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,8 +1,9 @@
<script setup lang="ts">
import gsap from "gsap";
const store = useProjectsStore();
const { onRender, onClick } = useScreen();
const store = useProjectsStore();
const { assets } = useAssets();
const CLICK_RADIUS = 22;
@@ -78,7 +79,7 @@ const startButtonAnimation = (type: ButtonType) => {
});
};
useScreenClick((x, y) => {
onClick((x, y) => {
if (
currentAnimation ||
store.isIntro ||
@@ -111,7 +112,7 @@ useScreenClick((x, y) => {
}
});
useRender((ctx) => {
onRender((ctx) => {
// Draw disabled buttons
if (store.currentProject === 0) {
ctx.drawImage(