Public: anyone can read this; the crew can change it.

forked from trevato/cs

Take updates from trevato/cs #361

Merged opened this in answer to

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

Merged

This merges trevato/cs `main` (144285e, staged at `refs/following/main`). Where the two sides disagree, this repository's direction wins. Three upstream changes are rebuilt on this repo's engine because their files have drifted too far apart to merge as-is. Each is its own commit, so review them one at a time:

shipped production is serving it deploy ae07c2d

opened this

This merges trevato/cs main (144285e, staged at refs/following/main). Where the two sides disagree, this repository's direction wins. Three upstream changes are rebuilt on this repo's engine because their files have drifted too far apart to merge as-is. Each is its own commit, so review them one at a time:

  • #214, the gun comes up over its own draw (7e5298d): after a switch the gun rises in view over its deploy time, and the ammo count is dim until it can fire. The rise lives in src/client/scene.ts, the dim ammo in hud.ts.
  • #212, a hit that kills is an X, held longer (2648395): this now happens for grenade kills too, not just bullets. world.ts records a grenade hit that lands, and hud.ts draws the kill mark.
  • #217, reduced motion only where it is decoration (f1ea1f6):

- A new module, src/client/motion.ts, holds the two values and checks the input. - The menu has a new Motion select next to Sensitivity. It starts at whatever (prefers-reduced-motion: reduce) says, and a match reads it when it starts, the same way it reads the sensitivity. - Reduced does exactly two things: the gun stops swaying as you walk (scene.ts), and the red "hit from this direction" arc holds its strength and then disappears instead of fading (hud.ts). - The recoil kick, the gun's raise, the crosshair spread, the pain flash, the tracers and the kill feed are the same on both settings. There's a test that fails if Reduced ever changes the kick or the raise. - The fake page's matchMedia (src/engine/page.ts) now answers each media query separately, so tests can ask about reduced motion without also getting a phone.

What I left out:

  • Upstream stores Motion in settings.ts and also puts it in a pause-overlay control that applies on the next frame. This repo reads its menu fields when a match starts and saves none of them, so Motion does the same here. Saving it and adding a pause-overlay copy can come later if wanted.
  • The Motion select has no selected attribute. Full is simply the first option, which a browser picks by default. That keeps selected for the map select only, which two existing tests in src/server.test.ts expect. No existing test was changed.
  • Upstream's README test for this section isn't ported, because this repo has no readme.test.ts. The README gets the new paragraph under Playing and a motion entry in the module list.

bun run test passes (1440 tests), and the booted app serves the Motion control on /.

To try it: open the preview and walk around with Motion on Full, then on Reduced. The gun should sway only on Full. Get shot on each: on Reduced the red arc stays at full strength until it disappears. Turning on your system's reduce-motion setting makes the menu start at Reduced.

🤖 Generated with Claude Code

Closes #359

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs