Skip to content

mirror ​

Reflects one side of the picture onto the other.

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

// mirror: Reflects one side of the picture onto the other.
export default function Video() {
  return (
    <Composition fps={30} width={640} height={360}>
      <Track id="main">
        <Clip
          id="shot"
          src="asset:coffeeWide"
          in={4}
          out={7}
          fit="cover"
          effects={[
            {
              type: "mirror",
              position: [
                { at: 0.5, value: 1, easing: "easeInOut" },
                { at: 1.5, value: 0.5 },
              ],
            },
          ]}
        />
      </Track>
    </Composition>
  );
}

The coffee footage is Pixabay videos 209419, 209424, 46989 and 251, under the Pixabay Content License. The maker of the machine in the red cup shot has nothing to do with this project.

Params ​

Drawn as a shader.

paramtypedefaultdescription
axis"vertical" | "horizontal""vertical"Which way the mirror's line runs: vertical reflects left and right, horizontal top and bottom.
positionnumber (0..1)0.5Where the line sits, as a fraction across the frame (down it, for horizontal).
flipbooleanfalseKeep the right (or bottom) side and reflect it, instead of the left (or top).

All effects and transitions · Units

MIT licensed.