Split The code is public; the app answers only to the crew.

Play it fullscreen: the view and the touch pad together, on a phone and on a laptop #62

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pushed. Here's the summary: Adds a Fullscreen control to the menu and the pause overlay that fullscreens #wrapper — the element holding both #stage and #touch — never #stage alone, so a phone in fullscreen keeps its pad.

Notes

shipped merged

opened this

Pushed. Here's the summary:

Adds a Fullscreen control to the menu and the pause overlay that fullscreens #wrapper — the element holding both #stage and #touch — never #stage alone, so a phone in fullscreen keeps its pad.

  • src/client/fullscreen.ts: a pure fullscreenControl(supported, active) deciding whether the button shows, its label ("Fullscreen" / "Exit fullscreen") and aria-pressed, plus a thin attachFullscreen that wires one or more buttons (menu's and pause's are the same switch) to fullscreenchange, and calls back only when the wrapper itself drops out of fullscreen — wired in main.ts to run the same pause the game already does on a lost pointer lock, so Esc never leaves a match running unpaused.
  • src/pages/game.ts: wraps #stage/#touch in #wrapper, adds the two buttons (hidden by default, shown by JS only when document.fullscreenEnabled), and CSS so that in fullscreen the view fills the space above the pad (letterboxing math is unnecessary — the renderer already recomputes FOV/aspect from the box's real pixel size every frame, so nothing stretches) while the pad sits at the bottom with env(safe-area-inset-bottom) padding.
  • Tests: fullscreen.test.ts for the pure decision's three cases, pages/game.test.ts asserting the wrapper contains both #stage and #touch in that order and that both buttons exist. bun test is green (252 pass).
  • Left out, per the issue: orientation lock, and any auto-fullscreen on Play.

Not tested in an actual browser (no display here) — worth checking the preview at 360×640 and 1280×800, in and out of fullscreen, with the pause overlay up, and confirming pointer lock still works inside fullscreen on desktop.

Closes #51

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs