I built a satirical site where people pay to exist. The universe is one stained-glass window, recomputed every time someone pays
Each person is one piece of glass, and its area is proportional to what they paid. Pay more and your piece grows while everyone else's shrinks.
Some of the problems that made it fun:
- Exact areas. It's a power diagram (weighted Voronoi). The weights are solved iteratively until every cell's area matches its owner's amount: first on large regions, then inside each one, so it stays fast with thousands of cells. It runs in a Web Worker so the page never freezes.
- Looking like glass at every zoom level. Tiny pieces are flat color, and they form the texture of the window seen from afar. Bigger ones get a radial glow and a painted grisaille photo made with blend modes (no pixel reads, so no CORS trouble). Lead lines thicken around big pieces, like in a real window.
- Same renderer everywhere. The live site draws it on a 2D canvas; the share cards and link previews are rendered server-side with the exact same code through Skia (@napi-rs/canvas).
- The video is the real renderer