vaweGitHub

Video componentsChange between shots

Shadow handoff

a card lifts, its blurred shadow stretches down and right and darkens into the night scene’s ground colour, then the card leaves faster than it lifted.

Change between shotsproduct5 s

shadow-handoff.md

Shadow handoff: final frame of the transition animation
00:00.0000:05.00
Tap the clip to play it.

When to use

Use when a product moves from a light theme to a dark one on screen: a theme control is picked and the whole page recolours.

Look: a browser window on the flat neutral ground, holding a weekly report: a stat card with a number, a delta pill and a seven day bar chart, and two small cards. The page has a Light and Dark segmented control at the top right. The colours are twelve tokens on the page (ground, card, ink, muted, line, control, bars, delta, tooltip), registered as colours so they animate.

How it moves: the pointer travels to Dark on EASE.land and presses (a 12 percent dip). The control thumb slides one slot in 200 ms on EASE.landSoft. Then every token goes from its light to its dark value together in 0.32 s on EASE.land. There is no shadow, no glow and no spread: a real theme change is one crossfade of all surfaces. The pointer then goes to the Friday bar and a tooltip fades in. The window and the pointer leave on leave.

The code

js
for (const k of Object.keys(LIGHT)) CSS.registerProperty({ name: `--a-${k}`, syntax: '<color>', inherits: true, initialValue: LIGHT[k] });
ind.animate([{ translate: '0 0' }, { translate: `${indW}px 0` }], { duration: 200, delay: 1400, easing: EASE.landSoft, fill: 'both' });
app.animate([LIGHT, DARK].map((p) => Object.fromEntries(Object.entries(p).map(([k, v]) => [`--a-${k}`, v]))),
  { duration: 320, delay: 1450, easing: EASE.land, fill: 'both' });

Easing

Each ease is a pair of After Effects handles from core/motion/presets.js. Every curve as CSS.

EaseLeaving a keyArriving at a key
land12% influence, speed 4.875% influence, speed 0
landSoft20% influence, speed 2.575% influence, speed 0

Notes

Common mistake: one layer fading over another, or a shadow that grows across the page. Recolour the tokens, so every surface moves together and the layout does not change by a pixel.

Looks (ground, type, radius, accent) live in demo/demo.css; this snippet keeps neutral tokens.

Sound

Sound: tick at 1.4 s, on the press (default gain).

Chain it into a film.

Copy chains of video components from the recipes.