
Motionboard recreation · no launch-film original
Before and After Slider
A flat, noisy lake photo sits under a Before tag while a cursor takes the handle of a divider, drags it to the right edge to reveal the graded After, pulls it back part way and leaves it in the middle with two result chips, then the Prism lockup appears.
Motionboard shot: Grade Slider
How to make a Before and After Slider with Claude Code or Codex
Copy the recipe above and paste it into Claude Code or Codex. The agent installs the skill and builds the shot.
npx skills add krisyangdev/motionboardHow it's built
Draw the same 1560x810px picture twice as SVG, a flat grey Before blurred 1.7px with an overlay grain and a saturated After, and stack the After layer on top with clip-path: inset(0px 1560px 0px 0px) so the film opens on the Before. Put a 6px line and a 112px round handle in a wrapper at the frame's top-left, and for every move tween three things with the same duration and ease: the wrapper x, the After clip-path inset(0px (1560 − x)px 0px 0px) and the cursor x.
Start the sweep at 1.55s and take the divider to x=1560px in 1.6s with power2.inOut, hold it until 3.8s, pull it back to x=330px over 1.3s, and settle it at x=780px between 5.35s and 6.35s with power3.inOut. Flip the Original pill to Enhanced at 2.35s, the midpoint of the first sweep, release the handle at 6.4s and bring in the Noise −82% and Sky recovered chips at 6.45s and 6.65s. Fade the scene out 7.3–7.9s, then show the mark at 8.0s, the wordmark at 8.08s and the tagline at 8.2s, held still for 2.25s.
Press the copy button to send this recipe to Claude Code or Codex, or install the skill once with npx skills add krisyangdev/motionboard. The agent builds the two pictures, the divider and the lockup. Replace the lake with a real before and after pair of your product, draw both into the same 1560x810px frame, and swap the indigo #5a4df5 for your accent. Render an MP4 with HyperFrames, or port the GSAP timeline to your website.
Full recipe
Why it works
The divider is one object. The line, the round handle and the clip edge of the After layer all take the same x from tweens with the same duration and ease, and the cursor takes it too, so the thing the eye follows and the thing that changes never drift apart. Both versions are the same drawing with the same geometry, so the only difference between left and right is the grade, and the eye reads that difference as the product's work. The Before is grey, soft and noisy and the After has a saturated sky and sharp ridges, so the first half second of the sweep already shows a result. The sweep crosses the full width first so the viewer sees the whole After once, goes back part way to show the Before again, and settles in the middle, where both halves, both tags and the two result chips are in frame together. The cursor holds the handle for the whole move, which tells the viewer the slider can be dragged. The Original pill flips to Enhanced at the exact midpoint of the first sweep, so the label and the picture change at the same moment. The film has one accent, indigo #5a4df5, used for the After tag, the Enhanced pill, the chip ticks and the mark.
Spec
- Timing
- Film 11s. The frame settles 0–1.4s; the divider fades in 0.35–0.75s; the cursor appears at 0.6s (0.25s), reaches the handle by 1.4s (0.8s) and presses at 1.45s (0.08s); sweep to the right edge 1.55–3.15s (1.6s); hold 3.15–3.8s; back to x=330px 3.8–5.1s (1.3s); hold 5.1–5.35s; settle at x=780px 5.35–6.35s (1.0s); release at 6.4s (0.25s); cursor leaves 6.6–7.05s; chips at 6.45s and 6.65s (0.6s each); scene leaves 7.3–7.9s (0.6s); mark at 8.0s (0.6s), wordmark at 8.08s (0.6s), tagline at 8.2s (0.55s), held still 2.25s to the end
- Easing
- Sweep to the right edge and back power2.inOut; settle in the middle power3.inOut; settle-in of the frame, chips, mark, wordmark and tagline
cubic-bezier(0.16,1,0.3,1)(expo.out); cursor approach power3.out, cursor exit power2.in; releaseback.out(2); scene exit power2.in; Original/Enhanced pill cross-fade power2.out (0.25s) - Camera
- Locked, flat frame. The only camera-like move is the frame settling from 1.035x to 1x over 0–1.4s, and the whole scene scaling to 0.965x while it fades 7.3–7.9s
- Subject
- Image frame 1560x810px at (180px, 150px), radius 28px. Two SVG layers of one mountain lake at dusk (horizon at y=465px, sun glow at x=400px, far peak near x=1100px, three ridges from seeds 7, 19 and 41, 15 left and 9 right pines from seed 88, 48 ripples from seed 311). The After layer sits on top with
clip-path: inset(0px Rpx 0px 0px), where R = 1560 − x, and starts fully clipped (R=1560px). Divider line 6px wide, handle a 112px white circle with two 6px chevrons. Tags 56px high with 30px 600 text: Before top right, After top left. Header 52px high: 48px mark, Prism 34px 700, file name 26px, pill 264x52px. Chips 60px high, 28px 600: Noise −82% and Sky recovered, at left 220px, top 790px and 864px - Sync
- Divider, clip edge and cursor share one tween time and ease for every leg. The pill flips to Enhanced at 2.35s, the midpoint of the first sweep, when the divider is at x=780px. The After tag shows as the divider passes it. The handle is released at 6.4s, 0.05s after it settles, and the chips come in after the release (6.45s and 6.65s)
- Style
- Paper
#eceef1(radial#f6f7f9to#e2e5ea), ink#0d0f14, one accent indigo#5a4df5; Inter only. After sky#161447,#43308a,#a4468f,#f0745c,#ffb26bwith 24 stars, rim light#ffc58aand a vignette; Before sky#5a5c64to#a39b94, blurred 1.7px, a#b9b4aehaze at 0.16 and a 0.75-opacity overlay grain (fractal noise 0.9, 2 octaves, saturation 0.25). Mark is a 150px indigo-gradient rounded square with a white prism and rays, wordmark Prism 150px 700, tagline Every photo, finished. at 48px 500; 0.05 grain and a light vignette
Prompt
Build an 11-second, 1920x1080, 30 fps light product film called Grade Slider: a before-and-after comparison slider over one photo, in the style of the standard web comparison widget. The fictional product is Prism, an AI photo editor. Background paper #eceef1 (radial #f6f7f9 to #e2e5ea), ink #0d0f14, one accent indigo #5a4df5, Inter only. Picture: draw one mountain lake at dusk twice as 1560x810 SVG (markup generated in JS with a seeded mulberry32 PRNG; no external images). Horizon y=465px, sun glow at x=400px, three ridges made by midpoint displacement (seeds 7, 19, 41; the far ridge has a peak near x=1100px, the mid ridge near x=820px), the ridges mirrored and blurred as a lake reflection, 48 horizontal ripple bars, sun streaks, a dark bank plus about 24 pines in the lower corners, clouds blurred 12px, three birds. Both versions use the same geometry. After: sky #161447, #43308a, #a4468f, #f0745c, #ffb26b, 24 stars, a thin rim light #ffc58a on the ridges, a vignette. Before: grey sky #5a5c64 to #a39b94, desaturated ridges and water, the whole drawing blurred 1.7px, a #b9b4ae haze at 0.16 opacity, and an overlay-blended fractal-noise layer (baseFrequency 0.9, 2 octaves, saturation 0.25, opacity 0.75). Frame: 1560x810px at (180px, 150px), radius 28px, overflow hidden, soft shadow. Before is the base layer; After sits on top with clip-path inset(0px 1560px 0px 0px) in CSS, so the film opens on the Before. Tags 56px high, 30px 600: Before top right (dark translucent), After top left (accent), each inside its own layer. Above the frame a 52px header: a 48px mark, Prism 34px 700, the file name dusk-lake.dng at 26px, and a 264x52px pill reading Original that cross-fades to Enhanced. Divider: a wrapper at the frame's top-left that GSAP moves in x, holding a 6px white line the full frame height and a 112px white circle handle with two 6px chevrons at mid-height. Every leg tweens three things with the same duration and ease: the divider x, the After layer clip-path inset(0px (1560 − x)px 0px 0px), and the cursor x (tip 16px right of and 20px below the handle centre). The frame settles from 1.035x to 1x over 0–1.4s (expo.out). The divider fades in at 0.35s; the cursor fades in at 0.6s and moves to the handle by 1.4s (power3.out), then presses at 1.45s (cursor scale 0.86, handle 0.92). Legs: 1.55–3.15s to x=1560 (power2.inOut); 3.8–5.1s to x=330 (power2.inOut); 5.35–6.35s to x=780 (power3.inOut). The pill flips to Enhanced at 2.35s over 0.25s. Release at 6.4s (back.out(2)); the cursor drifts 90px right and 80px down and fades 6.6–7.05s. Chips: two 60px-high white pills with an indigo tick and 28px 600 text, Noise −82% and Sky recovered, at left 220px, top 790px and 864px, rising 18px and fading in over 0.6s (expo.out) at 6.45s and 6.65s. The whole scene scales to 0.965x and fades 7.3–7.9s (power2.in). Lockup on the cleared paper, from 8.0s: a 150px indigo-gradient rounded-square mark with a white prism and rays (scale 0.82 to 1 over 0.6s), the wordmark Prism (150px, 700, tracking −0.045em, rising 22px from 8.08s over 0.6s) and the tagline Every photo, finished. (48px 500, the last word bold in #4a3fe0, rising 16px from 8.2s over 0.55s), all expo.out and held still to 11s. Add a 0.05 overlay grain and a light vignette. Constraints: deterministic, one paused GSAP timeline; hidden states in CSS; .to tweens with explicit end values; no CSS transform on GSAP-animated elements; no random, Date or requestAnimationFrame.
People describe it as
- A divider with a round handle sweeps across a photo and the sharp, colourful version appears behind it
- The cursor holds the handle while it goes to the right edge, back left part way and then to the middle
- Before and After tags and two result chips stay on the picture, then the Prism lockup appears
Often confused with
- Locked-Layout ReskinLocked-Layout Reskin keeps the layout fixed and hard-cuts between colour schemes every 6–10 frames; here one picture is revealed by an eased divider that moves continuously, so both versions stay on screen together.
- X-Ray EffectX-ray Dissolve cross-dissolves two versions of a device from one camera position; here a hard vertical edge moves across a single picture and the viewer compares the two grades side by side.
FAQ
How does a before and after slider work?
Two versions of the same picture are stacked at the same size. The top one is clipped with clip-path: inset(), and the right inset equals the frame width minus the divider x. Moving the divider and updating the inset together shows more or less of the top picture, and the cursor moves with the same tween so the handle looks held.
How do you keep the divider and the picture in sync?
Tween the divider x, the clip-path inset and the cursor x in the same call with the same duration and ease. Because all three run on one timeline, any frame you seek to shows the handle exactly on the clip edge.
Is it free to use?
Yes. Motionboard is free and MIT licensed, so you can use and modify the recipes and the films they produce in personal and commercial projects. The licence asks only that copies of the recipe files keep the copyright notice.







