zoom
Zooms through the first clip into the next, with a blur.
tsx
import { Clip, Composition, Track, Transition } from "@cutcraft/kit";
// zoom: Zooms through the first clip into the next, with a blur.
export default function Video() {
return (
<Composition fps={30} width={640} height={360}>
<Track id="main">
<Clip id="first" src="asset:coffee" in={1} out={3} fit="cover" />
<Transition id="change" type="zoom" duration={1} />
<Clip id="next" src="asset:coffeeWide" in={4} out={6} fit="cover" />
</Track>
</Composition>
);
}The coffee footage is Pixabay videos 209419 and 209424, under the Pixabay Content License.
Params
Drawn by a shader, as a crossfade where WebGL is missing.
| param | type | default | description |
|---|---|---|---|
center | [number, number] | [0.5,0.5] | The point the clips zoom toward, as [x, y] fractions of the frame from the top left. |
scale | number (1..4) | 1.6 | How far the clips zoom, as a multiplier: the outgoing clip grows to it and the next one shrinks from it. |
blur | number (0..1) | 0.5 | How much the clips smear along the zoom, most at the middle: 0 is none. |