@autoaiai/aicut 0.1.7 → 0.1.13

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 (306) hide show
  1. package/MANUAL.md +94 -84
  2. package/package.json +1 -1
  3. package/product.json +2 -1
  4. package/skills/aicut/SKILL.md +4 -4
  5. package/skills/aicut/references/commands.md +15 -15
  6. package/skills/aicut/references/film-format.md +1 -1
  7. package/skills/aicut/references/recipes.md +4 -4
  8. package/skills/aicut/references/troubleshooting.md +2 -2
  9. package/skills/aicut-motion/SKILL.md +75 -9
  10. package/skills/aicut-motion/THIRD_PARTY_NOTICES.md +14 -0
  11. package/skills/aicut-motion/assets/atlas/lib/harness.js +116 -0
  12. package/skills/aicut-motion/assets/atlas/lib/sound.js +274 -0
  13. package/skills/aicut-motion/assets/atlas/styles/001-flat-vector-science/code.js +937 -0
  14. package/skills/aicut-motion/assets/atlas/styles/001-flat-vector-science/poster.jpg +0 -0
  15. package/skills/aicut-motion/assets/atlas/styles/001-flat-vector-science/style.json +13 -0
  16. package/skills/aicut-motion/assets/atlas/styles/002-watercolor-wash/code.js +909 -0
  17. package/skills/aicut-motion/assets/atlas/styles/002-watercolor-wash/poster.jpg +0 -0
  18. package/skills/aicut-motion/assets/atlas/styles/002-watercolor-wash/style.json +13 -0
  19. package/skills/aicut-motion/assets/atlas/styles/003-shadow-puppet-theatre/code.js +881 -0
  20. package/skills/aicut-motion/assets/atlas/styles/003-shadow-puppet-theatre/poster.jpg +0 -0
  21. package/skills/aicut-motion/assets/atlas/styles/003-shadow-puppet-theatre/style.json +13 -0
  22. package/skills/aicut-motion/assets/atlas/styles/004-whiteboard-explainer/code.js +897 -0
  23. package/skills/aicut-motion/assets/atlas/styles/004-whiteboard-explainer/poster.jpg +0 -0
  24. package/skills/aicut-motion/assets/atlas/styles/004-whiteboard-explainer/style.json +13 -0
  25. package/skills/aicut-motion/assets/atlas/styles/005-psychedelic-poster/code.js +814 -0
  26. package/skills/aicut-motion/assets/atlas/styles/005-psychedelic-poster/poster.jpg +0 -0
  27. package/skills/aicut-motion/assets/atlas/styles/005-psychedelic-poster/style.json +13 -0
  28. package/skills/aicut-motion/assets/atlas/styles/006-tech-glow-explainer/code.js +990 -0
  29. package/skills/aicut-motion/assets/atlas/styles/006-tech-glow-explainer/poster.jpg +0 -0
  30. package/skills/aicut-motion/assets/atlas/styles/006-tech-glow-explainer/style.json +13 -0
  31. package/skills/aicut-motion/assets/atlas/styles/007-papercraft-models/code.js +994 -0
  32. package/skills/aicut-motion/assets/atlas/styles/007-papercraft-models/poster.jpg +0 -0
  33. package/skills/aicut-motion/assets/atlas/styles/007-papercraft-models/style.json +13 -0
  34. package/skills/aicut-motion/assets/atlas/styles/008-1940s-film-noir/code.js +792 -0
  35. package/skills/aicut-motion/assets/atlas/styles/008-1940s-film-noir/poster.jpg +0 -0
  36. package/skills/aicut-motion/assets/atlas/styles/008-1940s-film-noir/style.json +13 -0
  37. package/skills/aicut-motion/assets/atlas/styles/009-manim-style-math/code.js +840 -0
  38. package/skills/aicut-motion/assets/atlas/styles/009-manim-style-math/poster.jpg +0 -0
  39. package/skills/aicut-motion/assets/atlas/styles/009-manim-style-math/style.json +13 -0
  40. package/skills/aicut-motion/assets/atlas/styles/010-illuminated-manuscript/code.js +1126 -0
  41. package/skills/aicut-motion/assets/atlas/styles/010-illuminated-manuscript/poster.jpg +0 -0
  42. package/skills/aicut-motion/assets/atlas/styles/010-illuminated-manuscript/style.json +13 -0
  43. package/skills/aicut-motion/assets/atlas/styles/011-editorial-essay-collage/code.js +854 -0
  44. package/skills/aicut-motion/assets/atlas/styles/011-editorial-essay-collage/poster.jpg +0 -0
  45. package/skills/aicut-motion/assets/atlas/styles/011-editorial-essay-collage/style.json +13 -0
  46. package/skills/aicut-motion/assets/atlas/styles/012-bioluminescent-deep-sea/code.js +1124 -0
  47. package/skills/aicut-motion/assets/atlas/styles/012-bioluminescent-deep-sea/poster.jpg +0 -0
  48. package/skills/aicut-motion/assets/atlas/styles/012-bioluminescent-deep-sea/style.json +13 -0
  49. package/skills/aicut-motion/assets/atlas/styles/013-product-launch-reveal/code.js +728 -0
  50. package/skills/aicut-motion/assets/atlas/styles/013-product-launch-reveal/poster.jpg +0 -0
  51. package/skills/aicut-motion/assets/atlas/styles/013-product-launch-reveal/style.json +13 -0
  52. package/skills/aicut-motion/assets/atlas/styles/014-halftone-pop-panel/code.js +664 -0
  53. package/skills/aicut-motion/assets/atlas/styles/014-halftone-pop-panel/poster.jpg +0 -0
  54. package/skills/aicut-motion/assets/atlas/styles/014-halftone-pop-panel/style.json +13 -0
  55. package/skills/aicut-motion/assets/atlas/styles/015-isometric-pastel/code.js +991 -0
  56. package/skills/aicut-motion/assets/atlas/styles/015-isometric-pastel/poster.jpg +0 -0
  57. package/skills/aicut-motion/assets/atlas/styles/015-isometric-pastel/style.json +13 -0
  58. package/skills/aicut-motion/assets/atlas/styles/016-oscilloscope-vector-art/code.js +801 -0
  59. package/skills/aicut-motion/assets/atlas/styles/016-oscilloscope-vector-art/poster.jpg +0 -0
  60. package/skills/aicut-motion/assets/atlas/styles/016-oscilloscope-vector-art/style.json +13 -0
  61. package/skills/aicut-motion/assets/atlas/styles/017-risograph-zine/code.js +692 -0
  62. package/skills/aicut-motion/assets/atlas/styles/017-risograph-zine/poster.jpg +0 -0
  63. package/skills/aicut-motion/assets/atlas/styles/017-risograph-zine/style.json +13 -0
  64. package/skills/aicut-motion/assets/atlas/styles/018-claymation-set/code.js +756 -0
  65. package/skills/aicut-motion/assets/atlas/styles/018-claymation-set/poster.jpg +0 -0
  66. package/skills/aicut-motion/assets/atlas/styles/018-claymation-set/style.json +13 -0
  67. package/skills/aicut-motion/assets/atlas/styles/019-neon-sign-at-night/code.js +922 -0
  68. package/skills/aicut-motion/assets/atlas/styles/019-neon-sign-at-night/poster.jpg +0 -0
  69. package/skills/aicut-motion/assets/atlas/styles/019-neon-sign-at-night/style.json +13 -0
  70. package/skills/aicut-motion/assets/atlas/styles/020-kawaii-anime/code.js +852 -0
  71. package/skills/aicut-motion/assets/atlas/styles/020-kawaii-anime/poster.jpg +0 -0
  72. package/skills/aicut-motion/assets/atlas/styles/020-kawaii-anime/style.json +13 -0
  73. package/skills/aicut-motion/assets/atlas/styles/021-ukiyo-e-woodblock/code.js +724 -0
  74. package/skills/aicut-motion/assets/atlas/styles/021-ukiyo-e-woodblock/poster.jpg +0 -0
  75. package/skills/aicut-motion/assets/atlas/styles/021-ukiyo-e-woodblock/style.json +13 -0
  76. package/skills/aicut-motion/assets/atlas/styles/022-16-bit-pixel-odyssey/code.js +793 -0
  77. package/skills/aicut-motion/assets/atlas/styles/022-16-bit-pixel-odyssey/poster.jpg +0 -0
  78. package/skills/aicut-motion/assets/atlas/styles/022-16-bit-pixel-odyssey/style.json +13 -0
  79. package/skills/aicut-motion/assets/atlas/styles/023-chalkboard-lesson/code.js +846 -0
  80. package/skills/aicut-motion/assets/atlas/styles/023-chalkboard-lesson/poster.jpg +0 -0
  81. package/skills/aicut-motion/assets/atlas/styles/023-chalkboard-lesson/style.json +13 -0
  82. package/skills/aicut-motion/assets/atlas/styles/024-cut-paper-diorama/code.js +1008 -0
  83. package/skills/aicut-motion/assets/atlas/styles/024-cut-paper-diorama/poster.jpg +0 -0
  84. package/skills/aicut-motion/assets/atlas/styles/024-cut-paper-diorama/style.json +13 -0
  85. package/skills/aicut-motion/assets/atlas/styles/025-cathedral-glass/code.js +680 -0
  86. package/skills/aicut-motion/assets/atlas/styles/025-cathedral-glass/poster.jpg +0 -0
  87. package/skills/aicut-motion/assets/atlas/styles/025-cathedral-glass/style.json +13 -0
  88. package/skills/aicut-motion/assets/atlas/styles/026-editorial-chart/code.js +633 -0
  89. package/skills/aicut-motion/assets/atlas/styles/026-editorial-chart/poster.jpg +0 -0
  90. package/skills/aicut-motion/assets/atlas/styles/026-editorial-chart/style.json +13 -0
  91. package/skills/aicut-motion/assets/atlas/styles/027-synthwave-outrun/code.js +757 -0
  92. package/skills/aicut-motion/assets/atlas/styles/027-synthwave-outrun/poster.jpg +0 -0
  93. package/skills/aicut-motion/assets/atlas/styles/027-synthwave-outrun/style.json +13 -0
  94. package/skills/aicut-motion/assets/atlas/styles/028-origami-studio/code.js +828 -0
  95. package/skills/aicut-motion/assets/atlas/styles/028-origami-studio/poster.jpg +0 -0
  96. package/skills/aicut-motion/assets/atlas/styles/028-origami-studio/style.json +13 -0
  97. package/skills/aicut-motion/assets/atlas/styles/029-linocut-relief-print/code.js +697 -0
  98. package/skills/aicut-motion/assets/atlas/styles/029-linocut-relief-print/poster.jpg +0 -0
  99. package/skills/aicut-motion/assets/atlas/styles/029-linocut-relief-print/style.json +13 -0
  100. package/skills/aicut-motion/assets/atlas/styles/030-holographic-foil-card/code.js +687 -0
  101. package/skills/aicut-motion/assets/atlas/styles/030-holographic-foil-card/poster.jpg +0 -0
  102. package/skills/aicut-motion/assets/atlas/styles/030-holographic-foil-card/style.json +13 -0
  103. package/skills/aicut-motion/assets/atlas/styles/031-voxel-diorama/code.js +727 -0
  104. package/skills/aicut-motion/assets/atlas/styles/031-voxel-diorama/poster.jpg +0 -0
  105. package/skills/aicut-motion/assets/atlas/styles/031-voxel-diorama/style.json +13 -0
  106. package/skills/aicut-motion/assets/atlas/styles/032-sumi-e-ink-wash/code.js +903 -0
  107. package/skills/aicut-motion/assets/atlas/styles/032-sumi-e-ink-wash/poster.jpg +0 -0
  108. package/skills/aicut-motion/assets/atlas/styles/032-sumi-e-ink-wash/style.json +13 -0
  109. package/skills/aicut-motion/assets/atlas/styles/033-etch-a-sketch-toy/code.js +662 -0
  110. package/skills/aicut-motion/assets/atlas/styles/033-etch-a-sketch-toy/poster.jpg +0 -0
  111. package/skills/aicut-motion/assets/atlas/styles/033-etch-a-sketch-toy/style.json +13 -0
  112. package/skills/aicut-motion/assets/atlas/styles/034-cosmic-star-chart/code.js +951 -0
  113. package/skills/aicut-motion/assets/atlas/styles/034-cosmic-star-chart/poster.jpg +0 -0
  114. package/skills/aicut-motion/assets/atlas/styles/034-cosmic-star-chart/style.json +13 -0
  115. package/skills/aicut-motion/assets/atlas/styles/035-punk-zine-collage/code.js +759 -0
  116. package/skills/aicut-motion/assets/atlas/styles/035-punk-zine-collage/poster.jpg +0 -0
  117. package/skills/aicut-motion/assets/atlas/styles/035-punk-zine-collage/style.json +13 -0
  118. package/skills/aicut-motion/assets/atlas/styles/036-thermal-camera/code.js +738 -0
  119. package/skills/aicut-motion/assets/atlas/styles/036-thermal-camera/poster.jpg +0 -0
  120. package/skills/aicut-motion/assets/atlas/styles/036-thermal-camera/style.json +13 -0
  121. package/skills/aicut-motion/assets/atlas/styles/037-engineering-blueprint/code.js +793 -0
  122. package/skills/aicut-motion/assets/atlas/styles/037-engineering-blueprint/poster.jpg +0 -0
  123. package/skills/aicut-motion/assets/atlas/styles/037-engineering-blueprint/style.json +13 -0
  124. package/skills/aicut-motion/assets/atlas/styles/038-impasto-night/code.js +673 -0
  125. package/skills/aicut-motion/assets/atlas/styles/038-impasto-night/poster.jpg +0 -0
  126. package/skills/aicut-motion/assets/atlas/styles/038-impasto-night/style.json +13 -0
  127. package/skills/aicut-motion/assets/atlas/styles/039-win95-desktop/code.js +907 -0
  128. package/skills/aicut-motion/assets/atlas/styles/039-win95-desktop/poster.jpg +0 -0
  129. package/skills/aicut-motion/assets/atlas/styles/039-win95-desktop/style.json +13 -0
  130. package/skills/aicut-motion/assets/atlas/styles/040-low-poly-faceted/code.js +833 -0
  131. package/skills/aicut-motion/assets/atlas/styles/040-low-poly-faceted/poster.jpg +0 -0
  132. package/skills/aicut-motion/assets/atlas/styles/040-low-poly-faceted/style.json +13 -0
  133. package/skills/aicut-motion/assets/atlas/styles/041-manga-page/code.js +845 -0
  134. package/skills/aicut-motion/assets/atlas/styles/041-manga-page/poster.jpg +0 -0
  135. package/skills/aicut-motion/assets/atlas/styles/041-manga-page/style.json +13 -0
  136. package/skills/aicut-motion/assets/atlas/styles/042-wood-type-letterpress/code.js +496 -0
  137. package/skills/aicut-motion/assets/atlas/styles/042-wood-type-letterpress/poster.jpg +0 -0
  138. package/skills/aicut-motion/assets/atlas/styles/042-wood-type-letterpress/style.json +13 -0
  139. package/skills/aicut-motion/assets/atlas/styles/043-light-painting/code.js +635 -0
  140. package/skills/aicut-motion/assets/atlas/styles/043-light-painting/poster.jpg +0 -0
  141. package/skills/aicut-motion/assets/atlas/styles/043-light-painting/style.json +13 -0
  142. package/skills/aicut-motion/assets/atlas/styles/044-felt-patchwork/code.js +799 -0
  143. package/skills/aicut-motion/assets/atlas/styles/044-felt-patchwork/poster.jpg +0 -0
  144. package/skills/aicut-motion/assets/atlas/styles/044-felt-patchwork/style.json +13 -0
  145. package/skills/aicut-motion/assets/atlas/styles/045-phosphor-terminal/code.js +547 -0
  146. package/skills/aicut-motion/assets/atlas/styles/045-phosphor-terminal/poster.jpg +0 -0
  147. package/skills/aicut-motion/assets/atlas/styles/045-phosphor-terminal/style.json +13 -0
  148. package/skills/aicut-motion/assets/atlas/styles/046-glassmorphism-ui/code.js +592 -0
  149. package/skills/aicut-motion/assets/atlas/styles/046-glassmorphism-ui/poster.jpg +0 -0
  150. package/skills/aicut-motion/assets/atlas/styles/046-glassmorphism-ui/style.json +13 -0
  151. package/skills/aicut-motion/assets/atlas/styles/047-tarot-card/code.js +768 -0
  152. package/skills/aicut-motion/assets/atlas/styles/047-tarot-card/poster.jpg +0 -0
  153. package/skills/aicut-motion/assets/atlas/styles/047-tarot-card/style.json +13 -0
  154. package/skills/aicut-motion/assets/atlas/styles/048-transit-map/code.js +666 -0
  155. package/skills/aicut-motion/assets/atlas/styles/048-transit-map/poster.jpg +0 -0
  156. package/skills/aicut-motion/assets/atlas/styles/048-transit-map/style.json +13 -0
  157. package/skills/aicut-motion/assets/atlas/styles/049-gouache-travel-poster/code.js +559 -0
  158. package/skills/aicut-motion/assets/atlas/styles/049-gouache-travel-poster/poster.jpg +0 -0
  159. package/skills/aicut-motion/assets/atlas/styles/049-gouache-travel-poster/style.json +13 -0
  160. package/skills/aicut-motion/assets/atlas/styles/050-napkin-sketch/code.js +943 -0
  161. package/skills/aicut-motion/assets/atlas/styles/050-napkin-sketch/poster.jpg +0 -0
  162. package/skills/aicut-motion/assets/atlas/styles/050-napkin-sketch/style.json +13 -0
  163. package/skills/aicut-motion/assets/atlas/styles/051-art-deco-foil/code.js +606 -0
  164. package/skills/aicut-motion/assets/atlas/styles/051-art-deco-foil/poster.jpg +0 -0
  165. package/skills/aicut-motion/assets/atlas/styles/051-art-deco-foil/style.json +13 -0
  166. package/skills/aicut-motion/assets/atlas/styles/052-radiograph-on-lightbox/code.js +730 -0
  167. package/skills/aicut-motion/assets/atlas/styles/052-radiograph-on-lightbox/poster.jpg +0 -0
  168. package/skills/aicut-motion/assets/atlas/styles/052-radiograph-on-lightbox/style.json +13 -0
  169. package/skills/aicut-motion/assets/atlas/styles/053-vaporwave/code.js +782 -0
  170. package/skills/aicut-motion/assets/atlas/styles/053-vaporwave/poster.jpg +0 -0
  171. package/skills/aicut-motion/assets/atlas/styles/053-vaporwave/style.json +13 -0
  172. package/skills/aicut-motion/assets/atlas/styles/054-ebru-paper-marbling/code.js +504 -0
  173. package/skills/aicut-motion/assets/atlas/styles/054-ebru-paper-marbling/poster.jpg +0 -0
  174. package/skills/aicut-motion/assets/atlas/styles/054-ebru-paper-marbling/style.json +13 -0
  175. package/skills/aicut-motion/assets/atlas/styles/055-isotype-pictograms/code.js +517 -0
  176. package/skills/aicut-motion/assets/atlas/styles/055-isotype-pictograms/poster.jpg +0 -0
  177. package/skills/aicut-motion/assets/atlas/styles/055-isotype-pictograms/style.json +13 -0
  178. package/skills/aicut-motion/assets/atlas/styles/056-soft-3d-clay/code.js +713 -0
  179. package/skills/aicut-motion/assets/atlas/styles/056-soft-3d-clay/poster.jpg +0 -0
  180. package/skills/aicut-motion/assets/atlas/styles/056-soft-3d-clay/style.json +13 -0
  181. package/skills/aicut-motion/assets/atlas/styles/057-cross-stitch-sampler/code.js +717 -0
  182. package/skills/aicut-motion/assets/atlas/styles/057-cross-stitch-sampler/poster.jpg +0 -0
  183. package/skills/aicut-motion/assets/atlas/styles/057-cross-stitch-sampler/style.json +13 -0
  184. package/skills/aicut-motion/assets/atlas/styles/058-constructivist-propaganda/code.js +540 -0
  185. package/skills/aicut-motion/assets/atlas/styles/058-constructivist-propaganda/poster.jpg +0 -0
  186. package/skills/aicut-motion/assets/atlas/styles/058-constructivist-propaganda/style.json +13 -0
  187. package/skills/aicut-motion/assets/atlas/styles/059-pocket-monochrome/code.js +524 -0
  188. package/skills/aicut-motion/assets/atlas/styles/059-pocket-monochrome/poster.jpg +0 -0
  189. package/skills/aicut-motion/assets/atlas/styles/059-pocket-monochrome/style.json +13 -0
  190. package/skills/aicut-motion/assets/atlas/styles/060-botanical-plate/code.js +934 -0
  191. package/skills/aicut-motion/assets/atlas/styles/060-botanical-plate/poster.jpg +0 -0
  192. package/skills/aicut-motion/assets/atlas/styles/060-botanical-plate/style.json +13 -0
  193. package/skills/aicut-motion/assets/atlas/styles/061-kinetic-type/code.js +690 -0
  194. package/skills/aicut-motion/assets/atlas/styles/061-kinetic-type/poster.jpg +0 -0
  195. package/skills/aicut-motion/assets/atlas/styles/061-kinetic-type/style.json +13 -0
  196. package/skills/aicut-motion/assets/atlas/styles/062-byzantine-mosaic/code.js +612 -0
  197. package/skills/aicut-motion/assets/atlas/styles/062-byzantine-mosaic/poster.jpg +0 -0
  198. package/skills/aicut-motion/assets/atlas/styles/062-byzantine-mosaic/style.json +13 -0
  199. package/skills/aicut-motion/assets/atlas/styles/063-y2k-liquid-chrome/code.js +666 -0
  200. package/skills/aicut-motion/assets/atlas/styles/063-y2k-liquid-chrome/poster.jpg +0 -0
  201. package/skills/aicut-motion/assets/atlas/styles/063-y2k-liquid-chrome/style.json +13 -0
  202. package/skills/aicut-motion/assets/atlas/styles/064-sticky-note-wall/code.js +651 -0
  203. package/skills/aicut-motion/assets/atlas/styles/064-sticky-note-wall/poster.jpg +0 -0
  204. package/skills/aicut-motion/assets/atlas/styles/064-sticky-note-wall/style.json +13 -0
  205. package/skills/aicut-motion/assets/atlas/styles/065-vintage-newsprint/code.js +656 -0
  206. package/skills/aicut-motion/assets/atlas/styles/065-vintage-newsprint/poster.jpg +0 -0
  207. package/skills/aicut-motion/assets/atlas/styles/065-vintage-newsprint/style.json +13 -0
  208. package/skills/aicut-motion/assets/atlas/styles/066-hidden-line-wireframe/code.js +672 -0
  209. package/skills/aicut-motion/assets/atlas/styles/066-hidden-line-wireframe/poster.jpg +0 -0
  210. package/skills/aicut-motion/assets/atlas/styles/066-hidden-line-wireframe/style.json +13 -0
  211. package/skills/aicut-motion/assets/atlas/styles/067-memphis-group/code.js +548 -0
  212. package/skills/aicut-motion/assets/atlas/styles/067-memphis-group/poster.jpg +0 -0
  213. package/skills/aicut-motion/assets/atlas/styles/067-memphis-group/style.json +13 -0
  214. package/skills/aicut-motion/assets/atlas/styles/068-ballpoint-notebook/code.js +989 -0
  215. package/skills/aicut-motion/assets/atlas/styles/068-ballpoint-notebook/poster.jpg +0 -0
  216. package/skills/aicut-motion/assets/atlas/styles/068-ballpoint-notebook/style.json +13 -0
  217. package/skills/aicut-motion/assets/atlas/styles/069-op-art-sphere/code.js +440 -0
  218. package/skills/aicut-motion/assets/atlas/styles/069-op-art-sphere/poster.jpg +0 -0
  219. package/skills/aicut-motion/assets/atlas/styles/069-op-art-sphere/style.json +13 -0
  220. package/skills/aicut-motion/assets/atlas/styles/070-topographic-survey/code.js +895 -0
  221. package/skills/aicut-motion/assets/atlas/styles/070-topographic-survey/poster.jpg +0 -0
  222. package/skills/aicut-motion/assets/atlas/styles/070-topographic-survey/style.json +13 -0
  223. package/skills/aicut-motion/assets/atlas/styles/071-pointillist-afternoon/code.js +563 -0
  224. package/skills/aicut-motion/assets/atlas/styles/071-pointillist-afternoon/poster.jpg +0 -0
  225. package/skills/aicut-motion/assets/atlas/styles/071-pointillist-afternoon/style.json +13 -0
  226. package/skills/aicut-motion/assets/atlas/styles/072-vector-arcade-1980/code.js +627 -0
  227. package/skills/aicut-motion/assets/atlas/styles/072-vector-arcade-1980/poster.jpg +0 -0
  228. package/skills/aicut-motion/assets/atlas/styles/072-vector-arcade-1980/style.json +13 -0
  229. package/skills/aicut-motion/assets/atlas/styles/073-patent-drawing/code.js +1096 -0
  230. package/skills/aicut-motion/assets/atlas/styles/073-patent-drawing/poster.jpg +0 -0
  231. package/skills/aicut-motion/assets/atlas/styles/073-patent-drawing/style.json +13 -0
  232. package/skills/aicut-motion/assets/atlas/styles/074-bauhaus-poster/code.js +595 -0
  233. package/skills/aicut-motion/assets/atlas/styles/074-bauhaus-poster/poster.jpg +0 -0
  234. package/skills/aicut-motion/assets/atlas/styles/074-bauhaus-poster/style.json +13 -0
  235. package/skills/aicut-motion/assets/atlas/styles/075-bitmap-paint-doodle/code.js +665 -0
  236. package/skills/aicut-motion/assets/atlas/styles/075-bitmap-paint-doodle/poster.jpg +0 -0
  237. package/skills/aicut-motion/assets/atlas/styles/075-bitmap-paint-doodle/style.json +13 -0
  238. package/skills/aicut-motion/assets/atlas/styles/076-nail-thread-string-art/code.js +645 -0
  239. package/skills/aicut-motion/assets/atlas/styles/076-nail-thread-string-art/poster.jpg +0 -0
  240. package/skills/aicut-motion/assets/atlas/styles/076-nail-thread-string-art/style.json +13 -0
  241. package/skills/aicut-motion/assets/atlas/styles/077-ridgeline/code.js +436 -0
  242. package/skills/aicut-motion/assets/atlas/styles/077-ridgeline/poster.jpg +0 -0
  243. package/skills/aicut-motion/assets/atlas/styles/077-ridgeline/style.json +13 -0
  244. package/skills/aicut-motion/assets/atlas/styles/078-sketchbook-graphite/code.js +1237 -0
  245. package/skills/aicut-motion/assets/atlas/styles/078-sketchbook-graphite/poster.jpg +0 -0
  246. package/skills/aicut-motion/assets/atlas/styles/078-sketchbook-graphite/style.json +13 -0
  247. package/skills/aicut-motion/assets/atlas/styles/079-teletext-page/code.js +622 -0
  248. package/skills/aicut-motion/assets/atlas/styles/079-teletext-page/poster.jpg +0 -0
  249. package/skills/aicut-motion/assets/atlas/styles/079-teletext-page/style.json +13 -0
  250. package/skills/aicut-motion/assets/atlas/styles/080-silkscreen-grid/code.js +524 -0
  251. package/skills/aicut-motion/assets/atlas/styles/080-silkscreen-grid/poster.jpg +0 -0
  252. package/skills/aicut-motion/assets/atlas/styles/080-silkscreen-grid/style.json +13 -0
  253. package/skills/aicut-motion/assets/atlas/styles/081-guilloch-security-print/code.js +689 -0
  254. package/skills/aicut-motion/assets/atlas/styles/081-guilloch-security-print/poster.jpg +0 -0
  255. package/skills/aicut-motion/assets/atlas/styles/081-guilloch-security-print/style.json +13 -0
  256. package/skills/aicut-motion/assets/atlas/styles/082-ascii-demoscene/code.js +574 -0
  257. package/skills/aicut-motion/assets/atlas/styles/082-ascii-demoscene/poster.jpg +0 -0
  258. package/skills/aicut-motion/assets/atlas/styles/082-ascii-demoscene/style.json +13 -0
  259. package/skills/aicut-motion/assets/atlas/styles/083-international-typographic-style/code.js +469 -0
  260. package/skills/aicut-motion/assets/atlas/styles/083-international-typographic-style/poster.jpg +0 -0
  261. package/skills/aicut-motion/assets/atlas/styles/083-international-typographic-style/style.json +13 -0
  262. package/skills/aicut-motion/assets/atlas/styles/084-flow-field/code.js +531 -0
  263. package/skills/aicut-motion/assets/atlas/styles/084-flow-field/poster.jpg +0 -0
  264. package/skills/aicut-motion/assets/atlas/styles/084-flow-field/style.json +13 -0
  265. package/skills/aicut-motion/assets/atlas/styles/085-macpaint-1984/code.js +675 -0
  266. package/skills/aicut-motion/assets/atlas/styles/085-macpaint-1984/poster.jpg +0 -0
  267. package/skills/aicut-motion/assets/atlas/styles/085-macpaint-1984/style.json +13 -0
  268. package/skills/aicut-motion/assets/atlas/styles/086-multi-scale-truchet/code.js +609 -0
  269. package/skills/aicut-motion/assets/atlas/styles/086-multi-scale-truchet/poster.jpg +0 -0
  270. package/skills/aicut-motion/assets/atlas/styles/086-multi-scale-truchet/style.json +13 -0
  271. package/skills/aicut-motion/references/design-systems/README.md +1 -1
  272. package/skills/aicut-motion/references/motion-delivery.md +55 -0
  273. package/skills/aicut-motion/references/pages.md +1 -1
  274. package/skills/aicut-motion/references/style-index.json +690 -0
  275. package/skills/aicut-motion/references/style-research.md +73 -0
  276. package/skills/aicut-motion/references/style-selection.md +71 -0
  277. package/skills/aicut-motion/scripts/atlas-viewer.html +195 -0
  278. package/skills/aicut-motion/scripts/atlas.mjs +109 -0
  279. package/studio/client.mjs +3 -3
  280. package/studio/server/fetch-github.mjs +14 -3
  281. package/studio/server/server.mjs +71 -6
  282. package/studio/server/skill-summaries.mjs +60 -0
  283. package/studio/server/skills.mjs +121 -7
  284. package/studio/server/styles-store.mjs +235 -0
  285. package/studio/server/template-posters.mjs +2 -2
  286. package/studio/server/templates-page.mjs +93 -93
  287. package/studio/server/templates.mjs +32 -7
  288. package/studio/ui/dist/assets/ExportCenter-DasulhAv.js +1 -0
  289. package/studio/ui/dist/assets/SettingsModal-BZw0Hz2_.js +2 -0
  290. package/studio/ui/dist/assets/apple-touch-icon-ClxQ7j-O.png +0 -0
  291. package/studio/ui/dist/assets/es-C8XPZARI.js +1 -0
  292. package/studio/ui/dist/assets/favicon-Blwx8Trs.png +0 -0
  293. package/studio/ui/dist/assets/index-BjJVmBzB.js +1623 -0
  294. package/studio/ui/dist/assets/index-C3BfKZFO.css +1 -0
  295. package/studio/ui/dist/assets/ja-BeNkdaEj.js +1 -0
  296. package/studio/ui/dist/assets/ko-DcTVhdzK.js +1 -0
  297. package/studio/ui/dist/assets/zh-CN-Cg51ctbL.js +1 -0
  298. package/studio/ui/dist/index.html +4 -3
  299. package/studio/ui/dist/assets/ExportCenter-F-2vF-lQ.js +0 -1
  300. package/studio/ui/dist/assets/SettingsModal-BgVYguNu.js +0 -2
  301. package/studio/ui/dist/assets/es-BRUzvuoM.js +0 -1
  302. package/studio/ui/dist/assets/index-Bhg-9dA3.css +0 -1
  303. package/studio/ui/dist/assets/index-CWur1Iw9.js +0 -1625
  304. package/studio/ui/dist/assets/ja-Cth-uDcW.js +0 -1
  305. package/studio/ui/dist/assets/ko-upvw591D.js +0 -1
  306. package/studio/ui/dist/assets/zh-CN-BCfJFazB.js +0 -1
@@ -0,0 +1,757 @@
1
+ {
2
+ const HZ = 438, VPX = 640, FOC = 420, CAMH = 1.25;
3
+ const proj = (x, h, z) => [VPX + (x / z) * FOC, HZ + ((CAMH - h) / z) * FOC];
4
+
5
+ function skyAndStars(c, W, t) {
6
+ const g = c.createLinearGradient(0, 0, 0, HZ);
7
+ g.addColorStop(0, '#05021a'); g.addColorStop(0.45, '#1c0640'); g.addColorStop(0.78, '#5a0f6e'); g.addColorStop(0.94, '#c41a7e'); g.addColorStop(1, '#ff4fa0');
8
+ c.fillStyle = g; c.fillRect(0, 0, W, HZ + 2);
9
+ const r = H.rng(404);
10
+ for (let i = 0; i < 220; i++) {
11
+ const x = r.range(0, W), y = Math.pow(r(), 1.6) * HZ * 0.8, s = r.range(0.6, 1.8);
12
+ const tw = (0.55 + 0.45 * Math.sin(t * r.range(1, 4) + i)) * H.clamp((t - r() * 1.4) / 0.25);
13
+ c.fillStyle = `rgba(255,${r.int(200, 255)},255,${(0.35 + r() * 0.6) * tw})`;
14
+ c.fillRect(x, y, s, s);
15
+ if (s > 1.65 && y < HZ * 0.5) { // cross glint
16
+ c.fillStyle = `rgba(200,240,255,${0.5 * tw})`; c.fillRect(x - 6, y + s / 2 - 0.5, 12 + s, 1); c.fillRect(x + s / 2 - 0.5, y - 6, 1, 12 + s);
17
+ }
18
+ }
19
+ }
20
+
21
+ function sun(c0, W, Hh, cx, cy, R, t) {
22
+ const L = H.layer(W, Hh), c = L.getContext('2d');
23
+ // outer bloom
24
+ const bg = c0.createRadialGradient(cx, cy, R * 0.6, cx, cy, R * 2.1);
25
+ bg.addColorStop(0, 'rgba(255,90,150,0.55)'); bg.addColorStop(0.5, 'rgba(255,40,140,0.15)'); bg.addColorStop(1, 'rgba(255,40,140,0)');
26
+ c0.fillStyle = bg; c0.fillRect(cx - R * 2.2, cy - R * 2.2, R * 4.4, R * 4.4);
27
+ c.beginPath(); c.arc(cx, cy, R, 0, Math.PI * 2);
28
+ const g = c.createLinearGradient(0, cy - R, 0, cy + R * 0.6);
29
+ g.addColorStop(0, '#fff6a0'); g.addColorStop(0.3, '#ffd23f'); g.addColorStop(0.55, '#ff8a3d'); g.addColorStop(0.8, '#ff3d7f'); g.addColorStop(1, '#d4147f');
30
+ c.fillStyle = g; c.fill();
31
+ c.globalCompositeOperation = 'destination-out';
32
+ const sc = (t * 10) % 22;
33
+ for (let k = -1; k < 14; k++) {
34
+ const y = cy - R * 0.18 + k * 22 + sc;
35
+ const f = H.clamp((y - (cy - R * 0.22)) / (R * 1.0));
36
+ c.fillRect(cx - R, y, R * 2, 2 + f * 11);
37
+ }
38
+ c0.drawImage(L, 0, 0);
39
+ }
40
+
41
+ function mountains(c, t, hs = 1) {
42
+ const nz = H.makeNoise(19);
43
+ const xs = [], zs = [];
44
+ for (let x = -64; x <= 64; x += 2.6) xs.push(x);
45
+ for (let z = 80; z >= 26; z -= 2.4) zs.push(z);
46
+ const hAt = (x, z) => {
47
+ const ax = Math.abs(x);
48
+ const ridge = H.smooth(4.5, 15, ax);
49
+ const n = nz.fbm2(x * 0.075 + 3, z * 0.09, 4) * 0.5 + 0.5;
50
+ const peaks = Math.pow(n, 1.6) * 36 + 2;
51
+ const back = H.smooth(30, 60, z) * 0.5 + 0.5;
52
+ const front = H.smooth(26, 40, z);
53
+ return ridge * peaks * back * front * hs;
54
+ };
55
+ const P = zs.map((z) => xs.map((x) => { const h = hAt(x, z); return [...proj(x, h, z), h]; }));
56
+ c.save();
57
+ c.lineJoin = 'round';
58
+ for (let j = 0; j < zs.length - 1; j++) {
59
+ const depth = 1 - j / (zs.length - 1); // 1 far ... 0 near
60
+ for (let i = 0; i < xs.length - 1; i++) {
61
+ const a = P[j][i], b = P[j][i + 1], cc = P[j + 1][i + 1], d = P[j + 1][i];
62
+ const hh = (a[2] + b[2] + cc[2] + d[2]) / 4;
63
+ if (hh < 0.01) continue;
64
+ const shade = H.clamp(hh / 26);
65
+ const col = H.mix('#120531', '#3a0f63', shade * 0.8);
66
+ c.fillStyle = H.rgba(col, 1);
67
+ c.beginPath(); c.moveTo(a[0], a[1]); c.lineTo(b[0], b[1]); c.lineTo(cc[0], cc[1]); c.lineTo(d[0], d[1]); c.closePath(); c.fill();
68
+ // wire: purple-magenta, brighter on the near rows, cyan tint on peaks
69
+ const lc = H.mix('#b02cff', '#4ff3ff', H.smooth(0.55, 1, shade));
70
+ const qh = Math.max(Math.abs(d[1] - a[1]), Math.abs(cc[1] - b[1]));
71
+ const dens = H.clamp((qh - 1) / 7);
72
+ c.strokeStyle = H.rgba(lc, (0.3 + 0.6 * (1 - depth)) * dens);
73
+ c.lineWidth = 1.1;
74
+ c.stroke();
75
+ // diagonal for triangle mesh look
76
+ c.beginPath(); c.moveTo(a[0], a[1]); c.lineTo(cc[0], cc[1]); c.strokeStyle = H.rgba(lc, (0.15 + 0.3 * (1 - depth)) * dens); c.stroke();
77
+ }
78
+ }
79
+ c.restore();
80
+ }
81
+
82
+ function floorAndRoad(c, W, Hh, t, rev = 1, hor = 1) {
83
+ const yTop = HZ + 1;
84
+ const g = c.createLinearGradient(0, yTop, 0, Hh);
85
+ g.addColorStop(0, '#2a0838'); g.addColorStop(0.15, '#12041f'); g.addColorStop(1, '#07010f');
86
+ c.fillStyle = g; c.fillRect(0, yTop, W, Hh - yTop);
87
+ const zFar = 34, zNear = 0.5;
88
+ const road = 2.4;
89
+ c.save();
90
+ const yRev = HZ + Math.pow(rev, 2.2) * (Hh - HZ + 4); // grid races from the horizon toward camera
91
+ c.beginPath(); c.rect(0, HZ, W, yRev - HZ); c.clip();
92
+ const strokeGrid = (lw, col) => {
93
+ c.strokeStyle = col; c.lineWidth = lw; c.beginPath();
94
+ for (let x = road + 0.0001; x <= 90; x += 2.6) for (const s of [-1, 1]) {
95
+ const [x0, y0] = proj(s * x, 0, zNear), [x1, y1] = proj(s * x, 0, zFar + 40);
96
+ c.moveTo(x0, y0); c.lineTo(x1, y1);
97
+ }
98
+ const off = (t * 7) % 2.6;
99
+ for (let z = 1 - off; z < zFar + 40; z += 2.6) {
100
+ if (z < 0.3) continue;
101
+ const [, y] = proj(0, 0, z);
102
+ const [xl] = proj(-road, 0, z), [xr] = proj(road, 0, z);
103
+ c.moveTo(0, y); c.lineTo(xl, y); c.moveTo(xr, y); c.lineTo(W, y);
104
+ }
105
+ c.stroke();
106
+ };
107
+ c.globalCompositeOperation = 'lighter';
108
+ strokeGrid(6, 'rgba(255,30,170,0.12)');
109
+ strokeGrid(2.6, 'rgba(255,50,190,0.35)');
110
+ strokeGrid(1.1, 'rgba(255,150,230,0.9)');
111
+ c.globalCompositeOperation = 'source-over';
112
+ // road surface
113
+ const [l0x, l0y] = proj(-road, 0, zNear), [r0x] = proj(road, 0, zNear), [l1x, l1y] = proj(-road, 0, 80), [r1x] = proj(road, 0, 80);
114
+ const rg = c.createLinearGradient(0, HZ, 0, Hh);
115
+ rg.addColorStop(0, '#1a0830'); rg.addColorStop(1, '#0b0418');
116
+ c.fillStyle = rg; c.beginPath(); c.moveTo(l0x, l0y); c.lineTo(l1x, l1y); c.lineTo(r1x, l1y); c.lineTo(r0x, l0y); c.closePath(); c.fill();
117
+ // sun reflection streak on the road
118
+ const sg = c.createLinearGradient(0, HZ, 0, Hh);
119
+ sg.addColorStop(0, 'rgba(255,120,120,0.55)'); sg.addColorStop(0.35, 'rgba(255,60,160,0.15)'); sg.addColorStop(1, 'rgba(255,60,160,0)');
120
+ c.fillStyle = sg; c.beginPath(); c.moveTo(VPX - 3, HZ); c.lineTo(VPX + 3, HZ); c.lineTo(VPX + 150, Hh); c.lineTo(VPX - 150, Hh); c.fill();
121
+ // edges (cyan neon)
122
+ c.globalCompositeOperation = 'lighter';
123
+ for (const [lw, a] of [[10, 0.12], [4, 0.35], [1.6, 1]]) {
124
+ c.strokeStyle = `rgba(80,240,255,${a})`; c.lineWidth = lw;
125
+ c.beginPath(); c.moveTo(l0x, l0y); c.lineTo(l1x, l1y); c.moveTo(r0x, l0y); c.lineTo(r1x, l1y); c.stroke();
126
+ }
127
+ // centre dashes
128
+ const off = (t * 7) % 3.2;
129
+ for (let z = 0.6 - off; z < 60; z += 3.2) {
130
+ const z0 = Math.max(0.35, z), z1 = z + 1.5;
131
+ if (z1 < 0.4) continue;
132
+ const [ax, ay] = proj(-0.08, 0, z0), [bx] = proj(0.08, 0, z0), [cx, cy] = proj(0.08, 0, z1), [dx] = proj(-0.08, 0, z1);
133
+ c.fillStyle = 'rgba(255,240,200,0.85)';
134
+ c.beginPath(); c.moveTo(ax, ay); c.lineTo(bx, ay); c.lineTo(cx, cy); c.lineTo(dx, cy); c.fill();
135
+ }
136
+ c.restore();
137
+ // horizon flare line
138
+ c.save(); c.globalCompositeOperation = 'lighter';
139
+ const hl = c.createLinearGradient(0, 0, W, 0);
140
+ hl.addColorStop(0, 'rgba(255,80,180,0)'); hl.addColorStop(0.5, 'rgba(255,200,230,0.95)'); hl.addColorStop(1, 'rgba(255,80,180,0)');
141
+ c.save(); c.beginPath(); c.rect(W / 2 * (1 - hor), 0, W * hor, Hh); c.clip();
142
+ c.fillStyle = hl; c.fillRect(0, HZ - 1, W, 2.5);
143
+ const hg = c.createLinearGradient(0, HZ - 10, 0, HZ + 30);
144
+ hg.addColorStop(0, 'rgba(255,60,160,0)'); hg.addColorStop(0.3, 'rgba(255,60,160,0.35)'); hg.addColorStop(1, 'rgba(255,60,160,0)');
145
+ c.fillStyle = hg; c.fillRect(0, HZ - 10, W, 40);
146
+ c.restore(); c.restore();
147
+ }
148
+
149
+ function bloom(ctx, W, Hh, amt, blur) {
150
+ const s = H.layer(W / 4, Hh / 4), sc = s.getContext('2d');
151
+ sc.filter = `blur(${blur}px)`; sc.drawImage(ctx.canvas, 0, 0, W / 4, Hh / 4);
152
+ ctx.save(); ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.globalCompositeOperation = 'screen'; ctx.globalAlpha = amt;
153
+ ctx.imageSmoothingEnabled = true; ctx.drawImage(s, 0, 0, ctx.canvas.width, ctx.canvas.height); ctx.restore();
154
+ }
155
+
156
+ function chromeTitle(c, text, cx, by, size) {
157
+ c.save();
158
+ c.font = `800 ${size}px "Orbitron"`; c.textAlign = 'center'; c.textBaseline = 'alphabetic';
159
+ c.letterSpacing = '4px';
160
+ const top = by - size * 0.74, bot = by + 2;
161
+ c.translate(cx, by); c.transform(1, 0, -0.22, 1, 0, 0); c.translate(-cx, -by);
162
+ // extrusion
163
+ for (let i = 14; i >= 1; i--) {
164
+ const k = i / 14;
165
+ c.fillStyle = H.rgba(H.mix('#ff2fb0', '#1a0533', 0.35 + k * 0.6), 1);
166
+ c.fillText(text, cx + i * 0.55, by + i * 0.9);
167
+ }
168
+ // dark outline
169
+ c.lineJoin = 'round';
170
+ c.strokeStyle = '#12032a'; c.lineWidth = 9; c.strokeText(text, cx, by);
171
+ // chrome fill
172
+ const g = c.createLinearGradient(0, top, 0, bot);
173
+ g.addColorStop(0, '#0e2a6b'); g.addColorStop(0.18, '#3d7fd6'); g.addColorStop(0.42, '#d9f2ff'); g.addColorStop(0.5, '#ffffff');
174
+ g.addColorStop(0.505, '#2a0a2e'); g.addColorStop(0.58, '#5a1d3a'); g.addColorStop(0.75, '#d0602a'); g.addColorStop(0.9, '#ffc06a'); g.addColorStop(1, '#fff1c8');
175
+ c.fillStyle = g; c.fillText(text, cx, by);
176
+ // bevel: light upper edge, dark lower edge (stroke clipped to glyph interior via source-atop on a layer)
177
+ c.restore();
178
+ const L = H.layer(c.canvas.width, c.canvas.height), lc = L.getContext('2d');
179
+ lc.font = `800 ${size}px "Orbitron"`; lc.textAlign = 'center'; lc.letterSpacing = '4px';
180
+ lc.translate(cx, by); lc.transform(1, 0, -0.22, 1, 0, 0); lc.translate(-cx, -by);
181
+ lc.fillStyle = '#000'; lc.fillText(text, cx, by);
182
+ lc.globalCompositeOperation = 'source-atop';
183
+ lc.strokeStyle = 'rgba(255,255,255,0.95)'; lc.lineWidth = 3; lc.strokeText(text, cx - 1.5, by - 2);
184
+ lc.strokeStyle = 'rgba(40,0,60,0.55)'; lc.lineWidth = 3; lc.strokeText(text, cx + 1.5, by + 2.5);
185
+ lc.globalCompositeOperation = 'destination-out';
186
+ lc.fillStyle = '#000'; lc.fillText(text, cx + 0.5, by + 0.5); // keep only the rim
187
+ c.drawImage(L, 0, 0);
188
+ // pink rim stroke
189
+ c.save();
190
+ c.font = `800 ${size}px "Orbitron"`; c.textAlign = 'center'; c.letterSpacing = '4px';
191
+ c.translate(cx, by); c.transform(1, 0, -0.22, 1, 0, 0); c.translate(-cx, -by);
192
+ c.strokeStyle = 'rgba(255,170,240,0.55)'; c.lineWidth = 1.2; c.strokeText(text, cx, by);
193
+ c.restore();
194
+ }
195
+
196
+ function glint(c, x, y, s, a) {
197
+ c.save(); c.globalCompositeOperation = 'lighter';
198
+ const rg = c.createRadialGradient(x, y, 0, x, y, s * 0.5);
199
+ rg.addColorStop(0, `rgba(255,255,255,${a})`); rg.addColorStop(1, 'rgba(255,200,255,0)');
200
+ c.fillStyle = rg; c.fillRect(x - s, y - s, s * 2, s * 2);
201
+ c.fillStyle = `rgba(255,255,255,${a})`;
202
+ c.beginPath(); c.moveTo(x - s, y); c.lineTo(x, y - 1.6); c.lineTo(x + s, y); c.lineTo(x, y + 1.6); c.fill();
203
+ c.beginPath(); c.moveTo(x, y - s * 0.7); c.lineTo(x - 1.4, y); c.lineTo(x, y + s * 0.7); c.lineTo(x + 1.4, y); c.fill();
204
+ c.restore();
205
+ }
206
+
207
+ // =====================================================================================
208
+ // EXPLAINER: a night drive. Examples ride the neon highway into a wireframe AI core on the horizon,
209
+ // a dashboard HUD carries the odometer counter, synth-knob weights and the GUESS/CHECK/ADJUST tubes;
210
+ // the camera tilts up into the sky for the accuracy chart and back down for the payoff.
211
+ // =====================================================================================
212
+ const E = H.ease, cl = H.clamp;
213
+ function neonStroke(c, col, w, draw) {
214
+ c.save(); c.lineCap = 'round'; c.lineJoin = 'round';
215
+ c.globalCompositeOperation = 'lighter';
216
+ c.strokeStyle = col; c.globalAlpha = 0.18; c.lineWidth = w * 5; c.beginPath(); draw(); c.stroke();
217
+ c.globalAlpha = 0.45; c.lineWidth = w * 2.2; c.beginPath(); draw(); c.stroke();
218
+ c.globalAlpha = 1; c.strokeStyle = '#fff'; c.lineWidth = Math.max(1, w * 0.7); c.beginPath(); draw(); c.stroke();
219
+ c.restore();
220
+ }
221
+ function neonText(c, txt, x, y, font, col, on = 1, align = 'center') {
222
+ if (on <= 0) return;
223
+ c.save(); c.font = font; c.textAlign = align; c.textBaseline = 'middle';
224
+ // dark backing so the tube separates from the sun / grid behind it
225
+ c.globalAlpha = on * 0.55; c.shadowColor = 'rgba(14,0,34,0.9)'; c.shadowBlur = 12; c.fillStyle = 'rgba(20,0,44,0.6)'; c.fillText(txt, x, y);
226
+ c.globalAlpha = on; c.shadowColor = col; c.shadowBlur = 22; c.fillStyle = col; c.fillText(txt, x, y);
227
+ c.shadowBlur = 8; c.fillText(txt, x, y);
228
+ // hot tube core: a thin lightened stroke, plus a light wash (keeps the colour, no pastel wash-out)
229
+ c.shadowBlur = 0; const fs = parseFloat((/(\d+(?:\.\d+)?)px/.exec(font) || [0, 24])[1]);
230
+ c.strokeStyle = H.rgba(H.mix(col, '#ffffff', 0.62), 0.9); c.lineWidth = Math.max(0.8, fs * 0.04); c.lineJoin = 'round'; c.strokeText(txt, x, y);
231
+ c.fillStyle = H.rgba(H.mix(col, '#ffffff', 0.45), 1); c.globalAlpha = on * 0.22; c.fillText(txt, x, y);
232
+ c.restore();
233
+ }
234
+ function deadTube(c, txt, x, y, font, col) { // unlit glass tube: faint tinted glass, a dim outline and a cold highlight
235
+ c.save(); c.font = font; c.textAlign = 'center'; c.textBaseline = 'middle'; c.lineJoin = 'round';
236
+ c.fillStyle = 'rgba(255,120,220,0.08)'; c.fillText(txt, x, y);
237
+ c.strokeStyle = col; c.globalAlpha = 0.6; c.lineWidth = 1.8; c.strokeText(txt, x, y);
238
+ c.globalAlpha = 0.35; c.strokeStyle = 'rgba(230,220,255,1)'; c.lineWidth = 0.7; c.strokeText(txt, x - 0.6, y - 0.8);
239
+ c.restore(); }
240
+ const flick = (t, t0) => { if (t < t0) return 0; const d = t - t0; if (d > 0.32) return 1; return [1, 0, 1, 0.3, 0, 1, 1, 0.5, 1, 1][Math.floor(d / 0.032)] ?? 1; };
241
+ function neonArrow(c, pts, prog, col, w = 2.5) {
242
+ let total = 0; const L = []; for (let i = 0; i < pts.length - 1; i++) { const l = Math.hypot(pts[i + 1][0] - pts[i][0], pts[i + 1][1] - pts[i][1]); L.push(l); total += l; }
243
+ let rem = total * cl(prog); const out = [pts[0]]; let dir = [1, 0];
244
+ for (let i = 0; i < L.length && rem > 0; i++) { const u = Math.min(1, rem / L[i]); const p = [H.lerp(pts[i][0], pts[i + 1][0], u), H.lerp(pts[i][1], pts[i + 1][1], u)]; out.push(p); dir = [(pts[i + 1][0] - pts[i][0]) / L[i], (pts[i + 1][1] - pts[i][1]) / L[i]]; rem -= L[i]; }
245
+ neonStroke(c, col, w, () => {
246
+ c.moveTo(...out[0]); for (const p of out) c.lineTo(...p);
247
+ if (prog >= 1) { const [ex, ey] = out[out.length - 1], a = Math.atan2(dir[1], dir[0]); c.moveTo(ex - Math.cos(a - 0.5) * 16, ey - Math.sin(a - 0.5) * 16); c.lineTo(ex, ey); c.lineTo(ex - Math.cos(a + 0.5) * 16, ey - Math.sin(a + 0.5) * 16); }
248
+ });
249
+ }
250
+ function neonIcon(c, kind, x, y, s, col) { // cat / dog line icon centred at x,y
251
+ neonStroke(c, col, 1.6 * s, () => {
252
+ if (kind === 'cat') {
253
+ c.moveTo(x - 16 * s, y - 2 * s); c.lineTo(x - 13 * s, y - 20 * s); c.lineTo(x - 4 * s, y - 11 * s);
254
+ c.moveTo(x + 16 * s, y - 2 * s); c.lineTo(x + 13 * s, y - 20 * s); c.lineTo(x + 4 * s, y - 11 * s);
255
+ c.moveTo(x + 16 * s, y + 2 * s); c.ellipse(x, y + 2 * s, 16 * s, 13 * s, 0, 0, 7);
256
+ c.moveTo(x - 6 * s, y); c.arc(x - 6 * s, y, 0.8 * s, 0, 7); c.moveTo(x + 6 * s, y); c.arc(x + 6 * s, y, 0.8 * s, 0, 7);
257
+ c.moveTo(x - 24 * s, y + 4 * s); c.lineTo(x - 10 * s, y + 6 * s); c.moveTo(x + 24 * s, y + 4 * s); c.lineTo(x + 10 * s, y + 6 * s);
258
+ } else {
259
+ c.moveTo(x + 13 * s, y); c.ellipse(x, y, 13 * s, 16 * s, 0, 0, 7);
260
+ c.moveTo(x - 12 * s, y - 10 * s); c.ellipse(x - 17 * s, y - 2 * s, 5 * s, 13 * s, 0.3, 0, 7);
261
+ c.moveTo(x + 22 * s, y - 2 * s); c.ellipse(x + 17 * s, y - 2 * s, 5 * s, 13 * s, -0.3, 0, 7);
262
+ c.moveTo(x - 5 * s, y - 4 * s); c.arc(x - 5 * s, y - 4 * s, 0.8 * s, 0, 7); c.moveTo(x + 5 * s, y - 4 * s); c.arc(x + 5 * s, y - 4 * s, 0.8 * s, 0, 7);
263
+ c.moveTo(x + 3 * s, y + 7 * s); c.ellipse(x, y + 7 * s, 3 * s, 2 * s, 0, 0, 7);
264
+ }
265
+ });
266
+ }
267
+ function exCard(c, x, y, s, kind, label, a = 1) {
268
+ c.save(); c.globalAlpha = a;
269
+ c.fillStyle = 'rgba(12,2,30,0.75)'; c.beginPath(); c.roundRect(x - 34 * s, y - 34 * s, 68 * s, 84 * s, 8 * s); c.fill();
270
+ neonStroke(c, '#4ff3ff', 1.4 * s, () => c.roundRect(x - 34 * s, y - 34 * s, 68 * s, 84 * s, 8 * s));
271
+ neonIcon(c, kind, x, y - 4 * s, s, kind === 'cat' ? '#ffb347' : '#ff7ad9');
272
+ if (s > 0.25) neonText(c, label, x, y + 36 * s, `800 ${Math.max(6, 17 * s)}px "Orbitron"`, '#ffe066', a);
273
+ c.restore();
274
+ }
275
+ function core(c, x, y, R, t, pulse, on) {
276
+ if (on <= 0 || R < 1) return;
277
+ c.save(); c.globalAlpha = on;
278
+ const g = c.createRadialGradient(x, y, 0, x, y, R * 1.15); g.addColorStop(0, 'rgba(20,0,40,0.92)'); g.addColorStop(0.85, 'rgba(30,0,60,0.85)'); g.addColorStop(1, 'rgba(30,0,60,0)');
279
+ c.fillStyle = g; c.beginPath(); c.arc(x, y, R * 1.15, 0, 7); c.fill();
280
+ const col = pulse > 0 ? H.rgba(H.mix('#c86bff', '#ffffff', pulse), 1) : '#c86bff';
281
+ neonStroke(c, col, 1.6, () => {
282
+ c.moveTo(x + R, y); c.arc(x, y, R, 0, 7);
283
+ for (let k = 1; k < 6; k++) { const a = (k / 6) * Math.PI; const ry = R * Math.cos(a), rx = R * Math.sin(a); c.moveTo(x + rx, y + ry); c.ellipse(x, y + ry, rx, rx * 0.28, 0, 0, 7); }
284
+ for (let k = 0; k < 6; k++) { const a = (k / 6) * Math.PI + t * 0.6; const rx = Math.abs(R * Math.cos(a)); c.moveTo(x, y - R); c.ellipse(x, y, Math.max(0.5, rx), R, 0, -Math.PI / 2, Math.PI * 1.5); }
285
+ });
286
+ c.restore();
287
+ }
288
+ function knob(c, x, y, r, v, label, hot) {
289
+ c.save();
290
+ const g = c.createRadialGradient(x - r * 0.3, y - r * 0.3, 1, x, y, r); g.addColorStop(0, '#5a5a78'); g.addColorStop(1, '#0d0a1c');
291
+ c.fillStyle = g; c.beginPath(); c.arc(x, y, r, 0, 7); c.fill();
292
+ c.strokeStyle = 'rgba(200,200,255,0.5)'; c.lineWidth = 1.5; c.stroke();
293
+ const a0 = Math.PI * 0.75, a1 = Math.PI * 2.25, a = H.lerp(a0, a1, v);
294
+ for (let i = 0; i <= 10; i++) { const aa = H.lerp(a0, a1, i / 10); const on = aa <= a + 0.01; c.fillStyle = on ? (hot ? '#ff4fd8' : '#4ff3ff') : 'rgba(120,120,160,0.35)'; c.beginPath(); c.arc(x + Math.cos(aa) * (r + 9), y + Math.sin(aa) * (r + 9), 2.2, 0, 7); c.fill(); }
295
+ c.restore();
296
+ neonStroke(c, hot ? '#ff4fd8' : '#4ff3ff', 1.6, () => { c.moveTo(x + Math.cos(a) * r * 0.25, y + Math.sin(a) * r * 0.25); c.lineTo(x + Math.cos(a) * r * 0.85, y + Math.sin(a) * r * 0.85); });
297
+ neonText(c, label, x, y + r + 30, '800 24px "Orbitron"', '#b9a2ff');
298
+ }
299
+ function odometer(c, x, y, value, on) {
300
+ const s = Math.round(value).toLocaleString('en-US').padStart(9, ' ');
301
+ c.save(); c.globalAlpha = on;
302
+ // chrome bezel around a smoked-glass window
303
+ const bz = c.createLinearGradient(0, y - 52, 0, y + 48);
304
+ bz.addColorStop(0, '#9aa6d8'); bz.addColorStop(0.18, '#2a2448'); bz.addColorStop(0.55, '#120c26'); bz.addColorStop(0.82, '#3a2a5a'); bz.addColorStop(1, '#c28ad8');
305
+ c.fillStyle = bz; c.beginPath(); c.roundRect(x - 251, y - 52, 502, 100, 11); c.fill();
306
+ c.fillStyle = '#05010e'; c.beginPath(); c.roundRect(x - 245, y - 46, 490, 88, 8); c.fill();
307
+ c.font = '800 64px "Orbitron"'; c.textAlign = 'center'; c.textBaseline = 'middle';
308
+ const frac = (value % 1);
309
+ c.save();
310
+ c.beginPath(); c.rect(x - 243, y - 44, 486, 84); c.clip();
311
+ // drum wheels: each digit sits on its own shaded cylinder
312
+ let cx = x - 232;
313
+ for (let i = 0; i < s.length; i++) {
314
+ const w = s[i] === ',' ? 22 : 54;
315
+ if (s[i] !== ',') {
316
+ const dg = c.createLinearGradient(0, y - 44, 0, y + 40);
317
+ dg.addColorStop(0, '#020008'); dg.addColorStop(0.5, '#0a0620'); dg.addColorStop(1, '#020008');
318
+ c.fillStyle = dg; c.fillRect(cx + 2, y - 44, w - 4, 84);
319
+ c.fillStyle = 'rgba(79,243,255,0.06)'; c.fillRect(cx + 2, y - 2, w - 4, 1);
320
+ }
321
+ cx += w;
322
+ }
323
+ // last digit rolls like a mechanical counter
324
+ cx = x - 232;
325
+ for (let i = 0; i < s.length; i++) {
326
+ const ch = s[i], w = ch === ',' ? 22 : 54;
327
+ if (ch !== ' ') {
328
+ c.shadowColor = '#4ff3ff'; c.shadowBlur = 16; c.fillStyle = '#aaffff';
329
+ if (i === s.length - 1 && value < 1e6) { c.fillText(ch, cx + w / 2, y - frac * 72); c.fillText(String((+ch + 1) % 10), cx + w / 2, y + 72 - frac * 72); }
330
+ else c.fillText(ch, cx + w / 2, y);
331
+ }
332
+ cx += w;
333
+ }
334
+ c.shadowBlur = 0;
335
+ // drum curvature: digits fade into the dark at the top and bottom of the window
336
+ const fd = c.createLinearGradient(0, y - 44, 0, y + 40);
337
+ fd.addColorStop(0, 'rgba(3,0,10,0.95)'); fd.addColorStop(0.2, 'rgba(3,0,10,0.25)'); fd.addColorStop(0.36, 'rgba(3,0,10,0)');
338
+ fd.addColorStop(0.64, 'rgba(3,0,10,0)'); fd.addColorStop(0.8, 'rgba(3,0,10,0.25)'); fd.addColorStop(1, 'rgba(3,0,10,0.95)');
339
+ c.fillStyle = fd; c.fillRect(x - 243, y - 44, 486, 84);
340
+ // inner shadow of the recessed window
341
+ c.shadowColor = 'rgba(0,0,0,0.9)'; c.shadowBlur = 14; c.shadowOffsetY = 4;
342
+ c.strokeStyle = '#000'; c.lineWidth = 10; c.strokeRect(x - 248, y - 49, 496, 94);
343
+ c.shadowColor = 'transparent';
344
+ // glass glare: diagonal sheen across the upper half
345
+ const gl = c.createLinearGradient(x - 200, y - 60, x + 40, y + 70);
346
+ gl.addColorStop(0, 'rgba(255,255,255,0.1)'); gl.addColorStop(0.42, 'rgba(255,255,255,0.06)'); gl.addColorStop(0.43, 'rgba(255,255,255,0)'); gl.addColorStop(1, 'rgba(255,255,255,0)');
347
+ c.fillStyle = gl; c.fillRect(x - 243, y - 44, 486, 84);
348
+ c.restore();
349
+ c.strokeStyle = 'rgba(79,243,255,0.7)'; c.lineWidth = 2; c.beginPath(); c.roundRect(x - 245, y - 46, 490, 88, 8); c.stroke();
350
+ c.strokeStyle = 'rgba(255,255,255,0.35)'; c.lineWidth = 1; c.beginPath(); c.moveTo(x - 238, y - 50.5); c.lineTo(x + 238, y - 50.5); c.stroke();
351
+ c.restore();
352
+ neonText(c, 'EXAMPLES', x, y + 64, '800 28px "Orbitron"', '#ffe066', on);
353
+ }
354
+
355
+ let swDashRefl = null, swBrushedC = null;
356
+ function swBrushed(W) { // horizontal brushed-metal / carbon streaks for the dash, built once
357
+ if (swBrushedC && swBrushedC.width === W) return swBrushedC;
358
+ const c = H.layer(W, 180), g = c.getContext('2d'), r = H.rng(5150);
359
+ for (let i = 0; i < 900; i++) {
360
+ const y = r.range(0, 180), x = r.range(-200, W), l = r.range(60, 420);
361
+ g.fillStyle = r() < 0.5 ? `rgba(200,190,255,${r.range(0.015, 0.05)})` : `rgba(0,0,0,${r.range(0.05, 0.14)})`;
362
+ g.fillRect(x, y, l, r.range(0.6, 1.4));
363
+ }
364
+ g.fillStyle = 'rgba(255,255,255,0.025)'; // fine 4 px weave
365
+ for (let y = 0; y < 180; y += 4) g.fillRect(0, y, W, 1);
366
+ return (swBrushedC = c);
367
+ }
368
+ function explainSW(ctx, W, H_, t) {
369
+ const T1 = 2.4, T3 = 6.0, T4 = 10.5, T5 = 12.9;
370
+ const tilt = t < T4 ? 0 : t < T5 - 0.1 ? 300 * E.inOut(cl((t - T4) / 0.7)) : 300 * (1 - E.inOut(cl((t - T5 + 0.1) / 0.5)));
371
+ ctx.fillStyle = '#05021a'; ctx.fillRect(0, 0, W, H_);
372
+ // extra stars above the tilted horizon
373
+ if (tilt > 0) { const r = H.rng(77); for (let i = 0; i < 120; i++) { ctx.fillStyle = `rgba(255,230,255,${r.range(0.3, 0.9)})`; ctx.fillRect(r.range(0, W), r.range(0, tilt + 40), 1.5, 1.5); } }
374
+ ctx.save(); ctx.translate(0, tilt);
375
+ skyAndStars(ctx, W, t + 3);
376
+ sun(ctx, W, H_, VPX, 352, 176, t);
377
+ mountains(ctx, t, 1);
378
+ floorAndRoad(ctx, W, H_, t, 1, 1);
379
+ // road chevrons (arrows) pointing at the core while data flows
380
+ const chevOn = cl((t - 2.5) / 0.3) * (t < T4 ? 1 : 0);
381
+ if (chevOn > 0) {
382
+ for (let k = 0; k < 5; k++) {
383
+ const z = 2.2 + ((k * 2.6 - t * 7) % 13 + 13) % 13;
384
+ const [x0, y0] = proj(-0.9, 0, z + 0.6), [xm, ym] = proj(0, 0, z), [x1, y1] = proj(0.9, 0, z + 0.6);
385
+ ctx.globalAlpha = chevOn * cl((14 - z) / 4);
386
+ neonStroke(ctx, '#ff4fd8', Math.max(0.8, 6 / z), () => { ctx.moveTo(x0, y0); ctx.lineTo(xm, ym); ctx.lineTo(x1, y1); });
387
+ ctx.globalAlpha = 1;
388
+ }
389
+ }
390
+ // the AI core on the horizon
391
+ const coreOn = t < T5 ? flick(t, 2.15) : 1 - cl((t - T5) / 0.25);
392
+ let pulse = 0;
393
+ if (t > 2.9 && t < 6.0) pulse = Math.max(0, 1 - (((t - 2.9) % 0.35) / 0.2));
394
+ if (t > 7.0 && t < 7.15) pulse = 1;
395
+ const coreR = 74 * (t < T5 ? E.back(cl((t - 2.15) / 0.4)) : 1 - E.in(cl((t - T5) / 0.3)));
396
+ core(ctx, VPX, 300, coreR, t, pulse, coreOn);
397
+ if (coreOn > 0 && t < T5) neonText(ctx, 'THE MODEL', VPX, 400, '800 28px "Orbitron"', '#e0a0ff', coreOn);
398
+ // examples ride the road into the core
399
+ if (t > 2.6 && t < 6.2) {
400
+ for (let k = 0; k < 11; k++) {
401
+ const t0 = 2.6 + k * 0.33, p = (t - t0) / 1.25; if (p < 0 || p > 1) continue;
402
+ const z = H.lerp(1.6, 28, E.in(p)), lane = k % 2 ? 0.75 : -0.75;
403
+ const [rx, ry] = proj(lane * (1 - p), 0.9, z);
404
+ const y = H.lerp(ry, 300, Math.pow(p, 2.5)), x = H.lerp(rx, VPX, Math.pow(p, 2.5));
405
+ exCard(ctx, x, y, 3.0 / z * 1.6, k % 2 ? 'dog' : 'cat', k % 2 ? 'DOG' : 'CAT', cl((1 - p) * 6));
406
+ }
407
+ }
408
+ // test picture
409
+ if (t > 6.1 && t < 7.1) {
410
+ const p = (t - 6.1) / 0.9, z = H.lerp(1.8, 26, E.in(p));
411
+ const [rx, ry] = proj(0, 0.9, z);
412
+ exCard(ctx, H.lerp(rx, VPX, Math.pow(p, 2.5)), H.lerp(ry, 300, Math.pow(p, 2.5)), 2.6 / z * 1.6, 'cat', '?', cl((1 - p) * 6));
413
+ }
414
+ ctx.restore();
415
+ if (t < T5) neonText(ctx, '', 0, 0, '10px sans-serif', '#000', 0);
416
+
417
+ // ---- beat 3: guess sign, check, error pulse to the knobs, guess again ----
418
+ const step = t < 7.0 ? -1 : t < 7.9 ? 0 : t < 8.5 ? 1 : t < 9.6 ? 2 : t < 10.05 ? 0 : 1;
419
+ if (t >= 7.0 && t < T4 + 0.2) {
420
+ const fade = 1 - cl((t - T4) / 0.2);
421
+ ctx.save(); ctx.globalAlpha = fade;
422
+ neonArrow(ctx, [[VPX + 84, 290], [880, 250]], cl((t - 7.0) / 0.3), '#4ff3ff');
423
+ neonText(ctx, 'GUESS', 790, 222, '800 28px "Orbitron"', '#4ff3ff', flick(t, 7.1) * fade);
424
+ if (t < 9.6) {
425
+ neonText(ctx, 'DOG?', 1010, 245, '800 52px "Orbitron"', '#ff3d7f', flick(t, 7.3) * fade);
426
+ if (t > 7.9) {
427
+ const xo = flick(t, 7.9) * fade;
428
+ ctx.globalAlpha = xo; neonStroke(ctx, '#ff2020', 4, () => { ctx.moveTo(1120, 220); ctx.lineTo(1166, 266); ctx.moveTo(1166, 220); ctx.lineTo(1120, 266); }); ctx.globalAlpha = fade;
429
+ const cp = cl((t - 7.95) / 0.3);
430
+ neonStroke(ctx, '#ffe066', 2, () => ctx.ellipse(1040, 245, 150, 52, -0.05, -Math.PI / 2, -Math.PI / 2 + cp * Math.PI * 2));
431
+ neonText(ctx, "CHECK: IT'S A CAT", 1030, 330, '800 26px "Orbitron"', '#ffe066', flick(t, 8.05) * fade);
432
+ const fl = Math.max(0, 1 - (t - 7.9) / 0.35);
433
+ if (fl > 0) { ctx.fillStyle = `rgba(255,30,80,${0.25 * fl})`; ctx.fillRect(0, 0, W, H_); }
434
+ }
435
+ } else {
436
+ neonText(ctx, 'CAT', 1010, 245, '800 52px "Orbitron"', '#5cffb0', flick(t, 9.6) * fade);
437
+ ctx.globalAlpha = flick(t, 9.75) * fade;
438
+ neonStroke(ctx, '#5cffb0', 4, () => { ctx.moveTo(1112, 246); ctx.lineTo(1130, 266); ctx.lineTo(1170, 218); });
439
+ ctx.globalAlpha = fade;
440
+ neonText(ctx, 'CORRECT', 1030, 330, '800 26px "Orbitron"', '#5cffb0', flick(t, 9.85) * fade);
441
+ }
442
+ if (t > 8.5 && t < 9.6) { // error pulse travels down to the weights
443
+ const pts = [[1040, 350], [1040, 470], [1120, 560]];
444
+ neonArrow(ctx, pts, cl((t - 8.5) / 0.4), '#ff4fd8');
445
+ neonText(ctx, 'ERROR', 1062, 430, '800 26px "Orbitron"', '#ff4fd8', flick(t, 8.6) * fade, 'left');
446
+ const pp = cl((t - 8.5) / 0.4); const py = H.lerp(340, 590, pp);
447
+ ctx.save(); ctx.globalCompositeOperation = 'lighter'; const g = ctx.createRadialGradient(1040 - (py > 470 ? (py - 470) / 130 * 30 : 0), py, 0, 1040, py, 26); g.addColorStop(0, 'rgba(255,120,230,0.9)'); g.addColorStop(1, 'rgba(255,60,200,0)'); ctx.fillStyle = g; ctx.fillRect(1000, py - 30, 80, 60); ctx.restore();
448
+ }
449
+ ctx.restore();
450
+ }
451
+
452
+ // ---- dashboard HUD (beats 2-3) ----
453
+ const dashY = 600 + 190 * (t < 2.5 ? 1 : t < T4 ? 1 - E.out(cl((t - 2.5) / 0.4)) : E.in(cl((t - T4 + 0.1) / 0.35)));
454
+ if (dashY < 740) {
455
+ ctx.save(); ctx.translate(0, dashY - 600);
456
+ const dg = ctx.createLinearGradient(0, 540, 0, 720); dg.addColorStop(0, 'rgba(8,2,22,0.88)'); dg.addColorStop(1, 'rgba(3,0,10,0.97)');
457
+ // grab the road / sun strip just above the dash before covering it: it is reflected in the dash's glossy top
458
+ const pxs = ctx.canvas.width / W, topY = dashY - 60, refH = 96;
459
+ const RL = swDashRefl || (swDashRefl = H.layer(W / 4, refH / 4)), rc = RL.getContext('2d');
460
+ rc.setTransform(1, 0, 0, 1, 0, 0); rc.clearRect(0, 0, RL.width, RL.height); rc.filter = 'blur(1.5px)';
461
+ rc.drawImage(ctx.canvas, 0, Math.max(0, (topY - refH) * pxs), ctx.canvas.width, refH * pxs, 0, 0, RL.width, RL.height); rc.filter = 'none';
462
+ const slab = () => { ctx.beginPath(); ctx.moveTo(0, 568); ctx.lineTo(120, 540); ctx.lineTo(W - 120, 540); ctx.lineTo(W, 568); ctx.lineTo(W, 720); ctx.lineTo(0, 720); ctx.closePath(); };
463
+ ctx.fillStyle = dg; slab(); ctx.fill();
464
+ ctx.save(); slab(); ctx.clip();
465
+ // flipped, soft reflection of the horizon glow fading down the glossy dash
466
+ ctx.save(); ctx.globalAlpha = 0.16; ctx.globalCompositeOperation = 'lighter'; ctx.translate(0, 540); ctx.scale(1, -1);
467
+ ctx.imageSmoothingEnabled = true; ctx.drawImage(RL, 0, -refH * 0.9, W, refH * 0.9); ctx.restore();
468
+ const rf = ctx.createLinearGradient(0, 540, 0, 640); rf.addColorStop(0, 'rgba(6,1,18,0)'); rf.addColorStop(1, 'rgba(6,1,18,0.9)');
469
+ ctx.fillStyle = rf; ctx.fillRect(0, 540, W, 100);
470
+ // brushed / carbon fibre texture (cached)
471
+ ctx.globalAlpha = 0.6; ctx.drawImage(swBrushed(W), 0, 540); ctx.globalAlpha = 1;
472
+ // recessed instrument panels behind the loop, the odometer and the knobs
473
+ for (const [px, pw] of [[10, 460], [1010, 262]]) {
474
+ const pg = ctx.createLinearGradient(0, 582, 0, 706); pg.addColorStop(0, 'rgba(0,0,0,0.5)'); pg.addColorStop(1, 'rgba(20,10,44,0.35)');
475
+ ctx.fillStyle = pg; ctx.beginPath(); ctx.roundRect(px, 582, pw, 124, 10); ctx.fill();
476
+ ctx.strokeStyle = 'rgba(0,0,0,0.6)'; ctx.lineWidth = 1.5; ctx.beginPath(); ctx.roundRect(px, 582, pw, 124, 10); ctx.stroke();
477
+ ctx.strokeStyle = 'rgba(190,170,255,0.12)'; ctx.lineWidth = 1; ctx.beginPath(); ctx.moveTo(px + 10, 706.5); ctx.lineTo(px + pw - 10, 706.5); ctx.stroke();
478
+ }
479
+ ctx.restore();
480
+ neonStroke(ctx, '#4ff3ff', 1.2, () => { ctx.moveTo(0, 568); ctx.lineTo(120, 540); ctx.lineTo(W - 120, 540); ctx.lineTo(W, 568); });
481
+ // chrome bevel just under the neon edge
482
+ ctx.strokeStyle = 'rgba(255,255,255,0.35)'; ctx.lineWidth = 1; ctx.beginPath(); ctx.moveTo(0, 571); ctx.lineTo(121, 543); ctx.lineTo(W - 121, 543); ctx.lineTo(W, 571); ctx.stroke();
483
+ ctx.strokeStyle = 'rgba(0,0,0,0.5)'; ctx.lineWidth = 1; ctx.beginPath(); ctx.moveTo(0, 573); ctx.lineTo(121, 545); ctx.lineTo(W - 121, 545); ctx.lineTo(W, 573); ctx.stroke();
484
+ // loop tubes
485
+ const tubes = [['GUESS', 72], ['CHECK', 226], ['ADJUST', 390]];
486
+ tubes.forEach(([lab, x], i) => { deadTube(ctx, lab, x, 612, '800 28px "Orbitron"', '#ff7ad9'); if (i === step) neonText(ctx, lab, x, 612, '800 28px "Orbitron"', '#ff4fd8', flick(t, [7.0, 7.9, 8.5, 9.6, 10.05][[0, 1, 2, 0, 1][[7.0, 7.9, 8.5, 9.6, 10.05].findIndex((x2, j, a) => t >= x2 && (j === a.length - 1 || t < a[j + 1]))]] ?? 0)); });
487
+ ctx.globalAlpha = t > T3 ? 1 : 0.35;
488
+ neonArrow(ctx, [[132, 612], [158, 612]], 1, '#b9a2ff', 1.4); neonArrow(ctx, [[292, 612], [312, 612]], 1, '#b9a2ff', 1.4);
489
+ neonArrow(ctx, [[440, 630], [448, 662], [40, 662], [40, 634]], 1, '#b9a2ff', 1.2);
490
+ ctx.globalAlpha = 1;
491
+ neonText(ctx, 'REPEAT', 250, 690, '800 26px "Orbitron"', '#b9a2ff', t > T3 ? 1 : 0.4);
492
+ // odometer
493
+ const n = 1e6 * E.inOut(cl((t - 2.9) / 2.7));
494
+ odometer(ctx, 725, 600, n, 1);
495
+ // weights as synth knobs
496
+ const adj = E.inOut(cl((t - 8.9) / 0.6));
497
+ [[0.25, 0.8], [0.7, 0.3], [0.45, 0.9]].forEach(([a, b], i) => knob(ctx, 1055 + i * 92, 604, 25, H.lerp(a, b, adj) + (t < 8.9 ? Math.sin(t * 2 + i) * 0.02 : 0), 'W' + (i + 1), t > 8.85 && t < 9.6));
498
+ ctx.restore();
499
+ }
500
+
501
+ // ---- beat 4: chart in the sky ----
502
+ if (t > T4 + 0.3 && t < T5 + 0.1) {
503
+ const on = t < T5 - 0.15 ? flick(t, T4 + 0.5) : 1 - cl((t - T5 + 0.15) / 0.25);
504
+ const gx0 = 180, gx1 = 860, gy0 = 110, gy1 = 420;
505
+ ctx.save(); ctx.globalAlpha = on;
506
+ ctx.strokeStyle = 'rgba(79,243,255,0.18)'; ctx.lineWidth = 1;
507
+ for (let i = 1; i <= 4; i++) { ctx.beginPath(); ctx.moveTo(gx0, H.lerp(gy1, gy0, i / 4)); ctx.lineTo(gx1, H.lerp(gy1, gy0, i / 4)); ctx.stroke(); }
508
+ neonStroke(ctx, '#4ff3ff', 1.6, () => { ctx.moveTo(gx0, gy0 - 10); ctx.lineTo(gx0, gy1); ctx.lineTo(gx1 + 20, gy1); });
509
+ neonText(ctx, 'TRAINING ROUNDS', (gx0 + gx1) / 2, gy1 + 34, '800 26px "Orbitron"', '#4ff3ff', on);
510
+ neonText(ctx, '100%', gx0 - 46, gy0, '800 22px "Orbitron"', '#4ff3ff', on); neonText(ctx, '50%', gx0 - 40, gy1, '800 22px "Orbitron"', '#4ff3ff', on);
511
+ const pr = cl((t - T4 - 0.8) / 1.1), N = 24, val = (u) => 61 + 36 * (1 - Math.pow(1 - u, 2.3)) + Math.sin(u * 40) * 2 * (1 - u);
512
+ const P = (u) => [H.lerp(gx0 + 6, gx1, u), H.lerp(gy1, gy0, (val(u) - 50) / 50)];
513
+ if (pr > 0) {
514
+ // soft glow fill under the curve, like a vector-monitor phosphor wash
515
+ const fg = ctx.createLinearGradient(0, gy0, 0, gy1); fg.addColorStop(0, 'rgba(255,79,216,0.22)'); fg.addColorStop(1, 'rgba(255,79,216,0)');
516
+ ctx.fillStyle = fg; ctx.beginPath(); ctx.moveTo(P(0)[0], gy1); ctx.lineTo(...P(0)); for (let i = 1; i <= N * pr; i++) ctx.lineTo(...P(i / N)); ctx.lineTo(...P(pr)); ctx.lineTo(P(pr)[0], gy1); ctx.closePath(); ctx.fill();
517
+ neonStroke(ctx, '#ff4fd8', 2.4, () => { ctx.moveTo(...P(0)); for (let i = 1; i <= N * pr; i++) ctx.lineTo(...P(i / N)); ctx.lineTo(...P(pr)); });
518
+ const [hx, hy] = P(pr);
519
+ ctx.save(); ctx.globalCompositeOperation = 'lighter'; const g = ctx.createRadialGradient(hx, hy, 0, hx, hy, 22); g.addColorStop(0, 'rgba(255,255,255,1)'); g.addColorStop(0.3, 'rgba(255,120,230,0.8)'); g.addColorStop(1, 'rgba(255,60,200,0)'); ctx.fillStyle = g; ctx.fillRect(hx - 24, hy - 24, 48, 48); ctx.restore();
520
+ }
521
+ ctx.restore();
522
+ const acc = pr >= 1 ? 97 : Math.round(val(pr));
523
+ neonText(ctx, 'ACCURACY', 1060, 168, '800 28px "Orbitron"', '#ff4fd8', on);
524
+ ctx.save(); ctx.globalAlpha = on; chromeTitle(ctx, acc + '%', 1060, 290, 92); ctx.restore();
525
+ if (pr >= 1) {
526
+ const k = cl((t - (T4 + 1.9)) / 0.3);
527
+ glint(ctx, 1160, 210, 70 * Math.sin(k * Math.PI) + 26, 0.95 * on);
528
+ neonStroke(ctx, '#ffe066', 2, () => ctx.ellipse(1060, 255, 150 * E.back(k), 80 * E.back(k), 0, 0, 7));
529
+ neonText(ctx, 'UP FROM 61%', 1060, 370, '800 26px "Orbitron"', '#ffe066', on);
530
+ }
531
+ }
532
+
533
+ // ---- header: the question slams in, then shrinks into the corner and stays ----
534
+ {
535
+ const pS = cl((t - 0.15) / 0.4), pM = E.inOut(cl((t - 1.75) / 0.6));
536
+ if (t >= 0.15) {
537
+ const sc = (1 + 1.5 * Math.pow(1 - pS, 3)) * H.lerp(1, 0.5, pM);
538
+ const cx = H.lerp(VPX, 300, pM), cy = H.lerp(190, 52, pM);
539
+ ctx.save(); ctx.globalAlpha = cl(pS * 4);
540
+ ctx.translate(cx, cy); ctx.scale(sc, sc); ctx.translate(-VPX, -190);
541
+ chromeTitle(ctx, 'HOW DOES AI LEARN?', VPX, 214, 56);
542
+ ctx.restore();
543
+ if (pS >= 1 && t < 0.9) { const fl = Math.exp(-(t - 0.55) * 8); ctx.save(); ctx.globalCompositeOperation = 'lighter'; ctx.fillStyle = `rgba(255,200,255,${0.35 * fl})`; ctx.fillRect(0, 0, W, H_); ctx.restore(); }
544
+ if (t > 0.6 && t < 1.8) glint(ctx, 200 + (t - 0.6) / 1.2 * 880, 170, 40, 0.9);
545
+ }
546
+ }
547
+ // ---- beat 5: payoff ----
548
+ if (t > T5 + 0.3) {
549
+ const p = cl((t - T5 - 0.3) / 0.35);
550
+ ctx.save(); ctx.globalAlpha = cl(p * 4); ctx.translate(VPX, 220); const s2 = 1 + 1.2 * Math.pow(1 - p, 3); ctx.scale(s2, s2); ctx.translate(-VPX, -220);
551
+ chromeTitle(ctx, 'MORE EXAMPLES', VPX, 240, 80);
552
+ ctx.restore();
553
+ const on = flick(t, T5 + 0.75);
554
+ ctx.save(); ctx.globalAlpha = on;
555
+ neonArrow(ctx, [[390, 330], [462, 330]], cl((t - T5 - 0.75) / 0.2), '#ff4fd8', 3);
556
+ ctx.restore();
557
+ ctx.save(); ctx.translate(690, 334); ctx.rotate(-0.06);
558
+ ctx.font = '700 76px "Caveat"'; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.lineJoin = 'round';
559
+ // unlit glass tube (always there once the payoff is up)
560
+ ctx.globalAlpha = t >= T5 + 0.75 ? 1 : 0;
561
+ ctx.shadowColor = 'rgba(16,0,40,0.95)'; ctx.shadowBlur = 22; ctx.fillStyle = 'rgba(30,0,50,0.6)'; ctx.fillText('better guesses', 0, 0);
562
+ ctx.shadowBlur = 10; ctx.lineWidth = 6; ctx.strokeStyle = 'rgba(30,0,50,0.45)'; ctx.strokeText('better guesses', 0, 0);
563
+ ctx.shadowBlur = 0; ctx.strokeStyle = 'rgba(255,150,210,0.3)'; ctx.lineWidth = 1.6; ctx.strokeText('better guesses', 0, 0);
564
+ if (on > 0) {
565
+ ctx.globalAlpha = on;
566
+ ctx.shadowColor = '#ff1fa8'; ctx.shadowBlur = 28; ctx.fillStyle = '#ff1aa8'; ctx.fillText('better guesses', 0, 0);
567
+ ctx.shadowBlur = 12; ctx.fillText('better guesses', 0, 0);
568
+ ctx.shadowBlur = 0; ctx.strokeStyle = 'rgba(255,215,245,0.9)'; ctx.lineWidth = 1.5; ctx.strokeText('better guesses', 0, 0);
569
+ ctx.fillStyle = 'rgba(255,190,235,0.9)'; ctx.globalAlpha = 0.12 * on; ctx.fillText('better guesses', 0, 0);
570
+ }
571
+ ctx.restore();
572
+ }
573
+ bloom(ctx, W, H_, 0.3, 4);
574
+ ctx.fillStyle = 'rgba(0,0,0,0.12)';
575
+ for (let y = Math.floor(t * 20) % 3; y < H_; y += 3) ctx.fillRect(0, y, W, 1);
576
+ H.grain(ctx, W, H_, 0.04, 12 + Math.floor(t * 12), true);
577
+ H.vignette(ctx, W, H_, 0.5, '6,0,20');
578
+ }
579
+
580
+ // ---- SOUND: an 80s night drive. A driving synth pulse (kick + bass) under the road, airy pad in the sky; slams are
581
+ // gated-reverb snares with detuned saw stabs, neon text strikes buzz through its flicker, arrows are analog zaps,
582
+ // the odometer rolls with mechanical clicks and the weight knobs sweep a resonant filter. Times copy explainSW.
583
+ function swSound(k) {
584
+ const END = 14.5, T1 = 2.4, T3 = 6.0, T4 = 10.5, T5 = 12.9;
585
+ const snare = (t, g = 1, pan = 0) => { // 80s gated-reverb snare: bright burst cut off hard
586
+ k.noise(t, { dur: 0.24, color: 'pink', filter: 'bandpass', f: 1700, q: 0.6, gain: 0.32 * g, a: 0.002, hold: 0.17, verb: 0.5, pan });
587
+ k.tone(t, { f: [[0, 230], [0.08, 160]], dur: 0.12, gain: 0.22 * g, pan });
588
+ };
589
+ const stab = (t, notes, g = 1, d = 0.5, pan = 0, minor = false) => notes.forEach((n, i) => { // detuned saw chord stab, filter closing
590
+ k.tone(t, { f: n, type: 'sawtooth', dur: d, gain: 0.05 * g, a: 0.004, hold: d * 0.3, filter: 'lowpass', f2: [[0, 3200], [d * 0.8, 600]], verb: 0.35, pan: pan + (i - 1) * 0.2, minor });
591
+ k.tone(t, { f: n, type: 'sawtooth', detune: 14, dur: d, gain: 0.04 * g, a: 0.004, hold: d * 0.3, filter: 'lowpass', f2: [[0, 2600], [d * 0.8, 500]], verb: 0.35, pan: pan - (i - 1) * 0.2, minor });
592
+ });
593
+ const zap = (t, d, f0, f1, g = 1, pan = 0, minor = true) => k.tone(t, { f: [[0, f0], [d, f1]], type: 'sawtooth', dur: d + 0.05, gain: 0.06 * g, a: 0.005, hold: d * 0.6, filter: 'lowpass', f2: 1600, pan, minor });
594
+ // neon strike: buzzes on and off with flick()'s 32 ms pattern [1,0,1,.3,0,1,1,.5,1,1], then a short hum tail
595
+ const FLK = [1, 0, 1, 0.3, 0, 1, 1, 0.5, 1, 1];
596
+ const strike = (t, g = 1, pan = 0, minor = false) => {
597
+ FLK.forEach((v, i) => {
598
+ if (!v) return;
599
+ k.tone(t + i * 0.032, { f: 120, type: 'sawtooth', dur: 0.034, gain: 0.16 * v * g, a: 0.001, hold: 0.026, filter: 'bandpass', f2: 1400, q: 1.4, pan, minor });
600
+ if (!FLK[i - 1]) k.noise(t + i * 0.032, { dur: 0.008, filter: 'bandpass', f: 2200, q: 1.5, gain: 0.22 * g, a: 0.0005, pan, minor });
601
+ });
602
+ k.tone(t + 0.32, { f: 120, type: 'sawtooth', dur: 0.35, gain: 0.07 * g, a: 0.005, filter: 'bandpass', f2: 1100, q: 1.4, pan, minor });
603
+ };
604
+ const counter = (t0, t1, fn, step, play) => { let last = -1, lastV = fn(t0); for (let t = t0; t <= t1 + 1e-6; t += 1 / 120) { const v = fn(t); if (Math.abs(v - lastV) >= step && t - last >= 1 / 12) { play(t, v); last = t; lastV = v; } } };
605
+
606
+ // ---- music: pad intro, driving pulse on the road (bar = 2.4 s, lands on T1), airy pad in the sky, pad payoff
607
+ k.music('pad', 0.55, T1, { bpm: 100, gain: 0.45, chords: [['A3', 'C4', 'E4', 'G4']] });
608
+ k.music('pulse', T1, T4 - 0.1, { bpm: 100, gain: 0.42, chords: [['A3', 'C4', 'E4', 'G4'], ['F3', 'A3', 'C4', 'E4'], ['C4', 'E4', 'G4', 'B4'], ['G3', 'B3', 'D4', 'F4']] });
609
+ k.music('pad', T4 + 0.1, T5, { bpm: 100, gain: 0.4, chords: [['F3', 'A3', 'C4', 'E4'], ['G3', 'B3', 'D4', 'F4']] });
610
+ k.music('pad', T5 + 0.65, END, { bpm: 100, gain: 0.45, chords: [['C4', 'E4', 'G4', 'B4']] });
611
+ k.bed('hiss', 0, END, { gain: 0.8 });
612
+
613
+ // ---- beat 1: chrome title slams in (0.15..0.55, flash at 0.55), glint sweeps, then glides into the corner
614
+ k.noise(0.15, { dur: 0.42, color: 'pink', filter: 'bandpass', f: [[0, 400], [0.4, 3000]], q: 1, gain: 0.2, a: 0.38 }); // reverse swell into the slam
615
+ const SLAM = 0.55;
616
+ snare(SLAM, 1.1); k.play('thud', SLAM, { f: 90, gain: 0.7 });
617
+ stab(SLAM, ['A3', 'E4', 'A4', 'C5'], 1.1, 0.7);
618
+ k.noise(0.6, { dur: 1.2, color: 'pink', filter: 'bandpass', f: [[0, 900], [1.2, 2200]], q: 3, gain: 0.04, a: 0.4, pan: -0.6, minor: true }); // glint
619
+ k.noise(1.75, { dur: 0.6, color: 'brown', filter: 'lowpass', f: [[0, 500], [0.6, 200]], gain: 0.12, a: 0.25, pan: -0.4, minor: true }); // title glides to the corner
620
+
621
+ // ---- beat 2: the core flickers on (2.15), the dashboard rises (2.5..2.9), cards ride into the core
622
+ strike(2.15, 1);
623
+ k.tone(2.15, { f: [[0, 'A2'], [0.4, 'A3']], type: 'sawtooth', dur: 0.5, gain: 0.06, a: 0.05, hold: 0.25, filter: 'lowpass', f2: [[0, 300], [0.4, 1400]] });
624
+ k.noise(2.5, { dur: 0.4, color: 'brown', filter: 'lowpass', f: [[0, 200], [0.4, 600]], gain: 0.14, a: 0.2, minor: true }); // dash slides up
625
+ // core absorbs a card each pulse (every 0.35 s from 2.9 to 6.0): soft analog bloop, walking up A minor pentatonic
626
+ const PENT = ['A4', 'C5', 'D5', 'E5', 'G5', 'E5', 'D5', 'C5', 'A4'];
627
+ for (let i = 0; 2.9 + i * 0.35 < T3; i++) k.tone(2.9 + i * 0.35, { f: [[0, k.hz(PENT[i % PENT.length]) * 0.5], [0.05, PENT[i % PENT.length]]], type: 'triangle', dur: 0.16, gain: 0.08, a: 0.002, hold: 0.04, verb: 0.25, pan: 0.15, minor: true });
628
+ // odometer 0 -> 1,000,000 (2.9..5.6, ease-in-out): mechanical roller clicks, then a stab when it lands
629
+ counter(2.9, 5.6, (t) => E.inOut(cl((t - 2.9) / 2.7)), 1 / 40, (t) => k.noise(t, { dur: 0.012, filter: 'bandpass', f: 1800, q: 3, gain: 0.17, a: 0.0005, pan: 0.15, minor: true }));
630
+ stab(5.6, ['E4', 'A4', 'C5'], 0.8, 0.35, 0.15);
631
+
632
+ // ---- beat 3: the loop tubes light (6.0), test card rides in, guess / check / adjust
633
+ strike(T3, 0.7, -0.6, true);
634
+ zap(7.0, 0.3, 300, 1100, 1, 0.4); // arrow core -> sign
635
+ strike(7.0, 0.6, -0.8, true); // GUESS tube
636
+ strike(7.1, 0.8, 0.3, true); // GUESS label
637
+ strike(7.3, 1, 0.6); stab(7.3, ['G4', 'D5'], 0.6, 0.3, 0.6); // "DOG?" sign buzzes on
638
+ // CHECK (7.9): wrong. red flash, the X strikes on, a sour falling stab
639
+ const WRONG = 7.9;
640
+ k.play('thud', WRONG, { f: 80, gain: 0.75 });
641
+ ['A3', 'Eb4', 'Bb4'].forEach((n, i) => k.tone(WRONG, { f: [[0, n], [0.45, k.hz(n) * 0.8]], type: 'sawtooth', dur: 0.55, gain: 0.07, a: 0.004, hold: 0.25, filter: 'lowpass', f2: [[0, 2400], [0.5, 500]], verb: 0.3, pan: 0.6 + (i - 1) * 0.15 }));
642
+ strike(WRONG, 0.8, 0.7);
643
+ strike(8.05, 0.6, 0.6, true); // CHECK: IT'S A CAT
644
+ // ADJUST (8.5): error pulse runs down to the knobs (8.5..8.9) as a falling zap
645
+ zap(8.5, 0.4, 1000, 180, 1.3, 0.7, false);
646
+ strike(8.5, 0.6, -0.4, true);
647
+ // knobs turn (8.9..9.5, ease-in-out): resonant filter sweep + detent clicks (30 detents over the three knobs' travel)
648
+ k.tone(8.9, { f: 'A2', type: 'sawtooth', dur: 0.7, gain: 0.07, a: 0.05, hold: 0.45, filter: 'lowpass', f2: [[0, 300], [0.6, 1800]], q: 8, pan: 0.6, minor: true });
649
+ counter(8.9, 9.5, (t) => E.inOut(cl((t - 8.9) / 0.6)), 1 / 10, (t) => k.noise(t, { dur: 0.01, filter: 'bandpass', f: 1500, q: 3, gain: 0.14, a: 0.0005, pan: 0.7, minor: true }));
650
+ // GUESS again -> CAT (9.6), tick (9.75), CORRECT (9.85): bright major stab + sign buzz
651
+ strike(9.6, 0.8, 0.6);
652
+ stab(9.6, ['C4', 'E4', 'G4', 'C5'], 1, 0.5, 0.5);
653
+ k.tone(9.75, { f: 'G4', type: 'triangle', dur: 0.4, gain: 0.1, verb: 0.3, pan: 0.6 }); k.tone(9.85, { f: 'C5', type: 'triangle', dur: 0.6, gain: 0.1, verb: 0.3, pan: 0.6 });
654
+ strike(10.05, 0.5, -0.6, true); // CHECK tube
655
+
656
+ // ---- beat 4: camera tilts up into the sky (10.5..11.2), chart flickers on (11.0), line draws 11.3..12.4
657
+ k.noise(T4, { dur: 0.75, color: 'pink', filter: 'bandpass', f: [[0, 300], [0.7, 2400]], q: 1.4, gain: 0.16, a: 0.5 }); // filter sweep up
658
+ k.noise(T4 - 0.1, { dur: 0.35, color: 'brown', filter: 'lowpass', f: 400, gain: 0.12, a: 0.1, minor: true }); // dash drops away
659
+ strike(T4 + 0.5, 0.8);
660
+ k.tone(T4 + 0.8, { f: [[0, 'A3'], [1.1, 'A4']], type: 'sawtooth', dur: 1.15, gain: 0.04, a: 0.1, hold: 0.9, filter: 'lowpass', f2: 1300, pan: -0.3, minor: true }); // the line's glowing head
661
+ const val = (u) => 61 + 36 * (1 - Math.pow(1 - u, 2.3)) + Math.sin(u * 40) * 2 * (1 - u);
662
+ counter(T4 + 0.8, T4 + 1.9, (t) => Math.round(val(cl((t - T4 - 0.8) / 1.1))), 1, (t) => k.noise(t, { dur: 0.012, filter: 'bandpass', f: 1800, q: 3, gain: 0.14, a: 0.0005, pan: 0.4, minor: true }));
663
+ // 97% (pr >= 1 at T4 + 1.9): biggest moment. gated snare, big chord stab, deep boom, glint
664
+ const BEST = T4 + 1.9 + 1e-3;
665
+ snare(BEST, 1.3, 0.3); k.play('impact', BEST, { f: 70, gain: 1 });
666
+ stab(BEST, ['F3', 'C4', 'E4', 'A4', 'C5'], 1.4, 1.3, 0.3);
667
+ k.noise(BEST + 0.05, { dur: 0.35, color: 'pink', filter: 'bandpass', f: [[0, 1200], [0.3, 2200]], q: 3, gain: 0.06, a: 0.15, pan: 0.5 });
668
+
669
+ // ---- beat 5: tilt back down (12.8..13.3), MORE EXAMPLES slams in (13.2..13.55), arrow + script strike (13.65)
670
+ k.noise(T5 - 0.1, { dur: 0.5, color: 'pink', filter: 'bandpass', f: [[0, 2000], [0.5, 300]], q: 1.4, gain: 0.12, a: 0.15 });
671
+ k.noise(T5 + 0.3, { dur: 0.27, color: 'pink', filter: 'bandpass', f: [[0, 500], [0.25, 2600]], q: 1, gain: 0.14, a: 0.24 });
672
+ const PAY = T5 + 0.65;
673
+ snare(PAY, 0.9); k.play('thud', PAY, { f: 90, gain: 0.55 });
674
+ stab(PAY, ['C4', 'G4', 'C5'], 0.9, 0.5);
675
+ zap(PAY + 0.1, 0.2, 400, 1000, 0.8, -0.4);
676
+ // takeaway lands: script buzzes on and the chord resolves (B -> C over C)
677
+ const TAKE = T5 + 0.75;
678
+ strike(TAKE, 1, 0.2);
679
+ k.tone(TAKE, { f: 'B4', type: 'triangle', dur: 0.2, gain: 0.1, verb: 0.3 }); k.tone(TAKE + 0.18, { f: 'C5', type: 'triangle', dur: 1.2, gain: 0.12, verb: 0.4 });
680
+ k.tone(TAKE + 0.18, { f: 'C3', type: 'sawtooth', dur: 1.2, gain: 0.06, a: 0.02, hold: 0.4, filter: 'lowpass', f2: 700 });
681
+ }
682
+
683
+ registerStyle({
684
+ id: 'synthwave',
685
+ name: 'Synthwave Outrun',
686
+ category: 'Retro UI & Neon',
687
+ description: '80s outrun poster: neon grid highway to a striped sunset, wireframe vector mountains, chrome-beveled italic title with a horizon reflection and a hot-pink neon script, all bathed in bloom.',
688
+ motion: 'Stars blink on, the horizon line and grid race toward camera, the striped sun rises and wireframe mountains grow, the chrome title slams in with a flash, the script tube flickers on and glints sweep the chrome.',
689
+ fonts: ['800 112px "Orbitron"', '700 74px "Caveat"', '800 14px "Orbitron"', '800 52px "Orbitron"'],
690
+ frameT: 5.2,
691
+ duration: 5.5,
692
+ explainerDuration: 14.5,
693
+ explainerNote: 'A night drive explains it: labelled example cards ride the neon highway into a wireframe AI core, a dashboard HUD holds a rolling odometer counter, synth-knob weights and GUESS/CHECK/ADJUST neon tubes; the camera tilts up into the sky for a glowing accuracy chart and back down for a chrome payoff.',
694
+ explainer(ctx, W, H_, t) { explainSW(ctx, W, H_, t); },
695
+ explainerSound(k) { swSound(k); },
696
+ readsPixels: true,
697
+ draw(ctx, W, H_, t) {
698
+ const E = H.ease, cl = H.clamp;
699
+ skyAndStars(ctx, W, t);
700
+ sun(ctx, W, H_, VPX, 352 + (1 - E.out(cl((t - 0.5) / 1.6))) * 300, 176, t);
701
+ mountains(ctx, t, E.inOut(cl((t - 1.0) / 1.3)));
702
+ floorAndRoad(ctx, W, H_, t, E.inOut(cl((t - 0.3) / 0.95)) * 0.999 + 0.001, E.out(cl((t - 0.1) / 0.5)));
703
+ bloom(ctx, W, H_, 0.55, 5);
704
+
705
+ // Title: chrome slams in from the camera, lands with a flash
706
+ const T_T = 2.05, pT = cl((t - T_T) / 0.45);
707
+ if (t >= T_T) {
708
+ const sc = 1 + 1.6 * Math.pow(1 - pT, 3);
709
+ ctx.save();
710
+ ctx.globalAlpha = cl(pT * 4);
711
+ ctx.translate(VPX, 140); ctx.scale(sc, sc); ctx.translate(-VPX, -140);
712
+ chromeTitle(ctx, 'NEURAL DRIVE', VPX + 6, 168, 104);
713
+ ctx.restore();
714
+ const fl = t > T_T + 0.45 ? Math.exp(-(t - T_T - 0.45) * 7) : 0;
715
+ if (fl > 0.01) { ctx.save(); ctx.globalCompositeOperation = 'lighter'; const fg = ctx.createRadialGradient(VPX, 130, 0, VPX, 130, 520); fg.addColorStop(0, `rgba(255,220,255,${0.7 * fl})`); fg.addColorStop(1, 'rgba(255,120,220,0)'); ctx.fillStyle = fg; ctx.fillRect(0, 0, W, H_); ctx.restore(); }
716
+ }
717
+ // glint sweeps across the chrome every 2.2 s, plus a resting star glint
718
+ const gph = (t - 2.6) % 2.2;
719
+ if (t > 2.6 && gph < 0.75) glint(ctx, 180 + (gph / 0.75) * 920, 98 + (gph / 0.75) * 40, 46, 0.95);
720
+ if (t > 2.6) glint(ctx, 952, 172, 26 * (0.75 + 0.25 * Math.sin(t * 4)), 0.7);
721
+
722
+ // Neon script subtitle: tube flickers on
723
+ const flick = [[2.85, 1], [2.92, 0], [3.02, 1], [3.06, 0], [3.2, 1], [3.24, 0.4], [3.3, 1]];
724
+ let on = 0; for (const [ft, v] of flick) if (t >= ft) on = v;
725
+ if (t >= 2.6) {
726
+ ctx.save();
727
+ ctx.translate(760, 238); ctx.rotate(-0.09);
728
+ ctx.font = '700 74px "Caveat"'; ctx.textAlign = 'center';
729
+ // unlit glass tube
730
+ ctx.strokeStyle = 'rgba(255,150,210,0.28)'; ctx.lineWidth = 1.6; ctx.strokeText('Midnight Upload', 0, 0);
731
+ if (on > 0) {
732
+ ctx.globalAlpha = on;
733
+ ctx.shadowColor = '#ff1fa8'; ctx.shadowBlur = 28; ctx.fillStyle = '#ff2fb6';
734
+ ctx.fillText('Midnight Upload', 0, 0);
735
+ ctx.shadowBlur = 12; ctx.fillText('Midnight Upload', 0, 0);
736
+ ctx.shadowBlur = 0; ctx.strokeStyle = 'rgba(255,215,245,0.9)'; ctx.lineWidth = 1.6; ctx.strokeText('Midnight Upload', 0, 0);
737
+ ctx.fillStyle = 'rgba(255,190,235,0.9)'; ctx.globalAlpha = 0.35 * on; ctx.fillText('Midnight Upload', 0, 0);
738
+ }
739
+ // underline swash draws on
740
+ const sw = cl((t - 3.35) / 0.35);
741
+ if (sw > 0) {
742
+ ctx.globalAlpha = 1; ctx.strokeStyle = '#ff2fb6'; ctx.lineWidth = 4; ctx.lineCap = 'round'; ctx.shadowColor = '#ff1fa8'; ctx.shadowBlur = 18;
743
+ ctx.setLineDash([420 * sw, 1000]);
744
+ ctx.beginPath(); ctx.moveTo(-170, 20); ctx.bezierCurveTo(-60, 34, 80, 10, 200, 16); ctx.stroke();
745
+ }
746
+ ctx.restore();
747
+ }
748
+
749
+ bloom(ctx, W, H_, 0.25, 3);
750
+ // CRT scanlines + grain
751
+ ctx.fillStyle = 'rgba(0,0,0,0.12)';
752
+ for (let y = Math.floor(t * 20) % 3; y < H_; y += 3) ctx.fillRect(0, y, W, 1);
753
+ H.grain(ctx, W, H_, 0.05, 12 + Math.floor(t * 12), true);
754
+ H.vignette(ctx, W, H_, 0.55, '6,0,20');
755
+ },
756
+ });
757
+ }