Skip to content

Keys, effects and speed ​

Everything about an element is a prop on it: where it sits, how it moves, its effects, its speed, the frames it holds. This page shows how a prop changes over time, how effects are written, and how a clip ramps its speed, holds a frame and moves its sound.

See it in: A coffee film (a push-in, a speed ramp, a held frame and a LUT that comes in), An edit (a push-in), Slideshow with motion (a push on every photo).

tsx
<Clip id="pour" src="asset:coffee" in={8} out={14}
  transform={{ scale: [{ at: 0, value: 1, easing: "easeInOut" }, { at: 3.5, value: 1.2 }] }}
  effects={[{ type: "lut", src: "asset:warm" }]}
  speed={[{ at: 0, value: 1, easing: "easeInOutQuad" }, { at: 1.6, value: 0.4 }]}
  freezes={[{ start: 4.2, duration: 1.4, source: 12.4 }]}
  volume={[{ at: 0, value: 0 }, { at: 0.5, value: 1 }]} />

The shot pushes in, has a warm look, eases into slow motion, holds one frame for 1.4 seconds, and its sound fades up over half a second.

To sayWrite
A value that staysThe value: opacity: 0.8.
A value that changesA list of keys: opacity: [{ at: 0, value: 0 }, { at: 1, value: 1 }].
A value that is another element'sA link: rotation: { link: "logo.transform.rotation" }.
A look on the elementeffects={[{ type: "blur", radius: 8 }]}.
A speed rampKeys on speed.
A held framefreezes={[{ start, duration, source }]}.
Sound that changesKeys on volume and pan.

A value, or keys over time ​

A number is a constant. A list of keys is a value that changes over time. Each key is { at, value, easing? }:

  • at is seconds into the element, not into the video. Move the element and its keys move with it.
  • value is what the prop is at that moment.
  • easing says how the value leaves this key on its way to the next one. Left out, it is linear. The last key's easing is not used.

Before the first key the value holds the first key's value, and after the last it holds the last one's.

tsx
<Title id="name" start={1} duration={3}
  transform={{ opacity: [{ at: 0, value: 0, easing: "easeOut" }, { at: 0.4, value: 1 }] }}>
  Halvard
</Title>

The title fades in over its first 0.4 seconds, fast at first and slowing down at the end.

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

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540}>
      <Track id="main">
        {/* A slow push-in: two keys on each scale axis. */}
        <Clip
          id="shot"
          src="asset:espresso"
          in={2}
          out={5}
          fit="cover"
          transform={{
            scale: [
              { at: 0, value: 1, easing: "easeInOutSine" },
              { at: 3, value: 1.4 },
            ],
          }}
        />
      </Track>
    </Composition>
  );
}

What keys can move ​

PropKeys move
transform.scaleBoth axes, from one list. scale: { x: [...], y: [...] } moves each on its own.
transform.rotationDegrees, clockwise.
transform.opacity0 to 1.
transform.anchor.x, transform.anchor.yThe point it scales and turns around.
transform.borderRadiusRounded corners.
transform.crop.x, .y, .width, .heightThe part of the source shown: a zoom into a screen recording.
box.x, box.yWhere it sits in the frame, in pixels.
volume, panIts sound.
speedA clip's playback rate.
Every param of every effectA blur that clears, a LUT that comes in.
A shape's width, height, fill, points, stroke.color, stroke.thickness, stroke.dashOffsetIts size, colour, outline and corners. See Shapes that change.
A mask's path.points, feather, opacityIts drawn outline, its soft edge, how much it lets through. See Masks that move.

Anything else is a constant: a font, a title's colour, a fit.

Shapes that change ​

A <Shape> takes keys on its own values, so it can grow, change colour, draw its line on and change shape.

tsx
import { Composition, Shape, Title, Track } from "@uberscene/kit";

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540} background={{ type: "color", color: "#101418" }}>
      <Track id="shapes" layout="free">
        {/* Size and colour: the dot grows and turns from orange to violet, moved in OKLab, then back. */}
        <Shape
          id="dot"
          type="circle"
          start={0}
          duration={4}
          width={[
            { at: 0, value: 60, easing: "easeInOut" },
            { at: 1.6, value: 180, easing: "easeInOut" },
            { at: 3.2, value: 60 },
          ]}
          height={[
            { at: 0, value: 60, easing: "easeInOut" },
            { at: 1.6, value: 180, easing: "easeInOut" },
            { at: 3.2, value: 60 },
          ]}
          fill={[
            { at: 0, value: "#e8a33d", easing: "easeInOut" },
            { at: 1.6, value: "#7b5cff", easing: "easeInOut" },
            { at: 3.2, value: "#e8a33d" },
          ]}
          box={{ x: 200, y: 240, origin: "center" }}
        />
        {/* A line that draws on: its dash offset runs from the dash's length to 0, and its stroke thickens. */}
        <Shape
          id="line"
          type="path"
          start={0}
          duration={4}
          width={220}
          height={180}
          fill={{ type: "none" }}
          points={[
            { x: 0, y: 1 },
            { x: 0.3, y: 0.2 },
            { x: 0.6, y: 0.7 },
            { x: 1, y: 0 },
          ]}
          stroke={{
            color: "#5bc0be",
            thickness: [
              { at: 0, value: 3 },
              { at: 2, value: 10 },
            ],
            lineCap: "round",
            lineJoin: "round",
            dashArray: [700],
            dashOffset: [
              { at: 0, value: 700, easing: "easeInOut" },
              { at: 2, value: 0 },
            ],
          }}
          box={{ x: 480, y: 240, origin: "center" }}
        />
        {/* A morph: two lists of five points, moved point by point, from a star-like shape to a house. */}
        <Shape
          id="morph"
          type="polygon"
          start={0}
          duration={4}
          width={180}
          height={180}
          fill={[
            { at: 0.6, value: "#f25f5c", easing: "easeInOut" },
            { at: 2.6, value: "#ffd166" },
          ]}
          points={[
            {
              at: 0.6,
              easing: "easeInOut",
              value: [
                { x: 0.5, y: 0 },
                { x: 1, y: 0.4 },
                { x: 0.8, y: 1 },
                { x: 0.2, y: 1 },
                { x: 0, y: 0.4 },
              ],
            },
            {
              at: 2.6,
              value: [
                { x: 0.5, y: 0.05 },
                { x: 1, y: 0.45 },
                { x: 1, y: 1 },
                { x: 0, y: 1 },
                { x: 0, y: 0.45 },
              ],
            },
          ]}
          box={{ x: 760, y: 240, origin: "center" }}
        />
      </Track>
      <Track id="labels" layout="free">
        <Title id="l1" start={0} duration={4} box={{ x: 200, y: 420, origin: "center" }} style={{ size: 24 }}>
          size and colour
        </Title>
        <Title id="l2" start={0} duration={4} box={{ x: 480, y: 420, origin: "center" }} style={{ size: 24 }}>
          draw on
        </Title>
        <Title id="l3" start={0} duration={4} box={{ x: 760, y: 420, origin: "center" }} style={{ size: 24 }}>
          morph
        </Title>
      </Track>
    </Composition>
  );
}
  • Size. width and height take keys and generators, as transform does. The shape grows from its box's origin, so a box with origin: "center" grows from the middle.
  • Colour. fill (a colour, not a gradient) and stroke.color take keys of colours: hex, rgb(), hsl(), a CSS name, or a theme token such as $primary. The colour moves through OKLab, a space where equal steps look equal, so red to blue passes through a clear purple and not a muddy grey.
  • Drawing a line on. Give the stroke one dash as long as the line (dashArray: [700]) and key dashOffset from that length to 0. stroke.thickness takes keys and generators too.
  • Changing shape. points takes keys of point lists. Two keys with as many points move point by point; with a different number of points the shape changes at the key.
tsx
<Shape id="dot" type="circle" width={[{ at: 0, value: 60 }, { at: 1.6, value: 180 }]}
  fill={[{ at: 0, value: "$primary" }, { at: 1.6, value: "#7b5cff" }]} />

Curves ​

A point in points may have a handleIn and a handleOut: positions, in the same fractions of the box as the point, that the line coming in and going out is pulled toward, as a drawn <Mask> writes them. A point with no handles is a corner. A path is open unless it has closed; a polygon is closed unless it has closed={false}.

tsx
import { Composition, Shape, Title, Track } from "@uberscene/kit";

// A circle written as four curved points, and a leaf written as the same four: the handles move with the points.
const k = 0.224; // 0.5 - 0.276: a quarter circle's handle, as a fraction of the box.
const circle = [
  { x: 0.5, y: 0, handleIn: { x: k, y: 0 }, handleOut: { x: 1 - k, y: 0 } },
  { x: 1, y: 0.5, handleIn: { x: 1, y: k }, handleOut: { x: 1, y: 1 - k } },
  { x: 0.5, y: 1, handleIn: { x: 1 - k, y: 1 }, handleOut: { x: k, y: 1 } },
  { x: 0, y: 0.5, handleIn: { x: 0, y: 1 - k }, handleOut: { x: 0, y: k } },
];
const leaf = [
  { x: 0.5, y: 0, handleIn: { x: 0.5, y: 0 }, handleOut: { x: 0.5, y: 0 } },
  { x: 0.9, y: 0.55, handleIn: { x: 0.95, y: 0.2 }, handleOut: { x: 0.85, y: 0.9 } },
  { x: 0.5, y: 1, handleIn: { x: 0.5, y: 1 }, handleOut: { x: 0.5, y: 1 } },
  { x: 0.1, y: 0.55, handleIn: { x: 0.15, y: 0.9 }, handleOut: { x: 0.05, y: 0.2 } },
];

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540} background={{ type: "color", color: "#101418" }}>
      <Track id="shapes" layout="free">
        {/* An open curve that draws itself on: each point's handles pull the line through it. */}
        <Shape
          id="wave"
          type="path"
          start={0}
          duration={4}
          width={320}
          height={160}
          fill={{ type: "none" }}
          points={[
            { x: 0, y: 0.5, handleOut: { x: 0.17, y: -0.3 } },
            { x: 0.5, y: 0.5, handleIn: { x: 0.33, y: 1.3 }, handleOut: { x: 0.67, y: -0.3 } },
            { x: 1, y: 0.5, handleIn: { x: 0.83, y: 1.3 } },
          ]}
          stroke={{
            color: "#5bc0be",
            thickness: 8,
            lineCap: "round",
            dashArray: [700],
            dashOffset: [
              { at: 0, value: 700, easing: "easeInOut" },
              { at: 2, value: 0 },
            ],
          }}
          box={{ x: 270, y: 240, origin: "center" }}
        />
        {/* A closed curve that morphs: four points with handles each side, a circle into a leaf and back. */}
        <Shape
          id="blob"
          type="path"
          closed
          start={0}
          duration={4}
          width={200}
          height={200}
          fill={[
            { at: 0.4, value: "#e8a33d", easing: "easeInOut" },
            { at: 2, value: "#7bd389", easing: "easeInOut" },
            { at: 3.6, value: "#e8a33d" },
          ]}
          points={[
            { at: 0.4, easing: "easeInOut", value: circle },
            { at: 2, easing: "easeInOut", value: leaf },
            { at: 3.6, value: circle },
          ]}
          box={{ x: 690, y: 240, origin: "center" }}
        />
      </Track>
      <Track id="labels" layout="free">
        <Title id="l1" start={0} duration={4} box={{ x: 270, y: 420, origin: "center" }} style={{ size: 24 }}>
          an open curve
        </Title>
        <Title id="l2" start={0} duration={4} box={{ x: 690, y: 420, origin: "center" }} style={{ size: 24 }}>
          a curved morph
        </Title>
      </Track>
    </Composition>
  );
}

Keys on a curve move its handles with its points, so a circle written as four curved points can become any other four-point shape. Give every key the same number of points: uberscene lint warns when two keys differ, since the shape then jumps at the key instead of morphing.

Masks that move ​

A <Mask> takes keys on its drawn outline, its feather and its opacity. The outline's keys go on points inside path, a list of point lists as a shape's points takes, and move point by point and handle by handle when two keys have as many points; closed stays one value. feather and opacity take keys and generators. A shape (a rect, an ellipse or a polygon) stays as written: draw the outline to move it.

tsx
<Clip id="pour" src="asset:redCup" in={30} out={33}>
  <Mask id="opening" type="drawn"
    path={{ points: [{ at: 0, value: slot, easing: "easeInOut" }, { at: 2.5, value: wide }], closed: true }}
    opacity={[{ at: 0, value: 0.3 }, { at: 1, value: 1 }]} />
</Clip>

An element may hold several masks. They join in file order, each by its mode: add (the default) shows what it covers as well, subtract hides what it covers, intersect keeps only where it and the masks before it both show. The area starts empty when the first mask adds, and whole when it subtracts or intersects, as in After Effects: one subtract mask cuts a hole, and one intersect mask shows its region as an add mask would. Each mask is inverted, softened and faded on its own before it joins. A shape is in fractions of the element's box; a drawn path is in its pixels.

Easing ​

The easing names are CSS's, in camelCase (linear, ease, easeIn, easeOut, easeInOut), the usual curves by name (easeInOutSine, easeOutBack, easeInOutQuad…), and spring. The <Clip> reference lists them all. For a move that needs more, draw it yourself in a <Layer>.

Motion without keys ​

Some movement is not a move from here to there: a card that is never quite still, a frame that closes in slowly, a light that pulses. Keys for those are busywork, and they are the same on every element. In place of a number or a list of keys, a value can be a generator: an object with a type.

tsx
import { Composition, Shape, Title, Track } from "@uberscene/kit";

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540} background={{ type: "color", color: "#101418" }}>
      <Track id="cards" layout="free">
        {/* A wiggle: a small wobble added to the rotation and the height it sits at, never quite the same twice. */}
        <Shape
          id="wobble"
          type="rectangle"
          start={0}
          duration={5}
          width={200}
          height={130}
          cornerRadius={14}
          fill="#e8a33d"
          box={{ x: 200, y: { type: "wiggle", base: 240, amount: 14, frequency: 0.5 }, origin: "center" }}
          transform={{ rotation: { type: "wiggle", amount: 5, frequency: 0.6 } }}
        />
        {/* A drift: a steady change added to the scale, so it grows a little all the way through. */}
        <Shape
          id="grow"
          type="rectangle"
          start={0}
          duration={5}
          width={200}
          height={130}
          cornerRadius={14}
          fill="#5bc0be"
          box={{ x: 480, y: 240, origin: "center" }}
          transform={{ scale: { type: "drift", base: 0.8, speed: 0.06 } }}
        />
        {/* A loop: two keys played back and forth for as long as the element lasts. */}
        <Shape
          id="pulse"
          type="rectangle"
          start={0}
          duration={5}
          width={200}
          height={130}
          cornerRadius={14}
          fill="#f25f5c"
          box={{ x: 760, y: 240, origin: "center" }}
          transform={{
            opacity: {
              type: "loop",
              direction: "alternate",
              keys: [
                { at: 0, value: 1, easing: "easeInOut" },
                { at: 0.6, value: 0.25 },
              ],
            },
          }}
        />
      </Track>
      <Track id="labels" layout="free">
        <Title id="l1" start={0} duration={5} box={{ x: 200, y: 400, origin: "center" }} style={{ size: 24 }}>
          wiggle
        </Title>
        <Title id="l2" start={0} duration={5} box={{ x: 480, y: 400, origin: "center" }} style={{ size: 24 }}>
          drift
        </Title>
        <Title id="l3" start={0} duration={5} box={{ x: 760, y: 400, origin: "center" }} style={{ size: 24 }}>
          loop
        </Title>
      </Track>
    </Composition>
  );
}
typeWhat it doesIts params
wiggleA smooth wobble added to the value. It never repeats exactly.amount: the most it adds or takes away, in the value's own units (degrees for a rotation, pixels for box.x). frequency: wobbles a second, 1 when left out. seed: which wobble.
driftA steady change added to the value, from the element's start.speed: how much it adds each second.
loopA key list played again and again.keys: two or more. direction, in CSS's words (animation-direction): normal (the default) plays the keys forward each pass, reverse backward each pass, alternate forward then backward, alternateReverse backward then forward. iterationCount: how many passes, then it holds where the last one ended (CSS's animation-fill-mode: forwards); left out, it loops for as long as the element lasts.

A wiggle and a drift are added to a base: a number, or a list of keys, so a wobble goes on top of a keyed move.

tsx
transform={{ rotation: { type: "wiggle", amount: 2 } }}                       // about the default, 0
transform={{ scale: { type: "drift", base: 0.8, speed: 0.06 } }}              // from 0.8, growing
transform={{ rotation: { type: "wiggle", amount: 3, base: [{ at: 0, value: 0 }, { at: 1, value: 90 }] } }}
transform={{ opacity: { type: "loop", direction: "alternate", keys: [{ at: 0, value: 1 }, { at: 0.6, value: 0.25 }] } }}
transform={{ scale: { type: "loop", iterationCount: 3, keys: [{ at: 0, value: 1 }, { at: 0.4, value: 1.1 }] } }} // three beats, then still
  • The same every time. A generator is worked out from the time and its params alone, so a frame is the same in the preview and the export, and scrubbing back shows what was there before.
  • Seeds. Left out, a wiggle's seed comes from the element's id and the prop, so no two elements wobble alike. Give several elements the same seed, amount and frequency to move them together: a card's frame, its picture and its label on one seed bob as one.
  • Where. Everything keys can move in transform and box, every numeric param of an effect, a camera's x, y, zoom and rotation, and a shape's width, height, stroke.thickness and stroke.dashOffset. Not speed, volume or pan: those take a number or keys.
  • On box.x and box.y a wiggle or a drift needs a base, the place it is added to; without one the element is centred and there is nothing to add to, which is an error that says so.
  • A loop's mode is the spelling before direction, and is an error now: mode: "repeat" is the default direction, normal, and mode: "pingpong" is direction: "alternate". uberscene lint --fix moves a file.
  • On a pushed camera a generator goes on top of the moves the push makes: a drift on zoom beside push closes in slowly while the camera still makes room. See the camera.

Following another element ​

A hand moves with its forearm, and the forearm with the arm. Keys copied from one to the next drift apart as soon as one of them changes. Give an overlay a follow and it moves with that one instead.

tsx
import { Composition, Shape, Title, Track } from "@uberscene/kit";

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540} background={{ type: "color", color: "#101418" }}>
      <Track id="rig" layout="free">
        {/* The upper arm hangs from its shoulder (the anchor at its top) and swings. */}
        <Shape
          id="arm"
          type="rectangle"
          start={0}
          duration={4}
          width={36}
          height={170}
          cornerRadius={18}
          fill="#e8a33d"
          box={{ x: 480, y: 110, origin: "top" }}
          transform={{
            anchor: { x: 0.5, y: 0.05 },
            rotation: {
              type: "loop",
              direction: "alternate",
              keys: [
                { at: 0, value: -35 },
                { at: 1.4, value: 35, easing: "easeInOut" },
              ],
            },
          }}
        />
        {/* The forearm's box is read in the arm's box: its elbow sits at the arm's lower end, and it bends there. */}
        <Shape
          id="forearm"
          follow="arm"
          type="rectangle"
          start={0}
          duration={4}
          width={30}
          height={150}
          cornerRadius={15}
          fill="#5bc0be"
          box={{ x: 18, y: 152, origin: "top" }}
          transform={{
            anchor: { x: 0.5, y: 0.05 },
            rotation: {
              type: "loop",
              direction: "alternate",
              keys: [
                { at: 0, value: 10 },
                { at: 0.7, value: 70, easing: "easeInOut" },
              ],
            },
          }}
        />
        {/* The hand follows the forearm, so the arm too: two links up the chain. */}
        <Shape
          id="hand"
          follow="forearm"
          type="ellipse"
          start={0}
          duration={4}
          width={56}
          height={56}
          fill="#ffffff"
          box={{ x: 15, y: 150, origin: "center" }}
        />
        {/* A label rides on the hand, and fades on its own: opacity is not handed down the chain. */}
        <Title
          id="tag"
          follow="hand"
          start={1}
          duration={3}
          box={{ x: 64, y: 28, width: 120, height: 40, origin: "left" }}
          style={{ size: 24, color: "#ffffff", align: "left" }}
          enter={{ type: "fade", duration: 0.4 }}
        >
          hello
        </Title>
      </Track>
    </Composition>
  );
}
tsx
<Shape id="arm" ... box={{ x: 480, y: 110, width: 36, height: 170, origin: "top" }} transform={{ rotation: 20 }} />
<Shape id="hand" follow="arm" ... box={{ x: 18, y: 170, origin: "center" }} />
  • Its box is read in the box of what it follows. box.x and box.y are pixels from that box's top left, before it turns or scales; a coordinate left out centres it there. Above, the hand sits at the bottom middle of the arm.
  • What it takes from what it follows: where that element is, its rotation and scale (about that element's own anchor), and its enter and exit moves, so a card that slides in brings its label with it. Each link up the chain adds its own.
  • What stays its own: opacity, crop and corner rounding. Fading the arm does not fade the hand; fade both, or give the hand the same keys.
  • Time. Each element plays its keys on its own clock. An element places its followers even outside its own start and duration: before it starts, where its entrance leaves it; after it ends, where it stood before its exit began, so a follower is not left carried off screen. The follower's own timing decides when it shows.
  • What can follow and be followed: titles, shapes, SVG, stickers and layers. Both sit on the same side of a camera: on tracks inside it, or outside. An SVG read from a file (src) can't be followed yet, since its size is only known once it is drawn; write its markup in content.
  • Mistakes the resolver names: a follow that does not exist, one that is not an overlay, an SVG read from a file, two elements on different sides of the camera, and a chain that comes back to where it started (it names every element in the circle).
  • Removing an element others follow hands its followers to what it followed, or to none, in the same edit, and writes their numbers again so they stay where they were drawn: its rotation is added to theirs and its scale multiplied in. A keyed value is taken where it stands when the follower starts. Undo puts it back.
  • The layout check and uberscene inspect report where a follower really is, after the chain, and a fix the layout check suggests is in the follower's own numbers.

Two things that move together need the same keys twice, kept in step by hand. In place of a number, a value can be a link: another element's value, read as it changes.

tsx
import { Composition, Shape, Title, Track } from "@uberscene/kit";

const LABEL = { size: 22, color: "#9aa4b1", align: "center" } as const;

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540} background={{ type: "color", color: "#101418" }}>
      <Track id="hands" layout="free">
        {/* The one that is keyed: a hand that swings back and forth. */}
        <Shape
          id="dial"
          type="rectangle"
          start={0}
          duration={6}
          width={28}
          height={150}
          cornerRadius={14}
          fill="#e8a33d"
          box={{ x: 200, y: 250, origin: "bottom" }}
          transform={{
            anchor: { x: 0.5, y: 0.92 },
            rotation: {
              type: "loop",
              direction: "alternate",
              keys: [
                { at: 0, value: -60 },
                { at: 1.5, value: 60, easing: "easeInOut" },
              ],
            },
          }}
        />
        {/* Twice the dial's turn, the other way. */}
        <Shape
          id="gear"
          type="rectangle"
          start={0}
          duration={6}
          width={28}
          height={150}
          cornerRadius={14}
          fill="#5bc0be"
          box={{ x: 480, y: 250, origin: "bottom" }}
          transform={{ anchor: { x: 0.5, y: 0.92 }, rotation: { link: "dial.transform.rotation", scale: -2 } }}
        />
        {/* The dial's turn, 0.4 s late. */}
        <Shape
          id="late"
          type="rectangle"
          start={0}
          duration={6}
          width={28}
          height={150}
          cornerRadius={14}
          fill="#ffffff"
          box={{ x: 760, y: 250, origin: "bottom" }}
          transform={{ anchor: { x: 0.5, y: 0.92 }, rotation: { link: "dial.transform.rotation", delay: 0.4 } }}
        />
        {/* A link reads any number: the bar's width is the dial's angle, three pixels a degree, about 300 px. */}
        <Shape
          id="meter"
          type="rectangle"
          start={0}
          duration={6}
          width={{ link: "dial.transform.rotation", scale: 3, offset: 300 }}
          height={18}
          cornerRadius={9}
          fill="#e8a33d"
          box={{ x: 180, y: 440, origin: "left" }}
        />
      </Track>
      <Track id="labels" layout="free">
        <Title
          id="l1"
          start={0}
          duration={6}
          box={{ x: 200, y: 290, width: 240, height: 34, origin: "top" }}
          style={LABEL}
        >
          keyed
        </Title>
        <Title
          id="l2"
          start={0}
          duration={6}
          box={{ x: 480, y: 290, width: 240, height: 34, origin: "top" }}
          style={LABEL}
        >
          scale: -2
        </Title>
        <Title
          id="l3"
          start={0}
          duration={6}
          box={{ x: 760, y: 290, width: 240, height: 34, origin: "top" }}
          style={LABEL}
        >
          delay: 0.4
        </Title>
        <Title
          id="l4"
          start={0}
          duration={6}
          box={{ x: 180, y: 486, width: 420, height: 34, origin: "left" }}
          style={{ ...LABEL, align: "left" }}
        >
          width, linked to the angle
        </Title>
      </Track>
    </Composition>
  );
}
tsx
<Shape id="dial" ... transform={{ rotation: [{ at: 0, value: -60 }, { at: 1.5, value: 60 }] }} />
<Shape id="gear" ... transform={{ rotation: { link: "dial.transform.rotation", scale: -2 } }} />
<Shape id="late" ... transform={{ rotation: { link: "dial.transform.rotation", delay: 0.4 } }} />
<Shape id="meter" ... width={{ link: "dial.transform.rotation", scale: 3, offset: 300 }} />
FieldWhat it does
linkThe value to read: an element's id, then the path of the value as it is written on that element (dial.transform.rotation, card.box.x, logo.width, cam.zoom, shot.effects.0.radius).
scaleWhat the value read is multiplied by. Left out, 1.
offsetWhat is added after scale, in the linking value's own units. Left out, 0.
delayHow many seconds late it runs: the value the other one had that long ago. Left out, 0.
  • Whatever is written there. A link reads a number, keys, a wiggle, a drift, a loop, or another link. A value nothing is written at reads as what it is anyway (a rotation of 0, an opacity of 1, a scale of 1).
  • The same moment of the video. Two elements that start at different times each count their keys from their own start; a link reads the other element at the moment being drawn, not at the same time into it. Before the other element's first key, and after its last, the link holds that key's value, as keys do.
  • Where. Every number keys can move: in transform and box, a shape's width, height, stroke.thickness and stroke.dashOffset, a camera's x, y, zoom and rotation, a sound's volume and pan, and every numeric param of an effect. { link: "logo.transform.scale" } on a scale links both axes. Not a colour or a shape's points, and not speed.
  • A link is the whole value. It has no base, and it takes no keys of its own: the key actions refuse a linked value and say where its keys are. To change the motion, change the value it names, or scale and offset.
  • Mistakes the resolver names: an element that does not exist, a path that element does not have, a value that is not a number, a place nothing is written at (box.x on a centred element), and a circle of links, which is reported once with the links it goes through. Two elements may read different values of each other.
  • On a pushed camera x, y and zoom are the push's, so they cannot be linked; rotation can.
  • Removing the element a link names writes what the link gave as keys in its place, in the same edit, so the motion stays. A key that fell before the element's own start is cut there, and a wobble is written as a wobble of the element's own. Undo puts the link back.
  • How it is read. The resolver writes a link as the keys of the value it names, as it writes a camera's push as camera keys. So the preview, the export, motion blur and the checks treat it as any keyed value.

For anything a link cannot say (one value worked out from two others, a condition), draw it in a <Layer>: props stay data, and code lives in the layer.

Effects ​

A look on an element is an entry of its effects list: its type, then its params by name.

tsx
<Clip id="shot" src="asset:espresso"
  effects={[
    { type: "exposure", stops: 0.5 },
    { type: "vignette", amount: 0.4 },
  ]} />
  • Effects run in the order of the list: the first is drawn first, and the next one works on what it made.
  • type is a built-in effect, or one the file declares with effect() (Your own effects).
  • enabled: false turns one off and keeps it in the file.
  • Clips, titles, shapes, SVG, stickers, layers, nested sequences and adjustments take effects. On an <Adjustment>, they work on everything beneath it.
tsx
import { Clip, Composition, Track } from "@uberscene/kit";

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540}>
      <Track id="main">
        <Clip id="plain" src="asset:redCup" in={18} out={19.5} fit="cover" />
        <Clip
          id="graded"
          src="asset:redCup"
          in={19.5}
          out={21}
          fit="cover"
          effects={[{ type: "grayscale" }, { type: "vignette", amount: 0.6 }]}
        />
      </Track>
    </Composition>
  );
}

Every param takes keys, so a blur can clear as the shot starts:

tsx
<Clip id="open" src="asset:city"
  effects={[{ type: "blur", radius: [{ at: 0, value: 12, easing: "easeOut" }, { at: 1, value: 0 }] }]} />

A param that is a list, such as a box [x, y, width, height], takes keys of lists: each key's value is a whole box. Effects and transitions lists every effect and its params.

Speed ramps ​

speed on a clip is a playback rate: speed={2} plays twice as fast and lasts half as long. Keys on it ramp the speed:

tsx
<Clip id="ramp" src="asset:redCup" in={15} out={23}
  speed={[{ at: 0, value: 1, easing: "easeInOutQuad" }, { at: 1, value: 4 }]} />

The clip plays at normal speed, then eases into four times as fast over its first second. Here at is seconds of the clip as it plays, and the clip lasts as long as its source takes at those speeds. Its sound follows, the pitch rising and falling with the speed.

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

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540}>
      <Track id="main">
        {/* Normal speed, easing into a four-times speed-up. */}
        <Clip
          id="ramp"
          src="asset:redCup"
          in={15}
          out={23}
          fit="cover"
          speed={[
            { at: 0, value: 1 },
            { at: 1, value: 4, easing: "easeInOutQuad" },
          ]}
        />
      </Track>
    </Composition>
  );
}

Freeze frames ​

freezes holds one frame of a clip on screen while its time stands still, then the clip plays on. Each hold is { start, duration, source }:

  • start: seconds into the clip where the hold starts.
  • duration: seconds it holds.
  • source: the time in the source of the frame held.
tsx
<Clip id="shot" src="asset:espresso" in={14} out={17}
  freezes={[{ start: 1, duration: 1, source: 15 }]} />

A second into the clip, the frame at 15 seconds of the source stays for one second. The clip is one second longer for it. The sound is silent while the frame holds. <Audio> takes freezes too.

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

export default function Video() {
  return (
    <Composition fps={30} width={960} height={540}>
      <Track id="main">
        {/* At 1 s into the clip, hold the source's frame at 15 s for one second, then play on. */}
        <Clip
          id="shot"
          src="asset:espresso"
          in={14}
          out={17}
          fit="cover"
          freezes={[{ start: 1, duration: 1, source: 15 }]}
        />
      </Track>
    </Composition>
  );
}

Volume and pan ​

volume is a gain: 1 plays the sound as it is, 0 mutes it. pan places it between the speakers, from -1 (left) to 1 (right). Both take keys:

tsx
<Audio id="bed" src="asset:music" start={0} duration="fill"
  volume={[{ at: 0, value: 0 }, { at: 2, value: 0.4 }, { at: 30, value: 0.4 }, { at: 32, value: 0.1 }]}
  pan={[{ at: 0, value: -0.5 }, { at: 4, value: 0.5 }]} />

The music comes up over two seconds, drops under the voice at 30 seconds, and drifts from left to right. For a fade at the start and end only, fade={{ in: 1, out: 2 }} is shorter; for music that drops whenever someone talks, duck does it (Captions and sound).

In the editor ​

The editor reads keys and effects where they are written. Dragging a key in the timeline changes its at; changing a value in the inspector writes it into the list. The actions find a key by the element's id, the path of the prop and its time (key/add, key/move…), and an effect by its place in the list (effect/update, effect/toggle…).

generator/set writes a generator at a path, or takes it off. The number or keys that were there become its base and stay as the value when it comes off, and the key actions go on working on those keys underneath it.

A list written by code, such as a variable or a .map, cannot be edited key by key: the editor locks the whole prop, as it does any prop the file computes.

Files written before keys were props used <Keyframe>, <Effect>, <SpeedKey> and <Freeze> children, and automation. They stop with an error that says so; uberscene lint --fix video.tsx moves them.

Next ​

MIT licensed.