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,128 @@
1
+ // Pain 1: posting by hand, brand by brand (five phones, a pointer tapping POST on each, times scribbled under them)
2
+ // Fix 1: one calendar, every client — client tabs, a month grid, post cards landing in their cells.
3
+ import { SPRING, sp, type SceneProps } from "agentcut";
4
+ import { PainFix } from "./lib/painfix";
5
+ import { HandText, Hatch, PRINT, SCRIPT, Sk, SkLine, SkPoly, SkRect, prog } from "./lib/sketch";
6
+
7
+ type Card = { r: number; c: number; brand: string };
8
+ type Props = SceneProps & {
9
+ tSwipe: number; tPainText: number; tFixText: number; painText: string; fixText: string;
10
+ brands: string[]; times: string[]; tabs: string[]; cards: Card[]; tTaps: number; tapEvery: number; tCards: number; cardEvery: number;
11
+ enterFrom?: [number, number] | null;
12
+ };
13
+
14
+ export default function Posting(p: Props) {
15
+ return (
16
+ <PainFix
17
+ duration={p.clip.duration} tSwipe={p.tSwipe} tPainText={p.tPainText} tFixText={p.tFixText}
18
+ painText={p.painText} fixText={p.fixText} fixPose="scheduled" fixAt={[1720, 1005, 330]} enterFrom={p.enterFrom ?? null}
19
+ pain={(f) => <Pain f={f} {...p} />}
20
+ fix={(f, fl) => <Fix f={f} fl={fl} {...p} />}
21
+ />
22
+ );
23
+ }
24
+
25
+ function Pain({ f, brands, times, tTaps, tapEvery }: Props & { f: number }) {
26
+ return (
27
+ <>
28
+ <Sk>
29
+ {brands.map((_, i) => {
30
+ const x = 150 + i * 280, y = 300 + (i % 2) * 30;
31
+ const pp = prog(f, 4 + i * 4, 10);
32
+ const rot = [-3, 2, -1.5, 3, -2][i % 5];
33
+ const tapped = f >= tTaps + i * tapEvery;
34
+ return (
35
+ <g key={i} transform={`rotate(${rot} ${x + 110} ${y + 220})`}>
36
+ <SkRect x={x} y={y} w={220} h={430} p={pp} id={20 + i} sw={3.4} fill="#EEEBE5" />
37
+ <SkLine a={[x + 80, y + 22]} b={[x + 140, y + 22]} p={pp} id={30 + i} sw={3} />
38
+ <SkRect x={x + 22} y={y + 90} w={176} h={150} p={pp} id={40 + i} sw={2.4} />
39
+ <Hatch x={x + 26} y={y + 94} w={168} h={142} p={pp} id={50 + i} gap={13} o={0.22} />
40
+ <SkLine a={[x + 22, y + 262]} b={[x + 190, y + 262]} p={pp} id={60 + i} sw={2} o={0.6} />
41
+ <SkLine a={[x + 22, y + 286]} b={[x + 150, y + 286]} p={pp} id={65 + i} sw={2} o={0.6} />
42
+ <SkRect x={x + 40} y={y + 320} w={140} h={58} p={pp} id={70 + i} sw={3.4} fill={tapped ? "#cfcac2" : undefined} />
43
+ {tapped && f < tTaps + i * tapEvery + 8 && [0, 1, 2, 3].map((k) => {
44
+ const a = (k / 4) * Math.PI * 2 + 0.4;
45
+ return <SkLine key={k} a={[x + 110 + Math.cos(a) * 80, y + 349 + Math.sin(a) * 50]} b={[x + 110 + Math.cos(a) * 110, y + 349 + Math.sin(a) * 70]} id={80 + k + i * 4} sw={3} />;
46
+ })}
47
+ </g>
48
+ );
49
+ })}
50
+ {/* the pointer that taps every POST button, one after another */}
51
+ {(() => {
52
+ const i = Math.min(brands.length - 1, Math.max(0, Math.floor((f - tTaps + tapEvery) / tapEvery)));
53
+ if (f < tTaps - 10) return null;
54
+ const tx = 150 + i * 280 + 140, ty = 300 + (i % 2) * 30 + 380;
55
+ const local = (f - tTaps) - i * tapEvery;
56
+ const lift = local < 0 ? Math.min(1, -local / 6) : Math.max(0, 1 - Math.abs(local) / 3) * 0;
57
+ return <SkPoly pts={[[tx, ty - lift * 40], [tx + 18, ty + 52 - lift * 40], [tx + 28, ty + 34 - lift * 40], [tx + 52, ty + 46 - lift * 40], [tx, ty - lift * 40]]} closed id={99} sw={3.4} />;
58
+ })()}
59
+ </Sk>
60
+ {brands.map((b, i) => {
61
+ const x = 150 + i * 280, y = 300 + (i % 2) * 30;
62
+ return (
63
+ <div key={b}>
64
+ <HandText x={x + 110} y={y + 334} size={36} font={PRINT} weight={400} p={prog(f, 10 + i * 4, 6)} id={110 + i} align="center" width={140}>POST</HandText>
65
+ <HandText x={x + 110} y={y + 448} size={40} font={SCRIPT} p={prog(f, 12 + i * 4, 6)} id={120 + i} align="center" width={220}>{b}</HandText>
66
+ <HandText x={x + 110} y={y + 500} size={44} font={SCRIPT} p={prog(f, tTapsFor(i), 6)} id={130 + i} align="center" width={220} color="#4a4744">{times[i]}</HandText>
67
+ </div>
68
+ );
69
+ })}
70
+ </>
71
+ );
72
+ function tTapsFor(i: number) { return tTaps + i * tapEvery; }
73
+ }
74
+
75
+ const GX = 170, GY = 360, GW = 1330, GH = 610, COLS = 7, ROWS = 4;
76
+ const DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
77
+
78
+ function Fix({ fl, tabs, cards, tCards, cardEvery }: Props & { f: number; fl: number }) {
79
+ const cw = GW / COLS, rh = (GH - 56) / ROWS;
80
+ const pg = prog(fl, -2, 12);
81
+ return (
82
+ <>
83
+ <Sk>
84
+ {tabs.map((_, i) => (
85
+ <SkPoly key={i} pts={[[GX + i * 250, GY], [GX + i * 250 + 18, GY - 62], [GX + i * 250 + 222, GY - 62], [GX + i * 250 + 240, GY]]} p={prog(fl, i * 3, 8)} id={300 + i} sw={i === 0 ? 4.5 : 3} />
86
+ ))}
87
+ <SkRect x={GX} y={GY} w={GW} h={GH} p={pg} id={310} sw={4.5} fill="#EFECE6" />
88
+ <SkLine a={[GX, GY + 56]} b={[GX + GW, GY + 56]} p={pg} id={311} sw={3} />
89
+ {Array.from({ length: COLS - 1 }, (_, i) => (
90
+ <SkLine key={i} a={[GX + (i + 1) * cw, GY + 56]} b={[GX + (i + 1) * cw, GY + GH]} p={prog(fl, 4 + i, 8)} id={320 + i} sw={2} o={0.6} />
91
+ ))}
92
+ {Array.from({ length: ROWS - 1 }, (_, i) => (
93
+ <SkLine key={i} a={[GX, GY + 56 + (i + 1) * rh]} b={[GX + GW, GY + 56 + (i + 1) * rh]} p={prog(fl, 6 + i, 8)} id={330 + i} sw={2} o={0.6} />
94
+ ))}
95
+ {cards.map((c, i) => {
96
+ const t0 = tCards + i * cardEvery;
97
+ if (fl < t0) return null;
98
+ const land = sp(fl, t0, SPRING.pop);
99
+ const x = GX + c.c * cw + 10, y = GY + 56 + c.r * rh + 10 - (1 - land) * 60;
100
+ return (
101
+ <g key={i} opacity={Math.min(1, land * 1.5)}>
102
+ <SkRect x={x} y={y} w={cw - 20} h={rh - 20} id={340 + i} sw={3} fill="#F4F2EE" />
103
+ <Hatch x={x + 8} y={y + 8} w={44} h={rh - 36} id={360 + i} gap={8} o={0.4} />
104
+ </g>
105
+ );
106
+ })}
107
+ </Sk>
108
+ {tabs.map((t, i) => (
109
+ <HandText key={t} x={GX + i * 250 + 120} y={GY - 56} size={40} font={SCRIPT} p={prog(fl, 2 + i * 3, 6)} id={380 + i} align="center" width={220}>{t}</HandText>
110
+ ))}
111
+ {DAYS.map((d, i) => (
112
+ <HandText key={d} x={GX + i * cw + cw / 2} y={GY + 6} size={36} font={PRINT} weight={400} p={prog(fl, 6 + i, 4)} id={390 + i} align="center" width={cw}>{d}</HandText>
113
+ ))}
114
+ {cards.map((c, i) => {
115
+ const t0 = tCards + i * cardEvery;
116
+ if (fl < t0) return null;
117
+ const land = sp(fl, t0, SPRING.pop);
118
+ const x = GX + c.c * cw + 10, y = GY + 56 + c.r * rh + 10 - (1 - land) * 60;
119
+ return (
120
+ <div key={i} style={{ opacity: Math.min(1, land * 1.5) }}>
121
+ <HandText x={x + 60} y={y + 12} size={28} font={SCRIPT} id={400 + i}>{c.brand}</HandText>
122
+ <HandText x={x + 60} y={y + 52} size={22} font={PRINT} weight={400} id={420 + i} color="#4a4744">Scheduled</HandText>
123
+ </div>
124
+ );
125
+ })}
126
+ </>
127
+ );
128
+ }
@@ -0,0 +1,119 @@
1
+ // Pain -> fix beat. A comic panel holds a messy charcoal sketch of the pain; on the bar line the colour mascot
2
+ // dashes across left->right, and everything behind it is redrawn as the neat fix (eraser smear on the seam).
3
+ import React from "react";
4
+ import { AbsoluteFill, useCurrentFrame } from "remotion";
5
+ import { SPRING, ease, mix, sp } from "agentcut";
6
+ import { HAND, HandText, Mascot, MascotShadow, Sk, SkCheck, SkLine, SkPoly, SkRect, Smudge, clamp, prog } from "./sketch";
7
+
8
+ export type PainFixProps = {
9
+ duration: number;
10
+ tSwipe: number; // local frame the mascot crosses the centre (the bar line)
11
+ tPainText: number; // pain caption writes on (first spoken word)
12
+ tFixText: number;
13
+ painText: string;
14
+ fixText: string;
15
+ fixPose: string;
16
+ fixAt?: [number, number, number]; // mascot x, feet y, height after the swipe
17
+ enterFrom?: [number, number] | null; // mascot start (feet) for a hop-in from the previous beat; null = pop in
18
+ pain: (f: number) => React.ReactNode;
19
+ fix: (f: number, fl: number) => React.ReactNode; // fl = frames since the swipe
20
+ painSize?: number;
21
+ fixSize?: number;
22
+ };
23
+
24
+ const SWIPE = 22; // frames for the dash across the frame
25
+
26
+ export function PainFix(props: PainFixProps) {
27
+ const f = useCurrentFrame();
28
+ const { duration, tSwipe, tPainText, tFixText, painText, fixText, fixPose, pain, fix } = props;
29
+ const [fx, fy, fh] = props.fixAt ?? [1715, 1010, 330];
30
+ const out = ease(f, duration - 8, duration);
31
+ const s0 = tSwipe - SWIPE / 2;
32
+ const k = clamp((f - s0) / SWIPE, 0, 1);
33
+ const kk = ease(f, s0, s0 + SWIPE); // eased dash
34
+ const seam = mix(-260, 2180, kk); // x of the mascot during the dash
35
+ const swiping = f >= s0 && f < s0 + SWIPE;
36
+ const after = f >= s0 + SWIPE;
37
+
38
+ // pre-swipe mascot: confused, peeking from the bottom-right corner
39
+ const pop = props.enterFrom ? sp(f, 0, SPRING.snappy) : sp(f, 8, SPRING.pop);
40
+ let mx = 1745, my = 1060, mh = 270, pose = "confused", rot = 0;
41
+ if (props.enterFrom && f < 16) {
42
+ const t = ease(f, 0, 16);
43
+ mx = mix(props.enterFrom[0], 1745, t);
44
+ my = mix(props.enterFrom[1], 1060, t) - Math.sin(Math.PI * t) * 160;
45
+ pose = "excited";
46
+ rot = mix(-8, 0, t);
47
+ } else if (!props.enterFrom) {
48
+ my = mix(1400, 1060, pop);
49
+ }
50
+ // wind-up right before the dash: the mascot ducks off the right edge
51
+ const exitR = ease(f, s0 - 10, s0 - 2);
52
+ mx += exitR * 360;
53
+ if (swiping) {
54
+ mx = seam;
55
+ my = 1000 - Math.abs(Math.sin(k * Math.PI * 3)) * 40;
56
+ mh = 300;
57
+ pose = "excited";
58
+ rot = 12;
59
+ }
60
+ if (after) {
61
+ const land = sp(f, s0 + SWIPE, SPRING.land);
62
+ mx = mix(2250, fx, land);
63
+ my = fy;
64
+ mh = fh;
65
+ pose = fixPose;
66
+ rot = mix(10, 0, land);
67
+ }
68
+
69
+ const fl = f - tSwipe;
70
+ const painClip = swiping ? `inset(0px 0px 0px ${seam}px)` : undefined;
71
+ const fixClip = swiping ? `inset(0px ${1920 - seam}px 0px 0px)` : undefined;
72
+
73
+ const panelP = prog(f, 0, 10);
74
+ return (
75
+ <AbsoluteFill style={{ opacity: 1 - out, filter: out > 0 ? `blur(${out * 5}px)` : undefined }}>
76
+ <Sk>
77
+ <SkRect x={56} y={44} w={1808} h={992} p={panelP} id={7} sw={5} />
78
+ </Sk>
79
+ {!after && (
80
+ <AbsoluteFill style={{ clipPath: painClip }}>
81
+ {pain(f)}
82
+ <Caption text={painText} p={prog(f, tPainText, 12)} id={11} size={props.painSize ?? 96} question />
83
+ </AbsoluteFill>
84
+ )}
85
+ {(swiping || after) && (
86
+ <AbsoluteFill style={{ clipPath: fixClip }}>
87
+ {fix(f, fl)}
88
+ <Caption text={fixText} p={prog(f, tFixText, 12)} id={12} size={props.fixSize ?? 96} />
89
+ </AbsoluteFill>
90
+ )}
91
+ {swiping && <Smudge x={seam - 120} y={560} w={340} h={1100} o={0.35} rot={4} />}
92
+ {(after || (!swiping && exitR < 1)) && <MascotShadow x={mx} y={my - 4} w={mh * 0.62} o={0.4} />}
93
+ <Mascot pose={pose} x={mx} y={my} h={mh} rot={rot} />
94
+ </AbsoluteFill>
95
+ );
96
+ }
97
+
98
+ function Caption({ text, p, id, size, question }: { text: string; p: number; id: number; size: number; question?: boolean }) {
99
+ if (p <= 0) return null;
100
+ const u = clamp(p * 1.4 - 0.4, 0, 1);
101
+ return (
102
+ <>
103
+ <HandText x={110} y={78} size={size} p={p} id={id} font={HAND}>{text}</HandText>
104
+ <Sk>
105
+ {question ? (
106
+ <>
107
+ <SkLine a={[112, 78 + size * 1.12]} b={[112 + text.length * size * 0.42, 78 + size * 1.1]} p={u} id={id + 3} sw={4} />
108
+ <SkLine a={[130, 78 + size * 1.24]} b={[112 + text.length * size * 0.36, 78 + size * 1.22]} p={clamp(u * 1.5 - 0.5, 0, 1)} id={id + 4} sw={3} o={0.7} />
109
+ </>
110
+ ) : (
111
+ <>
112
+ <SkPoly pts={[[112, 78 + size * 1.14], [112 + text.length * size * 0.42, 78 + size * 1.1]]} p={u} id={id + 3} sw={5} />
113
+ <SkCheck x={130 + text.length * size * 0.44} y={78 + size * 0.55} s={1.3} p={clamp(u * 2 - 1, 0, 1)} id={id + 5} sw={6} />
114
+ </>
115
+ )}
116
+ </Sk>
117
+ </>
118
+ );
119
+ }
@@ -0,0 +1,291 @@
1
+ // Charcoal sketch kit. Everything is graphite grey on paper; the mascot (Mascot) is the only colour.
2
+ // Lines are hand-wobbled polylines re-seeded on threes ("line boil"), drawn on with a progress 0..1.
3
+ // All coordinates live in a 1920x1080 SVG viewBox (wide only).
4
+ import React from "react";
5
+ import { AbsoluteFill, Img, useCurrentFrame } from "remotion";
6
+ import { asset, ease } from "agentcut";
7
+
8
+ export const clamp = (v: number, lo = 0, hi = 1) => Math.min(hi, Math.max(lo, v));
9
+
10
+ export const INK = "#2a2826";
11
+ export const INK_SOFT = "#5d5a56";
12
+ export const PAPER = "#E9E6DF";
13
+ export const HAND = "Cabin Sketch";
14
+ export const SCRIPT = "Caveat";
15
+ export const PRINT = "Patrick Hand";
16
+
17
+ /** boil index: changes every `every` frames (sketch elements animate on threes). */
18
+ export const boil = (f: number, every = 3) => Math.floor(f / every);
19
+ /** frame quantised to twos for drawn elements (the mascot moves on ones). */
20
+ export const twos = (f: number) => Math.floor(f / 2) * 2;
21
+ /** draw-on progress on twos. */
22
+ export const prog = (f: number, start: number, dur: number) => clamp((twos(f) - start) / dur, 0, 1);
23
+
24
+ export function rng(seed: number) {
25
+ let a = (seed * 2654435761) >>> 0;
26
+ return () => {
27
+ a = (a + 0x6d2b79f5) >>> 0;
28
+ let t = a;
29
+ t = Math.imul(t ^ (t >>> 15), t | 1);
30
+ t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
31
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
32
+ };
33
+ }
34
+
35
+ export type Pt = [number, number];
36
+
37
+ /** a hand-drawn line: slight bow, per-point wobble, overshoot at both ends. */
38
+ export function roughLine(a: Pt, b: Pt, seed: number, rough = 1): Pt[] {
39
+ const r = rng(seed);
40
+ const dx = b[0] - a[0], dy = b[1] - a[1];
41
+ const len = Math.hypot(dx, dy) || 1;
42
+ const nx = -dy / len, ny = dx / len;
43
+ const over = (r() * 0.04 + 0.01) * Math.min(len, 400);
44
+ const bow = (r() - 0.5) * Math.min(len, 600) * 0.025 * rough;
45
+ const n = Math.max(4, Math.round(len / 28));
46
+ const pts: Pt[] = [];
47
+ for (let i = 0; i <= n; i++) {
48
+ const t = i / n;
49
+ const tt = -over / len + t * (1 + (2 * over) / len);
50
+ const off = Math.sin(Math.PI * t) * bow + (r() - 0.5) * 2.2 * rough;
51
+ pts.push([a[0] + dx * tt + nx * off, a[1] + dy * tt + ny * off]);
52
+ }
53
+ return pts;
54
+ }
55
+
56
+ export function roughPoly(pts: Pt[], seed: number, closed = false, rough = 1): Pt[] {
57
+ const out: Pt[] = [];
58
+ const segs = closed ? pts.length : pts.length - 1;
59
+ for (let i = 0; i < segs; i++) {
60
+ const seg = roughLine(pts[i], pts[(i + 1) % pts.length], seed * 31 + i, rough);
61
+ out.push(...(i === 0 ? seg : seg.slice(1)));
62
+ }
63
+ return out;
64
+ }
65
+
66
+ export function roughEllipse(cx: number, cy: number, rx: number, ry: number, seed: number, rough = 1): Pt[] {
67
+ const r = rng(seed);
68
+ const start = r() * Math.PI * 2;
69
+ const sweep = Math.PI * 2 * (1.06 + r() * 0.08); // sketchy circles overshoot
70
+ const n = Math.max(18, Math.round((rx + ry) / 7));
71
+ const pts: Pt[] = [];
72
+ for (let i = 0; i <= n; i++) {
73
+ const t = start + (sweep * i) / n;
74
+ const k = 1 + (r() - 0.5) * 0.03 * rough + (i / n) * 0.04;
75
+ pts.push([cx + Math.cos(t) * rx * k, cy + Math.sin(t) * ry * k]);
76
+ }
77
+ return pts;
78
+ }
79
+
80
+ /** keep the first fraction (by length) of a polyline. */
81
+ export function trim(pts: Pt[], p: number): Pt[] {
82
+ if (p >= 1) return pts;
83
+ if (p <= 0 || pts.length < 2) return [];
84
+ let total = 0;
85
+ const seg: number[] = [];
86
+ for (let i = 1; i < pts.length; i++) {
87
+ const d = Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]);
88
+ seg.push(d);
89
+ total += d;
90
+ }
91
+ let want = total * p;
92
+ const out: Pt[] = [pts[0]];
93
+ for (let i = 1; i < pts.length; i++) {
94
+ if (want >= seg[i - 1]) {
95
+ out.push(pts[i]);
96
+ want -= seg[i - 1];
97
+ } else {
98
+ const t = want / seg[i - 1];
99
+ out.push([pts[i - 1][0] + (pts[i][0] - pts[i - 1][0]) * t, pts[i - 1][1] + (pts[i][1] - pts[i - 1][1]) * t]);
100
+ break;
101
+ }
102
+ }
103
+ return out;
104
+ }
105
+
106
+ export function toD(pts: Pt[]): string {
107
+ if (pts.length < 2) return "";
108
+ let d = `M${pts[0][0].toFixed(1)},${pts[0][1].toFixed(1)}`;
109
+ for (let i = 1; i < pts.length - 1; i++) {
110
+ const mx = (pts[i][0] + pts[i + 1][0]) / 2, my = (pts[i][1] + pts[i + 1][1]) / 2;
111
+ d += ` Q${pts[i][0].toFixed(1)},${pts[i][1].toFixed(1)} ${mx.toFixed(1)},${my.toFixed(1)}`;
112
+ }
113
+ const l = pts[pts.length - 1];
114
+ d += ` L${l[0].toFixed(1)},${l[1].toFixed(1)}`;
115
+ return d;
116
+ }
117
+
118
+ type StrokeStyle = { sw?: number; o?: number; color?: string; passes?: number };
119
+
120
+ /** draws one shape (given as a generator of points per seed) in 1–3 charcoal passes. */
121
+ function Passes({ make, p, sw = 3.2, o = 0.9, color = INK, passes = 2, seed }: StrokeStyle & {
122
+ make: (seed: number) => Pt[];
123
+ p: number;
124
+ seed: number;
125
+ }) {
126
+ if (p <= 0) return null;
127
+ const halo = trim(make(seed * 7 + 55), p);
128
+ return (
129
+ <g>
130
+ {/* soft charcoal halo: a wide, faint smear under the line */}
131
+ <path d={toD(halo)} fill="none" stroke={color} strokeOpacity={o * 0.1} strokeWidth={sw * 4.5} strokeLinecap="round" strokeLinejoin="round" />
132
+ {Array.from({ length: passes }, (_, i) => {
133
+ const pts = trim(make(seed * 7 + i * 101), p);
134
+ return (
135
+ <path key={i} d={toD(pts)} fill="none" stroke={color} strokeOpacity={i === 0 ? o : o * 0.55}
136
+ strokeWidth={i === 0 ? sw : sw * 0.6} strokeLinecap="round" strokeLinejoin="round" />
137
+ );
138
+ })}
139
+ </g>
140
+ );
141
+ }
142
+
143
+ /** the per-frame seed for a shape: stable id + boil. */
144
+ export function useBoil(id: number, every = 3) {
145
+ const f = useCurrentFrame();
146
+ return id * 977 + boil(f, every) * 13;
147
+ }
148
+
149
+ export function SkLine({ a, b, p = 1, id = 1, rough = 1, ...s }: StrokeStyle & { a: Pt; b: Pt; p?: number; id?: number; rough?: number }) {
150
+ const seed = useBoil(id);
151
+ return <Passes make={(sd) => roughLine(a, b, sd, rough)} p={p} seed={seed} {...s} />;
152
+ }
153
+
154
+ export function SkPoly({ pts, closed = false, p = 1, id = 1, rough = 1, ...s }: StrokeStyle & { pts: Pt[]; closed?: boolean; p?: number; id?: number; rough?: number }) {
155
+ const seed = useBoil(id);
156
+ return <Passes make={(sd) => roughPoly(pts, sd, closed, rough)} p={p} seed={seed} {...s} />;
157
+ }
158
+
159
+ /** rectangle drawn as four separate strokes (each overshoots), drawn on one after another. */
160
+ export function SkRect({ x, y, w: rw, h, p = 1, id = 1, fill, ...s }: StrokeStyle & { x: number; y: number; w: number; h: number; p?: number; id?: number; fill?: string }) {
161
+ const seed = useBoil(id);
162
+ const c: Pt[] = [[x, y], [x + rw, y], [x + rw, y + h], [x, y + h]];
163
+ return (
164
+ <g>
165
+ {fill && p > 0 ? <rect x={x} y={y} width={rw} height={h} fill={fill} opacity={clamp(p * 2, 0, 1)} /> : null}
166
+ {[0, 1, 2, 3].map((i) => (
167
+ <Passes key={i} make={(sd) => roughLine(c[i], c[(i + 1) % 4], sd)} p={clamp(p * 4 - i, 0, 1)} seed={seed + i * 5} {...s} />
168
+ ))}
169
+ </g>
170
+ );
171
+ }
172
+
173
+ export function SkEllipse({ cx, cy, rx, ry, p = 1, id = 1, rough = 1, ...s }: StrokeStyle & { cx: number; cy: number; rx: number; ry: number; p?: number; id?: number; rough?: number }) {
174
+ const seed = useBoil(id);
175
+ return <Passes make={(sd) => roughEllipse(cx, cy, rx, ry, sd, rough)} p={p} seed={seed} {...s} />;
176
+ }
177
+
178
+ /** diagonal charcoal hatching inside a rect (shading). */
179
+ export function Hatch({ x, y, w: rw, h, p = 1, id = 1, gap = 14, angle = 1, o = 0.35, sw = 2 }: { x: number; y: number; w: number; h: number; p?: number; id?: number; gap?: number; angle?: number; o?: number; sw?: number }) {
180
+ const seed = useBoil(id);
181
+ const r = rng(seed);
182
+ const lines: React.ReactNode[] = [];
183
+ const n = Math.floor((rw + h) / gap);
184
+ const shown = Math.floor(n * p);
185
+ for (let i = 0; i < shown; i++) {
186
+ const d = i * gap;
187
+ // line x + y = const (angle 1) clipped to rect
188
+ let a: Pt = angle > 0 ? [x + Math.min(d, rw), y + Math.max(0, d - rw)] : [x + rw - Math.min(d, rw), y + Math.max(0, d - rw)];
189
+ let b: Pt = angle > 0 ? [x + Math.max(0, d - h), y + Math.min(d, h)] : [x + rw - Math.max(0, d - h), y + Math.min(d, h)];
190
+ const j = (r() - 0.5) * 4;
191
+ a = [a[0] + j, a[1]];
192
+ b = [b[0] + j, b[1]];
193
+ lines.push(<path key={i} d={toD(roughLine(a, b, seed + i, 0.6))} stroke={INK} strokeOpacity={o * (0.7 + r() * 0.5)} strokeWidth={sw} fill="none" strokeLinecap="round" />);
194
+ }
195
+ return <g>{lines}</g>;
196
+ }
197
+
198
+ /** check mark / cross / arrow helpers */
199
+ export function SkCheck({ x, y, s = 1, p = 1, id = 1, ...st }: StrokeStyle & { x: number; y: number; s?: number; p?: number; id?: number }) {
200
+ return <SkPoly pts={[[x, y], [x + 16 * s, y + 18 * s], [x + 46 * s, y - 24 * s]]} p={p} id={id} {...st} />;
201
+ }
202
+ export function SkArrow({ a, b, p = 1, id = 1, head = 26, ...st }: StrokeStyle & { a: Pt; b: Pt; p?: number; id?: number; head?: number }) {
203
+ const ang = Math.atan2(b[1] - a[1], b[0] - a[0]);
204
+ const h1: Pt = [b[0] - Math.cos(ang - 0.5) * head, b[1] - Math.sin(ang - 0.5) * head];
205
+ const h2: Pt = [b[0] - Math.cos(ang + 0.5) * head, b[1] - Math.sin(ang + 0.5) * head];
206
+ return (
207
+ <g>
208
+ <SkLine a={a} b={b} p={clamp(p * 1.25, 0, 1)} id={id} {...st} />
209
+ <SkPoly pts={[h1, b, h2]} p={clamp(p * 5 - 4, 0, 1)} id={id + 50} {...st} />
210
+ </g>
211
+ );
212
+ }
213
+
214
+ /** full-frame SVG layer in the 1920x1080 space. */
215
+ export function Sk({ children, style }: { children: React.ReactNode; style?: React.CSSProperties }) {
216
+ return (
217
+ <svg viewBox="0 0 1920 1080" width="100%" height="100%" style={{ position: "absolute", inset: 0, overflow: "visible", ...style }}>
218
+ {children}
219
+ </svg>
220
+ );
221
+ }
222
+
223
+ /** handwritten text, written on left→right (clip) and boiling slightly on threes. */
224
+ export function HandText({ children, x, y, size = 80, font = HAND, weight = 700, p = 1, id = 1, color = INK, align = "left", width, rot = 0, style }: {
225
+ children: React.ReactNode; x: number; y: number; size?: number; font?: string; weight?: number; p?: number; id?: number; color?: string;
226
+ align?: "left" | "center" | "right"; width?: number; rot?: number; style?: React.CSSProperties;
227
+ }) {
228
+ const f = useCurrentFrame();
229
+ const r = rng(id * 31 + boil(f));
230
+ const jx = (r() - 0.5) * 2.2, jy = (r() - 0.5) * 2.2, jr = (r() - 0.5) * 0.5;
231
+ if (p <= 0) return null;
232
+ const left = align === "center" && width ? x - width / 2 : align === "right" && width ? x - width : x;
233
+ return (
234
+ <div style={{
235
+ position: "absolute", left, top: y, width, fontFamily: font, fontWeight: weight, fontSize: size, lineHeight: 1.02,
236
+ color, textAlign: align, whiteSpace: width ? "normal" : "nowrap",
237
+ transform: `translate(${jx}px, ${jy}px) rotate(${rot + jr}deg)`,
238
+ clipPath: p < 1 ? `inset(-20% ${(1 - p) * 100}% -20% -5%)` : undefined,
239
+ textShadow: `0.6px 0.8px 0 rgba(42,40,38,0.35)`,
240
+ ...style,
241
+ }}>{children}</div>
242
+ );
243
+ }
244
+
245
+ /** the Rolino mascot: the only colour element. Moves on ones. */
246
+ export function Mascot({ pose, x, y, h, rot = 0, flip = false, opacity = 1, squash = 0 }: {
247
+ pose: string; x: number; y: number; h: number; rot?: number; flip?: boolean; opacity?: number; squash?: number;
248
+ }) {
249
+ // x,y = bottom centre (feet) in px
250
+ const sy = 1 - squash, sx = 1 + squash * 0.6;
251
+ return (
252
+ <div style={{
253
+ position: "absolute", left: x, top: y, width: 0, height: 0, opacity,
254
+ }}>
255
+ <Img src={asset(`assets/mascot/${pose}.png`)} style={{
256
+ position: "absolute", height: h, left: 0, bottom: 0,
257
+ transform: `translateX(-50%) rotate(${rot}deg) scale(${(flip ? -1 : 1) * sx}, ${sy})`, transformOrigin: "50% 100%",
258
+ }} />
259
+ </div>
260
+ );
261
+ }
262
+
263
+ /** a hatched contact shadow under the mascot so it sits on the paper. */
264
+ export function MascotShadow({ x, y, w, id = 900, o = 0.5 }: { x: number; y: number; w: number; id?: number; o?: number }) {
265
+ return (
266
+ <Sk>
267
+ <SkEllipse cx={x} cy={y} rx={w / 2} ry={w / 9} id={id} sw={2.4} o={o} />
268
+ <SkEllipse cx={x} cy={y} rx={w / 2.6} ry={w / 14} id={id + 1} sw={2} o={o * 0.7} />
269
+ </Sk>
270
+ );
271
+ }
272
+
273
+ /** a smeared eraser band (for the mascot's swipe). */
274
+ export function Smudge({ x, y, w, h, o = 0.5, rot = 0 }: { x: number; y: number; w: number; h: number; o?: number; rot?: number }) {
275
+ return (
276
+ <Img src={asset("assets/paper/smudge.png")} style={{
277
+ position: "absolute", left: x - w / 2, top: y - h / 2, width: w, height: h, opacity: o, transform: `rotate(${rot}deg)`,
278
+ }} />
279
+ );
280
+ }
281
+
282
+ /** fade + slight blur out at the end of a clip (eraser-ish exit). */
283
+ export function useExit(duration: number, frames = 8) {
284
+ const f = useCurrentFrame();
285
+ const out = ease(f, duration - frames, duration);
286
+ return { opacity: 1 - out, filter: out > 0 ? `blur(${out * 6}px)` : undefined } as React.CSSProperties;
287
+ }
288
+
289
+ export function Layer({ children, style }: { children: React.ReactNode; style?: React.CSSProperties }) {
290
+ return <AbsoluteFill style={style}>{children}</AbsoluteFill>;
291
+ }