agentcut 0.2.25 → 0.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +177 -148
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -5
- package/dist/config.js.map +1 -1
- package/dist/studio/agents/claude.js +3 -2
- package/dist/studio/agents/claude.js.map +1 -1
- package/dist/studio/chat.js +1 -1
- package/dist/studio/chat.js.map +1 -1
- package/dist/studio/cli.js +40 -21
- package/dist/studio/cli.js.map +1 -1
- package/dist/studio/download.d.ts +24 -0
- package/dist/studio/download.js +234 -0
- package/dist/studio/download.js.map +1 -0
- package/dist/studio/host.d.ts +1 -2
- package/dist/studio/host.js +36 -8
- package/dist/studio/host.js.map +1 -1
- package/dist/studio/housekeeping.d.ts +2 -2
- package/dist/studio/housekeeping.js +18 -17
- package/dist/studio/housekeeping.js.map +1 -1
- package/dist/studio/mcp-guides.js +1 -18
- package/dist/studio/mcp-guides.js.map +1 -1
- package/dist/studio/proc.js +16 -6
- package/dist/studio/proc.js.map +1 -1
- package/dist/studio/proxies.d.ts +4 -0
- package/dist/studio/proxies.js +15 -6
- package/dist/studio/proxies.js.map +1 -1
- package/dist/studio/release-cursor.js +21 -21
- package/dist/studio/release-video.js +10 -10
- package/dist/studio/schema.d.ts +0 -1
- package/dist/studio/schema.js +0 -1
- package/dist/studio/schema.js.map +1 -1
- package/dist/studio/tools.d.ts +0 -4
- package/dist/studio/tools.js +32 -31
- package/dist/studio/tools.js.map +1 -1
- package/dist/studio/voice/kokoro-catalog.d.ts +56 -28
- package/dist/studio/voice/kokoro-catalog.js +56 -28
- package/dist/studio/voice/kokoro-catalog.js.map +1 -1
- package/dist/studio/voice/ming-catalog.d.ts +19 -0
- package/dist/studio/voice/ming-catalog.js +40 -0
- package/dist/studio/voice/ming-catalog.js.map +1 -0
- package/dist/studio/voice/ming.d.ts +12 -0
- package/dist/studio/voice/ming.js +397 -0
- package/dist/studio/voice/ming.js.map +1 -0
- package/dist/studio/voice/previews.d.ts +5 -0
- package/dist/studio/voice/previews.js +50 -0
- package/dist/studio/voice/previews.js.map +1 -0
- package/dist/studio/voice/registry.js +2 -0
- package/dist/studio/voice/registry.js.map +1 -1
- package/dist/studio/voice.d.ts +1 -1
- package/dist/studio/voice.js +5 -6
- package/dist/studio/voice.js.map +1 -1
- package/package.json +56 -56
- package/template/AGENTS.md +14 -14
- package/template/components/README.md +70 -70
- package/template/components/before-after/BeforeAfter.tsx +89 -89
- package/template/components/catalog.ts +107 -107
- package/template/components/cinematic/Device3D.tsx +324 -324
- package/template/components/cinematic/devices3d/display-model.ts +184 -184
- package/template/components/cinematic/devices3d/iphone-model.ts +643 -643
- package/template/components/cinematic/devices3d/macbook-model.ts +608 -608
- package/template/components/cinematic/devices3d/models.ts +657 -657
- package/template/components/cinematic/devices3d/runtime.ts +267 -267
- package/template/components/cinematic/math.ts +100 -100
- package/template/components/color/grade-effect.ts +650 -650
- package/template/components/color/grade.ts +512 -512
- package/template/components/color/looks.ts +154 -154
- package/template/components/countdown/Countdown.tsx +166 -166
- package/template/components/dot-trace-title/DotTraceTitle.tsx +181 -181
- package/template/components/dot-trace-title/meta.json +51 -51
- package/template/components/generate/GenerateReveal.tsx +381 -381
- package/template/components/hook-card/HookCard.tsx +554 -554
- package/template/components/index.ts +199 -199
- package/template/components/lib.ts +191 -191
- package/template/components/line-diagram/LineDiagram.tsx +205 -205
- package/template/components/line-diagram/meta.json +215 -215
- package/template/components/list-card/ListCard.tsx +104 -104
- package/template/components/live-clip.ts +75 -75
- package/template/components/looks.tsx +1447 -1447
- package/template/components/loops/LoopCanvas.tsx +132 -132
- package/template/components/loops/engine.ts +184 -184
- package/template/components/loops/library.ts +667 -667
- package/template/components/loops/library2.ts +777 -777
- package/template/components/motion-loop/MotionLoop.tsx +37 -37
- package/template/components/motion-loop/meta.json +311 -311
- package/template/components/props.ts +73 -73
- package/template/components/quote-card/QuoteCard.tsx +71 -71
- package/template/components/style-layer.tsx +233 -233
- package/template/components/styles.ts +113 -113
- package/template/components/types.ts +66 -66
- package/template/components/word-pop/WordPop.tsx +59 -59
- package/template/components/word-stack/WordStack.tsx +122 -122
- package/template/presets/charcoal-sketch/PROMPT.md +48 -48
- package/template/presets/charcoal-sketch/scripts/duck_music.py +34 -34
- package/template/presets/punk-cut-paper/scenes/Motif.tsx +376 -376
- package/template/presets/punk-cut-paper/scenes/Photo.tsx +73 -73
- package/template/presets/punk-cut-paper/scenes/Ransom.tsx +119 -119
- package/template/runtime/composition.tsx +1189 -1185
- package/template/runtime/helpers.tsx +230 -230
- package/template/runtime/index.tsx +22 -22
- package/template/runtime/types.ts +315 -315
- package/template/skill/SKILL.md +186 -351
- package/template/skill/references/broll.md +44 -44
- package/template/skill/references/browser-export.md +61 -61
- package/template/skill/references/cinematic.md +206 -206
- package/template/skill/references/color.md +79 -79
- package/template/skill/references/craft.md +54 -10
- package/template/skill/references/editing-styles.md +57 -57
- package/template/skill/references/feature-launch.md +5 -1
- package/template/skill/references/footage.md +72 -72
- package/template/skill/references/format.md +142 -142
- package/template/skill/references/how-to.md +0 -15
- package/template/skill/references/launch-direction.md +89 -0
- package/template/skill/references/loops.md +151 -151
- package/template/skill/references/mcp-external.md +19 -0
- package/template/skill/references/performance.md +93 -93
- package/template/skill/references/person-cutout.md +19 -19
- package/template/skill/references/presets.md +60 -60
- package/template/skill/references/product-launch.md +4 -1
- package/template/skill/references/release-capture.md +53 -0
- package/template/skill/references/sound.md +167 -155
- package/template/skill/references/style-spy.md +160 -160
- package/template/skill/references/website-howto.md +45 -45
- package/template/starter/.studio/chat.json +1 -1
- package/template/starter/layers.json +46 -46
- package/template/starter/notes.md +4 -4
- package/template/starter/project.json +13 -13
- package/template/starter/scenes/Title.tsx +38 -38
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
// Project styles: one look for a whole video. A project picks one in project.json (`"style": "loud"`)
|
|
2
|
-
// and every prop tagged with a token in its meta.json (`"style": "accent"`) follows it unless the
|
|
3
|
-
// clip sets that prop itself. Captions and text clips follow it too. The styles themselves live in
|
|
4
|
-
// styles.json (the helper reads it too). Metadata only (no React).
|
|
5
|
-
import stylesData from "./styles.json";
|
|
6
|
-
import type { PropSpec, PropValues } from "./types";
|
|
7
|
-
|
|
8
|
-
/** What a style decides. Props opt in with `"style": "<token>"` in their meta.json. */
|
|
9
|
-
export type StyleToken =
|
|
10
|
-
/** Graphic language of the talking-head components (looks.tsx): ink, paper, notebook, crt, clean. */
|
|
11
|
-
| "look"
|
|
12
|
-
/** Headline font: FONTS keys in order of preference ("condensed,wide"); the first the prop offers wins. */
|
|
13
|
-
| "font"
|
|
14
|
-
/** Headline weight; the prop's nearest option is used. */
|
|
15
|
-
| "weight"
|
|
16
|
-
/** Text over footage. */
|
|
17
|
-
| "text"
|
|
18
|
-
| "accent"
|
|
19
|
-
/** Text sitting on the accent color (marker highlights). */
|
|
20
|
-
| "onAccent"
|
|
21
|
-
/** Card / panel fill behind small text. */
|
|
22
|
-
| "panel"
|
|
23
|
-
/** Text on that panel. */
|
|
24
|
-
| "panelText"
|
|
25
|
-
/** Borders, hard shadows and pen strokes. */
|
|
26
|
-
| "line"
|
|
27
|
-
/** "dark" or "light" UI cards. */
|
|
28
|
-
| "theme"
|
|
29
|
-
/** Fill of full-frame components. */
|
|
30
|
-
| "backdrop";
|
|
31
|
-
|
|
32
|
-
export interface MotionStyle {
|
|
33
|
-
id: string;
|
|
34
|
-
name: string;
|
|
35
|
-
/** One line: what it looks like. */
|
|
36
|
-
description: string;
|
|
37
|
-
/** Graphic language of the talking-head components, captions and overlay (looks.tsx). */
|
|
38
|
-
look: "ink" | "paper" | "notebook" | "crt" | "neon" | "line" | "vhs" | "clean";
|
|
39
|
-
tokens: Record<StyleToken, string>;
|
|
40
|
-
/**
|
|
41
|
-
* Camera on footage clips (style-layer.tsx): "punch" jump-cut zooms with a shake, "snap"
|
|
42
|
-
* stop-motion steps, "drift" a slow push-in, "glitch" jumps, "still" none. `every` in frames.
|
|
43
|
-
*/
|
|
44
|
-
camera: {
|
|
45
|
-
mode: "punch" | "snap" | "drift" | "glitch" | "tape" | "still";
|
|
46
|
-
zoom: number;
|
|
47
|
-
every: number;
|
|
48
|
-
shake: number;
|
|
49
|
-
/** A color grade for the footage, as a CSS filter ("saturate(1.2) sepia(0.2)"). */
|
|
50
|
-
grade?: string;
|
|
51
|
-
};
|
|
52
|
-
/** Texture over the whole video. */
|
|
53
|
-
overlay: { kind: "grain" | "scanlines" | "neon" | "vhs" | "vignette" | "none"; amount: number };
|
|
54
|
-
/**
|
|
55
|
-
* Caption tracks: drawn in the look (position, words per line). The font and colors are the
|
|
56
|
-
* fallback for pages that can't draw the look.
|
|
57
|
-
*/
|
|
58
|
-
captions: {
|
|
59
|
-
fontFamily: string;
|
|
60
|
-
fontWeight: number;
|
|
61
|
-
color: string;
|
|
62
|
-
highlight: string;
|
|
63
|
-
preset: "pop" | "karaoke" | "plain";
|
|
64
|
-
position: "top" | "center" | "lower" | "bottom";
|
|
65
|
-
wordsPerLine: number;
|
|
66
|
-
};
|
|
67
|
-
/** Defaults for text clips. */
|
|
68
|
-
text: { fontFamily: string; fontWeight: number; color: string };
|
|
69
|
-
/** How to edit in this style: pacing, camera, positions (for Claude and the style picker). */
|
|
70
|
-
guide: string[];
|
|
71
|
-
/** The component to reach for, by job in the edit, with the props that make it this style. */
|
|
72
|
-
shots: { job: string; component: string; props?: PropValues }[];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export const MOTION_STYLES: Record<string, MotionStyle> = Object.fromEntries(
|
|
76
|
-
(stylesData as unknown as MotionStyle[]).map((style) => [style.id, style]),
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
export const STYLE_TOKENS: StyleToken[] = [
|
|
80
|
-
"look",
|
|
81
|
-
"font",
|
|
82
|
-
"weight",
|
|
83
|
-
"text",
|
|
84
|
-
"accent",
|
|
85
|
-
"onAccent",
|
|
86
|
-
"panel",
|
|
87
|
-
"panelText",
|
|
88
|
-
"line",
|
|
89
|
-
"theme",
|
|
90
|
-
"backdrop",
|
|
91
|
-
];
|
|
92
|
-
|
|
93
|
-
export function getMotionStyle(id: string | null | undefined): MotionStyle | null {
|
|
94
|
-
return (id && MOTION_STYLES[id]) || null;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/** The style's value for one prop, if the prop follows that token and the value fits the prop. */
|
|
98
|
-
export function styleValueFor(spec: PropSpec, style: MotionStyle | null): PropValues[string] | undefined {
|
|
99
|
-
if (!style || !spec.style) return undefined;
|
|
100
|
-
const value = style.tokens[spec.style];
|
|
101
|
-
if (spec.type === "select") {
|
|
102
|
-
const options = spec.options.map((o) => o.value);
|
|
103
|
-
if (spec.style === "weight") {
|
|
104
|
-
const target = Number(value);
|
|
105
|
-
const numeric = options.filter((o) => Number.isFinite(Number(o)));
|
|
106
|
-
if (!numeric.length || !Number.isFinite(target)) return undefined;
|
|
107
|
-
return numeric.reduce((best, o) => (Math.abs(Number(o) - target) < Math.abs(Number(best) - target) ? o : best));
|
|
108
|
-
}
|
|
109
|
-
return value.split(",").map((v) => v.trim()).find((v) => options.includes(v));
|
|
110
|
-
}
|
|
111
|
-
if (spec.type === "color" || spec.type === "text") return value;
|
|
112
|
-
return undefined;
|
|
113
|
-
}
|
|
1
|
+
// Project styles: one look for a whole video. A project picks one in project.json (`"style": "loud"`)
|
|
2
|
+
// and every prop tagged with a token in its meta.json (`"style": "accent"`) follows it unless the
|
|
3
|
+
// clip sets that prop itself. Captions and text clips follow it too. The styles themselves live in
|
|
4
|
+
// styles.json (the helper reads it too). Metadata only (no React).
|
|
5
|
+
import stylesData from "./styles.json";
|
|
6
|
+
import type { PropSpec, PropValues } from "./types";
|
|
7
|
+
|
|
8
|
+
/** What a style decides. Props opt in with `"style": "<token>"` in their meta.json. */
|
|
9
|
+
export type StyleToken =
|
|
10
|
+
/** Graphic language of the talking-head components (looks.tsx): ink, paper, notebook, crt, clean. */
|
|
11
|
+
| "look"
|
|
12
|
+
/** Headline font: FONTS keys in order of preference ("condensed,wide"); the first the prop offers wins. */
|
|
13
|
+
| "font"
|
|
14
|
+
/** Headline weight; the prop's nearest option is used. */
|
|
15
|
+
| "weight"
|
|
16
|
+
/** Text over footage. */
|
|
17
|
+
| "text"
|
|
18
|
+
| "accent"
|
|
19
|
+
/** Text sitting on the accent color (marker highlights). */
|
|
20
|
+
| "onAccent"
|
|
21
|
+
/** Card / panel fill behind small text. */
|
|
22
|
+
| "panel"
|
|
23
|
+
/** Text on that panel. */
|
|
24
|
+
| "panelText"
|
|
25
|
+
/** Borders, hard shadows and pen strokes. */
|
|
26
|
+
| "line"
|
|
27
|
+
/** "dark" or "light" UI cards. */
|
|
28
|
+
| "theme"
|
|
29
|
+
/** Fill of full-frame components. */
|
|
30
|
+
| "backdrop";
|
|
31
|
+
|
|
32
|
+
export interface MotionStyle {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
/** One line: what it looks like. */
|
|
36
|
+
description: string;
|
|
37
|
+
/** Graphic language of the talking-head components, captions and overlay (looks.tsx). */
|
|
38
|
+
look: "ink" | "paper" | "notebook" | "crt" | "neon" | "line" | "vhs" | "clean";
|
|
39
|
+
tokens: Record<StyleToken, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Camera on footage clips (style-layer.tsx): "punch" jump-cut zooms with a shake, "snap"
|
|
42
|
+
* stop-motion steps, "drift" a slow push-in, "glitch" jumps, "still" none. `every` in frames.
|
|
43
|
+
*/
|
|
44
|
+
camera: {
|
|
45
|
+
mode: "punch" | "snap" | "drift" | "glitch" | "tape" | "still";
|
|
46
|
+
zoom: number;
|
|
47
|
+
every: number;
|
|
48
|
+
shake: number;
|
|
49
|
+
/** A color grade for the footage, as a CSS filter ("saturate(1.2) sepia(0.2)"). */
|
|
50
|
+
grade?: string;
|
|
51
|
+
};
|
|
52
|
+
/** Texture over the whole video. */
|
|
53
|
+
overlay: { kind: "grain" | "scanlines" | "neon" | "vhs" | "vignette" | "none"; amount: number };
|
|
54
|
+
/**
|
|
55
|
+
* Caption tracks: drawn in the look (position, words per line). The font and colors are the
|
|
56
|
+
* fallback for pages that can't draw the look.
|
|
57
|
+
*/
|
|
58
|
+
captions: {
|
|
59
|
+
fontFamily: string;
|
|
60
|
+
fontWeight: number;
|
|
61
|
+
color: string;
|
|
62
|
+
highlight: string;
|
|
63
|
+
preset: "pop" | "karaoke" | "plain";
|
|
64
|
+
position: "top" | "center" | "lower" | "bottom";
|
|
65
|
+
wordsPerLine: number;
|
|
66
|
+
};
|
|
67
|
+
/** Defaults for text clips. */
|
|
68
|
+
text: { fontFamily: string; fontWeight: number; color: string };
|
|
69
|
+
/** How to edit in this style: pacing, camera, positions (for Claude and the style picker). */
|
|
70
|
+
guide: string[];
|
|
71
|
+
/** The component to reach for, by job in the edit, with the props that make it this style. */
|
|
72
|
+
shots: { job: string; component: string; props?: PropValues }[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const MOTION_STYLES: Record<string, MotionStyle> = Object.fromEntries(
|
|
76
|
+
(stylesData as unknown as MotionStyle[]).map((style) => [style.id, style]),
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
export const STYLE_TOKENS: StyleToken[] = [
|
|
80
|
+
"look",
|
|
81
|
+
"font",
|
|
82
|
+
"weight",
|
|
83
|
+
"text",
|
|
84
|
+
"accent",
|
|
85
|
+
"onAccent",
|
|
86
|
+
"panel",
|
|
87
|
+
"panelText",
|
|
88
|
+
"line",
|
|
89
|
+
"theme",
|
|
90
|
+
"backdrop",
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
export function getMotionStyle(id: string | null | undefined): MotionStyle | null {
|
|
94
|
+
return (id && MOTION_STYLES[id]) || null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** The style's value for one prop, if the prop follows that token and the value fits the prop. */
|
|
98
|
+
export function styleValueFor(spec: PropSpec, style: MotionStyle | null): PropValues[string] | undefined {
|
|
99
|
+
if (!style || !spec.style) return undefined;
|
|
100
|
+
const value = style.tokens[spec.style];
|
|
101
|
+
if (spec.type === "select") {
|
|
102
|
+
const options = spec.options.map((o) => o.value);
|
|
103
|
+
if (spec.style === "weight") {
|
|
104
|
+
const target = Number(value);
|
|
105
|
+
const numeric = options.filter((o) => Number.isFinite(Number(o)));
|
|
106
|
+
if (!numeric.length || !Number.isFinite(target)) return undefined;
|
|
107
|
+
return numeric.reduce((best, o) => (Math.abs(Number(o) - target) < Math.abs(Number(best) - target) ? o : best));
|
|
108
|
+
}
|
|
109
|
+
return value.split(",").map((v) => v.trim()).find((v) => options.includes(v));
|
|
110
|
+
}
|
|
111
|
+
if (spec.type === "color" || spec.type === "text") return value;
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
// The Agentcut motion component library: ready-made Remotion animations that people and Claude
|
|
2
|
-
// drop on the timeline and tune through props. One folder per component (see README.md).
|
|
3
|
-
import type { ComponentType } from "react";
|
|
4
|
-
import type { StyleToken } from "./styles";
|
|
5
|
-
|
|
6
|
-
/** One editable prop. The same description drives the inspector form, the gallery and Claude's catalog. */
|
|
7
|
-
export type PropSpec = (
|
|
8
|
-
| { type: "text"; label: string; default: string; multiline?: boolean; maxLength?: number; help?: string }
|
|
9
|
-
| { type: "lines"; label: string; default: string[]; max?: number; help?: string }
|
|
10
|
-
| { type: "color"; label: string; default: string; help?: string }
|
|
11
|
-
| { type: "number"; label: string; default: number; min: number; max: number; step: number; unit?: string; help?: string }
|
|
12
|
-
| { type: "select"; label: string; default: string; options: { value: string; label: string }[]; help?: string }
|
|
13
|
-
| { type: "boolean"; label: string; default: boolean; help?: string }
|
|
14
|
-
) & {
|
|
15
|
-
/** Follows this token of the project's style when the clip doesn't set it (see styles.ts). */
|
|
16
|
-
style?: StyleToken;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type PropValues = Record<string, string | string[] | number | boolean>;
|
|
20
|
-
|
|
21
|
-
export interface ComponentMeta {
|
|
22
|
-
/** kebab-case, matches the folder name: the `component` value in layers.json. */
|
|
23
|
-
id: string;
|
|
24
|
-
name: string;
|
|
25
|
-
category: ComponentCategory;
|
|
26
|
-
/** One sentence: what it is. */
|
|
27
|
-
description: string;
|
|
28
|
-
/** When to reach for it (Claude reads this). */
|
|
29
|
-
useWhen: string;
|
|
30
|
-
/** Good length at 30 fps; it adapts to any clip length. */
|
|
31
|
-
durationInFrames: number;
|
|
32
|
-
/** "overlay": sits over other layers (transparent background). "full": fills the frame. */
|
|
33
|
-
layer: "overlay" | "full";
|
|
34
|
-
tags: string[];
|
|
35
|
-
props: Record<string, PropSpec>;
|
|
36
|
-
/** Named prop sets: gallery variations and examples Claude can copy. */
|
|
37
|
-
examples: { name: string; props: PropValues }[];
|
|
38
|
-
/** Where the still preview sits, as a fraction of the duration (default 0.55): pick a sharp, fully-in moment. */
|
|
39
|
-
stillAt?: number;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export type ComponentCategory =
|
|
43
|
-
| "Talking Head"
|
|
44
|
-
| "Text & Titles"
|
|
45
|
-
| "Overlays"
|
|
46
|
-
| "Charts & Stats"
|
|
47
|
-
| "AI & Product"
|
|
48
|
-
| "Backgrounds"
|
|
49
|
-
| "Transitions";
|
|
50
|
-
|
|
51
|
-
/** What every component receives besides its own props. */
|
|
52
|
-
export interface MotionBaseProps {
|
|
53
|
-
width: number;
|
|
54
|
-
height: number;
|
|
55
|
-
fps: number;
|
|
56
|
-
/** Length of the clip on the timeline (local frames 0…durationInFrames-1). */
|
|
57
|
-
durationInFrames: number;
|
|
58
|
-
/** "wide", "mobile", … */
|
|
59
|
-
variant: string;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface MotionComponent {
|
|
63
|
-
meta: ComponentMeta;
|
|
64
|
-
// Props are resolved (defaults filled in) before the component renders.
|
|
65
|
-
Component: ComponentType<MotionBaseProps & PropValues>;
|
|
66
|
-
}
|
|
1
|
+
// The Agentcut motion component library: ready-made Remotion animations that people and Claude
|
|
2
|
+
// drop on the timeline and tune through props. One folder per component (see README.md).
|
|
3
|
+
import type { ComponentType } from "react";
|
|
4
|
+
import type { StyleToken } from "./styles";
|
|
5
|
+
|
|
6
|
+
/** One editable prop. The same description drives the inspector form, the gallery and Claude's catalog. */
|
|
7
|
+
export type PropSpec = (
|
|
8
|
+
| { type: "text"; label: string; default: string; multiline?: boolean; maxLength?: number; help?: string }
|
|
9
|
+
| { type: "lines"; label: string; default: string[]; max?: number; help?: string }
|
|
10
|
+
| { type: "color"; label: string; default: string; help?: string }
|
|
11
|
+
| { type: "number"; label: string; default: number; min: number; max: number; step: number; unit?: string; help?: string }
|
|
12
|
+
| { type: "select"; label: string; default: string; options: { value: string; label: string }[]; help?: string }
|
|
13
|
+
| { type: "boolean"; label: string; default: boolean; help?: string }
|
|
14
|
+
) & {
|
|
15
|
+
/** Follows this token of the project's style when the clip doesn't set it (see styles.ts). */
|
|
16
|
+
style?: StyleToken;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type PropValues = Record<string, string | string[] | number | boolean>;
|
|
20
|
+
|
|
21
|
+
export interface ComponentMeta {
|
|
22
|
+
/** kebab-case, matches the folder name: the `component` value in layers.json. */
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
category: ComponentCategory;
|
|
26
|
+
/** One sentence: what it is. */
|
|
27
|
+
description: string;
|
|
28
|
+
/** When to reach for it (Claude reads this). */
|
|
29
|
+
useWhen: string;
|
|
30
|
+
/** Good length at 30 fps; it adapts to any clip length. */
|
|
31
|
+
durationInFrames: number;
|
|
32
|
+
/** "overlay": sits over other layers (transparent background). "full": fills the frame. */
|
|
33
|
+
layer: "overlay" | "full";
|
|
34
|
+
tags: string[];
|
|
35
|
+
props: Record<string, PropSpec>;
|
|
36
|
+
/** Named prop sets: gallery variations and examples Claude can copy. */
|
|
37
|
+
examples: { name: string; props: PropValues }[];
|
|
38
|
+
/** Where the still preview sits, as a fraction of the duration (default 0.55): pick a sharp, fully-in moment. */
|
|
39
|
+
stillAt?: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type ComponentCategory =
|
|
43
|
+
| "Talking Head"
|
|
44
|
+
| "Text & Titles"
|
|
45
|
+
| "Overlays"
|
|
46
|
+
| "Charts & Stats"
|
|
47
|
+
| "AI & Product"
|
|
48
|
+
| "Backgrounds"
|
|
49
|
+
| "Transitions";
|
|
50
|
+
|
|
51
|
+
/** What every component receives besides its own props. */
|
|
52
|
+
export interface MotionBaseProps {
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
fps: number;
|
|
56
|
+
/** Length of the clip on the timeline (local frames 0…durationInFrames-1). */
|
|
57
|
+
durationInFrames: number;
|
|
58
|
+
/** "wide", "mobile", … */
|
|
59
|
+
variant: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface MotionComponent {
|
|
63
|
+
meta: ComponentMeta;
|
|
64
|
+
// Props are resolved (defaults filled in) before the component renders.
|
|
65
|
+
Component: ComponentType<MotionBaseProps & PropValues>;
|
|
66
|
+
}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { AbsoluteFill, useCurrentFrame } from "remotion";
|
|
2
|
-
import { exitOut, splitHighlights, unit } from "../lib";
|
|
3
|
-
import { Chip, lookKit, type LookProps } from "../looks";
|
|
4
|
-
import type { MotionBaseProps } from "../types";
|
|
5
|
-
|
|
6
|
-
type Props = MotionBaseProps &
|
|
7
|
-
LookProps & {
|
|
8
|
-
lines: string[];
|
|
9
|
-
position: string;
|
|
10
|
-
size: number;
|
|
11
|
-
stagger: number;
|
|
12
|
-
tilt: boolean;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const POSITION_Y: Record<string, number> = { top: 0.16, center: 0.5, lower: 0.68, bottom: 0.82 };
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* A punchy phrase over the speaker, word by word, in the project's look: boxed and tilted (ink),
|
|
19
|
-
* ransom-note scraps (paper), handwriting with a marker (notebook), terminal text (crt) or a pill.
|
|
20
|
-
*/
|
|
21
|
-
export function WordPop(props: Props) {
|
|
22
|
-
const frame = useCurrentFrame();
|
|
23
|
-
const { width, height, fps, durationInFrames: d } = props;
|
|
24
|
-
const u = unit(width, height);
|
|
25
|
-
const kit = lookKit(props, u);
|
|
26
|
-
const fontSize = (props.size / 100) * Math.min(width, height);
|
|
27
|
-
const out = exitOut(frame, d, 8);
|
|
28
|
-
// Each line starts once the words of the lines above are in.
|
|
29
|
-
const starts = props.lines.map((_, i) =>
|
|
30
|
-
props.lines.slice(0, i).reduce((sum, line) => sum + splitHighlights(line).length * props.stagger + 2, 0),
|
|
31
|
-
);
|
|
32
|
-
return (
|
|
33
|
-
<AbsoluteFill style={{ opacity: out }}>
|
|
34
|
-
<div
|
|
35
|
-
style={{
|
|
36
|
-
position: "absolute",
|
|
37
|
-
left: "6%",
|
|
38
|
-
right: "6%",
|
|
39
|
-
top: `${(POSITION_Y[props.position] ?? 0.68) * 100}%`,
|
|
40
|
-
transform: "translateY(-50%)",
|
|
41
|
-
display: "flex",
|
|
42
|
-
flexDirection: "column",
|
|
43
|
-
alignItems: "center",
|
|
44
|
-
gap: fontSize * 0.3,
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
47
|
-
{props.lines.map((line, i) => {
|
|
48
|
-
const start = starts[i];
|
|
49
|
-
const tilt = props.tilt && (kit.look === "ink" || kit.look === "paper") ? (i % 2 === 0 ? -2.5 : 2) : 0;
|
|
50
|
-
return (
|
|
51
|
-
<div key={i} style={{ transform: `rotate(${tilt}deg)` }}>
|
|
52
|
-
<Chip kit={kit} line={line} fontSize={fontSize} frame={frame} fps={fps} start={start} stagger={props.stagger} seed={i + 1} />
|
|
53
|
-
</div>
|
|
54
|
-
);
|
|
55
|
-
})}
|
|
56
|
-
</div>
|
|
57
|
-
</AbsoluteFill>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
1
|
+
import { AbsoluteFill, useCurrentFrame } from "remotion";
|
|
2
|
+
import { exitOut, splitHighlights, unit } from "../lib";
|
|
3
|
+
import { Chip, lookKit, type LookProps } from "../looks";
|
|
4
|
+
import type { MotionBaseProps } from "../types";
|
|
5
|
+
|
|
6
|
+
type Props = MotionBaseProps &
|
|
7
|
+
LookProps & {
|
|
8
|
+
lines: string[];
|
|
9
|
+
position: string;
|
|
10
|
+
size: number;
|
|
11
|
+
stagger: number;
|
|
12
|
+
tilt: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const POSITION_Y: Record<string, number> = { top: 0.16, center: 0.5, lower: 0.68, bottom: 0.82 };
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A punchy phrase over the speaker, word by word, in the project's look: boxed and tilted (ink),
|
|
19
|
+
* ransom-note scraps (paper), handwriting with a marker (notebook), terminal text (crt) or a pill.
|
|
20
|
+
*/
|
|
21
|
+
export function WordPop(props: Props) {
|
|
22
|
+
const frame = useCurrentFrame();
|
|
23
|
+
const { width, height, fps, durationInFrames: d } = props;
|
|
24
|
+
const u = unit(width, height);
|
|
25
|
+
const kit = lookKit(props, u);
|
|
26
|
+
const fontSize = (props.size / 100) * Math.min(width, height);
|
|
27
|
+
const out = exitOut(frame, d, 8);
|
|
28
|
+
// Each line starts once the words of the lines above are in.
|
|
29
|
+
const starts = props.lines.map((_, i) =>
|
|
30
|
+
props.lines.slice(0, i).reduce((sum, line) => sum + splitHighlights(line).length * props.stagger + 2, 0),
|
|
31
|
+
);
|
|
32
|
+
return (
|
|
33
|
+
<AbsoluteFill style={{ opacity: out }}>
|
|
34
|
+
<div
|
|
35
|
+
style={{
|
|
36
|
+
position: "absolute",
|
|
37
|
+
left: "6%",
|
|
38
|
+
right: "6%",
|
|
39
|
+
top: `${(POSITION_Y[props.position] ?? 0.68) * 100}%`,
|
|
40
|
+
transform: "translateY(-50%)",
|
|
41
|
+
display: "flex",
|
|
42
|
+
flexDirection: "column",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
gap: fontSize * 0.3,
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
{props.lines.map((line, i) => {
|
|
48
|
+
const start = starts[i];
|
|
49
|
+
const tilt = props.tilt && (kit.look === "ink" || kit.look === "paper") ? (i % 2 === 0 ? -2.5 : 2) : 0;
|
|
50
|
+
return (
|
|
51
|
+
<div key={i} style={{ transform: `rotate(${tilt}deg)` }}>
|
|
52
|
+
<Chip kit={kit} line={line} fontSize={fontSize} frame={frame} fps={fps} start={start} stagger={props.stagger} seed={i + 1} />
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
})}
|
|
56
|
+
</div>
|
|
57
|
+
</AbsoluteFill>
|
|
58
|
+
);
|
|
59
|
+
}
|