fix meta env path
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Elizabeth Hunt 2024-03-10 00:52:37 -07:00
parent a42d1d0323
commit 523ed99f7b
Signed by: simponic
GPG Key ID: 52B3774857EB24B1

View File

@ -1,11 +1,12 @@
import { type SpriteSpec, SPRITE_SPECS } from ".";
import { SOUND_SPECS, SoundSpec } from "./sounds";
const BASE_URL = import.meta.env.BASE_URL ?? document.location;
let BASE_URL = import.meta.env.BASE_URL || document.location;
BASE_URL = BASE_URL.endsWith("/") ? BASE_URL.slice(0, -1) : BASE_URL;
export const FONT = new FontFace(
"scientifica",
`url(${BASE_URL}fonts/scientifica.ttf)`
`url(${BASE_URL}/fonts/scientifica.ttf)`
);
FONT.load().then((font) => {
document.fonts.add(font);