feat: centralize all screen related callbacks in useScreen

This commit is contained in:
2025-12-29 21:01:19 +01:00
parent e9412a2e20
commit f60fb3625c
42 changed files with 184 additions and 128 deletions

View File

@@ -1,12 +1,13 @@
<script setup lang="ts">
const CENTER_X = 63;
const CENTER_Y = 95;
const { onRender } = useScreen();
const app = useAppStore();
const store = useHomeStore();
const { assets } = useAssets();
const CENTER_X = 63;
const CENTER_Y = 95;
function drawLine(
ctx: CanvasRenderingContext2D,
x0: number,
@@ -52,7 +53,7 @@ function drawLine(
}
}
useRender((ctx) => {
onRender((ctx) => {
ctx.globalAlpha = store.isIntro
? store.intro.stage1Opacity
: store.isOutro && store.outro.animateTop