chore: format

This commit is contained in:
2026-02-27 00:55:25 +01:00
parent 54958437c4
commit d11aae080a
10 changed files with 106 additions and 29 deletions

View File

@@ -42,7 +42,10 @@ onRender((ctx) => {
ctx.textBaseline = "top";
ctx.fillStyle = "#ffffff";
const rawText = typeof confirmationModal.text === "function" ? confirmationModal.text() : confirmationModal.text;
const rawText =
typeof confirmationModal.text === "function"
? confirmationModal.text()
: confirmationModal.text;
const lines = rawText.split("\n").slice(0, MAX_LINES);
const totalTextHeight = lines.length * LINE_HEIGHT;
const textStartY = BG_Y + Math.floor((BG_HEIGHT - totalTextHeight) / 2) - 2;

View File

@@ -70,15 +70,33 @@ onRender((ctx) => {
ctx.fillStyle = "#aaaaaa";
ctx.font = "7px NDS7";
fillTextHCentered(ctx, $t(`creditsScreen.${id}.label`), 0, y, LOGICAL_WIDTH);
fillTextHCentered(
ctx,
$t(`creditsScreen.${id}.label`),
0,
y,
LOGICAL_WIDTH,
);
ctx.fillStyle = "#ffffff";
ctx.font = "10px NDS10";
fillTextHCentered(ctx, $t(`creditsScreen.${id}.author`), 0, y + CREDITS_LINE_HEIGHT, LOGICAL_WIDTH);
fillTextHCentered(
ctx,
$t(`creditsScreen.${id}.author`),
0,
y + CREDITS_LINE_HEIGHT,
LOGICAL_WIDTH,
);
ctx.fillStyle = "#888888";
ctx.font = "7px NDS7";
fillTextHCentered(ctx, $t(`creditsScreen.${id}.url`), 0, y + CREDITS_LINE_HEIGHT * 2, LOGICAL_WIDTH);
fillTextHCentered(
ctx,
$t(`creditsScreen.${id}.url`),
0,
y + CREDITS_LINE_HEIGHT * 2,
LOGICAL_WIDTH,
);
}
ctx.globalAlpha = store.isIntro

View File

@@ -49,15 +49,33 @@ onRender((ctx) => {
ctx.fillStyle = "#aaaaaa";
ctx.font = "7px NDS7";
fillTextHCentered(ctx, $t(`creditsScreen.${id}.label`), 0, y, LOGICAL_WIDTH);
fillTextHCentered(
ctx,
$t(`creditsScreen.${id}.label`),
0,
y,
LOGICAL_WIDTH,
);
ctx.fillStyle = "#ffffff";
ctx.font = "10px NDS10";
fillTextHCentered(ctx, $t(`creditsScreen.${id}.author`), 0, y + CREDITS_LINE_HEIGHT, LOGICAL_WIDTH);
fillTextHCentered(
ctx,
$t(`creditsScreen.${id}.author`),
0,
y + CREDITS_LINE_HEIGHT,
LOGICAL_WIDTH,
);
ctx.fillStyle = "#888888";
ctx.font = "7px NDS7";
fillTextHCentered(ctx, $t(`creditsScreen.${id}.url`), 0, y + CREDITS_LINE_HEIGHT * 2, LOGICAL_WIDTH);
fillTextHCentered(
ctx,
$t(`creditsScreen.${id}.url`),
0,
y + CREDITS_LINE_HEIGHT * 2,
LOGICAL_WIDTH,
);
}
});

View File

@@ -15,14 +15,28 @@ const switch2d = () => {
</script>
<template>
<UModal :open="true" :dismissible="false" :title="$t('lagModal.title')" :ui="{ footer: 'justify-end' }">
<UModal
:open="true"
:dismissible="false"
:title="$t('lagModal.title')"
:ui="{ footer: 'justify-end' }"
>
<template #body>
{{ $t('lagModal.body') }}
{{ $t("lagModal.body") }}
</template>
<template #footer>
<UButton variant="ghost" color="neutral" :label="$t('lagModal.keep3d')" @click="keep3d" />
<UButton color="neutral" :label="$t('lagModal.switch2d')" @click="switch2d" />
<UButton
variant="ghost"
color="neutral"
:label="$t('lagModal.keep3d')"
@click="keep3d"
/>
<UButton
color="neutral"
:label="$t('lagModal.switch2d')"
@click="switch2d"
/>
</template>
</UModal>
</template>

View File

@@ -193,7 +193,9 @@ onMounted(() => {
canvas.value.addEventListener("click", handleCanvasClick);
canvas.value.addEventListener("mousedown", handleCanvasMouseDown);
canvas.value.addEventListener("wheel", handleCanvasWheel, { passive: true });
canvas.value.addEventListener("touchstart", handleTouchStart, { passive: false });
canvas.value.addEventListener("touchstart", handleTouchStart, {
passive: false,
});
canvas.value.addEventListener("touchend", handleTouchEnd, { passive: true });
canvas.value.addEventListener("mousedown", handleSwipeMouseDown);
canvas.value.addEventListener("mouseup", handleSwipeMouseUp);

View File

@@ -156,16 +156,28 @@ useKeyDown(({ key }) => {
switch (key) {
case "NDS_UP":
if (selectedRow > 0) { assets.audio.tinyClick.play(0.8); select(selectedCol, selectedRow - 1); }
if (selectedRow > 0) {
assets.audio.tinyClick.play(0.8);
select(selectedCol, selectedRow - 1);
}
break;
case "NDS_RIGHT":
if (selectedCol < GRID_SIZE - 1) { assets.audio.tinyClick.play(0.8); select(selectedCol + 1, selectedRow); }
if (selectedCol < GRID_SIZE - 1) {
assets.audio.tinyClick.play(0.8);
select(selectedCol + 1, selectedRow);
}
break;
case "NDS_DOWN":
if (selectedRow < GRID_SIZE - 1) { assets.audio.tinyClick.play(0.8); select(selectedCol, selectedRow + 1); }
if (selectedRow < GRID_SIZE - 1) {
assets.audio.tinyClick.play(0.8);
select(selectedCol, selectedRow + 1);
}
break;
case "NDS_LEFT":
if (selectedCol > 0) { assets.audio.tinyClick.play(0.8); select(selectedCol - 1, selectedRow); }
if (selectedCol > 0) {
assets.audio.tinyClick.play(0.8);
select(selectedCol - 1, selectedRow);
}
break;
}
});

View File

@@ -13,7 +13,11 @@ export const useKeyDown = (callback: KeyDownCallback) => {
if (app.lagModalOpen) return;
const ndsButton = mapCodeToNDS(event.code);
if (ndsButton && document.activeElement && document.activeElement !== document.body) {
if (
ndsButton &&
document.activeElement &&
document.activeElement !== document.body
) {
(document.activeElement as HTMLElement).blur();
}

View File

@@ -32,18 +32,18 @@ const isTouchDevice = () =>
const windowSize = useWindowSize();
const isLargeEnough = computed(
() => windowSize.width.value / windowSize.height.value > 614 / 667,
watch(
[windowSize.width, windowSize.height],
([width, height]) => {
if (width / height > 614 / 667) {
if (app.booted) app.allowHints();
} else {
app.disallowHints();
}
},
{ immediate: true },
);
watch([windowSize.width, windowSize.height], ([width, height]) => {
if (width / height > 614 / 667) {
if (app.booted) app.allowHints();
} else {
app.disallowHints();
}
}, { immediate: true });
const helpButton = useTemplateRef("helpButton");
let helpAnimation: gsap.core.Timeline | null = null;

View File

@@ -36,7 +36,10 @@ export const useIntroStore = defineStore("intro", {
() => {
const now = new Date();
const isBirthday = now.getMonth() === 3 && now.getDate() === 25;
(isBirthday ? assets.audio.birthdayStartup : assets.audio.startUp).play();
(isBirthday
? assets.audio.birthdayStartup
: assets.audio.startUp
).play();
},
undefined,
delay,

View File

@@ -37,7 +37,10 @@ export default defineNuxtConfig({
{ property: "og:image:type", content: "image/png" },
{ property: "og:image:width", content: "1200" },
{ property: "og:image:height", content: "630" },
{ property: "og:image:alt", content: "3D Nintendo DS home screen from pihkaal.me" },
{
property: "og:image:alt",
content: "3D Nintendo DS home screen from pihkaal.me",
},
{ property: "og:url", content: URL },
{ property: "og:site_name", content: TITLE },
{ property: "og:locale", content: "en-US" },