TRIAL 2026-11-18
  • TypeScript 96%
  • CSS 3.2%
  • HTML 0.6%
  • Shell 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Travis Johnson 259f08305d Add MIT license
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X3rSFQDJYjX6bGw3aeA4iy
2026-10-28 00:46:13 -05:00
scripts Refactor: split renderer and particle stepping; shortcuts, fullscreen, deploy 2026-09-23 10:54:47 -05:00
src Fix sound on iOS; honest mute button; tap-for-sound hint 2026-09-23 20:45:13 -05:00
test 3-2-1 countdown over the beacon when a bucket is about to tip 2026-09-23 10:55:52 -05:00
.gitignore Scaffold: vite + ts + vitest, design doc with component plan 2026-09-23 10:22:58 -05:00
DESIGN.md DESIGN.md: feature lists reflect what shipped; open ideas 2026-09-23 10:57:07 -05:00
index.html 3D view (lazy three.js) and live equations in the ∂ panel 2026-09-23 10:53:07 -05:00
LICENSE Add MIT license 2026-10-28 00:46:13 -05:00
package-lock.json Scaffold: vite + ts + vitest, design doc with component plan 2026-09-23 10:22:58 -05:00
package.json Scaffold: vite + ts + vitest, design doc with component plan 2026-09-23 10:22:58 -05:00
README.md Mobile layout, README, component table refresh 2026-09-23 10:56:54 -05:00
tsconfig.json Scaffold: vite + ts + vitest, design doc with component plan 2026-09-23 10:22:58 -05:00
vite.config.ts Refactor: split renderer and particle stepping; shortcuts, fullscreen, deploy 2026-09-23 10:54:47 -05:00

🪣 Big Bucket (bucketdump-sim)

A tipping-bucket water park simulator. The bucket fills, the beacon flashes, ding ding ding, 3… 2… 1…, SPLOOSH. Built for a 3-year-old operator and his applied-math dad. Live at https://tcj.io/bigbucket/.

npm install
npm run dev        # http://localhost:5173 (also on the LAN, for phones)
npm test           # 83 unit/headless tests (~10 s)
npm run build      # static site in dist/ (relative URLs; works from any subpath)
scripts/deploy.sh  # test + build + rsync to tcj.io:/var/www/tcj.io/bigbucket/  (--dry-run available)

For the operator (kid)

  • Big lever = how much water. Tap the 💧 to switch to acorns, balls, sand or slime.
  • DUMP! shoves the fullest bucket. You can also tap a bucket to dump it early.
  • 🐢 slow = slow motion. ⏸ pause, ↺ start over.
  • Scenes along the top; 🎲 makes up a brand-new park; 📺 demo plays by itself; 🎯 splash'em: soak the wandering crowd before the clock runs out.
  • 👁 glass buckets vs painted ones (can you guess when it'll tip?), 🌈 rainbow water, 🧊 3D.

For the dad

  • ⊕ com: fluid centroid, combined COM + plumb line, lever arm, torque arc, lip, brim level.
  • ▦ dash: V, V_tip, θ, ω, τ, I, stiffness k = −∂τ/∂θ, effective metacentric height GM, small-oscillation period, spill rate, ETA, verdict, V_ret.
  • ∂ plots: the governing ODEs with live numbers; the equilibrium set θ*(V) (stable green / unstable red) with the live trajectory tracing the hysteresis loop; the potential U(θ) with the bucket as a ball; the (θ, ω) phase portrait; θ(t) and V(t) for every bucket.
  • ✏️ design: drag things; the inspector re-solves the counterweight for a target tip fill, or turn auto-tune off and break it (overflows / stuck / unstable are diagnosed live). 🔗 share copies a URL with the whole park encoded.

Keys: space dump · s slow · p pause · r random · g glass · c COM · b dashboard · d plots · m mute · 3 3D · f fullscreen.

The model (short version — see DESIGN.md)

Rigid bucket on an axle; fluid is quasi-static (free surface ⟂ g), solved exactly as a polygon clip with bisection on the level. I(θ,V)·θ̈ = τ(θ,V) − c·θ̇, overflow drains over the lower lip at the 2D weir rate ⅔·Cd·√(2g)·H^{3/2} and becomes particles that can land in other buckets. Tipping is a saddle-node fold of the equilibrium branch — the empty bucket rests on a stop held by its counterweight, the fill pushes the torque at the stop through zero, and it snaps over. It's the same free-surface destabilisation that capsizes ships (the bucket even has a GM).