feat(gallery): transition to and from the nds
This commit is contained in:
31
app/components/Gallery/TopScreen/TopScreen.vue
Normal file
31
app/components/Gallery/TopScreen/TopScreen.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
const { onRender } = useScreen();
|
||||
const store = useGalleryStore();
|
||||
const { assets } = useAssets();
|
||||
|
||||
onMounted(() => {
|
||||
if (store.shouldAnimateOutro) {
|
||||
store.shouldAnimateOutro = false;
|
||||
store.animateOutro();
|
||||
} else {
|
||||
store.$reset();
|
||||
store.animateIntro();
|
||||
}
|
||||
});
|
||||
|
||||
onRender((ctx) => {
|
||||
ctx.drawImage(assets.home.topScreen.background, 0, 0);
|
||||
|
||||
ctx.fillStyle = "#000000";
|
||||
ctx.globalAlpha = store.isIntro
|
||||
? store.intro.fadeOpacity
|
||||
: store.isOutro
|
||||
? store.outro.fadeOpacity
|
||||
: 0;
|
||||
ctx.fillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div />
|
||||
</template>
|
||||
Reference in New Issue
Block a user