All motions

The bug that wants to stay

Animated short: a beetle, a mouse pointer and a line underlined in red

Created with AI
  1. 0–3 s The beetle sleeps at the end of the line underlined in red, the pointer traces the underline and finds it
  2. 3–7.4 s The pointer lunges and misses, the beetle hides behind a curly brace and pushes a semicolon out as a barricade
  3. 7.4–11 s A chase across the lines, letters wobbling under its feet
  4. 11–14.8 s The test runner's beam catches it at "1 failing", it holds up a sign: "It's a feature"
  5. 14.8–20 s The pointer hesitates and types // TODO, the underline turns yellow, "0 failing" — then the beetle eats the comment and goes back to sleep
  • Short film
  • 20 s Loop
  • 1080² · 30 fps
  • Canvas 2D
  • 709 KB

Prompt

English · for Claude Code, Codex & co. · 858 words
Build a 20-second looping silent short, 1080×1080: a bug that does not want to be fixed. The stage is a close-up of an invented dark code editor seen from above; the bug is a small beetle walking on the screen, the mouse pointer is its opponent. No sound, no captions — everything is told through body language and timing. On-screen text is code, in English.

DESIGN
Editor #15171C with a faint top-left light, tab strip ("cart.ts" active, "cart.test.ts"), gutter numbers 21–34, indent guides, status bar with a test badge "1 failing". Code in Geist Mono 500 at 36 px, 66 px line pitch, calm palette: keywords violet #B5A3E8, functions blue #8DB6EE, types teal #7CCAC3, strings sage #A9C891, numbers sand #E4B07C, punctuation grey. Fourteen lines: an import, a function total(cart) with a loop, the faulty line "sum -= 0.01;" with a red zigzag underline, a return, and a test expecting 42. The beetle is flat vector, drawn top-down: orange wing cases #EF7A4B with a seam and four dots, darker head, two big round white eyes with pupils and a highlight, peach legs and antennae, a soft contact shadow and leg shadows offset to the bottom right. The pointer is a white arrow with a dark outline and shadow. The sign is a cream card on a wooden stick: "It's a feature" in Geist 600.

STORYBOARD
0–3 s  Nap. The beetle sleeps at the end of the underlined line, legs tucked, antennae drooping, breathing. The pointer glides in, traces the underline, stops next to it. One eye opens, then both, pupils shrink. The pointer winds up.
3–7.4 s  Dodge. The pointer lunges and clicks on nothing: the beetle squashes, spins and bolts up to the "{" at the end of the for-line, squeezes itself thin behind it and peeks. The pointer looks around, creeps in from below. The beetle leans out, hooks the ";" of the next line and pushes it out in front as a barricade; the pointer pokes it, the semicolon wobbles, the pointer recoils. Smug half-closed eyes. The pointer swoops around.
7.4–11 s  Chase. The beetle runs along the function signature, down through the loop and across the faulty line, glancing back once; every letter it crosses rocks and settles. The pointer follows half a second behind. The semicolon slides back to its place.
11–14.8 s  Caught. The test badge lights up and throws a wedge of light across the editor, everything else dims; the beetle skids to a halt in it, legs splayed, pupils tiny. The pointer rears up to strike — the beetle turns and swings up the sign. The pointer stops short, tilts, moves over and reads. Two slow blinks.
14.8–20 s  Truce. The pointer circles, hesitates, then goes to the faulty line, clicks behind it and types "// TODO". The underline wipes to yellow, the badge digit rolls to "0 failing" in green, the light retracts, the pointer leaves. The beetle puts the sign away, walks home along the line and eats the comment character by character from the end; the underline turns red again, the badge rolls back to "1 failing", it flattens down and closes its eyes. Frame 0 = last frame.

MOTION
The beetle follows Catmull-Rom paths by arc length with Hermite speed curves, so speed is continuous through a run. Six legs in an alternating tripod gait: each foot is planted at a fixed point of the path for 56 % of the stride and swings to the next one, legs solved with two-bone IK (front knees forward, middle outward, hind back) — no foot slides. Eyes always look somewhere on purpose: at the pointer, ahead, back over the shoulder, into the lamp, at the comment. Anticipation before every dash (squash, then stretch), antennae sweep back with speed, critically damped settles, nothing bounces. Letters wobble as damped sines triggered when the beetle passes over them. The pointer leans into its motion and has its own tilt track for wind-ups, double takes and reading nods. Light always from the top left.

TECHNIQUE
- One self-contained HTML page plus one JS file (no inline script, no libraries, no network requests). Stage exactly 1080×1080 CSS px, or the size named above (1080×1920 for portrait).
- Expose window.MOTION = { duration, fps: 30, width, height, seek(t) } with the stage size in width and height. seek(t) redraws the frame for time t from scratch: no state between frames, no Math.random (seeded PRNG only), no Date, no CSS transitions, no timers.
- Loop: seek(0) and seek(duration) must look identical.
- With ?render=1 the stage sits unscaled at the top left (for frame capture). Without it, scale the stage to fit the window and loop with requestAnimationFrame.
- prefers-reduced-motion: show one representative still, no loop.

CHECK
Render stills at the listed times, look at every one, fix anything that overlaps, is cut off, aliased or unreadable, then render again. Report only when frame 0 equals the last frame.
Stills: every second, then every 0.1 s around 3.0, 6.3, 7.4, 11.0, 12.8, 17.5 and 19.0–20.0, with 3× crops of the beetle asleep, behind the brace, running and holding the sign; frame 0 must equal frame 20.

How to recreate it

  1. Give the prompt to a coding agent

    Create an empty folder and paste the prompt into Claude Code, Codex or Cursor. The agent writes one HTML page and one script — the animation then runs right in the browser.

  2. Let it check the stills

    The prompt makes the agent render stills and look at them itself. Only refine what you don't like in the picture: “scene 3 is too busy” works better than a new prompt.

  3. Render to MP4

    Because every animation can draw any frame exactly through window.MOTION.seek(t), a small script renders it frame by frame — no stutter, no screen recording. Then ffmpeg joins the frames into a clip.

Render commands Download render.mjs
# 1 · Render every frame (Chrome, Node ≥ 22)
node render.mjs http://localhost:3000/ \
  frames/ frames 30

# 2 · Join the frames into an MP4
ffmpeg -framerate 30 -i frames/%05d.png \
  -c:v libx264 -preset slow -crf 22 \
  -pix_fmt yuv420p -movflags +faststart \
  my-motion.mp4

How a clip is built with Claude Code

Background

A silent film inside a code editor: a small beetle naps on a faulty line, the mouse pointer comes to fix it. The beetle dodges, hides behind a curly brace, barricades itself with a semicolon and, caught in the test runner's beam, holds up a sign: "It's a feature". 20 seconds of character animation with a clean walk cycle, looping, with the prompt.

What I learned building it

A character only comes alive once its feet stay on the ground and its eyes have a target. So I plant every foot on a fixed point of the path and give the gaze a direction at every moment. The punchline is then carried by the pause before it, not by the movement.

Inspiration

The starting point was a prompt by @KamStudioLabs ((opens in a new tab)) on Skillry. You'll find the original wording there; the prompt above is my own version.

More motions

Contact

Let's discuss
your project
together.

Send me a message or fill out the contact form. I'll get back to you within 24 hours.

Paul Mill

Paul Mill

hallo@paulmill.com