chore: format
This commit is contained in:
@@ -42,7 +42,10 @@ onRender((ctx) => {
|
|||||||
ctx.textBaseline = "top";
|
ctx.textBaseline = "top";
|
||||||
ctx.fillStyle = "#ffffff";
|
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 lines = rawText.split("\n").slice(0, MAX_LINES);
|
||||||
const totalTextHeight = lines.length * LINE_HEIGHT;
|
const totalTextHeight = lines.length * LINE_HEIGHT;
|
||||||
const textStartY = BG_Y + Math.floor((BG_HEIGHT - totalTextHeight) / 2) - 2;
|
const textStartY = BG_Y + Math.floor((BG_HEIGHT - totalTextHeight) / 2) - 2;
|
||||||
|
|||||||
@@ -70,15 +70,33 @@ onRender((ctx) => {
|
|||||||
|
|
||||||
ctx.fillStyle = "#aaaaaa";
|
ctx.fillStyle = "#aaaaaa";
|
||||||
ctx.font = "7px NDS7";
|
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.fillStyle = "#ffffff";
|
||||||
ctx.font = "10px NDS10";
|
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.fillStyle = "#888888";
|
||||||
ctx.font = "7px NDS7";
|
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
|
ctx.globalAlpha = store.isIntro
|
||||||
|
|||||||
@@ -49,15 +49,33 @@ onRender((ctx) => {
|
|||||||
|
|
||||||
ctx.fillStyle = "#aaaaaa";
|
ctx.fillStyle = "#aaaaaa";
|
||||||
ctx.font = "7px NDS7";
|
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.fillStyle = "#ffffff";
|
||||||
ctx.font = "10px NDS10";
|
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.fillStyle = "#888888";
|
||||||
ctx.font = "7px NDS7";
|
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,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,28 @@ const switch2d = () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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>
|
<template #body>
|
||||||
{{ $t('lagModal.body') }}
|
{{ $t("lagModal.body") }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<UButton variant="ghost" color="neutral" :label="$t('lagModal.keep3d')" @click="keep3d" />
|
<UButton
|
||||||
<UButton color="neutral" :label="$t('lagModal.switch2d')" @click="switch2d" />
|
variant="ghost"
|
||||||
|
color="neutral"
|
||||||
|
:label="$t('lagModal.keep3d')"
|
||||||
|
@click="keep3d"
|
||||||
|
/>
|
||||||
|
<UButton
|
||||||
|
color="neutral"
|
||||||
|
:label="$t('lagModal.switch2d')"
|
||||||
|
@click="switch2d"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</UModal>
|
</UModal>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -193,7 +193,9 @@ onMounted(() => {
|
|||||||
canvas.value.addEventListener("click", handleCanvasClick);
|
canvas.value.addEventListener("click", handleCanvasClick);
|
||||||
canvas.value.addEventListener("mousedown", handleCanvasMouseDown);
|
canvas.value.addEventListener("mousedown", handleCanvasMouseDown);
|
||||||
canvas.value.addEventListener("wheel", handleCanvasWheel, { passive: true });
|
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("touchend", handleTouchEnd, { passive: true });
|
||||||
canvas.value.addEventListener("mousedown", handleSwipeMouseDown);
|
canvas.value.addEventListener("mousedown", handleSwipeMouseDown);
|
||||||
canvas.value.addEventListener("mouseup", handleSwipeMouseUp);
|
canvas.value.addEventListener("mouseup", handleSwipeMouseUp);
|
||||||
|
|||||||
@@ -156,16 +156,28 @@ useKeyDown(({ key }) => {
|
|||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case "NDS_UP":
|
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;
|
break;
|
||||||
case "NDS_RIGHT":
|
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;
|
break;
|
||||||
case "NDS_DOWN":
|
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;
|
break;
|
||||||
case "NDS_LEFT":
|
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;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,7 +13,11 @@ export const useKeyDown = (callback: KeyDownCallback) => {
|
|||||||
if (app.lagModalOpen) return;
|
if (app.lagModalOpen) return;
|
||||||
|
|
||||||
const ndsButton = mapCodeToNDS(event.code);
|
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();
|
(document.activeElement as HTMLElement).blur();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,18 +32,18 @@ const isTouchDevice = () =>
|
|||||||
|
|
||||||
const windowSize = useWindowSize();
|
const windowSize = useWindowSize();
|
||||||
|
|
||||||
const isLargeEnough = computed(
|
watch(
|
||||||
() => windowSize.width.value / windowSize.height.value > 614 / 667,
|
[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");
|
const helpButton = useTemplateRef("helpButton");
|
||||||
let helpAnimation: gsap.core.Timeline | null = null;
|
let helpAnimation: gsap.core.Timeline | null = null;
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ export const useIntroStore = defineStore("intro", {
|
|||||||
() => {
|
() => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const isBirthday = now.getMonth() === 3 && now.getDate() === 25;
|
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,
|
undefined,
|
||||||
delay,
|
delay,
|
||||||
|
|||||||
@@ -37,7 +37,10 @@ export default defineNuxtConfig({
|
|||||||
{ property: "og:image:type", content: "image/png" },
|
{ property: "og:image:type", content: "image/png" },
|
||||||
{ property: "og:image:width", content: "1200" },
|
{ property: "og:image:width", content: "1200" },
|
||||||
{ property: "og:image:height", content: "630" },
|
{ 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:url", content: URL },
|
||||||
{ property: "og:site_name", content: TITLE },
|
{ property: "og:site_name", content: TITLE },
|
||||||
{ property: "og:locale", content: "en-US" },
|
{ property: "og:locale", content: "en-US" },
|
||||||
|
|||||||
Reference in New Issue
Block a user