@auscera/cleoedits 0.0.0-stage → 0.1.0

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 (230) hide show
  1. package/README.md +62 -2
  2. package/cli.mjs +149 -0
  3. package/lib/dependencies.mjs +384 -0
  4. package/lib/run.mjs +114 -0
  5. package/lib/workspace.mjs +167 -0
  6. package/package.json +240 -3
  7. package/workspace/.agents/skills/cleoedits/SKILL.md +29 -0
  8. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/audiogram.json +41 -0
  9. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/facebook.json +48 -0
  10. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/linkedin.json +48 -0
  11. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/podcast.json +23 -0
  12. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/reels.json +48 -0
  13. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/shorts.json +48 -0
  14. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/tiktok.json +48 -0
  15. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/x.json +48 -0
  16. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/youtube-shorts.json +48 -0
  17. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/youtube.json +48 -0
  18. package/workspace/.agents/skills/cleoedits/assets/reel_effects/assets/LICENSE-SimpleIcons +30 -0
  19. package/workspace/.agents/skills/cleoedits/assets/reel_effects/assets/logos.json +1 -0
  20. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Anton-Regular.ttf +0 -0
  21. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/ArchivoBlack-Regular.ttf +0 -0
  22. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/InstrumentSerif-Italic.ttf +0 -0
  23. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Inter.ttf +0 -0
  24. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/LICENSE-PermanentMarker.txt +202 -0
  25. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Montserrat.ttf +0 -0
  26. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Anton.txt +93 -0
  27. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-ArchivoBlack.txt +93 -0
  28. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-InstrumentSerif.txt +93 -0
  29. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Inter.txt +93 -0
  30. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Montserrat.txt +93 -0
  31. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-PlayfairDisplay.txt +93 -0
  32. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Poppins.txt +93 -0
  33. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-SpaceMono.txt +93 -0
  34. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PermanentMarker-Regular.ttf +0 -0
  35. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PlayfairDisplay-Italic.ttf +0 -0
  36. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PlayfairDisplay.ttf +0 -0
  37. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-Black.ttf +0 -0
  38. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-Bold.ttf +0 -0
  39. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-ExtraBold.ttf +0 -0
  40. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/SpaceMono-Bold.ttf +0 -0
  41. package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/LICENSE-MediaPipe +218 -0
  42. package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/LICENSE-YuNet +21 -0
  43. package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/NOTICE.md +4 -0
  44. package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/selfie_segmenter.tflite +0 -0
  45. package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/yunet.onnx +0 -0
  46. package/workspace/.agents/skills/cleoedits/assets/video_styles/LICENSE +21 -0
  47. package/workspace/.agents/skills/cleoedits/assets/video_styles/audio-app-ui/STYLE.md +65 -0
  48. package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/STYLE.md +53 -0
  49. package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/index.html +328 -0
  50. package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/studio.js +57 -0
  51. package/workspace/.agents/skills/cleoedits/assets/video_styles/data-story/STYLE.md +65 -0
  52. package/workspace/.agents/skills/cleoedits/assets/video_styles/data-story/index.html +575 -0
  53. package/workspace/.agents/skills/cleoedits/assets/video_styles/design-app-ui/STYLE.md +68 -0
  54. package/workspace/.agents/skills/cleoedits/assets/video_styles/editor-ui/STYLE.md +73 -0
  55. package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/STYLE.md +54 -0
  56. package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/index.html +189 -0
  57. package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/studio.js +57 -0
  58. package/workspace/.agents/skills/cleoedits/assets/video_styles/explainer-diagram/STYLE.md +64 -0
  59. package/workspace/.agents/skills/cleoedits/assets/video_styles/explainer-diagram/index.html +620 -0
  60. package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/STYLE.md +55 -0
  61. package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/index.html +238 -0
  62. package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/studio.js +57 -0
  63. package/workspace/.agents/skills/cleoedits/assets/video_styles/growing-city/STYLE.md +66 -0
  64. package/workspace/.agents/skills/cleoedits/assets/video_styles/growing-city/index.html +602 -0
  65. package/workspace/.agents/skills/cleoedits/assets/video_styles/ink-line/STYLE.md +66 -0
  66. package/workspace/.agents/skills/cleoedits/assets/video_styles/ink-line/index.html +777 -0
  67. package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/STYLE.md +56 -0
  68. package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/index.html +186 -0
  69. package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/studio.js +57 -0
  70. package/workspace/.agents/skills/cleoedits/assets/video_styles/motion-app-ui/STYLE.md +68 -0
  71. package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/STYLE.md +56 -0
  72. package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/index.html +244 -0
  73. package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/studio.js +57 -0
  74. package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-world/STYLE.md +67 -0
  75. package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-world/index.html +663 -0
  76. package/workspace/.agents/skills/cleoedits/assets/video_styles/particle-field/STYLE.md +59 -0
  77. package/workspace/.agents/skills/cleoedits/assets/video_styles/particle-field/index.html +395 -0
  78. package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/STYLE.md +52 -0
  79. package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/index.html +194 -0
  80. package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/studio.js +57 -0
  81. package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/STYLE.md +58 -0
  82. package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/index.html +242 -0
  83. package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/studio.js +57 -0
  84. package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/STYLE.md +53 -0
  85. package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/index.html +138 -0
  86. package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/studio.js +57 -0
  87. package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-kinetic/STYLE.md +63 -0
  88. package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-kinetic/index.html +599 -0
  89. package/workspace/.agents/skills/cleoedits/assets/video_styles/time-travel/STYLE.md +65 -0
  90. package/workspace/.agents/skills/cleoedits/assets/video_styles/time-travel/index.html +1297 -0
  91. package/workspace/.agents/skills/cleoedits/assets/video_styles/weather-widget/STYLE.md +69 -0
  92. package/workspace/.agents/skills/cleoedits/assets/video_styles/weather-widget/index.html +674 -0
  93. package/workspace/.agents/skills/cleoedits/references/audio-clearervoice-elevenlabs.md +11 -0
  94. package/workspace/.agents/skills/cleoedits/references/ffmpeg-and-reels.md +15 -0
  95. package/workspace/.agents/skills/cleoedits/references/hyperframes-workflows.md +13 -0
  96. package/workspace/.agents/skills/cleoedits/references/kdenlive-cli-and-mcp.md +12 -0
  97. package/workspace/.agents/skills/cleoedits/references/motion-design-pipeline.md +7 -0
  98. package/workspace/.agents/skills/cleoedits/references/motion-taste-emil.md +5 -0
  99. package/workspace/.agents/skills/cleoedits/references/playwright-demo-capture.md +9 -0
  100. package/workspace/.agents/skills/cleoedits/references/remotion-workflows.md +13 -0
  101. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/LICENSE +21 -0
  102. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_ass_overlay.py +399 -0
  103. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/__init__.py +235 -0
  104. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/alpha.py +560 -0
  105. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/asr.py +1237 -0
  106. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/color.py +540 -0
  107. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/decision.py +2452 -0
  108. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/drawtext.py +290 -0
  109. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/emit.py +1309 -0
  110. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/emoji.py +518 -0
  111. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/fonts.py +875 -0
  112. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/pacing.py +263 -0
  113. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/pacing_edit.py +432 -0
  114. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/probe.py +1613 -0
  115. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/runner.py +3994 -0
  116. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/text.py +73 -0
  117. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/timeline.py +721 -0
  118. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/wrap.py +981 -0
  119. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_contract.py +2454 -0
  120. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_platforms.py +258 -0
  121. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_review.html +754 -0
  122. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_review.py +258 -0
  123. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_smartcut.py +450 -0
  124. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/audio.py +867 -0
  125. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/background.py +136 -0
  126. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/batch.py +1409 -0
  127. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/broll.py +282 -0
  128. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/caption.py +2207 -0
  129. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/check.py +815 -0
  130. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/color.py +695 -0
  131. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/crop.py +91 -0
  132. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/cropdetect.py +214 -0
  133. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/cut.py +2076 -0
  134. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/deinterlace.py +90 -0
  135. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/denoise.py +94 -0
  136. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/export.py +1033 -0
  137. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/fit.py +729 -0
  138. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/freeze.py +197 -0
  139. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/graphics.py +920 -0
  140. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/grid.py +235 -0
  141. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/insert.py +142 -0
  142. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/join.py +1083 -0
  143. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/look.py +475 -0
  144. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/loop.py +395 -0
  145. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/loudness.py +397 -0
  146. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/metadata.py +416 -0
  147. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/multicam.py +414 -0
  148. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/overlay.py +766 -0
  149. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/pad.py +121 -0
  150. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/probe.py +145 -0
  151. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/proxy.py +93 -0
  152. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/redact.py +162 -0
  153. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/render.py +2424 -0
  154. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/report.py +354 -0
  155. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/reverse.py +114 -0
  156. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/scenes.py +439 -0
  157. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sequence.py +285 -0
  158. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/silence.py +945 -0
  159. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/speedramp.py +193 -0
  160. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sphere.py +137 -0
  161. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/stabilize.py +141 -0
  162. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/straighten.py +120 -0
  163. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sync.py +500 -0
  164. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/verify.py +411 -0
  165. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/waveform.py +502 -0
  166. package/workspace/.agents/skills/cleoedits/scripts/kdenlive_builder.py +284 -0
  167. package/workspace/.agents/skills/cleoedits/scripts/motion/LICENSE-claude-motion +21 -0
  168. package/workspace/.agents/skills/cleoedits/scripts/motion/LICENSE-motion-design +21 -0
  169. package/workspace/.agents/skills/cleoedits/scripts/motion/_media.py +43 -0
  170. package/workspace/.agents/skills/cleoedits/scripts/motion/pacing_check.py +90 -0
  171. package/workspace/.agents/skills/cleoedits/scripts/motion/storyboard.py +77 -0
  172. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/LICENSE +26 -0
  173. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/fx.py +2717 -0
  174. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/logos.py +194 -0
  175. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/sfx.py +105 -0
  176. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/trim.py +99 -0
  177. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/words.py +60 -0
  178. package/workspace/.claude/commands/blender-3d.md +12 -0
  179. package/workspace/.claude/commands/business-short-form-reels.md +12 -0
  180. package/workspace/.claude/commands/color-grade.md +12 -0
  181. package/workspace/.claude/commands/cutout-grid-reel.md +12 -0
  182. package/workspace/.claude/commands/depth-ui-reel.md +12 -0
  183. package/workspace/.claude/commands/explainer-panel-reel.md +12 -0
  184. package/workspace/.claude/commands/freeze-frame.md +12 -0
  185. package/workspace/.claude/commands/glass-graph.md +12 -0
  186. package/workspace/.claude/commands/over-the-shoulder.md +12 -0
  187. package/workspace/.claude/commands/personal-short-form-reels.md +12 -0
  188. package/workspace/.claude/commands/ranking-format.md +12 -0
  189. package/workspace/.claude/commands/relight.md +12 -0
  190. package/workspace/.claude/commands/reverse-engineer.md +12 -0
  191. package/workspace/.claude/commands/text-behind.md +12 -0
  192. package/workspace/.claude/commands/tier-list.md +12 -0
  193. package/workspace/.claude-plugin/plugin.json +8 -0
  194. package/workspace/.npmignore +15 -0
  195. package/workspace/AGENTS.md +30 -0
  196. package/workspace/README.md +63 -0
  197. package/workspace/assets/fonts/TikTokSans-OFL.txt +93 -0
  198. package/workspace/assets/fonts/TikTokSans-Variable.ttf +0 -0
  199. package/workspace/assets/luts/clean_warm.cube +4917 -0
  200. package/workspace/assets/luts/golden_hour.cube +4917 -0
  201. package/workspace/assets/luts/moody_dark.cube +4917 -0
  202. package/workspace/assets/luts/teal_orange.cube +4917 -0
  203. package/workspace/assets/sfx/NOTICE.txt +1 -0
  204. package/workspace/assets/sfx/click.wav +0 -0
  205. package/workspace/assets/sfx/pop.wav +0 -0
  206. package/workspace/assets/sfx/riser.wav +0 -0
  207. package/workspace/assets/sfx/whoosh.wav +0 -0
  208. package/workspace/generators/hyperframes/index.html +39 -0
  209. package/workspace/generators/hyperframes/package.json +15 -0
  210. package/workspace/generators/hyperframes/pnpm-lock.yaml +1181 -0
  211. package/workspace/generators/hyperframes/pnpm-workspace.yaml +10 -0
  212. package/workspace/generators/remotion/eslint.config.mjs +3 -0
  213. package/workspace/generators/remotion/package.json +36 -0
  214. package/workspace/generators/remotion/pnpm-lock.yaml +4179 -0
  215. package/workspace/generators/remotion/pnpm-workspace.yaml +10 -0
  216. package/workspace/generators/remotion/remotion.config.ts +13 -0
  217. package/workspace/generators/remotion/src/Root.tsx +52 -0
  218. package/workspace/generators/remotion/src/index.css +1 -0
  219. package/workspace/generators/remotion/src/index.ts +4 -0
  220. package/workspace/generators/remotion/tsconfig.json +15 -0
  221. package/workspace/pipeline/scripts/_codec.py +28 -0
  222. package/workspace/pipeline/scripts/ai_media_api.py +109 -0
  223. package/workspace/pipeline/scripts/blender_render.py +166 -0
  224. package/workspace/pipeline/scripts/composite.py +49 -0
  225. package/workspace/pipeline/scripts/melt.sh +68 -0
  226. package/workspace/pipeline/scripts/normalize_audio.py +39 -0
  227. package/workspace/pipeline/scripts/person_matte.py +216 -0
  228. package/workspace/pipeline/scripts/record_demo.py +69 -0
  229. package/workspace/pipeline/scripts/whisper_cut.py +98 -0
  230. package/workspace-manifest.json +908 -0
@@ -0,0 +1,194 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=1920, height=1080" />
6
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=League+Gothic&family=Archivo+Black&display=swap" />
7
+ <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
8
+ <script src="studio.js"></script>
9
+ <style>
10
+ /* style: poster-pop. Every colour comes from these tokens. */
11
+ :root { --ground: #FFD400; --ink: #111111; --paper: #FFFFFF; }
12
+ * { margin: 0; padding: 0; box-sizing: border-box; }
13
+ html, body { width: 1920px; height: 1080px; overflow: hidden; background: var(--ground); }
14
+ #root { position: relative; width: 1920px; height: 1080px; overflow: hidden; background: var(--ground); }
15
+ #cv { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
16
+ /* these make the browser fetch both fonts before the canvas draws with them */
17
+ .load { position: absolute; left: -9999px; top: 0; font-size: 40px; }
18
+ </style>
19
+ </head>
20
+ <body>
21
+ <div id="root" data-composition-id="main" data-start="0" data-duration="12" data-width="1920" data-height="1080">
22
+ <canvas id="cv" width="1920" height="1080"></canvas>
23
+ <span class="load" style="font-family:'League Gothic'">THREE 123</span>
24
+ <span class="load" style="font-family:'Archivo Black'">BOLD FAST LOUD</span>
25
+ </div>
26
+ <script>
27
+ const S = STUDIO, W = 1920, H = 1080, D = 12;
28
+ const css = getComputedStyle(document.documentElement);
29
+ const C = { y: css.getPropertyValue('--ground').trim(), k: css.getPropertyValue('--ink').trim(),
30
+ w: css.getPropertyValue('--paper').trim() };
31
+ const cv = document.getElementById('cv'), ctx = cv.getContext('2d');
32
+ const LG = 'League Gothic', AB = 'Archivo Black';
33
+ const OFF = 0.5; // video time t = story time u - OFF, so the seam sits inside shot 1
34
+
35
+ // ---- type helpers: everything is placed by cap height and baseline, measured from the real font
36
+ const capCache = {};
37
+ function capRatio(fam) {
38
+ if (capCache[fam]) return capCache[fam];
39
+ ctx.font = `1000px "${fam}"`;
40
+ const r = ctx.measureText('H').actualBoundingBoxAscent / 1000;
41
+ if (document.fonts && document.fonts.check(`100px "${fam}"`)) capCache[fam] = r;
42
+ return r;
43
+ }
44
+ const TRACK = 0.01; // tracking in em
45
+ function layout(text, fam, cap, maxW) {
46
+ let fs = cap / capRatio(fam);
47
+ ctx.font = `${fs}px "${fam}"`;
48
+ let ws = [...text].map(ch => ctx.measureText(ch).width);
49
+ let tw = ws.reduce((a, b) => a + b, 0) + TRACK * fs * (ws.length - 1);
50
+ if (maxW && tw > maxW) { const k = maxW / tw; fs *= k; ws = ws.map(w => w * k); tw = maxW; }
51
+ return { fs, ws, tw, cap: fs * capRatio(fam) };
52
+ }
53
+ // draw a word whose letters slam in one by one from `from` (px offset), stopping dead
54
+ function word(lt, o) {
55
+ const L = layout(o.text, o.fam || LG, o.cap, o.maxW);
56
+ let x = o.x;
57
+ if (o.align === 'center') x -= L.tw / 2; else if (o.align === 'right') x -= L.tw;
58
+ ctx.font = `${L.fs}px "${o.fam || LG}"`;
59
+ ctx.fillStyle = o.color; ctx.textBaseline = 'alphabetic';
60
+ const n = L.ws.length, stg = o.stg == null ? 0.033 : o.stg, st = o.start || 0;
61
+ const from = o.from || [0, 0];
62
+ const rev = from[0] < 0; // coming from the left: the right-hand letter leads
63
+ let cx = x;
64
+ for (let i = 0; i < n; i++) {
65
+ const order = rev ? n - 1 - i : i;
66
+ const s0 = st + order * stg;
67
+ if (lt >= s0) {
68
+ const p = S.seg(lt, s0, 0.2, 'power4.out');
69
+ const zs = o.zip && i % 2 ? -1 : 1; // zip: odd letters come from the other side
70
+ ctx.fillText(o.text[i], cx + (1 - p) * from[0], o.base + (1 - p) * from[1] * zs);
71
+ }
72
+ cx += L.ws[i] + TRACK * L.fs;
73
+ }
74
+ return L;
75
+ }
76
+ // a paper card that slams in, with its word rising up inside the card's edge a beat later
77
+ function card(lt, o) {
78
+ const p = S.seg(lt, o.start, 0.2, 'power4.out');
79
+ if (lt < o.start) return;
80
+ const dx = (1 - p) * o.from[0], dy = (1 - p) * o.from[1];
81
+ const x = o.x + dx, y = o.y + dy;
82
+ ctx.fillStyle = C.w; ctx.fillRect(x, y, o.w, o.h);
83
+ ctx.save(); ctx.beginPath(); ctx.rect(x, y, o.w, o.h); ctx.clip();
84
+ const q = S.seg(lt, o.start + 0.067, 0.24, 'power4.out');
85
+ const L = layout(o.text, AB, o.cap, o.maxW);
86
+ const base = y + o.h / 2 + L.cap / 2 + (1 - q) * o.h;
87
+ word(99, { text: o.text, fam: AB, cap: o.cap, maxW: o.maxW, x: x + o.tx, base, color: C.k, stg: 0 });
88
+ ctx.restore();
89
+ }
90
+ // the punch: 1.0 to 1.06 fast, then back over 0.4 s
91
+ function punch(lt, beats) {
92
+ let s = 0;
93
+ for (const b of beats) {
94
+ const d = lt - b; if (d < 0) continue;
95
+ const e = d < 0.05 ? S.seg(d, 0, 0.05, 'power2.out') : 1 - S.seg(d, 0.05, 0.4, 'sine.inOut');
96
+ s = Math.max(s, e);
97
+ }
98
+ return 1 + 0.06 * s;
99
+ }
100
+ // the land jolt: the poster drops a few px when something hits, then settles
101
+ function jolt(lt, hits) {
102
+ let y = 0;
103
+ for (const h of hits) if (lt >= h) y = 18 * (1 - S.seg(lt, h, 0.15, 'power2.out'));
104
+ return y;
105
+ }
106
+ function frame(bg, sc, jy, ax, ay, draw) {
107
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
108
+ ctx.fillStyle = bg; ctx.fillRect(0, 0, W, H);
109
+ ctx.translate(ax, ay + jy); ctx.scale(sc, sc); ctx.translate(-ax, -ay);
110
+ draw();
111
+ }
112
+ const mid = (cap) => H / 2 + cap / 2; // baseline that centres a cap height
113
+
114
+ // ---- the shots, in story time u
115
+ const SHOTS = [
116
+ { u: 0, d: 1, f(lt) { // THREE
117
+ frame(C.y, punch(lt, [0.5]), jolt(lt, [0.27]), W / 2, H / 2, () =>
118
+ word(lt, { text: 'THREE', cap: 0.86 * H, x: W / 2, align: 'center', base: mid(0.86 * H), color: C.k, from: [0, H * 1.1] }));
119
+ } },
120
+ { u: 1, d: 1, f(lt) { // THINGS
121
+ frame(C.k, punch(lt, [0.5]), jolt(lt, [0.3]), W / 2, H / 2, () =>
122
+ word(lt, { text: 'THINGS', cap: 0.8 * H, x: W / 2, align: 'center', base: mid(0.8 * H), color: C.y, from: [0, H * 1.2], zip: true }));
123
+ } },
124
+ { u: 2, d: 0.5, f(lt) { // YOU
125
+ frame(C.y, 1, jolt(lt, [0.12]), W / 2, H / 2, () =>
126
+ word(lt, { text: 'YOU', cap: 1.04 * H, x: W / 2, align: 'center', base: mid(1.04 * H), color: C.k, from: [0, -H * 1.3] }));
127
+ } },
128
+ { u: 2.5, d: 0.5, f(lt) { // NEED
129
+ frame(C.k, 1, jolt(lt, [0.15]), W / 2, H / 2, () =>
130
+ word(lt, { text: 'NEED', cap: 1.0 * H, x: W / 2, align: 'center', base: mid(1.0 * H), color: C.y, from: [0, H * 1.2] }));
131
+ } },
132
+ { u: 3, d: 1.5, f(lt) { // 3 + BOLD
133
+ frame(C.y, punch(lt, [1.0]), jolt(lt, [0.1, 0.6]), W / 2, H / 2, () => {
134
+ word(lt, { text: '3', cap: 1.45 * H, x: -80, base: mid(1.45 * H), color: C.k, from: [0, H * 1.6] });
135
+ card(lt, { start: 0.5, x: 560, y: H / 2 - 260, w: W - 520, h: 520, from: [1400, 0], text: 'BOLD', cap: 340, maxW: 1200, tx: 120 });
136
+ });
137
+ } },
138
+ { u: 4.5, d: 1.5, f(lt) { // 2 + FAST
139
+ frame(C.k, punch(lt, [1.0]), jolt(lt, [0.1, 0.6]), W / 2, H / 2, () => {
140
+ word(lt, { text: '2', cap: 1.45 * H, x: W + 80, align: 'right', base: mid(1.45 * H), color: C.y, from: [0, -H * 1.6] });
141
+ card(lt, { start: 0.5, x: -40, y: H / 2 - 260, w: 1400, h: 520, from: [-1500, 0], text: 'FAST', cap: 340, maxW: 1200, tx: 144 });
142
+ });
143
+ } },
144
+ { u: 6, d: 1.5, f(lt) { // 1 + LOUD
145
+ frame(C.y, punch(lt, [1.0]), jolt(lt, [0.1, 0.6]), W / 2, H / 2, () => {
146
+ word(lt, { text: '1', cap: 1.45 * H, x: 40, base: mid(1.45 * H), color: C.k, from: [-1200, 0] });
147
+ card(lt, { start: 0.5, x: 400, y: H / 2 - 260, w: W - 360, h: 520, from: [0, 1000], text: 'LOUD', cap: 340, maxW: 1300, tx: 160 });
148
+ });
149
+ } },
150
+ { u: 7.5, d: 1.5, f(lt) { // 3 2 1, one per half beat, each too big for the poster
151
+ const i = Math.min(2, Math.floor(lt / 0.5)), l = lt - i * 0.5;
152
+ const bg = i === 1 ? C.y : C.k, fg = i === 1 ? C.k : C.y;
153
+ const P = [ { x: W * 0.3, align: 'center', from: [0, H * 1.6], cap: 1.3 * H },
154
+ { x: W / 2, align: 'center', from: [0, -H * 1.6], cap: 1.3 * H },
155
+ { x: W * 0.7, align: 'center', from: [W, 0], cap: 1.5 * H } ][i];
156
+ frame(bg, 1, jolt(l, [0.1]), W / 2, H / 2, () =>
157
+ word(l, { text: '321'[i], cap: P.cap, x: P.x, align: P.align, base: mid(P.cap), color: fg, from: P.from }));
158
+ } },
159
+ { u: 9, d: 1.5, f(lt) { // GO
160
+ const inv = lt >= 1.0, bg = inv ? C.k : C.y, fg = inv ? C.y : C.k;
161
+ const crash = 1.4 - 0.4 * S.seg(lt, 0, 0.2, 'power4.out');
162
+ frame(bg, crash * punch(lt, [0.5, 1.0]), jolt(lt, [0.12]), W / 2, H / 2, () =>
163
+ word(lt, { text: 'GO', cap: 1.2 * H, x: W / 2, align: 'center', base: mid(1.2 * H), color: fg, stg: 0 }));
164
+ } },
165
+ { u: 10.5, d: 1.5, f(lt) { // MAKE IT / COUNT
166
+ frame(C.y, punch(lt, [1.0]), jolt(lt, [0.1, 0.6]), W / 2, H / 2, () => {
167
+ // paper strip with the support line, then the giant word under it
168
+ const p = S.seg(lt, 0, 0.2, 'power4.out'), sy = -(1 - p) * 320;
169
+ ctx.fillStyle = C.w; ctx.fillRect(-40, sy - 40, W + 80, 320);
170
+ ctx.save(); ctx.beginPath(); ctx.rect(-40, sy - 40, W + 80, 320); ctx.clip();
171
+ const q = S.seg(lt, 0.067, 0.24, 'power4.out');
172
+ word(99, { text: 'MAKE IT', fam: AB, cap: 170, x: 64, base: sy + 140 + 85 + (1 - q) * 300, color: C.k, stg: 0 });
173
+ // an ink arrow at the right end of the strip, pointing down at the word
174
+ const ax = W - 64 - 100, ay = sy + 30 + (1 - q) * 300;
175
+ ctx.fillStyle = C.k; ctx.beginPath();
176
+ ctx.moveTo(ax - 36, ay); ctx.lineTo(ax + 36, ay); ctx.lineTo(ax + 36, ay + 110);
177
+ ctx.lineTo(ax + 100, ay + 110); ctx.lineTo(ax, ay + 220); ctx.lineTo(ax - 100, ay + 110);
178
+ ctx.lineTo(ax - 36, ay + 110); ctx.closePath(); ctx.fill();
179
+ ctx.restore();
180
+ word(lt, { text: 'COUNT', cap: 760, x: W / 2, align: 'center', base: 1080 - 10, color: C.k, from: [0, 1000], start: 0.5, maxW: W + 120 });
181
+ });
182
+ } },
183
+ ];
184
+
185
+ window.__timelines["main"] = S.play(function render(t) {
186
+ const u = (t + OFF) % D;
187
+ let sh = SHOTS[0];
188
+ for (const s of SHOTS) if (u >= s.u) sh = s;
189
+ sh.f(u - sh.u);
190
+ }, { loop: true });
191
+ if (document.fonts) ['League Gothic', 'Archivo Black'].forEach(f => document.fonts.load(`100px "${f}"`));
192
+ </script>
193
+ </body>
194
+ </html>
@@ -0,0 +1,57 @@
1
+ // studio.js: one clock for the whole piece (hack 4).
2
+ // Load it after GSAP and before your scene script.
3
+ // Your scene calls STUDIO.play(render). render(t) must draw the WHOLE frame from t alone.
4
+ // Same t in, same picture out. That makes renders exact, seekable, and loopable.
5
+ (function () {
6
+ // works from <head> or <body>: the root is looked up the first time it is needed
7
+ const R = () => document.querySelector('[data-composition-id]');
8
+ const num = (k) => +R().dataset[k];
9
+ const cache = {};
10
+ const S = {
11
+ get root() { return R(); },
12
+ get D() { return num('duration'); },
13
+ get W() { return num('width'); },
14
+ get H() { return num('height'); },
15
+ get V() { return S.H > S.W; }, // true for 9:16
16
+ get u() { return Math.min(S.W, S.H) / 1080; }, // 1 unit = 1 px at a 1080 short side
17
+ ease(name) { return cache[name] || (cache[name] = name === 'none' ? (p) => p : gsap.parseEase(name)); },
18
+ // eased 0..1 progress of a move that starts at `start` and lasts `dur`
19
+ seg(t, start, dur, ease) {
20
+ const p = Math.min(1, Math.max(0, (t - start) / dur));
21
+ return S.ease(ease || 'power3.out')(p);
22
+ },
23
+ mix(a, b, p) { return a + (b - a) * p; },
24
+ // a wave that always loops: use whole-number cycles
25
+ wave(t, cycles, offset) { return Math.sin(2 * Math.PI * ((cycles || 1) * t / S.D + (offset || 0))); },
26
+ // seeded random numbers (never use Math.random in a render)
27
+ rng(seed) {
28
+ let a = seed >>> 0;
29
+ return function () {
30
+ a = (a + 0x6d2b79f5) | 0;
31
+ let t = Math.imul(a ^ (a >>> 15), 1 | a);
32
+ t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
33
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
34
+ };
35
+ },
36
+ // one clock drives everything; loop:true wraps t so t = D draws the same frame as t = 0
37
+ play(render, opts) {
38
+ const loop = !opts || opts.loop !== false;
39
+ const D = S.D, root = S.root;
40
+ const clock = { t: 0 };
41
+ const tl = gsap.timeline({ paused: true });
42
+ // loop_check.py sets STUDIO_NO_WRAP so it can prove render(end) really equals render(0)
43
+ const wrap = loop && !window.STUDIO_NO_WRAP;
44
+ const draw = () => render(wrap ? clock.t % D : clock.t);
45
+ tl.to(clock, { t: D, duration: D, ease: 'none', onUpdate: draw }, 0);
46
+ draw();
47
+ // fonts can arrive after the first draw; draw again so text measured from them is right,
48
+ // even on frame 0 (seeking to the time you are already at does not redraw)
49
+ if (document.fonts && document.fonts.ready) document.fonts.ready.then(draw);
50
+ window.addEventListener('load', draw);
51
+ window.__timelines = window.__timelines || {};
52
+ window.__timelines[root.dataset.compositionId] = tl;
53
+ return tl;
54
+ },
55
+ };
56
+ window.STUDIO = S;
57
+ })();
@@ -0,0 +1,58 @@
1
+ # Risograph
2
+
3
+ id: risograph
4
+ Best for: playful promos, events, music, culture, bold announcements.
5
+ Mood: two-ink print. Grainy, a little off-register, full of energy.
6
+ Reference piece: styles/risograph/index.html (12 s, loops)
7
+ Gallery video: gallery/videos/risograph.mp4
8
+
9
+ ## Palette (hex)
10
+ - paper: #F5F0E6
11
+ - ink one: #FF48B0 (fluorescent pink, the main ink)
12
+ - ink two: #0078BF (blue, used where the two inks overprint)
13
+ - overprint: multiply blend, so pink over blue makes a dark purple by itself
14
+ - knockout: #FFFFFF inside an ink layer (white multiplies to nothing, so the paper shows)
15
+
16
+ ## Type
17
+ - Display: Archivo Black, tracking -0.02em, all caps
18
+ - Small text: Space Mono 700, 24 to 28 px
19
+ - Font links (paste into <head>; all fonts are free):
20
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Mono:wght@700&display=swap">
21
+
22
+ ## Easing (numbers)
23
+ - stamp: power4.out, 0.25 s (hard landing, no fade)
24
+ - slide: expo.out, 0.5 s
25
+ - jitter: 1 to 2 px register shift on beats only
26
+
27
+ ## Motion rules
28
+ - Shapes stamp in hard, like a print pass. No opacity fades.
29
+ - The blue layer sits 3 to 6 px off the pink layer (misregistration).
30
+ - Grain is a fixed seeded texture, so every frame is the same paper.
31
+ - Cut on the beat (every 0.5 s at 120 BPM).
32
+ - Build each ink as its own full frame layer with mix-blend-mode multiply. Move the blue layer, never the paper.
33
+ - Repeating patterns (stripes, rings) step by 1.5 periods, not whole ones, so the step reads as a move.
34
+
35
+ ## Signature moves
36
+ - The stamp: scale 1.12 to 1 with a 1 to 2 degree rotate settle, and the blue plate thumps 4 to 7 px off and settles.
37
+ - The second plate: a halftone copy of the word lands far off register, then snaps to 18 px off.
38
+ - The roller wipe: blue bars plus one pink bar sweep across and clip the old sheet away under them.
39
+ - Halftone dots that grow toward the bottom of a shape, and swell a step on each beat.
40
+
41
+ ## Grid
42
+ Big shapes, 80 px margins, chunky blocks. Overlap on purpose.
43
+
44
+ ## Composition
45
+ - One poster per 4 s: a giant word, one big shape, one band of stripes or dots, one small label.
46
+ - Words hang off the left margin. Shapes bleed off the edge.
47
+ - Put the overlap where it matters: the purple belongs on the hero word or the hero shape.
48
+
49
+ ## With media
50
+ - Turn photos into one ink: grayscale, high contrast, then a halftone or a flat fill in pink or blue.
51
+ - Put the photo in an ink layer so it multiplies with the other ink. Keep the paper grain on top.
52
+ - Crop photos into circles or hard rectangles. No soft edges.
53
+
54
+ ## Ban list
55
+ - clean digital gradients
56
+ - more than two inks
57
+ - drop shadows
58
+ - thin hairline type
@@ -0,0 +1,242 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=1920, height=1080" />
6
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Mono:wght@700&display=swap" />
7
+ <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
8
+ <script src="studio.js"></script>
9
+ <style>
10
+ /* style: risograph. Every colour comes from these tokens. White inside an ink layer = knockout. */
11
+ :root { --paper: #F5F0E6; --pink: #FF48B0; --blue: #0078BF; --knock: #FFFFFF; }
12
+ * { margin: 0; padding: 0; box-sizing: border-box; }
13
+ html, body { width: 1920px; height: 1080px; overflow: hidden; background: var(--paper); }
14
+ #root { position: relative; width: 1920px; height: 1080px; overflow: hidden; background: var(--paper);
15
+ isolation: isolate; font-family: 'Archivo Black', sans-serif; }
16
+ .abs { position: absolute; left: 0; top: 0; }
17
+ .ink { position: absolute; inset: 0; mix-blend-mode: multiply; filter: url(#rough); }
18
+ .dots { color: transparent; background: radial-gradient(circle, var(--blue) 0 40%, transparent 43%) 0 0 / 19px 19px;
19
+ -webkit-background-clip: text; background-clip: text; }
20
+ .scene { position: absolute; inset: 0; }
21
+ .word { position: absolute; left: 0; top: 0; white-space: nowrap; line-height: 1; letter-spacing: -0.02em;
22
+ text-transform: uppercase; transform-origin: 50% 62%; }
23
+ .pink { color: var(--pink); } .blue { color: var(--blue); }
24
+ .lab { position: absolute; font-family: 'Space Mono', monospace; font-weight: 700; font-size: 28px;
25
+ letter-spacing: 0.08em; line-height: 40px; height: 40px; overflow: hidden; white-space: nowrap; }
26
+ .lab span { position: absolute; left: 0; top: 0; }
27
+ .lab.r span { left: auto; right: 0; }
28
+ .bar { position: absolute; }
29
+ canvas { position: absolute; left: 0; top: 0; }
30
+ </style>
31
+ </head>
32
+ <body>
33
+ <svg width="0" height="0" style="position:absolute"><filter id="rough" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="2" seed="4" result="n"/><feDisplacementMap in="SourceGraphic" in2="n" scale="2.6" xChannelSelector="R" yChannelSelector="G"/></filter></svg>
34
+ <div id="root" data-composition-id="main" data-start="0" data-duration="12" data-width="1920" data-height="1080">
35
+ <div id="blue" class="ink"></div>
36
+ <div id="pink" class="ink"></div>
37
+ </div>
38
+ <script>
39
+ const S = STUDIO, root = S.root, W = 1920, H = 1080, M = 80;
40
+ const OFFSET = 1.5; // t = 0 lands just as the halftone disc starts its slide
41
+ const BLUE = getComputedStyle(document.documentElement).getPropertyValue('--blue').trim();
42
+ const PINK = getComputedStyle(document.documentElement).getPropertyValue('--pink').trim();
43
+ const PAPER = getComputedStyle(document.documentElement).getPropertyValue('--paper').trim();
44
+ const LB = document.getElementById('blue'), LP = document.getElementById('pink');
45
+ const el = (parent, tag, cls, css, html) => { const d = document.createElement(tag); if (cls) d.className = cls;
46
+ Object.assign(d.style, css || {}); if (html != null) d.innerHTML = html; parent.appendChild(d); return d; };
47
+ const hex = (h) => [1, 3, 5].map(i => parseInt(h.slice(i, i + 2), 16));
48
+
49
+ // ---------- scenes: one container per ink per scene, so the roller wipe can clip a whole sheet
50
+ const SC = ['A', 'B', 'C'].map(() => ({ b: el(LB, 'div', 'scene'), p: el(LP, 'div', 'scene') }));
51
+ const word = (parent, cls, text, fs) => el(parent, 'div', 'word ' + cls, { fontSize: fs + 'px' }, text);
52
+
53
+ // ---------- halftone: dots on a rotated grid, clipped to a circle
54
+ function halftone(ctx, cx, cy, R, cell, ang, size, color) {
55
+ ctx.save(); ctx.beginPath(); ctx.arc(cx, cy, R, 0, Math.PI * 2); ctx.clip();
56
+ ctx.fillStyle = color; const c = Math.cos(ang), s = Math.sin(ang), n = Math.ceil(R / cell) + 2;
57
+ ctx.beginPath();
58
+ for (let i = -n; i <= n; i++) for (let j = -n; j <= n; j++) {
59
+ const x = cx + (i * c - j * s) * cell, y = cy + (i * s + j * c) * cell;
60
+ const dx = x - cx, dy = y - cy; if (dx * dx + dy * dy > (R + cell) * (R + cell)) continue;
61
+ const r = size((x - cx) / R, (y - cy) / R) * cell; if (r < 0.6) continue;
62
+ ctx.moveTo(x + r, y); ctx.arc(x, y, r, 0, Math.PI * 2);
63
+ }
64
+ ctx.fill(); ctx.restore();
65
+ }
66
+
67
+ // ---------- scene A: SAT 9PM
68
+ const A = SC[0];
69
+ const discA = el(A.p, 'div', 'abs', { width: '820px', height: '820px', borderRadius: '50%', background: 'var(--pink)' });
70
+ const htA = el(A.b, 'canvas', '', {}); htA.width = htA.height = 700;
71
+ halftone(htA.getContext('2d'), 350, 350, 350, 24, 0.26, (u, v) => Math.min(0.62, 0.1 + 0.32 * (1 + 0.7 * u + 0.7 * v)), BLUE);
72
+ const sat = word(A.p, 'pink', 'SAT', 470), pm = word(A.b, 'blue', '9PM', 470);
73
+ const bandA = el(A.b, 'div', 'abs', { width: (W - 2 * M) + 'px', height: '132px',
74
+ background: 'repeating-linear-gradient(90deg, var(--blue) 0 18px, transparent 18px 36px)' });
75
+ const labA = el(A.b, 'div', 'lab r blue', { width: '400px' }, '<span>DOORS OPEN</span><span>ALL NIGHT</span>');
76
+
77
+ // ---------- scene B: LIVE, pink plate then blue plate
78
+ const B = SC[1];
79
+ const liveP = word(B.p, 'pink', '', 735), liveB = word(B.b, 'dots', '', 735);
80
+ const LETTERS = 'LIVE'.split('');
81
+ const lp = LETTERS.map(ch => el(liveP, 'span', '', { display: 'inline-block', transformOrigin: '50% 70%' }, ch));
82
+ const lb = LETTERS.map(ch => el(liveB, 'span', '', { display: 'inline-block' }, ch));
83
+ const bandB = el(B.b, 'div', 'abs', { width: '2800px', height: '250px', transformOrigin: '0 0',
84
+ background: 'repeating-linear-gradient(90deg, var(--blue) 0 22px, transparent 22px 48px)' });
85
+ const labB = el(B.p, 'div', 'lab pink', { width: '600px' }, '<span>ONE NIGHT ONLY</span>');
86
+
87
+ // ---------- scene C: NEW SOUND, halftone sun and sound rings
88
+ const C = SC[2];
89
+ const SUN = { x: 1430, y: 1150, R: 640 };
90
+ const sunCv = el(C.b, 'canvas', '', {}); sunCv.width = W; sunCv.height = H; const sunX = sunCv.getContext('2d');
91
+ const NS = 'http://www.w3.org/2000/svg';
92
+ const svg = document.createElementNS(NS, 'svg'); svg.setAttribute('width', W); svg.setAttribute('height', H);
93
+ svg.style.position = 'absolute'; svg.style.left = '0'; svg.style.top = '0'; C.p.appendChild(svg);
94
+ const RINGS = 14, GAP = 96;
95
+ const rings = Array.from({ length: RINGS }, () => { const c = document.createElementNS(NS, 'circle');
96
+ c.setAttribute('cx', SUN.x); c.setAttribute('cy', SUN.y); c.setAttribute('fill', 'none'); c.setAttribute('stroke', PINK);
97
+ svg.appendChild(c); return c; });
98
+ const knock = word(C.p, '', 'SOUND', 330); knock.style.color = 'var(--knock)';
99
+ knock.style.webkitTextStroke = '44px var(--knock)';
100
+ const nw = word(C.b, 'blue', 'NEW', 400), snd = word(C.p, 'pink', 'SOUND', 330);
101
+ const labC = el(C.b, 'div', 'lab r blue', { width: '400px' }, '<span>TURN IT UP</span>');
102
+
103
+ // ---------- registration marks: printed in both inks, so the off-register plate always shows
104
+ const mark = (parent, color, x, y) => { const m = document.createElementNS(NS, 'svg');
105
+ m.setAttribute('width', 60); m.setAttribute('height', 60); Object.assign(m.style, { position: 'absolute', left: (x - 30) + 'px', top: (y - 30) + 'px' });
106
+ m.innerHTML = `<circle cx="30" cy="30" r="16" fill="none" stroke="${color}" stroke-width="4"/>
107
+ <path d="M30 4V56M4 30H56" stroke="${color}" stroke-width="4"/>`; parent.appendChild(m); };
108
+ [[40, 40], [W - 40, H - 40]].forEach(([x, y]) => { mark(LP, PINK, x, y); mark(LB, BLUE, x, y); });
109
+
110
+ // ---------- roller wipe: blue bars plus one pink bar, offsets measured back from the leading edge
111
+ const BARS = [{ l: LB, a: 0, b: 128 }, { l: LB, a: 150, b: 186 }, { l: LB, a: 204, b: 216 }, { l: LP, a: 70, b: 172 }]
112
+ .map(o => Object.assign(o, { e: el(o.l, 'div', 'bar', { background: o.l === LB ? 'var(--blue)' : 'var(--pink)' }) }));
113
+ const WIPES = [{ T: 3.5, dir: 'LR', s: 0 }, { T: 7.5, dir: 'TB', s: 1 }, { T: 11.5, dir: 'RL', s: 2 }];
114
+
115
+ // ---------- fixed paper: grain (multiply) and ink dropout speckle (paper colour on top)
116
+ const rnd = S.rng(9);
117
+ const mottle = (seed, w, h) => { const c = document.createElement('canvas'); c.width = w; c.height = h;
118
+ const x = c.getContext('2d'), d = x.createImageData(w, h), r = S.rng(seed);
119
+ for (let i = 0; i < w * h; i++) { const v = r() * 255; d.data.set([v, v, v, 255], i * 4); } x.putImageData(d, 0, 0); return c; };
120
+ const grain = el(root, 'canvas', '', { mixBlendMode: 'multiply' }); grain.width = W; grain.height = H;
121
+ { const g = grain.getContext('2d'); g.imageSmoothingEnabled = true; g.drawImage(mottle(3, 40, 23), 0, 0, W, H);
122
+ const d = g.getImageData(0, 0, W, H), p = d.data;
123
+ for (let i = 0; i < p.length; i += 4) { const n = rnd(), m = p[i] / 255;
124
+ const v = 255 - 16 * n * n - 9 * m - (n > 0.9985 ? 70 : 0); p[i] = v; p[i + 1] = v - 1; p[i + 2] = v - 3; p[i + 3] = 255; }
125
+ g.putImageData(d, 0, 0); }
126
+ const speck = el(root, 'canvas', '', {}); speck.width = W; speck.height = H;
127
+ { const g = speck.getContext('2d'); g.globalAlpha = 0.13; g.imageSmoothingEnabled = true; g.drawImage(mottle(5, 64, 36), 0, 0, W, H);
128
+ const d = g.getImageData(0, 0, W, H), p = d.data, pc = hex(PAPER);
129
+ for (let i = 0; i < p.length; i += 4) { const a = p[i + 3] * (p[i] / 255) * 1.4; p.set([...pc, a], i); }
130
+ g.putImageData(d, 0, 0); g.globalAlpha = 1; g.fillStyle = PAPER;
131
+ for (let i = 0; i < 52000; i++) { const x = rnd() * W, y = rnd() * H, r = 0.5 + 1.4 * rnd() * rnd();
132
+ g.globalAlpha = 0.45 + 0.55 * rnd(); g.beginPath(); g.arc(x, y, r, 0, Math.PI * 2); g.fill(); } }
133
+
134
+ // ---------- type metrics: place words by baseline (fonts can land late, so measure in render)
135
+ const mc = document.createElement('canvas').getContext('2d');
136
+ function base() { mc.font = '100px "Archivo Black"'; const m = mc.measureText('H');
137
+ const asc = m.fontBoundingBoxAscent / 100, des = m.fontBoundingBoxDescent / 100;
138
+ return { off: (1 - asc - des) / 2 + asc, cap: m.actualBoundingBoxAscent / 100 }; }
139
+ const put = (e, x, baseline, fs, mt, extra) => { e.style.left = x + 'px'; e.style.top = (baseline - mt.off * fs) + 'px';
140
+ e.style.transform = extra || ''; };
141
+
142
+ // stamp: hard landing, scale 1.12 to 1 with a small rotate settle, no fade
143
+ const stampT = (tt, t0, r0) => { if (tt < t0) return null; const p = S.seg(tt, t0, 0.25, 'power4.out');
144
+ return `scale(${S.mix(1.12, 1, p)}) rotate(${S.mix(r0 || 0, 0, p)}deg)`; };
145
+ const show = (e, tr) => { e.style.visibility = tr == null ? 'hidden' : 'visible'; if (tr != null) e.style.transform = tr; };
146
+
147
+ // register: the blue plate sits 3 to 6 px off, moves 1 to 2 px each beat, and gets a thump on every stamp
148
+ const JR = S.rng(21), JIT = Array.from({ length: 24 }, () => [JR() * 3 - 1.5, JR() * 3 - 1.5]);
149
+ const HITS = [0, 0.5, 1, 4, 4.25, 4.5, 4.75, 6, 8.5, 9, 9.5];
150
+ const KR = S.rng(33), KICK = HITS.map(() => [(KR() < 0.5 ? -1 : 1) * (4 + 3 * KR()), (KR() < 0.5 ? -1 : 1) * (3 + 3 * KR())]);
151
+
152
+ window.__timelines["main"] = S.play(function render(t) {
153
+ const tt = (t + OFFSET) % S.D, mt = base();
154
+ const beat = Math.floor(tt * 2 + 1e-6) % 24;
155
+ let rx = 5 + JIT[beat][0], ry = -3 + JIT[beat][1];
156
+ HITS.forEach((h, i) => { const d = tt - h; if (d >= 0 && d < 0.6) { const k = Math.exp(-d * 16); rx += KICK[i][0] * k; ry += KICK[i][1] * k; } });
157
+ LB.style.transform = `translate(${rx.toFixed(2)}px, ${ry.toFixed(2)}px)`;
158
+
159
+ // which sheet is on the drum, and the wipe that clears it
160
+ SC.forEach((sc, i) => { const on = tt >= i * 4 && tt < i * 4 + 4; sc.b.style.display = sc.p.style.display = on ? 'block' : 'none';
161
+ sc.b.style.clipPath = sc.p.style.clipPath = 'none'; });
162
+ BARS.forEach(o => o.e.style.display = 'none');
163
+ WIPES.forEach(w => { if (tt < w.T - 0.1 || tt >= w.T + 0.5) return;
164
+ const e = S.seg(tt, w.T - 0.1, 0.6, w.dir === 'TB' ? 'sine.inOut' : 'power2.inOut');
165
+ const L = w.dir === 'TB' ? H : W, lead = S.mix(-40, L + 260, e);
166
+ const cut = lead - 64;
167
+ const clip = w.dir === 'LR' ? `inset(0 0 0 ${cut}px)` : w.dir === 'RL' ? `inset(0 ${cut}px 0 0)` : `inset(${cut}px 0 0 0)`;
168
+ SC[w.s].b.style.clipPath = SC[w.s].p.style.clipPath = clip;
169
+ BARS.forEach(o => { const s = o.e.style; s.display = 'block'; const a = lead - o.b, len = o.b - o.a;
170
+ if (w.dir === 'TB') Object.assign(s, { left: '-20px', width: (W + 40) + 'px', top: a + 'px', height: len + 'px' });
171
+ else if (w.dir === 'LR') Object.assign(s, { top: '-20px', height: (H + 40) + 'px', left: a + 'px', width: len + 'px' });
172
+ else Object.assign(s, { top: '-20px', height: (H + 40) + 'px', left: (W - a - len) + 'px', width: len + 'px' }); });
173
+ });
174
+
175
+ // ----- scene A
176
+ if (tt < 4) {
177
+ discA.style.left = (1330 - 410) + 'px'; discA.style.top = (560 - 410) + 'px';
178
+ show(discA, stampT(tt, 0, -2));
179
+ const sA = S.seg(tt, 1.5, 0.5, 'expo.out');
180
+ htA.style.transform = `translate(${1560 - 350 + (1 - sA) * 260}px, ${250 - 350 - (1 - sA) * 700}px) rotate(${(1 - sA) * 18}deg)`;
181
+ htA.style.visibility = tt >= 1.5 ? 'visible' : 'hidden';
182
+ const satT = stampT(tt, 0.5, 1.5), pmT = stampT(tt, 1.0, -1.5);
183
+ put(sat, M - 8, 92 + mt.cap * 470, 470, mt); show(sat, satT);
184
+ put(pm, M - 8, H - 92, 470, mt); show(pm, pmT);
185
+ // stripe band: masked reveal from the left, then steps one stripe pair per beat
186
+ const r = S.seg(tt, 2.0, 0.5, 'expo.out');
187
+ bandA.style.left = M + 'px'; bandA.style.top = '478px';
188
+ bandA.style.clipPath = `inset(0 ${(1 - r) * 100}% 0 0)`; bandA.style.visibility = tt >= 2 ? 'visible' : 'hidden';
189
+ const st = S.seg(tt, 2.5, 0.4, 'expo.out') + S.seg(tt, 3.0, 0.4, 'expo.out');
190
+ bandA.style.backgroundPosition = `${st * 54}px 0`;
191
+ // label: masked slide up, then swaps
192
+ Object.assign(labA.style, { left: (W - M - 400) + 'px', top: (H - M - 34) + 'px' });
193
+ const l1 = S.seg(tt, 2.0, 0.4, 'expo.out'), l2 = S.seg(tt, 3.0, 0.4, 'expo.inOut');
194
+ labA.children[0].style.transform = `translateY(${(1 - l1) * 40 - l2 * 40}px)`;
195
+ labA.children[1].style.transform = `translateY(${(1 - l2) * 40}px)`;
196
+ }
197
+
198
+ // ----- scene B
199
+ if (tt >= 4 && tt < 8) {
200
+ const fs = 735, bl = 540 + mt.cap * fs / 2 + 10;
201
+ put(liveP, M - 14, bl, fs, mt); put(liveB, M - 14, bl, fs, mt);
202
+ lp.forEach((s, i) => { const tr = stampT(tt, 4 + i * 0.25, i % 2 ? 2 : -2); s.style.visibility = tr == null ? 'hidden' : 'visible'; if (tr) s.style.transform = tr; });
203
+ // blue plate: stamps far off register, then snaps home
204
+ const on = tt >= 6, sn = S.seg(tt, 6.5, 0.35, 'expo.out'), land = S.seg(tt, 6.0, 0.25, 'power4.out');
205
+ liveB.style.visibility = on ? 'visible' : 'hidden';
206
+ liveB.style.transform = `translate(${S.mix(64, 18, sn)}px, ${S.mix(-46, 14, sn)}px) scale(${S.mix(1.08, 1, land)})`;
207
+ // stripe band slides in on a slant, then steps on each beat
208
+ const sb = S.seg(tt, 5.0, 0.5, 'expo.out');
209
+ const step = [5.5, 6.0, 6.5, 7.0].reduce((a, b) => a + S.seg(tt, b, 0.4, 'expo.out'), 0);
210
+ bandB.style.visibility = tt >= 5 ? 'visible' : 'hidden';
211
+ bandB.style.transform = `translate(${-300 + (1 - sb) * 2400}px, ${700}px) rotate(-11deg)`;
212
+ bandB.style.backgroundPosition = `${step * 72}px 0`;
213
+ Object.assign(labB.style, { left: M + 'px', top: (M + 4) + 'px' });
214
+ labB.children[0].style.transform = `translateY(${(1 - S.seg(tt, 7.0, 0.4, 'expo.out')) * 40}px)`;
215
+ }
216
+
217
+ // ----- scene C
218
+ if (tt >= 8) {
219
+ const rise = S.seg(tt, 8.0, 0.6, 'expo.out');
220
+ const sy = SUN.y + (1 - rise) * 760;
221
+ let sw = 0; [9.5, 10, 10.5, 11].forEach(b => { const d = tt - b; sw += 0.09 * S.seg(tt, b, 0.3, 'expo.out'); });
222
+ sunX.clearRect(0, 0, W, H);
223
+ halftone(sunX, SUN.x, sy, SUN.R, 26, 0.26 + 0.3 * (1 - rise), (u, v) => Math.min(0.66, (0.12 + 0.5 * (v + 1) / 2 + 0.25 * (1 - Math.hypot(u, v))) * (1 + sw)), BLUE);
224
+ // rings: stamp at 9.5 with the first pulse
225
+ const rOn = tt >= 9.5, rl = S.seg(tt, 9.5, 0.25, 'power4.out');
226
+ // a sound wave: every beat sends a thick pulse out through the rings
227
+ const PULSES = [9.5, 10, 10.5, 11, 11.5];
228
+ rings.forEach((c, i) => { const r = SUN.R + 40 + i * GAP;
229
+ let pu = 0; PULSES.forEach(b => { const d = tt - b; if (d >= 0) { const x = (r - SUN.R - 1150 * d) / 110; pu += Math.exp(-x * x); } });
230
+ const w = (Math.max(7, 20 - (r - SUN.R) / 90) + 26 * Math.min(1, pu)) * S.mix(0.4, 1, rl);
231
+ c.setAttribute('cy', sy); c.setAttribute('r', Math.max(1, (r + 12 * Math.min(1, pu)) * S.mix(1.04, 1, rl))); c.setAttribute('stroke-width', w);
232
+ c.style.visibility = rOn ? 'visible' : 'hidden'; });
233
+ put(nw, M - 8, 92 + mt.cap * 400, 400, mt); show(nw, stampT(tt, 8.5, -1.5));
234
+ const sT = stampT(tt, 9.0, 1.5);
235
+ put(snd, M - 6, H - 92, 330, mt); show(snd, sT); put(knock, M - 6, H - 92, 330, mt); show(knock, sT);
236
+ Object.assign(labC.style, { left: (W - M - 400) + 'px', top: (M + 4) + 'px' });
237
+ labC.children[0].style.transform = `translateY(${(1 - S.seg(tt, 10.0, 0.4, 'expo.out')) * 40}px)`;
238
+ }
239
+ }, { loop: true });
240
+ </script>
241
+ </body>
242
+ </html>
@@ -0,0 +1,57 @@
1
+ // studio.js: one clock for the whole piece (hack 4).
2
+ // Load it after GSAP and before your scene script.
3
+ // Your scene calls STUDIO.play(render). render(t) must draw the WHOLE frame from t alone.
4
+ // Same t in, same picture out. That makes renders exact, seekable, and loopable.
5
+ (function () {
6
+ // works from <head> or <body>: the root is looked up the first time it is needed
7
+ const R = () => document.querySelector('[data-composition-id]');
8
+ const num = (k) => +R().dataset[k];
9
+ const cache = {};
10
+ const S = {
11
+ get root() { return R(); },
12
+ get D() { return num('duration'); },
13
+ get W() { return num('width'); },
14
+ get H() { return num('height'); },
15
+ get V() { return S.H > S.W; }, // true for 9:16
16
+ get u() { return Math.min(S.W, S.H) / 1080; }, // 1 unit = 1 px at a 1080 short side
17
+ ease(name) { return cache[name] || (cache[name] = name === 'none' ? (p) => p : gsap.parseEase(name)); },
18
+ // eased 0..1 progress of a move that starts at `start` and lasts `dur`
19
+ seg(t, start, dur, ease) {
20
+ const p = Math.min(1, Math.max(0, (t - start) / dur));
21
+ return S.ease(ease || 'power3.out')(p);
22
+ },
23
+ mix(a, b, p) { return a + (b - a) * p; },
24
+ // a wave that always loops: use whole-number cycles
25
+ wave(t, cycles, offset) { return Math.sin(2 * Math.PI * ((cycles || 1) * t / S.D + (offset || 0))); },
26
+ // seeded random numbers (never use Math.random in a render)
27
+ rng(seed) {
28
+ let a = seed >>> 0;
29
+ return function () {
30
+ a = (a + 0x6d2b79f5) | 0;
31
+ let t = Math.imul(a ^ (a >>> 15), 1 | a);
32
+ t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
33
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
34
+ };
35
+ },
36
+ // one clock drives everything; loop:true wraps t so t = D draws the same frame as t = 0
37
+ play(render, opts) {
38
+ const loop = !opts || opts.loop !== false;
39
+ const D = S.D, root = S.root;
40
+ const clock = { t: 0 };
41
+ const tl = gsap.timeline({ paused: true });
42
+ // loop_check.py sets STUDIO_NO_WRAP so it can prove render(end) really equals render(0)
43
+ const wrap = loop && !window.STUDIO_NO_WRAP;
44
+ const draw = () => render(wrap ? clock.t % D : clock.t);
45
+ tl.to(clock, { t: D, duration: D, ease: 'none', onUpdate: draw }, 0);
46
+ draw();
47
+ // fonts can arrive after the first draw; draw again so text measured from them is right,
48
+ // even on frame 0 (seeking to the time you are already at does not redraw)
49
+ if (document.fonts && document.fonts.ready) document.fonts.ready.then(draw);
50
+ window.addEventListener('load', draw);
51
+ window.__timelines = window.__timelines || {};
52
+ window.__timelines[root.dataset.compositionId] = tl;
53
+ return tl;
54
+ },
55
+ };
56
+ window.STUDIO = S;
57
+ })();