@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,730 @@
1
+ {
2
+ // ---------- radiograph of a robot hand on a lightbox ----------
3
+ const dens = (a) => `rgba(255,255,255,${a})`;
4
+
5
+ // tapered bone outline between two points (waisted shaft, flared condyles)
6
+ function bonePath(x, x1, y1, x2, y2, w) {
7
+ const dx = x2 - x1, dy = y2 - y1, L = Math.hypot(dx, dy), ux = dx / L, uy = dy / L, px = -uy, py = ux;
8
+ const P = (s, o) => [x1 + ux * s + px * o, y1 + uy * s + py * o];
9
+ const hw = w / 2, mw = w * 0.36;
10
+ x.beginPath();
11
+ let p = P(0, -hw); x.moveTo(...p);
12
+ let c = P(L * 0.5, -mw), e = P(L, -hw * 0.92); x.quadraticCurveTo(...c, ...e);
13
+ x.arc(x2, y2, hw * 0.92, Math.atan2(-py, -px), Math.atan2(py, px));
14
+ c = P(L * 0.5, mw); e = P(0, hw); x.quadraticCurveTo(...c, ...e);
15
+ x.arc(x1, y1, hw, Math.atan2(py, px), Math.atan2(-py, -px));
16
+ x.closePath();
17
+ }
18
+ function bone(x, x1, y1, x2, y2, w) {
19
+ bonePath(x, x1, y1, x2, y2, w);
20
+ x.fillStyle = dens(0.11); x.fill();
21
+ x.strokeStyle = dens(0.08); x.lineWidth = 9; x.stroke();
22
+ x.strokeStyle = dens(0.2); x.lineWidth = 3; x.stroke(); // cortical shell
23
+ }
24
+ function pin(x, cx, cy, r) {
25
+ x.fillStyle = dens(0.14); x.beginPath(); x.arc(cx, cy, r, 0, 7); x.fill();
26
+ x.strokeStyle = dens(0.75); x.lineWidth = 3.5; x.beginPath(); x.arc(cx, cy, r * 0.62, 0, 7); x.stroke();
27
+ x.fillStyle = dens(0.35); x.beginPath(); x.arc(cx, cy, r * 0.22, 0, 7); x.fill();
28
+ }
29
+ function screw(x, cx, cy, a, len, w) {
30
+ x.save(); x.translate(cx, cy); x.rotate(a);
31
+ x.fillStyle = dens(0.8); x.fillRect(-w / 2, 0, w, len);
32
+ x.fillStyle = dens(0.85); x.beginPath(); x.ellipse(0, 0, w * 0.9, w * 0.45, 0, 0, 7); x.fill();
33
+ x.strokeStyle = dens(0.25); x.lineWidth = 1;
34
+ for (let k = 4; k < len; k += 3) { x.beginPath(); x.moveTo(-w / 2 - 1.5, k); x.lineTo(w / 2 + 1.5, k + 1.5); x.stroke(); }
35
+ x.restore();
36
+ }
37
+ function gear(x, cx, cy, r, teeth, d) {
38
+ x.fillStyle = dens(d); x.beginPath();
39
+ for (let i = 0; i < teeth * 2; i++) {
40
+ const a = i / (teeth * 2) * Math.PI * 2, rr = i % 2 ? r : r * 0.84;
41
+ const a2 = (i + 1) / (teeth * 2) * Math.PI * 2;
42
+ x.lineTo(cx + Math.cos(a) * rr, cy + Math.sin(a) * rr); x.lineTo(cx + Math.cos(a2) * rr, cy + Math.sin(a2) * rr);
43
+ }
44
+ x.closePath(); x.fill();
45
+ x.fillStyle = dens(d * 0.8); x.beginPath(); x.arc(cx, cy, r * 0.25, 0, 7); x.fill();
46
+ }
47
+
48
+ // draws one robot hand into density ctx x (local coords: wrist at 0,0; fingers up)
49
+ function hand(x, sil, curl, t) {
50
+ const fingers = [
51
+ { b: [-80, -236], a: -0.17, L: [92, 60, 46], w: 31, m: [-44, -86] },
52
+ { b: [-18, -254], a: -0.04, L: [104, 68, 50], w: 32, m: [-12, -92] },
53
+ { b: [44, -244], a: 0.09, L: [96, 63, 47], w: 31, m: [20, -90] },
54
+ { b: [100, -210], a: 0.24, L: [74, 50, 40], w: 27, m: [50, -80] },
55
+ ];
56
+ const thumb = { b: [-108, -124], a: -0.82, L: [70, 56, 46], w: 32, m: [-56, -60] };
57
+ const chains = [];
58
+ const chain = (f, isThumb) => {
59
+ let [cx, cy] = f.b, a = f.a; const pts = [[cx, cy]];
60
+ f.L.forEach((len, i) => {
61
+ a += (i === 0 ? 0 : curl * (isThumb ? 0.25 : 0.12)) + Math.sin(t * 1.3 + i + f.b[0]) * 0.015;
62
+ cx += Math.sin(a) * len; cy -= Math.cos(a) * len; pts.push([cx, cy]);
63
+ });
64
+ return pts;
65
+ };
66
+ const all = fingers.map((f) => ({ f, pts: chain(f, false) }));
67
+ const th = { f: thumb, pts: chain(thumb, true) };
68
+ all.push(th);
69
+ // ---- soft tissue (silicone skin glove) silhouette ----
70
+ sil.lineCap = 'round'; sil.lineJoin = 'round'; sil.strokeStyle = '#fff'; sil.fillStyle = '#fff';
71
+ all.forEach(({ f, pts }) => {
72
+ sil.lineWidth = f.w * 1.6; sil.beginPath(); sil.moveTo(...f.m); pts.forEach((p) => sil.lineTo(...p)); sil.stroke();
73
+ });
74
+ sil.beginPath(); sil.moveTo(-120, -40); sil.quadraticCurveTo(-158, -150, -110, -246); sil.lineTo(128, -222);
75
+ sil.quadraticCurveTo(146, -110, 112, -20); sil.quadraticCurveTo(80, 40, 70, 260); sil.lineTo(-74, 260); sil.quadraticCurveTo(-80, 40, -120, -40); sil.fill();
76
+
77
+ // ---- forearm actuator rods ----
78
+ bone(x, -40, 300, -34, 52, 36); bone(x, 40, 300, 34, 56, 32);
79
+ x.fillStyle = dens(0.35); x.fillRect(-46, 120, 8, 150); x.fillRect(36, 130, 7, 140); // piston rods inside
80
+ // ---- wrist bearing ring ----
81
+ for (let i = 0; i < 18; i++) {
82
+ const a = i / 18 * Math.PI * 2; x.fillStyle = dens(0.42);
83
+ x.beginPath(); x.arc(Math.cos(a) * 58, 26 + Math.sin(a) * 20, 6, 0, 7); x.fill();
84
+ }
85
+ x.strokeStyle = dens(0.28); x.lineWidth = 5; x.beginPath(); x.ellipse(0, 26, 66, 25, 0, 0, 7); x.stroke();
86
+ x.beginPath(); x.ellipse(0, 26, 50, 16, 0, 0, 7); x.stroke();
87
+ // ---- carpal servo block ----
88
+ [[-62, -78, 54, 50], [-6, -86, 58, 54], [52, -76, 48, 48]].forEach(([sx, sy, sw, sh], i) => {
89
+ x.fillStyle = dens(0.13); x.beginPath(); x.roundRect(sx, sy, sw, sh, 6); x.fill();
90
+ x.strokeStyle = dens(0.3); x.lineWidth = 3; x.stroke();
91
+ gear(x, sx + sw / 2, sy + sh / 2, sw * 0.32, 12, 0.32);
92
+ x.strokeStyle = dens(0.12); x.lineWidth = 1.2;
93
+ for (let k = 0; k < 7; k++) { x.beginPath(); x.moveTo(sx + 6, sy + 6 + k * 2); x.lineTo(sx + sw - 6, sy + 6 + k * 2); x.stroke(); }
94
+ screw(x, sx + 6, sy + sh - 4, 0, 10, 5); screw(x, sx + sw - 6, sy + sh - 4, 0, 10, 5);
95
+ });
96
+ // ---- palm: battery cell + PCB ----
97
+ x.fillStyle = dens(0.08); x.beginPath(); x.roundRect(-92, -210, 190, 112, 8); x.fill(); // PCB
98
+ x.strokeStyle = dens(0.1); x.lineWidth = 1.2;
99
+ for (let k = 0; k < 14; k++) { x.beginPath(); x.moveTo(-86, -200 + k * 7.5); x.lineTo(-30 + (k % 3) * 12, -200 + k * 7.5); x.lineTo(-20 + (k % 3) * 12, -190 + k * 7.5); x.stroke(); }
100
+ x.fillStyle = dens(0.3); x.fillRect(30, -190, 44, 30); x.fillRect(-70, -136, 26, 18); x.fillRect(50, -140, 16, 22);
101
+ x.fillStyle = dens(0.45); for (let k = 0; k < 8; k++) { x.fillRect(28 + k * 6, -194, 2, 4); x.fillRect(28 + k * 6, -160, 2, 4); }
102
+ // battery (rolled cell: concentric layers)
103
+ x.save(); x.translate(-6, -150); x.rotate(0.02);
104
+ x.fillStyle = dens(0.12); x.beginPath(); x.roundRect(-22, -48, 44, 96, 10); x.fill();
105
+ x.strokeStyle = dens(0.38); x.lineWidth = 3; x.stroke();
106
+ x.strokeStyle = dens(0.09); x.lineWidth = 1;
107
+ for (let k = 1; k < 6; k++) { x.beginPath(); x.roundRect(-22 + k * 3.5, -48 + k * 3, 44 - k * 7, 96 - k * 6, 8); x.stroke(); }
108
+ x.fillStyle = dens(0.5); x.fillRect(-6, -54, 12, 6);
109
+ x.restore();
110
+ // ---- metacarpals ----
111
+ all.forEach(({ f }) => bone(x, f.m[0], f.m[1], f.b[0], f.b[1], f.w * 0.92));
112
+ // ---- phalanges + joints ----
113
+ all.forEach(({ f, pts }) => {
114
+ for (let i = 0; i < pts.length - 1; i++) {
115
+ const w = f.w * (1 - i * 0.12);
116
+ bone(x, pts[i][0], pts[i][1], pts[i + 1][0], pts[i + 1][1], w);
117
+ }
118
+ pts.slice(0, -1).forEach((p, i) => pin(x, p[0], p[1], f.w * (0.42 - i * 0.04)));
119
+ // fingertip sensor pad + chip
120
+ const tip = pts[pts.length - 1], pr = pts[pts.length - 2], a = Math.atan2(tip[1] - pr[1], tip[0] - pr[0]);
121
+ x.save(); x.translate(tip[0], tip[1]); x.rotate(a);
122
+ x.fillStyle = dens(0.4); x.fillRect(-16, -5, 12, 10);
123
+ x.restore();
124
+ // tendon cables (steel), both sides of each finger
125
+ [-1, 1].forEach((sd) => {
126
+ x.strokeStyle = dens(0.22); x.lineWidth = 1.4; x.beginPath();
127
+ const o = (p, q) => { const dx = q[0] - p[0], dy = q[1] - p[1], L = Math.hypot(dx, dy); return [-dy / L * sd * f.w * 0.36, dx / L * sd * f.w * 0.36]; };
128
+ const om = o(f.m, f.b); x.moveTo(f.m[0] + om[0], f.m[1] + om[1] + 40);
129
+ for (let i = 0; i < pts.length - 1; i++) { const op = o(pts[i], pts[i + 1]); x.lineTo(pts[i][0] + op[0], pts[i][1] + op[1]); x.lineTo(pts[i + 1][0] + op[0] * 0.8, pts[i + 1][1] + op[1] * 0.8); }
130
+ x.stroke();
131
+ });
132
+ // screws at metacarpal heads
133
+ screw(x, f.m[0] + 4, f.m[1] - 6, Math.atan2(f.b[0] - f.m[0], -(f.b[1] - f.m[1])) + Math.PI, 18, 5);
134
+ });
135
+ // wiring loom from wrist into palm
136
+ x.strokeStyle = dens(0.14); x.lineWidth = 1.3;
137
+ for (let k = 0; k < 6; k++) { x.beginPath(); x.moveTo(-12 + k * 5, 280); x.bezierCurveTo(-10 + k * 6, 120, 30 - k * 8, -30, -40 + k * 18, -100); x.stroke(); }
138
+ return all;
139
+ }
140
+
141
+ // ================= EXPLAINER: a radiologist working a lightbox; films are slapped up and pulled down =================
142
+ let exNoise = null;
143
+ function getFilmNoise(W, Hh) {
144
+ if (exNoise) return exNoise;
145
+ const nz = H.makeNoise(31), R = H.rng(919), mott = new Float32Array(W * Hh), grain = new Float32Array(W * Hh);
146
+ const LW = W / 4, LH = Hh / 4, low = new Float32Array((LW + 1) * (LH + 1));
147
+ for (let y = 0; y <= LH; y++) for (let x = 0; x <= LW; x++) low[y * (LW + 1) + x] = nz.fbm2(x * 0.016, y * 0.016, 3) * 0.04;
148
+ for (let y = 0; y < Hh; y++) for (let x = 0; x < W; x++) {
149
+ const fx = x / 4, fy = y / 4, ix = fx | 0, iy = fy | 0, ax = fx - ix, ay = fy - iy, j = iy * (LW + 1) + ix;
150
+ mott[y * W + x] = (low[j] * (1 - ax) + low[j + 1] * ax) * (1 - ay) + (low[j + LW + 1] * (1 - ax) + low[j + LW + 2] * ax) * ay;
151
+ grain[y * W + x] = (R() + R() + R() - 1.5) * 0.05;
152
+ }
153
+ return (exNoise = { mott, grain });
154
+ }
155
+ function gearR(x, cx, cy, r, teeth, d, rot) { x.save(); x.translate(cx, cy); x.rotate(rot); gear(x, 0, 0, r, teeth, d); x.restore(); }
156
+ function catSkull(x, cx, cy, s) {
157
+ x.fillStyle = dens(0.07); x.beginPath(); x.ellipse(cx, cy + s * 0.05, s * 1.1, s * 0.95, 0, 0, 7); x.fill();
158
+ x.beginPath(); x.moveTo(cx - s * 1.0, cy - s * 0.3); x.lineTo(cx - s * 0.85, cy - s * 1.35); x.lineTo(cx - s * 0.3, cy - s * 0.85); x.fill();
159
+ x.beginPath(); x.moveTo(cx + s * 1.0, cy - s * 0.3); x.lineTo(cx + s * 0.85, cy - s * 1.35); x.lineTo(cx + s * 0.3, cy - s * 0.85); x.fill();
160
+ x.fillStyle = dens(0.12); x.strokeStyle = dens(0.24); x.lineWidth = 4;
161
+ x.beginPath(); x.ellipse(cx, cy - s * 0.12, s * 0.82, s * 0.66, 0, 0, 7); x.fill(); x.stroke();
162
+ x.strokeStyle = dens(0.3); x.lineWidth = 5;
163
+ x.beginPath(); x.arc(cx - s * 0.38, cy - s * 0.05, s * 0.24, 0, 7); x.stroke(); x.beginPath(); x.arc(cx + s * 0.38, cy - s * 0.05, s * 0.24, 0, 7); x.stroke();
164
+ x.fillStyle = dens(0.1); x.beginPath(); x.ellipse(cx, cy + s * 0.38, s * 0.36, s * 0.24, 0, 0, 7); x.fill(); x.strokeStyle = dens(0.18); x.lineWidth = 3; x.stroke();
165
+ x.fillStyle = dens(0.45); for (let k = -3; k <= 3; k++) x.fillRect(cx + k * s * 0.08 - 2, cy + s * 0.55, 4, k === -3 || k === 3 ? 14 : 7);
166
+ x.strokeStyle = dens(0.22); x.lineWidth = 4; x.beginPath(); x.arc(cx, cy + s * 0.35, s * 0.48, 0.3, Math.PI - 0.3); x.stroke();
167
+ }
168
+ function dogSkull(x, cx, cy, s) {
169
+ x.fillStyle = dens(0.07);
170
+ x.beginPath(); x.ellipse(cx - s * 0.2, cy, s * 0.9, s * 0.75, 0, 0, 7); x.fill();
171
+ x.beginPath(); x.roundRect(cx, cy - s * 0.3, s * 1.25, s * 0.62, s * 0.3); x.fill();
172
+ x.beginPath(); x.ellipse(cx - s * 0.75, cy + s * 0.2, s * 0.3, s * 0.65, 0.3, 0, 7); x.fill();
173
+ x.fillStyle = dens(0.12); x.strokeStyle = dens(0.24); x.lineWidth = 4;
174
+ x.beginPath(); x.ellipse(cx - s * 0.3, cy - s * 0.12, s * 0.65, s * 0.5, 0, 0, 7); x.fill(); x.stroke();
175
+ x.beginPath(); x.moveTo(cx + s * 0.05, cy - s * 0.32); x.lineTo(cx + s * 1.15, cy - s * 0.12); x.lineTo(cx + s * 1.15, cy + s * 0.12); x.lineTo(cx + s * 0.05, cy + s * 0.2); x.fill(); x.stroke();
176
+ x.strokeStyle = dens(0.3); x.lineWidth = 5; x.beginPath(); x.arc(cx - s * 0.05, cy - s * 0.18, s * 0.2, 0, 7); x.stroke();
177
+ x.fillStyle = dens(0.45); for (let k = 0; k < 8; k++) x.fillRect(cx + s * 0.15 + k * s * 0.12, cy + s * 0.14, 4, k === 6 ? 14 : 7);
178
+ x.strokeStyle = dens(0.22); x.lineWidth = 4; x.beginPath(); x.moveTo(cx - s * 0.5, cy + s * 0.3); x.quadraticCurveTo(cx + s * 0.4, cy + s * 0.55, cx + s * 1.1, cy + s * 0.25); x.stroke();
179
+ }
180
+ function robotHead(x, cx, cy, s, rot, glow) {
181
+ x.fillStyle = dens(0.06); x.strokeStyle = dens(0.28); x.lineWidth = 7;
182
+ x.beginPath(); x.roundRect(cx - s, cy - s * 0.9, s * 2, s * 1.7, s * 0.35); x.fill(); x.stroke();
183
+ x.strokeStyle = dens(0.12); x.lineWidth = 3; x.beginPath(); x.roundRect(cx - s * 0.88, cy - s * 0.78, s * 1.76, s * 1.46, s * 0.28); x.stroke();
184
+ x.strokeStyle = dens(0.55); x.lineWidth = 7; x.beginPath(); x.arc(cx - s * 0.45, cy - s * 0.35, s * 0.2, 0, 7); x.stroke(); x.beginPath(); x.arc(cx + s * 0.45, cy - s * 0.35, s * 0.2, 0, 7); x.stroke();
185
+ x.fillStyle = dens(0.18); x.beginPath(); x.arc(cx - s * 0.45, cy - s * 0.35, s * 0.1, 0, 7); x.arc(cx + s * 0.45, cy - s * 0.35, s * 0.1, 0, 7); x.fill();
186
+ // the "learning" mechanism: three gears (weights) + chip
187
+ gearR(x, cx - s * 0.42, cy + s * 0.25, s * 0.26, 12, 0.3, rot[0]);
188
+ gearR(x, cx + s * 0.02, cy + s * 0.32, s * 0.2, 10, 0.3, rot[1]);
189
+ gearR(x, cx + s * 0.42, cy + s * 0.22, s * 0.24, 11, 0.3, rot[2]);
190
+ x.fillStyle = dens(0.25 + glow * 0.3); x.fillRect(cx - s * 0.2, cy - s * 0.72, s * 0.4, s * 0.22);
191
+ x.fillStyle = dens(0.5); for (let k = 0; k < 6; k++) { x.fillRect(cx - s * 0.18 + k * s * 0.07, cy - s * 0.78, 3, 6); x.fillRect(cx - s * 0.18 + k * s * 0.07, cy - s * 0.48, 3, 6); }
192
+ x.strokeStyle = dens(0.12); x.lineWidth = 1.5;
193
+ for (let k = 0; k < 5; k++) { x.beginPath(); x.moveTo(cx - s * 0.2 + k * s * 0.1, cy - s * 0.5); x.bezierCurveTo(cx - s * 0.3 + k * s * 0.15, cy - s * 0.1, cx - s * 0.5 + k * s * 0.2, cy, cx - s * 0.42 + k * s * 0.2, cy + s * 0.1); x.stroke(); }
194
+ screw(x, cx - s * 0.85, cy - s * 0.75, 0.3, 16, 5); screw(x, cx + s * 0.85, cy - s * 0.75, -0.3, 16, 5);
195
+ screw(x, cx - s * 0.85, cy + s * 0.65, 2.8, 16, 5); screw(x, cx + s * 0.85, cy + s * 0.65, -2.8, 16, 5);
196
+ bone(x, cx - s * 0.25, cy + s * 0.8, cx - s * 0.25, cy + s * 1.35, s * 0.2); bone(x, cx + s * 0.25, cy + s * 0.8, cx + s * 0.25, cy + s * 1.35, s * 0.2);
197
+ x.strokeStyle = dens(0.4); x.lineWidth = 4; x.beginPath(); x.moveTo(cx, cy - s * 0.9); x.lineTo(cx, cy - s * 1.2); x.stroke();
198
+ x.fillStyle = dens(0.5); x.beginPath(); x.arc(cx, cy - s * 1.25, 8, 0, 7); x.fill();
199
+ }
200
+ function netFilm(x, cx, cy, s, order, seedN) {
201
+ const R = H.rng(seedN), L = [[-1, 3], [0, 4], [1, 2]], P = [];
202
+ L.forEach(([lx, n], li) => { P.push([]); for (let k = 0; k < n; k++) P[li].push([cx + lx * s * 0.8 + (R() - 0.5) * s * 0.9 * (1 - order), cy + (k - (n - 1) / 2) * s * 0.5 + (R() - 0.5) * s * 0.9 * (1 - order)]); });
203
+ for (let li = 0; li < 2; li++) P[li].forEach((a) => P[li + 1].forEach((b) => {
204
+ const w = R(); if (w > 0.35 + order * 0.65) return;
205
+ x.strokeStyle = dens(0.08 + order * 0.22 * (0.4 + w)); x.lineWidth = 1.5 + order * 2.5; x.beginPath(); x.moveTo(...a); x.lineTo(...b); x.stroke();
206
+ }));
207
+ P.flat().forEach(([px, py]) => { x.fillStyle = dens(0.2 + order * 0.4); x.beginPath(); x.arc(px, py, 6 + order * 4, 0, 7); x.fill(); });
208
+ }
209
+
210
+ // lead marker (as the hero's 'R PA'): a faint acrylic holder with dense lead letters inside the field
211
+ function leadMarker(x, s, lx, ly) {
212
+ x.save(); x.globalCompositeOperation = 'source-over'; x.font = '700 30px sans-serif';
213
+ const w = x.measureText(s).width;
214
+ x.fillStyle = dens(0.1); x.beginPath(); x.roundRect(lx - 7, ly - 30, w + 14, 38, 4); x.fill();
215
+ x.fillStyle = dens(0.9); x.fillText(s, lx, ly); x.restore();
216
+ }
217
+ function xrayExplainer(ctx, W, Hh, t) {
218
+ const sm = H.smooth, E = H.ease;
219
+ const hsh = (n) => { const v = Math.sin(n * 78.233 + 1.7) * 43758.5453; return v - Math.floor(v); };
220
+ const { mott, grain } = getFilmNoise(W, Hh);
221
+ const Wr = H.rng(4040);
222
+ // ---- film choreography: [enter, leave, x, y, w, h, rot, content] (films drop in from the top under the clips, get pulled down) ----
223
+ const slide = (tin, tout) => { const a = E.out(sm(tin, tin + 0.35, t)), b = E.in(sm(tout, tout + 0.3, t)); return (1 - a) * -760 + b * 780; };
224
+ const films = [];
225
+ films.push({ tin: -1, tout: 1.9, x: 120, y: 46, w: 1040, h: 700, rot: -0.006, kind: 'hook' });
226
+ for (let k = 0; k < 10; k++) films.push({ tin: 2.75 + k * 0.29, tout: 6.0, x: 70 + (k % 2) * 30 + Math.sin(k * 2.1) * 14, y: 150 + Math.cos(k * 1.7) * 18 + (k % 3) * 10, w: 330, h: 250, rot: Math.sin(k * 3.3) * 0.08, kind: k % 3 === 1 ? 'dog' : 'cat', small: k });
227
+ const modelX = H.lerp(700, 470, E.inOut(sm(6.0, 6.5, t)));
228
+ films.push({ tin: 2.35, tout: 10.3, x: modelX, y: 52, w: 460, h: 600, rot: 0.004, kind: 'model' });
229
+ films.push({ tin: 6.3, tout: 10.3, x: 28, y: 170, w: 300, h: 240, rot: -0.04, kind: 'cat' });
230
+ films.push({ tin: 10.55, tout: 99, x: 90, y: 46, w: 1100, h: 520, rot: 0.003, kind: 'rounds' });
231
+ // ---- density + film masks ----
232
+ const Dc = H.layer(W, Hh), dx = Dc.getContext('2d'); dx.fillStyle = '#000'; dx.fillRect(0, 0, W, Hh); dx.globalCompositeOperation = 'lighter';
233
+ const M = H.layer(W, Hh), mx = M.getContext('2d');
234
+ const adj = sm(8.85, 9.4, t);
235
+ const rot = [0.3 + adj * 2.2, -0.5 - adj * 2.8, 0.1 + adj * 2.5].map((a) => Math.floor(a * 6) / 6 + (adj > 0 && adj < 1 ? 0 : 0));
236
+ const drawn = [];
237
+ for (const F of films) {
238
+ const oy = slide(F.tin, F.tout);
239
+ if (oy > 760 || oy < -740) continue;
240
+ drawn.push({ ...F, oy });
241
+ const cx = F.x + F.w / 2, cy = F.y + oy + F.h / 2;
242
+ const tf = (c) => { c.save(); c.translate(cx, cy); c.rotate(F.rot); c.translate(-cx, -cy + 0); };
243
+ // later films sit on top: mask over, density replaced under them
244
+ // R = film, G = exposed (collimated) field; a later film replaces both channels under it
245
+ const ins = F.w < 400 ? 16 : 26;
246
+ tf(mx); mx.fillStyle = 'rgb(255,0,0)'; mx.fillRect(F.x, F.y + oy, F.w, F.h);
247
+ mx.fillStyle = 'rgb(255,255,0)'; mx.fillRect(F.x + ins, F.y + oy + ins, F.w - ins * 2, F.h - ins * 2); mx.restore();
248
+ tf(dx); dx.globalCompositeOperation = 'source-over'; dx.fillStyle = '#000'; dx.fillRect(F.x, F.y + oy, F.w, F.h); dx.globalCompositeOperation = 'lighter';
249
+ dx.beginPath(); dx.rect(F.x, F.y + oy, F.w, F.h); dx.clip();
250
+ const X = F.x, Y = F.y + oy;
251
+ if (F.kind === 'hook') robotHead(dx, X + 520, Y + 400, 150, [0.2, 0.9, 1.6], 0);
252
+ if (F.kind === 'cat') { catSkull(dx, X + F.w / 2 - 10, Y + F.h / 2 + 18, 70); leadMarker(dx, 'CAT', X + 30, Y + 52); }
253
+ if (F.kind === 'dog') { dogSkull(dx, X + F.w / 2 - 30, Y + F.h / 2 + 16, 68); leadMarker(dx, 'DOG', X + 30, Y + 52); }
254
+ if (F.kind === 'model') robotHead(dx, X + F.w / 2, Y + 270, 150, rot, t > 2.8 && t < 6 ? sm(2.8, 5.6, t) : 0.3);
255
+ if (F.kind === 'rounds') {
256
+ for (let r = 0; r < 4; r++) {
257
+ const dev = sm(10.95 + r * 0.4, 11.3 + r * 0.4, t);
258
+ if (dev <= 0) continue;
259
+ dx.globalAlpha = dev; netFilm(dx, X + 150 + r * 270, Y + 200, 95, [0.05, 0.4, 0.75, 1][r], 77 + r); dx.globalAlpha = 1;
260
+ }
261
+ }
262
+ dx.restore();
263
+ }
264
+ const Db = H.layer(W, Hh), dbx = Db.getContext('2d'); dbx.filter = 'blur(1px)'; dbx.drawImage(Dc, 0, 0);
265
+ // halation: a wide glow round dense parts (quarter-size blur, smooth upscale), as the hero's Dwide
266
+ const Dq = H.layer(W / 4, Hh / 4), dqx = Dq.getContext('2d'); dqx.filter = 'blur(3.5px)'; dqx.drawImage(Dc, 0, 0, W / 4, Hh / 4);
267
+ const LW = W / 4, LH = Hh / 4, Q = dqx.getImageData(0, 0, LW, LH).data, qrow = new Float32Array(LW);
268
+ const qix = new Int32Array(W), qax = new Float32Array(W);
269
+ for (let x = 0; x < W; x++) { const f = Math.min(LW - 1.001, Math.max(0, (x + 0.5) / 4 - 0.5)); qix[x] = f | 0; qax[x] = f - (f | 0); }
270
+ const D = dbx.getImageData(0, 0, W, Hh).data, md = mx.getImageData(0, 0, W, Hh).data;
271
+ // ---- transmission through film on the lightbox ----
272
+ const tubeOn = [0.05, 0.2, 0.32].map((t0, i) => t < t0 ? 0 : t - t0 > 0.3 ? 1 : (hsh(Math.floor(t * 30) + i * 13) > 0.5 ? 1 : 0.15));
273
+ const img = ctx.createImageData(W, Hh), d = img.data;
274
+ const boxRow = new Float32Array(W);
275
+ for (let x = 0; x < W; x++) {
276
+ let a = 0, ws = 0; [213, 640, 1067].forEach((tx, i) => { const w = Math.exp(-Math.pow((x - tx) / 330, 2)); a += w * tubeOn[i]; ws += w; });
277
+ boxRow[x] = (0.05 + 0.95 * a / ws) * (0.86 + 0.07 * Math.cos((x - 640) / 1280 * Math.PI * 6) - 0.08 * Math.pow(Math.abs(x - 640) / 640, 3));
278
+ }
279
+ const Rg = H.rng(5 + Math.floor(t * 30)), gk = 0.03 * 255; // the photo's moving grain (was a separate H.grain pass)
280
+ for (let y = 0; y < Hh; y++) {
281
+ const vy = 0.1 * Math.pow(Math.abs(y - 360) / 360, 2);
282
+ { const f = Math.min(LH - 1.001, Math.max(0, (y + 0.5) / 4 - 0.5)), iy = f | 0, ay = f - iy;
283
+ for (let q = 0; q < LW; q++) qrow[q] = (Q[(iy * LW + q) * 4] * (1 - ay) + Q[((iy + 1) * LW + q) * 4] * ay) / 255; }
284
+ for (let x = 0; x < W; x++) {
285
+ const i = (y * W + x) * 4, j = y * W + x, inF = md[i] / 255, inFd = md[i + 1] / 255;
286
+ const Dv = D[i] / 255 + (qrow[qix[x]] * (1 - qax[x]) + qrow[qix[x] + 1] * qax[x]) * 0.14;
287
+ const Tf = 0.045 + 0.93 * (1 - Math.exp(-3.0 * Dv)) + mott[j] * (1 - Dv) + grain[j] * (0.5 + Dv);
288
+ const Tc = 0.64 + mott[j] + grain[j] * 0.6; // collimated rebate: unexposed blue base + fog
289
+ const T = 1 + (Tc + (Tf - Tc) * inFd - 1) * inF, L = (boxRow[x] - vy) * T * 255 * 1.22;
290
+ const gn = (Rg() - 0.5) * gk;
291
+ d[i] = L * (1 - 0.2 * inF) * 0.98 + gn; d[i + 1] = L * (1 - 0.1 * inF) + gn; d[i + 2] = L * 1.04 + gn; d[i + 3] = 255;
292
+ }
293
+ }
294
+ ctx.putImageData(img, 0, 0);
295
+ // ---- film surface: emulsion scratches, dust, edge print (seeded per film, so they travel with it) ----
296
+ for (const F of drawn) {
297
+ const cx = F.x + F.w / 2, cy = F.y + F.oy + F.h / 2, X = F.x, Y = F.y + F.oy, big = F.w >= 400;
298
+ const Rf = H.rng(5100 + films.indexOf(F) * 37);
299
+ ctx.save(); ctx.translate(cx, cy); ctx.rotate(F.rot); ctx.translate(-cx, -cy);
300
+ ctx.beginPath(); ctx.rect(X, Y, F.w, F.h); ctx.clip();
301
+ const ns = big ? 5 + Math.floor(Rf() * 3) : 3;
302
+ for (let k = 0; k < ns; k++) {
303
+ const x0 = X + Rf.range(0.08, 0.92) * F.w, y0 = Y + Rf.range(0.05, 0.8) * F.h, len = Rf.range(0.15, 0.45) * F.h, a = 1.45 + Rf.range(-0.25, 0.25);
304
+ ctx.strokeStyle = `rgba(200,225,255,${Rf.range(0.08, 0.2)})`; ctx.lineWidth = Rf.range(0.5, 1.2);
305
+ ctx.beginPath(); ctx.moveTo(x0, y0); ctx.quadraticCurveTo(x0 + Math.cos(a) * len * 0.5 + Rf.range(-8, 8), y0 + Math.sin(a) * len * 0.5, x0 + Math.cos(a) * len, y0 + Math.sin(a) * len); ctx.stroke();
306
+ }
307
+ const nd = big ? 40 + Math.floor(Rf() * 20) : 18;
308
+ for (let k = 0; k < nd; k++) {
309
+ ctx.fillStyle = `rgba(0,0,0,${Rf.range(0.2, 0.6)})`;
310
+ ctx.beginPath(); ctx.ellipse(X + Rf() * F.w, Y + Rf() * F.h, Rf.range(0.5, 2), Rf.range(0.5, 1.5), Rf() * 3, 0, 7); ctx.fill();
311
+ }
312
+ for (let k = 0; k < 4; k++) { // a few bright pinholes / emulsion pick-offs
313
+ ctx.fillStyle = `rgba(215,232,255,${Rf.range(0.15, 0.35)})`;
314
+ ctx.beginPath(); ctx.arc(X + Rf() * F.w, Y + Rf() * F.h, Rf.range(0.6, 1.4), 0, 7); ctx.fill();
315
+ }
316
+ if (F.kind === 'model' || F.kind === 'rounds') {
317
+ ctx.fillStyle = 'rgba(30,40,60,0.55)'; ctx.font = '400 13px "Courier Prime"'; ctx.textAlign = 'left'; ctx.textBaseline = 'alphabetic';
318
+ if (F.kind === 'model') ctx.fillText('SAFETY \u25a0 BLUE BASE \u25a0 0713', X + 30, Y + F.h - 8);
319
+ else { ctx.textAlign = 'right'; ctx.fillText('SAFETY \u25a0 BLUE BASE 35x43 \u25a0 0714', X + F.w - 30, Y + F.h - 8); }
320
+ }
321
+ ctx.restore();
322
+ }
323
+ // ---- lightbox bloom: the bright box bleeds over film edges (as the hero) ----
324
+ {
325
+ const bright = H.layer(W / 4, Hh / 4), bx = bright.getContext('2d');
326
+ bx.filter = 'blur(6px)'; bx.drawImage(ctx.canvas, 0, 0, W / 4, Hh / 4);
327
+ const bb = bx.getImageData(0, 0, W / 4, Hh / 4), bd = bb.data;
328
+ for (let i = 0; i < bd.length; i += 4) { const l = (bd[i] + bd[i + 1] + bd[i + 2]) / 765, k = H.smooth(0.6, 0.95, l); bd[i] *= k; bd[i + 1] *= k; bd[i + 2] *= k; }
329
+ bx.putImageData(bb, 0, 0);
330
+ ctx.save(); ctx.globalCompositeOperation = 'screen'; ctx.globalAlpha = 0.55; ctx.imageSmoothingQuality = 'high'; ctx.drawImage(bright, 0, 0, W, Hh); ctx.restore();
331
+ }
332
+ // ---- film edges + clips ----
333
+ for (const F of drawn) {
334
+ const cx = F.x + F.w / 2, cy = F.y + F.oy + F.h / 2;
335
+ ctx.save(); ctx.translate(cx, cy); ctx.rotate(F.rot); ctx.translate(-cx, -cy);
336
+ ctx.strokeStyle = 'rgba(20,30,50,0.5)'; ctx.lineWidth = 1.5; ctx.strokeRect(F.x, F.y + F.oy, F.w, F.h);
337
+ if (F.small === undefined) [F.x + F.w * 0.25, F.x + F.w * 0.75].forEach((c) => {
338
+ const g2 = ctx.createLinearGradient(0, F.y + F.oy - 18, 0, F.y + F.oy + 22);
339
+ g2.addColorStop(0, '#eef2f6'); g2.addColorStop(0.35, '#8e98a3'); g2.addColorStop(0.7, '#4b525b'); g2.addColorStop(1, '#b8c0c8');
340
+ ctx.fillStyle = g2; ctx.beginPath(); ctx.roundRect(c - 30, F.y + F.oy - 18, 60, 40, 8); ctx.fill();
341
+ ctx.fillStyle = '#2a2f36'; ctx.beginPath(); ctx.arc(c, F.y + F.oy - 2, 6, 0, 7); ctx.fill();
342
+ });
343
+ ctx.restore();
344
+ }
345
+ // ---- grease pencil (on film / glass) ----
346
+ const WAX = 'rgba(255,232,140,0.92)', RED = 'rgba(225,40,30,0.95)', INK = 'rgba(24,22,26,0.92)', GRN = 'rgba(20,150,60,0.95)';
347
+ const wax = (pts, prog, col = WAX, w = 3) => {
348
+ if (prog <= 0) return; const n = Math.max(1, Math.floor((pts.length - 1) * Math.min(1, prog)));
349
+ ctx.strokeStyle = col; ctx.lineCap = 'round'; ctx.lineJoin = 'round';
350
+ for (let p = 0; p < 2; p++) { ctx.lineWidth = w - p; ctx.beginPath(); ctx.moveTo(pts[0][0] + p, pts[0][1] + p * 0.5); for (let i = 1; i <= n; i++) ctx.lineTo(pts[i][0] + p + Math.sin(i * 7.1) * 0.6, pts[i][1] + p * 0.5); ctx.stroke(); }
351
+ };
352
+ const waxArrow = (pts, prog, col = WAX) => {
353
+ wax(pts, prog, col);
354
+ if (prog >= 1) { const e = pts[pts.length - 1], q = pts[pts.length - 3], a = Math.atan2(e[1] - q[1], e[0] - q[0]); wax([[e[0] + Math.cos(a + 2.6) * 18, e[1] + Math.sin(a + 2.6) * 18], e, [e[0] + Math.cos(a - 2.6) * 18, e[1] + Math.sin(a - 2.6) * 18]], 1, col); }
355
+ };
356
+ const qpts = (x0, y0, qx, qy, x1, y1, n = 30) => Array.from({ length: n + 1 }, (_, i) => { const u = i / n; return [(1 - u) * (1 - u) * x0 + 2 * (1 - u) * u * qx + u * u * x1, (1 - u) * (1 - u) * y0 + 2 * (1 - u) * u * qy + u * u * y1]; });
357
+ const ring = (cx, cy, rx, ry, prog, col = WAX) => wax(Array.from({ length: 61 }, (_, i) => { const a = -0.8 + i / 60 * Math.PI * 2.2; return [cx + Math.cos(a) * rx * (1 + Math.sin(i * 0.7) * 0.02), cy + Math.sin(a) * ry]; }), prog, col, 3.2);
358
+ const write = (s, x, y, size, prog, col = WAX, align = 'left', rot = -0.04) => {
359
+ if (prog <= 0) return; ctx.save(); ctx.font = `700 ${size}px "Caveat"`; ctx.textAlign = align; const w = ctx.measureText(s).width;
360
+ ctx.translate(x, y); ctx.rotate(rot); const x0 = align === 'center' ? -w / 2 : 0;
361
+ ctx.beginPath(); ctx.rect(x0 - 4, -size, (w + 8) * Math.min(1, prog), size * 1.6); ctx.clip(); ctx.fillStyle = col; ctx.fillText(s, 0, 0); ctx.restore();
362
+ };
363
+ const tape = (x, y, w, h, s, size, prog, rot = -0.02) => {
364
+ if (prog <= 0) return; ctx.save(); ctx.translate(x + w / 2, y + h / 2); ctx.rotate(rot); const k = E.back(Math.min(1, prog)); ctx.scale(0.9 + 0.1 * k, 0.9 + 0.1 * k); ctx.globalAlpha = Math.min(1, prog * 3);
365
+ ctx.fillStyle = 'rgba(232,220,180,0.93)'; ctx.beginPath(); ctx.moveTo(-w / 2, -h / 2); for (let i = 0; i <= 10; i++) ctx.lineTo(-w / 2 + i / 10 * w, -h / 2 + (i % 2) * 2); ctx.lineTo(w / 2 + 3, h / 2); for (let i = 10; i >= 0; i--) ctx.lineTo(-w / 2 + i / 10 * w, h / 2 - (i % 2) * 2); ctx.fill();
366
+ ctx.fillStyle = '#1b1d2a'; ctx.font = `400 ${size}px "Permanent Marker"`; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.fillText(s, 0, 2); ctx.restore();
367
+ };
368
+ // HOOK: the question is scrawled over a scout film, then the film is pulled
369
+ if (t < 2.3) {
370
+ const oy = slide(-1, 1.9);
371
+ write('How does', 300, 150 + oy, 74, sm(0.25, 0.8, t));
372
+ write('AI learn?', 640, 250 + oy, 118, sm(0.8, 1.55, t), WAX, 'left', -0.06);
373
+ wax(qpts(630, 278 + oy, 820, 300 + oy, 1010, 270 + oy), sm(1.5, 1.75, t));
374
+ }
375
+ // header tape stays for the rest of the piece
376
+ tape(22, 8, 400, 52, 'How does AI learn?', 30, sm(2.4, 2.6, t), -0.025);
377
+ // DATA
378
+ if (t > 2.6 && t < 6.4) {
379
+ const p = sm(2.8, 5.6, t), v = p >= 1 ? 1000000 : Math.round(Math.pow(10, 6 * p));
380
+ const mo = slide(2.35, 10.3), X = modelX;
381
+ waxArrow(qpts(420, 300, 520, 250, X + 20, 280), sm(3.0, 3.35, t), INK);
382
+ write('labelled films', 445, 226, 42, sm(3.2, 3.6, t), INK, 'left', -0.06);
383
+ // the model film's ID flash: counter typed by the flasher
384
+ ctx.fillStyle = 'rgba(205,222,240,0.95)'; ctx.fillRect(X + 30, 52 + mo + 456, 400, 136);
385
+ ctx.fillStyle = 'rgba(10,16,30,0.92)'; ctx.font = '400 16px "Courier Prime"'; ctx.textAlign = 'left'; ctx.fillText('MODEL · TRAINING SET', X + 44, 52 + mo + 478);
386
+ ctx.font = '700 66px "Courier Prime"'; ctx.fillText(v.toLocaleString('en-US'), X + 44, 52 + mo + 538); ctx.font = '700 30px "Courier Prime"'; ctx.fillText('examples', X + 44, 52 + mo + 578);
387
+ }
388
+ // LOOP: guess -> check -> adjust (wax notes on the glass)
389
+ if (t > 6.4 && t < 10.5) {
390
+ const off = slide(6.3, 10.3), X = modelX;
391
+ waxArrow(qpts(338, 300, 400, 280, X + 26, 270), sm(6.7, 7.0, t), INK);
392
+ write('Guess', 340, 240, 50, sm(6.75, 7.05, t), INK, 'left', -0.08);
393
+ waxArrow(qpts(X + 440, 250, X + 480, 230, X + 520, 250), sm(7.1, 7.3, t), INK);
394
+ write('dog?', X + 535, 275, 84, sm(7.3, 7.65, t), INK);
395
+ if (t > 9.5) wax([[X + 530, 248], [X + 690, 258]], sm(9.5, 9.65, t), RED, 4);
396
+ ring(X + 610, 252, 105, 56, sm(7.8, 8.15, t), RED);
397
+ write('✗', X + 735, 280, 80, sm(7.95, 8.05, t), RED);
398
+ write('Check', X + 560, 160, 54, sm(8.0, 8.3, t), RED);
399
+ waxArrow(qpts(X + 610, 330, X + 560, 520, X + 330, 360), sm(8.3, 8.85, t), RED);
400
+ write('Adjust', X + 470, 470, 54, sm(8.7, 9.0, t), RED);
401
+ write('cat', X + 545, 400, 84, sm(9.65, 9.95, t), INK);
402
+ write('✓', X + 690, 400, 84, sm(9.95, 10.1, t), GRN);
403
+ if (adj > 0 && adj < 1) write('turning…', X + 150, 610, 34, 1);
404
+ }
405
+ // PROGRESS: four rounds on one film; accuracy rewritten (crossed out) as it climbs
406
+ if (t > 10.5) {
407
+ const oy = slide(10.55, 99), Y = 46 + oy;
408
+ const vals = [61, 79, 90, 97];
409
+ for (let r = 0; r < 4; r++) {
410
+ const t0 = 11.0 + r * 0.4;
411
+ write('round ' + ['1', '10', '100', '1,000'][r], 150 + r * 270, Y + 66, 38, sm(t0 - 0.1, t0 + 0.15, t), WAX, 'center', 0);
412
+ write(vals[r] + '%', 150 + r * 270, Y + 420 - r * 40, 64, sm(t0 + 0.15, t0 + 0.35, t), r === 3 ? 'rgba(140,255,150,0.95)' : WAX, 'center', -0.03);
413
+ }
414
+ const pts = vals.map((v, r) => [150 + r * 270, Y + 360 - r * 40]);
415
+ const cpts = []; for (let r = 0; r < 3; r++) for (let k = 0; k <= 10; k++) cpts.push([pts[r][0] + (pts[r + 1][0] - pts[r][0]) * k / 10 + 40, pts[r][1] + (pts[r + 1][1] - pts[r][1]) * k / 10 - 30]);
416
+ wax(cpts, sm(11.3, 12.6, t));
417
+ write('Accuracy \u2197', 100, Y + 492, 48, sm(11.05, 11.3, t), WAX, 'left', 0);
418
+ ring(960, Y + 282, 110, 70, sm(12.5, 12.85, t), RED); ring(960, Y + 284, 118, 76, sm(12.7, 13.0, t), RED);
419
+ tape(250, 590, 780, 70, 'More examples → better guesses', 34, sm(13.05, 13.35, t), 0.01);
420
+ }
421
+ H.vignette(ctx, W, Hh, 0.22, '4,8,16');
422
+ }
423
+
424
+ // Sound: a reading room. The lightbox's fluorescent tubes tink and buzz on, then hum under everything; films are
425
+ // stiff sheets: pulled out of the spring clips (snap + the wobbly flex of X-ray film) and slapped up under them;
426
+ // every note is a waxy grease-pencil stroke for exactly as long as it draws; the ID flasher clacks the counter;
427
+ // masking tape tears and presses; the radiologist's knuckle knocks the glass for WRONG and for the 97% hit.
428
+ // All times are copied from xrayExplainer() above (same film table, slide easing, write/ring/arrow windows).
429
+ // Voiceover mode (k.vo): beds drop out; the small films, labels, counter clacks and minor strokes play quieter.
430
+ function xraySound(k) {
431
+ const sm = H.smooth, E = H.ease, D = 15;
432
+ const hsh = (n) => { const v = Math.sin(n * 78.233 + 1.7) * 43758.5453; return v - Math.floor(v); }; // = xrayExplainer hsh
433
+ const when = (f, v, a, b) => { for (let t = a; t <= b; t += 0.001) if (f(t) >= v) return t; return b; };
434
+ // grease pencil on film: waxy, low-mid drag in short grains (no squeaks), lasting the draw-on time
435
+ const wax = (a, b, g = 1, pan = 0, minor = true) => { const d = b - a, r = H.rng(Math.floor(a * 1000));
436
+ for (let x = 0; x < d; x += 0.03 + r() * 0.025) { const gd = 0.04 + r() * 0.03;
437
+ k.noise(a + x, { dur: gd, color: 'pink', filter: 'bandpass', f: 850 + r() * 500, q: 1.1, gain: 0.2 * g * (0.6 + r() * 0.5), a: gd * 0.35, pan: pan + (r() - 0.5) * 0.15, minor }); }
438
+ k.noise(a, { dur: d, color: 'brown', filter: 'lowpass', f: 350, gain: 0.08 * g, a: 0.02, hold: d * 0.8, pan, minor }); };
439
+ // spring clip letting go / biting on: a short metallic snap, kept low
440
+ const clip = (t, g = 1, pan = 0, minor = false) => { k.noise(t, { dur: 0.02, filter: 'bandpass', f: 1900, q: 4, gain: 0.3 * g, a: 0.001, pan, minor });
441
+ k.tone(t, { f: [[0, 520], [0.05, 380]], dur: 0.06, gain: 0.05 * g, pan, minor }); };
442
+ // stiff X-ray film flexing as it moves: a low "wub" wobble
443
+ const flex = (t, d, g = 1, pan = 0, minor = false) => { const n = Math.max(2, Math.round(d / 0.07));
444
+ for (let i = 0; i < n; i++) k.noise(t + i * d / n, { dur: d / n * 1.6, color: 'brown', filter: 'bandpass', f: 180 + (i % 2) * 140 + i * 15, q: 1.5, gain: 0.32 * g * (1 - i / n * 0.5), a: d / n * 0.5, pan, minor }); };
445
+ // a film slapped up onto the glass under the clips
446
+ const slapUp = (t, g = 1, pan = 0, clips = true, minor = false) => { k.play('slap', t, { gain: 0.55 * g, pan, minor }); flex(t, 0.16, 0.6 * g, pan, minor); if (clips) { clip(t + 0.03, 0.8 * g, pan - 0.3, minor); clip(t + 0.06, 0.7 * g, pan + 0.3, minor); } };
447
+ // pulled down out of the clips: snap snap, then the sheet flexes away
448
+ const pull = (t, g = 1, pan = 0, minor = false) => { clip(t, g, pan - 0.3, minor); clip(t + 0.025, g * 0.9, pan + 0.3, minor); flex(t + 0.04, 0.3, g, pan, minor); };
449
+ // knuckle on the lightbox glass: a dull knock with a short glassy rattle
450
+ const knock = (t, g = 1, pan = 0) => { k.play('thud', t, { f: 170, gain: 0.55 * g, pan }); k.noise(t, { dur: 0.05, filter: 'bandpass', f: 1500, q: 5, gain: 0.18 * g, a: 0.001, pan }); k.noise(t + 0.008, { dur: 0.12, filter: 'bandpass', f: 2200, q: 9, gain: 0.06 * g, pan }); };
451
+ // the ID flasher: dry mechanical clack per change, throttled
452
+ const flasher = (val, a, b, gap, pan, avoid = []) => { let last = -1, prev = val(a);
453
+ for (let t = a; t <= b; t += 0.002) { const v = val(t);
454
+ if (v !== prev && t - last >= gap && !avoid.some((x) => t > x - 0.03 && t < x + 0.19)) { k.play('typebar', t, { gain: 0.38, pan, minor: true }); last = t; }
455
+ prev = v; } };
456
+
457
+ // ---- beds: lightbox ballast hum + a quiet room (the tubes' own buzz is scheduled as they strike)
458
+ k.bed('room', 0, D, { gain: 0.5 });
459
+ k.bed('hum', 0.05, D, { gain: 0.45 });
460
+
461
+ // ---- 0.05 / 0.2 / 0.32: three tubes stutter on (30 slots/s, lit when hsh(floor(t*30)+i*13) > 0.5), then latch
462
+ [0.05, 0.2, 0.32].forEach((t0, i) => { const pan = [-0.6, 0, 0.6][i];
463
+ k.noise(t0, { dur: 0.012, filter: 'bandpass', f: 1300, q: 3, gain: 0.25, a: 0.001, pan }); // starter tink (low)
464
+ let was = false;
465
+ for (let s = Math.floor(t0 * 30); s / 30 < t0 + 0.3; s++) { const on = hsh(s + i * 13) > 0.5, ta = Math.max(t0, s / 30);
466
+ if (on && !was) k.tone(ta, { f: 120, type: 'sawtooth', dur: 0.035, gain: 0.05, filter: 'bandpass', f2: 1100, q: 1.5, pan });
467
+ was = on; }
468
+ k.tone(t0 + 0.3, { f: 120, type: 'sawtooth', dur: D - t0 - 0.3, gain: 0.0045, a: 0.05, hold: D - t0 - 1, filter: 'bandpass', f2: 900, q: 1.5, pan, bus: 'amb', minor: true });
469
+ });
470
+
471
+ // ---- hook: the question in grease pencil, underline, then the film is pulled at 1.9
472
+ wax(0.25, 0.8, 0.9, -0.3, false);
473
+ wax(0.8, 1.55, 1.1, 0.1, false);
474
+ wax(1.5, 1.75, 0.8, 0.2);
475
+ pull(1.9, 1.0);
476
+ // ---- model film up at 2.35 (E.out over 0.35: settled at ~2.57); header tape 2.4–2.6 (E.back overshoot)
477
+ slapUp(2.57, 1.0, 0.25);
478
+ k.play('tape', 2.36, { dur: 0.12, gain: 0.7, pan: -0.6 }); // torn and stuck as it appears
479
+
480
+ // ---- DATA: ten small films slap down at 2.75 + k*0.29 (settled +0.22); arrow 3.0–3.35, label 3.2–3.6
481
+ for (let c = 0; c < 10; c++) slapUp(2.75 + c * 0.29 + 0.22, 0.3, -0.6, false, true);
482
+ wax(3.0, 3.35, 0.7, -0.2);
483
+ wax(3.36, 3.6, 0.6, -0.3); // label (3.2–3.6), continuing after the arrow so the two don't stack
484
+ // ID flasher counter: 10^(6p), p = sm(2.8, 5.6), locks at 1,000,000
485
+ const smallLand = Array.from({ length: 10 }, (_, c) => 2.97 + c * 0.29);
486
+ flasher((t) => { const p = sm(2.8, 5.6, t); return p >= 1 ? 1e6 : Math.round(Math.pow(10, 6 * p)); }, 2.82, 5.5, 0.09, 0.3, smallLand);
487
+ k.play('typebar', 5.6, { gain: 0.8, pan: 0.3 }); k.play('thud', 5.6, { f: 140, gain: 0.35, pan: 0.3 });
488
+
489
+ // ---- 6.0: the small films are pulled down; the model film slides left on the glass (E.inOut 6.0–6.5)
490
+ pull(6.0, 0.9, -0.5);
491
+ k.noise(6.05, { dur: 0.45, color: 'pink', filter: 'bandpass', f: [[0, 500], [0.22, 900], [0.45, 450]], q: 0.8, gain: 0.08, a: 0.22, pan: 0.2 });
492
+ slapUp(6.52, 0.8, -0.6); // cat film up at 6.3 (settled ~6.52)
493
+
494
+ // ---- LOOP
495
+ wax(6.7, 7.0, 0.7, -0.3); wax(7.0, 7.08, 0.5, -0.3); // Guess arrow + its label (6.75–7.05)
496
+ wax(7.1, 7.3, 0.6, 0.3); // arrow to the answer
497
+ wax(7.3, 7.65, 1.0, 0.45, false); // "dog?" (the guess)
498
+ // WRONG: red ring 7.8–8.15, ✗ slashed 7.95–8.05 with a knock on the glass, "Check" 8.0–8.3
499
+ wax(7.8, 8.15, 1.0, 0.45, false);
500
+ knock(7.97, 1.4, 0.55); k.noise(7.95, { dur: 0.1, color: 'pink', filter: 'bandpass', f: 900, q: 0.9, gain: 0.32, a: 0.01, pan: 0.6 });
501
+ wax(8.16, 8.3, 0.6, 0.4);
502
+ wax(8.3, 8.85, 0.8, 0.2, false); // red arrow back to the gears
503
+ wax(8.86, 9.0, 0.5, 0.2); // "Adjust" (8.7–9.0) tail
504
+ // gears turn in steps (rot = floor(a*6)/6, adj = sm(8.85, 9.4)): one ratchet click per step of any gear
505
+ { const steps = []; const r0 = [0.3, -0.5, 0.1], dr = [2.2, -2.8, 2.5];
506
+ for (let g = 0; g < 3; g++) { let prev = Math.floor(r0[g] * 6); for (let t = 8.85; t <= 9.41; t += 0.002) { const v = Math.floor((r0[g] + dr[g] * sm(8.85, 9.4, t)) * 6); if (v !== prev) { steps.push(t); prev = v; } } }
507
+ steps.sort((a, b) => a - b); let last = -1;
508
+ for (const ts of steps) if (ts - last >= 0.07) { k.play('tock', ts, { f: 380, gain: 0.32, pan: -0.1, minor: true }); last = ts; } }
509
+ // RIGHT: red cross-out 9.5–9.65, "cat" 9.65–9.95, green ✓ 9.95–10.1 and two taps of the pencil on the glass
510
+ wax(9.5, 9.65, 0.8, 0.45);
511
+ wax(9.65, 9.95, 1.0, 0.45, false);
512
+ wax(9.95, 10.1, 1.1, 0.6, false);
513
+ knock(10.12, 0.7, 0.55); knock(10.26, 0.9, 0.55);
514
+ k.tone(10.14, { f: 'E4', dur: 0.6, gain: 0.07, a: 0.01, verb: 0.3, pan: 0.4 }); k.tone(10.28, { f: 'A4', dur: 0.8, gain: 0.08, a: 0.01, verb: 0.3, pan: 0.4 });
515
+
516
+ // ---- 10.3: model + cat films pulled down; the long "rounds" film slaps up at 10.55 (settled ~10.77)
517
+ pull(10.3, 1.0, 0);
518
+ slapUp(10.77, 1.2, 0);
519
+
520
+ // ---- PROGRESS: round labels (t0-0.1 .. t0+0.15) and values (t0+0.15 .. t0+0.35), t0 = 11.0 + r*0.4
521
+ for (let r = 0; r < 4; r++) { const t0 = 11.0 + r * 0.4, pan = -0.6 + r * 0.4;
522
+ wax(t0 - 0.1, t0 + 0.13, 0.45, pan);
523
+ wax(t0 + 0.15, t0 + 0.35, r === 3 ? 1.0 : 0.65, pan, r !== 3); }
524
+ wax(11.05, 11.28, 0.5, -0.6); // "Accuracy ↗"
525
+ k.noise(11.3, { dur: 1.3, color: 'pink', filter: 'bandpass', f: [[0, 700], [1.3, 1100]], q: 1, gain: 0.04, a: 0.1, hold: 1.0, pan: 0.1, minor: true }); // the long curve, faint underneath
526
+ // THE HIT: 97% written (12.35–12.55), palm slap on the lightbox + knock, then two red rings 12.5–12.85, 12.7–13.0
527
+ k.play('slap', 12.55, { gain: 1.1, pan: 0.4 }); knock(12.55, 1.8, 0.4); k.play('thud', 12.55, { f: 80, gain: 1.2, pan: 0.4 });
528
+ k.noise(12.55, { dur: 0.6, color: 'brown', filter: 'lowpass', f: [[0, 900], [0.5, 200]], gain: 0.25, verb: 0.3, pan: 0.4 });
529
+ wax(12.6, 12.85, 1.0, 0.4, false); wax(12.85, 13.0, 0.8, 0.45);
530
+
531
+ // ---- takeaway tape 13.05–13.35 (E.back overshoot, lands ~13.25): tear, stick, press flat
532
+ k.play('tape', 13.04, { dur: 0.2, gain: 1.5 });
533
+ k.noise(13.24, { dur: 0.2, color: 'brown', filter: 'lowpass', f: 600, gain: 0.3, a: 0.005 }); // palm presses it flat (soft, no thump)
534
+ k.noise(13.32, { dur: 0.35, color: 'pink', filter: 'bandpass', f: 700, q: 0.8, gain: 0.08, a: 0.1 }); // thumb smooths it
535
+ // resolve: a soft low chord under the finished board, the lightbox hum carrying on
536
+ ['A3', 'E4', 'A4', 'C#5'].forEach((n, i) => k.tone(13.45 + i * 0.05, { f: n, type: 'sine', dur: 1.5, gain: 0.05 - i * 0.006, a: 0.06, hold: 0.4, verb: 0.35, pan: (i - 1.5) * 0.25 }));
537
+ }
538
+
539
+ registerStyle({
540
+ id: 'x-ray',
541
+ name: 'Radiograph on Lightbox',
542
+ category: 'Light & Imaging',
543
+ description: 'A blue-base X-ray film clipped to a glowing viewer: additive translucent density of a robot hand — hollow-shelled bones, pivot pins, screws, tendons, battery cell and gears — with collimation borders, lead markers, an ID flash, grease-pencil notes, scratches and dust.',
544
+ motion: 'The viewer\u2019s fluorescent tubes stutter on one by one, the film develops from milky fog to deep blue-black top-down like it was dipped in the tank, then a grease pencil circles the loose pin and scrawls a note while the camera slowly pushes in.',
545
+ fonts: ['700 30px "Courier Prime"', '400 15px "Courier Prime"', '700 40px "Caveat"', '700 34px sans-serif', '400 30px "Permanent Marker"'],
546
+ frameT: 4.7,
547
+ duration: 5,
548
+ readsPixels: true,
549
+ explainerDuration: 15,
550
+ explainerNote: 'A radiologist working a lightbox: scenes change by pulling films down and slapping new ones up under the clips, arrows, circles and answers are grease pencil on the glass, the counter is typed by the ID flasher and accuracy is rewritten round by round, with masking-tape labels for the header and takeaway.',
551
+ explainer(ctx, W, Hh, t) { xrayExplainer(ctx, W, Hh, t); },
552
+ explainerSound(k) { xraySound(k); },
553
+ draw(ctx, W, Hh, t) {
554
+ const hsh = (n) => { const v = Math.sin(n * 78.233 + 1.7) * 43758.5453; return v - Math.floor(v); };
555
+ // three fluorescent tubes strike in turn (stutter then latch)
556
+ const tubeX = [213, 640, 1067], tubeT = [0.15, 0.4, 0.62];
557
+ const tubeOn = tubeT.map((t0, i) => t < t0 ? 0 : t - t0 > 0.35 ? 1 : (hsh(Math.floor(t * 30) + i * 13) > 0.5 ? 1 : 0.15));
558
+ const hum = 1 + (hsh(Math.floor(t * 30) + 77) - 0.5) * 0.015;
559
+ const R = H.rng(909), nz = H.makeNoise(31);
560
+ const filmRot = -0.009, fcx = W / 2, fcy = Hh / 2 + 20;
561
+ const filmT = (x) => { x.translate(fcx, fcy); x.rotate(filmRot); x.translate(-fcx, -fcy); };
562
+ const film = { x: 92, y: 46, w: W - 184, h: 760 };
563
+ const fields = [{ x: 148, y: 92, w: 610, h: 610 }, { x: 790, y: 92, w: 342, h: 610 }];
564
+
565
+ // ---- density (x-ray attenuation) ----
566
+ const Dc = H.layer(W, Hh), dx = Dc.getContext('2d');
567
+ dx.fillStyle = '#000'; dx.fillRect(0, 0, W, Hh);
568
+ const Sc = H.layer(W, Hh), sx = Sc.getContext('2d');
569
+ dx.save(); sx.save(); filmT(dx); filmT(sx);
570
+ dx.globalCompositeOperation = 'lighter';
571
+ // PA view
572
+ dx.save(); sx.save();
573
+ dx.translate(458, 548); sx.translate(458, 548); dx.rotate(0.06); sx.rotate(0.06); dx.scale(0.88, 0.88); sx.scale(0.88, 0.88);
574
+ const handA = hand(dx, sx, 0.15, t);
575
+ dx.restore(); sx.restore();
576
+ // oblique view (foreshortened, more curl)
577
+ dx.save(); sx.save();
578
+ dx.translate(972, 560); sx.translate(972, 560); dx.rotate(-0.1); sx.rotate(-0.1); dx.scale(0.5, 0.8); sx.scale(0.5, 0.8);
579
+ hand(dx, sx, 0.9, t + 1);
580
+ dx.restore(); sx.restore();
581
+ // lead markers (lead blocks x-rays -> white)
582
+ dx.globalCompositeOperation = 'source-over';
583
+ dx.fillStyle = dens(0.75); dx.font = '700 34px sans-serif';
584
+ dx.fillText('R', 176, 140); dx.fillText('R', 816, 140);
585
+ dx.font = '700 20px sans-serif'; dx.fillText('PA', 214, 138); dx.fillText('OBL', 852, 138);
586
+ dx.restore(); sx.restore();
587
+ // add soft tissue
588
+ dx.save(); dx.globalCompositeOperation = 'lighter'; dx.globalAlpha = 0.1; dx.filter = 'blur(6px)'; dx.drawImage(Sc, 0, 0); dx.restore();
589
+ // a little scatter / unsharpness
590
+ const Db = H.layer(W, Hh), dbx = Db.getContext('2d');
591
+ dbx.filter = 'blur(1.1px)'; dbx.drawImage(Dc, 0, 0);
592
+ const Dw = H.layer(W, Hh), dwx = Dw.getContext('2d');
593
+ dwx.filter = 'blur(14px)'; dwx.drawImage(Dc, 0, 0);
594
+ const D = dbx.getImageData(0, 0, W, Hh).data, Dwide = dwx.getImageData(0, 0, W, Hh).data;
595
+
596
+ // ---- masks ----
597
+ const M = H.layer(W, Hh), mx = M.getContext('2d');
598
+ mx.save(); filmT(mx);
599
+ mx.fillStyle = 'rgb(255,0,0)'; mx.fillRect(film.x, film.y, film.w, film.h); // film area (R)
600
+ mx.fillStyle = 'rgb(255,255,0)'; fields.forEach((f) => mx.fillRect(f.x, f.y, f.w, f.h)); // exposed fields (G)
601
+ mx.restore();
602
+ const Mb = H.layer(W, Hh), mbx = Mb.getContext('2d'); mbx.filter = 'blur(2px)'; mbx.drawImage(M, 0, 0);
603
+ const md = mbx.getImageData(0, 0, W, Hh).data;
604
+
605
+ // ---- film transmission on lightbox ----
606
+ const img = ctx.createImageData(W, Hh), d = img.data;
607
+ for (let y = 0; y < Hh; y++) for (let x = 0; x < W; x++) {
608
+ const i = (y * W + x) * 4;
609
+ const inFilm = md[i] / 255, inField = md[i + 1] / 255;
610
+ // lightbox: three fluorescent tubes behind diffuser
611
+ const box = 0.86 + 0.07 * Math.cos((x - 640) / 1280 * Math.PI * 6) - 0.1 * Math.pow(Math.abs(y - 360) / 360, 2) - 0.08 * Math.pow(Math.abs(x - 640) / 640, 3);
612
+ const Dv = D[i] / 255 + Dwide[i] / 255 * 0.12;
613
+ const mott = nz.fbm2(x * 0.004, y * 0.004, 3) * 0.04;
614
+ const grain = (R() + R() + R() - 1.5) * 0.05;
615
+ // exposed field: transmission rises with object density (negative film)
616
+ const Tf0 = 0.025 + 0.93 * (1 - Math.exp(-3.0 * Dv)) + mott * (1 - Dv) + grain * (0.5 + Dv);
617
+ // development front sweeps top->bottom with uneven, mottled edge
618
+ const dv = H.smooth(0, 1, (t - 0.75 - (y / Hh) * 0.95 - mott * 6) / 0.6);
619
+ const fog = 0.4 + mott * 2 + grain * 0.4;
620
+ const Tf = fog + (Tf0 - fog) * dv;
621
+ const Tc = 0.64 + mott + grain * 0.6; // collimated, unexposed (blue base + fog)
622
+ const Tfilm = Tc + (Tf - Tc) * inField;
623
+ const T = 1 + (Tfilm - 1) * inFilm;
624
+ const tint = inFilm > 0.01 ? [0.80, 0.90, 1.0] : [1, 1, 1];
625
+ const L = box * T * 255 * 1.22;
626
+ d[i] = L * (1 + (tint[0] - 1) * inFilm) * 0.98;
627
+ d[i + 1] = L * (1 + (tint[1] - 1) * inFilm);
628
+ d[i + 2] = L * (1 + (tint[2] - 1) * inFilm) * 1.04;
629
+ d[i + 3] = 255;
630
+ }
631
+ ctx.putImageData(img, 0, 0);
632
+
633
+ // ---- on-film overlays (in film space) ----
634
+ ctx.save(); filmT(ctx);
635
+ // emulsion scratches (bright) and dust (dark)
636
+ for (let k = 0; k < 9; k++) {
637
+ const x0 = R.range(160, 1120), y0 = R.range(100, 700), len = R.range(40, 260), a = 1.45 + R.range(-0.25, 0.25);
638
+ ctx.strokeStyle = `rgba(200,225,255,${R.range(0.08, 0.22)})`; ctx.lineWidth = R.range(0.5, 1.2);
639
+ ctx.beginPath(); ctx.moveTo(x0, y0); ctx.quadraticCurveTo(x0 + Math.cos(a) * len * 0.5 + R.range(-8, 8), y0 + Math.sin(a) * len * 0.5, x0 + Math.cos(a) * len, y0 + Math.sin(a) * len); ctx.stroke();
640
+ }
641
+ for (let k = 0; k < 120; k++) {
642
+ ctx.fillStyle = `rgba(0,0,0,${R.range(0.2, 0.6)})`;
643
+ const x0 = R.range(100, 1180), y0 = R.range(50, 715);
644
+ ctx.beginPath(); ctx.ellipse(x0, y0, R.range(0.5, 2), R.range(0.5, 1.5), R() * 3, 0, 7); ctx.fill();
645
+ }
646
+ // ID flash block (photographically printed: light patch, dark type)
647
+ const idx = 812, idy = 600, idw = 300, idh = 88;
648
+ ctx.globalAlpha = H.smooth(2.0, 2.5, t);
649
+ ctx.fillStyle = 'rgba(205,222,240,0.92)'; ctx.fillRect(idx, idy, idw, idh);
650
+ ctx.fillStyle = 'rgba(10,16,30,0.9)'; ctx.font = '400 15px "Courier Prime"';
651
+ ctx.fillText('ROBOTICS LAB · RADIOLOGY', idx + 12, idy + 22);
652
+ ctx.font = '700 30px "Courier Prime"'; ctx.fillText('UNIT-07 R HAND', idx + 12, idy + 54);
653
+ ctx.font = '400 15px "Courier Prime"'; ctx.fillText('2026-10-09 60kV 2mAs #4471', idx + 12, idy + 76);
654
+ // film edge notch code + edge print
655
+ ctx.fillStyle = 'rgba(30,40,60,0.55)'; ctx.font = '400 13px "Courier Prime"';
656
+ ctx.fillText('SAFETY ■ BLUE BASE 35x43 ■ 0712', 140, 80);
657
+ ctx.globalAlpha = 1;
658
+ // grease pencil circle + note around a joint (waxy, broken stroke)
659
+ const jp = handA[3].pts[1], jm = new DOMMatrix().translate(458, 548).rotate(0.06 * 180 / Math.PI).scale(0.88), gpt = jm.transformPoint({ x: jp[0], y: jp[1] });
660
+ const gx = gpt.x, gy = gpt.y;
661
+ ctx.strokeStyle = 'rgba(255,236,150,0.85)'; ctx.lineCap = 'round';
662
+ const circP = H.smooth(2.6, 3.25, t);
663
+ for (let p = 0; p < 3; p++) {
664
+ ctx.lineWidth = 2.4 - p * 0.5; ctx.beginPath();
665
+ for (let k = 0; k <= 60; k++) {
666
+ const u = k / 60, a = -0.6 + u * Math.PI * 2.15, rr = 42 + Math.sin(u * 7) * 2 + p * 1.5;
667
+ const px = gx + Math.cos(a) * rr * 1.1, py = gy + Math.sin(a) * rr;
668
+ const brk = R() < 0.06;
669
+ if (u > circP - p * 0.04) continue;
670
+ if (k === 0 || brk) ctx.moveTo(px, py); else ctx.lineTo(px, py);
671
+ }
672
+ ctx.stroke();
673
+ }
674
+ const wrP = H.smooth(3.3, 3.95, t);
675
+ if (wrP > 0) {
676
+ ctx.font = '700 40px "Caveat"'; ctx.fillStyle = 'rgba(255,236,150,0.9)';
677
+ ctx.save(); ctx.translate(gx + 70, gy - 34); ctx.rotate(-0.08);
678
+ ctx.beginPath(); ctx.rect(-4, -40, 4 + wrP * 180, 60); ctx.clip(); ctx.fillText('pin loose?', 0, 0); ctx.restore();
679
+ }
680
+ if (t > 3.95) { const ap = H.smooth(3.95, 4.1, t); ctx.beginPath(); ctx.moveTo(gx + 66, gy - 40); ctx.quadraticCurveTo(gx + 54 + (1 - ap) * 6, gy - 30, H.lerp(gx + 66, gx + 44, ap), H.lerp(gy - 40, gy - 18, ap)); ctx.lineWidth = 2; ctx.stroke(); }
681
+ ctx.restore();
682
+
683
+ // ---- lightbox bloom around film edges (bright box bleeds over film) ----
684
+ const bright = H.layer(W / 4, Hh / 4), bx = bright.getContext('2d');
685
+ bx.filter = 'blur(10px)'; bx.drawImage(ctx.canvas, 0, 0, W / 4, Hh / 4);
686
+ const bb = bx.getImageData(0, 0, W / 4, Hh / 4), bd = bb.data;
687
+ for (let i = 0; i < bd.length; i += 4) { const l = (bd[i] + bd[i + 1] + bd[i + 2]) / 765; const k = H.smooth(0.6, 0.95, l); bd[i] *= k; bd[i + 1] *= k; bd[i + 2] *= k; }
688
+ bx.putImageData(bb, 0, 0);
689
+ ctx.save(); ctx.globalCompositeOperation = 'screen'; ctx.globalAlpha = 0.8; ctx.filter = 'blur(6px)';
690
+ ctx.drawImage(bright, 0, 0, W, Hh); ctx.restore();
691
+
692
+ // ---- spring clips holding the film ----
693
+ const clip = (cx) => {
694
+ const cy = 30;
695
+ ctx.save(); ctx.translate(cx, cy); ctx.rotate(filmRot);
696
+ ctx.fillStyle = 'rgba(0,0,0,0.35)'; ctx.beginPath(); ctx.roundRect(-36, 6, 76, 46, 10); ctx.filter = 'blur(4px)'; ctx.fill(); ctx.filter = 'none';
697
+ const mg = ctx.createLinearGradient(0, -6, 0, 44);
698
+ mg.addColorStop(0, '#f2f5f8'); mg.addColorStop(0.25, '#9aa3ad'); mg.addColorStop(0.55, '#4b525b'); mg.addColorStop(0.8, '#c8ced5'); mg.addColorStop(1, '#6b737c');
699
+ ctx.fillStyle = mg; ctx.beginPath(); ctx.roundRect(-34, -6, 68, 46, 9); ctx.fill();
700
+ ctx.strokeStyle = 'rgba(20,24,30,0.6)'; ctx.lineWidth = 1.5; ctx.stroke();
701
+ ctx.fillStyle = 'rgba(255,255,255,0.7)'; ctx.fillRect(-28, -2, 56, 2);
702
+ ctx.fillStyle = '#2a2f36'; ctx.beginPath(); ctx.arc(0, 10, 7, 0, 7); ctx.fill();
703
+ ctx.fillStyle = 'rgba(255,255,255,0.4)'; ctx.beginPath(); ctx.arc(-2, 8, 2.5, 0, 7); ctx.fill();
704
+ ctx.restore();
705
+ };
706
+ clip(330); clip(950);
707
+ // viewer frame top edge
708
+ const fg = ctx.createLinearGradient(0, 0, 0, 22);
709
+ fg.addColorStop(0, '#15181d'); fg.addColorStop(1, '#3b4048');
710
+ ctx.fillStyle = fg; ctx.fillRect(0, 0, W, 20);
711
+
712
+ // photo-of-a-lightbox finish
713
+ // lightbox is the only light in the room: darkness where tubes are still off
714
+ const lg = ctx.createLinearGradient(0, 0, W, 0);
715
+ for (let k = 0; k <= 16; k++) {
716
+ const x = k / 16 * W; let a = 0, wsum = 0;
717
+ tubeX.forEach((tx, i) => { const w = Math.exp(-Math.pow((x - tx) / 330, 2)); a += w * tubeOn[i]; wsum += w; });
718
+ const lit = H.clamp(a / wsum) * hum, v = Math.min(255, 12 + 243 * lit) | 0;
719
+ lg.addColorStop(k / 16, `rgb(${v},${v},${Math.min(255, v + 2)})`);
720
+ }
721
+ ctx.save(); ctx.globalCompositeOperation = 'multiply'; ctx.fillStyle = lg; ctx.fillRect(0, 0, W, Hh); ctx.restore();
722
+ // slow push-in (camera)
723
+ const push = 1 + 0.035 * H.ease.inOut(H.clamp(t / 5));
724
+ const cp = H.layer(W, Hh); cp.getContext('2d').drawImage(ctx.canvas, 0, 0);
725
+ ctx.save(); ctx.translate(560, 390); ctx.scale(push, push); ctx.translate(-560, -390); ctx.drawImage(cp, 0, 0); ctx.restore();
726
+ H.vignette(ctx, W, Hh, 0.22, '4,8,16');
727
+ H.grain(ctx, W, Hh, 0.03, 5 + Math.floor(t * 30), true);
728
+ },
729
+ });
730
+ }