All motions

One shape, fourteen states

UI motion: from button to command palette, without a cut

Created with AI
  1. Bar 1 click on “Get started”, loader, kobalt check with two rings
  2. Bars 2–3 dynamic island, player with play/pause morph, the camera leans in on the scrub
  3. Bar 4 volume slider with rubber-band stretch, close-up on the stretched end
  4. Bar 5 toggle flips on the beat, liquid tab indicator in close-up
  5. Bars 6–7 chart with ticker and tooltip, whip pan into the ⌘K palette, “Saved”, back to the button
  • UI motion
  • 14 s Loop
  • 1080² · 30 fps
  • HTML
  • 1.2 MB

Prompt

English · for Claude Code, Codex & co. · 865 words
Build a 14-second looping UI motion shot, 1080×1080, award-level. One shape, never cut: every state is the same element morphing its size, radius and colour, while its content swaps with a short blur (≤ 6 px, ~120 ms, old text out before new text in). A cursor drives every change with real clicks and drags. The component lives in 3D space on a dark stage, and a directed camera works it like a product film.

CHAIN (120 BPM, 7 bars of 4 beats, something happens on every beat)
button "Get started" → click → loader ring → check (the shape fills with the accent, the check draws, two thin rings leave it) → dynamic island (cover + waveform) → click → music player (cover, title, play/pause icon that morphs) → scrub the progress bar → it becomes a volume slider that stretches like a rubber band when dragged past max → toggle flips on the beat → the knob becomes a liquid tab indicator (Day / Week / Month) → the tabs open into a line chart that draws itself, number ticks up, tooltip follows the cursor → whip pan into a ⌘K command palette → type "save" to filter → enter → toast "Saved" → back to the button. The last frame equals the first, cursor position and speed included.

STAGE
Deep steel #0E1117 with a grey radial light (no coloured glow), a faint dot grid with camera parallax, a soft vignette. Behind the component one huge outlined word per state (Geist 700, 1.5 px stroke, ~19 % white, cropped by the frame: START, WAIT, DONE, LIVE, PLAY, LOUD, ON, WEEK, +8.2%, ⌘K, SAVED); its letters roll up out of a mask with a stagger exactly when the state changes and stretch vertically while they move fast. A small Geist Mono HUD: title and timecode on top, state counter + name, camera zoom readout and a 28-tick beat ruler (current beat flashes the accent) at the bottom.

DESIGN
Surfaces graphite #1E242F and white cards, text white / #0E1117, secondary #6B7280. Exactly one vivid accent, electric kobalt #3D63F5, for everything active: the CTA, the check, progress, slider fill, toggle on, chart line and its fading area, the selected palette row, the caret, the toast badge. One typeface for the UI: Geist (500–600 UI, 400 secondary); Geist Mono for the HUD. All icon strokes 1.75 px with round caps. Depth: a CSS perspective tilt (≤ 7°) toward the cursor plus a slow drift; three layered shadows (contact, mid, ambient) that shift with the tilt and tighten on press; a top highlight, a 1 px rim light and a specular streak that slides with the tilt. Cursor: white arrow with a dark edge and a drop shadow, a subtle press on clicks. No backdrop-filter on anything the camera scales (it rasterises at 1× and the text goes soft).

CAMERA
Phase framing (scale + translate) so each state fills the frame, plus decisive push-ins on the money moments: the scrub playhead, the rubber-band end of the slider, the liquid tab indicator, the chart tooltip (close-up that follows the hover). Snap-zoom kicks on clicks, the check, the toggle flip and the toast, and a small one on every downbeat. A whip pan with a slight roll into the command palette, with a horizontal blur proportional to the camera speed (SVG feGaussianBlur, only during the whip). On the fastest cursor moves a short trail of faint, slightly blurred ghost cursors fakes the shutter.

MOTION
Springs are closed-form step responses (damping 0.8–1, tiny overshoot at most). A value whose target changes many times is the SUM of one spring per change, each starting at its change time — so it stays a pure function of time. The tab indicator's and toggle knob's leading edge rides a faster spring than the trailing edge, so it stretches ahead. Drags are direct manipulation: while held, the value comes from the cursor; on release it springs back from where it was. Colour swaps of the large surface flip within two frames on the beat. Camera kicks use the wrapped time (t − tk mod duration) so the loop stays seamless. Never put will-change on anything the camera scales.

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 1.0 s from 0 to 14, plus 11.45 (whip) and 10.9 (tooltip close-up).

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 button becomes a loader, a dynamic island, a player, slider, toggle, tabs, chart and command palette: one single shape in 3D space on dark steel, with push-ins, a whip pan and giant background type. 14 seconds, with the prompt.

What I learned building it

The “liquid” indicators are one simple trick: the leading and trailing edges ride springs of different speeds. And black-and-white swaps have to happen hard on the beat.

Inspiration

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

In depth in the blog article

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