All motions

The slicing machine

A pastel isometric miniature world in portrait, every face shaded from one light

Created with AI
  1. 0–1.85 s The harp drops onto the striped cube, four slices tip over one after another and fan out, nested squares inside
  2. 1.85–3.6 s Everything steps forward one beat, the roll cake is sliced, the slices show their spiral, the melon drops onto the belt
  3. 3.6–4.75 s The melon falls into slices with rind, flesh and core, the big lilac box drops in
  4. 4.75–6.24 s The heavy box rides in, the harp winds up high and stops halfway on something hard
  5. 6.24–9 s The shell falls apart forwards and backwards, the striped cube from the start stands inside, and the loop begins again
  • Isometric loop
  • 9 s Loop
  • 1080 × 1920 · 30 fps
  • Canvas 2D
  • 552 KB

Prompt

English · for Claude Code, Codex & co. · 870 words
Build a 9-second looping pastel isometric "slicing machine" in portrait 9:16 — stage 1080×1920 CSS px (not square). A wire harp on a floating mint island cuts three objects into equal slices that fan out on a conveyor; the fourth object is a big lilac box that the harp cannot cut — it falls apart and the striped cube from the first frame stands inside. No text.

DESIGN
True isometric (orthographic) projection in Canvas 2D: x along the infeed (screen right-down), y along the outfeed (screen left-down), z up, 104 px per unit. One light from the upper left gives three tones per face (top light, left face mid, right face dark) with a lilac tint in the shade. Every solid is a box or a surface of revolution about y; planar faces are painted in their own 2D coordinates through an affine setTransform (orthographic keeps planes affine), so stripes, rings and spirals sit exactly on the cut faces. Sort pieces by AABB separation, with explicit order constraints for stacked slices; fill a hull underlay under each piece so face seams never show the background. Soft contact shadows: project every piece along the light onto the deck, fill the hulls on an offscreen canvas, blur 4 px, clip to the deck. Palette: background cream to pale lilac, island mint over a clay base, belts slate-lilac with lighter slats, machine butter yellow, steel parts pale lilac-white. Objects: a cube with coral/cream stripes whose cut faces show nested squares (cream, mint, lilac, butter, coral core — only the rings larger than the cut position); a roll cake whose discs show a pink spiral; a periwinkle melon shaded analytically as one radial gradient around the projected sphere centre, with cut faces showing rind, flesh, a peach ring and a lilac core; a 1.5 lilac box with a lid seam, lined in butter yellow inside. Keep the top 10 %, bottom 22 % and right 12 % free of anything important. Banned: glow, confetti, bouncy easing.

STORYBOARD
0–1.85 The striped cube stands under the raised harp (a butter carriage, four steel posts, seven blades 0.25 apart with a lit cutting edge). Brief anticipation lift, quadratic drop, hit at 0.28 on the anvil (lamp flashes, the slots light up), fast cubic-out return. From tc + 0.2, four slices tip forward one by one every 0.08 s and slide out onto the outfeed into a fan: the front slice flat, each following one leaning on the rear-top corner of the one in front (angle computed from that contact).
1.85–3.6 Both belts step together (quintic, 0.6 s): the fan rides off the front edge and tips down, the roll cake arrives from the waiting slot (leaning against the start and stop). Cut at 2.06, spiral discs fan out. The melon drops from above onto the slot: stretched while falling, squashed and settled on landing.
3.6–4.75 The melon is cut at 3.81; slices with rings and core. The lilac box drops in.
4.75–6.24 The box rides in more slowly. The harp winds up high (cubic in-out), holds, slams down and stops at height 1.0 — on the hidden cube — with a damped recoil, a shiver of the shell and the lamp.
6.24–9 The shell has been cut into six slices: three fall forward into a fan (wall with butter inner face, two arches), three tip backward over the far edge and slide out of view behind it (clipped at that edge). Inside stands the striped cube exactly at its frame-0 position, with a soft breath at 6.9. The outfeed carries the fan away, the roll cake drops onto the slot at 8.35 — and frame 0 follows.

MOTION
Indexing belts with quintic easing; belt slats move by integer multiples of their spacing per loop. Critically damped impulses w·t·e^(1−w·t) for every squash, windowed to exactly zero; nothing overshoots. Slices: rotation with u² (gravity), pivot slides cubic in-out, impact squash on landing. Off the edge: tip about the edge, the belt's push fades, gravity. 21-sample motion blur over half a frame only while the harp drops and lifts off, and while objects drop in from the sky.

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 9, plus every 0.1 s across 1.35–2.35, 3.1–4.1, 4.25–5.25, 5.74–6.74 and 8.5–9.0; frames 0.48–0.78 and 6.75–7.22 frame by frame for the fan order.

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 pastel slicing machine on a floating island: a wire harp cuts a striped cube, a roll cake and a melon into equal slices that fan out on the belt. The last box won't cut — it falls apart, and inside stands the cube from the start. 9 seconds, 9:16, built as code — with a prompt to recreate it.

What I learned building it

Two solids — box and surface of revolution — build the whole scene, as long as every planar face is painted in its own coordinates: isometry maps planes affinely, so stripes, rings and spirals sit exactly on the cut face. And a sphere needs no facets at all: every normal points away from its centre, so its shading is a single gradient, however the slice is turned.

Inspiration

The model was a video by @marblemannequin ((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

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