TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/player-one/llms.txt
Use this file to discover all available pages before exploring further.
HUD component mimics the persistent status bar found on classic arcade cabinets. It sits at the very top of the viewport as a fixed, non-interactive overlay, displaying a collection of game-style readouts — player tag, score, credits, a coin prompt, and a live clock — all set in the font-pixel typeface (Press Start 2P). Because it carries pointer-events-none, it never intercepts clicks intended for content below.
Visual Layout
The HUD is divided into two horizontal groups anchored to the left and right edges of the top bar.Left Group
| Element | Value | Color |
|---|---|---|
| Terminal icon + label | PLAYER_1 | Lime (#a3ff12) |
| Score readout | SCORE: 999999 | Cyan (#00ffff) |
Right Group
| Element | Value | Color |
|---|---|---|
| Insert prompt | INSERT COIN | Magenta (#ff00aa), pulsing |
| Coins icon + credits | CREDITS: 0 | Orange (#ff6600) |
| Live clock | HH:MM:SS (24 h) | Lime, opacity-50 |
Usage
The HUD has no props. All values (player name, score, credits) are hard-coded display constants. Only the clock is dynamic.
Live Clock Behavior
The clock is the HUD’s sole reactive element. On mount, auseState hook captures new Date() as the initial value, and a setInterval fires every 1 000 ms to replace it with a fresh Date object. The interval is cleared in the useEffect cleanup function to prevent memory leaks on unmount.
Time is formatted with:
hour12: false option forces 24-hour notation regardless of the user’s locale settings, keeping the display consistent across all environments.
Implementation Notes
Where It’s Used
HUD is rendered once in the root layout component, alongside CRTOverlay and Navigation, so it persists on every page without re-mounting during client-side route transitions. The pt-24 padding applied by PageTransition ensures page content begins below the HUD’s height.