Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind
full screen #141
Check · Review · Land · Live done — Landed and live in production.
Pushed. Tests: 631 pass, 0 fail (`bun test`), and a fresh `bun run build` matches the committed bundles.
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
Pushed. Tests: 631 pass, 0 fail (
bun test), and a freshbun run buildmatches the committed bundles.The stage — the box both canvases, the HUD, the touch pads and the overlays live in — now goes on the whole screen, in all three games, with the same two gestures: a button in its top corner and a key (F in the shooter and the example, G in the range, because F is the range's trigger).
src/engine/fullscreen.tsis the new module behind the door and the whole of what a game needs around the Fullscreen API:supported, so a browser that will not put an element full screen — an iPhone will not — leaves the button hidden instead of shipping one that does nothing;on, read from the document every time rather than remembered, because a person leaves with Escape and no code of ours runs;enter,exit,toggle,onChange,detach; and a refusal (no gesture, a policy, a browser that throws where it should reject) swallowed rather than thrown. The shell renders#fulllast in the stage so it paints over the overlays, and renders ithiddenbecause it is the one control on the page that does nothing without a script — each entry reveals it once it has asked its browser — and the style block puts back every rule that sized the stage (the 16:9 box, the phone's 4:3, the 78vh cap, the border) when the stage is the screen.Worth a look in the preview: press F on
/, G on/range, F on/example, and the button on each — the label, the title andaria-pressedfollow the state, including when you leave with Escape. On a phone the button is the only way in and it is the 44px target every other control here is. What I did not do: Play does not put you full screen by itself, because a click that takes over the screen without being asked is worse than a key; and if your browser hands the pointer back on the switch mid-match, the existing pause screen appears and Resume takes it again — that path is unchanged. The range's and the example's size ceilings are raised to today's size plus about 10%, the way every other number insrc/games.tswas set, and the reason is written beside them: this is the first module behind the door that is code a browser actually runs, so all three bundles grew about a kilobyte (app 73,130 raw / 33,948 gzipped, range 29,975 / 12,704, example 9,735 / 4,620). No dependency was added. The app's terminal is unchanged: full screen is a browser affordance and there is nothing on/it makes reachable thatsrc/tty.tsdoes not already show.🤖 Generated with Claude Code
Closes #132