/ai-design-skills:design-to-motionfrom ai-design-skills
Turns a static design (a Figma frame, dashboard, card set, app screen, or a UI on a photo background) into a pixel exact HTML replica that loads in from an empty state, then has every visual act out what it does (a chart being read, a list receiving items, a prompt being typed) in a seamless loop, and exports an MP4 for X, a website GIF, and an 800×500 GIF. Use this skill whenever the user asks to animate a design, a Figma link, a screenshot, UI cards, a dashboard, or a hero image, to make a loading or appear animation, a showcase loop, a motion mockup, or a video or GIF of a design, even when they only say "animate this". Also use it on landing pages and websites for bento and feature cards that pair text with a visual, and for product or dashboard mockups. Always consult it before exporting layers, choosing what moves, building the intro, writing the visual story loops, or encoding video and GIFs.
Ships in ai-design-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A showcase animation is not a redesign. The viewer must see the exact design, and must see that it is alive.
exact frame → empty state → smooth load → every visual acts out its story → seamless repeat.
This skill has three parts. Part A rebuilds the design so the finished frame is indistinguishable from the source. Part B is the motion system. Part C records and exports. Work through A before touching B, and never encode anything before the checks in A7 and B9 pass. Parts A and B apply in both contexts below; Part C is for the showcase, or for a website only when exports are asked for.
Apply to any request to animate a static design: Figma frames, UI cards, dashboards, app screens, marketing heroes, product mockups, and designs placed on a photo background. When a rule here conflicts with a framework default, this file wins. When the user's explicit prompt conflicts with a rule, the user wins.
Not for interaction motion inside a shipping product (hovers, menus, toasts). For that, use a product motion skill such as emilkowalski/skills. Companion skill: landing-page-design in this repo, when the animation will live on a landing page.
Decide the context before anything else. It changes what you animate, how the motion starts and ends, and what you deliver.
| Showcase | Website | |
|---|---|---|
| Typical request | "Animate this design for me", a Figma link and nothing else | Building or editing a landing page or site, or the request names one |
| What gets animated | The whole frame | Only the sections that qualify (table below) |
| Start | Page load, from the empty state | When the section scrolls into view, once |
| After the intro | Stories run, then the frame dissolves and the cycle repeats (B5) | Stories run forever. No dissolve, no cycle |
| Text | Exported layers, so the frame is pixel exact | Live HTML text in the site's font, for SEO and accessibility. Only the visual parts are exported images or SVG |
| Deliverables | The page plus MP4 for X, website GIF, 800×500 GIF (Part C) | The animated sections inside the site's code. Exports only when asked |
If the request does not say which, look at where you are working: inside a site's codebase, assume website. With only a design and no site, assume showcase. If it is still unclear, ask once.
Scan the page section by section. Apply this skill only where a section has a visual part. Never animate a text section with it.
| Section | Apply |
|---|---|
| Bento and feature sections: cards with text plus a visual (a chart, list, flow, calendar, prompt, player) | Card intro on scroll (B2, card kind, text included), then a story loop on each card's visual (B4). This is the main use on a landing page |
| Product or dashboard mockup (a hero shot of the app, a product screenshot) | The loading intro on scroll: surfaces stay, contents load (A5). Then ask the user whether they also want stories after loading. Do not add them unasked |
| Logo rows, integrations | A marquee or a gentle light up story |
| Text only sections: headline blocks, testimonials, FAQ, pricing, CTA, footer | Not this skill. Use the page's normal scroll reveal (for example landing-page-design B7) |
Website rules:
IntersectionObserver. Start the intro when about 30% of the section is visible. Play it once. Never use a scroll listener.prefers-reduced-motion: reduce shows each section in its final state with no stories.Gather these before building. Ask only for what is missing, and ask in one batch.
If the user cannot answer, make a reasonable assumption, state it in one line, and continue. On the first design of a session, show the live page before recording exports, so the direction can be corrected cheaply.
Figma. Use the REST API with a personal access token.
GET /v1/files/:key/nodes?ids=:node&geometry=paths gives the tree, bounds, fills, effects, and radii.GET /v1/images/:key?ids=:node&format=png&scale=2 renders the reference frame. The finished still must match this image (A7).absolute bounds − origin.Flat image only. The image is the reference. Rebuild what you can isolate, and tell the user plainly which parts cannot be separated before you animate them. Never fake fidelity by animating a screenshot as one block.
Export every element that will move as its own PNG at 3x through /v1/images, batched 20 to 25 ids per call.
| Case | Placement |
|---|---|
PNG size equals absoluteRenderBounds (text layers always do) | Place at the render bounds |
| PNG larger than the render bounds (a parent clipped it), effects that overhang evenly | x = bbox.x − (pngW − bbox.w) / 2. Use renderBounds.y when the top was not clipped, otherwise derive it from the effect radius and offset |
| Overhang that is not even (a line with an arrowhead, a stroke with one square cap) | Take the bounds of strokeGeometry or fillGeometry from the geometry=paths response instead of the formula |
| Rotated vectors with a large layer blur (soft colour blobs) | Export with use_absolute_bounds=true and place at the bounding box. Run a PSNR offset search against the reference only if that region scores below about 45 dB. Blobs can be stored at 1x; the loss is invisible |
| Zero height or zero width stroked vectors | use_absolute_bounds=true returns null for them. Export without it |
| Mask group with blurred content | Anchor on the edge that was not clipped (usually the bottom of the mask plus its stroke) |
| Arcs, donuts, partial ellipses | Export with use_absolute_bounds=true |
| Patterns or overlays far larger than their surface | Export with use_absolute_bounds=true, then crop to the surface rectangle |
Instance children (ids like I12:34;56:78) | They often return null. Export the parent instance |
| Lines that should draw on, dashed or not | Figma outlines strokes into filled shapes, so there is no centerline to animate. Write the centerline yourself and use it as a mask over the exported PNG (example below) |
| A photo baked inside a larger exported layer | Export the photo node on its own as well. Cover the baked photo with a skeleton, and put the separate photo layer on top for the photo resolve. At rest it must equal the reference |
Rules that keep the frame exact:
individualStrokeWeights), and effects. Then export each child separately.R is a CSS box-shadow with blur R on a single element, or filter: drop-shadow() with blur about R / 2 on a group. Both give the same Gaussian. Verify against the reference.filter: drop-shadow(). Per element box-shadow would darken neighbours where surfaces overlap. Separate cards each carry their own shadow inside their card unit, so the shadow moves with the card.visible: false) and stray layers buried under opaque shapes.Drawing a line on. Read the corner points and arc radii from the outline in strokeGeometry: the centerline sits halfway across the stroke width, and a rounded corner's centerline radius is the outline's inner radius plus half the stroke. Most UI connectors are straight runs and arcs, so the path is short:
<svg class="ly" viewBox="0 0 1440 990" style="left:0;top:0;width:1440px;height:990px">
<mask id="draw1">
<path d="M193 832 V700 A45 45 0 0 1 238 655 H380" fill="none" stroke="#fff" stroke-width="8"
pathLength="1" stroke-dasharray="1" stroke-dashoffset="1"/>
</mask>
<image href="data:image/png;base64,..." x="192" y="653" width="190" height="181" mask="url(#draw1)"/>
</svg>
Animate stroke-dashoffset from 1 to 0 on the JS clock. pathLength="1" means no length measuring, and the wide mask stroke covers the line's antialiasing. For pulses that travel along it, read positions with getPointAtLength on the same path.
When the design sits on a photo or texture, the background is part of the design, not decoration. Often the whole canvas outside the app frame is background.
GET /v1/files/:key/images returns the raw image fills. Apply the fill's scale mode and imageTransform as CSS: for a stretch fill with a transform, background-size is the frame size divided by the transform scale, and background-position is the negative offset.backdrop-filter: blur() is its own element, a sibling above the background, never inside an ancestor that has filter or opacity below 1. Headless Chrome only renders it with transform: translateZ(0) and a z-index on that element.Decide which of the two layouts the design is. It changes what the empty state contains and what moves.
App frame (joined surfaces). A dashboard or app screen whose frame is built from two or more surfaces joined into one unit: a sidebar and a body, often overlapping by a few pixels. Only this layout gets static surfaces.
Separate cards (bento, card sets, widgets). Cards that stand apart from each other with gaps between them. These are not joined surfaces.
card kind in B2), staggered in reading order, and its contents follow inside it.Both layouts:
Clip pattern, which keeps stage coordinates valid inside the clip. For separate cards, the card's unit wraps its clip, so the card and its contents move together:
<div class="clip" style="left:113px;top:138px;width:305px;height:907px;border-radius:16px 0 0 16px">
<div class="cin" style="left:-113px;top:-138px"><!-- units in stage coordinates --></div>
</div>
.clip { position: absolute; overflow: hidden; isolation: isolate; }
.cin { position: absolute; width: var(--stage-w); height: var(--stage-h); }
On a website, build inside the site's code instead, following the website rules in "Two contexts". The clock, units, and modes below still apply per section.
<img> elements only; CSS gradients are not images.?still renders the exact Figma frame with no motion (also used for reduced motion). ?loop repeats the cycle like the exports. ?capture turns off requestAnimationFrame and exposes window.__start(), window.__tick(dt), and the loop time window.__lt, so the recorder drives the clock (C1)..u carrying its delay --d. The intro is CSS transitions keyed on .stage.in. Because a unit covers the whole stage, any percentage in clip-path or transform-origin on it refers to the stage, not the element. Use pixel values computed from the element's rectangle.transform: translateZ(0), so their antialiasing does not change when nearby transitions start. Otherwise a 1px edge flickers at every cycle start.requestAnimationFrame) drives everything time based: masks, sweeps, stories, accents. Drive it from loop time, never from wall clock, so capture is deterministic. In ?capture the clock advances only through __tick.Render ?still at 2x and compare it with the reference before any motion work.
gblur sigma≈1.2) so sub pixel antialiasing does not dominate. Aim above 35 dB overall and above 30 dB per container. Text heavy containers sit near 30 dB because 3x layers are resampled to 2x; if one is lower, retest it at sigma≈2.5, where text edges stop counting and only structure remains.Every timing, distance, and curve below comes from the values in Make it yours. Never invent ad hoc values.
The first frame of every page load and every export is the empty state. Empty becomes loaded. Never open on the finished frame.
The appear animation is smooth, slow, and soft: elements rise from below and resolve from blur to sharp, staggered.
| Kind | Use for | From |
|---|---|---|
card | Separate cards (bento, card sets) as a whole, with their shadow | translateY(24px), scale(0.985), blur(6px), opacity 0 |
up | Text, headers, values, rows | translateY(10px), blur(4px), opacity 0 |
down | Top toolbars, top bars | translateY(-8px), blur(4px) |
left | Sidebar items, list rows, labels | translateX(-10px), blur(4px) |
pop | Icons, badges, avatars, buttons, dots | scale(0.82–0.88) from the element's own center, blur(4px) |
photo | Images | skeleton shimmer first, then blur(14px) saturate(0.6) to sharp. For a photo baked into a bigger layer, see A3 |
wipe | Bars, fills, highlights | A left to right clip-path reveal in pixels on the full stage unit (A6). The right inset starts at stageW − x (zero width, so no sliver shows) and ends at stageW − (x + w) (the element fully shown). Top and bottom insets stay at y and stageH − (y + h) |
line / grow | Rules, ticks, timelines | scaleX(0) / scaleY(0) from their start edge |
donut | Rings, gauges | conic mask sweeping clockwise from 12 o'clock |
tray / rise | Sheets, trays, folders | slide up 40px from inside the container's bottom edge, clipped by it |
fade | Layers that sit under another layer | opacity only |
scale(0) on an object. Only lines and bars grow from zero, because they draw.clip-path wipe with the in out curve, 0.7 to 1.1s.The intro is only the opening. The main act is every visual acting out what it does, on a loop: a lead list receives new leads, a chart is being read, a calendar finds an open slot, a prompt gets typed. When a user says "animate the visuals", this is what they mean. A frame that only loads in and then sits there with a few pulses is not finished.
Write the story first. For each visual, name its story in one sentence before building, for example "a new lead lands on top and the older ones settle back". Pick from this table, or invent one in the same spirit.
| Visual | Story |
|---|---|
| Stack of items (leads, notifications, files) | A new item lands on top with a blur, the others step back one slot, the last one leaves |
| Line or area chart | A scrubber glides across, dots ride the curves, the tooltip value counts. Or: the line redraws, a marker pops, the numbers count up with it |
| Bar chart, equalizer, grid of cells | Bars breathe like a live feed and settle back to the design heights. A dot and tooltip ride the active bar |
| Donut, gauge | Segments ease outward one at a time and back. Or: the ring sweeps again clockwise |
| Table, list | A cursor inspects rows one by one, the row highlights, and a preview loads for it. Or: a soft highlight steps down the rows |
| Calendar, scheduler | A highlight searches for an open slot, the event glides into it, then back |
| Flow, connectors, pipeline | Pulses travel along the connectors in the flow direction, and nodes or avatars light up as a pulse passes. Dashed lines march |
| AI, prompt, form | The prompt deletes and retypes, chips evaluate one by one, then the result appears with a blur |
| Counters, KPIs | Numbers count up together with the chart that drives them |
| Profile, long content | The content scrolls slowly inside its clip, then returns |
| Logo row | A continuous marquee that moves exactly one full set per loop, so it repeats seamlessly |
| Media player | The playback handle and progress advance while the play button pulses |
Rules for stories
?still.?still.// [[time, value], ...] eased per segment; values may be numbers or arrays
function track(keys, t, ease = easeInOut) {
if (t <= keys[0][0]) return keys[0][1];
for (let i = 1; i < keys.length; i++) {
const [t1, v1] = keys[i], [t0, v0] = keys[i - 1];
if (t <= t1) {
const k = ease(Math.min(1, (t - t0) / (t1 - t0 || 1)));
return Array.isArray(v0) ? v0.map((v, j) => v + (v1[j] - v) * k) : v0 + (v1 - v0) * k;
}
}
return keys[keys.length - 1][1];
}
// a slot that scrubs along a curve and returns to its design position
slot.style.transform = `translate(${track([[0, [0, 0]], [1.2, [46, -18]], [2.6, [46, -18]], [3.8, [0, 0]]], t).join('px,')}px)`;
Accents sit on top of stories, never instead of them:
| Accent | Use for | Values |
|---|---|---|
| Pulse ring | Status dots, live indicators, play buttons | 1.8–2.2s period, ring scale 1 → 2.6, opacity 0.55 → 0 |
| Heartbeat | Hearts, likes, sparkles | +20% over 0.35s, every 3s |
| Gentle bob | Floating objects (folders, devices, cards inside cards) | ±2.6px, 2.8s sine |
| Sheen sweep | Photos, bars, buttons | A band 38% of the element's width, peaking at 34% white, 1.5s pass every 3.4s. On light grey shapes it disappears; use a refill story instead |
| Skeleton glimmer | Placeholder lines inside the design | 2.4s shimmer |
On a website there is no cycle: the intro plays once on scroll and the stories run until the section leaves the viewport.
| Phase | Default timing |
|---|---|
| Build in | 0 → 2.4s |
| Stories | 2.4 → 11.0s |
| Dissolve | 11.0 → 11.6s (opacity 0.5s) |
| Empty beat | 11.6 → 12.0s |
?loop and the exports dissolve and restart.Never use default ease or linear for entrances.
| Token | Curve | Use |
|---|---|---|
--e | cubic-bezier(0.16, 1, 0.3, 1) | Transforms on entrance (1.05s) |
--e2 | cubic-bezier(0.33, 1, 0.68, 1) | Opacity and blur (0.7–0.8s) |
--io | cubic-bezier(0.65, 0, 0.35, 1) | Wipes, fills, sweeps, camera moves |
| linear | linear | Constant motion only (shimmer, playback) |
Showcase timing is slower than product UI timing on purpose. Product rules like "under 300ms" do not apply here; slow and smooth is the brief.
--io, and the frame returns to its resting position before the dissolve.transform, opacity, filter, and clip-path only. Never top, left, width, or height.backdrop-filter is fine.prefers-reduced-motion: reduce renders the still frame.Run these on the recorded frames (C1) before encoding.
?still used for comparison here is rendered at the capture's device scale factor, not at the 2x of A7.
inf).?still frame, so no story, helper, or content escapes its card. The intro frames are excluded, because the cards' own rise moves pixels there; the contact sheet must show contents moving with their card, never ahead of it or outside it.__start. The seam check cannot catch JS state that failed to reset, because both its frames are at loop time 0; this one can.?still at the capture scale, proving every story came back to the design.Never screen record in real time. Step a fake clock and screenshot every frame. Three details decide whether the loop is smooth and the seam is clean; all three are in the snippet.
await page.clock.install({ time: 0 });
await page.goto(url + '?capture', { waitUntil: 'load' });
await page.evaluate(() => document.fonts.ready);
await page.clock.pauseAt(10000);
const loopTime = [];
for (let i = 0; i < frames; i++) {
// 1. whole milliseconds that average exactly 1000/60 (17, 17, 16, ...); runFor(1000 / 60) drifts
const dt = Math.round((i + 1) * 1000 / 60) - Math.round(i * 1000 / 60);
await page.clock.runFor(dt);
loopTime.push(await page.evaluate(([i, PRE, dt]) => {
if (i === PRE) window.__start(); // 2. start inside the same evaluate as the seek
if (i >= PRE) window.__tick(dt / 1000); // 3. the page clock advances here, never through rAF
const now = performance.now();
for (const a of document.getAnimations()) { // CSS transitions follow the fake clock
a.__m ??= window.__mark; // each one keeps the mark it was created under
a.pause(); a.currentTime = Math.max(0, now - a.__m);
}
return i >= PRE ? window.__lt : 0;
}, [i, PRE, dt]));
await page.screenshot({ path: `${out}/${String(i).padStart(5, '0')}.png` });
}
On the page side, in ?capture:
__start() adds the in class. Every change of the stage's state classes (in, out, the reset) sets window.__mark = performance.now(), so each transition is seeked from the moment it was created. Transition delays (--d) are counted inside currentTime.__tick(dt) advances the loop time, runs the cycle phases (B5), draws every story and accent, and sets window.__lt.PRE is a few frames (about 15) recorded before the start, so the page has settled. Save loopTime beside the frames.
deviceScaleFactor = min(1920 / W, 1200 / H) so the long side hits the X limit. Screenshots round to whole pixels and can come out one pixel odd (1745×1200 for a 1440×990 frame); the MP4 crop to even dimensions takes care of it, so expect 1744×1200.PRE − 1 (loop time 0, the empty state) and spans exactly cycle × 60 frames. Record at least 10 frames past it for the seam check.| File | Spec |
|---|---|
<name>-x.mp4 | H.264, yuv420p, 60fps, CRF 14–15, preset slow, +faststart, max 1920×1200, even dimensions |
<name>-loop.gif | 960px wide, 15–20fps, about 2 to 3MB, for the website |
<name>-800x500.gif | Always delivered. When the frame has wide empty borders (most card and bento frames), crop to the content with about 40px of margin at exactly 1.6:1. When the content fills the frame, fit it and pad with the page background colour. On a photo background, always crop, so no flat band sits beside the photo. 20fps, 12fps if heavy |
ffmpeg -start_number $A -framerate 60 -i frames/%05d.png -frames:v $N \
-vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" -c:v libx264 -preset slow -crf 15 \
-pix_fmt yuv420p -movflags +faststart name-x.mp4
ffmpeg -start_number $A -framerate 60 -i frames/%05d.png -filter_complex \
"trim=end_frame=$N,fps=20,scale=960:-2:flags=lanczos,split[a][b];\
[a]palettegen=max_colors=192:stats_mode=diff[p];\
[b][p]paletteuse=dither=bayer:bayer_scale=4:diff_mode=rectangle" -loop 0 name-loop.gif
For the 800×500 GIF, add scale=800:500:force_original_aspect_ratio=decrease,pad=800:500:(ow-iw)/2:(oh-ih)/2:color=<page bg> before split.
Before building, state in a few lines:
After building, report:
Every motion and export value lives here. Edit this section and the rest of the skill follows.
| Value | Default |
|---|---|
| Rise distance | 10px (up), 8px (down), 10px (left) |
| Entrance blur | 4px, photos 14px |
| Pop start scale | 0.82–0.88 |
| Transform duration | 1.05s with --e |
| Opacity and blur duration | 0.7–0.8s with --e2 |
| Wipe duration | 0.7s, slow bars 1.1s, with --io |
| Card rise | 24px, scale(0.985), blur(6px), 0.9s transform with --e, 0.6s opacity |
| Container stagger | 80–90ms |
| Tray and folder rise | 40px |
| Typing | one glyph every 45–70ms, caret blink 1s |
| Item stagger | 30–80ms |
| Story start | 2.4s |
| Story length | 3–8s per card, offset between cards |
| Cycle | 12s (dissolve at 11.0s, reset at 11.6s), longer if a story needs it |
| MP4 | 60fps, CRF 15, max 1920×1200 |
| Website GIF | 960px wide, 20fps |
| Small GIF | 800×500, 20fps |
Fidelity
Context and layout
Motion
Export
<name>-x.mp4, <name>-loop.gif, <name>-800x500.gif deliveredPart of ai-design-skills by Elaya, MIT licensed.
A few general motion rules were adapted, not copied, from these MIT licensed skill collections:
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub navcoaching/ai-design-skills --plugin ai-design-skills12 skills in this plugin
/build-design-systemUse when someone wants a design system built from the UI an app already ships, or one phase of it, such as "extract tokens from the app", "add states to our Button", "replace the hardcoded colors with tokens" or "start a design system". Moving screens onto an existing system's components is migrate-design-system. A vague whole-app ask goes to design-system-boss./component-docsUse to write one component's documentation entry from its code, stories and real call sites, such as "document the button", "write docs for Select", "what states does Toast have", or usage rules for a new or changed component. Not for foundations or pages that span components, which no skill here writes, nor for changing the component, which is build-design-system./