The live demo starts when it’s in view.Spin the turret to choose a weight, then click the bench to drop it · Sound starts off
One event, felt everywhere: impact({ x, y, mass }) makes every [data-body] element dip, rock and ring down on its shock mounts by its distance and its own…
What it costs a frame
CPU
0.70 ms
02468101216.7 ms
GPU
not used
CPU, median
0.70 ms
CPU, 95th pct
1.24 ms
Draw calls
0
Weight
Moderate
Measured 14 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged CPU 0.68–0.81 ms). What ran: Measured with the demo dropping weights by itself from its first frame and every 0.35 s after, hot hits from brick to anvil at seeded spots, so through the whole run plates ring on their springs, hundreds of sparks bounce off their edges, dust spreads, rims glow and the turret turns to each weight. The system is stepped from the demo’s update(), so the CPU time is all of it: the clock, the springs’ transform writes, the spark simulation and the Canvas 2D drawing. No GPU of its own. Phones: tiers are being measured next.
apple · Apple A19 Proin a browser tab · 16 November 2026
not timed
0.76
1.60
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026
not timed
1.29
2.10
Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.
What it needs
Renders with
DOM and CSSPlain DOM and CSS: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages
What it’s for
Dashboards and control rooms where an alarm or a big number lands with weight
Games and toys: drops, slams and hits the interface itself feels
Drag and drop that lands heavily
A choice with a physical feel: a selector wheel, a carousel of modes
Animations that must be paused, stepped and replayed exactly (tests, captures, tutorials)
Pitfalls, in brief
The plates own their transform while they ring: a transform of your own on a [data-body] element is overwritten.
Plates are measured against the root at register() and on a resize of the root.
Hits come in client px (event.clientX and clientY).
The sparks layer is a canvas over the whole root at z-index 4: anything that must sit above it (a menu, a dialog) needs a higher z-index or to live outside the root.
Sound starts off and needs a click: call sound.power(true) from a click or a key press, never on load.
4 more in brief
Everything moves on the clock: pause() freezes the plates, sparks and turret mid-flight and advance(ms) steps them in fixed 1/60 s ticks, the same every time.
Under reduced motion (clock.calm) plates stay put and no sparks fly, but rims still glow and the turret still chooses (at once), so nothing that tells you something is lost.
The turret is a radiogroup: Tab reaches the chosen head, arrows and Home and End choose.
One frame loop runs only while something moves and stops by itself: do not drive the clock from a loop of your own as well, or it steps twice.
9 pitfalls in full, the hook-up guide, the module source and its tests come with the part.
Where it comes from
From HaTac. Fully custom code.
impactweightspringsshakesparksparticlescanvas 2dweb audiosoundtween clockdeterministicpause and stepdialspinnerdetentsinertiaradiogroupkeyboardtouchreduced motiondomno dependencies
One distance-field atlas holds a thin and a black cut of a typeface in its red and green channels, every glyph in the same fixed cell, so mixing the channels…