One shape, fourteen states
UI motion: from button to command palette, without a cut
- Bar 1 click on “Get started”, loader, kobalt check with two rings
- Bars 2–3 dynamic island, player with play/pause morph, the camera leans in on the scrub
- Bar 4 volume slider with rubber-band stretch, close-up on the stretched end
- Bar 5 toggle flips on the beat, liquid tab indicator in close-up
- 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
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
-
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.
-
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.
-
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.
# 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
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.
More motions
-
An agent platform, introduced UI motion 0:15 -
Agents that pick the model UI motion 0:14 -
A sentence becomes an app UI motion 0:15 -
An operating system, introduced UI motion 0:47.2 -
Your new design partner Voice-over 0:54.3 -
Ten kilometres, floating UGC ad 0:12.6 -
The journey of an order Explainer 0:34 -
Make it move Kinetic typography 0:08 -
From noise to a workflow Particles 0:14 -
The Gimli Glider Voice-over 0:19 -
Oscilloscope intro Oscilloscope 0:20 -
A keystroke in cross-section Explainer 0:20 -
A ring called Orbit UI motion 0:10 -
The bug that wants to stay Short film 0:20 -
Shin, not foot Voice-over 0:17 -
Jellyfish in a light shaft Organic loop 0:18 -
A logo that comes alive Logo reveal 0:08 -
How circles draw any shape Explainer 0:20 -
Pixel wizard Pixel art 0:16 -
The shortest war Voice-over 0:16 -
Loose mosaic wall Mosaic 0:20 -
Near fall Physics simulation 0:09 -
A Negroni, explained Explainer 0:20 -
Where the fuel money goes Voice-over 0:19.5 -
One print, nothing else Title sequence 0:20 -
Infinite zoom into the detail Infinite zoom 0:15 -
Cube stack Short film 0:07 -
A request at 22:47 Chat story 0:17 -
Claude Code in three steps Voice-over 0:17.5 -
The inbox factory Isometric loop 0:12 -
From 0 to 100 % soft Physics simulation 0:10 -
One line, three inks Showreel 0:20 -
The request breaks out Physics simulation 0:15 -
The slicing machine Isometric loop 0:09 -
How backlinks work Explainer 0:20 -
A ball that grows with every bounce Physics simulation 0:10 -
What makes a home Paper cut-out 0:20 -
Words that carry Kinetic typography 0:20 -
Shard logo reveal Logo reveal 0:11