@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
package/dist/goo-blob.js CHANGED
@@ -1,588 +1,21 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-C1je1s0u.js";
2
2
  import { t } from "./useResolveTokenColor-vAylyR0x.js";
3
- import { n, r, t as i } from "./procedural-color.glsl-CIFsJhwI.js";
4
- import { a, n as o, r as s, t as c, u as l } from "./procedural-color.wgsl-CToRHugY.js";
5
- import { n as u, t as d } from "./compile-CQEFRTmx.js";
6
- import { s as f, t as p } from "./color-DweYl7pE.js";
7
- import { t as m } from "./useIntersectionPause-Bj4sPkMh.js";
8
- import { n as h, t as g } from "./prng-Za0Rmgag.js";
9
- import { computed as _, createElementBlock as v, createElementVNode as y, defineComponent as b, inject as x, normalizeStyle as S, onScopeDispose as C, onUnmounted as w, openBlock as T, readonly as E, ref as D, useTemplateRef as O, watch as k } from "vue";
10
- import { SpringProgress as A } from "@mkbabb/keyframes.js";
11
- //#region src/components/custom/goo-blob/types.ts
12
- var j = {
13
- geometry: {
14
- canvasSize: 200,
15
- bodyRadius: .22,
16
- satelliteCount: 3,
17
- satelliteRadius: .082,
18
- orbitRadius: .17,
19
- eccentricity: .05
20
- },
21
- satellites: {
22
- mergeDuration: 1800,
23
- absorbedDuration: [2e3, 4e3],
24
- emergeDuration: 2200,
25
- orbitDuration: [8e3, 14e3]
26
- },
27
- membrane: {
28
- smoothK: .05,
29
- merge: "circular",
30
- noiseAmp: .038,
31
- noiseFreq: 3.5,
32
- noiseSpeed: .08,
33
- warpAmp: .35,
34
- pulseFreq: .3,
35
- pulseAmp: .008
36
- },
37
- color: {
38
- paletteStops: [
39
- "#b5947f",
40
- "#d4b27d",
41
- "#dad6b1"
42
- ],
43
- hueRange: 5,
44
- satShift: 0,
45
- brightnessShift: 0,
46
- colorNoiseFreq: 2,
47
- colorNoiseSpeed: .05
48
- },
49
- surface: {
50
- lit: !0,
51
- rimColor: "#8c694e",
52
- lightDir: [
53
- .4,
54
- .7,
55
- .6
56
- ],
57
- specStrength: .16,
58
- specShininess: 20,
59
- rimPower: 2.5,
60
- rimStrength: .32,
61
- iridescence: .09,
62
- iridHue: 85,
63
- iridSpeed: .06,
64
- sssScale: .1,
65
- sssPower: 2,
66
- coreGlow: .06
67
- },
68
- interaction: {
69
- pointerAttraction: .35,
70
- pointerStrength: .1,
71
- stretch: .5,
72
- clickImpulse: .5
73
- },
74
- quality: "full",
75
- tempo: 1
76
- }, M = Symbol("blobConfig"), N = 1 / 1.6, P = {
77
- idle: {
78
- valence: 0,
79
- arousal: .35
80
- },
81
- happy: {
82
- valence: .8,
83
- arousal: .6
84
- },
85
- curious: {
86
- valence: .3,
87
- arousal: .5
88
- },
89
- sleepy: {
90
- valence: -.1,
91
- arousal: .1
92
- },
93
- excited: {
94
- valence: .7,
95
- arousal: 1
96
- }
97
- }, F = (e, t, n) => e + (t - e) * n;
98
- function I({ valence: e, arousal: t }) {
99
- return {
100
- orbitSpeedScale: F(.4, 2.2, t),
101
- wobbleScale: F(.5, 2, t),
102
- pulseFreq: F(.15, 1.5, t),
103
- pulseAmp: F(.008, .05, t),
104
- noiseAmp: F(.015, .045, t),
105
- hueRange: F(3, 25, t * .6 + (e * .5 + .5) * .4),
106
- satShift: F(-.05, .1, e * .5 + .5),
107
- brightnessShift: F(-.03, .08, e * .5 + .5),
108
- smoothK: F(.85, 1.35, t),
109
- pointerAttraction: F(-.2, .6, e * .5 + .5) * (.7 + .15 * t),
110
- mergeRate: F(2, .3, t),
111
- iridScale: F(.55, 1.35, t)
112
- };
113
- }
114
- var L = {
115
- idle: I(P.idle),
116
- happy: I(P.happy),
117
- curious: I(P.curious),
118
- sleepy: I(P.sleepy),
119
- excited: I(P.excited)
120
- }, R = {
121
- idle: 1500,
122
- happy: 1200,
123
- curious: 800,
124
- sleepy: 2500,
125
- excited: 600
126
- }, z = 6e3, B = .35, V = .85, H = .2, U = .015, W = .02, ee = .01, te = .015, G = .75, ne = 2e3, re = /* @__PURE__ */ "uResolution.uTime.uBaseColor.uPointer.uPointerActive.uPointerAttraction.uPointerStrength.uBodyRadius.uPulsePhase.uPulseAmp.uNoiseAmp.uNoiseFreq.uNoiseSpeed.uWarpAmp.uSmoothK.uMerge.uMaxReach.uLit.uRimColor.uLightDir.uSpecStrength.uSpecShininess.uRimPower.uRimStrength.uIridescence.uIridHue.uIridSpeed.uSssScale.uSssPower.uCoreGlow.uHueRange.uSatShift.uBrightnessShift.uColorNoiseFreq.uColorNoiseSpeed.uStopCount.uSatCount.uTrailCount.uVelocity.uStretch".split(".");
127
- //#endregion
128
- //#region src/components/custom/goo-blob/composables/easing.ts
129
- function ie(e) {
130
- return e < .5 ? 2 * e * e : 1 - 2 * (1 - e) * (1 - e);
131
- }
132
- function ae(e) {
133
- return e * e;
134
- }
135
- function oe(e) {
136
- return 1 - (1 - e) * (1 - e);
137
- }
138
- //#endregion
139
- //#region src/components/custom/goo-blob/composables/useBlobMood.ts
140
- function se(e, t, n) {
141
- let r = (e, t) => e + (t - e) * n;
142
- return {
143
- orbitSpeedScale: r(e.orbitSpeedScale, t.orbitSpeedScale),
144
- wobbleScale: r(e.wobbleScale, t.wobbleScale),
145
- pulseFreq: r(e.pulseFreq, t.pulseFreq),
146
- pulseAmp: r(e.pulseAmp, t.pulseAmp),
147
- noiseAmp: r(e.noiseAmp, t.noiseAmp),
148
- hueRange: r(e.hueRange, t.hueRange),
149
- satShift: r(e.satShift, t.satShift),
150
- brightnessShift: r(e.brightnessShift, t.brightnessShift),
151
- smoothK: r(e.smoothK, t.smoothK),
152
- pointerAttraction: r(e.pointerAttraction, t.pointerAttraction),
153
- mergeRate: r(e.mergeRate, t.mergeRate),
154
- iridScale: r(e.iridScale, t.iridScale)
155
- };
156
- }
157
- function ce() {
158
- let e = D("idle"), t = D({ ...L.idle }), n = { ...L.idle }, r = { ...L.idle }, i = 0, a = 0, o = !1, s = 0, c = !1, l = !1, u = 0;
159
- function d(s, l = {}) {
160
- (l.source ?? "manual") === "manual" && (c = !0), !(s === e.value && !o) && (e.value = s, n = { ...t.value }, r = L[s], a = R[s], i = 0, o = !0);
161
- }
162
- function f(e) {
163
- u = e.idleMs;
164
- let t = e.pointerActive && !l;
165
- if (l = e.pointerActive, c && (e.clicked || t) && (c = !1), !c) {
166
- if (e.clicked) {
167
- s = 900, d("excited", { source: "auto" });
168
- return;
169
- }
170
- s > 0 || (e.pointerActive ? d("curious", { source: "auto" }) : e.idleMs > 6e3 ? d("sleepy", { source: "auto" }) : d("idle", { source: "auto" }));
171
- }
172
- }
173
- function p() {
174
- return o || s > 0 || c && e.value !== "idle" ? !1 : !(!c && e.value !== "sleepy" && u < 6e3);
175
- }
176
- function m() {
177
- return o || s > 0 || c || e.value === "sleepy" ? Infinity : Math.max(0, z - u);
178
- }
179
- function h(e) {
180
- if (s > 0 && (s = Math.max(0, s - e)), !o) return;
181
- i += e;
182
- let c = Math.min(i / a, 1), l = ie(c);
183
- t.value = se(n, r, l), c >= 1 && (o = !1);
184
- }
185
- return {
186
- currentMood: E(e),
187
- params: E(t),
188
- setMood: d,
189
- update: f,
190
- tick: h,
191
- isSettled: p,
192
- nextAutoMoodMs: m
193
- };
194
- }
195
- //#endregion
196
- //#region src/components/custom/goo-blob/composables/useBlobPointer.ts
197
- function le(e) {
198
- let t = D({
199
- x: 0,
200
- y: 0
201
- }), n = D({
202
- x: 0,
203
- y: 0
204
- }), r = D(!1), i = D(0), a = 0, o = 0, s = {
205
- response: .18,
206
- dampingFraction: 1
207
- }, c = new A(s), l = new A(s), u = Array.from({ length: 15 }, () => ({
208
- x: 0,
209
- y: 0,
210
- radius: 0
211
- })), d = 0, f = 0, p = 0, m = 0;
212
- function h(t) {
213
- let n = e.value;
214
- if (!n) return;
215
- let i = n.getBoundingClientRect();
216
- a = (t.clientX - i.left) / i.width * 2 - 1, o = (t.clientY - i.top) / i.height * 2 - 1, r.value = !0;
217
- }
218
- function g() {
219
- r.value = !1;
220
- }
221
- let _ = null;
222
- k(e, (e) => {
223
- _ &&= (_(), null), e && (e.addEventListener("pointermove", h), e.addEventListener("pointerleave", g), _ = () => {
224
- e.removeEventListener("pointermove", h), e.removeEventListener("pointerleave", g);
225
- });
226
- }, { immediate: !0 }), w(() => _?.());
227
- function v(e = 16) {
228
- let s = Math.min(e, 50), h = s / 1e3;
229
- r.value ? C = 0 : C += Math.min(e, 50);
230
- let g = r.value ? a : 0, _ = r.value ? o : 0;
231
- if (c.target = g, l.target = _, c.tickDt(s), l.tickDt(s), t.value = {
232
- x: c.value,
233
- y: l.value
234
- }, n.value = {
235
- x: c.velocity,
236
- y: l.velocity
237
- }, p !== 0 || m !== 0) {
238
- let e = -324 * p - 2 * B * 18 * m;
239
- m += e * h, p += m * h, p < -.9 && (p = -.9), Math.abs(p) < 1e-4 && Math.abs(m) < 1e-4 && (p = 0, m = 0);
240
- }
241
- i.value = p;
242
- let v = Math.hypot(c.velocity, l.velocity);
243
- r.value || v > .05 ? (d = (d + 1) % 15, u[d].x = c.value, u[d].y = l.value, f = Math.min(f + 1, 15)) : f > 0 && (f = Math.max(0, f - 1));
244
- }
245
- function y(e) {
246
- let t = [];
247
- for (let n = 0; n < f; n++) {
248
- let r = u[(d - n + 30) % 15];
249
- t.push({
250
- x: r.x,
251
- y: r.y,
252
- radius: e * (1 - n / 15)
253
- });
254
- }
255
- return {
256
- sources: t,
257
- count: f
258
- };
259
- }
260
- let b = !1;
261
- function x(e) {
262
- m += e * 18, b = !0;
263
- }
264
- function S() {
265
- let e = b;
266
- return b = !1, e;
267
- }
268
- let C = 0;
269
- function T() {
270
- c.reset(0, 0), l.reset(0, 0), c.target = 0, l.target = 0, t.value = {
271
- x: 0,
272
- y: 0
273
- }, n.value = {
274
- x: 0,
275
- y: 0
276
- }, p = 0, m = 0, i.value = 0, f = 0;
277
- }
278
- function O() {
279
- return !(r.value || Math.hypot(c.velocity, l.velocity) > .001 || Math.abs(c.value) > .001 || Math.abs(l.value) > .001 || f > 0 || p !== 0 || m !== 0);
280
- }
281
- return {
282
- pointer: E(t),
283
- velocity: E(n),
284
- active: E(r),
285
- pulse: E(i),
286
- idleMs: () => C,
287
- tick: v,
288
- trailSources: y,
289
- click: x,
290
- consumeClick: S,
291
- rest: T,
292
- isAtRest: O
293
- };
294
- }
295
- //#endregion
296
- //#region src/components/custom/goo-blob/composables/useBlobSatellites.ts
297
- function K(e, t, n) {
298
- return t + e() * (n - t);
299
- }
300
- function q(e) {
301
- return e < 0 ? 0 : e > 1 ? 1 : e;
302
- }
303
- function J(e, t, n) {
304
- return e + (t - e) * n;
305
- }
306
- function ue(e, t, n, r, i) {
307
- let a = t / 4 * Math.PI * 2 + (e() - .5) * Math.PI, o = n * (V + e() * H), s = r * (.3 + e() * .7);
308
- return {
309
- phase: "orbiting",
310
- phaseStart: i,
311
- phaseDuration: 6e3 + e() * 1e4,
312
- timeOrigin: i,
313
- angularSpeed: .08 + e() * .16,
314
- phaseOffset: a,
315
- baseRadiusX: o * (1 - s),
316
- baseRadiusY: o * (1 + s),
317
- wobbleAmp1: U + e() * W,
318
- wobbleFreq1: .08 + e() * .22,
319
- wobbleAmp2: ee + e() * te,
320
- wobbleFreq2: .18 + e() * .32,
321
- pertXAmp: .03 + e() * .05,
322
- pertXFreq: .06 + e() * .18,
323
- pertXPhase: e() * Math.PI * 2,
324
- pertYAmp: .03 + e() * .05,
325
- pertYFreq: .07 + e() * .17,
326
- pertYPhase: e() * Math.PI * 2,
327
- startX: 0,
328
- startY: 0,
329
- endX: 0,
330
- endY: 0
331
- };
332
- }
333
- function Y(e, t, n, r) {
334
- e.phase = t, e.phaseStart = n, e.phaseDuration = r;
335
- }
336
- function X(e, t, n, r) {
337
- let i = (t - e.timeOrigin) / 1e3, a = e.angularSpeed * n * i + e.phaseOffset, o = r * (e.wobbleAmp1 * Math.sin(e.wobbleFreq1 * i) + e.wobbleAmp2 * Math.sin(e.wobbleFreq2 * i + 1.3));
338
- return {
339
- x: (e.baseRadiusX + o) * Math.cos(a) + e.pertXAmp * Math.sin(e.pertXFreq * i + e.pertXPhase),
340
- y: (e.baseRadiusY + o) * Math.sin(a) + e.pertYAmp * Math.cos(e.pertYFreq * i + e.pertYPhase)
341
- };
342
- }
343
- function de(e, t, n, r, i) {
344
- e.timeOrigin = i, e.angularSpeed = .08 + t() * .16, e.phaseOffset = t() * Math.PI * 2;
345
- let a = n * (V + t() * H), o = r * (.3 + t() * .7);
346
- e.baseRadiusX = a * (1 - o), e.baseRadiusY = a * (1 + o), e.wobbleAmp1 = U + t() * W, e.wobbleFreq1 = .08 + t() * .22, e.wobbleAmp2 = ee + t() * te, e.wobbleFreq2 = .18 + t() * .32, e.pertXAmp = .03 + t() * .05, e.pertXFreq = .06 + t() * .18, e.pertXPhase = t() * Math.PI * 2, e.pertYAmp = .03 + t() * .05, e.pertYFreq = .07 + t() * .17, e.pertYPhase = t() * Math.PI * 2;
347
- }
348
- function fe(e, t) {
349
- let n = h(g(t + "goo")), r = [], i = [], a = [], o = -Infinity, s = e.geometry.orbitRadius;
350
- function c() {
351
- let t = e.geometry.orbitRadius;
352
- if (t !== s && s > 0) {
353
- let e = t / s;
354
- for (let t of r) t.baseRadiusX *= e, t.baseRadiusY *= e;
355
- s = t;
356
- }
357
- }
358
- function l(t) {
359
- let o = e.geometry.satelliteCount;
360
- for (; r.length < o;) r.push(ue(n, r.length, e.geometry.orbitRadius, e.geometry.eccentricity, t)), i.push({
361
- x: 0,
362
- y: 0,
363
- radius: e.geometry.satelliteRadius,
364
- opacity: 0
365
- }), a.push({
366
- x: 0,
367
- y: 0,
368
- start: 0
369
- });
370
- r.length > o && (r.length = o, i.length = o, a.length = o);
371
- }
372
- function u(t, s) {
373
- l(t), c();
374
- let u = r.length, d = s.mergeRate, f = e.geometry.satelliteRadius, p = e.satellites.mergeDuration, m = e.satellites.emergeDuration, h = e.satellites.orbitDuration, g = e.satellites.absorbedDuration;
375
- for (let c = 0; c < u; c++) {
376
- let l = r[c], u = t - l.phaseStart, _ = q(l.phaseDuration > 0 ? u / l.phaseDuration : 1);
377
- switch (l.phase) {
378
- case "orbiting":
379
- if (_ >= 1) if (t - o < 3e3 * d) l.phaseStart = t, l.phaseDuration = K(n, h[0], h[1]);
380
- else {
381
- let e = X(l, t, s.orbitSpeedScale, s.wobbleScale);
382
- l.startX = e.x, l.startY = e.y;
383
- let n = Math.hypot(e.x, e.y), r = n > .01 ? .08 / n : 0;
384
- l.endX = e.x * r, l.endY = e.y * r, Y(l, "merging", t, p), o = t;
385
- }
386
- break;
387
- case "merging":
388
- _ >= 1 && Y(l, "absorbed", t, K(n, g[0], g[1]));
389
- break;
390
- case "absorbed":
391
- if (_ >= 1) {
392
- de(l, n, e.geometry.orbitRadius, e.geometry.eccentricity, t);
393
- let r = X(l, t + 3e3, s.orbitSpeedScale, s.wobbleScale);
394
- l.endX = r.x, l.endY = r.y;
395
- let i = Math.hypot(r.x, r.y), a = i > .01 ? .08 / i : 0;
396
- l.startX = r.x * a, l.startY = r.y * a, Y(l, "emerging", t, m);
397
- }
398
- break;
399
- case "emerging":
400
- if (_ >= 1) {
401
- let e = a[c];
402
- e.x = l.endX, e.y = l.endY, e.start = t, l.timeOrigin = t, l.phaseOffset = Math.atan2(l.endY, l.endX), Y(l, "orbiting", t, K(n, h[0], h[1]));
403
- }
404
- break;
405
- }
406
- let v, y, b, x;
407
- switch (l.phase) {
408
- case "orbiting": {
409
- let e = X(l, t, s.orbitSpeedScale, s.wobbleScale), n = a[c], r = t - n.start;
410
- if (n.start > 0 && r < 2e3) {
411
- let t = q(r / ne), i = t * t * (3 - 2 * t);
412
- v = J(n.x, e.x, i), y = J(n.y, e.y, i);
413
- } else v = e.x, y = e.y;
414
- b = G, x = 1;
415
- break;
416
- }
417
- case "merging": {
418
- let e = ae(q((t - l.phaseStart) / l.phaseDuration));
419
- v = J(l.startX, l.endX, e), y = J(l.startY, l.endY, e);
420
- let n = q((t - l.phaseStart) / l.phaseDuration);
421
- b = n > .85 ? J(G, 0, (n - .85) / .15) : G, x = J(1, .65, e);
422
- break;
423
- }
424
- case "absorbed":
425
- v = 0, y = 0, b = 0, x = .5;
426
- break;
427
- case "emerging": {
428
- let e = oe(q((t - l.phaseStart) / l.phaseDuration));
429
- v = J(l.startX, l.endX, e), y = J(l.startY, l.endY, e);
430
- let n = q((t - l.phaseStart) / l.phaseDuration);
431
- b = n < .1 ? J(0, G, n / .1) : G, x = J(.65, 1, e);
432
- break;
433
- }
434
- }
435
- let S = i[c];
436
- S.x = v, S.y = y, S.radius = f * x, S.opacity = b;
437
- }
438
- }
439
- function d() {
440
- for (let e of r) e.phaseOffset += (n() - .5) * .6, e.pertXPhase += n() * Math.PI, e.pertYPhase += n() * Math.PI;
441
- }
442
- function f(e) {
443
- n = h(g(e + "goo"));
444
- }
445
- function p() {
446
- for (let e of r) if (e.phase !== "orbiting") return !1;
447
- return !0;
448
- }
449
- function m(e) {
450
- let t = Infinity;
451
- for (let e of r) {
452
- let n = e.phaseStart + e.phaseDuration;
453
- n < t && (t = n);
454
- }
455
- return t === Infinity ? e + 3e4 : t;
456
- }
457
- return {
458
- sources: i,
459
- tick: u,
460
- nudge: d,
461
- reseed: f,
462
- isQuiescent: p,
463
- nextEventMs: m
464
- };
465
- }
466
- //#endregion
3
+ import { t as n } from "./usePointerVelocityField-QLsy3_kv.js";
4
+ import { a as r, t as i } from "./useGpuSubstrate-4pTcp6mX.js";
5
+ import { n as a, t as o } from "./compile-nZ1xVYTp.js";
6
+ import { s, t as c } from "./color-Cs0-oxYL.js";
7
+ import { t as l } from "./useIntersectionPause-Dbozzjgm.js";
8
+ import { a as u, c as d, d as f, f as p, i as m, l as h, n as g, o as _, r as v, s as y, t as b, u as x } from "./uniformBridgeWGPU-CtAKl45L.js";
9
+ import { computed as S, createElementBlock as C, createElementVNode as w, defineComponent as T, inject as E, normalizeStyle as D, onScopeDispose as O, onUnmounted as k, openBlock as A, ref as j, useTemplateRef as M, watch as N } from "vue";
467
10
  //#region src/components/custom/goo-blob/shaders/metaball.vert.ts
468
- var pe = "#version 300 es\n\nin vec2 aPosition;\nout vec2 vUv;\n\nvoid main() {\n vUv = 0.5 * (aPosition + 1.0);\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}", me = "// --- SDF ---\n\nfloat sdCircle(vec2 p, vec2 center, float radius) {\n return length(p - center) - radius;\n}\n\n// AX.W15 — the VALUE+GRADIENT circle: returns vec3(d, dd/dx, dd/dy). The circle\n// gradient is the UNIT radial direction (p - center)/length(p - center) (the\n// eikonal property holds EXACTLY for a circle), guarded at the degenerate centre.\n// This is the keystone of the analytic-gradient smin: carrying the gradient\n// through the scene field DELETES the per-pixel 4-tap normal (4 full sceneDist\n// evals, each running 3-octave FBM + the sat/trail loops).\nvec3 sdgCircle(vec2 p, vec2 center, float radius) {\n vec2 d = p - center;\n float len = length(d);\n vec2 grad = len > 1e-6 ? d / len : vec2(0.0, 1.0);\n return vec3(len - radius, grad);\n}\n\n// IQ 2024 quadratic-polynomial smin, NORMALIZED so k is a blend band in distance\n// units. The k *= 4.0 pre-scale makes the h*h*k*0.25 poly's effective blend width\n// equal to k (the un-normalized form's width was 0.25*k).\nfloat sminQuadratic(float a, float b, float k) {\n k *= 4.0;\n float h = max(k - abs(a - b), 0.0) / k;\n return min(a, b) - h * h * k * 0.25;\n}\n\n// IQ circular smin — a quarter-circle fillet at the seam (rounder than the\n// quadratic). The k *= 1.0/(1.0-sqrt(0.5)) factor normalizes k to the same\n// blend-band units so the merge axis swaps shape without re-tuning uSmoothK.\nfloat sminCircular(float a, float b, float k) {\n k *= 1.0 / (1.0 - sqrt(0.5));\n float h = max(k - abs(a - b), 0.0) / k;\n return min(a, b) - k * 0.5 * (1.0 + h - sqrt(1.0 - h * (h - 2.0)));\n}\n\n// Config-gated merge dispatch — uMerge 0 = quadratic, 1 = circular.\nfloat smin(float a, float b, float k) {\n if (uMerge > 0.5) return sminCircular(a, b, k);\n return sminQuadratic(a, b, k);\n}\n\n// AX.W15 — the VALUE+GRADIENT smin. a/b are vec3(dist, grad.xy); the blended\n// gradient is mix(a.yz, b.yz, w) with the interpolation weight w the distance\n// blend uses (IQ's vec2-smin insight). This propagates the analytic gradient\n// through the merge so the surface normal reads the field gradient DIRECTLY — no\n// finite-difference tap. The blend weight matches each variant.\nvec3 sminQuadraticG(vec3 a, vec3 b, float k) {\n k *= 4.0;\n float h = max(k - abs(a.x - b.x), 0.0) / k;\n float m = h * h * k * 0.25;\n // h-weight that selects which surface dominates (0 → a, 1 → b).\n float w = (a.x < b.x) ? 0.5 * h * h : 1.0 - 0.5 * h * h;\n float dist = min(a.x, b.x) - m;\n vec2 grad = mix(a.yz, b.yz, w);\n return vec3(dist, grad);\n}\n\nvec3 sminCircularG(vec3 a, vec3 b, float k) {\n k *= 1.0 / (1.0 - sqrt(0.5));\n float h = max(k - abs(a.x - b.x), 0.0) / k;\n float m = k * 0.5 * (1.0 + h - sqrt(1.0 - h * (h - 2.0)));\n float w = (a.x < b.x) ? 0.5 * h : 1.0 - 0.5 * h;\n float dist = min(a.x, b.x) - m;\n vec2 grad = mix(a.yz, b.yz, w);\n return vec3(dist, grad);\n}\n\nvec3 sminG(vec3 a, vec3 b, float k) {\n if (uMerge > 0.5) return sminCircularG(a, b, k);\n return sminQuadraticG(a, b, k);\n}", he = "// --- Noise ---\n\nfloat hash21(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// IQ analytic-derivative gradient noise — value in .x, ANALYTIC gradient\n// (d/dx, d/dy) in .yz, from one eval. The quintic fade has a continuous 2nd\n// derivative so the gradient is smooth (a cubic smoothstep fade would crease it).\n// (Inigo Quilez, https://iquilezles.org/articles/gradientnoise/.)\nvec3 noised(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n\n // Quintic fade + its derivative.\n vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n vec2 du = 30.0 * f * f * (f * (f - 2.0) + 1.0);\n\n // Per-corner gradient vectors from the hash (centred to [-1, 1]).\n vec2 ga = -1.0 + 2.0 * vec2(hash21(i + vec2(0.0, 0.0)), hash21(i + vec2(7.3, 0.0)));\n vec2 gb = -1.0 + 2.0 * vec2(hash21(i + vec2(1.0, 0.0)), hash21(i + vec2(8.3, 0.0)));\n vec2 gc = -1.0 + 2.0 * vec2(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(7.3, 1.0)));\n vec2 gd = -1.0 + 2.0 * vec2(hash21(i + vec2(1.0, 1.0)), hash21(i + vec2(8.3, 1.0)));\n\n float va = dot(ga, f - vec2(0.0, 0.0));\n float vb = dot(gb, f - vec2(1.0, 0.0));\n float vc = dot(gc, f - vec2(0.0, 1.0));\n float vd = dot(gd, f - vec2(1.0, 1.0));\n\n // Value, remapped to [0,1] so it drops in for the prior valueNoise.\n float n = va + u.x * (vb - va) + u.y * (vc - va) + u.x * u.y * (va - vb - vc + vd);\n float value = 0.5 + 0.5 * n;\n\n // Analytic gradient (chain rule through the bilinear blend + the fade).\n vec2 grad =\n ga + u.x * (gb - ga) + u.y * (gc - ga) + u.x * u.y * (ga - gb - gc + gd) +\n du * (vec2(u.y, u.x) * (va - vb - vc + vd) + vec2(vb, vc) - va);\n return vec3(value, 0.5 * grad);\n}\n\n// Rotated-octave FBM over the analytic gradient noise: a fixed ~0.5 rad 2x2\n// rotation between octaves breaks the axis-aligned banding. The rotation CONSTANT\n// is spliced from the shared chunk (AV.W2 — the one FBM_ROT); the loops below\n// stay blob-local (param octaves + the LIQUID lacunarity/persistence, per §3a).", ge = 1.8, _e = .42, ve = `float fbm(vec2 p, int octaves) {
469
- float value = 0.0;
470
- float amp = 0.5;
471
- float freq = 1.0;
472
- for (int i = 0; i < 4; i++) {
473
- if (i >= octaves) break;
474
- value += amp * noised(p * freq).x;
475
- p = FBM_ROT * p;
476
- freq *= ${ge.toFixed(1)};
477
- amp *= ${_e.toFixed(2)};
478
- }
479
- return value;
480
- }
481
-
482
- // AX.W15 — FBM with ANALYTIC GRADIENT. Returns vec3(value, ∂/∂x, ∂/∂y). The
483
- // gradient accumulates noised()'s analytic gradient per octave, chain-ruled
484
- // through the per-octave frequency scale AND the FBM_ROT rotation: octave i samples
485
- // at R^i · (freq·p), so the gradient w.r.t. the ORIGINAL p picks up freq and
486
- // the accumulated rotation transpose (R^T)^i. The keystone feed for the
487
- // analytic surface normal — it DELETES the per-pixel 4-tap finite difference.
488
- vec3 fbmG(vec2 p, int octaves) {
489
- float value = 0.0;
490
- vec2 grad = vec2(0.0);
491
- float amp = 0.5;
492
- float freq = 1.0;
493
- // The accumulated octave rotation R^i — its transpose maps the i-th octave's
494
- // local gradient back into the ORIGINAL p frame. Seeded at identity (octave 0).
495
- mat2 rotAccum = mat2(1.0, 0.0, 0.0, 1.0);
496
- vec2 pp = p;
497
- for (int i = 0; i < 4; i++) {
498
- if (i >= octaves) break;
499
- vec3 n = noised(pp * freq);
500
- value += amp * n.x;
501
- // d(value)/dp = amp · freq · (R^i)^T · noised.yz (the rotated chain rule).
502
- grad += amp * freq * (transpose(rotAccum) * n.yz);
503
- pp = FBM_ROT * pp;
504
- freq *= ${ge.toFixed(1)};
505
- amp *= ${_e.toFixed(2)};
506
- rotAccum = FBM_ROT * rotAccum;
507
- }
508
- return vec3(value, grad);
509
- }
510
-
511
- // One domain-warp pass with the ANALYTIC GRADIENT carried (warp-Jacobian
512
- // APPROXIMATION per the SOTA deepening [2]: the warp is low-frequency, so the
513
- // gradient of the OUTER fbm dominates and the warp-offset Jacobian is dropped —
514
- // the error is sub-perceptible and full autodiff is overfit for one blob).
515
- vec3 fbmWarpedG(vec2 p, int octaves, float warpAmp) {
516
- if (warpAmp <= 0.0) return fbmG(p, octaves);
517
- vec2 q = vec2(fbm(p + vec2(0.0, 0.0), octaves), fbm(p + vec2(5.2, 1.3), octaves));
518
- return fbmG(p + warpAmp * (q - 0.5), octaves);
519
- }
520
- `, ye = "// Edit #4's gamut step — hue-preserving inward chroma clamp. If the linear result\n// is out of [0,1], bisect chroma toward 0 (L + h fixed) until in gamut. Preserves\n// hue exactly (only C shrinks). 16 steps resolve C to < 2^-16 of its span.\nbool inGamut(vec3 lin) {\n return all(greaterThanEqual(lin, vec3(0.0))) && all(lessThanEqual(lin, vec3(1.0)));\n}\nvec3 gamutClampOklch(vec3 lch) {\n vec3 lin = oklabToLinearSrgb(oklchToOklab(lch));\n if (inGamut(lin)) return lch;\n float lo = 0.0;\n float hi = lch.y;\n for (int i = 0; i < 16; i++) {\n float mid = 0.5 * (lo + hi);\n vec3 test = vec3(lch.x, mid, lch.z);\n if (inGamut(oklabToLinearSrgb(oklchToOklab(test)))) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return vec3(lch.x, lo, lch.z);\n}", be = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform vec2 uResolution;\nuniform float uTime;\nuniform vec3 uBaseColor;\n\n// Multi-stop palette (W11.b) — 2-4 in-family OKLCh stops (uploaded GAMMA sRGB, like\n// uBaseColor). uStopCount <= 1 falls back to uBaseColor (the single-color default,\n// zero regression). MAX_BLOB_STOPS is a compile-time #define.\n#define MAX_BLOB_STOPS 4\nuniform int uStopCount;\nuniform vec3 uPalette[MAX_BLOB_STOPS];\n\n// Pointer\nuniform vec2 uPointer;\nuniform float uPointerActive;\nuniform float uPointerAttraction;\nuniform float uPointerStrength;\n\n// Main body\nuniform float uBodyRadius;\n\n// Pulsation\nuniform float uPulsePhase;\nuniform float uPulseAmp;\n\n// Surface noise\nuniform float uNoiseAmp;\nuniform float uNoiseFreq;\nuniform float uNoiseSpeed;\n\n// Gooey\nuniform float uSmoothK;\nuniform float uMerge; // 0 = quadratic smin, 1 = circular smin (rounder menisci)\n\n// AX.W16 (arm 5) — the PRE-FBM bounding-discard radius (UV space). main() early-outs\n// to a transparent write for any fragment OUTSIDE this radius BEFORE the two 3-octave\n// FBM calls + the OKLCh round-trip. The renderer uploads it PADDED by every\n// outward-expanding term (body + eccentric orbit + sat radius + smin band + FBM edge\n// amplitude + click-pulse + a lean/squash safety pad) so it NEVER clips the wet\n// meniscus (IQ: inflate the bound to match any outward op).\nuniform float uMaxReach;\n\n// Membrane — domain-warp strength on the FBM edge displacement (0 = plain fbm).\nuniform float uWarpAmp;\n\n// Lit glass surface (W9.b) — gated behind uLit so the flat fill stays default.\nuniform float uLit; // 0 = flat fill (default), 1 = lit droplet\nuniform vec3 uRimColor; // Fresnel rim tint (GAMMA sRGB, via the /color leaf)\nuniform vec3 uLightDir; // normalized light direction (x, y, z)\nuniform float uSpecStrength; // Blinn-Phong specular weight\nuniform float uSpecShininess; // specular exponent (16-64, tight glint)\nuniform float uRimPower; // Fresnel/Schlick exponent (~2-3)\nuniform float uRimStrength; // Fresnel rim weight\n\n// Iridescence + fake subsurface (W11.a) — translucent-gel read.\nuniform float uIridescence; // warm-pearl rim sheen weight (0 = off)\nuniform float uIridHue; // base hue (radians) the cosine palette biases toward (warm)\nuniform float uIridSpeed; // animated-thickness scroll for the iridescent t\nuniform float uSssScale; // fast-SSS back-light weight\nuniform float uSssPower; // fast-SSS exponent\nuniform float uCoreGlow; // thickness-driven inner-luminosity lift\n\n// Color perturbation (perceptually uniform — OKLCh L/C/h)\nuniform float uHueRange; // degrees of hue swing (converted to radians)\nuniform float uSatShift; // OKLCh chroma swing\nuniform float uBrightnessShift; // OKLCh lightness bias\nuniform float uColorNoiseFreq;\nuniform float uColorNoiseSpeed;\n\n// Satellites (max 4)\n#define MAX_SATS 4\nuniform int uSatCount;\nuniform vec2 uSatPos[MAX_SATS];\nuniform float uSatRadius[MAX_SATS];\nuniform float uSatOpacity[MAX_SATS];\n\n// Pointer trail (W10) — a decaying-radius pseudopod toward the cursor. uTrail is a\n// COMPILE-TIME-SIZED array (GLSL ES 3.00 forbids a uniform-sized array) with a\n// DYNAMIC break on uTrailCount, mirroring the satellite loop. Later samples paint\n// smaller metaballs (r *= 1 - i/N) so the trail tapers into a tail.\n#define TRAIL_N 15\nuniform int uTrailCount;\nuniform vec2 uTrailPos[TRAIL_N];\nuniform float uTrailRadius[TRAIL_N];\n\n// Velocity-driven volume-preserving squash-and-stretch (W10).\nuniform vec2 uVelocity; // smoothed pointer velocity (motion direction + speed)\nuniform float uStretch; // squash-stretch magnitude (0 = off)\n\nconst float PI = 3.141592653589793;\n", Z = "\n", xe = be + Z + he + Z + `${i}
521
-
522
- ` + ve + Z + me + Z + `
523
- // --- Color (Ottosson OKLab/OKLCh — value.js EXACT constants, transposed) ---
524
- //
525
- // The OETF (srgbToLinear/linearToSrgb) + the four Ottosson matrices + their space
526
- // conversions are SPLICED from the shared chunk (AV.W2 —
527
- // src/composables/glass/webgl/shaders/procedural-color.glsl.ts). They live there
528
- // ONCE so the OETF can never diverge from aurora's; the line-for-line TS port
529
- // (__tests__/metaball-color.glsl-port.ts) mirrors that chunk. The gamut-clamp
530
- // below stays blob-local (aurora has no in-shader OKLCh path).
531
- ${n}
532
- ${r}
533
-
534
- ` + ye + Z + "\n// AX.W15 — de-synced breath. The body throb was a single sin(uPulsePhase) — a\n// mechanical pulse that re-syncs every cycle. Three DETUNED sines at IRRATIONAL\n// frequency ratios (1, 0.13/0.09 ≈ 1.444, 0.31) never re-phase, so the membrane\n// breathes like a living creature (an asymmetric slower-exhale calm band) rather\n// than a metronome. Normalized so the composite stays in ~[-1, 1].\nfloat breath(float phase) {\n return (sin(phase)\n + 0.5 * sin(phase * 1.4444 + 1.7)\n + 0.28 * sin(phase * 0.31 + 4.1)) / 1.78;\n}\n\n// AX.W15 — the composite SDF field WITH its ANALYTIC GRADIENT, returned as\n// vec3(dist, ∂d/∂x, ∂d/∂y). The domain-warped body membrane smin-merged with the\n// satellites + trail; the gradient propagates through sminG's mix(a.yz, b.yz, h)\n// so the surface normal reads the field gradient DIRECTLY (the 4-tap finite\n// difference is DELETED — its 4 full evals per lit pixel are gone).\n//\n// The ANISOTROPIC SQUASH (W10 volume-preserving stretch) is a linear map\n// bodyUv = D·R·uv (R rotates world→(motion-axis, perp); D = diag(1/sa, sa)). The\n// body field's gradient is computed in bodyUv space, so it MUST be transformed back\n// to uv space by M^T = R^T·D (the inverse-transpose handling the SOTA-deepening [2]\n// warns the 4-tap did implicitly by sampling in screen space).\nvec3 sceneDistG(vec2 uv) {\n // De-synced pulsing body radius.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Velocity-driven VOLUME-PRESERVING squash-and-stretch (W10), SATURATED (AX.W46\n // D5). sa is the stretch along motion, EXACTLY 1/sa perpendicular (area-preserving).\n // The basis (ax, perp) is captured so the gradient can be transformed back below.\n //\n // The W10 form sa = 1 + speed*uStretch rode an UNBOUNDED critically-damped spring\n // velocity (O(5-8)/s on a fast flick) -> sa ~ 1.78-2.25x elongation, a violent\n // taffy-pull. A tanh saturation sa = 1 + tanh(speed*k)*uStretch caps the elongation\n // at 1 + uStretch (~1.5x at the default stretch 0.5) no matter how fast the flick —\n // the fastest flick reads as a lively bounce, never a rubber-band snap (the standard\n // volume-preserving squash-and-stretch restraint). k = 1.6 keeps the tanh in its\n // near-linear regime for a slow drag (the gentle squash still reads) and saturates\n // only the fast flick.\n vec2 bodyUv = uv;\n vec2 ax = vec2(1.0, 0.0);\n vec2 perp = vec2(0.0, 1.0);\n float sa = 1.0;\n float speed = length(uVelocity);\n bool squashed = uStretch > 0.0 && speed > 1e-4;\n if (squashed) {\n ax = uVelocity / speed;\n perp = vec2(-ax.y, ax.x);\n sa = 1.0 + tanh(speed * 1.6) * uStretch;\n bodyUv = vec2(dot(uv, ax) / sa, dot(uv, perp) * sa);\n }\n\n // Domain-warped FBM displacement WITH its analytic gradient (the warp-Jacobian\n // approximation per [2]). disp = (noiseVal - 0.5) · uNoiseAmp; its gradient in\n // bodyUv space is uNoiseAmp · uNoiseFreq · fbmGrad (the uNoiseFreq chain factor\n // from the bodyUv·uNoiseFreq argument).\n vec3 fbmv = fbmWarpedG(bodyUv * uNoiseFreq + uTime * uNoiseSpeed, 3, uWarpAmp);\n float bodyDisplacement = (fbmv.x - 0.5) * uNoiseAmp;\n vec2 dispGradBody = uNoiseAmp * uNoiseFreq * fbmv.yz;\n\n // Body circle WITH gradient (in bodyUv space). The displaced radius subtracts\n // the displacement, so the body gradient is circleGrad - dispGrad (sign per\n // [2]: d = circleDist - displacement ⇒ grad = circleGrad - dispGrad).\n vec3 bodyG = sdgCircle(bodyUv, vec2(0.0), bodyR + bodyDisplacement);\n vec2 bodyGradBody = bodyG.yz - dispGradBody;\n\n // Transform the body gradient back to uv space: g_uv = R^T · D · g_body, i.e.\n // scale by D = diag(1/sa, sa) in the (ax, perp) frame then reconstruct in world.\n vec2 bodyGradUv;\n if (squashed) {\n vec2 scaled = vec2(bodyGradBody.x / sa, bodyGradBody.y * sa);\n bodyGradUv = scaled.x * ax + scaled.y * perp;\n } else {\n bodyGradUv = bodyGradBody;\n }\n vec3 d = vec3(bodyG.x, bodyGradUv);\n\n // Satellites — smin-merged into the body (uMerge selects quadratic/circular).\n for (int i = 0; i < MAX_SATS; i++) {\n if (i >= uSatCount) break;\n vec3 satG = sdgCircle(uv, uSatPos[i], uSatRadius[i]);\n satG.x += (1.0 - uSatOpacity[i]) * 0.3;\n d = sminG(d, satG, uSmoothK);\n }\n\n // Pointer trail — a decaying-radius pseudopod reaching toward the cursor,\n // smin-merged so it stretches an elastic limb and snaps back.\n for (int i = 0; i < TRAIL_N; i++) {\n if (i >= uTrailCount) break;\n vec3 trailG = sdgCircle(uv, uTrailPos[i], uTrailRadius[i]);\n d = sminG(d, trailG, uSmoothK);\n }\n return d;\n}\n\n// AX.W15 — the analytic surface normal. The field gradient grad2d arrives\n// DIRECTLY from sceneDistG (no 4-tap). The smin field is sub-unit (the CD family\n// |grad| ≤ 1) so the gradient is NOT unit-length — normalize() before the dome\n// lift (the unit contract is on the FINAL lifted normal N, not the raw field\n// gradient). The Z dome: 'interior' is the normalized depth inward from the rim\n// (-d/bodyR); z = sqrt(1 - (1 - interior)^2) is the unit half-sphere profile (flat\n// centre, steep rim). N tilts outward along the field gradient near the rim and\n// points at the viewer deep inside.\nvec3 surfaceNormalFromGrad(vec2 grad2d, float d, float bodyR) {\n vec2 g = normalize(grad2d + vec2(1e-6));\n float interior = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0);\n float z = sqrt(max(0.0, 1.0 - (1.0 - interior) * (1.0 - interior)));\n return normalize(vec3(g * (1.0 - z), z) + vec3(0.0, 0.0, 1e-6));\n}\n\n// W11.b — sample the multi-stop palette at t in [0,1], interpolating adjacent\n// stops in OKLab with a MIDPOINT CHROMA-BUMP (a linear OKLab mix of a vivid pair\n// dips chroma through grey; the bump lifts it back). Falls back to uBaseColor when\n// uStopCount <= 1. Returns an OKLCh stop [L, C, h(rad)].\nvec3 samplePaletteOklch(float t) {\n if (uStopCount <= 1) return oklabToOklch(srgbToOklab(uBaseColor));\n float n = float(uStopCount);\n float ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n int i0 = int(floor(ft));\n int i1 = min(i0 + 1, uStopCount - 1);\n float f = ft - float(i0);\n // Fetch adjacent stops (uPalette is gamma sRGB) → OKLab.\n vec3 labA = srgbToOklab(uPalette[i0]);\n vec3 labB = srgbToOklab(uPalette[i1]);\n vec3 lab = mix(labA, labB, f);\n vec3 lch = oklabToOklch(lab);\n // Midpoint chroma-bump: a bell (peaks at f=0.5) lifts C off the grey midpoint.\n lch.y += 0.03 * sin(PI * f);\n return lch;\n}\n\nvoid main() {\n vec2 uv = vUv - 0.5;\n\n // AX.W16 (arm 5) — PRE-FBM bounding early-out. The oversized canvas (1.6x the\n // wrapper) runs the full fragment ALU — two 3-octave FBM evals + the OKLCh\n // round-trip + the lit/iridescence/SSS block — on a large transparent border\n // otherwise (~60% of the canvas is outside the droplet reach). Any fragment beyond\n // uMaxReach (the PADDED worst-case painted reach, uploaded so it never clips the\n // wet meniscus) writes transparent and returns BEFORE any of that work. This is a\n // transparent WRITE, NOT a GLSL discard: the pass is a pure premultiplied blend\n // with no depth, and discard disables the tiled-renderer fast path on mobile GPUs.\n // No fwidth is computed before the return, so there is no\n // derivative-in-non-uniform-control-flow hazard (the kept pixels compute their own\n // fwidth normally below). The pad covers the pointer-lean uv shift, so testing the\n // pre-deform uv is safe.\n if (dot(uv, uv) > uMaxReach * uMaxReach) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Pointer deformation — honor the SIGN of uPointerAttraction (W10): a positive\n // attraction leans the body IN toward the cursor, a negative shies it AWAY. The\n // signed influence flows straight into the UV shift (no hardcoded repulsion).\n //\n // AY.W-BLOB-CONFIG D2 — the SIGN was INVERTED in the rendered result. The\n // sample-shift sign here was uv -= dir*influence; the live readback (an attraction\n // sweep over a HELD pointer) measured the body shifting MORE toward the cursor as\n // attraction went MORE NEGATIVE (a=-1 -> +0.081, a=0 -> +0.063, a=+1 -> +0.042) —\n // exactly inverted: a shy-away -1 LUNGED at the cursor, a lean-in +1 pulled back.\n // pointerDir = uPointer - uv is the toward-pointer direction in SAMPLE space; to\n // MOVE the rendered body TOWARD the pointer the sample must shift ALONG pointerDir\n // (sample the field from where the pointer is), so the sign is uv += dir*influence.\n // A positive attraction now shifts the body toward the cursor (leans in), a negative\n // shifts it away (shies) — the sign the comment + the demo slider always promised,\n // now true in the render.\n //\n // AX.W46 D5 — the falloff radius NARROWS 0.65 → 0.5 (the calm-lean reconciliation).\n // The W15 REDRESS widened it to 0.65 to clear a synthetic floor; the live π-lane\n // read the result as a LUNGE. The drama lives in the STRENGTH (pointerStrength,\n // dropped to 0.18 in types.ts), NOT the falloff — the falloff's job is purely to keep\n // the lean COHERENT across the creature so the body, satellites and trail all tilt\n // toward the cursor as ONE. At 0.5 the body (sitting ≈0.2 uv from the cursor on a\n // hover-flick) is still well inside the cutoff, so the whole creature tilts as one —\n // a gentle, coherent \"it notices you\" lean rather than the body lunging a body-width.\n if (uPointerActive > 0.5) {\n vec2 pointerDir = uPointer - uv;\n float pointerDist = length(pointerDir);\n float influence = smoothstep(0.5, 0.0, pointerDist) * uPointerAttraction * uPointerStrength;\n uv += normalize(pointerDir + 1e-6) * influence;\n }\n\n // The de-synced pulsing body radius — also reused below for the inner-glow scale.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Composite domain-warped membrane field WITH its analytic gradient (AX.W15).\n vec3 scene = sceneDistG(uv);\n float d = scene.x;\n vec2 fieldGrad = scene.yz;\n\n // Edit #1 — fwidth-based anti-aliased edge: derive the smoothstep half-width\n // from the SDF screen-space gradient so the edge stays ~1px regardless of zoom.\n float aa = max(fwidth(d), 1e-6);\n float alpha = 1.0 - smoothstep(-aa, aa, d);\n\n if (alpha < 0.001) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Edit #4 — perceptually-uniform OKLCh variation. Gamma base → linear → OKLab\n // → OKLCh; perturb L/C/h; OKLCh → OKLab → linear; hue-preserving gamut clamp.\n // The base is the multi-stop palette sample (W11.b) — distributed across the\n // body/satellites by the color noise field — or uBaseColor when single-stop.\n float colorNoise = fbm(uv * uColorNoiseFreq + uTime * uColorNoiseSpeed, 3);\n vec3 oklch = samplePaletteOklch(colorNoise);\n\n oklch.z += (colorNoise - 0.5) * uHueRange * (PI / 180.0); // hue swing, radians\n oklch.y = max(oklch.y + (colorNoise - 0.5) * uSatShift, 0.0); // chroma swing\n oklch.x = clamp(oklch.x + uBrightnessShift, 0.0, 1.0); // lightness bias\n\n // Surface normal — from the ANALYTIC field gradient (AX.W15: the 4-tap is\n // deleted). Computed ONCE here and reused by the iridescence (W11.a), the\n // fake-SSS (W11.a), and the lit glass block (W9.b).\n vec3 N = surfaceNormalFromGrad(fieldGrad, d, bodyR);\n vec3 V = vec3(0.0, 0.0, 1.0);\n float thickness = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0); // 0 at rim, ~1 deep in\n float fres = pow(1.0 - max(dot(N, V), 0.0), 2.5); // rim-weighted angle\n\n // ── W11.a iridescence — warm-biased IQ cosine palette driving OKLCh HUE ──\n //\n // A thin-film-like sheen on the RIM (fres-weighted), NOT the cold-blue default:\n // an IQ cosine palette (a + b*cos(2pi(c*t + d))) maps the Fresnel/edge angle +\n // the FBM color field + an animated thickness onto a HUE OFFSET biased to the\n // warm arc (uIridHue), with the chroma clamped to a warm-pearl band so the rim\n // reads cream/gold (congruent with the warm-cream-glass identity). Mixed into\n // OKLCh BEFORE the gamut clamp. Default LOW.\n if (uIridescence > 0.0) {\n float t = fres + 0.3 * colorNoise + uTime * uIridSpeed;\n // Cosine palette in HUE space, centred on the warm uIridHue (~0.18 turn of\n // warm sweep so the sheen shimmers gold→peach, never swinging to cold blue).\n float iridHue = uIridHue + 0.18 * PI * cos(2.0 * PI * t);\n float w = fres * uIridescence; // rim-weighted blend\n oklch.z = mix(oklch.z, iridHue, w);\n // Warm-pearl chroma cap: lift chroma toward a pale-pearl band, clamped.\n oklch.y = min(oklch.y + 0.04 * w, oklch.y + 0.08);\n oklch.x = min(oklch.x + 0.05 * w, 1.0); // a touch brighter at the sheen\n }\n\n // ── W11.a fake subsurface translucency — thickness inner-glow + back-light ──\n //\n // A bright translucent CORE fading to a light-leaking EDGE (the -d ramp) plus\n // the fast-SSS back-light (light wrapping through the thin rim). Both lift OKLCh\n // L and warm the hue, consuming the W9 normal. In OKLCh before the gamut clamp.\n if (uCoreGlow > 0.0 || uSssScale > 0.0) {\n // Beer-Lambert inner luminosity (AX.W15): a SATURATING 1 - exp(-k·thickness)\n // curve — a flat thick core with a fast warm rim falloff — NOT the linear\n // coreGlow·thickness ramp (which over-brightens deep interiors). k ≈ 3 reads\n // as glass depth.\n oklch.x = min(oklch.x + uCoreGlow * (1.0 - exp(-3.0 * thickness)), 1.0);\n // Fast-SSS back-light: light wrapping through the thin (low-thickness) rim.\n vec3 L = normalize(uLightDir + vec3(1e-6));\n float back = pow(clamp(dot(V, -(L + N * thickness)), 0.0, 1.0), uSssPower);\n float sss = back * uSssScale * (1.0 - thickness);\n oklch.x = min(oklch.x + sss, 1.0);\n // Warm the THIN leaking rim only (scale by 1 - thickness): the SSS hue-warm\n // shift rides the rim, not the core (AX.W15 — only the thin rim warms).\n oklch.z += sss * 0.1 * (1.0 - thickness);\n }\n\n oklch = gamutClampOklch(oklch);\n\n vec3 lin = oklabToLinearSrgb(oklchToOklab(oklch));\n\n // ── W9.b lit glass surface — Blinn-Phong glint + Fresnel rim, in LINEAR ──\n //\n // The lit terms enter lin in LINEAR space BEFORE the OETF (linearToSrgb)\n // and BEFORE the * alpha premultiply — a post-OETF apply double-gammas the\n // highlight and fringes the premultiplied edge (the named A5/A2 trap). The\n // prior flat inner-glow lift is SUBSUMED by the Fresnel rim (the curvature\n // read now comes from the surface normal, not a flat smoothstep). Gated behind\n // uLit so the flat fill stays the default (zero regression).\n if (uLit > 0.5) {\n // N, V, thickness are already computed in main() (reused by iridescence/SSS).\n vec3 L = normalize(uLightDir + vec3(1e-6)); // light direction\n vec3 H = normalize(L + V); // Blinn-Phong half-vector\n\n // Warm-cream specular glint — a near-white OKLCh TINT (L~0.97, C~0.03,\n // hue~85°) routed through the SAME spliced OKLCh matrices, NOT hardcoded\n // sRGB white (pure white reads cheap-CG). Linearized for the linear add.\n vec3 warmCream = oklabToLinearSrgb(oklchToOklab(vec3(0.97, 0.03, radians(85.0))));\n\n // ENERGY-CONSERVING Blinn-Phong (AX.W15 [9]): the (shininess+2)/8 factor\n // DECOUPLES shininess from strength (without it, raising shininess dims the\n // glint, so the two knobs fight). SPECULAR ANTIALIASING: the FBM membrane\n // makes the normal vary fast, so a tight glint (16-64) STROBES on small\n // dock-grid blobs. Widen the effective lobe where the normal varies\n // (Toksvig-style fwidth clamp) — drop shininess, NOT raise it. nVar reads\n // the screen-space normal derivative; a high-variance pixel softens the\n // exponent so the glint stays stable.\n float nVar = length(fwidth(N));\n float shininess = uSpecShininess / (1.0 + 24.0 * nVar);\n float energyNorm = (shininess + 2.0) / 8.0;\n float spec = pow(max(dot(N, H), 0.0), shininess) * uSpecStrength * energyNorm;\n\n // Fresnel/Schlick rim — fed uRimColor (the --foreground warm rim via the\n // /color leaf). FOREGROUND-AWARE MIN-CONTRAST GUARD (AX.W15 [10]):\n // a var(--primary) blob in dark mode resolves a rim near the BODY color, so\n // the rim washes out (no contrast). When the rim's luminance sits too close\n // to the body's, the guard CHROMA-REDUCES and L-LIFTS the rim stop (a\n // perceptual move, NOT a re-tint) so the curved rim always reads. Computed in\n // OKLCh so the lift is perceptual.\n vec3 rimOkl = oklabToOklch(srgbToOklab(uRimColor));\n float bodyL = oklch.x; // the post-perturb body lightness\n float dL = abs(rimOkl.x - bodyL);\n // If the rim is within 0.22 L of the body, push it AWAY (lift if the body is\n // dark, the dark-mode primary case; the chroma-reduce keeps it neutral-warm).\n float lack = clamp((0.22 - dL) / 0.22, 0.0, 1.0);\n rimOkl.x = clamp(mix(rimOkl.x, (bodyL < 0.5 ? 0.92 : 0.18), lack), 0.0, 1.0);\n rimOkl.y *= mix(1.0, 0.5, lack); // chroma-reduce toward a pale pearl\n vec3 rimLin = oklabToLinearSrgb(oklchToOklab(rimOkl));\n\n float rimFres = pow(1.0 - max(dot(N, V), 0.0), uRimPower);\n float rim = rimFres * uRimStrength * (1.0 - 0.6 * thickness);\n\n // Combine the two warm highlights and add in LINEAR. max(spec, rim*scale)\n // keeps the glint from stacking on the rim into a blown hotspot.\n //\n // AX.W46 D4 — CLAMP the linear highlight below unity before the add (the\n // belt-and-braces guard the re-derived specStrength makes rarely-binding but\n // never lets a worst-case normal blow to a hard white spot). The energy-\n // conserving Blinn-Phong CAN still spike on a grazing normal where the Toksvig\n // widen has not kicked in; capping the highlight magnitude at 0.85 (a contained\n // warm gleam, sub-unity) means the OETF clamp below can never crush a\n // pure-white pixel over the dome. The cap is on the highlight ALONE (not the\n // composited lin), so the body color underneath is untouched — it caps only\n // the additive catch-light's energy.\n vec3 highlight = max(warmCream * spec, rimLin * rim);\n highlight = min(highlight, vec3(0.85));\n lin += highlight;\n }\n\n vec3 rgb = clamp(linearToSrgb(lin), 0.0, 1.0); // MANDATORY OETF — closes the seam\n\n // IGN dither (AX.W15 [2][9]) — the low-chroma warm-cream dome BANDS on 8-bit\n // panels (visible Mach steps in the smooth L roll). Interleaved-gradient noise at\n // 1/255, applied AFTER linearToSrgb and BEFORE the *alpha premultiply (aurora\n // ships the same splice). A triangular ±0.5 LSB dither decorrelates the steps.\n float ign = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));\n rgb = clamp(rgb + (ign - 0.5) / 255.0, 0.0, 1.0);\n\n // Edit #8 — premultiply AFTER the OETF: straight-alpha gamma → premultiplied.\n fragColor = vec4(rgb * alpha, alpha);\n}";
535
- //#endregion
536
- //#region src/components/custom/goo-blob/composables/uploadBlobUniforms.ts
537
- function Se(e, t, n, r, i, a, o, s, c) {
538
- let { U: l, satPosLocs: u, satRadLocs: d, satOpLocs: f, trailPosLocs: p, trailRadLocs: m, paletteLocs: h } = r, { params: g, rgb: _, simTimeMs: v, timeSec: y, resolveColor: b, rimColor: x, paletteStops: S } = c, { geometry: C, membrane: w, color: T, surface: E, interaction: D } = a;
539
- e.useProgram(t), e.bindVertexArray(n), e.uniform2f(l.uResolution, i.width, i.height), e.uniform1f(l.uTime, v / 1e3), e.uniform3f(l.uBaseColor, _[0], _[1], _[2]);
540
- let O = S, k = Math.min(O.length, 4);
541
- e.uniform1i(l.uStopCount, k);
542
- for (let t = 0; t < 4; t++) {
543
- let n = h[t] ?? null, r = O[t];
544
- if (r) {
545
- let t = b(r);
546
- e.uniform3f(n, t[0], t[1], t[2]);
547
- } else e.uniform3f(n, _[0], _[1], _[2]);
548
- }
549
- let A = o.pointer.value, j = D.pointerAttraction + g.pointerAttraction;
550
- e.uniform2f(l.uPointer, A.x * .5 * N, A.y * .5 * N), e.uniform1f(l.uPointerActive, +!!o.active.value), e.uniform1f(l.uPointerAttraction, j), e.uniform1f(l.uPointerStrength, D.pointerStrength * N);
551
- let M = Math.max(0, Math.min(1, j)), P = o.velocity.value;
552
- e.uniform2f(l.uVelocity, P.x * .5 * N, P.y * .5 * N), e.uniform1f(l.uStretch, D.stretch);
553
- let F = o.trailSources(C.satelliteRadius * .7 * M);
554
- e.uniform1i(l.uTrailCount, F.count);
555
- for (let t = 0; t < 15; t++) {
556
- let n = p[t] ?? null, r = m[t] ?? null, i = F.sources[t];
557
- i ? (e.uniform2f(n, i.x * .5 * N, i.y * .5 * N), e.uniform1f(r, i.radius * N)) : (e.uniform2f(n, 0, 0), e.uniform1f(r, 0));
558
- }
559
- e.uniform1f(l.uBodyRadius, C.bodyRadius * N), e.uniform1f(l.uPulsePhase, y * w.pulseFreq * g.pulseFreq * Math.PI * 2);
560
- let I = o.pulse.value * D.clickImpulse;
561
- e.uniform1f(l.uPulseAmp, (w.pulseAmp * g.pulseAmp / .015 + I) * N), e.uniform1f(l.uNoiseAmp, w.noiseAmp * g.noiseAmp / .025 * N), e.uniform1f(l.uNoiseFreq, w.noiseFreq), e.uniform1f(l.uNoiseSpeed, w.noiseSpeed), e.uniform1f(l.uWarpAmp, w.warpAmp);
562
- let L = C.orbitRadius * 1.2 * (1 + C.eccentricity), R = w.smoothK * g.smoothK, z = Math.max(0, L - C.satelliteRadius - C.bodyRadius), B = R > 0 ? Math.min(1.25, 1 + z / R) : 1;
563
- e.uniform1f(l.uSmoothK, R * B * N), e.uniform1f(l.uMerge, +(w.merge === "circular"));
564
- let V = L + C.satelliteRadius, H = (Math.max(C.bodyRadius, V) + R * B + w.noiseAmp * g.noiseAmp / .025 + Math.abs(o.pulse.value) * D.clickImpulse) * N + .1;
565
- e.uniform1f(l.uMaxReach, H), e.uniform1f(l.uHueRange, T.hueRange + g.hueRange), e.uniform1f(l.uSatShift, T.satShift + g.satShift), e.uniform1f(l.uBrightnessShift, T.brightnessShift + g.brightnessShift), e.uniform1f(l.uColorNoiseFreq, T.colorNoiseFreq), e.uniform1f(l.uColorNoiseSpeed, T.colorNoiseSpeed), e.uniform1f(l.uLit, +!!E.lit);
566
- let U = b(x);
567
- e.uniform3f(l.uRimColor, U[0], U[1], U[2]), e.uniform3f(l.uLightDir, E.lightDir[0], E.lightDir[1], E.lightDir[2]), e.uniform1f(l.uSpecStrength, E.specStrength), e.uniform1f(l.uSpecShininess, E.specShininess), e.uniform1f(l.uRimPower, E.rimPower), e.uniform1f(l.uRimStrength, E.rimStrength), e.uniform1f(l.uIridescence, E.iridescence * g.iridScale), e.uniform1f(l.uIridHue, E.iridHue * (Math.PI / 180)), e.uniform1f(l.uIridSpeed, E.iridSpeed), e.uniform1f(l.uSssScale, E.sssScale * g.iridScale), e.uniform1f(l.uSssPower, E.sssPower), e.uniform1f(l.uCoreGlow, E.coreGlow);
568
- let W = s.sources;
569
- e.uniform1i(l.uSatCount, W.length);
570
- for (let t = 0; t < 4; t++) {
571
- let n = u[t] ?? null, r = d[t] ?? null, i = f[t] ?? null, a = W[t];
572
- a ? (e.uniform2f(n, a.x * N, a.y * N), e.uniform1f(r, a.radius * N), e.uniform1f(i, a.opacity)) : (e.uniform2f(n, 0, 0), e.uniform1f(r, 0), e.uniform1f(i, 0));
573
- }
574
- e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), e.drawArrays(e.TRIANGLES, 0, 6), e.bindVertexArray(null);
575
- }
576
- //#endregion
577
- //#region src/components/custom/goo-blob/composables/buildMetaballProgram.ts
578
- var Q = "[GooBlob]";
579
- function Ce(e) {
580
- let t = d(e, e.VERTEX_SHADER, pe, Q), n = d(e, e.FRAGMENT_SHADER, xe, Q), r = u(e, t, n, Q);
11
+ var P = "#version 300 es\n\nin vec2 aPosition;\nout vec2 vUv;\n\nvoid main() {\n vUv = 0.5 * (aPosition + 1.0);\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}", F = "[GooBlob]";
12
+ function I(e) {
13
+ let t = o(e, e.VERTEX_SHADER, P, F), n = o(e, e.FRAGMENT_SHADER, _, F), r = a(e, t, n, F);
581
14
  e.useProgram(r);
582
15
  let i = e.createVertexArray();
583
16
  e.bindVertexArray(i);
584
- let a = e.createBuffer();
585
- e.bindBuffer(e.ARRAY_BUFFER, a), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
17
+ let s = e.createBuffer();
18
+ e.bindBuffer(e.ARRAY_BUFFER, s), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
586
19
  -1,
587
20
  -1,
588
21
  1,
@@ -596,12 +29,12 @@ function Ce(e) {
596
29
  1,
597
30
  1
598
31
  ]), e.STATIC_DRAW);
599
- let o = e.getAttribLocation(r, "aPosition");
600
- e.enableVertexAttribArray(o), e.vertexAttribPointer(o, 2, e.FLOAT, !1, 0, 0);
601
- let s = {};
602
- for (let t of re) s[t] = e.getUniformLocation(r, t);
603
- let c = [], l = [], f = [];
604
- for (let t = 0; t < 4; t++) c.push(e.getUniformLocation(r, `uSatPos[${t}]`)), l.push(e.getUniformLocation(r, `uSatRadius[${t}]`)), f.push(e.getUniformLocation(r, `uSatOpacity[${t}]`));
32
+ let c = e.getAttribLocation(r, "aPosition");
33
+ e.enableVertexAttribArray(c), e.vertexAttribPointer(c, 2, e.FLOAT, !1, 0, 0);
34
+ let l = {};
35
+ for (let t of x) l[t] = e.getUniformLocation(r, t);
36
+ let u = [], d = [], f = [];
37
+ for (let t = 0; t < 4; t++) u.push(e.getUniformLocation(r, `uSatPos[${t}]`)), d.push(e.getUniformLocation(r, `uSatRadius[${t}]`)), f.push(e.getUniformLocation(r, `uSatOpacity[${t}]`));
605
38
  let p = [], m = [];
606
39
  for (let t = 0; t < 15; t++) p.push(e.getUniformLocation(r, `uTrailPos[${t}]`)), m.push(e.getUniformLocation(r, `uTrailRadius[${t}]`));
607
40
  let h = [];
@@ -611,11 +44,11 @@ function Ce(e) {
611
44
  vs: t,
612
45
  fs: n,
613
46
  vao: i,
614
- buf: a,
47
+ buf: s,
615
48
  locs: {
616
- U: s,
617
- satPosLocs: c,
618
- satRadLocs: l,
49
+ U: l,
50
+ satPosLocs: u,
51
+ satRadLocs: d,
619
52
  satOpLocs: f,
620
53
  trailPosLocs: p,
621
54
  trailRadLocs: m,
@@ -624,522 +57,23 @@ function Ce(e) {
624
57
  };
625
58
  }
626
59
  //#endregion
627
- //#region src/components/custom/goo-blob/shaders/metaball.wgsl.ts
628
- var we = `
629
- const MAX_SATS: i32 = 4;
630
- const TRAIL_N: i32 = 15;
631
- const MAX_BLOB_STOPS: i32 = 4;
632
- const PI: f32 = 3.141592653589793;
633
- const FBM_LACUNARITY: f32 = 1.8;
634
- const FBM_GAIN: f32 = 0.42;
635
-
636
- // ── Uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──
637
- // Scalars packed into vec4 lanes; per-satellite / per-trail / per-palette rows packed
638
- // into a vec4 so the array stride is the natural 16 bytes (no std140 stride trap — the
639
- // parity-blowout suspect the wave's §Triumvirate names).
640
- struct Uniforms {
641
- // s0: (uTime, uBodyRadius, uPulsePhase, uPulseAmp)
642
- s0: vec4<f32>,
643
- // s1: (uNoiseAmp, uNoiseFreq, uNoiseSpeed, uWarpAmp)
644
- s1: vec4<f32>,
645
- // s2: (uSmoothK, uMerge, uMaxReach, uLit)
646
- s2: vec4<f32>,
647
- // s3: (uSpecStrength, uSpecShininess, uRimPower, uRimStrength)
648
- s3: vec4<f32>,
649
- // s4: (uIridescence, uIridHue, uIridSpeed, uSssScale)
650
- s4: vec4<f32>,
651
- // s5: (uSssPower, uCoreGlow, uHueRange, uSatShift)
652
- s5: vec4<f32>,
653
- // s6: (uBrightnessShift, uColorNoiseFreq, uColorNoiseSpeed, uStretch)
654
- s6: vec4<f32>,
655
- // s7: (uPointerActive, uPointerAttraction, uPointerStrength, _pad)
656
- s7: vec4<f32>,
657
- // ptr: (uPointer.x, uPointer.y, uVelocity.x, uVelocity.y)
658
- ptr: vec4<f32>,
659
- // base: (uBaseColor.rgb, _pad)
660
- base: vec4<f32>,
661
- // rim: (uRimColor.rgb, _pad)
662
- rim: vec4<f32>,
663
- // light: (uLightDir.xyz, _pad)
664
- light: vec4<f32>,
665
- // res: (uResolution.x, uResolution.y, _pad, _pad)
666
- res: vec4<f32>,
667
- // ints: (uStopCount, uSatCount, uTrailCount, _pad)
668
- ints: vec4<i32>,
669
- palette: array<vec4<f32>, 4>,
670
- satPos: array<vec4<f32>, 4>, // (pos.x, pos.y, radius, opacity)
671
- trailPos: array<vec4<f32>, 15>, // (pos.x, pos.y, radius, _pad)
672
- };
673
-
674
- @group(0) @binding(0) var<uniform> u: Uniforms;
675
-
676
- // ── Noise (blob-LOCAL 3D-p3 hash + IQ analytic-derivative gradient noise) ──
677
- fn hash21(p: vec2<f32>) -> f32 {
678
- var p3 = fract(vec3<f32>(p.x, p.y, p.x) * 0.1031);
679
- p3 = p3 + dot(p3, p3.yzx + 33.33);
680
- return fract((p3.x + p3.y) * p3.z);
681
- }
682
-
683
- // IQ analytic-derivative gradient noise — value in .x, ANALYTIC gradient (d/dx, d/dy) in
684
- // .yz, from one eval. The quintic fade has a continuous 2nd derivative.
685
- fn noised(p: vec2<f32>) -> vec3<f32> {
686
- let i = floor(p);
687
- let f = fract(p);
688
- let uu = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);
689
- let du = 30.0 * f * f * (f * (f - 2.0) + 1.0);
690
-
691
- let ga = -1.0 + 2.0 * vec2<f32>(hash21(i + vec2<f32>(0.0, 0.0)), hash21(i + vec2<f32>(7.3, 0.0)));
692
- let gb = -1.0 + 2.0 * vec2<f32>(hash21(i + vec2<f32>(1.0, 0.0)), hash21(i + vec2<f32>(8.3, 0.0)));
693
- let gc = -1.0 + 2.0 * vec2<f32>(hash21(i + vec2<f32>(0.0, 1.0)), hash21(i + vec2<f32>(7.3, 1.0)));
694
- let gd = -1.0 + 2.0 * vec2<f32>(hash21(i + vec2<f32>(1.0, 1.0)), hash21(i + vec2<f32>(8.3, 1.0)));
695
-
696
- let va = dot(ga, f - vec2<f32>(0.0, 0.0));
697
- let vb = dot(gb, f - vec2<f32>(1.0, 0.0));
698
- let vc = dot(gc, f - vec2<f32>(0.0, 1.0));
699
- let vd = dot(gd, f - vec2<f32>(1.0, 1.0));
700
-
701
- let n = va + uu.x * (vb - va) + uu.y * (vc - va) + uu.x * uu.y * (va - vb - vc + vd);
702
- let value = 0.5 + 0.5 * n;
703
-
704
- let grad =
705
- ga + uu.x * (gb - ga) + uu.y * (gc - ga) + uu.x * uu.y * (ga - gb - gc + gd) +
706
- du * (vec2<f32>(uu.y, uu.x) * (va - vb - vc + vd) + vec2<f32>(vb, vc) - va);
707
- return vec3<f32>(value, 0.5 * grad);
708
- }
709
-
710
- ${c}
711
-
712
- fn fbm(p0: vec2<f32>, octaves: i32) -> f32 {
713
- var value = 0.0;
714
- var amp = 0.5;
715
- var freq = 1.0;
716
- var p = p0;
717
- for (var i = 0; i < 4; i = i + 1) {
718
- if (i >= octaves) { break; }
719
- value = value + amp * noised(p * freq).x;
720
- p = FBM_ROT * p;
721
- freq = freq * FBM_LACUNARITY;
722
- amp = amp * FBM_GAIN;
723
- }
724
- return value;
725
- }
726
-
727
- // FBM with ANALYTIC GRADIENT — value in .x, ∂/∂x, ∂/∂y in .yz. The gradient accumulates
728
- // noised()'s analytic gradient per octave, chain-ruled through the per-octave frequency
729
- // scale AND the FBM_ROT rotation (the keystone feed for the analytic surface normal).
730
- fn fbmG(p: vec2<f32>, octaves: i32) -> vec3<f32> {
731
- var value = 0.0;
732
- var grad = vec2<f32>(0.0, 0.0);
733
- var amp = 0.5;
734
- var freq = 1.0;
735
- var rotAccum = mat2x2<f32>(1.0, 0.0, 0.0, 1.0);
736
- var pp = p;
737
- for (var i = 0; i < 4; i = i + 1) {
738
- if (i >= octaves) { break; }
739
- let n = noised(pp * freq);
740
- value = value + amp * n.x;
741
- grad = grad + amp * freq * (transpose(rotAccum) * n.yz);
742
- pp = FBM_ROT * pp;
743
- freq = freq * FBM_LACUNARITY;
744
- amp = amp * FBM_GAIN;
745
- rotAccum = FBM_ROT * rotAccum;
746
- }
747
- return vec3<f32>(value, grad);
748
- }
749
-
750
- // One domain-warp pass with the ANALYTIC GRADIENT carried (warp-Jacobian approximation).
751
- fn fbmWarpedG(p: vec2<f32>, octaves: i32, warpAmp: f32) -> vec3<f32> {
752
- if (warpAmp <= 0.0) { return fbmG(p, octaves); }
753
- let q = vec2<f32>(fbm(p + vec2<f32>(0.0, 0.0), octaves),
754
- fbm(p + vec2<f32>(5.2, 1.3), octaves));
755
- return fbmG(p + warpAmp * (q - 0.5), octaves);
756
- }
757
-
758
- // ── SDF body (value+gradient circle + the IQ normalized smin, value+gradient form) ──
759
- fn sdgCircle(p: vec2<f32>, center: vec2<f32>, radius: f32) -> vec3<f32> {
760
- let d = p - center;
761
- let len = length(d);
762
- var grad = vec2<f32>(0.0, 1.0);
763
- if (len > 1e-6) { grad = d / len; }
764
- return vec3<f32>(len - radius, grad);
765
- }
766
-
767
- fn sminQuadraticG(a: vec3<f32>, b: vec3<f32>, k0: f32) -> vec3<f32> {
768
- let k = k0 * 4.0;
769
- let h = max(k - abs(a.x - b.x), 0.0) / k;
770
- let m = h * h * k * 0.25;
771
- var w = 1.0 - 0.5 * h * h;
772
- if (a.x < b.x) { w = 0.5 * h * h; }
773
- let dist = min(a.x, b.x) - m;
774
- let grad = mix(a.yz, b.yz, w);
775
- return vec3<f32>(dist, grad);
776
- }
777
-
778
- fn sminCircularG(a: vec3<f32>, b: vec3<f32>, k0: f32) -> vec3<f32> {
779
- let k = k0 * (1.0 / (1.0 - sqrt(0.5)));
780
- let h = max(k - abs(a.x - b.x), 0.0) / k;
781
- let m = k * 0.5 * (1.0 + h - sqrt(1.0 - h * (h - 2.0)));
782
- var w = 1.0 - 0.5 * h;
783
- if (a.x < b.x) { w = 0.5 * h; }
784
- let dist = min(a.x, b.x) - m;
785
- let grad = mix(a.yz, b.yz, w);
786
- return vec3<f32>(dist, grad);
787
- }
788
-
789
- fn sminG(a: vec3<f32>, b: vec3<f32>, k: f32) -> vec3<f32> {
790
- if (u.s2.y > 0.5) { return sminCircularG(a, b, k); }
791
- return sminQuadraticG(a, b, k);
792
- }
793
-
794
- ${o}
795
- ${s}
796
-
797
- // ── OKLCh gamut clamp (hue-preserving inward chroma clamp — blob-local) ──
798
- fn inGamut(lin: vec3<f32>) -> bool {
799
- return all(lin >= vec3<f32>(0.0)) && all(lin <= vec3<f32>(1.0));
800
- }
801
- fn gamutClampOklch(lch: vec3<f32>) -> vec3<f32> {
802
- let lin = oklabToLinearSrgb(oklchToOklab(lch));
803
- if (inGamut(lin)) { return lch; }
804
- var lo = 0.0;
805
- var hi = lch.y;
806
- for (var i = 0; i < 16; i = i + 1) {
807
- let mid = 0.5 * (lo + hi);
808
- let test = vec3<f32>(lch.x, mid, lch.z);
809
- if (inGamut(oklabToLinearSrgb(oklchToOklab(test)))) { lo = mid; } else { hi = mid; }
810
- }
811
- return vec3<f32>(lch.x, lo, lch.z);
812
- }
813
-
814
- // AX.W15 — de-synced breath (three DETUNED sines at irrational ratios).
815
- fn breath(phase: f32) -> f32 {
816
- return (sin(phase) + 0.5 * sin(phase * 1.4444 + 1.7) + 0.28 * sin(phase * 0.31 + 4.1)) / 1.78;
817
- }
818
-
819
- // AX.W15 — the composite SDF field WITH its ANALYTIC GRADIENT vec3(dist, ∂/∂x, ∂/∂y).
820
- fn sceneDistG(uv: vec2<f32>) -> vec3<f32> {
821
- let uBodyRadius = u.s0.y;
822
- let uPulsePhase = u.s0.z;
823
- let uPulseAmp = u.s0.w;
824
- let uNoiseAmp = u.s1.x;
825
- let uNoiseFreq = u.s1.y;
826
- let uNoiseSpeed = u.s1.z;
827
- let uWarpAmp = u.s1.w;
828
- let uSmoothK = u.s2.x;
829
- let uTime = u.s0.x;
830
- let uVelocity = u.ptr.zw;
831
- let uStretch = u.s6.w;
832
- let uSatCount = u.ints.y;
833
- let uTrailCount = u.ints.z;
834
-
835
- let bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;
836
-
837
- // Velocity-driven VOLUME-PRESERVING squash-and-stretch (tanh-saturated).
838
- var bodyUv = uv;
839
- var ax = vec2<f32>(1.0, 0.0);
840
- var perp = vec2<f32>(0.0, 1.0);
841
- var sa = 1.0;
842
- let speed = length(uVelocity);
843
- let squashed = uStretch > 0.0 && speed > 1e-4;
844
- if (squashed) {
845
- ax = uVelocity / speed;
846
- perp = vec2<f32>(-ax.y, ax.x);
847
- sa = 1.0 + tanh(speed * 1.6) * uStretch;
848
- bodyUv = vec2<f32>(dot(uv, ax) / sa, dot(uv, perp) * sa);
849
- }
850
-
851
- // Domain-warped FBM displacement WITH its analytic gradient.
852
- let fbmv = fbmWarpedG(bodyUv * uNoiseFreq + uTime * uNoiseSpeed, 3, uWarpAmp);
853
- let bodyDisplacement = (fbmv.x - 0.5) * uNoiseAmp;
854
- let dispGradBody = uNoiseAmp * uNoiseFreq * fbmv.yz;
855
-
856
- let bodyG = sdgCircle(bodyUv, vec2<f32>(0.0), bodyR + bodyDisplacement);
857
- let bodyGradBody = bodyG.yz - dispGradBody;
858
-
859
- var bodyGradUv: vec2<f32>;
860
- if (squashed) {
861
- let scaled = vec2<f32>(bodyGradBody.x / sa, bodyGradBody.y * sa);
862
- bodyGradUv = scaled.x * ax + scaled.y * perp;
863
- } else {
864
- bodyGradUv = bodyGradBody;
865
- }
866
- var d = vec3<f32>(bodyG.x, bodyGradUv);
867
-
868
- // Satellites — smin-merged into the body.
869
- for (var i = 0; i < MAX_SATS; i = i + 1) {
870
- if (i >= uSatCount) { break; }
871
- let s = u.satPos[i];
872
- var satG = sdgCircle(uv, s.xy, s.z);
873
- satG.x = satG.x + (1.0 - s.w) * 0.3;
874
- d = sminG(d, satG, uSmoothK);
875
- }
876
-
877
- // Pointer trail — a decaying-radius pseudopod.
878
- for (var i = 0; i < TRAIL_N; i = i + 1) {
879
- if (i >= uTrailCount) { break; }
880
- let tp = u.trailPos[i];
881
- let trailG = sdgCircle(uv, tp.xy, tp.z);
882
- d = sminG(d, trailG, uSmoothK);
883
- }
884
- return d;
885
- }
886
-
887
- // AX.W15 — the analytic surface normal from the field gradient.
888
- fn surfaceNormalFromGrad(grad2d: vec2<f32>, d: f32, bodyR: f32) -> vec3<f32> {
889
- let g = normalize(grad2d + vec2<f32>(1e-6));
890
- let interior = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0);
891
- let z = sqrt(max(0.0, 1.0 - (1.0 - interior) * (1.0 - interior)));
892
- return normalize(vec3<f32>(g * (1.0 - z), z) + vec3<f32>(0.0, 0.0, 1e-6));
893
- }
894
-
895
- // W11.b — sample the multi-stop palette at t, OKLab mix + midpoint chroma-bump. Returns
896
- // an OKLCh stop [L, C, h(rad)]. Falls back to uBaseColor when uStopCount <= 1.
897
- fn samplePaletteOklch(t: f32) -> vec3<f32> {
898
- let uStopCount = u.ints.x;
899
- if (uStopCount <= 1) { return oklabToOklch(srgbToOklab(u.base.rgb)); }
900
- let n = f32(uStopCount);
901
- let ft = clamp(t, 0.0, 1.0) * (n - 1.0);
902
- let i0 = i32(floor(ft));
903
- let i1 = min(i0 + 1, uStopCount - 1);
904
- let f = ft - f32(i0);
905
- let labA = srgbToOklab(u.palette[i0].rgb);
906
- let labB = srgbToOklab(u.palette[i1].rgb);
907
- let lab = mix(labA, labB, f);
908
- var lch = oklabToOklch(lab);
909
- lch.y = lch.y + 0.03 * sin(PI * f);
910
- return lch;
911
- }
912
-
913
- // ── Full-screen triangle vertex stage (the pilot idiom — no vertex buffer) ──
914
- struct VSOut {
915
- @builtin(position) pos: vec4<f32>,
916
- @location(0) uv: vec2<f32>,
917
- };
918
-
919
- @vertex
920
- fn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {
921
- var p = vec2<f32>(-1.0, -1.0);
922
- if (vi == 1u) { p = vec2<f32>(3.0, -1.0); }
923
- else if (vi == 2u) { p = vec2<f32>(-1.0, 3.0); }
924
- var out: VSOut;
925
- out.pos = vec4<f32>(p, 0.0, 1.0);
926
- // vUv = aPos * 0.5 + 0.5 (the metaball.vert convention).
927
- out.uv = p * 0.5 + 0.5;
928
- return out;
929
- }
930
-
931
- // ── Fragment stage (the main() transcription) ──
932
- @fragment
933
- fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
934
- let uTime = u.s0.x;
935
- let uBodyRadius = u.s0.y;
936
- let uPulsePhase = u.s0.z;
937
- let uPulseAmp = u.s0.w;
938
- let uMaxReach = u.s2.z;
939
- let uLit = u.s2.w;
940
- let uPointerActive = u.s7.x;
941
- let uPointerAttraction = u.s7.y;
942
- let uPointerStrength = u.s7.z;
943
- let uPointer = u.ptr.xy;
944
- let uHueRange = u.s5.z;
945
- let uSatShift = u.s5.w;
946
- let uBrightnessShift = u.s6.x;
947
- let uColorNoiseFreq = u.s6.y;
948
- let uColorNoiseSpeed = u.s6.z;
949
- let uIridescence = u.s4.x;
950
- let uIridHue = u.s4.y;
951
- let uIridSpeed = u.s4.z;
952
- let uSssScale = u.s4.w;
953
- let uSssPower = u.s5.x;
954
- let uCoreGlow = u.s5.y;
955
- let uSpecStrength = u.s3.x;
956
- let uSpecShininess = u.s3.y;
957
- let uRimPower = u.s3.z;
958
- let uRimStrength = u.s3.w;
959
- let uLightDir = u.light.xyz;
960
- let uRimColor = u.rim.rgb;
961
-
962
- var uv = in.uv - 0.5;
963
-
964
- // PRE-FBM bounding early-out — transparent WRITE (not a discard).
965
- if (dot(uv, uv) > uMaxReach * uMaxReach) {
966
- return vec4<f32>(0.0);
967
- }
968
-
969
- // Pointer deformation — sign per AY.W-BLOB-CONFIG D2.
970
- if (uPointerActive > 0.5) {
971
- let pointerDir = uPointer - uv;
972
- let pointerDist = length(pointerDir);
973
- let influence = smoothstep(0.5, 0.0, pointerDist) * uPointerAttraction * uPointerStrength;
974
- uv = uv + normalize(pointerDir + vec2<f32>(1e-6)) * influence;
975
- }
976
-
977
- let bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;
978
-
979
- // Composite domain-warped membrane field WITH its analytic gradient.
980
- let scene = sceneDistG(uv);
981
- let d = scene.x;
982
- let fieldGrad = scene.yz;
983
-
984
- // ── fwidth SITE #1 (metaball.frag.ts line 266) — AA-edge half-width from the SDF
985
- // screen-space gradient. The WGSL fragment-stage fwidth() transcription. ──
986
- let aa = max(fwidth(d), 1e-6);
987
- let alpha = 1.0 - smoothstep(-aa, aa, d);
988
-
989
- if (alpha < 0.001) {
990
- return vec4<f32>(0.0);
991
- }
992
-
993
- // Edit #4 — perceptually-uniform OKLCh variation.
994
- let colorNoise = fbm(uv * uColorNoiseFreq + uTime * uColorNoiseSpeed, 3);
995
- var oklch = samplePaletteOklch(colorNoise);
996
-
997
- oklch.z = oklch.z + (colorNoise - 0.5) * uHueRange * (PI / 180.0);
998
- oklch.y = max(oklch.y + (colorNoise - 0.5) * uSatShift, 0.0);
999
- oklch.x = clamp(oklch.x + uBrightnessShift, 0.0, 1.0);
1000
-
1001
- let N = surfaceNormalFromGrad(fieldGrad, d, bodyR);
1002
- let V = vec3<f32>(0.0, 0.0, 1.0);
1003
- let thickness = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0);
1004
- let fres = pow(1.0 - max(dot(N, V), 0.0), 2.5);
1005
-
1006
- // ── W11.a iridescence — warm-biased IQ cosine palette driving OKLCh HUE ──
1007
- if (uIridescence > 0.0) {
1008
- let t = fres + 0.3 * colorNoise + uTime * uIridSpeed;
1009
- let iridHue = uIridHue + 0.18 * PI * cos(2.0 * PI * t);
1010
- let w = fres * uIridescence;
1011
- oklch.z = mix(oklch.z, iridHue, w);
1012
- oklch.y = min(oklch.y + 0.04 * w, oklch.y + 0.08);
1013
- oklch.x = min(oklch.x + 0.05 * w, 1.0);
1014
- }
1015
-
1016
- // ── W11.a fake subsurface translucency — thickness inner-glow + back-light ──
1017
- if (uCoreGlow > 0.0 || uSssScale > 0.0) {
1018
- oklch.x = min(oklch.x + uCoreGlow * (1.0 - exp(-3.0 * thickness)), 1.0);
1019
- let L = normalize(uLightDir + vec3<f32>(1e-6));
1020
- let back = pow(clamp(dot(V, -(L + N * thickness)), 0.0, 1.0), uSssPower);
1021
- let sss = back * uSssScale * (1.0 - thickness);
1022
- oklch.x = min(oklch.x + sss, 1.0);
1023
- oklch.z = oklch.z + sss * 0.1 * (1.0 - thickness);
1024
- }
1025
-
1026
- oklch = gamutClampOklch(oklch);
1027
-
1028
- var lin = oklabToLinearSrgb(oklchToOklab(oklch));
1029
-
1030
- // ── W9.b lit glass surface — Blinn-Phong glint + Fresnel rim, in LINEAR ──
1031
- if (uLit > 0.5) {
1032
- let L = normalize(uLightDir + vec3<f32>(1e-6));
1033
- let H = normalize(L + V);
1034
-
1035
- let warmCream = oklabToLinearSrgb(oklchToOklab(vec3<f32>(0.97, 0.03, radians(85.0))));
1036
-
1037
- // ── fwidth SITE #2 (metaball.frag.ts line 364) — Toksvig normal-variance
1038
- // specular clamp. The WGSL fragment-stage fwidth() of the surface normal. ──
1039
- let nVar = length(fwidth(N));
1040
- let shininess = uSpecShininess / (1.0 + 24.0 * nVar);
1041
- let energyNorm = (shininess + 2.0) / 8.0;
1042
- let spec = pow(max(dot(N, H), 0.0), shininess) * uSpecStrength * energyNorm;
1043
-
1044
- var rimOkl = oklabToOklch(srgbToOklab(uRimColor));
1045
- let bodyL = oklch.x;
1046
- let dL = abs(rimOkl.x - bodyL);
1047
- let lack = clamp((0.22 - dL) / 0.22, 0.0, 1.0);
1048
- var target = 0.18;
1049
- if (bodyL < 0.5) { target = 0.92; }
1050
- rimOkl.x = clamp(mix(rimOkl.x, target, lack), 0.0, 1.0);
1051
- rimOkl.y = rimOkl.y * mix(1.0, 0.5, lack);
1052
- let rimLin = oklabToLinearSrgb(oklchToOklab(rimOkl));
1053
-
1054
- let rimFres = pow(1.0 - max(dot(N, V), 0.0), uRimPower);
1055
- let rim = rimFres * uRimStrength * (1.0 - 0.6 * thickness);
1056
-
1057
- var highlight = max(warmCream * spec, rimLin * rim);
1058
- highlight = min(highlight, vec3<f32>(0.85));
1059
- lin = lin + highlight;
1060
- }
1061
-
1062
- var rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));
1063
-
1064
- // IGN dither — 1-LSB triangular dither in DISPLAY space, AFTER linearToSrgb.
1065
- let fragCoord = in.pos.xy;
1066
- let ign = fract(52.9829189 * fract(dot(fragCoord, vec2<f32>(0.06711056, 0.00583715))));
1067
- rgb = clamp(rgb + (ign - 0.5) / 255.0, vec3<f32>(0.0), vec3<f32>(1.0));
1068
-
1069
- // premultiply AFTER the OETF: straight-alpha gamma → premultiplied.
1070
- return vec4<f32>(rgb * alpha, alpha);
1071
- }
1072
- `, Te = 592, $ = {
1073
- s0: 0,
1074
- s1: 4,
1075
- s2: 8,
1076
- s3: 12,
1077
- s4: 16,
1078
- s5: 20,
1079
- s6: 24,
1080
- s7: 28,
1081
- ptr: 32,
1082
- base: 36,
1083
- rim: 40,
1084
- light: 44,
1085
- res: 48,
1086
- ints: 52,
1087
- palette: 56,
1088
- satPos: 72,
1089
- trailPos: 88
1090
- };
1091
- function Ee() {
1092
- let e = new ArrayBuffer(Te);
1093
- return {
1094
- buffer: e,
1095
- f32: new Float32Array(e),
1096
- i32: new Int32Array(e)
1097
- };
1098
- }
1099
- function De(e, t, n, r, i, a) {
1100
- let { f32: o, i32: s } = e, { params: c, rgb: l, simTimeMs: u, timeSec: d, resolveColor: f, rimColor: p, paletteStops: m } = a, { geometry: h, membrane: g, color: _, surface: v, interaction: y } = n, b = r.pointer.value, x = y.pointerAttraction + c.pointerAttraction, S = Math.max(0, Math.min(1, x)), C = r.velocity.value, w = r.pulse.value * y.clickImpulse, T = (g.pulseAmp * c.pulseAmp / .015 + w) * N, E = d * g.pulseFreq * c.pulseFreq * Math.PI * 2, D = g.noiseAmp * c.noiseAmp / .025 * N, O = h.orbitRadius * 1.2 * (1 + h.eccentricity), k = g.smoothK * c.smoothK, A = Math.max(0, O - h.satelliteRadius - h.bodyRadius), j = k > 0 ? Math.min(1.25, 1 + A / k) : 1, M = k * j * N, P = O + h.satelliteRadius, F = (Math.max(h.bodyRadius, P) + k * j + g.noiseAmp * c.noiseAmp / .025 + Math.abs(r.pulse.value) * y.clickImpulse) * N + .1;
1101
- o[$.s0 + 0] = u / 1e3, o[$.s0 + 1] = h.bodyRadius * N, o[$.s0 + 2] = E, o[$.s0 + 3] = T, o[$.s1 + 0] = D, o[$.s1 + 1] = g.noiseFreq, o[$.s1 + 2] = g.noiseSpeed, o[$.s1 + 3] = g.warpAmp, o[$.s2 + 0] = M, o[$.s2 + 1] = +(g.merge === "circular"), o[$.s2 + 2] = F, o[$.s2 + 3] = +!!v.lit, o[$.s3 + 0] = v.specStrength, o[$.s3 + 1] = v.specShininess, o[$.s3 + 2] = v.rimPower, o[$.s3 + 3] = v.rimStrength, o[$.s4 + 0] = v.iridescence * c.iridScale, o[$.s4 + 1] = v.iridHue * (Math.PI / 180), o[$.s4 + 2] = v.iridSpeed, o[$.s4 + 3] = v.sssScale * c.iridScale, o[$.s5 + 0] = v.sssPower, o[$.s5 + 1] = v.coreGlow, o[$.s5 + 2] = _.hueRange + c.hueRange, o[$.s5 + 3] = _.satShift + c.satShift, o[$.s6 + 0] = _.brightnessShift + c.brightnessShift, o[$.s6 + 1] = _.colorNoiseFreq, o[$.s6 + 2] = _.colorNoiseSpeed, o[$.s6 + 3] = y.stretch, o[$.s7 + 0] = +!!r.active.value, o[$.s7 + 1] = x, o[$.s7 + 2] = y.pointerStrength * N, o[$.s7 + 3] = 0, o[$.ptr + 0] = b.x * .5 * N, o[$.ptr + 1] = b.y * .5 * N, o[$.ptr + 2] = C.x * .5 * N, o[$.ptr + 3] = C.y * .5 * N, o[$.base + 0] = l[0], o[$.base + 1] = l[1], o[$.base + 2] = l[2], o[$.base + 3] = 0;
1102
- let I = f(p);
1103
- o[$.rim + 0] = I[0], o[$.rim + 1] = I[1], o[$.rim + 2] = I[2], o[$.rim + 3] = 0, o[$.light + 0] = v.lightDir[0], o[$.light + 1] = v.lightDir[1], o[$.light + 2] = v.lightDir[2], o[$.light + 3] = 0, o[$.res + 0] = t.width, o[$.res + 1] = t.height, o[$.res + 2] = 0, o[$.res + 3] = 0;
1104
- let L = m, R = Math.min(L.length, 4);
1105
- for (let e = 0; e < 4; e++) {
1106
- let t = $.palette + e * 4, n = L[e];
1107
- if (n) {
1108
- let e = f(n);
1109
- o[t + 0] = e[0], o[t + 1] = e[1], o[t + 2] = e[2];
1110
- } else o[t + 0] = l[0], o[t + 1] = l[1], o[t + 2] = l[2];
1111
- o[t + 3] = 0;
1112
- }
1113
- let z = i.sources;
1114
- for (let e = 0; e < 4; e++) {
1115
- let t = $.satPos + e * 4, n = z[e];
1116
- n ? (o[t + 0] = n.x * N, o[t + 1] = n.y * N, o[t + 2] = n.radius * N, o[t + 3] = n.opacity) : (o[t + 0] = 0, o[t + 1] = 0, o[t + 2] = 0, o[t + 3] = 0);
1117
- }
1118
- let B = r.trailSources(h.satelliteRadius * .7 * S);
1119
- for (let e = 0; e < 15; e++) {
1120
- let t = $.trailPos + e * 4, n = B.sources[e];
1121
- n ? (o[t + 0] = n.x * .5 * N, o[t + 1] = n.y * .5 * N, o[t + 2] = n.radius * N) : (o[t + 0] = 0, o[t + 1] = 0, o[t + 2] = 0), o[t + 3] = 0;
1122
- }
1123
- return s[$.ints + 0] = R, s[$.ints + 1] = z.length, s[$.ints + 2] = B.count, s[$.ints + 3] = 0, e;
1124
- }
1125
- //#endregion
1126
60
  //#region src/components/custom/goo-blob/composables/wgpuSetup.ts
1127
- var Oe = 64, ke = 8, Ae = 2;
1128
- function je(e) {
1129
- let { canvas: t, config: n, pointer: r, satellites: i, resolveFrame: a, shouldContinue: o } = e;
1130
- return function(e, s, c) {
61
+ var L = 64, R = 8, z = 2;
62
+ function B(e) {
63
+ let { canvas: t, config: n, pointer: i, satellites: a, resolveFrame: o, shouldContinue: s } = e;
64
+ return function(e, c, l) {
1131
65
  let u = e.createShaderModule({
1132
66
  label: "[GooBlob] metaball.wgsl",
1133
- code: we
67
+ code: m
1134
68
  }), d = e.createBuffer({
1135
69
  label: "[GooBlob] uniforms",
1136
- size: Te,
1137
- usage: Oe | ke
70
+ size: b,
71
+ usage: L | R
1138
72
  }), f = e.createBindGroupLayout({
1139
73
  label: "[GooBlob] bind-group-0",
1140
74
  entries: [{
1141
75
  binding: 0,
1142
- visibility: Ae,
76
+ visibility: z,
1143
77
  buffer: { type: "uniform" }
1144
78
  }]
1145
79
  }), p = e.createRenderPipeline({
@@ -1153,7 +87,7 @@ function je(e) {
1153
87
  module: u,
1154
88
  entryPoint: "fs_main",
1155
89
  targets: [{
1156
- format: c,
90
+ format: l,
1157
91
  blend: {
1158
92
  color: {
1159
93
  srcFactor: "one",
@@ -1169,23 +103,23 @@ function je(e) {
1169
103
  }]
1170
104
  },
1171
105
  primitive: { topology: "triangle-list" }
1172
- }), m = e.createBindGroup({
106
+ }), h = e.createBindGroup({
1173
107
  label: "[GooBlob] bind-group",
1174
108
  layout: f,
1175
109
  entries: [{
1176
110
  binding: 0,
1177
111
  resource: { buffer: d }
1178
112
  }]
1179
- }), h = Ee();
1180
- function g() {
1181
- let e = l(), r = n.quality === "half" ? .5 : 1, i = t.clientWidth || n.geometry.canvasSize, a = t.clientHeight || n.geometry.canvasSize, o = Math.max(1, Math.round(i * e * r)), s = Math.max(1, Math.round(a * e * r));
1182
- (t.width !== o || t.height !== s) && (t.width = o, t.height = s);
113
+ }), _ = g();
114
+ function y() {
115
+ let e = r(), i = n.quality === "half" ? .5 : 1, a = t.clientWidth || n.geometry.canvasSize, o = t.clientHeight || n.geometry.canvasSize, s = Math.max(1, Math.round(a * e * i)), c = Math.max(1, Math.round(o * e * i));
116
+ (t.width !== s || t.height !== c) && (t.width = s, t.height = c);
1183
117
  }
1184
- function _(o) {
1185
- let c = a(o);
1186
- if (!c) return;
1187
- De(h, t, n, r, i, c), e.queue.writeBuffer(d, 0, h.buffer);
1188
- let l = s.getCurrentTexture().createView(), u = e.createCommandEncoder({ label: "[GooBlob] frame" }), f = u.beginRenderPass({ colorAttachments: [{
118
+ function x(r) {
119
+ let s = o(r);
120
+ if (!s) return;
121
+ v(_, t, n, i, a, s), e.queue.writeBuffer(d, 0, _.buffer);
122
+ let l = c.getCurrentTexture().createView(), u = e.createCommandEncoder({ label: "[GooBlob] frame" }), f = u.beginRenderPass({ colorAttachments: [{
1189
123
  view: l,
1190
124
  clearValue: {
1191
125
  r: 0,
@@ -1196,12 +130,12 @@ function je(e) {
1196
130
  loadOp: "clear",
1197
131
  storeOp: "store"
1198
132
  }] });
1199
- f.setPipeline(p), f.setBindGroup(0, m), f.draw(3, 1, 0, 0), f.end(), e.queue.submit([u.finish()]);
133
+ f.setPipeline(p), f.setBindGroup(0, h), f.draw(3, 1, 0, 0), f.end(), e.queue.submit([u.finish()]);
1200
134
  }
1201
135
  return {
1202
- frame: _,
1203
- shouldContinue: o,
1204
- resize: g,
136
+ frame: x,
137
+ shouldContinue: s,
138
+ resize: y,
1205
139
  teardown: () => {
1206
140
  d.destroy();
1207
141
  }
@@ -1210,121 +144,128 @@ function je(e) {
1210
144
  }
1211
145
  //#endregion
1212
146
  //#region src/components/custom/goo-blob/composables/useMetaballRenderer.ts
1213
- function Me(e) {
1214
- let { canvasRef: t, color: n, rimColor: r, paletteStops: i, mood: o, pointer: s, satellites: c, config: u } = e, d = 0, h = 0, g = /* @__PURE__ */ new Map();
1215
- function _(e) {
1216
- let t = g.get(e);
147
+ function V(e) {
148
+ let { canvasRef: t, color: a, rimColor: o, paletteStops: d, mood: f, pointer: p, satellites: m, config: h } = e, g = 0, _ = 0, v = n(), y = /* @__PURE__ */ new Map();
149
+ function b(e) {
150
+ let t = y.get(e);
1217
151
  if (t) return t;
1218
- let n = f(p(e));
1219
- return g.size > 256 && g.clear(), g.set(e, n), n;
1220
- }
1221
- let v = null, y = !1, b = null;
1222
- function x() {
1223
- b !== null && (clearTimeout(b), b = null);
1224
- }
1225
- function S(e) {
1226
- if (x(), typeof setTimeout > "u") return;
1227
- let t = Math.min(Math.max(e - h, 16), 3e4);
1228
- b = setTimeout(() => {
1229
- b = null, v?.wake();
152
+ let n = s(c(e));
153
+ return y.size > 256 && y.clear(), y.set(e, n), n;
154
+ }
155
+ let x = null, S = !1, C = null;
156
+ function w() {
157
+ C !== null && (clearTimeout(C), C = null);
158
+ }
159
+ function T(e) {
160
+ if (w(), typeof setTimeout > "u") return;
161
+ let t = Math.min(Math.max(e - _, 16), 3e4);
162
+ C = setTimeout(() => {
163
+ C = null, x?.wake();
1230
164
  }, t);
1231
165
  }
1232
- m(t, {
1233
- pause: () => v?.suspend("off-screen-io"),
1234
- resume: () => v?.resume("off-screen-io")
166
+ l(t, {
167
+ pause: () => x?.suspend("off-screen-io"),
168
+ resume: () => x?.resume("off-screen-io")
1235
169
  }, {
1236
170
  rootMargin: "200px",
1237
171
  pauseWhenHidden: !1
1238
172
  });
1239
- function C(e) {
1240
- let t = d ? (e - d) * 1e3 : 16;
1241
- d = e;
1242
- let a = Math.max(0, Math.min(t, 50)), l = v?.reducedMotion ?? !1, f = (l || y ? 0 : u.tempo) * a;
1243
- return h += f, l || o.update({
1244
- pointerActive: s.active.value,
1245
- clicked: s.consumeClick(),
1246
- idleMs: s.idleMs()
1247
- }), o.tick(f), l ? s.rest() : s.tick(f), c.tick(h, o.params.value), {
1248
- params: o.params.value,
1249
- rgb: _(n.value),
1250
- simTimeMs: h,
173
+ function E(e) {
174
+ let t = g ? (e - g) * 1e3 : 16;
175
+ g = e;
176
+ let n = Math.max(0, Math.min(t, 50)), r = x?.reducedMotion ?? !1, i = r || S ? 0 : h.tempo, s = i * n;
177
+ if (_ += s, i > 0 && p.active.value) {
178
+ let e = p.pointer.value;
179
+ v.setPointer(e.x * .5 + .5, e.y * .5 + .5);
180
+ }
181
+ v.tick(i === 0 ? 0 : n);
182
+ let c = v.acceleration.value, l = v.velocity.value, u = -(c.x * l.x + c.y * l.y);
183
+ return u > 0 && i > 0 && p.click(Math.min(.5, u * 4 + v.burst.value * .2)), r || f.update({
184
+ pointerActive: p.active.value,
185
+ clicked: p.consumeClick(),
186
+ idleMs: p.idleMs()
187
+ }), f.tick(s), r ? p.rest() : p.tick(s), m.tick(_, f.params.value), {
188
+ params: f.params.value,
189
+ rgb: b(a.value),
190
+ simTimeMs: _,
1251
191
  timeSec: e,
1252
- resolveColor: _,
1253
- rimColor: r.value,
1254
- paletteStops: i.value
192
+ resolveColor: b,
193
+ rimColor: o.value,
194
+ paletteStops: d.value
1255
195
  };
1256
196
  }
1257
- function T() {
1258
- if (y) return !1;
1259
- if (!o.isSettled() || !s.isAtRest() || !c.isQuiescent()) return x(), !0;
1260
- let e = c.nextEventMs(h), t = o.nextAutoMoodMs(), n = Number.isFinite(t) ? h + t : Infinity;
1261
- return S(Math.min(e, n)), !1;
1262
- }
1263
- function E(e) {
1264
- let t = l(), n = u.quality === "half" ? .5 : 1, r = e.clientWidth || u.geometry.canvasSize, i = e.clientHeight || u.geometry.canvasSize, a = Math.max(1, Math.round(r * t * n)), o = Math.max(1, Math.round(i * t * n));
1265
- return (e.width !== a || e.height !== o) && (e.width = a, e.height = o), {
1266
- w: a,
1267
- h: o
197
+ function D() {
198
+ if (S) return !1;
199
+ if (!f.isSettled() || !p.isAtRest() || !m.isQuiescent()) return w(), !0;
200
+ let e = m.nextEventMs(_), t = f.nextAutoMoodMs(), n = Number.isFinite(t) ? _ + t : Infinity;
201
+ return T(Math.min(e, n)), !1;
202
+ }
203
+ function O(e) {
204
+ let t = r(), n = h.quality === "half" ? .5 : 1, i = e.clientWidth || h.geometry.canvasSize, a = e.clientHeight || h.geometry.canvasSize, o = Math.max(1, Math.round(i * t * n)), s = Math.max(1, Math.round(a * t * n));
205
+ return (e.width !== o || e.height !== s) && (e.width = o, e.height = s), {
206
+ w: o,
207
+ h: s
1268
208
  };
1269
209
  }
1270
- function D(e) {
1271
- v = a(e, {
210
+ function A(e) {
211
+ x = i(e, {
1272
212
  contextAttrs: {
1273
213
  alpha: !0,
1274
214
  premultipliedAlpha: !0,
1275
215
  antialias: !1,
1276
216
  preserveDrawingBuffer: !1
1277
217
  },
1278
- setupWGPU: je({
218
+ setupWGPU: B({
1279
219
  canvas: e,
1280
- config: u,
1281
- pointer: s,
1282
- satellites: c,
1283
- resolveFrame: C,
1284
- shouldContinue: T,
1285
- getReducedMotion: () => v?.reducedMotion ?? !1
220
+ config: h,
221
+ pointer: p,
222
+ satellites: m,
223
+ resolveFrame: E,
224
+ shouldContinue: D,
225
+ getReducedMotion: () => x?.reducedMotion ?? !1
1286
226
  }),
1287
227
  setupGL: (t) => {
1288
- let { prog: n, vs: r, fs: i, vao: a, buf: o, locs: l } = Ce(t);
1289
- function d() {
1290
- let { w: n, h: r } = E(e);
228
+ let { prog: n, vs: r, fs: i, vao: a, buf: o, locs: s } = I(t);
229
+ function c() {
230
+ let { w: n, h: r } = O(e);
1291
231
  t.viewport(0, 0, n, r);
1292
232
  }
1293
- function f(r) {
1294
- Se(t, n, a, l, e, u, s, c, C(r));
233
+ function l(r) {
234
+ u(t, n, a, s, e, h, p, m, E(r));
1295
235
  }
1296
236
  return {
1297
- frame: f,
1298
- shouldContinue: T,
1299
- resize: d,
237
+ frame: l,
238
+ shouldContinue: D,
239
+ resize: c,
1300
240
  teardown: () => {
1301
241
  t.deleteProgram(n), t.deleteShader(r), t.deleteShader(i), t.deleteBuffer(o), t.deleteVertexArray(a);
1302
242
  }
1303
243
  };
1304
244
  }
1305
- }), v.armAsync();
245
+ }), x.armAsync();
1306
246
  }
1307
- return k(t, (e) => {
1308
- e && !v && D(e);
1309
- }, { immediate: !0 }), k(n, () => v?.wake()), k(i, () => v?.wake(), { deep: !0 }), w(() => {
1310
- x(), v?.dispose(), v = null;
247
+ return N(t, (e) => {
248
+ e && !x && A(e);
249
+ }, { immediate: !0 }), N(a, () => x?.wake()), N(d, () => x?.wake(), { deep: !0 }), k(() => {
250
+ w(), x?.dispose(), x = null;
1311
251
  }), {
1312
252
  pause: () => {
1313
- y = !0, v?.suspend("manual");
253
+ S = !0, x?.suspend("manual");
1314
254
  },
1315
255
  resume: () => {
1316
- y = !1, v?.resume("manual");
256
+ S = !1, x?.resume("manual");
1317
257
  },
1318
- wake: () => v?.wake()
258
+ wake: () => x?.wake()
1319
259
  };
1320
260
  }
1321
261
  //#endregion
1322
262
  //#region src/components/custom/goo-blob/GooBlob.vue
1323
- var Ne = /* @__PURE__ */ e(/* @__PURE__ */ b({
263
+ var H = /* @__PURE__ */ e(/* @__PURE__ */ T({
1324
264
  __name: "GooBlob",
1325
265
  props: {
1326
266
  color: {},
1327
267
  config: {},
268
+ variant: {},
1328
269
  seed: { default: "" },
1329
270
  paused: {
1330
271
  type: Boolean,
@@ -1333,71 +274,73 @@ var Ne = /* @__PURE__ */ e(/* @__PURE__ */ b({
1333
274
  },
1334
275
  emits: ["click", "update:paused"],
1335
276
  setup(e, { expose: n, emit: r }) {
1336
- let i = r, a = x(M, null), o = e.config ?? a;
277
+ let i = r, a = E(p, null), o = e.config ?? a;
1337
278
  if (!o) throw Error("[glass-ui] GooBlob: no blob config. Pass an explicit `config` prop (e.g. BLOB_CONFIG_DEFAULTS) or provide(BLOB_CONFIG_KEY, cfg) from an ancestor. There is no silent defaults synthesis.");
1338
- let s = () => e.config ?? a ?? o, c = O("canvasRef"), l = O("wrapperRef"), u = ce(), d = le(l), f = fe(o, e.color + e.seed), p = t(), m = D(e.color), h = D(o.surface.rimColor), g = D([...o.color.paletteStops]);
1339
- function b() {
1340
- let t = l.value, n = s();
1341
- p.invalidate(), m.value = p.resolve(e.color, t), h.value = p.resolve(n.surface.rimColor, t), g.value = n.color.paletteStops.map((e) => p.resolve(e, t));
279
+ let s = () => e.config ?? a ?? o, c = new Proxy(o, { get(t, n, r) {
280
+ return n === "variant" && e.variant != null ? e.variant : Reflect.get(t, n, r);
281
+ } }), l = M("canvasRef"), u = M("wrapperRef"), f = h(), m = d(u), g = y(o, e.color + e.seed), _ = t(), v = j(e.color), b = j(o.surface.rimColor), x = j([...o.color.paletteStops]);
282
+ function T() {
283
+ let t = u.value, n = s();
284
+ _.invalidate(), v.value = _.resolve(e.color, t), b.value = _.resolve(n.surface.rimColor, t), x.value = n.color.paletteStops.map((e) => _.resolve(e, t));
1342
285
  }
1343
- let w = Me({
1344
- canvasRef: c,
1345
- color: m,
1346
- rimColor: h,
1347
- paletteStops: g,
1348
- mood: u,
1349
- pointer: d,
1350
- satellites: f,
1351
- config: o
286
+ let k = V({
287
+ canvasRef: l,
288
+ color: v,
289
+ rimColor: b,
290
+ paletteStops: x,
291
+ mood: f,
292
+ pointer: m,
293
+ satellites: g,
294
+ config: c
1352
295
  });
1353
- k(l, b, { immediate: !0 });
1354
- let E = null;
1355
- typeof document < "u" && (E = new MutationObserver(b), E.observe(document.documentElement, {
296
+ N(u, T, { immediate: !0 });
297
+ let P = null;
298
+ typeof document < "u" && (P = new MutationObserver(T), P.observe(document.documentElement, {
1356
299
  attributes: !0,
1357
300
  attributeFilter: ["class"]
1358
- })), k(_(() => e.color), (t) => {
1359
- b(), f.reseed(t + e.seed);
1360
- }), k(() => {
301
+ })), N(S(() => e.color), (t) => {
302
+ T(), g.reseed(t + e.seed);
303
+ }), N(() => {
1361
304
  let e = s();
1362
305
  return [e.color.paletteStops.join("|"), e.surface.rimColor];
1363
- }, () => b(), { deep: !0 }), k(() => d.active.value, (e) => {
1364
- e && w.wake();
1365
- }), k(() => e.paused, (e) => e ? w.pause() : w.resume(), { immediate: !0 }), C(() => {
1366
- E?.disconnect(), E = null;
306
+ }, () => T(), { deep: !0 }), N(() => m.active.value, (e) => {
307
+ e && k.wake();
308
+ }), N(() => e.paused, (e) => e ? k.pause() : k.resume(), { immediate: !0 }), O(() => {
309
+ P?.disconnect(), P = null;
1367
310
  });
1368
- function A() {
1369
- f.nudge();
311
+ function F() {
312
+ g.nudge();
1370
313
  }
1371
- function j(e) {
1372
- u.setMood(e, { source: "manual" });
314
+ function I(e) {
315
+ f.setMood(e, { source: "manual" });
1373
316
  }
1374
- function N() {
1375
- d.click(o.interaction.clickImpulse);
317
+ function L() {
318
+ m.click(o.interaction.clickImpulse);
1376
319
  }
1377
- function P() {
1378
- N(), i("click");
320
+ function R() {
321
+ L(), i("click");
1379
322
  }
1380
323
  return n({
1381
- nudge: A,
1382
- setMood: j,
1383
- pulse: N,
1384
- currentMood: u.currentMood,
1385
- pause: w.pause,
1386
- resume: w.resume
1387
- }), (t, n) => (T(), v("div", {
324
+ nudge: F,
325
+ setMood: I,
326
+ pulse: L,
327
+ currentMood: f.currentMood,
328
+ pause: k.pause,
329
+ resume: k.resume
330
+ }), (t, n) => (A(), C("div", {
1388
331
  ref_key: "wrapperRef",
1389
- ref: l,
332
+ ref: u,
1390
333
  class: "goo-blob-wrapper",
1391
- style: S({ "--blob-color": e.color }),
1392
- onClick: P
1393
- }, [y("canvas", {
334
+ style: D({ "--blob-color": e.color }),
335
+ onClick: R
336
+ }, [w("canvas", {
1394
337
  ref_key: "canvasRef",
1395
- ref: c,
338
+ ref: l,
1396
339
  class: "goo-blob-canvas",
1397
340
  "aria-hidden": "true",
1398
341
  "data-testid": "goo-blob-canvas"
1399
342
  }, null, 512)], 4));
1400
343
  }
1401
- }), [["__scopeId", "data-v-46b07dc3"]]);
344
+ }), [["__scopeId", "data-v-2906dd32"]]);
1402
345
  //#endregion
1403
- export { j as BLOB_CONFIG_DEFAULTS, M as BLOB_CONFIG_KEY, Ne as GooBlob, ce as useBlobMood, le as useBlobPointer, fe as useBlobSatellites, Me as useMetaballRenderer };
346
+ export { f as BLOB_CONFIG_DEFAULTS, p as BLOB_CONFIG_KEY, H as GooBlob, h as useBlobMood, d as useBlobPointer, y as useBlobSatellites, V as useMetaballRenderer };