agentcut 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +11 -2
- package/dist/bridge.d.ts +45 -0
- package/dist/bridge.js +691 -0
- package/dist/bridge.js.map +1 -0
- package/dist/config.d.ts +13 -0
- package/dist/config.js +50 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/log.d.ts +1 -0
- package/dist/log.js +14 -0
- package/dist/log.js.map +1 -0
- package/dist/studio/agents/claude.d.ts +7 -0
- package/dist/studio/agents/claude.js +155 -0
- package/dist/studio/agents/claude.js.map +1 -0
- package/dist/studio/agents/codex.d.ts +4 -0
- package/dist/studio/agents/codex.js +169 -0
- package/dist/studio/agents/codex.js.map +1 -0
- package/dist/studio/agents/index.d.ts +8 -0
- package/dist/studio/agents/index.js +50 -0
- package/dist/studio/agents/index.js.map +1 -0
- package/dist/studio/agents/types.d.ts +131 -0
- package/dist/studio/agents/types.js +11 -0
- package/dist/studio/agents/types.js.map +1 -0
- package/dist/studio/bundler.d.ts +29 -0
- package/dist/studio/bundler.js +136 -0
- package/dist/studio/bundler.js.map +1 -0
- package/dist/studio/chat.d.ts +147 -0
- package/dist/studio/chat.js +681 -0
- package/dist/studio/chat.js.map +1 -0
- package/dist/studio/cli.d.ts +2 -0
- package/dist/studio/cli.js +194 -0
- package/dist/studio/cli.js.map +1 -0
- package/dist/studio/components.d.ts +4 -0
- package/dist/studio/components.js +36 -0
- package/dist/studio/components.js.map +1 -0
- package/dist/studio/host.d.ts +105 -0
- package/dist/studio/host.js +634 -0
- package/dist/studio/host.js.map +1 -0
- package/dist/studio/http.d.ts +21 -0
- package/dist/studio/http.js +240 -0
- package/dist/studio/http.js.map +1 -0
- package/dist/studio/music.d.ts +35 -0
- package/dist/studio/music.js +130 -0
- package/dist/studio/music.js.map +1 -0
- package/dist/studio/proc.d.ts +11 -0
- package/dist/studio/proc.js +69 -0
- package/dist/studio/proc.js.map +1 -0
- package/dist/studio/projects.d.ts +84 -0
- package/dist/studio/projects.js +369 -0
- package/dist/studio/projects.js.map +1 -0
- package/dist/studio/render.d.ts +24 -0
- package/dist/studio/render.js +197 -0
- package/dist/studio/render.js.map +1 -0
- package/dist/studio/reveal.d.ts +7 -0
- package/dist/studio/reveal.js +49 -0
- package/dist/studio/reveal.js.map +1 -0
- package/dist/studio/schema.d.ts +4152 -0
- package/dist/studio/schema.js +358 -0
- package/dist/studio/schema.js.map +1 -0
- package/dist/studio/tools.d.ts +2 -0
- package/dist/studio/tools.js +165 -0
- package/dist/studio/tools.js.map +1 -0
- package/dist/studio/voice.d.ts +150 -0
- package/dist/studio/voice.js +434 -0
- package/dist/studio/voice.js.map +1 -0
- package/dist/studio/workspace.d.ts +31 -0
- package/dist/studio/workspace.js +187 -0
- package/dist/studio/workspace.js.map +1 -0
- package/package.json +50 -4
- package/template/AGENTS.md +13 -0
- package/template/components/CATALOG.md +1306 -0
- package/template/components/README.md +61 -0
- package/template/components/STYLES.md +246 -0
- package/template/components/arcade-title/ArcadeTitle.tsx +860 -0
- package/template/components/arcade-title/meta.json +28 -0
- package/template/components/aurora/Aurora.tsx +63 -0
- package/template/components/aurora/meta.json +28 -0
- package/template/components/bar-wipe-title/BarWipeTitle.tsx +94 -0
- package/template/components/bar-wipe-title/meta.json +29 -0
- package/template/components/before-after/BeforeAfter.tsx +89 -0
- package/template/components/before-after/meta.json +233 -0
- package/template/components/bento-grid/BentoGrid.tsx +202 -0
- package/template/components/bento-grid/meta.json +25 -0
- package/template/components/blur-in-title/BlurInTitle.tsx +121 -0
- package/template/components/blur-in-title/meta.json +32 -0
- package/template/components/catalog.json +8730 -0
- package/template/components/catalog.ts +103 -0
- package/template/components/chat-thread/ChatThread.tsx +128 -0
- package/template/components/chat-thread/meta.json +24 -0
- package/template/components/checklist/Checklist.tsx +129 -0
- package/template/components/checklist/meta.json +25 -0
- package/template/components/confetti/Confetti.tsx +109 -0
- package/template/components/confetti/meta.json +28 -0
- package/template/components/countdown/Countdown.tsx +166 -0
- package/template/components/countdown/meta.json +28 -0
- package/template/components/cut-and-paste/CutAndPaste.tsx +654 -0
- package/template/components/cut-and-paste/meta.json +29 -0
- package/template/components/decode-text/DecodeText.tsx +97 -0
- package/template/components/decode-text/meta.json +29 -0
- package/template/components/editorial-quote/EditorialQuote.tsx +122 -0
- package/template/components/editorial-quote/meta.json +28 -0
- package/template/components/glitch-title/GlitchTitle.tsx +171 -0
- package/template/components/glitch-title/meta.json +32 -0
- package/template/components/halftone-wave/HalftoneWave.tsx +106 -0
- package/template/components/halftone-wave/meta.json +28 -0
- package/template/components/highlighter/Highlighter.tsx +142 -0
- package/template/components/highlighter/meta.json +28 -0
- package/template/components/hook-card/HookCard.tsx +552 -0
- package/template/components/hook-card/meta.json +304 -0
- package/template/components/index.ts +149 -0
- package/template/components/iris-wipe/IrisWipe.tsx +76 -0
- package/template/components/iris-wipe/meta.json +24 -0
- package/template/components/kinetic-poster/KineticPoster.tsx +437 -0
- package/template/components/kinetic-poster/meta.json +31 -0
- package/template/components/kinetic-punch/KineticPunch.tsx +80 -0
- package/template/components/kinetic-punch/meta.json +30 -0
- package/template/components/lava-lamp/LavaLamp.tsx +92 -0
- package/template/components/lava-lamp/meta.json +28 -0
- package/template/components/letter-cascade/LetterCascade.tsx +102 -0
- package/template/components/letter-cascade/meta.json +29 -0
- package/template/components/lib.ts +179 -0
- package/template/components/light-leak/LightLeakTransition.tsx +43 -0
- package/template/components/light-leak/meta.json +74 -0
- package/template/components/line-diagram/LineDiagram.tsx +205 -0
- package/template/components/line-diagram/meta.json +217 -0
- package/template/components/list-card/ListCard.tsx +104 -0
- package/template/components/list-card/meta.json +232 -0
- package/template/components/logo-sting/LogoSting.tsx +129 -0
- package/template/components/logo-sting/meta.json +29 -0
- package/template/components/looks.tsx +1447 -0
- package/template/components/lower-third/LowerThird.tsx +100 -0
- package/template/components/lower-third/meta.json +24 -0
- package/template/components/marquee/Marquee.tsx +100 -0
- package/template/components/marquee/meta.json +30 -0
- package/template/components/notification/Notification.tsx +115 -0
- package/template/components/notification/meta.json +27 -0
- package/template/components/outline-fill/OutlineFill.tsx +106 -0
- package/template/components/outline-fill/meta.json +28 -0
- package/template/components/panel-sweep/PanelSweep.tsx +86 -0
- package/template/components/panel-sweep/meta.json +25 -0
- package/template/components/prompt-box/PromptBox.tsx +131 -0
- package/template/components/prompt-box/meta.json +24 -0
- package/template/components/props.ts +73 -0
- package/template/components/quote-card/QuoteCard.tsx +71 -0
- package/template/components/quote-card/meta.json +216 -0
- package/template/components/shape-shift/ShapeShift.tsx +420 -0
- package/template/components/shape-shift/meta.json +31 -0
- package/template/components/slide-zoom-message/SlideZoomMessage.tsx +179 -0
- package/template/components/slide-zoom-message/meta.json +199 -0
- package/template/components/social-post/SocialPost.tsx +185 -0
- package/template/components/social-post/meta.json +30 -0
- package/template/components/split-flap/SplitFlap.tsx +191 -0
- package/template/components/split-flap/meta.json +29 -0
- package/template/components/spotlight-grid/SpotlightGrid.tsx +84 -0
- package/template/components/spotlight-grid/meta.json +25 -0
- package/template/components/stat-counter/StatCounter.tsx +117 -0
- package/template/components/stat-counter/meta.json +27 -0
- package/template/components/sticker-badge/StickerBadge.tsx +46 -0
- package/template/components/sticker-badge/meta.json +220 -0
- package/template/components/sticker-slam/StickerSlam.tsx +941 -0
- package/template/components/sticker-slam/meta.json +34 -0
- package/template/components/style-layer.tsx +233 -0
- package/template/components/styles.json +762 -0
- package/template/components/styles.ts +113 -0
- package/template/components/target-lock/TargetLock.tsx +662 -0
- package/template/components/target-lock/meta.json +32 -0
- package/template/components/text-reveal/TextReveal.tsx +99 -0
- package/template/components/text-reveal/meta.json +28 -0
- package/template/components/tile-wipe/TileWipe.tsx +75 -0
- package/template/components/tile-wipe/meta.json +24 -0
- package/template/components/type-zoom/TypeZoom.tsx +103 -0
- package/template/components/type-zoom/meta.json +27 -0
- package/template/components/types.ts +66 -0
- package/template/components/typewriter/Typewriter.tsx +112 -0
- package/template/components/typewriter/meta.json +29 -0
- package/template/components/word-pop/WordPop.tsx +59 -0
- package/template/components/word-pop/meta.json +237 -0
- package/template/components/word-stack/WordStack.tsx +122 -0
- package/template/components/word-stack/meta.json +27 -0
- package/template/components/word-swap/WordSwap.tsx +127 -0
- package/template/components/word-swap/meta.json +30 -0
- package/template/presets/charcoal-sketch/PROMPT.md +48 -0
- package/template/presets/charcoal-sketch/assets/paper/grain-0.png +0 -0
- package/template/presets/charcoal-sketch/assets/paper/grain-1.png +0 -0
- package/template/presets/charcoal-sketch/assets/paper/grain-2.png +0 -0
- package/template/presets/charcoal-sketch/assets/paper/sketch-paper.jpg +0 -0
- package/template/presets/charcoal-sketch/assets/paper/smudge.png +0 -0
- package/template/presets/charcoal-sketch/poster.jpg +0 -0
- package/template/presets/charcoal-sketch/preset.json +17 -0
- package/template/presets/charcoal-sketch/preview.mp4 +0 -0
- package/template/presets/charcoal-sketch/scenes/Grain.tsx +23 -0
- package/template/presets/charcoal-sketch/scenes/Paper.tsx +17 -0
- package/template/presets/charcoal-sketch/scenes/examples/Agents.tsx +100 -0
- package/template/presets/charcoal-sketch/scenes/examples/Approvals.tsx +110 -0
- package/template/presets/charcoal-sketch/scenes/examples/Blog.tsx +105 -0
- package/template/presets/charcoal-sketch/scenes/examples/EndCard.tsx +41 -0
- package/template/presets/charcoal-sketch/scenes/examples/Hook.tsx +130 -0
- package/template/presets/charcoal-sketch/scenes/examples/Ideas.tsx +92 -0
- package/template/presets/charcoal-sketch/scenes/examples/Posting.tsx +128 -0
- package/template/presets/charcoal-sketch/scenes/lib/painfix.tsx +119 -0
- package/template/presets/charcoal-sketch/scenes/lib/sketch.tsx +291 -0
- package/template/presets/charcoal-sketch/scripts/build_layers.example.py +193 -0
- package/template/presets/charcoal-sketch/scripts/duck_music.py +34 -0
- package/template/presets/charcoal-sketch/scripts/make_textures.py +93 -0
- package/template/presets/punk-cut-paper/PROMPT.md +37 -0
- package/template/presets/punk-cut-paper/assets/paper/desk-cream.jpg +0 -0
- package/template/presets/punk-cut-paper/assets/paper/grain-overlay.png +0 -0
- package/template/presets/punk-cut-paper/assets/paper/halftone-black.png +0 -0
- package/template/presets/punk-cut-paper/assets/paper/halftone-red.png +0 -0
- package/template/presets/punk-cut-paper/assets/paper/halftone-yellow.png +0 -0
- package/template/presets/punk-cut-paper/assets/paper/kraft.jpg +0 -0
- package/template/presets/punk-cut-paper/assets/paper/newsprint.jpg +0 -0
- package/template/presets/punk-cut-paper/assets/paper/paper-cream.jpg +0 -0
- package/template/presets/punk-cut-paper/assets/paper/paper-white.jpg +0 -0
- package/template/presets/punk-cut-paper/assets/paper/tape.png +0 -0
- package/template/presets/punk-cut-paper/build_layers.example.py +150 -0
- package/template/presets/punk-cut-paper/poster.jpg +0 -0
- package/template/presets/punk-cut-paper/preset.json +15 -0
- package/template/presets/punk-cut-paper/preview.mp4 +0 -0
- package/template/presets/punk-cut-paper/scenes/Backdrop.tsx +76 -0
- package/template/presets/punk-cut-paper/scenes/Motif.tsx +376 -0
- package/template/presets/punk-cut-paper/scenes/Photo.tsx +73 -0
- package/template/presets/punk-cut-paper/scenes/Ransom.tsx +119 -0
- package/template/presets/punk-cut-paper/scenes/Xerox.tsx +31 -0
- package/template/presets/punk-cut-paper/scenes/lib/punk.tsx +208 -0
- package/template/runtime/composition.tsx +920 -0
- package/template/runtime/helpers.tsx +228 -0
- package/template/runtime/index.tsx +22 -0
- package/template/runtime/types.ts +248 -0
- package/template/skill/SKILL.md +149 -0
- package/template/skill/references/browser-export.md +61 -0
- package/template/skill/references/components.md +38 -0
- package/template/skill/references/craft.md +53 -0
- package/template/skill/references/cursor.md +91 -0
- package/template/skill/references/footage.md +73 -0
- package/template/skill/references/format.md +140 -0
- package/template/skill/references/presets.md +56 -0
- package/template/skill/references/sound.md +128 -0
- package/template/starter/.studio/chat.json +1 -0
- package/template/starter/assets/.keep +0 -0
- package/template/starter/layers.json +46 -0
- package/template/starter/notes.md +4 -0
- package/template/starter/project.json +13 -0
- package/template/starter/renders/.keep +0 -0
- package/template/starter/scenes/Title.tsx +38 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { AbsoluteFill, useCurrentFrame } from "remotion";
|
|
2
|
+
import { FONTS, exitOut, mix, pop, ramp, unit } from "../lib";
|
|
3
|
+
import type { MotionBaseProps } from "../types";
|
|
4
|
+
|
|
5
|
+
type Props = MotionBaseProps & {
|
|
6
|
+
text: string;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
theme: string;
|
|
9
|
+
accent: string;
|
|
10
|
+
speed: number;
|
|
11
|
+
delay: number;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** An AI prompt box that types a request, then presses send. */
|
|
16
|
+
export function PromptBox(props: Props) {
|
|
17
|
+
const frame = useCurrentFrame();
|
|
18
|
+
const { width, height, fps, durationInFrames } = props;
|
|
19
|
+
const u = unit(width, height);
|
|
20
|
+
const vertical = height > width;
|
|
21
|
+
const dark = props.theme !== "light";
|
|
22
|
+
const appear = pop(frame, fps, 0);
|
|
23
|
+
const out = exitOut(frame, durationInFrames);
|
|
24
|
+
const typingFrames = (props.text.length / Math.max(1, props.speed)) * fps;
|
|
25
|
+
const typed = Math.floor(
|
|
26
|
+
Math.max(0, Math.min(props.text.length, ((frame - props.delay) / Math.max(1, typingFrames)) * props.text.length)),
|
|
27
|
+
);
|
|
28
|
+
const doneAt = props.delay + typingFrames;
|
|
29
|
+
const press = frame >= doneAt + 6 ? ramp(frame, doneAt + 6, 8) : 0;
|
|
30
|
+
const pressScale = press > 0 && press < 1 ? mix(1, 0.86, Math.sin(press * Math.PI)) : 1;
|
|
31
|
+
const sent = frame >= doneAt + 10;
|
|
32
|
+
const caretOn = !sent && Math.floor(frame / (fps * 0.5)) % 2 === 0;
|
|
33
|
+
const boxWidth = Math.min(width * (vertical ? 0.88 : 0.62), 1400 * u);
|
|
34
|
+
const fontSize = (vertical ? 40 : 34) * u;
|
|
35
|
+
const surface = dark ? "#16181d" : "#ffffff";
|
|
36
|
+
const border = dark ? "rgba(255,255,255,0.10)" : "rgba(10,12,16,0.10)";
|
|
37
|
+
const ink = dark ? "#f4f4f5" : "#0b0d10";
|
|
38
|
+
const muted = dark ? "rgba(244,244,245,0.42)" : "rgba(11,13,16,0.42)";
|
|
39
|
+
const glow = sent ? ramp(frame, doneAt + 10, 14) : 0;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<AbsoluteFill style={{ alignItems: "center", justifyContent: "center", opacity: out }}>
|
|
43
|
+
<div
|
|
44
|
+
style={{
|
|
45
|
+
width: boxWidth,
|
|
46
|
+
transform: `translateY(${mix(40 * u, 0, appear)}px) scale(${mix(0.96, 1, appear)})`,
|
|
47
|
+
opacity: Math.min(1, appear * 1.4),
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
{props.label ? (
|
|
51
|
+
<div
|
|
52
|
+
style={{
|
|
53
|
+
fontFamily: FONTS.sans,
|
|
54
|
+
fontWeight: 700,
|
|
55
|
+
fontSize: fontSize * 0.62,
|
|
56
|
+
color: dark ? "rgba(255,255,255,0.7)" : "rgba(11,13,16,0.6)",
|
|
57
|
+
marginBottom: 14 * u,
|
|
58
|
+
paddingLeft: 6 * u,
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
{props.label}
|
|
62
|
+
</div>
|
|
63
|
+
) : null}
|
|
64
|
+
<div
|
|
65
|
+
style={{
|
|
66
|
+
display: "flex",
|
|
67
|
+
alignItems: "flex-end",
|
|
68
|
+
gap: 20 * u,
|
|
69
|
+
background: surface,
|
|
70
|
+
border: `${Math.max(1, 1.5 * u)}px solid ${border}`,
|
|
71
|
+
borderRadius: 30 * u,
|
|
72
|
+
padding: `${26 * u}px ${26 * u}px ${26 * u}px ${34 * u}px`,
|
|
73
|
+
boxShadow: `0 ${24 * u}px ${70 * u}px rgba(0,0,0,${dark ? 0.45 : 0.16})${
|
|
74
|
+
glow > 0 && /^#[0-9a-f]{6}$/i.test(props.accent)
|
|
75
|
+
? `, 0 0 ${60 * u * glow}px ${props.accent}${Math.round(glow * 70).toString(16).padStart(2, "0")}`
|
|
76
|
+
: ""
|
|
77
|
+
}`,
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
<div
|
|
81
|
+
style={{
|
|
82
|
+
flex: 1,
|
|
83
|
+
minHeight: fontSize * 2.6,
|
|
84
|
+
fontFamily: FONTS.sans,
|
|
85
|
+
fontSize,
|
|
86
|
+
lineHeight: 1.3,
|
|
87
|
+
color: typed > 0 ? ink : muted,
|
|
88
|
+
whiteSpace: "pre-wrap",
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
{typed > 0 ? props.text.slice(0, typed) : props.placeholder}
|
|
92
|
+
<span
|
|
93
|
+
style={{
|
|
94
|
+
display: "inline-block",
|
|
95
|
+
width: Math.max(2, 3 * u),
|
|
96
|
+
height: fontSize * 1.1,
|
|
97
|
+
marginLeft: 3 * u,
|
|
98
|
+
verticalAlign: "text-bottom",
|
|
99
|
+
background: props.accent,
|
|
100
|
+
opacity: caretOn ? 1 : 0,
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
<div
|
|
105
|
+
style={{
|
|
106
|
+
width: 64 * u,
|
|
107
|
+
height: 64 * u,
|
|
108
|
+
flexShrink: 0,
|
|
109
|
+
borderRadius: 999,
|
|
110
|
+
display: "flex",
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
justifyContent: "center",
|
|
113
|
+
background: typed >= props.text.length ? props.accent : dark ? "rgba(255,255,255,0.12)" : "rgba(11,13,16,0.08)",
|
|
114
|
+
transform: `scale(${pressScale})`,
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
<svg width={30 * u} height={30 * u} viewBox="0 0 24 24" fill="none">
|
|
118
|
+
<path
|
|
119
|
+
d="M12 19V5M5 12l7-7 7 7"
|
|
120
|
+
stroke={typed >= props.text.length ? "#0b0d10" : muted}
|
|
121
|
+
strokeWidth={2.6}
|
|
122
|
+
strokeLinecap="round"
|
|
123
|
+
strokeLinejoin="round"
|
|
124
|
+
/>
|
|
125
|
+
</svg>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</AbsoluteFill>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "prompt-box",
|
|
3
|
+
"name": "Prompt Box",
|
|
4
|
+
"category": "AI & Product",
|
|
5
|
+
"description": "An AI chat input that types a request character by character, then presses send.",
|
|
6
|
+
"useWhen": "Showing what a user asks an AI feature (\"make a launch video…\") right before the result appears; demos of chat, search or command bars.",
|
|
7
|
+
"durationInFrames": 120,
|
|
8
|
+
"layer": "overlay",
|
|
9
|
+
"tags": ["ai", "prompt", "chat", "typing", "input", "search"],
|
|
10
|
+
"props": {
|
|
11
|
+
"text": { "type": "text", "label": "Prompt", "default": "Make a 20 second launch video for my app", "multiline": true, "maxLength": 240 },
|
|
12
|
+
"placeholder": { "type": "text", "label": "Placeholder", "default": "Describe your video…" },
|
|
13
|
+
"label": { "type": "text", "label": "Label", "default": "", "help": "Optional small line above the box." },
|
|
14
|
+
"theme": { "type": "select", "style": "theme", "label": "Theme", "default": "dark", "options": [{ "value": "dark", "label": "Dark" }, { "value": "light", "label": "Light" }] },
|
|
15
|
+
"accent": { "type": "color", "style": "accent", "label": "Accent", "default": "#34d399" },
|
|
16
|
+
"speed": { "type": "number", "label": "Typing speed", "default": 28, "min": 6, "max": 80, "step": 1, "unit": "chars/s" },
|
|
17
|
+
"delay": { "type": "number", "label": "Start typing at", "default": 12, "min": 0, "max": 90, "step": 1, "unit": "frames" }
|
|
18
|
+
},
|
|
19
|
+
"examples": [
|
|
20
|
+
{ "name": "Dark", "props": {} },
|
|
21
|
+
{ "name": "Light search", "props": { "theme": "light", "text": "Find every clip where I mention pricing", "placeholder": "Search your recordings", "accent": "#6366f1" } },
|
|
22
|
+
{ "name": "With label", "props": { "label": "Agentcut", "text": "Add a whoosh on every scene change and match the volume" } }
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Prop defaults and checks for library components (metadata only: no React, no Remotion).
|
|
2
|
+
import { COMPONENT_METAS } from "./catalog";
|
|
3
|
+
import { getMotionStyle, styleValueFor } from "./styles";
|
|
4
|
+
import type { PropSpec, PropValues } from "./types";
|
|
5
|
+
|
|
6
|
+
function coerce(spec: PropSpec, value: unknown): PropValues[string] {
|
|
7
|
+
switch (spec.type) {
|
|
8
|
+
case "number": {
|
|
9
|
+
const n = typeof value === "number" ? value : Number(value);
|
|
10
|
+
return Number.isFinite(n) ? Math.min(spec.max, Math.max(spec.min, n)) : spec.default;
|
|
11
|
+
}
|
|
12
|
+
case "boolean":
|
|
13
|
+
return typeof value === "boolean" ? value : spec.default;
|
|
14
|
+
case "lines":
|
|
15
|
+
if (Array.isArray(value)) return value.map(String).slice(0, spec.max ?? 12);
|
|
16
|
+
return typeof value === "string" ? value.split("\n") : spec.default;
|
|
17
|
+
case "select":
|
|
18
|
+
return spec.options.some((o) => o.value === value) ? String(value) : spec.default;
|
|
19
|
+
default:
|
|
20
|
+
return typeof value === "string" ? value : value === undefined || value === null ? spec.default : String(value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The clip's props with defaults filled in and wrong types replaced (the preview never crashes on a
|
|
26
|
+
* typo). Props the clip leaves out follow the project's style (`styleId`) where they're tagged to.
|
|
27
|
+
*/
|
|
28
|
+
export function resolveComponentProps(
|
|
29
|
+
id: string,
|
|
30
|
+
props: Record<string, unknown> | undefined,
|
|
31
|
+
styleId?: string | null,
|
|
32
|
+
): PropValues {
|
|
33
|
+
const meta = COMPONENT_METAS[id];
|
|
34
|
+
if (!meta) return {};
|
|
35
|
+
const style = getMotionStyle(styleId);
|
|
36
|
+
const out: PropValues = {};
|
|
37
|
+
for (const [key, spec] of Object.entries(meta.props)) {
|
|
38
|
+
const own = props?.[key];
|
|
39
|
+
out[key] = coerce(spec, own === undefined ? styleValueFor(spec, style) : own);
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Props of a component that follow the project style (the keys "Use style" clears from a clip). */
|
|
45
|
+
export function styledPropKeys(id: string): string[] {
|
|
46
|
+
const meta = COMPONENT_METAS[id];
|
|
47
|
+
if (!meta) return [];
|
|
48
|
+
return Object.entries(meta.props)
|
|
49
|
+
.filter(([, spec]) => spec.style)
|
|
50
|
+
.map(([key]) => key);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Problems with a clip's props, for the problems list: unknown keys and values out of range. */
|
|
54
|
+
export function checkComponentProps(id: string, props: Record<string, unknown> | undefined): string[] {
|
|
55
|
+
const meta = COMPONENT_METAS[id];
|
|
56
|
+
if (!meta) return [`Unknown component "${id}". Available: ${Object.keys(COMPONENT_METAS).join(", ")}.`];
|
|
57
|
+
const issues: string[] = [];
|
|
58
|
+
for (const [key, value] of Object.entries(props ?? {})) {
|
|
59
|
+
const spec = meta.props[key];
|
|
60
|
+
if (!spec) {
|
|
61
|
+
issues.push(`"${key}" isn't a prop of ${id} (props: ${Object.keys(meta.props).join(", ")}).`);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (spec.type === "number" && (typeof value !== "number" || value < spec.min || value > spec.max))
|
|
65
|
+
issues.push(`${key} should be a number from ${spec.min} to ${spec.max}.`);
|
|
66
|
+
if (spec.type === "select" && !spec.options.some((o) => o.value === value))
|
|
67
|
+
issues.push(`${key} should be one of ${spec.options.map((o) => o.value).join(", ")}.`);
|
|
68
|
+
if (spec.type === "boolean" && typeof value !== "boolean") issues.push(`${key} should be true or false.`);
|
|
69
|
+
if (spec.type === "lines" && !Array.isArray(value)) issues.push(`${key} should be a list of lines.`);
|
|
70
|
+
}
|
|
71
|
+
return issues;
|
|
72
|
+
}
|
|
73
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useCurrentFrame } from "remotion";
|
|
2
|
+
import { unit } from "../lib";
|
|
3
|
+
import { CardStage, Label, enter, headWeight, lookKit, typed, type LookProps } from "../looks";
|
|
4
|
+
import type { MotionBaseProps } from "../types";
|
|
5
|
+
|
|
6
|
+
type Props = MotionBaseProps &
|
|
7
|
+
LookProps & {
|
|
8
|
+
quote: string;
|
|
9
|
+
name: string;
|
|
10
|
+
role: string;
|
|
11
|
+
footer: string;
|
|
12
|
+
layout: string;
|
|
13
|
+
size: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Someone else's words as proof: a quote with the name and role under it, on the look's card.
|
|
18
|
+
* Full frame or over footage.
|
|
19
|
+
*/
|
|
20
|
+
export function QuoteCard(props: Props) {
|
|
21
|
+
const frame = useCurrentFrame();
|
|
22
|
+
const { width, height, fps, durationInFrames: d } = props;
|
|
23
|
+
const u = unit(width, height);
|
|
24
|
+
const kit = lookKit(props, u);
|
|
25
|
+
const fontSize = (props.size / 100) * Math.min(width, height);
|
|
26
|
+
const q = enter(kit, frame, fps, 6, 0, 2);
|
|
27
|
+
const by = enter(kit, frame, fps, 18, 0, 5);
|
|
28
|
+
const marks = kit.look === "crt" ? ['"', '"'] : ["“", "”"];
|
|
29
|
+
return (
|
|
30
|
+
<CardStage
|
|
31
|
+
kit={kit}
|
|
32
|
+
width={width}
|
|
33
|
+
height={height}
|
|
34
|
+
layout={props.layout}
|
|
35
|
+
frame={frame}
|
|
36
|
+
fps={fps}
|
|
37
|
+
durationInFrames={d}
|
|
38
|
+
footer={props.footer}
|
|
39
|
+
footerStart={26}
|
|
40
|
+
title="~/quote.txt"
|
|
41
|
+
>
|
|
42
|
+
<div style={{ padding: `${fontSize * 0.9}px ${fontSize * 0.9}px ${fontSize * 0.8}px`, display: "flex", flexDirection: "column", gap: fontSize * 0.6 }}>
|
|
43
|
+
<div
|
|
44
|
+
style={{
|
|
45
|
+
opacity: q.opacity,
|
|
46
|
+
transform: q.transform,
|
|
47
|
+
fontFamily: kit.look === "paper" ? kit.head : kit.head,
|
|
48
|
+
fontWeight: headWeight(kit),
|
|
49
|
+
fontSize,
|
|
50
|
+
lineHeight: kit.look === "notebook" ? 1.05 : 1.08,
|
|
51
|
+
letterSpacing: kit.look === "crt" || kit.look === "notebook" ? 0 : "-0.015em",
|
|
52
|
+
textTransform: kit.look === "crt" ? "uppercase" : "none",
|
|
53
|
+
color: kit.panelText,
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
<span style={{ color: kit.look === "clean" || kit.look === "crt" || kit.look === "neon" || kit.look === "line" ? kit.accent : kit.panelText }}>{marks[0]}</span>
|
|
57
|
+
{typed(kit, props.quote, frame, 6, 2)}
|
|
58
|
+
<span style={{ color: kit.look === "clean" || kit.look === "crt" || kit.look === "neon" || kit.look === "line" ? kit.accent : kit.panelText }}>{marks[1]}</span>
|
|
59
|
+
</div>
|
|
60
|
+
<div style={{ opacity: by.opacity, transform: by.transform, display: "flex", flexDirection: "column", gap: fontSize * 0.15 }}>
|
|
61
|
+
<div style={{ fontFamily: kit.body, fontSize: fontSize * (kit.look === "notebook" || kit.look === "crt" ? 0.62 : 0.46), color: kit.panelText }}>{props.name}</div>
|
|
62
|
+
{props.role ? (
|
|
63
|
+
<Label kit={kit} fontSize={fontSize * 0.3}>
|
|
64
|
+
{props.role}
|
|
65
|
+
</Label>
|
|
66
|
+
) : null}
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</CardStage>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "quote-card",
|
|
3
|
+
"name": "Quote Card",
|
|
4
|
+
"category": "Talking Head",
|
|
5
|
+
"durationInFrames": 120,
|
|
6
|
+
"layer": "overlay",
|
|
7
|
+
"description": "Someone else's words as proof: a quote with the name and role, on the project's card.",
|
|
8
|
+
"useWhen": "Testimonials, a review, a tweet or a line from a client that backs up what the speaker just said.",
|
|
9
|
+
"tags": [
|
|
10
|
+
"quote",
|
|
11
|
+
"testimonial",
|
|
12
|
+
"proof",
|
|
13
|
+
"card",
|
|
14
|
+
"talking head"
|
|
15
|
+
],
|
|
16
|
+
"props": {
|
|
17
|
+
"quote": {
|
|
18
|
+
"type": "text",
|
|
19
|
+
"label": "Quote",
|
|
20
|
+
"default": "Invoicing took my whole Friday. Now it runs overnight.",
|
|
21
|
+
"multiline": true
|
|
22
|
+
},
|
|
23
|
+
"name": {
|
|
24
|
+
"type": "text",
|
|
25
|
+
"label": "Name",
|
|
26
|
+
"default": "Client name"
|
|
27
|
+
},
|
|
28
|
+
"role": {
|
|
29
|
+
"type": "text",
|
|
30
|
+
"label": "Role",
|
|
31
|
+
"default": "Founder · Their company"
|
|
32
|
+
},
|
|
33
|
+
"footer": {
|
|
34
|
+
"type": "text",
|
|
35
|
+
"label": "Footer",
|
|
36
|
+
"default": "",
|
|
37
|
+
"help": "A phrase under the card (empty for none)."
|
|
38
|
+
},
|
|
39
|
+
"layout": {
|
|
40
|
+
"type": "select",
|
|
41
|
+
"label": "Layout",
|
|
42
|
+
"default": "full",
|
|
43
|
+
"options": [
|
|
44
|
+
{
|
|
45
|
+
"value": "full",
|
|
46
|
+
"label": "Full frame"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"value": "card",
|
|
50
|
+
"label": "Card over video"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"size": {
|
|
55
|
+
"type": "number",
|
|
56
|
+
"label": "Size",
|
|
57
|
+
"default": 7.5,
|
|
58
|
+
"min": 3,
|
|
59
|
+
"max": 14,
|
|
60
|
+
"step": 0.5,
|
|
61
|
+
"unit": "% of frame"
|
|
62
|
+
},
|
|
63
|
+
"look": {
|
|
64
|
+
"type": "select",
|
|
65
|
+
"style": "look",
|
|
66
|
+
"label": "Look",
|
|
67
|
+
"default": "ink",
|
|
68
|
+
"options": [
|
|
69
|
+
{
|
|
70
|
+
"value": "ink",
|
|
71
|
+
"label": "Ink (bold borders)"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"value": "paper",
|
|
75
|
+
"label": "Cut paper"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"value": "notebook",
|
|
79
|
+
"label": "Notebook"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"value": "crt",
|
|
83
|
+
"label": "Terminal"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"value": "neon",
|
|
87
|
+
"label": "Neon (cyberpunk)"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"value": "line",
|
|
91
|
+
"label": "Line (black & white)"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"value": "vhs",
|
|
95
|
+
"label": "VHS (90s tape)"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"value": "clean",
|
|
99
|
+
"label": "Clean"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"help": "The graphic language. Follows the project style."
|
|
103
|
+
},
|
|
104
|
+
"font": {
|
|
105
|
+
"type": "select",
|
|
106
|
+
"style": "font",
|
|
107
|
+
"label": "Headline font",
|
|
108
|
+
"default": "archivo",
|
|
109
|
+
"options": [
|
|
110
|
+
{
|
|
111
|
+
"value": "archivo",
|
|
112
|
+
"label": "Archivo Black"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"value": "condensed",
|
|
116
|
+
"label": "Anton"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"value": "grotesk",
|
|
120
|
+
"label": "Space Grotesk"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"value": "caveat",
|
|
124
|
+
"label": "Caveat"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"value": "pixel",
|
|
128
|
+
"label": "VT323"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"value": "tech",
|
|
132
|
+
"label": "Orbitron"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"value": "heavy",
|
|
136
|
+
"label": "Montserrat"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"value": "retro",
|
|
140
|
+
"label": "Bungee"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"value": "sans",
|
|
144
|
+
"label": "Inter"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"value": "display",
|
|
148
|
+
"label": "Bricolage"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"value": "serif",
|
|
152
|
+
"label": "Instrument Serif"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"value": "fraunces",
|
|
156
|
+
"label": "Fraunces"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"value": "wide",
|
|
160
|
+
"label": "Unbounded"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"accent": {
|
|
165
|
+
"type": "color",
|
|
166
|
+
"style": "accent",
|
|
167
|
+
"label": "Accent",
|
|
168
|
+
"default": "#ff3d8b"
|
|
169
|
+
},
|
|
170
|
+
"panel": {
|
|
171
|
+
"type": "color",
|
|
172
|
+
"style": "panel",
|
|
173
|
+
"label": "Card",
|
|
174
|
+
"default": "#ffffff"
|
|
175
|
+
},
|
|
176
|
+
"panelText": {
|
|
177
|
+
"type": "color",
|
|
178
|
+
"style": "panelText",
|
|
179
|
+
"label": "Card text",
|
|
180
|
+
"default": "#111111"
|
|
181
|
+
},
|
|
182
|
+
"line": {
|
|
183
|
+
"type": "color",
|
|
184
|
+
"style": "line",
|
|
185
|
+
"label": "Ink",
|
|
186
|
+
"default": "#111111",
|
|
187
|
+
"help": "Borders, hard shadows, pen strokes."
|
|
188
|
+
},
|
|
189
|
+
"backdrop": {
|
|
190
|
+
"type": "color",
|
|
191
|
+
"style": "backdrop",
|
|
192
|
+
"label": "Backdrop",
|
|
193
|
+
"default": "#ffe14d",
|
|
194
|
+
"help": "Full-frame and split backgrounds."
|
|
195
|
+
},
|
|
196
|
+
"onVideo": {
|
|
197
|
+
"type": "color",
|
|
198
|
+
"style": "text",
|
|
199
|
+
"label": "Text on video",
|
|
200
|
+
"default": "#ffffff"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"examples": [
|
|
204
|
+
{
|
|
205
|
+
"name": "Testimonial",
|
|
206
|
+
"props": {}
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "Over video",
|
|
210
|
+
"props": {
|
|
211
|
+
"layout": "card",
|
|
212
|
+
"footer": "say the *same* thing"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|