fuzzyworld

nuts / shampoo / files / README.md

Branch shampoo · default branch · all branches

README.md

Blame: the commit that last changed each line · file · history

44eb5832 2026-04-12 Pavel Safronov1# nuts
2
3> A phone-focused full-screen toy: a box of hex nuts bouncing around with haptic feedback.
4
92192937 2026-06-07 Pavel Safronov5[Play with it!](https://pavelsafronov.gitlab.io/nuts)
6
44eb5832 2026-04-12 Pavel Safronov7## Features
8
9- **Physics** — [Matter.js](https://brm.io/matter-js/) 2D rigid-body simulation
10- **Haptics** — Web Vibration API fires on every wall impact (intensity scales with collision speed)
11- **Tilt gravity** — Device orientation rotates the gravity vector so nuts roll as you tilt your phone
12- **Shake** — DeviceMotion events detect shakes and punt all nuts with a random impulse + double-vibrate
13- **Configurable** — Slider to set 1–50 nuts; reset positions on demand
14- **Offline-ready** — No server, no data, runs entirely in the browser
15
16## Tech stack
17
18- [pnpm](https://pnpm.io/) + [TypeScript](https://www.typescriptlang.org/)
19- [Vite](https://vitejs.dev/) — dev server and bundler
20- [Matter.js](https://brm.io/matter-js/) — 2D physics engine
21
22## Development
23
24```bash
25pnpm install
26pnpm dev # http://localhost:5173
27pnpm build # production bundle → dist/
28pnpm preview # preview dist/ build
29```
30
31## Deployment
32
33Hosted on GitLab Pages via `.gitlab-ci.yml`. Pushes to the default branch trigger a build and publish `dist/` as the Pages site.
34
35If your project is in a GitLab group/subgroup the Vite `base: './'` config ensures assets resolve correctly under the Pages sub-path.