chore: format
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user