Skip to content

<Motion> ​

Children animated by a Motion sequence on the video's clock.

tsx
import { Clip, Composition, Motion, Track } from "@cutcraft/kit";

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540}>
      <Track id="main">
        <Clip id="shot" src="asset:aurora" in={0} out={3} fit="cover" />
      </Track>
      <Track id="text" layout="free">
        {/* A Motion sequence over the tag's children: each step names a selector inside it. */}
        <Motion
          id="headline"
          anchor="shot"
          duration={3}
          sequence={[
            ["h1", { opacity: [0, 1], y: [40, 0] }, { duration: 0.6, ease: "easeOut" }],
            [".rule", { scaleX: [0, 1] }, { at: 0.3, duration: 0.8 }],
          ]}
        >
          <h1
            style={{
              position: "absolute",
              left: 0,
              right: 0,
              top: 200,
              margin: 0,
              textAlign: "center",
              color: "#ffffff",
              font: "700 84px Inter, sans-serif",
            }}
          >
            Launch
          </h1>
          <div
            className="rule"
            style={{
              position: "absolute",
              left: 330,
              width: 300,
              top: 310,
              height: 6,
              background: "#e8a33d",
              transformOrigin: "left",
            }}
          />
        </Motion>
      </Track>
    </Composition>
  );
}

The player draws it once the host calls installFreeCodeLibraries() (Free code); the export draws it the same way, in headless Chrome (Exporting).

Used in: Product launch · Kinetic type · Data story · Logo reveal · An edit · Brand spot in any theme

Props ​

proptypedefaultrequireddescription
idstringyesThe element's name: unique in the file, and what anchors, ducking and the editor refer to it by.
startnumber (0..∞)Seconds from the start of the video. Free-layout tracks only; on a sequence track the element follows the one before it.
anchor"start" | stringOverlays: start relative to another element's start, or to its end with id.end.
atstringWith anchor: a word, shot or silence of the anchor's source (word:14655); the start is where the anchor plays it, plus offset.
offsetnumberSeconds added to the start that anchor and at give; negative starts earlier.
durationnumber (> 0) | "fill" | "source" | { match } |How long it plays: seconds; "source" for the whole trimmed source; "fill" to run to the end of the composition; { match: id } for as long as another element; { until: id } to end when another element ends.
enterHow it comes in: a fade, slide, scale or wipe over its first seconds, with an easing.
exitHow it goes out, over its last seconds, as enter.
transformMoves, scales, turns and fades the whole layer, as on any element; the editor's handles write it.
blend"normal" | "multiply" | "screen" | "overlay" | "darken" | … 13 moreHow the layer mixes with what is under it, as CSS mix-blend-mode does.
groundbooleanThe layer is a ground that other things sit on: a wall behind a game, a scrim that darkens footage under a title. The layout check then treats it like a background: it is not held to the safe zone and is not said to cover the captions.
sequence[string, object] | [string, object, object][][]Motion steps: [selector, keyframes, options], where at in the options is seconds into the layer.

Timed, visual, transformable. Children: effect, keyframe. All elements

MIT licensed.