Skip to content

Commit ffe7353

Browse files
committed
feat: improve UI
1 parent e777b74 commit ffe7353

2 files changed

Lines changed: 32 additions & 10 deletions

File tree

frontend/app/globals.css

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,18 @@ canvas {
211211
will-change: height, transform;
212212
}
213213

214-
/* Before play: a panel filling the bottom half, behind which the canvas shows
215-
the "click anywhere to start" prompt. Slides up on first paint. */
214+
/* Before play: a panel anchored to the bottom, only as tall as its content,
215+
behind which the canvas shows the "click anywhere to start" prompt. Slides up
216+
on first paint. */
216217
.menu.is-panel {
217-
height: 54vh;
218-
padding: clamp(16px, 3vh, 32px) 24px;
218+
height: auto;
219+
max-height: 82vh;
220+
padding: clamp(16px, 3vh, 32px) 24px clamp(20px, 4vh, 40px);
219221
overflow-y: auto;
220222
background: linear-gradient(
221223
to top,
222224
rgba(9, 4, 24, 0.96),
223-
rgba(20, 9, 46, 0.86) 60%,
225+
rgba(20, 9, 46, 0.86) 70%,
224226
rgba(20, 9, 46, 0)
225227
);
226228
animation: menu-rise 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
@@ -310,8 +312,9 @@ canvas {
310312
display: flex;
311313
align-items: center;
312314
justify-content: center;
313-
/* Centre the prompt in the top portion, above the bottom-half panel. */
314-
padding-bottom: 54vh;
315+
/* Bias the prompt toward the upper area so it sits clear of the bottom panel
316+
(which is only as tall as its content). */
317+
padding-bottom: clamp(200px, 30vh, 380px);
315318
cursor: pointer;
316319
}
317320

@@ -334,6 +337,25 @@ canvas {
334337
opacity: 0.85;
335338
}
336339

340+
/* Short screens: the bottom panel would leave no room for the prompt above it
341+
(they'd overlap), so centre the menu like a modal and drop the prompt — the
342+
click-to-start target still covers everything outside the centred card. */
343+
@media (max-height: 640px) {
344+
.start-menu-prompt {
345+
display: none;
346+
}
347+
.menu.is-panel {
348+
top: 0;
349+
max-height: 100%;
350+
align-items: center;
351+
background: radial-gradient(
352+
circle at 50% 45%,
353+
rgba(40, 18, 82, 0.62),
354+
rgba(9, 4, 24, 0.94)
355+
);
356+
}
357+
}
358+
337359
.menu-card {
338360
width: min(600px, 100%);
339361
text-align: center;

frontend/app/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { trackEvent } from "./analytics";
2424
* KeyParty — a key-smashing game for kids.
2525
*
2626
* The app opens full-screen at a "menu" shown as a panel in the bottom half,
27-
* with a "Click anywhere to start" prompt over the canvas above it. Starting asks
27+
* with a "Click to start" prompt over the canvas above it. Starting asks
2828
* the native shell (see native/appkit_host.m) to enter kiosk mode: full-screen,
2929
* with a global event tap that swallows every OS shortcut so nothing the child
3030
* presses can quit the game, switch apps, or poke the operating system. Swallowed
@@ -1569,7 +1569,7 @@ export default function Home() {
15691569
{mode === "menu" && (
15701570
<div className="start-catcher" onClick={handleStart}>
15711571
<div className="start-menu-prompt">
1572-
Click anywhere to start
1572+
Click to start
15731573
<small><PartyTrio /></small>
15741574
</div>
15751575
</div>
@@ -1688,7 +1688,7 @@ export default function Home() {
16881688
{showWebNote && (
16891689
<div className="web-note">
16901690
<span className="access-line">
1691-
<GiWorld className="inline-icon" /> You’re playing in the browser. Key Party works best as the desktop app —
1691+
You’re playing in the browser. Key Party works best as the desktop app —
16921692
the browser can’t lock the keyboard, so a child can still press a shortcut and
16931693
slip out of the game.
16941694
</span>

0 commit comments

Comments
 (0)