Files
lemonade/src/components/TitleScreen.tsx
T
jcoffey-dev 71cbb02353 Add a persistent high score table
Retiring writes each player's closing balance to a top-ten table in
localStorage, reachable from the title screen and the standings, with
the summer just finished picked out in yellow.

Stored rows are user-editable, so every field is validated on load and
malformed entries are dropped. Storage being unavailable is a normal
case, not an error: the game plays on with an empty table.

Also stops the status line claiming DAY 00 on screens that have no day.
2026-09-08 15:29:35 -07:00

39 lines
972 B
TypeScript

import { Btn, Line } from './Crt'
import { bannerRows } from './logo'
const BANNER = bannerRows('LEMONADE')
export function TitleScreen({
onStart,
onInstructions,
onScores,
seed,
}: {
onStart: () => void
onInstructions: () => void
onScores: () => void
seed: number
}) {
return (
<div className="stack">
<pre className="banner" aria-label="LEMONADE">
{BANNER.join('\n')}
</pre>
<Line className="center accent">S T A N D</Line>
<Line />
<Line className="center">LEMONSVILLE, CALIFORNIA</Line>
<Line className="center dim">ATARI 8-BIT EDITION &middot; SEED {seed}</Line>
<Line />
<Line className="center blink">PRESS START</Line>
<Line />
<div className="row center">
<Btn kind="primary" onClick={onStart}>
START
</Btn>
<Btn onClick={onInstructions}>INSTRUCTIONS</Btn>
<Btn onClick={onScores}>HIGH SCORES</Btn>
</div>
</div>
)
}