@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,612 @@
1
+ {
2
+ // ---------- Byzantine tesserae mosaic with andamento ----------
3
+ // 1) paint a flat "cartoon" into a label map 2) distance field from every contour
4
+ // 3) tessera rows = iso-distance bands (so tiles follow the forms) 4) seeds along each band
5
+ // 5) per-pixel constrained Voronoi (same region + same row) -> irregular tiles, grout, bevels.
6
+ const REG = [
7
+ // name, rgb, tile size, kind
8
+ ['gold', [204, 162, 70], 13, 'gold'],
9
+ ['halo', [214, 174, 80], 11, 'gold'],
10
+ ['haloRing', [150, 38, 30], 10],
11
+ ['haloInner', [232, 224, 204], 8],
12
+ ['bDark', [44, 40, 42], 10],
13
+ ['bBand', [226, 214, 190], 11],
14
+ ['lozenge', [158, 46, 34], 9],
15
+ ['bInner', [118, 34, 26], 9],
16
+ ['face', [166, 180, 188], 9],
17
+ ['faceShade', [120, 136, 150], 9],
18
+ ['outline', [38, 36, 44], 8],
19
+ ['eyeGlow', [64, 172, 192], 7],
20
+ ['eyeWhite', [228, 226, 214], 7],
21
+ ['pupil', [22, 24, 30], 6],
22
+ ['copper', [178, 104, 56], 8],
23
+ ['red', [172, 44, 34], 8],
24
+ ['robe', [34, 54, 104], 10],
25
+ ['robeLight', [64, 94, 156], 10],
26
+ ['clavus', [206, 164, 66], 9, 'gold'],
27
+ ['collar', [140, 48, 38], 8],
28
+ ['neck', [128, 140, 150], 8],
29
+ ['letters', [124, 30, 26], 9],
30
+ ['star', [236, 232, 220], 7],
31
+ ];
32
+ const ID = {}; REG.forEach((r, i) => (ID[r[0]] = i));
33
+ const key = (i) => [(i * 11 + 3) & 255, (i * 37 + 50) & 255, (i * 91 + 17) & 255];
34
+
35
+ // all static work (cartoon, distance field, seeds, per-pixel tile ownership + bevel) is
36
+ // deterministic, so it is computed once and reused by every frame
37
+ let CACHE = null;
38
+ function build(W, H_) {
39
+ const nz = H.makeNoise(4), rnd = H.rng(331);
40
+ // ---------- 1) cartoon / label map ----------
41
+ const LC = H.layer(W, H_), lc = LC.getContext('2d');
42
+ const fill = (name) => { const k = key(ID[name]); lc.fillStyle = `rgb(${k[0]},${k[1]},${k[2]})`; lc.strokeStyle = lc.fillStyle; };
43
+ const circ = (x, y, r) => { lc.beginPath(); lc.arc(x, y, r, 0, Math.PI * 2); lc.fill(); };
44
+ fill('bDark'); lc.fillRect(0, 0, W, H_);
45
+ fill('bBand'); lc.fillRect(14, 14, W - 28, H_ - 28);
46
+ fill('lozenge');
47
+ const loz = (x, y, a) => { lc.beginPath(); lc.moveTo(x - a, y); lc.lineTo(x, y - 13); lc.lineTo(x + a, y); lc.lineTo(x, y + 13); lc.closePath(); lc.fill(); };
48
+ for (let x = 50; x < W - 20; x += 64) { loz(x, 33, 22); loz(x, H_ - 33, 22); }
49
+ for (let y = 97; y < H_ - 60; y += 64) { lc.beginPath(); lc.moveTo(33, y - 22); lc.lineTo(46, y); lc.lineTo(33, y + 22); lc.lineTo(20, y); lc.closePath(); lc.fill(); lc.beginPath(); lc.moveTo(W - 33, y - 22); lc.lineTo(W - 20, y); lc.lineTo(W - 33, y + 22); lc.lineTo(W - 46, y); lc.closePath(); lc.fill(); }
50
+ fill('bInner'); lc.fillRect(52, 52, W - 104, H_ - 104);
51
+ fill('gold'); lc.fillRect(62, 62, W - 124, H_ - 124);
52
+ // scattered white stars in the gold field
53
+ fill('star');
54
+ [[200, 470], [1080, 470], [250, 600], [1030, 600]].forEach(([x, y]) => { lc.beginPath(); for (let k = 0; k < 8; k++) { const a = k * Math.PI / 4, q = k % 2 ? 6 : 17; lc.lineTo(x + Math.cos(a) * q, y + Math.sin(a) * q); } lc.closePath(); lc.fill(); });
55
+ // halo
56
+ const HX = 640, HY = 292;
57
+ fill('haloRing'); circ(HX, HY, 202);
58
+ fill('haloInner'); circ(HX, HY, 190);
59
+ fill('halo'); circ(HX, HY, 179);
60
+ // robe / shoulders
61
+ const robe = () => { lc.beginPath(); lc.moveTo(400, 720); lc.bezierCurveTo(400, 560, 440, 470, 560, 440); lc.lineTo(720, 440); lc.bezierCurveTo(840, 470, 880, 560, 880, 720); lc.closePath(); };
62
+ fill('outline'); robe(); lc.lineWidth = 18; lc.stroke(); robe(); lc.fill();
63
+ fill('robe'); lc.save(); lc.translate(640, 0); lc.scale(0.975, 1); lc.translate(-640, 6); robe(); lc.fill(); lc.restore();
64
+ // fold highlights
65
+ fill('robeLight'); lc.lineWidth = 16; lc.lineCap = 'round';
66
+ [[[470, 720], [474, 620], [500, 540], [540, 480]], [[560, 720], [556, 640], [568, 570], [590, 500]], [[720, 720], [724, 640], [712, 570], [690, 500]], [[810, 720], [806, 620], [780, 540], [740, 480]]].forEach((p) => { lc.beginPath(); lc.moveTo(...p[0]); lc.bezierCurveTo(...p[1], ...p[2], ...p[3]); lc.stroke(); });
67
+ // clavi (gold stripes)
68
+ fill('clavus'); lc.lineWidth = 22; lc.lineCap = 'butt';
69
+ [[[528, 720], [520, 600], [530, 520], [556, 452]], [[752, 720], [760, 600], [750, 520], [724, 452]]].forEach((p) => { lc.beginPath(); lc.moveTo(...p[0]); lc.bezierCurveTo(...p[1], ...p[2], ...p[3]); lc.stroke(); });
70
+ // collar
71
+ fill('collar'); lc.beginPath(); lc.ellipse(640, 440, 92, 34, 0, 0, Math.PI); lc.fill();
72
+ // neck
73
+ fill('outline'); lc.fillRect(602, 384, 76, 62);
74
+ fill('neck'); lc.fillRect(610, 384, 60, 58);
75
+ fill('outline'); lc.fillRect(610, 404, 60, 6); lc.fillRect(610, 422, 60, 6);
76
+ // ears (bolts)
77
+ [[536, 296], [744, 296]].forEach(([x, y]) => { fill('outline'); circ(x, y, 25); fill('copper'); circ(x, y, 18); fill('outline'); circ(x, y, 6); });
78
+ // antenna
79
+ fill('outline'); lc.lineWidth = 10; lc.lineCap = 'round'; lc.beginPath(); lc.moveTo(640, 190); lc.lineTo(640, 132); lc.stroke();
80
+ fill('outline'); circ(640, 124, 22); fill('red'); circ(640, 124, 15);
81
+ // head
82
+ const head = (pad) => { lc.beginPath(); lc.roundRect(540 - pad, 182 - pad, 200 + pad * 2, 214 + pad * 2, 56 + pad); };
83
+ fill('outline'); head(9); lc.fill();
84
+ fill('face'); head(0); lc.fill();
85
+ fill('faceShade'); lc.save(); head(0); lc.clip(); lc.beginPath(); lc.moveTo(690, 170); lc.bezierCurveTo(740, 250, 740, 330, 680, 410); lc.lineTo(760, 410); lc.lineTo(760, 170); lc.closePath(); lc.fill(); lc.restore();
86
+ // brows
87
+ fill('outline'); lc.lineWidth = 9; lc.lineCap = 'round';
88
+ [[560, 236, 624, 228], [656, 228, 720, 236]].forEach(([a, b, c2, d]) => { lc.beginPath(); lc.moveTo(a, b); lc.quadraticCurveTo((a + c2) / 2, b - 16, c2, d); lc.stroke(); });
89
+ // eyes
90
+ [[594, 280], [686, 280]].forEach(([x, y]) => { fill('outline'); circ(x, y, 33); fill('eyeWhite'); circ(x, y, 26); fill('eyeGlow'); circ(x, y, 18); fill('pupil'); circ(x, y, 8); });
91
+ // nose + mouth
92
+ fill('outline'); lc.lineWidth = 9; lc.beginPath(); lc.moveTo(640, 262); lc.lineTo(640, 330); lc.lineTo(628, 336); lc.stroke();
93
+ lc.beginPath(); lc.moveTo(606, 360); lc.quadraticCurveTo(640, 370, 674, 360); lc.stroke();
94
+ // letters "A" "I" with abbreviation bars (icon style)
95
+ fill('letters'); lc.font = '600 132px "Cormorant Garamond"'; lc.textAlign = 'center'; lc.textBaseline = 'alphabetic';
96
+ lc.fillText('A', 352, 272); lc.fillText('I', 930, 272);
97
+ lc.lineWidth = 10; lc.lineCap = 'round'; lc.beginPath(); lc.moveTo(318, 150); lc.lineTo(386, 150); lc.moveTo(906, 150); lc.lineTo(954, 150); lc.stroke();
98
+
99
+ // resolve labels (antialiased edge pixels take a resolved neighbour)
100
+ const lab = new Uint8Array(W * H_);
101
+ {
102
+ const d = lc.getImageData(0, 0, W, H_).data, map = new Map();
103
+ REG.forEach((_, i) => { const k = key(i); map.set((k[0] << 16) | (k[1] << 8) | k[2], i); });
104
+ for (let p = 0; p < W * H_; p++) {
105
+ const v = map.get((d[p * 4] << 16) | (d[p * 4 + 1] << 8) | d[p * 4 + 2]);
106
+ if (v !== undefined) lab[p] = v;
107
+ else lab[p] = p % W ? lab[p - 1] : (p >= W ? lab[p - W] : 0);
108
+ }
109
+ }
110
+ // ---------- 2) distance field (chamfer) ----------
111
+ const D = new Float32Array(W * H_);
112
+ for (let y = 0; y < H_; y++) for (let x = 0; x < W; x++) {
113
+ const p = y * W + x, l = lab[p];
114
+ const edge = (x < W - 1 && lab[p + 1] !== l) || (y < H_ - 1 && lab[p + W] !== l) || (x > 0 && lab[p - 1] !== l) || (y > 0 && lab[p - W] !== l);
115
+ D[p] = edge ? 0.5 : 1e9;
116
+ }
117
+ const A = 1, B = 1.4142;
118
+ for (let y = 0; y < H_; y++) for (let x = 0; x < W; x++) {
119
+ const p = y * W + x; let v = D[p];
120
+ if (x > 0) v = Math.min(v, D[p - 1] + A);
121
+ if (y > 0) { v = Math.min(v, D[p - W] + A); if (x > 0) v = Math.min(v, D[p - W - 1] + B); if (x < W - 1) v = Math.min(v, D[p - W + 1] + B); }
122
+ D[p] = v;
123
+ }
124
+ for (let y = H_ - 1; y >= 0; y--) for (let x = W - 1; x >= 0; x--) {
125
+ const p = y * W + x; let v = D[p];
126
+ if (x < W - 1) v = Math.min(v, D[p + 1] + A);
127
+ if (y < H_ - 1) { v = Math.min(v, D[p + W] + A); if (x < W - 1) v = Math.min(v, D[p + W + 1] + B); if (x > 0) v = Math.min(v, D[p + W - 1] + B); }
128
+ D[p] = v;
129
+ }
130
+ // wobble the rows a little (hand-laid)
131
+ for (let y = 0; y < H_; y += 1) for (let x = 0; x < W; x++) { const p = y * W + x; if (D[p] > 1.5) D[p] += nz.n2(x * 0.045, y * 0.045) * 1.6; }
132
+
133
+ // row parametrisation: echo rows hug every contour; the open gold ground switches to straight
134
+ // horizontal courses beyond two echo rows (as in real Byzantine grounds)
135
+ const GOLD = ID.gold;
136
+ const rowInfo = (p, x, y) => {
137
+ const l = lab[p], s = REG[l][2], d = D[p];
138
+ if (l === GOLD && d >= 2 * s) {
139
+ const rv = (y + nz.n2(x * 0.012, y * 0.03) * 3) / s, row = Math.floor(rv);
140
+ return [1000 + row, rv - row, s, d - 2 * s];
141
+ }
142
+ const row = Math.floor(d / s);
143
+ return [row, d / s - row, s, 99];
144
+ };
145
+ // ---------- 3+4) seeds along the centre of each row band ----------
146
+ const CS = 16, GW = Math.ceil(W / CS), GH = Math.ceil(H_ / CS);
147
+ const grid = Array.from({ length: GW * GH }, () => []);
148
+ const SX = [], SY = [], SL = [], SR = [], SW = [], SC = [], SG = [];
149
+ const near = (x, y, l, row, rad) => {
150
+ const cx = (x / CS) | 0, cy = (y / CS) | 0;
151
+ for (let j = cy - 1; j <= cy + 1; j++) for (let i = cx - 1; i <= cx + 1; i++) {
152
+ if (i < 0 || j < 0 || i >= GW || j >= GH) continue;
153
+ for (const s of grid[j * GW + i]) if (SL[s] === l && SR[s] === row && (SX[s] - x) ** 2 + (SY[s] - y) ** 2 < rad * rad) return true;
154
+ }
155
+ return false;
156
+ };
157
+ const GOLDS = [[198, 154, 60], [214, 172, 76], [226, 188, 92], [186, 142, 52], [238, 204, 112], [206, 160, 64]];
158
+ for (let y = 0; y < H_; y++) for (let x = 0; x < W; x++) {
159
+ const p = y * W + x, l = lab[p];
160
+ const [row, fr0, s] = rowInfo(p, x, y);
161
+ if (Math.abs(fr0 - 0.5) * s > 0.6) continue;
162
+ const rad = s * (0.82 + 0.3 * rnd());
163
+ if (near(x, y, l, row, rad)) continue;
164
+ const i = SX.length;
165
+ SX.push(x); SY.push(y); SL.push(l); SR.push(row); SW.push(0.88 + 0.26 * rnd());
166
+ const reg = REG[l]; let col;
167
+ if (reg[3] === 'gold') { col = rnd.pick(GOLDS).slice(); if (rnd.chance(0.05)) col = [150, 112, 42]; SG.push(rnd.chance(0.14) ? rnd.range(0, 6.28) : -1); }
168
+ else { const v = 1 + rnd.gauss() * 0.06; col = reg[1].map((c) => H.clamp(c * v + rnd.gauss() * 6, 0, 255)); SG.push(-1); }
169
+ SC.push(col);
170
+ grid[((y / CS) | 0) * GW + ((x / CS) | 0)].push(i);
171
+ }
172
+
173
+ // ---------- 5) per-pixel tile ownership, grout and bevel ----------
174
+ const N = W * H_, OWN = new Int32Array(N), GRT = new Uint8Array(N), BR = new Float32Array(N), KK = new Float32Array(N), BED = new Float32Array(N), SIN = new Uint8Array(N);
175
+ const Lx = -0.6, Ly = -0.8;
176
+ for (let y = 0; y < H_; y++) {
177
+ const cy = (y / CS) | 0;
178
+ for (let x = 0; x < W; x++) {
179
+ const p = y * W + x, l = lab[p], d = D[p];
180
+ BED[p] = 0.9 + 0.08 * nz.n2(x * 0.08, y * 0.08) + 0.04 * nz.n2(x * 0.6, y * 0.6);
181
+ SIN[p] = d < 1.7 ? 1 : 0;
182
+ const [row, fr, s, zoneEdge] = rowInfo(p, x, y);
183
+ const cx = (x / CS) | 0;
184
+ let b1 = 1e9, b2 = 1e9, i1 = -1, f1 = 1e9, fi = -1;
185
+ for (let j = cy - 1; j <= cy + 1; j++) {
186
+ if (j < 0 || j >= GH) continue;
187
+ for (let i = cx - 1; i <= cx + 1; i++) {
188
+ if (i < 0 || i >= GW) continue;
189
+ const cell = grid[j * GW + i];
190
+ for (let k = 0; k < cell.length; k++) {
191
+ const sd = cell[k]; if (SL[sd] !== l) continue;
192
+ const dd = Math.sqrt((SX[sd] - x) ** 2 + (SY[sd] - y) ** 2) * SW[sd];
193
+ if (SR[sd] === row) { if (dd < b1) { b2 = b1; b1 = dd; i1 = sd; } else if (dd < b2) b2 = dd; }
194
+ else if (dd < f1) { f1 = dd; fi = sd; }
195
+ }
196
+ }
197
+ }
198
+ let sameRow = true;
199
+ if (i1 < 0) { i1 = fi; b1 = f1; sameRow = false; }
200
+ OWN[p] = i1;
201
+ if (i1 < 0) { GRT[p] = 1; BR[p] = 0.85; continue; }
202
+ const rowEdge = sameRow ? Math.min(fr, 1 - fr) * s : 99;
203
+ const cellEdge = (b2 - b1) * 0.5;
204
+ const edge = Math.min(rowEdge, cellEdge, d, zoneEdge);
205
+ const g = 1.05 + 0.35 * nz.n2(x * 0.3, y * 0.3);
206
+ if (edge < g) { GRT[p] = 1; BR[p] = 0.75 + 0.2 * nz.n2(x * 0.5, y * 0.5) + 0.1 * (edge / g); continue; }
207
+ let vx = x - SX[i1], vy = y - SY[i1]; const vm = Math.hypot(vx, vy) || 1; vx /= vm; vy /= vm;
208
+ const k = H.clamp(1 - (edge - g) / 2.6);
209
+ let br = 1 + k * k * (vx * Lx + vy * Ly) * 0.3 - k * 0.06 + nz.n2(x * 0.7, y * 0.7) * 0.03;
210
+ br *= 0.94 + 0.12 * ((SX[i1] * 7.13 + SY[i1] * 3.71) % 1);
211
+ BR[p] = br; KK[p] = k;
212
+ }
213
+ }
214
+ // ---------- 6) laying order: figure first, then robe, halo ring, halo, letters, gold ground outward, border last ----------
215
+ const LT = new Float32Array(SX.length), lr = H.rng(77), HCX = 640, HCY = 300;
216
+ const FIG = new Set(['outline', 'eyeGlow', 'eyeWhite', 'pupil', 'face', 'faceShade', 'copper', 'red', 'neck', 'collar']);
217
+ for (let i = 0; i < SX.length; i++) {
218
+ const nm = REG[SL[i]][0], x = SX[i], y = SY[i], dc = Math.hypot(x - HCX, y - HCY), j = lr();
219
+ let lt;
220
+ if (FIG.has(nm)) lt = 0.15 + Math.min(dc, 260) / 260 * 0.9 + j * 0.12;
221
+ else if (nm === 'robe' || nm === 'robeLight' || nm === 'clavus') lt = 0.65 + Math.max(0, y - 430) / 290 * 0.75 + j * 0.15;
222
+ else if (nm === 'haloRing' || nm === 'haloInner') lt = 1.0 + (((Math.atan2(y - HCY, x - HCX) + Math.PI / 2) / (Math.PI * 2) + 1) % 1) * 0.55 + j * 0.05;
223
+ else if (nm === 'halo') lt = 1.35 + Math.max(0, 190 - dc) / 190 * 0.5 + j * 0.03;
224
+ else if (nm === 'letters') lt = 1.5 + j * 0.3;
225
+ else if (nm === 'star') lt = 1.75 + j * 0.2;
226
+ else if (nm === 'gold') lt = 1.8 + Math.max(0, dc - 195) / 560 * 1.25 + j * 0.035 + (SR[i] % 2) * 0.03;
227
+ else { const u = y < 60 ? x / W * 0.25 : x > W - 60 ? 0.25 + y / H_ * 0.25 : y > H_ - 60 ? 0.5 + (1 - x / W) * 0.25 : 0.75 + (1 - y / H_) * 0.25; lt = 2.8 + u * 0.6 + j * 0.08; }
228
+ LT[i] = lt;
229
+ }
230
+ return { OWN, GRT, BR, KK, BED, SIN, LT, SC, SG };
231
+ }
232
+
233
+ // ===== EXPLAINER HELPERS =====
234
+ // extra palette for the explainer scenes
235
+ [['cream', [232, 222, 196], 8], ['brown', [118, 78, 48], 8], ['green', [52, 124, 66], 8], ['tan', [196, 140, 70], 8], ['ink', [40, 34, 40], 7], ['txt', [92, 20, 18], 5]].forEach((r) => { if (ID[r[0]] === undefined) { ID[r[0]] = REG.length; REG.push(r); } });
236
+ // ---- scene tessellation: the same andamento pipeline as the still, plus per-tile lay / removal times ----
237
+ // paint(cx, F): F(name, lay, rem = 99, kind = 0) sets the fill for either the label pass or the time pass.
238
+ // kind: 0 solid, 1 sweep along x (+0..0.7s), 2 radial from (cx,cy) given via F.c, 3 bottom-up within element (+0..0.5s)
239
+ const MX_SCENES = {}; let MX_BED = null;
240
+ function mxScene(id, W, H_, paint, kinds, sceneRem = 99) {
241
+ if (MX_SCENES[id]) return MX_SCENES[id];
242
+ const nz = H.makeNoise(4), rnd = H.rng(331 + id.length * 7);
243
+ const LCv = H.layer(W, H_), lc = LCv.getContext('2d'), TCv = H.layer(W, H_), tc = TCv.getContext('2d');
244
+ const enc = (v) => Math.round(H.clamp(v / 15) * 255);
245
+ [lc, tc].forEach((cx, pass) => {
246
+ const F = (name, lay, rem = 15, kind = 0) => {
247
+ let col;
248
+ if (pass === 0) { const k = key(ID[name]); col = `rgb(${k[0]},${k[1]},${k[2]})`; }
249
+ else col = `rgb(${enc(lay)},${enc(rem)},${kind})`;
250
+ cx.fillStyle = col; cx.strokeStyle = col;
251
+ };
252
+ cx.imageSmoothingEnabled = false; paint(cx, F);
253
+ });
254
+ const N = W * H_, lab = new Uint8Array(N);
255
+ { const d = lc.getImageData(0, 0, W, H_).data, map = new Map(); REG.forEach((_, i) => { const k = key(i); map.set((k[0] << 16) | (k[1] << 8) | k[2], i); });
256
+ for (let p = 0; p < N; p++) { const v = map.get((d[p * 4] << 16) | (d[p * 4 + 1] << 8) | d[p * 4 + 2]); lab[p] = v !== undefined ? v : (p % W ? lab[p - 1] : (p >= W ? lab[p - W] : 0)); } }
257
+ const td = tc.getImageData(0, 0, W, H_).data;
258
+ const D = new Float32Array(N);
259
+ for (let y = 0; y < H_; y++) for (let x = 0; x < W; x++) { const p = y * W + x, l = lab[p]; D[p] = ((x < W - 1 && lab[p + 1] !== l) || (y < H_ - 1 && lab[p + W] !== l) || (x > 0 && lab[p - 1] !== l) || (y > 0 && lab[p - W] !== l)) ? 0.5 : 1e9; }
260
+ for (let y = 0; y < H_; y++) for (let x = 0; x < W; x++) { const p = y * W + x; let v = D[p]; if (x > 0) v = Math.min(v, D[p - 1] + 1); if (y > 0) { v = Math.min(v, D[p - W] + 1); if (x > 0) v = Math.min(v, D[p - W - 1] + 1.4142); if (x < W - 1) v = Math.min(v, D[p - W + 1] + 1.4142); } D[p] = v; }
261
+ for (let y = H_ - 1; y >= 0; y--) for (let x = W - 1; x >= 0; x--) { const p = y * W + x; let v = D[p]; if (x < W - 1) v = Math.min(v, D[p + 1] + 1); if (y < H_ - 1) { v = Math.min(v, D[p + W] + 1); if (x < W - 1) v = Math.min(v, D[p + W + 1] + 1.4142); if (x > 0) v = Math.min(v, D[p + W - 1] + 1.4142); } D[p] = v; }
262
+ for (let p = 0; p < N; p++) if (D[p] > 1.5) D[p] += nz.n2((p % W) * 0.045, ((p / W) | 0) * 0.045) * 1.6;
263
+ const GOLD = ID.gold;
264
+ const rowInfo = (p, x, y) => { const l = lab[p], s = REG[l][2], d = D[p]; if (l === GOLD && d >= 2 * s) { const rv = (y + nz.n2(x * 0.012, y * 0.03) * 3) / s, row = Math.floor(rv); return [1000 + row, rv - row, s, d - 2 * s]; } const row = Math.floor(d / s); return [row, d / s - row, s, 99]; };
265
+ const CS = 16, GW = Math.ceil(W / CS), GH = Math.ceil(H_ / CS), grid = Array.from({ length: GW * GH }, () => []);
266
+ const SX = [], SY = [], SL = [], SR = [], SW = [], SC = [], SG = [], LT = [], RT = [];
267
+ const near = (x, y, l, row, rad) => { const cx = (x / CS) | 0, cy = (y / CS) | 0; for (let j = cy - 1; j <= cy + 1; j++) for (let i = cx - 1; i <= cx + 1; i++) { if (i < 0 || j < 0 || i >= GW || j >= GH) continue; for (const s of grid[j * GW + i]) if (SL[s] === l && SR[s] === row && (SX[s] - x) ** 2 + (SY[s] - y) ** 2 < rad * rad) return true; } return false; };
268
+ const GOLDS = [[198, 154, 60], [214, 172, 76], [226, 188, 92], [186, 142, 52], [238, 204, 112], [206, 160, 64]];
269
+ for (let y = 0; y < H_; y++) for (let x = 0; x < W; x++) {
270
+ const p = y * W + x; if (td[p * 4] === 255) continue; // never laid in this layer
271
+ const l = lab[p], [row, fr0, s] = rowInfo(p, x, y);
272
+ if (Math.abs(fr0 - 0.5) * s > 0.6) continue;
273
+ const rad = s * (0.82 + 0.3 * rnd()); if (near(x, y, l, row, rad)) continue;
274
+ const i = SX.length; SX.push(x); SY.push(y); SL.push(l); SR.push(row); SW.push(0.88 + 0.26 * rnd());
275
+ const reg = REG[l]; let col;
276
+ if (reg[3] === 'gold') { col = rnd.pick(GOLDS).slice(); if (rnd.chance(0.05)) col = [150, 112, 42]; SG.push(rnd.chance(0.14) ? rnd.range(0, 6.28) : -1); }
277
+ else { const v = 1 + rnd.gauss() * 0.06; col = reg[1].map((c) => H.clamp(c * v + rnd.gauss() * 6, 0, 255)); SG.push(-1); }
278
+ SC.push(col);
279
+ const o = p * 4, kind = td[o + 2], lay = td[o] / 255 * 15, rem = td[o + 1] / 255 * 15;
280
+ LT.push(lay + (kinds[kind] ? kinds[kind](x, y, l) : 0) + rnd() * 0.04); RT.push(rem >= 14.9 ? sceneRem + (x - 60) / 1160 * 0.55 : rem);
281
+ grid[((y / CS) | 0) * GW + ((x / CS) | 0)].push(i);
282
+ }
283
+ const OWN = new Int32Array(N), GRT = new Uint8Array(N), BR = new Float32Array(N), KK = new Float32Array(N), SIN = new Uint8Array(N);
284
+ const Lx = -0.6, Ly = -0.8;
285
+ for (let y = 0; y < H_; y++) { const cy = (y / CS) | 0; for (let x = 0; x < W; x++) {
286
+ const p = y * W + x, l = lab[p], d = D[p]; SIN[p] = d < 1.7 ? 1 : 0;
287
+ if (td[p * 4] === 255) { OWN[p] = -1; continue; }
288
+ const [row, fr, s, zoneEdge] = rowInfo(p, x, y), cx = (x / CS) | 0;
289
+ let b1 = 1e9, b2 = 1e9, i1 = -1, f1 = 1e9, fi = -1;
290
+ for (let j = cy - 1; j <= cy + 1; j++) { if (j < 0 || j >= GH) continue; for (let i = cx - 1; i <= cx + 1; i++) { if (i < 0 || i >= GW) continue; const cell = grid[j * GW + i]; for (let k = 0; k < cell.length; k++) { const sd = cell[k]; if (SL[sd] !== l) continue; const dd = Math.sqrt((SX[sd] - x) ** 2 + (SY[sd] - y) ** 2) * SW[sd]; if (SR[sd] === row) { if (dd < b1) { b2 = b1; b1 = dd; i1 = sd; } else if (dd < b2) b2 = dd; } else if (dd < f1) { f1 = dd; fi = sd; } } } }
291
+ let sameRow = true; if (i1 < 0) { i1 = fi; b1 = f1; sameRow = false; }
292
+ OWN[p] = i1; if (i1 < 0) { GRT[p] = 1; BR[p] = 0.85; continue; }
293
+ const edge = Math.min(sameRow ? Math.min(fr, 1 - fr) * s : 99, (b2 - b1) * 0.5, d, zoneEdge), g = (1.05 + 0.35 * nz.n2(x * 0.3, y * 0.3)) * (s < 8 ? 0.5 + 0.5 * (s - 5) / 3 : 1);
294
+ if (edge < g) { GRT[p] = 1; BR[p] = 0.75 + 0.2 * nz.n2(x * 0.5, y * 0.5) + 0.1 * (edge / g); continue; }
295
+ let vx = x - SX[i1], vy = y - SY[i1]; const vm = Math.hypot(vx, vy) || 1; vx /= vm; vy /= vm;
296
+ const k = H.clamp(1 - (edge - g) / 2.6);
297
+ BR[p] = (1 + k * k * (vx * Lx + vy * Ly) * 0.3 - k * 0.06 + nz.n2(x * 0.7, y * 0.7) * 0.03) * (0.94 + 0.12 * ((SX[i1] * 7.13 + SY[i1] * 3.71) % 1)); KK[p] = k;
298
+ } }
299
+ // wet lime setting bed: cloudy putty, trowel drag marks and grains of sand aggregate
300
+ if (!MX_BED || MX_BED.length !== N) { MX_BED = new Float32Array(N); const BED = MX_BED, br = H.rng(907);
301
+ for (let p = 0; p < N; p++) { const x = p % W, y = (p / W) | 0, tr = nz.n2(x * 0.004 + y * 0.011, y * 0.05 - x * 0.012);
302
+ let v = 0.88 + 0.07 * nz.n2(x * 0.06, y * 0.06) + 0.05 * nz.n2(x * 0.5, y * 0.5) + 0.04 * Math.sin(tr * 9 + y * 0.35) * (0.5 + 0.5 * nz.n2(x * 0.02, y * 0.02));
303
+ const g = br(); if (g < 0.03) v -= 0.14 + 0.1 * br(); else if (g > 0.985) v += 0.08; BED[p] = v; } }
304
+ const BED = MX_BED;
305
+ return (MX_SCENES[id] = { OWN, GRT, BR, KK, SIN, BED, SC, SG, LT: Float32Array.from(LT), RT: Float32Array.from(RT) });
306
+ }
307
+ // composite one or more scenes (newest first) into the frame
308
+ function mxRender(ctx, W, H_, scenes, t, sinS) {
309
+ const img = ctx.createImageData(W, H_), out = img.data, N = W * H_, top = sinS || scenes[0];
310
+ for (let p = 0; p < N; p++) {
311
+ const o = p * 4; out[o + 3] = 255; let done = false;
312
+ for (let s = 0; s < scenes.length && !done; s++) {
313
+ const S = scenes[s], i = S.OWN[p];
314
+ if (i < 0 || t < S.LT[i] || t >= S.RT[i]) continue;
315
+ done = true;
316
+ const age = t - S.LT[i], wet = age < 0.2 ? (1 - age / 0.2) * 0.15 : 0;
317
+ if (S.GRT[p]) { const g = S.BR[p] - wet * 0.6; out[o] = 122 * g; out[o + 1] = 112 * g; out[o + 2] = 96 * g; break; }
318
+ const c = S.SC[i]; let br = S.BR[p] + wet, add = 0;
319
+ if (S.SG[i] >= 0) { const sp = Math.pow(Math.max(0, Math.sin(t * 1.4 + S.SG[i] + (p % W) * 0.004)), 10); add = sp * 120 * (1 - S.KK[p] * 0.5); br += 0.12; }
320
+ out[o] = Math.min(255, c[0] * br + add); out[o + 1] = Math.min(255, c[1] * br + add * 0.92); out[o + 2] = Math.min(255, c[2] * br + add * 0.6);
321
+ }
322
+ if (!done) { const v = top.BED[p]; if (top.SIN[p]) { out[o] = 168 * v; out[o + 1] = 80 * v; out[o + 2] = 56 * v; } else { out[o] = 192 * v; out[o + 1] = 184 * v; out[o + 2] = 164 * v; } }
323
+ }
324
+ ctx.putImageData(img, 0, 0);
325
+ }
326
+ // live tesserae laid on a regular grid (opus tessellatum) for the changing parts: counters, pointers
327
+ function mxGrid(ctx, x0, y0, w, h, cell, drawMask, col, seed) {
328
+ const mw = Math.ceil(w / cell), mh = Math.ceil(h / cell), M = H.layer(mw, mh), m = M.getContext('2d');
329
+ m.scale(1 / cell, 1 / cell); m.translate(-x0, -y0); m.fillStyle = '#fff'; m.strokeStyle = '#fff'; drawMask(m);
330
+ const d = m.getImageData(0, 0, mw, mh).data, r = H.rng(seed), base = H.hex(col);
331
+ for (let j = 0; j < mh; j++) for (let i = 0; i < mw; i++) {
332
+ const a = d[(j * mw + i) * 4 + 3]; const jr = r(); if (a < 110) continue;
333
+ const v = 0.88 + jr * 0.22, x = x0 + i * cell + 0.8 + (r() - 0.5) * 0.8, y = y0 + j * cell + 0.8 + (r() - 0.5) * 0.8, s = cell - 1.8;
334
+ ctx.fillStyle = 'rgb(118,108,92)'; ctx.fillRect(x0 + i * cell, y0 + j * cell, cell, cell);
335
+ ctx.fillStyle = `rgb(${base[0] * v | 0},${base[1] * v | 0},${base[2] * v | 0})`; ctx.fillRect(x, y, s, s);
336
+ ctx.fillStyle = 'rgba(255,255,255,0.22)'; ctx.fillRect(x, y, s, 1.2); ctx.fillRect(x, y, 1.2, s);
337
+ ctx.fillStyle = 'rgba(0,0,0,0.22)'; ctx.fillRect(x, y + s - 1.2, s, 1.2); ctx.fillRect(x + s - 1.2, y, 1.2, s);
338
+ }
339
+ }
340
+ // the icon robot (same cartoon as the still), drawn into a scene at (cx,cy) scale s
341
+ function mxRobot(cx, F, X, Y, s, t0) {
342
+ cx.save(); cx.translate(X, Y); cx.scale(s, s); cx.translate(-640, -300);
343
+ const circ = (x, y, r) => { cx.beginPath(); cx.arc(x, y, r, 0, Math.PI * 2); cx.fill(); };
344
+ F('haloRing', t0, 15, 2); circ(640, 292, 202); F('haloInner', t0, 15, 2); circ(640, 292, 190); F('halo', t0, 15, 2); circ(640, 292, 179);
345
+ [[536, 296], [744, 296]].forEach(([x, y]) => { F('outline', t0, 15, 2); circ(x, y, 25); F('copper', t0, 15, 2); circ(x, y, 18); F('outline', t0, 15, 2); circ(x, y, 6); });
346
+ F('outline', t0, 15, 2); cx.lineWidth = 10; cx.lineCap = 'round'; cx.beginPath(); cx.moveTo(640, 190); cx.lineTo(640, 132); cx.stroke(); circ(640, 124, 22); F('red', t0, 15, 2); circ(640, 124, 15);
347
+ F('outline', t0, 15, 2); cx.beginPath(); cx.roundRect(531, 173, 218, 232, 65); cx.fill();
348
+ F('face', t0, 15, 2); cx.beginPath(); cx.roundRect(540, 182, 200, 214, 56); cx.fill();
349
+ F('faceShade', t0, 15, 2); cx.save(); cx.beginPath(); cx.roundRect(540, 182, 200, 214, 56); cx.clip(); cx.beginPath(); cx.moveTo(690, 170); cx.bezierCurveTo(740, 250, 740, 330, 680, 410); cx.lineTo(760, 410); cx.lineTo(760, 170); cx.closePath(); cx.fill(); cx.restore();
350
+ F('outline', t0, 15, 2); cx.lineWidth = 9; [[560, 236, 624, 228], [656, 228, 720, 236]].forEach(([a, b, c2, d]) => { cx.beginPath(); cx.moveTo(a, b); cx.quadraticCurveTo((a + c2) / 2, b - 16, c2, d); cx.stroke(); });
351
+ [[594, 280], [686, 280]].forEach(([x, y]) => { F('outline', t0, 15, 2); circ(x, y, 33); F('eyeWhite', t0, 15, 2); circ(x, y, 26); F('eyeGlow', t0, 15, 2); circ(x, y, 18); F('pupil', t0, 15, 2); circ(x, y, 8); });
352
+ F('outline', t0, 15, 2); cx.beginPath(); cx.moveTo(606, 360); cx.quadraticCurveTo(640, 370, 674, 360); cx.stroke();
353
+ cx.restore();
354
+ }
355
+ function mxFrame(cx, F, lay, rem, kind) {
356
+ F('bDark', lay, rem, kind); cx.fillRect(0, 0, 1280, 720); F('bBand', lay, rem, kind); cx.fillRect(14, 14, 1252, 692);
357
+ F('lozenge', lay, rem, kind); const loz = (x, y) => { cx.beginPath(); cx.moveTo(x - 22, y); cx.lineTo(x, y - 12); cx.lineTo(x + 22, y); cx.lineTo(x, y + 12); cx.closePath(); cx.fill(); };
358
+ for (let x = 50; x < 1260; x += 64) { loz(x, 33); loz(x, 687); }
359
+ F('bInner', lay, rem, kind); cx.fillRect(48, 48, 1184, 624); F('gold', lay, rem, kind); cx.fillRect(56, 56, 1168, 608);
360
+ }
361
+ // lettering for tessellation: fitted to its plaque (maxW), strokes thickened so every stem spans >= 2 tile rows,
362
+ // and (on the gold ground) a contour of pale tesserae around the letters, as in real inscriptions
363
+ function mxText(cx, F, txt, x, y, size, name, lay, rem = 15, kind = 0, align = 'center', maxW = 0, halo = false) {
364
+ cx.font = `700 ${size}px "Libre Baskerville"`;
365
+ if (maxW) { const w = cx.measureText(txt).width; if (w > maxW) { size = Math.max(30, size * maxW / w); cx.font = `700 ${size}px "Libre Baskerville"`; } }
366
+ cx.textAlign = align; cx.textBaseline = 'middle'; cx.lineJoin = 'round'; cx.lineCap = 'round';
367
+ if (halo) { F('cream', lay, rem, kind); cx.lineWidth = Math.max(16, size * 0.2); cx.strokeText(txt, x, y); }
368
+ F(name === 'letters' ? 'txt' : name, lay, rem, kind); cx.lineWidth = Math.min(4.6, size * (size < 40 ? 0.045 : 0.065)); cx.strokeText(txt, x, y); cx.fillText(txt, x, y);
369
+ }
370
+ function mxPlaque(cx, F, x, y, w, h, lay, rem = 15, kind = 0) { F('ink', lay, rem, kind); cx.beginPath(); cx.roundRect(x - 6, y - 6, w + 12, h + 12, 14); cx.fill(); F('cream', lay, rem, kind); cx.beginPath(); cx.roundRect(x, y, w, h, 10); cx.fill(); }
371
+ function mxArrow(cx, F, pts, w, name, lay, rem = 15, kind = 1) {
372
+ F(name, lay, rem, kind); cx.lineWidth = w; cx.lineCap = 'round'; cx.lineJoin = 'round'; cx.beginPath(); pts.forEach((p, i) => i ? cx.lineTo(p[0], p[1]) : cx.moveTo(p[0], p[1])); cx.stroke();
373
+ const a = pts[pts.length - 1], b = pts[pts.length - 2], an = Math.atan2(a[1] - b[1], a[0] - b[0]);
374
+ cx.beginPath(); cx.moveTo(a[0] + Math.cos(an) * w * 1.6, a[1] + Math.sin(an) * w * 1.6); cx.lineTo(a[0] + Math.cos(an + 2.3) * w * 2, a[1] + Math.sin(an + 2.3) * w * 2); cx.lineTo(a[0] + Math.cos(an - 2.3) * w * 2, a[1] + Math.sin(an - 2.3) * w * 2); cx.closePath(); cx.fill();
375
+ }
376
+ const mxQ = (a, m, b, n = 24) => { const o = []; for (let k = 0; k <= n; k++) { const t = k / n, u = 1 - t; o.push([u * u * a[0] + 2 * u * t * m[0] + t * t * b[0], u * u * a[1] + 2 * u * t * m[1] + t * t * b[1]]); } return o; };
377
+ function mxAnimal(cx, F, x, y, s, isCat, lay, rem = 15) {
378
+ const circ = (a, b, r) => { cx.beginPath(); cx.arc(a, b, r, 0, Math.PI * 2); cx.fill(); };
379
+ cx.save(); cx.translate(x, y); cx.scale(s, s);
380
+ if (isCat) { F('outline', lay, rem); cx.beginPath(); cx.moveTo(-40, -6); cx.lineTo(-34, -56); cx.lineTo(-8, -34); cx.lineTo(8, -34); cx.lineTo(34, -56); cx.lineTo(40, -6); cx.arc(0, 0, 40, 0, Math.PI); cx.closePath(); cx.fill(); F('tan', lay, rem); cx.beginPath(); cx.moveTo(-32, -6); cx.lineTo(-29, -42); cx.lineTo(-8, -26); cx.lineTo(8, -26); cx.lineTo(29, -42); cx.lineTo(32, -6); cx.arc(0, 0, 32, 0, Math.PI); cx.closePath(); cx.fill(); }
381
+ else { F('outline', lay, rem); circ(-36, 4, 20); circ(36, 4, 20); circ(0, 0, 42); F('brown', lay, rem); cx.beginPath(); cx.ellipse(-36, 8, 12, 24, 0.2, 0, 7); cx.fill(); cx.beginPath(); cx.ellipse(36, 8, 12, 24, -0.2, 0, 7); cx.fill(); F('tan', lay, rem); circ(0, 0, 34); F('cream', lay, rem); cx.beginPath(); cx.ellipse(0, 16, 16, 12, 0, 0, 7); cx.fill(); }
382
+ F('pupil', lay, rem); circ(-13, -2, 6); circ(13, -2, 6); circ(0, isCat ? 12 : 10, 5);
383
+ cx.restore();
384
+ }
385
+
386
+ // ===== END EXPLAINER HELPERS =====
387
+ registerStyle({
388
+ id: 'mosaic',
389
+ name: 'Byzantine Mosaic',
390
+ category: 'Illustration',
391
+ description: 'A Byzantine wall mosaic built from thousands of hand-cut tesserae laid in rows that echo every contour (andamento), with mortar grout, bevelled tile edges, per-tile colour variation and a glinting gold-smalti ground.',
392
+ motion: 'Light rakes across the wall so individual gold smalti flash in turn; tiles could be laid row by row outward from the figure.',
393
+ fonts: ['600 120px "Cormorant Garamond"', '700 46px "Libre Baskerville"', '700 72px "Cormorant Garamond"'],
394
+ frameT: 5.4,
395
+ duration: 5.5,
396
+ readsPixels: true,
397
+ draw(ctx, W, H_, t) {
398
+ if (!CACHE) CACHE = build(W, H_);
399
+ const { OWN, GRT, BR, KK, BED, SIN, LT, SC, SG } = CACHE;
400
+ const img = ctx.createImageData(W, H_), out = img.data;
401
+ for (let p = 0, N = W * H_; p < N; p++) {
402
+ const i = OWN[p], o = p * 4; out[o + 3] = 255;
403
+ if (i < 0 || t < LT[i]) {
404
+ // bare lime setting bed with the red-ochre sinopia underdrawing
405
+ const v = BED[p];
406
+ if (SIN[p]) { out[o] = 168 * v; out[o + 1] = 84 * v; out[o + 2] = 58 * v; }
407
+ else { out[o] = 206 * v; out[o + 1] = 194 * v; out[o + 2] = 170 * v; }
408
+ continue;
409
+ }
410
+ const age = t - LT[i], wet = age < 0.2 ? (1 - age / 0.2) * 0.3 : 0;
411
+ if (GRT[p]) { const g = BR[p] - wet * 0.3; out[o] = 122 * g; out[o + 1] = 112 * g; out[o + 2] = 96 * g; continue; }
412
+ const c = SC[i], k = KK[p];
413
+ let br = BR[p] + wet, add = 0;
414
+ if (SG[i] >= 0) { const sp = Math.pow(Math.max(0, Math.sin(t * 1.4 + SG[i] + (p % W) * 0.004)), 10); add = sp * 120 * (1 - k * 0.5); br += 0.12; }
415
+ out[o] = Math.min(255, c[0] * br + add); out[o + 1] = Math.min(255, c[1] * br + add * 0.92); out[o + 2] = Math.min(255, c[2] * br + add * 0.6);
416
+ }
417
+ ctx.putImageData(img, 0, 0);
418
+ // raking light across the wall + vignette
419
+ const lg = ctx.createLinearGradient(0, 0, W, H_); lg.addColorStop(0, 'rgba(255,240,200,0.10)'); lg.addColorStop(0.6, 'rgba(0,0,0,0)'); lg.addColorStop(1, 'rgba(20,10,0,0.18)');
420
+ ctx.fillStyle = lg; ctx.fillRect(0, 0, W, H_);
421
+ H.vignette(ctx, W, H_, 0.42);
422
+ H.grain(ctx, W, H_, 0.035, 2 + Math.floor(t * 12));
423
+ },
424
+ // ===== EXPLAINER =====
425
+ explainerDuration: 14.5,
426
+ explainerNote: 'Every scene is a fresh andamento-tessellated wall: tiles are laid element by element (arrows tile by tile along their length), scene changes pry the old tesserae up and re-lay the wall in a sweeping front, counters are live tesserae re-set on a grid, and gold smalti flash on the key moments.',
427
+ explainer(ctx, W, H_, t) {
428
+ const cl = H.clamp, ease = H.ease.inOut;
429
+ const kinds = [null, (x) => (x - 60) / 1160 * 0.7, (x, y) => Math.hypot(x - 980, y - 330) / 260 * 0.45, (x, y) => (720 - y) / 720 * 0.5, (x) => (x - 60) / 1160 * 0.25];
430
+ // ---- scene 1: question, then examples -> model ----
431
+ const S0 = () => mxScene('s0', W, H_, (cx, F) => {
432
+ mxFrame(cx, F, 0, 15, 1);
433
+ mxText(cx, F, 'How does', 640, 290, 112, 'letters', 0.3, 1.95, 1, 'center', 0, true); mxText(cx, F, 'AI learn?', 640, 430, 112, 'letters', 0.7, 1.95, 1, 'center', 0, true);
434
+ }, kinds);
435
+ const S1 = () => mxScene('s1', W, H_, (cx, F) => {
436
+ mxFrame(cx, F, 2.0, 15, 1);
437
+ mxPlaque(cx, F, 70, 66, 440, 70, 2.0, 15, 4); mxText(cx, F, 'How does AI learn?', 290, 101, 46, 'letters', 2.15, 15, 4, 'center', 410);
438
+ // example cards
439
+ for (let i = 0; i < 6; i++) {
440
+ const x = 90 + (i % 3) * 140, y = 170 + Math.floor(i / 3) * 190, lay = 2.45 + i * 0.22, isCat = [1, 0, 1, 0, 1, 1][i];
441
+ mxPlaque(cx, F, x, y, 124, 166, lay); mxAnimal(cx, F, x + 62, y + 66, 0.95, !!isCat, lay + 0.05); mxText(cx, F, isCat ? 'cat' : 'dog', x + 62, y + 138, 36, 'letters', lay + 0.1);
442
+ }
443
+ mxArrow(cx, F, mxQ([520, 300], [640, 220], [740, 300]), 18, 'red', 3.6, 15, 1);
444
+ mxArrow(cx, F, mxQ([520, 440], [640, 470], [740, 400]), 18, 'red', 3.9, 15, 1);
445
+ mxRobot(cx, F, 980, 330, 0.95, 2.6);
446
+ mxPlaque(cx, F, 870, 560, 220, 70, 3.0); mxText(cx, F, 'MODEL', 980, 596, 50, 'letters', 3.1, 15, 0, 'center', 196);
447
+ mxPlaque(cx, F, 90, 568, 700, 84, 3.2); mxText(cx, F, 'examples', 770, 610, 46, 'letters', 3.3, 15, 0, 'right');
448
+ }, kinds, 6.0);
449
+ // ---- scene 2: guess -> check -> adjust ----
450
+ const S2 = () => mxScene('s2', W, H_, (cx, F) => {
451
+ mxFrame(cx, F, 6.05, 15, 1);
452
+ mxPlaque(cx, F, 70, 66, 440, 70, 6.1, 15, 1); mxText(cx, F, 'How does AI learn?', 290, 101, 46, 'letters', 6.2, 15, 1, 'center', 410);
453
+ mxPlaque(cx, F, 80, 240, 190, 210, 6.4); mxAnimal(cx, F, 175, 330, 1.25, true, 6.45); mxText(cx, F, 'new picture', 175, 486, 30, 'letters', 6.6, 15, 0, 'center', 0, true);
454
+ mxArrow(cx, F, mxQ([285, 340], [320, 300], [355, 330]), 16, 'red', 6.7, 15, 1);
455
+ mxRobot(cx, F, 520, 350, 0.7, 6.5);
456
+ mxText(cx, F, 'GUESS', 520, 172, 52, 'letters', 6.9, 15, 0, 'center', 0, true);
457
+ mxPlaque(cx, F, 660, 210, 190, 90, 7.0); F('cream', 7.0, 9.3); cx.beginPath(); cx.roundRect(660, 210, 190, 90, 10); cx.fill(); mxText(cx, F, 'dog?', 755, 256, 60, 'letters', 7.05, 9.3, 0, 'center', 170);
458
+ // ("cat" + tick live in S2b, so the label map keeps "dog?" whole under the cross)
459
+ // wrong-guess cross
460
+ F('ink', 7.8, 9.3, 0); cx.lineWidth = 11; cx.lineCap = 'round'; cx.beginPath(); cx.moveTo(680, 220); cx.lineTo(830, 292); cx.moveTo(830, 220); cx.lineTo(680, 292); cx.stroke();
461
+ mxArrow(cx, F, mxQ([860, 250], [900, 200], [940, 240]), 16, 'red', 7.35, 15, 1);
462
+ mxText(cx, F, 'CHECK', 1080, 172, 52, 'letters', 7.4, 15, 0, 'center', 0, true);
463
+ mxPlaque(cx, F, 950, 210, 250, 120, 7.5); mxText(cx, F, 'answer:', 1075, 245, 34, 'letters', 7.55, 15, 0, 'center', 230); mxText(cx, F, 'cat', 1075, 295, 52, 'green', 7.65);
464
+ mxArrow(cx, F, mxQ([1080, 345], [1090, 520], [860, 535]), 16, 'red', 8.2, 15, 1);
465
+ mxText(cx, F, 'error', 1150, 450, 40, 'txt', 8.4, 15, 0, 'center', 0, true);
466
+ [[520, 530], [650, 545], [780, 530]].forEach(([x, y], i) => { F('ink', 8.4 + i * 0.08); cx.beginPath(); cx.arc(x, y, 52, 0, 7); cx.fill(); F('cream', 8.45 + i * 0.08); cx.beginPath(); cx.arc(x, y, 44, 0, 7); cx.fill(); });
467
+ mxText(cx, F, 'ADJUST', 650, 630, 42, 'letters', 8.6, 15, 0, 'center', 0, true);
468
+ mxArrow(cx, F, mxQ([450, 545], [350, 540], [420, 470]), 16, 'red', 9.05, 15, 1);
469
+ }, kinds, 10.35);
470
+ // the corrected answer: the dog? plaque re-laid underneath with "cat" + tick (nothing else in this layer is ever laid)
471
+ const S2b = () => mxScene('s2b', W, H_, (cx, F) => {
472
+ F('gold', 15); cx.fillRect(0, 0, W, H_);
473
+ F('cream', 7.0); cx.beginPath(); cx.roundRect(660, 210, 190, 90, 10); cx.fill();
474
+ mxText(cx, F, 'cat', 735, 256, 60, 'green', 9.35); F('green', 9.5); cx.lineWidth = 12; cx.lineCap = 'round'; cx.beginPath(); cx.moveTo(790, 254); cx.lineTo(806, 272); cx.lineTo(836, 232); cx.stroke();
475
+ }, kinds, 10.35);
476
+ // ---- scene 3: accuracy over rounds + takeaway ----
477
+ const accs = [61, 70, 78, 84, 89, 93, 95, 97];
478
+ const S3 = () => mxScene('s3', W, H_, (cx, F) => {
479
+ mxFrame(cx, F, 10.4, 15, 1);
480
+ mxPlaque(cx, F, 70, 66, 440, 70, 10.45, 15, 1); mxText(cx, F, 'How does AI learn?', 290, 101, 46, 'letters', 10.55, 15, 1, 'center', 410);
481
+ F('ink', 10.7); cx.fillRect(100, 576, 600, 12); cx.fillRect(100, 150, 12, 438);
482
+ accs.forEach((a, i) => { const h = (a - 50) / 50 * 400, x = 130 + i * 70; F(i === 7 ? 'red' : 'robeLight', 10.95 + i * 0.18, 15, 3); cx.fillRect(x, 576 - h, 50, h); });
483
+ mxText(cx, F, 'training rounds →', 400, 622, 32, 'letters', 11.0, 15, 0, 'center', 0, true);
484
+ mxPlaque(cx, F, 770, 150, 420, 250, 10.9); mxText(cx, F, 'Accuracy', 980, 200, 50, 'letters', 11.0, 15, 0, 'center', 390);
485
+ mxPlaque(cx, F, 770, 440, 420, 180, 13.0, 15, 4); mxText(cx, F, 'More examples →', 980, 495, 46, 'letters', 13.05, 15, 4, 'center', 390); mxText(cx, F, 'better guesses', 980, 565, 46, 'letters', 13.2, 15, 4, 'center', 390);
486
+ }, kinds);
487
+ const list = t < 2.8 ? [S1(), S0()] : t < 6.0 ? [S1()] : t < 10.4 ? [S2(), S2b(), S1()] : [S3(), S2(), S2b()];
488
+ mxRender(ctx, W, H_, list, t, t < 2.8 ? list[1] : list[0]);
489
+ // ---- live tesserae ----
490
+ if (t > 3.3 && t < 6.2) {
491
+ const e = ease(cl((t - 3.3) / 2.5)), v = t >= 5.8 ? 1000000 : Math.round(Math.pow(10, 1 + 5 * e));
492
+ mxGrid(ctx, 110, 572, 470, 76, 6, (m) => { m.font = '700 66px "Libre Baskerville"'; m.textAlign = 'left'; m.textBaseline = 'middle'; m.lineWidth = 2.5; m.lineJoin = 'round'; m.strokeText(v.toLocaleString('en-US'), 118, 614); m.fillText(v.toLocaleString('en-US'), 118, 614); }, '#7c1e1a', Math.floor(t * 12));
493
+ }
494
+ if (t > 8.5 && t < 10.4) {
495
+ const tq = Math.floor(t * 12) / 12;
496
+ [[520, 530], [650, 545], [780, 530]].forEach(([x, y], i) => { const a0 = [-2.2, -0.6, -1.5][i], a1 = [-0.9, -2.3, -0.4][i], a = a0 + (a1 - a0) * ease(cl((tq - 8.7 - i * 0.12) / 0.6)); mxGrid(ctx, x - 48, y - 48, 96, 96, 6, (m) => { m.lineWidth = 12; m.lineCap = 'round'; m.beginPath(); m.moveTo(x, y); m.lineTo(x + Math.cos(a) * 38, y + Math.sin(a) * 38); m.stroke(); m.beginPath(); m.arc(x, y, 8, 0, 7); m.fill(); }, '#2a2a34', 40 + i); });
497
+ }
498
+ if (t > 10.9) {
499
+ const pr = cl((t - 10.95) / 1.5), v = Math.round(61 + 36 * (1 - Math.pow(1 - pr, 2.3))), pop = t > 12.5 ? 1 + 0.15 * Math.pow(1 - cl((t - 12.5) / 0.3), 2) : 1;
500
+ mxGrid(ctx, 790, 230, 380, 160, 7, (m) => { m.translate(980, 312); m.scale(pop, pop); m.font = '700 112px "Libre Baskerville"'; m.textAlign = 'center'; m.textBaseline = 'middle'; m.lineWidth = 4.5; m.lineJoin = 'round'; m.strokeText(v + '%', 0, 0); m.fillText(v + '%', 0, 0); }, v >= 97 ? '#1f6a34' : '#7c1e1a', 77);
501
+ }
502
+ // emphasis: gold flash on the wrong guess and on 97%
503
+ const flash = (x, y, R, a) => { if (a <= 0) return; ctx.save(); ctx.globalCompositeOperation = 'screen'; const g = ctx.createRadialGradient(x, y, 0, x, y, R); g.addColorStop(0, `rgba(255,220,140,${0.5 * a})`); g.addColorStop(1, 'rgba(255,220,140,0)'); ctx.fillStyle = g; ctx.fillRect(x - R, y - R, 2 * R, 2 * R); ctx.restore(); };
504
+ flash(755, 256, 220, cl((t - 7.8) / 0.15) * (1 - cl((t - 8.3) / 0.4)));
505
+ flash(980, 312, 300, cl((t - 12.5) / 0.15) * (1 - cl((t - 13.1) / 0.5)));
506
+ // same raking light across the wall as the still
507
+ const lg = ctx.createLinearGradient(0, 0, W, H_); lg.addColorStop(0, 'rgba(255,240,200,0.10)'); lg.addColorStop(0.6, 'rgba(0,0,0,0)'); lg.addColorStop(1, 'rgba(20,10,0,0.18)');
508
+ ctx.fillStyle = lg; ctx.fillRect(0, 0, W, H_);
509
+ H.vignette(ctx, W, H_, 0.42);
510
+ H.grain(ctx, W, H_, 0.035, 2 + Math.floor(t * 12));
511
+ },
512
+ // Sound: a mosaicist's workshop with a little stone-room reverb. Tesserae are small stone/glass chips: laying a
513
+ // sweeping front is a pattering cascade of dry clacks over a soft trowel smear in the mortar (panned with the
514
+ // front); an element set all at once is a handful pressed in (a cluster + a dull thunk); prying a scene up is a
515
+ // chisel scrape with chips clattering loose. The live counters re-set tiles with single clacks. No high pings.
516
+ // Times from explainer()/mxScene above: lay times are stored as 8-bit values of t/15, so a lay time v really
517
+ // starts at q(v); sweep kinds add (x-60)/1160*0.7 (kind 1), dist/260*0.45 from (980,330) (kind 2),
518
+ // (720-y)/720*0.5 (kind 3), (x-60)/1160*0.25 (kind 4); a scene is pried up from sceneRem over (x-60)/1160*0.55.
519
+ explainerSound(k) {
520
+ // Chrome glitch: a noise buffer that starts within ~1e-8 s of a sample boundary (float error like 4.15 + 0.1 * 1 + 0.11)
521
+ // spikes far above its gain. Put every start a quarter sample past the 48 kHz grid so none land there.
522
+ { const k0 = k, sn = (t) => (Math.round(t * 48000) + 0.25) / 48000; k = { ...k0, play: (n, t, o) => k0.play(n, sn(t), o), tone: (t, o) => k0.tone(sn(t), o), noise: (t, o) => k0.noise(sn(t), o) }; }
523
+ const D = 14.5, q = (v) => Math.round(v / 15 * 255) / 255 * 15, s1 = (x) => (x - 60) / 1160 * 0.7, s4 = (x) => (x - 60) / 1160 * 0.25;
524
+ const pan = (x) => H.clamp(x / 640 - 1, -1, 1) * 0.6;
525
+ let seed = 11; const rnd = () => ((seed = (seed * 16807) % 2147483647) / 2147483647);
526
+ // one stone chip clacking into place
527
+ const clack = (t, g, p, f) => { k.noise(t, { dur: 0.014, filter: 'bandpass', f, q: 2.5, gain: 0.32 * g, a: 0.0008, pan: p }); k.noise(t, { dur: 0.022, filter: 'bandpass', f: f * 0.38, q: 3, gain: 0.24 * g, a: 0.001, pan: p }); };
528
+ // a sweeping front of tiles laid over [t0, t0+d] from x0 to x1: n clacks + trowel smear in the mortar
529
+ const lay = (t0, d, x0, x1, n, g = 1, minor = true) => {
530
+ const run = () => {
531
+ for (let i = 0; i < n; i++) { const u = (i + rnd() * 0.8) / n; clack(t0 + d * u, g * (0.55 + 0.5 * rnd()), pan(x0 + (x1 - x0) * u), 1500 + rnd() * 1300); }
532
+ k.noise(t0, { dur: d + 0.05, color: 'pink', filter: 'bandpass', f: 480, q: 0.8, gain: 0.07 * g, a: Math.min(0.08, d * 0.3), hold: d * 0.5, pan: pan((x0 + x1) / 2) });
533
+ };
534
+ if (minor) k.withMinor(run); else run(); // key moments stay full in voiceover mode
535
+ };
536
+ // an element pressed in all at once: a handful of chips + a dull thunk
537
+ const set = (t, x, g = 1, minor = true) => {
538
+ const run = () => { for (let i = 0; i < 4; i++) clack(t + i * 0.009 + rnd() * 0.006, g * (0.6 + 0.4 * rnd()), pan(x) + (rnd() - 0.5) * 0.2, 1500 + rnd() * 1100); k.tone(t, { f: [[0, 190], [0.05, 110]], dur: 0.07, gain: 0.12 * g, pan: pan(x) }); };
539
+ if (minor) k.withMinor(run); else run();
540
+ };
541
+ // a scene pried up left to right: chisel scrape + loose chips
542
+ const pry = (t0, d) => {
543
+ k.noise(t0, { dur: d, filter: 'bandpass', f: [[0, 900], [d, 1400]], q: 1.6, gain: 0.12, a: 0.06, hold: d * 0.5, pan: 0 });
544
+ for (let i = 0; i < 10; i++) { const u = (i + rnd()) / 10; clack(t0 + d * u, 0.5 + 0.3 * rnd(), pan(60 + 1160 * u), 1300 + rnd() * 900); }
545
+ };
546
+
547
+ k.bed('room', 0, D, { gain: 0.4 });
548
+
549
+ // ---- scene 0: the gold field is laid L -> R (0 -> 0.7), then the two lines of letters
550
+ lay(0, 0.7, 60, 1220, 26, 0.9, false);
551
+ lay(q(0.3) + s1(400), s1(880) - s1(400), 400, 880, 10, 1.1); // "How does"
552
+ lay(q(0.7) + s1(430), s1(850) - s1(430), 430, 850, 10, 1.2, false); // "AI learn?"
553
+ // the letters are prised out at once (1.94), then scene 1 is laid over it L -> R (2.0 -> 2.7)
554
+ k.noise(q(1.95), { dur: 0.12, filter: 'bandpass', f: 1100, q: 1.4, gain: 0.14 }); set(q(1.95), 640, 0.9, false);
555
+ lay(q(2.0), 0.7, 60, 1220, 22, 0.8);
556
+ lay(q(2.0), 0.1, 70, 510, 3, 0.7); lay(q(2.15) + 0.02, 0.07, 150, 430, 3, 0.6); // header plaque + text
557
+ // six example cards pressed in (2.45 + i*0.22), their animals (+0.05) and labels (+0.1)
558
+ for (let i = 0; i < 6; i++) { const x = 152 + (i % 3) * 140; set(q(2.45 + i * 0.22), x, 0.9); set(q(2.5 + i * 0.22) + 0.01, x, 0.5); }
559
+ lay(q(2.6), 0.42, 900, 1060, 9, 0.8); // the robot radiates out from its centre
560
+ set(q(3.0), 980, 0.8); set(q(3.1), 980, 0.6); set(q(3.2), 440, 0.8); set(q(3.3), 700, 0.6); // MODEL + examples plaques
561
+ lay(q(3.6) + s1(520), s1(740) - s1(520), 520, 740, 5, 0.9); lay(q(3.9) + s1(520), s1(740) - s1(520), 520, 740, 5, 0.9); // red arrows
562
+ // live counter 10 -> 1,000,000 (3.3 -> 5.8): one clack per tile re-set while it runs, faster mid-count
563
+ for (let t = 3.36; t < 5.75;) { const e = H.clamp((t - 3.3) / 2.5), sp = Math.min(1, 6 * e * (1 - e)); clack(t, 0.5 + 0.35 * sp, pan(340), 1700 + e * 500); t += 1 / (4 + 8 * sp); }
564
+ set(5.8, 340, 1.4, false); k.play('thud', 5.8, { f: 130, gain: 0.35, pan: pan(340) }); // 1,000,000 set
565
+
566
+ // ---- scene 1 pried up (6.0 -> 6.55) while scene 2's field is laid (6.06 -> 6.76)
567
+ pry(6.0, 0.55);
568
+ lay(q(6.05), 0.7, 60, 1220, 20, 0.7);
569
+ lay(q(6.1) + 0.002, 0.27, 70, 510, 5, 0.6); // header
570
+ set(q(6.4), 175, 0.9); set(q(6.45), 175, 0.6); set(q(6.6), 175, 0.5); // new picture
571
+ lay(q(6.7) + s1(285), 0.05, 285, 355, 3, 0.8); // arrow
572
+ lay(q(6.5) + 0.62, 0.35, 420, 620, 8, 0.7); // the robot (radiates from far right, so it fills in late)
573
+ set(q(6.9), 520, 0.7); set(q(7.0), 755, 0.9); set(q(7.05), 755, 0.8); // GUESS, plaque, "dog?"
574
+ set(q(7.4), 1080, 0.7); set(q(7.5), 1075, 0.8); set(q(7.55), 1075, 0.5); set(q(7.65), 1075, 0.7); // CHECK, answer: cat
575
+ // WRONG: the dark cross is set over "dog?" with a gold flash (7.77)
576
+ set(q(7.8), 755, 1.6, false);
577
+ k.play('thud', q(7.8), { f: 100, gain: 0.55, pan: pan(755) });
578
+ k.play('error', q(7.8), { f: 'E3', gain: 0.45, pan: pan(755) });
579
+ k.noise(7.8, { dur: 0.5, color: 'pink', filter: 'bandpass', f: 1100, q: 4, gain: 0.05, a: 0.1, verb: 0.4, pan: pan(755), minor: true }); // the gold glints
580
+ lay(q(7.35) + s1(860), s1(940) - s1(860), 860, 940, 3, 0.7); // CHECK arrow finishes just after
581
+ lay(q(8.2) + s1(860), s1(1090) - s1(860), 860, 1090, 6, 0.8); // error arrow back
582
+ set(q(8.4), 1150, 0.5); // 'error'
583
+ [8.4, 8.48, 8.56].forEach((t0, i) => set(q(t0), [520, 650, 780][i], 0.75)); set(q(8.6), 650, 0.6); // dials + ADJUST
584
+ // dial needles turn on twos (8.7 + i*0.12, 0.6 s each): one clack per moving frame
585
+ for (let f = Math.floor(8.7 * 12) + 1; f / 12 < 9.45; f++) clack(f / 12, 0.6, pan([520, 650, 780][f % 3]), 1300 + (f % 3) * 200);
586
+ lay(q(9.05) + s1(350), 0.06, 350, 450, 3, 0.8); // arrow back to the guess
587
+ // CORRECTION: "dog?" and the cross prised out (9.29), "cat" set (9.35), green tick (9.53)
588
+ k.noise(q(9.3), { dur: 0.1, filter: 'bandpass', f: 1100, q: 1.4, gain: 0.12, pan: pan(755) });
589
+ set(q(9.35), 735, 1.1, false); set(q(9.5), 813, 1.1, false);
590
+ k.play('success', q(9.5), { f: 'G4', gain: 0.6, pan: pan(780) });
591
+
592
+ // ---- scene 2 pried up (10.35 -> 10.9), scene 3 laid (10.41 -> 11.11)
593
+ pry(10.35, 0.55);
594
+ lay(q(10.4), 0.7, 60, 1220, 20, 0.7);
595
+ set(q(10.7), 150, 0.8); set(q(10.9), 980, 0.8); set(q(11.0), 980, 0.5); // axes, Accuracy plaque + label
596
+ // eight bars rise bottom-up (q(10.95 + 0.18i) + 0.1 .. + h/720*0.5)
597
+ [61, 70, 78, 84, 89, 93, 95, 97].forEach((a, i) => { const h = (a - 50) / 50 * 400; lay(q(10.95 + i * 0.18) + 0.1, h / 720 * 0.5, 155 + i * 70, 155 + i * 70, 3 + Math.round(h / 120), i === 7 ? 1.1 : 0.8); });
598
+ { let last = 61, lastT = -1; // accuracy tiles re-set per new value, <= 12/s (reaches 97 near 12.22)
599
+ for (let t = 10.95; t < 12.45; t += 1 / 120) { const v = Math.round(61 + 36 * (1 - Math.pow(1 - H.clamp((t - 10.95) / 1.5), 2.3))); if (v !== last && t - lastT >= 1 / 12) { clack(t, 0.7, pan(980), 1500 + (v - 61) * 15); last = v; lastT = t; } } }
600
+ // 97% pops with a gold flash (12.5): the big hit
601
+ k.play('impact', 12.5, { gain: 1.05, pan: pan(980) });
602
+ set(12.5, 980, 1.6, false);
603
+ k.play('ding', 12.52, { f: 'C5', gain: 0.45, pan: pan(980) }); k.play('ding', 12.52, { f: 'G4', gain: 0.35, pan: pan(980) });
604
+ // takeaway plaque + two lines laid (13.15 -> 13.4), resolves
605
+ lay(q(13.0) + s4(764), s4(1196) - s4(764), 764, 1196, 6, 0.8);
606
+ lay(q(13.05) + 0.16, 0.07, 800, 1160, 4, 0.8); lay(q(13.2) + 0.16, 0.07, 800, 1160, 4, 0.9, false);
607
+ ['C4', 'G4', 'E5'].forEach((f, i) => k.play('ding', 13.42 + i * 0.1, { f, gain: 0.55 - i * 0.05, pan: pan(980) + (i - 1) * 0.2 }));
608
+ },
609
+
610
+ // ===== END EXPLAINER =====
611
+ });
612
+ }