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.
Files changed (248) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -2
  3. package/dist/bridge.d.ts +45 -0
  4. package/dist/bridge.js +691 -0
  5. package/dist/bridge.js.map +1 -0
  6. package/dist/config.d.ts +13 -0
  7. package/dist/config.js +50 -0
  8. package/dist/config.js.map +1 -0
  9. package/dist/index.d.ts +2 -0
  10. package/dist/index.js +35 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/log.d.ts +1 -0
  13. package/dist/log.js +14 -0
  14. package/dist/log.js.map +1 -0
  15. package/dist/studio/agents/claude.d.ts +7 -0
  16. package/dist/studio/agents/claude.js +155 -0
  17. package/dist/studio/agents/claude.js.map +1 -0
  18. package/dist/studio/agents/codex.d.ts +4 -0
  19. package/dist/studio/agents/codex.js +169 -0
  20. package/dist/studio/agents/codex.js.map +1 -0
  21. package/dist/studio/agents/index.d.ts +8 -0
  22. package/dist/studio/agents/index.js +50 -0
  23. package/dist/studio/agents/index.js.map +1 -0
  24. package/dist/studio/agents/types.d.ts +131 -0
  25. package/dist/studio/agents/types.js +11 -0
  26. package/dist/studio/agents/types.js.map +1 -0
  27. package/dist/studio/bundler.d.ts +29 -0
  28. package/dist/studio/bundler.js +136 -0
  29. package/dist/studio/bundler.js.map +1 -0
  30. package/dist/studio/chat.d.ts +147 -0
  31. package/dist/studio/chat.js +681 -0
  32. package/dist/studio/chat.js.map +1 -0
  33. package/dist/studio/cli.d.ts +2 -0
  34. package/dist/studio/cli.js +194 -0
  35. package/dist/studio/cli.js.map +1 -0
  36. package/dist/studio/components.d.ts +4 -0
  37. package/dist/studio/components.js +36 -0
  38. package/dist/studio/components.js.map +1 -0
  39. package/dist/studio/host.d.ts +105 -0
  40. package/dist/studio/host.js +634 -0
  41. package/dist/studio/host.js.map +1 -0
  42. package/dist/studio/http.d.ts +21 -0
  43. package/dist/studio/http.js +240 -0
  44. package/dist/studio/http.js.map +1 -0
  45. package/dist/studio/music.d.ts +35 -0
  46. package/dist/studio/music.js +130 -0
  47. package/dist/studio/music.js.map +1 -0
  48. package/dist/studio/proc.d.ts +11 -0
  49. package/dist/studio/proc.js +69 -0
  50. package/dist/studio/proc.js.map +1 -0
  51. package/dist/studio/projects.d.ts +84 -0
  52. package/dist/studio/projects.js +369 -0
  53. package/dist/studio/projects.js.map +1 -0
  54. package/dist/studio/render.d.ts +24 -0
  55. package/dist/studio/render.js +197 -0
  56. package/dist/studio/render.js.map +1 -0
  57. package/dist/studio/reveal.d.ts +7 -0
  58. package/dist/studio/reveal.js +49 -0
  59. package/dist/studio/reveal.js.map +1 -0
  60. package/dist/studio/schema.d.ts +4152 -0
  61. package/dist/studio/schema.js +358 -0
  62. package/dist/studio/schema.js.map +1 -0
  63. package/dist/studio/tools.d.ts +2 -0
  64. package/dist/studio/tools.js +165 -0
  65. package/dist/studio/tools.js.map +1 -0
  66. package/dist/studio/voice.d.ts +150 -0
  67. package/dist/studio/voice.js +434 -0
  68. package/dist/studio/voice.js.map +1 -0
  69. package/dist/studio/workspace.d.ts +31 -0
  70. package/dist/studio/workspace.js +187 -0
  71. package/dist/studio/workspace.js.map +1 -0
  72. package/package.json +50 -4
  73. package/template/AGENTS.md +13 -0
  74. package/template/components/CATALOG.md +1306 -0
  75. package/template/components/README.md +61 -0
  76. package/template/components/STYLES.md +246 -0
  77. package/template/components/arcade-title/ArcadeTitle.tsx +860 -0
  78. package/template/components/arcade-title/meta.json +28 -0
  79. package/template/components/aurora/Aurora.tsx +63 -0
  80. package/template/components/aurora/meta.json +28 -0
  81. package/template/components/bar-wipe-title/BarWipeTitle.tsx +94 -0
  82. package/template/components/bar-wipe-title/meta.json +29 -0
  83. package/template/components/before-after/BeforeAfter.tsx +89 -0
  84. package/template/components/before-after/meta.json +233 -0
  85. package/template/components/bento-grid/BentoGrid.tsx +202 -0
  86. package/template/components/bento-grid/meta.json +25 -0
  87. package/template/components/blur-in-title/BlurInTitle.tsx +121 -0
  88. package/template/components/blur-in-title/meta.json +32 -0
  89. package/template/components/catalog.json +8730 -0
  90. package/template/components/catalog.ts +103 -0
  91. package/template/components/chat-thread/ChatThread.tsx +128 -0
  92. package/template/components/chat-thread/meta.json +24 -0
  93. package/template/components/checklist/Checklist.tsx +129 -0
  94. package/template/components/checklist/meta.json +25 -0
  95. package/template/components/confetti/Confetti.tsx +109 -0
  96. package/template/components/confetti/meta.json +28 -0
  97. package/template/components/countdown/Countdown.tsx +166 -0
  98. package/template/components/countdown/meta.json +28 -0
  99. package/template/components/cut-and-paste/CutAndPaste.tsx +654 -0
  100. package/template/components/cut-and-paste/meta.json +29 -0
  101. package/template/components/decode-text/DecodeText.tsx +97 -0
  102. package/template/components/decode-text/meta.json +29 -0
  103. package/template/components/editorial-quote/EditorialQuote.tsx +122 -0
  104. package/template/components/editorial-quote/meta.json +28 -0
  105. package/template/components/glitch-title/GlitchTitle.tsx +171 -0
  106. package/template/components/glitch-title/meta.json +32 -0
  107. package/template/components/halftone-wave/HalftoneWave.tsx +106 -0
  108. package/template/components/halftone-wave/meta.json +28 -0
  109. package/template/components/highlighter/Highlighter.tsx +142 -0
  110. package/template/components/highlighter/meta.json +28 -0
  111. package/template/components/hook-card/HookCard.tsx +552 -0
  112. package/template/components/hook-card/meta.json +304 -0
  113. package/template/components/index.ts +149 -0
  114. package/template/components/iris-wipe/IrisWipe.tsx +76 -0
  115. package/template/components/iris-wipe/meta.json +24 -0
  116. package/template/components/kinetic-poster/KineticPoster.tsx +437 -0
  117. package/template/components/kinetic-poster/meta.json +31 -0
  118. package/template/components/kinetic-punch/KineticPunch.tsx +80 -0
  119. package/template/components/kinetic-punch/meta.json +30 -0
  120. package/template/components/lava-lamp/LavaLamp.tsx +92 -0
  121. package/template/components/lava-lamp/meta.json +28 -0
  122. package/template/components/letter-cascade/LetterCascade.tsx +102 -0
  123. package/template/components/letter-cascade/meta.json +29 -0
  124. package/template/components/lib.ts +179 -0
  125. package/template/components/light-leak/LightLeakTransition.tsx +43 -0
  126. package/template/components/light-leak/meta.json +74 -0
  127. package/template/components/line-diagram/LineDiagram.tsx +205 -0
  128. package/template/components/line-diagram/meta.json +217 -0
  129. package/template/components/list-card/ListCard.tsx +104 -0
  130. package/template/components/list-card/meta.json +232 -0
  131. package/template/components/logo-sting/LogoSting.tsx +129 -0
  132. package/template/components/logo-sting/meta.json +29 -0
  133. package/template/components/looks.tsx +1447 -0
  134. package/template/components/lower-third/LowerThird.tsx +100 -0
  135. package/template/components/lower-third/meta.json +24 -0
  136. package/template/components/marquee/Marquee.tsx +100 -0
  137. package/template/components/marquee/meta.json +30 -0
  138. package/template/components/notification/Notification.tsx +115 -0
  139. package/template/components/notification/meta.json +27 -0
  140. package/template/components/outline-fill/OutlineFill.tsx +106 -0
  141. package/template/components/outline-fill/meta.json +28 -0
  142. package/template/components/panel-sweep/PanelSweep.tsx +86 -0
  143. package/template/components/panel-sweep/meta.json +25 -0
  144. package/template/components/prompt-box/PromptBox.tsx +131 -0
  145. package/template/components/prompt-box/meta.json +24 -0
  146. package/template/components/props.ts +73 -0
  147. package/template/components/quote-card/QuoteCard.tsx +71 -0
  148. package/template/components/quote-card/meta.json +216 -0
  149. package/template/components/shape-shift/ShapeShift.tsx +420 -0
  150. package/template/components/shape-shift/meta.json +31 -0
  151. package/template/components/slide-zoom-message/SlideZoomMessage.tsx +179 -0
  152. package/template/components/slide-zoom-message/meta.json +199 -0
  153. package/template/components/social-post/SocialPost.tsx +185 -0
  154. package/template/components/social-post/meta.json +30 -0
  155. package/template/components/split-flap/SplitFlap.tsx +191 -0
  156. package/template/components/split-flap/meta.json +29 -0
  157. package/template/components/spotlight-grid/SpotlightGrid.tsx +84 -0
  158. package/template/components/spotlight-grid/meta.json +25 -0
  159. package/template/components/stat-counter/StatCounter.tsx +117 -0
  160. package/template/components/stat-counter/meta.json +27 -0
  161. package/template/components/sticker-badge/StickerBadge.tsx +46 -0
  162. package/template/components/sticker-badge/meta.json +220 -0
  163. package/template/components/sticker-slam/StickerSlam.tsx +941 -0
  164. package/template/components/sticker-slam/meta.json +34 -0
  165. package/template/components/style-layer.tsx +233 -0
  166. package/template/components/styles.json +762 -0
  167. package/template/components/styles.ts +113 -0
  168. package/template/components/target-lock/TargetLock.tsx +662 -0
  169. package/template/components/target-lock/meta.json +32 -0
  170. package/template/components/text-reveal/TextReveal.tsx +99 -0
  171. package/template/components/text-reveal/meta.json +28 -0
  172. package/template/components/tile-wipe/TileWipe.tsx +75 -0
  173. package/template/components/tile-wipe/meta.json +24 -0
  174. package/template/components/type-zoom/TypeZoom.tsx +103 -0
  175. package/template/components/type-zoom/meta.json +27 -0
  176. package/template/components/types.ts +66 -0
  177. package/template/components/typewriter/Typewriter.tsx +112 -0
  178. package/template/components/typewriter/meta.json +29 -0
  179. package/template/components/word-pop/WordPop.tsx +59 -0
  180. package/template/components/word-pop/meta.json +237 -0
  181. package/template/components/word-stack/WordStack.tsx +122 -0
  182. package/template/components/word-stack/meta.json +27 -0
  183. package/template/components/word-swap/WordSwap.tsx +127 -0
  184. package/template/components/word-swap/meta.json +30 -0
  185. package/template/presets/charcoal-sketch/PROMPT.md +48 -0
  186. package/template/presets/charcoal-sketch/assets/paper/grain-0.png +0 -0
  187. package/template/presets/charcoal-sketch/assets/paper/grain-1.png +0 -0
  188. package/template/presets/charcoal-sketch/assets/paper/grain-2.png +0 -0
  189. package/template/presets/charcoal-sketch/assets/paper/sketch-paper.jpg +0 -0
  190. package/template/presets/charcoal-sketch/assets/paper/smudge.png +0 -0
  191. package/template/presets/charcoal-sketch/poster.jpg +0 -0
  192. package/template/presets/charcoal-sketch/preset.json +17 -0
  193. package/template/presets/charcoal-sketch/preview.mp4 +0 -0
  194. package/template/presets/charcoal-sketch/scenes/Grain.tsx +23 -0
  195. package/template/presets/charcoal-sketch/scenes/Paper.tsx +17 -0
  196. package/template/presets/charcoal-sketch/scenes/examples/Agents.tsx +100 -0
  197. package/template/presets/charcoal-sketch/scenes/examples/Approvals.tsx +110 -0
  198. package/template/presets/charcoal-sketch/scenes/examples/Blog.tsx +105 -0
  199. package/template/presets/charcoal-sketch/scenes/examples/EndCard.tsx +41 -0
  200. package/template/presets/charcoal-sketch/scenes/examples/Hook.tsx +130 -0
  201. package/template/presets/charcoal-sketch/scenes/examples/Ideas.tsx +92 -0
  202. package/template/presets/charcoal-sketch/scenes/examples/Posting.tsx +128 -0
  203. package/template/presets/charcoal-sketch/scenes/lib/painfix.tsx +119 -0
  204. package/template/presets/charcoal-sketch/scenes/lib/sketch.tsx +291 -0
  205. package/template/presets/charcoal-sketch/scripts/build_layers.example.py +193 -0
  206. package/template/presets/charcoal-sketch/scripts/duck_music.py +34 -0
  207. package/template/presets/charcoal-sketch/scripts/make_textures.py +93 -0
  208. package/template/presets/punk-cut-paper/PROMPT.md +37 -0
  209. package/template/presets/punk-cut-paper/assets/paper/desk-cream.jpg +0 -0
  210. package/template/presets/punk-cut-paper/assets/paper/grain-overlay.png +0 -0
  211. package/template/presets/punk-cut-paper/assets/paper/halftone-black.png +0 -0
  212. package/template/presets/punk-cut-paper/assets/paper/halftone-red.png +0 -0
  213. package/template/presets/punk-cut-paper/assets/paper/halftone-yellow.png +0 -0
  214. package/template/presets/punk-cut-paper/assets/paper/kraft.jpg +0 -0
  215. package/template/presets/punk-cut-paper/assets/paper/newsprint.jpg +0 -0
  216. package/template/presets/punk-cut-paper/assets/paper/paper-cream.jpg +0 -0
  217. package/template/presets/punk-cut-paper/assets/paper/paper-white.jpg +0 -0
  218. package/template/presets/punk-cut-paper/assets/paper/tape.png +0 -0
  219. package/template/presets/punk-cut-paper/build_layers.example.py +150 -0
  220. package/template/presets/punk-cut-paper/poster.jpg +0 -0
  221. package/template/presets/punk-cut-paper/preset.json +15 -0
  222. package/template/presets/punk-cut-paper/preview.mp4 +0 -0
  223. package/template/presets/punk-cut-paper/scenes/Backdrop.tsx +76 -0
  224. package/template/presets/punk-cut-paper/scenes/Motif.tsx +376 -0
  225. package/template/presets/punk-cut-paper/scenes/Photo.tsx +73 -0
  226. package/template/presets/punk-cut-paper/scenes/Ransom.tsx +119 -0
  227. package/template/presets/punk-cut-paper/scenes/Xerox.tsx +31 -0
  228. package/template/presets/punk-cut-paper/scenes/lib/punk.tsx +208 -0
  229. package/template/runtime/composition.tsx +920 -0
  230. package/template/runtime/helpers.tsx +228 -0
  231. package/template/runtime/index.tsx +22 -0
  232. package/template/runtime/types.ts +248 -0
  233. package/template/skill/SKILL.md +149 -0
  234. package/template/skill/references/browser-export.md +61 -0
  235. package/template/skill/references/components.md +38 -0
  236. package/template/skill/references/craft.md +53 -0
  237. package/template/skill/references/cursor.md +91 -0
  238. package/template/skill/references/footage.md +73 -0
  239. package/template/skill/references/format.md +140 -0
  240. package/template/skill/references/presets.md +56 -0
  241. package/template/skill/references/sound.md +128 -0
  242. package/template/starter/.studio/chat.json +1 -0
  243. package/template/starter/assets/.keep +0 -0
  244. package/template/starter/layers.json +46 -0
  245. package/template/starter/notes.md +4 -0
  246. package/template/starter/project.json +13 -0
  247. package/template/starter/renders/.keep +0 -0
  248. package/template/starter/scenes/Title.tsx +38 -0
@@ -0,0 +1,92 @@
1
+ import { useId } from "react";
2
+ import { AbsoluteFill, random, useCurrentFrame } from "remotion";
3
+ import { exitOut, ramp, unit } from "../lib";
4
+ import type { MotionBaseProps } from "../types";
5
+
6
+ type Props = MotionBaseProps & {
7
+ colorA: string;
8
+ colorB: string;
9
+ colorC: string;
10
+ background: string;
11
+ blobs: number;
12
+ blobSize: number;
13
+ speed: number;
14
+ look: string;
15
+ grain: boolean;
16
+ seed: number;
17
+ };
18
+
19
+ // The SVG is drawn at a quarter of the frame size and scaled up: the goo blur is the costly part.
20
+ const SCALE = 4;
21
+
22
+ /**
23
+ * A lava lamp: blobs rise, sink and merge through an SVG "goo" filter (blur, then a hard alpha
24
+ * threshold), colored by a vertical gradient. "Soft" skips the threshold for a dreamy blur field.
25
+ */
26
+ export function LavaLamp(props: Props) {
27
+ const frame = useCurrentFrame();
28
+ const { width, height, fps, durationInFrames: d } = props;
29
+ const w = width / SCALE;
30
+ const h = height / SCALE;
31
+ const u = unit(width, height) / SCALE;
32
+ const t = (frame / fps) * props.speed;
33
+ const fadeIn = ramp(frame, 0, 12);
34
+ const out = exitOut(frame, d, 12);
35
+ const goo = props.look !== "soft";
36
+ // SVG ids are page-global: two lamps on one page must not share gradients.
37
+ const id = `lava${useId().replace(/[^a-zA-Z0-9]/g, "")}`;
38
+ const base = 190 * u * props.blobSize;
39
+ const count = Math.round(props.blobs);
40
+
41
+ const blobs = Array.from({ length: count }, (_, i) => {
42
+ const r = (k: string) => random(`${props.seed}-${i}-${k}`);
43
+ const radius = base * (0.55 + r("r") * 0.9);
44
+ const x = w * (0.1 + r("x") * 0.8) + Math.sin(t * (0.25 + r("wx") * 0.35) + r("px") * 6.28) * w * 0.08;
45
+ // Each blob travels most of the height and back, at its own pace: they meet, merge and split.
46
+ const y = h * 0.5 + Math.sin(t * (0.18 + r("wy") * 0.3) + r("py") * 6.28) * h * 0.55;
47
+ const squash = 1 + Math.sin(t * 0.9 + i) * 0.08;
48
+ return { x, y, rx: radius * squash, ry: radius / squash };
49
+ });
50
+
51
+ return (
52
+ <AbsoluteFill style={{ background: props.background, opacity: out * fadeIn }}>
53
+ <svg width={width} height={height} viewBox={`0 0 ${w} ${h}`} preserveAspectRatio="none" style={{ position: "absolute", inset: 0 }}>
54
+ <defs>
55
+ <linearGradient id={`${id}-fill`} x1="0" y1="0" x2="0" y2={h} gradientUnits="userSpaceOnUse">
56
+ <stop offset="0%" stopColor={props.colorA} />
57
+ <stop offset="55%" stopColor={props.colorB} />
58
+ <stop offset="100%" stopColor={props.colorC} />
59
+ </linearGradient>
60
+ <filter id={`${id}-goo`} x="-20%" y="-20%" width="140%" height="140%" colorInterpolationFilters="sRGB">
61
+ <feGaussianBlur in="SourceGraphic" stdDeviation={(goo ? 7 : 13) * u * SCALE} result="blur" />
62
+ {goo ? (
63
+ <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -9" />
64
+ ) : null}
65
+ </filter>
66
+ <radialGradient id={`${id}-shade`} cx="35%" cy="30%" r="80%">
67
+ <stop offset="0%" stopColor="#ffffff" stopOpacity={0.18} />
68
+ <stop offset="60%" stopColor="#ffffff" stopOpacity={0} />
69
+ </radialGradient>
70
+ </defs>
71
+ <g filter={`url(#${id}-goo)`}>
72
+ {/* Pools at the bottom and top, like the wax resting in a real lamp. */}
73
+ <ellipse cx={w / 2} cy={h * 1.04} rx={w * 0.7} ry={h * 0.12} fill={`url(#${id}-fill)`} />
74
+ <ellipse cx={w / 2} cy={-h * 0.04} rx={w * 0.6} ry={h * 0.08} fill={`url(#${id}-fill)`} />
75
+ {blobs.map((b, i) => (
76
+ <ellipse key={i} cx={b.x} cy={b.y} rx={b.rx} ry={b.ry} fill={`url(#${id}-fill)`} />
77
+ ))}
78
+ </g>
79
+ <rect width={w} height={h} fill={`url(#${id}-shade)`} />
80
+ {props.grain ? (
81
+ <>
82
+ <filter id={`${id}-grain`}>
83
+ <feTurbulence type="fractalNoise" baseFrequency={0.9} numOctaves={2} seed={frame % 60} />
84
+ <feColorMatrix type="saturate" values="0" />
85
+ </filter>
86
+ <rect width={w} height={h} filter={`url(#${id}-grain)`} opacity={0.12} />
87
+ </>
88
+ ) : null}
89
+ </svg>
90
+ </AbsoluteFill>
91
+ );
92
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "id": "lava-lamp",
3
+ "name": "Lava Lamp",
4
+ "category": "Backgrounds",
5
+ "description": "Glossy blobs that rise, sink and melt into each other like a lava lamp, in a three-color gradient. Loops for any length.",
6
+ "useWhen": "A living, colorful background behind titles, product shots, a speaker cut-out or an end card; anything retro, playful, music-led or \"vibe\". Put text components on a track above it. \"Soft\" turns it into a blurry gradient field.",
7
+ "durationInFrames": 300,
8
+ "layer": "full",
9
+ "tags": ["lava", "blobs", "metaballs", "goo", "liquid", "gradient", "background", "loop", "retro"],
10
+ "props": {
11
+ "colorA": { "type": "color", "label": "Top color", "default": "#ff6b3d" },
12
+ "colorB": { "type": "color", "label": "Middle color", "default": "#ff2e88" },
13
+ "colorC": { "type": "color", "label": "Bottom color", "default": "#7b2cff" },
14
+ "background": { "type": "color", "label": "Background", "default": "#140a1f" },
15
+ "blobs": { "type": "number", "label": "Blobs", "default": 9, "min": 3, "max": 18, "step": 1 },
16
+ "blobSize": { "type": "number", "label": "Blob size", "default": 1, "min": 0.4, "max": 2.5, "step": 0.05, "unit": "×" },
17
+ "speed": { "type": "number", "label": "Speed", "default": 1, "min": 0.1, "max": 4, "step": 0.1, "unit": "×" },
18
+ "look": { "type": "select", "label": "Look", "default": "lava", "options": [{ "value": "lava", "label": "Lava (merging blobs)" }, { "value": "soft", "label": "Soft (blurred)" }] },
19
+ "grain": { "type": "boolean", "label": "Film grain", "default": true },
20
+ "seed": { "type": "number", "label": "Pattern", "default": 4, "min": 0, "max": 99, "step": 1 }
21
+ },
22
+ "examples": [
23
+ { "name": "Sunset lava", "props": {} },
24
+ { "name": "Acid", "props": { "colorA": "#d9f99d", "colorB": "#22c55e", "colorC": "#0ea5e9", "background": "#04130d", "seed": 12, "blobSize": 1.3 } },
25
+ { "name": "Soft aura", "props": { "colorA": "#fbcfe8", "colorB": "#a5b4fc", "colorC": "#67e8f9", "background": "#f8fafc", "look": "soft", "blobs": 7, "blobSize": 1.8, "speed": 0.6, "grain": false } }
26
+ ],
27
+ "stillAt": 0.3
28
+ }
@@ -0,0 +1,102 @@
1
+ import { AbsoluteFill, spring, useCurrentFrame } from "remotion";
2
+ import { FONTS, exitOut, fill, mix, splitHighlights, unit } from "../lib";
3
+ import type { MotionBaseProps } from "../types";
4
+
5
+ type Props = MotionBaseProps & {
6
+ lines: string[];
7
+ direction: string;
8
+ color: string;
9
+ accent: string;
10
+ background: string;
11
+ size: number;
12
+ weight: string;
13
+ font: string;
14
+ uppercase: boolean;
15
+ stagger: number;
16
+ bounce: number;
17
+ };
18
+
19
+ /** Each letter springs up out of its own mask with a little rotation: the classic per-character cascade. */
20
+ export function LetterCascade(props: Props) {
21
+ const frame = useCurrentFrame();
22
+ const { width, height, fps, durationInFrames: d } = props;
23
+ const u = unit(width, height);
24
+ const vertical = height > width;
25
+ const fontSize = (props.size / 100) * Math.min(width, height) * (vertical ? 1.1 : 1);
26
+ const out = exitOut(frame, d, 14);
27
+ const sign = props.direction === "drop" ? -1 : 1;
28
+ // Letters leave in the order they came: the exit is a fast cascade back into the mask.
29
+ const exitStart = d - 16;
30
+ const total = props.lines.reduce((n, line) => n + line.replace(/[\s*]/g, "").length, 0);
31
+ let index = 0;
32
+
33
+ return (
34
+ <AbsoluteFill
35
+ style={{
36
+ background: fill(props.background),
37
+ alignItems: "center",
38
+ justifyContent: "center",
39
+ padding: `0 ${Math.round((vertical ? 60 : 110) * u)}px`,
40
+ }}
41
+ >
42
+ <div style={{ display: "flex", flexDirection: "column", alignItems: "center" }}>
43
+ {props.lines.map((line, lineIndex) => (
44
+ <div
45
+ key={lineIndex}
46
+ style={{
47
+ display: "flex",
48
+ flexWrap: "wrap",
49
+ justifyContent: "center",
50
+ columnGap: fontSize * 0.25,
51
+ fontFamily: FONTS[props.font] ?? FONTS.sans,
52
+ fontWeight: Number(props.weight) || 800,
53
+ fontSize,
54
+ lineHeight: 1,
55
+ letterSpacing: "-0.02em",
56
+ textTransform: props.uppercase ? "uppercase" : undefined,
57
+ }}
58
+ >
59
+ {splitHighlights(line).map((word, wordIndex) => (
60
+ // The mask: each word clips its letters, so they rise out of the baseline.
61
+ <span
62
+ key={wordIndex}
63
+ style={{ display: "inline-flex", overflow: "hidden", padding: `${fontSize * 0.08}px 0 ${fontSize * 0.14}px` }}
64
+ >
65
+ {Array.from(word.text).map((char, charIndex) => {
66
+ const i = index++;
67
+ const t = spring({
68
+ frame: frame - i * props.stagger,
69
+ fps,
70
+ config: { damping: mix(26, 9, props.bounce), stiffness: 160, mass: 0.8 },
71
+ });
72
+ const leave = clampLeave(frame - (exitStart + (i / Math.max(1, total)) * 10));
73
+ const y = (1 - t) * fontSize * 1.1 * sign - leave * fontSize * 1.1 * sign;
74
+ return (
75
+ <span
76
+ key={charIndex}
77
+ style={{
78
+ display: "inline-block",
79
+ color: word.highlighted ? props.accent : props.color,
80
+ transform: `translateY(${y}px) rotate(${(1 - t) * 14 * sign}deg)`,
81
+ transformOrigin: "0% 100%",
82
+ opacity: out < 0.02 ? 0 : 1,
83
+ }}
84
+ >
85
+ {char}
86
+ </span>
87
+ );
88
+ })}
89
+ </span>
90
+ ))}
91
+ </div>
92
+ ))}
93
+ </div>
94
+ </AbsoluteFill>
95
+ );
96
+ }
97
+
98
+ /** 0→1 over 8 frames, eased in (letters accelerate away). */
99
+ function clampLeave(f: number) {
100
+ const t = Math.min(1, Math.max(0, f / 8));
101
+ return t * t * t;
102
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "id": "letter-cascade",
3
+ "name": "Letter Cascade",
4
+ "category": "Text & Titles",
5
+ "description": "Every letter springs out of its own mask with a slight tilt, one after another, then drops back out in order.",
6
+ "useWhen": "Energetic titles and section headers: launch day, a big feature name, a hype line before a demo. Works best with short, bold lines; uppercase in Anton or Unbounded feels like a sports or fashion promo.",
7
+ "durationInFrames": 90,
8
+ "layer": "overlay",
9
+ "tags": ["title", "letters", "cascade", "spring", "kinetic type", "intro", "bold"],
10
+ "props": {
11
+ "lines": { "type": "lines", "label": "Text", "default": ["Ship *faster*"], "max": 3, "help": "One line per row. *Starred* words use the accent." },
12
+ "direction": { "type": "select", "label": "Direction", "default": "rise", "options": [{ "value": "rise", "label": "Rise up" }, { "value": "drop", "label": "Drop down" }] },
13
+ "color": { "type": "color", "style": "text", "label": "Text", "default": "#ffffff" },
14
+ "accent": { "type": "color", "style": "accent", "label": "Accent", "default": "#f97316" },
15
+ "background": { "type": "color", "label": "Background", "default": "transparent", "help": "\"transparent\" to sit over other layers." },
16
+ "size": { "type": "number", "label": "Size", "default": 15, "min": 4, "max": 30, "step": 0.5, "unit": "% of frame" },
17
+ "weight": { "type": "select", "style": "weight", "label": "Weight", "default": "800", "options": [{ "value": "500", "label": "Medium" }, { "value": "700", "label": "Bold" }, { "value": "800", "label": "Extra bold" }, { "value": "900", "label": "Black" }] },
18
+ "font": { "type": "select", "style": "font", "label": "Font", "default": "wide", "options": [{ "value": "sans", "label": "Inter" }, { "value": "display", "label": "Bricolage" }, { "value": "serif", "label": "Instrument Serif" }, { "value": "fraunces", "label": "Fraunces" }, { "value": "grotesk", "label": "Space Grotesk" }, { "value": "syne", "label": "Syne" }, { "value": "wide", "label": "Unbounded" }, { "value": "condensed", "label": "Anton" }, { "value": "mono", "label": "Mono" }, { "value": "archivo", "label": "Archivo Black" }, { "value": "caveat", "label": "Caveat" }, { "value": "pixel", "label": "VT323" }, { "value": "tech", "label": "Orbitron" }, { "value": "heavy", "label": "Montserrat" }, { "value": "retro", "label": "Bungee" }] },
19
+ "uppercase": { "type": "boolean", "label": "Uppercase", "default": false },
20
+ "stagger": { "type": "number", "label": "Letter delay", "default": 1.5, "min": 0.5, "max": 6, "step": 0.5, "unit": "frames" },
21
+ "bounce": { "type": "number", "label": "Bounce", "default": 0.4, "min": 0, "max": 1, "step": 0.05 }
22
+ },
23
+ "examples": [
24
+ { "name": "Rise", "props": {} },
25
+ { "name": "Poster", "props": { "lines": ["*Launch*", "week"], "font": "condensed", "weight": "500", "uppercase": true, "size": 22, "accent": "#facc15", "background": "#111111" } },
26
+ { "name": "Soft drop", "props": { "lines": ["Hello, *world*"], "direction": "drop", "font": "fraunces", "weight": "700", "bounce": 0.7, "accent": "#f472b6" } }
27
+ ],
28
+ "stillAt": 0.6
29
+ }
@@ -0,0 +1,179 @@
1
+ // Small helpers shared by the components. Components import only react, remotion and this file,
2
+ // so they bundle the same way in the gallery, the studio preview, the browser export and a local render.
3
+ import { useEffect, useState } from "react";
4
+ import { Easing, interpolate, spring, useDelayRender } from "remotion";
5
+
6
+ /** Scale for the frame size: 1 at 1080 px on the short side. */
7
+ export const unit = (width: number, height: number) => Math.min(width, height) / 1080;
8
+
9
+ export const clamp01 = (v: number) => Math.min(1, Math.max(0, v));
10
+
11
+ /** 0→1 over `frames` starting at `start`, eased. */
12
+ export function ramp(frame: number, start: number, frames: number, easing = Easing.bezier(0.22, 1, 0.36, 1)) {
13
+ return interpolate(frame, [start, start + Math.max(1, frames)], [0, 1], {
14
+ extrapolateLeft: "clamp",
15
+ extrapolateRight: "clamp",
16
+ easing,
17
+ });
18
+ }
19
+
20
+ /** A soft spring for entrances (no overshoot past ~4%). */
21
+ export function pop(frame: number, fps: number, delay = 0, stiffness = 170) {
22
+ return spring({ frame: frame - delay, fps, config: { damping: 18, stiffness, mass: 0.9 } });
23
+ }
24
+
25
+ /** 1 while on screen, easing to 0 over the last `frames` of the clip (the shared exit). */
26
+ export function exitOut(frame: number, durationInFrames: number, frames = 12) {
27
+ return 1 - ramp(frame, durationInFrames - frames, frames, Easing.bezier(0.55, 0, 0.75, 0.25));
28
+ }
29
+
30
+ export const mix = (a: number, b: number, t: number) => a + (b - a) * t;
31
+
32
+ /** Split "Make videos with *Claude*" into words, marking *starred* ones as highlighted. */
33
+ export function splitHighlights(line: string) {
34
+ return line
35
+ .split(/\s+/)
36
+ .filter(Boolean)
37
+ .map((word) => {
38
+ const highlighted = /^\*.*\*[.,!?:;]*$/.test(word);
39
+ return { text: highlighted ? word.replace(/\*/g, "") : word, highlighted };
40
+ });
41
+ }
42
+
43
+ export const FONTS: Record<string, string> = {
44
+ sans: 'Inter, "Geist", "Segoe UI", system-ui, -apple-system, sans-serif',
45
+ display: '"Bricolage Grotesque", "Geist", Inter, system-ui, sans-serif',
46
+ serif: '"Instrument Serif", Georgia, "Times New Roman", serif',
47
+ mono: '"Geist Mono", "JetBrains Mono", ui-monospace, Menlo, monospace',
48
+ grotesk: '"Space Grotesk", Inter, system-ui, sans-serif',
49
+ syne: 'Syne, "Bricolage Grotesque", Inter, system-ui, sans-serif',
50
+ fraunces: 'Fraunces, "Instrument Serif", Georgia, serif',
51
+ wide: 'Unbounded, "Bricolage Grotesque", Inter, system-ui, sans-serif',
52
+ condensed: 'Anton, "Bebas Neue", Impact, "Arial Narrow", sans-serif',
53
+ archivo: '"Archivo Black", "Arial Black", Inter, system-ui, sans-serif',
54
+ caveat: 'Caveat, "Segoe Print", "Comic Sans MS", cursive',
55
+ pixel: 'VT323, "Geist Mono", ui-monospace, monospace',
56
+ tech: 'Orbitron, Unbounded, "Space Grotesk", system-ui, sans-serif',
57
+ heavy: 'Montserrat, "Arial Black", Inter, system-ui, sans-serif',
58
+ retro: 'Bungee, "Arial Black", Impact, system-ui, sans-serif',
59
+ };
60
+
61
+ // Every family in FONTS, from Google Fonts (variable axes where the family has them).
62
+ const FONTS_CSS =
63
+ "https://fonts.googleapis.com/css2?family=Inter:wght@400..900&family=Bricolage+Grotesque:opsz,wght@12..96,400..800" +
64
+ "&family=Instrument+Serif:ital@0;1&family=Geist+Mono:wght@400..700&family=Space+Grotesk:wght@400..700" +
65
+ "&family=Syne:wght@400..800&family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900" +
66
+ "&family=Unbounded:wght@400..900&family=Anton&family=Archivo+Black&family=Caveat:wght@400..700&family=VT323&family=Orbitron:wght@400..900&family=Montserrat:wght@500..900&family=Bungee" +
67
+ "&display=block";
68
+ const FONT_FACES = [
69
+ "700 40px Inter",
70
+ '700 40px "Bricolage Grotesque"',
71
+ '400 40px "Instrument Serif"',
72
+ 'italic 400 40px "Instrument Serif"',
73
+ '500 40px "Geist Mono"',
74
+ '700 40px "Space Grotesk"',
75
+ "700 40px Syne",
76
+ "500 40px Fraunces",
77
+ "italic 500 40px Fraunces",
78
+ "700 40px Unbounded",
79
+ "400 40px Anton",
80
+ '400 40px "Archivo Black"',
81
+ "700 40px Caveat",
82
+ "400 40px VT323",
83
+ "800 40px Orbitron",
84
+ "900 40px Montserrat",
85
+ "400 40px Bungee",
86
+ ];
87
+
88
+ let fontsLoaded = false;
89
+ let fontsLoading: Promise<void> | undefined;
90
+
91
+ /** Loads the library's fonts once per page (resolves even if the network fails: text falls back). */
92
+ export function loadMotionFonts() {
93
+ if (typeof document === "undefined") return Promise.resolve();
94
+ fontsLoading ??= new Promise<void>((resolve) => {
95
+ const done = () => {
96
+ fontsLoaded = true;
97
+ resolve();
98
+ };
99
+ const timeout = setTimeout(done, 10000);
100
+ const link = document.createElement("link");
101
+ link.rel = "stylesheet";
102
+ link.href = FONTS_CSS;
103
+ link.onload = () => {
104
+ Promise.allSettled(FONT_FACES.map((face) => document.fonts.load(face))).then(() => {
105
+ clearTimeout(timeout);
106
+ done();
107
+ });
108
+ };
109
+ link.onerror = () => {
110
+ clearTimeout(timeout);
111
+ done();
112
+ };
113
+ document.head.appendChild(link);
114
+ });
115
+ return fontsLoading;
116
+ }
117
+
118
+ /** Holds the render (export, still, local render) until the fonts are in, so frame 0 has the right type. */
119
+ export function useMotionFonts() {
120
+ const { delayRender, continueRender } = useDelayRender();
121
+ const [handle] = useState(() => (fontsLoaded ? null : delayRender("Loading motion component fonts")));
122
+ useEffect(() => {
123
+ if (handle === null) return;
124
+ loadMotionFonts().then(() => continueRender(handle));
125
+ }, [handle, continueRender]);
126
+ }
127
+
128
+ /** The `background` prop as a CSS value ("transparent" keeps an overlay see-through). */
129
+ export const fill = (background: string) => (background === "transparent" ? undefined : background);
130
+
131
+ /**
132
+ * Blur that the browser export draws cleanly: it clips a filtered element to its own box, so the
133
+ * box gets padding for the blur's spread (and a matching negative margin, so layout doesn't move).
134
+ */
135
+ export function blurStyle(px: number) {
136
+ if (px < 0.3) return {};
137
+ const pad = Math.ceil(px * 2.5);
138
+ return { filter: `blur(${px.toFixed(2)}px)`, padding: pad, margin: -pad };
139
+ }
140
+
141
+ /**
142
+ * A hex color at an alpha, as rgba(). Fade gradients to the color at alpha 0 rather than to
143
+ * "transparent" (transparent black), which greys the falloff in the browser export.
144
+ */
145
+ export function alpha(hex: string, a: number) {
146
+ const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim());
147
+ if (!m) return a <= 0 ? "transparent" : hex;
148
+ const n = parseInt(m[1], 16);
149
+ return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${a})`;
150
+ }
151
+
152
+ /**
153
+ * A soft radial glow centered at (x, y) px. The browser export only draws centered, unsized radial
154
+ * gradients, so the glow is a box of the glow's size with a plain radial-gradient inside.
155
+ */
156
+ export function glowStyle(x: number, y: number, w: number, h: number, color: string, opacity = 1, reach = 0.7) {
157
+ return {
158
+ position: "absolute",
159
+ left: x - w / 2,
160
+ top: y - h / 2,
161
+ width: w,
162
+ height: h,
163
+ background: `radial-gradient(${color} 0%, ${alpha(color, 0)} ${Math.round(reach * 100)}%)`,
164
+ opacity,
165
+ } as const;
166
+ }
167
+
168
+ /** Out-expo: fast start, long soft landing (the "premium" ease). */
169
+ export const easeOutExpo = Easing.bezier(0.16, 1, 0.3, 1);
170
+ export const easeInOut = Easing.bezier(0.65, 0, 0.35, 1);
171
+
172
+ /** Readable text on a color: near-black or white. */
173
+ export function onColor(hex: string) {
174
+ const m = /^#?([0-9a-f]{6})$/i.exec(hex.trim());
175
+ if (!m) return "#ffffff";
176
+ const n = parseInt(m[1], 16);
177
+ const [r, g, b] = [(n >> 16) & 255, (n >> 8) & 255, n & 255];
178
+ return 0.299 * r + 0.587 * g + 0.114 * b > 160 ? "#0b0d10" : "#ffffff";
179
+ }
@@ -0,0 +1,43 @@
1
+ import { LightLeak } from "@remotion/light-leaks";
2
+ import { AbsoluteFill, interpolate, useCurrentFrame } from "remotion";
3
+ import type { MotionBaseProps } from "../types";
4
+
5
+ type Props = MotionBaseProps & {
6
+ seed: number;
7
+ hueShift: number;
8
+ strength: number;
9
+ flash: boolean;
10
+ };
11
+
12
+ /**
13
+ * A film light leak that blooms over the frame and retracts (Remotion's WebGL light leak).
14
+ * Center the clip on a cut: it covers most of the frame at its midpoint, hiding the change.
15
+ */
16
+ export function LightLeakTransition(props: Props) {
17
+ const frame = useCurrentFrame();
18
+ const mid = props.durationInFrames / 2;
19
+ // An optional soft white bloom right at the cut.
20
+ const flash = props.flash
21
+ ? interpolate(frame, [mid - 6, mid, mid + 8], [0, 0.55, 0], {
22
+ extrapolateLeft: "clamp",
23
+ extrapolateRight: "clamp",
24
+ })
25
+ : 0;
26
+ return (
27
+ <AbsoluteFill style={{ opacity: props.strength }}>
28
+ <LightLeak
29
+ durationInFrames={props.durationInFrames}
30
+ seed={Math.round(props.seed)}
31
+ hueShift={props.hueShift}
32
+ />
33
+ {flash > 0 ? (
34
+ <AbsoluteFill
35
+ style={{
36
+ background: "radial-gradient(80% 70% at 50% 45%, #fff6e6 0%, rgba(255,246,230,0) 70%)",
37
+ opacity: flash,
38
+ }}
39
+ />
40
+ ) : null}
41
+ </AbsoluteFill>
42
+ );
43
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "id": "light-leak",
3
+ "name": "Light Leak",
4
+ "category": "Transitions",
5
+ "description": "A warm film light leak that blooms over the frame and retracts, covering a cut at its midpoint.",
6
+ "useWhen": "Soft, cinematic transitions between scenes or clips, reveals, the drop of a song, a dreamy or nostalgic look. Put it on a track above both clips and center it on the cut (from = cut frame \u2212 half its length).",
7
+ "durationInFrames": 40,
8
+ "layer": "overlay",
9
+ "tags": [
10
+ "transition",
11
+ "light leak",
12
+ "film",
13
+ "flare",
14
+ "cut",
15
+ "cinematic"
16
+ ],
17
+ "props": {
18
+ "seed": {
19
+ "type": "number",
20
+ "label": "Pattern",
21
+ "default": 3,
22
+ "min": 0,
23
+ "max": 40,
24
+ "step": 1,
25
+ "help": "Different numbers give different leak shapes."
26
+ },
27
+ "hueShift": {
28
+ "type": "number",
29
+ "label": "Hue",
30
+ "default": 0,
31
+ "min": 0,
32
+ "max": 360,
33
+ "step": 1,
34
+ "unit": "\u00b0",
35
+ "help": "0 warm amber, 120 green, 240 blue."
36
+ },
37
+ "strength": {
38
+ "type": "number",
39
+ "label": "Strength",
40
+ "default": 1,
41
+ "min": 0.2,
42
+ "max": 1,
43
+ "step": 0.05
44
+ },
45
+ "flash": {
46
+ "type": "boolean",
47
+ "label": "Bloom at the cut",
48
+ "default": false,
49
+ "help": "A brief soft white flash at the midpoint."
50
+ }
51
+ },
52
+ "examples": [
53
+ {
54
+ "name": "Warm",
55
+ "props": {}
56
+ },
57
+ {
58
+ "name": "Cool blue",
59
+ "props": {
60
+ "seed": 11,
61
+ "hueShift": 210
62
+ }
63
+ },
64
+ {
65
+ "name": "Bloom",
66
+ "props": {
67
+ "seed": 7,
68
+ "hueShift": 330,
69
+ "flash": true
70
+ }
71
+ }
72
+ ],
73
+ "stillAt": 0.45
74
+ }