@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,675 @@
1
+ {
2
+ // ---------- 1984 Macintosh / MacPaint: 640x360 1-bit buffer, pixel-doubled to 1280x720 ----------
3
+ const SW = 640, SH = 360;
4
+ const PAT = [ // classic 8x8 MacPaint-style fill patterns (rows as bytes)
5
+ [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], [0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd], [0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55],
6
+ [0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22], [0x80, 0x00, 0x08, 0x00, 0x80, 0x00, 0x08, 0x00], [0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00],
7
+ [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80], [0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01], [0xff, 0x80, 0x80, 0x80, 0xff, 0x08, 0x08, 0x08],
8
+ [0x88, 0x54, 0x22, 0x45, 0x88, 0x15, 0x22, 0x51], [0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00], [0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88],
9
+ [0xff, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80], [0x81, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x81], [0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f],
10
+ [0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x81], [0x80, 0x80, 0x41, 0x3e, 0x08, 0x08, 0x14, 0xe3], [0x00, 0x00, 0x88, 0x55, 0x22, 0x00, 0x00, 0x00],
11
+ [0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00], [0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb], [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
12
+ [0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33], [0x08, 0x1c, 0x22, 0xc1, 0x80, 0x01, 0x02, 0x04], [0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00],
13
+ [0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88], [0xc0, 0xc0, 0x0c, 0x0c, 0xc0, 0xc0, 0x0c, 0x0c], [0x7f, 0x7f, 0x7f, 0x00, 0xf7, 0xf7, 0xf7, 0x00],
14
+ [0x44, 0xaa, 0x11, 0x11, 0x11, 0xaa, 0x44, 0x44], [0x82, 0x44, 0x39, 0x44, 0x82, 0x01, 0x01, 0x01], [0xf8, 0x74, 0x22, 0x47, 0x8f, 0x17, 0x22, 0x71],
15
+ [0x55, 0xa0, 0x40, 0x40, 0x55, 0x0a, 0x04, 0x04], [0x20, 0x50, 0x88, 0x88, 0x88, 0x88, 0x05, 0x02], [0xbf, 0x00, 0xbf, 0xbf, 0xb0, 0xb0, 0xb0, 0xb0],
16
+ [0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18], [0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff], [0x22, 0x00, 0x88, 0x00, 0x22, 0x00, 0x88, 0x00],
17
+ ];
18
+ const patBit = (p, x, y) => (PAT[p][y & 7] >> (7 - (x & 7))) & 1;
19
+
20
+ // ================= EXPLAINER: "How does AI learn?" told with Finder windows, alerts and MacPaint tools =================
21
+ function macExplainer(ctx, W, H_, t) {
22
+ const B = new Uint8Array(SW * SH);
23
+ const px = (x, y, v = 1) => { x |= 0; y |= 0; if (x >= 0 && y >= 0 && x < SW && y < SH) B[y * SW + x] = v; };
24
+ const inv = (x, y) => { x |= 0; y |= 0; if (x >= 0 && y >= 0 && x < SW && y < SH) B[y * SW + x] ^= 1; };
25
+ const fill = (x, y, w, h, v = 1) => { for (let j = 0; j < h; j++) for (let i = 0; i < w; i++) px(x + i, y + j, v); };
26
+ const pfill = (x, y, w, h, p) => { for (let j = 0; j < h; j++) for (let i = 0; i < w; i++) px(x + i, y + j, patBit(p, x + i, y + j)); };
27
+ const invRect = (x, y, w, h) => { for (let j = 0; j < h; j++) for (let i = 0; i < w; i++) inv(x + i, y + j); };
28
+ const hl = (x0, x1, y, v = 1) => { for (let x = x0; x <= x1; x++) px(x, y, v); };
29
+ const vl = (x, y0, y1, v = 1) => { for (let y = y0; y <= y1; y++) px(x, y, v); };
30
+ const box = (x, y, w, h, v = 1) => { hl(x, x + w - 1, y, v); hl(x, x + w - 1, y + h - 1, v); vl(x, y, y + h - 1, v); vl(x + w - 1, y, y + h - 1, v); };
31
+ const line = (x0, y0, x1, y1, v = 1, dash = 0) => {
32
+ x0 |= 0; y0 |= 0; x1 |= 0; y1 |= 0; let k = 0;
33
+ const dx = Math.abs(x1 - x0), dy = -Math.abs(y1 - y0), sx = x0 < x1 ? 1 : -1, sy = y0 < y1 ? 1 : -1; let e = dx + dy;
34
+ for (;;) { if (!dash || ((k++ / dash) | 0) % 2 === 0) px(x0, y0, v); if (x0 === x1 && y0 === y1) break; const e2 = 2 * e; if (e2 >= dy) { e += dy; x0 += sx; } if (e2 <= dx) { e += dx; y0 += sy; } }
35
+ };
36
+ const thick = (x0, y0, x1, y1, dash = 0) => { line(x0, y0, x1, y1, 1, dash); line(x0 + 1, y0, x1 + 1, y1, 1, dash); line(x0, y0 + 1, x1, y1 + 1, 1, dash); };
37
+ const arrow = (pts, f, dash = 0) => { // polyline drawn on to fraction f, 2px, with head
38
+ let L = 0; for (let i = 1; i < pts.length; i++) L += Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]);
39
+ let left = L * H.clamp(f), ex = pts[0][0], ey = pts[0][1], ang = 0;
40
+ for (let i = 1; i < pts.length && left > 0; i++) {
41
+ const [ax, ay] = pts[i - 1], [bx, by] = pts[i], d = Math.hypot(bx - ax, by - ay), k = Math.min(1, left / d);
42
+ ex = ax + (bx - ax) * k; ey = ay + (by - ay) * k; ang = Math.atan2(by - ay, bx - ax);
43
+ thick(ax, ay, ex, ey, dash); left -= d;
44
+ }
45
+ if (f > 0.05) { for (let s = -1; s <= 1; s += 2) thick(ex, ey, ex + Math.cos(ang + Math.PI - s * 0.5) * 9, ey + Math.sin(ang + Math.PI - s * 0.5) * 9); }
46
+ };
47
+ const oval = (cx, cy, rx, ry, mode) => {
48
+ for (let y = -ry; y <= ry; y++) for (let x = -rx; x <= rx; x++) {
49
+ const d = (x * x) / (rx * rx) + (y * y) / (ry * ry); if (d > 1.02) continue;
50
+ const edge = (x * x) / ((rx - 1.5) * (rx - 1.5)) + (y * y) / ((ry - 1.5) * (ry - 1.5)) > 1.0;
51
+ if (edge) px(cx + x, cy + y, 1); else if (mode !== 'line') px(cx + x, cy + y, mode === 'white' ? 0 : patBit(mode, cx + x, cy + y));
52
+ }
53
+ };
54
+ const tl = H.layer(SW, 70), tx = tl.getContext('2d', { willReadFrequently: true });
55
+ const text = (str, x, y, font = '700 13px "Inter"', v = 1, thr = 120) => {
56
+ tx.clearRect(0, 0, SW, 70); tx.font = font; tx.textBaseline = 'top'; tx.fillStyle = '#000'; tx.fillText(str, 1, 2);
57
+ const w = Math.ceil(tx.measureText(str).width) + 3, d = tx.getImageData(0, 0, Math.min(SW, w), 70).data, ww = Math.min(SW, w);
58
+ for (let j = 0; j < 70; j++) for (let i = 0; i < ww; i++) if (d[(j * ww + i) * 4 + 3] > thr) px(x + i - 1, y + j - 2, v);
59
+ return w - 3;
60
+ };
61
+ const tw = (str, font = '700 13px "Inter"') => { tx.font = font; return Math.ceil(tx.measureText(str).width); };
62
+ const ctext = (str, cx, y, font) => text(str, Math.round(cx - tw(str, font) / 2), y, font);
63
+ const ease = (a, d) => H.ease.inOut(H.clamp((t - a) / d));
64
+ const fmt = (n) => String(Math.floor(n)).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
65
+ const BIG = '800 22px "Inter"', UI = '700 13px "Inter"', SM = '400 11px "Inter"', HUGE = '800 44px "Inter"';
66
+
67
+ // ---------- Mac chrome ----------
68
+ const win = (x, y, w, h, title) => {
69
+ fill(x, y, w, h, 0); box(x, y, w, h); hl(x + 1, x + w, y + h); vl(x + w, y + 1, y + h);
70
+ for (let yy = y + 3; yy <= y + 15; yy += 2) hl(x + 2, x + w - 3, yy);
71
+ hl(x, x + w - 1, y + 18);
72
+ fill(x + 8, y + 4, 13, 11, 0); box(x + 9, y + 5, 11, 10);
73
+ const tW = tw(title); fill(Math.round(x + w / 2 - tW / 2 - 8), y + 2, tW + 16, 15, 0); text(title, Math.round(x + w / 2 - tW / 2), y + 3);
74
+ };
75
+ const dialog = (x, y, w, h) => { fill(x, y, w, h, 0); box(x, y, w, h); box(x + 3, y + 3, w - 6, h - 6); box(x + 4, y + 4, w - 8, h - 8); hl(x + 1, x + w, y + h); vl(x + w, y + 1, y + h); };
76
+ const rbox = (x, y, w, h, rad = 6) => { // rounded rect outline
77
+ hl(x + rad, x + w - rad - 1, y); hl(x + rad, x + w - rad - 1, y + h - 1); vl(x, y + rad, y + h - rad - 1); vl(x + w - 1, y + rad, y + h - rad - 1);
78
+ for (let a = 0; a <= Math.PI / 2; a += 0.05) { const dx = Math.round((1 - Math.cos(a)) * rad), dy = Math.round((1 - Math.sin(a)) * rad); px(x + dx, y + dy); px(x + w - 1 - dx, y + dy); px(x + dx, y + h - 1 - dy); px(x + w - 1 - dx, y + h - 1 - dy); }
79
+ };
80
+ const button = (x, y, w, h, label, pressed, dflt) => {
81
+ fill(x + 2, y + 2, w - 4, h - 4, 0); rbox(x, y, w, h, 7); ctext(label, x + w / 2, y + h / 2 - 7, UI);
82
+ if (dflt) { rbox(x - 4, y - 4, w + 8, h + 8, 10); rbox(x - 3, y - 3, w + 6, h + 6, 9); rbox(x - 2, y - 2, w + 4, h + 4, 8); }
83
+ if (pressed) invRect(x + 2, y + 2, w - 4, h - 4);
84
+ };
85
+ const zoom = (src, dst, k) => { const head = Math.floor(H.clamp(k) * 8); for (let i = Math.max(0, head - 3); i <= head; i++) { const f = i / 8, q = src.map((v, j) => Math.round(v + (dst[j] - v) * f)); box(q[0], q[1], q[2], q[3]); } };
86
+ const CUR = ['#.........', '##........', '#o#.......', '#oo#......', '#ooo#.....', '#oooo#....', '#ooooo#...', '#oooooo#..', '#ooooooo#.', '#oooo#####', '#oo#o#....', '#o#.#o#...', '##..#o#...', '.....#o#..', '.....#o#..', '......##..'];
87
+ const cursor = (x, y) => CUR.forEach((row, j) => [...row].forEach((c, i) => { if (c === '#') px(x + i, y + j, 1); else if (c === 'o') px(x + i, y + j, 0); }));
88
+ // little 1-bit pictures
89
+ const catPic = (cx, cy, s) => { // s ~ radius
90
+ const ear = (dir) => { for (let k = 0; k < s * 0.8; k++) { const w2 = Math.round(k * 0.6); hl(Math.round(cx + dir * s * 0.55 - w2), Math.round(cx + dir * s * 0.55 + w2), Math.round(cy - s * 1.25 + k)); } };
91
+ ear(-1); ear(1);
92
+ oval(cx, cy, Math.round(s), Math.round(s * 0.85), 3);
93
+ oval(cx - Math.round(s * 0.38), cy - Math.round(s * 0.1), Math.max(2, Math.round(s * 0.14)), Math.max(2, Math.round(s * 0.2)), 0);
94
+ oval(cx + Math.round(s * 0.38), cy - Math.round(s * 0.1), Math.max(2, Math.round(s * 0.14)), Math.max(2, Math.round(s * 0.2)), 0);
95
+ fill(cx - 2, cy + Math.round(s * 0.25), 5, 3, 1);
96
+ for (const d of [-1, 1]) { line(cx + d * s * 0.3, cy + s * 0.35, cx + d * s * 1.25, cy + s * 0.2); line(cx + d * s * 0.3, cy + s * 0.45, cx + d * s * 1.2, cy + s * 0.55); }
97
+ };
98
+ const dogPic = (cx, cy, s) => {
99
+ oval(cx, cy, Math.round(s * 0.85), Math.round(s), 24);
100
+ for (const d of [-1, 1]) oval(cx + d * Math.round(s * 0.85), cy - Math.round(s * 0.1), Math.round(s * 0.3), Math.round(s * 0.65), 0);
101
+ oval(cx - Math.round(s * 0.32), cy - Math.round(s * 0.2), Math.max(2, Math.round(s * 0.12)), Math.max(2, Math.round(s * 0.12)), 0);
102
+ oval(cx + Math.round(s * 0.32), cy - Math.round(s * 0.2), Math.max(2, Math.round(s * 0.12)), Math.max(2, Math.round(s * 0.12)), 0);
103
+ oval(cx, cy + Math.round(s * 0.35), Math.max(3, Math.round(s * 0.22)), Math.max(2, Math.round(s * 0.15)), 0);
104
+ };
105
+ const docIcon = (x, y, kind, sel) => { // 32x32 Finder document icon with a picture on it
106
+ fill(x + 4, y, 20, 32, 0); hl(x + 4, x + 21, y); vl(x + 4, y, y + 31); hl(x + 4, x + 27, y + 31); vl(x + 27, y + 6, y + 31); line(x + 21, y, x + 27, y + 6); vl(x + 21, y, y + 6); hl(x + 21, x + 27, y + 6);
107
+ (kind ? catPic : dogPic)(x + 16, y + 19, 6);
108
+ if (sel) invRect(x + 4, y, 24, 32);
109
+ };
110
+ const brainIcon = (x, y, hi) => { // 64x56 "model" icon: a classic compact computer with a brain on screen
111
+ fill(x + 8, y, 48, 56, 0); box(x + 8, y, 48, 56); box(x + 9, y + 1, 46, 54);
112
+ box(x + 14, y + 6, 36, 28); pfill(x + 15, y + 7, 34, 26, hi ? 0 : 3);
113
+ oval(x + 32, y + 20, 13, 10, 'white'); line(x + 32, y + 11, x + 32, y + 29);
114
+ for (let k = 0; k < 3; k++) { line(x + 22 + k * 2, y + 14 + k * 4, x + 29, y + 16 + k * 4); line(x + 35, y + 16 + k * 4, x + 42 - k * 2, y + 14 + k * 4); }
115
+ hl(x + 14, x + 26, y + 44); fill(x + 36, y + 43, 14, 3, 1);
116
+ };
117
+ const slider = (x, y, w, v, label) => { text(label, x - 28, y - 6, UI); hl(x, x + w, y); hl(x, x + w, y + 1); for (let k = 0; k <= 4; k++) vl(x + (k * w) / 4, y + 4, y + 7); const kx = Math.round(x + v * w); fill(kx - 6, y - 8, 12, 17, 0); box(kx - 6, y - 8, 12, 17); for (let k = 0; k < 3; k++) hl(kx - 3, kx + 3, y - 3 + k * 3); };
118
+ const ants = (x, y, w, h) => { const ant = Math.floor(t * 8); let k = 0; const st = (xx, yy) => { px(xx, yy, ((k + ant) >> 2) & 1); k++; }; for (let i = 0; i < w; i++) st(x + i, y); for (let j = 0; j < h; j++) st(x + w, y + j); for (let i = w; i > 0; i--) st(x + i, y + h); for (let j = h; j > 0; j--) st(x, y + j); };
119
+
120
+ // ---------- desktop + menu bar ----------
121
+ for (let y = 0; y < SH; y++) for (let x = 0; x < SW; x++) B[y * SW + x] = (x + y) & 1;
122
+ fill(0, 0, SW, 19, 0); hl(0, SW - 1, 19);
123
+ [[0, 0, 1, 1], [SW - 1, 0, -1, 1], [0, SH - 1, 1, -1], [SW - 1, SH - 1, -1, -1]].forEach(([cx, cy, dx, dy]) => { [5, 3, 2, 1, 1].forEach((n, j) => { for (let i = 0; i < n; i++) px(cx + dx * i, cy + dy * j, 1); }); });
124
+ const LOGO = ['..###..', '.#...#.', '#..#..#', '#.#.#.#', '#..#..#', '.#...#.', '..###..', '..#.#..', '..###..', '..###..', '...#...'];
125
+ LOGO.forEach((row, j) => [...row].forEach((c, i) => c === '#' && px(14 + i, 4 + j)));
126
+ let mx = 36; ['File', 'Edit', 'Train', 'Model', 'Help'].forEach((m) => { mx += text(m, mx, 4, UI) + 18; });
127
+
128
+ const MAIN = [12, 26, 616, 328];
129
+ // ---------- BEAT 1: alert asks the question, OK click -> it becomes the window title ----------
130
+ if (t < 1.7 && t > 0.2) {
131
+ const dx = 60, dy = 80, dw = 520, dh = 190;
132
+ dialog(dx, dy, dw, dh);
133
+ // note icon: speech balloon with "?"
134
+ oval(dx + 56, dy + 60, 32, 26, 'white'); thick(dx + 40, dy + 82, dx + 30, dy + 102); thick(dx + 30, dy + 102, dx + 58, dy + 86);
135
+ text('?', dx + 46, dy + 38, '800 34px "Inter"');
136
+ const q = 'How does AI learn?', qn = Math.min(q.length, Math.floor((t - 0.3) * 30));
137
+ text(q.slice(0, Math.max(0, qn)), dx + 110, dy + 40, '800 40px "Inter"');
138
+ if (t > 0.75) text('Click OK to find out.', dx + 112, dy + 98, UI);
139
+ button(dx + dw - 120, dy + dh - 52, 90, 30, 'OK', t > 1.45 && t < 1.65, true);
140
+ }
141
+ // cursor path: wanders to OK and clicks
142
+ let cur = null;
143
+ if (t < 1.7) { const k = ease(0.7, 0.7); cur = [Math.round(H.lerp(600, 60 + 520 - 76, k)), Math.round(H.lerp(330, 80 + 190 - 38, k))]; }
144
+ if (t >= 1.65 && t < 1.95) zoom([60, 80, 520, 190], MAIN, (t - 1.65) / 0.3);
145
+
146
+ // ---------- BEAT 2: Finder window of labelled examples dragged into the Model ----------
147
+ if (t >= 1.95) {
148
+ win(MAIN[0], MAIN[1], MAIN[2], MAIN[3], 'How does AI learn?');
149
+ const cx0 = MAIN[0] + 1, cy0 = MAIN[1] + 19;
150
+ // Finder info bar, counting items
151
+ const n = 1e6 * Math.pow(H.clamp((t - 2.5) / 3.2), 2.2);
152
+ text(fmt(n) + ' examples', cx0 + 12, cy0 + 4, UI); text('Training Data', cx0 + MAIN[2] - 130, cy0 + 4, UI);
153
+ hl(cx0, cx0 + MAIN[2] - 3, cy0 + 20); hl(cx0, cx0 + MAIN[2] - 3, cy0 + 22);
154
+ // icon grid with labels landing under each icon
155
+ const icons = [];
156
+ for (let j = 0; j < 3; j++) for (let i = 0; i < 4; i++) icons.push([cx0 + 26 + i * 64, cy0 + 40 + j * 74, (i + j * 2) % 3 !== 1]);
157
+ const nShown = Math.floor(H.clamp((t - 2.0) / 0.6) * icons.length);
158
+ const dragI = t > 2.9 && t < 5.9 ? Math.floor((t - 2.9) / 0.5) : -1, dk = ((t - 2.9) % 0.5) / 0.4;
159
+ icons.forEach(([x, y, kind], k) => {
160
+ if (k >= nShown) return;
161
+ const sel = dragI >= 0 && (dragI * 5) % 12 === k && dk < 1;
162
+ docIcon(x, y, kind, sel);
163
+ const lb = kind ? 'cat' : 'dog'; const lw = tw(lb, UI);
164
+ fill(x + 16 - lw / 2 - 2, y + 35, lw + 4, 15, sel ? 1 : 0); text(lb, Math.round(x + 16 - lw / 2), y + 36, UI, sel ? 0 : 1);
165
+ });
166
+ // model icon + label, arrow "training data"
167
+ const mx2 = cx0 + 430, my2 = cy0 + 100;
168
+ const hit = dragI >= 0 && dk > 0.95;
169
+ brainIcon(mx2, my2, hit); ctext('Model', mx2 + 32, my2 + 62, UI);
170
+ if (t > 2.5) { // the hero number of this beat
171
+ text('examples seen', cx0 + 300, cy0 + 212, UI);
172
+ text(fmt(n), cx0 + 300, cy0 + 230, '800 40px "Inter"');
173
+ }
174
+ if (t > 2.4) { arrow([[cx0 + 285, cy0 + 130], [mx2 - 8, my2 + 28]], ease(2.4, 0.5)); if (t > 2.8) text('training data', cx0 + 300, cy0 + 104, UI); }
175
+ // the drag: dotted outline + cursor carrying it
176
+ if (dragI >= 0 && dk < 1) {
177
+ const [ix, iy] = icons[(dragI * 5) % 12], e = H.ease.inOut(H.clamp(dk));
178
+ const ox = Math.round(H.lerp(ix + 4, mx2 + 20, e)), oy = Math.round(H.lerp(iy, my2 + 10, e) - Math.sin(e * Math.PI) * 30);
179
+ for (let i = 0; i < 24; i += 2) { px(ox + i, oy); px(ox + i, oy + 31); } for (let j = 0; j < 32; j += 2) { px(ox, oy + j); px(ox + 23, oy + j); }
180
+ cur = [ox + 12, oy + 14];
181
+ }
182
+ }
183
+
184
+ // ---------- BEAT 3: the Model window — Guess, Check (alert + beep), Adjust (sliders) ----------
185
+ const MW = [44, 52, 552, 290];
186
+ if (t >= 5.9 && t < 6.2) zoom([12 + 1 + 430, 26 + 19 + 100, 64, 56], MW, (t - 5.9) / 0.3);
187
+ if (t >= 6.2) {
188
+ win(MW[0], MW[1], MW[2], MW[3], 'Model');
189
+ const x0 = MW[0], y0 = MW[1] + 19;
190
+ const phase = t < 7.4 ? 0 : t < 8.3 ? 1 : t < 9.4 ? 2 : 0;
191
+ ['Guess', 'Check', 'Adjust'].forEach((nm, i) => { button(x0 + 110 + i * 140, y0 + 12, 88, 24, nm, i === phase); if (i < 2) arrow([[x0 + 204 + i * 140, y0 + 24], [x0 + 244 + i * 140, y0 + 24]], 1); });
192
+ // loop-back arrow (dashed) under the buttons
193
+ thick(x0 + 434, y0 + 40, x0 + 434, y0 + 50, 3); thick(x0 + 434, y0 + 50, x0 + 154, y0 + 50, 3); arrow([[x0 + 154, y0 + 50], [x0 + 154, y0 + 41]], 1);
194
+ text('repeat', x0 + 268, y0 + 54, UI);
195
+ // picture panel
196
+ box(x0 + 22, y0 + 82, 120, 110); catPic(x0 + 82, y0 + 142, 30); ctext('new picture', x0 + 82, y0 + 198, UI);
197
+ arrow([[x0 + 148, y0 + 136], [x0 + 196, y0 + 136]], ease(6.4, 0.3)); if (t > 6.5) text('guess', x0 + 150, y0 + 112, UI);
198
+ // weights panel (Control-Panel sliders)
199
+ box(x0 + 204, y0 + 76, 180, 124); text('Weights', x0 + 212, y0 + 82, UI); hl(x0 + 204, x0 + 383, y0 + 100);
200
+ const adj = H.ease.inOut(H.clamp((t - 8.6) / 0.6));
201
+ [[0.25, 0.6], [0.7, 0.35], [0.4, 0.8]].forEach(([a, b], i) => slider(x0 + 246, y0 + 122 + i * 26, 120, H.lerp(a, b, adj), 'w' + (i + 1)));
202
+ arrow([[x0 + 390, y0 + 136], [x0 + 420, y0 + 136]], ease(6.9, 0.2));
203
+ if (t > 7.0 && t < 9.4) {
204
+ text('dog?', x0 + 428, y0 + 118, '800 30px "Inter"');
205
+ if (t > 7.5) { thick(x0 + 424, y0 + 116, x0 + 506, y0 + 156); thick(x0 + 506, y0 + 116, x0 + 424, y0 + 156); }
206
+ }
207
+ if (t > 8.3) { // error travels back
208
+ arrow([[x0 + 466, y0 + 164], [x0 + 466, y0 + 222], [x0 + 300, y0 + 222], [x0 + 300, y0 + 204]], ease(8.3, 0.5), 4);
209
+ if (t > 8.5) text('error', x0 + 370, y0 + 228, UI);
210
+ }
211
+ if (t > 9.6) {
212
+ text('cat', x0 + 430, y0 + 118, '800 30px "Inter"');
213
+ if (t > 9.85) { const k = H.clamp((t - 9.85) / 0.25); thick(x0 + 490, y0 + 136, x0 + 490 + 8 * Math.min(1, k * 2), y0 + 136 + 10 * Math.min(1, k * 2)); if (k > 0.5) thick(x0 + 498, y0 + 146, x0 + 498 + 20 * (k - 0.5) * 2, y0 + 146 - 30 * (k - 0.5) * 2); }
214
+ }
215
+ // CHECK: stop alert
216
+ if (t > 7.4 && t < 8.3) {
217
+ const ax = 250, ay = 210, aw = 300, ah = 96;
218
+ dialog(ax, ay, aw, ah);
219
+ // stop icon: octagon with a hand-ish bar
220
+ const sx = ax + 40, sy = ay + 40, R = 18; for (let a = 0; a < 8; a++) { const a0 = (a + 0.5) * Math.PI / 4, a1 = (a + 1.5) * Math.PI / 4; thick(sx + Math.cos(a0) * R, sy + Math.sin(a0) * R, sx + Math.cos(a1) * R, sy + Math.sin(a1) * R); }
221
+ fill(sx - 9, sy - 3, 19, 7, 1);
222
+ text('Wrong!', ax + 72, ay + 18, BIG); text("It's a cat, not a dog.", ax + 72, ay + 48, UI);
223
+ button(ax + aw - 84, ay + ah - 34, 60, 22, 'OK', t > 8.1, true);
224
+ }
225
+ cur = t < 9.4 ? [x0 + 110 + phase * 140 + 60, y0 + 30] : [x0 + 170, y0 + 30];
226
+ }
227
+
228
+ // ---------- BEAT 4: Accuracy chart window (pattern-filled area, counting number) ----------
229
+ const CWN = [28, 50, 584, 300];
230
+ if (t >= 10.4 && t < 10.7) zoom(MW, CWN, (t - 10.4) / 0.3);
231
+ if (t >= 10.7) {
232
+ win(CWN[0], CWN[1], CWN[2], CWN[3], 'Accuracy');
233
+ const ox = CWN[0] + 60, oy = CWN[1] + 262, aw = 330, ah = 196;
234
+ vl(ox, oy - ah - 6, oy); hl(ox, ox + aw + 6, oy);
235
+ for (let k = 0; k <= 4; k++) hl(ox - 5, ox, oy - (k * ah) / 4);
236
+ text('100%', ox - 50, oy - ah - 6, UI); text('50%', ox - 42, oy - ah / 2 - 6, UI); text('training rounds →', ox + aw - 160, oy + 8, UI);
237
+ const acc = (x) => 97 - 36 * Math.exp(-x * 4.5);
238
+ const prog = H.clamp((t - 10.9) / 1.6);
239
+ let lastY = oy;
240
+ for (let x = 0; x <= aw * prog; x++) {
241
+ const v = acc(x / aw), yy = Math.round(oy - (v / 100) * ah);
242
+ for (let y = yy + 2; y < oy; y++) px(ox + x, y, patBit(9, ox + x, y));
243
+ px(ox + x, yy); px(ox + x, yy + 1); lastY = yy;
244
+ }
245
+ const val = Math.round(61 + 36 * H.ease.out(prog));
246
+ text('Accuracy', CWN[0] + 420, CWN[1] + 60, UI);
247
+ const nx = CWN[0] + 420, ny = CWN[1] + 84;
248
+ fill(nx - 4, ny - 4, 140, 60, 0); text(val + '%', nx, ny, HUGE);
249
+ text('61% → ' + val + '%', nx, ny + 62, UI);
250
+ if (prog >= 1) { // emphasis: marching-ants selection + oval tool ring on the last point
251
+ ants(nx - 10, ny - 8, 136, 60);
252
+ const k = H.clamp((t - 12.55) / 0.3); if (k > 0) oval(ox + aw, lastY, Math.round(14 * k) + 2, Math.round(14 * k) + 2, 'line');
253
+ }
254
+ cur = [nx + 120, ny + 70];
255
+ }
256
+ // ---------- BEAT 5: closing alert ----------
257
+ if (t > 13.0) {
258
+ const dx = 64, dy = 196, dw = 360, dh = 120;
259
+ dialog(dx, dy, dw, dh);
260
+ LOGO.forEach((row, j) => [...row].forEach((c, i) => { if (c === '#') fill(dx + 24 + i * 4, dy + 22 + j * 4, 4, 4, 1); }));
261
+ const l1 = 'More examples →', l2 = 'better guesses.';
262
+ text(l1.slice(0, Math.floor((t - 13.0) * 40)), dx + 74, dy + 24, BIG);
263
+ if (t > 13.3) text(l2.slice(0, Math.floor((t - 13.3) * 40)), dx + 74, dy + 52, BIG);
264
+ button(dx + dw - 96, dy + dh - 38, 68, 24, 'OK', false, true);
265
+ cur = [dx + dw - 40, dy + dh + 20];
266
+ }
267
+ // system beep = menu bar flash on the wrong guess
268
+ if (t > 7.4 && t < 7.55) invRect(0, 0, SW, 19);
269
+ if (cur) cursor(cur[0], cur[1]);
270
+
271
+ const lc = H.layer(SW, SH), lx = lc.getContext('2d');
272
+ const img = lx.createImageData(SW, SH);
273
+ for (let i = 0; i < B.length; i++) { const v = B[i] ? 0 : 255; img.data[i * 4] = v; img.data[i * 4 + 1] = v; img.data[i * 4 + 2] = v; img.data[i * 4 + 3] = 255; }
274
+ lx.putImageData(img, 0, 0);
275
+ ctx.save(); ctx.imageSmoothingEnabled = false; ctx.drawImage(lc, 0, 0, W, H_); ctx.restore();
276
+ }
277
+
278
+ // ================= SOUND: a 1984 Mac on a desk. Mouse clicks and ball rumble, keyboard clicks, the floppy drive
279
+ // chattering while the Finder works, the square-wave system beep, and the Mac's 4-voice square synth for the big hits.
280
+ // All times copied from macExplainer above.
281
+ function macSound(k) {
282
+ const END = 14.5;
283
+ const sq = (t, f, dur, gain, o) => k.tone(t, Object.assign({ f, type: 'square', dur, gain, a: 0.002, hold: dur * 0.6, filter: 'lowpass', f2: 2200 }, o));
284
+ const tri = (t, f, dur, gain, o) => k.tone(t, Object.assign({ f, type: 'triangle', dur, gain, a: 0.003, hold: dur * 0.5 }, o));
285
+ // mouse button: plastic micro-switch, down is a firmer clack than up
286
+ const mclick = (t, down, pan = 0, g = 1) => {
287
+ k.noise(t, { dur: 0.014, filter: 'bandpass', f: down ? 1700 : 2300, q: 3, gain: (down ? 0.32 : 0.2) * g, a: 0.001, pan });
288
+ k.tone(t, { f: down ? 210 : 280, dur: 0.035, gain: (down ? 0.14 : 0.08) * g, a: 0.001, pan });
289
+ };
290
+ // mouse ball rolling across the desk
291
+ const rumble = (t, dur, pan = 0) => k.noise(t, { dur, color: 'brown', filter: 'bandpass', f: 260, q: 1.2, gain: 0.09, a: dur * 0.3, hold: dur * 0.3, pan, minor: true });
292
+ // floppy drive: motor whir + head-step clunks
293
+ const motor = (t, dur, g = 1) => { k.tone(t, { f: 92, type: 'sawtooth', dur, gain: 0.025 * g, a: 0.08, hold: dur - 0.2, filter: 'lowpass', f2: 380, pan: 0.2, minor: true }); k.noise(t, { dur, filter: 'bandpass', f: 700, q: 2.5, gain: 0.02 * g, a: 0.08, hold: dur - 0.2, pan: 0.2, minor: true }); };
294
+ const step = (t, g = 1) => { k.noise(t, { dur: 0.02, filter: 'bandpass', f: 950, q: 5, gain: 0.3 * g, a: 0.001, pan: 0.2, minor: true }); k.tone(t, { f: 140, dur: 0.03, gain: 0.08 * g, a: 0.001, pan: 0.2, minor: true }); };
295
+ // zoom-rects: 8 stepped outlines -> 8 stepped low square ticks, rising
296
+ const zoomSnd = (t, pan = 0) => { for (let i = 0; i < 8; i++) sq(t + i * 0.0375, 180 * Math.pow(2, i / 6), 0.03, 0.05, { f2: 1200, pan }); };
297
+ // keyboard: the Mac 128 keyboard's clicky keys, one key per two typed characters (keeps it under ~15/s)
298
+ const typeOut = (t0, len, cps, pan = 0) => { for (let i = 0; i < len; i += 2) k.play('key', t0 + i / cps, { gain: 1.0, pan, minor: true }); };
299
+
300
+ k.bed('room', 0, END, { gain: 0.7 });
301
+ k.bed('hiss', 0, END, { gain: 0.6 }); // the built-in CRT's faint whine/hiss
302
+
303
+ // ---- BEAT 1: alert (0.2), typed question (0.3, 30 cps), cursor rolls to OK (0.7-1.4), click (1.45/1.65)
304
+ sq(0.2, 'A3', 0.05, 0.06, { f2: 900 }); k.play('tock', 0.2, { f: 420, gain: 0.5 }); // the dialog snaps up
305
+ typeOut(0.3, 18, 30, -0.1);
306
+ rumble(0.7, 0.7, 0.3);
307
+ mclick(1.45, true, 0.4); mclick(1.65, false, 0.4);
308
+ zoomSnd(1.65); // zoom-rects 1.65-1.95
309
+
310
+ // ---- BEAT 2: Finder window (1.95), icons read off the disk (2.0-2.6, 12 icons)
311
+ motor(1.95, 0.75);
312
+ for (let i = 0; i < 12; i += 2) step(2.0 + (i / 12) * 0.6, 0.8);
313
+ k.noise(2.4, { dur: 0.5, color: 'brown', filter: 'lowpass', f: [[0, 300], [0.5, 900]], gain: 0.07, a: 0.35, pan: 0.2, minor: true }); // arrow slides to the Model (2.4-2.9)
314
+ // training: the floppy runs while examples are copied; head steps are the counter's ticks, faster as it speeds up
315
+ motor(2.5, 3.3, 1.2);
316
+ for (let t = 2.55; t < 5.7;) { step(t, 0.5); t += H.lerp(0.22, 0.09, (t - 2.5) / 3.2); }
317
+ // six drags (2.9 + i*0.5): mouse down on the icon, ball rolls, drop into the Model at dk > 0.95 (+0.38)
318
+ for (let i = 0; i < 6; i++) {
319
+ const t = 2.9 + i * 0.5;
320
+ mclick(t, true, -0.4, 0.8); rumble(t + 0.02, 0.34, -0.1);
321
+ mclick(t + 0.38, false, 0.35, 0.9);
322
+ k.tone(t + 0.38, { f: [[0, 220 * Math.pow(2, i / 12)], [0.06, 330 * Math.pow(2, i / 12)]], type: 'square', dur: 0.08, gain: 0.05, a: 0.002, hold: 0.04, filter: 'lowpass', f2: 1400, pan: 0.35, minor: true });
323
+ }
324
+ // counter lands on 1,000,000 (t = 5.7): drive stops with a final seek, a clean square two-note
325
+ step(5.7, 1.1); sq(5.72, 'E5', 0.07, 0.07, { pan: -0.2 }); sq(5.8, 'A5', 0.22, 0.07, { pan: -0.2 });
326
+
327
+ // ---- BEAT 3: zoom into the Model window (5.9-6.2), Guess clicked (6.2)
328
+ zoomSnd(5.9, 0.3);
329
+ mclick(6.2, true, -0.3); mclick(6.32, false, -0.3, 0.8);
330
+ k.noise(6.4, { dur: 0.3, color: 'brown', filter: 'lowpass', f: [[0, 300], [0.3, 800]], gain: 0.05, a: 0.2, minor: true }); // guess arrow
331
+ k.noise(6.9, { dur: 0.2, color: 'brown', filter: 'lowpass', f: [[0, 300], [0.2, 800]], gain: 0.05, a: 0.14, pan: 0.4, minor: true });
332
+ sq(7.0, 'D4', 0.08, 0.07, { pan: 0.5 }); sq(7.09, 'G4', 0.16, 0.07, { pan: 0.5 }); // "dog?" appears: a questioning lift
333
+ // CHECK (7.4): button + stop alert + menu-bar flash = the Mac system beep (the wrong guess)
334
+ mclick(7.4, true, 0);
335
+ sq(7.4, 1000, 0.17, 0.12, { f2: 3200, hold: 0.12 }); sq(7.4, 500, 0.17, 0.05, { f2: 1600, hold: 0.12 });
336
+ sq(7.5, 'G2', 0.22, 0.1, { f2: 700, hold: 0.12, pan: 0.5 }); k.play('thud', 7.5, { f: 110, gain: 0.5, pan: 0.5 }); // X slams over "dog?"
337
+ mclick(8.1, true, 0.3); mclick(8.28, false, 0.3, 0.8); // OK on the alert
338
+ // ADJUST (8.3): button, dashed error line draws back (8.3-8.8), 'error' label (8.5)
339
+ mclick(8.3, true, 0.2);
340
+ k.withMinor(() => { for (let i = 0; i < 8; i++) { const f = i / 7, e = H.ease.inOut(f); sq(8.3 + f * 0.5, 600 * Math.pow(2, -e), 0.025, 0.04, { f2: 1500, pan: 0.6 - e * 0.5 }); } });
341
+ // weight sliders move (8.6-9.2, ease in-out): mouse drags, detent clicks where the knobs pass tick marks
342
+ rumble(8.6, 0.6, -0.1); // slider drag
343
+ [8.68, 8.78, 8.86, 8.93, 9.0, 9.08, 9.17].forEach((t, i) => k.play('click', t, { f: 1300 + (i % 3) * 120, gain: 1.0, pan: -0.15, minor: true }));
344
+ // GUESS again (9.4), "cat" (9.6), check mark draws (9.85-10.1): the correction
345
+ mclick(9.4, true, -0.3); mclick(9.52, false, -0.3, 0.8);
346
+ sq(9.6, 'G4', 0.1, 0.07, { pan: 0.5 });
347
+ sq(9.85, 'E5', 0.09, 0.08, { pan: 0.5 }); sq(9.95, 'A5', 0.35, 0.08, { pan: 0.5 }); tri(9.95, 'A3', 0.4, 0.14, { pan: 0.5 });
348
+
349
+ // ---- BEAT 4: zoom to the Accuracy window (10.4-10.7), chart draws 10.9-12.5, number 61 -> 97 (ease-out)
350
+ zoomSnd(10.4);
351
+ motor(10.75, 1.8, 0.8);
352
+ let last = 61, lastT = -1;
353
+ for (let f = Math.ceil(10.9 * 60); f < 12.42 * 60; f++) { // ticks stop just before the 97% hit
354
+ const t = f / 60, v = Math.round(61 + 36 * H.ease.out(H.clamp((t - 10.9) / 1.6)));
355
+ if (v > last && t - lastT >= 1 / 12) { sq(t, 300 + (v - 61) * 12, 0.03, 0.045, { f2: 1600, minor: true, pan: 0.3 }); lastT = t; last = v; }
356
+ }
357
+ // 97% (12.5): the biggest hit. 4-voice square chord (the Mac's own synth) over a low triangle, ants start crawling
358
+ const P = 12.5;
359
+ ['C5', 'E5', 'G5'].forEach((n, i) => sq(P + i * 0.05, n, 0.08, 0.07, { pan: 0.3 }));
360
+ ['C5', 'E5', 'G5', 'C6'].forEach((n) => sq(P + 0.15, n, 0.7, 0.055, { f2: 2400, hold: 0.2, pan: 0.3, verb: 0.12 }));
361
+ tri(P + 0.15, 'C3', 0.75, 0.34, { hold: 0.2 }); // decays by ~13.0 so the closing alert reads k.play('thud', P, { f: 120, gain: 0.45 });
362
+ k.noise(12.55, { dur: 0.3, color: 'brown', filter: 'lowpass', f: [[0, 400], [0.3, 1000]], gain: 0.05, a: 0.1, minor: true }); // oval tool ring
363
+
364
+ // ---- BEAT 5: closing alert (13.0), takeaway typed (13.0 / 13.3 at 40 cps), lands at ~13.68
365
+ sq(13.0, 'A3', 0.05, 0.06, { f2: 900 }); k.play('tock', 13.0, { f: 420, gain: 0.5 });
366
+ for (let t = 13.03; t < 13.66; t += 0.08) k.play('key', t, { gain: 1.0, pan: -0.3, minor: true }); // both lines type 13.0-13.68; one key per ~3 chars
367
+ const TAKE = 13.68;
368
+ sq(TAKE, 'G4', 0.12, 0.045); sq(TAKE + 0.12, 'C5', 0.8, 0.045, { verb: 0.12 }); sq(TAKE + 0.12, 'E4', 0.8, 0.025); tri(TAKE + 0.12, 'C3', 0.9, 0.14);
369
+ }
370
+
371
+ registerStyle({
372
+ id: 'mac-1bit',
373
+ name: 'MacPaint 1984',
374
+ category: 'Retro Digital',
375
+ description: 'Pure 1-bit black & white at the original 72-dpi grain: real Atkinson-dithered grayscale (blown-out highlights, crunchy shadows), 8x8 fill patterns, striped title bars, marching ants and bitmap type.',
376
+ motion: 'Built the way a 1984 user would: the dithered image scans in row by row, then pencil, line, bucket, rectangle and text tools each switch on in the palette and lay down their marks in snappy, unanimated 1-bit steps, ending on crawling marching ants.',
377
+ duration: 6.2,
378
+ fonts: ['700 13px "Inter"', '700 34px "Libre Baskerville"', '400 11px "Inter"', '8px "Silkscreen"', '800 22px "Inter"', '800 40px "Inter"'],
379
+ frameT: 6.0,
380
+ readsPixels: true,
381
+ explainerDuration: 14.5,
382
+ explainerNote: 'Explains with the 1984 desktop itself: an alert asks the question and, once OK is clicked, zoom-rects turn it into the window title; labelled Finder icons are dragged into a Model icon while the item count climbs; a Model window cycles Guess/Check/Adjust buttons with a stop alert and menu-bar beep flash, dashed error arrow and Control-Panel weight sliders; a pattern-filled chart climbs to 97% inside marching ants.',
383
+ explainer(ctx, W, H_, t) { macExplainer(ctx, W, H_, t); },
384
+ explainerSound(k) { macSound(k); },
385
+ draw(ctx, W, H_, t) {
386
+ const B = new Uint8Array(SW * SH); // 1 = black
387
+ const px = (x, y, v = 1) => { x |= 0; y |= 0; if (x >= 0 && y >= 0 && x < SW && y < SH) B[y * SW + x] = v; };
388
+ const inv = (x, y) => { x |= 0; y |= 0; if (x >= 0 && y >= 0 && x < SW && y < SH) B[y * SW + x] ^= 1; };
389
+ const fill = (x, y, w, h, v = 1) => { for (let j = 0; j < h; j++) for (let i = 0; i < w; i++) px(x + i, y + j, v); };
390
+ const pfill = (x, y, w, h, p) => { for (let j = 0; j < h; j++) for (let i = 0; i < w; i++) px(x + i, y + j, patBit(p, x + i, y + j)); };
391
+ const hl = (x0, x1, y, v = 1) => { for (let x = x0; x <= x1; x++) px(x, y, v); };
392
+ const vl = (x, y0, y1, v = 1) => { for (let y = y0; y <= y1; y++) px(x, y, v); };
393
+ const box = (x, y, w, h, v = 1) => { hl(x, x + w - 1, y, v); hl(x, x + w - 1, y + h - 1, v); vl(x, y, y + h - 1, v); vl(x + w - 1, y, y + h - 1, v); };
394
+ const line = (x0, y0, x1, y1, v = 1) => {
395
+ x0 |= 0; y0 |= 0; x1 |= 0; y1 |= 0;
396
+ const dx = Math.abs(x1 - x0), dy = -Math.abs(y1 - y0), sx = x0 < x1 ? 1 : -1, sy = y0 < y1 ? 1 : -1; let e = dx + dy;
397
+ for (;;) { px(x0, y0, v); if (x0 === x1 && y0 === y1) break; const e2 = 2 * e; if (e2 >= dy) { e += dy; x0 += sx; } if (e2 <= dx) { e += dx; y0 += sy; } }
398
+ };
399
+ const oval = (cx, cy, rx, ry, mode) => { // mode: 'line' | pattern index
400
+ for (let y = -ry; y <= ry; y++) for (let x = -rx; x <= rx; x++) {
401
+ const d = (x * x) / (rx * rx) + (y * y) / (ry * ry);
402
+ if (d > 1.02) continue;
403
+ const edge = (x * x) / ((rx - 1) * (rx - 1)) + (y * y) / ((ry - 1) * (ry - 1)) > 1.0;
404
+ if (edge) px(cx + x, cy + y, 1); else if (mode !== 'line') px(cx + x, cy + y, patBit(mode, cx + x, cy + y));
405
+ }
406
+ };
407
+ // bitmap text: render with canvas, threshold alpha -> pure 1-bit glyphs
408
+ const tl = H.layer(SW, 60), tx = tl.getContext('2d', { willReadFrequently: true });
409
+ const text = (str, x, y, font, v = 1, thr = 120) => {
410
+ tx.clearRect(0, 0, SW, 60); tx.font = font; tx.textBaseline = 'top'; tx.fillStyle = '#000'; tx.fillText(str, 1, 2);
411
+ const w = Math.ceil(tx.measureText(str).width) + 3, d = tx.getImageData(0, 0, w, 60).data;
412
+ for (let j = 0; j < 60; j++) for (let i = 0; i < w; i++) if (d[(j * w + i) * 4 + 3] > thr) px(x + i - 1, y + j - 2, v);
413
+ return w - 3;
414
+ };
415
+ const r = H.rng(1984);
416
+
417
+ // ---------- desktop: classic 50% gray ----------
418
+ for (let y = 0; y < SH; y++) for (let x = 0; x < SW; x++) B[y * SW + x] = (x + y) & 1;
419
+
420
+ // ---------- menu bar ----------
421
+ fill(0, 0, SW, 19, 0); hl(0, SW - 1, 19);
422
+ // rounded screen corners
423
+ [[0, 0, 1, 1], [SW - 1, 0, -1, 1], [0, SH - 1, 1, -1], [SW - 1, SH - 1, -1, -1]].forEach(([cx, cy, dx, dy]) => {
424
+ const m = [5, 3, 2, 1, 1]; m.forEach((n, j) => { for (let i = 0; i < n; i++) px(cx + dx * i, cy + dy * j, 1); });
425
+ });
426
+ // menu logo: a tiny lightbulb
427
+ const LOGO = ['..###..', '.#...#.', '#..#..#', '#.#.#.#', '#..#..#', '.#...#.', '..###..', '..#.#..', '..###..', '..###..', '...#...'];
428
+ LOGO.forEach((row, j) => [...row].forEach((c, i) => c === '#' && px(14 + i, 4 + j)));
429
+ const menus = ['File', 'Edit', 'Goodies', 'Font', 'FontSize', 'Style'];
430
+ let mx = 36;
431
+ const openMenu = 2;
432
+ menus.forEach((m, i) => {
433
+ const w = text(m, mx, 4, '700 13px "Inter"');
434
+ if (i === openMenu && t > 3.88 && t < 3.98) { for (let y = 1; y < 19; y++) for (let x = mx - 6; x < mx + w + 6; x++) inv(x, y); }
435
+ mx += w + 16;
436
+ });
437
+
438
+ // ---------- desktop icons (right) ----------
439
+ const icon = (rows, x, y) => rows.forEach((row, j) => [...row].forEach((c, i) => { if (c === '#') px(x + i, y + j, 1); else if (c === 'o') px(x + i, y + j, 0); }));
440
+ const DISK = [
441
+ '##########################', '#oooo#oooooooooooo#ooooo#', '#oooo#oooooo##oooo#oooooo#', '#oooo#oooooo##oooo#oooooo#', '#oooo#oooooo##oooo#oooooo#',
442
+ '#oooo#oooooooooooo#oooooo#', '#oooo##############oooooo#', '#ooooooooooooooooooooooooo#', '#ooo##################ooo#', '#ooo#oooooooooooooooo#ooo#',
443
+ '#ooo#oooooooooooooooo#ooo#', '#ooo#oo############oo#ooo#', '#ooo#oooooooooooooooo#ooo#', '#ooo#oo#########ooooo#ooo#', '#ooo#oooooooooooooooo#ooo#',
444
+ '#ooo#oo###########ooo#ooo#', '#ooo#oooooooooooooooo#ooo#', '#ooo#oooooooooooooooo#ooo#', '#ooo#oooooooooooooooo#ooo#', '##########################',
445
+ ];
446
+ icon(DISK, 592, 32);
447
+ fill(584, 55, 42, 12, 0); text('AI Disk', 586, 56, '400 11px "Inter"');
448
+ const TRASH = [
449
+ '.......######.......', '.....##oooooo##.....', '####################', '#oooooooooooooooooo#', '####################', '.#oooooooooooooooo#.',
450
+ '.#oo#ooo#ooo#ooo#o#.', '.#oo#ooo#ooo#ooo#o#.', '.#oo#ooo#ooo#ooo#o#.', '.#oo#ooo#ooo#ooo#o#.', '.#oo#ooo#ooo#ooo#o#.', '.#oo#ooo#ooo#ooo#o#.',
451
+ '.#oo#ooo#ooo#ooo#o#.', '.#oo#ooo#ooo#ooo#o#.', '.#oo#ooo#ooo#ooo#o#.', '.#oooooooooooooooo#.', '..################..',
452
+ ];
453
+ icon(TRASH, 598, 300);
454
+ fill(588, 320, 38, 12, 0); text('Trash', 593, 321, '400 11px "Inter"');
455
+
456
+ // ---------- MacPaint window ----------
457
+ const wx = 14, wy = 26, ww = 562, wh = 326;
458
+ fill(wx, wy, ww, wh, 0); box(wx, wy, ww, wh); hl(wx + 1, wx + ww, wy + wh); vl(wx + ww, wy + 1, wy + wh); // drop shadow
459
+ // striped title bar
460
+ for (let y = wy + 3; y <= wy + 15; y += 2) hl(wx + 2, wx + ww - 3, y);
461
+ hl(wx, wx + ww - 1, wy + 18);
462
+ fill(wx + 8, wy + 4, 13, 11, 0); box(wx + 9, wy + 5, 11, 11 - 1); // close box
463
+ const title = 'untitled';
464
+ tx.font = '700 13px "Inter"'; const tw = Math.ceil(tx.measureText(title).width);
465
+ fill(wx + ww / 2 - tw / 2 - 8, wy + 2, tw + 16, 15, 0);
466
+ text(title, wx + ww / 2 - tw / 2, wy + 3, '700 13px "Inter"');
467
+
468
+ // ---------- tool palette (2 x 9) ----------
469
+ const tpx = wx + 8, tpy = wy + 26, cw2 = 26, ch2 = 20;
470
+ const tools = ['select', 'lasso', 'hand', 'text', 'bucket', 'spray', 'brush', 'pencil', 'line', 'eraser', 'rect', 'frect', 'rrect', 'frrect', 'oval', 'foval', 'free', 'poly'];
471
+ const activeTool = t < 1.85 ? 'select' : t < 2.3 ? 'pencil' : t < 3.35 ? 'line' : t < 3.5 ? 'bucket' : t < 3.95 ? 'rect' : t < 4.75 ? 'text' : 'select';
472
+ tools.forEach((tool, k) => {
473
+ const cx = tpx + (k % 2) * cw2, cy = tpy + Math.floor(k / 2) * ch2;
474
+ box(cx, cy, cw2 + 1, ch2 + 1);
475
+ const ox = cx + 5, oy = cy + 3;
476
+ switch (tool) {
477
+ case 'select': for (let i = 0; i < 16; i += 2) { px(ox + i, oy); px(ox + i, oy + 13); } for (let j = 0; j < 14; j += 2) { px(ox, oy + j); px(ox + 15, oy + j); } break;
478
+ case 'lasso': for (let a = 0; a < 6.28; a += 0.05) px(ox + 8 + Math.cos(a) * 7, oy + 5 + Math.sin(a) * 4); line(ox + 4, oy + 9, ox + 3, oy + 13); line(ox + 3, oy + 13, ox + 6, oy + 12); break;
479
+ case 'hand': box(ox + 3, oy + 6, 10, 8); for (let f = 0; f < 4; f++) vl(ox + 4 + f * 2.5, oy + 1 + (f === 0 || f === 3 ? 2 : 0), oy + 6); vl(ox + 1, oy + 5, oy + 8); break;
480
+ case 'text': text('A', ox + 3, oy - 1, '700 13px "Inter"'); break;
481
+ case 'bucket': line(ox + 3, oy + 6, ox + 9, oy); line(ox + 9, oy, ox + 15, oy + 6); line(ox + 15, oy + 6, ox + 9, oy + 12); line(ox + 9, oy + 12, ox + 3, oy + 6); vl(ox + 2, oy + 6, oy + 12); px(ox + 1, oy + 11); px(ox + 3, oy + 12); break;
482
+ case 'spray': box(ox + 7, oy + 4, 7, 10); fill(ox + 9, oy + 1, 3, 3); [[2, 0], [0, 2], [3, 3], [1, 5], [4, 1]].forEach(([a, b]) => px(ox + a, oy + b)); break;
483
+ case 'brush': line(ox + 14, oy, ox + 6, oy + 8); line(ox + 15, oy + 1, ox + 7, oy + 9); fill(ox + 2, oy + 9, 5, 4); break;
484
+ case 'pencil': line(ox + 13, oy, ox + 2, oy + 11); line(ox + 15, oy + 2, ox + 4, oy + 13); line(ox + 13, oy, ox + 15, oy + 2); px(ox + 1, oy + 13); px(ox + 2, oy + 12); break;
485
+ case 'line': line(ox + 1, oy + 13, ox + 15, oy); break;
486
+ case 'eraser': line(ox + 2, oy + 8, ox + 8, oy + 2); line(ox + 8, oy + 2, ox + 15, oy + 2); line(ox + 2, oy + 8, ox + 2, oy + 13); hl(ox + 2, ox + 9, oy + 13); line(ox + 9, oy + 13, ox + 15, oy + 7); vl(ox + 15, oy + 2, oy + 7); hl(ox + 2, ox + 9, oy + 8); vl(ox + 9, oy + 8, oy + 13); line(ox + 9, oy + 8, ox + 15, oy + 2); break;
487
+ case 'rect': box(ox + 1, oy + 2, 15, 11); break;
488
+ case 'frect': pfill(ox + 1, oy + 2, 15, 11, 3); box(ox + 1, oy + 2, 15, 11); break;
489
+ case 'rrect': case 'frrect': if (tool === 'frrect') pfill(ox + 2, oy + 3, 13, 9, 3); hl(ox + 3, ox + 13, oy + 2); hl(ox + 3, ox + 13, oy + 12); vl(ox + 1, oy + 4, oy + 10); vl(ox + 15, oy + 4, oy + 10); px(ox + 2, oy + 3); px(ox + 14, oy + 3); px(ox + 2, oy + 11); px(ox + 14, oy + 11); break;
490
+ case 'oval': oval(ox + 8, oy + 7, 8, 6, 'line'); break;
491
+ case 'foval': oval(ox + 8, oy + 7, 8, 6, 3); break;
492
+ case 'free': for (let x = 0; x < 15; x++) px(ox + 1 + x, oy + 7 + Math.sin(x * 0.7) * 4 + (x > 10 ? 2 : 0)); break;
493
+ case 'poly': line(ox + 1, oy + 12, ox + 5, oy + 1); line(ox + 5, oy + 1, ox + 15, oy + 5); line(ox + 15, oy + 5, ox + 10, oy + 12); line(ox + 10, oy + 12, ox + 1, oy + 12); break;
494
+ }
495
+ if (tool === activeTool) for (let y = cy + 1; y < cy + ch2; y++) for (let x = cx + 1; x < cx + cw2; x++) inv(x, y);
496
+ });
497
+ // line-width selector
498
+ const lwy = tpy + 9 * ch2 + 10;
499
+ box(tpx, lwy, 2 * cw2 + 1, 60);
500
+ [1, 2, 3, 4, 6].forEach((w, i) => { const y = lwy + 6 + i * 10; fill(tpx + 8, y, 2 * cw2 - 15, w); if (i === 1) { px(tpx + 3, y); px(tpx + 4, y); px(tpx + 3, y + 1); } });
501
+
502
+ // ---------- canvas area ----------
503
+ const cx0 = wx + 68, cy0 = wy + 26, cwid = ww - 76, chei = 246;
504
+ box(cx0 - 1, cy0 - 1, cwid + 2, chei + 2);
505
+
506
+ // grayscale "digitized" render of the subject, then real Atkinson dithering
507
+ const G = H.layer(cwid, chei), g = G.getContext('2d', { willReadFrequently: true });
508
+ const bx = cwid * 0.73, by = 108, R = 52;
509
+ const pulse = 0.5;
510
+ // backdrop: wall with glow falloff, table plane
511
+ const bg = g.createRadialGradient(bx, by, 10, bx, by, 300);
512
+ bg.addColorStop(0, '#fff'); bg.addColorStop(0.25, '#e8e8e8'); bg.addColorStop(0.6, '#8a8a8a'); bg.addColorStop(1, '#3a3a3a');
513
+ g.fillStyle = bg; g.fillRect(0, 0, cwid, chei);
514
+ const tableY = 222;
515
+ const tg = g.createLinearGradient(0, tableY, 0, chei);
516
+ tg.addColorStop(0, '#b0b0b0'); tg.addColorStop(1, '#4a4a4a');
517
+ g.fillStyle = tg; g.fillRect(0, tableY, cwid, chei - tableY);
518
+ // soft contact shadow + glow pool
519
+ const sh = g.createRadialGradient(bx, tableY + 10, 2, bx, tableY + 10, 80);
520
+ sh.addColorStop(0, 'rgba(0,0,0,0.75)'); sh.addColorStop(1, 'rgba(0,0,0,0)');
521
+ g.save(); g.translate(bx, tableY + 10); g.scale(1, 0.18); g.translate(-bx, -(tableY + 10)); g.fillStyle = sh; g.fillRect(bx - 90, tableY - 400, 180, 900); g.restore();
522
+ // glass bulb: luminous core, darker fresnel rim
523
+ g.save();
524
+ g.beginPath(); g.arc(bx, by, R, Math.PI * 0.72, Math.PI * 0.28 + Math.PI * 2);
525
+ g.lineTo(bx + R * 0.34, by + R * 1.28); g.lineTo(bx - R * 0.34, by + R * 1.28); g.closePath();
526
+ const gl = g.createRadialGradient(bx - 8, by - 6, 4, bx, by + 6, R * 1.25);
527
+ gl.addColorStop(0, '#ffffff'); gl.addColorStop(0.35 + pulse * 0.08, '#f4f4f4'); gl.addColorStop(0.75, '#b8b8b8'); gl.addColorStop(1, '#5a5a5a');
528
+ g.fillStyle = gl; g.fill();
529
+ g.clip();
530
+ // specular window reflection
531
+ g.fillStyle = 'rgba(255,255,255,0.9)';
532
+ g.beginPath(); g.ellipse(bx - R * 0.45, by - R * 0.45, R * 0.18, R * 0.32, -0.7, 0, 7); g.fill();
533
+ // circuit-brain filament inside the bulb
534
+ g.strokeStyle = '#1a1a1a'; g.lineWidth = 2.2; g.lineCap = 'round';
535
+ const rb = H.rng(77);
536
+ g.beginPath(); // two hemispheres
537
+ for (const s of [-1, 1]) {
538
+ g.moveTo(bx, by - 30);
539
+ g.bezierCurveTo(bx + s * 30, by - 42, bx + s * 52, by - 16, bx + s * 42, by + 8);
540
+ g.bezierCurveTo(bx + s * 40, by + 28, bx + s * 14, by + 30, bx, by + 22);
541
+ }
542
+ g.moveTo(bx, by - 30); g.lineTo(bx, by + 22);
543
+ g.stroke();
544
+ g.lineWidth = 1.6;
545
+ for (let k = 0; k < 9; k++) { // circuit traces with pads
546
+ const s = k % 2 ? 1 : -1, y0 = by - 22 + k * 5.5, x1 = bx + s * rb.range(14, 34), y1 = y0 + rb.range(-6, 6);
547
+ g.beginPath(); g.moveTo(bx + s * 3, y0); g.lineTo(bx + s * 10, y0); g.lineTo(x1, y1); g.stroke();
548
+ g.beginPath(); g.arc(x1, y1, 2.6, 0, 7); g.fillStyle = '#000'; g.fill();
549
+ }
550
+ // filament stems down to base
551
+ g.lineWidth = 2; g.beginPath(); g.moveTo(bx - 6, by + 22); g.lineTo(bx - 9, by + R * 1.25); g.moveTo(bx + 6, by + 22); g.lineTo(bx + 9, by + R * 1.25); g.stroke();
552
+ g.restore();
553
+ // screw base: metallic cylinder with ridges
554
+ const b0 = by + R * 1.26, bw = R * 0.74;
555
+ for (let k = 0; k < 5; k++) {
556
+ const y = b0 + k * 8;
557
+ const cg = g.createLinearGradient(bx - bw / 2, 0, bx + bw / 2, 0);
558
+ cg.addColorStop(0, '#101010'); cg.addColorStop(0.28, '#9a9a9a'); cg.addColorStop(0.4, '#e8e8e8'); cg.addColorStop(0.62, '#707070'); cg.addColorStop(1, '#0a0a0a');
559
+ g.fillStyle = cg; g.beginPath(); g.ellipse(bx, y + 4, bw / 2 - k * 0.6, 5.5, 0, 0, 7); g.fill();
560
+ g.fillRect(bx - bw / 2 + k * 0.6, y, bw - k * 1.2, 4.5);
561
+ }
562
+ g.fillStyle = '#111'; g.beginPath(); g.ellipse(bx, b0 + 42, 8, 5, 0, 0, 7); g.fill();
563
+
564
+ // Atkinson dithering (6/8 of error diffused -> blown highlights, crunchy darks)
565
+ const id = g.getImageData(0, 0, cwid, chei).data;
566
+ const lum = new Float32Array(cwid * chei);
567
+ for (let i = 0; i < lum.length; i++) lum[i] = (id[i * 4] * 0.299 + id[i * 4 + 1] * 0.587 + id[i * 4 + 2] * 0.114) / 255;
568
+ // the "scan" builds in over time: rows below scanY are still blank
569
+ const scanY = Math.floor(H.clamp((t - 0.45) / 1.4) * chei);
570
+ for (let y = 0; y < chei; y++) for (let x = 0; x < cwid; x++) {
571
+ const i = y * cwid + x, o = lum[i], n = o < 0.5 ? 0 : 1, e = (o - n) / 8;
572
+ lum[i] = n;
573
+ if (x + 1 < cwid) lum[i + 1] += e;
574
+ if (x + 2 < cwid) lum[i + 2] += e;
575
+ if (y + 1 < chei) { if (x > 0) lum[i + cwid - 1] += e; lum[i + cwid] += e; if (x + 1 < cwid) lum[i + cwid + 1] += e; }
576
+ if (y + 2 < chei) lum[i + 2 * cwid] += e;
577
+ px(cx0 + x, cy0 + y, y <= scanY ? (n ? 0 : 1) : 0);
578
+ }
579
+
580
+ // scanner head: an inverted band riding the scan line
581
+ if (scanY < chei && t > 0.45) for (let y = scanY + 1; y < Math.min(chei, scanY + 3); y++) for (let x = 0; x < cwid; x++) inv(cx0 + x, cy0 + y);
582
+ // crisp hand-drawn overlays (pencil + line tools) on top of the dither
583
+ const BX = cx0 + bx, BY = cy0 + by;
584
+ const outP = H.clamp((t - 1.9) / 0.38);
585
+ if (outP > 0) {
586
+ const aEnd = Math.PI * 0.72 + Math.PI * 1.56 * outP;
587
+ for (let a = Math.PI * 0.72; a < aEnd; a += 0.004) px(BX + Math.cos(a) * R, BY + Math.sin(a) * R);
588
+ if (outP >= 1) {
589
+ line(BX + Math.cos(Math.PI * 0.28) * R, BY + Math.sin(Math.PI * 0.28) * R, BX + R * 0.34, BY + R * 1.28);
590
+ line(BX + Math.cos(Math.PI * 0.72) * R, BY + Math.sin(Math.PI * 0.72) * R, BX - R * 0.34, BY + R * 1.28);
591
+ } else { // pencil cursor at the tip
592
+ const pxc = Math.round(BX + Math.cos(aEnd) * R), pyc = Math.round(BY + Math.sin(aEnd) * R);
593
+ for (let q = 0; q < 12; q++) { px(pxc + q, pyc - q, 1); px(pxc + q + 2, pyc - q + 2, 1); px(pxc + q + 1, pyc - q + 1, 0); }
594
+ }
595
+ }
596
+ // rays: line tool, 2px, one per click-drag
597
+ const rayT = (t - 2.3) / 0.092, nRays = Math.floor(rayT);
598
+ for (let k = 0; k < 11; k++) {
599
+ if (k > nRays) break;
600
+ const a = -Math.PI * 0.9 + k * (Math.PI * 0.85 / 10);
601
+ const r0 = R + 14, r1full = R + 30 + (k % 2) * 12 + pulse * 4;
602
+ const r1 = k < nRays ? r1full : r0 + (r1full - r0) * H.clamp(rayT - nRays);
603
+ for (let s = r0; s < r1; s++) { px(BX + Math.cos(a) * s, BY + Math.sin(a) * s); px(BX + Math.cos(a) * s + 1, BY + Math.sin(a) * s); }
604
+ if (k === nRays && t < 3.35) { // crosshair cursor mid-drag
605
+ const chx = Math.round(BX + Math.cos(a) * r1), chy = Math.round(BY + Math.sin(a) * r1);
606
+ for (let q = -7; q <= 7; q++) { if (Math.abs(q) > 1) { px(chx + q, chy, 1); px(chx, chy + q, 1); px(chx + q, chy - 1, 0); px(chx + q, chy + 1, 0); px(chx - 1, chy + q, 0); px(chx + 1, chy + q, 0); } }
607
+ }
608
+ }
609
+ // floor: paint-bucket flood of a pattern, horizon line on top
610
+ const flY = cy0 + tableY;
611
+ if (t >= 3.42) { pfill(cx0, flY, cwid, cy0 + chei - flY, 24); hl(cx0, cx0 + cwid - 1, flY); }
612
+ // patterned cast shadow (oval tool, 50% gray)
613
+ if (t >= 3.5) oval(Math.round(BX), flY + 4, 40, 3, 2);
614
+ // stack of books drawn with rect tool + fills
615
+ const books = [[34, 120, 13, 8], [42, 104, 11, 6], [30, 112, 12, 21]];
616
+ const nBooks = H.clamp(Math.floor((t - 3.55) / 0.13) + 1, 0, 3);
617
+ let byy = flY;
618
+ books.slice(0, nBooks).forEach(([bxl, bwd, bht, pt]) => { byy -= bht; const x0 = cx0 + bxl; fill(x0, byy, bwd, bht, 0); pfill(x0 + 6, byy + 2, bwd - 12, bht - 4, pt); box(x0, byy, bwd, bht + 1); vl(x0 + 4, byy, byy + bht); vl(x0 + bwd - 5, byy, byy + bht); });
619
+ // title lettering in a bitmap serif, with marching-ants selection
620
+ const ttl = 'Bright Machine';
621
+ tx.font = '700 34px "Libre Baskerville"';
622
+ const ttw = Math.ceil(tx.measureText(ttl).width);
623
+ const ttx = cx0 + 16, tty = cy0 + 12;
624
+ if (t >= 3.95) {
625
+ fill(ttx - 6, tty - 4, ttw + 12, 58, 0);
626
+ const nT = H.clamp(Math.floor((t - 3.98) / 0.036), 0, ttl.length);
627
+ const sub = 'an idea, in 1-bit', nS = H.clamp(Math.floor((t - 4.5) / 0.013), 0, sub.length);
628
+ text(ttl.slice(0, nT), ttx, tty, '700 34px "Libre Baskerville"', 1, 110);
629
+ const ant = Math.floor(t * 8);
630
+ const antBox = (x, y, w, h) => {
631
+ let k = 0;
632
+ const step = (xx, yy) => { if (((k + ant) >> 2) & 1) px(xx, yy, 1); else px(xx, yy, 0); k++; };
633
+ for (let i = 0; i < w; i++) step(x + i, y);
634
+ for (let j = 0; j < h; j++) step(x + w, y + j);
635
+ for (let i = w; i > 0; i--) step(x + i, y + h);
636
+ for (let j = h; j > 0; j--) step(x, y + j);
637
+ };
638
+ if (t >= 4.75) antBox(ttx - 7, tty - 5, ttw + 13, 59);
639
+ if (nS > 0) text(sub.slice(0, nS), ttx + 3, tty + 38, '700 13px "Inter"', 1, 120);
640
+ if (t < 4.75) { // I-beam text cursor after the last typed glyph
641
+ tx.font = nS > 0 ? '700 13px "Inter"' : '700 34px "Libre Baskerville"';
642
+ const ibx = ttx + Math.ceil(tx.measureText(nS > 0 ? sub.slice(0, nS) : ttl.slice(0, nT)).width) + 3, iby = nS > 0 ? tty + 38 : tty + 2, ibh = nS > 0 ? 14 : 34;
643
+ if (Math.floor(t * 4) % 2 === 0 || nS > 0) { vl(ibx, iby, iby + ibh); px(ibx - 1, iby); px(ibx + 1, iby); px(ibx - 1, iby + ibh); px(ibx + 1, iby + ibh); }
644
+ }
645
+ }
646
+
647
+ // ---------- pattern palette ----------
648
+ const ppy = cy0 + chei + 8, ppx = cx0;
649
+ const nCols = Math.floor(cwid / 25);
650
+ for (let k = 0; k < nCols * 2; k++) {
651
+ const c = k % nCols, rr2 = Math.floor(k / nCols), x = ppx + c * 25, y = ppy + rr2 * 17;
652
+ pfill(x + 1, y + 1, 24, 16, k % PAT.length); box(x, y, 26, 18);
653
+ }
654
+ // current fill pattern + line sample
655
+ box(tpx, ppy, 2 * cw2 + 1, 35); pfill(tpx + 3, ppy + 3, 2 * cw2 - 5, 29, 9); box(tpx + 3, ppy + 3, 2 * cw2 - 5, 29);
656
+
657
+ // Finder "zoom rects": the window opens out of the disk icon
658
+ if (t < 0.4) {
659
+ for (let y = wy; y <= wy + wh + 1; y++) for (let x = wx; x <= wx + ww + 1; x++) B[y * SW + x] = (x + y) & 1;
660
+ const src = [592, 32, 26, 20], dst = [wx, wy, ww, wh];
661
+ const head = Math.floor(H.clamp(t / 0.36) * 8);
662
+ for (let k = Math.max(0, head - 3); k <= head; k++) {
663
+ const f = k / 8, q = src.map((v, i) => Math.round(v + (dst[i] - v) * f));
664
+ box(q[0], q[1], q[2], q[3], 1); box(q[0] + 1, q[1] + 1, q[2] - 2, q[3] - 2, 0);
665
+ }
666
+ }
667
+ // ---------- blit: 1-bit -> pixels, pixel-doubled ----------
668
+ const lc = H.layer(SW, SH), lx = lc.getContext('2d');
669
+ const img = lx.createImageData(SW, SH);
670
+ for (let i = 0; i < B.length; i++) { const v = B[i] ? 0 : 255; img.data[i * 4] = v; img.data[i * 4 + 1] = v; img.data[i * 4 + 2] = v; img.data[i * 4 + 3] = 255; }
671
+ lx.putImageData(img, 0, 0);
672
+ ctx.save(); ctx.imageSmoothingEnabled = false; ctx.drawImage(lc, 0, 0, W, H_); ctx.restore();
673
+ },
674
+ });
675
+ }