fuzzyworld

bubbles / files / README.md

README.md

2.5 KB ยท history ยท blame

Bubbles

Your phone is a glass of water.

Tilt to slosh. Tap to drop things in. Some float. Some sink.

Live demo: https://apps.fuzzyworld.net/bubbles/

Repository: https://code.fuzzyworld.net/bubbles/ (git clone https://code.fuzzyworld.net/bubbles.git)


What it does

Action Result
Tilt phone left/right Water sloshes toward the low side
Tilt past ~45ยฐ Water spills over the rim (permanently lost)
Tap anywhere A random object drops into the water
Desktop Move mouse left/right to simulate tilt

Objects

Icon Density Behaviour
๐Ÿ“ Ping pong 0.10 Bobs wildly on the surface
๐Ÿฆ† Duck 0.50 Floats high
๐ŸŽ Apple 0.80 Floats
๐Ÿ‹ Lemon 0.85 Floats
๐ŸงŠ Ice 0.92 Barely floats
๐ŸŸ Fish 1.05 Barely sinks
๐Ÿชจ Rock 2.60 Sinks
๐Ÿ’Ž Gem 3.50 Sinks
โš“ Anchor 7.50 Sinks fast
๐Ÿ”ฉ Bolt 7.80 Sinks fast

Max 12 objects at a time โ€” the oldest is removed when you add a 13th.


Tech

Physics: - 1-D column wave simulation (80 columns, spring-coupled) - Buoyancy via submerged fraction of circle cross-section - Elastic damped circle vs. circle + wall collisions - DeviceOrientationEvent for real tilt; mouse fallback on desktop


Development

# Install dependencies
pnpm install

# Generate favicons and og-image from wind.png
pnpm gen-assets

# Start dev server
pnpm dev

# Type-check + production build
pnpm build

Output goes to dist/.


Deploy

pnpm run deploy

fw deploy (from fuzzyworld-tools) builds a fresh clone of main:

pnpm install โ†’ pnpm gen-assets โ†’ pnpm build โ†’ upload dist/

and publishes it at https://apps.fuzzyworld.net/bubbles/


Attribution

Wind icon by Icongeek26 from Flaticon.

Source
1# Bubbles
2
3Your phone is a glass of water.
4
5Tilt to slosh. Tap to drop things in. Some float. Some sink.
6
7**Live demo:** https://apps.fuzzyworld.net/bubbles/
8
9**Repository:** https://code.fuzzyworld.net/bubbles/ (`git clone https://code.fuzzyworld.net/bubbles.git`)
10
11---
12
13## What it does
14
15| Action | Result |
16| --------------------- | -------------------------------------------- |
17| Tilt phone left/right | Water sloshes toward the low side |
18| Tilt past ~45ยฐ | Water spills over the rim (permanently lost) |
19| Tap anywhere | A random object drops into the water |
20| Desktop | Move mouse left/right to simulate tilt |
21
22### Objects
23
24| Icon | Density | Behaviour |
25| ----------- | ------- | -------------------------- |
26| ๐Ÿ“ Ping pong | 0.10 | Bobs wildly on the surface |
27| ๐Ÿฆ† Duck | 0.50 | Floats high |
28| ๐ŸŽ Apple | 0.80 | Floats |
29| ๐Ÿ‹ Lemon | 0.85 | Floats |
30| ๐ŸงŠ Ice | 0.92 | Barely floats |
31| ๐ŸŸ Fish | 1.05 | Barely sinks |
32| ๐Ÿชจ Rock | 2.60 | Sinks |
33| ๐Ÿ’Ž Gem | 3.50 | Sinks |
34| โš“ Anchor | 7.50 | Sinks fast |
35| ๐Ÿ”ฉ Bolt | 7.80 | Sinks fast |
36
37Max 12 objects at a time โ€” the oldest is removed when you add a 13th.
38
39---
40
41## Tech
42
43- TypeScript + Canvas 2D API (no framework, no WebGL)
44- Vite for bundling
45- pnpm for package management
46- Static hosting at apps.fuzzyworld.net (no server)
47
48Physics:
49- 1-D column wave simulation (80 columns, spring-coupled)
50- Buoyancy via submerged fraction of circle cross-section
51- Elastic damped circle vs. circle + wall collisions
52- `DeviceOrientationEvent` for real tilt; mouse fallback on desktop
53
54---
55
56## Development
57
58```sh
59# Install dependencies
60pnpm install
61
62# Generate favicons and og-image from wind.png
63pnpm gen-assets
64
65# Start dev server
66pnpm dev
67
68# Type-check + production build
69pnpm build
70```
71
72Output goes to `dist/`.
73
74---
75
76## Deploy
77
78```bash
79pnpm run deploy
80```
81
82`fw deploy` (from [fuzzyworld-tools](https://code.fuzzyworld.net/fuzzyworld-tools/)) builds a fresh clone of `main`:
83
84```
85pnpm install โ†’ pnpm gen-assets โ†’ pnpm build โ†’ upload dist/
86```
87
88and publishes it at https://apps.fuzzyworld.net/bubbles/
89
90---
91
92## Attribution
93
94Wind icon by [Icongeek26](https://www.flaticon.com/authors/icongeek26) from [Flaticon](https://www.flaticon.com/).