@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,680 @@
1
+ {
2
+ // ---------------------------------------------------------------
3
+ // Stained glass — hand-cut pieces in lead came, light pouring through
4
+ // ---------------------------------------------------------------
5
+ // region id -> [base colour, subdivision: 0 = whole region, 1 = coarse cut, 2 = fine cut, palette for per-piece picks]
6
+ const REG = {
7
+ 1: { c: [28, 52, 150], sub: 1, alt: [[34, 70, 168], [22, 40, 120], [40, 60, 160]] }, // field: cobalt
8
+ 2: { c: [168, 26, 40], sub: 2, alt: [[168, 26, 40], [214, 160, 40], [168, 26, 40], [30, 110, 90]] }, // border
9
+ 4: { c: [232, 176, 52], sub: 1, alt: [[236, 184, 60], [224, 150, 40], [244, 204, 90]] }, // halo gold
10
+ 5: { c: [178, 30, 46], sub: 0, alt: [[178, 30, 46], [150, 20, 50], [196, 52, 50]] }, // halo petals ruby
11
+ 6: { c: [196, 210, 222], sub: 0 }, // head: pale white glass
12
+ 7: { c: [70, 226, 236], sub: 0 }, // eyes
13
+ 8: { c: [104, 44, 138], sub: 1, alt: [[104, 44, 138], [124, 56, 150], [86, 36, 120]] }, // robe: purple
14
+ 9: { c: [30, 128, 88], sub: 1, alt: [[30, 128, 88], [40, 146, 96], [24, 104, 80]] }, // inner robe: green
15
+ 10: { c: [176, 188, 204], sub: 0 }, // hands
16
+ 11: { c: [255, 214, 96], sub: 0 }, // the chip
17
+ 12: { c: [236, 214, 150], sub: 0 }, // banner
18
+ 13: { c: [190, 206, 150], sub: 1, alt: [[196, 214, 150], [222, 204, 140], [170, 200, 170], [214, 190, 120]] }, // lancet quarries
19
+ 14: { c: [186, 34, 40], sub: 0 }, // rondels
20
+ 15: { c: [240, 196, 70], sub: 0 }, // stars in the field
21
+ 16: { c: [44, 70, 104], sub: 0 }, // face plate
22
+ 17: { c: [60, 170, 200], sub: 2, alt: [[60, 170, 200], [40, 140, 190], [90, 190, 210]] }, // chip pins / circuit ring
23
+ };
24
+
25
+
26
+ // =================================================================
27
+ // EXPLAINER — "How does AI learn?" told as a cycle of three windows along a nave, the way glaziers told
28
+ // stories: the camera walks from window to window. Arrows are strips of glass in lead came, labels are
29
+ // grisaille painted on pale banner glass, numbers are repainted on their banner, emphasis is light flaring.
30
+ // =================================================================
31
+ const SGW = 1120, SGH = 660, SGTOP = 30, SGX = [80, 1480, 2880], SG_WORLD = 4200;
32
+ let SGC = null;
33
+ const clS = (v) => (v < 0 ? 0 : v > 1 ? 1 : v);
34
+ const ezS = (u) => H.ease.inOut(clS(u));
35
+ const wS = (t, a, b) => clS((t - a) / (b - a));
36
+ const lerpS = (a, b, u) => a + (b - a) * u;
37
+ const cssS = (c, a = 1) => `rgba(${c[0] | 0},${c[1] | 0},${c[2] | 0},${a})`;
38
+ const LEAD = 'rgb(20,16,14)';
39
+ const GOLD = [240, 190, 64], RUBY = [176, 28, 44], CREAMG = [238, 220, 166], WHITEG = [214, 226, 236], GREENG = [40, 150, 96], AMBER = [236, 140, 50], BROWNG = [150, 92, 50];
40
+ const archP = (c, x0, y0, w, h, inset = 0) => {
41
+ const a = x0 + inset, b = x0 + w - inset, top = y0 + inset, bot = y0 + h - inset * 0.4, spring = y0 + 150, cx = x0 + w / 2;
42
+ c.beginPath(); c.moveTo(a, bot); c.lineTo(a, spring); c.quadraticCurveTo(a, top + 12, cx, top); c.quadraticCurveTo(b, top + 12, b, spring); c.lineTo(b, bot); c.closePath();
43
+ };
44
+
45
+ // one window's background glass: Voronoi-cut field + finer border, lead where pieces meet, streaky seedy glass
46
+ function makeWindow(field, seed) {
47
+ const w = SGW, h = SGH, M = H.layer(w, h), m = M.getContext('2d');
48
+ m.fillStyle = 'rgb(2,0,0)'; archP(m, 0, 0, w, h, 0); m.fill();
49
+ m.fillStyle = 'rgb(1,0,0)'; archP(m, 0, 0, w, h, 26); m.fill();
50
+ const reg = m.getImageData(0, 0, w, h).data;
51
+ const nz = H.makeNoise(seed), r = H.rng(seed);
52
+ const cells = (cs, rs) => { const gw = Math.ceil(w / cs) + 1, gh = Math.ceil(h / cs) + 1, p = new Float32Array(gw * gh * 2); for (let j = 0; j < gh; j++) for (let i = 0; i < gw; i++) { p[(j * gw + i) * 2] = (i + 0.15 + rs() * 0.7) * cs; p[(j * gw + i) * 2 + 1] = (j + 0.15 + rs() * 0.7) * cs; } return { cs, gw, gh, p }; };
53
+ const F = cells(58, H.rng(seed + 1)), B = cells(22, H.rng(seed + 2));
54
+ const piece = new Int32Array(w * h);
55
+ for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) {
56
+ const i = y * w + x, rg = reg[i * 4]; if (!rg) continue;
57
+ const S = rg === 1 ? F : B, gx = (x / S.cs) | 0, gy = (y / S.cs) | 0; let best = 1e9, bi = 0;
58
+ for (let dy = -1; dy <= 1; dy++) for (let dx = -1; dx <= 1; dx++) { const ix = gx + dx, iy = gy + dy; if (ix < 0 || iy < 0 || ix >= S.gw || iy >= S.gh) continue; const k = iy * S.gw + ix, px = S.p[k * 2] - x, py = S.p[k * 2 + 1] - y, d = px * px + py * py; if (d < best) { best = d; bi = k; } }
59
+ piece[i] = rg * 100000 + bi + 1;
60
+ }
61
+ const LD = H.layer(w, h), ld = LD.getContext('2d'), li = ld.createImageData(w, h);
62
+ for (let y = 0; y < h - 1; y++) for (let x = 0; x < w - 1; x++) { const i = y * w + x; if (piece[i] !== piece[i + 1] || piece[i] !== piece[i + w]) li.data[i * 4 + 3] = 255; }
63
+ ld.putImageData(li, 0, 0);
64
+ const blurOf = (px) => { const c = H.layer(w, h), x = c.getContext('2d'); x.filter = `blur(${px}px)`; x.drawImage(LD, 0, 0); return x.getImageData(0, 0, w, h).data; };
65
+ const lead = blurOf(2.4), prox = blurOf(8);
66
+ const out = H.layer(w, h), oc = out.getContext('2d'), img = oc.createImageData(w, h), d = img.data, cache = new Map();
67
+ const border = [[168, 26, 40], [214, 160, 40], [168, 26, 40], [30, 110, 90]];
68
+ for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) {
69
+ const i = y * w + x, o = i * 4, p = piece[i]; if (!p) continue;
70
+ let pc = cache.get(p);
71
+ if (!pc) { const q = H.rng(p * 7 + seed), base = p >= 200000 ? q.pick(border) : q.pick(field), v = 0.84 + q() * 0.28; pc = [base[0] * v, base[1] * v, base[2] * v, q() * 6.28]; cache.set(p, pc); }
72
+ const sa = pc[3], u = x * Math.cos(sa) + y * Math.sin(sa), vv = -x * Math.sin(sa) + y * Math.cos(sa);
73
+ const lum = (0.9 + nz.n2(u * 0.012, vv * 0.09 + (p % 997)) * 0.3) * (1 - prox[o + 3] / 255 * 0.4) * (0.95 + 0.15 * (1 - y / h));
74
+ let R = pc[0] * lum, G = pc[1] * lum, Bc = pc[2] * lum;
75
+ const lv = clS((lead[o + 3] / 255 - 0.07) / 0.14);
76
+ if (lv > 0) {
77
+ // rounded came: its upper-left shoulder catches the light from the room
78
+ const gl = (lead[o + 3 + 4] || 0) - (lead[o + 3 - 4] || 0) + (lead[o + 3 + w * 4] || 0) - (lead[o + 3 - w * 4] || 0);
79
+ const sh = 16 + lead[o + 3] / 255 * 12 + Math.max(0, -gl) * 0.22;
80
+ R = R * (1 - lv) + (sh + 4) * lv; G = G * (1 - lv) + (sh + 1) * lv; Bc = Bc * (1 - lv) + (sh - 3) * lv;
81
+ }
82
+ d[o] = R; d[o + 1] = G; d[o + 2] = Bc; d[o + 3] = 255;
83
+ }
84
+ oc.putImageData(img, 0, 0);
85
+ // seeds (bubbles)
86
+ for (let k = 0; k < 500; k++) { const x = r() * w, y = r() * h; if (!piece[(y | 0) * w + (x | 0)]) continue; oc.fillStyle = 'rgba(255,255,240,0.3)'; oc.beginPath(); oc.ellipse(x, y, r.range(0.8, 2.4), r.range(0.6, 1.6), 0.3, 0, 7); oc.fill(); }
87
+ // the window's stone reveal
88
+ oc.lineJoin = 'round'; oc.strokeStyle = 'rgb(20,16,14)'; oc.lineWidth = 8; archP(oc, 0, 0, w, h, 2); oc.stroke();
89
+ return out;
90
+ }
91
+ function sgCache() {
92
+ if (SGC) return SGC;
93
+ const C = {};
94
+ // nave wall: ashlar courses, dim, warm
95
+ const wall = H.layer(SG_WORLD, 720), wc = wall.getContext('2d'), r = H.rng(5);
96
+ wc.fillStyle = 'rgb(46,38,32)'; wc.fillRect(0, 0, SG_WORLD, 720);
97
+ for (let row = 0; row * 64 < 720; row++) for (let x = -((row & 1) * 90); x < SG_WORLD; x += 180) { const v = 0.8 + r() * 0.4; wc.fillStyle = `rgb(${62 * v | 0},${52 * v | 0},${44 * v | 0})`; wc.fillRect(x + 3, row * 64 + 3, 174, 58); }
98
+ const sp = H.layer(Math.ceil(SG_WORLD / 6), 120), sx = sp.getContext('2d');
99
+ for (let y = 0; y < 120; y++) for (let x = 0; x < sp.width; x++) { sx.fillStyle = `rgba(${r() < 0.5 ? '0,0,0' : '255,240,220'},${r() * 0.12})`; sx.fillRect(x, y, 1, 1); }
100
+ wc.drawImage(sp, 0, 0, SG_WORLD, 720);
101
+ // stone reveals + warm spill of light around each window
102
+ SGX.forEach((x0) => {
103
+ const g = wc.createRadialGradient(x0 + SGW / 2, 360, 200, x0 + SGW / 2, 360, 900); g.addColorStop(0, 'rgba(255,200,140,0.22)'); g.addColorStop(1, 'rgba(255,200,140,0)'); wc.fillStyle = g; wc.fillRect(x0 - 400, 0, SGW + 800, 720);
104
+ wc.lineJoin = 'round'; wc.strokeStyle = 'rgb(118,102,86)'; wc.lineWidth = 30; archP(wc, x0, SGTOP, SGW, SGH, -12); wc.stroke();
105
+ wc.strokeStyle = 'rgba(220,190,150,0.25)'; wc.lineWidth = 8; archP(wc, x0 - 6, SGTOP - 6, SGW, SGH, -16); wc.stroke();
106
+ });
107
+ C.wall = wall;
108
+ C.win = [makeWindow([[34, 70, 168], [22, 40, 120], [40, 60, 160], [30, 54, 140]], 11), makeWindow([[60, 40, 140], [44, 34, 120], [76, 50, 156], [36, 52, 140]], 12), makeWindow([[20, 90, 120], [24, 70, 130], [30, 100, 110], [26, 60, 120]], 13)];
109
+ // antique glass texture for dynamically placed glass, in world space so it travels with the pieces:
110
+ // per-pixel sheet-thickness variation (long, nearly horizontal low-frequency streaks, +/-12%) plus seed bubbles
111
+ {
112
+ const hw = SG_WORLD >> 1, hh = 360, half = H.layer(hw, hh), hc = half.getContext('2d'), im = hc.createImageData(hw, hh), q = im.data, tn = H.makeNoise(17);
113
+ for (let y = 0; y < hh; y++) for (let x = 0; x < hw; x++) {
114
+ const o = (y * hw + x) * 4, X = x * 2, Y = y * 2;
115
+ const v = tn.n2(X * 0.012 + Y * 0.0015, Y * 0.09) * 0.7 + tn.n2(X * 0.0035 + 40, Y * 0.022 + 9) * 0.45;
116
+ const dv = Math.max(-0.2, Math.min(0.2, v * 0.17));
117
+ if (dv > 0) { q[o] = 255; q[o + 1] = 248; q[o + 2] = 228; q[o + 3] = dv * 255; } else { q[o] = 8; q[o + 1] = 6; q[o + 2] = 22; q[o + 3] = -dv * 255; }
118
+ }
119
+ hc.putImageData(im, 0, 0);
120
+ const st = H.layer(SG_WORLD, 720), s2 = st.getContext('2d'), nr = H.rng(17);
121
+ s2.imageSmoothingEnabled = true; s2.drawImage(half, 0, 0, SG_WORLD, 720);
122
+ for (let k = 0; k < 2000; k++) {
123
+ const x = nr() * SG_WORLD, y = nr() * 720, rr = nr() < 0.88 ? nr.range(0.6, 1.6) : nr.range(1.8, 2.6);
124
+ s2.strokeStyle = 'rgba(10,6,20,0.38)'; s2.lineWidth = 0.8; s2.beginPath(); s2.ellipse(x, y, rr * 1.35, rr, 0.08, 0, 7); s2.stroke();
125
+ s2.fillStyle = 'rgba(255,252,236,0.55)'; s2.beginPath(); s2.arc(x - rr * 0.25, y - rr * 0.25, rr * 0.5, 0, 7); s2.fill();
126
+ }
127
+ C.streak = st;
128
+ }
129
+ C.dyn = H.layer(1280, 720); C.small = H.layer(160, 90);
130
+ SGC = C;
131
+ return C;
132
+ }
133
+
134
+ function explainStained(ctx, W, H_, t) {
135
+ const C = sgCache();
136
+ const cam = Math.round(1400 * ezS((t - 6.0) / 0.95) + 1400 * ezS((t - 10.4) / 0.95));
137
+ ctx.drawImage(C.wall, cam, 0, W, H_, 0, 0, W, H_);
138
+ SGX.forEach((x0, i) => { const sx = x0 - cam; if (sx > W || sx + SGW < 0) return; ctx.drawImage(C.win[i], sx, SGTOP); });
139
+ // the first window is lit as the sun reaches it
140
+ if (t < 1.4) { ctx.save(); ctx.fillStyle = `rgba(8,6,10,${0.85 * (1 - ezS((t - 0.1) / 1.2))})`; archP(ctx, SGX[0] - cam, SGTOP, SGW, SGH, 0); ctx.fill(); ctx.restore(); }
141
+
142
+ // ---------- dynamic glass ----------
143
+ const D = C.dyn, d = D.getContext('2d');
144
+ d.setTransform(1, 0, 0, 1, 0, 0); d.clearRect(0, 0, W, H_); d.translate(-cam, 0);
145
+ d.lineJoin = 'round'; d.lineCap = 'round';
146
+ // grisaille: lettering painted straight onto the glass, so later pieces (a ruby cross) can sit over it
147
+ const drawT = (q) => {
148
+ if (q.reveal <= 0) return;
149
+ d.save(); d.font = `${q.font} ${q.size}px "Cormorant Garamond"`; d.textAlign = 'left';
150
+ const tw = d.measureText(q.str).width, x0 = q.align === 'center' ? q.x - tw / 2 : q.align === 'right' ? q.x - tw : q.x;
151
+ if (q.reveal < 1) { d.beginPath(); d.rect(x0 - 6, q.y - q.size, (tw + 12) * q.reveal, q.size * 1.4); d.clip(); }
152
+ // fired grisaille: a soft matt halo, then the trace line, then a crisp darker outline
153
+ const ink = q.ink.map((v) => v * 0.62);
154
+ d.fillStyle = cssS(ink, 0.22); d.fillText(q.str, x0 + 1.5, q.y + 1.8);
155
+ d.fillStyle = cssS(ink, 1); d.fillText(q.str, x0, q.y);
156
+ d.lineJoin = 'round'; d.lineWidth = Math.max(1, q.size * 0.028); d.strokeStyle = cssS(ink.map((v) => v * 0.6), 0.4); d.strokeText(q.str, x0, q.y); d.restore();
157
+ };
158
+ // a cut piece: glass fill, darkening towards the came like the background panes (light glows in its middle),
159
+ // then the lead came with a soft highlight on its upper-left shoulder so it reads as rounded metal
160
+ const pc = (fill, col, k = 1, leadW = 7) => {
161
+ d.fillStyle = cssS(H.mix([10, 8, 14], col, k)); fill(); d.fill();
162
+ d.save(); d.clip(); d.shadowColor = 'rgba(14,6,18,0.62)'; d.shadowBlur = 22; d.lineWidth = 6; d.strokeStyle = LEAD; d.stroke(); d.restore();
163
+ d.lineWidth = leadW; d.strokeStyle = LEAD; d.stroke();
164
+ d.save(); d.translate(-leadW * 0.16, -leadW * 0.16); d.lineWidth = 1.5; d.strokeStyle = 'rgba(255,240,220,0.1)'; d.stroke(); d.restore();
165
+ };
166
+ const rect = (x, y, w, h, col, k = 1, rad = 6) => pc(() => { d.beginPath(); d.roundRect(x, y, w, h, rad); }, col, k);
167
+ const banner = (x, y, w, h, str, size, { k = 1, col = CREAMG, ink = [58, 34, 22], font = '600', reveal = 1, align = 'center' } = {}) => {
168
+ if (k <= 0) return; rect(x, y, w, h, col, k, 8);
169
+ if (str && reveal > 0) drawT({ str, x: align === 'center' ? x + w / 2 : x + 22, y: y + h / 2 + size * 0.34, size, ink, font, reveal, align });
170
+ };
171
+ // a strip of glass in came, cut into short pieces, drawn on along its path, with a glass arrowhead
172
+ const strip = (pts, prog, w, col, head = true) => {
173
+ if (prog <= 0) return;
174
+ const n = Math.max(2, Math.ceil(pts.length * clS(prog)));
175
+ const P = pts.slice(0, n);
176
+ d.beginPath(); P.forEach(([x, y], i) => (i ? d.lineTo(x, y) : d.moveTo(x, y)));
177
+ d.lineWidth = w + 9; d.strokeStyle = LEAD; d.stroke();
178
+ d.save(); d.translate(-1.4, -1.4); d.lineWidth = w + 5; d.strokeStyle = 'rgba(255,240,220,0.13)'; d.stroke(); d.restore();
179
+ d.lineWidth = w; d.strokeStyle = cssS(col.map((v) => v * 0.72)); d.stroke();
180
+ d.lineWidth = w * 0.72; d.strokeStyle = cssS(col.map((v) => v * 0.88)); d.stroke(); d.lineWidth = w * 0.4; d.strokeStyle = cssS(col); d.stroke();
181
+ d.lineWidth = 4; d.strokeStyle = LEAD;
182
+ for (let i = 4; i < n - 1; i += 5) { const [ax, ay] = P[i - 1], [bx, by] = P[i + 1], a = Math.atan2(by - ay, bx - ax), [x, y] = P[i]; d.beginPath(); d.moveTo(x - Math.sin(a) * w * 0.6, y + Math.cos(a) * w * 0.6); d.lineTo(x + Math.sin(a) * w * 0.6, y - Math.cos(a) * w * 0.6); d.stroke(); }
183
+ if (head && prog >= 1) { const [ax, ay] = pts[pts.length - 3], [bx, by] = pts[pts.length - 1], a = Math.atan2(by - ay, bx - ax); pc(() => { d.beginPath(); d.moveTo(bx + Math.cos(a) * w * 1.6, by + Math.sin(a) * w * 1.6); d.lineTo(bx + Math.cos(a + 2.3) * w * 1.9, by + Math.sin(a + 2.3) * w * 1.9); d.lineTo(bx + Math.cos(a - 2.3) * w * 1.9, by + Math.sin(a - 2.3) * w * 1.9); d.closePath(); }, col); }
184
+ };
185
+ const bez = (p0, p1, p2, p3, n = 30) => { 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; };
186
+ const ring = (cx, cy, rx, ry, n = 48) => { const o = []; for (let i = 0; i <= n; i++) { const a = -Math.PI / 2 + i / n * Math.PI * 2; o.push([cx + Math.cos(a) * rx, cy + Math.sin(a) * ry]); } return o; };
187
+ // the model: a small rose window with a gold chip at its heart; three white spokes are its weights
188
+ const rose = (cx, cy, R, k, spin, flare) => {
189
+ if (k <= 0) return;
190
+ for (let i = 0; i < 12; i++) { const a0 = i / 12 * Math.PI * 2, a1 = a0 + Math.PI / 6; pc(() => { d.beginPath(); d.arc(cx, cy, R, a0, a1); d.arc(cx, cy, R * 0.66, a1, a0, true); d.closePath(); }, H.mix(i % 2 ? RUBY : GOLD, [255, 250, 230], flare * 0.6), k); }
191
+ pc(() => { d.beginPath(); d.arc(cx, cy, R * 0.66, 0, 7); }, H.mix([40, 120, 190], [220, 240, 255], flare * 0.5), k);
192
+ for (let i = 0; i < 3; i++) { const a = -Math.PI / 2 + i * 2.094 + spin; pc(() => { d.beginPath(); d.moveTo(cx + Math.cos(a - 0.12) * R * 0.3, cy + Math.sin(a - 0.12) * R * 0.3); d.lineTo(cx + Math.cos(a) * R * 0.62, cy + Math.sin(a) * R * 0.62); d.lineTo(cx + Math.cos(a + 0.12) * R * 0.3, cy + Math.sin(a + 0.12) * R * 0.3); d.closePath(); }, WHITEG, k, 5); }
193
+ rect(cx - R * 0.24, cy - R * 0.24, R * 0.48, R * 0.48, H.mix(GOLD, [255, 250, 220], flare), k, 4);
194
+ };
195
+ const animal = (x, y, s, dog, k = 1) => {
196
+ rect(x - s / 2, y - s / 2, s, s, [200, 214, 222], k, 4);
197
+ if (dog) { pc(() => { d.beginPath(); d.ellipse(x, y + s * 0.04, s * 0.28, s * 0.27, 0, 0, 7); }, BROWNG, k, 5); for (const q of [-1, 1]) pc(() => { d.beginPath(); d.ellipse(x + q * s * 0.3, y + s * 0.06, s * 0.09, s * 0.2, q * 0.3, 0, 7); }, [96, 58, 34], k, 5); }
198
+ else pc(() => { d.beginPath(); [[-0.32, 0], [-0.3, -0.36], [-0.1, -0.2], [0.1, -0.2], [0.3, -0.36], [0.32, 0], [0.22, 0.24], [0, 0.32], [-0.22, 0.24]].forEach(([a, b], i) => (i ? d.lineTo(x + a * s, y + b * s) : d.moveTo(x + a * s, y + b * s))); d.closePath(); }, AMBER, k, 5);
199
+ d.fillStyle = LEAD; d.beginPath(); d.arc(x - s * 0.1, y, s * 0.045, 0, 7); d.arc(x + s * 0.1, y, s * 0.045, 0, 7); d.fill();
200
+ };
201
+ const fmt = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
202
+ const glows = [];
203
+
204
+ // ===== window 1: the data =====
205
+ {
206
+ const X = SGX[0];
207
+ rose(X + 880, 300, 150, ezS((t - 1.2) / 0.6), 0, 0);
208
+ banner(X + 780, 470, 200, 56, 'the model', 34, { k: ezS((t - 2.3) / 0.3), reveal: wS(t, 2.4, 2.8) });
209
+ // rail + flow arrow
210
+ strip(bez([X + 60, 420], [X + 300, 470], [X + 500, 340], [X + 700, 320]), wS(t, 2.2, 2.8), 16, GOLD);
211
+ banner(X + 130, 150, 380, 56, 'labelled examples', 32, { k: ezS((t - 2.6) / 0.3), reveal: wS(t, 2.7, 3.1) });
212
+ for (let i = 0; i < 17; i++) {
213
+ const s0 = 2.6 + i * 0.2, v = (t - s0) / 1.4; if (v <= 0 || v >= 1) continue;
214
+ const a = 1 - v, x = a * a * a * 40 + 3 * a * a * v * 300 + 3 * a * v * v * 520 + v * v * v * 760, y = a * a * a * 330 + 3 * a * a * v * 370 + 3 * a * v * v * 250 + v * v * v * 270;
215
+ const s = v > 0.8 ? 86 * (1 - (v - 0.8) / 0.2 * 0.9) : 86, dog = (i % 2 === 1) !== (i % 5 === 0);
216
+ animal(X + x, y, s, dog);
217
+ if (s > 64) banner(X + x - 40, y + s / 2 + 6, 80, 36, dog ? 'dog' : 'cat', 28, { col: dog ? [222, 196, 150] : [250, 214, 150] });
218
+ }
219
+ if (t > 2.9) {
220
+ const n = t > 5.6 ? 1e6 : Math.round(1e6 * H.ease.in(wS(t, 3.0, 5.6)) / 1000) * 1000;
221
+ banner(X + 60, 540, 640, 96, '', 0, { k: ezS((t - 2.9) / 0.3) });
222
+ drawT({ str: fmt(n), x: X + 90, y: 612, size: 68, ink: [58, 34, 22], font: '700', reveal: wS(t, 3.0, 3.3), align: 'left' });
223
+ drawT({ str: 'examples', x: X + 440, y: 606, size: 40, ink: [58, 34, 22], font: '600', reveal: wS(t, 3.1, 3.4), align: 'left' });
224
+ if (t > 5.6) strip([[X + 90, 626], [X + 420, 626]].flatMap(([x, y], i, A) => i ? Array.from({ length: 12 }, (_, k) => [lerpS(A[0][0], x, (k + 1) / 12), y]) : [[x, y]]), wS(t, 5.6, 5.9), 8, RUBY, false);
225
+ }
226
+ if (t > 2.6 && t < 6.2) glows.push([X + 880, 300, 220, 0.25 + 0.1 * Math.sin(t * 4)]);
227
+ }
228
+ // ===== window 2: guess -> check -> adjust =====
229
+ {
230
+ const X = SGX[1], second = t > 9.4, flare = Math.sin(Math.PI * wS(t, 8.6, 9.6)), spin = ezS((t - 8.7) / 0.6) * 1.2;
231
+ rose(X + 240, 370, 150, 1, spin, flare);
232
+ banner(X + 140, 540, 200, 56, 'the model', 34);
233
+ animal(X + 920, 300, 210, false, ezS((t - 6.6) / 0.4));
234
+ banner(X + 820, 420, 200, 52, 'new picture', 32, { k: ezS((t - 6.8) / 0.3), reveal: wS(t, 6.9, 7.2) });
235
+ // the guess banner
236
+ banner(X + 420, 100, 320, 120, '', 0, { k: ezS((t - 7.0) / 0.3) });
237
+ if (!second && t > 7.1) drawT({ str: 'dog?', x: X + 580, y: 186, size: 84, ink: [58, 34, 22], font: '700', reveal: wS(t, 7.1, 7.5), align: 'center' });
238
+ strip(bez([X + 340, 250], [X + 360, 170], [X + 380, 160], [X + 412, 160]), wS(t, 6.9, 7.2), 14, GOLD);
239
+ banner(X + 200, 100, 150, 52, 'Guess', 34, { k: ezS((t - 6.95) / 0.3), reveal: wS(t, 7.0, 7.3) });
240
+ strip(bez([X + 820, 220], [X + 800, 170], [X + 780, 160], [X + 748, 160]), wS(t, 7.5, 7.8), 14, WHITEG);
241
+ banner(X + 820, 110, 150, 52, 'Check', 34, { k: ezS((t - 7.55) / 0.3), reveal: wS(t, 7.6, 7.9) });
242
+ if (t > 7.9 && !second) {
243
+ strip([[X + 470, 110], [X + 690, 210]].flatMap((p, i, A) => i ? Array.from({ length: 10 }, (_, k) => [lerpS(A[0][0], p[0], (k + 1) / 10), lerpS(A[0][1], p[1], (k + 1) / 10)]) : [p]), wS(t, 7.9, 8.05), 16, RUBY, false);
244
+ strip([[X + 690, 110], [X + 470, 210]].flatMap((p, i, A) => i ? Array.from({ length: 10 }, (_, k) => [lerpS(A[0][0], p[0], (k + 1) / 10), lerpS(A[0][1], p[1], (k + 1) / 10)]) : [p]), wS(t, 8.05, 8.2), 16, RUBY, false);
245
+ strip(ring(X + 580, 160, 200, 92), wS(t, 8.0, 8.45), 12, RUBY, false);
246
+ banner(X + 810, 486, 220, 52, "it's a cat!", 34, { k: ezS((t - 8.0) / 0.25), reveal: wS(t, 8.05, 8.4), col: [244, 200, 196], ink: [130, 20, 30] });
247
+ glows.push([X + 580, 160, 260, 0.35 * Math.sin(Math.PI * wS(t, 7.9, 8.8))]);
248
+ }
249
+ strip(bez([X + 600, 230], [X + 660, 560], [X + 460, 560], [X + 390, 430]), wS(t, 8.25, 8.8), 16, RUBY);
250
+ banner(X + 560, 560, 170, 54, 'Adjust', 36, { k: ezS((t - 8.45) / 0.3), reveal: wS(t, 8.5, 8.85), col: [244, 200, 196], ink: [130, 20, 30] });
251
+ if (second) {
252
+ drawT({ str: 'cat', x: X + 560, y: 186, size: 84, ink: [58, 34, 22], font: '700', reveal: wS(t, 9.4, 9.7), align: 'center' });
253
+ strip([[X + 640, 160], [X + 660, 186], [X + 674, 176], [X + 690, 150], [X + 712, 120]], wS(t, 9.7, 9.95), 16, GREENG, false);
254
+ }
255
+ if (flare > 0) glows.push([X + 240, 370, 300, 0.6 * flare]);
256
+ }
257
+ // ===== window 3: progress =====
258
+ {
259
+ const X = SGX[2], N = 10, pr = wS(t, 11.2, 12.7);
260
+ d.lineWidth = 12; d.strokeStyle = LEAD; d.beginPath(); d.moveTo(X + 100, 520); d.lineTo(X + 1020, 520); d.stroke();
261
+ for (let i = 0; i < N; i++) {
262
+ const acc = 61 + 36 * (1 - Math.exp(-i / 2.6)) / (1 - Math.exp(-(N - 1) / 2.6)), hh = (acc - 40) * 5.4 * ezS((t - 11.2 - i * 0.15) / 0.35);
263
+ if (hh < 2) continue;
264
+ const bx = X + 130 + i * 86, col = i === N - 1 ? GOLD : i % 2 ? [40, 150, 190] : [60, 120, 200];
265
+ pc(() => { d.beginPath(); d.moveTo(bx, 520); d.lineTo(bx, 520 - hh + 26); d.quadraticCurveTo(bx, 520 - hh, bx + 30, 520 - hh); d.quadraticCurveTo(bx + 60, 520 - hh, bx + 60, 520 - hh + 26); d.lineTo(bx + 60, 520); d.closePath(); }, col);
266
+ d.lineWidth = 4; d.strokeStyle = LEAD; for (let y = 520 - 44; y > 520 - hh + 30; y -= 44) { d.beginPath(); d.moveTo(bx, y); d.lineTo(bx + 60, y - 8); d.stroke(); }
267
+ }
268
+ const acc = Math.round(t < 11.2 ? 61 : t > 12.7 ? 97 : lerpS(61, 97, H.ease.out(pr)));
269
+ banner(X + 520, 90, 480, 110, '', 0, { k: ezS((t - 10.95) / 0.3) });
270
+ drawT({ str: 'Accuracy', x: X + 550, y: 160, size: 44, ink: [58, 34, 22], font: '600', reveal: wS(t, 11.0, 11.3), align: 'left' });
271
+ drawT({ str: acc + '%', x: X + 980, y: 172, size: 80, ink: acc >= 97 ? [140, 20, 30] : [58, 34, 22], font: '700', reveal: wS(t, 11.1, 11.3), align: 'right' });
272
+ banner(X + 100, 300, 120, 50, '61%', 32, { k: ezS((t - 11.3) / 0.3), reveal: wS(t, 11.35, 11.6) });
273
+ banner(X + 120, 534, 330, 52, 'training rounds →', 32, { k: ezS((t - 11.0) / 0.3), reveal: wS(t, 11.1, 11.5) });
274
+ if (t > 12.7) { strip(ring(X + 905, 146, 112, 66), wS(t, 12.7, 13.1), 12, GOLD, false); glows.push([X + 1004, 200, 260, 0.55 * Math.sin(Math.PI * wS(t, 12.7, 13.7))], [X + 880, 140, 260, 0.4 * Math.sin(Math.PI * wS(t, 12.75, 13.6))]); }
275
+ }
276
+ // texture the dynamic glass, then composite
277
+ d.setTransform(1, 0, 0, 1, 0, 0); d.globalCompositeOperation = 'source-atop'; d.drawImage(C.streak, cam, 0, W, H_, 0, 0, W, H_); d.globalCompositeOperation = 'source-over';
278
+ ctx.drawImage(D, 0, 0);
279
+ // light: cheap bloom through the glass + flares + rays + dust
280
+ const sm = C.small.getContext('2d'); sm.clearRect(0, 0, 160, 90); sm.drawImage(ctx.canvas, 0, 0, ctx.canvas.width, ctx.canvas.height, 0, 0, 160, 90);
281
+ ctx.save(); ctx.globalCompositeOperation = 'screen'; ctx.globalAlpha = 0.35; ctx.imageSmoothingEnabled = true; ctx.drawImage(C.small, 0, 0, W, H_);
282
+ ctx.globalAlpha = 1;
283
+ for (const [x, y, rr, a] of glows) { if (a <= 0) continue; const g = ctx.createRadialGradient(x - cam, y, 4, x - cam, y, rr); g.addColorStop(0, `rgba(255,236,180,${a})`); g.addColorStop(1, 'rgba(255,220,150,0)'); ctx.fillStyle = g; ctx.fillRect(x - cam - rr, y - rr, rr * 2, rr * 2); }
284
+ [[300, [255, 214, 140]], [520, [150, 170, 255]], [760, [255, 190, 150]]].forEach(([sx, c], k) => {
285
+ const dr = Math.sin(t * 0.5 + k) * 20 - cam * 0.08; const g = ctx.createLinearGradient(sx + dr, 0, sx + dr + 400, 720); g.addColorStop(0, H.rgba(c, 0.1)); g.addColorStop(1, H.rgba(c, 0));
286
+ ctx.fillStyle = g; ctx.beginPath(); ctx.moveTo(sx + dr - 40, 0); ctx.lineTo(sx + dr + 60, 0); ctx.lineTo(sx + dr + 520, 720); ctx.lineTo(sx + dr + 320, 720); ctx.closePath(); ctx.fill();
287
+ });
288
+ const dr = H.rng(3);
289
+ for (let k = 0; k < 90; k++) { const x = dr() * W + Math.sin(t * 0.5 + k) * 8, y = ((dr() * 720 - t * 10 * (0.5 + dr())) % 720 + 720) % 720; ctx.fillStyle = `rgba(255,240,210,${dr.range(0.15, 0.45)})`; ctx.beginPath(); ctx.arc(x, y, dr.range(0.6, 1.6), 0, 7); ctx.fill(); }
290
+ ctx.restore();
291
+ H.vignette(ctx, W, H_, 0.45, '10,6,4');
292
+
293
+ // ---------- screen-space banners: hook -> header; takeaway ----------
294
+ const sbanner = (x, y, w, h, str, size, font, reveal = 1) => {
295
+ ctx.save(); ctx.lineJoin = 'round';
296
+ ctx.fillStyle = cssS(CREAMG); ctx.beginPath(); ctx.roundRect(x, y, w, h, 10); ctx.fill();
297
+ ctx.save(); ctx.clip(); ctx.drawImage(C.streak, x, y, w, h, x, y, w, h); ctx.shadowColor = 'rgba(14,6,18,0.55)'; ctx.shadowBlur = 22; ctx.lineWidth = 6; ctx.strokeStyle = LEAD; ctx.stroke(); ctx.restore();
298
+ ctx.lineWidth = 9; ctx.strokeStyle = LEAD; ctx.stroke();
299
+ ctx.save(); ctx.translate(-1.5, -1.5); ctx.lineWidth = 1.5; ctx.strokeStyle = 'rgba(255,240,220,0.16)'; ctx.stroke(); ctx.restore();
300
+ ctx.restore();
301
+ ctx.save(); ctx.font = font; const tw = ctx.measureText(str).width, x0 = x + w / 2 - tw / 2;
302
+ if (reveal < 1) { ctx.beginPath(); ctx.rect(x0 - 6, y, (tw + 12) * reveal, h); ctx.clip(); }
303
+ ctx.textBaseline = 'middle'; ctx.fillStyle = 'rgba(38,20,12,0.22)'; ctx.fillText(str, x0 + 1.5, y + h / 2 + size * 0.04 + 1.8);
304
+ ctx.fillStyle = 'rgb(38,20,12)'; ctx.fillText(str, x0, y + h / 2 + size * 0.04);
305
+ ctx.lineJoin = 'round'; ctx.lineWidth = Math.max(1, size * 0.024); ctx.strokeStyle = 'rgba(20,10,6,0.4)'; ctx.strokeText(str, x0, y + h / 2 + size * 0.04); ctx.restore();
306
+ };
307
+ {
308
+ const k = ezS((t - 1.5) / 0.7), s = lerpS(1, 0.5, k);
309
+ const w = 820 * s, h = 150 * s, x = lerpS(640 - 410, 18, k), y = lerpS(260, 14, k);
310
+ sbanner(x, y, w, h, 'How does AI learn?', 92 * s, `400 ${92 * s}px "UnifrakturMaguntia"`, wS(t, 0.2, 1.2));
311
+ }
312
+ if (t > 13.15) sbanner(140, 610, 1000, 92, 'More examples → better guesses', 52, '600 52px "Cormorant Garamond"', ezS((t - 13.2) / 0.7));
313
+ }
314
+
315
+ registerStyle({
316
+ id: 'stained-glass',
317
+ name: 'Cathedral Glass',
318
+ category: 'Painterly',
319
+ description: 'A leaded Gothic window: hand-cut pieces of streaky, seedy antique glass held in thick dark came, painted grisaille details, and light blazing through into a dim stone interior with dusty rays.',
320
+ motion: 'Daylight sweeps slowly across the window so pieces brighten in turn, the rays drift with floating dust, and the chip in the saint\'s hands pulses.',
321
+ fonts: ['400 38px "UnifrakturMaguntia"', '600 40px "Cormorant Garamond"'],
322
+ duration: 5.5,
323
+ frameT: 5.4,
324
+ readsPixels: true,
325
+ explainerDuration: 15,
326
+ explainerNote: 'Told as a cycle of three leaded windows along a nave, the camera walking from window to window; arrows are strips of glass in lead came with glass arrowheads, labels and the counters are grisaille painted on pale banner glass, and emphasis is ruby glass rings and light flaring through the pieces.',
327
+ explainer(ctx, W, H_, t) { explainStained(ctx, W, H_, t); },
328
+ explainerSound(k) {
329
+ // all times copied from explainStained() above (its wS()/ezS() windows). Glass, lead, stone and light, kept low.
330
+ const D = 15;
331
+ const when = (f, v, a, b) => { for (let t = a; t <= b; t += 0.001) if (f(t) >= v) return t; return b; };
332
+ const SC = ['D4', 'E4', 'F4', 'G4', 'A4', 'C5', 'D5']; // D dorian-ish; glass fundamentals stay under ~600 Hz
333
+ // a piece of glass set into its lead came: a soft dull lead tap and a short, low glassy ring
334
+ const piece = (t, f, g = 1, pan = 0, minor = true) => { const h = k.hz(f);
335
+ k.noise(t, { dur: 0.03, color: 'brown', filter: 'lowpass', f: 600, gain: 0.16 * g, a: 0.002, pan, minor });
336
+ k.tone(t, { f: h, dur: 0.55, gain: 0.09 * g, a: 0.002, verb: 0.35, pan, minor });
337
+ k.tone(t, { f: h * 2.32, dur: 0.22, gain: 0.03 * g, a: 0.002, verb: 0.35, pan, minor }); };
338
+ // a glass strip leaded along a path: one piece per lead division, stepping up the scale, panned along
339
+ const strip = (a, b, n, i0, g = 1, p0 = 0, p1 = p0, minor = true) => { for (let i = 0; i < n; i++) piece(a + (b - a) * i / n, SC[(i0 + i) % SC.length], g * (i ? 0.75 : 1), p0 + (p1 - p0) * i / Math.max(1, n - 1), minor); };
340
+ // grisaille painted onto glass with a soft sable brush
341
+ const paint = (a, b, g = 0.6, pan = 0) => k.play('stroke', a, { material: 'brush', dur: b - a, gain: g, pan, minor: true });
342
+ // a pale banner pane slid into place
343
+ const pane = (t, g = 1, pan = 0) => { k.noise(t, { dur: 0.25, color: 'pink', filter: 'bandpass', f: [[0, 400], [0.25, 700]], q: 1.2, gain: 0.07 * g, a: 0.1, pan, minor: true }); piece(t + 0.25, 'A3', 0.8 * g, pan); };
344
+ // light flaring through the glass: a slow glass-harmonica swell
345
+ const light = (t, dur, notes, g = 1, pan = 0, minor = false) => notes.forEach((n, i) => {
346
+ k.tone(t + i * 0.05, { f: n, dur, gain: 0.05 * g, a: dur * 0.35, verb: 0.5, pan: pan + (i - (notes.length - 1) / 2) * 0.25, minor });
347
+ k.tone(t + i * 0.05, { f: k.hz(n) * 1.004, dur: dur * 0.9, gain: 0.03 * g, a: dur * 0.4, pan: -pan, minor }); });
348
+ // footsteps on the nave's stone floor while the camera walks to the next window
349
+ const step = (t, pan) => { k.play('thud', t, { f: 75, gain: 0.25, pan });
350
+ k.noise(t, { dur: 0.1, color: 'brown', filter: 'lowpass', f: 350, gain: 0.22, a: 0.004, pan, verb: 0.6 });
351
+ k.noise(t + 0.03, { dur: 0.06, color: 'pink', filter: 'bandpass', f: 900, q: 1, gain: 0.05, pan }); };
352
+ const walk = (a, b) => { for (let i = 0; i < 3; i++) step(a + 0.1 + i * (b - a - 0.2) / 2, i % 2 ? 0.25 : -0.25); light(a, b - a + 0.4, ['D3', 'A3'], 0.6, 0, true); };
353
+ // the counters: a fingertip tick on the glass, small and dull
354
+ const tickG = (t, pan) => k.play('tock', t, { f: 1250, gain: 0.42, pan, minor: true });
355
+ const counter = (val, a, b, gap, pan, avoid = []) => { let last = val(a), lastT = -1;
356
+ for (let t = a; t <= b; t += 1 / 240) { const v = val(t); if (v !== last && t - lastT >= gap && !avoid.some((x) => t > x - 0.03 && t < x + 0.08)) { tickG(t, pan); lastT = t; } last = v; } };
357
+
358
+ // ---- the nave: a big stone room and a soft organ-like pad (Dm, C, Bb, F; 3.75 s bars)
359
+ k.bed('room', 0, D, { gain: 0.65 });
360
+ k.music('pad', 0, D, { bpm: 64, gain: 0.32, chords: [['D3', 'A3', 'D4', 'F4'], ['C3', 'G3', 'C4', 'E4'], ['Bb2', 'F3', 'Bb3', 'D4'], ['F3', 'A3', 'C4', 'F4']] });
361
+
362
+ // ---- 1 HOOK: the sun reaches the first window (0.1-1.3), the title is painted on its banner 0.2-1.2
363
+ light(0.1, 1.6, ['D3', 'A3', 'D4'], 1.0, -0.2);
364
+ paint(0.2, 1.2, 0.8);
365
+ k.noise(1.5, { dur: 0.7, color: 'pink', filter: 'bandpass', f: [[0, 300], [0.7, 600]], q: 0.7, gain: 0.06, a: 0.25, minor: true }); // banner slides to the corner
366
+
367
+ // ---- 2 DATA: the rose window fills in (1.2-1.8), the gold strip 2.2-2.8, banners
368
+ [0, 1, 2, 3].forEach((i) => piece(1.22 + i * 0.12, SC[[0, 2, 4, 6][i]], 0.9, 0.5 + i * 0.05, i > 0));
369
+ light(1.2, 1.2, ['F4'], 0.6, 0.5, true);
370
+ strip(2.2, 2.8, 6, 0, 1.0, -0.8, 0.0, false);
371
+ pane(2.3, 0.8, 0.5); // 'the model' banner (ezS 2.3-2.6)
372
+ pane(2.6, 0.8, -0.4); // 'labelled examples' banner
373
+ paint(2.7, 3.1, 0.5, -0.4);
374
+ pane(2.9, 1.0, -0.4); // the counter banner
375
+ // counter: n = 1e6 * ease.in(wS(3.0, 5.6)), rounded to thousands
376
+ counter((t) => Math.round(1e6 * H.ease.in(wS(t, 3.0, 5.6)) / 1000), 3.3, 5.58, 1 / 12, -0.5);
377
+ piece(5.6, 'D4', 1.5, -0.5, false); // 1,000,000 lands
378
+ strip(5.6, 5.9, 4, 2, 0.8, -0.7, -0.2); // ruby underline
379
+
380
+ // ---- walk to window 2 (camera 6.0-6.95)
381
+ walk(6.0, 6.95);
382
+
383
+ // ---- 3 GUESS -> CHECK -> ADJUST
384
+ piece(6.62, 'G3', 1.2, 0.6, false); // the cat panel is leaded in (ezS 6.6-7.0)
385
+ strip(6.9, 7.2, 4, 0, 0.9, -0.4, -0.2, false); // guess strip
386
+ pane(6.97, 0.7, -0.1); // guess banner
387
+ paint(7.1, 7.5, 0.7, 0.0); // 'dog?'
388
+ strip(7.5, 7.8, 4, 2, 0.9, 0.5, 0.3, false); // check strip
389
+ // the wrong guess: two ruby strips hard-set across it, a low clashing glass knock, light flares red (7.9-8.8)
390
+ piece(7.9, 'Eb3', 1.4, 0.0, false); piece(8.05, 'D3', 1.4, 0.0, false);
391
+ k.play('thud', 7.9, { f: 100, gain: 0.35 });
392
+ k.tone(7.9, { f: 'D3', type: 'triangle', dur: 0.8, gain: 0.12, a: 0.01, verb: 0.4 });
393
+ k.tone(7.9, { f: 'Eb3', type: 'triangle', dur: 0.8, gain: 0.1, a: 0.01, verb: 0.4 });
394
+ strip(8.2, 8.45, 3, 4, 0.6, 0.2, -0.2); // the ruby ring closes
395
+ strip(8.25, 8.8, 5, 4, 1.0, 0.0, -0.6, false); // adjust strip runs back to the rose
396
+ // the rose flares and its spokes turn (8.6-9.6 / ezS over 8.7-9.3)
397
+ light(8.6, 1.2, ['D4', 'A4'], 0.9, -0.6);
398
+ const sp = (t) => ezS((t - 8.7) / 0.6);
399
+ [0.2, 0.5, 0.8].forEach((v) => k.play('tock', when(sp, v, 8.7, 9.3), { f: 700, gain: 0.35, pan: -0.6, minor: true }));
400
+ paint(9.4, 9.7, 0.8, 0.0); // 'cat'
401
+ strip(9.7, 9.95, 3, 2, 1.0, 0.1, 0.3, false); // green check
402
+ k.play('ding', 9.97, { f: 'A4', gain: 0.45, pan: 0.2 });
403
+ k.tone(10.0, { f: 'D5', dur: 1.2, gain: 0.05, verb: 0.4, pan: 0.3 });
404
+
405
+ // ---- walk to window 3 (camera 10.4-11.35)
406
+ walk(10.4, 11.35);
407
+
408
+ // ---- 4 PROGRESS: accuracy banner 10.95, ten glass lancets rising from 11.2 + i*0.15, the % repainted
409
+ pane(10.95, 0.8, 0.3);
410
+ const bars = Array.from({ length: 10 }, (_, i) => 11.2 + i * 0.15 + 0.12); // a lancet is leaded once it has risen a little
411
+ bars.forEach((t, i) => piece(t, SC[i % SC.length], 0.55, -0.7 + i * 0.12));
412
+ const acc = (t) => Math.round(61 + 36 * H.ease.out(wS(t, 11.2, 12.7)));
413
+ const t97 = when(acc, 97, 11.2, 12.7);
414
+ counter(acc, 11.25, t97 - 0.05, 1 / 8, 0.5, bars);
415
+ tickG(t97, 0.5); piece(t97, 'A3', 1.2, 0.5); // 97% repainted in ruby
416
+ // the gold ring is leaded round 97% and light flares through the last lancet and the banner: the biggest hit
417
+ k.play('impact', 12.7, { gain: 0.75, pan: 0.4 });
418
+ piece(12.7, 'D4', 2.2, 0.4, false);
419
+ k.play('ding', 12.72, { f: 'D4', gain: 0.8, pan: 0.3 });
420
+ light(12.7, 1.6, ['D3', 'A3', 'F4', 'A4'], 1.4, 0.4);
421
+ strip(12.85, 13.1, 3, 4, 0.6, 0.5, 0.3);
422
+
423
+ // ---- 5 TAKEAWAY: the banner set in at 13.15, painted 13.2-13.9, then a resolving glass chord
424
+ piece(13.15, 'A3', 0.9, 0); // the takeaway banner appears at once (no fade)
425
+ paint(13.2, 13.9, 0.9, 0);
426
+ k.play('ding', 13.95, { f: 'F4', gain: 0.5 });
427
+ light(13.95, 1.0, ['D3', 'A3', 'D4', 'F4'], 1.0, 0);
428
+ },
429
+ draw(ctx, W, H_, t) {
430
+ const cx = 640, x0 = 372, x1 = 908, spring = 360, R = 340;
431
+ // two-centred pointed arch: each side is an arc centred on the springing line inside the opposite half
432
+ const pointed = (c, a, b, r, top, bottom) => {
433
+ const mid = (a + b) / 2, CL = a + r, CR = b - r;
434
+ c.beginPath(); c.moveTo(a, bottom); c.lineTo(a, top);
435
+ c.arc(CL, top, r, Math.PI, Math.PI + Math.acos((CL - mid) / r), false);
436
+ c.arc(CR, top, r, Math.PI * 2 - Math.acos((mid - CR) / r), Math.PI * 2, false);
437
+ c.lineTo(b, bottom); c.closePath();
438
+ };
439
+ const archPath = (c, inset = 0) => pointed(c, x0 + inset, x1 - inset, R - inset, spring, 700 - inset * 0.3);
440
+ const lancet = (c, lx, w, top, bottom) => pointed(c, lx, lx + w, w * 0.9, top, bottom);
441
+
442
+ // ---------- 1. design: region map ----------
443
+ const M = H.layer(W, H_), m = M.getContext('2d');
444
+ const id = (n) => `rgb(${n},0,0)`;
445
+ m.fillStyle = id(0); m.fillRect(0, 0, W, H_);
446
+ m.fillStyle = id(2); archPath(m, 0); m.fill();
447
+ m.fillStyle = id(1); archPath(m, 22); m.fill();
448
+ // side lancets
449
+ [[140, 120], [1020, 120]].forEach(([lx, w]) => { m.fillStyle = id(2); lancet(m, lx, w, 250, 640); m.fill(); m.fillStyle = id(13); lancet(m, lx + 14, w - 28, 256, 626); m.fill(); });
450
+ [[200, 420], [1080, 420], [200, 260], [1080, 260]].forEach(([x, y]) => { m.fillStyle = id(14); m.beginPath(); m.arc(x, y, 26, 0, 7); m.fill(); });
451
+ // stars in the field
452
+ const sr = H.rng(17);
453
+ for (let k = 0; k < 26; k++) {
454
+ const x = sr.range(400, 880), y = sr.range(90, 640), s = sr.range(7, 11);
455
+ if (Math.hypot(x - cx, y - 250) < 175 || (Math.abs(x - cx) < 150 && y > 330)) continue;
456
+ m.fillStyle = id(15); m.beginPath(); m.moveTo(x, y - s); m.lineTo(x + s * 0.6, y); m.lineTo(x, y + s); m.lineTo(x - s * 0.6, y); m.fill();
457
+ }
458
+ // halo: rose of petals around a gold ring, ring of circuit pins
459
+ const hy = 246;
460
+ m.fillStyle = id(17); m.beginPath(); m.arc(cx, hy, 168, 0, 7); m.fill();
461
+ m.fillStyle = id(4); m.beginPath(); m.arc(cx, hy, 150, 0, 7); m.fill();
462
+ for (let k = 0; k < 16; k++) {
463
+ const a = k / 16 * Math.PI * 2, a2 = a + Math.PI / 16;
464
+ m.fillStyle = id(5); m.beginPath(); m.moveTo(cx + Math.cos(a) * 92, hy + Math.sin(a) * 92);
465
+ m.quadraticCurveTo(cx + Math.cos(a2) * 150, hy + Math.sin(a2) * 150, cx + Math.cos(a + Math.PI / 8) * 92, hy + Math.sin(a + Math.PI / 8) * 92);
466
+ m.quadraticCurveTo(cx + Math.cos(a2) * 112, hy + Math.sin(a2) * 112, cx + Math.cos(a) * 92, hy + Math.sin(a) * 92); m.fill();
467
+ }
468
+ // robe (behind the head), inner robe, sleeves
469
+ m.fillStyle = id(8); m.beginPath(); m.moveTo(cx - 70, 352); m.quadraticCurveTo(cx - 150, 400, cx - 176, 640); m.lineTo(cx + 176, 640); m.quadraticCurveTo(cx + 150, 400, cx + 70, 352); m.closePath(); m.fill();
470
+ m.fillStyle = id(9); m.beginPath(); m.moveTo(cx - 34, 360); m.lineTo(cx - 64, 640); m.lineTo(cx + 64, 640); m.lineTo(cx + 34, 360); m.closePath(); m.fill();
471
+ m.fillStyle = id(8); m.beginPath(); m.moveTo(cx - 120, 420); m.quadraticCurveTo(cx - 60, 500, cx - 6, 470); m.lineTo(cx - 6, 512); m.quadraticCurveTo(cx - 80, 540, cx - 132, 480); m.fill();
472
+ m.beginPath(); m.moveTo(cx + 120, 420); m.quadraticCurveTo(cx + 60, 500, cx + 6, 470); m.lineTo(cx + 6, 512); m.quadraticCurveTo(cx + 80, 540, cx + 132, 480); m.fill();
473
+ // hands cradling the chip
474
+ m.fillStyle = id(10); m.beginPath(); m.ellipse(cx - 30, 488, 24, 18, 0.3, 0, 7); m.fill(); m.beginPath(); m.ellipse(cx + 30, 488, 24, 18, -0.3, 0, 7); m.fill();
475
+ m.fillStyle = id(11); m.fillRect(cx - 26, 438, 52, 52);
476
+ m.fillStyle = id(17); for (let k = 0; k < 4; k++) { m.fillRect(cx - 22 + k * 13, 428, 6, 10); m.fillRect(cx - 22 + k * 13, 490, 6, 10); }
477
+ // head: rounded square with face plate and eyes, antenna
478
+ m.fillStyle = id(6); m.beginPath(); m.roundRect(cx - 60, 196, 120, 120, 26); m.fill();
479
+ m.fillRect(cx - 24, 312, 48, 30);
480
+ m.fillStyle = id(16); m.beginPath(); m.roundRect(cx - 44, 226, 88, 62, 14); m.fill();
481
+ m.fillStyle = id(7); m.beginPath(); m.arc(cx - 20, 254, 11, 0, 7); m.fill(); m.beginPath(); m.arc(cx + 20, 254, 11, 0, 7); m.fill();
482
+ m.fillStyle = id(6); m.fillRect(cx - 4, 160, 8, 38); m.beginPath(); m.arc(cx, 156, 12, 0, 7); m.fill();
483
+ // banner
484
+ m.fillStyle = id(12); m.beginPath(); m.moveTo(cx - 230, 600); m.quadraticCurveTo(cx, 576, cx + 230, 600); m.lineTo(cx + 236, 664); m.quadraticCurveTo(cx, 640, cx - 236, 664); m.closePath(); m.fill();
485
+ const MAP = m.getImageData(0, 0, W, H_).data;
486
+ const reg = new Uint8Array(W * H_);
487
+ for (let i = 0; i < reg.length; i++) { const v = MAP[i * 4]; reg[i] = REG[v] || v === 0 ? v : 0; }
488
+
489
+ // ---------- 2. cut the glass: jittered Voronoi inside each region ----------
490
+ const grids = { 1: 40, 2: 22 };
491
+ const seedsFor = {};
492
+ for (const [k, cs] of Object.entries(grids)) {
493
+ const r = H.rng(100 + +k), gw = Math.ceil(W / cs), gh = Math.ceil(H_ / cs), pts = new Float32Array(gw * gh * 2);
494
+ for (let j = 0; j < gh; j++) for (let i = 0; i < gw; i++) { pts[(j * gw + i) * 2] = (i + 0.15 + r() * 0.7) * cs; pts[(j * gw + i) * 2 + 1] = (j + 0.15 + r() * 0.7) * cs; }
495
+ seedsFor[k] = { cs, gw, gh, pts };
496
+ }
497
+ const piece = new Int32Array(W * H_);
498
+ for (let y = 0; y < H_; y++) for (let x = 0; x < W; x++) {
499
+ const i = y * W + x, rg = reg[i];
500
+ if (!rg) { piece[i] = 0; continue; }
501
+ const sub = REG[rg].sub;
502
+ if (!sub) { piece[i] = rg * 100000; continue; }
503
+ const S = seedsFor[sub], gx = (x / S.cs) | 0, gy = (y / S.cs) | 0;
504
+ let best = 1e9, bi = 0;
505
+ for (let dy = -1; dy <= 1; dy++) for (let dx = -1; dx <= 1; dx++) {
506
+ const ix = gx + dx, iy = gy + dy; if (ix < 0 || iy < 0 || ix >= S.gw || iy >= S.gh) continue;
507
+ const k = iy * S.gw + ix, px = S.pts[k * 2] - x, py = S.pts[k * 2 + 1] - y, d = px * px + py * py;
508
+ if (d < best) { best = d; bi = k; }
509
+ }
510
+ piece[i] = rg * 100000 + bi + 1;
511
+ }
512
+ // the lead: wherever neighbouring pixels belong to different pieces
513
+ const LD = H.layer(W, H_), ld = LD.getContext('2d');
514
+ const limg = ld.createImageData(W, H_), la = limg.data;
515
+ for (let y = 0; y < H_ - 1; y++) for (let x = 0; x < W - 1; x++) {
516
+ const i = y * W + x, p = piece[i];
517
+ if (p !== piece[i + 1] || p !== piece[i + W]) la[i * 4 + 3] = 255;
518
+ }
519
+ ld.putImageData(limg, 0, 0);
520
+ const L1 = H.layer(W, H_), l1 = L1.getContext('2d'); l1.filter = 'blur(2.2px)'; l1.drawImage(LD, 0, 0); l1.filter = 'none';
521
+ const L2 = H.layer(W, H_), l2 = L2.getContext('2d'); l2.filter = 'blur(7px)'; l2.drawImage(LD, 0, 0); l2.filter = 'none';
522
+ const lead = l1.getImageData(0, 0, W, H_).data, prox = l2.getImageData(0, 0, W, H_).data;
523
+
524
+ // ---------- 3. stone interior ----------
525
+ const nz = H.makeNoise(8);
526
+ const img = ctx.createImageData(W, H_), d = img.data;
527
+ const gr = H.rng(5);
528
+ // daylight sweeping across the window
529
+ const sweep = 0.5 + 0.5 * Math.sin(t * 0.9 - 2.4);
530
+ // the window lights up piece by piece, spreading out from the chip in the saint's hands
531
+ const winL = H.smooth(0.3, 3.0, t);
532
+ // per-piece glass colour
533
+ const pcache = new Map();
534
+ const pieceCol = (p, rg, x, y) => {
535
+ let c = pcache.get(p); if (c) return c;
536
+ // whole-region pieces (and their stray anti-aliased pixels) light from the region's own centre
537
+ const AT = { 5: [640, 300], 6: [640, 256], 7: [640, 254], 10: [640, 488], 11: [640, 464], 12: [640, 620], 14: [200, 340], 15: [640, 330], 16: [640, 256] };
538
+ if (AT[rg]) { x = AT[rg][0]; y = AT[rg][1]; }
539
+ const rb = H.rng(p * 3 + 1), birth = 0.3 + 2.3 * Math.min(1, Math.hypot(x - cx, y - 464) / 620) + rb() * 0.35;
540
+ const k = H.clamp((t - birth) / 0.3), on = k * k * (3 - 2 * k) * (1 + 0.25 * Math.sin(k * Math.PI)); // a little flare as it catches
541
+ const r = H.rng(p * 7 + 13), def = REG[rg];
542
+ const base = def.alt ? r.pick(def.alt) : def.c;
543
+ const v = 0.86 + r() * 0.26;
544
+ c = [base[0] * v + r.gauss() * 8, base[1] * v + r.gauss() * 8, base[2] * v + r.gauss() * 8, r() * 6.28, 0.4 + r() * 0.8, on];
545
+ pcache.set(p, c); return c;
546
+ };
547
+ for (let y = 0; y < H_; y++) for (let x = 0; x < W; x++) {
548
+ const i = y * W + x, o = i * 4, rg = reg[i];
549
+ let r, g, b;
550
+ if (!rg) {
551
+ // ashlar masonry, warmly lit by the window's glow
552
+ const row = Math.floor(y / 72), off = (row & 1) * 95 + (row % 3) * 37, bxp = (x + off) % 190, byp = y % 72;
553
+ const mortar = bxp < 3 || byp < 3 ? 0.5 : (bxp < 6 || byp < 6 ? 1.12 : 1);
554
+ const tex = 0.85 + nz.fbm2(x * 0.02, y * 0.02, 3) * 0.25 + (gr() - 0.5) * 0.08;
555
+ const glow = Math.max(0.12, 1 - Math.hypot((x - cx) / 620, (y - 330) / 520));
556
+ const k = tex * mortar * (0.18 + glow * 0.42 * (0.2 + 0.8 * winL));
557
+ r = 120 * k; g = 104 * k; b = 92 * k;
558
+ } else {
559
+ const p = piece[i], pc = pieceCol(p, rg, x, y);
560
+ // streaky, seedy antique glass: thickness varies within each sheet
561
+ const sa = pc[3], u = x * Math.cos(sa) + y * Math.sin(sa), v = -x * Math.sin(sa) + y * Math.cos(sa);
562
+ const streak = nz.n2(u * 0.012, v * 0.09 + p) * 0.6 + nz.n2(x * 0.05, y * 0.05) * 0.25;
563
+ const pr = prox[o + 3] / 255, white = rg === 6 || rg === 10;
564
+ // pale white glass shows its streaks and thickness more (and must not blow out to flat white)
565
+ let lum = (white ? 0.84 + streak * 0.5 : 0.92 + streak * 0.32) * (1 - pr * (white ? 0.5 : 0.42)) * (0.92 + 0.16 * pc[4]);
566
+ // light passes stronger through the upper window and in a slow diagonal sweep
567
+ lum *= 0.88 + 0.22 * (1 - y / H_) + 0.14 * Math.exp(-Math.pow((x + y * 0.6 - (300 + sweep * 900)) / 260, 2));
568
+ const on = pc[5];
569
+ r = pc[0] * lum; g = pc[1] * lum; b = pc[2] * lum;
570
+ // hot core where light is strongest
571
+ const hot = Math.max(0, lum - 1.05) * (white ? 70 : 180); r += hot; g += hot; b += hot * 0.8;
572
+ // unlit glass: almost black, just a hint of its colour in the dim nave
573
+ const dim = 0.07 + 0.93 * on; r = r * dim + 14 * (1 - on); g = g * dim + 15 * (1 - on); b = b * dim + 20 * (1 - on);
574
+ }
575
+ // lead came: dark, rounded, catching a little light on its upper-left shoulder
576
+ const la_ = lead[o + 3] / 255;
577
+ // hand-drawn came swells and thins a little along its length
578
+ const lv = la_ > 0.02 ? H.clamp((la_ - 0.07 - (Math.sin(x * 0.031 + y * 0.017) + Math.sin(y * 0.029 - x * 0.013)) * 0.018) / 0.14) : 0;
579
+ if (lv > 0 && (rg || reg[Math.min(reg.length - 1, i + 3)] || reg[Math.max(0, i - 3)])) {
580
+ const gx = (lead[o + 3 + 4] || 0) - (lead[o + 3 - 4] || 0), gy = (lead[o + 3 + W * 4] || 0) - (lead[o + 3 - W * 4] || 0);
581
+ const sh = 14 + Math.max(0, -(gx + gy)) * 0.5 + la_ * 12;
582
+ r = r * (1 - lv) + (sh + 6) * lv; g = g * (1 - lv) + (sh + 4) * lv; b = b * (1 - lv) + sh * lv;
583
+ }
584
+ d[o] = r; d[o + 1] = g; d[o + 2] = b; d[o + 3] = 255;
585
+ }
586
+ ctx.putImageData(img, 0, 0);
587
+
588
+ // ---------- stone reveal: chamfered mouldings framing each opening ----------
589
+ ctx.save();
590
+ const reveal = (fn, wdt) => {
591
+ ctx.lineJoin = 'round';
592
+ ctx.strokeStyle = 'rgba(112,98,84,0.96)'; ctx.lineWidth = wdt; fn(); ctx.stroke();
593
+ ctx.strokeStyle = 'rgba(214,180,140,0.22)'; ctx.lineWidth = wdt * 0.3; ctx.save(); ctx.translate(-wdt * 0.18, -wdt * 0.18); fn(); ctx.stroke(); ctx.restore();
594
+ ctx.strokeStyle = 'rgba(30,22,18,0.7)'; ctx.lineWidth = 3; fn(); ctx.stroke();
595
+ };
596
+ ctx.globalAlpha = 0.35 + 0.65 * winL;
597
+ reveal(() => archPath(ctx, -12), 22);
598
+ reveal(() => lancet(ctx, 128, 144, 250, 652), 18);
599
+ reveal(() => lancet(ctx, 1008, 144, 250, 652), 18);
600
+ ctx.fillStyle = 'rgb(120,104,88)'; ctx.fillRect(330, 700, 620, 20); ctx.fillStyle = 'rgba(230,200,160,0.35)'; ctx.fillRect(330, 700, 620, 4);
601
+ ctx.restore();
602
+
603
+ // ---------- 4. seeds & bubbles in the glass ----------
604
+ const br = H.rng(91);
605
+ ctx.save();
606
+ for (let k = 0; k < 900; k++) {
607
+ const x = br() * W, y = br() * H_, i = (y | 0) * W + (x | 0);
608
+ if (!reg[i] || lead[i * 4 + 3] > 20) continue;
609
+ const rr = br() < 0.85 ? br.range(0.6, 1.4) : br.range(1.8, 3.2);
610
+ ctx.fillStyle = 'rgba(255,255,240,0.35)'; ctx.beginPath(); ctx.ellipse(x, y, rr * 1.3, rr, 0.3, 0, 7); ctx.fill();
611
+ ctx.strokeStyle = 'rgba(0,0,20,0.25)'; ctx.lineWidth = 0.6; ctx.stroke();
612
+ }
613
+ ctx.restore();
614
+
615
+ // ---------- 5. grisaille: paint fired onto the glass ----------
616
+ ctx.save(); ctx.globalCompositeOperation = 'multiply'; ctx.lineCap = 'round'; ctx.lineJoin = 'round';
617
+ const gris = (a) => `rgba(52,34,26,${a})`;
618
+ // robe folds: soft smear shading, the way glass painters matted it on
619
+ ctx.save(); ctx.filter = 'blur(5px)'; ctx.strokeStyle = gris(0.3); ctx.lineWidth = 12;
620
+ [[-120, 450, -146, 600], [-80, 480, -96, 600], [86, 480, 100, 600], [124, 450, 148, 600]].forEach(([a, b, c2, e]) => { ctx.beginPath(); ctx.moveTo(cx + a, b); ctx.quadraticCurveTo(cx + (a + c2) / 2 + 10, (b + e) / 2, cx + c2, e); ctx.stroke(); });
621
+ ctx.restore();
622
+ ctx.strokeStyle = gris(0.5); ctx.lineWidth = 2.2;
623
+ [[-112, 470, -128, 560], [112, 470, 128, 560]].forEach(([a, b, c2, e]) => { ctx.beginPath(); ctx.moveTo(cx + a, b); ctx.quadraticCurveTo(cx + (a + c2) / 2 + 6, (b + e) / 2, cx + c2, e); ctx.stroke(); });
624
+ // face plate: mouth grille, eye pupils
625
+ ctx.lineWidth = 2.4; for (let k = 0; k < 5; k++) { ctx.beginPath(); ctx.moveTo(cx - 18 + k * 9, 272); ctx.lineTo(cx - 18 + k * 9, 282); ctx.stroke(); }
626
+ ctx.fillStyle = gris(0.6); ctx.beginPath(); ctx.arc(cx - 20, 254, 4, 0, 7); ctx.arc(cx + 20, 254, 4, 0, 7); ctx.fill();
627
+ // head shading + rivets: a soft matt badgered toward the edges of the white glass, darker on the shadow side
628
+ ctx.save(); ctx.beginPath(); ctx.roundRect(cx - 60, 196, 120, 120, 26); ctx.clip();
629
+ const hm = ctx.createRadialGradient(cx - 16, 236, 18, cx - 4, 252, 98); hm.addColorStop(0, gris(0)); hm.addColorStop(0.55, gris(0.08)); hm.addColorStop(1, gris(0.42));
630
+ ctx.fillStyle = hm; ctx.fillRect(cx - 60, 196, 120, 120);
631
+ ctx.restore();
632
+ ctx.save(); ctx.beginPath(); ctx.roundRect(cx - 44, 226, 88, 62, 14); ctx.clip();
633
+ const fm = ctx.createLinearGradient(0, 226, 0, 288); fm.addColorStop(0, gris(0)); fm.addColorStop(1, gris(0.35));
634
+ ctx.fillStyle = fm; ctx.fillRect(cx - 44, 226, 88, 62); ctx.restore();
635
+ ctx.fillStyle = gris(0.25); ctx.beginPath(); ctx.roundRect(cx + 30, 200, 26, 112, 18); ctx.fill();
636
+ ctx.fillStyle = gris(0.55); [[-48, 208], [48, 208], [-48, 304], [48, 304]].forEach(([a, b]) => { ctx.beginPath(); ctx.arc(cx + a, b, 3, 0, 7); ctx.fill(); });
637
+ // chip die + traces
638
+ ctx.strokeStyle = gris(0.6); ctx.lineWidth = 2; ctx.strokeRect(cx - 14, 450, 28, 28);
639
+ ctx.lineWidth = 1.6; for (let k = 0; k < 3; k++) { ctx.beginPath(); ctx.moveTo(cx - 14, 456 + k * 8); ctx.lineTo(cx - 24, 456 + k * 8); ctx.moveTo(cx + 14, 456 + k * 8); ctx.lineTo(cx + 24, 456 + k * 8); ctx.stroke(); }
640
+ // halo: fine radiating hatching on the gold ring
641
+ ctx.strokeStyle = gris(0.28); ctx.lineWidth = 1.2;
642
+ for (let k = 0; k < 72; k++) { const a = k / 72 * Math.PI * 2; ctx.beginPath(); ctx.moveTo(cx + Math.cos(a) * 128, hy + Math.sin(a) * 128); ctx.lineTo(cx + Math.cos(a) * 146, hy + Math.sin(a) * 146); ctx.stroke(); }
643
+ // lancet quarries: little painted fleurons
644
+ ctx.strokeStyle = gris(0.35); ctx.lineWidth = 1.4;
645
+ for (let y = 300; y < 620; y += 40) [200, 1080].forEach((x) => { if (Math.abs(y - 420) < 40) return; ctx.beginPath(); ctx.moveTo(x - 7, y); ctx.lineTo(x + 7, y); ctx.moveTo(x, y - 7); ctx.lineTo(x, y + 7); ctx.stroke(); });
646
+ // banner text
647
+ ctx.fillStyle = gris(0.92); ctx.font = '400 38px "UnifrakturMaguntia"'; ctx.textAlign = 'center';
648
+ ctx.save(); ctx.translate(cx, 636); ctx.rotate(0); ctx.fillText('In Silico Veritas', 0, 0); ctx.restore();
649
+ ctx.restore();
650
+
651
+ // ---------- 6. light: bloom, chip pulse, rays, dust ----------
652
+ const glass = H.layer(W, H_), gx_ = glass.getContext('2d');
653
+ gx_.filter = 'blur(16px)'; gx_.drawImage(ctx.canvas, 0, 0, ctx.canvas.width, ctx.canvas.height, 0, 0, W, H_); gx_.filter = 'none';
654
+ ctx.save(); ctx.globalCompositeOperation = 'screen'; ctx.globalAlpha = 0.45; ctx.drawImage(glass, 0, 0); ctx.restore();
655
+ const pulse = (0.6 + 0.4 * Math.sin(t * 3)) * H.smooth(0.15, 0.6, t);
656
+ ctx.save(); ctx.globalCompositeOperation = 'screen';
657
+ const cg = ctx.createRadialGradient(cx, 464, 4, cx, 464, 90); cg.addColorStop(0, `rgba(255,236,170,${0.75 * pulse})`); cg.addColorStop(1, 'rgba(255,200,100,0)');
658
+ ctx.fillStyle = cg; ctx.fillRect(cx - 100, 370, 200, 200);
659
+ // shafts of light falling from the window into the dusty nave
660
+ const rays = [[470, 0.12, [255, 214, 140]], [560, 0.15, [150, 170, 255]], [640, 0.16, [255, 200, 120]], [730, 0.13, [255, 150, 160]], [830, 0.12, [190, 255, 200]]];
661
+ const rayL = H.smooth(2.3, 3.6, t);
662
+ ctx.filter = 'blur(6px)'; ctx.globalAlpha = rayL;
663
+ rays.forEach(([sx, a, c], k) => {
664
+ const drift = Math.sin(t * 0.4 + k) * 14;
665
+ const g = ctx.createLinearGradient(sx, 200, sx + 520, 760);
666
+ g.addColorStop(0, H.rgba(c, a * 1.6)); g.addColorStop(0.6, H.rgba(c, a * 0.6)); g.addColorStop(1, H.rgba(c, 0));
667
+ ctx.fillStyle = g; ctx.beginPath(); ctx.moveTo(sx - 30, 200); ctx.lineTo(sx + 40, 200); ctx.lineTo(sx + 600 + drift, 760); ctx.lineTo(sx + 430 + drift, 760); ctx.closePath(); ctx.fill();
668
+ });
669
+ ctx.filter = 'none';
670
+ const dr = H.rng(3);
671
+ for (let k = 0; k < 140; k++) {
672
+ const x = dr.range(560, 1280) + Math.sin(t * 0.5 + k) * 8, y = (dr.range(200, 720) - t * 6 * (0.5 + dr())) % 720;
673
+ ctx.fillStyle = `rgba(255,240,210,${dr.range(0.15, 0.5) * rayL})`; ctx.beginPath(); ctx.arc(x, y < 200 ? y + 520 : y, dr.range(0.6, 1.6), 0, 7); ctx.fill();
674
+ }
675
+ ctx.restore();
676
+ H.vignette(ctx, W, H_, 0.55, '10,6,4');
677
+ H.grain(ctx, W, H_, 0.035, 12);
678
+ }
679
+ });
680
+ }