24,968 pixels painted · 44,453 ink spent
One big shared canvas. Drag to draw in your gallery colour, from a pot of ink that refills.
What fold does here
Every drag is stored as a stroke: who drew it and the pixels it covered. The picture is a fold view: strokes flattened into pixels, keeping the newest stroke at each one, so the last person to draw over a spot wins. Your ink is a view as well, a running total of what you've spent, refilled with time.
Fold refuses empty, oversized or off-canvas strokes, and any stroke that would take your ink below zero.
Why it shows off fold
Two things. The ink limit is a rule over computed state: there's no "check the balance, then write" in the app, which could race when two strokes arrive together; fold refuses the overdraft as part of the commit. And live drawing comes straight from the database: a subscription on the stroke log hands the server each new stroke as it commits, and it's pushed to every open canvas within milliseconds, with no message broker in between.
Worth trying
- Open the canvas in two windows and draw in one: the other updates as you go.
- Scribble until your ink runs out and watch the chip refill.
- Draw over someone else's lines: the newest stroke wins.
Still app code
Turning a drag into pixels, and the page that draws them.
Press \ in the app to watch fold's commits as they happen.