À Ras Bord
Your phone becomes a glass filled to the brim: whatever you do, don't spill
The phone becomes a glass filled to the brim: tilt it and the liquid leans, shake it and it sloshes, and whatever spills over is gone for good. Play solo for 60 seconds ("Hold steady") or pass the phone from hand to hand among friends ("The round"), with a forfeit for whoever comes last. The light on the table is computed by refraction from the same simulated surface as the liquid.
What shines
- Physically computed caustic: rays are refracted through the liquid's surface (Snell's law, n = 1.36) and projected onto the table, so the patch of light streaks when the liquid sloshes
- Hand-written liquid physics (damped spring, two harmonics, overflow), a fixed-step 120 Hz loop, invariants tested with Vitest
- Canvas 2D rendering with no textures at all: meniscus, refraction, condensation, drops and the glass rim all follow from the simulation
- "The round" mode: up to 8 players on a single phone, 10 s each, the liquid keeps moving while the phone changes hands, then a ranking and a final forfeit
- Sensor reading designed for both iOS and Android: gravity rebuilt from beta and gamma, calibration relative to the starting position
How to use it
Open it on a phone, choose "Hold steady" or "The round", confirm your starting position, then hold the glass without spilling anything; on a computer, scan the QR code.
Made with
- Svelte 5 (runes)
- TypeScript
- Vite
- Canvas 2D
- DeviceOrientation API
- DeviceMotion API
- Vibration API
- Vitest
- qrcode-generator
- @vitejs/plugin-basic-ssl
- GitHub Actions / GitHub Pages
- Google Fonts