@mkbabb/glass-ui 4.0.1 → 4.1.0

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 (459) hide show
  1. package/dist/{CardAction-CW7a0m8M.js → CardAction-8whJrLWt.js} +23 -8
  2. package/dist/{CommandShortcut-DvZNQ_HF.js → CommandShortcut-D3yxgHNn.js} +23 -12
  3. package/dist/{ConfiguratorRow-BR4l-ixA.js → ConfiguratorRow-CaP7U3ZA.js} +11 -11
  4. package/dist/ContextMenuContent-B3ZsheLV.js +90 -0
  5. package/dist/{ContextMenuSubContent-xol4sD2q.js → ContextMenuSubContent-DDRID3qC.js} +15 -15
  6. package/dist/{DataTable-CuKwF7wr.js → DataTable-Bc9kUtu_.js} +2 -2
  7. package/dist/{DialogContent-DcKK8k9i.js → DialogContent-6JtTB5x2.js} +8 -5
  8. package/dist/DialogFooter-9phqcRIS.js +80 -0
  9. package/dist/DialogScrollContent-TTuovQst.js +93 -0
  10. package/dist/HoverCardContent-Bel1gdLZ.js +88 -0
  11. package/dist/{IconChip-BTD-nay5.js → IconChip-DhbdGdFQ.js} +1 -1
  12. package/dist/{IconTooltip-Bl8gFZ8d.js → IconTooltip-B0zimd2H.js} +1 -1
  13. package/dist/Input-Cg9DF62r.js +57 -0
  14. package/dist/{Notification-VUwexFUf.js → Notification-CphK7AAm.js} +3 -3
  15. package/dist/NumberFieldContent-D8cXeyO4.js +140 -0
  16. package/dist/PagerDots-Cjx96la-.js +98 -0
  17. package/dist/{SelectScrollDownButton-CrA8F0iV.js → SelectScrollDownButton-DAKCBEdW.js} +62 -57
  18. package/dist/{SelectSeparator-DXswVdRz.js → SelectSeparator-C2UGOkXF.js} +1 -1
  19. package/dist/Separator-DQcwC2TR.js +44 -0
  20. package/dist/Switch-B8RscmRu.js +49 -0
  21. package/dist/{Toaster-Bw4xR8xV.js → Toaster-D9qIHjBI.js} +1 -1
  22. package/dist/{ToggleGroupItem-pEM9vIhs.js → ToggleGroupItem-BLtr3TJq.js} +2 -2
  23. package/dist/TooltipProvider-BJ_Y5EGX.js +109 -0
  24. package/dist/animated-digit.js +1 -1
  25. package/dist/api/index.d.ts +15 -32
  26. package/dist/api/types-extra.d.ts +31 -0
  27. package/dist/api.js +1 -1
  28. package/dist/aurora.js +579 -251
  29. package/dist/border-progress.js +49 -57
  30. package/dist/{button-DYCUa-tH.js → button-5dY1Dvhd.js} +13 -14
  31. package/dist/button.js +1 -1
  32. package/dist/canvas.js +2 -3
  33. package/dist/card.js +1 -1
  34. package/dist/carousel.js +20 -20
  35. package/dist/color-Cs0-oxYL.js +116 -0
  36. package/dist/color.js +2 -2
  37. package/dist/command.js +1 -1
  38. package/dist/completion-seal.d.ts +1 -0
  39. package/dist/completion-seal.js +89 -0
  40. package/dist/components/custom/aurora/Aurora.vue.d.ts +10 -5
  41. package/dist/components/custom/aurora/composables/color.d.ts +13 -0
  42. package/dist/components/custom/aurora/composables/frameLoop.d.ts +9 -0
  43. package/dist/components/custom/aurora/composables/runtime.d.ts +12 -0
  44. package/dist/components/custom/aurora/composables/uniformBridgeWGPU.d.ts +11 -2
  45. package/dist/components/custom/aurora/composables/wgpuSetup.d.ts +8 -0
  46. package/dist/components/custom/aurora/constants/presets.d.ts +18 -0
  47. package/dist/components/custom/aurora/constants/renderMode.d.ts +16 -8
  48. package/dist/components/custom/aurora/constants/shaders/aurora-mediums.wgsl.d.ts +1 -0
  49. package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
  50. package/dist/components/custom/border-progress/composables/spectrum-walk.d.ts +25 -0
  51. package/dist/components/custom/border-progress/composables/useBorderSpectrum.d.ts +14 -18
  52. package/dist/components/custom/border-progress/index.d.ts +1 -1
  53. package/dist/components/custom/completion-seal/CompletionSeal.vue.d.ts +21 -0
  54. package/dist/components/custom/completion-seal/composables/useCompletionSeal.d.ts +37 -0
  55. package/dist/components/custom/completion-seal/constants.d.ts +46 -0
  56. package/dist/components/custom/completion-seal/index.d.ts +4 -0
  57. package/dist/components/custom/concentric/composables/concentricGLSetup.d.ts +7 -0
  58. package/dist/components/custom/concentric/composables/concentricWGPUSetup.d.ts +9 -0
  59. package/dist/components/custom/concentric/composables/ringField.d.ts +57 -16
  60. package/dist/components/custom/concentric/composables/uniformBridgeWGPU.d.ts +2 -1
  61. package/dist/components/custom/concentric/composables/useConcentric.d.ts +4 -4
  62. package/dist/components/custom/concentric/constants.d.ts +30 -6
  63. package/dist/components/custom/concentric/index.d.ts +2 -2
  64. package/dist/components/custom/concentric/shaders/concentric.glsl.d.ts +2 -2
  65. package/dist/components/custom/concentric/shaders/concentric.wgsl.d.ts +1 -1
  66. package/dist/components/custom/confirm-dialog/ConfirmDialog.vue.d.ts +3 -3
  67. package/dist/components/custom/constellation/Constellation.vue.d.ts +5 -4
  68. package/dist/components/custom/constellation/composables/constellationGLSetup.d.ts +10 -0
  69. package/dist/components/custom/constellation/composables/constellationWGPUSetup.d.ts +19 -0
  70. package/dist/components/custom/constellation/composables/uniformBridgeWGPU.d.ts +66 -0
  71. package/dist/components/custom/constellation/composables/useConstellation.d.ts +3 -10
  72. package/dist/components/custom/constellation/constants.d.ts +33 -0
  73. package/dist/components/custom/constellation/constellationField.d.ts +31 -1
  74. package/dist/components/custom/constellation/constellationInteraction.d.ts +23 -14
  75. package/dist/components/custom/constellation/constellationRender.d.ts +25 -0
  76. package/dist/components/custom/constellation/constellationTypes.d.ts +38 -0
  77. package/dist/components/custom/constellation/constellationWell.d.ts +15 -0
  78. package/dist/components/custom/constellation/index.d.ts +5 -5
  79. package/dist/components/custom/constellation/shaders/constellation-lines.glsl.d.ts +2 -0
  80. package/dist/components/custom/constellation/shaders/constellation-lines.wgsl.d.ts +1 -0
  81. package/dist/components/custom/constellation/shaders/constellation-points.glsl.d.ts +2 -0
  82. package/dist/components/custom/constellation/shaders/constellation-points.wgsl.d.ts +1 -0
  83. package/dist/components/custom/deck/DeckPager.vue.d.ts +29 -0
  84. package/dist/components/custom/deck/composables/useDeck.d.ts +27 -0
  85. package/dist/components/custom/deck/composables/useDeckKeyboard.d.ts +25 -0
  86. package/dist/components/custom/deck/composables/useDeckSpring.d.ts +22 -0
  87. package/dist/components/custom/deck/constants.d.ts +14 -0
  88. package/dist/components/custom/deck/index.d.ts +8 -0
  89. package/dist/components/custom/dock/DockIconButton.vue.d.ts +12 -0
  90. package/dist/components/custom/dock/DockStack.vue.d.ts +65 -0
  91. package/dist/components/custom/dock/GlassDock.vue.d.ts +4 -2
  92. package/dist/components/custom/dock/composables/dockMorphMeasure.d.ts +80 -0
  93. package/dist/components/custom/dock/composables/index.d.ts +2 -0
  94. package/dist/components/custom/dock/composables/useDockSearch.d.ts +85 -0
  95. package/dist/components/custom/dock/composables/useDockShellProps.d.ts +11 -0
  96. package/dist/components/custom/dock/constants.d.ts +18 -14
  97. package/dist/components/custom/dock/index.d.ts +5 -2
  98. package/dist/components/custom/dot-flow-field/DotFlowField.vue.d.ts +15 -11
  99. package/dist/components/custom/dot-flow-field/composables/flowField.d.ts +48 -6
  100. package/dist/components/custom/dot-flow-field/composables/uniformBridgeWGPU.d.ts +23 -8
  101. package/dist/components/custom/dot-flow-field/composables/useDotFlowField.d.ts +6 -5
  102. package/dist/components/custom/dot-flow-field/composables/useFlowParticles.d.ts +18 -5
  103. package/dist/components/custom/dot-flow-field/constants.d.ts +42 -21
  104. package/dist/components/custom/dot-flow-field/index.d.ts +2 -2
  105. package/dist/components/custom/dot-flow-field/shaders/flow-field.compute.wgsl.d.ts +1 -1
  106. package/dist/components/custom/dot-flow-field/shaders/flow-field.glsl.d.ts +4 -20
  107. package/dist/components/custom/dot-flow-field/shaders/flow-field.render.wgsl.d.ts +1 -1
  108. package/dist/components/custom/dot-matrix/DotMatrix.vue.d.ts +43 -0
  109. package/dist/components/custom/dot-matrix/composables/dotMatrixField.d.ts +89 -0
  110. package/dist/components/custom/dot-matrix/composables/uniformBridgeWGPU.d.ts +52 -0
  111. package/dist/components/custom/dot-matrix/composables/useDotMatrix.d.ts +34 -0
  112. package/dist/components/custom/dot-matrix/composables/useDotSphere.d.ts +27 -0
  113. package/dist/components/custom/dot-matrix/constants.d.ts +58 -0
  114. package/dist/components/custom/dot-matrix/index.d.ts +5 -0
  115. package/dist/components/custom/dot-matrix/shaders/dot-matrix.glsl.d.ts +4 -0
  116. package/dist/components/custom/dot-matrix/shaders/dot-matrix.wgsl.d.ts +1 -0
  117. package/dist/components/custom/easing/EasingPicker.vue.d.ts +2 -2
  118. package/dist/components/custom/easing/composables/useEasingPicker.d.ts +5 -0
  119. package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +11 -0
  120. package/dist/components/custom/fourier-field/FourierField.vue.d.ts +40 -47
  121. package/dist/components/custom/fourier-field/composables/fourierFieldGLSetup.d.ts +15 -0
  122. package/dist/components/custom/fourier-field/composables/fourierFieldWGPUSetup.d.ts +20 -0
  123. package/dist/components/custom/fourier-field/composables/uniformBridgeWGPU.d.ts +41 -0
  124. package/dist/components/custom/fourier-field/composables/useFourierField.d.ts +40 -37
  125. package/dist/components/custom/fourier-field/constants.d.ts +61 -4
  126. package/dist/components/custom/fourier-field/index.d.ts +23 -18
  127. package/dist/components/custom/fourier-field/shaders/fourier-field.compute.wgsl.d.ts +1 -0
  128. package/dist/components/custom/fourier-field/shaders/fourier-field.glsl.d.ts +4 -0
  129. package/dist/components/custom/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -0
  130. package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +9 -1
  131. package/dist/components/custom/goo-blob/constants.d.ts +1 -1
  132. package/dist/components/custom/goo-blob/index.d.ts +1 -1
  133. package/dist/components/custom/goo-blob/shaders/metaball-noise.wgsl.d.ts +1 -0
  134. package/dist/components/custom/goo-blob/shaders/metaball-palette.wgsl.d.ts +1 -0
  135. package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +1 -1
  136. package/dist/components/custom/goo-blob/shaders/metaball.wgsl.d.ts +1 -1
  137. package/dist/components/custom/goo-blob/types.d.ts +36 -0
  138. package/dist/components/custom/goo-dot-matrix/GooDotMatrix.vue.d.ts +49 -0
  139. package/dist/components/custom/goo-dot-matrix/composables/gooDotLattice.d.ts +24 -0
  140. package/dist/components/custom/goo-dot-matrix/composables/gooDotSetup.d.ts +50 -0
  141. package/dist/components/custom/goo-dot-matrix/composables/uniformBridgeWGPU.d.ts +35 -0
  142. package/dist/components/custom/goo-dot-matrix/composables/useGooDotMatrix.d.ts +31 -0
  143. package/dist/components/custom/goo-dot-matrix/constants.d.ts +76 -0
  144. package/dist/components/custom/goo-dot-matrix/index.d.ts +5 -0
  145. package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.frag.d.ts +11 -0
  146. package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.wgsl.d.ts +3 -0
  147. package/dist/components/custom/labeled-field/LabeledField.vue.d.ts +21 -2
  148. package/dist/components/custom/metric-stack/MetricRow.vue.d.ts +15 -0
  149. package/dist/components/custom/pager-dots/PagerDots.vue.d.ts +9 -0
  150. package/dist/components/custom/pager-dots/index.d.ts +2 -0
  151. package/dist/components/custom/pager-dots/pagerWindow.d.ts +9 -0
  152. package/dist/components/custom/paper-grid/PaperGrid.vue.d.ts +42 -0
  153. package/dist/components/custom/paper-grid/composables/paperGrid.d.ts +90 -0
  154. package/dist/components/custom/paper-grid/composables/paperGridGLSetup.d.ts +16 -0
  155. package/dist/components/custom/paper-grid/composables/paperGridWGPUSetup.d.ts +19 -0
  156. package/dist/components/custom/paper-grid/composables/uniformBridgeWGPU.d.ts +16 -0
  157. package/dist/components/custom/paper-grid/composables/usePaperGrid.d.ts +31 -0
  158. package/dist/components/custom/paper-grid/constants.d.ts +57 -0
  159. package/dist/components/custom/paper-grid/index.d.ts +5 -0
  160. package/dist/components/custom/paper-grid/shaders/paper-grid.glsl.d.ts +4 -0
  161. package/dist/components/custom/paper-grid/shaders/paper-grid.wgsl.d.ts +1 -0
  162. package/dist/components/custom/search/FuzzySearch.vue.d.ts +8 -2
  163. package/dist/components/custom/search/SearchBar.vue.d.ts +8 -0
  164. package/dist/components/custom/search/index.d.ts +2 -0
  165. package/dist/components/custom/search/searchVariants.d.ts +19 -0
  166. package/dist/components/custom/selectable-chip/SelectableChip.vue.d.ts +50 -0
  167. package/dist/components/custom/selectable-chip/index.d.ts +2 -0
  168. package/dist/components/custom/selectable-chip/selectableChipVariants.d.ts +23 -0
  169. package/dist/components/custom/split-chars/SplitChars.vue.d.ts +39 -0
  170. package/dist/components/custom/split-chars/index.d.ts +1 -0
  171. package/dist/components/custom/tabs/SegmentedTabs.vue.d.ts +8 -6
  172. package/dist/components/custom/tabs/constants.d.ts +20 -2
  173. package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +29 -16
  174. package/dist/components/custom/watercolor-dot/useWatercolorBlob.d.ts +10 -5
  175. package/dist/components/ui/_shared/index.d.ts +2 -0
  176. package/dist/components/ui/_shared/useControlSize.d.ts +46 -0
  177. package/dist/components/ui/button/index.d.ts +1 -1
  178. package/dist/components/ui/card/Card.vue.d.ts +45 -0
  179. package/dist/components/ui/card/index.d.ts +1 -1
  180. package/dist/components/ui/carousel/CarouselNext.vue.d.ts +1 -1
  181. package/dist/components/ui/carousel/CarouselPrevious.vue.d.ts +1 -1
  182. package/dist/components/ui/command/CommandDialog.vue.d.ts +9 -3
  183. package/dist/components/ui/command/CommandList.vue.d.ts +3 -0
  184. package/dist/components/ui/context-menu/ContextMenuContent.vue.d.ts +5 -1
  185. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +4 -0
  186. package/dist/components/ui/hover-card/HoverCardContent.vue.d.ts +3 -0
  187. package/dist/components/ui/input/Input.vue.d.ts +3 -0
  188. package/dist/components/ui/number-field/NumberFieldInput.vue.d.ts +6 -1
  189. package/dist/components/ui/select/SelectContent.vue.d.ts +3 -0
  190. package/dist/components/ui/switch/Switch.vue.d.ts +2 -0
  191. package/dist/components/ui/textarea/Textarea.vue.d.ts +3 -0
  192. package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +3 -0
  193. package/dist/composables/color/index.d.ts +2 -0
  194. package/dist/composables/color/useAccentTone.d.ts +34 -0
  195. package/dist/composables/glass/useVizChoreography.d.ts +123 -0
  196. package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +10 -0
  197. package/dist/composables/glass/webgl/shaders/flow.wgsl.d.ts +1 -0
  198. package/dist/composables/glass/webgpu/index.d.ts +1 -1
  199. package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +28 -7
  200. package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +1 -0
  201. package/dist/composables/glass/webgpu/webgpuDevice.d.ts +42 -0
  202. package/dist/composables/motion/core/index.d.ts +3 -0
  203. package/dist/composables/motion/scrollReader.d.ts +25 -0
  204. package/dist/composables/motion/springPresets.d.ts +20 -1
  205. package/dist/composables/motion/useCharStagger.d.ts +44 -0
  206. package/dist/composables/motion/useDockCtaReceive.d.ts +31 -6
  207. package/dist/composables/motion/useScrollChrome.d.ts +58 -0
  208. package/dist/composables/motion/useScrollTrigger.d.ts +67 -0
  209. package/dist/composables/motion/useSpringPress.d.ts +5 -5
  210. package/dist/composables/motion/useStaggerReveal.d.ts +24 -0
  211. package/dist/composables/sidebar/index.d.ts +4 -1
  212. package/dist/composables/sidebar/types.d.ts +68 -3
  213. package/dist/composables/sidebar/useClickDelegate.d.ts +4 -0
  214. package/dist/composables/sidebar/useLazyLoader.d.ts +5 -0
  215. package/dist/composables/sidebar/useScrollTo.d.ts +5 -0
  216. package/dist/composables/virtual/index.d.ts +4 -0
  217. package/dist/composables/virtual/useVirtualSectionWindow.d.ts +72 -0
  218. package/dist/composables/virtual/useWindowedStore.d.ts +43 -0
  219. package/dist/composables/virtual/virtualSectionLayout.d.ts +103 -0
  220. package/dist/concentric.js +495 -221
  221. package/dist/configurator.js +2 -2
  222. package/dist/confirm-dialog.js +62 -47
  223. package/dist/constellation.js +635 -235
  224. package/dist/context-menu.js +2 -2
  225. package/dist/controls.js +1 -1
  226. package/dist/createCanvasLifecycle-Gh45Ce-p.js +93 -0
  227. package/dist/dark.js +1 -1
  228. package/dist/data-table.js +1 -1
  229. package/dist/deck.d.ts +1 -0
  230. package/dist/deck.js +105 -0
  231. package/dist/dialog.js +4 -3
  232. package/dist/dock.js +602 -458
  233. package/dist/dot-flow-field.js +580 -290
  234. package/dist/dot-matrix.d.ts +1 -0
  235. package/dist/dot-matrix.js +630 -0
  236. package/dist/dotMatrixField-D_x9_1qq.js +48 -0
  237. package/dist/{dropdown-menu-CofSZuk8.js → dropdown-menu-aJmV5SqE.js} +83 -79
  238. package/dist/dropdown-menu.js +1 -1
  239. package/dist/easing.js +188 -176
  240. package/dist/expandable-container.js +42 -20
  241. package/dist/fading-scroll.js +1 -1
  242. package/dist/flow.glsl-B2P7e0MT.js +4 -0
  243. package/dist/forms.js +62 -60
  244. package/dist/fourier-field.js +825 -178
  245. package/dist/fourier-math.js +1 -1
  246. package/dist/glass-ui.css +1 -1
  247. package/dist/glass-ui.js +145 -104
  248. package/dist/goo-blob.js +171 -1228
  249. package/dist/goo-dot-matrix.d.ts +1 -0
  250. package/dist/goo-dot-matrix.js +591 -0
  251. package/dist/handmark.js +1 -1
  252. package/dist/hover-card.js +1 -1
  253. package/dist/hover-popover.js +1 -1
  254. package/dist/icon-chip.js +1 -1
  255. package/dist/icon-tooltip.js +1 -1
  256. package/dist/index.d.ts +2 -0
  257. package/dist/instrument-chassis.js +1 -1
  258. package/dist/keyboard.js +1 -1
  259. package/dist/labeled-field.js +70 -60
  260. package/dist/metric-cell.js +1 -1
  261. package/dist/metric-stack.js +11 -2
  262. package/dist/motion-core.js +54 -32
  263. package/dist/motion-curves.js +11 -1
  264. package/dist/motion.js +46 -111
  265. package/dist/notification.js +1 -1
  266. package/dist/number-field.js +1 -1
  267. package/dist/pager-dots.js +2 -91
  268. package/dist/paper-backdrop.js +1 -1
  269. package/dist/paper-grid.d.ts +1 -0
  270. package/dist/paper-grid.js +788 -0
  271. package/dist/{presets-BW2b-fr1.js → presets-CvOUqtdY.js} +3 -3
  272. package/dist/{procedural-color.glsl-CIFsJhwI.js → procedural-color.wgsl-m7Zgv35j.js} +2 -2
  273. package/dist/progress.js +1 -1
  274. package/dist/pulse.js +1 -1
  275. package/dist/reactive.js +1 -1
  276. package/dist/{useCanvas2D-B8w_E3Rr.js → resolveCanvasColor-yPyIpJt9.js} +12 -2
  277. package/dist/scrollReader-DI1NWxUw.js +42 -0
  278. package/dist/scrolling-text.js +1 -1
  279. package/dist/search.js +160 -304
  280. package/dist/select.js +3 -3
  281. package/dist/selectable-chip.d.ts +1 -0
  282. package/dist/selectable-chip.js +65 -0
  283. package/dist/separator.js +1 -1
  284. package/dist/{sheet-tZMg0E0w.js → sheet-B2flBfLH.js} +2 -2
  285. package/dist/sheet.js +1 -1
  286. package/dist/sidebar.js +216 -114
  287. package/dist/slider.js +1 -1
  288. package/dist/sortable-list.js +1 -1
  289. package/dist/spectrum-walk-BVzA7Biz.js +33 -0
  290. package/dist/{springPresets-CFQGQfdl.js → springPresets-Ce7OYCm9.js} +12 -6
  291. package/dist/styles/animations.css +13 -3
  292. package/dist/styles/cards.css +69 -0
  293. package/dist/styles/completion-seal.css +131 -0
  294. package/dist/styles/components.css +2 -3
  295. package/dist/styles/configurator.css +55 -0
  296. package/dist/styles/critical-partition.mjs +33 -11
  297. package/dist/styles/deferred.css +2 -0
  298. package/dist/styles/dock/cta-seat.css +87 -0
  299. package/dist/styles/dock/density.css +153 -0
  300. package/dist/styles/dock/layers.css +55 -7
  301. package/dist/styles/dock/morph-bridge.css +54 -18
  302. package/dist/styles/dock/morph.css +41 -33
  303. package/dist/styles/dock/overflow.css +12 -0
  304. package/dist/styles/dock/search.css +68 -0
  305. package/dist/styles/dock/shape.css +124 -0
  306. package/dist/styles/dock/shell.css +23 -5
  307. package/dist/styles/dock/stack-rail.css +264 -0
  308. package/dist/styles/dock-controls/dark-mode-toggle.css +17 -4
  309. package/dist/styles/dock-controls/icon-button.css +14 -0
  310. package/dist/styles/dock.css +11 -1
  311. package/dist/styles/glass/accent-tone.css +66 -0
  312. package/dist/styles/glass/control-surfaces.css +167 -0
  313. package/dist/styles/glass/ladder.css +67 -17
  314. package/dist/styles/glass/rim.css +19 -9
  315. package/dist/styles/glass/surfaces.css +69 -148
  316. package/dist/styles/glass.css +10 -0
  317. package/dist/styles/index.css +15 -0
  318. package/dist/styles/scroll-chrome.css +123 -0
  319. package/dist/styles/scroll-driven.css +38 -0
  320. package/dist/styles/segmented-tabs.css +50 -14
  321. package/dist/styles/theme/bridges.css +22 -0
  322. package/dist/styles/theme/radius.css +18 -1
  323. package/dist/styles/tokens/color-radius.css +13 -3
  324. package/dist/styles/tokens/dark-arm.css +39 -6
  325. package/dist/styles/tokens/glass-deep.css +28 -3
  326. package/dist/styles/tokens/glass-fx.css +44 -1
  327. package/dist/styles/tokens/glass.css +91 -31
  328. package/dist/styles/tokens/light-dark.css +1 -1
  329. package/dist/styles/tokens/offsets.css +27 -0
  330. package/dist/styles/tokens/property-regs.css +133 -0
  331. package/dist/styles/tokens/scale-paper.css +73 -29
  332. package/dist/styles/tokens/scheme-motion.css +44 -6
  333. package/dist/styles/tokens/sizing-config.css +110 -0
  334. package/dist/styles/tokens/sizing.css +55 -104
  335. package/dist/styles/tokens.css +5 -0
  336. package/dist/styles/typography/semantic.css +18 -5
  337. package/dist/styles/utilities/a11y-overrides.css +20 -5
  338. package/dist/styles/utilities/base-misc.css +52 -0
  339. package/dist/styles/utilities/btn.css +14 -3
  340. package/dist/styles/utilities/components.css +31 -6
  341. package/dist/styles/utilities/metal.css +26 -0
  342. package/dist/switch.js +1 -1
  343. package/dist/tabs.js +8 -8
  344. package/dist/timeline.js +1 -1
  345. package/dist/toast.js +1 -1
  346. package/dist/toggle-chip.js +10 -10
  347. package/dist/toggle-group.js +1 -1
  348. package/dist/tooltip.js +1 -1
  349. package/dist/typewriter.js +1 -1
  350. package/dist/uniformBridgeWGPU-CtAKl45L.js +1204 -0
  351. package/dist/{useAnimatedNumber-BfUq2bUM.js → useAnimatedNumber-CLrxicG9.js} +1 -1
  352. package/dist/{useConfiguratorState-DNlOh6c8.js → useConfiguratorState-4xblKfwd.js} +25 -24
  353. package/dist/useControlSize-SH1UmJCi.js +9 -0
  354. package/dist/useDockCtaReceive-DfFkmgL1.js +82 -0
  355. package/dist/{useDragMorph-DgxnsVJz.js → useDragMorph-BUgAC-zK.js} +4 -4
  356. package/dist/useFuzzySearch-DIhcYtcw.js +177 -0
  357. package/dist/useGpuSubstrate-4pTcp6mX.js +294 -0
  358. package/dist/{useLiquidPress-kfb4KX79.js → useLiquidPress-BooG97RY.js} +2 -2
  359. package/dist/usePointerVelocityField-QLsy3_kv.js +91 -0
  360. package/dist/useScrollChrome-D66AVP7C.js +258 -0
  361. package/dist/{useSpringMount-q1amq1SJ.js → useSpringMount-BWDnKIwh.js} +1 -1
  362. package/dist/useSpringPress-B1-Czp-V.js +36 -0
  363. package/dist/useViewTransition-CUI1nAgn.js +95 -0
  364. package/dist/{vendor-CKmzio-i.js → vendor-B2qOlYY3.js} +24 -11
  365. package/dist/virtual.d.ts +1 -0
  366. package/dist/virtual.js +225 -0
  367. package/dist/watercolor-dot.js +116 -73
  368. package/package.json +127 -7
  369. package/src/styles/animations.css +13 -3
  370. package/src/styles/cards.css +69 -0
  371. package/src/styles/completion-seal.css +131 -0
  372. package/src/styles/configurator.css +55 -0
  373. package/src/styles/critical-partition.mjs +33 -11
  374. package/src/styles/dock/cta-seat.css +87 -0
  375. package/src/styles/dock/density.css +153 -0
  376. package/src/styles/dock/layers.css +55 -7
  377. package/src/styles/dock/morph-bridge.css +54 -18
  378. package/src/styles/dock/morph.css +41 -33
  379. package/src/styles/dock/overflow.css +12 -0
  380. package/src/styles/dock/search.css +68 -0
  381. package/src/styles/dock/shape.css +124 -0
  382. package/src/styles/dock/shell.css +23 -5
  383. package/src/styles/dock/stack-rail.css +264 -0
  384. package/src/styles/dock-controls/dark-mode-toggle.css +17 -4
  385. package/src/styles/dock-controls/icon-button.css +14 -0
  386. package/src/styles/dock.css +11 -1
  387. package/src/styles/glass/accent-tone.css +66 -0
  388. package/src/styles/glass/control-surfaces.css +167 -0
  389. package/src/styles/glass/ladder.css +67 -17
  390. package/src/styles/glass/rim.css +19 -9
  391. package/src/styles/glass/surfaces.css +69 -148
  392. package/src/styles/glass.css +10 -0
  393. package/src/styles/index.css +15 -0
  394. package/src/styles/scroll-chrome.css +123 -0
  395. package/src/styles/scroll-driven.css +38 -0
  396. package/src/styles/segmented-tabs.css +50 -14
  397. package/src/styles/theme/bridges.css +22 -0
  398. package/src/styles/theme/radius.css +18 -1
  399. package/src/styles/tokens/color-radius.css +13 -3
  400. package/src/styles/tokens/dark-arm.css +39 -6
  401. package/src/styles/tokens/glass-deep.css +28 -3
  402. package/src/styles/tokens/glass-fx.css +44 -1
  403. package/src/styles/tokens/glass.css +91 -31
  404. package/src/styles/tokens/light-dark.css +1 -1
  405. package/src/styles/tokens/offsets.css +27 -0
  406. package/src/styles/tokens/property-regs.css +133 -0
  407. package/src/styles/tokens/scale-paper.css +73 -29
  408. package/src/styles/tokens/scheme-motion.css +44 -6
  409. package/src/styles/tokens/sizing-config.css +110 -0
  410. package/src/styles/tokens/sizing.css +55 -104
  411. package/src/styles/tokens.css +5 -0
  412. package/src/styles/typography/semantic.css +18 -5
  413. package/src/styles/utilities/a11y-overrides.css +20 -5
  414. package/src/styles/utilities/base-misc.css +52 -0
  415. package/src/styles/utilities/btn.css +14 -3
  416. package/src/styles/utilities/components.css +31 -6
  417. package/src/styles/utilities/metal.css +26 -0
  418. package/dist/ContextMenuContent-uWnVxDab.js +0 -85
  419. package/dist/DialogFooter-BZNX5aVr.js +0 -165
  420. package/dist/HoverCardContent-b2uaAMRR.js +0 -83
  421. package/dist/Input-h9v5LeXf.js +0 -55
  422. package/dist/NumberFieldContent-Cq7EzX-U.js +0 -138
  423. package/dist/Separator-pKF0oA4M.js +0 -37
  424. package/dist/Switch-CwYNf8bo.js +0 -47
  425. package/dist/TooltipProvider-rzvnXz60.js +0 -104
  426. package/dist/color-DweYl7pE.js +0 -86
  427. package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +0 -35
  428. package/dist/components/custom/constellation/constellationDraw.d.ts +0 -30
  429. package/dist/components/custom/dock/DockRail.vue.d.ts +0 -89
  430. package/dist/createCanvasLifecycle-CHD5XrDW.js +0 -82
  431. package/dist/procedural-color.wgsl-CToRHugY.js +0 -224
  432. package/dist/resolveCanvasColor-CUyHr5Uu.js +0 -11
  433. package/dist/styles/dock/rail-extend.css +0 -397
  434. package/dist/usePointerVelocityField-JbRd5CrM.js +0 -137
  435. package/dist/useRAFLoop-UYa4zoiN.js +0 -109
  436. package/dist/useSpringPress-BsqPr7FJ.js +0 -34
  437. package/src/styles/dock/rail-extend.css +0 -397
  438. /package/dist/{FadingScroll-DI6hQhT9.js → FadingScroll-DLRbH5Xr.js} +0 -0
  439. /package/dist/{HoverPopover-CbqbNwgU.js → HoverPopover-BcIxvyqZ.js} +0 -0
  440. /package/dist/{InstrumentChassis-Bx0F_q5g.js → InstrumentChassis-CxsHSyMj.js} +0 -0
  441. /package/dist/{PaperBackdrop-Vf3tlpvd.js → PaperBackdrop-CqwjnfLv.js} +0 -0
  442. /package/dist/{Progress-DctG61iZ.js → Progress-CnqB7gLm.js} +0 -0
  443. /package/dist/{ScrollingText-yOpBzFYq.js → ScrollingText-CTZbA_cG.js} +0 -0
  444. /package/dist/{SelectGroup-DwwjicPY.js → SelectGroup-BFiod7X2.js} +0 -0
  445. /package/dist/{compile-CQEFRTmx.js → compile-nZ1xVYTp.js} +0 -0
  446. /package/dist/{constants-BPOqYJAm.js → constants--C2DkLW8.js} +0 -0
  447. /package/dist/{math-BINYmg5z.js → math-Eb0w3LqU.js} +0 -0
  448. /package/dist/{prng-Za0Rmgag.js → prng-B-d9eYX8.js} +0 -0
  449. /package/dist/{slider-DVb4HXU-.js → slider-2A0rPn79.js} +0 -0
  450. /package/dist/{useGlobalDark-C28t0VWJ.js → useGlobalDark-CmjB9E32.js} +0 -0
  451. /package/dist/{useIntersectionPause-Bj4sPkMh.js → useIntersectionPause-Dbozzjgm.js} +0 -0
  452. /package/dist/{useInterval-CvK1mL92.js → useInterval-CNdua40W.js} +0 -0
  453. /package/dist/{useKeyboardShortcuts-BXWXOZ-9.js → useKeyboardShortcuts-BPRp33Im.js} +0 -0
  454. /package/dist/{useLiquidFlex-mZPMiNXh.js → useLiquidFlex-UmA6LMZu.js} +0 -0
  455. /package/dist/{useScrollProgress-D7bYU2RK.js → useScrollProgress-c3yxmH6a.js} +0 -0
  456. /package/dist/{useSortable-DHjtZSEd.js → useSortable-BVqlJRBR.js} +0 -0
  457. /package/dist/{useTextHighlight-CWEi25hf.js → useTextHighlight-NmBM5V_4.js} +0 -0
  458. /package/dist/{vReveal-Czsb7zQC.js → vReveal-D9k0jADx.js} +0 -0
  459. /package/dist/{vSpecular-CQFmLNzA.js → vSpecular-EX7loENl.js} +0 -0
@@ -1,180 +1,771 @@
1
- import { t as e } from "./useCanvas2D-B8w_E3Rr.js";
2
- import { t } from "./_plugin-vue_export-helper-C1je1s0u.js";
3
- import { i as n, s as r, t as i } from "./color-DweYl7pE.js";
4
- import { t as a } from "./useGlobalDark-C28t0VWJ.js";
5
- import { n as o, t as s } from "./prng-Za0Rmgag.js";
6
- import { a as c, i as l, n as u, r as d, t as f } from "./math-BINYmg5z.js";
7
- import { createElementBlock as p, createElementVNode as m, defineComponent as h, onMounted as g, openBlock as _, ref as v, useTemplateRef as y, watch as b } from "vue";
8
- //#region src/components/custom/fourier-field/presets.ts
9
- var x = {
10
- hero: {
11
- harmonics: 5,
12
- harmonicScale: .24,
13
- epicycles: !0,
14
- trailLength: 260,
15
- epicycleHueShift: 42,
16
- durationMs: 16e3,
17
- frozenSeed: "fourier-field/hero",
18
- frozenT: .34,
19
- peakAlpha: .92,
20
- trailWidth: 3,
21
- headGlowAlpha: .95,
22
- headGlowBlur: 18,
23
- headDotRadius: 5,
24
- epicycleRatios: {
25
- circle: .5,
26
- arm: .72
27
- },
28
- epicycleWidths: {
29
- circle: 2.4,
30
- arm: 2
31
- },
32
- epicycleRainbow: !0,
33
- trailFadeExp: 1.35,
34
- trailFloor: .34
35
- },
36
- final: {
37
- harmonics: 11,
38
- harmonicScale: .17,
39
- epicycles: !1,
40
- trailLength: 360,
41
- epicycleHueShift: 36,
42
- durationMs: 21e3,
43
- frozenSeed: "fourier-field/final",
44
- frozenT: .42,
45
- peakAlpha: .88,
46
- trailWidth: 3.2,
47
- headGlowAlpha: .92,
48
- headGlowBlur: 16,
49
- headDotRadius: 4.5,
50
- epicycleRatios: {
51
- circle: 0,
52
- arm: 0
53
- },
54
- epicycleWidths: {
55
- circle: 0,
56
- arm: 0
57
- },
58
- epicycleRainbow: !1,
59
- trailFadeExp: 1.45,
60
- trailFloor: .36
61
- }
1
+ import { t as e } from "./_plugin-vue_export-helper-C1je1s0u.js";
2
+ import { n as t } from "./useResolveTokenColor-vAylyR0x.js";
3
+ import { t as n } from "./usePointerVelocityField-QLsy3_kv.js";
4
+ import { n as r, o as i, r as a, s as o } from "./procedural-color.wgsl-m7Zgv35j.js";
5
+ import { a as s, t as c } from "./useGpuSubstrate-4pTcp6mX.js";
6
+ import { c as l, t as u } from "./color-Cs0-oxYL.js";
7
+ import { t as d } from "./useGlobalDark-CmjB9E32.js";
8
+ import { n as f, t as p } from "./prng-B-d9eYX8.js";
9
+ import { a as m, i as h, n as g, r as _, t as v } from "./math-Eb0w3LqU.js";
10
+ import { computed as y, createElementBlock as b, createElementVNode as x, defineComponent as S, normalizeClass as C, onMounted as w, onScopeDispose as T, openBlock as E, shallowRef as D, useTemplateRef as O, watch as k } from "vue";
11
+ //#region src/components/custom/fourier-field/constants.ts
12
+ var A = 64, j = 384, M = [{
13
+ L: .62,
14
+ C: .19,
15
+ h: 34
16
+ }, {
17
+ L: .86,
18
+ C: .06,
19
+ h: 70
20
+ }], N = {
21
+ source: "elliptic",
22
+ harmonics: 6,
23
+ showEpicycles: !0,
24
+ epicycleArms: 6,
25
+ rainbowChain: !0,
26
+ trailArc: .43,
27
+ trailWidth: 3,
28
+ intensity: 1,
29
+ harmonicScale: .24,
30
+ speed: 1,
31
+ palette: M,
32
+ respectReducedMotion: !0,
33
+ interactive: !0
34
+ }, P = "\nconst MAX_PHASORS: i32 = 64;\nconst TAU: f32 = 6.283185307179586;\n\nstruct Phasor {\n // (re, im, index, _pad)\n data: vec4<f32>,\n};\n\n// ── Compute uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──\nstruct ComputeUniforms {\n // c0: (headT, trailArc, _pad, _pad)\n c0: vec4<f32>,\n // ints: (harmonicN, epicycleArmN, sampleCount, phasorCount)\n ints: vec4<i32>,\n};\n\n@group(0) @binding(0) var<uniform> u: ComputeUniforms;\n@group(0) @binding(1) var<storage, read> phasors: array<Phasor>;\n// curveSamples[i] = (x, y, age, _pad)\n@group(0) @binding(2) var<storage, read_write> curveSamples: array<vec4<f32>>;\n// chainTips[k] = (x, y, _pad, _pad) — the running tip after stacking phasor k\n@group(0) @binding(3) var<storage, read_write> chainTips: array<vec4<f32>>;\n\n// The PARTIAL-SUM curve point at parameter t over the first n phasors — the WGSL\n// transcription of math.ts:78-95 (partialSumAt). EXACTLY:\n// c += vec2(re·cos − im·sin, re·sin + im·cos) with angle = TAU·index·t.\nfn partialSumAt(t: f32, n: i32) -> vec2<f32> {\n var c = vec2<f32>(0.0, 0.0);\n let phasorCount = u.ints.w;\n let lim = min(n, phasorCount);\n for (var i = 0; i < MAX_PHASORS; i = i + 1) {\n if (i >= lim) { break; }\n let p = phasors[i].data;\n let re = p.x;\n let im = p.y;\n let index = p.z;\n let angle = TAU * index * t;\n let cs = cos(angle);\n let sn = sin(angle);\n c = c + vec2<f32>(re * cs - im * sn, re * sn + im * cs);\n }\n return c;\n}\n\n// The epicycle chain tip after stacking the first k phasors at head_t — the WGSL\n// transcription of math.ts:41-60 (positionsAt, read at the running tip). The running tip\n// after phasor (k−1) is exactly the partial sum over the first k terms.\nfn epicycleChainTip(t: f32, k: i32) -> vec2<f32> {\n return partialSumAt(t, k);\n}\n\n@compute @workgroup_size(64)\nfn cs_main(@builtin(global_invocation_id) gid: vec3<u32>) {\n let i = i32(gid.x);\n let headT = u.c0.x;\n let trailArc = u.c0.y;\n let harmonicN = u.ints.x;\n let armN = u.ints.y;\n let sampleCount = u.ints.z;\n\n // ── The comet body samples ──\n if (i < sampleCount) {\n // age: 0 at the oldest tail (i = sampleCount−1), 1 at the head (i = 0).\n let denom = max(f32(sampleCount - 1), 1.0);\n let frac = f32(i) / denom; // 0 = head, 1 = tail\n let age = 1.0 - frac; // 1 = head, 0 = tail\n // sample back along the period from the head by trailArc.\n var t = headT - trailArc * frac;\n t = t - floor(t); // fract → [0,1)\n let pt = partialSumAt(t, harmonicN);\n curveSamples[i] = vec4<f32>(pt.x, pt.y, age, 0.0);\n }\n\n // ── The epicycle chain tips (k = 0..armN, capped to harmonicN) ──\n // chainTips[0] is the origin; chainTips[k] is the tip after phasor (k−1).\n let armLim = min(armN, harmonicN);\n if (i <= armLim && i <= MAX_PHASORS) {\n let tip = epicycleChainTip(headT, i);\n chainTips[i] = vec4<f32>(tip.x, tip.y, 0.0, 0.0);\n }\n}\n", F = `
35
+ const PI: f32 = 3.141592653589793;
36
+ const TAU: f32 = 6.283185307179586;
37
+ const MAX_CURVE_SAMPLES: i32 = 384;
38
+ const MAX_PHASORS: i32 = 64;
39
+ const MAX_FOURIER_STOPS: i32 = 4;
40
+
41
+ // ── Render uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──
42
+ struct RenderUniforms {
43
+ // r0: (centerX, centerY, scale, aspect) — model→clip fit transform
44
+ r0: vec4<f32>,
45
+ // r1: (trailWidth, peakAlpha, headGlowAlpha, trailFadeExp)
46
+ r1: vec4<f32>,
47
+ // r2: (trailFloor, intensity, showEpicycles, rainbowChain)
48
+ r2: vec4<f32>,
49
+ // ints: (sampleCount, armCount, stopCount, _pad)
50
+ ints: vec4<i32>,
51
+ // palette stops: linear-sRGB rgb + _pad
52
+ palette: array<vec4<f32>, 4>,
62
53
  };
63
- //#endregion
64
- //#region src/components/custom/fourier-field/composables/useFourierField.ts
65
- function S(t, { hostRef: l, canvasRef: u }) {
66
- let { variant: f, colorResolver: p, seed: m, freeze: h, intensity: _, clock: y } = t, S = Math.max(0, Math.min(2, _)), C = v(t.color), w = v("rgb(0, 0, 0)"), T = v("rgb(0, 0, 0)"), E = v([]);
67
- function D(e) {
68
- if (!e.includes("var(") && !e.includes("light-dark(")) return e;
69
- let t = l.value;
70
- if (typeof window > "u" || !t) return e;
71
- let n = t.style.color;
72
- t.style.color = e;
73
- let r = getComputedStyle(t).color;
74
- return t.style.color = n, r || e;
54
+
55
+ @group(0) @binding(0) var<uniform> u: RenderUniforms;
56
+ // curveSamples[i] = (x, y, age, _pad) in MODEL space
57
+ @group(0) @binding(1) var<storage, read> curveSamples: array<vec4<f32>>;
58
+ // chainTips[k] = (x, y, _pad, _pad) in MODEL space
59
+ @group(0) @binding(2) var<storage, read> chainTips: array<vec4<f32>>;
60
+
61
+ ${r}
62
+ ${a}
63
+
64
+ // Sample the multi-stop palette (linear-sRGB stops, OKLab mix). t in [0,1].
65
+ fn samplePaletteLin(t: f32) -> vec3<f32> {
66
+ let stopCount = u.ints.z;
67
+ if (stopCount <= 1) { return u.palette[0].rgb; }
68
+ let n = f32(stopCount);
69
+ let ft = clamp(t, 0.0, 1.0) * (n - 1.0);
70
+ let i0 = i32(floor(ft));
71
+ let i1 = min(i0 + 1, stopCount - 1);
72
+ let f = ft - f32(i0);
73
+ let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i0].rgb);
74
+ let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i1].rgb);
75
+ return oklabToLinearSrgb(mix(labA, labB, f));
76
+ }
77
+
78
+ // A warm-anchored chain hue sweep over the palette base — the rainbow chain register.
79
+ // Tilts the base hue by a tight warm-ward band so the chain stays colourful but warm.
80
+ fn chainColorLin(seg: f32, rainbow: bool) -> vec3<f32> {
81
+ let baseLin = u.palette[0].rgb;
82
+ if (!rainbow) { return baseLin; }
83
+ let lab = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * baseLin);
84
+ let lch = oklabToOklch(lab);
85
+ // warm-anchored: a touch cool at the root climbing warm toward the tips.
86
+ let hueShift = mix(-0.45, 1.15, clamp(seg, 0.0, 1.0)); // radians (~ -26°..+66°)
87
+ let h = lch.z + hueShift;
88
+ let lifted = vec3<f32>(0.66, max(lch.y, 0.14), h);
89
+ return oklabToLinearSrgb(oklchToOklab(lifted));
90
+ }
91
+
92
+ // Distance from point p to segment ab (model space).
93
+ fn segDist(p: vec2<f32>, a: vec2<f32>, b: vec2<f32>) -> f32 {
94
+ let pa = p - a;
95
+ let ba = b - a;
96
+ let h = clamp(dot(pa, ba) / max(dot(ba, ba), 1e-8), 0.0, 1.0);
97
+ return length(pa - ba * h);
98
+ }
99
+
100
+ struct VSOut {
101
+ @builtin(position) pos: vec4<f32>,
102
+ @location(0) model: vec2<f32>, // model-space coordinate of this fragment
103
+ };
104
+
105
+ @vertex
106
+ fn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {
107
+ // Full-screen triangle (covers the viewport with 3 verts).
108
+ var p = array<vec2<f32>, 3>(
109
+ vec2<f32>(-1.0, -3.0), vec2<f32>(-1.0, 1.0), vec2<f32>(3.0, 1.0),
110
+ );
111
+ let clip = p[vi];
112
+ // Inverse of the model→clip fit: clip = (model − center)·scale, aspect-corrected x.
113
+ // → model = center + clip·(1/scale), x un-aspect-corrected.
114
+ let center = u.r0.xy;
115
+ let scale = max(u.r0.z, 1e-6);
116
+ let aspect = max(u.r0.w, 1e-4);
117
+ let model = center + vec2<f32>(clip.x * aspect, clip.y) / scale;
118
+
119
+ var out: VSOut;
120
+ out.pos = vec4<f32>(clip, 0.0, 1.0);
121
+ out.model = model;
122
+ return out;
123
+ }
124
+
125
+ @fragment
126
+ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
127
+ let p = in.model;
128
+ // AA feather: one device pixel in model units (fwidth of the model coord).
129
+ let aa = max(fwidth(p.x) + fwidth(p.y), 1e-5) * 0.75;
130
+
131
+ let trailWidth = u.r1.x; // already in model units (packed CPU-side)
132
+ let peak = u.r1.y * u.r2.y; // peakAlpha · intensity
133
+ let headGlow = u.r1.z * u.r2.y;
134
+ let fadeExp = u.r1.w;
135
+ let trailFloor = u.r2.x;
136
+ let sampleCount = u.ints.x;
137
+ let armCount = u.ints.y;
138
+ let showEpicycles = u.r2.z > 0.5;
139
+ let rainbow = u.r2.w > 0.5;
140
+ let halfW = trailWidth * 0.5;
141
+
142
+ var accum = vec4<f32>(0.0); // premultiplied accumulation
143
+
144
+ // ── Epicycle scaffolding (orbit rings + arms + joint dots) UNDER the curve ──
145
+ if (showEpicycles && armCount >= 1) {
146
+ for (var k = 0; k < MAX_PHASORS; k = k + 1) {
147
+ if (k >= armCount) { break; }
148
+ let a = chainTips[k].xy;
149
+ let b = chainTips[k + 1].xy;
150
+ let seg = f32(k) / max(f32(armCount - 1), 1.0);
151
+ let lin = chainColorLin(seg, rainbow);
152
+ // orbit RING around a (radius = arm length).
153
+ let radius = length(b - a);
154
+ let dRing = abs(length(p - a) - radius);
155
+ let ringW = max(halfW * 0.45, aa);
156
+ let ringMask = (1.0 - smoothstep(ringW, ringW + aa, dRing)) * 0.5;
157
+ // ARM segment a→b.
158
+ let dArm = segDist(p, a, b);
159
+ let armMask = 1.0 - smoothstep(halfW * 0.55, halfW * 0.55 + aa, dArm);
160
+ // joint DOT at a.
161
+ let dotR = max(halfW * 0.7, aa * 2.0);
162
+ let dDot = length(p - a);
163
+ let dotMask = 1.0 - smoothstep(dotR, dotR + aa, dDot);
164
+ let m = clamp(max(max(ringMask, armMask), dotMask), 0.0, 1.0) * peak * 0.7;
165
+ let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));
166
+ // over-composite (premultiplied).
167
+ accum = vec4<f32>(rgb * m, m) + accum * (1.0 - m);
168
+ }
169
+ }
170
+
171
+ // ── The comet TRAIL — min-distance to the curve polyline, per-segment age fade ──
172
+ for (var i = 0; i < MAX_CURVE_SAMPLES; i = i + 1) {
173
+ if (i >= sampleCount - 1) { break; }
174
+ let sa = curveSamples[i];
175
+ let sb = curveSamples[i + 1];
176
+ let d = segDist(p, sa.xy, sb.xy);
177
+ let cover = 1.0 - smoothstep(halfW, halfW + aa, d);
178
+ if (cover < 0.002) { continue; }
179
+ let age = max(sa.z, sb.z); // 1 at head, 0 at tail
180
+ var a = peak * pow(age, fadeExp);
181
+ a = max(a, peak * trailFloor);
182
+ a = a * cover;
183
+ let lin = samplePaletteLin(1.0 - age * 0.4); // warm core, lighter tail
184
+ let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));
185
+ accum = vec4<f32>(rgb * a, a) + accum * (1.0 - a);
186
+ }
187
+
188
+ // ── The comet HEAD — halo + saturated core + white specular at curveSamples[0] ──
189
+ if (sampleCount >= 1) {
190
+ let head = curveSamples[0].xy;
191
+ let dHead = length(p - head);
192
+ let coreR = halfW * 1.5;
193
+ let haloR = coreR * 3.0;
194
+ let headLin = samplePaletteLin(0.0);
195
+ let headRgb = clamp(linearToSrgb(headLin), vec3<f32>(0.0), vec3<f32>(1.0));
196
+ // soft halo
197
+ let halo = (1.0 - smoothstep(0.0, haloR, dHead)) * headGlow * 0.35;
198
+ accum = vec4<f32>(headRgb * halo, halo) + accum * (1.0 - halo);
199
+ // saturated core
200
+ let core = (1.0 - smoothstep(coreR, coreR + aa, dHead)) * headGlow;
201
+ accum = vec4<f32>(headRgb * core, core) + accum * (1.0 - core);
202
+ // white specular
203
+ let spec = (1.0 - smoothstep(coreR * 0.4, coreR * 0.4 + aa, dHead)) * headGlow * 0.9;
204
+ accum = vec4<f32>(vec3<f32>(1.0) * spec, spec) + accum * (1.0 - spec);
205
+ }
206
+
207
+ return accum;
208
+ }
209
+ `, I = {
210
+ c0: 0,
211
+ ints: 4
212
+ };
213
+ function L() {
214
+ let e = /* @__PURE__ */ new ArrayBuffer(32);
215
+ return {
216
+ buffer: e,
217
+ f32: new Float32Array(e),
218
+ i32: new Int32Array(e)
219
+ };
220
+ }
221
+ function R(e, t, n, r, i, a, o) {
222
+ let { f32: s, i32: c } = e;
223
+ return s[I.c0 + 0] = t, s[I.c0 + 1] = n, s[I.c0 + 2] = 0, s[I.c0 + 3] = 0, c[I.ints + 0] = r, c[I.ints + 1] = i, c[I.ints + 2] = a, c[I.ints + 3] = o, e;
224
+ }
225
+ var z = 128, B = {
226
+ r0: 0,
227
+ r1: 4,
228
+ r2: 8,
229
+ ints: 12,
230
+ palette: 16
231
+ };
232
+ function V() {
233
+ let e = new ArrayBuffer(z);
234
+ return {
235
+ buffer: e,
236
+ f32: new Float32Array(e),
237
+ i32: new Int32Array(e)
238
+ };
239
+ }
240
+ function H(e) {
241
+ let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity, a = e;
242
+ for (let e = 0; e < 720; e++) {
243
+ let o = m(a, e / 720), [s, c] = o[o.length - 1];
244
+ s < t && (t = s), c < n && (n = c), s > r && (r = s), c > i && (i = c);
75
245
  }
76
- let O = x[f], k = 0;
77
- function A() {
78
- C.value = D(t.color);
79
- let [e, a, o] = p(C.value).map((e) => Math.round(e * 255));
80
- w.value = `rgb(${e}, ${a}, ${o})`;
81
- let s = i(C.value), [c, l, u] = r({
82
- L: s.L,
83
- C: s.C,
84
- h: n(s.h, "analogous", O.epicycleHueShift, 1)
85
- }).map((e) => Math.round(e * 255));
86
- if (T.value = `rgb(${c}, ${l}, ${u})`, O.epicycleRainbow && k > 0) {
87
- let e = [];
88
- for (let t = 0; t < k; t++) {
89
- let n = k > 1 ? t / (k - 1) : 0, [i, a, o] = r({
90
- L: .62,
91
- C: .17,
92
- h: s.h + -30 + n * 100
93
- }).map((e) => Math.round(e * 255));
94
- e.push(`rgb(${i}, ${a}, ${o})`);
95
- }
96
- E.value = e;
97
- } else E.value = [];
246
+ if (!isFinite(t)) return {
247
+ centerX: 0,
248
+ centerY: 0,
249
+ scale: 1
250
+ };
251
+ let o = Math.max(.001, r - t), s = Math.max(.001, i - n), c = 2 * .82 / Math.max(o, s);
252
+ return {
253
+ centerX: (t + r) / 2,
254
+ centerY: (n + i) / 2,
255
+ scale: c
256
+ };
257
+ }
258
+ function U(e, t, n) {
259
+ let r = Math.max(n, 1) / 2;
260
+ return e / Math.max(t, 1e-6) / r;
261
+ }
262
+ function W(e, t, n, r, i, a, o, s, c, u, d, f, p, m) {
263
+ let { f32: h, i32: g } = e;
264
+ h[B.r0 + 0] = t.centerX, h[B.r0 + 1] = t.centerY, h[B.r0 + 2] = t.scale, h[B.r0 + 3] = n, h[B.r1 + 0] = r, h[B.r1 + 1] = i, h[B.r1 + 2] = a, h[B.r1 + 3] = o, h[B.r2 + 0] = s, h[B.r2 + 1] = c, h[B.r2 + 2] = +!!u, h[B.r2 + 3] = +!!d;
265
+ let _ = Math.min(m.length, 4);
266
+ g[B.ints + 0] = f, g[B.ints + 1] = p, g[B.ints + 2] = _, g[B.ints + 3] = 0;
267
+ for (let e = 0; e < 4; e++) {
268
+ let t = B.palette + e * 4, n = l(m[Math.min(e, _ - 1)] ?? m[0]);
269
+ h[t + 0] = n[0], h[t + 1] = n[1], h[t + 2] = n[2], h[t + 3] = 0;
98
270
  }
99
- function j(e) {
100
- return d(o(s((h ? e.frozenSeed : `${Math.random()}`) + m)), {
101
- harmonics: e.harmonics,
102
- harmonicScale: e.harmonicScale
103
- });
271
+ return e;
272
+ }
273
+ function ee(e) {
274
+ let t = Math.min(e.length, 64), n = new Float32Array(256);
275
+ for (let r = 0; r < t; r++) {
276
+ let t = e[r], i = r * 4;
277
+ n[i + 0] = t.coefficient[0], n[i + 1] = t.coefficient[1], n[i + 2] = t.index, n[i + 3] = 0;
104
278
  }
105
- let { isDark: M } = a();
106
- g(() => {
107
- let n = u.value;
108
- if (!n) return;
109
- let r = x[f], i = j(r), a = [...i].sort((e, t) => t.amplitude - e.amplitude);
110
- k = a.length, A();
111
- let o = Infinity, s = Infinity, d = -Infinity, p = -Infinity;
112
- for (let e = 0; e < 720; e++) {
113
- let t = c(i, e / 720), [n, r] = t[t.length - 1];
114
- n < o && (o = n), r < s && (s = r), n > d && (d = n), r > p && (p = r);
115
- }
116
- let m = Math.max(.001, d - o), g = Math.max(.001, p - s), _ = (o + d) / 2, v = (s + p) / 2, C = [], D = e({
117
- canvas: u,
118
- setup: () => ({ render(e, t) {
119
- let o = n.clientWidth || n.offsetWidth || 0, s = n.clientHeight || n.offsetHeight || 0;
120
- if (!o || !s) return;
121
- let l = .82, u = Math.min(o / m * l, s / g * l), d = o / 2, f = s / 2, p = (e, t) => [d + (e - _) * u, f + (t - v) * u], b = h || D.reducedMotion ? r.frozenT : y ? y() : t / r.durationMs % 1, x = w.value, O = T.value, k = E.value, A = M.value, j = r.peakAlpha * S, N = r.headGlowAlpha * S;
122
- if (e.clearRect(0, 0, o, s), r.epicycleRatios.arm > 0) {
123
- let t = c(a, b);
124
- e.lineCap = "round", e.lineJoin = "round";
125
- let n = Math.min(1, j * r.epicycleRatios.circle), i = Math.min(1, j * r.epicycleRatios.arm);
126
- for (let a = 1; a < t.length; a++) {
127
- let [o, s] = p(t[a - 1][0], t[a - 1][1]), [c, l] = p(t[a][0], t[a][1]), u = Math.hypot(c - o, l - s), d = k.length > 0 ? k[Math.min(a - 1, k.length - 1)] : O;
128
- e.strokeStyle = d, e.lineWidth = r.epicycleWidths.circle, e.globalAlpha = n, e.beginPath(), e.arc(o, s, u, 0, Math.PI * 2), e.stroke(), e.lineWidth = r.epicycleWidths.arm, e.globalAlpha = i, e.beginPath(), e.moveTo(o, s), e.lineTo(c, l), e.stroke(), e.fillStyle = d, e.globalAlpha = Math.min(1, i * .9), e.beginPath(), e.arc(o, s, Math.max(2, r.epicycleWidths.arm * .9), 0, Math.PI * 2), e.fill();
129
- }
130
- e.globalAlpha = 1;
279
+ return n;
280
+ }
281
+ //#endregion
282
+ //#region src/components/custom/fourier-field/composables/fourierFieldWGPUSetup.ts
283
+ var G = 64, K = 128, q = 8, te = 1, J = 2, Y = 4, ne = 64, re = .92, ie = .95, ae = 1.35, oe = .34;
284
+ function se(e) {
285
+ let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: c } = e;
286
+ return function(e, l, u) {
287
+ let d = e.createShaderModule({
288
+ label: "[FourierField] fourier-field.compute.wgsl",
289
+ code: P
290
+ }), f = e.createShaderModule({
291
+ label: "[FourierField] fourier-field.render.wgsl",
292
+ code: F
293
+ }), p = e.createBuffer({
294
+ label: "[FourierField] phasors",
295
+ size: 1024,
296
+ usage: K | q
297
+ }), m = e.createBuffer({
298
+ label: "[FourierField] curve-samples",
299
+ size: 384 * 16,
300
+ usage: K
301
+ }), h = e.createBuffer({
302
+ label: "[FourierField] chain-tips",
303
+ size: 1040,
304
+ usage: K
305
+ }), g = e.createBuffer({
306
+ label: "[FourierField] compute-uniforms",
307
+ size: L().buffer.byteLength,
308
+ usage: G | q
309
+ }), _ = e.createBuffer({
310
+ label: "[FourierField] render-uniforms",
311
+ size: V().buffer.byteLength,
312
+ usage: G | q
313
+ }), v = e.createBindGroupLayout({
314
+ label: "[FourierField] compute-bgl",
315
+ entries: [
316
+ {
317
+ binding: 0,
318
+ visibility: Y,
319
+ buffer: { type: "uniform" }
320
+ },
321
+ {
322
+ binding: 1,
323
+ visibility: Y,
324
+ buffer: { type: "read-only-storage" }
325
+ },
326
+ {
327
+ binding: 2,
328
+ visibility: Y,
329
+ buffer: { type: "storage" }
330
+ },
331
+ {
332
+ binding: 3,
333
+ visibility: Y,
334
+ buffer: { type: "storage" }
131
335
  }
132
- let P = r.trailLength / 600, F = r.trailLength;
133
- C.length = 0;
134
- for (let e = F; e >= 0; e--) {
135
- let t = c(i, (b - e / F * P + 1) % 1);
136
- C.push(p(t[t.length - 1][0], t[t.length - 1][1]));
336
+ ]
337
+ }), y = e.createComputePipeline({
338
+ label: "[FourierField] compute-pipeline",
339
+ layout: e.createPipelineLayout({ bindGroupLayouts: [v] }),
340
+ compute: {
341
+ module: d,
342
+ entryPoint: "cs_main"
343
+ }
344
+ }), b = e.createBindGroup({
345
+ label: "[FourierField] compute-bg",
346
+ layout: v,
347
+ entries: [
348
+ {
349
+ binding: 0,
350
+ resource: { buffer: g }
351
+ },
352
+ {
353
+ binding: 1,
354
+ resource: { buffer: p }
355
+ },
356
+ {
357
+ binding: 2,
358
+ resource: { buffer: m }
359
+ },
360
+ {
361
+ binding: 3,
362
+ resource: { buffer: h }
137
363
  }
138
- e.globalCompositeOperation = "source-over", e.strokeStyle = x, e.lineCap = "round", e.lineJoin = "round", e.lineWidth = r.trailWidth;
139
- for (let t = 1; t < C.length; t++) {
140
- let n = j * (t / (C.length - 1)) ** r.trailFadeExp;
141
- n = Math.max(n, j * r.trailFloor), e.globalAlpha = Math.min(1, n), e.beginPath(), e.moveTo(C[t - 1][0], C[t - 1][1]), e.lineTo(C[t][0], C[t][1]), e.stroke();
364
+ ]
365
+ }), x = e.createBindGroupLayout({
366
+ label: "[FourierField] render-bgl",
367
+ entries: [
368
+ {
369
+ binding: 0,
370
+ visibility: te | J,
371
+ buffer: { type: "uniform" }
372
+ },
373
+ {
374
+ binding: 1,
375
+ visibility: J,
376
+ buffer: { type: "read-only-storage" }
377
+ },
378
+ {
379
+ binding: 2,
380
+ visibility: J,
381
+ buffer: { type: "read-only-storage" }
142
382
  }
143
- if (e.globalCompositeOperation = M.value ? "lighter" : "source-over", A && C.length >= 4) {
144
- e.strokeStyle = x, e.lineWidth = r.trailWidth;
145
- let t = Math.max(1, Math.floor(C.length * .66));
146
- for (let n = t; n < C.length; n++) {
147
- let r = (n - t) / Math.max(1, C.length - 1 - t);
148
- e.globalAlpha = Math.min(1, .18 * r * S), e.beginPath(), e.moveTo(C[n - 1][0], C[n - 1][1]), e.lineTo(C[n][0], C[n][1]), e.stroke();
383
+ ]
384
+ }), S = e.createRenderPipeline({
385
+ label: "[FourierField] render-pipeline",
386
+ layout: e.createPipelineLayout({ bindGroupLayouts: [x] }),
387
+ vertex: {
388
+ module: f,
389
+ entryPoint: "vs_main"
390
+ },
391
+ fragment: {
392
+ module: f,
393
+ entryPoint: "fs_main",
394
+ targets: [{
395
+ format: u,
396
+ blend: {
397
+ color: {
398
+ srcFactor: "one",
399
+ dstFactor: "one-minus-src-alpha",
400
+ operation: "add"
401
+ },
402
+ alpha: {
403
+ srcFactor: "one",
404
+ dstFactor: "one-minus-src-alpha",
405
+ operation: "add"
406
+ }
149
407
  }
408
+ }]
409
+ },
410
+ primitive: { topology: "triangle-list" }
411
+ }), C = e.createBindGroup({
412
+ label: "[FourierField] render-bg",
413
+ layout: x,
414
+ entries: [
415
+ {
416
+ binding: 0,
417
+ resource: { buffer: _ }
418
+ },
419
+ {
420
+ binding: 1,
421
+ resource: { buffer: m }
422
+ },
423
+ {
424
+ binding: 2,
425
+ resource: { buffer: h }
150
426
  }
151
- if (C.length >= 2) {
152
- e.save(), e.globalCompositeOperation = "source-over", e.shadowColor = x, e.shadowBlur = r.headGlowBlur, e.globalAlpha = Math.min(1, N), e.strokeStyle = x, e.lineWidth = r.trailWidth + .6;
153
- let t = C.slice(-6);
154
- e.beginPath(), e.moveTo(t[0][0], t[0][1]);
155
- for (let n = 1; n < t.length; n++) e.lineTo(t[n][0], t[n][1]);
156
- e.stroke(), e.restore();
157
- }
158
- if (r.headDotRadius > 0 && C.length >= 1) {
159
- let [t, n] = C[C.length - 1];
160
- e.globalCompositeOperation = "source-over", e.globalAlpha = Math.min(1, N * .4), e.fillStyle = x, e.beginPath(), e.arc(t, n, r.headDotRadius * 2.6, 0, Math.PI * 2), e.fill(), e.globalAlpha = Math.min(1, N), e.beginPath(), e.arc(t, n, r.headDotRadius, 0, Math.PI * 2), e.fill(), e.globalAlpha = Math.min(1, N * .95), e.fillStyle = "rgb(255, 255, 255)", e.beginPath(), e.arc(t, n, Math.max(1.2, r.headDotRadius * .38), 0, Math.PI * 2), e.fill();
161
- }
162
- e.shadowBlur = 0, e.globalCompositeOperation = "source-over", e.globalAlpha = 1;
163
- } })
164
- });
165
- b(l, A, { immediate: !0 }), b(() => t.color, () => {
166
- A(), D.wake();
167
- }), b(M, () => {
168
- A(), D.wake();
169
- });
170
- });
427
+ ]
428
+ }), w = L(), T = V(), E = null, D = {
429
+ centerX: 0,
430
+ centerY: 0,
431
+ scale: 1
432
+ }, O = 0;
433
+ function k() {
434
+ let t = r();
435
+ t !== E && (E = t, O = Math.min(t.length, 64), D = H(t), e.queue.writeBuffer(p, 0, ee(t)));
436
+ }
437
+ function A() {
438
+ let e = s(), n = t.clientWidth || 320, r = t.clientHeight || 320, i = Math.max(1, Math.round(n * e)), a = Math.max(1, Math.round(r * e));
439
+ (t.width !== i || t.height !== a) && (t.width = i, t.height = a);
440
+ }
441
+ function j(r) {
442
+ c?.(r), k();
443
+ let o = a(), s = Math.max(1, Math.min(Math.round(n.harmonics), O)), u = n.showEpicycles ? Math.max(1, Math.min(Math.round(n.epicycleArms), s)) : 0;
444
+ R(w, o, n.trailArc, s, u, 384, O), e.queue.writeBuffer(g, 0, w.buffer);
445
+ let d = Math.min(t.clientWidth || 320, t.clientHeight || 320), f = (t.clientWidth || 320) / Math.max(t.clientHeight || 320, 1), p = U(n.trailWidth, D.scale, d);
446
+ W(T, D, f, p, re, ie, ae, oe, n.intensity, n.showEpicycles, n.rainbowChain, 384, u, i()), e.queue.writeBuffer(_, 0, T.buffer);
447
+ let m = e.createCommandEncoder({ label: "[FourierField] frame" }), h = m.beginComputePass();
448
+ h.setPipeline(y), h.setBindGroup(0, b), h.dispatchWorkgroups(Math.ceil(384 / ne)), h.end();
449
+ let v = l.getCurrentTexture().createView(), x = m.beginRenderPass({ colorAttachments: [{
450
+ view: v,
451
+ clearValue: {
452
+ r: 0,
453
+ g: 0,
454
+ b: 0,
455
+ a: 0
456
+ },
457
+ loadOp: "clear",
458
+ storeOp: "store"
459
+ }] });
460
+ x.setPipeline(S), x.setBindGroup(0, C), x.draw(3, 1, 0, 0), x.end(), e.queue.submit([m.finish()]);
461
+ }
462
+ return {
463
+ frame: j,
464
+ shouldContinue: o,
465
+ resize: A,
466
+ teardown: () => {
467
+ p.destroy(), m.destroy(), h.destroy(), g.destroy(), _.destroy();
468
+ }
469
+ };
470
+ };
471
+ }
472
+ //#endregion
473
+ //#region src/components/custom/fourier-field/shaders/fourier-field.glsl.ts
474
+ var ce = "#version 300 es\nin vec2 aPosition;\nout vec2 vClip;\nvoid main() {\n vClip = aPosition;\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}\n", le = `#version 300 es
475
+ precision highp float;
476
+
477
+ #define MAX_CURVE_SAMPLES 256
478
+ #define MAX_PHASORS 64
479
+
480
+ in vec2 vClip;
481
+ out vec4 fragColor;
482
+
483
+ uniform vec4 uFit; // (centerX, centerY, scale, aspect)
484
+ uniform vec4 uTrail; // (trailWidth, peakAlpha, headGlowAlpha, trailFadeExp)
485
+ uniform vec4 uEnv; // (trailFloor, intensity, showEpicycles, rainbowChain)
486
+ uniform int uSampleCount;
487
+ uniform int uArmCount;
488
+ uniform int uStopCount;
489
+ uniform vec3 uPalette[4]; // linear-sRGB stops
490
+ // curveSamples[i] = (x, y, age) in MODEL space; chainTips[k] = (x, y) in MODEL space.
491
+ uniform vec3 uCurve[MAX_CURVE_SAMPLES];
492
+ uniform vec2 uChain[MAX_PHASORS];
493
+
494
+ const float PI = 3.141592653589793;
495
+
496
+ ${i}
497
+ ${o}
498
+
499
+ // Negative-safe cube root (the WGSL chunk's cbrt3 twin; the GLSL chunk inlines it).
500
+ vec3 cbrt3(vec3 v) { return sign(v) * pow(abs(v), vec3(1.0 / 3.0)); }
501
+
502
+ vec3 samplePaletteLin(float t) {
503
+ if (uStopCount <= 1) return uPalette[0];
504
+ float n = float(uStopCount);
505
+ float ft = clamp(t, 0.0, 1.0) * (n - 1.0);
506
+ int i0 = int(floor(ft));
507
+ int i1 = min(i0 + 1, uStopCount - 1);
508
+ float f = ft - float(i0);
509
+ vec3 labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * uPalette[i0]);
510
+ vec3 labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * uPalette[i1]);
511
+ return oklabToLinearSrgb(mix(labA, labB, f));
512
+ }
513
+
514
+ vec3 chainColorLin(float seg, bool rainbow) {
515
+ vec3 baseLin = uPalette[0];
516
+ if (!rainbow) return baseLin;
517
+ vec3 lab = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * baseLin);
518
+ vec3 lch = oklabToOklch(lab);
519
+ float hueShift = mix(-0.45, 1.15, clamp(seg, 0.0, 1.0));
520
+ vec3 lifted = vec3(0.66, max(lch.y, 0.14), lch.z + hueShift);
521
+ return oklabToLinearSrgb(oklchToOklab(lifted));
522
+ }
523
+
524
+ float segDist(vec2 p, vec2 a, vec2 b) {
525
+ vec2 pa = p - a;
526
+ vec2 ba = b - a;
527
+ float h = clamp(dot(pa, ba) / max(dot(ba, ba), 1e-8), 0.0, 1.0);
528
+ return length(pa - ba * h);
529
+ }
530
+
531
+ void main() {
532
+ vec2 center = uFit.xy;
533
+ float scale = max(uFit.z, 1e-6);
534
+ float aspect = max(uFit.w, 1e-4);
535
+ // clip → model (the inverse of model→clip fit).
536
+ vec2 p = center + vec2(vClip.x * aspect, vClip.y) / scale;
537
+
538
+ float aa = max(fwidth(p.x) + fwidth(p.y), 1e-5) * 0.75;
539
+ float trailWidth = uTrail.x; // already in model units (packed CPU-side)
540
+ float peak = uTrail.y * uEnv.y;
541
+ float headGlow = uTrail.z * uEnv.y;
542
+ float fadeExp = uTrail.w;
543
+ float trailFloor = uEnv.x;
544
+ bool showEpicycles = uEnv.z > 0.5;
545
+ bool rainbow = uEnv.w > 0.5;
546
+ float halfW = trailWidth * 0.5;
547
+
548
+ vec4 accum = vec4(0.0);
549
+
550
+ if (showEpicycles && uArmCount >= 1) {
551
+ for (int k = 0; k < MAX_PHASORS; k++) {
552
+ if (k >= uArmCount) break;
553
+ vec2 a = uChain[k];
554
+ vec2 b = uChain[k + 1];
555
+ float seg = float(k) / max(float(uArmCount - 1), 1.0);
556
+ vec3 lin = chainColorLin(seg, rainbow);
557
+ float radius = length(b - a);
558
+ float dRing = abs(length(p - a) - radius);
559
+ float ringW = max(halfW * 0.45, aa);
560
+ float ringMask = (1.0 - smoothstep(ringW, ringW + aa, dRing)) * 0.5;
561
+ float dArm = segDist(p, a, b);
562
+ float armMask = 1.0 - smoothstep(halfW * 0.55, halfW * 0.55 + aa, dArm);
563
+ float dotR = max(halfW * 0.7, aa * 2.0);
564
+ float dDot = length(p - a);
565
+ float dotMask = 1.0 - smoothstep(dotR, dotR + aa, dDot);
566
+ float m = clamp(max(max(ringMask, armMask), dotMask), 0.0, 1.0) * peak * 0.7;
567
+ vec3 rgb = clamp(linearToSrgb(lin), vec3(0.0), vec3(1.0));
568
+ accum = vec4(rgb * m, m) + accum * (1.0 - m);
569
+ }
570
+ }
571
+
572
+ for (int i = 0; i < MAX_CURVE_SAMPLES; i++) {
573
+ if (i >= uSampleCount - 1) break;
574
+ vec3 sa = uCurve[i];
575
+ vec3 sb = uCurve[i + 1];
576
+ float d = segDist(p, sa.xy, sb.xy);
577
+ float cover = 1.0 - smoothstep(halfW, halfW + aa, d);
578
+ if (cover < 0.002) continue;
579
+ float age = max(sa.z, sb.z);
580
+ float a = peak * pow(age, fadeExp);
581
+ a = max(a, peak * trailFloor) * cover;
582
+ vec3 lin = samplePaletteLin(1.0 - age * 0.4);
583
+ vec3 rgb = clamp(linearToSrgb(lin), vec3(0.0), vec3(1.0));
584
+ accum = vec4(rgb * a, a) + accum * (1.0 - a);
585
+ }
586
+
587
+ if (uSampleCount >= 1) {
588
+ vec2 head = uCurve[0].xy;
589
+ float dHead = length(p - head);
590
+ float coreR = halfW * 1.5;
591
+ float haloR = coreR * 3.0;
592
+ vec3 headRgb = clamp(linearToSrgb(samplePaletteLin(0.0)), vec3(0.0), vec3(1.0));
593
+ float halo = (1.0 - smoothstep(0.0, haloR, dHead)) * headGlow * 0.35;
594
+ accum = vec4(headRgb * halo, halo) + accum * (1.0 - halo);
595
+ float core = (1.0 - smoothstep(coreR, coreR + aa, dHead)) * headGlow;
596
+ accum = vec4(headRgb * core, core) + accum * (1.0 - core);
597
+ float spec = (1.0 - smoothstep(coreR * 0.4, coreR * 0.4 + aa, dHead)) * headGlow * 0.9;
598
+ accum = vec4(vec3(1.0) * spec, spec) + accum * (1.0 - spec);
599
+ }
600
+
601
+ fragColor = accum;
602
+ }
603
+ `, X = 256, Z = 64, ue = .92, de = .95, fe = 1.35, pe = .34;
604
+ function Q(e, t, n) {
605
+ let r = e.createShader(t);
606
+ if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
607
+ let t = e.getShaderInfoLog(r);
608
+ throw e.deleteShader(r), Error(`[FourierField] shader compile failed: ${t}`);
609
+ }
610
+ return r;
611
+ }
612
+ function me(e) {
613
+ let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: c } = e;
614
+ return function(e) {
615
+ let u = Q(e, e.VERTEX_SHADER, ce), d = Q(e, e.FRAGMENT_SHADER, le), f = e.createProgram();
616
+ if (e.attachShader(f, u), e.attachShader(f, d), e.linkProgram(f), !e.getProgramParameter(f, e.LINK_STATUS)) throw Error(`[FourierField] link failed: ${e.getProgramInfoLog(f)}`);
617
+ e.deleteShader(u), e.deleteShader(d);
618
+ let p = e.createVertexArray();
619
+ e.bindVertexArray(p);
620
+ let m = e.createBuffer();
621
+ e.bindBuffer(e.ARRAY_BUFFER, m), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
622
+ -1,
623
+ -1,
624
+ 3,
625
+ -1,
626
+ -1,
627
+ 3
628
+ ]), e.STATIC_DRAW);
629
+ let g = e.getAttribLocation(f, "aPosition");
630
+ e.enableVertexAttribArray(g), e.vertexAttribPointer(g, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
631
+ let _ = (t) => e.getUniformLocation(f, t), v = _("uFit"), y = _("uTrail"), b = _("uEnv"), x = _("uSampleCount"), S = _("uArmCount"), C = _("uStopCount"), w = _("uPalette[0]"), T = _("uCurve[0]"), E = _("uChain[0]"), D = new Float32Array(X * 3), O = new Float32Array((Z + 1) * 2), k = new Float32Array(12), A = null, j = {
632
+ centerX: 0,
633
+ centerY: 0,
634
+ scale: 1
635
+ }, M = 0;
636
+ function N() {
637
+ let e = r();
638
+ e !== A && (A = e, M = Math.min(e.length, Z), j = H(e));
639
+ }
640
+ function P() {
641
+ let n = s(), r = t.clientWidth || 320, i = t.clientHeight || 320, a = Math.max(1, Math.round(r * n)), o = Math.max(1, Math.round(i * n));
642
+ (t.width !== a || t.height !== o) && (t.width = a, t.height = o), e.viewport(0, 0, t.width, t.height);
643
+ }
644
+ function F(r) {
645
+ c?.(r), N();
646
+ let o = A;
647
+ if (!o) return;
648
+ let s = a(), u = Math.max(1, Math.min(Math.round(n.harmonics), M)), d = n.showEpicycles ? Math.max(1, Math.min(Math.round(n.epicycleArms), u)) : 0, m = X, g = Math.max(m - 1, 1);
649
+ for (let e = 0; e < m; e++) {
650
+ let t = e / g, r = 1 - t, i = s - n.trailArc * t;
651
+ i -= Math.floor(i);
652
+ let [a, c] = h(o, i, u), l = e * 3;
653
+ D[l + 0] = a, D[l + 1] = c, D[l + 2] = r;
654
+ }
655
+ let _ = Math.min(d, u);
656
+ for (let e = 0; e <= Z; e++) {
657
+ let t = e * 2;
658
+ if (e <= _) {
659
+ let [n, r] = h(o, s, e);
660
+ O[t + 0] = n, O[t + 1] = r;
661
+ } else O[t + 0] = 0, O[t + 1] = 0;
662
+ }
663
+ let P = t.clientWidth || 320, F = t.clientHeight || 320, I = Math.min(P, F), L = P / Math.max(F, 1), R = U(n.trailWidth, j.scale, I), z = i(), B = Math.min(z.length, 4);
664
+ for (let e = 0; e < 4; e++) {
665
+ let t = l(z[Math.min(e, B - 1)] ?? z[0]);
666
+ k[e * 3 + 0] = t[0], k[e * 3 + 1] = t[1], k[e * 3 + 2] = t[2];
667
+ }
668
+ e.useProgram(f), e.bindVertexArray(p), e.enable(e.BLEND), e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA), e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), e.uniform4f(v, j.centerX, j.centerY, j.scale, L), e.uniform4f(y, R, ue, de, fe), e.uniform4f(b, pe, n.intensity, +!!n.showEpicycles, +!!n.rainbowChain), e.uniform1i(x, m), e.uniform1i(S, d), e.uniform1i(C, B), e.uniform3fv(w, k), e.uniform3fv(T, D), e.uniform2fv(E, O), e.drawArrays(e.TRIANGLES, 0, 3);
669
+ }
670
+ return {
671
+ frame: F,
672
+ shouldContinue: o,
673
+ resize: P,
674
+ teardown: () => {
675
+ e.deleteProgram(f), e.deleteBuffer(m), e.deleteVertexArray(p);
676
+ }
677
+ };
678
+ };
679
+ }
680
+ //#endregion
681
+ //#region src/components/custom/fourier-field/composables/useFourierField.ts
682
+ function $(e, t) {
683
+ let { config: r, getSpectrum: i, getPalette: a } = t, o = t.mode ?? "live", s = t.frozenT ?? .34, l = t.periodS ?? 16, u = 0, d = -1, f = 0, p = n({ respectReducedMotion: r.respectReducedMotion }), m = () => (t.freeze?.() ?? !1) || (S?.reducedMotion ?? !1);
684
+ function h(e) {
685
+ let t = d >= 0 ? (e - d) * 1e3 : 16.7;
686
+ if (d = e, p.tick(t), m()) {
687
+ u = s, f = 0;
688
+ return;
689
+ }
690
+ let n = Math.min(Math.max(t / 1e3, 0), .05);
691
+ if (r.interactive && p.active.value) {
692
+ u = p.smoothedPosition.value.x % 1, u < 0 && (u += 1), f = p.burst.value * 4;
693
+ return;
694
+ }
695
+ let i = r.speed / l + f;
696
+ u = (u + i * n) % 1, u < 0 && (u += 1), f *= .92 ** (n * 60), Math.abs(f) < 1e-4 && (f = 0);
697
+ }
698
+ let g = () => u, _ = (e) => {
699
+ p.onPointerMove(e), r.interactive && S?.wake();
700
+ }, v = () => {
701
+ p.onPointerEnter(), r.interactive && S?.wake();
702
+ }, y = (e) => e.parentElement ?? e;
703
+ function b(e) {
704
+ let t = y(e);
705
+ t.addEventListener("pointermove", _), t.addEventListener("pointerenter", v), t.addEventListener("pointerleave", p.onPointerLeave);
706
+ }
707
+ function x(e) {
708
+ let t = y(e);
709
+ t.removeEventListener("pointermove", _), t.removeEventListener("pointerenter", v), t.removeEventListener("pointerleave", p.onPointerLeave);
710
+ }
711
+ let S = null, C = () => {
712
+ let t = e.value;
713
+ return t ? (S || (b(t), S = c(t, {
714
+ mode: o,
715
+ respectReducedMotion: r.respectReducedMotion,
716
+ setupWGPU: se({
717
+ canvas: t,
718
+ config: r,
719
+ getSpectrum: i,
720
+ getPalette: a,
721
+ getHeadT: g,
722
+ shouldContinue: () => !0,
723
+ onFrame: h
724
+ }),
725
+ setupGL: me({
726
+ canvas: t,
727
+ config: r,
728
+ getSpectrum: i,
729
+ getPalette: a,
730
+ getHeadT: g,
731
+ shouldContinue: () => !0,
732
+ onFrame: h
733
+ })
734
+ }), S.armAsync()), S) : null;
735
+ };
736
+ queueMicrotask(() => C());
737
+ let w = {
738
+ get backend() {
739
+ return C()?.backend ?? "webgpu";
740
+ },
741
+ pause: () => C()?.suspend("manual"),
742
+ resume: () => C()?.resume("manual"),
743
+ wake: () => C()?.wake(),
744
+ renderAt: (e) => C()?.renderAt(e),
745
+ get reducedMotion() {
746
+ return S?.reducedMotion ?? !1;
747
+ },
748
+ get headT() {
749
+ return u;
750
+ },
751
+ setHeadT: (e) => {
752
+ u = (e % 1 + 1) % 1, C()?.wake();
753
+ },
754
+ dispose: () => {
755
+ let t = e.value;
756
+ t && x(t), p.dispose(), S?.dispose();
757
+ }
758
+ };
759
+ return T(() => w.dispose()), w;
171
760
  }
172
761
  //#endregion
173
762
  //#region src/components/custom/fourier-field/FourierField.vue
174
- var C = /* @__PURE__ */ t(/* @__PURE__ */ h({
763
+ var he = /* @__PURE__ */ e(/* @__PURE__ */ S({
175
764
  __name: "FourierField",
176
765
  props: {
177
- variant: { default: "hero" },
766
+ config: {},
767
+ spectrum: {},
768
+ getPalette: {},
178
769
  color: {},
179
770
  colorResolver: {},
180
771
  seed: { default: "" },
@@ -182,25 +773,81 @@ var C = /* @__PURE__ */ t(/* @__PURE__ */ h({
182
773
  type: Boolean,
183
774
  default: !1
184
775
  },
185
- intensity: { default: 1 },
186
- clock: {}
776
+ intensity: {}
187
777
  },
188
- setup(e) {
189
- let t = e, n = y("hostRef"), r = y("canvasRef");
190
- return S(t, {
191
- hostRef: n,
192
- canvasRef: r
193
- }), (e, t) => (_(), p("div", {
778
+ setup(e, { expose: n }) {
779
+ let r = e, i = O("hostRef"), a = O("canvasRef"), { isDark: o } = d(), s = y(() => {
780
+ let e = r.config ?? N, t = r.intensity == null ? e.intensity : Math.max(0, Math.min(2, r.intensity)), n = r.config ? e.interactive : !1;
781
+ return {
782
+ ...e,
783
+ intensity: t,
784
+ interactive: n
785
+ };
786
+ }), c = y(() => r.spectrum && r.spectrum.length > 0 ? r.spectrum : _(f(p((r.freeze ? "fourier-field/frozen" : r.seed || "fourier-field") + r.seed)), {
787
+ harmonics: Math.min(s.value.harmonics + 4, 62),
788
+ harmonicScale: s.value.harmonicScale
789
+ })), l = () => c.value;
790
+ function m(e) {
791
+ if (!e.includes("var(") && !e.includes("light-dark(")) return e;
792
+ let n = i.value;
793
+ if (typeof window > "u" || !n) return e;
794
+ if (e.includes("var(")) return t(e, n);
795
+ let r = n.style.color;
796
+ n.style.color = e;
797
+ let a = getComputedStyle(n).color;
798
+ return n.style.color = r, a || e;
799
+ }
800
+ let h = D(s.value.palette);
801
+ function g() {
802
+ if (r.getPalette) {
803
+ h.value = r.getPalette();
804
+ return;
805
+ }
806
+ if (o.value, r.color) {
807
+ let e = m(r.color);
808
+ if (e.includes("var(") || e.includes("light-dark(")) return;
809
+ let t = u(e);
810
+ h.value = [{
811
+ L: Math.max(.5, t.L),
812
+ C: Math.max(.12, t.C),
813
+ h: t.h
814
+ }, {
815
+ L: Math.min(.9, t.L + .22),
816
+ C: t.C * .4,
817
+ h: t.h + 18
818
+ }];
819
+ return;
820
+ }
821
+ h.value = s.value.palette;
822
+ }
823
+ let v = $(a, {
824
+ config: s.value,
825
+ getSpectrum: l,
826
+ getPalette: () => h.value,
827
+ freeze: () => r.freeze
828
+ });
829
+ return k([
830
+ () => r.color,
831
+ () => r.getPalette,
832
+ o
833
+ ], g, { immediate: !0 }), w(g), k(o, () => v.wake()), k(() => r.freeze, () => v.wake()), n({
834
+ backend: () => v.backend,
835
+ pause: v.pause,
836
+ resume: v.resume,
837
+ wake: v.wake,
838
+ renderAt: v.renderAt,
839
+ setHeadT: v.setHeadT
840
+ }), (e, t) => (E(), b("div", {
194
841
  ref_key: "hostRef",
195
- ref: n,
196
- class: "fourier-field"
197
- }, [m("canvas", {
842
+ ref: i,
843
+ class: C(["fourier-field", { "fourier-field--interactive": s.value.interactive }])
844
+ }, [x("canvas", {
198
845
  ref_key: "canvasRef",
199
- ref: r,
846
+ ref: a,
200
847
  class: "fourier-field-canvas",
201
848
  "aria-hidden": "true"
202
- }, null, 512)], 512));
849
+ }, null, 512)], 2));
203
850
  }
204
- }), [["__scopeId", "data-v-5638d46b"]]);
851
+ }), [["__scopeId", "data-v-b0591225"]]);
205
852
  //#endregion
206
- export { C as FourierField, f as comp, u as dftFromPoints, d as makeEllipticSpectrum, l as partialSumAt, c as positionsAt };
853
+ export { N as DEFAULT_FOURIER_CONFIG, he as FourierField, j as MAX_CURVE_SAMPLES, A as MAX_PHASORS, M as WARM_IDENTITY_PALETTE, v as comp, g as dftFromPoints, _ as makeEllipticSpectrum, h as partialSumAt, m as positionsAt, $ as useFourierField };