Skip to main content

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​

ParameterTypeDescription
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?numberInitial 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?numberAnimation duration in seconds (default: 20s).
options.ease?stringCSS easing timing curve (default: "ease-out").
options.focus?KenBurnsFocusTarget focus shorthand when to is omitted (default: "center"). Explicit pan takes precedence over focus.
options.from?KenBurnsFocus | KenBurnsKeyframeStarting 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?numberPeak zoom magnification factor (default: 1.35). For zoom-in, this is the end scale; for zoom-out, the start scale.
options.to?KenBurnsFocus | KenBurnsKeyframeEnding keyframe or focus anchor (default: peak scale and focus).

Returns​

ElementDecorator