feat(nds): don't display help button and hints on smaller screens (they can't click on the buttons anyway)

This commit is contained in:
2026-02-22 22:50:24 +01:00
parent 8ac9911746
commit 0d5da308b9
2 changed files with 18 additions and 15 deletions

View File

@@ -1,23 +1,15 @@
<script setup lang="ts">
import gsap from "gsap";
import { useWindowSize } from "@vueuse/core";
const app = useAppStore();
const ndsScale = ref(1);
const hintsContainer = useTemplateRef<HTMLElement>("hintsContainer");
const windowSize = useWindowSize();
const hintsContainer = useTemplateRef("hintsContainer");
const updateScale = () => {
const scaleX = (window.innerWidth - 40) / 235;
const scaleY = (window.innerHeight - 40) / 431;
ndsScale.value = Math.min(scaleX, scaleY);
};
onMounted(() => {
updateScale();
window.addEventListener("resize", updateScale);
});
onUnmounted(() => {
window.removeEventListener("resize", updateScale);
const ndsScale = computed(() => {
const scaleX = (windowSize.width.value - 40) / 235;
const scaleY = (windowSize.height.value - 40) / 431;
return Math.min(scaleX, scaleY);
});
watch(

View File

@@ -1,4 +1,5 @@
<script setup lang="ts">
import { useWindowSize } from "@vueuse/core";
import gsap from "gsap";
const { isReady } = useAssets();
@@ -25,6 +26,16 @@ const toggleFullscreen = () => {
}
};
const windowSize = useWindowSize();
watch([windowSize.width, windowSize.height], ([width, height]) => {
if (width / height > 614 / 667) {
app.allowHints();
} else {
app.disallowHints();
}
});
const helpButton = useTemplateRef("helpButton");
let helpAnimation: gsap.core.Timeline | null = null;