@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.
- package/dist/{CardAction-CW7a0m8M.js → CardAction-8whJrLWt.js} +23 -8
- package/dist/{CommandShortcut-DvZNQ_HF.js → CommandShortcut-D3yxgHNn.js} +23 -12
- package/dist/{ConfiguratorRow-BR4l-ixA.js → ConfiguratorRow-CaP7U3ZA.js} +11 -11
- package/dist/ContextMenuContent-B3ZsheLV.js +90 -0
- package/dist/{ContextMenuSubContent-xol4sD2q.js → ContextMenuSubContent-DDRID3qC.js} +15 -15
- package/dist/{DataTable-CuKwF7wr.js → DataTable-Bc9kUtu_.js} +2 -2
- package/dist/{DialogContent-DcKK8k9i.js → DialogContent-6JtTB5x2.js} +8 -5
- package/dist/DialogFooter-9phqcRIS.js +80 -0
- package/dist/DialogScrollContent-TTuovQst.js +93 -0
- package/dist/HoverCardContent-Bel1gdLZ.js +88 -0
- package/dist/{IconChip-BTD-nay5.js → IconChip-DhbdGdFQ.js} +1 -1
- package/dist/{IconTooltip-Bl8gFZ8d.js → IconTooltip-B0zimd2H.js} +1 -1
- package/dist/Input-Cg9DF62r.js +57 -0
- package/dist/{Notification-VUwexFUf.js → Notification-CphK7AAm.js} +3 -3
- package/dist/NumberFieldContent-D8cXeyO4.js +140 -0
- package/dist/PagerDots-Cjx96la-.js +98 -0
- package/dist/{SelectScrollDownButton-CrA8F0iV.js → SelectScrollDownButton-DAKCBEdW.js} +62 -57
- package/dist/{SelectSeparator-DXswVdRz.js → SelectSeparator-C2UGOkXF.js} +1 -1
- package/dist/Separator-DQcwC2TR.js +44 -0
- package/dist/Switch-B8RscmRu.js +49 -0
- package/dist/{Toaster-Bw4xR8xV.js → Toaster-D9qIHjBI.js} +1 -1
- package/dist/{ToggleGroupItem-pEM9vIhs.js → ToggleGroupItem-BLtr3TJq.js} +2 -2
- package/dist/TooltipProvider-BJ_Y5EGX.js +109 -0
- package/dist/animated-digit.js +1 -1
- package/dist/api/index.d.ts +15 -32
- package/dist/api/types-extra.d.ts +31 -0
- package/dist/api.js +1 -1
- package/dist/aurora.js +579 -251
- package/dist/border-progress.js +49 -57
- package/dist/{button-DYCUa-tH.js → button-5dY1Dvhd.js} +13 -14
- package/dist/button.js +1 -1
- package/dist/canvas.js +2 -3
- package/dist/card.js +1 -1
- package/dist/carousel.js +20 -20
- package/dist/color-Cs0-oxYL.js +116 -0
- package/dist/color.js +2 -2
- package/dist/command.js +1 -1
- package/dist/completion-seal.d.ts +1 -0
- package/dist/completion-seal.js +89 -0
- package/dist/components/custom/aurora/Aurora.vue.d.ts +10 -5
- package/dist/components/custom/aurora/composables/color.d.ts +13 -0
- package/dist/components/custom/aurora/composables/frameLoop.d.ts +9 -0
- package/dist/components/custom/aurora/composables/runtime.d.ts +12 -0
- package/dist/components/custom/aurora/composables/uniformBridgeWGPU.d.ts +11 -2
- package/dist/components/custom/aurora/composables/wgpuSetup.d.ts +8 -0
- package/dist/components/custom/aurora/constants/presets.d.ts +18 -0
- package/dist/components/custom/aurora/constants/renderMode.d.ts +16 -8
- package/dist/components/custom/aurora/constants/shaders/aurora-mediums.wgsl.d.ts +1 -0
- package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
- package/dist/components/custom/border-progress/composables/spectrum-walk.d.ts +25 -0
- package/dist/components/custom/border-progress/composables/useBorderSpectrum.d.ts +14 -18
- package/dist/components/custom/border-progress/index.d.ts +1 -1
- package/dist/components/custom/completion-seal/CompletionSeal.vue.d.ts +21 -0
- package/dist/components/custom/completion-seal/composables/useCompletionSeal.d.ts +37 -0
- package/dist/components/custom/completion-seal/constants.d.ts +46 -0
- package/dist/components/custom/completion-seal/index.d.ts +4 -0
- package/dist/components/custom/concentric/composables/concentricGLSetup.d.ts +7 -0
- package/dist/components/custom/concentric/composables/concentricWGPUSetup.d.ts +9 -0
- package/dist/components/custom/concentric/composables/ringField.d.ts +57 -16
- package/dist/components/custom/concentric/composables/uniformBridgeWGPU.d.ts +2 -1
- package/dist/components/custom/concentric/composables/useConcentric.d.ts +4 -4
- package/dist/components/custom/concentric/constants.d.ts +30 -6
- package/dist/components/custom/concentric/index.d.ts +2 -2
- package/dist/components/custom/concentric/shaders/concentric.glsl.d.ts +2 -2
- package/dist/components/custom/concentric/shaders/concentric.wgsl.d.ts +1 -1
- package/dist/components/custom/confirm-dialog/ConfirmDialog.vue.d.ts +3 -3
- package/dist/components/custom/constellation/Constellation.vue.d.ts +5 -4
- package/dist/components/custom/constellation/composables/constellationGLSetup.d.ts +10 -0
- package/dist/components/custom/constellation/composables/constellationWGPUSetup.d.ts +19 -0
- package/dist/components/custom/constellation/composables/uniformBridgeWGPU.d.ts +66 -0
- package/dist/components/custom/constellation/composables/useConstellation.d.ts +3 -10
- package/dist/components/custom/constellation/constants.d.ts +33 -0
- package/dist/components/custom/constellation/constellationField.d.ts +31 -1
- package/dist/components/custom/constellation/constellationInteraction.d.ts +23 -14
- package/dist/components/custom/constellation/constellationRender.d.ts +25 -0
- package/dist/components/custom/constellation/constellationTypes.d.ts +38 -0
- package/dist/components/custom/constellation/constellationWell.d.ts +15 -0
- package/dist/components/custom/constellation/index.d.ts +5 -5
- package/dist/components/custom/constellation/shaders/constellation-lines.glsl.d.ts +2 -0
- package/dist/components/custom/constellation/shaders/constellation-lines.wgsl.d.ts +1 -0
- package/dist/components/custom/constellation/shaders/constellation-points.glsl.d.ts +2 -0
- package/dist/components/custom/constellation/shaders/constellation-points.wgsl.d.ts +1 -0
- package/dist/components/custom/deck/DeckPager.vue.d.ts +29 -0
- package/dist/components/custom/deck/composables/useDeck.d.ts +27 -0
- package/dist/components/custom/deck/composables/useDeckKeyboard.d.ts +25 -0
- package/dist/components/custom/deck/composables/useDeckSpring.d.ts +22 -0
- package/dist/components/custom/deck/constants.d.ts +14 -0
- package/dist/components/custom/deck/index.d.ts +8 -0
- package/dist/components/custom/dock/DockIconButton.vue.d.ts +12 -0
- package/dist/components/custom/dock/DockStack.vue.d.ts +65 -0
- package/dist/components/custom/dock/GlassDock.vue.d.ts +4 -2
- package/dist/components/custom/dock/composables/dockMorphMeasure.d.ts +80 -0
- package/dist/components/custom/dock/composables/index.d.ts +2 -0
- package/dist/components/custom/dock/composables/useDockSearch.d.ts +85 -0
- package/dist/components/custom/dock/composables/useDockShellProps.d.ts +11 -0
- package/dist/components/custom/dock/constants.d.ts +18 -14
- package/dist/components/custom/dock/index.d.ts +5 -2
- package/dist/components/custom/dot-flow-field/DotFlowField.vue.d.ts +15 -11
- package/dist/components/custom/dot-flow-field/composables/flowField.d.ts +48 -6
- package/dist/components/custom/dot-flow-field/composables/uniformBridgeWGPU.d.ts +23 -8
- package/dist/components/custom/dot-flow-field/composables/useDotFlowField.d.ts +6 -5
- package/dist/components/custom/dot-flow-field/composables/useFlowParticles.d.ts +18 -5
- package/dist/components/custom/dot-flow-field/constants.d.ts +42 -21
- package/dist/components/custom/dot-flow-field/index.d.ts +2 -2
- package/dist/components/custom/dot-flow-field/shaders/flow-field.compute.wgsl.d.ts +1 -1
- package/dist/components/custom/dot-flow-field/shaders/flow-field.glsl.d.ts +4 -20
- package/dist/components/custom/dot-flow-field/shaders/flow-field.render.wgsl.d.ts +1 -1
- package/dist/components/custom/dot-matrix/DotMatrix.vue.d.ts +43 -0
- package/dist/components/custom/dot-matrix/composables/dotMatrixField.d.ts +89 -0
- package/dist/components/custom/dot-matrix/composables/uniformBridgeWGPU.d.ts +52 -0
- package/dist/components/custom/dot-matrix/composables/useDotMatrix.d.ts +34 -0
- package/dist/components/custom/dot-matrix/composables/useDotSphere.d.ts +27 -0
- package/dist/components/custom/dot-matrix/constants.d.ts +58 -0
- package/dist/components/custom/dot-matrix/index.d.ts +5 -0
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.glsl.d.ts +4 -0
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.wgsl.d.ts +1 -0
- package/dist/components/custom/easing/EasingPicker.vue.d.ts +2 -2
- package/dist/components/custom/easing/composables/useEasingPicker.d.ts +5 -0
- package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +11 -0
- package/dist/components/custom/fourier-field/FourierField.vue.d.ts +40 -47
- package/dist/components/custom/fourier-field/composables/fourierFieldGLSetup.d.ts +15 -0
- package/dist/components/custom/fourier-field/composables/fourierFieldWGPUSetup.d.ts +20 -0
- package/dist/components/custom/fourier-field/composables/uniformBridgeWGPU.d.ts +41 -0
- package/dist/components/custom/fourier-field/composables/useFourierField.d.ts +40 -37
- package/dist/components/custom/fourier-field/constants.d.ts +61 -4
- package/dist/components/custom/fourier-field/index.d.ts +23 -18
- package/dist/components/custom/fourier-field/shaders/fourier-field.compute.wgsl.d.ts +1 -0
- package/dist/components/custom/fourier-field/shaders/fourier-field.glsl.d.ts +4 -0
- package/dist/components/custom/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +9 -1
- package/dist/components/custom/goo-blob/constants.d.ts +1 -1
- package/dist/components/custom/goo-blob/index.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/metaball-noise.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/metaball-palette.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/metaball.wgsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/types.d.ts +36 -0
- package/dist/components/custom/goo-dot-matrix/GooDotMatrix.vue.d.ts +49 -0
- package/dist/components/custom/goo-dot-matrix/composables/gooDotLattice.d.ts +24 -0
- package/dist/components/custom/goo-dot-matrix/composables/gooDotSetup.d.ts +50 -0
- package/dist/components/custom/goo-dot-matrix/composables/uniformBridgeWGPU.d.ts +35 -0
- package/dist/components/custom/goo-dot-matrix/composables/useGooDotMatrix.d.ts +31 -0
- package/dist/components/custom/goo-dot-matrix/constants.d.ts +76 -0
- package/dist/components/custom/goo-dot-matrix/index.d.ts +5 -0
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.frag.d.ts +11 -0
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.wgsl.d.ts +3 -0
- package/dist/components/custom/labeled-field/LabeledField.vue.d.ts +21 -2
- package/dist/components/custom/metric-stack/MetricRow.vue.d.ts +15 -0
- package/dist/components/custom/pager-dots/PagerDots.vue.d.ts +9 -0
- package/dist/components/custom/pager-dots/index.d.ts +2 -0
- package/dist/components/custom/pager-dots/pagerWindow.d.ts +9 -0
- package/dist/components/custom/paper-grid/PaperGrid.vue.d.ts +42 -0
- package/dist/components/custom/paper-grid/composables/paperGrid.d.ts +90 -0
- package/dist/components/custom/paper-grid/composables/paperGridGLSetup.d.ts +16 -0
- package/dist/components/custom/paper-grid/composables/paperGridWGPUSetup.d.ts +19 -0
- package/dist/components/custom/paper-grid/composables/uniformBridgeWGPU.d.ts +16 -0
- package/dist/components/custom/paper-grid/composables/usePaperGrid.d.ts +31 -0
- package/dist/components/custom/paper-grid/constants.d.ts +57 -0
- package/dist/components/custom/paper-grid/index.d.ts +5 -0
- package/dist/components/custom/paper-grid/shaders/paper-grid.glsl.d.ts +4 -0
- package/dist/components/custom/paper-grid/shaders/paper-grid.wgsl.d.ts +1 -0
- package/dist/components/custom/search/FuzzySearch.vue.d.ts +8 -2
- package/dist/components/custom/search/SearchBar.vue.d.ts +8 -0
- package/dist/components/custom/search/index.d.ts +2 -0
- package/dist/components/custom/search/searchVariants.d.ts +19 -0
- package/dist/components/custom/selectable-chip/SelectableChip.vue.d.ts +50 -0
- package/dist/components/custom/selectable-chip/index.d.ts +2 -0
- package/dist/components/custom/selectable-chip/selectableChipVariants.d.ts +23 -0
- package/dist/components/custom/split-chars/SplitChars.vue.d.ts +39 -0
- package/dist/components/custom/split-chars/index.d.ts +1 -0
- package/dist/components/custom/tabs/SegmentedTabs.vue.d.ts +8 -6
- package/dist/components/custom/tabs/constants.d.ts +20 -2
- package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +29 -16
- package/dist/components/custom/watercolor-dot/useWatercolorBlob.d.ts +10 -5
- package/dist/components/ui/_shared/index.d.ts +2 -0
- package/dist/components/ui/_shared/useControlSize.d.ts +46 -0
- package/dist/components/ui/button/index.d.ts +1 -1
- package/dist/components/ui/card/Card.vue.d.ts +45 -0
- package/dist/components/ui/card/index.d.ts +1 -1
- package/dist/components/ui/carousel/CarouselNext.vue.d.ts +1 -1
- package/dist/components/ui/carousel/CarouselPrevious.vue.d.ts +1 -1
- package/dist/components/ui/command/CommandDialog.vue.d.ts +9 -3
- package/dist/components/ui/command/CommandList.vue.d.ts +3 -0
- package/dist/components/ui/context-menu/ContextMenuContent.vue.d.ts +5 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +4 -0
- package/dist/components/ui/hover-card/HoverCardContent.vue.d.ts +3 -0
- package/dist/components/ui/input/Input.vue.d.ts +3 -0
- package/dist/components/ui/number-field/NumberFieldInput.vue.d.ts +6 -1
- package/dist/components/ui/select/SelectContent.vue.d.ts +3 -0
- package/dist/components/ui/switch/Switch.vue.d.ts +2 -0
- package/dist/components/ui/textarea/Textarea.vue.d.ts +3 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +3 -0
- package/dist/composables/color/index.d.ts +2 -0
- package/dist/composables/color/useAccentTone.d.ts +34 -0
- package/dist/composables/glass/useVizChoreography.d.ts +123 -0
- package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +10 -0
- package/dist/composables/glass/webgl/shaders/flow.wgsl.d.ts +1 -0
- package/dist/composables/glass/webgpu/index.d.ts +1 -1
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +28 -7
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +1 -0
- package/dist/composables/glass/webgpu/webgpuDevice.d.ts +42 -0
- package/dist/composables/motion/core/index.d.ts +3 -0
- package/dist/composables/motion/scrollReader.d.ts +25 -0
- package/dist/composables/motion/springPresets.d.ts +20 -1
- package/dist/composables/motion/useCharStagger.d.ts +44 -0
- package/dist/composables/motion/useDockCtaReceive.d.ts +31 -6
- package/dist/composables/motion/useScrollChrome.d.ts +58 -0
- package/dist/composables/motion/useScrollTrigger.d.ts +67 -0
- package/dist/composables/motion/useSpringPress.d.ts +5 -5
- package/dist/composables/motion/useStaggerReveal.d.ts +24 -0
- package/dist/composables/sidebar/index.d.ts +4 -1
- package/dist/composables/sidebar/types.d.ts +68 -3
- package/dist/composables/sidebar/useClickDelegate.d.ts +4 -0
- package/dist/composables/sidebar/useLazyLoader.d.ts +5 -0
- package/dist/composables/sidebar/useScrollTo.d.ts +5 -0
- package/dist/composables/virtual/index.d.ts +4 -0
- package/dist/composables/virtual/useVirtualSectionWindow.d.ts +72 -0
- package/dist/composables/virtual/useWindowedStore.d.ts +43 -0
- package/dist/composables/virtual/virtualSectionLayout.d.ts +103 -0
- package/dist/concentric.js +495 -221
- package/dist/configurator.js +2 -2
- package/dist/confirm-dialog.js +62 -47
- package/dist/constellation.js +635 -235
- package/dist/context-menu.js +2 -2
- package/dist/controls.js +1 -1
- package/dist/createCanvasLifecycle-Gh45Ce-p.js +93 -0
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/deck.d.ts +1 -0
- package/dist/deck.js +105 -0
- package/dist/dialog.js +4 -3
- package/dist/dock.js +602 -458
- package/dist/dot-flow-field.js +580 -290
- package/dist/dot-matrix.d.ts +1 -0
- package/dist/dot-matrix.js +630 -0
- package/dist/dotMatrixField-D_x9_1qq.js +48 -0
- package/dist/{dropdown-menu-CofSZuk8.js → dropdown-menu-aJmV5SqE.js} +83 -79
- package/dist/dropdown-menu.js +1 -1
- package/dist/easing.js +188 -176
- package/dist/expandable-container.js +42 -20
- package/dist/fading-scroll.js +1 -1
- package/dist/flow.glsl-B2P7e0MT.js +4 -0
- package/dist/forms.js +62 -60
- package/dist/fourier-field.js +825 -178
- package/dist/fourier-math.js +1 -1
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +145 -104
- package/dist/goo-blob.js +171 -1228
- package/dist/goo-dot-matrix.d.ts +1 -0
- package/dist/goo-dot-matrix.js +591 -0
- package/dist/handmark.js +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/hover-popover.js +1 -1
- package/dist/icon-chip.js +1 -1
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/instrument-chassis.js +1 -1
- package/dist/keyboard.js +1 -1
- package/dist/labeled-field.js +70 -60
- package/dist/metric-cell.js +1 -1
- package/dist/metric-stack.js +11 -2
- package/dist/motion-core.js +54 -32
- package/dist/motion-curves.js +11 -1
- package/dist/motion.js +46 -111
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +2 -91
- package/dist/paper-backdrop.js +1 -1
- package/dist/paper-grid.d.ts +1 -0
- package/dist/paper-grid.js +788 -0
- package/dist/{presets-BW2b-fr1.js → presets-CvOUqtdY.js} +3 -3
- package/dist/{procedural-color.glsl-CIFsJhwI.js → procedural-color.wgsl-m7Zgv35j.js} +2 -2
- package/dist/progress.js +1 -1
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +1 -1
- package/dist/{useCanvas2D-B8w_E3Rr.js → resolveCanvasColor-yPyIpJt9.js} +12 -2
- package/dist/scrollReader-DI1NWxUw.js +42 -0
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +160 -304
- package/dist/select.js +3 -3
- package/dist/selectable-chip.d.ts +1 -0
- package/dist/selectable-chip.js +65 -0
- package/dist/separator.js +1 -1
- package/dist/{sheet-tZMg0E0w.js → sheet-B2flBfLH.js} +2 -2
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +216 -114
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +1 -1
- package/dist/spectrum-walk-BVzA7Biz.js +33 -0
- package/dist/{springPresets-CFQGQfdl.js → springPresets-Ce7OYCm9.js} +12 -6
- package/dist/styles/animations.css +13 -3
- package/dist/styles/cards.css +69 -0
- package/dist/styles/completion-seal.css +131 -0
- package/dist/styles/components.css +2 -3
- package/dist/styles/configurator.css +55 -0
- package/dist/styles/critical-partition.mjs +33 -11
- package/dist/styles/deferred.css +2 -0
- package/dist/styles/dock/cta-seat.css +87 -0
- package/dist/styles/dock/density.css +153 -0
- package/dist/styles/dock/layers.css +55 -7
- package/dist/styles/dock/morph-bridge.css +54 -18
- package/dist/styles/dock/morph.css +41 -33
- package/dist/styles/dock/overflow.css +12 -0
- package/dist/styles/dock/search.css +68 -0
- package/dist/styles/dock/shape.css +124 -0
- package/dist/styles/dock/shell.css +23 -5
- package/dist/styles/dock/stack-rail.css +264 -0
- package/dist/styles/dock-controls/dark-mode-toggle.css +17 -4
- package/dist/styles/dock-controls/icon-button.css +14 -0
- package/dist/styles/dock.css +11 -1
- package/dist/styles/glass/accent-tone.css +66 -0
- package/dist/styles/glass/control-surfaces.css +167 -0
- package/dist/styles/glass/ladder.css +67 -17
- package/dist/styles/glass/rim.css +19 -9
- package/dist/styles/glass/surfaces.css +69 -148
- package/dist/styles/glass.css +10 -0
- package/dist/styles/index.css +15 -0
- package/dist/styles/scroll-chrome.css +123 -0
- package/dist/styles/scroll-driven.css +38 -0
- package/dist/styles/segmented-tabs.css +50 -14
- package/dist/styles/theme/bridges.css +22 -0
- package/dist/styles/theme/radius.css +18 -1
- package/dist/styles/tokens/color-radius.css +13 -3
- package/dist/styles/tokens/dark-arm.css +39 -6
- package/dist/styles/tokens/glass-deep.css +28 -3
- package/dist/styles/tokens/glass-fx.css +44 -1
- package/dist/styles/tokens/glass.css +91 -31
- package/dist/styles/tokens/light-dark.css +1 -1
- package/dist/styles/tokens/offsets.css +27 -0
- package/dist/styles/tokens/property-regs.css +133 -0
- package/dist/styles/tokens/scale-paper.css +73 -29
- package/dist/styles/tokens/scheme-motion.css +44 -6
- package/dist/styles/tokens/sizing-config.css +110 -0
- package/dist/styles/tokens/sizing.css +55 -104
- package/dist/styles/tokens.css +5 -0
- package/dist/styles/typography/semantic.css +18 -5
- package/dist/styles/utilities/a11y-overrides.css +20 -5
- package/dist/styles/utilities/base-misc.css +52 -0
- package/dist/styles/utilities/btn.css +14 -3
- package/dist/styles/utilities/components.css +31 -6
- package/dist/styles/utilities/metal.css +26 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +8 -8
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/toggle-chip.js +10 -10
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/uniformBridgeWGPU-CtAKl45L.js +1204 -0
- package/dist/{useAnimatedNumber-BfUq2bUM.js → useAnimatedNumber-CLrxicG9.js} +1 -1
- package/dist/{useConfiguratorState-DNlOh6c8.js → useConfiguratorState-4xblKfwd.js} +25 -24
- package/dist/useControlSize-SH1UmJCi.js +9 -0
- package/dist/useDockCtaReceive-DfFkmgL1.js +82 -0
- package/dist/{useDragMorph-DgxnsVJz.js → useDragMorph-BUgAC-zK.js} +4 -4
- package/dist/useFuzzySearch-DIhcYtcw.js +177 -0
- package/dist/useGpuSubstrate-4pTcp6mX.js +294 -0
- package/dist/{useLiquidPress-kfb4KX79.js → useLiquidPress-BooG97RY.js} +2 -2
- package/dist/usePointerVelocityField-QLsy3_kv.js +91 -0
- package/dist/useScrollChrome-D66AVP7C.js +258 -0
- package/dist/{useSpringMount-q1amq1SJ.js → useSpringMount-BWDnKIwh.js} +1 -1
- package/dist/useSpringPress-B1-Czp-V.js +36 -0
- package/dist/useViewTransition-CUI1nAgn.js +95 -0
- package/dist/{vendor-CKmzio-i.js → vendor-B2qOlYY3.js} +24 -11
- package/dist/virtual.d.ts +1 -0
- package/dist/virtual.js +225 -0
- package/dist/watercolor-dot.js +116 -73
- package/package.json +127 -7
- package/src/styles/animations.css +13 -3
- package/src/styles/cards.css +69 -0
- package/src/styles/completion-seal.css +131 -0
- package/src/styles/configurator.css +55 -0
- package/src/styles/critical-partition.mjs +33 -11
- package/src/styles/dock/cta-seat.css +87 -0
- package/src/styles/dock/density.css +153 -0
- package/src/styles/dock/layers.css +55 -7
- package/src/styles/dock/morph-bridge.css +54 -18
- package/src/styles/dock/morph.css +41 -33
- package/src/styles/dock/overflow.css +12 -0
- package/src/styles/dock/search.css +68 -0
- package/src/styles/dock/shape.css +124 -0
- package/src/styles/dock/shell.css +23 -5
- package/src/styles/dock/stack-rail.css +264 -0
- package/src/styles/dock-controls/dark-mode-toggle.css +17 -4
- package/src/styles/dock-controls/icon-button.css +14 -0
- package/src/styles/dock.css +11 -1
- package/src/styles/glass/accent-tone.css +66 -0
- package/src/styles/glass/control-surfaces.css +167 -0
- package/src/styles/glass/ladder.css +67 -17
- package/src/styles/glass/rim.css +19 -9
- package/src/styles/glass/surfaces.css +69 -148
- package/src/styles/glass.css +10 -0
- package/src/styles/index.css +15 -0
- package/src/styles/scroll-chrome.css +123 -0
- package/src/styles/scroll-driven.css +38 -0
- package/src/styles/segmented-tabs.css +50 -14
- package/src/styles/theme/bridges.css +22 -0
- package/src/styles/theme/radius.css +18 -1
- package/src/styles/tokens/color-radius.css +13 -3
- package/src/styles/tokens/dark-arm.css +39 -6
- package/src/styles/tokens/glass-deep.css +28 -3
- package/src/styles/tokens/glass-fx.css +44 -1
- package/src/styles/tokens/glass.css +91 -31
- package/src/styles/tokens/light-dark.css +1 -1
- package/src/styles/tokens/offsets.css +27 -0
- package/src/styles/tokens/property-regs.css +133 -0
- package/src/styles/tokens/scale-paper.css +73 -29
- package/src/styles/tokens/scheme-motion.css +44 -6
- package/src/styles/tokens/sizing-config.css +110 -0
- package/src/styles/tokens/sizing.css +55 -104
- package/src/styles/tokens.css +5 -0
- package/src/styles/typography/semantic.css +18 -5
- package/src/styles/utilities/a11y-overrides.css +20 -5
- package/src/styles/utilities/base-misc.css +52 -0
- package/src/styles/utilities/btn.css +14 -3
- package/src/styles/utilities/components.css +31 -6
- package/src/styles/utilities/metal.css +26 -0
- package/dist/ContextMenuContent-uWnVxDab.js +0 -85
- package/dist/DialogFooter-BZNX5aVr.js +0 -165
- package/dist/HoverCardContent-b2uaAMRR.js +0 -83
- package/dist/Input-h9v5LeXf.js +0 -55
- package/dist/NumberFieldContent-Cq7EzX-U.js +0 -138
- package/dist/Separator-pKF0oA4M.js +0 -37
- package/dist/Switch-CwYNf8bo.js +0 -47
- package/dist/TooltipProvider-rzvnXz60.js +0 -104
- package/dist/color-DweYl7pE.js +0 -86
- package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +0 -35
- package/dist/components/custom/constellation/constellationDraw.d.ts +0 -30
- package/dist/components/custom/dock/DockRail.vue.d.ts +0 -89
- package/dist/createCanvasLifecycle-CHD5XrDW.js +0 -82
- package/dist/procedural-color.wgsl-CToRHugY.js +0 -224
- package/dist/resolveCanvasColor-CUyHr5Uu.js +0 -11
- package/dist/styles/dock/rail-extend.css +0 -397
- package/dist/usePointerVelocityField-JbRd5CrM.js +0 -137
- package/dist/useRAFLoop-UYa4zoiN.js +0 -109
- package/dist/useSpringPress-BsqPr7FJ.js +0 -34
- package/src/styles/dock/rail-extend.css +0 -397
- /package/dist/{FadingScroll-DI6hQhT9.js → FadingScroll-DLRbH5Xr.js} +0 -0
- /package/dist/{HoverPopover-CbqbNwgU.js → HoverPopover-BcIxvyqZ.js} +0 -0
- /package/dist/{InstrumentChassis-Bx0F_q5g.js → InstrumentChassis-CxsHSyMj.js} +0 -0
- /package/dist/{PaperBackdrop-Vf3tlpvd.js → PaperBackdrop-CqwjnfLv.js} +0 -0
- /package/dist/{Progress-DctG61iZ.js → Progress-CnqB7gLm.js} +0 -0
- /package/dist/{ScrollingText-yOpBzFYq.js → ScrollingText-CTZbA_cG.js} +0 -0
- /package/dist/{SelectGroup-DwwjicPY.js → SelectGroup-BFiod7X2.js} +0 -0
- /package/dist/{compile-CQEFRTmx.js → compile-nZ1xVYTp.js} +0 -0
- /package/dist/{constants-BPOqYJAm.js → constants--C2DkLW8.js} +0 -0
- /package/dist/{math-BINYmg5z.js → math-Eb0w3LqU.js} +0 -0
- /package/dist/{prng-Za0Rmgag.js → prng-B-d9eYX8.js} +0 -0
- /package/dist/{slider-DVb4HXU-.js → slider-2A0rPn79.js} +0 -0
- /package/dist/{useGlobalDark-C28t0VWJ.js → useGlobalDark-CmjB9E32.js} +0 -0
- /package/dist/{useIntersectionPause-Bj4sPkMh.js → useIntersectionPause-Dbozzjgm.js} +0 -0
- /package/dist/{useInterval-CvK1mL92.js → useInterval-CNdua40W.js} +0 -0
- /package/dist/{useKeyboardShortcuts-BXWXOZ-9.js → useKeyboardShortcuts-BPRp33Im.js} +0 -0
- /package/dist/{useLiquidFlex-mZPMiNXh.js → useLiquidFlex-UmA6LMZu.js} +0 -0
- /package/dist/{useScrollProgress-D7bYU2RK.js → useScrollProgress-c3yxmH6a.js} +0 -0
- /package/dist/{useSortable-DHjtZSEd.js → useSortable-BVqlJRBR.js} +0 -0
- /package/dist/{useTextHighlight-CWEi25hf.js → useTextHighlight-NmBM5V_4.js} +0 -0
- /package/dist/{vReveal-Czsb7zQC.js → vReveal-D9k0jADx.js} +0 -0
- /package/dist/{vSpecular-CQFmLNzA.js → vSpecular-EX7loENl.js} +0 -0
package/dist/dot-flow-field.js
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-C1je1s0u.js";
|
|
2
|
+
import { t } from "./usePointerVelocityField-QLsy3_kv.js";
|
|
3
|
+
import { n, o as r, r as i, s as a } from "./procedural-color.wgsl-m7Zgv35j.js";
|
|
4
|
+
import { a as o, t as s } from "./useGpuSubstrate-4pTcp6mX.js";
|
|
5
|
+
import { c } from "./color-Cs0-oxYL.js";
|
|
5
6
|
import { computed as l, createElementBlock as u, createElementVNode as d, defineComponent as f, normalizeStyle as p, onScopeDispose as m, openBlock as h, useTemplateRef as g, watch as _ } from "vue";
|
|
6
7
|
//#region src/components/custom/dot-flow-field/shaders/flow-field.compute.wgsl.ts
|
|
7
|
-
var v = "\nconst MAX_WAVE_COMPONENTS: i32 = 8;\nconst PI: f32 = 3.141592653589793;\nconst TAU: f32 = 6.283185307179586;\nconst FLOW_GRAVITY: f32 = 9.81;\nconst CURL_EPS: f32 = 0.012;\nconst FBM_ROT: mat2x2<f32> = mat2x2<f32>(0.8, 0.6, -0.6, 0.8);\n\nstruct Particle {\n // (pos.x, pos.y,
|
|
8
|
+
var v = "\nconst MAX_WAVE_COMPONENTS: i32 = 8;\nconst PI: f32 = 3.141592653589793;\nconst TAU: f32 = 6.283185307179586;\nconst FLOW_GRAVITY: f32 = 9.81;\nconst CURL_EPS: f32 = 0.012;\nconst FBM_ROT: mat2x2<f32> = mat2x2<f32>(0.8, 0.6, -0.6, 0.8);\n\nstruct Particle {\n // (pos.x, pos.y, height, |disp|) — the anchored-lattice live state\n data: vec4<f32>,\n};\n\n// ── Uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──\nstruct FlowUniforms {\n // p0: (uTime, uDt, uWindSpeed, uCurlStrength)\n p0: vec4<f32>,\n // p1: (uGridPitch, uDisplaceAmp, uSpringK, uGridCols) — the lattice geometry\n p1: vec4<f32>,\n // ints: (uWaveCount, uParticleCount, uGridColsI, _pad)\n ints: vec4<i32>,\n // each wave row: (amplitude, wavelength, directionDeg, phase)\n waves: array<vec4<f32>, 8>,\n};\n\n@group(0) @binding(0) var<uniform> u: FlowUniforms;\n@group(0) @binding(1) var<storage, read_write> particles: array<Particle>;\n\n// ── The deterministic lattice origin (transcribes flowField.ts gridOrigin) ──\nfn gridOrigin(index: u32, cols: i32, pitch: f32) -> vec2<f32> {\n let c = max(cols, 1);\n let col = i32(index) % c;\n let row = i32(index) / c;\n let half = f32(c - 1) * pitch * 0.5;\n return vec2<f32>(f32(col) * pitch - half, f32(row) * pitch - half);\n}\n\n// ── The Gerstner-sum analytic ∇⊥h velocity (transcribes flowField.ts gerstnerVelocity) ──\nfn gerstnerVelocity(p: vec2<f32>, t: f32) -> vec2<f32> {\n var dhdx = 0.0;\n var dhdy = 0.0;\n let windSpeed = u.p0.z;\n let waveCount = u.ints.x;\n for (var i = 0; i < MAX_WAVE_COMPONENTS; i = i + 1) {\n if (i >= waveCount) { break; }\n let w = u.waves[i];\n let amplitude = w.x;\n let wavelength = max(w.y, 1e-4);\n let dirRad = w.z * PI / 180.0;\n let phase = w.w;\n let k = TAU / wavelength;\n let d = vec2<f32>(cos(dirRad), sin(dirRad));\n let omega = sqrt(FLOW_GRAVITY * k) * windSpeed;\n let theta = k * (d.x * p.x + d.y * p.y) - omega * t + phase;\n let akc = amplitude * k * cos(theta);\n dhdx = dhdx + akc * d.x;\n dhdy = dhdy + akc * d.y;\n }\n // v = ∇⊥h = (∂h/∂y, −∂h/∂x).\n return vec2<f32>(dhdy, -dhdx);\n}\n\n// ── The scalar Gerstner HEIGHT (transcribes flowField.ts sampleHeight — the brightness\n// driver, normalized to ≈[-1,1] by the total amplitude so the band thresholds are\n// wave-table-independent). ──\nfn sampleHeight(o: vec2<f32>, t: f32) -> f32 {\n var h = 0.0;\n var ampSum = 0.0;\n let windSpeed = u.p0.z;\n let waveCount = u.ints.x;\n for (var i = 0; i < MAX_WAVE_COMPONENTS; i = i + 1) {\n if (i >= waveCount) { break; }\n let w = u.waves[i];\n let k = TAU / max(w.y, 1e-4);\n let dirRad = w.z * PI / 180.0;\n let d = vec2<f32>(cos(dirRad), sin(dirRad));\n let omega = sqrt(FLOW_GRAVITY * k) * windSpeed;\n let theta = k * (d.x * o.x + d.y * o.y) - omega * t + w.w;\n h = h + w.x * sin(theta);\n ampSum = ampSum + abs(w.x);\n }\n return h / max(ampSum, 1e-4);\n}\n\n// ── Shared curl-noise basis (the WGSL twin of flow.glsl.ts curlFBM) ──\nfn hash21(p: vec2<f32>) -> f32 {\n var p3 = fract(vec3<f32>(p.x, p.y, p.x) * 0.1031);\n p3 = p3 + dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfn valueNoise(p: vec2<f32>) -> f32 {\n let i = floor(p);\n let f = fract(p);\n let u2 = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n let a = hash21(i + vec2<f32>(0.0, 0.0));\n let b = hash21(i + vec2<f32>(1.0, 0.0));\n let c = hash21(i + vec2<f32>(0.0, 1.0));\n let d = hash21(i + vec2<f32>(1.0, 1.0));\n return mix(mix(a, b, u2.x), mix(c, d, u2.x), u2.y);\n}\n\nfn potentialFBM(p0: vec2<f32>) -> f32 {\n var v = 0.0;\n var amp = 0.5;\n var freq = 1.0;\n var p = p0;\n for (var i = 0; i < 3; i = i + 1) {\n v = v + amp * valueNoise(p * freq);\n p = FBM_ROT * p;\n freq = freq * 2.0;\n amp = amp * 0.5;\n }\n return v;\n}\n\nfn curlFBM(p: vec2<f32>) -> vec2<f32> {\n let dx = potentialFBM(p + vec2<f32>(CURL_EPS, 0.0)) - potentialFBM(p - vec2<f32>(CURL_EPS, 0.0));\n let dy = potentialFBM(p + vec2<f32>(0.0, CURL_EPS)) - potentialFBM(p - vec2<f32>(0.0, CURL_EPS));\n let g = vec2<f32>(dx, dy) / (2.0 * CURL_EPS);\n return vec2<f32>(g.y, -g.x);\n}\n\n// The composite flow velocity (transcribes flowField.ts sampleVelocity EXACTLY — the\n// coarse ×0.55 curl domain-scale, the §3.2 inversion).\nfn sampleVelocity(p: vec2<f32>, t: f32) -> vec2<f32> {\n let curlStrength = u.p0.w;\n var v = gerstnerVelocity(p, t);\n if (curlStrength > 0.0) {\n let c = curlFBM(vec2<f32>(p.x * 0.55 + t * 0.15, p.y * 0.55));\n v = v + c * curlStrength;\n }\n return v;\n}\n\n// The sub-cell DISPLACEMENT (transcribes flowField.ts sampleDisplacement — ∇⊥h + the\n// coarse curl break, soft-clamped through tanh so the magnitude rides into [0,1)).\nfn sampleDisplacement(o: vec2<f32>, t: f32) -> vec2<f32> {\n let v = sampleVelocity(o, t);\n let mag = length(v);\n if (mag < 1e-5) { return vec2<f32>(0.0, 0.0); }\n let bounded = tanh(mag);\n return v * (bounded / mag);\n}\n\n@compute @workgroup_size(64)\nfn cs_main(@builtin(global_invocation_id) gid: vec3<u32>) {\n let idx = gid.x;\n let count = u32(u.ints.y);\n if (idx >= count) { return; } // bounds-guard the dispatch tail\n\n let t = u.p0.x;\n let dt = u.p0.y;\n let pitch = u.p1.x;\n let displaceAmp = u.p1.y;\n let springK = u.p1.z;\n let cols = u.ints.z;\n\n // The PERMANENT anchor — no wrap, no re-seed (the coherence fix).\n let o = gridOrigin(idx, cols, pitch);\n let disp = sampleDisplacement(o, t);\n let anchorTarget = o + disp * (displaceAmp * pitch);\n\n var pr = particles[idx];\n var pos = pr.data.xy;\n // Framerate-independent critically-damped pull-to-anchor:\n // p ← mix(p, anchorTarget, 1 - exp(-springK·dt)) (the GPGPU influence-pull pattern).\n let k = 1.0 - exp(-springK * dt);\n pos = mix(pos, anchorTarget, k);\n\n let h = sampleHeight(o, t);\n particles[idx] = Particle(vec4<f32>(pos, h, length(disp)));\n}\n", y = `
|
|
8
9
|
const PI: f32 = 3.141592653589793;
|
|
9
10
|
const TAU: f32 = 6.283185307179586;
|
|
10
|
-
const FLOW_GRAVITY: f32 = 9.81;
|
|
11
|
-
const MAX_WAVE_COMPONENTS: i32 = 8;
|
|
12
11
|
const MAX_FLOW_STOPS: i32 = 4;
|
|
13
12
|
|
|
14
13
|
struct Particle {
|
|
15
|
-
// (pos.x, pos.y,
|
|
14
|
+
// (pos.x, pos.y, height, |disp|)
|
|
16
15
|
data: vec4<f32>,
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
// ── Render uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──
|
|
20
19
|
struct RenderUniforms {
|
|
21
|
-
// r0: (uTime,
|
|
20
|
+
// r0: (uTime, uContrast, uBaseBright, uDomainHalf)
|
|
22
21
|
r0: vec4<f32>,
|
|
23
|
-
// r1: (uDotSize,
|
|
22
|
+
// r1: (uDotSize, uSizePulse, uAspect, uGridPitch)
|
|
24
23
|
r1: vec4<f32>,
|
|
25
|
-
//
|
|
24
|
+
// r2: (uWaveBandCenter, uWaveBandWidth, uGlobeMask, _pad)
|
|
25
|
+
r2: vec4<f32>,
|
|
26
|
+
// ints: (uStopCount, uParticleCount, _pad, _pad)
|
|
26
27
|
ints: vec4<i32>,
|
|
27
28
|
// bg: (background.rgb, hasBackground)
|
|
28
29
|
bg: vec4<f32>,
|
|
29
|
-
// each wave row: (amplitude, wavelength, directionDeg, phase)
|
|
30
|
-
waves: array<vec4<f32>, 8>,
|
|
31
30
|
// each palette stop: linear-sRGB rgb + _pad
|
|
32
31
|
palette: array<vec4<f32>, 4>,
|
|
33
32
|
};
|
|
@@ -35,34 +34,32 @@ struct RenderUniforms {
|
|
|
35
34
|
@group(0) @binding(0) var<uniform> u: RenderUniforms;
|
|
36
35
|
@group(0) @binding(1) var<storage, read> particles: array<Particle>;
|
|
37
36
|
|
|
38
|
-
${
|
|
39
|
-
${
|
|
37
|
+
${n}
|
|
38
|
+
${i}
|
|
40
39
|
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
fn
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
return vec2<f32>(dhdy, -dhdx);
|
|
40
|
+
// The sweeping bright-stripe band (transcribes flowField.ts waveBand): a soft two-sided
|
|
41
|
+
// ridge over the normalized height — 1 at the band center, falling to 0 at ±width.
|
|
42
|
+
fn waveBand(h: f32, center: f32, width: f32) -> f32 {
|
|
43
|
+
let w = max(width, 1e-3);
|
|
44
|
+
let d = abs(h - center);
|
|
45
|
+
return 1.0 - smoothstep(0.0, w, d);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// The optional soft-disc globe mask — a slow Lissajous-drifting radial field (the
|
|
49
|
+
// reference's two-sphere composition). OFF when uGlobeMask <= 0.5 (returns 1).
|
|
50
|
+
fn globeMask(o: vec2<f32>, t: f32, on: f32) -> f32 {
|
|
51
|
+
if (on <= 0.5) { return 1.0; }
|
|
52
|
+
// a slow Lissajous center drift within the domain
|
|
53
|
+
let cx = 0.35 * sin(t * 0.13);
|
|
54
|
+
let cy = 0.28 * cos(t * 0.11);
|
|
55
|
+
let d = length(o - vec2<f32>(cx, cy));
|
|
56
|
+
// a soft disc of radius ~0.6 with a feathered edge
|
|
57
|
+
return 1.0 - smoothstep(0.45, 0.75, d);
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
// Sample the multi-stop palette (linear-sRGB stops, OKLab mix). t in [0,1].
|
|
64
61
|
fn samplePaletteLin(t: f32) -> vec3<f32> {
|
|
65
|
-
let stopCount = u.ints.
|
|
62
|
+
let stopCount = u.ints.x;
|
|
66
63
|
if (stopCount <= 1) { return u.palette[0].rgb; }
|
|
67
64
|
let n = f32(stopCount);
|
|
68
65
|
let ft = clamp(t, 0.0, 1.0) * (n - 1.0);
|
|
@@ -77,8 +74,7 @@ fn samplePaletteLin(t: f32) -> vec3<f32> {
|
|
|
77
74
|
struct VSOut {
|
|
78
75
|
@builtin(position) pos: vec4<f32>,
|
|
79
76
|
@location(0) local: vec2<f32>, // [-1,1] billboard-local coords for the soft circle
|
|
80
|
-
@location(1)
|
|
81
|
-
@location(2) alphaScale: f32, // velocity-derived alpha scale (denser-where-calm)
|
|
77
|
+
@location(1) bright: f32, // band-driven brightness [0, ~1.6]
|
|
82
78
|
};
|
|
83
79
|
|
|
84
80
|
@vertex
|
|
@@ -95,21 +91,23 @@ fn vs_main(
|
|
|
95
91
|
|
|
96
92
|
let pr = particles[ii].data;
|
|
97
93
|
let p = pr.xy;
|
|
98
|
-
let
|
|
94
|
+
let h = pr.z;
|
|
95
|
+
let dispMag = pr.w;
|
|
99
96
|
let half = u.r0.w;
|
|
100
97
|
|
|
101
|
-
//
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
let
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
let
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
// the quad
|
|
98
|
+
// Brightness = base + band·contrast, masked by the optional globe (read at the live
|
|
99
|
+
// position — close enough to the anchor at the sub-cell cap). The band SWEEPS as h
|
|
100
|
+
// translates across the lattice.
|
|
101
|
+
let band = waveBand(h, u.r2.x, u.r2.y);
|
|
102
|
+
var bright = u.r0.z + band * u.r0.y;
|
|
103
|
+
bright = bright * globeMask(p, u.r0.x, u.r2.z);
|
|
104
|
+
|
|
105
|
+
// A subtle drift-driven size pulse (never a re-seed — the dot only breathes).
|
|
106
|
+
let sizePulse = u.r1.y;
|
|
107
|
+
let sizeWorld = u.r1.x * (1.0 + dispMag * sizePulse);
|
|
108
|
+
|
|
109
|
+
// Position the quad at the dot in clip space. Domain [-half,half] → NDC [-1,1];
|
|
110
|
+
// the quad half-extent rides sizeWorld (in domain units, aspect-corrected x).
|
|
113
111
|
let aspect = u.r1.z;
|
|
114
112
|
let ndc = p / half;
|
|
115
113
|
let off = local * sizeWorld / half;
|
|
@@ -118,8 +116,7 @@ fn vs_main(
|
|
|
118
116
|
var out: VSOut;
|
|
119
117
|
out.pos = vec4<f32>(ndc.x + offX, ndc.y + off.y, 0.0, 1.0);
|
|
120
118
|
out.local = local;
|
|
121
|
-
out.
|
|
122
|
-
out.alphaScale = alphaScale;
|
|
119
|
+
out.bright = bright;
|
|
123
120
|
return out;
|
|
124
121
|
}
|
|
125
122
|
|
|
@@ -127,28 +124,234 @@ fn vs_main(
|
|
|
127
124
|
fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
128
125
|
// Soft circle — radial smoothstep over the billboard-local radius.
|
|
129
126
|
let r = length(in.local);
|
|
130
|
-
let feather = 0.
|
|
127
|
+
let feather = 0.4;
|
|
131
128
|
let mask = 1.0 - smoothstep(1.0 - feather, 1.0, r);
|
|
132
129
|
if (mask < 0.002) { return vec4<f32>(0.0); }
|
|
133
130
|
|
|
134
|
-
|
|
135
|
-
let
|
|
131
|
+
// The brightness lights the dot core; the palette tints it (the warm-cream identity).
|
|
132
|
+
let bright = clamp(in.bright, 0.0, 1.6);
|
|
133
|
+
let tone = clamp(bright, 0.0, 1.0);
|
|
134
|
+
let lin = samplePaletteLin(tone) * bright;
|
|
135
|
+
// A floor alpha so even an off-band dot stays a faint lattice point (the calm grid).
|
|
136
|
+
let alpha = mask * clamp(bright * 0.8 + 0.12, 0.0, 1.0);
|
|
136
137
|
let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
137
138
|
// Premultiplied-alpha output.
|
|
138
139
|
return vec4<f32>(rgb * alpha, alpha);
|
|
139
140
|
}
|
|
140
|
-
`, b =
|
|
141
|
-
|
|
141
|
+
`, b = "#version 300 es\nprecision highp float;\nin vec2 aPosition;\nout vec2 vUv;\nvoid main() {\n vUv = aPosition; // [-1,1]² domain\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}", x = `#version 300 es
|
|
142
|
+
precision highp float;
|
|
143
|
+
|
|
144
|
+
#define PI 3.141592653589793
|
|
145
|
+
#define TAU 6.283185307179586
|
|
146
|
+
#define FLOW_GRAVITY 9.81
|
|
147
|
+
#define CURL_EPS 0.012
|
|
148
|
+
#define MAX_WAVE_COMPONENTS 8
|
|
149
|
+
#define MAX_FLOW_STOPS 4
|
|
150
|
+
|
|
151
|
+
in vec2 vUv;
|
|
152
|
+
out vec4 fragColor;
|
|
153
|
+
|
|
154
|
+
uniform float uTime;
|
|
155
|
+
uniform float uWindSpeed;
|
|
156
|
+
uniform float uCurlStrength;
|
|
157
|
+
uniform float uDomainHalf;
|
|
158
|
+
uniform float uAspect;
|
|
159
|
+
uniform float uGridPitchDomain; // lattice pitch in DOMAIN units
|
|
160
|
+
uniform float uDotRadiusDomain; // dot radius in DOMAIN units
|
|
161
|
+
uniform float uDisplaceAmp; // sub-cell drift in pitch fractions
|
|
162
|
+
uniform float uContrast;
|
|
163
|
+
uniform float uBaseBright;
|
|
164
|
+
uniform float uWaveBandCenter;
|
|
165
|
+
uniform float uWaveBandWidth;
|
|
166
|
+
uniform float uGlobeMask;
|
|
167
|
+
uniform int uWaveCount;
|
|
168
|
+
uniform int uStopCount;
|
|
169
|
+
uniform float uHasBackground;
|
|
170
|
+
uniform vec3 uBg;
|
|
171
|
+
uniform vec4 uWaves[MAX_WAVE_COMPONENTS]; // (amplitude, wavelength, directionDeg, phase)
|
|
172
|
+
uniform vec3 uPalette[MAX_FLOW_STOPS]; // linear-sRGB stops
|
|
173
|
+
|
|
174
|
+
const mat2 FBM_ROT = mat2(0.8, 0.6, -0.6, 0.8);
|
|
175
|
+
|
|
176
|
+
${r}
|
|
177
|
+
${a}
|
|
178
|
+
|
|
179
|
+
// ── The Gerstner-sum analytic ∇⊥h velocity (transcribes flowField.ts gerstnerVelocity) ──
|
|
180
|
+
vec2 gerstnerVelocity(vec2 p, float t) {
|
|
181
|
+
float dhdx = 0.0;
|
|
182
|
+
float dhdy = 0.0;
|
|
183
|
+
for (int i = 0; i < MAX_WAVE_COMPONENTS; i++) {
|
|
184
|
+
if (i >= uWaveCount) break;
|
|
185
|
+
vec4 w = uWaves[i];
|
|
186
|
+
float k = TAU / max(w.y, 1e-4);
|
|
187
|
+
float dirRad = w.z * PI / 180.0;
|
|
188
|
+
vec2 d = vec2(cos(dirRad), sin(dirRad));
|
|
189
|
+
float omega = sqrt(FLOW_GRAVITY * k) * uWindSpeed;
|
|
190
|
+
float theta = k * (d.x * p.x + d.y * p.y) - omega * t + w.w;
|
|
191
|
+
float akc = w.x * k * cos(theta);
|
|
192
|
+
dhdx += akc * d.x;
|
|
193
|
+
dhdy += akc * d.y;
|
|
194
|
+
}
|
|
195
|
+
return vec2(dhdy, -dhdx);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// ── The scalar Gerstner HEIGHT (transcribes flowField.ts sampleHeight) ──
|
|
199
|
+
float sampleHeight(vec2 o, float t) {
|
|
200
|
+
float h = 0.0;
|
|
201
|
+
float ampSum = 0.0;
|
|
202
|
+
for (int i = 0; i < MAX_WAVE_COMPONENTS; i++) {
|
|
203
|
+
if (i >= uWaveCount) break;
|
|
204
|
+
vec4 w = uWaves[i];
|
|
205
|
+
float k = TAU / max(w.y, 1e-4);
|
|
206
|
+
float dirRad = w.z * PI / 180.0;
|
|
207
|
+
vec2 d = vec2(cos(dirRad), sin(dirRad));
|
|
208
|
+
float omega = sqrt(FLOW_GRAVITY * k) * uWindSpeed;
|
|
209
|
+
float theta = k * (d.x * o.x + d.y * o.y) - omega * t + w.w;
|
|
210
|
+
h += w.x * sin(theta);
|
|
211
|
+
ampSum += abs(w.x);
|
|
212
|
+
}
|
|
213
|
+
return h / max(ampSum, 1e-4);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// ── Shared curl-noise basis (the GLSL twin of flow.glsl.ts curlFBM) ──
|
|
217
|
+
float hash21(vec2 p) {
|
|
218
|
+
vec3 p3 = fract(vec3(p.x, p.y, p.x) * 0.1031);
|
|
219
|
+
p3 += dot(p3, p3.yzx + 33.33);
|
|
220
|
+
return fract((p3.x + p3.y) * p3.z);
|
|
221
|
+
}
|
|
222
|
+
float valueNoise(vec2 p) {
|
|
223
|
+
vec2 i = floor(p);
|
|
224
|
+
vec2 f = fract(p);
|
|
225
|
+
vec2 u2 = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);
|
|
226
|
+
float a = hash21(i + vec2(0.0, 0.0));
|
|
227
|
+
float b = hash21(i + vec2(1.0, 0.0));
|
|
228
|
+
float c = hash21(i + vec2(0.0, 1.0));
|
|
229
|
+
float d = hash21(i + vec2(1.0, 1.0));
|
|
230
|
+
return mix(mix(a, b, u2.x), mix(c, d, u2.x), u2.y);
|
|
231
|
+
}
|
|
232
|
+
float potentialFBM(vec2 p0) {
|
|
233
|
+
float v = 0.0;
|
|
234
|
+
float amp = 0.5;
|
|
235
|
+
float freq = 1.0;
|
|
236
|
+
vec2 p = p0;
|
|
237
|
+
for (int i = 0; i < 3; i++) {
|
|
238
|
+
v += amp * valueNoise(p * freq);
|
|
239
|
+
p = FBM_ROT * p;
|
|
240
|
+
freq *= 2.0;
|
|
241
|
+
amp *= 0.5;
|
|
242
|
+
}
|
|
243
|
+
return v;
|
|
244
|
+
}
|
|
245
|
+
vec2 curlFBM(vec2 p) {
|
|
246
|
+
float dx = potentialFBM(p + vec2(CURL_EPS, 0.0)) - potentialFBM(p - vec2(CURL_EPS, 0.0));
|
|
247
|
+
float dy = potentialFBM(p + vec2(0.0, CURL_EPS)) - potentialFBM(p - vec2(0.0, CURL_EPS));
|
|
248
|
+
vec2 g = vec2(dx, dy) / (2.0 * CURL_EPS);
|
|
249
|
+
return vec2(g.y, -g.x);
|
|
250
|
+
}
|
|
251
|
+
vec2 sampleVelocity(vec2 p, float t) {
|
|
252
|
+
vec2 v = gerstnerVelocity(p, t);
|
|
253
|
+
if (uCurlStrength > 0.0) {
|
|
254
|
+
vec2 c = curlFBM(vec2(p.x * 0.55 + t * 0.15, p.y * 0.55));
|
|
255
|
+
v += c * uCurlStrength;
|
|
256
|
+
}
|
|
257
|
+
return v;
|
|
258
|
+
}
|
|
259
|
+
// sub-cell displacement (transcribes flowField.ts sampleDisplacement — tanh soft-clamp).
|
|
260
|
+
vec2 sampleDisplacement(vec2 o, float t) {
|
|
261
|
+
vec2 v = sampleVelocity(o, t);
|
|
262
|
+
float mag = length(v);
|
|
263
|
+
if (mag < 1e-5) return vec2(0.0);
|
|
264
|
+
return v * (tanh(mag) / mag);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// The sweeping bright-stripe band (transcribes flowField.ts waveBand).
|
|
268
|
+
float waveBand(float h, float center, float width) {
|
|
269
|
+
float w = max(width, 1e-3);
|
|
270
|
+
float d = abs(h - center);
|
|
271
|
+
return 1.0 - smoothstep(0.0, w, d);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// The optional soft-disc globe mask (the reference's two-sphere composition).
|
|
275
|
+
float globeMask(vec2 o, float t, float on) {
|
|
276
|
+
if (on <= 0.5) return 1.0;
|
|
277
|
+
float cx = 0.35 * sin(t * 0.13);
|
|
278
|
+
float cy = 0.28 * cos(t * 0.11);
|
|
279
|
+
float d = length(o - vec2(cx, cy));
|
|
280
|
+
return 1.0 - smoothstep(0.45, 0.75, d);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
vec3 samplePaletteLin(float t) {
|
|
284
|
+
if (uStopCount <= 1) return uPalette[0];
|
|
285
|
+
float n = float(uStopCount);
|
|
286
|
+
float ft = clamp(t, 0.0, 1.0) * (n - 1.0);
|
|
287
|
+
int i0 = int(floor(ft));
|
|
288
|
+
int i1 = min(i0 + 1, uStopCount - 1);
|
|
289
|
+
float f = ft - float(i0);
|
|
290
|
+
vec3 lmsA = LINEAR_SRGB_TO_LMS * uPalette[i0];
|
|
291
|
+
vec3 lmsB = LINEAR_SRGB_TO_LMS * uPalette[i1];
|
|
292
|
+
vec3 labA = LMS_TO_OKLAB * (sign(lmsA) * pow(abs(lmsA), vec3(1.0 / 3.0)));
|
|
293
|
+
vec3 labB = LMS_TO_OKLAB * (sign(lmsB) * pow(abs(lmsB), vec3(1.0 / 3.0)));
|
|
294
|
+
return oklabToLinearSrgb(mix(labA, labB, f));
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
void main() {
|
|
298
|
+
float aspect = max(uAspect, 1e-4);
|
|
299
|
+
// Domain-space pixel (aspect-corrected x so the lattice stays square).
|
|
300
|
+
vec2 p = vec2(vUv.x * aspect, vUv.y);
|
|
301
|
+
float pitch = max(uGridPitchDomain, 1e-3);
|
|
302
|
+
|
|
303
|
+
// The nearest lattice cell ORIGIN (the anchored grid — the deterministic gridOrigin
|
|
304
|
+
// mapping, evaluated per-pixel: round p/pitch to the nearest cell center).
|
|
305
|
+
vec2 cell = floor(p / pitch + 0.5);
|
|
306
|
+
vec2 o = cell * pitch;
|
|
307
|
+
|
|
308
|
+
// The dot DRIFTS toward o + disp·displaceAmp·pitch (the same sub-cell offset the
|
|
309
|
+
// compute kernel writes — here evaluated analytically per pixel).
|
|
310
|
+
vec2 disp = sampleDisplacement(o, uTime);
|
|
311
|
+
vec2 dotCenter = o + disp * (uDisplaceAmp * pitch);
|
|
312
|
+
|
|
313
|
+
// The soft circle around the (drifted) dot center.
|
|
314
|
+
float dist = length(p - dotCenter);
|
|
315
|
+
float radius = max(uDotRadiusDomain, 1e-4);
|
|
316
|
+
float mask = 1.0 - smoothstep(radius * 0.6, radius, dist);
|
|
317
|
+
if (mask < 0.002) {
|
|
318
|
+
if (uHasBackground > 0.5) {
|
|
319
|
+
fragColor = vec4(clamp(linearToSrgb(uBg), vec3(0.0), vec3(1.0)), 1.0);
|
|
320
|
+
} else {
|
|
321
|
+
fragColor = vec4(0.0);
|
|
322
|
+
}
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// The brightness lights the dot — the SWEEPING band over the height at the anchor.
|
|
327
|
+
float h = sampleHeight(o, uTime);
|
|
328
|
+
float band = waveBand(h, uWaveBandCenter, uWaveBandWidth);
|
|
329
|
+
float bright = (uBaseBright + band * uContrast) * globeMask(o, uTime, uGlobeMask);
|
|
330
|
+
bright = clamp(bright, 0.0, 1.6);
|
|
331
|
+
|
|
332
|
+
float tone = clamp(bright, 0.0, 1.0);
|
|
333
|
+
vec3 lin = samplePaletteLin(tone) * bright;
|
|
334
|
+
vec3 rgb = clamp(linearToSrgb(lin), vec3(0.0), vec3(1.0));
|
|
335
|
+
float alpha = mask * clamp(bright * 0.8 + 0.12, 0.0, 1.0);
|
|
336
|
+
|
|
337
|
+
if (uHasBackground > 0.5) {
|
|
338
|
+
vec3 bg = clamp(linearToSrgb(uBg), vec3(0.0), vec3(1.0));
|
|
339
|
+
fragColor = vec4(mix(bg, rgb, alpha), 1.0);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
fragColor = vec4(rgb * alpha, alpha);
|
|
343
|
+
}`, S = 9.81, C = Math.PI * 2;
|
|
344
|
+
function w(e) {
|
|
142
345
|
let t = e * Math.PI / 180;
|
|
143
346
|
return {
|
|
144
347
|
x: Math.cos(t),
|
|
145
348
|
y: Math.sin(t)
|
|
146
349
|
};
|
|
147
350
|
}
|
|
148
|
-
function
|
|
351
|
+
function T(e, t, n, r) {
|
|
149
352
|
let i = 0, a = 0;
|
|
150
353
|
for (let o of n) {
|
|
151
|
-
let n =
|
|
354
|
+
let n = C / Math.max(o.wavelength, 1e-4), s = w(o.direction), c = Math.sqrt(S * n) * r, l = n * (s.x * e.x + s.y * e.y) - c * t + o.phase, u = Math.cos(l), d = o.amplitude * n * u;
|
|
152
355
|
i += d * s.x, a += d * s.y;
|
|
153
356
|
}
|
|
154
357
|
return {
|
|
@@ -156,8 +359,8 @@ function C(e, t, n, r) {
|
|
|
156
359
|
y: -i
|
|
157
360
|
};
|
|
158
361
|
}
|
|
159
|
-
var
|
|
160
|
-
function
|
|
362
|
+
var E = .012;
|
|
363
|
+
function D(e, t) {
|
|
161
364
|
let n = e * .1031 % 1, r = t * .1031 % 1, i = e * .1031 % 1;
|
|
162
365
|
n < 0 && (n += 1), r < 0 && (r += 1), i < 0 && (i += 1);
|
|
163
366
|
let a = n * (r + 33.33) + r * (i + 33.33) + i * (n + 33.33);
|
|
@@ -165,57 +368,92 @@ function T(e, t) {
|
|
|
165
368
|
let o = (n + r) * i % 1;
|
|
166
369
|
return o < 0 && (o += 1), o;
|
|
167
370
|
}
|
|
168
|
-
function
|
|
371
|
+
function O(e, t, n) {
|
|
169
372
|
return e + (t - e) * n;
|
|
170
373
|
}
|
|
171
|
-
function
|
|
172
|
-
let n = Math.floor(e), r = Math.floor(t), i = e - n, a = t - r, o = i * i * i * (i * (i * 6 - 15) + 10), s = a * a * a * (a * (a * 6 - 15) + 10), c =
|
|
173
|
-
return
|
|
374
|
+
function k(e, t) {
|
|
375
|
+
let n = Math.floor(e), r = Math.floor(t), i = e - n, a = t - r, o = i * i * i * (i * (i * 6 - 15) + 10), s = a * a * a * (a * (a * 6 - 15) + 10), c = D(n, r), l = D(n + 1, r), u = D(n, r + 1), d = D(n + 1, r + 1);
|
|
376
|
+
return O(O(c, l, o), O(u, d, o), s);
|
|
174
377
|
}
|
|
175
|
-
function
|
|
378
|
+
function A(e, t) {
|
|
176
379
|
let n = 0, r = .5, i = 1, a = e, o = t;
|
|
177
380
|
for (let e = 0; e < 3; e++) {
|
|
178
|
-
n += r *
|
|
381
|
+
n += r * k(a * i, o * i);
|
|
179
382
|
let e = .8 * a - .6 * o, t = .6 * a + .8 * o;
|
|
180
383
|
a = e, o = t, i *= 2, r *= .5;
|
|
181
384
|
}
|
|
182
385
|
return n;
|
|
183
386
|
}
|
|
184
|
-
function
|
|
185
|
-
let t =
|
|
387
|
+
function j(e) {
|
|
388
|
+
let t = A(e.x + E, e.y) - A(e.x - E, e.y), n = A(e.x, e.y + E) - A(e.x, e.y - E), r = t / (2 * E);
|
|
186
389
|
return {
|
|
187
|
-
x: n / (2 *
|
|
390
|
+
x: n / (2 * E),
|
|
188
391
|
y: -r
|
|
189
392
|
};
|
|
190
393
|
}
|
|
191
|
-
function
|
|
192
|
-
let a =
|
|
394
|
+
function M(e, t, n, r, i) {
|
|
395
|
+
let a = T(e, t, n, r);
|
|
193
396
|
if (i <= 0) return a;
|
|
194
|
-
let o =
|
|
195
|
-
x: e.x *
|
|
196
|
-
y: e.y *
|
|
397
|
+
let o = j({
|
|
398
|
+
x: e.x * .55 + t * .15,
|
|
399
|
+
y: e.y * .55
|
|
197
400
|
});
|
|
198
401
|
return {
|
|
199
402
|
x: a.x + o.x * i,
|
|
200
403
|
y: a.y + o.y * i
|
|
201
404
|
};
|
|
202
405
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
n
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
406
|
+
var N = .85;
|
|
407
|
+
function P(e, t, n) {
|
|
408
|
+
let r = Math.max(t, 1), i = e % r, a = Math.floor(e / r), o = (r - 1) * n / 2;
|
|
409
|
+
return {
|
|
410
|
+
x: i * n - o,
|
|
411
|
+
y: a * n - o
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
function F(e, t, n, r) {
|
|
415
|
+
let i = 0, a = 0;
|
|
416
|
+
for (let o of n) {
|
|
417
|
+
let n = C / Math.max(o.wavelength, 1e-4), s = w(o.direction), c = Math.sqrt(S * n) * r, l = n * (s.x * e.x + s.y * e.y) - c * t + o.phase;
|
|
418
|
+
i += o.amplitude * Math.sin(l), a += Math.abs(o.amplitude);
|
|
213
419
|
}
|
|
214
|
-
return
|
|
420
|
+
return i / Math.max(a, 1e-4);
|
|
421
|
+
}
|
|
422
|
+
function I(e, t, n, r, i) {
|
|
423
|
+
let a = M(e, t, n, r, i), o = Math.hypot(a.x, a.y);
|
|
424
|
+
if (o < 1e-5) return {
|
|
425
|
+
x: 0,
|
|
426
|
+
y: 0
|
|
427
|
+
};
|
|
428
|
+
let s = Math.tanh(o) / o;
|
|
429
|
+
return {
|
|
430
|
+
x: a.x * s,
|
|
431
|
+
y: a.y * s
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
function L(e, t, n) {
|
|
435
|
+
return 1 - ee(0, Math.max(n, .001), Math.abs(e - t));
|
|
436
|
+
}
|
|
437
|
+
function ee(e, t, n) {
|
|
438
|
+
let r = Math.min(Math.max((n - e) / Math.max(t - e, 1e-6), 0), 1);
|
|
439
|
+
return r * r * (3 - 2 * r);
|
|
440
|
+
}
|
|
441
|
+
function R(e, t = 3, n = 2.5) {
|
|
442
|
+
let r = 2 * N, i = Math.max(n, .5) * r, a = i / C, o = r / 3, s = Math.max(1, Math.min(Math.round(t), 3)), c = [], l = i, u = 1;
|
|
443
|
+
for (let t = 0; t < s; t++) {
|
|
444
|
+
let n = Math.max(l, o), r = C / n, i = Math.exp(-1 / (r * a) ** 2) / (r * r), s = (t % 2 == 0 ? 1 : -1) * (8 + t * 4);
|
|
445
|
+
c.push({
|
|
446
|
+
amplitude: i * u,
|
|
447
|
+
wavelength: n,
|
|
448
|
+
direction: e + s,
|
|
449
|
+
phase: t * 1.618033 % C
|
|
450
|
+
}), l *= .58, u *= .38;
|
|
451
|
+
}
|
|
452
|
+
return c;
|
|
215
453
|
}
|
|
216
454
|
//#endregion
|
|
217
455
|
//#region src/components/custom/dot-flow-field/constants.ts
|
|
218
|
-
var
|
|
456
|
+
var te = 16384, ne = 8, re = 4, z = [{
|
|
219
457
|
L: .92,
|
|
220
458
|
C: .03,
|
|
221
459
|
h: 78
|
|
@@ -223,171 +461,183 @@ var M = 16384, N = 8, P = 4, F = 4e3, I = [{
|
|
|
223
461
|
L: .84,
|
|
224
462
|
C: .07,
|
|
225
463
|
h: 62
|
|
226
|
-
}],
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
464
|
+
}], B = R(35, 3, 2.5), V = {
|
|
465
|
+
waveComponents: B,
|
|
466
|
+
windSpeed: .3,
|
|
467
|
+
curlStrength: .12,
|
|
468
|
+
gridPitch: 26,
|
|
469
|
+
dotSize: 2,
|
|
470
|
+
displaceAmp: .18,
|
|
471
|
+
springK: 6,
|
|
472
|
+
waveBandCenter: 0,
|
|
473
|
+
waveBandWidth: .55,
|
|
474
|
+
contrast: .6,
|
|
475
|
+
coherence: .8,
|
|
476
|
+
globeMask: !1,
|
|
477
|
+
palette: z,
|
|
235
478
|
background: "transparent",
|
|
236
479
|
interactive: !1,
|
|
237
480
|
respectReducedMotion: !0
|
|
238
|
-
},
|
|
481
|
+
}, H = N, ie = 16384;
|
|
482
|
+
function U(e, t) {
|
|
483
|
+
let n = Math.min(Math.max(Math.ceil((t || 320) / Math.max(e, 4)) + 2, 4), 128);
|
|
484
|
+
return {
|
|
485
|
+
cols: n,
|
|
486
|
+
count: Math.min(n * n, ie),
|
|
487
|
+
pitchDomain: 2 * H / Math.max(n, 1)
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
var ae = 176, W = {
|
|
239
491
|
p0: 0,
|
|
240
492
|
p1: 4,
|
|
241
493
|
ints: 8,
|
|
242
494
|
waves: 12
|
|
243
495
|
};
|
|
244
|
-
function
|
|
245
|
-
let e = new ArrayBuffer(
|
|
496
|
+
function G() {
|
|
497
|
+
let e = new ArrayBuffer(ae);
|
|
246
498
|
return {
|
|
247
499
|
buffer: e,
|
|
248
500
|
f32: new Float32Array(e),
|
|
249
501
|
i32: new Int32Array(e)
|
|
250
502
|
};
|
|
251
503
|
}
|
|
252
|
-
|
|
253
|
-
function U(e, t, n, r, i) {
|
|
504
|
+
function oe(e, t, n, r, i) {
|
|
254
505
|
let { f32: a, i32: o } = e;
|
|
255
|
-
a[
|
|
506
|
+
a[W.p0 + 0] = n, a[W.p0 + 1] = r, a[W.p0 + 2] = t.windSpeed, a[W.p0 + 3] = t.curlStrength, a[W.p1 + 0] = i.pitchDomain, a[W.p1 + 1] = t.displaceAmp, a[W.p1 + 2] = t.springK, a[W.p1 + 3] = i.cols;
|
|
256
507
|
let s = Math.min(t.waveComponents.length, 8);
|
|
257
|
-
return o[
|
|
508
|
+
return o[W.ints + 0] = s, o[W.ints + 1] = i.count, o[W.ints + 2] = i.cols, o[W.ints + 3] = 0, de(a, W.waves, t.waveComponents), e;
|
|
258
509
|
}
|
|
259
|
-
var
|
|
510
|
+
var se = 144, K = {
|
|
260
511
|
r0: 0,
|
|
261
512
|
r1: 4,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
palette:
|
|
513
|
+
r2: 8,
|
|
514
|
+
ints: 12,
|
|
515
|
+
bg: 16,
|
|
516
|
+
palette: 20
|
|
266
517
|
};
|
|
267
|
-
function
|
|
268
|
-
let e = new ArrayBuffer(
|
|
518
|
+
function q() {
|
|
519
|
+
let e = new ArrayBuffer(se);
|
|
269
520
|
return {
|
|
270
521
|
buffer: e,
|
|
271
522
|
f32: new Float32Array(e),
|
|
272
523
|
i32: new Int32Array(e)
|
|
273
524
|
};
|
|
274
525
|
}
|
|
275
|
-
|
|
276
|
-
|
|
526
|
+
var J = .22, ce = .4;
|
|
527
|
+
function le(e, t) {
|
|
528
|
+
let n = (t || 320) / (2 * H);
|
|
277
529
|
return e / Math.max(n, 1e-4);
|
|
278
530
|
}
|
|
279
|
-
function
|
|
280
|
-
let { f32:
|
|
281
|
-
|
|
282
|
-
let
|
|
283
|
-
if (
|
|
531
|
+
function ue(e, t, n, r, i, a, o) {
|
|
532
|
+
let { f32: s, i32: l } = e;
|
|
533
|
+
s[K.r0 + 0] = n, s[K.r0 + 1] = t.contrast, s[K.r0 + 2] = J, s[K.r0 + 3] = H, s[K.r1 + 0] = le(t.dotSize, i), s[K.r1 + 1] = ce, s[K.r1 + 2] = r, s[K.r1 + 3] = a.pitchDomain, s[K.r2 + 0] = t.waveBandCenter, s[K.r2 + 1] = t.waveBandWidth, s[K.r2 + 2] = +!!t.globeMask, s[K.r2 + 3] = 0;
|
|
534
|
+
let u = Math.min(o.length, 4);
|
|
535
|
+
if (l[K.ints + 0] = u, l[K.ints + 1] = a.count, l[K.ints + 2] = 0, l[K.ints + 3] = 0, t.background === "transparent") s[K.bg + 0] = 0, s[K.bg + 1] = 0, s[K.bg + 2] = 0, s[K.bg + 3] = 0;
|
|
284
536
|
else {
|
|
285
|
-
let e =
|
|
286
|
-
|
|
537
|
+
let e = c(t.background);
|
|
538
|
+
s[K.bg + 0] = e[0], s[K.bg + 1] = e[1], s[K.bg + 2] = e[2], s[K.bg + 3] = 1;
|
|
287
539
|
}
|
|
288
|
-
q(o, G.waves, t.waveComponents);
|
|
289
540
|
for (let e = 0; e < 4; e++) {
|
|
290
|
-
let t =
|
|
291
|
-
|
|
541
|
+
let t = K.palette + e * 4, n = c(o[Math.min(e, u - 1)] ?? o[0]);
|
|
542
|
+
s[t + 0] = n[0], s[t + 1] = n[1], s[t + 2] = n[2], s[t + 3] = 0;
|
|
292
543
|
}
|
|
293
544
|
return e;
|
|
294
545
|
}
|
|
295
|
-
function
|
|
546
|
+
function de(e, t, n) {
|
|
296
547
|
for (let r = 0; r < 8; r++) {
|
|
297
548
|
let i = t + r * 4, a = n[r];
|
|
298
549
|
a ? (e[i + 0] = a.amplitude, e[i + 1] = a.wavelength, e[i + 2] = a.direction, e[i + 3] = a.phase) : (e[i + 0] = 0, e[i + 1] = 1, e[i + 2] = 0, e[i + 3] = 0);
|
|
299
550
|
}
|
|
300
551
|
}
|
|
301
|
-
function
|
|
302
|
-
let t = new Float32Array(
|
|
303
|
-
for (let
|
|
304
|
-
let
|
|
305
|
-
r
|
|
306
|
-
let i = Math.sin(e * 19.31 + 4) * 43758.5453;
|
|
307
|
-
i -= Math.floor(i);
|
|
308
|
-
let a = n * 4;
|
|
309
|
-
t[a + 0] = (r * 2 - 1) * H, t[a + 1] = (i * 2 - 1) * H, t[a + 2] = r * 6 % 6, t[a + 3] = e;
|
|
552
|
+
function fe(e) {
|
|
553
|
+
let { cols: t, count: n, pitchDomain: r } = e, i = new Float32Array(n * 4), a = (t - 1) * r / 2;
|
|
554
|
+
for (let e = 0; e < n; e++) {
|
|
555
|
+
let n = e % t, o = Math.floor(e / t), s = e * 4;
|
|
556
|
+
i[s + 0] = n * r - a, i[s + 1] = o * r - a, i[s + 2] = 0, i[s + 3] = 0;
|
|
310
557
|
}
|
|
311
|
-
return
|
|
558
|
+
return i;
|
|
312
559
|
}
|
|
313
560
|
//#endregion
|
|
314
561
|
//#region src/components/custom/dot-flow-field/composables/useFlowParticles.ts
|
|
315
|
-
var
|
|
316
|
-
function
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
562
|
+
var Y = 64, pe = 128, X = 8, Z = 1, me = 2, Q = 4, he = 64;
|
|
563
|
+
function $(e) {
|
|
564
|
+
return Math.min(e.clientWidth || 320, e.clientHeight || 320);
|
|
565
|
+
}
|
|
566
|
+
function ge(e) {
|
|
567
|
+
let { canvas: t, config: n, getPalette: r, shouldContinue: i, onFrame: a } = e;
|
|
568
|
+
return function(e, s, c) {
|
|
569
|
+
let l = U(n.gridPitch, $(t)), u = e.createShaderModule({
|
|
320
570
|
label: "[DotFlowField] flow-field.compute.wgsl",
|
|
321
571
|
code: v
|
|
322
|
-
}),
|
|
572
|
+
}), d = e.createShaderModule({
|
|
323
573
|
label: "[DotFlowField] flow-field.render.wgsl",
|
|
324
574
|
code: y
|
|
325
|
-
}),
|
|
326
|
-
label: "[DotFlowField]
|
|
327
|
-
size:
|
|
328
|
-
usage:
|
|
575
|
+
}), f = fe(l), p = e.createBuffer({
|
|
576
|
+
label: "[DotFlowField] lattice",
|
|
577
|
+
size: l.count * 16,
|
|
578
|
+
usage: pe | X,
|
|
329
579
|
mappedAtCreation: !0
|
|
330
580
|
});
|
|
331
|
-
new Float32Array(
|
|
332
|
-
let
|
|
581
|
+
new Float32Array(p.getMappedRange()).set(f), p.unmap();
|
|
582
|
+
let m = e.createBuffer({
|
|
333
583
|
label: "[DotFlowField] compute-uniforms",
|
|
334
|
-
size:
|
|
335
|
-
usage:
|
|
336
|
-
}),
|
|
584
|
+
size: G().buffer.byteLength,
|
|
585
|
+
usage: Y | X
|
|
586
|
+
}), h = e.createBuffer({
|
|
337
587
|
label: "[DotFlowField] render-uniforms",
|
|
338
|
-
size:
|
|
339
|
-
usage:
|
|
340
|
-
}),
|
|
588
|
+
size: q().buffer.byteLength,
|
|
589
|
+
usage: Y | X
|
|
590
|
+
}), g = e.createBindGroupLayout({
|
|
341
591
|
label: "[DotFlowField] compute-bgl",
|
|
342
592
|
entries: [{
|
|
343
593
|
binding: 0,
|
|
344
|
-
visibility:
|
|
594
|
+
visibility: Q,
|
|
345
595
|
buffer: { type: "uniform" }
|
|
346
596
|
}, {
|
|
347
597
|
binding: 1,
|
|
348
|
-
visibility:
|
|
598
|
+
visibility: Q,
|
|
349
599
|
buffer: { type: "storage" }
|
|
350
600
|
}]
|
|
351
|
-
}),
|
|
601
|
+
}), _ = e.createComputePipeline({
|
|
352
602
|
label: "[DotFlowField] compute-pipeline",
|
|
353
|
-
layout: e.createPipelineLayout({ bindGroupLayouts: [
|
|
603
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [g] }),
|
|
354
604
|
compute: {
|
|
355
|
-
module:
|
|
605
|
+
module: u,
|
|
356
606
|
entryPoint: "cs_main"
|
|
357
607
|
}
|
|
358
|
-
}),
|
|
608
|
+
}), b = e.createBindGroup({
|
|
359
609
|
label: "[DotFlowField] compute-bg",
|
|
360
|
-
layout:
|
|
610
|
+
layout: g,
|
|
361
611
|
entries: [{
|
|
362
612
|
binding: 0,
|
|
363
|
-
resource: { buffer:
|
|
613
|
+
resource: { buffer: m }
|
|
364
614
|
}, {
|
|
365
615
|
binding: 1,
|
|
366
|
-
resource: { buffer:
|
|
616
|
+
resource: { buffer: p }
|
|
367
617
|
}]
|
|
368
|
-
}),
|
|
618
|
+
}), x = e.createBindGroupLayout({
|
|
369
619
|
label: "[DotFlowField] render-bgl",
|
|
370
620
|
entries: [{
|
|
371
621
|
binding: 0,
|
|
372
|
-
visibility:
|
|
622
|
+
visibility: Z | me,
|
|
373
623
|
buffer: { type: "uniform" }
|
|
374
624
|
}, {
|
|
375
625
|
binding: 1,
|
|
376
|
-
visibility:
|
|
626
|
+
visibility: Z,
|
|
377
627
|
buffer: { type: "read-only-storage" }
|
|
378
628
|
}]
|
|
379
|
-
}),
|
|
629
|
+
}), S = e.createRenderPipeline({
|
|
380
630
|
label: "[DotFlowField] render-pipeline",
|
|
381
|
-
layout: e.createPipelineLayout({ bindGroupLayouts: [
|
|
631
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [x] }),
|
|
382
632
|
vertex: {
|
|
383
|
-
module:
|
|
633
|
+
module: d,
|
|
384
634
|
entryPoint: "vs_main"
|
|
385
635
|
},
|
|
386
636
|
fragment: {
|
|
387
|
-
module:
|
|
637
|
+
module: d,
|
|
388
638
|
entryPoint: "fs_main",
|
|
389
639
|
targets: [{
|
|
390
|
-
format:
|
|
640
|
+
format: c,
|
|
391
641
|
blend: {
|
|
392
642
|
color: {
|
|
393
643
|
srcFactor: "one",
|
|
@@ -403,30 +653,36 @@ function oe(e) {
|
|
|
403
653
|
}]
|
|
404
654
|
},
|
|
405
655
|
primitive: { topology: "triangle-list" }
|
|
406
|
-
}),
|
|
656
|
+
}), C = e.createBindGroup({
|
|
407
657
|
label: "[DotFlowField] render-bg",
|
|
408
|
-
layout:
|
|
658
|
+
layout: x,
|
|
409
659
|
entries: [{
|
|
410
660
|
binding: 0,
|
|
411
|
-
resource: { buffer:
|
|
661
|
+
resource: { buffer: h }
|
|
412
662
|
}, {
|
|
413
663
|
binding: 1,
|
|
414
|
-
resource: { buffer:
|
|
664
|
+
resource: { buffer: p }
|
|
415
665
|
}]
|
|
416
|
-
}),
|
|
666
|
+
}), w = G(), T = q(), E = -1;
|
|
417
667
|
function D() {
|
|
418
|
-
let e = o(),
|
|
419
|
-
(t.width !==
|
|
668
|
+
let e = o(), r = t.clientWidth || 320, i = t.clientHeight || 320, a = Math.max(1, Math.round(r * e)), s = Math.max(1, Math.round(i * e));
|
|
669
|
+
(t.width !== a || t.height !== s) && (t.width = a, t.height = s);
|
|
670
|
+
let c = U(n.gridPitch, $(t));
|
|
671
|
+
l = {
|
|
672
|
+
...c,
|
|
673
|
+
count: Math.min(c.count, f.length / 4)
|
|
674
|
+
};
|
|
420
675
|
}
|
|
421
676
|
function O(i) {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
677
|
+
a?.(i);
|
|
678
|
+
let o = E < 0 ? 0 : Math.min(Math.max(i - E, 0), .05);
|
|
679
|
+
E = i;
|
|
680
|
+
let c = (t.clientWidth || 320) / Math.max(t.clientHeight || 320, 1);
|
|
681
|
+
oe(w, n, i, o, l), e.queue.writeBuffer(m, 0, w.buffer), ue(T, n, i, c, $(t), l, r()), e.queue.writeBuffer(h, 0, T.buffer);
|
|
682
|
+
let u = Math.ceil(l.count / he), d = e.createCommandEncoder({ label: "[DotFlowField] frame" }), f = d.beginComputePass();
|
|
683
|
+
f.setPipeline(_), f.setBindGroup(0, b), f.dispatchWorkgroups(u), f.end();
|
|
684
|
+
let p = s.getCurrentTexture().createView(), g = d.beginRenderPass({ colorAttachments: [{
|
|
685
|
+
view: p,
|
|
430
686
|
clearValue: {
|
|
431
687
|
r: 0,
|
|
432
688
|
g: 0,
|
|
@@ -436,137 +692,171 @@ function oe(e) {
|
|
|
436
692
|
loadOp: "clear",
|
|
437
693
|
storeOp: "store"
|
|
438
694
|
}] });
|
|
439
|
-
|
|
695
|
+
g.setPipeline(S), g.setBindGroup(0, C), g.draw(6, l.count, 0, 0), g.end(), e.queue.submit([d.finish()]);
|
|
440
696
|
}
|
|
441
697
|
return {
|
|
442
698
|
frame: O,
|
|
443
699
|
shouldContinue: i,
|
|
444
700
|
resize: D,
|
|
445
701
|
teardown: () => {
|
|
446
|
-
|
|
702
|
+
p.destroy(), m.destroy(), h.destroy();
|
|
447
703
|
}
|
|
448
704
|
};
|
|
449
705
|
};
|
|
450
706
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
-
function se(e) {
|
|
458
|
-
let t = Math.min(Math.max(e.particleCount, 1), M), n = .85, r = [];
|
|
459
|
-
function i(e, t) {
|
|
460
|
-
let r = Q(e, t), i = Q(e + 4, t + 2);
|
|
461
|
-
return {
|
|
462
|
-
x: (r * 2 - 1) * n,
|
|
463
|
-
y: (i * 2 - 1) * n
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
for (let e = 0; e < t; e++) {
|
|
467
|
-
let t = (e + 1) * .6180339887, n = i(t, e * .137);
|
|
468
|
-
r.push({
|
|
469
|
-
pos: n,
|
|
470
|
-
age: Q(t, 7) * 6,
|
|
471
|
-
seed: t
|
|
472
|
-
});
|
|
707
|
+
function _e(e, t, n) {
|
|
708
|
+
let r = e.createShader(t);
|
|
709
|
+
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
710
|
+
let t = e.getShaderInfoLog(r);
|
|
711
|
+
throw e.deleteShader(r), Error(`[DotFlowField] shader compile failed: ${t}`);
|
|
473
712
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
713
|
+
return r;
|
|
714
|
+
}
|
|
715
|
+
function ve(e) {
|
|
716
|
+
let { canvas: t, config: n, getPalette: r, shouldContinue: i, onFrame: a } = e;
|
|
717
|
+
return function(e) {
|
|
718
|
+
let s = _e(e, e.VERTEX_SHADER, b), l = _e(e, e.FRAGMENT_SHADER, x), u = e.createProgram();
|
|
719
|
+
if (e.attachShader(u, s), e.attachShader(u, l), e.linkProgram(u), !e.getProgramParameter(u, e.LINK_STATUS)) throw Error(`[DotFlowField] link failed: ${e.getProgramInfoLog(u)}`);
|
|
720
|
+
e.deleteShader(s), e.deleteShader(l);
|
|
721
|
+
let d = e.createVertexArray();
|
|
722
|
+
e.bindVertexArray(d);
|
|
723
|
+
let f = e.createBuffer();
|
|
724
|
+
e.bindBuffer(e.ARRAY_BUFFER, f), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
|
|
725
|
+
-1,
|
|
726
|
+
-1,
|
|
727
|
+
3,
|
|
728
|
+
-1,
|
|
729
|
+
-1,
|
|
730
|
+
3
|
|
731
|
+
]), e.STATIC_DRAW);
|
|
732
|
+
let p = e.getAttribLocation(u, "aPosition");
|
|
733
|
+
e.enableVertexAttribArray(p), e.vertexAttribPointer(p, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
|
|
734
|
+
let m = (t) => e.getUniformLocation(u, t), h = m("uTime"), g = m("uWindSpeed"), _ = m("uCurlStrength"), v = m("uDomainHalf"), y = m("uAspect"), S = m("uGridPitchDomain"), C = m("uDotRadiusDomain"), w = m("uDisplaceAmp"), T = m("uContrast"), E = m("uBaseBright"), D = m("uWaveBandCenter"), O = m("uWaveBandWidth"), k = m("uGlobeMask"), A = m("uWaveCount"), j = m("uStopCount"), M = m("uHasBackground"), N = m("uBg"), P = m("uWaves[0]"), F = m("uPalette[0]");
|
|
735
|
+
function I() {
|
|
736
|
+
let n = o(), r = t.clientWidth || 320, i = t.clientHeight || 320, a = Math.max(1, Math.round(r * n)), s = Math.max(1, Math.round(i * n));
|
|
737
|
+
(t.width !== a || t.height !== s) && (t.width = a, t.height = s), e.viewport(0, 0, t.width, t.height);
|
|
480
738
|
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
739
|
+
function L(i) {
|
|
740
|
+
a?.(i);
|
|
741
|
+
let o = $(t), s = (t.clientWidth || 320) / Math.max(t.clientHeight || 320, 1), l = U(n.gridPitch, o), f = o / (2 * H), p = n.dotSize / Math.max(f, 1e-4);
|
|
742
|
+
e.useProgram(u), e.bindVertexArray(d), e.enable(e.BLEND), e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA), e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), e.uniform1f(h, i), e.uniform1f(g, n.windSpeed), e.uniform1f(_, n.curlStrength), e.uniform1f(v, H), e.uniform1f(y, s), e.uniform1f(S, l.pitchDomain), e.uniform1f(C, p), e.uniform1f(w, n.displaceAmp), e.uniform1f(T, n.contrast), e.uniform1f(E, J), e.uniform1f(D, n.waveBandCenter), e.uniform1f(O, n.waveBandWidth), e.uniform1f(k, +!!n.globeMask);
|
|
743
|
+
let m = Math.min(n.waveComponents.length, 8), b = r(), x = Math.min(b.length, 4);
|
|
744
|
+
if (e.uniform1i(A, m), e.uniform1i(j, x), n.background === "transparent") e.uniform1f(M, 0), e.uniform3f(N, 0, 0, 0);
|
|
745
|
+
else {
|
|
746
|
+
e.uniform1f(M, 1);
|
|
747
|
+
let t = c(n.background);
|
|
748
|
+
e.uniform3f(N, t[0], t[1], t[2]);
|
|
749
|
+
}
|
|
750
|
+
let I = new Float32Array(32);
|
|
751
|
+
for (let e = 0; e < 8; e++) {
|
|
752
|
+
let t = n.waveComponents[e];
|
|
753
|
+
I[e * 4 + 0] = t?.amplitude ?? 0, I[e * 4 + 1] = t?.wavelength ?? 1, I[e * 4 + 2] = t?.direction ?? 0, I[e * 4 + 3] = t?.phase ?? 0;
|
|
754
|
+
}
|
|
755
|
+
e.uniform4fv(P, I);
|
|
756
|
+
let L = new Float32Array(12);
|
|
757
|
+
for (let e = 0; e < 4; e++) {
|
|
758
|
+
let t = c(b[Math.min(e, x - 1)] ?? b[0]);
|
|
759
|
+
L[e * 3 + 0] = t[0], L[e * 3 + 1] = t[1], L[e * 3 + 2] = t[2];
|
|
760
|
+
}
|
|
761
|
+
e.uniform3fv(F, L), e.drawArrays(e.TRIANGLES, 0, 3), e.bindVertexArray(null);
|
|
490
762
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
763
|
+
return {
|
|
764
|
+
frame: L,
|
|
765
|
+
shouldContinue: i,
|
|
766
|
+
resize: I,
|
|
767
|
+
teardown: () => {
|
|
768
|
+
e.deleteProgram(u), e.deleteVertexArray(d), e.deleteBuffer(f);
|
|
769
|
+
}
|
|
770
|
+
};
|
|
497
771
|
};
|
|
498
772
|
}
|
|
499
773
|
//#endregion
|
|
500
774
|
//#region src/components/custom/dot-flow-field/composables/useDotFlowField.ts
|
|
501
|
-
function
|
|
502
|
-
let { config:
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
775
|
+
function ye(e, n) {
|
|
776
|
+
let { config: r, getPalette: i } = n, a = n.mode ?? "live", o = t({ respectReducedMotion: r.respectReducedMotion }), c = {
|
|
777
|
+
displaceBoost: 1,
|
|
778
|
+
bloom: 0
|
|
779
|
+
}, l = { ...r }, u = () => (Object.assign(l, r), l.displaceAmp = r.displaceAmp * c.displaceBoost, l.contrast = r.contrast * (1 + c.bloom * .8), l), d = null, f = 0;
|
|
780
|
+
function p(e) {
|
|
781
|
+
let t = f > 0 ? (e - f) * 1e3 : 16.7;
|
|
782
|
+
if (f = e, o.tick(t), !r.interactive || !o.active.value) {
|
|
783
|
+
c.displaceBoost += (1 - c.displaceBoost) * .1, c.bloom *= .9;
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
let n = o.speed.value, i = 1 + Math.min(2.5, n * 3);
|
|
787
|
+
c.displaceBoost += (i - c.displaceBoost) * .2, c.bloom = Math.max(c.bloom * .9, o.burst.value);
|
|
788
|
+
}
|
|
789
|
+
let h = () => {
|
|
790
|
+
o.onPointerEnter(), r.interactive && d?.wake();
|
|
791
|
+
}, g = (e) => {
|
|
792
|
+
o.onPointerMove(e), r.interactive && d?.wake();
|
|
793
|
+
}, _ = (e) => e.parentElement ?? e;
|
|
794
|
+
function v(e) {
|
|
795
|
+
let t = _(e);
|
|
796
|
+
t.addEventListener("pointermove", g), t.addEventListener("pointerenter", h), t.addEventListener("pointerleave", o.onPointerLeave);
|
|
797
|
+
}
|
|
798
|
+
function y(e) {
|
|
799
|
+
let t = _(e);
|
|
800
|
+
t.removeEventListener("pointermove", g), t.removeEventListener("pointerenter", h), t.removeEventListener("pointerleave", o.onPointerLeave);
|
|
801
|
+
}
|
|
802
|
+
let b = () => {
|
|
803
|
+
let t = e.value;
|
|
804
|
+
if (!t) return null;
|
|
805
|
+
if (!d) {
|
|
806
|
+
v(t);
|
|
807
|
+
let e = {
|
|
808
|
+
canvas: t,
|
|
809
|
+
config: u(),
|
|
810
|
+
getPalette: i,
|
|
811
|
+
shouldContinue: () => !0,
|
|
812
|
+
onFrame: p
|
|
813
|
+
};
|
|
814
|
+
d = s(t, {
|
|
815
|
+
mode: a,
|
|
816
|
+
respectReducedMotion: r.respectReducedMotion,
|
|
817
|
+
setupWGPU: ge({
|
|
818
|
+
...e,
|
|
819
|
+
config: l,
|
|
820
|
+
onFrame: (e) => {
|
|
821
|
+
p(e), u();
|
|
822
|
+
}
|
|
515
823
|
}),
|
|
516
|
-
setupGL: (
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
824
|
+
setupGL: ve({
|
|
825
|
+
...e,
|
|
826
|
+
config: l,
|
|
827
|
+
onFrame: (e) => {
|
|
828
|
+
p(e), u();
|
|
829
|
+
}
|
|
520
830
|
})
|
|
521
|
-
}),
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
resume: () => r()?.resume("manual"),
|
|
530
|
-
wake: () => r()?.wake(),
|
|
531
|
-
renderAt: (e) => r()?.renderAt(e),
|
|
532
|
-
get reducedMotion() {
|
|
533
|
-
return e?.reducedMotion ?? !1;
|
|
534
|
-
},
|
|
535
|
-
dispose: () => e?.dispose()
|
|
536
|
-
};
|
|
537
|
-
return m(() => i.dispose()), i;
|
|
538
|
-
}
|
|
539
|
-
let l = se(a), u = -1, d = e({
|
|
540
|
-
canvas: () => t.value,
|
|
541
|
-
respectReducedMotion: a.respectReducedMotion,
|
|
542
|
-
autoStart: s === "live",
|
|
543
|
-
setup: (e) => ({ render: (e, n) => {
|
|
544
|
-
let r = n / 1e3, i = u < 0 ? 0 : Math.min(Math.max((n - u) / 1e3, 0), .05);
|
|
545
|
-
u = n, i > 0 && l.step(i, r);
|
|
546
|
-
let s = t.value, d = s?.clientWidth || 320, f = s?.clientHeight || 320, p = o()[0] ?? a.palette[0];
|
|
547
|
-
l.paint(e, d, f, r, c(p));
|
|
548
|
-
} })
|
|
549
|
-
}), f = {
|
|
550
|
-
backend: "webgl2",
|
|
551
|
-
pause: () => d.suspend("manual"),
|
|
552
|
-
resume: () => d.resume("manual"),
|
|
553
|
-
wake: () => d.wake(),
|
|
554
|
-
renderAt: () => {
|
|
555
|
-
d.wake();
|
|
831
|
+
}), d.armAsync();
|
|
832
|
+
}
|
|
833
|
+
return d;
|
|
834
|
+
};
|
|
835
|
+
queueMicrotask(() => b());
|
|
836
|
+
let x = {
|
|
837
|
+
get backend() {
|
|
838
|
+
return b()?.backend ?? "webgpu";
|
|
556
839
|
},
|
|
840
|
+
pause: () => b()?.suspend("manual"),
|
|
841
|
+
resume: () => b()?.resume("manual"),
|
|
842
|
+
wake: () => b()?.wake(),
|
|
843
|
+
renderAt: (e) => b()?.renderAt(e),
|
|
557
844
|
get reducedMotion() {
|
|
558
|
-
return d
|
|
845
|
+
return d?.reducedMotion ?? !1;
|
|
559
846
|
},
|
|
560
|
-
dispose: () =>
|
|
847
|
+
dispose: () => {
|
|
848
|
+
let t = e.value;
|
|
849
|
+
t && y(t), o.dispose(), d?.dispose();
|
|
850
|
+
}
|
|
561
851
|
};
|
|
562
|
-
return m(() =>
|
|
852
|
+
return m(() => x.dispose()), x;
|
|
563
853
|
}
|
|
564
854
|
//#endregion
|
|
565
855
|
//#region src/components/custom/dot-flow-field/DotFlowField.vue
|
|
566
|
-
var
|
|
856
|
+
var be = /* @__PURE__ */ e(/* @__PURE__ */ f({
|
|
567
857
|
__name: "DotFlowField",
|
|
568
858
|
props: {
|
|
569
|
-
config: { default: () =>
|
|
859
|
+
config: { default: () => V },
|
|
570
860
|
paused: {
|
|
571
861
|
type: Boolean,
|
|
572
862
|
default: !1
|
|
@@ -574,7 +864,7 @@ var ce = /* @__PURE__ */ t(/* @__PURE__ */ f({
|
|
|
574
864
|
},
|
|
575
865
|
emits: ["update:paused"],
|
|
576
866
|
setup(e, { expose: t }) {
|
|
577
|
-
let n = g("canvasRef"), r =
|
|
867
|
+
let n = g("canvasRef"), r = ye(n, {
|
|
578
868
|
config: e.config,
|
|
579
869
|
getPalette: () => e.config.palette
|
|
580
870
|
});
|
|
@@ -599,6 +889,6 @@ var ce = /* @__PURE__ */ t(/* @__PURE__ */ f({
|
|
|
599
889
|
"data-testid": "dot-flow-field-canvas"
|
|
600
890
|
}, null, 512)], 4));
|
|
601
891
|
}
|
|
602
|
-
}), [["__scopeId", "data-v-
|
|
892
|
+
}), [["__scopeId", "data-v-01c7721a"]]);
|
|
603
893
|
//#endregion
|
|
604
|
-
export {
|
|
894
|
+
export { V as DEFAULT_FLOW_CONFIG, B as DEFAULT_WAVE_COMPONENTS, be as DotFlowField, N as FLOW_DOMAIN_HALF, S as FLOW_GRAVITY, re as MAX_FLOW_STOPS, te as MAX_PARTICLES, ne as MAX_WAVE_COMPONENTS, z as WARM_IDENTITY_PALETTE, R as buildWaveLadder, j as curlFBM, T as gerstnerVelocity, P as gridOrigin, I as sampleDisplacement, F as sampleHeight, M as sampleVelocity, ye as useDotFlowField, L as waveBand };
|