Skip to content

Open-source AI podcast clipper. Generate vertical clips with face tracking and burned-in captions. CLI, MCP server, web app.

Add nine motion presets (#247)

Nika Siradze51c58bd9c63c
diff --git a/remotion/src/style/theme.test.ts b/remotion/src/style/theme.test.ts
index 9e18046..90590d5 100644
--- a/remotion/src/style/theme.test.ts
+++ b/remotion/src/style/theme.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
-import { MOTIONS, PACKS, resolveTheme } from "./theme";
+import { ENTRANCES, MOTIONS, PACKS, ROLES, resolveTheme } from "./theme";
describe("resolveTheme", () => {
it("returns null without a style", () => {
@@ -53,3 +53,21 @@ describe("caption choice", () => {
for (const motion of Object.values(MOTIONS)) expect(motion.exit).toBe("fade");
});
});
+
+describe("motion presets", () => {
+ it("name an entrance for every role and leave by fading", () => {
+ for (const [id, motion] of Object.entries(MOTIONS)) {
+ expect(Object.keys(motion.roles).sort(), id).toEqual([...ROLES].sort());
+ for (const entrance of Object.values(motion.roles)) expect(ENTRANCES, id).toContain(entrance);
+ expect(motion.exit, id).toBe("fade");
+ }
+ });
+
+ it("resolve on every pack", () => {
+ for (const pack of Object.keys(PACKS) as (keyof typeof PACKS)[]) {
+ for (const motion of Object.keys(MOTIONS) as (keyof typeof MOTIONS)[]) {
+ expect(resolveTheme({ pack, motion })?.motion).toEqual(MOTIONS[motion]);
+ }
+ }
+ });
+});
diff --git a/remotion/src/style/theme.ts b/remotion/src/style/theme.ts
index 5f850ee..23c521e 100644
--- a/remotion/src/style/theme.ts
+++ b/remotion/src/style/theme.ts
@@ -111,6 +111,51 @@ export const MOTIONS = {
frames: 10, stagger: 6, holdEvery: 2, charsPerPose: 2, ease: "linear", overshoot: 0, bounces: 0,
from: "left", textUnit: "char", camera: "none", exit: "fade",
},
+ snappy: {
+ roles: every("pop"),
+ frames: 4, stagger: 3, holdEvery: 1, charsPerPose: 4, ease: "out", overshoot: 0, bounces: 0,
+ from: "left", textUnit: "word", camera: "punch", exit: "fade",
+ },
+ elastic: {
+ roles: every("spring", { media: "scale", label: "scale" }),
+ frames: 9, stagger: 5, holdEvery: 1, charsPerPose: 3, ease: "out", overshoot: 0.6, bounces: 2,
+ from: "bottom", textUnit: "word", camera: "push", exit: "fade",
+ },
+ cinematic: {
+ roles: every("blur", { media: "fade", label: "fade" }),
+ frames: 18, stagger: 9, holdEvery: 1, charsPerPose: 2, ease: "in-out", overshoot: 0, bounces: 0,
+ from: "bottom", textUnit: "word", camera: "push", exit: "fade",
+ },
+ slide: {
+ roles: every("slide", { media: "wipe" }),
+ frames: 10, stagger: 5, holdEvery: 1, charsPerPose: 3, ease: "out", overshoot: 0, bounces: 0,
+ from: "left", textUnit: "word", camera: "track", exit: "fade",
+ },
+ reveal: {
+ roles: every("mask-circle", { title: "wipe", item: "mask-diagonal", label: "fade", strip: "wipe" }),
+ frames: 14, stagger: 6, holdEvery: 1, charsPerPose: 2, ease: "in-out", overshoot: 0, bounces: 0,
+ from: "left", textUnit: "word", camera: "none", exit: "fade",
+ },
+ split: {
+ roles: every("mask-split", { label: "fade", strip: "wipe", name: "wipe" }),
+ frames: 12, stagger: 6, holdEvery: 1, charsPerPose: 2, ease: "out", overshoot: 0, bounces: 0,
+ from: "left", textUnit: "word", camera: "push", exit: "fade",
+ },
+ typewriter: {
+ roles: every("type", { media: "pop", figure: "pop" }),
+ frames: 6, stagger: 4, holdEvery: 1, charsPerPose: 1, ease: "linear", overshoot: 0, bounces: 0,
+ from: "left", textUnit: "char", camera: "none", exit: "fade",
+ },
+ zoom: {
+ roles: every("scale", { label: "pop", strip: "wipe" }),
+ frames: 8, stagger: 4, holdEvery: 1, charsPerPose: 3, ease: "out", overshoot: 0.2, bounces: 1,
+ from: "bottom", textUnit: "word", camera: "punch", exit: "fade",
+ },
+ newsroom: {
+ roles: every("wipe", { figure: "wipe-up", media: "wipe-up", label: "pop" }),
+ frames: 9, stagger: 5, holdEvery: 1, charsPerPose: 3, ease: "out", overshoot: 0, bounces: 0,
+ from: "left", textUnit: "word", camera: "track", exit: "fade",
+ },
} satisfies Record<string, Motion>;
export type MotionId = keyof typeof MOTIONS;