chore: format

This commit is contained in:
2026-02-27 00:55:25 +01:00
parent 2ac77bdb30
commit a2b0314bd7
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;
}
});