feat: require click on the loading screen, and make intro animation faster
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
const { onRender } = useScreen();
|
||||
const { assets } = useAssets();
|
||||
const store = useIntroStore();
|
||||
|
||||
const frames = Object.keys(assets.images.intro.logoAnimated).sort();
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
const app = useAppStore();
|
||||
const { isReady } = useAssets();
|
||||
const { t } = useI18n();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="fixed inset-0 bg-[#181818] flex items-center justify-center">
|
||||
<div
|
||||
class="fixed inset-0 bg-[#181818] flex flex-col items-center justify-center gap-4"
|
||||
:class="{ 'cursor-pointer': isReady }"
|
||||
@click="isReady && (app.userHasInteracted = true)"
|
||||
>
|
||||
<svg
|
||||
viewBox="0 0 512 512"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="size-20 animate-pulse"
|
||||
class="size-20 transition-[fill] duration-500 animate-pulse"
|
||||
:style="{ fill: isReady ? '#888888' : '#2a2a2a' }"
|
||||
>
|
||||
<g fill="#2a2a2a">
|
||||
<g>
|
||||
<path
|
||||
d="M488,32c0-17.645-14.355-32-32-32H56C38.355,0,24,14.355,24,32v215c0,0.113,0.012,0.223,0.017,0.334
|
||||
C24.011,247.556,24,247.777,24,248c0,7.331,3.307,13.9,8.504,18.306C27.23,272.013,24,279.635,24,288v192c0,17.645,14.355,32,32,32
|
||||
@@ -99,6 +110,13 @@
|
||||
/>
|
||||
</g>
|
||||
</svg>
|
||||
<span
|
||||
class="select-none transition-colors duration-500 animate-pulse"
|
||||
:style="{ color: isReady ? '#888888' : '#2a2a2a', fontFamily: 'NDS10' }"
|
||||
>
|
||||
{{
|
||||
isReady ? t("loadingScreen.clickToStart") : t("loadingScreen.loading")
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -614,6 +614,10 @@ const handleTouchEnd = (event: TouchEvent) => {
|
||||
onMounted(() => {
|
||||
app.ready = true;
|
||||
|
||||
if (app.userHasInteracted) {
|
||||
animateIntro();
|
||||
}
|
||||
|
||||
if (renderer) {
|
||||
renderer.instance.domElement.addEventListener("mousedown", handleMouseDown);
|
||||
renderer.instance.domElement.addEventListener("click", handleClick);
|
||||
|
||||
Reference in New Issue
Block a user