UI Motion Design Animation
By @okapi_fukugyo. Made with Claude Opus 5.5. Watch the original post.
Prompt
<inputs> Ask me the following 3 things: 8-12 UI components the shape transforms into (e.g. a button, a loading indicator, a music player, a volume slider, an on/off switch, tabs, a chart, a search box that opens with ⌘K, a notification that pops up for a moment), whether the colors are pure black and white or include one accent color, and a copyright-free track at around 120BPM (a tempo of 120 beats per minute) (e.g. Mixkit, free for commercial use). </inputs> <direction> Polished UI motion at the level you would see featured on "Dribbble", the portfolio site for designers. Only one shape, and never cut to another scene. Every state is shown by that same single shape morphing as it changes size, corner radius and color, and its contents swap with a short blur in between. A cursor triggers every change with real clicks and drags. The background is a warm light gray, the components are white and black, the on-screen text is in English, and all letters, numbers and symbols use Geist (a single font). All motion is natural, "spring"-like movement, with overshoot (bounce-back) kept to a bare minimum. The camera zooms so that each state fills the screen. Make the last frame identical to the first frame so it loops. Banned: bouncy motion, particles scattering everywhere, glowing haze, gradients on components, icons with inconsistent line weights, dead pauses where nothing happens, and anything that looks template-like. </direction> <structure> 120BPM, 7 bars (about 14 seconds), something happens on every beat. Button → loading indicator → checkmark → iPhone Dynamic Island-style display → music player whose play/pause icon morphs smoothly → drag the playback bar's knob to scrub the playback position → transforms into a volume slider (dragging past the maximum stretches it like rubber) → an on/off switch that toggles in time with the beat → the switch knob becomes a tab selection indicator that moves like liquid → the tabs open into a chart that draws its own line (hovering the cursor shows a tooltip) → collapses into the ⌘K search box → type to narrow down the suggestions → Enter → a notification that pops up for a moment → back to the button. </structure> <build> 1. One HTML file, square, 1440x1440. Compute every visual from time inside seek(t) (a function that, when given a time t, determines what is on screen at that instant). Use no CSS transitions (the automatic animation feature) and no timers, and do not carry any state over between frames. 2. Make the "spring" motion something that can be calculated directly from a formula (a closed-form step response). For values whose target changes several times, add up the motions calculated one per change. That way the value is always determined by time alone. 3. For the tab selection indicator, move the left and right edges with separate springs so the leading edge in the direction of travel stretches out before the trailing edge. Use the same technique for the switch knob. 4. Drags are direct manipulation: while the cursor is pressed, the value is calculated from the cursor position. On release, it springs back from that position. 5. Analyze the track with numpy (a tool for calculations) to find the beat positions, and start from the first beat of a bar. Place the UI sounds at the positions of the measured sound peaks. 6. Render with Playwright (a tool that drives a browser automatically and writes the screen out as images). Write out 4 sub-frames per frame, blend them with tmix in ffmpeg (a tool for making videos) to add motion blur (afterimages of movement), and output at 60fps. 7. Before rendering the full video, render just one frame per beat and check them. Fix anything that is off the beat, cramped or hard to read. </build> <gotchas> Never put will-change (a browser rendering setting) on elements the camera scales up and down. If you do, the text goes blurry. Give each piece of text that swaps inside the morphing box its own dedicated enter and exit timing (to prevent overlaps). Make the last frame match the first frame exactly, including the cursor's position and velocity. Otherwise the loop will stutter. </gotchas> <start> First ask me for the inputs, and before writing any code, show me the list of states for each beat. </start>