vaweGitHub

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.

Move the cameraproduct4.5 s

rack-focus.md

Rack focus: final frame of the camera move animation
00:00.0000:04.50
Tap the clip to play it.

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

js
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.

EaseLeaving a keyArriving at a key
land12% influence, speed 4.875% influence, speed 0
launch33% influence, speed 025% influence, speed 3
settle60% influence, speed 060% 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.

Chain it into a film.

Copy chains of video components from the recipes.