feat(assets): new assets loading system (currently only for images)

This commit is contained in:
2025-12-17 12:28:48 +01:00
parent 05398d5252
commit b85899617b
106 changed files with 359 additions and 366 deletions

View File

@@ -1,12 +1,10 @@
<script setup lang="ts">
import CLOCK_IMAGE from "/assets/images/home/top-screen/clock.webp";
const CENTER_X = 63;
const CENTER_Y = 95;
const store = useHomeStore();
const [clockImage] = useImages(CLOCK_IMAGE);
const { assets } = useAssets();
function drawLine(
ctx: CanvasRenderingContext2D,
@@ -59,7 +57,7 @@ useRender((ctx) => {
: store.isOutro && store.outro.animateTop
? store.outro.stage1Opacity
: 1;
ctx.drawImage(clockImage!, 13, 45);
ctx.drawImage(assets.home.topScreen.clock, 13, 45);
ctx.globalAlpha = store.isIntro
? store.intro.stage1Opacity