Function: kenBurns()
kenBurns(
options?:object):ElementDecorator
Decorates an element or frame with authentic Ken Burns camera panning and slow zooming.
Supports pure zoom, tracking pans, and combined pan-and-zoom shots. Restarts the shot from frame zero whenever entering active scene visibility.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | { delay?: number; direction?: "in" | "out"; duration?: number; ease?: string; focus?: KenBurnsFocus; from?: KenBurnsFocus | KenBurnsKeyframe; loop?: boolean | "alternate"; pan?: [number, number]; scale?: number; to?: KenBurnsFocus | KenBurnsKeyframe; } | - |
options.delay? | number | Initial delay before motion begins in seconds (default: 0s). |
options.direction? | "in" | "out" | Direction shorthand: "in" (default) zooms 1.0 to scale; "out" zooms scale to 1.0. |
options.duration? | number | Animation duration in seconds (default: 20s). |
options.ease? | string | CSS easing timing curve (default: "ease-out"). |
options.focus? | KenBurnsFocus | Target focus shorthand when to is omitted (default: "center"). Explicit pan takes precedence over focus. |
options.from? | KenBurnsFocus | KenBurnsKeyframe | Starting keyframe or focus anchor (default: full frame scale 1.0 at center). |
options.loop? | boolean | "alternate" | Whether motion loops continuously or alternates directions (default: false, holds end frame). |
options.pan? | [number, number] | Explicit target pan translation percentages [x, y] when to is omitted. Takes precedence over focus. |
options.scale? | number | Peak zoom magnification factor (default: 1.35). For zoom-in, this is the end scale; for zoom-out, the start scale. |
options.to? | KenBurnsFocus | KenBurnsKeyframe | Ending keyframe or focus anchor (default: peak scale and focus). |