Video componentsMove the camera
Rack focus
focus moves from one depth layer to another: near melts, far resolves, pinpoint lights swell into discs; use once per film.

When to use
Use when two things at different depths share a frame and the story passes from one to the other: the draft in front, the shipped result behind. The lens pulls focus: one plane resolves while the others go soft.
Look: a real photo as the far plane, always soft, with two pale paper cards over it at two depths (0.2 and 0.55; the photo sits at 0.95). The cards are drawn on a 2D canvas with a soft contact shadow, a mono label, a large word and a status line. Each card is sharp only when the focus is on its depth.
How it moves: the cards arrive on EASE.land (a 0.4 s fade with a 14 px rise, 150 ms apart). Focus sits on the near card for 1.2 s, then moves to the second card in 1.0 s on EASE.settle: the near card melts, the second resolves. Focus holds, then the cards leave on EASE.launch. The soft parts are a true depth of field: the circle of confusion grows with the depth difference, so the card next to the photo is less soft than the photo.
The code
import { lens, canvasSource, OFF } from '/core/surfaces/lens.js';
const NEAR = 0.2, MID = 0.55, FAR = 0.95; // depth, 0 near to 1 far
const rack = (t) => NEAR + (MID - NEAR) * easeFn('settle')(clamp((t - 1.2) / 1.0));
// paint(t) draws the photo and the cards into `color`, and each shape in its depth grey into `depth` (red channel)
const cam = lens(canvasSource(color, { depth }), { ...OFF, dof: { blur: 0.9, focus: rack, bokeh: 8 } });
vawe.onFrame(async (t) => { paint(t); await cam.draw(t); });Easing
Each ease is a pair of After Effects handles from core/motion/presets.js. Every curve as CSS.
| Ease | Leaving a key | Arriving at a key |
|---|---|---|
land | 12% influence, speed 4.8 | 75% influence, speed 0 |
launch | 33% influence, speed 0 | 25% influence, speed 3 |
settle | 60% influence, speed 0 | 60% influence, speed 0 |
Notes
Common mistake: two filter: blur() layers swapped on one curve. A uniform blur has no depth, so the plane between them never shows. Give each shape a depth and let the lens dof blur by distance from the focus.
Looks (ground, type, radius, accent) live in demo/demo.css; this snippet keeps neutral tokens.
Sound
Sound: none; a focus pull is felt, never heard.


