@maniclang/workbench 0.1.11

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 (644) hide show
  1. package/CONTRIBUTING.md +40 -0
  2. package/README.md +155 -0
  3. package/dist/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  4. package/dist/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  5. package/dist/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  6. package/dist/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  7. package/dist/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  8. package/dist/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  9. package/dist/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  10. package/dist/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  11. package/dist/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  12. package/dist/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  13. package/dist/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  14. package/dist/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  15. package/dist/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  16. package/dist/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  17. package/dist/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  18. package/dist/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  19. package/dist/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  20. package/dist/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  21. package/dist/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  22. package/dist/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  23. package/dist/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  24. package/dist/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  25. package/dist/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  26. package/dist/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  27. package/dist/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  28. package/dist/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  29. package/dist/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  30. package/dist/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  31. package/dist/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  32. package/dist/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  33. package/dist/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  34. package/dist/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  35. package/dist/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  36. package/dist/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  37. package/dist/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  38. package/dist/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  39. package/dist/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  40. package/dist/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  41. package/dist/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  42. package/dist/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  43. package/dist/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  44. package/dist/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  45. package/dist/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  46. package/dist/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  47. package/dist/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  48. package/dist/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  49. package/dist/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  50. package/dist/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  51. package/dist/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  52. package/dist/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  53. package/dist/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  54. package/dist/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  55. package/dist/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  56. package/dist/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  57. package/dist/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  58. package/dist/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  59. package/dist/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  60. package/dist/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  61. package/dist/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  62. package/dist/client/assets/abap-CRCWOmpq.js +1 -0
  63. package/dist/client/assets/apex-DnsZk_dE.js +1 -0
  64. package/dist/client/assets/azcli-1IWB1ccx.js +1 -0
  65. package/dist/client/assets/bat-DPkNLes8.js +1 -0
  66. package/dist/client/assets/bicep-Corcdgou.js +2 -0
  67. package/dist/client/assets/cameligo-CGrWLZr3.js +1 -0
  68. package/dist/client/assets/clojure-D9WOWImG.js +1 -0
  69. package/dist/client/assets/codicon-CgENjH2v.ttf +0 -0
  70. package/dist/client/assets/coffee-B7EJu28W.js +1 -0
  71. package/dist/client/assets/cpp-SEyurbux.js +1 -0
  72. package/dist/client/assets/csharp-BoL64M5l.js +1 -0
  73. package/dist/client/assets/csp-C46ZqvIl.js +1 -0
  74. package/dist/client/assets/css-DQU6DXDx.js +3 -0
  75. package/dist/client/assets/cssMode-CtRONlr8.js +4 -0
  76. package/dist/client/assets/cypher-D84EuPTj.js +1 -0
  77. package/dist/client/assets/dart-D8lhlL1r.js +1 -0
  78. package/dist/client/assets/dockerfile-DLk6rpji.js +1 -0
  79. package/dist/client/assets/ecl-BO6FnfXk.js +1 -0
  80. package/dist/client/assets/editor.worker-CZyr7Ur9.js +26 -0
  81. package/dist/client/assets/elixir-BRjLKONM.js +1 -0
  82. package/dist/client/assets/flow9-Cac8vKd7.js +1 -0
  83. package/dist/client/assets/freemarker2-BTSNJUl8.js +3 -0
  84. package/dist/client/assets/fsharp-fd1GTHhf.js +1 -0
  85. package/dist/client/assets/go-O9LJTZXk.js +1 -0
  86. package/dist/client/assets/graphql-LQdxqEYJ.js +1 -0
  87. package/dist/client/assets/handlebars-qkUBjVg6.js +1 -0
  88. package/dist/client/assets/hcl-DxDQ3s82.js +1 -0
  89. package/dist/client/assets/html-pguqE00h.js +1 -0
  90. package/dist/client/assets/htmlMode-BCCLuk2F.js +4 -0
  91. package/dist/client/assets/index-BFrMLHHu.css +1 -0
  92. package/dist/client/assets/index-CdBC-xgi.js +1250 -0
  93. package/dist/client/assets/ini-BvajGCUy.js +1 -0
  94. package/dist/client/assets/java-SYsfObOQ.js +1 -0
  95. package/dist/client/assets/javascript-ciDUXdez.js +1 -0
  96. package/dist/client/assets/jsonMode-BmkXC0tI.js +10 -0
  97. package/dist/client/assets/julia-DQXNmw_w.js +1 -0
  98. package/dist/client/assets/kotlin-qQ0MG-9I.js +1 -0
  99. package/dist/client/assets/less-GGFNNJHn.js +2 -0
  100. package/dist/client/assets/lexon-Canl7DCW.js +1 -0
  101. package/dist/client/assets/liquid-CwE4UIwf.js +1 -0
  102. package/dist/client/assets/lua-D28Ae8-K.js +1 -0
  103. package/dist/client/assets/m3-DPitgjJI.js +1 -0
  104. package/dist/client/assets/markdown-B811l8j2.js +1 -0
  105. package/dist/client/assets/mdx-K_9Emnjy.js +1 -0
  106. package/dist/client/assets/mips-CdjsipkG.js +1 -0
  107. package/dist/client/assets/msdax-CYqgjx_P.js +1 -0
  108. package/dist/client/assets/mysql-BHd6q0vd.js +1 -0
  109. package/dist/client/assets/objective-c-B1aVtJYH.js +1 -0
  110. package/dist/client/assets/pascal-BhNW15KB.js +1 -0
  111. package/dist/client/assets/pascaligo-5jv8CcQD.js +1 -0
  112. package/dist/client/assets/perl-DlYyT36c.js +1 -0
  113. package/dist/client/assets/pgsql-Dy0bjov7.js +1 -0
  114. package/dist/client/assets/php-120yhfDK.js +1 -0
  115. package/dist/client/assets/pla-CjnFlu4u.js +1 -0
  116. package/dist/client/assets/postiats-CQpG440k.js +1 -0
  117. package/dist/client/assets/powerquery-DdJtto1Z.js +1 -0
  118. package/dist/client/assets/powershell-Bu_VLpJB.js +1 -0
  119. package/dist/client/assets/protobuf-IBS6jZEB.js +2 -0
  120. package/dist/client/assets/pug-kFxLfcjb.js +1 -0
  121. package/dist/client/assets/python-BzIc0EVe.js +1 -0
  122. package/dist/client/assets/qsharp-q7JyzKFN.js +1 -0
  123. package/dist/client/assets/r-BIFz-_sK.js +1 -0
  124. package/dist/client/assets/razor-lXZl6dtu.js +1 -0
  125. package/dist/client/assets/redis-CHOsPHWR.js +1 -0
  126. package/dist/client/assets/redshift-CBifECDb.js +1 -0
  127. package/dist/client/assets/restructuredtext-CghPJEOS.js +1 -0
  128. package/dist/client/assets/ruby-CYWGW-b1.js +1 -0
  129. package/dist/client/assets/rust-DMDD0SHb.js +1 -0
  130. package/dist/client/assets/sb-BYAiYHFx.js +1 -0
  131. package/dist/client/assets/scala-Bqvq8jcR.js +1 -0
  132. package/dist/client/assets/scheme-Dhb-2j9p.js +1 -0
  133. package/dist/client/assets/scss-CTwUZ5N7.js +3 -0
  134. package/dist/client/assets/shell-CsDZo4DB.js +1 -0
  135. package/dist/client/assets/solidity-CME5AdoB.js +1 -0
  136. package/dist/client/assets/sophia-RYC1BQQz.js +1 -0
  137. package/dist/client/assets/sparql-KEyrF7De.js +1 -0
  138. package/dist/client/assets/sql-BdTr02Mf.js +1 -0
  139. package/dist/client/assets/st-C7iG7M4S.js +1 -0
  140. package/dist/client/assets/swift-D7IUmUK8.js +1 -0
  141. package/dist/client/assets/systemverilog-DgMryOEJ.js +1 -0
  142. package/dist/client/assets/tcl-PloMZuKG.js +1 -0
  143. package/dist/client/assets/tsMode-BAXmgo_t.js +11 -0
  144. package/dist/client/assets/twig-BfRIq3la.js +1 -0
  145. package/dist/client/assets/typescript-Cdf8nS1n.js +1 -0
  146. package/dist/client/assets/typespec-CzxlYoT_.js +1 -0
  147. package/dist/client/assets/vb-BwAE3J76.js +1 -0
  148. package/dist/client/assets/wgsl-B_1kOXbF.js +298 -0
  149. package/dist/client/assets/xml-DGyPgYnj.js +1 -0
  150. package/dist/client/assets/yaml-Dqv3HtbL.js +1 -0
  151. package/dist/client/index.html +14 -0
  152. package/dist/client/manic-logo.png +0 -0
  153. package/dist/client/wasm/manic_lang.d.ts +74 -0
  154. package/dist/client/wasm/manic_lang.js +302 -0
  155. package/dist/client/wasm/manic_lang_bg.wasm +0 -0
  156. package/dist/client/wasm/manic_lang_bg.wasm.d.ts +13 -0
  157. package/dist/server/agentProtocol.d.ts +131 -0
  158. package/dist/server/agentProtocol.js +21 -0
  159. package/dist/server/agentProtocol.js.map +1 -0
  160. package/dist/server/agentRuns.d.ts +46 -0
  161. package/dist/server/agentRuns.js +138 -0
  162. package/dist/server/agentRuns.js.map +1 -0
  163. package/dist/server/agentThreads.d.ts +20 -0
  164. package/dist/server/agentThreads.js +205 -0
  165. package/dist/server/agentThreads.js.map +1 -0
  166. package/dist/server/aiSecrets.d.ts +21 -0
  167. package/dist/server/aiSecrets.js +68 -0
  168. package/dist/server/aiSecrets.js.map +1 -0
  169. package/dist/server/app.d.ts +34 -0
  170. package/dist/server/app.js +804 -0
  171. package/dist/server/app.js.map +1 -0
  172. package/dist/server/assets.d.ts +34 -0
  173. package/dist/server/assets.js +659 -0
  174. package/dist/server/assets.js.map +1 -0
  175. package/dist/server/candidateFix.d.ts +28 -0
  176. package/dist/server/candidateFix.js +111 -0
  177. package/dist/server/candidateFix.js.map +1 -0
  178. package/dist/server/cli.d.ts +2 -0
  179. package/dist/server/cli.js +118 -0
  180. package/dist/server/cli.js.map +1 -0
  181. package/dist/server/diagnostics.d.ts +13 -0
  182. package/dist/server/diagnostics.js +73 -0
  183. package/dist/server/diagnostics.js.map +1 -0
  184. package/dist/server/engineCheck.d.ts +7 -0
  185. package/dist/server/engineCheck.js +60 -0
  186. package/dist/server/engineCheck.js.map +1 -0
  187. package/dist/server/engineInstall.d.ts +34 -0
  188. package/dist/server/engineInstall.js +228 -0
  189. package/dist/server/engineInstall.js.map +1 -0
  190. package/dist/server/enginePaths.d.ts +3 -0
  191. package/dist/server/enginePaths.js +76 -0
  192. package/dist/server/enginePaths.js.map +1 -0
  193. package/dist/server/folderPicker.d.ts +1 -0
  194. package/dist/server/folderPicker.js +54 -0
  195. package/dist/server/folderPicker.js.map +1 -0
  196. package/dist/server/manicAgent.d.ts +75 -0
  197. package/dist/server/manicAgent.js +476 -0
  198. package/dist/server/manicAgent.js.map +1 -0
  199. package/dist/server/manicEnv.d.ts +18 -0
  200. package/dist/server/manicEnv.js +64 -0
  201. package/dist/server/manicEnv.js.map +1 -0
  202. package/dist/server/promptStore.d.ts +11 -0
  203. package/dist/server/promptStore.js +85 -0
  204. package/dist/server/promptStore.js.map +1 -0
  205. package/dist/server/renderJobs.d.ts +54 -0
  206. package/dist/server/renderJobs.js +290 -0
  207. package/dist/server/renderJobs.js.map +1 -0
  208. package/dist/server/settings.d.ts +40 -0
  209. package/dist/server/settings.js +262 -0
  210. package/dist/server/settings.js.map +1 -0
  211. package/dist/server/smartDraw.d.ts +7 -0
  212. package/dist/server/smartDraw.js +88 -0
  213. package/dist/server/smartDraw.js.map +1 -0
  214. package/dist/server/workspace.d.ts +27 -0
  215. package/dist/server/workspace.js +172 -0
  216. package/dist/server/workspace.js.map +1 -0
  217. package/examples/.manic-output/40b6f3b9-7638-4c0e-bb4f-570d45d1b225/job.json +26 -0
  218. package/examples/.manic-output/993f3788-f75e-445c-ba45-c401907b3c02/job.json +26 -0
  219. package/examples/.manic-output/993f3788-f75e-445c-ba45-c401907b3c02/markers.json +13 -0
  220. package/examples/.manic-output/993f3788-f75e-445c-ba45-c401907b3c02/out.mp4 +0 -0
  221. package/examples/.manic-workbench-threads/thread_3ce7448a13f64f9e887d1bc8106a97a8.json +45 -0
  222. package/examples/.manic-workbench-threads/thread_d494cda29249477591056234719e4a3a.json +21 -0
  223. package/examples/.manic-workbench-threads/thread_e98ebdc225184ea5b8ddda8b44541f63.json +29 -0
  224. package/examples/README.md +35 -0
  225. package/examples/a-story-1.manic +222 -0
  226. package/examples/a-story.manic +100 -0
  227. package/examples/achromat-cinematic.manic +105 -0
  228. package/examples/achromat.manic +32 -0
  229. package/examples/aes-decrypt.manic +359 -0
  230. package/examples/aes-encrypt.manic +359 -0
  231. package/examples/aes-round.manic +70 -0
  232. package/examples/aes-story.manic +622 -0
  233. package/examples/ai-story.manic +118 -0
  234. package/examples/analysis.manic +53 -0
  235. package/examples/archimedes_pi.manic +89 -0
  236. package/examples/area_under_curve.manic +131 -0
  237. package/examples/art-rakkan.manic +69 -0
  238. package/examples/aspheric-lens.manic +32 -0
  239. package/examples/astronomical-watch.manic +96 -0
  240. package/examples/asymptote-randomwalk3-reference.manic +58 -0
  241. package/examples/asymptote-tiling-reference.manic +65 -0
  242. package/examples/aws-clustered-web-services.manic +186 -0
  243. package/examples/aws-event-processing-clusters-poc.manic +97 -0
  244. package/examples/aws-three-tier-web-application.manic +134 -0
  245. package/examples/band.manic +43 -0
  246. package/examples/banner.manic +37 -0
  247. package/examples/bayes.manic +27 -0
  248. package/examples/bellcurve.manic +41 -0
  249. package/examples/bfs_dfs.manic +35 -0
  250. package/examples/block-tackle.manic +26 -0
  251. package/examples/bloom-scope.manic +172 -0
  252. package/examples/boolean.manic +46 -0
  253. package/examples/boxplot-wave.manic +93 -0
  254. package/examples/boxplot.manic +43 -0
  255. package/examples/brace.manic +46 -0
  256. package/examples/brachistochrone-annotated.manic +51 -0
  257. package/examples/brachistochrone.manic +27 -0
  258. package/examples/bubble_sort.manic +41 -0
  259. package/examples/bullet-block-annotated.manic +48 -0
  260. package/examples/bullet-block.manic +11 -0
  261. package/examples/bullet-impact.manic +65 -0
  262. package/examples/bungee.manic +9 -0
  263. package/examples/c4-internet-banking-components.manic +33 -0
  264. package/examples/c4-internet-banking-containers.manic +29 -0
  265. package/examples/c4-internet-banking.manic +26 -0
  266. package/examples/c4-story.manic +171 -0
  267. package/examples/c4-test.manic +52 -0
  268. package/examples/c4-zoom.manic +69 -0
  269. package/examples/calculus-demo.manic +129 -0
  270. package/examples/calculus-one.manic +288 -0
  271. package/examples/captions.manic +31 -0
  272. package/examples/car-suspension-annotated.manic +57 -0
  273. package/examples/car-suspension.manic +8 -0
  274. package/examples/cart-pendulum.manic +11 -0
  275. package/examples/charts-bar-line.manic +26 -0
  276. package/examples/charts-column-race.manic +19 -0
  277. package/examples/charts-gdp-race.manic +43 -0
  278. package/examples/charts-german-elections.manic +28 -0
  279. package/examples/charts-line-race.manic +21 -0
  280. package/examples/circle-in-three.manic +156 -0
  281. package/examples/circle-thirds-no-triangle.manic +161 -0
  282. package/examples/clip-window.manic +34 -0
  283. package/examples/cloud-feathers.manic +50 -0
  284. package/examples/cloud-jellyfish-v2.manic +87 -0
  285. package/examples/cloud-jellyfish.manic +48 -0
  286. package/examples/cloud-kaleidoscope.manic +48 -0
  287. package/examples/cloud-koi.manic +51 -0
  288. package/examples/cloud-lissajous.manic +23 -0
  289. package/examples/cloud-medusae.manic +46 -0
  290. package/examples/cloud-phoenix.manic +49 -0
  291. package/examples/cloud-plumes.manic +47 -0
  292. package/examples/cloud-pottery.manic +104 -0
  293. package/examples/cloud-shells.manic +50 -0
  294. package/examples/cloud-starfield.manic +23 -0
  295. package/examples/cloud-wave-lattice.manic +23 -0
  296. package/examples/cloud-word.manic +31 -0
  297. package/examples/cloud3-ripple.manic +53 -0
  298. package/examples/cloud3-sphere.manic +26 -0
  299. package/examples/clt.manic +35 -0
  300. package/examples/collide-blocks-annotated.manic +45 -0
  301. package/examples/collide-blocks.manic +11 -0
  302. package/examples/compare-pendulum.manic +11 -0
  303. package/examples/complex-flowchart.manic +196 -0
  304. package/examples/compound-pulley.manic +25 -0
  305. package/examples/conics.manic +46 -0
  306. package/examples/coordinates.manic +52 -0
  307. package/examples/correlation.manic +35 -0
  308. package/examples/covariance.manic +30 -0
  309. package/examples/creator-affine-fern-growth.manic +72 -0
  310. package/examples/creator-bowl-to-saddle.manic +86 -0
  311. package/examples/creator-branch-counting-tree3.manic +77 -0
  312. package/examples/creator-chaos-game-fern.manic +72 -0
  313. package/examples/creator-circle-inversion-chain.manic +61 -0
  314. package/examples/creator-convex-hull-depth.manic +59 -0
  315. package/examples/creator-coordinate-worlds.manic +182 -0
  316. package/examples/creator-ellipse-reflection-property.manic +59 -0
  317. package/examples/creator-free-kicks.manic +261 -0
  318. package/examples/creator-geometry-language-showcase.manic +259 -0
  319. package/examples/creator-geometry-morph-promo.manic +151 -0
  320. package/examples/creator-heightmap-world.manic +130 -0
  321. package/examples/creator-hilbert3-spatial-index.manic +203 -0
  322. package/examples/creator-how-rocket-launch-works.manic +192 -0
  323. package/examples/creator-implicit-surface-parameterized.manic +51 -0
  324. package/examples/creator-incenter-dissection.manic +56 -0
  325. package/examples/creator-lattice-paths.manic +118 -0
  326. package/examples/creator-line-inversion.manic +49 -0
  327. package/examples/creator-lsystem-fractal-curve.manic +121 -0
  328. package/examples/creator-mandelbrot-escape-test.manic +58 -0
  329. package/examples/creator-monty-hall.manic +104 -0
  330. package/examples/creator-noise-story.manic +123 -0
  331. package/examples/creator-one-tile-pattern-story.manic +169 -0
  332. package/examples/creator-pathfinding.manic +82 -0
  333. package/examples/creator-point-to-plane-distance.manic +167 -0
  334. package/examples/creator-race-quiz.manic +76 -0
  335. package/examples/creator-randomwalk3-diffusion.manic +72 -0
  336. package/examples/creator-reflected-ellipse.manic +48 -0
  337. package/examples/creator-rule90-sierpinski.manic +64 -0
  338. package/examples/creator-three-shadows-of-a-curve.manic +48 -0
  339. package/examples/creator-trigonometry-one-angle.manic +307 -0
  340. package/examples/creator-v2-latex-algebra.manic +29 -0
  341. package/examples/creator-v2-latex-calculus.manic +37 -0
  342. package/examples/creator-v2-latex-physics.manic +29 -0
  343. package/examples/creator-v2-olympiad-geometry.manic +92 -0
  344. package/examples/creator-v2-options-socials.manic +21 -0
  345. package/examples/creator-v2-timers.manic +25 -0
  346. package/examples/creator-v2-timing-square.manic +25 -0
  347. package/examples/creator-v2-timing.manic +34 -0
  348. package/examples/creator-v2.manic +36 -0
  349. package/examples/creator-why-rockets-use-stages.manic +198 -0
  350. package/examples/creator-wrap-real-line.manic +51 -0
  351. package/examples/cubic-graphs.manic +432 -0
  352. package/examples/curve-features.manic +41 -0
  353. package/examples/definedmotion-fourier-gallery.manic +171 -0
  354. package/examples/derivative-of-ln-x.manic +194 -0
  355. package/examples/diagonalise.manic +56 -0
  356. package/examples/dijkstra.manic +29 -0
  357. package/examples/dimensions-unfold.manic +211 -0
  358. package/examples/disc-integration.manic +172 -0
  359. package/examples/double-incline.manic +9 -0
  360. package/examples/double-integral3.manic +43 -0
  361. package/examples/double-pendulum.manic +35 -0
  362. package/examples/double-spring.manic +9 -0
  363. package/examples/drop-mass.manic +25 -0
  364. package/examples/eigen3.manic +34 -0
  365. package/examples/equal_cuts.manic +44 -0
  366. package/examples/equation.manic +16 -0
  367. package/examples/equilateral.manic +57 -0
  368. package/examples/euler_line.manic +51 -0
  369. package/examples/exponential-shells.manic +188 -0
  370. package/examples/extrude3.manic +37 -0
  371. package/examples/factorial-flowchart.manic +69 -0
  372. package/examples/fibonacci-sphere.manic +57 -0
  373. package/examples/flow-lorenz.manic +47 -0
  374. package/examples/fourier-series-live-wave.manic +114 -0
  375. package/examples/fourier-square-wave-live.manic +114 -0
  376. package/examples/fractal_tree.manic +39 -0
  377. package/examples/frame3-grid-policies.manic +48 -0
  378. package/examples/ftc.manic +54 -0
  379. package/examples/function_graph.manic +54 -0
  380. package/examples/galton-board-process.manic +150 -0
  381. package/examples/gcp-clustered-web-services.manic +186 -0
  382. package/examples/gcp-message-collecting.manic +139 -0
  383. package/examples/geo-pythagoras-short.manic +119 -0
  384. package/examples/glsl-boxgrid.manic +105 -0
  385. package/examples/glsl-parameter.manic +30 -0
  386. package/examples/glsl-raymarch.manic +59 -0
  387. package/examples/glsl-shapes.manic +122 -0
  388. package/examples/gradient-descent-field.manic +116 -0
  389. package/examples/gradient-fastest-descent-shorts.manic +153 -0
  390. package/examples/gradient-fastest-descent.manic +125 -0
  391. package/examples/gradient-pendulum-shorts.manic +117 -0
  392. package/examples/gradient.manic +74 -0
  393. package/examples/graph.manic +45 -0
  394. package/examples/graph_moving.manic +67 -0
  395. package/examples/grid-astar.manic +15 -0
  396. package/examples/grid-life-soup.manic +31 -0
  397. package/examples/grid-life-zoo.manic +46 -0
  398. package/examples/grid-life.manic +19 -0
  399. package/examples/grid-wfc.manic +13 -0
  400. package/examples/growing-fractal-tree3.manic +58 -0
  401. package/examples/gun-shot.manic +82 -0
  402. package/examples/hashmap.manic +38 -0
  403. package/examples/heightmap3-world.manic +64 -0
  404. package/examples/heightmap3.manic +23 -0
  405. package/examples/hilbert-curve3-space-filling.manic +117 -0
  406. package/examples/hill_run.manic +71 -0
  407. package/examples/histogram.manic +43 -0
  408. package/examples/hotdog-taco.manic +147 -0
  409. package/examples/hue_wave.manic +35 -0
  410. package/examples/hypothesis.manic +32 -0
  411. package/examples/image.manic +29 -0
  412. package/examples/incircle_tangents.manic +64 -0
  413. package/examples/incline-bumper.manic +11 -0
  414. package/examples/incline-pulley.manic +11 -0
  415. package/examples/incline-showcase.manic +55 -0
  416. package/examples/inline-math.manic +16 -0
  417. package/examples/inscribed-angle-short.manic +56 -0
  418. package/examples/integral-sqrt-tanx.manic +255 -0
  419. package/examples/integrals.manic +274 -0
  420. package/examples/inverse-derivatives.manic +94 -0
  421. package/examples/k8s-cluster-components.manic +82 -0
  422. package/examples/k8s-stateful-architecture.manic +134 -0
  423. package/examples/k8s-three-tier.manic +146 -0
  424. package/examples/kapitza.manic +11 -0
  425. package/examples/latex-disintegration.manic +123 -0
  426. package/examples/lens-paper.manic +36 -0
  427. package/examples/lens-prescription.manic +33 -0
  428. package/examples/lens-system.manic +34 -0
  429. package/examples/lens.manic +31 -0
  430. package/examples/limit-infinity.manic +30 -0
  431. package/examples/limit.manic +33 -0
  432. package/examples/linear-algebra-3d.manic +50 -0
  433. package/examples/linear-algebra.manic +115 -0
  434. package/examples/linear-map.manic +39 -0
  435. package/examples/linear-map3.manic +33 -0
  436. package/examples/linear-system.manic +99 -0
  437. package/examples/linear_transform.manic +43 -0
  438. package/examples/linked_list.manic +38 -0
  439. package/examples/lln.manic +31 -0
  440. package/examples/loop-cinematic.manic +41 -0
  441. package/examples/loop-track.manic +11 -0
  442. package/examples/lorenz-attractor.manic +55 -0
  443. package/examples/lorenz-shells.manic +43 -0
  444. package/examples/lost-in-patterns.manic +149 -0
  445. package/examples/lsystem-asymptote-curves.manic +81 -0
  446. package/examples/manic-ml-activation-focus.manic +133 -0
  447. package/examples/manic-ml-cnn-edge-story.manic +102 -0
  448. package/examples/manic-ml-forward-pass.manic +93 -0
  449. package/examples/manic-ml-learning-step.manic +116 -0
  450. package/examples/manic-ml-logits-sampling.manic +112 -0
  451. package/examples/manic-ml-scalar-to-tensor.manic +143 -0
  452. package/examples/manic-ml-token-embedding.manic +110 -0
  453. package/examples/manic-ml-transformer-attention.manic +102 -0
  454. package/examples/manic-ml-transformer-block.manic +116 -0
  455. package/examples/manic-promo.manic +64 -0
  456. package/examples/map-attractor.manic +45 -0
  457. package/examples/mask-lens.manic +33 -0
  458. package/examples/matrix.manic +37 -0
  459. package/examples/matrix3.manic +101 -0
  460. package/examples/matrix_addition.manic +66 -0
  461. package/examples/matrix_addition_plane.manic +91 -0
  462. package/examples/maxwell-boltzmann-effusion-v2.manic +142 -0
  463. package/examples/maxwell-boltzmann-process.manic +86 -0
  464. package/examples/microservices-platform.manic +140 -0
  465. package/examples/molecule.manic +8 -0
  466. package/examples/morph-icons.manic +29 -0
  467. package/examples/morph.manic +29 -0
  468. package/examples/morph3.manic +49 -0
  469. package/examples/motion-flow-foundation.manic +148 -0
  470. package/examples/motion-graphics-v2-story.manic +189 -0
  471. package/examples/motion-graphics-v2.manic +81 -0
  472. package/examples/motion-graphics.manic +81 -0
  473. package/examples/multivariable3.manic +26 -0
  474. package/examples/mystory.manic +9 -0
  475. package/examples/newton.manic +39 -0
  476. package/examples/newtons-cradle.manic +10 -0
  477. package/examples/nine_point.manic +59 -0
  478. package/examples/noise-terrain.manic +16 -0
  479. package/examples/off-axis.manic +32 -0
  480. package/examples/onprem-advanced-web-service-v2.manic +196 -0
  481. package/examples/onprem-advanced-web-service.manic +175 -0
  482. package/examples/orthocenter.manic +63 -0
  483. package/examples/param3.manic +43 -0
  484. package/examples/parameter-journeys.manic +154 -0
  485. package/examples/parameterized-field-advection.manic +57 -0
  486. package/examples/parameterized-generated-families3.manic +83 -0
  487. package/examples/particles-flow.manic +61 -0
  488. package/examples/pascal-triangle.manic +92 -0
  489. package/examples/pendulum-annotated.manic +72 -0
  490. package/examples/pendulum-damped.manic +35 -0
  491. package/examples/pendulum.manic +38 -0
  492. package/examples/perfect-reel.manic +43 -0
  493. package/examples/pie.manic +41 -0
  494. package/examples/pieday.manic +113 -0
  495. package/examples/piston.manic +7 -0
  496. package/examples/popkorn-field.manic +38 -0
  497. package/examples/prism-cinematic.manic +36 -0
  498. package/examples/prism.manic +32 -0
  499. package/examples/probability.manic +57 -0
  500. package/examples/process-branching-dispatch.manic +71 -0
  501. package/examples/process-stream-observe.manic +54 -0
  502. package/examples/projection.manic +57 -0
  503. package/examples/prompt-test-10.manic +257 -0
  504. package/examples/prompt-test-11.manic +168 -0
  505. package/examples/prompt-test-12.manic +177 -0
  506. package/examples/prompt-test-13.manic +228 -0
  507. package/examples/prompt-test-14.manic +319 -0
  508. package/examples/prompt-test-15.manic +325 -0
  509. package/examples/prompt-test-16.manic +252 -0
  510. package/examples/prompt-test-2.manic +239 -0
  511. package/examples/prompt-test-3.manic +336 -0
  512. package/examples/prompt-test-4.manic +195 -0
  513. package/examples/prompt-test-5.manic +223 -0
  514. package/examples/prompt-test-6.manic +222 -0
  515. package/examples/prompt-test-7.manic +156 -0
  516. package/examples/prompt-test-8.manic +266 -0
  517. package/examples/prompt-test-9.manic +171 -0
  518. package/examples/prompt-test.manic +158 -0
  519. package/examples/pulley-annotated.manic +54 -0
  520. package/examples/pulley-paper.manic +52 -0
  521. package/examples/pulley-scale.manic +23 -0
  522. package/examples/pulley.manic +24 -0
  523. package/examples/quadratic-formula-continuity.manic +110 -0
  524. package/examples/quiz-euler.manic +52 -0
  525. package/examples/quiz-geometry-2.manic +107 -0
  526. package/examples/quiz-geometry.manic +108 -0
  527. package/examples/quiz-skins.manic +22 -0
  528. package/examples/raft-cm.manic +24 -0
  529. package/examples/ramp.manic +25 -0
  530. package/examples/ray-fan.manic +27 -0
  531. package/examples/raymarch-alpha.manic +39 -0
  532. package/examples/raymarch-boxgrid.manic +47 -0
  533. package/examples/raymarch-docker-latency.manic +74 -0
  534. package/examples/raymarch-metaballs.manic +37 -0
  535. package/examples/raymarch-sculpture.manic +39 -0
  536. package/examples/raymarch-shapes3.manic +31 -0
  537. package/examples/reactive-integral.manic +172 -0
  538. package/examples/reactive-math-journey.manic +185 -0
  539. package/examples/reactive-math-notation.manic +150 -0
  540. package/examples/reactive-multiformat.manic +130 -0
  541. package/examples/reactive-world.manic +111 -0
  542. package/examples/refraction-paper.manic +40 -0
  543. package/examples/refraction.manic +32 -0
  544. package/examples/resonance.manic +10 -0
  545. package/examples/rewrite-exponential-cubic.manic +141 -0
  546. package/examples/rewrite-integration.manic +199 -0
  547. package/examples/riemann_rainbow.manic +61 -0
  548. package/examples/riemann_readout.manic +61 -0
  549. package/examples/robot-arm.manic +25 -0
  550. package/examples/rref.manic +48 -0
  551. package/examples/second-law-thermodynamics.manic +385 -0
  552. package/examples/series-parallel-springs.manic +8 -0
  553. package/examples/serverless-processing.manic +145 -0
  554. package/examples/shader-cellular.manic +35 -0
  555. package/examples/shader-fractal.manic +45 -0
  556. package/examples/shader-fx.manic +34 -0
  557. package/examples/shader-glitch-grid.manic +55 -0
  558. package/examples/shader-parameter.manic +25 -0
  559. package/examples/shader-patterns.manic +37 -0
  560. package/examples/shader-plasma.manic +43 -0
  561. package/examples/shader-shapes-dsl.manic +46 -0
  562. package/examples/shader-shapes.manic +37 -0
  563. package/examples/shader-warp.manic +22 -0
  564. package/examples/shapes-howto.manic +411 -0
  565. package/examples/sine_wave.manic +42 -0
  566. package/examples/skew.manic +40 -0
  567. package/examples/smoke.rs +57 -0
  568. package/examples/solids3.manic +22 -0
  569. package/examples/some-story.manic +299 -0
  570. package/examples/spinning-cylinder-flow.manic +87 -0
  571. package/examples/spline.manic +21 -0
  572. package/examples/spot-diagram.manic +32 -0
  573. package/examples/spring-annotated.manic +60 -0
  574. package/examples/spring-chain.manic +11 -0
  575. package/examples/spring-damped.manic +33 -0
  576. package/examples/spring-incline.manic +10 -0
  577. package/examples/spring-paper.manic +46 -0
  578. package/examples/spring-pendulum.manic +14 -0
  579. package/examples/spring.manic +33 -0
  580. package/examples/sqrt-tanx.manic +217 -0
  581. package/examples/ssl-handshake-sdf.manic +116 -0
  582. package/examples/stack_queue.manic +53 -0
  583. package/examples/statistics.manic +60 -0
  584. package/examples/story-addressable-asset-cues.manic +71 -0
  585. package/examples/story-dependent-chain-history.manic +56 -0
  586. package/examples/story-living-dependency-cloud.manic +50 -0
  587. package/examples/story-time-varying-field3.manic +57 -0
  588. package/examples/story.manic +4 -0
  589. package/examples/string-art-breath.manic +70 -0
  590. package/examples/string-wave.manic +10 -0
  591. package/examples/summary.manic +48 -0
  592. package/examples/svg-howto.manic +172 -0
  593. package/examples/svg-import.manic +18 -0
  594. package/examples/systems-architecture-poc.manic +92 -0
  595. package/examples/systems-arrow-patterns.manic +151 -0
  596. package/examples/systems-foundation.manic +71 -0
  597. package/examples/systems-rabbitmq-consumers.manic +118 -0
  598. package/examples/table.manic +39 -0
  599. package/examples/table_braces.manic +54 -0
  600. package/examples/tangent-length-short.manic +57 -0
  601. package/examples/tangent.manic +29 -0
  602. package/examples/tangents.manic +54 -0
  603. package/examples/taylor.manic +44 -0
  604. package/examples/terminal_boot.manic +40 -0
  605. package/examples/test.manic +61 -0
  606. package/examples/text-guide.manic +304 -0
  607. package/examples/textbook-coordinate-worlds.manic +129 -0
  608. package/examples/textbook-doubly-list.manic +33 -0
  609. package/examples/textbook-function-to-solid.manic +126 -0
  610. package/examples/textbook-geometry-dimension-reduction.manic +129 -0
  611. package/examples/textbook-incline-fbd.manic +43 -0
  612. package/examples/textbook-length-area-volume.manic +137 -0
  613. package/examples/textbook-matrix-inverses.manic +172 -0
  614. package/examples/textbook-pulley.manic +35 -0
  615. package/examples/textbook-statistical-dimensions.manic +151 -0
  616. package/examples/textbook-tension.manic +39 -0
  617. package/examples/textbook-watermelon-sections.manic +216 -0
  618. package/examples/thales-semicircle-short.manic +53 -0
  619. package/examples/three-d-v2-lab.manic +83 -0
  620. package/examples/three-d-v2-story.manic +106 -0
  621. package/examples/three-d-v2.manic +69 -0
  622. package/examples/three_d.manic +39 -0
  623. package/examples/timing-v2-scene.manic +47 -0
  624. package/examples/trajectory.manic +28 -0
  625. package/examples/transform_copy.manic +35 -0
  626. package/examples/transforms.manic +54 -0
  627. package/examples/trapped-light-dimensions.manic +226 -0
  628. package/examples/tree-of-leaves.manic +215 -0
  629. package/examples/triangle.manic +68 -0
  630. package/examples/two_person_walk.manic +296 -0
  631. package/examples/two_pointer.manic +32 -0
  632. package/examples/type-to-sdf.manic +139 -0
  633. package/examples/typewriter.manic +28 -0
  634. package/examples/vector_field.manic +32 -0
  635. package/examples/vertical-spring.manic +10 -0
  636. package/examples/volume3.manic +21 -0
  637. package/examples/volumes-solid-of-revolution.manic +111 -0
  638. package/examples/walk.manic +154 -0
  639. package/examples/wheel-duo.manic +91 -0
  640. package/examples/wheel-radial.manic +78 -0
  641. package/examples/wheel-square.manic +83 -0
  642. package/examples/wireframe-spheres.manic +37 -0
  643. package/examples/zeroth-law-thermodynamics.manic +269 -0
  644. package/package.json +59 -0
@@ -0,0 +1,55 @@
1
+ // shader-glitch-grid — a p5 WEBGL multi-pass sketch ("Glitch animation of a randomly
2
+ // generated grid pattern") reimagined in ONE manic `shader`. The original pre-renders
3
+ // FOUR grid/stripe layers into off-screen buffers, composites them with a substitution
4
+ // shader (each coarse cell shows a different sub-pattern), captures the result, then a
5
+ // second shader RGB-shifts it into a glitch. manic `glsl()` can't take render-target
6
+ // textures — but the OUTCOME is closed-form: build the nested grid PROCEDURALLY per
7
+ // pixel, then chromatically tear it by sampling each colour channel at a per-scanline
8
+ // horizontal offset. Pure in (u,v,t): the glitch scrubs and records exactly.
9
+ //
10
+ // manic examples/shader-glitch-grid.manic
11
+ title("Glitch grid — a multi-pass shader, reimagined per-pixel");
12
+ canvas("1:1");
13
+ template("black");
14
+
15
+ shader(glitch) {
16
+ // per-scanline-block horizontal offset, re-randomised a few times a second, and
17
+ // faded IN after the grid has settled (the original delays the glitch too)
18
+ let band = floor(v * 40.0);
19
+ let gt = floor(t * 3.0);
20
+ let gon = smoothstep(3.5, 4.5, t);
21
+ let off = (rand2(band, gt) - 0.5) * 0.06 * gon;
22
+
23
+ // RED — the nested random grid sampled at u + off
24
+ let ru = u + off;
25
+ let rcx = floor(ru * 10.0); let rcy = floor(v * 10.0); let rh = rand2(rcx, rcy);
26
+ let rdot = step(0.2, fract(ru * 100.0)) * step(fract(ru * 100.0), 0.8)
27
+ * step(0.2, fract(v * 100.0)) * step(fract(v * 100.0), 0.8);
28
+ let rstr = step(0.5, fract(v * 50.0));
29
+ let cr = mix(0.08, mix(mix(0.90, 0.12, rdot), mix(0.93, 0.18, rstr), step(0.7, rh)), step(0.4, rh));
30
+
31
+ // GREEN — same grid at u + off*0.3 (slight chromatic split)
32
+ let gu = u + off * 0.3;
33
+ let gcx = floor(gu * 10.0); let gh = rand2(gcx, rcy);
34
+ let gdot = step(0.2, fract(gu * 100.0)) * step(fract(gu * 100.0), 0.8)
35
+ * step(0.2, fract(v * 100.0)) * step(fract(v * 100.0), 0.8);
36
+ let cg = mix(0.08, mix(mix(0.90, 0.12, gdot), mix(0.93, 0.18, rstr), step(0.7, gh)), step(0.4, gh));
37
+
38
+ // BLUE — same grid at u + off*1.2 (the widest split)
39
+ let bu = u + off * 1.2;
40
+ let bcx = floor(bu * 10.0); let bh = rand2(bcx, rcy);
41
+ let bdot = step(0.2, fract(bu * 100.0)) * step(fract(bu * 100.0), 0.8)
42
+ * step(0.2, fract(v * 100.0)) * step(fract(v * 100.0), 0.8);
43
+ let cb = mix(0.08, mix(mix(0.90, 0.12, bdot), mix(0.93, 0.18, rstr), step(0.7, bh)), step(0.4, bh));
44
+
45
+ // white noise on top (as the original adds), stronger while glitching
46
+ let n = (rand2(u * 700.0 + gt, v * 700.0) - 0.5) * (0.05 + 0.12 * gon);
47
+ let r = cr + n;
48
+ let g = cg + n;
49
+ let b = cb + n;
50
+ }
51
+
52
+ caption(head, "Glitch grid — one formula per pixel", (400, 44), 22);
53
+ hidden(head);
54
+ show(head);
55
+ wait(9);
@@ -0,0 +1,25 @@
1
+ // shader-parameter — a `shader` driven by a scene `parameter`, not just by time.
2
+ // The ring frequency `freq` is a slider/parameter: the shader references it by
3
+ // name, so the SAME field re-renders as `freq` animates. On the GLSL path it's a
4
+ // `u_freq` uniform (resolved from the parameter each frame); on the CPU fallback
5
+ // the live value is substituted into the formula — both stay in lock-step.
6
+ //
7
+ // manic examples/shader-parameter.manic
8
+ title("A shader driven by a parameter");
9
+ canvas("16:9");
10
+ template("black");
11
+
12
+ parameter(freq, (640, 660), 3, 1, 14, "freq", 0);
13
+
14
+ shader(rings) {
15
+ let d = hypot((u - 0.5) * asp, v - 0.5); // distance from centre (aspect-correct)
16
+ let hue = mod(d * freq * 90.0, 360.0); // ring hue cycles faster as freq rises
17
+ let sat = 0.8;
18
+ let val = 0.55 + 0.35 * sin(d * freq * 18.0);
19
+ }
20
+
21
+ caption(head, "shader ← parameter", (640, 66), 34);
22
+ hidden(head);
23
+ show(head);
24
+ // sweep the parameter: the rings tighten as freq climbs 3 → 14
25
+ to(freq, value, 14, 6, smooth);
@@ -0,0 +1,37 @@
1
+ // shader-patterns — the Book-of-Shaders "Patterns" chapter: `fract` and `floor`
2
+ // turn ONE cell into an infinite grid. `fract(u*n)` is the position INSIDE each
3
+ // tile (0..1), `floor(u*n)` is which tile you're in — so one motif drawn in tile
4
+ // space repeats everywhere, and the tile index can drive per-tile colour. Pure
5
+ // algebra of (u, v, t): no copies, no loop.
6
+ //
7
+ // manic examples/shader-patterns.manic
8
+ title("Patterns — one tile, endlessly repeated");
9
+ canvas("9:16");
10
+ template("black");
11
+
12
+ shader(bg) {
13
+ let n = 6.0;
14
+ let gx = fract(u*n*asp) - 0.5; // local coord inside each tile
15
+ let gy = fract(v*n) - 0.5;
16
+ let d = length(gx, gy);
17
+ let dot = smoothstep(0.36, 0.30, d); // a disc per tile
18
+ let ring = smoothstep(0.02, 0.0, abs(d - (0.24 + 0.06*sin(t)))); // pulsing ring
19
+ let id = floor(u*n*asp) + floor(v*n); // which tile → per-tile hue
20
+ let hue = mod(id*24.0 + t*36.0, 360.0);
21
+ let sat = 0.85;
22
+ let val = 0.12 + 0.6*dot + 0.5*ring;
23
+ }
24
+
25
+ caption(head, "Patterns from one tile", (540, 150), 34);
26
+ caption(sub, "fract() = position in tile, floor() = which tile", (540, 214), 20);
27
+ hidden(head);
28
+ hidden(sub);
29
+ equation(eq, (540, 1720), `\text{tile}(u)=\operatorname{fract}(u\,n),\ \operatorname{floor}(u\,n)`, 28);
30
+ hidden(eq);
31
+
32
+ show(head);
33
+ wait(1.4);
34
+ show(sub);
35
+ wait(2.4);
36
+ show(eq);
37
+ wait(22);
@@ -0,0 +1,43 @@
1
+ // shader-plasma — a fragment-shader-style colour field, the per-PIXEL twin of
2
+ // `cloud`. Every pixel's colour is ONE closed-form formula of its normalized
3
+ // coordinates `u`/`v`, live time `t`, and aspect `asp` — re-evaluated each frame
4
+ // yet pure in `t`, so it scrubs and records exactly. This is manic's take on
5
+ // "The Book of Shaders" (thebookofshaders.com): no per-pixel loops, just algebra.
6
+ //
7
+ // manic examples/shader-plasma.manic
8
+ title("A shader — one formula, every pixel");
9
+ canvas("9:16");
10
+ template("black");
11
+
12
+ shader(bg) {
13
+ // centre + aspect-correct so the field is round, not stretched (u/v are 0..1
14
+ // on BOTH axes, so a raw circle would be an ellipse on a 9:16 canvas).
15
+ let x = (u - 0.5) * asp;
16
+ let y = v - 0.5;
17
+ let d = length(x, y);
18
+ // layered travelling sines = classic plasma
19
+ let p = sin(x*7.0 + t) + sin(y*7.0 + t*1.3) + sin((x + y)*5.0 - t*0.9) + sin(d*11.0 - t*1.6);
20
+ // vignette: bright centre → dark edges (so the title/caption read in white)
21
+ let vig = smoothstep(0.95, 0.2, d);
22
+ let r = (0.5 + 0.5*sin(p + t)) * vig;
23
+ let g = (0.5 + 0.5*sin(p + t + 2.1)) * vig;
24
+ let b = (0.5 + 0.5*sin(p + t + 4.2)) * vig;
25
+ }
26
+
27
+ // ---- textbook annotations ----
28
+ caption(head, "A shader — one formula per pixel", (540, 150), 32);
29
+ caption(sub, "no loops, no assets — just algebra of (u, v, t)", (540, 214), 20);
30
+ hidden(head);
31
+ hidden(sub);
32
+ equation(eq, (540, 1720), `\text{colour} = f(u,\, v,\, t)`, 40);
33
+ caption(lab, "per-pixel, re-evaluated every frame — yet seekable", (540, 1800), 20);
34
+ hidden(eq);
35
+ hidden(lab);
36
+
37
+ show(head);
38
+ wait(1.4);
39
+ show(sub);
40
+ wait(2.4);
41
+ show(eq);
42
+ show(lab);
43
+ wait(24);
@@ -0,0 +1,46 @@
1
+ // shader-shapes-dsl — Patricio's glsl-shapes Shadertoy, now a FAITHFUL DSL twin using
2
+ // the new shape/SDF builtins (Layer 1). No vec2 algebra, no branches, no glsl — each
3
+ // shape is one scalar builtin (`sdpolygon`/`sdcircle`/`sdtriangle`/`sdhexagon`/
4
+ // `sdstar`/`sdrhombus`/`sdroundbox`), unioned, and banded by Patricio's oscillating
5
+ // iso-line. Transpiles to GLSL (full-res) with the CPU field as the exact fallback —
6
+ // so the SAME scene renders identically on both, unlike the old polar-approximation.
7
+ //
8
+ // manic examples/shader-shapes-dsl.manic
9
+ title("Patricio's shapes — faithful, in the shader DSL");
10
+ canvas("16:9");
11
+ template("black");
12
+
13
+ shader(shapes) {
14
+ let x = u * asp; // match Patricio's st = uv*vec2(asp,1)
15
+ let y = v;
16
+
17
+ // eight SDF shapes, each a single builtin (centres = Patricio's layout)
18
+ let s0 = sdpolygon(x - 0.48, y - 0.48, 0.076, 5); // pentagon
19
+ let s1 = sdcircle(x - 0.75, y - 0.80, 0.076); // circle
20
+ let s2 = sdtriangle(x - 0.21, y - 0.79, 0.076); // triangle
21
+ let s3 = sdpolygon(x - 0.16, y - 0.26, 0.076, 8); // octagon
22
+ let s4 = sdhexagon(x - 0.20, y - 0.50, 0.060); // hexagon
23
+ let s5 = sdstar(x - 0.79, y - 0.51, 0.11, 5); // 5-point star
24
+ let s6 = sdrhombus(x - 0.63, y - 0.17, 0.15, 0.07); // rhombus (≈ the ellipse)
25
+ let s7 = sdroundbox(x - 0.48, y - 0.79, 0.13, 0.05, 0.03); // rounded rectangle
26
+
27
+ // union — smin with a tiny k ≈ hard min (DSL `min` is a reduction, not callable)
28
+ let ua = smin(smin(smin(s0, s1, 0.003), s2, 0.003), s3, 0.003);
29
+ let ub = smin(smin(smin(s4, s5, 0.003), s6, 0.003), s7, 0.003);
30
+ let d = smin(ua, ub, 0.003);
31
+
32
+ // Patricio's oscillating iso-band + inside / thin-line masks
33
+ let band = floor(mod((d * 57.6 + t * 2.6) / 2.0, 1.0) * 2.0);
34
+ let outside = step(0.0, d);
35
+ let linem = step(0.0, d) * step(d, 0.006);
36
+
37
+ // two-tone palette: orange outside, blue inside (each banded); white iso-line
38
+ let br = mix(mix(0.431, 0.270, band), 1.000, outside);
39
+ let bgc = mix(mix(0.436, 0.190, band), mix(0.684, 0.514, band), outside);
40
+ let bbc = mix(1.000, mix(0.364, 0.128, band), outside);
41
+ let r = mix(br, 1.0, linem);
42
+ let g = mix(bgc, 1.0, linem);
43
+ let b = mix(bbc, 1.0, linem);
44
+ }
45
+
46
+ wait(8);
@@ -0,0 +1,37 @@
1
+ // shader-shapes — the Book-of-Shaders "Shapes" chapter: draw with DISTANCE and
2
+ // ANGLE. `length(x,y)` is the distance to the centre, `atan2(y,x)` the angle;
3
+ // modulating the radius by the angle turns a circle into a star or flower, and
4
+ // `smoothstep` cuts a crisp (anti-aliased) edge from the distance field. All
5
+ // per-pixel, no paths — just polar algebra of (u, v, t).
6
+ //
7
+ // manic examples/shader-shapes.manic
8
+ title("Shapes from distance & angle — a shader");
9
+ canvas("9:16");
10
+ template("black");
11
+
12
+ shader(bg) {
13
+ let x = (u - 0.5) * asp; // aspect-correct so it's round, not oval
14
+ let y = v - 0.5;
15
+ let r = length(x, y); // distance to centre
16
+ let a = atan2(y, x); // angle (polar)
17
+ // a 5-point star: the edge radius breathes with the angle (and pulses in t)
18
+ let edge = 0.30 + 0.08*cos(a*5.0 + t) + 0.02*sin(t*2.0);
19
+ let body = smoothstep(edge + 0.006, edge - 0.006, r); // 1 inside the star
20
+ let hue = mod(a*57.3 + t*30.0, 360.0); // angle → rainbow rim
21
+ let sat = 0.9;
22
+ let val = 0.12 + 0.6*body; // dark field, lit star
23
+ }
24
+
25
+ caption(head, "Shapes from distance & angle", (540, 150), 32);
26
+ caption(sub, "length() = radius, atan2() = angle — polar SDF", (540, 214), 20);
27
+ hidden(head);
28
+ hidden(sub);
29
+ equation(eq, (540, 1720), `r=\text{length}(x,y),\quad \theta=\operatorname{atan2}(y,x)`, 30);
30
+ hidden(eq);
31
+
32
+ show(head);
33
+ wait(1.4);
34
+ show(sub);
35
+ wait(2.4);
36
+ show(eq);
37
+ wait(22);
@@ -0,0 +1,22 @@
1
+ // shader-warp — Layer 2: vec math in the DSL. The headline that Layer-1 builtins
2
+ // can't express — DOMAIN WARPING. You can't rotate a scalar coordinate; with vec2 +
3
+ // rot2 + swizzle you rotate SPACE itself (more the further from centre), then read a
4
+ // ring pattern in the warped frame. Pure DSL — no glsl(), no vec2 gymnastics beyond
5
+ // the builtins. vecs are erased to scalar math at compile, so it renders on both
6
+ // backends (CPU field + GLSL) from one source.
7
+ //
8
+ // manic examples/shader-warp.manic
9
+ title("Domain warp — vec2 + rot2 in the shader DSL");
10
+ canvas("16:9");
11
+ template("black");
12
+
13
+ shader(warp) {
14
+ let p = vec2(u * asp - 0.9, v - 0.5); // name the centred coordinate as a vec2
15
+ let ang = length(p) * 7.0 - t; // twist grows with radius
16
+ let q = rot2(p, ang); // rotate SPACE once; reuse the vec2
17
+ let hue = mod(200.0 + q.x * 500.0 + q.y * 300.0, 360.0);
18
+ let sat = 0.8;
19
+ let val = 0.5 + 0.4 * sin(q.y * 40.0);
20
+ }
21
+
22
+ wait(8);
@@ -0,0 +1,411 @@
1
+ // ============================================================================
2
+ // shapes-howto.manic — SHAPECRAFT
3
+ // A power demo that also teaches the rules:
4
+ // fills hide constructions · outlined reveals · dashed rings for contacts
5
+ // circle/rect/polygon/sector fill by default · morph / become change identity
6
+ //
7
+ // manic examples/shapes-howto.manic
8
+ // manic examples/shapes-howto.manic --record out --preset studio
9
+ // ============================================================================
10
+
11
+ title("Shapecraft — Manic Shape Power");
12
+ canvas("16:9");
13
+ template("blank");
14
+
15
+ text(cap, (cx, h - 34), ""); size(cap, 22); color(cap, dim); display(cap);
16
+ text(head, (cx, 58), ""); size(head, 32); color(head, gold); display(head); bold(head);
17
+
18
+ // ---- stage energy ----
19
+ circle(well, (cx, cy), 420);
20
+ filled(well); gradient(well, panel, void, indigo, radial); opacity(well, 0.7);
21
+
22
+ spline(orbit, (180, 520), (340, 220), (640, 160), (940, 220), (1100, 520));
23
+ stroke(orbit, 2.5); gradient(orbit, dim, violet, teal, "curvature");
24
+ untraced(orbit); hidden(orbit); opacity(orbit, 0.55);
25
+
26
+ // ---- hero: one persistent outlined circle ----
27
+ circle(hero, (cx, cy), 120);
28
+ outlined(hero); color(hero, cyan); stroke(hero, 6); glow(hero, 1.4);
29
+ gradient(hero, cyan, mint, teal, 45);
30
+ untraced(hero); hidden(hero);
31
+
32
+ // fill veil — fades over the hero to show the trap without destroying morph
33
+ circle(veil, (cx, cy), 120);
34
+ filled(veil); color(veil, indigo); opacity(veil, 0.92); hidden(veil); z(veil, 5);
35
+
36
+ rect(asSquare, (cx, cy), 220, 220); hidden(asSquare);
37
+ polygon(asTri, (cx, 250), (cx - 140, 520), (cx + 140, 520)); hidden(asTri);
38
+ sector(asPie, (cx, cy), 130, -30, 300); color(asPie, magenta); hidden(asPie);
39
+ polygon(asDiamond, (cx, cy - 130), (cx + 130, cy), (cx, cy + 130), (cx - 130, cy));
40
+ color(asDiamond, gold); hidden(asDiamond);
41
+
42
+ circle(finalForm, (cx, cy), 130);
43
+ outlined(finalForm); color(finalForm, cyan); stroke(finalForm, 6);
44
+ gradient(finalForm, cyan, mint, violet, 90); glow(finalForm, 1.6); hidden(finalForm);
45
+
46
+ morph(hero, asSquare, 180); // spin-wound morph ready
47
+
48
+ text(heroTag, (cx, cy - 170), "one persistent id");
49
+ size(heroTag, 22); color(heroTag, fg); hidden(heroTag);
50
+
51
+ // ---- axes for the fill-trap punch ----
52
+ line(axX, (cx - 200, cy), (cx + 200, cy));
53
+ color(axX, dim); stroke(axX, 2); untraced(axX); hidden(axX);
54
+ line(axY, (cx, cy - 160), (cx, cy + 160));
55
+ color(axY, dim); stroke(axY, 2); untraced(axY); hidden(axY);
56
+
57
+ // ---- the cast (draw-on parade, then orbit travel) ----
58
+ circle(castC, (cx - 280, 280), 48);
59
+ outlined(castC); color(castC, teal); stroke(castC, 3.5); untraced(castC); hidden(castC);
60
+ rect(castR, (cx - 100, 250), 90, 70);
61
+ outlined(castR); color(castR, coral); stroke(castR, 3.5); untraced(castR); hidden(castR);
62
+ polygon(castP, (cx + 80, 230), (cx + 30, 310), (cx + 130, 310));
63
+ outlined(castP); color(castP, violet); stroke(castP, 3.5); untraced(castP); hidden(castP);
64
+ sector(castS, (cx + 260, 280), 52, -40, 240);
65
+ outlined(castS); color(castS, gold); stroke(castS, 3.5); untraced(castS); hidden(castS);
66
+ arc(castA, (cx - 220, 480), 50, -20, 250);
67
+ color(castA, mint); stroke(castA, 4); untraced(castA); hidden(castA);
68
+ arrow(castV, (cx + 40, 500), (cx + 180, 430));
69
+ color(castV, magenta); stroke(castV, 4); untraced(castV); hidden(castV);
70
+ line(castL, (cx + 240, 500), (cx + 340, 430));
71
+ color(castL, lime); stroke(castL, 4); untraced(castL); hidden(castL);
72
+
73
+ // sparks that ring the hero, then settle
74
+ rect(seed, (cx, cy), 60, 60); hidden(seed);
75
+ particles(sparks, seed, 12, 6, 19, "random");
76
+ color(sparks, cyan); glow(sparks, 0.5); hidden(sparks);
77
+ circle(orbitRing, (cx, cy), 230); hidden(orbitRing);
78
+
79
+ // ---- palette chips (fill OK — colour IS the subject) ----
80
+ let py = 400;
81
+ circle(chip0, (140, py), 26); filled(chip0); color(chip0, fg); hidden(chip0);
82
+ circle(chip1, (220, py), 26); filled(chip1); color(chip1, cyan); hidden(chip1);
83
+ circle(chip2, (300, py), 26); filled(chip2); color(chip2, magenta); hidden(chip2);
84
+ circle(chip3, (380, py), 26); filled(chip3); color(chip3, lime); hidden(chip3);
85
+ circle(chip4, (460, py), 26); filled(chip4); color(chip4, gold); hidden(chip4);
86
+ circle(chip5, (540, py), 26); filled(chip5); color(chip5, red); hidden(chip5);
87
+ circle(chip6, (620, py), 26); filled(chip6); color(chip6, orange); hidden(chip6);
88
+ circle(chip7, (700, py), 26); filled(chip7); color(chip7, blue); hidden(chip7);
89
+ circle(chip8, (780, py), 26); filled(chip8); color(chip8, teal); hidden(chip8);
90
+ circle(chip9, (860, py), 26); filled(chip9); color(chip9, violet); hidden(chip9);
91
+ circle(chip10, (940, py), 26); filled(chip10); color(chip10, coral); hidden(chip10);
92
+ circle(chip11, (1020,py), 26); filled(chip11); color(chip11, indigo); hidden(chip11);
93
+ circle(chip12, (1100,py), 26); filled(chip12); color(chip12, mint); hidden(chip12);
94
+ circle(chip13, (1180,py), 26); filled(chip13); color(chip13, dim); hidden(chip13);
95
+
96
+ rect(sq0, (140, py), 48, 48); color(sq0, fg); filled(sq0); hidden(sq0);
97
+ rect(sq1, (220, py), 48, 48); color(sq1, cyan); filled(sq1); hidden(sq1);
98
+ rect(sq2, (300, py), 48, 48); color(sq2, magenta); filled(sq2); hidden(sq2);
99
+ rect(sq3, (380, py), 48, 48); color(sq3, lime); filled(sq3); hidden(sq3);
100
+ rect(sq4, (460, py), 48, 48); color(sq4, gold); filled(sq4); hidden(sq4);
101
+ rect(sq5, (540, py), 48, 48); color(sq5, red); filled(sq5); hidden(sq5);
102
+ rect(sq6, (620, py), 48, 48); color(sq6, orange); filled(sq6); hidden(sq6);
103
+ rect(sq7, (700, py), 48, 48); color(sq7, blue); filled(sq7); hidden(sq7);
104
+ rect(sq8, (780, py), 48, 48); color(sq8, teal); filled(sq8); hidden(sq8);
105
+ rect(sq9, (860, py), 48, 48); color(sq9, violet); filled(sq9); hidden(sq9);
106
+ rect(sq10, (940, py), 48, 48); color(sq10, coral); filled(sq10); hidden(sq10);
107
+ rect(sq11, (1020,py), 48, 48); color(sq11, indigo); filled(sq11); hidden(sq11);
108
+ rect(sq12, (1100,py), 48, 48); color(sq12, mint); filled(sq12); hidden(sq12);
109
+ rect(sq13, (1180,py), 48, 48); color(sq13, dim); filled(sq13); hidden(sq13);
110
+
111
+ polygon(tri0, (140, py-22), (114, py+22), (166, py+22)); color(tri0, fg); filled(tri0); hidden(tri0);
112
+ polygon(tri1, (220, py-22), (194, py+22), (246, py+22)); color(tri1, cyan); filled(tri1); hidden(tri1);
113
+ polygon(tri2, (300, py-22), (274, py+22), (326, py+22)); color(tri2, magenta); filled(tri2); hidden(tri2);
114
+ polygon(tri3, (380, py-22), (354, py+22), (406, py+22)); color(tri3, lime); filled(tri3); hidden(tri3);
115
+ polygon(tri4, (460, py-22), (434, py+22), (486, py+22)); color(tri4, gold); filled(tri4); hidden(tri4);
116
+ polygon(tri5, (540, py-22), (514, py+22), (566, py+22)); color(tri5, red); filled(tri5); hidden(tri5);
117
+ polygon(tri6, (620, py-22), (594, py+22), (646, py+22)); color(tri6, orange); filled(tri6); hidden(tri6);
118
+ polygon(tri7, (700, py-22), (674, py+22), (726, py+22)); color(tri7, blue); filled(tri7); hidden(tri7);
119
+ polygon(tri8, (780, py-22), (754, py+22), (806, py+22)); color(tri8, teal); filled(tri8); hidden(tri8);
120
+ polygon(tri9, (860, py-22), (834, py+22), (886, py+22)); color(tri9, violet); filled(tri9); hidden(tri9);
121
+ polygon(tri10, (940, py-22), (914, py+22), (966, py+22)); color(tri10, coral); filled(tri10); hidden(tri10);
122
+ polygon(tri11, (1020,py-22),(994, py+22),(1046,py+22)); color(tri11, indigo); filled(tri11); hidden(tri11);
123
+ polygon(tri12, (1100,py-22),(1074,py+22),(1126,py+22)); color(tri12, mint); filled(tri12); hidden(tri12);
124
+ polygon(tri13, (1180,py-22),(1154,py+22),(1206,py+22)); color(tri13, dim); filled(tri13); hidden(tri13);
125
+
126
+ // ---- CENTER: one filled disc → 4 independent colours → one colour → move ----
127
+ circle(disc, (cx, cy), 140);
128
+ filled(disc); color(disc, coral); outline(disc, cyan); stroke(disc, 4);
129
+ glow(disc, 0.6); hidden(disc);
130
+
131
+ pie(q, (cx, cy), 140, 4); // q0..q3 — same centre/radius as disc
132
+ color(q0, teal); filled(q0); outline(q0, fg); stroke(q0, 2); untraced(q0); hidden(q0);
133
+ color(q1, coral); filled(q1); outline(q1, fg); stroke(q1, 2); untraced(q1); hidden(q1);
134
+ color(q2, violet); filled(q2); outline(q2, fg); stroke(q2, 2); untraced(q2); hidden(q2);
135
+ color(q3, gold); filled(q3); outline(q3, fg); stroke(q3, 2); untraced(q3); hidden(q3);
136
+
137
+ // reunited whole — one colour, one id that can move
138
+ circle(whole, (cx, cy), 140);
139
+ filled(whole); color(whole, cyan); outline(whole, mint); stroke(whole, 4);
140
+ glow(whole, 0.8); hidden(whole);
141
+
142
+ // ---- RIGHT: boolean → TWO regions, TWO colours ----
143
+ let bx = 1000;
144
+ let by = 400;
145
+ rect(bBox, (bx - 35, by - 35), 130, 130);
146
+ outlined(bBox); outline(bBox, cyan); opacity(bBox, 0.4); hidden(bBox);
147
+ circle(bCirc, (bx + 40, by + 20), 78);
148
+ outlined(bCirc); outline(bCirc, magenta); opacity(bCirc, 0.4); hidden(bCirc);
149
+ difference(onlyBox, bBox, bCirc, teal); hidden(onlyBox); glow(onlyBox, 0.6);
150
+ difference(onlyCirc, bCirc, bBox, coral); hidden(onlyCirc); glow(onlyCirc, 0.6);
151
+ intersect(bHit, bBox, bCirc, gold); hidden(bHit); glow(bHit, 0.5);
152
+ text(labBool, (bx, by + 155), "A−B · B−A · A∩B"); size(labBool, 16); color(labBool, dim); hidden(labBool);
153
+
154
+ // ---- contact truth ----
155
+ line(crossH, (cx - 160, cy), (cx + 160, cy));
156
+ color(crossH, dim); stroke(crossH, 2.5); dashed(crossH, 12, 8); untraced(crossH); hidden(crossH);
157
+ line(crossV, (cx, cy - 120), (cx, cy + 120));
158
+ color(crossV, dim); stroke(crossV, 2.5); dashed(crossV, 12, 8); untraced(crossV); hidden(crossV);
159
+ dot(badDot, (cx, cy), 16); color(badDot, coral); glow(badDot, 0.5); hidden(badDot);
160
+ circle(goodRing, (cx, cy), 18);
161
+ outlined(goodRing); color(goodRing, mint); stroke(goodRing, 2.8); dashed(goodRing, 4, 3);
162
+ untraced(goodRing); hidden(goodRing);
163
+
164
+ // ---- traveler on the orbit ----
165
+ dot(rider, (180, 520), 9); color(rider, gold); glow(rider, 1.2); hidden(rider);
166
+
167
+ // ============================================================================
168
+ // SCRIPT — one continuous shapecraft story
169
+ // ============================================================================
170
+
171
+ step("birth") {
172
+ seq {
173
+ say(head, "SHAPECRAFT", 0.35);
174
+ say(cap, "one shape. every identity. the visual stays true.", 0.35);
175
+ show(hero, 0.05);
176
+ par {
177
+ draw(hero, 1.2, smooth);
178
+ zoom(1.15, 1.2, smooth);
179
+ }
180
+ attach(heroTag, hero, (0, -160));
181
+ show(heroTag, 0.35);
182
+ wait(0.35);
183
+ }
184
+ }
185
+
186
+ step("truth") {
187
+ seq {
188
+ say(head, "outlined — constructions stay readable", 0.3);
189
+ say(cap, "axes through the hero: the rim never hides the truth.", 0.3);
190
+ par {
191
+ show(axX, 0.05); show(axY, 0.05);
192
+ draw(axX, 0.55); draw(axY, 0.55);
193
+ cam((cx, cy), 0.8, smooth); zoom(1.35, 0.8, smooth);
194
+ }
195
+ pulse(hero);
196
+ wait(0.45);
197
+
198
+ say(head, "filled — the trap", 0.25);
199
+ say(cap, "a filled disc sits on the axes and deletes them visually.", 0.25);
200
+ show(veil, 0.45);
201
+ flash(veil, coral);
202
+ wait(0.7);
203
+
204
+ say(head, "outlined — axes return", 0.25);
205
+ say(cap, "outline(id, c) only recolors the rim. outlined drops the fill.", 0.25);
206
+ fade(veil, 0.45);
207
+ flash(hero, mint);
208
+ wait(0.55);
209
+ par {
210
+ fade(axX, 0.35); fade(axY, 0.35); fade(heroTag, 0.35); fade(hero, 0.35);
211
+ cam((cx, cy), 0.7, smooth); zoom(1.0, 0.7, smooth);
212
+ }
213
+ }
214
+ }
215
+
216
+ step("cast") {
217
+ seq {
218
+ say(head, "the cast", 0.3);
219
+ say(cap, "circle · rect · polygon · sector · arc · line · arrow", 0.3);
220
+ show(sparks, 0.25);
221
+ arrange(sparks, orbitRing, "ring", 1.0, smooth);
222
+ wait(0.2);
223
+ stagger(0.1) {
224
+ show(castC, 0.05); draw(castC, 0.55);
225
+ show(castR, 0.05); draw(castR, 0.55);
226
+ show(castP, 0.05); draw(castP, 0.55);
227
+ show(castS, 0.05); draw(castS, 0.55);
228
+ show(castA, 0.05); draw(castA, 0.55);
229
+ show(castV, 0.05); draw(castV, 0.55);
230
+ show(castL, 0.05); draw(castL, 0.55);
231
+ }
232
+ wait(0.2);
233
+ show(orbit, 0.05); draw(orbit, 1.0, smooth);
234
+ show(rider, 0.2);
235
+ travel(rider, orbit, 2.0, smooth);
236
+ wait(0.25);
237
+ par {
238
+ fade(sparks, 0.4);
239
+ fade(castC, 0.4); fade(castR, 0.4); fade(castP, 0.4); fade(castS, 0.4);
240
+ fade(castA, 0.4); fade(castV, 0.4); fade(castL, 0.4);
241
+ fade(orbit, 0.4); fade(rider, 0.4);
242
+ }
243
+ }
244
+ }
245
+
246
+ step("palette") {
247
+ seq {
248
+ say(head, "the whole palette — then change the shape", 0.3);
249
+ say(cap, "filled chips when colour is the subject. become keeps the id.", 0.3);
250
+ stagger(0.05) {
251
+ show(chip0, 0.22); show(chip1, 0.22); show(chip2, 0.22); show(chip3, 0.22);
252
+ show(chip4, 0.22); show(chip5, 0.22); show(chip6, 0.22); show(chip7, 0.22);
253
+ show(chip8, 0.22); show(chip9, 0.22); show(chip10, 0.22); show(chip11, 0.22);
254
+ show(chip12, 0.22); show(chip13, 0.22);
255
+ }
256
+ wait(0.35);
257
+ say(cap, "become → square", 0.2);
258
+ stagger(0.035) {
259
+ for i in 0..14 { become(chip{i}, sq{i}, 0.65, smooth); }
260
+ }
261
+ wait(0.25);
262
+ say(cap, "become → triangle", 0.2);
263
+ stagger(0.035) {
264
+ for i in 0..14 { become(chip{i}, tri{i}, 0.65, smooth); }
265
+ }
266
+ wait(0.45);
267
+ par {
268
+ for i in 0..14 { fade(chip{i}, 0.35); }
269
+ }
270
+ }
271
+ }
272
+
273
+ step("morph") {
274
+ seq {
275
+ say(head, "morph · become · spin", 0.3);
276
+ say(cap, "same hero id — circle winds into a square, then becomes new geometry.", 0.3);
277
+ show(hero, 0.3);
278
+ to(hero, morph, 1, 1.5, smooth); // → square (with 180° wind)
279
+ wait(0.25);
280
+ become(hero, asDiamond, 0.95, smooth);
281
+ pulse(hero);
282
+ wait(0.2);
283
+ become(hero, asPie, 0.95, smooth);
284
+ spin(hero, 40, 0.7, out);
285
+ wait(0.2);
286
+ become(hero, asTri, 0.9, smooth);
287
+ wait(0.45);
288
+ }
289
+ }
290
+
291
+ step("pieces") {
292
+ seq {
293
+ say(head, "one fill → four fills → one fill → move", 0.3);
294
+ say(cap, "a filled disc can split into independent colours, reunite, then travel as one.", 0.3);
295
+ fade(hero, 0.3);
296
+
297
+ // 1 — the coral disc (same look as the fill-trap)
298
+ par {
299
+ show(axX, 0.05); show(axY, 0.05);
300
+ draw(axX, 0.4); draw(axY, 0.4);
301
+ cam((cx, cy), 0.6, smooth); zoom(1.25, 0.6, smooth);
302
+ }
303
+ show(disc, 0.45);
304
+ flash(disc, coral);
305
+ wait(0.5);
306
+
307
+ // 2 — cut into 4 independent colours
308
+ say(cap, "cut: each quadrant keeps its own fill.", 0.25);
309
+ fade(disc, 0.3);
310
+ stagger(0.1) {
311
+ show(q0, 0.05); draw(q0, 0.45);
312
+ show(q1, 0.05); draw(q1, 0.45);
313
+ show(q2, 0.05); draw(q2, 0.45);
314
+ show(q3, 0.05); draw(q3, 0.45);
315
+ }
316
+ // explode slightly so the independence is obvious
317
+ par {
318
+ move(q0, (cx + 22, cy - 22), 0.45, overshoot);
319
+ move(q1, (cx - 22, cy - 22), 0.45, overshoot);
320
+ move(q2, (cx - 22, cy + 22), 0.45, overshoot);
321
+ move(q3, (cx + 22, cy + 22), 0.45, overshoot);
322
+ }
323
+ wait(0.45);
324
+
325
+ // 3 — reunite as ONE colour, then ONE circle
326
+ say(cap, "reunite: every slice takes one colour, then they become one disc.", 0.25);
327
+ par {
328
+ recolor(q0, cyan, 0.5);
329
+ recolor(q1, cyan, 0.5);
330
+ recolor(q2, cyan, 0.5);
331
+ recolor(q3, cyan, 0.5);
332
+ }
333
+ // snap slices back to centre
334
+ par {
335
+ move(q0, (cx, cy), 0.5, smooth);
336
+ move(q1, (cx, cy), 0.5, smooth);
337
+ move(q2, (cx, cy), 0.5, smooth);
338
+ move(q3, (cx, cy), 0.5, smooth);
339
+ }
340
+ wait(0.15);
341
+ // swap the four pieces for one solid disc (same colour)
342
+ par {
343
+ fade(q0, 0.3); fade(q1, 0.3); fade(q2, 0.3); fade(q3, 0.3);
344
+ show(whole, 0.35);
345
+ }
346
+ pulse(whole);
347
+ wait(0.4);
348
+
349
+ // 4 — move as one unit
350
+ say(cap, "now it moves as a single identity.", 0.25);
351
+ par {
352
+ fade(axX, 0.35); fade(axY, 0.35);
353
+ cam((cx + 120, cy), 0.9, smooth); zoom(1.05, 0.9, smooth);
354
+ move(whole, (cx + 260, cy), 1.1, smooth);
355
+ }
356
+ wait(0.35);
357
+
358
+ // side boolean still lands on the right as the disc arrives
359
+ say(head, "boolean keeps two colours", 0.25);
360
+ say(cap, "A−B teal · B−A coral · then A∩B gold — never one muddy fill.", 0.25);
361
+ par { show(bBox, 0.3); show(bCirc, 0.3); }
362
+ wait(0.3);
363
+ par { fade(bBox, 0.2); fade(bCirc, 0.2); }
364
+ par { show(onlyBox, 0.4); show(onlyCirc, 0.4); }
365
+ flash(onlyBox, teal); flash(onlyCirc, coral);
366
+ show(labBool, 0.25);
367
+ wait(0.4);
368
+ show(bHit, 0.45); flash(bHit, gold);
369
+ wait(0.7);
370
+
371
+ par {
372
+ fade(whole, 0.35);
373
+ fade(onlyBox, 0.35); fade(onlyCirc, 0.35); fade(bHit, 0.35); fade(labBool, 0.35);
374
+ cam((cx, cy), 0.6, smooth); zoom(1.0, 0.6, smooth);
375
+ }
376
+ }
377
+ }
378
+
379
+ step("contact") {
380
+ seq {
381
+ say(head, "contact points", 0.3);
382
+ say(cap, "a solid dot hides the crossing. a dashed ring keeps it.", 0.3);
383
+ par {
384
+ show(crossH, 0.05); show(crossV, 0.05);
385
+ draw(crossH, 0.5); draw(crossV, 0.5);
386
+ cam((cx, cy), 0.7, smooth); zoom(1.55, 0.7, smooth);
387
+ }
388
+ show(badDot, 0.3);
389
+ flash(badDot, coral);
390
+ wait(0.55);
391
+ fade(badDot, 0.25);
392
+ show(goodRing, 0.05); draw(goodRing, 0.55);
393
+ pulse(goodRing);
394
+ wait(0.7);
395
+ par {
396
+ fade(crossH, 0.35); fade(crossV, 0.35); fade(goodRing, 0.35);
397
+ cam((cx, cy), 0.7, smooth); zoom(1.0, 0.7, smooth);
398
+ }
399
+ }
400
+ }
401
+
402
+ step("settle") {
403
+ seq {
404
+ say(head, "fills for subjects. outlines for truth.", 0.35);
405
+ say(cap, "shapecraft: the visual is true — never hide what you're proving.", 0.35);
406
+ show(hero, 0.2);
407
+ become(hero, finalForm, 1.0, smooth);
408
+ pulse(hero);
409
+ wait(1.6);
410
+ }
411
+ }