From 0 to 100 % soft
A soft-body simulation in portrait, volume conserved
- 0–1.7 s the piston hits the solid cube, bounces off, and the concrete block shakes
- 1.7–3.55 s at 25 % the cube squashes, bulges sideways and wobbles out
- 3.55–5.45 s at 50 % it pushes down to the exit of the die and springs back
- 5.45–7.45 s at 75 % a star-profiled strand hangs below the block and snaps back up
- 7.45–10 s at 100 % everything flows through and coils up, then the strand zips back into a solid cube
- Physics simulation
- 10 s Loop
- 1080 × 1920 · 30 fps
- Canvas 2D
- 513 KB
Prompt
Build a 10-second seamless loop in portrait 9:16 — stage 1080×1920 CSS px — in the "0 % soft → 100 % soft" format: the same glossy jelly cube is pressed five times by a steel piston into a star-shaped die in a cut-away concrete block, each time softer, under a huge readout "NN% soft".
DESIGN
Warm light-grey studio (wall #EEEAE3 fading into a floor #D6D0C6, grey key light from the top left, no colour in the light). A graphite press frame (two columns, a cross beam with bolts and a gland collar), a chrome rod and a steel head 360 px wide. Under it a concrete block on two legs, cut away at the centre plane: cut face with seeded aggregate stones, pores and grain; behind the cut a dark funnel (half width 100 → 34 over 70 px) leading into a steel-lined throat and a steel exit collar. The jelly is a vivid orange (#FF5A24) clamped superellipse: flat contact where it touches the block or the piston, lit top, deeper bottom, darker right flank, light glowing through near the bottom (stronger when softer), a specular band that follows the upper-left curve offset inwards along the normal, a hot spot on the shoulder, a faint sheen on the right flank, a soft contact shadow and the piston's shadow when it comes close. The strand below the die has a star profile: ridges and grooves run along it, sheen and shade follow the light direction continuously around turns. Readout: Archivo 800 semi-expanded 214 px digits in fixed cells (tabular), a smaller "%" on the cap line, the word in Instrument Serif 166 px in orange, centred over the press, below the top 10 %. Everything important stays out of the top 10 %, bottom 22 % and right 12 %.
STORYBOARD
0–1.7 0 %: frame 0 already shows the piston falling; it hits the solid cube at 0.1 s, bounces back twice, the block hops and tips with a damped motion; the readout rolls to 25.
1.7–3.55 25 %: wind-up, strike, squash and bulge, a small sag into the funnel, rebound taller than rest, damped wobble; rolls to 50.
3.55–5.45 50 %: deeper squash, the tip just pokes out under the die, springs back; longer wobble; rolls to 75.
5.45–7.45 75 %: the jelly bulges past the piston, a strand hangs 150 px out of the die and sways, then zips back; rolls to 100.
7.45–10 100 %: the piston pushes down to the block; the jelly flows through, falls as a star strand and coils on the floor in layers, a thin film is left under the piston. From 9.08 the strand zips back up, the cube regrows on top while the readout rolls forward from 100 to 0, and the piston is already falling again into frame 0.
MOTION
The body's area is conserved every frame: what has flowed into the die (funnel, throat, hanging strand, coil) is taken from the blob, and its width is solved from the area at the current height. Squash lowers the superellipse exponent (rounder flanks), stretch raises it. Release wobble is a damped cosine on the height plus a little sideways shear, lower and longer the softer the jelly. Past a width cap the jelly is pushed into the die instead of spreading further. The piston accelerates until contact and is then braked by the body; nothing eases with overshoot except the jelly itself. The readout rolls each digit inside a mask with a short stagger and re-centres as the digit count changes. All wobble is gated off before the loop point, so seek(0) and seek(10) are identical. ?lang=de|en switches the word.
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 s from 0 to 10, plus every 0.1 s across 1.4–2.1, 3.2–3.9, 5.1–5.8, 7.1–7.8 and 9.5–10/0–0.6, and 2× crops of the die exit and the coil. 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 glossy jelly cube is pressed five times by a steel piston into a star-shaped die, each time softer: at 0 % it bounces off, at 100 % it flows through as a strand and coils up. 10 seconds, 9:16, a seamless loop built as code — with a prompt to recreate it.
What I learned building it
A body only looks soft once it loses nothing: what flows into the die is missing on top, and the width is solved from the area every frame. And the rhythm works without sound when the hard impact is short and the wobble gets longer with every step.
Inspiration
The model was a video by @renderx20 ((opens in a new tab)) on TikTok. What I built is my own take on the format, not the video itself; the prompt above describes exactly this 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 -
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 -
One shape, fourteen states UI motion 0:14 -
What makes a home Paper cut-out 0:20 -
Words that carry Kinetic typography 0:20 -
Shard logo reveal Logo reveal 0:11