@amg555/frameforge-mcp 2.7.3 → 2.7.7

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 (565) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/AGENTS.md +33 -0
  3. package/CHANGELOG.md +49 -0
  4. package/CLAUDE.md +17 -6
  5. package/GEMINI.md +63 -0
  6. package/README.md +216 -426
  7. package/START_HERE.md +4 -2
  8. package/package.json +5 -3
  9. package/plugins/ai-video-editor/README.md +32 -0
  10. package/plugins/ai-video-editor/SKILL.md +152 -0
  11. package/plugins/ai-video-editor/assets/fonts/fonts.css +2409 -0
  12. package/plugins/ai-video-editor/assets/fonts/ttf/anton-400.ttf +0 -0
  13. package/plugins/ai-video-editor/assets/fonts/ttf/archivo-800.ttf +0 -0
  14. package/plugins/ai-video-editor/assets/fonts/ttf/cabin-sketch-700.ttf +0 -0
  15. package/plugins/ai-video-editor/assets/fonts/ttf/dm-sans-700.ttf +0 -0
  16. package/plugins/ai-video-editor/assets/fonts/ttf/fraunces-600.ttf +0 -0
  17. package/plugins/ai-video-editor/assets/fonts/ttf/fraunces-700.ttf +0 -0
  18. package/plugins/ai-video-editor/assets/fonts/ttf/fredoka-700.ttf +0 -0
  19. package/plugins/ai-video-editor/assets/fonts/ttf/inter-700.ttf +0 -0
  20. package/plugins/ai-video-editor/assets/fonts/ttf/inter-800.ttf +0 -0
  21. package/plugins/ai-video-editor/assets/fonts/ttf/inter-tight-800.ttf +0 -0
  22. package/plugins/ai-video-editor/assets/fonts/ttf/kalam-700.ttf +0 -0
  23. package/plugins/ai-video-editor/assets/fonts/ttf/noto-sans-devanagari-700.ttf +0 -0
  24. package/plugins/ai-video-editor/assets/fonts/web/noto-sans-devanagari-devanagari-400-normal.woff2 +0 -0
  25. package/plugins/ai-video-editor/assets/fonts/web/noto-sans-devanagari-devanagari-500-normal.woff2 +0 -0
  26. package/plugins/ai-video-editor/assets/fonts/web/noto-sans-devanagari-devanagari-600-normal.woff2 +0 -0
  27. package/plugins/ai-video-editor/assets/fonts/web/noto-sans-devanagari-devanagari-700-normal.woff2 +0 -0
  28. package/plugins/ai-video-editor/assets/fonts/web/noto-sans-devanagari-devanagari-800-normal.woff2 +0 -0
  29. package/plugins/ai-video-editor/engine/hidpi.js +117 -0
  30. package/plugins/ai-video-editor/engine/page.html +43 -0
  31. package/plugins/ai-video-editor/engine/player.js +145 -0
  32. package/plugins/ai-video-editor/references/example-story-warm-canvas.js +95 -0
  33. package/plugins/ai-video-editor/references/story-guide.md +112 -0
  34. package/plugins/ai-video-editor/requirements.txt +4 -0
  35. package/plugins/ai-video-editor/styles/chalk-talk/base.js +490 -0
  36. package/plugins/ai-video-editor/styles/chalk-talk/style.json +14 -0
  37. package/plugins/ai-video-editor/styles/chalk-talk/style.md +41 -0
  38. package/plugins/ai-video-editor/styles/clean-tech/base.js +447 -0
  39. package/plugins/ai-video-editor/styles/clean-tech/style.json +15 -0
  40. package/plugins/ai-video-editor/styles/clean-tech/style.md +38 -0
  41. package/plugins/ai-video-editor/styles/creator-motion-graphics/base.js +698 -0
  42. package/plugins/ai-video-editor/styles/creator-motion-graphics/style.json +16 -0
  43. package/plugins/ai-video-editor/styles/creator-motion-graphics/style.md +39 -0
  44. package/plugins/ai-video-editor/styles/data-story/base.js +432 -0
  45. package/plugins/ai-video-editor/styles/data-story/style.json +14 -0
  46. package/plugins/ai-video-editor/styles/data-story/style.md +38 -0
  47. package/plugins/ai-video-editor/styles/index.json +103 -0
  48. package/plugins/ai-video-editor/styles/pop-info/base.js +570 -0
  49. package/plugins/ai-video-editor/styles/pop-info/style.json +13 -0
  50. package/plugins/ai-video-editor/styles/pop-info/style.md +37 -0
  51. package/plugins/ai-video-editor/styles/software-walkthrough/base.js +544 -0
  52. package/plugins/ai-video-editor/styles/software-walkthrough/style.json +15 -0
  53. package/plugins/ai-video-editor/styles/software-walkthrough/style.md +38 -0
  54. package/plugins/ai-video-editor/styles/warm-canvas/base.js +610 -0
  55. package/plugins/ai-video-editor/styles/warm-canvas/style.json +14 -0
  56. package/plugins/ai-video-editor/styles/warm-canvas/style.md +37 -0
  57. package/plugins/aiinsight-shorts/CHANGELOG.md +6 -0
  58. package/plugins/aiinsight-shorts/README.md +43 -0
  59. package/plugins/aiinsight-shorts/SKILL.md +138 -0
  60. package/plugins/aiinsight-shorts/styles/deep-dive/STYLE.md +58 -0
  61. package/plugins/aiinsight-shorts/styles/deep-dive/example/data/cues.json +140 -0
  62. package/plugins/aiinsight-shorts/styles/deep-dive/example/data/lines.json +67 -0
  63. package/plugins/aiinsight-shorts/styles/deep-dive/example/data/words.json +614 -0
  64. package/plugins/aiinsight-shorts/styles/deep-dive/example/data/words.txt +102 -0
  65. package/plugins/aiinsight-shorts/styles/deep-dive/example/fonts/Inter-Black.otf +0 -0
  66. package/plugins/aiinsight-shorts/styles/deep-dive/example/fonts/Inter-ExtraBold.otf +0 -0
  67. package/plugins/aiinsight-shorts/styles/deep-dive/example/index.html +17 -0
  68. package/plugins/aiinsight-shorts/styles/deep-dive/example/script.json +27 -0
  69. package/plugins/aiinsight-shorts/styles/deep-dive/example/sheet.html +11 -0
  70. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/board.js +62 -0
  71. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/captions.js +68 -0
  72. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/engine.js +65 -0
  73. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/human.js +128 -0
  74. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/lib.js +44 -0
  75. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/look2d.js +33 -0
  76. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/sdf.js +79 -0
  77. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/sets.js +107 -0
  78. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/core/timing.js +23 -0
  79. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/main.js +56 -0
  80. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/sheet.js +79 -0
  81. package/plugins/aiinsight-shorts/styles/deep-dive/example/src/shots.js +136 -0
  82. package/plugins/aiinsight-shorts/styles/deep-dive/example/tools/capture.mjs +122 -0
  83. package/plugins/aiinsight-shorts/styles/deep-dive/example/tools/mix.py +172 -0
  84. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/LICENSE-three.txt +21 -0
  85. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/environments/RoomEnvironment.js +144 -0
  86. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/BokehPass.js +141 -0
  87. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
  88. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/MaskPass.js +104 -0
  89. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/OutputPass.js +97 -0
  90. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/Pass.js +95 -0
  91. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/RenderPass.js +99 -0
  92. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
  93. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
  94. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/shaders/BokehShader.js +145 -0
  95. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/shaders/CopyShader.js +45 -0
  96. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
  97. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/addons/shaders/OutputShader.js +85 -0
  98. package/plugins/aiinsight-shorts/styles/deep-dive/example/vendor/three.module.js +6 -0
  99. package/plugins/aiinsight-shorts/styles/deep-dive/style-sheet.png +0 -0
  100. package/plugins/aiinsight-shorts/styles/inside-out/STYLE.md +97 -0
  101. package/plugins/aiinsight-shorts/styles/inside-out/example/data/cues.json +178 -0
  102. package/plugins/aiinsight-shorts/styles/inside-out/example/data/lines.json +73 -0
  103. package/plugins/aiinsight-shorts/styles/inside-out/example/data/words.json +662 -0
  104. package/plugins/aiinsight-shorts/styles/inside-out/example/fonts/Inter-Black.otf +0 -0
  105. package/plugins/aiinsight-shorts/styles/inside-out/example/index.html +17 -0
  106. package/plugins/aiinsight-shorts/styles/inside-out/example/script.json +26 -0
  107. package/plugins/aiinsight-shorts/styles/inside-out/example/src/core/captions.js +68 -0
  108. package/plugins/aiinsight-shorts/styles/inside-out/example/src/core/kit.js +345 -0
  109. package/plugins/aiinsight-shorts/styles/inside-out/example/src/core/lib.js +44 -0
  110. package/plugins/aiinsight-shorts/styles/inside-out/example/src/core/timing.js +23 -0
  111. package/plugins/aiinsight-shorts/styles/inside-out/example/src/main.js +62 -0
  112. package/plugins/aiinsight-shorts/styles/inside-out/example/src/shots.js +195 -0
  113. package/plugins/aiinsight-shorts/styles/inside-out/example/tools/capture.mjs +122 -0
  114. package/plugins/aiinsight-shorts/styles/inside-out/example/tools/mix.py +172 -0
  115. package/plugins/aiinsight-shorts/styles/inside-out/style-sheet.png +0 -0
  116. package/plugins/aiinsight-shorts/styles/night-file/STYLE.md +36 -0
  117. package/plugins/aiinsight-shorts/styles/night-file/example/data/cues.json +146 -0
  118. package/plugins/aiinsight-shorts/styles/night-file/example/data/lines.json +73 -0
  119. package/plugins/aiinsight-shorts/styles/night-file/example/data/words.json +572 -0
  120. package/plugins/aiinsight-shorts/styles/night-file/example/data/words.txt +95 -0
  121. package/plugins/aiinsight-shorts/styles/night-file/example/fonts/FreeMonoBold.ttf +0 -0
  122. package/plugins/aiinsight-shorts/styles/night-file/example/fonts/Inter-Black.otf +0 -0
  123. package/plugins/aiinsight-shorts/styles/night-file/example/index.html +18 -0
  124. package/plugins/aiinsight-shorts/styles/night-file/example/script.json +26 -0
  125. package/plugins/aiinsight-shorts/styles/night-file/example/sheet.html +13 -0
  126. package/plugins/aiinsight-shorts/styles/night-file/example/src/core/board.js +62 -0
  127. package/plugins/aiinsight-shorts/styles/night-file/example/src/core/captions.js +49 -0
  128. package/plugins/aiinsight-shorts/styles/night-file/example/src/core/engine.js +65 -0
  129. package/plugins/aiinsight-shorts/styles/night-file/example/src/core/human.js +128 -0
  130. package/plugins/aiinsight-shorts/styles/night-file/example/src/core/kit.js +151 -0
  131. package/plugins/aiinsight-shorts/styles/night-file/example/src/core/lib.js +44 -0
  132. package/plugins/aiinsight-shorts/styles/night-file/example/src/core/sdf.js +79 -0
  133. package/plugins/aiinsight-shorts/styles/night-file/example/src/core/sets3d.js +106 -0
  134. package/plugins/aiinsight-shorts/styles/night-file/example/src/core/timing.js +23 -0
  135. package/plugins/aiinsight-shorts/styles/night-file/example/src/main.js +56 -0
  136. package/plugins/aiinsight-shorts/styles/night-file/example/src/sheet.js +86 -0
  137. package/plugins/aiinsight-shorts/styles/night-file/example/src/shots.js +130 -0
  138. package/plugins/aiinsight-shorts/styles/night-file/example/tools/capture.mjs +122 -0
  139. package/plugins/aiinsight-shorts/styles/night-file/example/tools/mix.py +172 -0
  140. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/LICENSE-three.txt +21 -0
  141. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/environments/RoomEnvironment.js +144 -0
  142. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/BokehPass.js +141 -0
  143. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
  144. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/MaskPass.js +104 -0
  145. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/OutputPass.js +97 -0
  146. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/Pass.js +95 -0
  147. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/RenderPass.js +99 -0
  148. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
  149. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
  150. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/shaders/BokehShader.js +145 -0
  151. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/shaders/CopyShader.js +45 -0
  152. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
  153. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/addons/shaders/OutputShader.js +85 -0
  154. package/plugins/aiinsight-shorts/styles/night-file/example/vendor/three.module.js +6 -0
  155. package/plugins/aiinsight-shorts/styles/night-file/style-sheet.png +0 -0
  156. package/plugins/aiinsight-shorts/styles/paper-atlas/STYLE.md +30 -0
  157. package/plugins/aiinsight-shorts/styles/paper-atlas/example/data/cues.json +167 -0
  158. package/plugins/aiinsight-shorts/styles/paper-atlas/example/data/lines.json +67 -0
  159. package/plugins/aiinsight-shorts/styles/paper-atlas/example/data/words.json +614 -0
  160. package/plugins/aiinsight-shorts/styles/paper-atlas/example/data/words.txt +102 -0
  161. package/plugins/aiinsight-shorts/styles/paper-atlas/example/fonts/Caladea-Bold.ttf +0 -0
  162. package/plugins/aiinsight-shorts/styles/paper-atlas/example/fonts/Inter-Black.otf +0 -0
  163. package/plugins/aiinsight-shorts/styles/paper-atlas/example/index.html +15 -0
  164. package/plugins/aiinsight-shorts/styles/paper-atlas/example/script.json +26 -0
  165. package/plugins/aiinsight-shorts/styles/paper-atlas/example/sheet.html +12 -0
  166. package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/core/board.js +62 -0
  167. package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/core/captions.js +47 -0
  168. package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/core/kit.js +152 -0
  169. package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/core/lib.js +44 -0
  170. package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/core/timing.js +23 -0
  171. package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/main.js +62 -0
  172. package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/sheet.js +61 -0
  173. package/plugins/aiinsight-shorts/styles/paper-atlas/example/src/shots.js +139 -0
  174. package/plugins/aiinsight-shorts/styles/paper-atlas/example/tools/capture.mjs +122 -0
  175. package/plugins/aiinsight-shorts/styles/paper-atlas/example/tools/mix.py +172 -0
  176. package/plugins/aiinsight-shorts/styles/paper-atlas/style-sheet.png +0 -0
  177. package/plugins/aiinsight-shorts/styles/stick-story/STYLE.md +32 -0
  178. package/plugins/aiinsight-shorts/styles/stick-story/example/data/cues.json +182 -0
  179. package/plugins/aiinsight-shorts/styles/stick-story/example/data/lines.json +79 -0
  180. package/plugins/aiinsight-shorts/styles/stick-story/example/data/words.json +662 -0
  181. package/plugins/aiinsight-shorts/styles/stick-story/example/data/words.txt +110 -0
  182. package/plugins/aiinsight-shorts/styles/stick-story/example/fonts/Inter-Black.otf +0 -0
  183. package/plugins/aiinsight-shorts/styles/stick-story/example/fonts/Inter-ExtraBold.otf +0 -0
  184. package/plugins/aiinsight-shorts/styles/stick-story/example/index.html +13 -0
  185. package/plugins/aiinsight-shorts/styles/stick-story/example/script.json +27 -0
  186. package/plugins/aiinsight-shorts/styles/stick-story/example/sheet.html +10 -0
  187. package/plugins/aiinsight-shorts/styles/stick-story/example/src/core/board.js +62 -0
  188. package/plugins/aiinsight-shorts/styles/stick-story/example/src/core/captions.js +47 -0
  189. package/plugins/aiinsight-shorts/styles/stick-story/example/src/core/kit.js +166 -0
  190. package/plugins/aiinsight-shorts/styles/stick-story/example/src/core/lib.js +44 -0
  191. package/plugins/aiinsight-shorts/styles/stick-story/example/src/core/timing.js +23 -0
  192. package/plugins/aiinsight-shorts/styles/stick-story/example/src/main.js +62 -0
  193. package/plugins/aiinsight-shorts/styles/stick-story/example/src/sheet.js +64 -0
  194. package/plugins/aiinsight-shorts/styles/stick-story/example/src/shots.js +148 -0
  195. package/plugins/aiinsight-shorts/styles/stick-story/example/tools/capture.mjs +122 -0
  196. package/plugins/aiinsight-shorts/styles/stick-story/example/tools/mix.py +172 -0
  197. package/plugins/aiinsight-shorts/styles/stick-story/style-sheet.png +0 -0
  198. package/plugins/aiinsight-shorts/styles/tall-tale/STYLE.md +51 -0
  199. package/plugins/aiinsight-shorts/styles/tall-tale/example/data/cues.json +271 -0
  200. package/plugins/aiinsight-shorts/styles/tall-tale/example/data/lines.json +127 -0
  201. package/plugins/aiinsight-shorts/styles/tall-tale/example/data/words.json +908 -0
  202. package/plugins/aiinsight-shorts/styles/tall-tale/example/data/words.txt +151 -0
  203. package/plugins/aiinsight-shorts/styles/tall-tale/example/fonts/Caladea-Bold.ttf +0 -0
  204. package/plugins/aiinsight-shorts/styles/tall-tale/example/fonts/Inter-Black.otf +0 -0
  205. package/plugins/aiinsight-shorts/styles/tall-tale/example/fonts/Inter-ExtraBold.otf +0 -0
  206. package/plugins/aiinsight-shorts/styles/tall-tale/example/index.html +19 -0
  207. package/plugins/aiinsight-shorts/styles/tall-tale/example/script.json +37 -0
  208. package/plugins/aiinsight-shorts/styles/tall-tale/example/sheet.html +13 -0
  209. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/board.js +62 -0
  210. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/captions.js +56 -0
  211. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/engine.js +65 -0
  212. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/lib.js +44 -0
  213. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/props.js +166 -0
  214. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/timing.js +23 -0
  215. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/toon.js +352 -0
  216. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/core/world.js +340 -0
  217. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/main.js +56 -0
  218. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/sheet.js +99 -0
  219. package/plugins/aiinsight-shorts/styles/tall-tale/example/src/shots.js +377 -0
  220. package/plugins/aiinsight-shorts/styles/tall-tale/example/tools/capture.mjs +122 -0
  221. package/plugins/aiinsight-shorts/styles/tall-tale/example/tools/mix.py +204 -0
  222. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/LICENSE-three.txt +21 -0
  223. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/environments/RoomEnvironment.js +144 -0
  224. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/BokehPass.js +141 -0
  225. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
  226. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/MaskPass.js +104 -0
  227. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/OutputPass.js +97 -0
  228. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/Pass.js +95 -0
  229. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/RenderPass.js +99 -0
  230. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
  231. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
  232. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/shaders/BokehShader.js +145 -0
  233. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/shaders/CopyShader.js +45 -0
  234. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
  235. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/addons/shaders/OutputShader.js +85 -0
  236. package/plugins/aiinsight-shorts/styles/tall-tale/example/vendor/three.module.js +6 -0
  237. package/plugins/aiinsight-shorts/styles/tall-tale/style-sheet.png +0 -0
  238. package/plugins/faceless-shorts/README.md +34 -0
  239. package/plugins/faceless-shorts/SKILL.md +124 -0
  240. package/plugins/faceless-shorts/styles/deep-dive/STYLE.md +58 -0
  241. package/plugins/faceless-shorts/styles/deep-dive/example/data/cues.json +140 -0
  242. package/plugins/faceless-shorts/styles/deep-dive/example/data/lines.json +67 -0
  243. package/plugins/faceless-shorts/styles/deep-dive/example/data/words.json +614 -0
  244. package/plugins/faceless-shorts/styles/deep-dive/example/data/words.txt +102 -0
  245. package/plugins/faceless-shorts/styles/deep-dive/example/fonts/Inter-Black.otf +0 -0
  246. package/plugins/faceless-shorts/styles/deep-dive/example/fonts/Inter-ExtraBold.otf +0 -0
  247. package/plugins/faceless-shorts/styles/deep-dive/example/index.html +16 -0
  248. package/plugins/faceless-shorts/styles/deep-dive/example/script.json +27 -0
  249. package/plugins/faceless-shorts/styles/deep-dive/example/sheet.html +10 -0
  250. package/plugins/faceless-shorts/styles/deep-dive/example/src/core/board.js +62 -0
  251. package/plugins/faceless-shorts/styles/deep-dive/example/src/core/captions.js +68 -0
  252. package/plugins/faceless-shorts/styles/deep-dive/example/src/core/engine.js +65 -0
  253. package/plugins/faceless-shorts/styles/deep-dive/example/src/core/human.js +128 -0
  254. package/plugins/faceless-shorts/styles/deep-dive/example/src/core/lib.js +44 -0
  255. package/plugins/faceless-shorts/styles/deep-dive/example/src/core/look2d.js +33 -0
  256. package/plugins/faceless-shorts/styles/deep-dive/example/src/core/sdf.js +79 -0
  257. package/plugins/faceless-shorts/styles/deep-dive/example/src/core/sets.js +107 -0
  258. package/plugins/faceless-shorts/styles/deep-dive/example/src/core/timing.js +23 -0
  259. package/plugins/faceless-shorts/styles/deep-dive/example/src/main.js +56 -0
  260. package/plugins/faceless-shorts/styles/deep-dive/example/src/sheet.js +79 -0
  261. package/plugins/faceless-shorts/styles/deep-dive/example/src/shots.js +136 -0
  262. package/plugins/faceless-shorts/styles/deep-dive/example/tools/capture.mjs +122 -0
  263. package/plugins/faceless-shorts/styles/deep-dive/example/tools/mix.py +172 -0
  264. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/LICENSE-three.txt +21 -0
  265. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/environments/RoomEnvironment.js +144 -0
  266. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/BokehPass.js +141 -0
  267. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
  268. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/MaskPass.js +104 -0
  269. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/OutputPass.js +97 -0
  270. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/Pass.js +95 -0
  271. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/RenderPass.js +99 -0
  272. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
  273. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
  274. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/shaders/BokehShader.js +145 -0
  275. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/shaders/CopyShader.js +45 -0
  276. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
  277. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/addons/shaders/OutputShader.js +85 -0
  278. package/plugins/faceless-shorts/styles/deep-dive/example/vendor/three.module.js +6 -0
  279. package/plugins/faceless-shorts/styles/deep-dive/style-sheet.png +0 -0
  280. package/plugins/faceless-shorts/styles/inside-out/STYLE.md +97 -0
  281. package/plugins/faceless-shorts/styles/inside-out/example/data/cues.json +178 -0
  282. package/plugins/faceless-shorts/styles/inside-out/example/data/lines.json +73 -0
  283. package/plugins/faceless-shorts/styles/inside-out/example/data/words.json +662 -0
  284. package/plugins/faceless-shorts/styles/inside-out/example/fonts/Inter-Black.otf +0 -0
  285. package/plugins/faceless-shorts/styles/inside-out/example/index.html +16 -0
  286. package/plugins/faceless-shorts/styles/inside-out/example/script.json +26 -0
  287. package/plugins/faceless-shorts/styles/inside-out/example/src/core/captions.js +68 -0
  288. package/plugins/faceless-shorts/styles/inside-out/example/src/core/kit.js +345 -0
  289. package/plugins/faceless-shorts/styles/inside-out/example/src/core/lib.js +44 -0
  290. package/plugins/faceless-shorts/styles/inside-out/example/src/core/timing.js +23 -0
  291. package/plugins/faceless-shorts/styles/inside-out/example/src/main.js +62 -0
  292. package/plugins/faceless-shorts/styles/inside-out/example/src/shots.js +195 -0
  293. package/plugins/faceless-shorts/styles/inside-out/example/tools/capture.mjs +122 -0
  294. package/plugins/faceless-shorts/styles/inside-out/example/tools/mix.py +172 -0
  295. package/plugins/faceless-shorts/styles/inside-out/style-sheet.png +0 -0
  296. package/plugins/faceless-shorts/styles/night-file/STYLE.md +36 -0
  297. package/plugins/faceless-shorts/styles/night-file/example/data/cues.json +146 -0
  298. package/plugins/faceless-shorts/styles/night-file/example/data/lines.json +73 -0
  299. package/plugins/faceless-shorts/styles/night-file/example/data/words.json +572 -0
  300. package/plugins/faceless-shorts/styles/night-file/example/data/words.txt +95 -0
  301. package/plugins/faceless-shorts/styles/night-file/example/fonts/FreeMonoBold.ttf +0 -0
  302. package/plugins/faceless-shorts/styles/night-file/example/fonts/Inter-Black.otf +0 -0
  303. package/plugins/faceless-shorts/styles/night-file/example/index.html +16 -0
  304. package/plugins/faceless-shorts/styles/night-file/example/script.json +26 -0
  305. package/plugins/faceless-shorts/styles/night-file/example/sheet.html +11 -0
  306. package/plugins/faceless-shorts/styles/night-file/example/src/core/board.js +62 -0
  307. package/plugins/faceless-shorts/styles/night-file/example/src/core/captions.js +49 -0
  308. package/plugins/faceless-shorts/styles/night-file/example/src/core/engine.js +65 -0
  309. package/plugins/faceless-shorts/styles/night-file/example/src/core/human.js +128 -0
  310. package/plugins/faceless-shorts/styles/night-file/example/src/core/kit.js +151 -0
  311. package/plugins/faceless-shorts/styles/night-file/example/src/core/lib.js +44 -0
  312. package/plugins/faceless-shorts/styles/night-file/example/src/core/sdf.js +79 -0
  313. package/plugins/faceless-shorts/styles/night-file/example/src/core/sets3d.js +106 -0
  314. package/plugins/faceless-shorts/styles/night-file/example/src/core/timing.js +23 -0
  315. package/plugins/faceless-shorts/styles/night-file/example/src/main.js +56 -0
  316. package/plugins/faceless-shorts/styles/night-file/example/src/sheet.js +86 -0
  317. package/plugins/faceless-shorts/styles/night-file/example/src/shots.js +130 -0
  318. package/plugins/faceless-shorts/styles/night-file/example/tools/capture.mjs +122 -0
  319. package/plugins/faceless-shorts/styles/night-file/example/tools/mix.py +172 -0
  320. package/plugins/faceless-shorts/styles/night-file/example/vendor/LICENSE-three.txt +21 -0
  321. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/environments/RoomEnvironment.js +144 -0
  322. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/BokehPass.js +141 -0
  323. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
  324. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/MaskPass.js +104 -0
  325. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/OutputPass.js +97 -0
  326. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/Pass.js +95 -0
  327. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/RenderPass.js +99 -0
  328. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
  329. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
  330. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/shaders/BokehShader.js +145 -0
  331. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/shaders/CopyShader.js +45 -0
  332. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
  333. package/plugins/faceless-shorts/styles/night-file/example/vendor/addons/shaders/OutputShader.js +85 -0
  334. package/plugins/faceless-shorts/styles/night-file/example/vendor/three.module.js +6 -0
  335. package/plugins/faceless-shorts/styles/night-file/style-sheet.png +0 -0
  336. package/plugins/faceless-shorts/styles/paper-atlas/STYLE.md +30 -0
  337. package/plugins/faceless-shorts/styles/paper-atlas/example/data/cues.json +167 -0
  338. package/plugins/faceless-shorts/styles/paper-atlas/example/data/lines.json +67 -0
  339. package/plugins/faceless-shorts/styles/paper-atlas/example/data/words.json +614 -0
  340. package/plugins/faceless-shorts/styles/paper-atlas/example/data/words.txt +102 -0
  341. package/plugins/faceless-shorts/styles/paper-atlas/example/fonts/Caladea-Bold.ttf +0 -0
  342. package/plugins/faceless-shorts/styles/paper-atlas/example/fonts/Inter-Black.otf +0 -0
  343. package/plugins/faceless-shorts/styles/paper-atlas/example/index.html +13 -0
  344. package/plugins/faceless-shorts/styles/paper-atlas/example/script.json +26 -0
  345. package/plugins/faceless-shorts/styles/paper-atlas/example/sheet.html +10 -0
  346. package/plugins/faceless-shorts/styles/paper-atlas/example/src/core/board.js +62 -0
  347. package/plugins/faceless-shorts/styles/paper-atlas/example/src/core/captions.js +47 -0
  348. package/plugins/faceless-shorts/styles/paper-atlas/example/src/core/kit.js +152 -0
  349. package/plugins/faceless-shorts/styles/paper-atlas/example/src/core/lib.js +44 -0
  350. package/plugins/faceless-shorts/styles/paper-atlas/example/src/core/timing.js +23 -0
  351. package/plugins/faceless-shorts/styles/paper-atlas/example/src/main.js +62 -0
  352. package/plugins/faceless-shorts/styles/paper-atlas/example/src/sheet.js +61 -0
  353. package/plugins/faceless-shorts/styles/paper-atlas/example/src/shots.js +139 -0
  354. package/plugins/faceless-shorts/styles/paper-atlas/example/tools/capture.mjs +122 -0
  355. package/plugins/faceless-shorts/styles/paper-atlas/example/tools/mix.py +172 -0
  356. package/plugins/faceless-shorts/styles/paper-atlas/style-sheet.png +0 -0
  357. package/plugins/faceless-shorts/styles/stick-story/STYLE.md +32 -0
  358. package/plugins/faceless-shorts/styles/stick-story/example/data/cues.json +182 -0
  359. package/plugins/faceless-shorts/styles/stick-story/example/data/lines.json +79 -0
  360. package/plugins/faceless-shorts/styles/stick-story/example/data/words.json +662 -0
  361. package/plugins/faceless-shorts/styles/stick-story/example/data/words.txt +110 -0
  362. package/plugins/faceless-shorts/styles/stick-story/example/fonts/Inter-Black.otf +0 -0
  363. package/plugins/faceless-shorts/styles/stick-story/example/fonts/Inter-ExtraBold.otf +0 -0
  364. package/plugins/faceless-shorts/styles/stick-story/example/index.html +12 -0
  365. package/plugins/faceless-shorts/styles/stick-story/example/script.json +27 -0
  366. package/plugins/faceless-shorts/styles/stick-story/example/sheet.html +9 -0
  367. package/plugins/faceless-shorts/styles/stick-story/example/src/core/board.js +62 -0
  368. package/plugins/faceless-shorts/styles/stick-story/example/src/core/captions.js +47 -0
  369. package/plugins/faceless-shorts/styles/stick-story/example/src/core/kit.js +166 -0
  370. package/plugins/faceless-shorts/styles/stick-story/example/src/core/lib.js +44 -0
  371. package/plugins/faceless-shorts/styles/stick-story/example/src/core/timing.js +23 -0
  372. package/plugins/faceless-shorts/styles/stick-story/example/src/main.js +62 -0
  373. package/plugins/faceless-shorts/styles/stick-story/example/src/sheet.js +64 -0
  374. package/plugins/faceless-shorts/styles/stick-story/example/src/shots.js +148 -0
  375. package/plugins/faceless-shorts/styles/stick-story/example/tools/capture.mjs +122 -0
  376. package/plugins/faceless-shorts/styles/stick-story/example/tools/mix.py +172 -0
  377. package/plugins/faceless-shorts/styles/stick-story/style-sheet.png +0 -0
  378. package/plugins/faceless-shorts/styles/tall-tale/STYLE.md +51 -0
  379. package/plugins/faceless-shorts/styles/tall-tale/example/data/cues.json +271 -0
  380. package/plugins/faceless-shorts/styles/tall-tale/example/data/lines.json +127 -0
  381. package/plugins/faceless-shorts/styles/tall-tale/example/data/words.json +908 -0
  382. package/plugins/faceless-shorts/styles/tall-tale/example/data/words.txt +151 -0
  383. package/plugins/faceless-shorts/styles/tall-tale/example/fonts/Caladea-Bold.ttf +0 -0
  384. package/plugins/faceless-shorts/styles/tall-tale/example/fonts/Inter-Black.otf +0 -0
  385. package/plugins/faceless-shorts/styles/tall-tale/example/fonts/Inter-ExtraBold.otf +0 -0
  386. package/plugins/faceless-shorts/styles/tall-tale/example/index.html +17 -0
  387. package/plugins/faceless-shorts/styles/tall-tale/example/script.json +37 -0
  388. package/plugins/faceless-shorts/styles/tall-tale/example/sheet.html +11 -0
  389. package/plugins/faceless-shorts/styles/tall-tale/example/src/core/board.js +62 -0
  390. package/plugins/faceless-shorts/styles/tall-tale/example/src/core/captions.js +56 -0
  391. package/plugins/faceless-shorts/styles/tall-tale/example/src/core/engine.js +65 -0
  392. package/plugins/faceless-shorts/styles/tall-tale/example/src/core/lib.js +44 -0
  393. package/plugins/faceless-shorts/styles/tall-tale/example/src/core/props.js +166 -0
  394. package/plugins/faceless-shorts/styles/tall-tale/example/src/core/timing.js +23 -0
  395. package/plugins/faceless-shorts/styles/tall-tale/example/src/core/toon.js +352 -0
  396. package/plugins/faceless-shorts/styles/tall-tale/example/src/core/world.js +340 -0
  397. package/plugins/faceless-shorts/styles/tall-tale/example/src/main.js +56 -0
  398. package/plugins/faceless-shorts/styles/tall-tale/example/src/sheet.js +99 -0
  399. package/plugins/faceless-shorts/styles/tall-tale/example/src/shots.js +377 -0
  400. package/plugins/faceless-shorts/styles/tall-tale/example/tools/capture.mjs +122 -0
  401. package/plugins/faceless-shorts/styles/tall-tale/example/tools/mix.py +204 -0
  402. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/LICENSE-three.txt +21 -0
  403. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/environments/RoomEnvironment.js +144 -0
  404. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/BokehPass.js +141 -0
  405. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/EffectComposer.js +231 -0
  406. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/MaskPass.js +104 -0
  407. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/OutputPass.js +97 -0
  408. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/Pass.js +95 -0
  409. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/RenderPass.js +99 -0
  410. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/ShaderPass.js +77 -0
  411. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/postprocessing/UnrealBloomPass.js +415 -0
  412. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/shaders/BokehShader.js +145 -0
  413. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/shaders/CopyShader.js +45 -0
  414. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/shaders/LuminosityHighPassShader.js +64 -0
  415. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/addons/shaders/OutputShader.js +85 -0
  416. package/plugins/faceless-shorts/styles/tall-tale/example/vendor/three.module.js +6 -0
  417. package/plugins/faceless-shorts/styles/tall-tale/style-sheet.png +0 -0
  418. package/plugins/motion-styles/LIBRARY.md +896 -0
  419. package/plugins/motion-styles/README.md +29 -0
  420. package/plugins/motion-styles/SKILL.md +70 -0
  421. package/plugins/motion-styles/catalog.json +2253 -0
  422. package/plugins/motion-styles/prompts/bio-glow.md +149 -0
  423. package/plugins/motion-styles/prompts/blueprint.md +145 -0
  424. package/plugins/motion-styles/prompts/breaking-desk.md +147 -0
  425. package/plugins/motion-styles/prompts/callout-kit.md +147 -0
  426. package/plugins/motion-styles/prompts/chalk-talk.md +153 -0
  427. package/plugins/motion-styles/prompts/chat-story.md +143 -0
  428. package/plugins/motion-styles/prompts/clay-diorama.md +149 -0
  429. package/plugins/motion-styles/prompts/clean-tech.md +147 -0
  430. package/plugins/motion-styles/prompts/comic-panels.md +145 -0
  431. package/plugins/motion-styles/prompts/cosmic-scale.md +147 -0
  432. package/plugins/motion-styles/prompts/creator-motion.md +149 -0
  433. package/plugins/motion-styles/prompts/data-city.md +149 -0
  434. package/plugins/motion-styles/prompts/data-story.md +147 -0
  435. package/plugins/motion-styles/prompts/deep-layers.md +147 -0
  436. package/plugins/motion-styles/prompts/doc-cinema.md +145 -0
  437. package/plugins/motion-styles/prompts/evidence-board.md +145 -0
  438. package/plugins/motion-styles/prompts/exploded-view.md +149 -0
  439. package/plugins/motion-styles/prompts/glass-icons.md +147 -0
  440. package/plugins/motion-styles/prompts/glitch-pack.md +145 -0
  441. package/plugins/motion-styles/prompts/globe-arcs.md +147 -0
  442. package/plugins/motion-styles/prompts/headline-backdrop.md +145 -0
  443. package/plugins/motion-styles/prompts/iso-cutaway.md +147 -0
  444. package/plugins/motion-styles/prompts/isotype.md +145 -0
  445. package/plugins/motion-styles/prompts/karaoke-subs.md +145 -0
  446. package/plugins/motion-styles/prompts/low-poly-atlas.md +149 -0
  447. package/plugins/motion-styles/prompts/lower-thirds.md +147 -0
  448. package/plugins/motion-styles/prompts/marker-board.md +145 -0
  449. package/plugins/motion-styles/prompts/market-tape.md +145 -0
  450. package/plugins/motion-styles/prompts/math-canvas.md +145 -0
  451. package/plugins/motion-styles/prompts/myth-or-fact.md +145 -0
  452. package/plugins/motion-styles/prompts/neon-line.md +145 -0
  453. package/plugins/motion-styles/prompts/paper-craft.md +145 -0
  454. package/plugins/motion-styles/prompts/parchment-map.md +147 -0
  455. package/plugins/motion-styles/prompts/physics-toybox.md +147 -0
  456. package/plugins/motion-styles/prompts/pixel-quest.md +145 -0
  457. package/plugins/motion-styles/prompts/podcast-clip.md +147 -0
  458. package/plugins/motion-styles/prompts/pop-info.md +145 -0
  459. package/plugins/motion-styles/prompts/product-turntable.md +149 -0
  460. package/plugins/motion-styles/prompts/punch-captions.md +145 -0
  461. package/plugins/motion-styles/prompts/quiz-countdown.md +145 -0
  462. package/plugins/motion-styles/prompts/quote-cinema.md +145 -0
  463. package/plugins/motion-styles/prompts/recipe-steps.md +145 -0
  464. package/plugins/motion-styles/prompts/rubber-hose-reel.md +145 -0
  465. package/plugins/motion-styles/prompts/shadow-puppets.md +145 -0
  466. package/plugins/motion-styles/prompts/size-lineup.md +149 -0
  467. package/plugins/motion-styles/prompts/software-walkthrough.md +147 -0
  468. package/plugins/motion-styles/prompts/stack-split.md +145 -0
  469. package/plugins/motion-styles/prompts/sticker-pop.md +145 -0
  470. package/plugins/motion-styles/prompts/storybook.md +145 -0
  471. package/plugins/motion-styles/prompts/swiss-grid.md +145 -0
  472. package/plugins/motion-styles/prompts/synth-grid.md +147 -0
  473. package/plugins/motion-styles/prompts/tactics-board.md +145 -0
  474. package/plugins/motion-styles/prompts/terminal.md +145 -0
  475. package/plugins/motion-styles/prompts/tier-list.md +143 -0
  476. package/plugins/motion-styles/prompts/timeline-rail.md +145 -0
  477. package/plugins/motion-styles/prompts/top-5-countdown.md +145 -0
  478. package/plugins/motion-styles/prompts/versus-split.md +145 -0
  479. package/plugins/motion-styles/prompts/vhs-camcorder.md +145 -0
  480. package/plugins/motion-styles/prompts/visual-novel.md +145 -0
  481. package/plugins/motion-styles/prompts/warm-canvas.md +145 -0
  482. package/plugins/motion-styles/prompts/woodcut-tale.md +145 -0
  483. package/plugins/motion-styles/prompts/zine-collage.md +145 -0
  484. package/plugins/motion-styles/sources/bio-glow.html +639 -0
  485. package/plugins/motion-styles/sources/blueprint.html +617 -0
  486. package/plugins/motion-styles/sources/breaking-desk.html +585 -0
  487. package/plugins/motion-styles/sources/callout-kit.html +586 -0
  488. package/plugins/motion-styles/sources/chalk-talk.html +597 -0
  489. package/plugins/motion-styles/sources/chat-story.html +597 -0
  490. package/plugins/motion-styles/sources/clay-diorama.html +681 -0
  491. package/plugins/motion-styles/sources/clean-tech.html +554 -0
  492. package/plugins/motion-styles/sources/comic-panels.html +608 -0
  493. package/plugins/motion-styles/sources/cosmic-scale.html +628 -0
  494. package/plugins/motion-styles/sources/creator-motion.html +805 -0
  495. package/plugins/motion-styles/sources/data-city.html +613 -0
  496. package/plugins/motion-styles/sources/data-story.html +539 -0
  497. package/plugins/motion-styles/sources/deep-layers.html +624 -0
  498. package/plugins/motion-styles/sources/doc-cinema.html +590 -0
  499. package/plugins/motion-styles/sources/evidence-board.html +610 -0
  500. package/plugins/motion-styles/sources/exploded-view.html +618 -0
  501. package/plugins/motion-styles/sources/glass-icons.html +612 -0
  502. package/plugins/motion-styles/sources/glitch-pack.html +583 -0
  503. package/plugins/motion-styles/sources/globe-arcs.html +621 -0
  504. package/plugins/motion-styles/sources/headline-backdrop.html +584 -0
  505. package/plugins/motion-styles/sources/iso-cutaway.html +621 -0
  506. package/plugins/motion-styles/sources/isotype.html +588 -0
  507. package/plugins/motion-styles/sources/karaoke-subs.html +577 -0
  508. package/plugins/motion-styles/sources/low-poly-atlas.html +621 -0
  509. package/plugins/motion-styles/sources/lower-thirds.html +582 -0
  510. package/plugins/motion-styles/sources/marker-board.html +598 -0
  511. package/plugins/motion-styles/sources/market-tape.html +598 -0
  512. package/plugins/motion-styles/sources/math-canvas.html +592 -0
  513. package/plugins/motion-styles/sources/myth-or-fact.html +587 -0
  514. package/plugins/motion-styles/sources/neon-line.html +597 -0
  515. package/plugins/motion-styles/sources/paper-craft.html +612 -0
  516. package/plugins/motion-styles/sources/parchment-map.html +624 -0
  517. package/plugins/motion-styles/sources/physics-toybox.html +617 -0
  518. package/plugins/motion-styles/sources/pixel-quest.html +609 -0
  519. package/plugins/motion-styles/sources/podcast-clip.html +585 -0
  520. package/plugins/motion-styles/sources/pop-info.html +677 -0
  521. package/plugins/motion-styles/sources/product-turntable.html +611 -0
  522. package/plugins/motion-styles/sources/punch-captions.html +583 -0
  523. package/plugins/motion-styles/sources/quiz-countdown.html +593 -0
  524. package/plugins/motion-styles/sources/quote-cinema.html +581 -0
  525. package/plugins/motion-styles/sources/recipe-steps.html +599 -0
  526. package/plugins/motion-styles/sources/rubber-hose-reel.html +627 -0
  527. package/plugins/motion-styles/sources/shadow-puppets.html +609 -0
  528. package/plugins/motion-styles/sources/size-lineup.html +620 -0
  529. package/plugins/motion-styles/sources/software-walkthrough.html +651 -0
  530. package/plugins/motion-styles/sources/stack-split.html +588 -0
  531. package/plugins/motion-styles/sources/sticker-pop.html +587 -0
  532. package/plugins/motion-styles/sources/storybook.html +600 -0
  533. package/plugins/motion-styles/sources/swiss-grid.html +590 -0
  534. package/plugins/motion-styles/sources/synth-grid.html +614 -0
  535. package/plugins/motion-styles/sources/tactics-board.html +608 -0
  536. package/plugins/motion-styles/sources/terminal.html +593 -0
  537. package/plugins/motion-styles/sources/tier-list.html +600 -0
  538. package/plugins/motion-styles/sources/timeline-rail.html +598 -0
  539. package/plugins/motion-styles/sources/top-5-countdown.html +589 -0
  540. package/plugins/motion-styles/sources/versus-split.html +592 -0
  541. package/plugins/motion-styles/sources/vhs-camcorder.html +587 -0
  542. package/plugins/motion-styles/sources/visual-novel.html +623 -0
  543. package/plugins/motion-styles/sources/warm-canvas.html +742 -0
  544. package/plugins/motion-styles/sources/woodcut-tale.html +598 -0
  545. package/plugins/motion-styles/sources/zine-collage.html +594 -0
  546. package/plugins/video-pipeline/.claude-plugin/plugin.json +2 -2
  547. package/plugins/video-pipeline/skills/.upstream-skills.json +156 -143
  548. package/plugins/video-pipeline/skills/video-pipeline/references/mcp-tools.md +3 -3
  549. package/scripts/deep-validate.js +3 -2
  550. package/src/audio-mixer/mixer.js +69 -0
  551. package/src/cli/make.js +19 -0
  552. package/src/harness/lib/browser.mjs +22 -1
  553. package/src/harness/lib/capture.mjs +33 -11
  554. package/src/harness/lib/jobs.mjs +16 -1
  555. package/src/mcp-server/server.js +726 -10
  556. package/src/pipeline/providers.js +77 -17
  557. package/src/skills/sync-upstream.js +15 -3
  558. package/src/utils/media-downloader.js +7 -0
  559. package/src/utils/tool-installer.js +212 -0
  560. package/src/utils/transcribe.js +9 -1
  561. package/src/video-renderer/renderer.js +68 -38
  562. package/src/video-renderer/scene-animator.js +50 -15
  563. package/src/workflows/assets.js +49 -5
  564. package/src/workflows/render.js +2 -0
  565. package/src/workflows/script.js +14 -3
@@ -0,0 +1,628 @@
1
+ <meta charset="utf-8">
2
+ <title>Cosmic Scale</title>
3
+ <meta name="claude:viewport-fit-sides" content="cover">
4
+ <link rel="preconnect" href="https://fonts.googleapis.com">
5
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
6
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=JetBrains+Mono:wght@500;700&family=Anton&family=Instrument+Serif:ital@0;1&family=Inter:wght@400;600;700;800&display=block">
7
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
8
+ <style>
9
+ /* Layout: an editing-suite player. One dark look by choice: the stage, then the transport bar under it. */
10
+ :root {
11
+ color-scheme: dark;
12
+ --bg: #0b0b0d;
13
+ --panel: #141417;
14
+ --ink: #f2f0ea;
15
+ --dim: #8d8c93;
16
+ --line: #26262c;
17
+ --accent: #ffd60a;
18
+ --display: "Anton", "Bebas Neue", Impact, "Arial Narrow", sans-serif;
19
+ --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
20
+ --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
21
+ }
22
+ html, body { height: 100%; }
23
+ body {
24
+ background: var(--bg); color: var(--ink); font-family: var(--body);
25
+ padding-left: max(16px, env(safe-area-inset-left, 0px));
26
+ padding-right: max(16px, env(safe-area-inset-right, 0px));
27
+ padding-block: 20px 28px;
28
+ }
29
+ .wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 14px; }
30
+ .top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; }
31
+ .name { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 4vw, 40px); letter-spacing: 0.02em; text-transform: uppercase; margin: 0; line-height: 1; }
32
+ .name em { font-family: var(--serif); font-style: italic; text-transform: none; color: var(--accent); letter-spacing: 0; font-size: 1.12em; }
33
+ .meta { color: var(--dim); font-size: 14px; margin: 0; }
34
+ .stage { position: relative; aspect-ratio: 720 / 1280; width: min(100%, calc(74vh * 720 / 1280)); max-width: 100%; margin-inline: auto; background: #000; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
35
+ .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
36
+ .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
37
+ .bar button, .bar label.btn {
38
+ font: 600 14px var(--body); color: var(--ink); background: transparent; border: 1px solid var(--line);
39
+ border-radius: 7px; padding: 8px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
40
+ }
41
+ .bar button:hover, .bar label.btn:hover { border-color: var(--dim); }
42
+ .bar button:focus-visible, .bar label.btn:focus-within, #scrub:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
43
+ .bar button[aria-pressed="true"] { background: var(--accent); color: #0b0b0d; border-color: var(--accent); }
44
+ #play { min-width: 82px; justify-content: center; background: var(--ink); color: #0b0b0d; border-color: var(--ink); }
45
+ #scrub { flex: 1 1 220px; min-width: 0; accent-color: var(--accent); }
46
+ #time { font: 600 14px var(--body); font-variant-numeric: tabular-nums; color: var(--dim); min-width: 92px; text-align: right; }
47
+ #vofile, #footfile { position: absolute; width: 1px; height: 1px; opacity: 0; }
48
+ .note { color: var(--dim); font-size: 13px; margin: 0; max-width: 70ch; }
49
+ </style>
50
+
51
+ <div class="wrap">
52
+ <div class="top">
53
+ <h1 class="name">Cosmic <em>Scale</em></h1>
54
+ <p class="meta">Reference animation · 15.0 s · 720×1280 · drawn in code, sound synthesized</p>
55
+ </div>
56
+ <div class="stage"><canvas id="stage" width="720" height="1280" aria-label="Cosmic Scale reference animation"></canvas></div>
57
+ <div class="bar">
58
+ <button id="play" type="button">Play</button>
59
+ <input id="scrub" type="range" min="0" max="15" step="0.01" value="0" aria-label="Scrub timeline">
60
+ <span id="time">0.00 / 15.00</span>
61
+ <button id="sound" type="button" aria-pressed="true">Sound on</button>
62
+ <button id="loop" type="button" aria-pressed="true">Loop</button>
63
+ <label class="btn" for="vofile">Load voiceover<input id="vofile" type="file" accept="audio/*"></label>
64
+ </div>
65
+ <p class="note" id="vonote">Load a voiceover to play it in sync. The effects switch to a lighter mix under narration.</p>
66
+ </div>
67
+
68
+ <script>
69
+ // =====================================================================================================
70
+ // COSMIC SCALE · core helpers (CM), sound kit (SFX), library helpers, style, player
71
+ // Every frame is a pure function of t. All randomness is seeded. Times are seconds.
72
+ // =====================================================================================================
73
+ // =====================================================================================================
74
+ const CM = (() => {
75
+ const clamp = (v, a = 0, b = 1) => (v < a ? a : v > b ? b : v);
76
+ const lerp = (a, b, u) => a + (b - a) * u;
77
+ const span = (t, a, b) => clamp((t - a) / (b - a));
78
+ const rotl = (x, k) => (x << k) | (x >>> (32 - k));
79
+ const hash = (s) => { s = String(s); let h = 0x9e3779b1; for (let i = 0; i < s.length; i++) { h = Math.imul(h ^ s.charCodeAt(i), 0x85ebca6b); h ^= h >>> 13; } return h >>> 0; };
80
+ // xoshiro128** style generator, seeded from a number or string
81
+ const rng = (seed) => {
82
+ const s = typeof seed === 'number' ? seed >>> 0 : hash(seed);
83
+ let a = (s ^ 0xa5a5a5a5) >>> 0, b = (Math.imul(s, 0x27d4eb2d) >>> 0) || 1, c = (0x165667b1 ^ s) >>> 0, d = (rotl(s, 7) >>> 0) || 7;
84
+ const r = () => { const res = Math.imul(rotl(Math.imul(b, 5), 7), 9) >>> 0; const t = b << 9; c ^= a; d ^= b; b ^= c; a ^= d; c ^= t; d = rotl(d, 11); return res / 4294967296; };
85
+ for (let i = 0; i < 8; i++) r();
86
+ r.in = (lo, hi) => lo + r() * (hi - lo);
87
+ r.pick = (arr) => arr[(r() * arr.length) | 0];
88
+ return r;
89
+ };
90
+ // smooth 1D value noise, roughly -1..1
91
+ const noise1 = (seed) => { const r = rng(seed), v = Float32Array.from({ length: 256 }, () => r() * 2 - 1); return (x) => { const i = Math.floor(x), f = x - i, u = f * f * (3 - 2 * f); return lerp(v[i & 255], v[(i + 1) & 255], u); }; };
92
+ const ez = {
93
+ out3: (u) => 1 - Math.pow(1 - u, 3),
94
+ in3: (u) => u * u * u,
95
+ inout3: (u) => (u < 0.5 ? 4 * u * u * u : 1 - Math.pow(-2 * u + 2, 3) / 2),
96
+ outExpo: (u) => (u >= 1 ? 1 : 1 - Math.pow(2, -10 * u)),
97
+ back: (u, s = 1.7) => (u <= 0 ? 0 : u >= 1 ? 1 : 1 + (s + 1) * Math.pow(u - 1, 3) + s * Math.pow(u - 1, 2)),
98
+ spring: (u) => (u <= 0 ? 0 : u >= 1 ? 1 : 1 - Math.exp(-6 * u) * Math.cos(13 * u)),
99
+ };
100
+ const layer = (w, h) => { const c = document.createElement('canvas'); c.width = w; c.height = h; return c; };
101
+ return { clamp, lerp, span, hash, rng, noise1, ez, layer };
102
+ })();
103
+
104
+ // =====================================================================================================
105
+ // SFX: synthesized creator-edit sound kit. Plain Web Audio, no files.
106
+ // voiceover mode keeps the music low under narration and plays sounds marked `soft` at 55%.
107
+ // =====================================================================================================
108
+ const SFX = (() => {
109
+ const SEMI = { C: -9, D: -7, E: -5, F: -4, G: -2, A: 0, B: 2 };
110
+ const hz = (n) => { if (typeof n === 'number') return n; const m = /^([A-G])(#|b)?(-?\d)$/.exec(n); return 440 * Math.pow(2, (SEMI[m[1]] + (m[2] === '#' ? 1 : m[2] === 'b' ? -1 : 0) + (+m[3] - 4) * 12) / 12); };
111
+
112
+ function kit(ac, o = {}) {
113
+ const VO = !!o.voiceover, SR = ac.sampleRate, T0 = o.from || 0, base = ac.currentTime + (o.lead || 0);
114
+ // snap every start a little past the sample grid (avoids level spikes on some browsers)
115
+ const at = (t) => (Math.round((base + (t - T0)) * SR) + 0.3) / SR;
116
+ const skip = (t, dur) => at(t) + dur < ac.currentTime || (t < T0 - 0.005 && dur < 1.2);
117
+
118
+ const comp = ac.createDynamicsCompressor();
119
+ comp.threshold.value = -14; comp.knee.value = 6; comp.ratio.value = 4; comp.attack.value = 0.003; comp.release.value = 0.15;
120
+ const master = ac.createGain(); master.gain.value = o.master == null ? 0.85 : o.master;
121
+ comp.connect(master); master.connect(o.dest || ac.destination);
122
+ const mk = (g) => { const n = ac.createGain(); n.gain.value = g; n.connect(comp); return n; };
123
+ const bus = { fx: mk(VO ? 0.78 : 0.95), music: mk(VO ? 0.3 : 0.62), amb: mk(0.45) };
124
+ const duckIn = ac.createGain(); duckIn.connect(bus.music);
125
+ const DUCKS = [];
126
+
127
+ // generated plate-style reverb
128
+ const verb = ac.createConvolver();
129
+ { const n = Math.floor(1.5 * SR), ir = ac.createBuffer(2, n, SR);
130
+ for (let ch = 0; ch < 2; ch++) { const r = CM.rng('plate' + ch), d = ir.getChannelData(ch); let lp = 0; for (let i = 0; i < n; i++) { const u = i / n; lp += (0.7 - 0.5 * u) * ((r() * 2 - 1) - lp); d[i] = lp * Math.pow(1 - u, 2.6) * 0.9; } }
131
+ verb.buffer = ir; }
132
+ const verbIn = ac.createGain(); verbIn.gain.value = 0.8; verbIn.connect(verb); verb.connect(comp);
133
+
134
+ // seeded noise buffers
135
+ const NB = {};
136
+ { const n = Math.floor(2 * SR);
137
+ for (const kind of ['white', 'pink', 'brown']) {
138
+ const b = ac.createBuffer(1, n, SR), d = b.getChannelData(0), r = CM.rng('nz' + kind); let b0 = 0, b1 = 0, b2 = 0, br = 0;
139
+ for (let i = 0; i < n; i++) { const w = r() * 2 - 1;
140
+ if (kind === 'white') d[i] = w;
141
+ else if (kind === 'pink') { b0 = 0.99765 * b0 + w * 0.099; b1 = 0.963 * b1 + w * 0.2965; b2 = 0.57 * b2 + w * 1.0527; d[i] = (b0 + b1 + b2 + w * 0.1848) * 0.18; }
142
+ else { br = (br + 0.02 * w) / 1.02; d[i] = br * 3.4; } }
143
+ NB[kind] = b; } }
144
+
145
+ const ramp = (param, v, t) => { if (!Array.isArray(v)) { param.setValueAtTime(v, t); return; } param.setValueAtTime(v[0][1], t + v[0][0]); for (let i = 1; i < v.length; i++) param.exponentialRampToValueAtTime(Math.max(1e-3, v[i][1]), t + v[i][0]); };
146
+ const env = (g, t, peak, dur, a = 0.004, hold = 0) => {
147
+ a = Math.min(a, dur * 0.9); hold = Math.min(hold, dur - a);
148
+ g.gain.setValueAtTime(0, t); g.gain.linearRampToValueAtTime(peak, t + a);
149
+ if (hold > 0) g.gain.setValueAtTime(peak, t + a + hold);
150
+ g.gain.exponentialRampToValueAtTime(1e-4, t + dur); g.gain.setValueAtTime(0, t + dur + 0.002);
151
+ };
152
+ const level = (p, d) => (p.gain == null ? d : p.gain) * (VO && p.soft ? 0.55 : 1);
153
+ const route = (node, p, t) => {
154
+ const pan = ac.createStereoPanner();
155
+ if (Array.isArray(p.pan)) { pan.pan.setValueAtTime(p.pan[0], t); pan.pan.linearRampToValueAtTime(p.pan[1], t + (p.dur || 0.2)); } else pan.pan.value = CM.clamp(p.pan || 0, -1, 1);
156
+ node.connect(pan); pan.connect(p.bus === 'music' ? duckIn : bus[p.bus || 'fx']);
157
+ if (p.verb) { const s = ac.createGain(); s.gain.value = p.verb; pan.connect(s); s.connect(verbIn); }
158
+ };
159
+ const filt = (p, t) => { if (!p.filter) return null; const f = ac.createBiquadFilter(); f.type = p.filter; f.Q.value = p.q == null ? 0.9 : p.q; ramp(f.frequency, p.ff == null ? 1200 : p.ff, t); return f; };
160
+
161
+ // primitive: oscillator voice. f may be a value or [[dt, hz], ...]
162
+ function voice(time, p) {
163
+ const dur = p.dur || 0.2; if (skip(time, dur)) return; const t = at(time);
164
+ const osc = ac.createOscillator(); osc.type = p.type || 'sine';
165
+ ramp(osc.frequency, Array.isArray(p.f) ? p.f.map(([d, v]) => [d, hz(v)]) : hz(p.f || 440), t);
166
+ const g = ac.createGain(); env(g, t, level(p, 0.3), dur, p.a, p.hold);
167
+ const f = filt(p, t); if (f) { osc.connect(f); f.connect(g); } else osc.connect(g);
168
+ route(g, p, t); osc.start(t); osc.stop(t + dur + 0.03);
169
+ }
170
+ // primitive: noise voice
171
+ function hiss(time, p) {
172
+ const dur = p.dur || 0.2; if (skip(time, dur)) return; const t = at(time);
173
+ const src = ac.createBufferSource(); src.buffer = NB[p.color || 'white']; src.loop = true; if (p.rate) src.playbackRate.value = p.rate;
174
+ const g = ac.createGain(); env(g, t, level(p, 0.3), dur, p.a, p.hold);
175
+ const f = filt(p, t); if (f) { src.connect(f); f.connect(g); } else src.connect(g);
176
+ route(g, p, t); src.start(t, CM.rng('off' + time)() * 1.5); src.stop(t + dur + 0.03);
177
+ }
178
+ function duck(t, depth = 0.5, hold = 0.25) { DUCKS.push({ t, depth, hold }); }
179
+
180
+ // ---------------- named sounds (creator-edit palette) ----------------
181
+ const S = {
182
+ // text slam: a tight low thump with a short papery crack
183
+ slam: (t, o) => { voice(t, { f: [[0, 150], [0.12, 52]], dur: 0.2, gain: 0.42 * o.g, pan: o.pan, soft: o.soft }); hiss(t, { dur: 0.07, filter: 'lowpass', ff: 2600, gain: 0.22 * o.g, pan: o.pan, soft: o.soft }); hiss(t, { dur: 0.012, filter: 'highpass', ff: 5000, gain: 0.12 * o.g, pan: o.pan, soft: o.soft }); },
184
+ // big drop: sub boom with a dark tail
185
+ boom: (t, o) => { voice(t, { f: [[0, 90], [0.08, 52], [1.6, 34]], dur: 1.7, gain: 0.7 * o.g, a: 0.006, hold: 0.12 }); hiss(t, { color: 'brown', dur: 0.6, filter: 'lowpass', ff: [[0, 600], [0.5, 90]], gain: 0.35 * o.g, verb: 0.3 }); duck(t, 0.7, 0.35); },
186
+ pop: (t, o) => { const f = o.f || 760; voice(t, { f: [[0, f * 1.7], [0.05, f]], dur: 0.08, gain: 0.22 * o.g, pan: o.pan, soft: o.soft }); hiss(t, { dur: 0.01, filter: 'highpass', ff: 4500, gain: 0.08 * o.g, pan: o.pan, soft: o.soft }); },
187
+ tick: (t, o) => hiss(t, { dur: 0.016, filter: 'bandpass', ff: o.f || 3800, q: 3, gain: 0.32 * o.g, pan: o.pan, soft: o.soft }),
188
+ click: (t, o) => { hiss(t, { dur: 0.012, filter: 'bandpass', ff: 3200, q: 2, gain: 0.35 * o.g, pan: o.pan }); hiss(t + 0.045, { dur: 0.01, filter: 'bandpass', ff: 2400, q: 2, gain: 0.22 * o.g, pan: o.pan }); },
189
+ whoosh: (t, o) => { const d = o.dur || 0.35, dir = o.dir || 1; hiss(t, { color: 'pink', dur: d, filter: 'bandpass', ff: [[0, 260], [d * 0.55, o.top || 3200], [d, 520]], q: 0.75, gain: 0.5 * o.g, a: d * 0.55, pan: [-0.7 * dir, 0.7 * dir], verb: 0.12, soft: o.soft }); hiss(t + d * 0.2, { dur: d * 0.6, filter: 'highpass', ff: [[0, 3000], [d * 0.6, 7000]], gain: 0.08 * o.g, a: d * 0.3, pan: [-0.4 * dir, 0.5 * dir], soft: o.soft }); },
190
+ riser: (t, o) => { const d = o.dur || 0.8; hiss(t, { color: 'pink', dur: d, filter: 'bandpass', ff: [[0, 300], [d, 5200]], q: 1.1, gain: 0.32 * o.g, a: d * 0.96, verb: 0.2, soft: o.soft }); voice(t, { type: 'sawtooth', f: [[0, 110], [d, 440]], dur: d, gain: 0.06 * o.g, a: d * 0.95, filter: 'lowpass', ff: [[0, 400], [d, 2400]], soft: o.soft }); },
191
+ glitch: (t, o) => { const r = CM.rng('gl' + t); for (let i = 0; i < 9; i++) voice(t + i * 0.021, { type: 'square', f: 180 + r() * 2200, dur: 0.018, gain: 0.07 * o.g, a: 0.001, hold: 0.012, pan: r() * 1.4 - 0.7 }); hiss(t, { dur: 0.2, filter: 'bandpass', ff: [[0, 4000], [0.2, 900]], q: 0.7, gain: 0.18 * o.g }); hiss(t + 0.1, { dur: 0.05, color: 'brown', gain: 0.25 * o.g }); },
192
+ ping: (t, o) => { voice(t, { f: 'E6', dur: 0.5, gain: 0.16 * o.g, a: 0.003, verb: 0.3, pan: o.pan }); voice(t + 0.11, { f: 'B6', dur: 0.7, gain: 0.14 * o.g, a: 0.003, verb: 0.35, pan: o.pan }); },
193
+ send: (t, o) => { voice(t, { f: [[0, 520], [0.11, 1500]], dur: 0.13, gain: 0.14 * o.g, pan: o.pan }); hiss(t, { dur: 0.1, filter: 'highpass', ff: [[0, 2000], [0.1, 6000]], gain: 0.07 * o.g, pan: o.pan }); },
194
+ keys: (t, o) => { const r = CM.rng('k' + t), end = t + (o.dur || 0.4); for (let x = t; x < end; x += 0.055 + r() * 0.035) { hiss(x, { dur: 0.014, filter: 'bandpass', ff: 3200 + r() * 900, q: 3, gain: 0.2 * o.g, pan: o.pan, soft: true }); voice(x, { f: 1900 + r() * 300, dur: 0.012, gain: 0.025 * o.g, pan: o.pan, soft: true }); } },
195
+ // highlighter / marker swipe: grainy felt drag
196
+ marker: (t, o) => { const d = o.dur || 0.25, r = CM.rng('m' + t); for (let x = 0; x < d; x += 0.022 + r() * 0.012) hiss(t + x, { dur: 0.03, filter: 'bandpass', ff: 1700 + r() * 900, q: 1.4, gain: 0.16 * o.g * (0.6 + r() * 0.5), pan: o.pan, soft: o.soft }); },
197
+ strike: (t, o) => { hiss(t, { dur: 0.15, filter: 'bandpass', ff: [[0, 1200], [0.15, 3200]], q: 1.2, gain: 0.3 * o.g, a: 0.02, pan: o.pan }); },
198
+ tapeStop: (t, o) => { voice(t, { type: 'sawtooth', f: [[0, 196], [0.62, 18]], dur: 0.66, gain: 0.22 * o.g, a: 0.004, hold: 0.3, filter: 'lowpass', ff: [[0, 1800], [0.6, 160]] }); voice(t, { f: [[0, 98], [0.62, 12]], dur: 0.66, gain: 0.3 * o.g, a: 0.004, hold: 0.3 }); hiss(t, { color: 'brown', dur: 0.5, filter: 'lowpass', ff: [[0, 900], [0.5, 120]], gain: 0.18 * o.g }); },
199
+ stamp: (t, o) => { voice(t, { f: [[0, 160], [0.18, 48]], dur: 0.28, gain: 0.6 * o.g }); hiss(t, { dur: 0.06, filter: 'bandpass', ff: 1300, q: 1.1, gain: 0.4 * o.g }); hiss(t + 0.004, { dur: 0.014, filter: 'highpass', ff: 4200, gain: 0.25 * o.g }); },
200
+ shimmer: (t, o) => { ['C6', 'E6', 'G6', 'B6', 'D7', 'E7'].forEach((n, i) => voice(t + i * 0.035, { f: n, dur: 0.75, gain: 0.045 * o.g, a: 0.003, verb: 0.45, pan: (i % 2 ? 0.35 : -0.35) })); },
201
+ sparkle: (t, o) => { const r = CM.rng('sp' + t); for (let i = 0; i < 5; i++) voice(t + i * 0.05, { f: 2400 + r() * 2400, dur: 0.25, gain: 0.03 * o.g, a: 0.002, verb: 0.4, pan: r() * 1.2 - 0.6 }); },
202
+ };
203
+ function play(name, t, opts = {}) { const fn = S[name]; if (!fn) throw new Error('unknown sound ' + name); fn(t, Object.assign({}, opts, { g: opts.gain == null ? 1 : opts.gain })); }
204
+
205
+ // ---------------- music: half-time beat with bass and soft pad ----------------
206
+ function music(t0, t1, p = {}) {
207
+ const bpm = p.bpm || 98, step = 60 / bpm / 4, bar = step * 16, g = p.gain == null ? 1 : p.gain;
208
+ const roots = p.roots || ['A1', 'F1', 'C2', 'G1'];
209
+ const pads = p.pads || [['A3', 'C4', 'E4'], ['F3', 'A3', 'C4'], ['C4', 'E4', 'G4'], ['G3', 'B3', 'D4']];
210
+ let bi = 0;
211
+ for (let tb = t0; tb < t1 - 0.05; tb += bar, bi++) {
212
+ const root = roots[bi % roots.length], pad = pads[bi % pads.length], blen = Math.min(bar, t1 - tb);
213
+ pad.forEach((n, k) => voice(tb, { type: 'triangle', f: n, dur: blen + 0.2, gain: 0.03 * g, a: 0.3, hold: blen - 0.5, filter: 'lowpass', ff: 1100, pan: (k - 1) * 0.35, verb: 0.3, bus: 'music' }));
214
+ for (let s = 0; s < 16; s++) {
215
+ const ts = tb + s * step; if (ts >= t1 - 0.02) break;
216
+ if (s === 0 || s === 10) { voice(ts, { f: [[0, 150], [0.09, 46]], dur: 0.32, gain: 0.5 * g, bus: 'music' }); hiss(ts, { dur: 0.012, filter: 'highpass', ff: 3000, gain: 0.05 * g, bus: 'music' }); }
217
+ if (s === 4 || s === 12) { hiss(ts, { dur: 0.16, filter: 'bandpass', ff: 1700, q: 0.8, gain: 0.26 * g, verb: 0.25, bus: 'music' }); hiss(ts + 0.008, { dur: 0.05, filter: 'highpass', ff: 4500, gain: 0.1 * g, bus: 'music' }); }
218
+ if (s % 2 === 0) hiss(ts, { dur: s % 4 === 2 ? 0.05 : 0.028, filter: 'highpass', ff: 7500, gain: (s % 4 === 2 ? 0.06 : 0.035) * g, bus: 'music' });
219
+ if ([0, 3, 6, 10, 14].includes(s)) voice(ts, { type: 'triangle', f: root, dur: step * 2.6, gain: 0.2 * g, a: 0.006, hold: step, filter: 'lowpass', ff: 380, bus: 'music' });
220
+ }
221
+ }
222
+ }
223
+ function drone(t0, t1, p = {}) { const d = t1 - t0, g = p.gain == null ? 1 : p.gain; voice(t0, { f: p.note || 'A1', dur: d, gain: 0.12 * g, a: d * 0.4, hold: d * 0.4, bus: 'music' }); hiss(t0, { color: 'pink', dur: d, filter: 'bandpass', ff: 900, q: 0.5, gain: 0.03 * g, a: d * 0.5, hold: d * 0.3, bus: 'amb' }); }
224
+ function finish() {
225
+ DUCKS.sort((a, b) => a.t - b.t);
226
+ for (const e of DUCKS) { const s = at(e.t); if (s + e.hold < ac.currentTime) continue; duckIn.gain.setTargetAtTime(1 - e.depth, Math.max(s, ac.currentTime), 0.008); duckIn.gain.setTargetAtTime(1, s + e.hold, 0.14); }
227
+ }
228
+ return { play, voice, hiss, music, drone, duck, finish, hz, vo: VO };
229
+ }
230
+ function live(score, from, opts = {}) {
231
+ const ac = new (window.AudioContext || window.webkitAudioContext)();
232
+ const k = kit(ac, Object.assign({}, opts, { from: from || 0, lead: 0.04 })); score(k); k.finish();
233
+ return () => { try { ac.close(); } catch (e) {} };
234
+ }
235
+ async function render(score, dur, sr = 48000, opts = {}) {
236
+ const len = Math.ceil(dur * sr), ac = new OfflineAudioContext(2, len, sr);
237
+ const k = kit(ac, Object.assign({}, opts, { from: 0 })); score(k); k.finish();
238
+ const buf = await ac.startRendering(), L = buf.getChannelData(0), R = buf.getChannelData(1), inter = new Float32Array(len * 2);
239
+ let peak = 0; for (let i = 0; i < len; i++) { inter[2 * i] = L[i]; inter[2 * i + 1] = R[i]; peak = Math.max(peak, Math.abs(L[i]), Math.abs(R[i])); }
240
+ return { inter, peak, sr, frames: len };
241
+ }
242
+ return { kit, live, render, hz };
243
+ })();
244
+
245
+ const STYLE = { name: 'Cosmic Scale', em: 'Scale', W: 720, H: 1280, three: true, footage: false, poster: 12.0,
246
+ fonts: 'family=Space+Grotesk:wght@500;700&family=JetBrains+Mono:wght@500;700',
247
+ loads: ['700 60px "Space Grotesk"', '500 30px "Space Grotesk"', '500 22px "JetBrains Mono"', '700 22px "JetBrains Mono"'],
248
+ cat: { family: '3D', fontsText: 'Space Grotesk (500 and 700), JetBrains Mono (500 and 700), Three.js r128',
249
+ look: 'Planets and stars at their true relative sizes in a deep starfield, built in Three.js with textures painted in code, and a camera that pulls back in big log-scale moves to reveal the scale.',
250
+ how: 'It starts close on something familiar, then each beat the camera pulls back by a power of ten so the next, bigger object slides into frame beside it. Every body gets a thin label with its real size, and the final reveal lands with a boom and a big counter.',
251
+ demo: 'How big is the Sun?',
252
+ replace: 'TL, BODIES (names, real radii, positions, painted textures), the CAM keyframes, the labels and counter in overlay() and scoreSound()',
253
+ keep: 'makeGL(), the painted canvas textures (paintTex), the starfield, the log-scale camera track (camAt), proj3() labels that only show when a body is big enough, the sun glow pass, chip(), wordLine() and grain()',
254
+ sizes: 'keep headlines at 56 px or more, labels at 22 px or more and the counter at 90 px or more',
255
+ voLine: 'Each pull-back starts about 0.3 s before the next object is named, its label lands on its name, and the reveal of the biggest object lands on the stressed word.',
256
+ full: '- Full mix (no voiceover): keep the deep drone, at most about 3 sounds at once, and a moment of near-silence before the big reveal.',
257
+ voMix: '- Voiceover mix: the player calls SFX.live with { voiceover: true } once narration is loaded. Keep the drone very low, mark label pings soft: true and keep the boom for the single reveal.',
258
+ sheet: [
259
+ 'Sizes are real: every body uses its true radius relative to the others (Earth = 1 unit), lined up side by side. Never fake a ratio; let tiny things be tiny and point them out with a ring and a label.',
260
+ 'Every surface is painted in code on a canvas (paintTex): oceans and continents, gas bands, craters, granulated plasma. No photos or downloaded textures.',
261
+ 'The camera moves on a log scale (camAt keys hold the log of the distance), so each pull-back feels like the same size of jump. Stars stay fixed far away so the motion reads as scale, not travel.',
262
+ 'Palette: black space (#02030a), white stars, warm sun orange (#ffb347 to #ff7a12) with a soft screen-blended glow, cool label blue (#bfe1ff). One warm accent (#ffcf8a) for the second headline line.',
263
+ 'Type: Space Grotesk 700 headlines at the top, JetBrains Mono labels with the real size, a dashed ring around anything smaller than a few pixels.',
264
+ 'Pace: hold the familiar object for 2 to 3 seconds, then one pull-back every 1.5 to 2.5 seconds, and hold the final reveal for about 3 seconds.',
265
+ ],
266
+ sound: [
267
+ 'Bed: a deep, slow drone with a filtered pad; no beat.',
268
+ 'Map events to the kit: every pull-back gets a long, low "whoosh"; each label gets a soft ping; the final reveal gets "riser" into "boom"; the counter "tick"s only when the shown number changes; the takeaway gets "shimmer".',
269
+ ] } };
270
+ const W = STYLE.W, H = STYLE.H;
271
+
272
+ // =====================================================================================================
273
+ // SHARED LIBRARY HELPERS (Style Library, Shorts set). Pure functions of t; all randomness seeded.
274
+ // W and H are the canvas size (set from STYLE). Coordinates are canvas pixels.
275
+ // =====================================================================================================
276
+ const { clamp, lerp, span, rng, noise1, ez } = CM;
277
+ const TAU = Math.PI * 2;
278
+ const rr = (c, x, y, w, h, r) => { c.beginPath(); c.roundRect(x, y, w, h, r); };
279
+ const lg = (c, x0, y0, x1, y1, stops) => { const g = c.createLinearGradient(x0, y0, x1, y1); stops.forEach(([o, col]) => g.addColorStop(o, col)); return g; };
280
+ const rg = (c, x, y, r0, r1, stops) => { const g = c.createRadialGradient(x, y, r0, x, y, r1); stops.forEach(([o, col]) => g.addColorStop(o, col)); return g; };
281
+ const fillAll = (c, f) => { c.fillStyle = f; c.fillRect(0, 0, W, H); };
282
+ // keyframe track: K = [[t, v1, v2, ...], ...], eased in-out between keys
283
+ function track(K, t, e = ez.inout3) {
284
+ if (t <= K[0][0]) return K[0].slice(1);
285
+ for (let i = 0; i < K.length - 1; i++) { const a = K[i], b = K[i + 1]; if (t <= b[0]) { const u = e((t - a[0]) / Math.max(1e-6, b[0] - a[0])); return a.slice(1).map((v, j) => lerp(v, b[j + 1], u)); } }
286
+ return K[K.length - 1].slice(1);
287
+ }
288
+ const textW = (c, s, font, ls = 0) => { c.save(); c.font = font; c.letterSpacing = ls + 'px'; const w = c.measureText(s).width; c.restore(); return w; };
289
+ const pxOf = (font) => parseFloat(/(\d+(?:\.\d+)?)px/.exec(font)[1]);
290
+ // text with options: a (align), b (baseline), ls (letter spacing), r (rotation), alpha, glow/gb, st/sw (stroke under fill), s (scale)
291
+ function txt(c, s, x, y, o = {}) {
292
+ c.save(); c.font = o.f || '700 40px Inter'; c.textAlign = o.a || 'left'; c.textBaseline = o.b || 'alphabetic'; c.letterSpacing = (o.ls || 0) + 'px';
293
+ c.translate(x, y); if (o.r) c.rotate(o.r); if (o.s != null) c.scale(o.s, o.s); if (o.alpha != null) c.globalAlpha *= o.alpha;
294
+ if (o.glow) { c.shadowColor = o.glow; c.shadowBlur = o.gb || 24; }
295
+ if (o.st) { c.lineJoin = 'round'; c.lineWidth = o.sw || 10; c.strokeStyle = o.st; c.strokeText(s, 0, 0); if (!o.glow) c.shadowColor = 'transparent'; }
296
+ if (o.c !== null) { c.fillStyle = o.c || '#fff'; c.fillText(s, 0, 0); }
297
+ c.restore();
298
+ }
299
+ // rounded label; returns its width. a: 'left' | 'center' | 'right' anchor at x; y is the top
300
+ function chip(c, s, x, y, o = {}) {
301
+ const f = o.f || '700 24px Inter', px = o.px == null ? pxOf(f) * 0.75 : o.px, h = o.h || pxOf(f) * 1.9, w = textW(c, s, f, o.ls || 0) + px * 2;
302
+ const x0 = o.a === 'center' ? x - w / 2 : o.a === 'right' ? x - w : x;
303
+ c.save(); if (o.alpha != null) c.globalAlpha *= o.alpha; if (o.shadow) { c.shadowColor = o.shadow; c.shadowBlur = o.sb || 24; c.shadowOffsetY = 8; }
304
+ rr(c, x0, y, w, h, o.r == null ? h / 2 : o.r); c.fillStyle = o.bg || '#fff'; c.fill(); c.shadowColor = 'transparent';
305
+ if (o.stroke) { c.strokeStyle = o.stroke; c.lineWidth = o.sw || 2; c.stroke(); }
306
+ txt(c, s, x0 + px, y + h / 2 + pxOf(f) * 0.05, { f, c: o.fg || '#111', b: 'middle', ls: o.ls }); c.restore(); return w;
307
+ }
308
+ // ---------- animation primitives ----------
309
+ const pop = (t, t0, d = 0.45, s = 1.9) => ez.back(span(t, t0, t0 + d), s);
310
+ const inn = (t, t0, d = 0.5) => ez.outExpo(span(t, t0, t0 + d));
311
+ const out = (t, t0, d = 0.35) => 1 - ez.in3(span(t, t0, t0 + d));
312
+ const typed = (full, t, a, b) => full.slice(0, Math.floor(full.length * span(t, a, b) + 1e-6));
313
+ const count = (v0, v1, t, a, b, e = ez.out3) => lerp(v0, v1, e(span(t, a, b)));
314
+ const pulse = (t, t0, d = 0.6) => { const u = (t - t0) / d; return u < 0 || u > 1 ? 0 : Math.sin(Math.PI * u); };
315
+ // a word slams in: big, blurred and transparent, settling with an expo ease
316
+ function slam(c, s, x, y, font, color, t0, t, o = {}) {
317
+ if (t < t0) return textW(c, s, font, o.ls || 0); const u = span(t, t0, t0 + (o.dur || 0.28)), e = ez.outExpo(u), sc = lerp(o.from || 1.9, 1, e);
318
+ c.save(); if (u < 1 && !o.noBlur) c.filter = `blur(${(1 - e) * 10}px)`;
319
+ txt(c, s, x, y, Object.assign({}, o, { f: font, c: color, s: sc * (o.s || 1), alpha: Math.min(1, e * 2.2) * (o.alpha == null ? 1 : o.alpha) })); c.restore();
320
+ return textW(c, s, font, o.ls || 0);
321
+ }
322
+ // a word rises from behind a mask line
323
+ function rise(c, s, x, y, font, color, t0, t, o = {}) {
324
+ const w = textW(c, s, font, o.ls || 0); if (t < t0) return w;
325
+ const px = pxOf(font), X = o.a === 'center' ? x - w / 2 : o.a === 'right' ? x - w : x, e = ez.outExpo(span(t, t0, t0 + (o.dur || 0.5)));
326
+ c.save(); c.beginPath(); c.rect(X - 20, y - px * 1.05, w + 40, px * 1.38); c.clip();
327
+ txt(c, s, X, y + (1 - e) * px * 1.0, { f: font, c: color, ls: o.ls, alpha: Math.min(1, e * 1.6) * (o.alpha == null ? 1 : o.alpha), st: o.st, sw: o.sw, glow: o.glow });
328
+ c.restore(); return w;
329
+ }
330
+ // words: [[text, t0, color?]]; kind: 'rise' | 'slam' | 'pop' | 'fade'; returns word boxes
331
+ function wordLine(c, words, x, y, font, color, t, o = {}) {
332
+ const sp = textW(c, ' ', font, o.ls || 0) * (o.space || 1), ws = words.map(([s]) => textW(c, s, font, o.ls || 0)), tot = ws.reduce((a, b) => a + b, 0) + sp * (words.length - 1);
333
+ let cx = o.a === 'center' ? x - tot / 2 : o.a === 'right' ? x - tot : x; const boxes = [];
334
+ words.forEach(([s, t0, col], i) => {
335
+ boxes.push({ x: cx, w: ws[i], y, t0 }); const k = o.kind || 'rise', cl = col || color;
336
+ if (k === 'slam') slam(c, s, cx + ws[i] / 2, y, font, cl, t0, t, Object.assign({}, o, { a: 'center' }));
337
+ else if (k === 'pop') { const p = pop(t, t0, 0.35); if (p > 0) txt(c, s, cx + ws[i] / 2, y, Object.assign({}, o, { f: font, c: cl, a: 'center', s: p, alpha: Math.min(1, p * 2) })); }
338
+ else if (k === 'fade') { const p = inn(t, t0, 0.4); if (p > 0) txt(c, s, cx, y + (1 - p) * 14, Object.assign({}, o, { f: font, c: cl, a: 'left', alpha: p * (o.alpha == null ? 1 : o.alpha) })); }
339
+ else rise(c, s, cx, y, font, cl, t0, t, Object.assign({}, o, { a: 'left' }));
340
+ cx += ws[i] + sp;
341
+ });
342
+ return boxes;
343
+ }
344
+ // highlighter swipe behind a word box, grows from the left
345
+ function swipeBehind(c, box, font, p, color, o = {}) {
346
+ if (p <= 0) return; const px = pxOf(font), pad = o.pad == null ? px * 0.16 : o.pad, e = ez.outExpo(clamp(p));
347
+ c.save(); c.fillStyle = color; if (o.skew) { c.translate(box.x, box.y); c.transform(1, 0, -0.18, 1, 0, 0); c.translate(-box.x, -box.y); }
348
+ rr(c, box.x - pad, box.y - px * (o.top || 0.86), (box.w + pad * 2) * e, px * (o.hh || 1.08), o.r == null ? px * 0.14 : o.r); c.fill(); c.restore();
349
+ }
350
+ // ---------- drawing helpers ----------
351
+ function leader(c, x1, y1, x2, y2, col = '#fff', w = 2, p = 1) {
352
+ if (p <= 0) return; c.save(); c.strokeStyle = col; c.fillStyle = col; c.lineWidth = w; c.beginPath(); c.moveTo(x1, y1); c.lineTo(lerp(x1, x2, clamp(p)), lerp(y1, y2, clamp(p))); c.stroke();
353
+ c.beginPath(); c.arc(x1, y1, w * 2.4, 0, TAU); c.fill(); c.restore();
354
+ }
355
+ function arrowHead(c, x, y, ang, s, col) { c.save(); c.translate(x, y); c.rotate(ang); c.fillStyle = col; c.beginPath(); c.moveTo(0, 0); c.lineTo(-s, -s * 0.55); c.lineTo(-s * 0.72, 0); c.lineTo(-s, s * 0.55); c.closePath(); c.fill(); c.restore(); }
356
+ // hand-drawn polyline revealed to progress p (0..1); jitter is seeded and stable
357
+ function hd(c, pts, o = {}) {
358
+ const p = o.p == null ? 1 : clamp(o.p); if (p <= 0) return; const r = rng(o.seed || 1), j = o.j == null ? 2 : o.j;
359
+ const J = pts.map(() => [(r() - 0.5) * j * 2, (r() - 0.5) * j * 2, (r() - 0.5) * j * 2, (r() - 0.5) * j * 2]);
360
+ let L = 0; const seg = []; for (let i = 1; i < pts.length; i++) { const d = Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]); seg.push(d); L += d; }
361
+ c.save(); c.strokeStyle = o.col || '#111'; c.lineWidth = o.w || 4; c.lineCap = c.lineJoin = 'round'; if (o.alpha != null) c.globalAlpha *= o.alpha;
362
+ for (let pass = 0; pass < (o.passes || 2); pass++) {
363
+ let left = L * p; c.beginPath(); c.moveTo(pts[0][0] + J[0][pass * 2], pts[0][1] + J[0][pass * 2 + 1]);
364
+ for (let i = 1; i < pts.length && left > 0; i++) { const u = Math.min(1, left / seg[i - 1]); left -= seg[i - 1];
365
+ c.lineTo(lerp(pts[i - 1][0] + J[i - 1][pass * 2], pts[i][0] + J[i][pass * 2], u), lerp(pts[i - 1][1] + J[i - 1][pass * 2 + 1], pts[i][1] + J[i][pass * 2 + 1], u)); }
366
+ c.stroke(); c.lineWidth *= 0.6; }
367
+ c.restore();
368
+ }
369
+ const ellipsePts = (cx, cy, rx, ry, turns = 1.08, n = 48, a0 = -0.5) => Array.from({ length: n + 1 }, (_, i) => { const a = a0 + i / n * TAU * turns, k = 1 + 0.03 * Math.sin(i * 1.7) + i * 0.0015; return [cx + Math.cos(a) * rx * k, cy + Math.sin(a) * ry * k]; });
370
+ const quadPts = (a, q, b, n = 40) => Array.from({ length: n + 1 }, (_, i) => { const u = i / n, v = 1 - u; return [v * v * a[0] + 2 * v * u * q[0] + u * u * b[0], v * v * a[1] + 2 * v * u * q[1] + u * u * b[1]]; });
371
+ function polyPart(c, pts, p) { const n = Math.max(2, Math.ceil(pts.length * clamp(p))); c.beginPath(); pts.slice(0, n).forEach(([x, y], i) => (i ? c.lineTo(x, y) : c.moveTo(x, y))); }
372
+ function blob(c, cx, cy, r, seed, k = 0.28, n = 18, sq = 0.85) { const R = rng(seed), rs = Array.from({ length: n }, () => 1 + (R() - 0.5) * 2 * k); c.beginPath(); for (let i = 0; i <= n; i++) { const a = i / n * TAU, q = rs[i % n]; const x = cx + Math.cos(a) * r * q, y = cy + Math.sin(a) * r * q * sq; i ? c.lineTo(x, y) : c.moveTo(x, y); } c.closePath(); }
373
+ function star(c, x, y, r1, r2, n = 5, rot = -Math.PI / 2) { c.beginPath(); for (let i = 0; i < n * 2; i++) { const a = rot + i / (n * 2) * TAU, q = i % 2 ? r2 : r1; c.lineTo(x + Math.cos(a) * q, y + Math.sin(a) * q); } c.closePath(); }
374
+ // pre-baked grain tiles, stepped at 24 fps
375
+ const GRAIN = (() => { const tiles = []; for (let k = 0; k < 6; k++) { const L = CM.layer(256, 256), x = L.getContext('2d'), r = rng('grain' + k), d = x.createImageData(256, 256); for (let i = 0; i < d.data.length; i += 4) { const v = r() * 255; d.data[i] = d.data[i + 1] = d.data[i + 2] = v; d.data[i + 3] = 255; } x.putImageData(d, 0, 0); tiles.push(L); } return tiles; })();
376
+ function grain(c, t, a = 0.06, mode = 'overlay') { c.save(); c.globalAlpha = a; c.globalCompositeOperation = mode; const tile = GRAIN[Math.floor(t * 24) % 6], pat = c.createPattern(tile, 'repeat'), r = rng(Math.floor(t * 24)); c.translate(-r() * 256, -r() * 256); c.fillStyle = pat; c.fillRect(0, 0, W + 512, H + 512); c.restore(); }
377
+ function vignette(c, a = 0.5, inner = 0.3, outer = 0.8) { c.fillStyle = rg(c, W / 2, H / 2, Math.max(W, H) * inner, Math.max(W, H) * outer, [[0, 'rgba(0,0,0,0)'], [1, `rgba(0,0,0,${a})`]]); c.fillRect(0, 0, W, H); }
378
+ // a simple faceless presenter used as a stand-in for footage
379
+ function person(c, cx, by, s, o = {}) {
380
+ const sk = o.skin || '#d9a284', hr = o.hair || '#2a1d17', shirt = o.shirt || '#2f4b7c', tilt = o.tilt || 0;
381
+ c.save(); c.translate(cx, by); c.rotate(tilt * 0.02); c.translate(-cx, -by);
382
+ c.fillStyle = shirt; c.beginPath(); c.moveTo(cx - 128 * s, by); c.bezierCurveTo(cx - 124 * s, by - 96 * s, cx - 86 * s, by - 132 * s, cx - 34 * s, by - 142 * s); c.lineTo(cx + 34 * s, by - 142 * s); c.bezierCurveTo(cx + 86 * s, by - 132 * s, cx + 124 * s, by - 96 * s, cx + 128 * s, by); c.closePath(); c.fill();
383
+ c.fillStyle = 'rgba(0,0,0,.18)'; c.beginPath(); c.moveTo(cx - 24 * s, by - 142 * s); c.lineTo(cx, by - 112 * s); c.lineTo(cx + 24 * s, by - 142 * s); c.fill();
384
+ c.fillStyle = sk; rr(c, cx - 21 * s, by - 178 * s, 42 * s, 48 * s, 12 * s); c.fill();
385
+ const hy = by - 220 * s + (o.nod || 0) * s; c.beginPath(); c.ellipse(cx, hy, 45 * s, 56 * s, 0, 0, TAU); c.fill();
386
+ c.beginPath(); c.ellipse(cx - 45 * s, hy + 6 * s, 7 * s, 12 * s, 0, 0, TAU); c.ellipse(cx + 45 * s, hy + 6 * s, 7 * s, 12 * s, 0, 0, TAU); c.fill();
387
+ c.fillStyle = rg(c, cx + 26 * s, hy + 10 * s, 4 * s, 60 * s, [[0, 'rgba(0,0,0,0)'], [1, 'rgba(0,0,0,.22)']]); c.beginPath(); c.ellipse(cx, hy, 45 * s, 56 * s, 0, 0, TAU); c.fill();
388
+ c.fillStyle = hr; c.beginPath(); c.ellipse(cx, hy - 18 * s, 49 * s, 42 * s, 0, Math.PI * 0.98, Math.PI * 2.02); c.fill(); c.beginPath(); c.ellipse(cx + 8 * s, hy - 42 * s, 40 * s, 20 * s, -0.2, 0, TAU); c.fill();
389
+ c.restore();
390
+ }
391
+ // footage: your own clip when loaded (window.loadFootage), else a defocused room with a faceless presenter
392
+ const FOOT = { video: null };
393
+ function footage(c, x, y, w, h, t, o = {}) {
394
+ c.save(); rr(c, x, y, w, h, o.r || 0); c.clip();
395
+ const v = FOOT.video;
396
+ if (v && v.readyState >= 2) { const s = Math.max(w / v.videoWidth, h / v.videoHeight), z = o.zoom || 1; c.translate(x + w / 2, y + h / 2); c.scale(z, z); c.drawImage(v, -v.videoWidth * s / 2, -v.videoHeight * s / 2, v.videoWidth * s, v.videoHeight * s); c.restore(); return true; }
397
+ const z = o.zoom || 1; c.translate(x + w / 2, y + h / 2); c.scale(z, z); c.translate(-(x + w / 2), -(y + h / 2));
398
+ c.fillStyle = lg(c, x, y, x, y + h, [[0, o.bg ? o.bg[0] : '#5a6b7d'], [1, o.bg ? o.bg[1] : '#2a3340']]); c.fillRect(x, y, w, h);
399
+ const r = rng(o.seed || 5); c.filter = `blur(${Math.max(4, w / 90)}px)`;
400
+ c.fillStyle = o.win || 'rgba(255,240,210,.22)'; c.fillRect(x + w * 0.08, y + h * 0.1, w * 0.32, h * 0.42);
401
+ c.fillStyle = 'rgba(0,0,0,.16)'; c.fillRect(x + w * 0.62, y + h * 0.18, w * 0.3, h * 0.07); c.fillRect(x + w * 0.62, y + h * 0.33, w * 0.3, h * 0.07);
402
+ for (let i = 0; i < 14; i++) { const bx = x + r() * w, by2 = y + r() * h * 0.7, br = (0.02 + r() * 0.05) * w; c.fillStyle = rg(c, bx, by2, 0, br, [[0, o.bokeh || 'rgba(255,214,150,.5)'], [1, 'rgba(255,214,150,0)']]); c.beginPath(); c.arc(bx, by2, br, 0, TAU); c.fill(); }
403
+ c.filter = 'none';
404
+ const nod = Math.sin(t * 2.1) * 3 + Math.sin(t * 5.3) * 1.2, sway = Math.sin(t * 0.9) * 0.6;
405
+ person(c, x + w / 2 + (o.dx || 0) * w, y + h + (o.dy || 0) * h, (o.s || 1.25) * h / 1280 * 2, Object.assign({}, o, { nod, tilt: sway }));
406
+ c.fillStyle = rg(c, x + w / 2, y + h / 2, Math.min(w, h) * 0.3, Math.max(w, h) * 0.75, [[0, 'rgba(0,0,0,0)'], [1, 'rgba(0,0,0,.42)']]); c.fillRect(x, y, w, h);
407
+ c.restore(); return false;
408
+ }
409
+ // ---------- scene layers and cuts ----------
410
+ const LA = CM.layer(W, H), LB = CM.layer(W, H);
411
+ function sceneLayer(L, draw, t) { const x = L.getContext('2d'); x.setTransform(1, 0, 0, 1, 0, 0); x.globalAlpha = 1; x.globalCompositeOperation = 'source-over'; x.filter = 'none'; x.clearRect(0, 0, W, H); draw(x, t); return L; }
412
+ // cut types: push (dir), up, fade, zoom (x, y), whip (dir), flash (color), iris (x, y, color), glitch, wipe (color), page
413
+ function composite(ctx, t, SCENES, CUTS, background) {
414
+ ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over'; ctx.filter = 'none';
415
+ if (background) background(ctx, t);
416
+ let idx = 0; for (const c of CUTS) if (t >= c.t) idx++;
417
+ const cut = CUTS.find((c) => t >= c.t && t < c.t + c.d);
418
+ if (!cut) { ctx.drawImage(sceneLayer(LA, SCENES[idx], t), 0, 0); return; }
419
+ const u = (t - cut.t) / cut.d, e = ez.inout3(u), A = sceneLayer(LA, SCENES[idx - 1], t), B = sceneLayer(LB, SCENES[idx], t), dir = cut.dir || 1;
420
+ const ty = cut.type;
421
+ if (ty === 'push' || ty === 'up') {
422
+ const vx = ty === 'push', s = 1 - 0.04 * Math.sin(Math.PI * u), D = vx ? W : H;
423
+ for (const [L, off] of [[A, -e * D * dir], [B, (1 - e) * D * dir]]) { ctx.save(); ctx.translate(W / 2 + (vx ? off : 0), H / 2 + (vx ? 0 : off)); ctx.scale(s, s); ctx.drawImage(L, -W / 2, -H / 2); ctx.restore(); }
424
+ } else if (ty === 'whip') {
425
+ const L = u < 0.5 ? A : B, off = (u < 0.5 ? -ez.in3(u * 2) : 1 - ez.out3((u - 0.5) * 2)) * W * dir;
426
+ for (let i = 0; i < 7; i++) { ctx.save(); ctx.globalAlpha = 0.22; ctx.drawImage(L, off + (i - 3) * 26 * Math.sin(Math.PI * u) * dir, 0); ctx.restore(); }
427
+ } else if (ty === 'zoom') {
428
+ const z = lerp(1, 3.2, ez.in3(clamp(u / 0.65))); ctx.save(); ctx.globalAlpha = 1 - span(u, 0.38, 0.65); ctx.translate(cut.x, cut.y); ctx.scale(z, z); ctx.drawImage(A, -cut.x, -cut.y); ctx.restore();
429
+ const zb = lerp(1.15, 1, ez.out3(span(u, 0.35, 1))); ctx.save(); ctx.globalAlpha = span(u, 0.35, 0.72); ctx.translate(W / 2, H / 2); ctx.scale(zb, zb); ctx.drawImage(B, -W / 2, -H / 2); ctx.restore();
430
+ } else if (ty === 'flash') {
431
+ ctx.drawImage(u < 0.5 ? A : B, 0, 0); ctx.fillStyle = cut.color || '#fff'; ctx.globalAlpha = 1 - Math.abs(u - 0.5) * 2; ctx.fillRect(0, 0, W, H); ctx.globalAlpha = 1;
432
+ } else if (ty === 'iris') {
433
+ const cx = cut.x == null ? W / 2 : cut.x, cy = cut.y == null ? H / 2 : cut.y, R = Math.hypot(W, H);
434
+ if (u < 0.5) { const r = R * (1 - ez.in3(u * 2)); ctx.fillStyle = cut.color || '#111'; ctx.fillRect(0, 0, W, H); ctx.save(); ctx.beginPath(); ctx.arc(cx, cy, r, 0, TAU); ctx.clip(); ctx.drawImage(A, 0, 0); ctx.restore(); if (cut.ring) { ctx.strokeStyle = cut.ring; ctx.lineWidth = 14; ctx.beginPath(); ctx.arc(cx, cy, r, 0, TAU); ctx.stroke(); } }
435
+ else { const r = R * ez.out3((u - 0.5) * 2); ctx.fillStyle = cut.color || '#111'; ctx.fillRect(0, 0, W, H); ctx.save(); ctx.beginPath(); ctx.arc(cx, cy, r, 0, TAU); ctx.clip(); ctx.drawImage(B, 0, 0); ctx.restore(); if (cut.ring) { ctx.strokeStyle = cut.ring; ctx.lineWidth = 14; ctx.beginPath(); ctx.arc(cx, cy, r, 0, TAU); ctx.stroke(); } }
436
+ } else if (ty === 'glitch') {
437
+ const L = u < 0.5 ? A : B, r = rng('cut' + Math.floor(t * 30)); ctx.drawImage(L, 0, 0);
438
+ for (let i = 0; i < 9; i++) { const y = r() * H, h = 10 + r() * H * 0.06, dx = (r() - 0.5) * W * 0.18 * Math.sin(Math.PI * u); ctx.drawImage(L, 0, y, W, h, dx, y, W, h); }
439
+ ctx.globalCompositeOperation = 'screen'; ctx.globalAlpha = 0.5 * Math.sin(Math.PI * u); ctx.fillStyle = '#ff0040'; ctx.fillRect(0, 0, W, H); ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over';
440
+ } else if (ty === 'wipe') {
441
+ ctx.drawImage(A, 0, 0); const x = lerp(-W * 0.3, W * 1.3, e); ctx.save(); ctx.beginPath(); ctx.moveTo(x - H * 0.3, 0); ctx.lineTo(-10, 0); ctx.lineTo(-10, H); ctx.lineTo(x + H * 0.3 - H * 0.6, H); ctx.lineTo(x - H * 0.3 + 0, 0); ctx.closePath();
442
+ ctx.beginPath(); ctx.moveTo(-10, 0); ctx.lineTo(x, 0); ctx.lineTo(x - H * 0.35, H); ctx.lineTo(-10, H); ctx.closePath(); ctx.clip(); ctx.drawImage(B, 0, 0); ctx.restore();
443
+ if (cut.color) { ctx.save(); ctx.strokeStyle = cut.color; ctx.lineWidth = 26; ctx.beginPath(); ctx.moveTo(x, 0); ctx.lineTo(x - H * 0.35, H); ctx.stroke(); ctx.restore(); }
444
+ } else if (ty === 'page') {
445
+ ctx.drawImage(B, 0, 0); const x = W * (1 - e); ctx.save(); ctx.beginPath(); ctx.rect(0, 0, x, H); ctx.clip(); ctx.drawImage(A, 0, 0); ctx.restore();
446
+ ctx.fillStyle = lg(ctx, x - 60, 0, x + 40, 0, [[0, 'rgba(0,0,0,0)'], [0.6, 'rgba(0,0,0,0.25)'], [1, 'rgba(0,0,0,0)']]); ctx.fillRect(x - 60, 0, 100, H);
447
+ } else { ctx.save(); ctx.globalAlpha = 1 - e; ctx.drawImage(A, 0, 0); ctx.globalAlpha = e; ctx.drawImage(B, 0, 0); ctx.restore(); }
448
+ }
449
+ // camera: zoom z about (x, y), with optional rotation and shake
450
+ function cam(c, x, y, z = 1, rot = 0) { c.translate(x, y); c.scale(z, z); if (rot) c.rotate(rot); c.translate(-x, -y); }
451
+ function shake(c, t, hits, amp = 14, d = 0.35) { let dx = 0, dy = 0; for (const h of hits) { const u = (t - h) / d; if (u > 0 && u < 1) { const k = (1 - u) * amp; dx += Math.sin(u * 61) * k; dy += Math.cos(u * 47) * k; } } c.translate(dx, dy); }
452
+ function punch(t, hits, amt = 0.06, d = 0.45) { let z = 1; for (const h of hits) { const u = (t - h) / d; if (u > 0 && u < 1) z += amt * Math.exp(-u * 4) * Math.sin(Math.min(1, u * 6) * Math.PI / 2); } return z; }
453
+ // ---------- Three.js (3D styles) ----------
454
+ function makeGL() { if (typeof THREE === 'undefined') return null; const r = new THREE.WebGLRenderer({ antialias: true, preserveDrawingBuffer: true, alpha: true }); r.setPixelRatio(1); r.setSize(W, H, false); r.shadowMap.enabled = true; r.shadowMap.type = THREE.PCFSoftShadowMap; r.setClearColor(0x000000, 0); return r; }
455
+ function lights3(s, o) {
456
+ const out = {};
457
+ if (o.hemi) s.add(out.hemi = new THREE.HemisphereLight(o.hemi[0], o.hemi[1], o.hemi[2]));
458
+ if (o.amb) s.add(out.amb = new THREE.AmbientLight(o.amb[0], o.amb[1]));
459
+ if (o.dir) { const d = out.dir = new THREE.DirectionalLight(o.dir[0], o.dir[1]); d.position.set(o.dir[2], o.dir[3], o.dir[4]);
460
+ if (o.shadow) { d.castShadow = true; d.shadow.mapSize.set(2048, 2048); const sc = d.shadow.camera; sc.left = -o.shadow; sc.right = o.shadow; sc.top = o.shadow; sc.bottom = -o.shadow; sc.near = 0.5; sc.far = 90; d.shadow.bias = -0.0006; }
461
+ s.add(d); }
462
+ out.points = (o.points || []).map(([col, int, x, y, z, dist]) => { const p = new THREE.PointLight(col, int, dist || 0); p.position.set(x, y, z); s.add(p); return p; });
463
+ return out;
464
+ }
465
+ const M3 = (g, color, o = {}) => { const m = new THREE.Mesh(g, new THREE.MeshStandardMaterial(Object.assign({ color, roughness: 0.85, metalness: 0 }, o))); m.castShadow = m.receiveShadow = true; return m; };
466
+ const P3 = (g, color, o = {}) => { const m = new THREE.Mesh(g, new THREE.MeshPhysicalMaterial(Object.assign({ color, roughness: 0.2, metalness: 0, clearcoat: 1, clearcoatRoughness: 0.1 }, o))); m.castShadow = m.receiveShadow = true; return m; };
467
+ const put = (parent, m, x = 0, y = 0, z = 0) => { m.position.set(x, y, z); parent.add(m); return m; };
468
+ const proj3 = (camera, v) => { const p = v.clone().project(camera); return [(p.x + 1) / 2 * W, (1 - p.y) / 2 * H, p.z]; };
469
+ // ---------- sound helpers ----------
470
+ function padBed(k, t0, t1, o = {}) {
471
+ const bpm = o.bpm || 90, beat = 60 / bpm, bar = beat * 4, chords = o.chords || [['A3', 'C4', 'E4'], ['F3', 'A3', 'C4'], ['C4', 'E4', 'G4'], ['G3', 'B3', 'D4']], g = o.gain == null ? 1 : o.gain;
472
+ let i = 0;
473
+ for (let tb = t0; tb < t1 - 0.1; tb += bar, i++) {
474
+ const ch = chords[i % chords.length], len = Math.min(bar, t1 - tb);
475
+ ch.forEach((n, j) => { k.voice(tb, { type: o.wave || 'triangle', f: n, dur: len + 0.4, gain: 0.026 * g, a: 0.5, hold: Math.max(0, len - 0.9), filter: 'lowpass', ff: o.cut || 1300, pan: (j - (ch.length - 1) / 2) * 0.3, verb: 0.3, bus: 'music' }); });
476
+ k.voice(tb, { f: k.hz(ch[0]) / 2, dur: len + 0.2, gain: 0.05 * g, a: 0.3, hold: Math.max(0, len - 0.6), bus: 'music' });
477
+ for (let b = 0; b < 8; b++) {
478
+ const ts = tb + b * beat / 2; if (ts >= t1 - 0.05) break;
479
+ if (o.hats && ts >= o.hats[0] && ts < o.hats[1]) k.hiss(ts, { dur: b % 2 ? 0.03 : 0.045, filter: 'highpass', ff: 8000, gain: (b % 2 ? 0.014 : 0.022) * g, bus: 'music' });
480
+ if (o.kick && ts >= o.kick[0] && ts < o.kick[1] && (b === 0 || b === 4)) k.voice(ts, { f: [[0, 120], [0.09, 46]], dur: 0.26, gain: 0.16 * g, bus: 'music' });
481
+ if (o.snare && ts >= o.snare[0] && ts < o.snare[1] && (b === 2 || b === 6)) k.hiss(ts, { dur: 0.14, filter: 'bandpass', ff: 1800, q: 0.8, gain: 0.08 * g, verb: 0.2, bus: 'music' });
482
+ }
483
+ }
484
+ }
485
+ // overall level wrapper so a score can be written at comfortable gains
486
+ function gainKit(k0, G) { return Object.assign({}, k0, { voice: (t, p) => k0.voice(t, Object.assign({}, p, { gain: (p.gain == null ? 0.3 : p.gain) * G })), hiss: (t, p) => k0.hiss(t, Object.assign({}, p, { gain: (p.gain == null ? 0.3 : p.gain) * G })), play: (n, t, o = {}) => k0.play(n, t, Object.assign({}, o, { gain: (o.gain == null ? 1 : o.gain) * G })) }); }
487
+ const SND = {
488
+ tick1: (k, t, pan = 0, g = 1) => { k.voice(t, { f: [[0, 760], [0.05, 1150]], dur: 0.07, gain: 0.07 * g, pan, soft: true }); k.hiss(t, { dur: 0.012, filter: 'highpass', ff: 6000, gain: 0.05 * g, pan, soft: true }); },
489
+ chime: (k, t, pan = 0, g = 1, n = ['C6', 'G6']) => { k.voice(t, { f: n[0], dur: 0.5, gain: 0.08 * g, a: 0.003, verb: 0.3, pan }); k.voice(t + 0.07, { f: n[1], dur: 0.6, gain: 0.07 * g, a: 0.003, verb: 0.3, pan }); },
490
+ swipe: (k, t, pan = 0, g = 1) => { k.hiss(t, { dur: 0.24, filter: 'bandpass', ff: [[0, 2400], [0.22, 6200]], q: 1.2, gain: 0.14 * g, a: 0.08, pan }); k.voice(t + 0.12, { f: 'E6', dur: 0.5, gain: 0.05 * g, verb: 0.35, pan }); },
491
+ tap: (k, t, pan = 0, g = 1, f = 420) => { k.voice(t, { f: [[0, f * 1.6], [0.04, f]], dur: 0.09, gain: 0.16 * g, pan, soft: true }); k.hiss(t, { dur: 0.02, filter: 'bandpass', ff: 1200, q: 1.5, gain: 0.08 * g, pan, soft: true }); },
492
+ paper: (k, t, pan = 0, g = 1, d = 0.28) => k.hiss(t, { color: 'pink', dur: d, filter: 'bandpass', ff: [[0, 700], [d, 3200]], q: 0.8, gain: 0.12 * g, a: d * 0.4, pan: [pan - 0.3, pan + 0.3], soft: true }),
493
+ bloop: (k, t, pan = 0, g = 1, f = 520) => k.voice(t, { f: [[0, f], [0.12, f * 1.5]], dur: 0.16, gain: 0.12 * g, pan, verb: 0.15 }),
494
+ pluck: (k, t, n, pan = 0, g = 1) => { k.voice(t, { type: 'triangle', f: n, dur: 0.6, gain: 0.1 * g, a: 0.002, verb: 0.3, pan }); k.voice(t, { f: n, dur: 0.25, gain: 0.05 * g, a: 0.002, pan }); },
495
+ chord: (k, t, notes, g = 1, d = 1.6) => notes.forEach((n, i) => k.voice(t + i * 0.05, { f: n, dur: d, gain: 0.05 * g, a: 0.01, verb: 0.4, pan: (i - (notes.length - 1) / 2) * 0.25 })),
496
+ scratch: (k, t, d = 0.2, pan = 0, g = 1) => { const r = CM.rng('sc' + t); for (let x = 0; x < d; x += 0.018 + r() * 0.01) k.hiss(t + x, { dur: 0.025, filter: 'bandpass', ff: 2600 + r() * 1800, q: 2, gain: 0.08 * g * (0.5 + r() * 0.6), pan, soft: true }); },
497
+ thud: (k, t, g = 1) => { k.voice(t, { f: [[0, 110], [0.15, 45]], dur: 0.3, gain: 0.35 * g }); k.hiss(t, { color: 'brown', dur: 0.15, filter: 'lowpass', ff: 500, gain: 0.2 * g }); },
498
+ beep: (k, t, f = 880, d = 0.12, g = 1, pan = 0) => k.voice(t, { type: 'square', f, dur: d, gain: 0.05 * g, a: 0.002, hold: d * 0.7, filter: 'lowpass', ff: 3000, pan }),
499
+ };
500
+
501
+ // =====================================================================================================
502
+ // STYLE: Cosmic Scale
503
+ // True-scale bodies in a starfield, painted textures, and a log-scale camera that pulls back beat by beat.
504
+ // Demo topic: "How big is the Sun?" (Earth radius = 1 unit).
505
+ // =====================================================================================================
506
+ const C = { bg: '#02030a', ink: '#ffffff', accent: '#ffcf8a', label: '#d8ecff', sun: '#ffb347' };
507
+ const HEAD = (px) => `700 ${px}px "Space Grotesk", system-ui, sans-serif`, MONO = (px, w = 500) => `${w} ${px}px "JetBrains Mono", ui-monospace, monospace`;
508
+ const TL = { D: 15, title: [0.3, 0.5, 0.7], titleOut: 2.7, labs: [1.4, 4.2, 6.2, 8.4], reveal: 8.1, count: [10.0, 11.6], take: 12.6 };
509
+ // [name, real diameter label, radius (Earth = 1), x, painter]
510
+ const BODIES = [['EARTH', '12,742 km', 1, 0, 'earth'], ['MOON', '3,474 km', 0.273, -2.3, 'moon'], ['JUPITER', '139,820 km', 10.97, 14.5, 'jupiter'], ['SUN', '1,391,400 km', 109.2, 140, 'sun']];
511
+ // camera keys: [t, x, log10(distance), lookX]
512
+ const CAM = [[0, 0, Math.log10(3.6), 0], [2.9, 0.1, Math.log10(3.9), 0], [4.3, -0.9, Math.log10(10), -0.8], [6.0, 6.5, Math.log10(48), 7], [8.0, 6.5, Math.log10(48), 7], [9.4, 95, Math.log10(640), 100], [TL.D, 98, Math.log10(700), 100]];
513
+ const camAt = (t) => { const [x, lz, lx] = track(CAM, t); return [x, Math.pow(10, lz), lx]; };
514
+ const earths = (t) => Math.round(1300000 * ez.out3(span(t, TL.count[0], TL.count[1])) / 1000) * 1000;
515
+ function paintTex(kind) {
516
+ const L = CM.layer(512, 256), c = L.getContext('2d'), r = rng('tex' + kind);
517
+ if (kind === 'earth') {
518
+ const g = Float32Array.from({ length: 64 * 32 }, () => r()), n2 = (x, y) => { const xi = Math.floor(x), yi = Math.floor(y), fx = x - xi, fy = y - yi, ux = fx * fx * (3 - 2 * fx), uy = fy * fy * (3 - 2 * fy), v = (a, b) => g[((b & 31) * 64) + (a & 63)]; return lerp(lerp(v(xi, yi), v(xi + 1, yi), ux), lerp(v(xi, yi + 1), v(xi + 1, yi + 1), ux), uy); };
519
+ const fbm = (x, y) => n2(x, y) * 0.55 + n2(x * 2.1, y * 2.1) * 0.28 + n2(x * 4.3, y * 4.3) * 0.17;
520
+ const d = c.createImageData(512, 256);
521
+ for (let y = 0; y < 256; y++) for (let x = 0; x < 512; x++) { const u = x / 512 * 8, v = y / 256 * 4, h = fbm(u, v), cl = fbm(u * 1.7 + 9, v * 1.7 + 3), lat = Math.abs(y - 128) / 128, i = (y * 512 + x) * 4;
522
+ let col = h > 0.54 ? (lat > 0.82 ? [235, 240, 245] : h > 0.66 ? [122, 140, 78] : [62, 132, 70]) : [24, 86 + h * 60, 160 + h * 40];
523
+ if (lat > 0.9) col = [240, 244, 248]; const cw = clamp((cl - 0.55) * 3.2) * 0.85; col = col.map((cc) => cc * (1 - cw) + 250 * cw);
524
+ d.data[i] = col[0]; d.data[i + 1] = col[1]; d.data[i + 2] = col[2]; d.data[i + 3] = 255; }
525
+ c.putImageData(d, 0, 0); }
526
+ if (kind === 'moon') { c.fillStyle = '#9a9a9a'; c.fillRect(0, 0, 512, 256); for (let i = 0; i < 70; i++) { c.fillStyle = r() > 0.5 ? 'rgba(60,60,60,0.35)' : 'rgba(220,220,220,0.25)'; c.beginPath(); c.arc(r() * 512, r() * 256, 2 + r() * 16, 0, TAU); c.fill(); } }
527
+ if (kind === 'jupiter') { const cols = ['#d9b38c', '#b07a52', '#efd9bd', '#c9925f', '#e8c9a0', '#9b6a45']; for (let y = 0; y < 256; y += 4) { c.fillStyle = cols[Math.floor((Math.sin(y * 0.09) * 0.5 + 0.5) * 5.99 + (r() * 0.4))]; c.fillRect(0, y, 512, 4); } c.fillStyle = '#b5543a'; c.beginPath(); c.ellipse(330, 168, 34, 16, 0, 0, TAU); c.fill(); }
528
+ if (kind === 'sun') { c.fillStyle = '#ff9a2e'; c.fillRect(0, 0, 512, 256); for (let i = 0; i < 2600; i++) { c.fillStyle = `rgba(255,${200 + r() * 55 | 0},120,${r() * 0.35})`; c.beginPath(); c.arc(r() * 512, r() * 256, 1 + r() * 4, 0, TAU); c.fill(); } }
529
+ const tx = new THREE.CanvasTexture(L); tx.needsUpdate = true; return tx;
530
+ }
531
+ let G = null;
532
+ function init3() {
533
+ const r = makeGL(); if (!r) return null; r.shadowMap.enabled = false;
534
+ const s = new THREE.Scene(); s.background = new THREE.Color(C.bg);
535
+ const camera = new THREE.PerspectiveCamera(40, W / H, 0.05, 20000);
536
+ const rr0 = rng(21), pos = []; for (let i = 0; i < 3000; i++) { const th = rr0() * TAU, ph = Math.acos(2 * rr0() - 1), d = 6000 + rr0() * 3000; pos.push(d * Math.sin(ph) * Math.cos(th), d * Math.sin(ph) * Math.sin(th), d * Math.cos(ph)); }
537
+ const sg = new THREE.BufferGeometry(); sg.setAttribute('position', new THREE.Float32BufferAttribute(pos, 3)); s.add(new THREE.Points(sg, new THREE.PointsMaterial({ color: '#ffffff', size: 1.6, sizeAttenuation: false })));
538
+ s.add(new THREE.AmbientLight('#ffffff', 0.18)); const sunLight = new THREE.PointLight('#fff3e0', 1.6, 0); sunLight.position.set(140, 0, 30); s.add(sunLight); const fill = new THREE.DirectionalLight('#ffffff', 0.6); fill.position.set(2, 2, 6); s.add(fill);
539
+ const meshes = BODIES.map(([n, d, R, x, p]) => { const mat = p === 'sun' ? new THREE.MeshBasicMaterial({ map: paintTex(p) }) : new THREE.MeshStandardMaterial({ map: paintTex(p), roughness: 0.9 }); const m = new THREE.Mesh(new THREE.SphereGeometry(R, 96, 48), mat); m.position.set(x, 0, 0); s.add(m); return m; });
540
+ return { r, s, camera, meshes };
541
+ }
542
+ function pose(t) { const [x, d, lx] = camAt(t); G.camera.position.set(x, d * 0.12, d); G.camera.lookAt(lx, 0, 0); G.meshes.forEach((m, i) => { m.rotation.y = t * (i === 3 ? 0.02 : 0.25); }); }
543
+ function overlay(c, t) {
544
+ // sun glow
545
+ if (G) { const [sx, sy] = proj3(G.camera, new THREE.Vector3(140, 0, 0)), [ex] = proj3(G.camera, new THREE.Vector3(140 + 109.2, 0, 0)), R = Math.abs(ex - sx), gl = span(t, TL.reveal + 0.4, TL.reveal + 1.4); if (R > 2 && gl > 0) { c.globalAlpha = gl; c.globalCompositeOperation = 'screen'; c.fillStyle = rg(c, sx, sy, R * 0.9, R * 2.4, [[0, 'rgba(255,170,60,0.55)'], [0.5, 'rgba(255,110,30,0.14)'], [1, 'rgba(0,0,0,0)']]); c.fillRect(0, 0, W, H); c.globalCompositeOperation = 'source-over'; c.globalAlpha = 1; } }
546
+ { const o = 1 - span(t, TL.titleOut, TL.titleOut + 0.4); if (o > 0) { c.save(); c.globalAlpha = o; wordLine(c, [['HOW', TL.title[0]], ['BIG', TL.title[1]], ['IS', TL.title[2]]], 50, 150, HEAD(80), C.ink, t); wordLine(c, [['THE', TL.title[2] + 0.15], ['SUN?', TL.title[2] + 0.3]], 50, 238, HEAD(80), C.accent, t); c.restore(); } }
547
+ if (G) BODIES.forEach(([n, d, R, x], i) => {
548
+ const p = inn(t, TL.labs[i], 0.5); if (p <= 0) return; const [bx, by] = proj3(G.camera, new THREE.Vector3(x, 0, 0)), [ex] = proj3(G.camera, new THREE.Vector3(x + R, 0, 0)), pr = Math.abs(ex - bx);
549
+ if (bx < -200 || bx > W + 200 || (i === 3 && t < TL.reveal + 0.6)) return;
550
+ const fade = i < 2 ? 1 - span(t, TL.labs[i + 1] + 1.6, TL.labs[i + 1] + 2.2) : i === 2 ? 1 - span(t, TL.reveal + 0.3, TL.reveal + 0.8) : 1; if (fade <= 0) return; c.save(); c.globalAlpha = p * fade;
551
+ if (pr < 8) { c.setLineDash([5, 6]); c.strokeStyle = C.label; c.lineWidth = 2; c.beginPath(); c.arc(bx, by, 16, 0, TAU); c.stroke(); c.setLineDash([]); }
552
+ const ly = i === 3 ? 900 : by - Math.max(pr, 16) - 70, lx = i === 3 ? 60 : clamp(bx - 10, 40, W - 330);
553
+ if (i !== 3) leader(c, bx, by - Math.max(pr, 16) - 4, lx + 30, ly + 44, C.label, 2, p);
554
+ chip(c, n, lx, ly, { f: MONO(24, 700), bg: 'rgba(255,255,255,0.12)', fg: '#fff', stroke: 'rgba(255,255,255,0.4)', ls: 2 }); txt(c, d, lx + 6, ly + 78, { f: MONO(22), c: C.label }); c.restore();
555
+ });
556
+ { const p = inn(t, TL.count[0] - 0.2, 0.4); if (p > 0) { c.save(); c.globalAlpha = p; txt(c, earths(t).toLocaleString('en-US'), 50, 160, { f: HEAD(98), c: '#fff', s: 1 + 0.06 * pulse(t, TL.count[1], 0.35) }); txt(c, 'EARTHS FIT INSIDE THE SUN', 54, 208, { f: MONO(24), c: C.accent, ls: 2 }); c.restore(); } }
557
+ wordLine(c, [['And', TL.take], ["it's", TL.take + 0.1], ['an', TL.take + 0.2]], 50, 1110, HEAD(58), '#fff', t);
558
+ wordLine(c, [['average', TL.take + 0.35, C.accent], ['star.', TL.take + 0.5]], 50, 1180, HEAD(58), '#fff', t);
559
+ }
560
+ function explainer(ctx, t) {
561
+ ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.globalAlpha = 1; ctx.filter = 'none';
562
+ if (!G) G = init3();
563
+ if (G) { pose(t); G.r.render(G.s, G.camera); ctx.drawImage(G.r.domElement, 0, 0); } else fillAll(ctx, C.bg);
564
+ overlay(ctx, t); vignette(ctx, 0.45); grain(ctx, t, 0.04);
565
+ }
566
+
567
+ // =================================== SOUND SCORE ===================================
568
+ // Vast and quiet: a deep drone and filtered pad, a long low whoosh for every pull-back, soft pings for labels,
569
+ // a riser into the boom for the Sun, counter ticks, and shimmer for the takeaway.
570
+ function scoreSound(k) {
571
+ k = gainKit(k, 2.0);
572
+ k.drone(0, TL.D, { note: 'D1', gain: 1.2 }); padBed(k, 0, TL.D, { bpm: 60, chords: [['D3', 'A3', 'E4'], ['Bb2', 'F3', 'D4'], ['G2', 'D3', 'A3'], ['A2', 'E3', 'C#4']], cut: 800, gain: 0.8 });
573
+ [TL.title[0], TL.title[1], TL.title[2], TL.title[2] + 0.15, TL.title[2] + 0.3].forEach((t) => SND.tick1(k, t, 0, 0.8));
574
+ [[2.9, 1.4], [4.3, 1.7], [8.0, 1.4]].forEach(([t, d]) => k.play('whoosh', t, { dur: d, gain: 0.45, top: 900, dir: 1 }));
575
+ TL.labs.forEach((t, i) => k.voice(t + 0.1, { f: ['A5', 'C6', 'E6', 'A6'][i], dur: 0.6, gain: 0.07, a: 0.003, verb: 0.4, soft: true }));
576
+ k.play('riser', TL.reveal - 0.2, { dur: 1.2, gain: 0.45 }); k.play('boom', TL.reveal + 1.0, { gain: 1 });
577
+ { let last = -1; for (let t = TL.count[0]; t <= TL.count[1]; t += 1 / 60) { const v = Math.floor(earths(t) / 65000); if (v !== last && v > 0) { k.play('tick', t, { f: 2200 + v * 90, gain: 0.3, soft: true }); last = v; } } }
578
+ k.play('pop', TL.count[1], { f: 700, gain: 0.5 }); k.play('shimmer', TL.take + 0.5, { gain: 1 });
579
+ }
580
+
581
+ // =================================== PLAYER ===================================
582
+ const cvs = document.getElementById('stage'), ctx = cvs.getContext('2d');
583
+ const DURATION = TL.D;
584
+ window.seek = (t) => explainer(ctx, clamp(t, 0, DURATION));
585
+ window.DURATION = DURATION;
586
+ window.scoreSound = scoreSound;
587
+ window.SFX = SFX;
588
+ window.loadFootage = (url) => { const v = document.createElement('video'); v.src = url; v.muted = true; v.playsInline = true; v.loop = true; v.crossOrigin = 'anonymous'; v.addEventListener('loadeddata', () => { FOOT.video = v; try { v.currentTime = T % (v.duration || 1); } catch (e) {} draw(); }); v.load(); };
589
+
590
+ const ui = { play: document.getElementById('play'), scrub: document.getElementById('scrub'), time: document.getElementById('time'), sound: document.getElementById('sound'), loop: document.getElementById('loop'), vo: document.getElementById('vofile'), foot: document.getElementById('footfile'), note: document.getElementById('vonote') };
591
+ let T = 0, playing = false, last = 0, soundOn = true, loopOn = true, stopSound = null, voAudio = null;
592
+ const fmt = (t) => t.toFixed(2) + ' / ' + DURATION.toFixed(2);
593
+ function draw() { window.seek(T); ui.scrub.value = T; ui.time.textContent = fmt(T); }
594
+ function syncFoot() { const v = FOOT.video; if (!v) return; try { v.currentTime = T % (v.duration || 1); if (playing) v.play().catch(() => {}); else v.pause(); } catch (e) {} }
595
+ function startAudio() {
596
+ stopAudio(); if (!playing) return;
597
+ if (soundOn) stopSound = SFX.live(scoreSound, T, { voiceover: !!voAudio });
598
+ if (voAudio) { try { voAudio.currentTime = T; voAudio.play().catch(() => {}); } catch (e) {} }
599
+ syncFoot();
600
+ }
601
+ function stopAudio() { if (stopSound) { stopSound(); stopSound = null; } if (voAudio) voAudio.pause(); if (FOOT.video) FOOT.video.pause(); }
602
+ function setPlaying(p) { playing = p; ui.play.textContent = p ? 'Pause' : 'Play'; last = performance.now(); if (p) startAudio(); else stopAudio(); }
603
+ function tick(now) {
604
+ if (playing) {
605
+ T += (now - last) / 1000; last = now;
606
+ if (T >= DURATION) { if (loopOn) { T = 0; startAudio(); } else { T = DURATION; setPlaying(false); } }
607
+ draw();
608
+ }
609
+ requestAnimationFrame(tick);
610
+ }
611
+ ui.play.addEventListener('click', () => { if (!playing && T >= DURATION) T = 0; setPlaying(!playing); });
612
+ ui.scrub.addEventListener('input', () => { T = parseFloat(ui.scrub.value); draw(); if (playing) startAudio(); else syncFoot(); });
613
+ ui.sound.addEventListener('click', () => { soundOn = !soundOn; ui.sound.setAttribute('aria-pressed', soundOn); ui.sound.textContent = soundOn ? 'Sound on' : 'Sound off'; if (playing) startAudio(); });
614
+ ui.loop.addEventListener('click', () => { loopOn = !loopOn; ui.loop.setAttribute('aria-pressed', loopOn); });
615
+ ui.vo.addEventListener('change', () => {
616
+ const f = ui.vo.files && ui.vo.files[0]; if (!f) return;
617
+ if (voAudio) { voAudio.pause(); URL.revokeObjectURL(voAudio.src); }
618
+ voAudio = new Audio(URL.createObjectURL(f)); ui.note.textContent = 'Voiceover loaded: ' + f.name + '. Effects use the lighter mix.';
619
+ if (playing) startAudio();
620
+ });
621
+ if (ui.foot) ui.foot.addEventListener('change', () => { const f = ui.foot.files && ui.foot.files[0]; if (!f) return; window.loadFootage(URL.createObjectURL(f)); ui.note.textContent = 'Footage loaded: ' + f.name + '.'; });
622
+ (async () => {
623
+ try { await Promise.all(["700 60px \"Space Grotesk\"","500 30px \"Space Grotesk\"","500 22px \"JetBrains Mono\"","700 22px \"JetBrains Mono\""].map((f) => document.fonts.load(f, 'AaZz09'))); await document.fonts.ready; } catch (e) {}
624
+ if (typeof setup === 'function') setup();
625
+ window.__posterT = 12; T = 12; draw(); window.__ready = true;
626
+ requestAnimationFrame((n) => { last = n; tick(n); });
627
+ })();
628
+ </script>