@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,673 @@
1
+ {
2
+ // ---------------------------------------------------------------
3
+ // Impasto oil — thousands of loaded strokes along a swirling flow field,
4
+ // each one raised off the canvas (height map) and lit for 3-D paint relief
5
+ // ---------------------------------------------------------------
6
+ const C = (r, g, b) => [r, g, b];
7
+ const jit = (c, r, a) => [c[0] + r.gauss() * a, c[1] + r.gauss() * a, c[2] + r.gauss() * a];
8
+ const mixc = (a, b, t) => [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t, a[2] + (b[2] - a[2]) * t];
9
+ const css = (c) => `rgb(${c[0] | 0},${c[1] | 0},${c[2] | 0})`;
10
+
11
+ // region ids painted into a flat map
12
+ const ID = { sky: 1, ground: 2, dome: 3, body: 4, slit: 5, person: 6, screen: 7, cypress: 8, text: 9, moon: 10, star: 11 };
13
+
14
+
15
+ // =================================================================
16
+ // EXPLAINER — "How does AI learn?" painted across one long canvas the camera travels along.
17
+ // Background: a swirling night sky built once with the full lit-stroke engine; the story is laid on top in
18
+ // fat, lit daubs (shadow edge, body, highlight ridge) — arrows, labels and numbers included.
19
+ // =================================================================
20
+ const IXW = 3400;
21
+ let IXC = null;
22
+ const lerpI = (a, b, u) => a + (b - a) * u;
23
+ const clI = (v) => (v < 0 ? 0 : v > 1 ? 1 : v);
24
+ const ezI = (u) => H.ease.inOut(clI(u));
25
+ const winI = (t, a, b) => clI((t - a) / (b - a));
26
+ const CREAM = C(244, 232, 196), CHROMEY = C(244, 206, 72), OCH = C(214, 150, 60), VERMI = C(214, 70, 46), PRUS = C(24, 44, 100), SKYL = C(110, 160, 210);
27
+
28
+ function impBackground() {
29
+ const W = IXW, Hh = 720, nz = H.makeNoise(77);
30
+ const hill = (x) => 560 + 26 * Math.sin(x * 0.0042 + 0.5) + 14 * Math.sin(x * 0.011 + 2);
31
+ const vort = [[420, 160, 1.6, 95], [1300, 140, -1.4, 85], [1900, 190, 1.8, 105], [2700, 150, -1.5, 95], [3200, 230, 1.4, 90]];
32
+ const psiRaw = (x, y) => { let v = y * 0.9 + 14 * Math.sin(x * 0.006 + y * 0.004) + nz.fbm2(x * 0.004, y * 0.004, 2) * 24; for (const [cx, cy, s, R] of vort) { const d2 = (x - cx) ** 2 + (y - cy) ** 2; v += s * R * 1.6 * Math.exp(-d2 / (2 * R * R)); } return v; };
33
+ const GS = 6, GW = Math.ceil(W / GS) + 2, GH = Math.ceil(Hh / GS) + 2, PG = new Float32Array(GW * GH);
34
+ for (let j = 0; j < GH; j++) for (let i = 0; i < GW; i++) PG[j * GW + i] = psiRaw(i * GS, j * GS);
35
+ const bil = (x, y) => { const fx = H.clamp(x / GS, 0, GW - 1.001), fy = H.clamp(y / GS, 0, GH - 1.001), i = fx | 0, j = fy | 0, u = fx - i, v = fy - j, k = j * GW + i; return (PG[k] * (1 - u) + PG[k + 1] * u) * (1 - v) + (PG[k + GW] * (1 - u) + PG[k + GW + 1] * u) * v; };
36
+ const dir = (x, y) => { if (y > hill(x)) { const d = (hill(x + 4) - hill(x - 4)) / 8; return Math.atan(d) + nz.n2(x * 0.01, y * 0.02) * 0.3; } const gx = (bil(x + 3, y) - bil(x - 3, y)) / 6, gy = (bil(x, y + 3) - bil(x, y - 3)) / 6; return Math.atan2(-gx, gy); };
37
+ const SKY_D = C(18, 34, 96), SKY_M = C(40, 78, 158), SKY_L = C(86, 140, 196), PALE = C(190, 214, 214);
38
+ const colAt = (x, y, r) => {
39
+ const hy = hill(x);
40
+ if (y > hy) { const dp = y - hy, b = Math.sin(dp * 0.07 + nz.n2(x * 0.006, y * 0.01) * 3); let c = mixc(C(24, 52, 60), C(16, 30, 52), H.clamp(dp / 160)); if (b > 0.4) c = mixc(c, C(64, 98, 66), 0.6); return c; }
41
+ let c = mixc(SKY_D, SKY_M, H.clamp(y / hy)); const band = Math.sin(bil(x, y) * 0.085);
42
+ let sw = 0; for (const [cx, cy, , R] of vort) sw = Math.max(sw, Math.exp(-((x - cx) ** 2 + (y - cy) ** 2) / (2 * (R * 1.3) ** 2)));
43
+ if (band > 0.35) c = mixc(c, SKY_L, 0.45 + 0.3 * sw); if (band > 0.75 && sw > 0.3) c = mixc(c, PALE, 0.5 * sw); if (band < -0.6) c = mixc(c, SKY_D, 0.5);
44
+ if (y > hy - 60) c = mixc(c, C(100, 140, 165), H.clamp((y - (hy - 60)) / 60) * 0.5);
45
+ return c;
46
+ };
47
+ const COL = H.layer(W, Hh), cx_ = COL.getContext('2d'), HT = H.layer(W, Hh), hx = HT.getContext('2d');
48
+ { const UP = H.layer(Math.ceil(W / 8), 90), ux = UP.getContext('2d'), r = H.rng(3); for (let y = 0; y < 90; y++) for (let x = 0; x < UP.width; x++) { ux.fillStyle = css(colAt(x * 8 + 4, y * 8 + 4, r)); ux.fillRect(x, y, 1, 1); } cx_.filter = 'blur(4px)'; cx_.drawImage(UP, -8, -8, W + 16, Hh + 16); cx_.filter = 'none'; }
49
+ hx.fillStyle = '#3a3a3a'; hx.fillRect(0, 0, W, Hh);
50
+ cx_.lineCap = hx.lineCap = 'round'; cx_.lineJoin = hx.lineJoin = 'round';
51
+ const r1 = H.rng(78), cells = [];
52
+ for (let y = 0; y < Hh + 6; y += 8.5) for (let x = 0; x < W + 6; x += 10) cells.push([x + r1.range(-4, 4), y + r1.range(-3, 3)]);
53
+ for (let i = cells.length - 1; i > 0; i--) { const j = Math.floor(r1() * (i + 1)); [cells[i], cells[j]] = [cells[j], cells[i]]; }
54
+ for (const [x, y] of cells) {
55
+ const gnd = y > hill(x), longS = r1() < 0.13;
56
+ const len = gnd ? r1.range(20, 32) : longS ? r1.range(28, 40) : r1.range(14, 24), w = longS ? r1.range(6.5, 8.5) : r1.range(5.5, 8), a0 = dir(x, y), pts = [[x, y]];
57
+ let fx = x, fy = y, bx = x, by = y;
58
+ for (let i = 0; i < 3; i++) { const af = dir(fx, fy), ab = dir(bx, by); fx += Math.cos(af) * len / 6; fy += Math.sin(af) * len / 6; bx -= Math.cos(ab) * len / 6; by -= Math.sin(ab) * len / 6; pts.push([fx, fy]); pts.unshift([bx, by]); }
59
+ const col = jit(colAt(x, y, r1), r1, 9), col2 = mixc(col, r1.chance(0.5) ? C(240, 236, 210) : C(10, 20, 60), 0.25);
60
+ const path = (c, o = 0, ox = 0, oy = 0) => { c.beginPath(); c.moveTo(pts[o][0] + ox, pts[o][1] + oy); for (let i = o + 1; i < pts.length - o; i++) c.lineTo(pts[i][0] + ox, pts[i][1] + oy); };
61
+ cx_.lineWidth = w; cx_.strokeStyle = css(col); path(cx_); cx_.stroke();
62
+ const nx = -Math.sin(a0), ny = Math.cos(a0), off = (r1() - 0.5) * w * 0.5;
63
+ cx_.lineWidth = w * 0.3; cx_.strokeStyle = css(col2); path(cx_, 1, nx * off, ny * off); cx_.stroke();
64
+ const base = 110 + r1() * 60; hx.lineWidth = w; hx.strokeStyle = `rgb(${base | 0},${base | 0},${base | 0})`; path(hx); hx.stroke();
65
+ const top = base + 50 + r1() * 40; hx.lineWidth = w * 0.42; hx.strokeStyle = `rgb(${top | 0},${top | 0},${top | 0})`; path(hx, 1, nx * off * 0.5, ny * off * 0.5); hx.stroke();
66
+ }
67
+ // light the relief once
68
+ const img = cx_.getImageData(0, 0, W, Hh), d = img.data;
69
+ hx.filter = 'blur(0.7px)'; hx.drawImage(HT, 0, 0); hx.filter = 'none';
70
+ const hd = hx.getImageData(0, 0, W, Hh).data;
71
+ for (let y = 1; y < Hh - 1; y++) for (let x = 1; x < W - 1; x++) {
72
+ const i = (y * W + x) * 4, gx = hd[i + 4] - hd[i - 4], gy = hd[i + W * 4] - hd[i - W * 4];
73
+ const lam = (gx * 0.7 + gy * 0.7) * 0.0078, sh = 1 + lam, spec = lam > 0.25 ? (lam - 0.25) * 140 : 0;
74
+ for (let c = 0; c < 3; c++) d[i + c] = d[i + c] * sh + spec;
75
+ }
76
+ cx_.putImageData(img, 0, 0);
77
+ return { canvas: COL, hill };
78
+ }
79
+
80
+ // one fat daub of paint: shadowed edge, body, a broken-colour streak and a lit ridge
81
+ function daub(c, pts, w, col, r) {
82
+ if (pts.length < 2) return;
83
+ const path = (ox, oy, s = 0) => { c.beginPath(); c.moveTo(pts[s][0] + ox, pts[s][1] + oy); for (let i = s + 1; i < pts.length - s; i++) c.lineTo(pts[i][0] + ox, pts[i][1] + oy); };
84
+ c.lineCap = 'round'; c.lineJoin = 'round';
85
+ c.lineWidth = w; c.strokeStyle = css(mixc(col, C(5, 8, 25), 0.55)); path(w * 0.16 + 0.6, w * 0.2 + 0.8); c.stroke();
86
+ c.strokeStyle = css(col); path(0, 0); c.stroke();
87
+ c.lineWidth = Math.max(1, w * 0.22); c.strokeStyle = css(mixc(col, r() < 0.5 ? C(255, 250, 230) : C(30, 30, 70), 0.22)); path(w * 0.18, -w * 0.05); c.stroke();
88
+ c.lineWidth = Math.max(1, w * 0.3); c.strokeStyle = css(mixc(col, C(255, 252, 240), 0.5)); path(-w * 0.18, -w * 0.22, pts.length > 3 ? 1 : 0); c.stroke();
89
+ }
90
+ // fill a shape (given as a mask canvas) with short daubs running along `ang(x,y)`
91
+ function paintMask(mask, colFn, ang, { step = 5, len = 10, w = 5, seed = 1 } = {}) {
92
+ const mw = mask.width, mh = mask.height, md = mask.getContext('2d').getImageData(0, 0, mw, mh).data;
93
+ const out = H.layer(mw + 16, mh + 16), oc = out.getContext('2d'), r = H.rng(seed);
94
+ oc.translate(8, 8);
95
+ for (let y = 0; y < mh; y += step * 0.8) for (let x = 0; x < mw; x += step) {
96
+ const xx = x + r.range(-1.5, 1.5), yy = y + r.range(-1.5, 1.5), k = ((yy | 0) * mw + (xx | 0)) * 4 + 3;
97
+ if (xx < 0 || yy < 0 || xx >= mw || yy >= mh || md[k] < 128) continue;
98
+ const a = ang(xx, yy) + r.gauss() * 0.15, l = len * (0.7 + r() * 0.6);
99
+ daub(oc, [[xx - Math.cos(a) * l / 2, yy - Math.sin(a) * l / 2], [xx, yy], [xx + Math.cos(a) * l / 2, yy + Math.sin(a) * l / 2]], w * (0.8 + r() * 0.4), jit(colFn(xx, yy), r, 10), r);
100
+ }
101
+ return out;
102
+ }
103
+ function impCache() {
104
+ if (IXC) return IXC;
105
+ const C0 = { bg: impBackground(), text: new Map() };
106
+ // painted cat & dog pictures (little framed canvases)
107
+ const animal = (dog) => {
108
+ const m = H.layer(200, 200), c = m.getContext('2d'); c.fillStyle = '#000';
109
+ c.fillRect(0, 0, 200, 200);
110
+ const frame = paintMask(m, (x, y) => (x < 14 || y < 14 || x > 186 || y > 186 ? C(150, 100, 50) : C(236, 222, 186)), (x, y) => (x < 14 || x > 186 ? Math.PI / 2 : 0), { step: 6, len: 14, w: 7, seed: dog ? 11 : 12 });
111
+ const hm = H.layer(200, 200), h = hm.getContext('2d'); h.fillStyle = '#000';
112
+ if (dog) { h.beginPath(); h.ellipse(100, 108, 52, 48, 0, 0, 7); h.fill(); }
113
+ else { h.beginPath(); [[46, 96], [50, 34], [80, 64], [120, 64], [150, 34], [154, 96], [140, 140], [100, 156], [60, 140]].forEach(([x, y], i) => (i ? h.lineTo(x, y) : h.moveTo(x, y))); h.fill(); }
114
+ const headCol = dog ? C(150, 98, 56) : C(238, 140, 48);
115
+ const head = paintMask(hm, () => headCol, (x, y) => Math.atan2(y - 108, x - 100) + Math.PI / 2, { step: 4.5, len: 10, w: 5, seed: dog ? 13 : 14 });
116
+ const out = H.layer(216, 216), o = out.getContext('2d'); o.drawImage(frame, 0, 0); o.drawImage(head, 0, 0);
117
+ const r = H.rng(dog ? 15 : 16);
118
+ if (dog) for (const s of [-1, 1]) daub(o, [[108 + s * 50, 80], [108 + s * 62, 116], [108 + s * 56, 146]], 18, C(90, 56, 34), r);
119
+ daub(o, [[84, 108], [86, 110]], 9, C(30, 30, 60), r); daub(o, [[128, 108], [130, 110]], 9, C(30, 30, 60), r);
120
+ daub(o, [[104, 128], [112, 128]], 8, C(60, 30, 40), r);
121
+ return out;
122
+ };
123
+ C0.cat = animal(false); C0.dog = animal(true);
124
+ IXC = C0;
125
+ return C0;
126
+ }
127
+ // lettering painted with a small brush (cached per string)
128
+ function paintedText(str, size, col, font = '900 italic', family = 'Fraunces') {
129
+ const C0 = impCache(), key = str + '|' + size + '|' + col.join(',');
130
+ let cv = C0.text.get(key);
131
+ if (cv) return cv;
132
+ const m = H.layer(4, 4).getContext('2d'); m.font = `${font} ${size}px "${family}"`;
133
+ const w = Math.ceil(m.measureText(str).width) + 10, h = Math.ceil(size * 1.3);
134
+ // thick lettering: a solid loaded fill, raised (shadow + lit rim) and dragged with brush streaks
135
+ cv = H.layer(w + 16, h + 16); const c = cv.getContext('2d'), r = H.rng(str.length * 7 + size), e = Math.max(1.2, size / 40);
136
+ c.font = `${font} ${size}px "${family}"`; c.translate(8, 8);
137
+ c.fillStyle = css(mixc(col, C(5, 8, 25), 0.65)); c.fillText(str, 5 + e * 1.6, size + e * 2);
138
+ c.fillStyle = css(mixc(col, C(255, 252, 240), 0.6)); c.fillText(str, 5 - e, size - e);
139
+ c.fillStyle = css(col); c.fillText(str, 5, size);
140
+ c.globalCompositeOperation = 'source-atop'; c.lineCap = 'round';
141
+ for (let k = 0; k < w * h / (size * 1.2); k++) {
142
+ const x = r() * w, y = r() * h, l = size * r.range(0.15, 0.4);
143
+ c.strokeStyle = css(mixc(col, r() < 0.5 ? C(255, 250, 230) : C(60, 40, 20), r.range(0.12, 0.3))); c.lineWidth = r.range(1, Math.max(1.5, size / 22));
144
+ c.beginPath(); c.moveTo(x, y); c.lineTo(x + l, y + r.gauss() * 1.5); c.stroke();
145
+ }
146
+ cv.base = size + 16;
147
+ // a dark ultramarine-umber glaze laid under the lettering so it separates from the swirls
148
+ { const gz = H.layer(cv.width + 24, cv.height + 24), gc = gz.getContext('2d');
149
+ const dr = Math.max(2, size / 18);
150
+ gc.filter = `blur(${Math.max(3.5, size / 11).toFixed(1)}px)`;
151
+ for (let a = 0; a < 8; a++) gc.drawImage(cv, 12 + Math.cos(a * 0.785) * dr, 12 + Math.sin(a * 0.785) * dr);
152
+ gc.filter = 'none';
153
+ gc.globalCompositeOperation = 'source-in'; gc.fillStyle = 'rgba(12,16,44,0.82)'; gc.fillRect(0, 0, gz.width, gz.height);
154
+ cv.glaze = gz; }
155
+ if (C0.text.size > 200) C0.text.clear();
156
+ C0.text.set(key, cv);
157
+ return cv;
158
+ }
159
+ let glazeTmp = null;
160
+ function pText(c, str, x, y, size, col, { align = 'left', reveal = 1 } = {}) {
161
+ if (reveal <= 0) return;
162
+ const cv = paintedText(str, size, col), w = cv.width - 16, ox = align === 'center' ? -w / 2 : align === 'right' ? -w : 0;
163
+ const rw = cv.width * clI(reveal), go = Math.max(2, size / 24);
164
+ if (cv.glaze) {
165
+ const gz = cv.glaze, dx = x + ox - 20 + go * 0.7, dy = y - cv.base - 12 + go;
166
+ if (reveal >= 1) c.drawImage(gz, dx, dy);
167
+ else {
168
+ // glaze follows the brush: cropped at the reveal edge and feathered so it never shows a hard dark block
169
+ if (!glazeTmp || glazeTmp.width < gz.width || glazeTmp.height < gz.height) glazeTmp = H.layer(gz.width, gz.height);
170
+ const gt = glazeTmp.getContext('2d'), ew = rw + 12;
171
+ gt.globalCompositeOperation = 'source-over'; gt.clearRect(0, 0, glazeTmp.width, glazeTmp.height);
172
+ gt.drawImage(gz, 0, 0, ew, gz.height, 0, 0, ew, gz.height);
173
+ const fg = gt.createLinearGradient(Math.max(0, ew - 26), 0, ew, 0); fg.addColorStop(0, 'rgba(0,0,0,0)'); fg.addColorStop(1, 'rgba(0,0,0,1)');
174
+ gt.globalCompositeOperation = 'destination-out'; gt.fillStyle = fg; gt.fillRect(Math.max(0, ew - 26), 0, 27, gz.height);
175
+ c.drawImage(glazeTmp, 0, 0, ew, gz.height, dx, dy, ew, gz.height);
176
+ }
177
+ }
178
+ c.drawImage(cv, 0, 0, rw, cv.height, x + ox - 8, y - cv.base, rw, cv.height);
179
+ }
180
+ // a painted arrow: a chain of fat daubs following a curve, drawn on progressively
181
+ function pArrow(c, pts, w, col, prog, seed, head = true) {
182
+ if (prog <= 0) return;
183
+ const r = H.rng(seed), n = Math.max(2, Math.ceil(pts.length * clI(prog)));
184
+ // each daub is laid by hand: a slight sideways wobble and its own load, so the chain never reads as one vector line
185
+ for (let i = 0; i < n - 1; i += 2) { const ox = (r() - 0.5) * w * 0.28, oy = (r() - 0.5) * w * 0.28; daub(c, pts.slice(i, Math.min(n, i + 4)).map((p) => [p[0] + ox, p[1] + oy]), w * (0.8 + r() * 0.4), jit(col, r, 12), r); }
186
+ if (head && prog >= 1) {
187
+ const a = pts[pts.length - 4] || pts[0], b = pts[pts.length - 1], ang = Math.atan2(b[1] - a[1], b[0] - a[0]);
188
+ for (const s of [-1, 1]) daub(c, [[b[0], b[1]], [b[0] - Math.cos(ang + s * 0.55) * w * 1.6, b[1] - Math.sin(ang + s * 0.55) * w * 1.6], [b[0] - Math.cos(ang + s * 0.55) * w * 3, b[1] - Math.sin(ang + s * 0.55) * w * 3]], w * 0.9, col, r);
189
+ }
190
+ }
191
+ const bezI = (p0, p1, p2, p3, n = 40) => { const o = []; for (let i = 0; i <= n; i++) { const u = i / n, a = 1 - u; o.push([a * a * a * p0[0] + 3 * a * a * u * p1[0] + 3 * a * u * u * p2[0] + u * u * u * p3[0], a * a * a * p0[1] + 3 * a * a * u * p1[1] + 3 * a * u * u * p2[1] + u * u * u * p3[1]]); } return o; };
192
+ const ring = (cx, cy, rx, ry, a0 = -0.5, turns = 1.08, n = 40) => { const o = []; for (let i = 0; i <= n; i++) { const a = a0 + i / n * Math.PI * 2 * turns; o.push([cx + Math.cos(a) * rx, cy + Math.sin(a) * ry]); } return o; };
193
+ const fmtI = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
194
+
195
+ function explainImpasto(ctx, W, H_, t) {
196
+ const C0 = impCache();
197
+ const cam = Math.round(760 * ezI((t - 6.0) / 0.9) + 1300 * ezI((t - 10.5) / 0.9));
198
+ ctx.drawImage(C0.bg.canvas, cam, 0, W, H_, 0, 0, W, H_);
199
+ ctx.save(); ctx.translate(-cam, 0);
200
+ const r = H.rng(1000 + Math.floor(t * 12)); // daubs re-laid on twos: a living, hand-made jitter
201
+
202
+ // ---------- the model: a blazing swirl-sun with three arms (its weights) ----------
203
+ const OX = 1040, OY = 290, OR = 110;
204
+ const og = winI(t, 1.4, 2.4);
205
+ if (og > 0) {
206
+ ctx.save(); ctx.globalCompositeOperation = 'screen';
207
+ const g = ctx.createRadialGradient(OX, OY, 10, OX, OY, OR * 2.2); g.addColorStop(0, `rgba(255,214,110,${0.55 * og})`); g.addColorStop(1, 'rgba(255,214,110,0)');
208
+ ctx.fillStyle = g; ctx.fillRect(OX - OR * 2.3, OY - OR * 2.3, OR * 4.6, OR * 4.6); ctx.restore();
209
+ for (let k = 0; k < 3; k++) { const rr = OR * (0.55 + k * 0.28) * og; if (rr > 4) pArrow(ctx, ring(OX, OY, rr, rr, k * 1.3, 1.0, 36), 13 - k * 2, k === 1 ? C(250, 236, 180) : CHROMEY, winI(t, 1.4 + k * 0.2, 2.2 + k * 0.2), 300 + k, false); }
210
+ const spin = ezI((t - 8.7) / 0.7) * 1.4;
211
+ for (let k = 0; k < 3; k++) { const a = k * 2.094 + 0.3 + spin * (k === 1 ? -1 : 1); const arm = []; for (let i = 0; i <= 8; i++) { const u = i / 8; arm.push([OX + Math.cos(a + u * 1.6) * u * OR * 0.5, OY + Math.sin(a + u * 1.6) * u * OR * 0.5]); } pArrow(ctx, arm, 10, VERMI, winI(t, 2.0 + k * 0.1, 2.4 + k * 0.1), 310 + k, false); }
212
+ pText(ctx, 'the model', OX, OY + OR + 70, 40, CREAM, { align: 'center', reveal: winI(t, 2.4, 2.9) });
213
+ }
214
+ if (t > 8.6 && t < 9.7) { const k = Math.sin(Math.PI * winI(t, 8.6, 9.7)); ctx.save(); ctx.globalCompositeOperation = 'screen'; const g = ctx.createRadialGradient(OX, OY, 10, OX, OY, OR * 2.6); g.addColorStop(0, `rgba(255,236,170,${0.7 * k})`); g.addColorStop(1, 'rgba(255,236,170,0)'); ctx.fillStyle = g; ctx.fillRect(OX - 300, OY - 300, 600, 600); ctx.restore(); }
215
+
216
+ // ---------- beat 2: painted examples swirl into the model; the count climbs ----------
217
+ const flow = bezI([-120, 520], [300, 600], [700, 120], [OX - OR, OY], 50);
218
+ pArrow(ctx, flow.slice(0, 46), 12, C(200, 214, 230), winI(t, 2.3, 3.0), 400, true);
219
+ const at = (u) => { const f = u * (flow.length - 1), i = Math.min(flow.length - 2, Math.floor(f)), q = f - i; return [lerpI(flow[i][0], flow[i + 1][0], q), lerpI(flow[i][1], flow[i + 1][1], q)]; };
220
+ for (const pass of [0, 1]) for (let i = 0; i < 24; i++) { // pass 0: the little canvases, pass 1: their labels on top
221
+ const s0 = 2.6 + i * 0.13, u = (t - s0) / 1.5;
222
+ if (u <= 0 || u >= 1) continue;
223
+ const [x, y] = at(u), dog = (i % 2 === 1) !== (i % 5 === 0), sc = u > 0.8 ? 1 - (u - 0.8) / 0.2 * 0.85 : 1, sz = 96 * sc;
224
+ ctx.save(); ctx.translate(x, y - 40 * sc); ctx.rotate(Math.sin(i * 1.9) * 0.15);
225
+ if (!pass) {
226
+ // cast shadow of the little canvas onto the sky
227
+ ctx.fillStyle = 'rgba(8,12,36,0.35)'; ctx.fillRect(-sz / 2 + 5, -sz / 2 + 7, sz * 0.92, sz * 0.92);
228
+ ctx.drawImage(dog ? C0.dog : C0.cat, -sz / 2, -sz / 2, sz, sz);
229
+ } else if (sc > 0.6) pText(ctx, dog ? 'dog' : 'cat', -sz / 2, sz / 2 + 34, 32, dog ? C(230, 190, 150) : CHROMEY);
230
+ ctx.restore();
231
+ }
232
+ if (t > 2.9) {
233
+ const n = t > 5.6 ? 1e6 : Math.round(1e6 * H.ease.in(winI(t, 3.0, 5.6)) / 1000) * 1000;
234
+ pText(ctx, fmtI(n), 80, 680, 64, CHROMEY, { reveal: winI(t, 2.9, 3.2) });
235
+ pText(ctx, 'examples', 80 + paintedText(fmtI(n), 64, CHROMEY).width, 680, 46, CREAM, { reveal: winI(t, 3.0, 3.4) });
236
+ if (t > 5.6) pArrow(ctx, bezI([70, 696], [250, 708], [500, 700], [660, 704], 24), 11, VERMI, winI(t, 5.6, 5.95), 410, false);
237
+ }
238
+
239
+ // ---------- beat 3: guess -> check -> adjust ----------
240
+ const PX = 1730, PY = 300;
241
+ if (t > 6.4) {
242
+ const k = H.ease.back(winI(t, 6.4, 6.8));
243
+ ctx.save(); ctx.translate(PX + 105, PY + 105); ctx.scale(k, k); ctx.drawImage(C0.cat, -110, -110, 220, 220); ctx.restore();
244
+ pText(ctx, 'new picture', PX + 105, PY + 262, 34, CREAM, { align: 'center', reveal: winI(t, 6.7, 7.1) });
245
+ }
246
+ const BX = 1420, BY = 120;
247
+ pArrow(ctx, bezI([OX + 80, OY - 80], [OX + 140, OY - 170], [BX - 60, BY + 60], [BX - 10, BY + 30], 24), 12, CHROMEY, winI(t, 6.8, 7.2), 420);
248
+ pText(ctx, 'Guess', OX + 60, OY - 150, 42, CREAM, { reveal: winI(t, 6.9, 7.3) });
249
+ const second = t > 9.4;
250
+ if (!second) pText(ctx, 'dog?', BX + 10, BY + 70, 86, C(230, 190, 150), { reveal: winI(t, 7.1, 7.5) });
251
+ pArrow(ctx, bezI([PX + 60, PY - 10], [PX + 20, PY - 90], [BX + 300, BY - 10], [BX + 250, BY + 20], 24), 12, CREAM, winI(t, 7.5, 7.9), 430);
252
+ pText(ctx, 'Check', PX + 60, PY - 60, 42, CREAM, { reveal: winI(t, 7.6, 8.0) });
253
+ if (t > 7.9 && !second) {
254
+ pArrow(ctx, [[BX + 10, BY - 20], [BX + 70, BY + 30], [BX + 130, BY + 80], [BX + 190, BY + 120]], 15, VERMI, winI(t, 7.9, 8.05), 440, false);
255
+ pArrow(ctx, [[BX + 190, BY - 20], [BX + 130, BY + 30], [BX + 70, BY + 80], [BX + 10, BY + 120]], 15, VERMI, winI(t, 8.05, 8.2), 441, false);
256
+ pArrow(ctx, ring(BX + 100, BY + 46, 150, 95, -0.4, 1.06, 44), 9, CHROMEY, winI(t, 8.0, 8.45), 442, false);
257
+ pText(ctx, "it's a cat!", PX + 105, PY + 312, 40, VERMI, { align: 'center', reveal: winI(t, 8.0, 8.4) });
258
+ }
259
+ pArrow(ctx, bezI([BX + 120, BY + 140], [BX + 80, BY + 360], [OX + 220, OY + 220], [OX + 100, OY + 110], 30), 10, VERMI, winI(t, 8.25, 8.8), 450);
260
+ pText(ctx, 'Adjust', BX + 40, BY + 330, 42, VERMI, { reveal: winI(t, 8.5, 8.9) });
261
+ if (second) {
262
+ pText(ctx, 'cat', BX + 20, BY + 70, 86, CHROMEY, { reveal: winI(t, 9.4, 9.7) });
263
+ pArrow(ctx, [[BX + 170, BY + 30], [BX + 186, BY + 52], [BX + 205, BY + 20], [BX + 232, BY - 20]], 11, C(90, 190, 90), winI(t, 9.7, 9.95), 460, false);
264
+ }
265
+
266
+ // ---------- beat 4: accuracy climbs, painted as a ridge over the hills ----------
267
+ const CX0 = 2210, CY0 = 540, CW = 800, CH = 340, N = 24;
268
+ if (t > 10.6) {
269
+ // axes as a chain of short loaded daubs (not one long vector line)
270
+ const axY = [], axX = [];
271
+ for (let i = 0; i <= 12; i++) { const u = i / 12; axY.push([CX0 + Math.sin(i * 2.1) * 1.4, CY0 - CH + CH * u]); axX.push([CX0 + (CW + 20) * u, CY0 + Math.sin(i * 1.7) * 1.4]); }
272
+ pArrow(ctx, axY, 9, CREAM, winI(t, 10.7, 11.0), 470, false);
273
+ pArrow(ctx, axX, 9, CREAM, winI(t, 10.8, 11.2), 471, false);
274
+ pText(ctx, 'training rounds', CX0 + CW / 2, CY0 + 52, 34, CREAM, { align: 'center', reveal: winI(t, 11.0, 11.4) });
275
+ const pts = [];
276
+ for (let i = 0; i <= N; i++) { const acc = 61 + 36 * (1 - Math.exp(-i / 5.5)) / (1 - Math.exp(-N / 5.5)) + (i > 0 && i < N ? Math.sin(i * 2.7) * 1.6 : 0); pts.push([CX0 + i / N * CW, CY0 - (acc - 50) / 50 * CH]); }
277
+ const pr = winI(t, 11.2, 12.7), dense = [];
278
+ for (let i = 0; i < N; i++) for (let k = 0; k < 3; k++) dense.push([lerpI(pts[i][0], pts[i + 1][0], k / 3), lerpI(pts[i][1], pts[i + 1][1], k / 3)]);
279
+ dense.push(pts[N]);
280
+ pArrow(ctx, dense, 11, CHROMEY, pr, 480, false);
281
+ const acc = Math.round(t < 11.2 ? 61 : t > 12.7 ? 97 : lerpI(61, 97, H.ease.out(pr)));
282
+ pText(ctx, 'Accuracy', CX0 + 10, CY0 - CH - 30, 50, CREAM, { reveal: winI(t, 10.9, 11.3) });
283
+ pText(ctx, acc + '%', CX0 + 270, CY0 - CH - 26, 76, acc >= 97 ? VERMI : CHROMEY, { reveal: winI(t, 11.1, 11.3) });
284
+ pText(ctx, '61%', CX0 - 74, pts[0][1] + 12, 30, CREAM, { reveal: winI(t, 11.2, 11.5) });
285
+ if (t > 12.7) { pArrow(ctx, ring(CX0 + 372, CY0 - CH - 52, 104, 60, -0.3, 1.06, 40), 8, CHROMEY, winI(t, 12.7, 13.1), 490, false); pArrow(ctx, ring(pts[N][0], pts[N][1], 28, 28, 0, 1.05, 24), 6, VERMI, winI(t, 12.9, 13.2), 491, false); }
286
+ }
287
+ ctx.restore();
288
+
289
+ // ---------- beat 5 + beat 1 (screen space) ----------
290
+ if (t > 13.2) pText(ctx, 'More examples → better guesses', 640, 690, 56, CREAM, { align: 'center', reveal: ezI((t - 13.2) / 0.7) });
291
+ {
292
+ const k = ezI((t - 1.5) / 0.8), s = lerpI(1, 0.58, k), cv = paintedText('How does AI learn?', 96, CHROMEY);
293
+ ctx.save(); ctx.translate(lerpI(640 - (cv.width - 16) / 2, 34, k), lerpI(380, 64, k)); ctx.scale(s, s);
294
+ pText(ctx, 'How does AI learn?', 0, 0, 96, CHROMEY, { reveal: winI(t, 0.1, 1.1) });
295
+ ctx.restore();
296
+ }
297
+ void r;
298
+ }
299
+
300
+ registerStyle({
301
+ id: 'impasto-oil',
302
+ name: 'Impasto Night',
303
+ category: 'Painterly',
304
+ description: 'Thick oil paint in short loaded strokes that follow a swirling flow field, Post-Impressionist night-sky style; every stroke stands off the canvas with a lit ridge and a shadowed edge, colour broken within each stroke.',
305
+ motion: 'The sky\'s strokes slowly rotate along their swirl and the halos around the moon and stars pulse ring by ring, as if the paint itself were turning.',
306
+ fonts: ['900 italic 64px "Fraunces"'],
307
+ duration: 6.5,
308
+ frameT: 6.4,
309
+ readsPixels: true,
310
+ explainerDuration: 15,
311
+ explainerNote: 'The camera travels along one long swirling night-sky canvas; arrows, rings, labels and numbers are all laid on as fat lit daubs of paint (shadow edge, body, highlight ridge) in chrome yellow and vermilion against the blues.',
312
+ explainer(ctx, W, H_, t) { explainImpasto(ctx, W, H_, t); },
313
+ explainerSound(k) {
314
+ // all times copied from explainImpasto() above (its winI()/ezI() windows)
315
+ const D = 15;
316
+ const when = (f, v, a, b) => { for (let t = a; t <= b; t += 0.001) if (f(t) >= v) return t; return b; };
317
+ // one fat daub of oil paint pressed onto canvas: a short, sticky, low smack
318
+ const daub = (t, g = 1, pan = 0, minor = true) => {
319
+ k.noise(t, { dur: 0.09, color: 'pink', filter: 'bandpass', f: [[0, 750], [0.09, 380]], q: 1.3, gain: 0.24 * g, a: 0.006, pan, minor });
320
+ k.tone(t, { f: [[0, 150], [0.06, 85]], dur: 0.08, gain: 0.09 * g, pan, minor });
321
+ };
322
+ // a loaded hog-hair brush dragged through thick paint, laying daubs as it goes (at most ~11 per second)
323
+ const drag = (a, b, g = 1, p0 = 0, p1 = p0, minor = true) => {
324
+ const d = b - a;
325
+ k.play('stroke', a, { material: 'brush', dur: d, gain: 1.1 * g, pan: (p0 + p1) / 2, minor });
326
+ for (let x = 0; x < d - 0.02; x += 0.09) daub(a + x, (x ? 0.55 : 1) * g, p0 + (p1 - p0) * x / d, minor);
327
+ };
328
+ const write = (s, a, b, g = 0.7, pan = 0) => { const re = /\S+/g; let m;
329
+ while ((m = re.exec(s))) { const wa = a + (b - a) * m.index / s.length, wb = a + (b - a) * (m.index + m[0].length) / s.length; k.play('stroke', wa, { material: 'brush', dur: wb - wa, gain: 1.1 * g, pan, minor: true }); daub(wa, 0.7 * g, pan); } };
330
+ // palette knife scraping paint: a steady, slightly metallic scrape (kept below 2 kHz)
331
+ const knife = (a, b, g = 1, pan = 0, minor = false) => { const d = b - a;
332
+ k.noise(a, { dur: d, filter: 'bandpass', f: [[0, 1100], [d, 1700]], q: 2.6, gain: 0.2 * g, a: 0.01, hold: d * 0.6, pan, minor });
333
+ k.noise(a, { dur: d, color: 'brown', filter: 'lowpass', f: 400, gain: 0.18 * g, a: 0.01, hold: d * 0.5, pan, minor }); };
334
+ // scene change: mixing a fresh pile on the palette with the knife, then a tap of the blade
335
+ const palette = (t) => { knife(t, t + 0.22, 0.8, -0.3); knife(t + 0.3, t + 0.5, 0.65, 0.3); k.play('tock', t + 0.62, { f: 1400, gain: 0.25, pan: 0.2 }); };
336
+ const counter = (val, a, b, pan) => { let last = val(a), lastT = -1;
337
+ for (let t = a; t <= b; t += 1 / 240) { const v = val(t); if (v !== last && t - lastT >= 1 / 12) { daub(t, 0.6, pan); lastT = t; } last = v; } };
338
+
339
+ k.bed('room', 0, D, { gain: 0.45 });
340
+ // a slow, dark night-sky pad (Ebmaj7, Cm7, Abmaj7, Bb6; 3.75 s bars)
341
+ k.music('pad', 0, D, { bpm: 64, gain: 0.3, chords: [['Eb3', 'G3', 'Bb3', 'D4'], ['C3', 'Eb3', 'G3', 'Bb3'], ['Ab2', 'C3', 'Eb3', 'G3'], ['Bb2', 'D3', 'F3', 'G3']] });
342
+
343
+ // ---- 1 HOOK: title painted 0.1-1.1, then a soft slide to the corner 1.5-2.3
344
+ write('How does AI learn?', 0.1, 1.1, 1.0);
345
+ k.noise(1.5, { dur: 0.8, color: 'pink', filter: 'bandpass', f: [[0, 280], [0.8, 600]], q: 0.7, gain: 0.07, a: 0.3, minor: true });
346
+
347
+ // ---- 2 DATA: the swirl-sun (rings 1.4-2.6, arms 2.0-2.6), the flow arrow 2.3-3.0
348
+ k.noise(1.4, { dur: 1.2, color: 'pink', filter: 'bandpass', f: [[0, 300], [0.6, 700], [1.2, 400]], q: 0.8, gain: 0.08, a: 0.5, pan: 0.6, verb: 0.3 }); // the glow swells
349
+ drag(1.4, 2.2, 1.0, 0.4, 0.8, false);
350
+ drag(1.8, 2.6, 0.6, 0.8, 0.4);
351
+ drag(2.3, 3.0, 1.0, -0.9, 0.3, false);
352
+ write('the model', 2.4, 2.9, 0.5, 0.6);
353
+ // counter painted in: n = 1e6 * ease.in(winI(3.0, 5.6)), rounded to thousands
354
+ counter((t) => Math.round(1e6 * H.ease.in(winI(t, 3.0, 5.6)) / 1000), 3.05, 5.58, -0.6);
355
+ k.play('thud', 5.6, { f: 140, gain: 0.25, pan: -0.6 }); daub(5.6, 1.0, -0.6, false); // 1,000,000 lands
356
+ drag(5.6, 5.95, 1.0, -0.8, -0.1, false); // vermilion underline
357
+
358
+ // ---- camera travels 6.0-6.9: the knife works a new pile on the palette
359
+ palette(6.0);
360
+
361
+ // ---- 3 GUESS -> CHECK -> ADJUST
362
+ daub(6.45, 1.5, 0.6, false); // the cat canvas pops on (ease.back 6.4-6.8)
363
+ drag(6.8, 7.2, 0.9, 0.1, 0.4, false); // Guess arrow
364
+ write('dog?', 7.1, 7.5, 0.9, 0.3);
365
+ drag(7.5, 7.9, 0.9, 0.6, 0.4, false); // Check arrow
366
+ // the wrong guess: two vermilion slashes laid with the knife, a low dull knock
367
+ knife(7.9, 8.05, 1.4, 0.2); knife(8.05, 8.2, 1.4, 0.35);
368
+ k.play('thud', 7.9, { f: 110, gain: 0.5, pan: 0.25 });
369
+ k.tone(7.92, { f: 'Ab3', type: 'triangle', dur: 0.2, gain: 0.17, a: 0.01, hold: 0.07, verb: 0.2, pan: 0.25 });
370
+ k.tone(8.1, { f: 'F3', type: 'triangle', dur: 0.38, gain: 0.17, a: 0.01, hold: 0.12, verb: 0.2, pan: 0.25 });
371
+ drag(8.25, 8.8, 1.1, 0.3, -0.1, false); // Adjust arrow runs back to the model
372
+ // the sun's arms swing round (ezI over 8.7-9.4) while it glows: a slow swirl of paint
373
+ k.noise(8.6, { dur: 1.1, color: 'pink', filter: 'bandpass', f: [[0, 350], [0.55, 900], [1.1, 400]], q: 1.0, gain: 0.08, a: 0.45, pan: -0.1, verb: 0.3, minor: true });
374
+ write('cat', 9.4, 9.7, 1.0, 0.3);
375
+ drag(9.7, 9.95, 1.1, 0.3, 0.4, false); // green check
376
+ k.play('success', 9.95, { f: 'G5', gain: 0.45, pan: 0.3 });
377
+
378
+ // ---- camera travels 10.5-11.4
379
+ palette(10.5);
380
+
381
+ // ---- 4 PROGRESS: axes 10.7-11.2, the ridge 11.2-12.7
382
+ drag(10.7, 11.0, 0.5, -0.6, -0.6); drag(10.8, 11.2, 0.5, -0.6, 0.6);
383
+ k.play('stroke', 11.2, { material: 'brush', dur: 1.5, gain: 0.6, pan: 0, minor: true }); // the ridge, a long drag
384
+ const acc = (t) => Math.round(61 + 36 * H.ease.out(winI(t, 11.2, 12.7)));
385
+ const t97 = when(acc, 97, 11.2, 12.7);
386
+ counter(acc, 11.2, t97 - 0.05, -0.3);
387
+ // 97% lands and turns vermilion: the biggest hit, a heavy knife-load of paint slapped on with a warm chord
388
+ k.play('impact', t97, { gain: 0.85, pan: -0.3 });
389
+ k.play('slap', t97, { gain: 0.5, pan: -0.3 }); daub(t97, 2.0, -0.3, false);
390
+ k.play('ding', t97 + 0.02, { f: 'Bb4', gain: 0.5 });
391
+ ['Eb5', 'G5'].forEach((f, i) => k.tone(t97 + 0.05 + i * 0.03, { f, dur: 1.3, gain: 0.07, verb: 0.3, pan: (i - 0.5) * 0.5 }));
392
+ drag(12.7, 13.1, 1.2, -0.4, -0.1, false); // chrome-yellow ring around 97%
393
+ drag(12.9, 13.2, 0.7, 0.6, 0.7); // small ring on the last point
394
+
395
+ // ---- 5 TAKEAWAY (13.2-13.9), then the resolve
396
+ write('More examples → better guesses', 13.2, 13.9, 1.1);
397
+ k.play('ding', 13.95, { f: 'Eb4', gain: 0.45 });
398
+ ['G4', 'Bb4', 'Eb5'].forEach((f, i) => k.tone(14.01 + i * 0.06, { f, dur: 1.2, gain: 0.065 - i * 0.008, verb: 0.3, pan: (i - 1) * 0.3 }));
399
+ },
400
+ draw(ctx, W, H_, t) {
401
+ const nz = H.makeNoise(31);
402
+ const hill = (x) => 498 + 26 * Math.sin(x * 0.0052 + 0.6) + 14 * Math.sin(x * 0.013 + 2) - 40 * Math.exp(-Math.pow((x - 930) / 180, 2));
403
+ const moon = [190, 124], stars = [[400, 88, 1.15], [575, 330, 0.85], [760, 66, 1.0], [960, 92, 1.2], [1050, 310, 0.8], [300, 262, 0.85], [870, 350, 0.7], [1180, 60, 0.9]];
404
+ const domeC = [930, hill(930) - 46], domeR = 52;
405
+ const person = [430, hill(430) + 8];
406
+
407
+ // ---------- region map ----------
408
+ const M = H.layer(W, H_), mx = M.getContext('2d');
409
+ mx.imageSmoothingEnabled = false;
410
+ const idc = (id) => `rgb(${id},0,0)`;
411
+ mx.fillStyle = idc(ID.sky); mx.fillRect(0, 0, W, H_);
412
+ mx.fillStyle = idc(ID.ground); mx.beginPath(); mx.moveTo(0, H_); for (let x = 0; x <= W; x += 8) mx.lineTo(x, hill(x)); mx.lineTo(W, H_); mx.fill();
413
+ mx.fillStyle = idc(ID.moon); mx.beginPath(); mx.arc(moon[0], moon[1], 36, 0, 7); mx.fill();
414
+ stars.forEach(([x, y, s]) => { mx.fillStyle = idc(ID.star); mx.beginPath(); mx.arc(x, y, 9 * s, 0, 7); mx.fill(); });
415
+ // observatory
416
+ mx.fillStyle = idc(ID.body); mx.fillRect(domeC[0] - 56, domeC[1], 112, 58);
417
+ mx.fillStyle = idc(ID.dome); mx.beginPath(); mx.arc(domeC[0], domeC[1] + 2, domeR, Math.PI, 0); mx.closePath(); mx.fill();
418
+ mx.fillStyle = idc(ID.slit); mx.beginPath(); mx.moveTo(domeC[0] - 6, domeC[1] - domeR + 2); mx.lineTo(domeC[0] + 12, domeC[1] - domeR + 4); mx.lineTo(domeC[0] + 14, domeC[1]); mx.lineTo(domeC[0] - 8, domeC[1]); mx.fill();
419
+ mx.fillRect(domeC[0] - 12, domeC[1] + 18, 18, 26);
420
+ // seated figure with laptop
421
+ const [px, py] = person;
422
+ mx.save(); mx.translate(px, py); mx.scale(1.55, 1.55); mx.translate(-px, -py);
423
+ mx.fillStyle = idc(ID.person);
424
+ mx.beginPath(); mx.arc(px - 6, py - 64, 11, 0, 7); mx.fill();
425
+ mx.beginPath(); mx.moveTo(px - 24, py - 50); mx.quadraticCurveTo(px - 4, py - 58, px + 2, py - 40); mx.lineTo(px + 12, py - 12); mx.lineTo(px - 32, py - 6); mx.closePath(); mx.fill();
426
+ mx.beginPath(); mx.moveTo(px - 30, py - 14); mx.lineTo(px + 40, py - 16); mx.lineTo(px + 46, py - 2); mx.lineTo(px - 28, py + 2); mx.fill();
427
+ mx.beginPath(); mx.moveTo(px - 2, py - 44); mx.lineTo(px + 26, py - 26); mx.lineTo(px + 22, py - 20); mx.lineTo(px - 6, py - 36); mx.fill();
428
+ mx.fillStyle = idc(ID.screen); mx.beginPath(); mx.moveTo(px + 22, py - 16); mx.lineTo(px + 46, py - 46); mx.lineTo(px + 53, py - 42); mx.lineTo(px + 31, py - 14); mx.fill();
429
+ mx.restore();
430
+ // cypress, flame-shaped
431
+ mx.fillStyle = idc(ID.cypress); mx.beginPath();
432
+ mx.moveTo(1090, H_);
433
+ for (let y = H_; y >= 110; y -= 10) { const u = (H_ - y) / (H_ - 110); mx.lineTo(1150 - 88 * Math.pow(1 - u, 0.7) * (0.8 + 0.2 * Math.sin(y * 0.05)) + 8 * Math.sin(y * 0.03), y); }
434
+ for (let y = 110; y <= H_; y += 10) { const u = (H_ - y) / (H_ - 110); mx.lineTo(1150 + 80 * Math.pow(1 - u, 0.7) * (0.8 + 0.2 * Math.cos(y * 0.045)) + 8 * Math.sin(y * 0.03), y); }
435
+ mx.closePath(); mx.fill();
436
+ // painted title
437
+ mx.fillStyle = idc(ID.text); mx.font = '900 italic 64px "Fraunces"'; mx.fillText('The Night Shift', 56, 672);
438
+ const MAP = mx.getImageData(0, 0, W, H_).data;
439
+ const idAt = (x, y) => { x = Math.max(0, Math.min(W - 1, x | 0)); y = Math.max(0, Math.min(H_ - 1, y | 0)); return MAP[(y * W + x) * 4]; };
440
+
441
+ // ---------- flow: stream function -> direction ----------
442
+ const vort = [[640, 200, 2.2, 110], [450, 270, -1.4, 85], [830, 250, -1.1, 75], [moon[0], moon[1], 1.6, 70], [1010, 170, 0.9, 80]];
443
+ const rot = t * 0.08;
444
+ const psiRaw = (x, y) => {
445
+ let v = y * 0.9 + 16 * Math.sin(x * 0.006 + y * 0.004 + 1.3) + nz.fbm2(x * 0.004, y * 0.004, 2) * 26;
446
+ for (const [cx, cy, s, R] of vort) { const d2 = (x - cx) ** 2 + (y - cy) ** 2; v += s * R * 1.6 * Math.exp(-d2 / (2 * R * R)); }
447
+ for (const [cx, cy, s] of stars) { const d2 = (x - cx) ** 2 + (y - cy) ** 2; v += 40 * s * Math.exp(-d2 / (2 * 22 * 22 * s * s)); }
448
+ return v;
449
+ };
450
+ // stream function sampled once per frame on a 4px grid (bilinear lookups are far cheaper than the analytic field)
451
+ const GS = 4, GW = Math.ceil(W / GS) + 2, GH = Math.ceil(H_ / GS) + 2, PG = new Float32Array(GW * GH), GX = new Float32Array(GW * GH), GY = new Float32Array(GW * GH);
452
+ for (let j = 0; j < GH; j++) for (let i = 0; i < GW; i++) PG[j * GW + i] = psiRaw(i * GS, j * GS);
453
+ for (let j = 1; j < GH - 1; j++) for (let i = 1; i < GW - 1; i++) { const k = j * GW + i; GX[k] = (PG[k + 1] - PG[k - 1]) / (2 * GS); GY[k] = (PG[k + GW] - PG[k - GW]) / (2 * GS); }
454
+ const bil = (A, x, y) => {
455
+ const fx = H.clamp(x / GS, 0, GW - 1.001), fy = H.clamp(y / GS, 0, GH - 1.001), i = fx | 0, j = fy | 0, u = fx - i, v = fy - j, k = j * GW + i;
456
+ return (A[k] * (1 - u) + A[k + 1] * u) * (1 - v) + (A[k + GW] * (1 - u) + A[k + GW + 1] * u) * v;
457
+ };
458
+ const psi = (x, y) => bil(PG, x, y);
459
+ function dirAt(x, y, id) {
460
+ if (id === ID.ground) { const d = (hill(x + 4) - hill(x - 4)) / 8; const depth = (y - hill(x)) / 220; return Math.atan(d * (1 - depth)) + nz.n2(x * 0.01, y * 0.02) * 0.35; }
461
+ if (id === ID.cypress) return -Math.PI / 2 + 0.55 * Math.sin(y * 0.035 + x * 0.04) + nz.n2(x * 0.03, y * 0.03) * 0.3;
462
+ if (id === ID.dome) return Math.atan2(y - domeC[1], x - domeC[0]) + Math.PI / 2;
463
+ if (id === ID.body || id === ID.text) return 0.02 * Math.sin(y);
464
+ if (id === ID.slit) return Math.PI / 2;
465
+ if (id === ID.person) return -Math.PI / 2 + 0.4;
466
+ if (id === ID.screen) return -0.8;
467
+ if (id === ID.moon) return Math.atan2(y - moon[1], x - moon[0]) + Math.PI / 2;
468
+ const gx = bil(GX, x, y), gy = bil(GY, x, y);
469
+ return Math.atan2(-gx, gy) + rot * Math.exp(-((x - 620) ** 2 + (y - 210) ** 2) / 30000);
470
+ }
471
+
472
+ // ---------- palette by region ----------
473
+ const SKY_D = C(18, 34, 96), SKY_M = C(40, 78, 158), SKY_L = C(86, 140, 196), PALE = C(190, 214, 214), CHROME = C(244, 206, 72), OCHRE = C(214, 160, 60), WHITE = C(240, 236, 210);
474
+ function colorAt(x, y, id, r) {
475
+ if (id === ID.sky || id === ID.star || id === ID.moon) {
476
+ const hy = hill(x);
477
+ let c = mixc(SKY_D, SKY_M, H.clamp(y / hy));
478
+ const ps = psi(x, y), band = Math.sin(ps * 0.085);
479
+ let sw = 0; for (const [cx, cy, s, R] of vort) sw = Math.max(sw, Math.exp(-(((x - cx) ** 2 + (y - cy) ** 2)) / (2 * (R * 1.3) ** 2)));
480
+ if (band > 0.35) c = mixc(c, SKY_L, 0.55 + 0.3 * sw);
481
+ if (band > 0.75 && sw > 0.3) c = mixc(c, PALE, 0.6 * sw);
482
+ if (band < -0.6) c = mixc(c, SKY_D, 0.5);
483
+ if (y > hy - 60) c = mixc(c, C(110, 150, 170), H.clamp((y - (hy - 60)) / 60) * 0.6);
484
+ // halos: concentric rings of chrome yellow / pale
485
+ const halo = (cx, cy, r0, r1, k) => {
486
+ const d = Math.hypot(x - cx, y - cy);
487
+ if (d < r0) return mixc(CHROME, WHITE, r() * 0.35);
488
+ if (d < r1) { const ring = Math.sin((d - r0) * k - t * 1.6); const f = 1 - (d - r0) / (r1 - r0); if (ring > 0.1) return mixc(c, ring > 0.6 ? mixc(CHROME, WHITE, 0.4) : C(200, 210, 150), f * 0.95); return mixc(c, SKY_L, f * 0.3); }
489
+ return null;
490
+ };
491
+ const hm = halo(moon[0], moon[1], 38, 108, 0.24); if (hm) return hm;
492
+ for (const [sx, sy, s] of stars) { const hs = halo(sx, sy, 10 * s, 52 * s, 0.34 / s); if (hs) return hs; }
493
+ return c;
494
+ }
495
+ if (id === ID.ground) {
496
+ const dpt = y - hill(x), b = Math.sin(dpt * 0.07 + nz.n2(x * 0.006, y * 0.01) * 3);
497
+ let c = mixc(C(24, 52, 60), C(16, 30, 52), H.clamp(dpt / 220));
498
+ if (b > 0.4) c = mixc(c, C(64, 98, 66), 0.6);
499
+ if (b < -0.7) c = mixc(c, C(90, 70, 40), 0.4);
500
+ // laptop glow spills onto the grass
501
+ const gd = Math.hypot(x - (px + 62), y - (py - 10));
502
+ if (gd < 170) c = mixc(c, mixc(CHROME, OCHRE, 0.4), Math.pow(1 - gd / 170, 1.6) * 0.85);
503
+ // distant village lights at the horizon
504
+ if (dpt < 26 && x > 560 && x < 840 && nz.n2(x * 0.15, 3) > 0.35) c = mixc(c, CHROME, 0.8);
505
+ return c;
506
+ }
507
+ if (id === ID.dome) { const sh = (x - domeC[0]) / domeR; return mixc(C(206, 210, 214), C(96, 116, 160), H.clamp(0.5 + sh * 0.6)); }
508
+ if (id === ID.body) return mixc(C(70, 90, 130), C(40, 54, 92), H.clamp((x - domeC[0] + 56) / 112));
509
+ if (id === ID.slit) return mixc(CHROME, C(255, 236, 160), r() * 0.5);
510
+ if (id === ID.person) { const lit = H.clamp(1 - Math.hypot(x - (px + 48), y - (py - 46)) / 70); return mixc(C(22, 26, 52), C(200, 140, 60), lit * 0.8); }
511
+ if (id === ID.screen) return mixc(C(255, 246, 200), C(240, 214, 120), r() * 0.4);
512
+ if (id === ID.cypress) { const b = Math.sin(x * 0.12 + y * 0.02); return b > 0.3 ? C(46, 78, 52) : b < -0.5 ? C(14, 20, 24) : C(26, 44, 40); }
513
+ if (id === ID.text) return mixc(CHROME, WHITE, 0.45 + r() * 0.3);
514
+ return SKY_M;
515
+ }
516
+
517
+ // ---------- layers ----------
518
+ const COL = H.layer(W, H_), cx_ = COL.getContext('2d');
519
+ const HT = H.layer(W, H_), hx = HT.getContext('2d');
520
+ // underpainting: thin, flat, scrubbed
521
+ // primed canvas, then a thin scrubbed underpainting (blocked in small, smoothed up)
522
+ cx_.fillStyle = 'rgb(214,200,172)'; cx_.fillRect(0, 0, W, H_);
523
+ {
524
+ const UP = H.layer(214, 120), ux = UP.getContext('2d'), r = H.rng(3);
525
+ for (let y = 0; y < 120; y++) for (let x = 0; x < 214; x++) { const X = x * 6 + 3, Y = y * 6 + 3, q = idAt(X, Y); ux.fillStyle = css(colorAt(X, Y, q === ID.text ? ID.ground : q, r)); ux.fillRect(x, y, 1, 1); }
526
+ cx_.globalAlpha = 0.9 * H.ease.out(H.clamp((t - 0.1) / 0.7)); cx_.filter = 'blur(5px)'; cx_.drawImage(UP, -6, -6, W + 12, H_ + 12); cx_.filter = 'none'; cx_.globalAlpha = 1;
527
+ }
528
+ hx.fillStyle = '#3a3a3a'; hx.fillRect(0, 0, W, H_);
529
+
530
+ function stroke(x, y, len, w, r, idFilter, birth = 0, dry = false) {
531
+ if (t < birth) return;
532
+ len *= 0.35 + 0.65 * H.ease.out(H.clamp((t - birth) / 0.18)); // the stroke is dragged out by the brush
533
+ const id = idAt(x, y);
534
+ if (idFilter && !idFilter(id)) return;
535
+ // trace the stroke along the flow, both directions from its centre
536
+ const pts = [[x, y]];
537
+ let a0 = dirAt(x, y, id);
538
+ const n = 3, st = len / (2 * n);
539
+ let fx = x, fy = y, bx = x, by = y, af = a0, ab = a0;
540
+ for (let i = 0; i < n; i++) {
541
+ fx += Math.cos(af) * st; fy += Math.sin(af) * st; af = af + (dirAt(fx, fy, id) - af + Math.PI * 3) % (Math.PI * 2) - Math.PI;
542
+ // keep bend gentle
543
+ bx -= Math.cos(ab) * st; by -= Math.sin(ab) * st; ab = ab + (dirAt(bx, by, id) - ab + Math.PI * 3) % (Math.PI * 2) - Math.PI;
544
+ pts.push([fx, fy]); pts.unshift([bx, by]);
545
+ }
546
+ const col = jit(colorAt(x, y, id, r), r, 9);
547
+ // occasional broken colour within the stroke
548
+ const col2 = mixc(col, r.chance(0.5) ? WHITE : C(10, 20, 60), 0.25 + r() * 0.15);
549
+ const path = () => { cx_.beginPath(); cx_.moveTo(pts[0][0], pts[0][1]); for (let i = 1; i < pts.length; i++) cx_.lineTo(pts[i][0], pts[i][1]); };
550
+ const nx = -Math.sin(a0), ny = Math.cos(a0);
551
+ if (dry) {
552
+ // dry brush: a few starved bristle streaks, the layer below showing between them, barely raised
553
+ const hb = 92 + r() * 30;
554
+ for (let b = 0; b < 4; b++) {
555
+ const o = (b - 1.5) * w * 0.3 + (r() - 0.5) * 1.2, s0 = r() < 0.5 ? 1 : 0;
556
+ cx_.lineWidth = w * (0.12 + r() * 0.12); cx_.strokeStyle = css(mixc(col, b & 1 ? WHITE : col, 0.15));
557
+ cx_.beginPath(); cx_.moveTo(pts[s0][0] + nx * o, pts[s0][1] + ny * o); for (let i = s0 + 1; i < pts.length - (b & 1); i++) cx_.lineTo(pts[i][0] + nx * o, pts[i][1] + ny * o); cx_.stroke();
558
+ hx.lineWidth = w * 0.18; hx.strokeStyle = `rgb(${hb | 0},${hb | 0},${hb | 0})`;
559
+ hx.beginPath(); hx.moveTo(pts[s0][0] + nx * o, pts[s0][1] + ny * o); for (let i = s0 + 1; i < pts.length - (b & 1); i++) hx.lineTo(pts[i][0] + nx * o, pts[i][1] + ny * o); hx.stroke();
560
+ }
561
+ return;
562
+ }
563
+ cx_.lineWidth = w; cx_.strokeStyle = css(col); path(); cx_.stroke();
564
+ // streak of the second colour dragged through one side of the stroke
565
+ const off = (r() - 0.5) * w * 0.5;
566
+ cx_.lineWidth = w * 0.3; cx_.strokeStyle = css(col2);
567
+ cx_.beginPath(); cx_.moveTo(pts[1][0] + nx * off, pts[1][1] + ny * off); for (let i = 2; i < pts.length - 1; i++) cx_.lineTo(pts[i][0] + nx * off, pts[i][1] + ny * off); cx_.stroke();
568
+ // height: a body plateau + a raised ridge, each stroke paints over what's under it
569
+ const hpath = () => { hx.beginPath(); hx.moveTo(pts[0][0], pts[0][1]); for (let i = 1; i < pts.length; i++) hx.lineTo(pts[i][0], pts[i][1]); };
570
+ const base = 100 + r() * 50 + w * 3; // fatter, more loaded strokes stand higher
571
+ hx.lineWidth = w; hx.strokeStyle = `rgb(${base | 0},${base | 0},${base | 0})`; hpath(); hx.stroke();
572
+ hx.lineWidth = w * 0.42; const top = base + 50 + r() * 40; hx.strokeStyle = `rgb(${top | 0},${top | 0},${top | 0})`;
573
+ hx.beginPath(); hx.moveTo(pts[0][0] + nx * off * 0.5, pts[0][1] + ny * off * 0.5); for (let i = 1; i < pts.length - 1; i++) hx.lineTo(pts[i][0] + nx * off * 0.5, pts[i][1] + ny * off * 0.5); hx.stroke();
574
+ }
575
+ cx_.lineCap = hx.lineCap = 'round'; cx_.lineJoin = hx.lineJoin = 'round';
576
+
577
+ // pass 1: sky + ground, big strokes on a jittered grid (random order so they overlap naturally)
578
+ const r1 = H.rng(77), cells = [];
579
+ for (let y = 0; y < H_ + 6; y += 7.5) for (let x = 0; x < W + 6; x += 9) cells.push([x + r1.range(-4, 4), y + r1.range(-3, 3)]);
580
+ for (let i = cells.length - 1; i > 0; i--) { const j = Math.floor(r1() * (i + 1)); [cells[i], cells[j]] = [cells[j], cells[i]]; }
581
+ const big = (id) => id === ID.sky || id === ID.ground || id === ID.cypress;
582
+ cells.forEach(([x, y], i) => {
583
+ const b = 0.5 + 2.2 * (0.6 * i / cells.length + 0.4 * H.clamp(y / H_));
584
+ if (t < b) return;
585
+ const rs = H.rng(5000 + i), id = idAt(x, y);
586
+ // vary the brush load by region: long sweeping strokes where the swirl runs strong, short dabs in the halos,
587
+ // long horizontal drags on the hill, tall narrow flicks on the cypress; a few starved dry-brush strokes
588
+ let len, w;
589
+ if (id === ID.ground) { len = rs.range(20, 34); w = rs.range(6, 8.2); }
590
+ else if (id === ID.cypress) { len = rs.range(20, 30); w = rs.range(4.2, 5.8); }
591
+ else {
592
+ let nearHalo = Math.hypot(x - moon[0], y - moon[1]) < 112;
593
+ for (const [sx, sy, ss] of stars) if (Math.hypot(x - sx, y - sy) < 54 * ss) nearHalo = true;
594
+ const fl = H.clamp(Math.hypot(bil(GX, x, y), bil(GY, x, y)) / 2.2);
595
+ if (nearHalo) { len = rs.range(7, 11); w = rs.range(5, 6.5); }
596
+ else if (rs() < 0.13) { len = rs.range(28, 40); w = rs.range(6.5, 8.5); }
597
+ else { len = rs.range(12, 18) + 8 * fl; w = rs.range(5.2, 7) + 1.2 * fl; }
598
+ }
599
+ stroke(x, y, len, w, rs, big, b, id !== ID.cypress && rs() < 0.05);
600
+ });
601
+ // pass 2: halos, objects, figure — smaller, denser strokes
602
+ const r2 = H.rng(78);
603
+ const small = (id) => !(id === ID.sky || id === ID.ground || id === ID.cypress || id === ID.text);
604
+ for (let k = 0; k < 2600; k++) {
605
+ const b2 = 2.4 + 1.1 * k / 2600;
606
+ const pick = r2();
607
+ let x, y;
608
+ if (pick < 0.35) { const a = r2() * 6.283, d = Math.sqrt(r2()) * 110; x = moon[0] + Math.cos(a) * d; y = moon[1] + Math.sin(a) * d; }
609
+ else if (pick < 0.6) { const s = r2.pick(stars), a = r2() * 6.283, d = Math.sqrt(r2()) * 40 * s[2]; x = s[0] + Math.cos(a) * d; y = s[1] + Math.sin(a) * d; }
610
+ else { x = r2.range(360, 1000); y = r2.range(380, 560); }
611
+ const id = idAt(x, y);
612
+ const rs = H.rng(9000 + k);
613
+ if (pick < 0.6) stroke(x, y, rs.range(9, 15), rs.range(4, 5.5), rs, (q) => q === ID.sky || q === ID.moon || q === ID.star, b2);
614
+ else stroke(x, y, rs.range(7, 11), rs.range(3.2, 4.4), rs, small, b2);
615
+ }
616
+ // dense small strokes over the observatory and the figure
617
+ [[860, 300, 1000, 470], [340, 330, 540, 530]].forEach(([x0, y0, x1, y1]) => {
618
+ for (let y = y0; y < y1; y += 3.2) for (let x = x0; x < x1; x += 3.6) {
619
+ const q = idAt(x, y);
620
+ const jx = r2.range(-1.5, 1.5), jy = r2.range(-1.5, 1.5);
621
+ if (small(q)) { const rs = H.rng((x * 7 + y * 131) | 0); stroke(x + jx, y + jy, rs.range(6, 10), rs.range(2.8, 3.8), rs, small, 3.0 + 0.8 * (1 - (y - y0) / (y1 - y0))); }
622
+ }
623
+ });
624
+ // laptop glow strokes radiating over the grass
625
+ for (let k = 0; k < 260; k++) {
626
+ const a = r2.range(-Math.PI, 0.3), d = r2.range(20, 120);
627
+ const rs = H.rng(12000 + k);
628
+ stroke(px + 62 + Math.cos(a) * d, py - 10 + Math.sin(a) * d * 0.6, rs.range(8, 14), rs.range(3.5, 5), rs, (q) => q === ID.ground, 3.6 + d / 120 * 0.4);
629
+ }
630
+ // cypress gets a second, flame-like pass
631
+ for (let k = 0; k < 900; k++) { const x = r2.range(1050, 1240), y = r2.range(100, 720), rs = H.rng(14000 + k); stroke(x, y, rs.range(14, 22), rs.range(4.5, 6.5), rs, (q) => q === ID.cypress, 2.5 + 0.9 * (1 - y / 720)); }
632
+ // dark underpaint ring under the title (comes in with the lettering) so it separates from the grass
633
+ { const ua = H.clamp((t - 3.9) / 0.6);
634
+ if (ua > 0) { cx_.save(); cx_.globalAlpha = 0.85 * ua; cx_.filter = 'blur(4px)'; cx_.font = '900 italic 64px "Fraunces"';
635
+ cx_.lineJoin = 'round'; cx_.lineWidth = 18; cx_.strokeStyle = 'rgb(12,20,34)'; cx_.strokeText('The Night Shift', 56, 672); cx_.fillStyle = 'rgb(12,20,34)'; cx_.fillText('The Night Shift', 56, 672); cx_.restore(); } }
636
+ // pass 3: lettering, painted with a small brush
637
+ for (let y = 600; y < 690; y += 2.6) for (let x = 40; x < 560; x += 3.2) {
638
+ if (idAt(x, y) !== ID.text) continue;
639
+ const rs = H.rng((x * 13 + y * 977) | 0);
640
+ stroke(x + rs.range(-1, 1), y + rs.range(-1, 1), rs.range(5, 8), rs.range(2.6, 3.4), rs, (q) => q === ID.text, 3.9 + (x - 40) / 520 * 0.6);
641
+ }
642
+
643
+ // ---------- light the relief ----------
644
+ ctx.drawImage(COL, 0, 0);
645
+ const img = ctx.getImageData(0, 0, W, H_), d = img.data;
646
+ hx.filter = 'blur(0.7px)'; hx.drawImage(HT, 0, 0); hx.filter = 'none';
647
+ const hd = hx.getImageData(0, 0, W, H_).data;
648
+ const cr = H.rng(9);
649
+ for (let y = 1; y < H_ - 1; y++) for (let x = 1; x < W - 1; x++) {
650
+ const i = (y * W + x) * 4;
651
+ const gx = hd[i + 4] - hd[i - 4], gy = hd[i + W * 4] - hd[i - W * 4];
652
+ // light from upper-left
653
+ const lam = (-gx * -0.7 + -gy * -0.7) * 0.0078;
654
+ let sh = 1 + lam;
655
+ const spec = lam > 0.25 ? (lam - 0.25) * 140 : 0;
656
+ // canvas weave in the valleys
657
+ const weave = ((x & 3) === 0 || (y & 3) === 0) ? -4 : 2;
658
+ const low = hd[i] < 120 ? 1 : 0;
659
+ for (let c = 0; c < 3; c++) d[i + c] = d[i + c] * sh + spec + weave * low + (cr() - 0.5) * 5;
660
+ }
661
+ ctx.putImageData(img, 0, 0);
662
+ // a breath of luminous glaze around the brightest lights
663
+ ctx.save(); ctx.globalCompositeOperation = 'screen';
664
+ const gl = H.clamp((t - 3.2) / 1.0) * (0.85 + 0.15 * Math.sin(t * 2.2));
665
+ [[moon[0], moon[1], 120, 0.22 * gl], [px + 66, py - 50, 100, 0.3 * gl], [domeC[0] + 3, domeC[1] - 20, 50, 0.18 * gl]].forEach(([x, y, rr, a]) => {
666
+ const g = ctx.createRadialGradient(x, y, 0, x, y, rr); g.addColorStop(0, `rgba(255,220,120,${a})`); g.addColorStop(1, 'rgba(255,220,120,0)');
667
+ ctx.fillStyle = g; ctx.fillRect(x - rr, y - rr, rr * 2, rr * 2);
668
+ });
669
+ ctx.restore();
670
+ H.vignette(ctx, W, H_, 0.35, '8,10,30');
671
+ }
672
+ });
673
+ }