feat: centralize all screen related callbacks in useScreen

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

View File

@@ -1,9 +1,10 @@
<script setup lang="ts">
const store = useContactStore();
const { onRender } = useScreen();
const store = useContactStore();
const { assets } = useAssets();
useRender((ctx) => {
onRender((ctx) => {
ctx.drawImage(assets.home.bottomScreen.background, 0, 0);
ctx.globalAlpha = store.isIntro
? store.intro.stage2Opacity

View File

@@ -1,9 +1,10 @@
<script setup lang="ts">
const store = useContactStore();
const { onRender } = useScreen();
const store = useContactStore();
const { assets } = useAssets();
useRender((ctx) => {
onRender((ctx) => {
ctx.globalAlpha = store.isIntro
? store.intro.stage3Opacity
: store.outro.stage1Opacity;

View File

@@ -1,9 +1,10 @@
<script setup lang="ts">
const store = useContactStore();
const { onRender } = useScreen();
const store = useContactStore();
const { assets } = useAssets();
useRender((ctx) => {
onRender((ctx) => {
ctx.drawImage(assets.home.topScreen.background, 0, 0);
ctx.globalAlpha = store.isIntro
? store.intro.stage2Opacity

View File

@@ -1,9 +1,10 @@
<script setup lang="ts">
const store = useContactStore();
const { onRender } = useScreen();
const store = useContactStore();
const { assets } = useAssets();
useRender((ctx) => {
onRender((ctx) => {
ctx.globalAlpha = store.isIntro
? store.intro.stage1Opacity
: store.outro.stage2Opacity;

View File

@@ -1,10 +1,11 @@
<script setup lang="ts">
const { onRender } = useScreen();
// text color:
const store = useContactStore();
const { assets } = useAssets();
useRender((ctx) => {
onRender((ctx) => {
ctx.globalAlpha = store.outro.stage2Opacity;
ctx.font = "10px NDS10";