@fusion.dev/helix 0.0.0-dev

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 (719) hide show
  1. package/LICENSE +21 -0
  2. package/custom-elements.json +99157 -0
  3. package/dist/accordion/index.d.ts +2 -0
  4. package/dist/accordion/index.js +2 -0
  5. package/dist/accordion/item/accordion-item.css.d.ts +1 -0
  6. package/dist/accordion/item/accordion-item.css.js +92 -0
  7. package/dist/accordion/item/accordion-item.d.ts +39 -0
  8. package/dist/accordion/item/accordion-item.js +45 -0
  9. package/dist/accordion/root/accordion-root.css.d.ts +1 -0
  10. package/dist/accordion/root/accordion-root.css.js +25 -0
  11. package/dist/accordion/root/accordion-root.d.ts +49 -0
  12. package/dist/accordion/root/accordion-root.js +40 -0
  13. package/dist/announcement/index.d.ts +1 -0
  14. package/dist/announcement/index.js +1 -0
  15. package/dist/announcement/root/announcement-root.css.d.ts +1 -0
  16. package/dist/announcement/root/announcement-root.css.js +145 -0
  17. package/dist/announcement/root/announcement-root.d.ts +26 -0
  18. package/dist/announcement/root/announcement-root.js +32 -0
  19. package/dist/app-header/index.d.ts +1 -0
  20. package/dist/app-header/index.js +1 -0
  21. package/dist/app-header/root/app-header-root.css.d.ts +1 -0
  22. package/dist/app-header/root/app-header-root.css.js +112 -0
  23. package/dist/app-header/root/app-header-root.d.ts +103 -0
  24. package/dist/app-header/root/app-header-root.js +72 -0
  25. package/dist/aura/index.d.ts +1 -0
  26. package/dist/aura/index.js +1 -0
  27. package/dist/aura/root/aura-axis.d.ts +61 -0
  28. package/dist/aura/root/aura-axis.js +68 -0
  29. package/dist/aura/root/aura-root.css.d.ts +1 -0
  30. package/dist/aura/root/aura-root.css.js +35 -0
  31. package/dist/aura/root/aura-root.d.ts +447 -0
  32. package/dist/aura/root/aura-root.js +1024 -0
  33. package/dist/aura/root/aura-shader.d.ts +46 -0
  34. package/dist/aura/root/aura-shader.js +1145 -0
  35. package/dist/avatar/group/avatar-group.css.d.ts +1 -0
  36. package/dist/avatar/group/avatar-group.css.js +48 -0
  37. package/dist/avatar/group/avatar-group.d.ts +34 -0
  38. package/dist/avatar/group/avatar-group.js +40 -0
  39. package/dist/avatar/index.d.ts +2 -0
  40. package/dist/avatar/index.js +2 -0
  41. package/dist/avatar/root/avatar-root.css.d.ts +1 -0
  42. package/dist/avatar/root/avatar-root.css.js +55 -0
  43. package/dist/avatar/root/avatar-root.d.ts +41 -0
  44. package/dist/avatar/root/avatar-root.js +46 -0
  45. package/dist/badge/index.d.ts +1 -0
  46. package/dist/badge/index.js +1 -0
  47. package/dist/badge/root/badge-root.css.d.ts +1 -0
  48. package/dist/badge/root/badge-root.css.js +91 -0
  49. package/dist/badge/root/badge-root.d.ts +38 -0
  50. package/dist/badge/root/badge-root.js +38 -0
  51. package/dist/bar-chart/index.d.ts +1 -0
  52. package/dist/bar-chart/index.js +1 -0
  53. package/dist/bar-chart/root/bar-chart-root.css.d.ts +1 -0
  54. package/dist/bar-chart/root/bar-chart-root.css.js +445 -0
  55. package/dist/bar-chart/root/bar-chart-root.d.ts +177 -0
  56. package/dist/bar-chart/root/bar-chart-root.js +122 -0
  57. package/dist/blockquote/index.d.ts +1 -0
  58. package/dist/blockquote/index.js +1 -0
  59. package/dist/blockquote/root/blockquote-root.css.d.ts +1 -0
  60. package/dist/blockquote/root/blockquote-root.css.js +42 -0
  61. package/dist/blockquote/root/blockquote-root.d.ts +27 -0
  62. package/dist/blockquote/root/blockquote-root.js +33 -0
  63. package/dist/breadcrumbs/breadcrumb/breadcrumb.css.d.ts +1 -0
  64. package/dist/breadcrumbs/breadcrumb/breadcrumb.css.js +109 -0
  65. package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +38 -0
  66. package/dist/breadcrumbs/breadcrumb/breadcrumb.js +44 -0
  67. package/dist/breadcrumbs/index.d.ts +2 -0
  68. package/dist/breadcrumbs/index.js +2 -0
  69. package/dist/breadcrumbs/root/breadcrumbs-root.css.d.ts +1 -0
  70. package/dist/breadcrumbs/root/breadcrumbs-root.css.js +23 -0
  71. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +29 -0
  72. package/dist/breadcrumbs/root/breadcrumbs-root.js +35 -0
  73. package/dist/button/index.d.ts +1 -0
  74. package/dist/button/index.js +1 -0
  75. package/dist/button/root/button-root.css.d.ts +1 -0
  76. package/dist/button/root/button-root.css.js +190 -0
  77. package/dist/button/root/button-root.d.ts +95 -0
  78. package/dist/button/root/button-root.js +59 -0
  79. package/dist/button-group/index.d.ts +1 -0
  80. package/dist/button-group/index.js +1 -0
  81. package/dist/button-group/root/button-group-root.css.d.ts +1 -0
  82. package/dist/button-group/root/button-group-root.css.js +54 -0
  83. package/dist/button-group/root/button-group-root.d.ts +48 -0
  84. package/dist/button-group/root/button-group-root.js +44 -0
  85. package/dist/callout/index.d.ts +1 -0
  86. package/dist/callout/index.js +1 -0
  87. package/dist/callout/root/callout-root.css.d.ts +1 -0
  88. package/dist/callout/root/callout-root.css.js +82 -0
  89. package/dist/callout/root/callout-root.d.ts +36 -0
  90. package/dist/callout/root/callout-root.js +42 -0
  91. package/dist/card/index.d.ts +1 -0
  92. package/dist/card/index.js +1 -0
  93. package/dist/card/root/card-root.css.d.ts +1 -0
  94. package/dist/card/root/card-root.css.js +111 -0
  95. package/dist/card/root/card-root.d.ts +120 -0
  96. package/dist/card/root/card-root.js +74 -0
  97. package/dist/carousel/index.d.ts +1 -0
  98. package/dist/carousel/index.js +1 -0
  99. package/dist/carousel/root/carousel-root.css.d.ts +1 -0
  100. package/dist/carousel/root/carousel-root.css.js +347 -0
  101. package/dist/carousel/root/carousel-root.d.ts +111 -0
  102. package/dist/carousel/root/carousel-root.js +53 -0
  103. package/dist/chat/composer/chat-composer.css.d.ts +1 -0
  104. package/dist/chat/composer/chat-composer.css.js +103 -0
  105. package/dist/chat/composer/chat-composer.d.ts +37 -0
  106. package/dist/chat/composer/chat-composer.js +43 -0
  107. package/dist/chat/index.d.ts +3 -0
  108. package/dist/chat/index.js +3 -0
  109. package/dist/chat/message/chat-message.css.d.ts +1 -0
  110. package/dist/chat/message/chat-message.css.js +270 -0
  111. package/dist/chat/message/chat-message.d.ts +66 -0
  112. package/dist/chat/message/chat-message.js +50 -0
  113. package/dist/chat/root/chat-root.css.d.ts +1 -0
  114. package/dist/chat/root/chat-root.css.js +134 -0
  115. package/dist/chat/root/chat-root.d.ts +51 -0
  116. package/dist/chat/root/chat-root.js +57 -0
  117. package/dist/checkbox/index.d.ts +1 -0
  118. package/dist/checkbox/index.js +1 -0
  119. package/dist/checkbox/root/checkbox-root.css.d.ts +1 -0
  120. package/dist/checkbox/root/checkbox-root.css.js +177 -0
  121. package/dist/checkbox/root/checkbox-root.d.ts +51 -0
  122. package/dist/checkbox/root/checkbox-root.js +48 -0
  123. package/dist/checkbox-group/index.d.ts +1 -0
  124. package/dist/checkbox-group/index.js +1 -0
  125. package/dist/checkbox-group/root/checkbox-group-root.css.d.ts +1 -0
  126. package/dist/checkbox-group/root/checkbox-group-root.css.js +30 -0
  127. package/dist/checkbox-group/root/checkbox-group-root.d.ts +29 -0
  128. package/dist/checkbox-group/root/checkbox-group-root.js +37 -0
  129. package/dist/code/index.d.ts +1 -0
  130. package/dist/code/index.js +1 -0
  131. package/dist/code/root/code-root.css.d.ts +1 -0
  132. package/dist/code/root/code-root.css.js +30 -0
  133. package/dist/code/root/code-root.d.ts +27 -0
  134. package/dist/code/root/code-root.js +33 -0
  135. package/dist/code-block/index.d.ts +1 -0
  136. package/dist/code-block/index.js +1 -0
  137. package/dist/code-block/root/code-block-root.css.d.ts +1 -0
  138. package/dist/code-block/root/code-block-root.css.js +84 -0
  139. package/dist/code-block/root/code-block-root.d.ts +31 -0
  140. package/dist/code-block/root/code-block-root.js +37 -0
  141. package/dist/color-input/index.d.ts +1 -0
  142. package/dist/color-input/index.js +1 -0
  143. package/dist/color-input/root/color-input-root.css.d.ts +1 -0
  144. package/dist/color-input/root/color-input-root.css.js +193 -0
  145. package/dist/color-input/root/color-input-root.d.ts +50 -0
  146. package/dist/color-input/root/color-input-root.js +62 -0
  147. package/dist/color-picker/index.d.ts +1 -0
  148. package/dist/color-picker/index.js +1 -0
  149. package/dist/color-picker/root/color-picker-root.css.d.ts +1 -0
  150. package/dist/color-picker/root/color-picker-root.css.js +282 -0
  151. package/dist/color-picker/root/color-picker-root.d.ts +53 -0
  152. package/dist/color-picker/root/color-picker-root.js +64 -0
  153. package/dist/combobox/index.d.ts +1 -0
  154. package/dist/combobox/index.js +1 -0
  155. package/dist/combobox/root/combobox-root.css.d.ts +1 -0
  156. package/dist/combobox/root/combobox-root.css.js +249 -0
  157. package/dist/combobox/root/combobox-root.d.ts +37 -0
  158. package/dist/combobox/root/combobox-root.js +49 -0
  159. package/dist/command/index.d.ts +1 -0
  160. package/dist/command/index.js +1 -0
  161. package/dist/command/root/command-root.css.d.ts +1 -0
  162. package/dist/command/root/command-root.css.js +76 -0
  163. package/dist/command/root/command-root.d.ts +31 -0
  164. package/dist/command/root/command-root.js +40 -0
  165. package/dist/copy-button/index.d.ts +1 -0
  166. package/dist/copy-button/index.js +1 -0
  167. package/dist/copy-button/root/copy-button-root.css.d.ts +1 -0
  168. package/dist/copy-button/root/copy-button-root.css.js +37 -0
  169. package/dist/copy-button/root/copy-button-root.d.ts +28 -0
  170. package/dist/copy-button/root/copy-button-root.js +34 -0
  171. package/dist/data-table/index.d.ts +1 -0
  172. package/dist/data-table/index.js +1 -0
  173. package/dist/data-table/root/data-table-root.css.d.ts +1 -0
  174. package/dist/data-table/root/data-table-root.css.js +91 -0
  175. package/dist/data-table/root/data-table-root.d.ts +49 -0
  176. package/dist/data-table/root/data-table-root.js +55 -0
  177. package/dist/date-input/index.d.ts +1 -0
  178. package/dist/date-input/index.js +1 -0
  179. package/dist/date-input/root/date-input-root.css.d.ts +1 -0
  180. package/dist/date-input/root/date-input-root.css.js +172 -0
  181. package/dist/date-input/root/date-input-root.d.ts +44 -0
  182. package/dist/date-input/root/date-input-root.js +59 -0
  183. package/dist/date-picker/index.d.ts +1 -0
  184. package/dist/date-picker/index.js +1 -0
  185. package/dist/date-picker/root/date-picker-root.css.d.ts +1 -0
  186. package/dist/date-picker/root/date-picker-root.css.js +219 -0
  187. package/dist/date-picker/root/date-picker-root.d.ts +38 -0
  188. package/dist/date-picker/root/date-picker-root.js +44 -0
  189. package/dist/dialog/index.d.ts +1 -0
  190. package/dist/dialog/index.js +1 -0
  191. package/dist/dialog/root/dialog-root.css.d.ts +1 -0
  192. package/dist/dialog/root/dialog-root.css.js +184 -0
  193. package/dist/dialog/root/dialog-root.d.ts +81 -0
  194. package/dist/dialog/root/dialog-root.js +54 -0
  195. package/dist/divider/index.d.ts +1 -0
  196. package/dist/divider/index.js +1 -0
  197. package/dist/divider/root/divider-root.css.d.ts +1 -0
  198. package/dist/divider/root/divider-root.css.js +82 -0
  199. package/dist/divider/root/divider-root.d.ts +34 -0
  200. package/dist/divider/root/divider-root.js +40 -0
  201. package/dist/donut-chart/index.d.ts +1 -0
  202. package/dist/donut-chart/index.js +1 -0
  203. package/dist/donut-chart/root/donut-chart-root.css.d.ts +1 -0
  204. package/dist/donut-chart/root/donut-chart-root.css.js +326 -0
  205. package/dist/donut-chart/root/donut-chart-root.d.ts +111 -0
  206. package/dist/donut-chart/root/donut-chart-root.js +76 -0
  207. package/dist/drawer/index.d.ts +1 -0
  208. package/dist/drawer/index.js +1 -0
  209. package/dist/drawer/root/drawer-root.css.d.ts +1 -0
  210. package/dist/drawer/root/drawer-root.css.js +151 -0
  211. package/dist/drawer/root/drawer-root.d.ts +69 -0
  212. package/dist/drawer/root/drawer-root.js +58 -0
  213. package/dist/drilldown/index.d.ts +2 -0
  214. package/dist/drilldown/index.js +2 -0
  215. package/dist/drilldown/item/drilldown-item.css.d.ts +1 -0
  216. package/dist/drilldown/item/drilldown-item.css.js +47 -0
  217. package/dist/drilldown/item/drilldown-item.d.ts +25 -0
  218. package/dist/drilldown/item/drilldown-item.js +31 -0
  219. package/dist/drilldown/root/drilldown-root.css.d.ts +1 -0
  220. package/dist/drilldown/root/drilldown-root.css.js +125 -0
  221. package/dist/drilldown/root/drilldown-root.d.ts +33 -0
  222. package/dist/drilldown/root/drilldown-root.js +39 -0
  223. package/dist/element-events.generated.d.ts +1 -0
  224. package/dist/element-events.generated.js +123 -0
  225. package/dist/empty/index.d.ts +1 -0
  226. package/dist/empty/index.js +1 -0
  227. package/dist/empty/root/empty-root.css.d.ts +1 -0
  228. package/dist/empty/root/empty-root.css.js +45 -0
  229. package/dist/empty/root/empty-root.d.ts +26 -0
  230. package/dist/empty/root/empty-root.js +32 -0
  231. package/dist/file-input/index.d.ts +1 -0
  232. package/dist/file-input/index.js +1 -0
  233. package/dist/file-input/root/file-input-root.css.d.ts +1 -0
  234. package/dist/file-input/root/file-input-root.css.js +194 -0
  235. package/dist/file-input/root/file-input-root.d.ts +40 -0
  236. package/dist/file-input/root/file-input-root.js +53 -0
  237. package/dist/flex/index.d.ts +1 -0
  238. package/dist/flex/index.js +1 -0
  239. package/dist/flex/root/flex-root.css.d.ts +1 -0
  240. package/dist/flex/root/flex-root.css.js +81 -0
  241. package/dist/flex/root/flex-root.d.ts +61 -0
  242. package/dist/flex/root/flex-root.js +75 -0
  243. package/dist/format-date/index.d.ts +1 -0
  244. package/dist/format-date/index.js +1 -0
  245. package/dist/format-date/root/format-date-root.css.d.ts +1 -0
  246. package/dist/format-date/root/format-date-root.css.js +15 -0
  247. package/dist/format-date/root/format-date-root.d.ts +28 -0
  248. package/dist/format-date/root/format-date-root.js +34 -0
  249. package/dist/grid/index.d.ts +1 -0
  250. package/dist/grid/index.js +1 -0
  251. package/dist/grid/root/grid-root.css.d.ts +1 -0
  252. package/dist/grid/root/grid-root.css.js +74 -0
  253. package/dist/grid/root/grid-root.d.ts +79 -0
  254. package/dist/grid/root/grid-root.js +125 -0
  255. package/dist/heatmap/index.d.ts +1 -0
  256. package/dist/heatmap/index.js +1 -0
  257. package/dist/heatmap/root/heatmap-root.css.d.ts +1 -0
  258. package/dist/heatmap/root/heatmap-root.css.js +141 -0
  259. package/dist/heatmap/root/heatmap-root.d.ts +87 -0
  260. package/dist/heatmap/root/heatmap-root.js +96 -0
  261. package/dist/icon/glyph.css.d.ts +1 -0
  262. package/dist/icon/glyph.css.js +7 -0
  263. package/dist/icon/index.d.ts +1 -0
  264. package/dist/icon/index.js +1 -0
  265. package/dist/icon/root/icon-root.css.d.ts +1 -0
  266. package/dist/icon/root/icon-root.css.js +20 -0
  267. package/dist/icon/root/icon-root.d.ts +29 -0
  268. package/dist/icon/root/icon-root.js +35 -0
  269. package/dist/icon-button/index.d.ts +1 -0
  270. package/dist/icon-button/index.js +1 -0
  271. package/dist/icon-button/root/icon-button-root.css.d.ts +1 -0
  272. package/dist/icon-button/root/icon-button-root.css.js +165 -0
  273. package/dist/icon-button/root/icon-button-root.d.ts +65 -0
  274. package/dist/icon-button/root/icon-button-root.js +63 -0
  275. package/dist/image/index.d.ts +1 -0
  276. package/dist/image/index.js +1 -0
  277. package/dist/image/root/image-root.css.d.ts +1 -0
  278. package/dist/image/root/image-root.css.js +73 -0
  279. package/dist/image/root/image-root.d.ts +39 -0
  280. package/dist/image/root/image-root.js +52 -0
  281. package/dist/index.d.ts +100 -0
  282. package/dist/index.js +100 -0
  283. package/dist/input/index.d.ts +1 -0
  284. package/dist/input/index.js +1 -0
  285. package/dist/input/root/input-root.css.d.ts +1 -0
  286. package/dist/input/root/input-root.css.js +123 -0
  287. package/dist/input/root/input-root.d.ts +36 -0
  288. package/dist/input/root/input-root.js +48 -0
  289. package/dist/kbd/index.d.ts +1 -0
  290. package/dist/kbd/index.js +1 -0
  291. package/dist/kbd/root/kbd-root.css.d.ts +1 -0
  292. package/dist/kbd/root/kbd-root.css.js +47 -0
  293. package/dist/kbd/root/kbd-root.d.ts +30 -0
  294. package/dist/kbd/root/kbd-root.js +36 -0
  295. package/dist/legend/index.d.ts +1 -0
  296. package/dist/legend/index.js +1 -0
  297. package/dist/legend/root/legend-root.css.d.ts +1 -0
  298. package/dist/legend/root/legend-root.css.js +90 -0
  299. package/dist/legend/root/legend-root.d.ts +128 -0
  300. package/dist/legend/root/legend-root.js +99 -0
  301. package/dist/line-chart/index.d.ts +1 -0
  302. package/dist/line-chart/index.js +1 -0
  303. package/dist/line-chart/root/line-chart-root.css.d.ts +1 -0
  304. package/dist/line-chart/root/line-chart-root.css.js +293 -0
  305. package/dist/line-chart/root/line-chart-root.d.ts +106 -0
  306. package/dist/line-chart/root/line-chart-root.js +74 -0
  307. package/dist/list/index.d.ts +2 -0
  308. package/dist/list/index.js +2 -0
  309. package/dist/list/item/list-item.css.d.ts +1 -0
  310. package/dist/list/item/list-item.css.js +70 -0
  311. package/dist/list/item/list-item.d.ts +49 -0
  312. package/dist/list/item/list-item.js +58 -0
  313. package/dist/list/root/list-root.css.d.ts +1 -0
  314. package/dist/list/root/list-root.css.js +76 -0
  315. package/dist/list/root/list-root.d.ts +54 -0
  316. package/dist/list/root/list-root.js +50 -0
  317. package/dist/listbox/index.d.ts +1 -0
  318. package/dist/listbox/index.js +1 -0
  319. package/dist/listbox/root/listbox-root.css.d.ts +1 -0
  320. package/dist/listbox/root/listbox-root.css.js +110 -0
  321. package/dist/listbox/root/listbox-root.d.ts +30 -0
  322. package/dist/listbox/root/listbox-root.js +38 -0
  323. package/dist/loader/index.d.ts +1 -0
  324. package/dist/loader/index.js +1 -0
  325. package/dist/loader/root/loader-root.css.d.ts +1 -0
  326. package/dist/loader/root/loader-root.css.js +159 -0
  327. package/dist/loader/root/loader-root.d.ts +49 -0
  328. package/dist/loader/root/loader-root.js +42 -0
  329. package/dist/megamenu/index.d.ts +1 -0
  330. package/dist/megamenu/index.js +1 -0
  331. package/dist/megamenu/root/megamenu-root.css.d.ts +1 -0
  332. package/dist/megamenu/root/megamenu-root.css.js +153 -0
  333. package/dist/megamenu/root/megamenu-root.d.ts +34 -0
  334. package/dist/megamenu/root/megamenu-root.js +40 -0
  335. package/dist/menu/index.d.ts +2 -0
  336. package/dist/menu/index.js +2 -0
  337. package/dist/menu/item/menu-item.css.d.ts +1 -0
  338. package/dist/menu/item/menu-item.css.js +87 -0
  339. package/dist/menu/item/menu-item.d.ts +26 -0
  340. package/dist/menu/item/menu-item.js +32 -0
  341. package/dist/menu/root/menu-root.css.d.ts +1 -0
  342. package/dist/menu/root/menu-root.css.js +161 -0
  343. package/dist/menu/root/menu-root.d.ts +36 -0
  344. package/dist/menu/root/menu-root.js +42 -0
  345. package/dist/meter/index.d.ts +1 -0
  346. package/dist/meter/index.js +1 -0
  347. package/dist/meter/root/meter-root.css.d.ts +1 -0
  348. package/dist/meter/root/meter-root.css.js +218 -0
  349. package/dist/meter/root/meter-root.d.ts +79 -0
  350. package/dist/meter/root/meter-root.js +72 -0
  351. package/dist/mixins/mixin-control-surface/mixin-control-surface.d.ts +28 -0
  352. package/dist/mixins/mixin-control-surface/mixin-control-surface.js +21 -0
  353. package/dist/navigation/index.d.ts +1 -0
  354. package/dist/navigation/index.js +1 -0
  355. package/dist/navigation/root/navigation-root.css.d.ts +1 -0
  356. package/dist/navigation/root/navigation-root.css.js +50 -0
  357. package/dist/navigation/root/navigation-root.d.ts +28 -0
  358. package/dist/navigation/root/navigation-root.js +34 -0
  359. package/dist/notifications/index.d.ts +2 -0
  360. package/dist/notifications/index.js +2 -0
  361. package/dist/notifications/notification/notification.css.d.ts +1 -0
  362. package/dist/notifications/notification/notification.css.js +194 -0
  363. package/dist/notifications/notification/notification.d.ts +64 -0
  364. package/dist/notifications/notification/notification.js +71 -0
  365. package/dist/notifications/root/notifications-root.css.d.ts +1 -0
  366. package/dist/notifications/root/notifications-root.css.js +94 -0
  367. package/dist/notifications/root/notifications-root.d.ts +43 -0
  368. package/dist/notifications/root/notifications-root.js +49 -0
  369. package/dist/number-input/index.d.ts +1 -0
  370. package/dist/number-input/index.js +1 -0
  371. package/dist/number-input/root/number-input-root.css.d.ts +1 -0
  372. package/dist/number-input/root/number-input-root.css.js +149 -0
  373. package/dist/number-input/root/number-input-root.d.ts +41 -0
  374. package/dist/number-input/root/number-input-root.js +49 -0
  375. package/dist/option/group/option-group.css.d.ts +1 -0
  376. package/dist/option/group/option-group.css.js +24 -0
  377. package/dist/option/group/option-group.d.ts +23 -0
  378. package/dist/option/group/option-group.js +29 -0
  379. package/dist/option/index.d.ts +2 -0
  380. package/dist/option/index.js +2 -0
  381. package/dist/option/root/option-root.css.d.ts +1 -0
  382. package/dist/option/root/option-root.css.js +93 -0
  383. package/dist/option/root/option-root.d.ts +30 -0
  384. package/dist/option/root/option-root.js +36 -0
  385. package/dist/outline/index.d.ts +1 -0
  386. package/dist/outline/index.js +1 -0
  387. package/dist/outline/root/outline-root.css.d.ts +1 -0
  388. package/dist/outline/root/outline-root.css.js +144 -0
  389. package/dist/outline/root/outline-root.d.ts +31 -0
  390. package/dist/outline/root/outline-root.js +37 -0
  391. package/dist/pagination/index.d.ts +3 -0
  392. package/dist/pagination/index.js +3 -0
  393. package/dist/pagination/root/pagination-root.css.d.ts +1 -0
  394. package/dist/pagination/root/pagination-root.css.js +158 -0
  395. package/dist/pagination/root/pagination-root.d.ts +59 -0
  396. package/dist/pagination/root/pagination-root.js +65 -0
  397. package/dist/pagination/size/pagination-size.css.d.ts +1 -0
  398. package/dist/pagination/size/pagination-size.css.js +24 -0
  399. package/dist/pagination/size/pagination-size.d.ts +31 -0
  400. package/dist/pagination/size/pagination-size.js +44 -0
  401. package/dist/pagination/summary/pagination-summary.css.d.ts +1 -0
  402. package/dist/pagination/summary/pagination-summary.css.js +9 -0
  403. package/dist/pagination/summary/pagination-summary.d.ts +23 -0
  404. package/dist/pagination/summary/pagination-summary.js +29 -0
  405. package/dist/pin-input/index.d.ts +1 -0
  406. package/dist/pin-input/index.js +1 -0
  407. package/dist/pin-input/root/pin-input-root.css.d.ts +1 -0
  408. package/dist/pin-input/root/pin-input-root.css.js +74 -0
  409. package/dist/pin-input/root/pin-input-root.d.ts +37 -0
  410. package/dist/pin-input/root/pin-input-root.js +45 -0
  411. package/dist/popover/index.d.ts +1 -0
  412. package/dist/popover/index.js +1 -0
  413. package/dist/popover/root/popover-root.css.d.ts +1 -0
  414. package/dist/popover/root/popover-root.css.js +93 -0
  415. package/dist/popover/root/popover-root.d.ts +53 -0
  416. package/dist/popover/root/popover-root.js +50 -0
  417. package/dist/progress/index.d.ts +1 -0
  418. package/dist/progress/index.js +1 -0
  419. package/dist/progress/root/progress-root.css.d.ts +1 -0
  420. package/dist/progress/root/progress-root.css.js +225 -0
  421. package/dist/progress/root/progress-root.d.ts +54 -0
  422. package/dist/progress/root/progress-root.js +45 -0
  423. package/dist/qr-code/index.d.ts +1 -0
  424. package/dist/qr-code/index.js +1 -0
  425. package/dist/qr-code/root/qr-code-root.css.d.ts +1 -0
  426. package/dist/qr-code/root/qr-code-root.css.js +58 -0
  427. package/dist/qr-code/root/qr-code-root.d.ts +37 -0
  428. package/dist/qr-code/root/qr-code-root.js +43 -0
  429. package/dist/quote/index.d.ts +1 -0
  430. package/dist/quote/index.js +1 -0
  431. package/dist/quote/root/quote-root.css.d.ts +1 -0
  432. package/dist/quote/root/quote-root.css.js +20 -0
  433. package/dist/quote/root/quote-root.d.ts +25 -0
  434. package/dist/quote/root/quote-root.js +31 -0
  435. package/dist/radio/group/radio-group.css.d.ts +1 -0
  436. package/dist/radio/group/radio-group.css.js +23 -0
  437. package/dist/radio/group/radio-group.d.ts +26 -0
  438. package/dist/radio/group/radio-group.js +34 -0
  439. package/dist/radio/index.d.ts +2 -0
  440. package/dist/radio/index.js +2 -0
  441. package/dist/radio/root/radio-root.css.d.ts +1 -0
  442. package/dist/radio/root/radio-root.css.js +198 -0
  443. package/dist/radio/root/radio-root.d.ts +73 -0
  444. package/dist/radio/root/radio-root.js +74 -0
  445. package/dist/rating/index.d.ts +1 -0
  446. package/dist/rating/index.js +1 -0
  447. package/dist/rating/root/rating-root.css.d.ts +1 -0
  448. package/dist/rating/root/rating-root.css.js +122 -0
  449. package/dist/rating/root/rating-root.d.ts +52 -0
  450. package/dist/rating/root/rating-root.js +42 -0
  451. package/dist/sandbox/index.d.ts +20 -0
  452. package/dist/sandbox/index.js +20 -0
  453. package/dist/sandbox/preview/sandbox-preview.css.d.ts +1 -0
  454. package/dist/sandbox/preview/sandbox-preview.css.js +14 -0
  455. package/dist/sandbox/preview/sandbox-preview.d.ts +224 -0
  456. package/dist/sandbox/preview/sandbox-preview.js +306 -0
  457. package/dist/sandbox/root/sandbox-root.css.d.ts +1 -0
  458. package/dist/sandbox/root/sandbox-root.css.js +73 -0
  459. package/dist/sandbox/root/sandbox-root.d.ts +324 -0
  460. package/dist/sandbox/root/sandbox-root.js +569 -0
  461. package/dist/sandbox/source/sandbox-source.css.d.ts +1 -0
  462. package/dist/sandbox/source/sandbox-source.css.js +27 -0
  463. package/dist/sandbox/source/sandbox-source.d.ts +105 -0
  464. package/dist/sandbox/source/sandbox-source.js +173 -0
  465. package/dist/sandbox/status-bar/sandbox-status-bar.css.d.ts +1 -0
  466. package/dist/sandbox/status-bar/sandbox-status-bar.css.js +23 -0
  467. package/dist/sandbox/status-bar/sandbox-status-bar.d.ts +59 -0
  468. package/dist/sandbox/status-bar/sandbox-status-bar.js +86 -0
  469. package/dist/sandbox/terminal/sandbox-terminal.css.d.ts +1 -0
  470. package/dist/sandbox/terminal/sandbox-terminal.css.js +69 -0
  471. package/dist/sandbox/terminal/sandbox-terminal.d.ts +71 -0
  472. package/dist/sandbox/terminal/sandbox-terminal.js +130 -0
  473. package/dist/sandbox/toolbar/sandbox-toolbar.css.d.ts +1 -0
  474. package/dist/sandbox/toolbar/sandbox-toolbar.css.js +32 -0
  475. package/dist/sandbox/toolbar/sandbox-toolbar.d.ts +37 -0
  476. package/dist/sandbox/toolbar/sandbox-toolbar.js +49 -0
  477. package/dist/scroll-area/index.d.ts +1 -0
  478. package/dist/scroll-area/index.js +1 -0
  479. package/dist/scroll-area/root/scroll-area-root.css.d.ts +1 -0
  480. package/dist/scroll-area/root/scroll-area-root.css.js +118 -0
  481. package/dist/scroll-area/root/scroll-area-root.d.ts +34 -0
  482. package/dist/scroll-area/root/scroll-area-root.js +40 -0
  483. package/dist/select/index.d.ts +1 -0
  484. package/dist/select/index.js +1 -0
  485. package/dist/select/root/select-root.css.d.ts +1 -0
  486. package/dist/select/root/select-root.css.js +197 -0
  487. package/dist/select/root/select-root.d.ts +71 -0
  488. package/dist/select/root/select-root.js +60 -0
  489. package/dist/shared/chart/series.css.d.ts +1 -0
  490. package/dist/shared/chart/series.css.js +35 -0
  491. package/dist/shared/chart/terminus.css.d.ts +1 -0
  492. package/dist/shared/chart/terminus.css.js +41 -0
  493. package/dist/shared/field/field-inline.css.d.ts +1 -0
  494. package/dist/shared/field/field-inline.css.js +7 -0
  495. package/dist/shared/field/field-stacked.css.d.ts +1 -0
  496. package/dist/shared/field/field-stacked.css.js +7 -0
  497. package/dist/shared/field/field.css.d.ts +1 -0
  498. package/dist/shared/field/field.css.js +59 -0
  499. package/dist/skeleton/index.d.ts +1 -0
  500. package/dist/skeleton/index.js +1 -0
  501. package/dist/skeleton/root/skeleton-root.css.d.ts +1 -0
  502. package/dist/skeleton/root/skeleton-root.css.js +74 -0
  503. package/dist/skeleton/root/skeleton-root.d.ts +34 -0
  504. package/dist/skeleton/root/skeleton-root.js +38 -0
  505. package/dist/slider/index.d.ts +1 -0
  506. package/dist/slider/index.js +1 -0
  507. package/dist/slider/root/slider-root.css.d.ts +1 -0
  508. package/dist/slider/root/slider-root.css.js +335 -0
  509. package/dist/slider/root/slider-root.d.ts +42 -0
  510. package/dist/slider/root/slider-root.js +50 -0
  511. package/dist/sparkline/index.d.ts +1 -0
  512. package/dist/sparkline/index.js +1 -0
  513. package/dist/sparkline/root/sparkline-root.css.d.ts +1 -0
  514. package/dist/sparkline/root/sparkline-root.css.js +103 -0
  515. package/dist/sparkline/root/sparkline-root.d.ts +114 -0
  516. package/dist/sparkline/root/sparkline-root.js +67 -0
  517. package/dist/speed-dial/index.d.ts +2 -0
  518. package/dist/speed-dial/index.js +2 -0
  519. package/dist/speed-dial/item/speed-dial-item.css.d.ts +1 -0
  520. package/dist/speed-dial/item/speed-dial-item.css.js +80 -0
  521. package/dist/speed-dial/item/speed-dial-item.d.ts +26 -0
  522. package/dist/speed-dial/item/speed-dial-item.js +32 -0
  523. package/dist/speed-dial/root/speed-dial-root.css.d.ts +1 -0
  524. package/dist/speed-dial/root/speed-dial-root.css.js +140 -0
  525. package/dist/speed-dial/root/speed-dial-root.d.ts +27 -0
  526. package/dist/speed-dial/root/speed-dial-root.js +34 -0
  527. package/dist/splitter/index.d.ts +1 -0
  528. package/dist/splitter/index.js +1 -0
  529. package/dist/splitter/root/splitter-root.css.d.ts +1 -0
  530. package/dist/splitter/root/splitter-root.css.js +203 -0
  531. package/dist/splitter/root/splitter-root.d.ts +78 -0
  532. package/dist/splitter/root/splitter-root.js +70 -0
  533. package/dist/stat/group/stat-group.css.d.ts +1 -0
  534. package/dist/stat/group/stat-group.css.js +12 -0
  535. package/dist/stat/group/stat-group.d.ts +30 -0
  536. package/dist/stat/group/stat-group.js +43 -0
  537. package/dist/stat/index.d.ts +2 -0
  538. package/dist/stat/index.js +2 -0
  539. package/dist/stat/root/stat-root.css.d.ts +1 -0
  540. package/dist/stat/root/stat-root.css.js +60 -0
  541. package/dist/stat/root/stat-root.d.ts +27 -0
  542. package/dist/stat/root/stat-root.js +33 -0
  543. package/dist/steps/index.d.ts +2 -0
  544. package/dist/steps/index.js +2 -0
  545. package/dist/steps/root/steps-root.css.d.ts +1 -0
  546. package/dist/steps/root/steps-root.css.js +94 -0
  547. package/dist/steps/root/steps-root.d.ts +36 -0
  548. package/dist/steps/root/steps-root.js +42 -0
  549. package/dist/steps/step/step.css.d.ts +1 -0
  550. package/dist/steps/step/step.css.js +158 -0
  551. package/dist/steps/step/step.d.ts +20 -0
  552. package/dist/steps/step/step.js +30 -0
  553. package/dist/switch/index.d.ts +1 -0
  554. package/dist/switch/index.js +1 -0
  555. package/dist/switch/root/switch-root.css.d.ts +1 -0
  556. package/dist/switch/root/switch-root.css.js +113 -0
  557. package/dist/switch/root/switch-root.d.ts +42 -0
  558. package/dist/switch/root/switch-root.js +50 -0
  559. package/dist/table/cell/table-cell.css.d.ts +1 -0
  560. package/dist/table/cell/table-cell.css.js +25 -0
  561. package/dist/table/cell/table-cell.d.ts +24 -0
  562. package/dist/table/cell/table-cell.js +30 -0
  563. package/dist/table/column/table-column.css.d.ts +1 -0
  564. package/dist/table/column/table-column.css.js +21 -0
  565. package/dist/table/column/table-column.d.ts +23 -0
  566. package/dist/table/column/table-column.js +29 -0
  567. package/dist/table/index.d.ts +4 -0
  568. package/dist/table/index.js +4 -0
  569. package/dist/table/root/table-root.css.d.ts +1 -0
  570. package/dist/table/root/table-root.css.js +39 -0
  571. package/dist/table/root/table-root.d.ts +29 -0
  572. package/dist/table/root/table-root.js +35 -0
  573. package/dist/table/row/table-row.css.d.ts +1 -0
  574. package/dist/table/row/table-row.css.js +5 -0
  575. package/dist/table/row/table-row.d.ts +24 -0
  576. package/dist/table/row/table-row.js +30 -0
  577. package/dist/tabs/index.d.ts +3 -0
  578. package/dist/tabs/index.js +3 -0
  579. package/dist/tabs/panel/tab-panel.css.d.ts +1 -0
  580. package/dist/tabs/panel/tab-panel.css.js +17 -0
  581. package/dist/tabs/panel/tab-panel.d.ts +26 -0
  582. package/dist/tabs/panel/tab-panel.js +32 -0
  583. package/dist/tabs/root/tabs-root.css.d.ts +1 -0
  584. package/dist/tabs/root/tabs-root.css.js +136 -0
  585. package/dist/tabs/root/tabs-root.d.ts +29 -0
  586. package/dist/tabs/root/tabs-root.js +35 -0
  587. package/dist/tabs/tab/tab.css.d.ts +1 -0
  588. package/dist/tabs/tab/tab.css.js +57 -0
  589. package/dist/tabs/tab/tab.d.ts +26 -0
  590. package/dist/tabs/tab/tab.js +32 -0
  591. package/dist/tag/index.d.ts +1 -0
  592. package/dist/tag/index.js +1 -0
  593. package/dist/tag/root/tag-root.css.d.ts +1 -0
  594. package/dist/tag/root/tag-root.css.js +112 -0
  595. package/dist/tag/root/tag-root.d.ts +66 -0
  596. package/dist/tag/root/tag-root.js +48 -0
  597. package/dist/text/index.d.ts +1 -0
  598. package/dist/text/index.js +1 -0
  599. package/dist/text/root/text-root.css.d.ts +1 -0
  600. package/dist/text/root/text-root.css.js +113 -0
  601. package/dist/text/root/text-root.d.ts +83 -0
  602. package/dist/text/root/text-root.js +92 -0
  603. package/dist/textarea/index.d.ts +1 -0
  604. package/dist/textarea/index.js +1 -0
  605. package/dist/textarea/root/textarea-root.css.d.ts +1 -0
  606. package/dist/textarea/root/textarea-root.css.js +79 -0
  607. package/dist/textarea/root/textarea-root.d.ts +27 -0
  608. package/dist/textarea/root/textarea-root.js +35 -0
  609. package/dist/time-input/index.d.ts +1 -0
  610. package/dist/time-input/index.js +1 -0
  611. package/dist/time-input/root/time-input-root.css.d.ts +1 -0
  612. package/dist/time-input/root/time-input-root.css.js +184 -0
  613. package/dist/time-input/root/time-input-root.d.ts +42 -0
  614. package/dist/time-input/root/time-input-root.js +53 -0
  615. package/dist/time-picker/index.d.ts +1 -0
  616. package/dist/time-picker/index.js +1 -0
  617. package/dist/time-picker/root/time-picker-root.css.d.ts +1 -0
  618. package/dist/time-picker/root/time-picker-root.css.js +147 -0
  619. package/dist/time-picker/root/time-picker-root.d.ts +38 -0
  620. package/dist/time-picker/root/time-picker-root.js +48 -0
  621. package/dist/timeline/index.d.ts +2 -0
  622. package/dist/timeline/index.js +2 -0
  623. package/dist/timeline/item/timeline-item.css.d.ts +1 -0
  624. package/dist/timeline/item/timeline-item.css.js +111 -0
  625. package/dist/timeline/item/timeline-item.d.ts +27 -0
  626. package/dist/timeline/item/timeline-item.js +33 -0
  627. package/dist/timeline/root/timeline-root.css.d.ts +1 -0
  628. package/dist/timeline/root/timeline-root.css.js +12 -0
  629. package/dist/timeline/root/timeline-root.d.ts +25 -0
  630. package/dist/timeline/root/timeline-root.js +31 -0
  631. package/dist/toast/index.d.ts +2 -0
  632. package/dist/toast/index.js +2 -0
  633. package/dist/toast/item/toast-item.css.d.ts +1 -0
  634. package/dist/toast/item/toast-item.css.js +233 -0
  635. package/dist/toast/item/toast-item.d.ts +31 -0
  636. package/dist/toast/item/toast-item.js +37 -0
  637. package/dist/toast/root/toast-root.css.d.ts +1 -0
  638. package/dist/toast/root/toast-root.css.js +66 -0
  639. package/dist/toast/root/toast-root.d.ts +37 -0
  640. package/dist/toast/root/toast-root.js +43 -0
  641. package/dist/toggle/group/toggle-group.css.d.ts +1 -0
  642. package/dist/toggle/group/toggle-group.css.js +118 -0
  643. package/dist/toggle/group/toggle-group.d.ts +49 -0
  644. package/dist/toggle/group/toggle-group.js +47 -0
  645. package/dist/toggle/index.d.ts +2 -0
  646. package/dist/toggle/index.js +2 -0
  647. package/dist/toggle/root/toggle-root.css.d.ts +1 -0
  648. package/dist/toggle/root/toggle-root.css.js +25 -0
  649. package/dist/toggle/root/toggle-root.d.ts +28 -0
  650. package/dist/toggle/root/toggle-root.js +34 -0
  651. package/dist/toolbar/index.d.ts +1 -0
  652. package/dist/toolbar/index.js +1 -0
  653. package/dist/toolbar/root/toolbar-root.css.d.ts +1 -0
  654. package/dist/toolbar/root/toolbar-root.css.js +28 -0
  655. package/dist/toolbar/root/toolbar-root.d.ts +29 -0
  656. package/dist/toolbar/root/toolbar-root.js +35 -0
  657. package/dist/tooltip/index.d.ts +1 -0
  658. package/dist/tooltip/index.js +1 -0
  659. package/dist/tooltip/root/tooltip-root.css.d.ts +1 -0
  660. package/dist/tooltip/root/tooltip-root.css.js +121 -0
  661. package/dist/tooltip/root/tooltip-root.d.ts +63 -0
  662. package/dist/tooltip/root/tooltip-root.js +42 -0
  663. package/dist/tour/index.d.ts +2 -0
  664. package/dist/tour/index.js +2 -0
  665. package/dist/tour/root/tour-root.css.d.ts +1 -0
  666. package/dist/tour/root/tour-root.css.js +30 -0
  667. package/dist/tour/root/tour-root.d.ts +24 -0
  668. package/dist/tour/root/tour-root.js +30 -0
  669. package/dist/tour/stop/tour-stop.css.d.ts +1 -0
  670. package/dist/tour/stop/tour-stop.css.js +77 -0
  671. package/dist/tour/stop/tour-stop.d.ts +34 -0
  672. package/dist/tour/stop/tour-stop.js +40 -0
  673. package/dist/tree/index.d.ts +2 -0
  674. package/dist/tree/index.js +2 -0
  675. package/dist/tree/item/tree-item.css.d.ts +1 -0
  676. package/dist/tree/item/tree-item.css.js +177 -0
  677. package/dist/tree/item/tree-item.d.ts +44 -0
  678. package/dist/tree/item/tree-item.js +50 -0
  679. package/dist/tree/root/tree-root.css.d.ts +1 -0
  680. package/dist/tree/root/tree-root.css.js +43 -0
  681. package/dist/tree/root/tree-root.d.ts +63 -0
  682. package/dist/tree/root/tree-root.js +47 -0
  683. package/dist/trend/index.d.ts +1 -0
  684. package/dist/trend/index.js +1 -0
  685. package/dist/trend/root/trend-root.css.d.ts +1 -0
  686. package/dist/trend/root/trend-root.css.js +50 -0
  687. package/dist/trend/root/trend-root.d.ts +48 -0
  688. package/dist/trend/root/trend-root.js +55 -0
  689. package/dist/video/index.d.ts +1 -0
  690. package/dist/video/index.js +1 -0
  691. package/dist/video/root/video-root.css.d.ts +1 -0
  692. package/dist/video/root/video-root.css.js +404 -0
  693. package/dist/video/root/video-root.d.ts +87 -0
  694. package/dist/video/root/video-root.js +61 -0
  695. package/dist/video-playlist/index.d.ts +3 -0
  696. package/dist/video-playlist/index.js +3 -0
  697. package/dist/video-playlist/item/video-playlist-item.css.d.ts +1 -0
  698. package/dist/video-playlist/item/video-playlist-item.css.js +95 -0
  699. package/dist/video-playlist/item/video-playlist-item.d.ts +25 -0
  700. package/dist/video-playlist/item/video-playlist-item.js +31 -0
  701. package/dist/video-playlist/menu/video-playlist-menu.css.d.ts +1 -0
  702. package/dist/video-playlist/menu/video-playlist-menu.css.js +44 -0
  703. package/dist/video-playlist/menu/video-playlist-menu.d.ts +43 -0
  704. package/dist/video-playlist/menu/video-playlist-menu.js +56 -0
  705. package/dist/video-playlist/root/video-playlist-root.css.d.ts +1 -0
  706. package/dist/video-playlist/root/video-playlist-root.css.js +21 -0
  707. package/dist/video-playlist/root/video-playlist-root.d.ts +26 -0
  708. package/dist/video-playlist/root/video-playlist-root.js +32 -0
  709. package/dist/virtual-list/index.d.ts +1 -0
  710. package/dist/virtual-list/index.js +1 -0
  711. package/dist/virtual-list/root/virtual-list-root.css.d.ts +1 -0
  712. package/dist/virtual-list/root/virtual-list-root.css.js +27 -0
  713. package/dist/virtual-list/root/virtual-list-root.d.ts +31 -0
  714. package/dist/virtual-list/root/virtual-list-root.js +37 -0
  715. package/elements.css +287 -0
  716. package/jsx.d.ts +54748 -0
  717. package/package.json +80 -0
  718. package/svelte.d.ts +139 -0
  719. package/vue.d.ts +11511 -0
@@ -0,0 +1,1145 @@
1
+ /**
2
+ * The shapes, in the order the shader branches on them.
3
+ *
4
+ * Exported so the component can turn a property into the integer the uniform
5
+ * takes without a second list to keep in step.
6
+ */
7
+ export const SHAPES = [
8
+ 'braid',
9
+ 'rays',
10
+ 'aurora',
11
+ 'streaks',
12
+ 'waves',
13
+ 'threads',
14
+ 'particles',
15
+ 'flow',
16
+ 'caustics',
17
+ 'lattice',
18
+ 'fracture',
19
+ ];
20
+ /**
21
+ * What the pointer does, in the order the shader branches on them.
22
+ *
23
+ * `native` is the shape's own, and is what absence means: braid leans, rays are
24
+ * occluded, threads pinch. The rest are generic, and deliberately few.
25
+ *
26
+ * **The generics are the thing this component spent a day removing**, so they
27
+ * are opt-in and never a default. A response made of the same material as the
28
+ * shape says something about that shape; a lamp that follows the cursor says
29
+ * the same nothing on all nine. They are here because a consumer may want the
30
+ * quieter, more conventional answer, not because it is the better one.
31
+ */
32
+ export const INTERACTIONS = ['native', 'light', 'shadow', 'ripple', 'none'];
33
+ /**
34
+ * Three vertices from `gl_VertexID`, covering the screen with one triangle.
35
+ *
36
+ * No attribute, no buffer and no upload, and one triangle rather than two, so
37
+ * there is no seam down the diagonal where a quad's halves meet.
38
+ */
39
+ export const VERTEX = `#version 300 es
40
+ out vec2 uv;
41
+ void main() {
42
+ vec2 p = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2);
43
+ uv = p;
44
+ gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);
45
+ }
46
+ `;
47
+ /**
48
+ * One program, branching on a uniform, for all five shapes.
49
+ *
50
+ * A branch on a uniform is uniform across the whole draw, so every lane takes
51
+ * the same path and it costs a jump rather than divergence. Five programs would
52
+ * mean compiling and linking on a property change, which is the one moment a
53
+ * reader is watching.
54
+ *
55
+ * **No backticks anywhere inside this string, including in comments.** One ends
56
+ * the template literal early, and what follows is parsed as JavaScript: it has
57
+ * silently stripped every brace out of a shader and left the driver reporting a
58
+ * syntax error two hundred lines from the cause. `bun run check:shaders` fails
59
+ * the build on it.
60
+ */
61
+ export const FRAGMENT = `#version 300 es
62
+ precision highp float;
63
+
64
+ in vec2 uv;
65
+ out vec4 color;
66
+
67
+ uniform vec2 uResolution;
68
+ uniform float uTime;
69
+ uniform int uShape;
70
+ uniform vec2 uPointer;
71
+ uniform float uReach;
72
+ uniform int uInteraction;
73
+ uniform float uTilt;
74
+ uniform float uScale;
75
+ uniform float uBloom;
76
+ uniform float uGain;
77
+
78
+ /* How much the members of a population differ from one another, 1 being the
79
+ resting amount and 0 a set that is uniform. Read by the shapes made of many
80
+ similar things, whether those are counted or continuous: streaks has lanes,
81
+ particles has motes, rays has a fan, and aurora has bundles and folds. Braid, waves and flow have a single subject and nothing to vary.
82
+ Threads is the deliberate exception, being even on purpose: a pass had
83
+ already given its strands their own hashes and produced a scatter rather
84
+ than a set. */
85
+ uniform float uVariance;
86
+ /* Where the pointer has been, as x, y and age. Age runs 0 at the moment it
87
+ was left to 1 when it has faded, so a spent slot costs a compare.
88
+
89
+ **This is what a fluid gets from a framebuffer, bought for eight vec3s.** A
90
+ real solver advects a dye texture and reads it back the next frame, which
91
+ needs render targets, a ping-pong pair and about six passes. What a reader
92
+ actually perceives from that is one thing: the cursor leaves a wake that
93
+ outlives it. A short history of where it went reproduces that in the single
94
+ pass this component already makes, at a fixed cost that does not grow with
95
+ how long the page has been open. What it cannot do is conserve anything, so
96
+ there is no diffusion and no pressure: the wake decays rather than
97
+ spreading. Worth knowing before this is asked to be a simulation. */
98
+ uniform vec3 uTrail[9];
99
+ uniform vec3 uGround;
100
+ uniform vec3 uHaze;
101
+ uniform vec3 uGlow;
102
+ uniform vec3 uPeak;
103
+
104
+ float hash(vec2 p) {
105
+ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
106
+ }
107
+
108
+ float noise(vec2 p) {
109
+ vec2 i = floor(p);
110
+ vec2 f = fract(p);
111
+ /* Quintic rather than cubic. Cubic smoothstep leaves a second derivative
112
+ discontinuity at every cell edge, which four octaves of lighting turn
113
+ into a faint square lattice: visible on a large soft field and exactly
114
+ the artifact that reads as cheap. */
115
+ vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);
116
+ return mix(
117
+ mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),
118
+ mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x),
119
+ u.y
120
+ );
121
+ }
122
+
123
+ /* Each octave is rotated as well as scaled. Doubling alone stacks every
124
+ octave on the same axes, so value noise keeps its grid however many are
125
+ summed. An irrational angle means no two octaves ever line up again. */
126
+ const mat2 TURN = mat2(0.8, 0.6, -0.6, 0.8);
127
+
128
+ float fbm(vec2 p) {
129
+ float sum = 0.0;
130
+ float amp = 0.5;
131
+ for (int i = 0; i < 5; i++) {
132
+ sum += amp * noise(p);
133
+ p = TURN * p * 2.03;
134
+ amp *= 0.5;
135
+ }
136
+ return sum;
137
+ }
138
+
139
+ /* Domain warping: the field is sampled at coordinates another field bends.
140
+ This is the single largest difference between noise that reads as organic
141
+ and noise that reads as television static, and it costs two more fbm calls
142
+ rather than a different algorithm. */
143
+ float warped(vec2 p, float t) {
144
+ vec2 q = vec2(fbm(p + vec2(0.0, t)), fbm(p + vec2(5.2, 1.3 - t)));
145
+ vec2 r = vec2(fbm(p + 4.0 * q + vec2(1.7, 9.2)), fbm(p + 4.0 * q + vec2(8.3, 2.8)));
146
+ return fbm(p + 4.0 * r);
147
+ }
148
+
149
+ /* An exponential falloff without the corner.
150
+ *
151
+ * Both abs and length have a vertex at zero and their derivative jumps
152
+ * across it, so a falloff built on either acquires a hard line exactly along
153
+ * the axis it is brightest on. That is a crease in something meant to be
154
+ * light, and it is what put a chevron through the braid wherever the
155
+ * pointer's height crossed a strand.
156
+ *
157
+ * Softening the distance rather than the exponent keeps the tails identical
158
+ * and rounds only the point. The softening scales with the rate, so a tight
159
+ * falloff is rounded tightly and a broad one broadly: at zero the result is
160
+ * exp(-0.06) whatever the rate is, six per cent off the peak, which is not
161
+ * visible as flattening.
162
+ *
163
+ * Takes the squared distance, because every caller already has one and a
164
+ * square root taken here is the one that would have reintroduced the vertex.
165
+ */
166
+ float falloff(float d2, float k) {
167
+ float soft = 0.06 / k;
168
+ return exp(-sqrt(d2 + soft * soft) * k);
169
+ }
170
+
171
+ /* Two strands half a turn apart, inside a wider volume. */
172
+ float braid(vec2 q, float t, vec2 qp, float reach) {
173
+ /* The strands lean toward the pointer where it is alongside them, and are
174
+ unmoved where it is not. A braid is a thing with a length, so what it can
175
+ answer with is a bend at a height, not a bulge at a point. */
176
+ float alongside = falloff((q.y - qp.y) * (q.y - qp.y), 1.1) * reach;
177
+ float lean = qp.x * alongside * 0.45;
178
+ float lit = 0.0;
179
+ for (int i = 0; i < 2; i++) {
180
+ float phase = float(i) * 3.14159265;
181
+ float x = q.x - lean - 0.34 * sin(q.y * 1.6 + t * 1.4 + phase);
182
+ lit += 0.8 * falloff(x * x, 13.0);
183
+ }
184
+ float volume = falloff(q.x * q.x, 2.6);
185
+ /* Compressed hard across the shaft and stretched along it. The same octaves
186
+ sampled square read as haze; this way they read as filaments. */
187
+ float streak = fbm(vec2(q.x * 9.0, q.y * 0.55 - t * 2.4));
188
+ float haze = warped(vec2(q.x * 0.8 + 4.0, q.y * 0.45), t * 0.5);
189
+ return lit * mix(0.35, 1.65, streak) + volume * 0.3 * mix(0.35, 1.05, haze);
190
+ }
191
+
192
+ /* A fan from a source above the frame, cut into filaments by angle. */
193
+ float rays(vec2 q, float t, vec2 qp, float reach) {
194
+ /* The pointer occludes, rather than the source moving.
195
+
196
+ Swinging the source re-aimed the whole fan, which is a thing a light does
197
+ and not a thing that happens when something passes in front of one. What
198
+ a reader knows about rays is that an object crossing them takes a bite
199
+ out of the light and drags a shadow behind itself, away from the source.
200
+ So the source is fixed and the pointer is a blocker.
201
+
202
+ The shadow is angular, not radial: it is the wedge of directions the
203
+ object covers as seen from the source, and it only exists further along
204
+ than the object is. A fragment nearer the source than the blocker is in
205
+ front of it and stays lit, which is the whole difference between an
206
+ occluder and a dark patch that follows the cursor. */
207
+ vec2 o = vec2(0.0, 1.45);
208
+ vec2 v = q - o;
209
+ float dist = length(v);
210
+ float ang = atan(v.x, -v.y);
211
+
212
+ vec2 vp = qp - o;
213
+ float distToBlocker = length(vp);
214
+ float angToBlocker = atan(vp.x, -vp.y);
215
+ /* Widened with distance, so the object reads as a fixed size rather than
216
+ as a wedge that grows the further out it is carried. */
217
+ float halfAngle = 0.055 / max(distToBlocker, 0.35);
218
+ float across = (ang - angToBlocker) / halfAngle;
219
+ /* Cast from the near edge of the object rather than from somewhere past it.
220
+ Ramping in over a fifth of a unit started the shadow below the thing
221
+ supposedly casting it, which reads as two objects. */
222
+ float behind = smoothstep(-0.03, 0.05, dist - distToBlocker);
223
+ float shadow = exp(-across * across) * behind * reach;
224
+
225
+ float fan = fbm(vec2(ang * 8.0, dist * 0.5 - t * 1.8));
226
+ float dust = warped(vec2(ang * 2.0, dist * 0.7), t * 0.4);
227
+ float spread = smoothstep(0.85, 0.05, abs(ang));
228
+ /* The fan is a population too, even though it is continuous rather than
229
+ counted: how far apart its light and dark run is how much one ray differs
230
+ from the next. Both ends travel toward the midpoint, so a variance of 0
231
+ is an even wash and a variance of 1 is exactly the pair this always had. */
232
+ float rv = clamp(uVariance, 0.0, 1.0);
233
+ float lit = spread * mix(mix(0.85, 0.2, rv), mix(0.85, 1.5, rv), fan) *
234
+ mix(0.75, 1.15, dust) * falloff(dot(v, v), 0.8);
235
+ return lit * (1.0 - shadow * 0.82);
236
+ }
237
+
238
+ /* Curtains on a drifting horizon. */
239
+ float aurora(vec2 q, float t, vec2 qp, float reach) {
240
+ /* The curtain waves harder where the pointer is, rather than being lifted
241
+ by it. An aurora is a sheet with an amplitude, and a swell only raised
242
+ the whole thing locally, which is a bump in a line. Multiplying the
243
+ amplitude bends it instead: the folds deepen and the ridge travels
244
+ further, which is what an aurora does when it is disturbed. */
245
+ float agitate = falloff((q.x - qp.x) * (q.x - qp.x), 1.5) * reach;
246
+
247
+ /* A curtain stands. It does not hang.
248
+
249
+ This was a falloff symmetric about the ridge, which is a band with a
250
+ wavy center line, and a band with vertical noise on it is an equaliser.
251
+ An aurora has a sharp lower border where the field lines reach their
252
+ lowest, and light that thins upward from it, so the top and the bottom
253
+ cannot be the same function. Cut hard below, drawn long above.
254
+
255
+ Two of them, offset and at different depths, because a single sheet reads
256
+ as a decal and what makes the real thing look like drapery is one curtain
257
+ seen through another. */
258
+ float lit = 0.0;
259
+ for (int i = 0; i < 2; i++) {
260
+ float f = float(i);
261
+ /* Two octaves, not a warp. A warp folds the domain back on itself and
262
+ puts high frequencies in the ridge, and against a hard top edge every
263
+ wiggle becomes a spike: the first pass came out a mountain range. What
264
+ an aurora has is a long undulation with a few folds in it, which is
265
+ what a low fundamental and one overtone give. */
266
+ float ridge =
267
+ ((noise(vec2(q.x * (0.55 + f * 0.2) + f * 4.0, t * 0.3)) - 0.5) * 1.7 +
268
+ (noise(vec2(q.x * (1.3 + f * 0.4) + f * 9.0, t * 0.45)) - 0.5) * 0.55) *
269
+ (1.0 + agitate * 2.0) +
270
+ f * 0.22;
271
+ /* **The sheet stands on the ridge rather than hanging from it, and that
272
+ inversion is the whole difference between an aurora and a landscape.**
273
+ A hard edge with mass under it is a mountain silhouette, which is
274
+ exactly what this drew: one unbroken ridge line across the frame with a
275
+ striped solid below it. The real thing is the other way up. A curtain's
276
+ lower border is its sharpest, brightest line, and what rises from it
277
+ thins and breaks into rays. Nothing else here had to change. */
278
+ float depth = q.y - ridge;
279
+ /* Sharp, but not a cliff: the edge is where the light stops, and a step
280
+ narrower than a pixel is an aliased line rather than an edge. */
281
+ /* **The border's sharpness varies along it.** One constant made one
282
+ continuously crisp line across the whole curtain, and a line of even
283
+ weight reads as drawn rather than lit however it wanders. A real lower
284
+ border is hard where the
285
+ sheet faces us and diffuse where it turns away, so the crispness is
286
+ drawn from the same slow noise the folds are. */
287
+ float crisp = mix(0.04, 0.3, noise(vec2(q.x * 0.8 + f * 5.0, t * 0.15)));
288
+ float edge = smoothstep(-crisp, crisp * 0.5, depth);
289
+ /* Steeper, so the curtain thins instead of filling everything above the
290
+ border. At 1.5 it still stood at a fifth a whole unit up, which with
291
+ the bundles over it painted a solid wall of stripes from the border to
292
+ the top of the frame: the dark under a hard line then read as a hill
293
+ and the light over it as rain. A curtain is mostly the bottom of a
294
+ curtain. */
295
+ float rise = exp(-max(depth, 0.0) * (2.9 + f * 1.1));
296
+ /* Stretched hard along the fall, so the striations are the vertical rays
297
+ a curtain is actually made of rather than texture on a stripe. */
298
+ /* 0.9 along the fall, not 0.35. Stretched that hard the rays held one
299
+ value for their whole length, which is a picket fence however the
300
+ bundles are shaped: what varies along a ray is the thing that makes it
301
+ look like moving light rather than a printed stripe. */
302
+ float rays = fbm(vec2(q.x * (9.0 + f * 4.0), q.y * 0.9 - t * (2.2 + f)));
303
+
304
+ /* A rim along the top edge. The brightest part of a curtain is the line
305
+ where the field lines end, and without it the sheet fades in from
306
+ nothing and reads as fog with stripes rather than as something with a
307
+ boundary. Wide enough to see: at k = 26 this was two pixels and might
308
+ as well not have been there. */
309
+ float rim = falloff(depth * depth, 7.0) * 0.45;
310
+
311
+ /* **A curtain is not the width of the sky.** Running edge to edge is what
312
+ made the ridge read as a horizon: a horizon is continuous and a curtain
313
+ is not. Broken into lengths by a slow mask, with real gaps between
314
+ them, it becomes some number of curtains rather than one long one. */
315
+ float lengths = smoothstep(0.2, 0.66, noise(vec2(q.x * 1.15 + f * 13.0, t * 0.12)));
316
+
317
+ /* Rays clump. Straight fbm is evenly spaced striping, which is a picket
318
+ fence whatever else is done to it, and the floor under it lit the sheet
319
+ everywhere so the rays only ever read as texture on a solid band.
320
+ Pushing the midtones apart leaves bright bundles with real gaps
321
+ between them, and the low floor is what lets the gaps be gaps. */
322
+ float bundles = smoothstep(0.34, 0.86, rays);
323
+
324
+ /* The curtain is a draped sheet, so it is bright where a fold turns edge
325
+ on and nearly out where it faces us. A narrow range here is a band of
326
+ even brightness, which is the other half of what made it read flat. */
327
+ float foldNoise = noise(vec2(q.x * 1.5 + f * 7.0, t * 0.25));
328
+
329
+ /* Bundles and folds are what a curtain is made many of, so both answer
330
+ variance about their own midpoint: at 0 an even sheet, at 1 the
331
+ clumping and the deep folds this was tuned to. */
332
+ float av = clamp(uVariance, 0.0, 1.0);
333
+ float bundled = mix(mix(0.85, 0.1, av), mix(0.85, 1.6, av), bundles);
334
+ float folded = mix(mix(0.775, 0.15, av), mix(0.775, 1.4, av), foldNoise);
335
+ lit += edge * lengths * (rise * bundled * folded + rim) * (1.0 - f * 0.45);
336
+ }
337
+ return lit;
338
+ }
339
+
340
+ /* Light traveling in lanes, at speed.
341
+ *
342
+ * The one shape here that is about motion rather than about a form. Each lane
343
+ * carries a trail with its own speed, length and phase, so the field reads as
344
+ * something passing rather than something standing: the streaks the earlier
345
+ * ground plane wanted and never got.
346
+ *
347
+ * The wrap is deliberately outside the frame. A trail restarting is a pop, so
348
+ * the travel runs to plus and minus 1.8 while the visible field ends nearer
349
+ * 1.2, and the reset happens where nobody is looking.
350
+ *
351
+ * The pointer is an obstacle: lanes bow around it and slow through it, the way
352
+ * anything moving past a body does. Pushed outward in proportion to the offset
353
+ * rather than by its sign, because a sign is a discontinuity and a
354
+ * discontinuity in a displacement is a crease.
355
+ */
356
+ float streaks(vec2 q, float t, vec2 qp, float reach) {
357
+ float near = falloff(dot(q - qp, q - qp), 1.6) * reach;
358
+ vec2 s = q + vec2((q.x - qp.x) * near * 1.1, 0.0);
359
+
360
+ /* Three lanes are visited, not one, and that is the fix for a square edge.
361
+
362
+ Each lane draws its speed, phase and length from a hash of its index, so
363
+ every one of them is at a different point in its cycle. Sampled from the
364
+ single lane a fragment falls in, the whole strip changes state at the
365
+ boundary and the field acquires a hard vertical line at every lane edge:
366
+ measured at 23 straight edges across the frame, and at a tilt of 90 the
367
+ same count arrives horizontal, which is what says they belong to the
368
+ shape's own axes rather than to the screen.
369
+
370
+ Visiting the neighbours and weighting each by its own distance is the
371
+ same answer particles already uses for the same reason. The weight
372
+ reaches zero between centres, so nothing is left to step. */
373
+ /* **Fewer lanes, and not all of them carry anything.** At 2.4 a frame held
374
+ a dozen streaks at once and read as rain: a streak is an event, and a
375
+ field of simultaneous events is a texture. Sixteen hundredths of the
376
+ lanes and a little over half of those alive puts the count at about
377
+ two fifths of what it was.
378
+
379
+ A dead lane contributes nothing anywhere rather than being cut off
380
+ somewhere, so it costs the three lane blend nothing. */
381
+ float laneF = s.x * 1.6;
382
+ float base = floor(laneF);
383
+
384
+ float lit = 0.0;
385
+ /* Three lanes, which is what the widths support. The tail spreads to at
386
+ most 0.15 and lanes sit 0.417 apart, so one lane out carries about a
387
+ fiftieth and the lane that drops out of the visited set, two out, is
388
+ around a ten millionth. That dropped lane is where a step could appear,
389
+ and it is the whole reason this loop is not a single lane. */
390
+ for (int k = -1; k <= 1; k++) {
391
+ float id = base + float(k);
392
+ float within = laneF - (id + 0.5);
393
+
394
+ /* Speed and length were already drawn per lane, and measure a little over
395
+ four times and seventy times across a frame. What was not drawn was
396
+ width, which came out flat at 47 to 53 pixels on every lane, so a set
397
+ that moved variously was still a set of identical objects.
398
+
399
+ All four now scale from a common resting value, so a variance of 0 is a
400
+ rank of equal streaks at one speed rather than a special case. Phase is
401
+ never scaled: lanes sharing a phase march in lockstep, which is not a
402
+ uniform population but a broken one. */
403
+ /* Clamped, and the upper half of that is not defensive tidying. These
404
+ are mix() calls, so a value past 1 extrapolates rather than
405
+ exaggerating: at 1.6 the length term reaches zero and beyond it goes
406
+ negative, which makes exp(-behind / len) grow instead of decay and the
407
+ lane becomes a full-height white bar. Measured at 2, the frame held 93
408
+ apparent lanes and six straight edges. There is nothing above 1 worth
409
+ reaching, the resting spread already being fourfold in speed. */
410
+ float v = clamp(uVariance, 0.0, 1.0);
411
+ float alive = step(0.42, hash(vec2(id, 97.0)));
412
+ float speed = mix(1.3, 0.55 + hash(vec2(id, 11.0)) * 1.5, v);
413
+ float phase = hash(vec2(id, 29.0));
414
+ /* Longer than they were. At 0.3 to 1.3 the tail was spent within about
415
+ half the gap and each streak read as a blob with a smudge behind it;
416
+ the thing is named for the trail, so the trail is the part that should
417
+ dominate the head. */
418
+ /* Shorter than it was. A plume that stays bright for two and a half
419
+ units is a searchlight: the frame is two units tall. */
420
+ float len = mix(0.85, 0.5 + hash(vec2(id, 47.0)) * 0.8, v);
421
+
422
+ /* **The lane is periodic, not a single streak that is put back when it
423
+ runs out.** It was fract() over a fixed span of 3.6, so a head left the
424
+ top at 1.8 and was moved to -1.8, taking whatever of its tail was still
425
+ on screen with it. That span is only off screen while the frame is
426
+ small enough to sit inside it, and the visible half-extent is
427
+ (|sin tilt| * aspect + |cos tilt|) * scale, which reaches 1.97 at a
428
+ tilt of 45 and 2.0 at a scale of 2. Past that the removal happens in
429
+ plain view, which is the popping.
430
+
431
+ Making the field periodic in y removes the event rather than moving it
432
+ out of sight: heads sit at every integer of u and the whole rank slides
433
+ through, so there is no frame in which one is created or destroyed and
434
+ no scale or tilt at which that becomes visible.
435
+
436
+ P is the gap between successive heads in a lane, and it is what density
437
+ is now made of. It varies too: lanes that are alike in spacing read as
438
+ a grid however much else about them differs. */
439
+ /* Wider spacing, because the tails are longer: at the old gap a streak's
440
+ tail reached the next one's nose and the lane read as a dashed line
441
+ rather than as separate things traveling. */
442
+ float gap = mix(4.2, 3.2 + hash(vec2(id, 59.0)) * 2.2, v);
443
+ float travel = phase + t * speed * 1.8 / gap;
444
+ float u = s.y / gap - travel;
445
+ float w = fract(u);
446
+ /* **A streak is one solid, not a brightness curve times a fixed width.**
447
+ Drawn separably it is a dart, and that is what these were: along the
448
+ lane the light stopped over a fifth of a unit, across it the lane kept
449
+ its full width the whole way, and the level sets of such a product meet
450
+ at a point. Straight edges and an apex, which is a paper dart.
451
+
452
+ So each term carries its own width. The tail leaves the head narrow and
453
+ spreads as it falls behind, and the front is a round cap rather than a
454
+ full-width wall cut off across the lane. Together that is a teardrop,
455
+ which is the silhouette the thing actually has. */
456
+ float across = within / 1.6;
457
+ /* 0.06, which is what the profile it replaces actually measured. Lanes
458
+ sit 0.417 apart and the old exp(-|within| * 4) was half-height at 0.072
459
+ of a lane, so a sigma of 0.15 was two and a half times too wide: every
460
+ lane overlapped both neighbours and the frame came out a blue wash with
461
+ no streaks in it at all. */
462
+ /* Thinner, and paired with the longer tail below. Length against width is
463
+ what makes a streak read as a streak: at a ratio near four these were
464
+ stubby rods with rounded ends whichever way they tapered, and the fix
465
+ for that is proportion rather than another change of profile. */
466
+ float wide = mix(0.045, 0.03 + hash(vec2(id, 71.0)) * 0.04, v);
467
+
468
+ /* **A comet is a nucleus with a coma, and a plume behind it.** Neither of
469
+ the two shapes this has been was that. A round cap the width of the
470
+ body with the body widening behind it drew a bulb on a shaft; tapering
471
+ the front instead drew a hairline that reads as a scratch. The fault
472
+ common to both is that the head glow was computed from the distance
473
+ *in front of* a head only, so there was never a round bright thing at
474
+ the head at all, just where the profile happened to start.
475
+
476
+ The glow is centered on the head now, measured to whichever head is
477
+ nearer along the lane, so it is symmetric about the nucleus the way a
478
+ coma is. */
479
+ float behind = (1.0 - w) * gap;
480
+ float ahead = w * gap;
481
+ float toHead = min(ahead, behind);
482
+ float nose = wide * 0.5;
483
+
484
+ float near2 = toHead * toHead + across * across;
485
+ float nucleus = exp(-near2 / (2.0 * nose * nose));
486
+ float coma = exp(-near2 / (2.0 * (nose * 3.0) * (nose * 3.0))) * 0.42;
487
+
488
+ /* The plume opens fast and fades fast, and is never as bright as the
489
+ head. A tail that holds its brightness for its whole length is a
490
+ streak of paint; what makes a comet read is that almost all of the
491
+ light is in the first tenth of it.
492
+
493
+ The onset is what keeps it continuous across a head. The plume exists
494
+ only behind, so its value would step from nothing to something at the
495
+ nucleus; ramping it in over a seventh of its own length puts that
496
+ transition under the brightest part of the coma, where there is nothing
497
+ left to see. */
498
+ float onset = 1.0 - exp(-behind / (0.15 * len));
499
+
500
+ /* **The straight edge was a min().** Clamping the plume's width with
501
+ min(nose * (1 + behind * 3), 0.16) saturates at a constant value of
502
+ behind, and a constant behind is a straight line across the lane: above
503
+ it the width was fixed and below it grew, and the kink between the two
504
+ drew a hard diagonal through the frame. A cap on a quantity that varies
505
+ along one axis is a cap along a line, which is the one shape this thing
506
+ must not have.
507
+
508
+ An exponential approach reaches the same limit without ever having a
509
+ corner, so there is no line to see anywhere. */
510
+ float spread = nose + (0.11 - nose) * (1.0 - exp(-behind * 1.3));
511
+ float tail = exp(-behind / len) * onset *
512
+ exp(-(across * across) / (2.0 * spread * spread)) * 0.5;
513
+
514
+ /* Slowed where the pointer is, which is the other half of an obstacle. */
515
+ float weight = mix(1.0, 0.5 + hash(vec2(id, 83.0)) * 0.95, v);
516
+ lit += (nucleus + coma + tail) * alive * weight * mix(1.0, 0.45, near);
517
+ }
518
+ float grain = fbm(vec2(s.x * 3.0, s.y * 1.4 - t * 1.6));
519
+ return lit * mix(0.55, 1.35, grain) * falloff(dot(q, q), 0.42);
520
+ }
521
+
522
+ /* Broad bands rolling under a warp.
523
+ *
524
+ * The softest shape here, and the only one with no filaments in it at all:
525
+ * where braid and threads are made of lines, this is made of gradients. The
526
+ * warp is what stops it sliding: bands moved by phase alone travel sideways
527
+ * like a barcode, and bands moved through a warped domain roll.
528
+ *
529
+ * The pointer drags them. Bowing the phase toward it bends the crests without
530
+ * changing how many there are, which is what a surface does when something
531
+ * pulls across it.
532
+ */
533
+ float waves(vec2 q, float t, vec2 qp, float reach) {
534
+ float pull = falloff(dot(q - qp, q - qp), 1.2) * reach;
535
+ /* **The warp was eating the waves.** At an amplitude of 2.4 against a band
536
+ frequency of 1.7 it swung the sine's argument by about four radians,
537
+ which is more than a whole period: the wavefronts were destroyed rather
538
+ than bent and what came out was turbulence. It read as marbled paper, and
539
+ at a low scale it filled the frame with near white.
540
+
541
+ A tenth of that bends the fronts and leaves them fronts. */
542
+ float warp = warped(vec2(q.x * 0.5, q.y * 0.4), t * 0.3) - 0.5;
543
+ vec2 w = q + warp * 0.32;
544
+
545
+ /* Two systems crossing, lit where they agree, which is what the shape is
546
+ named for and what it had stopped doing. One sine is a corrugation; two
547
+ at different angles interfere, and the slow beat between them is the
548
+ thing worth looking at. */
549
+ /* **And the frequency was too low to be a wave at all.** At 2.3 the period
550
+ is 2.7 in shape units against a visible half height of 1, so less than
551
+ one crest fitted across the frame: there was nothing periodic to see, and
552
+ every version of this that looked like anything looked like it because
553
+ the warp was making clouds. Around 8 puts five crests across the frame,
554
+ which is a wave field rather than a single swell.
555
+
556
+ The two are deliberately not harmonic. Close but unequal frequencies beat
557
+ against each other, and the slow traveling interference that produces is
558
+ the thing worth watching. */
559
+ float a = sin((w.y * 8.1 + w.x * 2.3) - t * 0.9 - pull * 1.4);
560
+ float b = sin((w.y * 5.3 - w.x * 3.4) + t * 0.6 + pull * 1.0);
561
+
562
+ /* **Added, these two make a lattice, not a wave field.** Equal amplitudes
563
+ crossing at an angle give a regular grid of lobes, which came out as
564
+ bubble wrap and got worse the more of it fitted on screen. Waves are
565
+ lines. So one system carries the fronts and the other only varies their
566
+ brightness along their length, which is what a real swell does: the
567
+ crests stay crests and are taller in some places than others. */
568
+ float band = a * 0.5 + 0.5;
569
+ band *= mix(0.45, 1.0, b * 0.5 + 0.5);
570
+
571
+ float grain = warped(vec2(w.x * 1.2 + 6.0, w.y * 0.85), t * 0.28);
572
+ return pow(band, 2.2) * mix(0.55, 1.2, grain) * falloff(dot(q, q), 0.4);
573
+ }
574
+
575
+ /* Luminous threads, woven to a pinch.
576
+ *
577
+ * Five curves at different frequencies and speeds, each a thin bright line
578
+ * rather than a band: what makes this read as woven is that they cross, and
579
+ * what makes it read as one object rather than five is the pinch, where every
580
+ * amplitude narrows at once and the whole weave gathers.
581
+ *
582
+ * The pointer is the pinch, which is the interaction this shape is for.
583
+ * Carrying it along drags the gathering point with it and the threads open
584
+ * behind and close ahead.
585
+ */
586
+ float threads(vec2 q, float t, vec2 qp, float reach) {
587
+ float pinchAt = mix(0.0, qp.x, reach);
588
+ /* Narrowed, not collapsed. At 0.88 the amplitude and the spacing both fell
589
+ to a tenth and all seven threads landed on the same line, which is a
590
+ bright blob rather than a gathering: what a pinch has to preserve is that
591
+ there are still threads in it. */
592
+ float gather = 1.0 - falloff((q.x - pinchAt) * (q.x - pinchAt), 1.1) * 0.6;
593
+
594
+ /* Seven, and every one of them the same thread.
595
+
596
+ The pass before this gave each its own amplitude, height, thickness and
597
+ brightness, all from hashes, and the result was a scatter rather than a
598
+ set: seven unrelated squiggles that happened to share a frame. What makes
599
+ a weave read as a weave is that the strands are alike and only their
600
+ phase differs, which is also what makes it a wave rather than a wobble.
601
+
602
+ So one amplitude, one thickness, one weight, one frequency, and the
603
+ phases fanned evenly across a turn. Alike, they cross at regular
604
+ intervals instead of at coincidences. */
605
+ float lit = 0.0;
606
+ for (int i = 0; i < 7; i++) {
607
+ float f = float(i);
608
+ float phase = f * (6.2831853 / 7.0);
609
+
610
+ /* Evenly spaced, and the spacing collapses at the pinch along with the
611
+ amplitude: threads that only narrow still run parallel through it,
612
+ where threads that also converge actually gather. */
613
+ /* The spacing closes less than the amplitude does, so the threads draw
614
+ together without stacking. */
615
+ float lane = (f - 3.0) * 0.17 * mix(1.0, gather, 0.65);
616
+ float amp = 0.34 * gather;
617
+
618
+ /* A second harmonic at a third the frequency and a third the amplitude,
619
+ which bends the long run of each thread without breaking it into
620
+ wiggles. Low and quiet is the difference between a wave with character
621
+ and a wave with noise on it. */
622
+ float y =
623
+ lane +
624
+ sin(q.x * 1.5 + t * 0.55 + phase) * amp +
625
+ sin(q.x * 0.5 - t * 0.3 + phase) * amp * 0.32;
626
+
627
+ lit += falloff((q.y - y) * (q.y - y), 24.0);
628
+ }
629
+ /* Quiet grain. At the old depth it was texture on the threads rather than
630
+ air around them, and a wave with grain on it is a wobble again. */
631
+ float grain = fbm(vec2(q.x * 2.0, q.y * 2.0 - t));
632
+ return lit * mix(0.85, 1.12, grain) * falloff(dot(q, q), 0.4);
633
+ }
634
+
635
+ /* Points adrift, and pushed aside.
636
+ *
637
+ * One per cell of a coarse lattice, jittered off center so the lattice never
638
+ * shows, and drifting on its own small orbit. Nine cells are visited because a
639
+ * point near a boundary has to be drawn by its neighbours too, which is what
640
+ * stops them popping in and out at the seams.
641
+ *
642
+ * The pointer repels. Pushing along the offset rather than by its sign keeps
643
+ * the displacement smooth, and it is the one response here where the reader
644
+ * is plainly moving things rather than lighting them.
645
+ */
646
+ float particles(vec2 q, float t, vec2 qp, float reach) {
647
+ float lit = 0.0;
648
+ vec2 cell = floor(q * 2.6);
649
+ for (int j = -1; j <= 1; j++) {
650
+ for (int i = -1; i <= 1; i++) {
651
+ vec2 c = cell + vec2(float(i), float(j));
652
+ float a = hash(c);
653
+ float b = hash(c + 17.3);
654
+ float v = clamp(uVariance, 0.0, 1.0);
655
+ vec2 at = (c + 0.5 + (vec2(a, b) - 0.5) * 0.85) / 2.6;
656
+ at += vec2(
657
+ sin(t * mix(1.0, 0.5 + a, v) + b * 6.28),
658
+ cos(t * mix(1.0, 0.42 + b, v) + a * 6.28)
659
+ ) * 0.07;
660
+
661
+ vec2 away = at - qp;
662
+ float push = falloff(dot(away, away), 2.2) * reach;
663
+ at += away * push * 0.55;
664
+
665
+ vec2 off = q - at;
666
+ /* Size, which was flat at 52 for every mote, so a field whose members
667
+ already differed in brightness and in how fast they wandered was
668
+ still made of one object repeated. Nine cells are visited here, so
669
+ unlike a streak lane a mote may be broader as well as tighter
670
+ without leaving an edge anywhere. */
671
+ float grade = mix(52.0, 52.0 * (0.62 + hash(c + 5.7) * 0.95), v);
672
+
673
+ /* **Round, because a particle is round.** These were stretched two and a
674
+ half times along a direction drawn per mote, on the reasoning that a
675
+ starfield says nothing because stars are fixed. That was a problem
676
+ nobody had, and the cure was worse: a fixed axis per mote is not
677
+ motion, it is orientation, so a field of them reads as grains of rice
678
+ pointing every which way rather than as particles at all. Motion, if
679
+ it is ever wanted here, has to come from the direction each mote is
680
+ actually traveling, and that is the wander below rather than a hash.
681
+
682
+ The halo stays. An order of magnitude wider and a tenth the strength,
683
+ so a mote sits in the field rather than on top of it: a hard little
684
+ disc on a dark ground is a pixel, and light has a neighbourhood. */
685
+ float core = falloff(dot(off, off), grade);
686
+ float halo = falloff(dot(off, off), grade * 0.16) * 0.1;
687
+ lit += (core + halo) * mix(0.8, 0.35 + a * 0.9, v);
688
+ }
689
+ }
690
+ return lit * falloff(dot(q, q), 0.4);
691
+ }
692
+
693
+ /* Ink in a viscous medium, drawn through by where the pointer went.
694
+ *
695
+ * **The wake is one stroke, not eight marks.** Each trail point used to add a
696
+ * vortex of its own, rotating the sample around its own center, which drew
697
+ * eight discrete swirls fading in place: a row of blobs rather than anything
698
+ * a hand had done. The marks are a polyline now. Distance is measured to the
699
+ * nearest *segment*, age is interpolated along it, and what a reader sees is
700
+ * a continuous stroke however far apart the samples fell.
701
+ *
702
+ * **And the displacement runs along the stroke, not around it.** Pushing the
703
+ * sample down the tangent is advection: the pattern is carried the way the
704
+ * hand went, which is what stirring looks like. Rotating it around a point is
705
+ * a whirlpool, and eight whirlpools is a washing machine.
706
+ *
707
+ * The marks arrive oldest first, so consecutive indices are consecutive in
708
+ * time. In the ring they are not, and a segment drawn across the wrap joined
709
+ * the newest mark to the oldest with a bright bar through the middle of the
710
+ * field.
711
+ *
712
+ * Nine, not eight: eight committed marks and the live head, which is held
713
+ * outside the ring so that committing appends rather than overwrites. A
714
+ * zero-length segment between the newest mark and the head is skipped below,
715
+ * which is what makes the commit invisible.
716
+ */
717
+ float flowWake(vec2 at, mat2 turn, vec2 shift, out vec2 push) {
718
+ push = vec2(0.0);
719
+ float wake = 0.0;
720
+
721
+ for (int i = 0; i < 8; i++) {
722
+ vec3 a = uTrail[i];
723
+ vec3 b = uTrail[i + 1];
724
+ if (a.z >= 1.0 || b.z >= 1.0) {
725
+ continue;
726
+ }
727
+ /* The marks arrive in screen space, and the field is sampled after a
728
+ rotation, a scale and a parallax shift. Compared without carrying them
729
+ through the same three, the wake sits somewhere else entirely: at a
730
+ tilt of 42 and a scale of 1.7 it landed most of a frame from the
731
+ cursor, which is what read as offset rather than as lagging. */
732
+ vec2 pa = turn * (a.xy - shift) * uScale;
733
+ vec2 pb = turn * (b.xy - shift) * uScale;
734
+ vec2 ab = pb - pa;
735
+ float len2 = dot(ab, ab);
736
+ if (len2 < 1e-6) {
737
+ continue;
738
+ }
739
+ float t = clamp(dot(at - pa, ab) / len2, 0.0, 1.0);
740
+ vec2 off = at - (pa + ab * t);
741
+
742
+ /* Elongated along the stroke, not round about it.
743
+
744
+ A circular falloff makes the wake a tube of even thickness, which is
745
+ what a pipe looks like and not what a stirred medium does. Ink pulled
746
+ through a liquid smears the way the hand went: it reaches further along
747
+ the direction of travel than across it. Weighting the along component
748
+ down stretches the ellipse into that direction, and costs one dot
749
+ product. */
750
+ vec2 tangent = ab * inversesqrt(len2);
751
+ float alongOff = dot(off, tangent);
752
+ float acrossOff = dot(off, vec2(-tangent.y, tangent.x));
753
+ float shaped = acrossOff * acrossOff + alongOff * alongOff * 0.3;
754
+
755
+ /* Squared, so a wake thins as it dies rather than switching off. */
756
+ float life = 1.0 - mix(a.z, b.z, t);
757
+ float w = life * life * falloff(shaped, 3.2);
758
+ wake += w;
759
+ push += (ab * inversesqrt(len2)) * w;
760
+ }
761
+
762
+ /* Limited, because an unbounded displacement folds and a fold is a crease.
763
+
764
+ Where the map from sample to displaced sample stops being one to one,
765
+ neighbouring samples land on the same value and the pattern piles into a
766
+ hard bright line: a caustic, which is what a sharp diagonal with a bright
767
+ wedge beside it always is. The sum runs over eight segments of unit
768
+ tangents, so near the stroke it reached several times the width of the
769
+ falloff it was displacing across, and folded every time.
770
+
771
+ The falloff is about a third of a unit wide, so the displacement has to
772
+ stay under that for the map to stay monotone. Saturating rather than
773
+ clamped: a clamp is a corner, and a corner in a displacement is the same
774
+ crease by another route. */
775
+ float mag = length(push);
776
+ push = mag > 0.0 ? push * (0.24 / (0.9 + mag)) : vec2(0.0);
777
+ return wake;
778
+ }
779
+
780
+ float flow(vec2 q, float t, mat2 turn, vec2 shift) {
781
+ vec2 push;
782
+ float wake = flowWake(q, turn, shift, push);
783
+ /* Already limited inside, so it is applied whole. */
784
+ vec2 p = q + push;
785
+
786
+ /* The field is warped by itself twice over, which is what gives a liquid
787
+ its folded look: each sample is displaced by the field's own value, so
788
+ structure gathers into sheets rather than staying a cloud. */
789
+ /* **Halved, because the detail was the problem.** At 1.15 and 2.3 every
790
+ octave landed small enough that the frame filled edge to edge with fine
791
+ crumple at one density: marbled stone, and it looked the same at every
792
+ scale, gain and bloom because there was no large form for any of them to
793
+ act on. Big shapes first, detail on top of them. */
794
+ /* *The directional pass is reverted.* Sampling the ink stretched along a
795
+ slow angle field did make filaments, and it made the shape busier and
796
+ more literal than the soft masses it replaced. Preferred as it was, so it
797
+ is as it was. The finding is worth keeping even though the code is not:
798
+ isotropic noise cannot make a current, so anything wanting one has to
799
+ carry a direction, and that is a bigger change than this shape wants. */
800
+ float ink = warped(p * 0.55, t * 0.55);
801
+ float sheet = warped(p * 1.1 + vec2(3.1, 1.7), t * 0.35);
802
+
803
+ /* **Floors of 0.55 and 0.5 meant it was never dark anywhere.** The lowest
804
+ the field could reach was a quarter lit, so every fragment landed in the
805
+ same middle band and the frame came out an even swatch of texture with no
806
+ structure to look at. Dropping the floor gives it voids.
807
+
808
+ And a slow large mass over the top, so the liquid is thick in places and
809
+ clear in others. Fine detail everywhere at one density is static; what
810
+ makes a fluid read is that it gathers. */
811
+ /* Thresholded, not just varied. A gentle modulation over a field that is
812
+ lit everywhere is still lit everywhere; what a liquid needs is somewhere
813
+ it simply is not, so the empty parts of the frame are what give the full
814
+ parts a shape. */
815
+ float mass = smoothstep(0.24, 0.72, noise(vec2(p.x * 0.45 - t * 0.1, p.y * 0.4 + t * 0.07)));
816
+ /* The void floor is 0.18 rather than 0.05. At a low scale the mass noise
817
+ varies less across the frame than the frame is wide, so a reader can land
818
+ inside one void and see nothing at all: empty has to mean faint, not
819
+ absent, or the shape can disappear entirely at a setting the property
820
+ explicitly allows. */
821
+ /* 0.28 rather than 0.18 under the voids, and a brighter ceiling. At a low
822
+ scale the mass noise varies less across the frame than the frame is wide,
823
+ so a reader can sit inside one void and see almost nothing: measured at
824
+ scale 0.5, which came out near black. Empty has to mean faint. */
825
+ float body = mix(0.05, 1.4, ink) * mix(0.4, 1.2, sheet) * mix(0.22, 1.45, mass);
826
+
827
+ /* The resting state matters more than the stirred one: most readers never
828
+ move the pointer, and a shape that is dark until touched is a shape most
829
+ people never see. */
830
+ /* 0.85 at rest, not 0.5. Halving an untouched field made sense when the
831
+ field had a floor under it and could not go dark; with the voids in, the
832
+ two together took it to a dim murk that read as wet rock. The wake still
833
+ lifts what it touches, from a resting level that is worth looking at. */
834
+ return body * (0.85 + clamp(wake, 0.0, 1.0) * 0.5) * falloff(dot(q, q), 0.55);
835
+ }
836
+
837
+ /* Light through moving water, focused into a web.
838
+ *
839
+ * **A caustic is where a wavefront folds, not where it is bright.** Sampling
840
+ * a noise field and lighting the high parts gives clouds; what makes the
841
+ * pattern on a pool floor is that the surface bends light and neighbouring
842
+ * rays land on the same spot. The cheap stand-in for that is the *zero* of a
843
+ * displaced wave sum rather than its peak: 1 - |sum| is thin and bright
844
+ * exactly where the sum crosses, which is the fold.
845
+ *
846
+ * abs() puts a derivative discontinuity along each of those lines, and here
847
+ * that is the drawing rather than a fault: a caustic edge is genuinely sharp,
848
+ * which is the whole reason it reads as light rather than as fog.
849
+ */
850
+ float caustics(vec2 q, float t, vec2 qp, float reach) {
851
+ /* The pointer is a stone in the water: the surface it disturbs is a ring
852
+ of extra phase, so the web tightens around it rather than brightening. */
853
+ float dropD = length(q - qp);
854
+ float drop = falloff(dropD * dropD, 1.4) * reach;
855
+
856
+ float lit = 0.0;
857
+ for (int i = 0; i < 3; i++) {
858
+ float f = float(i);
859
+ vec2 p = q * (1.5 + f * 0.55);
860
+
861
+ /* Warped by the field's own value, so the wavefronts bend the way a
862
+ surface does rather than sliding as a rigid pattern. */
863
+ vec2 w = p + vec2(
864
+ noise(p * 1.25 + vec2(t * 0.42 + f * 4.0, 0.0)),
865
+ noise(p * 1.1 - vec2(0.0, t * 0.36 + f * 7.0))
866
+ ) * 0.85;
867
+
868
+ float sum = sin(w.x * 3.1 + t * 0.7 + drop * 6.0) + sin(w.y * 2.7 - t * 0.55 - drop * 5.0);
869
+ float fold = 1.0 - clamp(abs(sum) * 0.5, 0.0, 1.0);
870
+ lit += pow(fold, 7.0) * (1.0 - f * 0.22);
871
+ }
872
+
873
+ /* **The pool has a lit part and a dark part.** Three layers of folds at one
874
+ density fill the frame edge to edge and every version of it looks the
875
+ same: bright everywhere carries the same amount of information as dark
876
+ everywhere. A slow depth over the top decides where the light is getting
877
+ through, so the web has somewhere to be faint and the eye somewhere to
878
+ start. */
879
+ float pool = smoothstep(0.2, 0.78, noise(vec2(q.x * 0.55 - t * 0.09, q.y * 0.5 + t * 0.06)));
880
+
881
+ /* And the stone brightens what it disturbs as well as bending it, or the
882
+ only evidence of a pointer is a phase shift nobody can see. */
883
+ float dim = warped(q * 0.7, t * 0.2);
884
+ return lit * mix(0.55, 1.25, dim) * mix(0.25, 1.25, pool) *
885
+ (1.0 + drop * 0.9) * falloff(dot(q, q), 0.4);
886
+ }
887
+
888
+ /* A lattice in perspective, lit at its nodes.
889
+ *
890
+ * **The one shape here that is not weather.** Everything else in this set is
891
+ * a fluid, a light or a sky, and a design system is none of those: it is a
892
+ * structure, regular, with the interesting part at the joints. So this is
893
+ * drawn rather than simulated, and it is the only one with straight lines in
894
+ * it on purpose.
895
+ *
896
+ * Perspective is a divide, not a matrix. Scaling the grid by 1 / (1 + depth)
897
+ * makes the cells shrink with distance and the whole thing recede, which is
898
+ * the entire trick and costs one division.
899
+ */
900
+ float lattice(vec2 q, float t, vec2 qp, float reach) {
901
+ /* The pointer lifts the plane nearest it, so the lattice crowds where a
902
+ reader is looking. A structure answers by changing its spacing, which is
903
+ the only thing about a lattice that can move without breaking it. */
904
+ vec2 away = q - qp;
905
+ float near = falloff(dot(away, away), 1.8) * reach;
906
+
907
+ /* **A ground plane, not a mirrored one.** Dividing by abs(p.y) makes two
908
+ floors meeting along y = 0, which reads as a bowtie with a crease down
909
+ the middle rather than as anything receding. Dividing by the distance
910
+ below a horizon is the actual projection: one plane, cells shrinking as
911
+ they approach it, and nothing above it to fold back.
912
+
913
+ It travels as well, so the structure arrives rather than sitting still.
914
+ Perspective and motion together are what say the plane is a plane. */
915
+ float below = max(1.45 - q.y, 0.14);
916
+ float depth = 1.0 / below;
917
+ vec2 g = vec2(
918
+ q.x * depth * (2.3 + near * 1.4),
919
+ depth * 1.6 + t * 0.28
920
+ );
921
+ vec2 cell = fract(g) - 0.5;
922
+
923
+ /* The rails, thinner the further back they are, so the grid does not turn
924
+ into a solid sheet at the horizon. */
925
+ float rail = min(abs(cell.x), abs(cell.y));
926
+ float lines = falloff(rail * rail, 24.0);
927
+
928
+ /* The joints, which is where a lattice is actually a lattice, and brighter
929
+ than the rails between them: a grid of even weight is graph paper. */
930
+ float node = falloff(dot(cell, cell), 26.0) * 2.1 * (0.6 + near * 0.9);
931
+
932
+ /* Faded toward the horizon, or the cells pile into a solid sheet exactly
933
+ where they are smallest. */
934
+ float far = smoothstep(0.0, 0.55, below) * smoothstep(3.4, 1.3, below);
935
+
936
+ float dust = warped(q * 0.9, t * 0.25);
937
+ return (lines * 0.5 + node) * far * mix(0.7, 1.2, dust) * falloff(dot(q, q), 0.42);
938
+ }
939
+
940
+ /* Cells, lit along the seams between them.
941
+ *
942
+ * **Provenance as a picture.** A Voronoi field is a set of territories, each
943
+ * one everything nearer to its own point than to any other, and the drawing
944
+ * is not the cells but the boundaries: where two claims meet is exactly
945
+ * what Trace is about. Nothing here is lit except the disagreements.
946
+ *
947
+ * The wall is the second nearest distance minus the nearest, which is zero
948
+ * on the boundary and grows into the interior. It is a genuine distance, so
949
+ * it needs no epsilon and produces no crease.
950
+ */
951
+ float fracture(vec2 q, float t, vec2 qp, float reach) {
952
+ vec2 g = q * 2.1;
953
+ vec2 base = floor(g);
954
+ vec2 f = g - base;
955
+
956
+ float first = 9.0;
957
+ float second = 9.0;
958
+ for (int j = -1; j <= 1; j++) {
959
+ for (int i = -1; i <= 1; i++) {
960
+ vec2 o = vec2(float(i), float(j));
961
+ vec2 id = base + o;
962
+
963
+ /* Each site drifts on its own small orbit, so the seams breathe rather
964
+ than the whole field sliding. */
965
+ float a = hash(id) * 6.2831853;
966
+ float b = hash(id + 41.7) * 6.2831853;
967
+ vec2 site = o + 0.5 + 0.42 * vec2(sin(t * 0.5 + a), cos(t * 0.42 + b));
968
+
969
+ /* Sites near the pointer are pushed away from it, which opens the
970
+ cells there: a territory answers by giving ground. */
971
+ vec2 world = (id + 0.5) / 2.1;
972
+ vec2 shove = world - qp;
973
+ site += normalize(shove + 0.0001) * falloff(dot(shove, shove), 2.4) * reach * 0.5;
974
+
975
+ float d = length(site - f);
976
+ if (d < first) {
977
+ second = first;
978
+ first = d;
979
+ } else if (d < second) {
980
+ second = d;
981
+ }
982
+ }
983
+ }
984
+
985
+ float wall = second - first;
986
+ float seam = falloff(wall * wall, 17.0);
987
+
988
+ /* **Not every seam is lit the same.** At one brightness the field is a
989
+ mosaic of equal cells, which is a texture; what makes a set of
990
+ territories read is that some borders are contested and most are not. A
991
+ slow field decides which, and the dark stretches give the lit ones a
992
+ shape. */
993
+ float contested = smoothstep(0.24, 0.8, noise(vec2(q.x * 0.6 + t * 0.07, q.y * 0.55 - t * 0.05)));
994
+
995
+ float grain = warped(q * 1.3, t * 0.3);
996
+ return seam * mix(0.6, 1.25, grain) * mix(0.18, 1.3, contested) *
997
+ falloff(dot(q, q), 0.42);
998
+ }
999
+
1000
+ /* Two wave fields crossed, lit where they agree. */
1001
+ void main() {
1002
+ vec2 p = uv * 2.0 - 1.0;
1003
+ float aspect = uResolution.x / max(uResolution.y, 1.0);
1004
+ p.x *= aspect;
1005
+
1006
+ /* What the pointer does, and the two answers this stopped giving.
1007
+
1008
+ It multiplied what was already lit, which shows nothing over a dark part
1009
+ of the field, so the visible answer to moving the cursor appeared
1010
+ wherever the shape happened to be bright rather than where the cursor
1011
+ was. Replacing that with a pull toward the pointer fixed the location and
1012
+ introduced the second problem: a radial pull is a magnifier, so every
1013
+ shape answered a pointer by zooming, and the lift that remained answered
1014
+ by glowing. Two gestures, applied identically to six different things,
1015
+ neither of which had anything to do with the thing it was applied to.
1016
+
1017
+ There is no shared response now. What is left here is parallax, and each
1018
+ shape answers for itself below. */
1019
+ /* **No global response, parallax included.** Every named interaction is a
1020
+ promise about what the pointer does, and translating the whole field is
1021
+ not any of them: a consumer asking for a light asked for a light, not for
1022
+ a light and a lean. It survived a pass that removed the other two shared
1023
+ gestures on the grounds that it was small, and small is not the test.
1024
+
1025
+ Measured on threads before removing it, sampling a column band on the far
1026
+ side of the frame from the cursor and correlating: 90 pixels of vertical
1027
+ travel on a 1224 pixel canvas, seven per cent of the frame, identical
1028
+ under native, light, shadow and ripple and zero under none. Whatever the
1029
+ pointer was told to do, it also moved everything.
1030
+
1031
+ What answers the pointer now is each shape, in the terms it is made of,
1032
+ and the three generics for a consumer who asks for one. */
1033
+ vec2 q = p;
1034
+
1035
+ /* **The tilt is an angle on the screen, not in the sampling space.**
1036
+
1037
+ p.x is stretched by the aspect before anything is rotated, so a
1038
+ rotation applied here is a rotation in an anisotropic space, which is a
1039
+ shear. Working it through: a feature along the shape's own x axis sits
1040
+ where q.y = 0, which is p.y = -tan(a) * p.x, and since p.x is aspect
1041
+ times the screen's x the slope a reader sees is aspect * tan(a). At a
1042
+ widescreen 1.78 a tilt of 14 drew at 23.9 degrees, and the same number
1043
+ drew differently in every box the component was put in.
1044
+
1045
+ Solving aspect * tan(a) = tan(tilt) gives the angle to rotate by. The two
1046
+ argument atan is what makes 90 work: tan blows up there, while
1047
+ atan(1, 0) is exactly a quarter turn. */
1048
+ float want = radians(uTilt);
1049
+ float a = atan(sin(want), cos(want) * aspect);
1050
+ mat2 turn = mat2(cos(a), sin(a), -sin(a), cos(a));
1051
+ q = turn * q * uScale;
1052
+
1053
+ /* The pointer, carried into the same frame the shapes are drawn in, so each
1054
+ one can answer it in its own terms. */
1055
+ vec2 qp = turn * uPointer * uScale;
1056
+
1057
+ float t = uTime * 0.06;
1058
+
1059
+ /* Each shape answers the pointer in the terms it is made of, and there is
1060
+ no shared response left over.
1061
+
1062
+ There used to be two, applied to everything: the field was pulled toward
1063
+ the cursor, and what was already lit was multiplied over a floor. Those
1064
+ are a zoom and a glow, they are the same gesture on every shape, and
1065
+ neither says anything about the shape it is on. A braid has a length and
1066
+ can lean. Rays have a source and can re-aim. A curtain has a horizon and
1067
+ can swell. Rings are made of spacing and can crowd. A weave is made of
1068
+ agreement and can shear. Flow is stirred, and had the only one of these
1069
+ that was ever about its own material. */
1070
+ /* A shape answers for itself only when nothing else has been asked for.
1071
+ Given a generic response, its own is switched off rather than layered
1072
+ under: two answers to one gesture is how the zoom and the glow got here
1073
+ in the first place. */
1074
+ float own = uInteraction == 0 ? uReach : 0.0;
1075
+
1076
+ float d = 0.0;
1077
+ if (uShape == 0) {
1078
+ d = braid(q, t, qp, own);
1079
+ } else if (uShape == 1) {
1080
+ d = rays(q, t, qp, own);
1081
+ } else if (uShape == 2) {
1082
+ d = aurora(q, t, qp, own);
1083
+ } else if (uShape == 3) {
1084
+ d = streaks(q, t, qp, own);
1085
+ } else if (uShape == 4) {
1086
+ d = waves(q, t, qp, own);
1087
+ } else if (uShape == 5) {
1088
+ d = threads(q, t, qp, own);
1089
+ } else if (uShape == 6) {
1090
+ d = particles(q, t, qp, own);
1091
+ } else if (uShape == 7) {
1092
+ d = flow(q, t, turn, uPointer * 0.05 * uReach);
1093
+ } else if (uShape == 8) {
1094
+ d = caustics(q, t, qp, own);
1095
+ } else if (uShape == 9) {
1096
+ d = lattice(q, t, qp, own);
1097
+ } else {
1098
+ d = fracture(q, t, qp, own);
1099
+ }
1100
+
1101
+ /* Bloom as an exponent on the field rather than a term inside each shape.
1102
+ Every shape is a density that falls off, so a power tightens or spreads
1103
+ that falloff and one control means the same thing in all five. */
1104
+ d = pow(max(d, 0.0), mix(2.0, 0.5, clamp(uBloom, 0.0, 1.0))) * uGain;
1105
+
1106
+ /* The generic answers, for a consumer who has asked for one.
1107
+
1108
+ All three are functions of distance from the pointer and nothing else,
1109
+ which is exactly what makes them generic and exactly what makes them say
1110
+ less. The light option lifts what is lit and puts a floor under itself so
1111
+ there is something at the cursor over a dark field. The shadow option is
1112
+ that gesture inverted, which suits a bright field where a lamp would be
1113
+ invisible. The ripple option is the one with a clock in it, so it keeps
1114
+ moving after the pointer has stopped. */
1115
+ if (uInteraction != 0 && uInteraction != 4) {
1116
+ vec2 toCursor = p - uPointer;
1117
+ float near = falloff(dot(toCursor, toCursor), 3.0) * uReach;
1118
+ if (uInteraction == 1) {
1119
+ d = d * (1.0 + near * 1.2) + near * 0.08;
1120
+ } else if (uInteraction == 2) {
1121
+ d *= 1.0 - near * 0.85;
1122
+ } else {
1123
+ float rings = sin(length(toCursor) * 13.0 - uTime * 3.2);
1124
+ d *= 1.0 + rings * near * 0.75;
1125
+ }
1126
+ }
1127
+
1128
+ d *= mix(0.65, 1.35, smoothstep(-1.0, 1.0, q.y));
1129
+
1130
+ /* Rolled off rather than clipped. A hard clamp flattens the core into a
1131
+ plateau of one value, which is what makes a bright shader look like a
1132
+ sticker; this compresses toward one and keeps the gradient inside it. */
1133
+ float lift = 1.0 - exp(-max(d, 0.0) * 1.15);
1134
+
1135
+ vec3 rgb = mix(uGround, uHaze, smoothstep(0.0, 0.16, lift));
1136
+ rgb = mix(rgb, uGlow, smoothstep(0.10, 0.46, lift));
1137
+ rgb = mix(rgb, uPeak, smoothstep(0.40, 0.72, lift) * 0.6);
1138
+
1139
+ /* Dithered before the buffer quantizes. A falloff this soft spans a few
1140
+ hundred 8-bit steps across a screen, and without a sub-step of noise it
1141
+ paints as visible rings. */
1142
+ float dither = (hash(gl_FragCoord.xy) - 0.5) / 255.0;
1143
+ color = vec4(rgb + dither, 1.0);
1144
+ }
1145
+ `;