Lab 00223 Oct 2026
Microbots
A heading made of thousands of tiny linked bots. Scatter them, rebuild the word, or drag a magnet over it and watch it swallow every bot.
- WebGL2 instancing
- Typed-array simulation
- Spring physics
- Built with Claude Code
How it works
The heading is drawn into a hidden canvas and sampled into a grid of slots, about 6,600 on a desktop and 1,100 on a phone. Each bot is a spring that crawls to its slot, and alternate rows lean at opposite angles so the word reads as a weave. The real heading stays in the page for screen readers and search.
Every bot is one instanced quad in WebGL2, shaped in the fragment shader as a spindle: thick in the middle, needle-thin at the tips. The whole swarm is simulated in one loop over typed arrays, so it holds 60 fps.
The magnet is a neodymium ring you can drag. A bot that touches it is magnetised in turn, so the magnet’s reach grows with the clump until it can pull the whole word off the page. Caught bots stand out from the ring like iron filings. Only a shake (three quick changes of direction) lets them go: they fall, land, and crawl home.
Click or tap the word and the bots stream off to build the next one. The magnet works with arrow keys, and Space shakes it.
Recreate it
A prompt you can paste into a coding agent to build your own.
Build a heading made of thousands of tiny bots, like the microbots in Big Hero 6, as a single HTML file.
- Render the word to a hidden canvas, sample it into a grid of slots, and give each slot a bot: a spring that crawls to its slot. Alternate rows lean ±45° so it reads as a weave. Keep the real <h1> for screen readers.
- Draw every bot as one instanced quad in WebGL2, shaped as a spindle: thick middle, needle-thin tips. Simulate all of them in one typed-array loop.
- The pointer scatters bots. A click streams them off to build the next word.
- Add a draggable neodymium ring magnet. Bots near it are pulled in and stick; each caught bot extends the magnet's reach, so it can swallow the whole word. Caught bots point outward like iron filings. Shaking the magnet (three fast direction changes) drops them, and they fall and crawl home.
- Arrow keys move the magnet, Space shakes it. Respect reduced motion.How it happened
The real conversation, shortened. Charul’s words are in quotes; everything else is a summary of what happened.
- Charul
What about nanobots, the kind from that movie, Big something?
- Claude
Built Microbots (Big Hero 6): the heading sampled into thousands of bots on springs that scatter from the pointer and stream off to build the next word.
- Charul
The nanobots’ shape should be thin at the edges and thick in the centre.
- Claude
Reshaped every bot into a spindle in the fragment shader.
- Charul
Can we make the nanobots attract to a real magnet, using the magnetometer on phones?
- Claude
Browsers can’t read the magnetometer. Native apps can, so that one waits for an app.
- Charul
Then let’s add a fake magnet in the UI that’s draggable. When it’s close enough the nanobots get attracted and stick to it, and when it’s shaken they fall back into place.
- Claude
Added a red horseshoe magnet that pulls bots off its two poles and drops them on a shake.
- Charul
This magnet looks so bad 😭
- Claude
Drew three other magnets to choose from.
- Charul
Option B, and all the nanobots should get attracted, not only a few.
- Claude
Made it a polished neodymium ring, and made every caught bot magnetic too, so the reach snowballs until it swallows the whole word.