@mkbabb/glass-ui 4.0.0 → 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/README.md +3 -1
- package/dist/CardAction-8whJrLWt.js +268 -0
- package/dist/{CommandShortcut-DdtWXxOK.js → CommandShortcut-D3yxgHNn.js} +25 -14
- package/dist/ConfiguratorRow-CaP7U3ZA.js +143 -0
- package/dist/ContextMenuContent-B3ZsheLV.js +90 -0
- package/dist/{ContextMenuSubContent-B0Vs6atR.js → ContextMenuSubContent-DDRID3qC.js} +28 -33
- package/dist/{DataTable-C464Zbqd.js → DataTable-Bc9kUtu_.js} +4 -4
- package/dist/{DialogContent-DDE6pQBU.js → DialogContent-6JtTB5x2.js} +11 -8
- package/dist/DialogFooter-9phqcRIS.js +80 -0
- package/dist/DialogScrollContent-TTuovQst.js +93 -0
- package/dist/{FadingScroll-DwNnvKMs.js → FadingScroll-DLRbH5Xr.js} +1 -1
- package/dist/HoverCardContent-Bel1gdLZ.js +88 -0
- package/dist/{HoverPopover-Dpzwvc4t.js → HoverPopover-BcIxvyqZ.js} +2 -2
- package/dist/{IconChip-BDw1j5mu.js → IconChip-DhbdGdFQ.js} +2 -1
- package/dist/{IconTooltip-DSjasZIt.js → IconTooltip-B0zimd2H.js} +1 -1
- package/dist/Input-Cg9DF62r.js +57 -0
- package/dist/{MetricBadge-BpC0R_Ec.js → MetricBadge-RHdBP72w.js} +1 -1
- package/dist/Notification-CphK7AAm.js +43 -0
- package/dist/NumberFieldContent-D8cXeyO4.js +140 -0
- package/dist/PagerDots-Cjx96la-.js +98 -0
- package/dist/{PopoverContent-BTorlp--.js → PopoverContent-DL7E6vJP.js} +4 -4
- package/dist/{Progress-hAT4gqGH.js → Progress-CnqB7gLm.js} +4 -4
- package/dist/{ScrollingText-CUVFTWk2.js → ScrollingText-CTZbA_cG.js} +2 -2
- package/dist/{SelectScrollDownButton-C1jb3b3K.js → SelectScrollDownButton-DAKCBEdW.js} +65 -61
- package/dist/{SelectSeparator-DK2y1Bun.js → SelectSeparator-C2UGOkXF.js} +1 -1
- package/dist/Separator-DQcwC2TR.js +44 -0
- package/dist/Switch-B8RscmRu.js +49 -0
- package/dist/Toaster-D9qIHjBI.js +274 -0
- package/dist/ToggleGroupItem-BLtr3TJq.js +170 -0
- package/dist/TooltipProvider-BJ_Y5EGX.js +109 -0
- package/dist/animated-digit.js +2 -2
- package/dist/api/index.d.ts +21 -33
- package/dist/api/types-extra.d.ts +37 -0
- package/dist/api.js +1 -1
- package/dist/aurora.js +1231 -260
- package/dist/badge.js +1 -1
- package/dist/border-progress.d.ts +1 -0
- package/dist/border-progress.js +98 -0
- package/dist/button-5dY1Dvhd.js +125 -0
- package/dist/button.js +1 -1
- package/dist/canvas.js +2 -3
- package/dist/card.js +2 -2
- package/dist/carousel.js +93 -110
- package/dist/collapsible.js +1 -1
- package/dist/color-Cs0-oxYL.js +116 -0
- package/dist/color.js +2 -2
- package/dist/command.js +1 -1
- package/dist/compile-nZ1xVYTp.js +19 -0
- 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/atoms-fields.d.ts +39 -0
- package/dist/components/custom/aurora/composables/auroraFallbackGround.d.ts +108 -0
- 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 +31 -0
- package/dist/components/custom/aurora/composables/uniformBridge.d.ts +5 -1
- package/dist/components/custom/aurora/composables/uniformBridgeWGPU.d.ts +60 -0
- package/dist/components/custom/aurora/composables/wgpuSetup.d.ts +37 -0
- package/dist/components/custom/aurora/constants/budget.d.ts +21 -0
- package/dist/components/custom/aurora/constants/presets.d.ts +20 -2
- package/dist/components/custom/aurora/constants/renderMode.d.ts +77 -18
- 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 -0
- package/dist/components/custom/aurora/constants/shaders/oil-modes.glsl.d.ts +1 -0
- package/dist/components/custom/aurora/constants/shaders/procedural-color.wgsl.d.ts +4 -0
- package/dist/components/custom/aurora/index.d.ts +2 -1
- package/dist/components/custom/border-progress/BorderProgress.vue.d.ts +46 -0
- package/dist/components/custom/border-progress/composables/spectrum-walk.d.ts +25 -0
- package/dist/components/custom/border-progress/composables/useBorderSpectrum.d.ts +18 -0
- package/dist/components/custom/border-progress/constants.d.ts +59 -0
- package/dist/components/custom/border-progress/index.d.ts +4 -0
- 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/Concentric.vue.d.ts +39 -0
- package/dist/components/custom/concentric/composables/concentricGLSetup.d.ts +18 -0
- package/dist/components/custom/concentric/composables/concentricWGPUSetup.d.ts +22 -0
- package/dist/components/custom/concentric/composables/ringField.d.ts +85 -0
- package/dist/components/custom/concentric/composables/uniformBridgeWGPU.d.ts +14 -0
- package/dist/components/custom/concentric/composables/useConcentric.d.ts +35 -0
- package/dist/components/custom/concentric/constants.d.ts +67 -0
- package/dist/components/custom/concentric/index.d.ts +5 -0
- package/dist/components/custom/concentric/shaders/concentric.glsl.d.ts +4 -0
- package/dist/components/custom/concentric/shaders/concentric.wgsl.d.ts +1 -0
- 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 +25 -4
- package/dist/components/custom/dock/DockLayerGroup.vue.d.ts +10 -2
- 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 +155 -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/composables/useLayerTransition.d.ts +13 -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 +42 -0
- package/dist/components/custom/dot-flow-field/composables/flowField.d.ts +83 -0
- package/dist/components/custom/dot-flow-field/composables/uniformBridgeWGPU.d.ts +39 -0
- package/dist/components/custom/dot-flow-field/composables/useDotFlowField.d.ts +35 -0
- package/dist/components/custom/dot-flow-field/composables/useFlowParticles.d.ts +31 -0
- package/dist/components/custom/dot-flow-field/constants.d.ts +69 -0
- package/dist/components/custom/dot-flow-field/index.d.ts +5 -0
- package/dist/components/custom/dot-flow-field/shaders/flow-field.compute.wgsl.d.ts +1 -0
- package/dist/components/custom/dot-flow-field/shaders/flow-field.glsl.d.ts +4 -0
- package/dist/components/custom/dot-flow-field/shaders/flow-field.render.wgsl.d.ts +1 -0
- 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/EasingConfigurator.vue.d.ts +33 -0
- package/dist/components/custom/easing/EasingPicker.vue.d.ts +49 -0
- package/dist/components/custom/easing/composables/useEasingPicker.d.ts +80 -0
- package/dist/components/custom/easing/constants.d.ts +28 -0
- package/dist/components/custom/easing/index.d.ts +3 -0
- package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +11 -0
- package/dist/components/custom/fourier-field/FourierField.vue.d.ts +43 -40
- 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 +42 -0
- package/dist/components/custom/fourier-field/constants.d.ts +64 -0
- 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/glass-panel/GlassPanel.vue.d.ts +1 -1
- package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +13 -3
- package/dist/components/custom/goo-blob/composables/uniformBridgeWGPU.d.ts +24 -0
- package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +18 -11
- package/dist/components/custom/goo-blob/composables/wgpuSetup.d.ts +23 -0
- 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 -0
- 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/handmark/HandMark.vue.d.ts +1 -1
- package/dist/components/custom/icon-chip/types.d.ts +11 -1
- package/dist/components/custom/instrument-chassis/InstrumentChassis.vue.d.ts +3 -1
- 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/metric-stack/MetricStack.vue.d.ts +1 -1
- 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/spa-view/SpaView.vue.d.ts +50 -0
- package/dist/components/custom/spa-view/index.d.ts +2 -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 +12 -0
- package/dist/components/custom/tabs/composables/useTabDragMorph.d.ts +42 -0
- package/dist/components/custom/tabs/constants.d.ts +20 -2
- package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +30 -17
- 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/menuItemVariants.d.ts +1 -1
- package/dist/components/ui/_shared/useControlSize.d.ts +46 -0
- package/dist/components/ui/badge/index.d.ts +1 -1
- package/dist/components/ui/button/Button.vue.d.ts +5 -2
- package/dist/components/ui/button/index.d.ts +2 -2
- package/dist/components/ui/card/Card.vue.d.ts +79 -4
- package/dist/components/ui/card/CardHeader.vue.d.ts +42 -16
- package/dist/components/ui/card/ScrollCard.vue.d.ts +33 -0
- package/dist/components/ui/card/ScrollCardHeader.vue.d.ts +17 -0
- package/dist/components/ui/card/index.d.ts +3 -1
- package/dist/components/ui/carousel/CarouselNext.vue.d.ts +2 -2
- package/dist/components/ui/carousel/CarouselPrevious.vue.d.ts +2 -2
- package/dist/components/ui/carousel/GlassCarouselPager.vue.d.ts +2 -2
- package/dist/components/ui/command/Command.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/drawer/Drawer.vue.d.ts +46 -33
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts +7 -8
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +2 -2
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +1 -1
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +2 -2
- package/dist/components/ui/drawer/composables/drawerSnapContext.d.ts +26 -0
- package/dist/components/ui/drawer/composables/useDrawerSnap.d.ts +17 -0
- package/dist/components/ui/drawer/constants.d.ts +45 -0
- package/dist/components/ui/drawer/index.d.ts +23 -15
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +4 -0
- package/dist/components/ui/focus-scope/FocusScope.vue.d.ts +20 -0
- package/dist/components/ui/focus-scope/index.d.ts +2 -0
- package/dist/components/ui/hover-card/HoverCardContent.vue.d.ts +3 -0
- package/dist/components/ui/index.d.ts +1 -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/progress/ProgressDefault.vue.d.ts +3 -2
- package/dist/components/ui/select/SelectContent.vue.d.ts +4 -1
- package/dist/components/ui/sheet/index.d.ts +1 -1
- package/dist/components/ui/switch/Switch.vue.d.ts +2 -0
- package/dist/components/ui/tags-input/TagsInput.vue.d.ts +2 -2
- package/dist/components/ui/textarea/Textarea.vue.d.ts +3 -0
- package/dist/components/ui/toast/Toast.vue.d.ts +5 -2
- package/dist/components/ui/toast/use-toast.d.ts +14 -0
- package/dist/components/ui/toggle/Toggle.vue.d.ts +1 -1
- 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/canvas2d/useCanvas2D.d.ts +13 -6
- package/dist/composables/glass/index.d.ts +5 -2
- package/dist/composables/glass/useSpecularPointer.d.ts +33 -0
- package/dist/composables/glass/useSpecularTracking.d.ts +20 -0
- package/dist/composables/glass/useVizChoreography.d.ts +123 -0
- package/dist/composables/glass/vSpecular.d.ts +2 -0
- package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +10 -0
- package/dist/composables/glass/webgl/shaders/flow.glsl.d.ts +1 -0
- package/dist/composables/glass/webgl/shaders/flow.wgsl.d.ts +1 -0
- package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +16 -0
- package/dist/composables/glass/webgpu/index.d.ts +2 -0
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +75 -0
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +85 -0
- package/dist/composables/glass/webgpu/webgpuDevice.d.ts +42 -0
- package/dist/composables/motion/core/index.d.ts +4 -0
- package/dist/composables/motion/index.d.ts +4 -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 +84 -0
- package/dist/composables/motion/useDragMorph.d.ts +77 -0
- package/dist/composables/motion/useLiquidFlex.d.ts +11 -0
- package/dist/composables/motion/useLiquidPress.d.ts +71 -0
- package/dist/composables/motion/useLiquidReveal.d.ts +51 -0
- package/dist/composables/motion/useNumericTransition.d.ts +3 -3
- package/dist/composables/motion/usePointerVelocityField.d.ts +98 -0
- 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.d.ts +1 -0
- package/dist/concentric.js +836 -0
- package/dist/configurator.js +3 -2
- package/dist/confirm-dialog.js +62 -49
- package/dist/constellation.js +635 -235
- package/dist/context-menu.js +3 -3
- package/dist/controls.js +2 -2
- 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 +819 -568
- package/dist/{dockContext-Bu1Avy-a.js → dockContext-BNfyPLe9.js} +1 -1
- package/dist/dom.js +5 -5
- package/dist/dot-flow-field.d.ts +1 -0
- package/dist/dot-flow-field.js +894 -0
- 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/drawer.d.ts +1 -0
- package/dist/drawer.js +380 -0
- package/dist/{dropdown-menu-BJ7E9js_.js → dropdown-menu-aJmV5SqE.js} +82 -79
- package/dist/dropdown-menu.js +1 -1
- package/dist/easing.d.ts +1 -0
- package/dist/easing.js +475 -0
- package/dist/expandable-container.js +46 -21
- package/dist/fading-scroll.js +1 -1
- package/dist/flow.glsl-B2P7e0MT.js +4 -0
- package/dist/focus-scope.d.ts +1 -0
- package/dist/focus-scope.js +23 -0
- package/dist/forms.js +65 -63
- package/dist/fourier-field.js +831 -172
- package/dist/fourier-math.js +1 -1
- package/dist/glass-panel.js +2 -2
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +187 -338
- package/dist/goo-blob.js +241 -692
- package/dist/goo-dot-matrix.d.ts +1 -0
- package/dist/goo-dot-matrix.js +591 -0
- package/dist/handmark.js +2 -2
- package/dist/header-ribbon.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 +3 -1
- package/dist/instrument-chassis.js +1 -1
- package/dist/keyboard.js +1 -1
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +70 -60
- package/dist/metric-badge.js +1 -1
- package/dist/metric-cell.js +1 -1
- package/dist/metric-stack.js +14 -9
- package/dist/motion-core.js +58 -36
- package/dist/motion-curves.js +11 -1
- package/dist/motion.js +90 -53
- 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/popover.js +1 -1
- package/dist/{presets-BW2b-fr1.js → presets-CvOUqtdY.js} +3 -3
- package/dist/{compile-EXXzEr1q.js → procedural-color.wgsl-m7Zgv35j.js} +2 -156
- package/dist/progress.js +1 -1
- package/dist/pulse.js +2 -2
- package/dist/reactive.js +1 -1
- package/dist/resolveCanvasColor-yPyIpJt9.js +93 -0
- package/dist/scrollReader-DI1NWxUw.js +42 -0
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +162 -308
- 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-CquRYOAw.js → sheet-B2flBfLH.js} +5 -5
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +216 -114
- package/dist/{slider-DQ95MET2.js → slider-2A0rPn79.js} +3 -3
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +2 -2
- package/dist/spa-view.d.ts +1 -0
- package/dist/spa-view.js +46 -0
- package/dist/spectrum-walk-BVzA7Biz.js +33 -0
- package/dist/{springPresets-WXaLbu8u.js → springPresets-Ce7OYCm9.js} +12 -6
- package/dist/styles/animations.css +46 -12
- package/dist/styles/border-progress.css +109 -0
- package/dist/styles/cards.css +145 -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 +162 -0
- package/dist/styles/critical.css +12 -0
- package/dist/styles/deferred.css +33 -0
- package/dist/styles/dock/cta-seat.css +87 -0
- package/dist/styles/dock/density.css +198 -0
- package/dist/styles/dock/layers.css +101 -29
- package/dist/styles/dock/morph-bridge.css +54 -18
- package/dist/styles/dock/morph.css +132 -7
- package/dist/styles/dock/overflow.css +28 -2
- package/dist/styles/dock/search.css +68 -0
- package/dist/styles/dock/shape.css +124 -0
- package/dist/styles/dock/shell.css +77 -21
- 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 +43 -1
- package/dist/styles/drawer.css +81 -35
- package/dist/styles/glass/accent-tone.css +66 -0
- package/dist/styles/glass/control-surfaces.css +167 -0
- package/dist/styles/glass/deep.css +44 -0
- package/dist/styles/glass/ladder.css +147 -41
- package/dist/styles/glass/material.css +78 -15
- package/dist/styles/glass/reveal.css +136 -0
- package/dist/styles/glass/rim.css +110 -0
- package/dist/styles/glass/surfaces.css +148 -129
- package/dist/styles/glass-refract.css +96 -44
- package/dist/styles/glass-specular-track.css +7 -0
- package/dist/styles/glass.css +13 -0
- package/dist/styles/hover-popover.css +7 -6
- package/dist/styles/icon-chip.css +77 -15
- package/dist/styles/index.css +36 -9
- package/dist/styles/instrument-chassis.css +66 -3
- package/dist/styles/scroll-choreography.css +300 -0
- package/dist/styles/scroll-chrome.css +123 -0
- package/dist/styles/scroll-driven.css +38 -0
- package/dist/styles/segmented-tabs.css +81 -14
- package/dist/styles/theme/bridges.css +33 -0
- package/dist/styles/theme/literals.css +11 -2
- package/dist/styles/theme/radius.css +24 -2
- package/dist/styles/tokens/color-radius.css +13 -3
- package/dist/styles/tokens/dark-arm.css +137 -32
- package/dist/styles/tokens/glass-deep.css +100 -0
- package/dist/styles/tokens/glass-fx.css +376 -0
- package/dist/styles/tokens/glass.css +131 -351
- package/dist/styles/tokens/light-dark.css +16 -3
- package/dist/styles/tokens/offsets.css +143 -0
- package/dist/styles/tokens/on-glass-fg.css +39 -0
- package/dist/styles/tokens/property-regs.css +260 -0
- package/dist/styles/tokens/scale-paper.css +168 -96
- package/dist/styles/tokens/scheme-motion.css +114 -38
- package/dist/styles/tokens/scroll-tokens.css +123 -0
- package/dist/styles/tokens/sizing-config.css +110 -0
- package/{src/styles/tokens/offsets-sizing.css → dist/styles/tokens/sizing.css} +92 -204
- package/dist/styles/tokens.css +14 -3
- package/dist/styles/typography/semantic.css +26 -13
- package/dist/styles/typography/utilities.css +22 -7
- package/dist/styles/utilities/a11y-overrides.css +20 -5
- package/dist/styles/utilities/animate.css +27 -24
- package/dist/styles/utilities/base-misc.css +307 -0
- package/dist/styles/utilities/base.css +47 -261
- package/dist/styles/utilities/btn.css +17 -4
- package/dist/styles/utilities/components.css +31 -6
- package/dist/styles/utilities/metal.css +215 -0
- package/dist/styles/utilities.css +14 -7
- package/dist/switch.js +1 -1
- package/dist/tabs.js +220 -107
- package/dist/timeline.js +2 -2
- 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 +2 -2
- package/dist/uniformBridgeWGPU-CtAKl45L.js +1204 -0
- package/dist/{useAnimatedNumber-C_3wZLx4.js → useAnimatedNumber-CLrxicG9.js} +1 -1
- package/dist/useConfiguratorState-4xblKfwd.js +162 -0
- package/dist/useControlSize-SH1UmJCi.js +9 -0
- package/dist/useDockCtaReceive-DfFkmgL1.js +82 -0
- package/dist/useDragMorph-BUgAC-zK.js +102 -0
- package/dist/useFuzzySearch-DIhcYtcw.js +177 -0
- package/dist/useGpuSubstrate-4pTcp6mX.js +294 -0
- package/dist/useLiquidPress-BooG97RY.js +39 -0
- package/dist/usePointerVelocityField-QLsy3_kv.js +91 -0
- package/dist/useScrollChrome-D66AVP7C.js +258 -0
- package/dist/useSpring-C0jyvEJB.js +40 -0
- package/dist/useSpringMount-BWDnKIwh.js +71 -0
- package/dist/useSpringPress-B1-Czp-V.js +36 -0
- package/dist/{useTouchGate-28Tk2-t2.js → useTouchGate-CBZTD4SD.js} +1 -1
- package/dist/useViewTransition-CUI1nAgn.js +95 -0
- package/dist/vSpecular-EX7loENl.js +68 -0
- package/dist/vendor-B2qOlYY3.js +239 -0
- package/dist/virtual.d.ts +1 -0
- package/dist/virtual.js +225 -0
- package/dist/watercolor-dot.js +117 -74
- package/package.json +252 -28
- package/src/styles/animations.css +46 -12
- package/src/styles/border-progress.css +109 -0
- package/src/styles/cards.css +145 -0
- package/src/styles/completion-seal.css +131 -0
- package/src/styles/configurator.css +55 -0
- package/src/styles/critical-partition.mjs +162 -0
- package/src/styles/dock/cta-seat.css +87 -0
- package/src/styles/dock/density.css +198 -0
- package/src/styles/dock/layers.css +101 -29
- package/src/styles/dock/morph-bridge.css +54 -18
- package/src/styles/dock/morph.css +132 -7
- package/src/styles/dock/overflow.css +28 -2
- package/src/styles/dock/search.css +68 -0
- package/src/styles/dock/shape.css +124 -0
- package/src/styles/dock/shell.css +77 -21
- 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 +43 -1
- package/src/styles/drawer.css +81 -35
- package/src/styles/glass/accent-tone.css +66 -0
- package/src/styles/glass/control-surfaces.css +167 -0
- package/src/styles/glass/deep.css +44 -0
- package/src/styles/glass/ladder.css +147 -41
- package/src/styles/glass/material.css +78 -15
- package/src/styles/glass/reveal.css +136 -0
- package/src/styles/glass/rim.css +110 -0
- package/src/styles/glass/surfaces.css +148 -129
- package/src/styles/glass-refract.css +96 -44
- package/src/styles/glass-specular-track.css +7 -0
- package/src/styles/glass.css +13 -0
- package/src/styles/hover-popover.css +7 -6
- package/src/styles/icon-chip.css +77 -15
- package/src/styles/index.css +27 -0
- package/src/styles/instrument-chassis.css +66 -3
- package/src/styles/scroll-choreography.css +300 -0
- package/src/styles/scroll-chrome.css +123 -0
- package/src/styles/scroll-driven.css +38 -0
- package/src/styles/segmented-tabs.css +81 -14
- package/src/styles/theme/bridges.css +33 -0
- package/src/styles/theme/literals.css +11 -2
- package/src/styles/theme/radius.css +24 -2
- package/src/styles/tokens/color-radius.css +13 -3
- package/src/styles/tokens/dark-arm.css +137 -32
- package/src/styles/tokens/glass-deep.css +100 -0
- package/src/styles/tokens/glass-fx.css +376 -0
- package/src/styles/tokens/glass.css +131 -351
- package/src/styles/tokens/light-dark.css +16 -3
- package/src/styles/tokens/offsets.css +143 -0
- package/src/styles/tokens/on-glass-fg.css +39 -0
- package/src/styles/tokens/property-regs.css +260 -0
- package/src/styles/tokens/scale-paper.css +168 -96
- package/src/styles/tokens/scheme-motion.css +114 -38
- package/src/styles/tokens/scroll-tokens.css +123 -0
- package/src/styles/tokens/sizing-config.css +110 -0
- package/{dist/styles/tokens/offsets-sizing.css → src/styles/tokens/sizing.css} +92 -204
- package/src/styles/tokens.css +14 -3
- package/src/styles/typography/semantic.css +26 -13
- package/src/styles/typography/utilities.css +22 -7
- package/src/styles/utilities/a11y-overrides.css +20 -5
- package/src/styles/utilities/animate.css +27 -24
- package/src/styles/utilities/base-misc.css +307 -0
- package/src/styles/utilities/base.css +47 -261
- package/src/styles/utilities/btn.css +17 -4
- package/src/styles/utilities/components.css +31 -6
- package/src/styles/utilities/metal.css +215 -0
- package/src/styles/utilities.css +14 -7
- package/dist/CardAction-XH4YBVEK.js +0 -158
- package/dist/ContextMenuContent-ON3x7cuk.js +0 -85
- package/dist/DialogFooter-8eZbdmPc.js +0 -165
- package/dist/HoverCardContent-DkMaQzH5.js +0 -83
- package/dist/Input-DVG_J0ne.js +0 -55
- package/dist/Notification-DKjKsQq8.js +0 -100
- package/dist/NumberFieldContent-1VtwDSgf.js +0 -145
- package/dist/Separator-BArl4OaB.js +0 -37
- package/dist/Switch-Dr--uLGH.js +0 -47
- package/dist/Toaster-Bm_HQSpc.js +0 -263
- package/dist/ToggleGroupItem-Dzk9hWsF.js +0 -157
- package/dist/TooltipProvider-B3MkB_8P.js +0 -104
- package/dist/button-BNDWhAZb.js +0 -81
- package/dist/check-njhk-vfu.js +0 -7
- package/dist/chevron-down-DKkxb4VV.js +0 -7
- package/dist/chevron-right-CPXbqQQz.js +0 -7
- package/dist/chevron-up-n_24SqI-.js +0 -7
- 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/createLucideIcon-DydS2qgk.js +0 -43
- package/dist/minimize-2-BV31Ob_h.js +0 -38
- package/dist/resolveCanvasColor-BBiYfp8g.js +0 -11
- package/dist/search-BSGrf2Sk.js +0 -12
- package/dist/styles/dock/rail-extend.css +0 -397
- package/dist/useCanvas2D-ClrQuZtp.js +0 -96
- package/dist/useConfiguratorState-kiIlun8I.js +0 -303
- package/dist/useRAFLoop-CdwJ7284.js +0 -109
- package/dist/useSpecularTracking-Bo5su68i.js +0 -32
- package/dist/useSpringMount-CvopqiFr.js +0 -108
- package/dist/useViewTransition-COsPjQVZ.js +0 -47
- package/dist/x-BUwTKe50.js +0 -10
- package/src/styles/dock/rail-extend.css +0 -397
- /package/dist/{CollapsibleContent-C_s6fG7r.js → CollapsibleContent-68dEXIAl.js} +0 -0
- /package/dist/{InstrumentChassis-UUJX0-mW.js → InstrumentChassis-CxsHSyMj.js} +0 -0
- /package/dist/{Label-Ck9SWEKM.js → Label-C2ejNWeC.js} +0 -0
- /package/dist/{ModalOverlay-CkPRRgl_.js → ModalOverlay-D1VrWyoi.js} +0 -0
- /package/dist/{PaperBackdrop-nBKe0vkB.js → PaperBackdrop-CqwjnfLv.js} +0 -0
- /package/dist/{SelectGroup-Dcczq44n.js → SelectGroup-BFiod7X2.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-CBt_VvXa.js → _plugin-vue_export-helper-C1je1s0u.js} +0 -0
- /package/dist/{badge-UILT_3pZ.js → badge-D9XWW4GT.js} +0 -0
- /package/dist/{constants-BPOqYJAm.js → constants--C2DkLW8.js} +0 -0
- /package/dist/{createContext-B2RaZ-b8.js → createContext-CpBNTRMI.js} +0 -0
- /package/dist/{math-DeuJwLFx.js → math-Eb0w3LqU.js} +0 -0
- /package/dist/{menuItemVariants-DWRQXBxJ.js → menuItemVariants-D8VNHq22.js} +0 -0
- /package/dist/{prng-Cg22zv8g.js → prng-B-d9eYX8.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/{useKeyboardShortcuts-BXWXOZ-9.js → useKeyboardShortcuts-BPRp33Im.js} +0 -0
- /package/dist/{useLiquidFlex-C12hXwOZ.js → useLiquidFlex-UmA6LMZu.js} +0 -0
- /package/dist/{useResizeObserver-V6nq5gJb.js → useResizeObserver-Bpoi7tRE.js} +0 -0
- /package/dist/{useResolveTokenColor-NUG2zYAW.js → useResolveTokenColor-vAylyR0x.js} +0 -0
- /package/dist/{useScrollProgress-D7bYU2RK.js → useScrollProgress-c3yxmH6a.js} +0 -0
- /package/dist/{useSurfaceAxis-CMnF2zHb.js → useSurfaceAxis-g0NloYEF.js} +0 -0
- /package/dist/{useTimer-B_PAasDL.js → useTimer-BHJOKr35.js} +0 -0
- /package/dist/{useUserInvalidAria-CDfJuakL.js → useUserInvalidAria-y5namzeE.js} +0 -0
- /package/dist/{useViewportReady-CvBcCYDf.js → useViewportReady-anbac3m6.js} +0 -0
|
@@ -0,0 +1,894 @@
|
|
|
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";
|
|
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";
|
|
7
|
+
//#region src/components/custom/dot-flow-field/shaders/flow-field.compute.wgsl.ts
|
|
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 = `
|
|
9
|
+
const PI: f32 = 3.141592653589793;
|
|
10
|
+
const TAU: f32 = 6.283185307179586;
|
|
11
|
+
const MAX_FLOW_STOPS: i32 = 4;
|
|
12
|
+
|
|
13
|
+
struct Particle {
|
|
14
|
+
// (pos.x, pos.y, height, |disp|)
|
|
15
|
+
data: vec4<f32>,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// ── Render uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──
|
|
19
|
+
struct RenderUniforms {
|
|
20
|
+
// r0: (uTime, uContrast, uBaseBright, uDomainHalf)
|
|
21
|
+
r0: vec4<f32>,
|
|
22
|
+
// r1: (uDotSize, uSizePulse, uAspect, uGridPitch)
|
|
23
|
+
r1: vec4<f32>,
|
|
24
|
+
// r2: (uWaveBandCenter, uWaveBandWidth, uGlobeMask, _pad)
|
|
25
|
+
r2: vec4<f32>,
|
|
26
|
+
// ints: (uStopCount, uParticleCount, _pad, _pad)
|
|
27
|
+
ints: vec4<i32>,
|
|
28
|
+
// bg: (background.rgb, hasBackground)
|
|
29
|
+
bg: vec4<f32>,
|
|
30
|
+
// each palette stop: linear-sRGB rgb + _pad
|
|
31
|
+
palette: array<vec4<f32>, 4>,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
@group(0) @binding(0) var<uniform> u: RenderUniforms;
|
|
35
|
+
@group(0) @binding(1) var<storage, read> particles: array<Particle>;
|
|
36
|
+
|
|
37
|
+
${n}
|
|
38
|
+
${i}
|
|
39
|
+
|
|
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);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Sample the multi-stop palette (linear-sRGB stops, OKLab mix). t in [0,1].
|
|
61
|
+
fn samplePaletteLin(t: f32) -> vec3<f32> {
|
|
62
|
+
let stopCount = u.ints.x;
|
|
63
|
+
if (stopCount <= 1) { return u.palette[0].rgb; }
|
|
64
|
+
let n = f32(stopCount);
|
|
65
|
+
let ft = clamp(t, 0.0, 1.0) * (n - 1.0);
|
|
66
|
+
let i0 = i32(floor(ft));
|
|
67
|
+
let i1 = min(i0 + 1, stopCount - 1);
|
|
68
|
+
let f = ft - f32(i0);
|
|
69
|
+
let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i0].rgb);
|
|
70
|
+
let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i1].rgb);
|
|
71
|
+
return oklabToLinearSrgb(mix(labA, labB, f));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
struct VSOut {
|
|
75
|
+
@builtin(position) pos: vec4<f32>,
|
|
76
|
+
@location(0) local: vec2<f32>, // [-1,1] billboard-local coords for the soft circle
|
|
77
|
+
@location(1) bright: f32, // band-driven brightness [0, ~1.6]
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
@vertex
|
|
81
|
+
fn vs_main(
|
|
82
|
+
@builtin(vertex_index) vi: u32,
|
|
83
|
+
@builtin(instance_index) ii: u32,
|
|
84
|
+
) -> VSOut {
|
|
85
|
+
// Two-triangle quad corners in billboard-local space.
|
|
86
|
+
var corners = array<vec2<f32>, 6>(
|
|
87
|
+
vec2<f32>(-1.0, -1.0), vec2<f32>(1.0, -1.0), vec2<f32>(-1.0, 1.0),
|
|
88
|
+
vec2<f32>(-1.0, 1.0), vec2<f32>(1.0, -1.0), vec2<f32>(1.0, 1.0),
|
|
89
|
+
);
|
|
90
|
+
let local = corners[vi];
|
|
91
|
+
|
|
92
|
+
let pr = particles[ii].data;
|
|
93
|
+
let p = pr.xy;
|
|
94
|
+
let h = pr.z;
|
|
95
|
+
let dispMag = pr.w;
|
|
96
|
+
let half = u.r0.w;
|
|
97
|
+
|
|
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).
|
|
111
|
+
let aspect = u.r1.z;
|
|
112
|
+
let ndc = p / half;
|
|
113
|
+
let off = local * sizeWorld / half;
|
|
114
|
+
let offX = off.x / max(aspect, 1e-4);
|
|
115
|
+
|
|
116
|
+
var out: VSOut;
|
|
117
|
+
out.pos = vec4<f32>(ndc.x + offX, ndc.y + off.y, 0.0, 1.0);
|
|
118
|
+
out.local = local;
|
|
119
|
+
out.bright = bright;
|
|
120
|
+
return out;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@fragment
|
|
124
|
+
fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
125
|
+
// Soft circle — radial smoothstep over the billboard-local radius.
|
|
126
|
+
let r = length(in.local);
|
|
127
|
+
let feather = 0.4;
|
|
128
|
+
let mask = 1.0 - smoothstep(1.0 - feather, 1.0, r);
|
|
129
|
+
if (mask < 0.002) { return vec4<f32>(0.0); }
|
|
130
|
+
|
|
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);
|
|
137
|
+
let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
138
|
+
// Premultiplied-alpha output.
|
|
139
|
+
return vec4<f32>(rgb * alpha, alpha);
|
|
140
|
+
}
|
|
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) {
|
|
345
|
+
let t = e * Math.PI / 180;
|
|
346
|
+
return {
|
|
347
|
+
x: Math.cos(t),
|
|
348
|
+
y: Math.sin(t)
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
function T(e, t, n, r) {
|
|
352
|
+
let i = 0, a = 0;
|
|
353
|
+
for (let o of 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;
|
|
355
|
+
i += d * s.x, a += d * s.y;
|
|
356
|
+
}
|
|
357
|
+
return {
|
|
358
|
+
x: a,
|
|
359
|
+
y: -i
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
var E = .012;
|
|
363
|
+
function D(e, t) {
|
|
364
|
+
let n = e * .1031 % 1, r = t * .1031 % 1, i = e * .1031 % 1;
|
|
365
|
+
n < 0 && (n += 1), r < 0 && (r += 1), i < 0 && (i += 1);
|
|
366
|
+
let a = n * (r + 33.33) + r * (i + 33.33) + i * (n + 33.33);
|
|
367
|
+
n += a, r += a, i += a;
|
|
368
|
+
let o = (n + r) * i % 1;
|
|
369
|
+
return o < 0 && (o += 1), o;
|
|
370
|
+
}
|
|
371
|
+
function O(e, t, n) {
|
|
372
|
+
return e + (t - e) * n;
|
|
373
|
+
}
|
|
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);
|
|
377
|
+
}
|
|
378
|
+
function A(e, t) {
|
|
379
|
+
let n = 0, r = .5, i = 1, a = e, o = t;
|
|
380
|
+
for (let e = 0; e < 3; e++) {
|
|
381
|
+
n += r * k(a * i, o * i);
|
|
382
|
+
let e = .8 * a - .6 * o, t = .6 * a + .8 * o;
|
|
383
|
+
a = e, o = t, i *= 2, r *= .5;
|
|
384
|
+
}
|
|
385
|
+
return n;
|
|
386
|
+
}
|
|
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);
|
|
389
|
+
return {
|
|
390
|
+
x: n / (2 * E),
|
|
391
|
+
y: -r
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
function M(e, t, n, r, i) {
|
|
395
|
+
let a = T(e, t, n, r);
|
|
396
|
+
if (i <= 0) return a;
|
|
397
|
+
let o = j({
|
|
398
|
+
x: e.x * .55 + t * .15,
|
|
399
|
+
y: e.y * .55
|
|
400
|
+
});
|
|
401
|
+
return {
|
|
402
|
+
x: a.x + o.x * i,
|
|
403
|
+
y: a.y + o.y * i
|
|
404
|
+
};
|
|
405
|
+
}
|
|
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);
|
|
419
|
+
}
|
|
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;
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/components/custom/dot-flow-field/constants.ts
|
|
456
|
+
var te = 16384, ne = 8, re = 4, z = [{
|
|
457
|
+
L: .92,
|
|
458
|
+
C: .03,
|
|
459
|
+
h: 78
|
|
460
|
+
}, {
|
|
461
|
+
L: .84,
|
|
462
|
+
C: .07,
|
|
463
|
+
h: 62
|
|
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,
|
|
478
|
+
background: "transparent",
|
|
479
|
+
interactive: !1,
|
|
480
|
+
respectReducedMotion: !0
|
|
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 = {
|
|
491
|
+
p0: 0,
|
|
492
|
+
p1: 4,
|
|
493
|
+
ints: 8,
|
|
494
|
+
waves: 12
|
|
495
|
+
};
|
|
496
|
+
function G() {
|
|
497
|
+
let e = new ArrayBuffer(ae);
|
|
498
|
+
return {
|
|
499
|
+
buffer: e,
|
|
500
|
+
f32: new Float32Array(e),
|
|
501
|
+
i32: new Int32Array(e)
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
function oe(e, t, n, r, i) {
|
|
505
|
+
let { f32: a, i32: o } = e;
|
|
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;
|
|
507
|
+
let s = Math.min(t.waveComponents.length, 8);
|
|
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;
|
|
509
|
+
}
|
|
510
|
+
var se = 144, K = {
|
|
511
|
+
r0: 0,
|
|
512
|
+
r1: 4,
|
|
513
|
+
r2: 8,
|
|
514
|
+
ints: 12,
|
|
515
|
+
bg: 16,
|
|
516
|
+
palette: 20
|
|
517
|
+
};
|
|
518
|
+
function q() {
|
|
519
|
+
let e = new ArrayBuffer(se);
|
|
520
|
+
return {
|
|
521
|
+
buffer: e,
|
|
522
|
+
f32: new Float32Array(e),
|
|
523
|
+
i32: new Int32Array(e)
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
var J = .22, ce = .4;
|
|
527
|
+
function le(e, t) {
|
|
528
|
+
let n = (t || 320) / (2 * H);
|
|
529
|
+
return e / Math.max(n, 1e-4);
|
|
530
|
+
}
|
|
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;
|
|
536
|
+
else {
|
|
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;
|
|
539
|
+
}
|
|
540
|
+
for (let e = 0; e < 4; e++) {
|
|
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;
|
|
543
|
+
}
|
|
544
|
+
return e;
|
|
545
|
+
}
|
|
546
|
+
function de(e, t, n) {
|
|
547
|
+
for (let r = 0; r < 8; r++) {
|
|
548
|
+
let i = t + r * 4, a = n[r];
|
|
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);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
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;
|
|
557
|
+
}
|
|
558
|
+
return i;
|
|
559
|
+
}
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region src/components/custom/dot-flow-field/composables/useFlowParticles.ts
|
|
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({
|
|
570
|
+
label: "[DotFlowField] flow-field.compute.wgsl",
|
|
571
|
+
code: v
|
|
572
|
+
}), d = e.createShaderModule({
|
|
573
|
+
label: "[DotFlowField] flow-field.render.wgsl",
|
|
574
|
+
code: y
|
|
575
|
+
}), f = fe(l), p = e.createBuffer({
|
|
576
|
+
label: "[DotFlowField] lattice",
|
|
577
|
+
size: l.count * 16,
|
|
578
|
+
usage: pe | X,
|
|
579
|
+
mappedAtCreation: !0
|
|
580
|
+
});
|
|
581
|
+
new Float32Array(p.getMappedRange()).set(f), p.unmap();
|
|
582
|
+
let m = e.createBuffer({
|
|
583
|
+
label: "[DotFlowField] compute-uniforms",
|
|
584
|
+
size: G().buffer.byteLength,
|
|
585
|
+
usage: Y | X
|
|
586
|
+
}), h = e.createBuffer({
|
|
587
|
+
label: "[DotFlowField] render-uniforms",
|
|
588
|
+
size: q().buffer.byteLength,
|
|
589
|
+
usage: Y | X
|
|
590
|
+
}), g = e.createBindGroupLayout({
|
|
591
|
+
label: "[DotFlowField] compute-bgl",
|
|
592
|
+
entries: [{
|
|
593
|
+
binding: 0,
|
|
594
|
+
visibility: Q,
|
|
595
|
+
buffer: { type: "uniform" }
|
|
596
|
+
}, {
|
|
597
|
+
binding: 1,
|
|
598
|
+
visibility: Q,
|
|
599
|
+
buffer: { type: "storage" }
|
|
600
|
+
}]
|
|
601
|
+
}), _ = e.createComputePipeline({
|
|
602
|
+
label: "[DotFlowField] compute-pipeline",
|
|
603
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [g] }),
|
|
604
|
+
compute: {
|
|
605
|
+
module: u,
|
|
606
|
+
entryPoint: "cs_main"
|
|
607
|
+
}
|
|
608
|
+
}), b = e.createBindGroup({
|
|
609
|
+
label: "[DotFlowField] compute-bg",
|
|
610
|
+
layout: g,
|
|
611
|
+
entries: [{
|
|
612
|
+
binding: 0,
|
|
613
|
+
resource: { buffer: m }
|
|
614
|
+
}, {
|
|
615
|
+
binding: 1,
|
|
616
|
+
resource: { buffer: p }
|
|
617
|
+
}]
|
|
618
|
+
}), x = e.createBindGroupLayout({
|
|
619
|
+
label: "[DotFlowField] render-bgl",
|
|
620
|
+
entries: [{
|
|
621
|
+
binding: 0,
|
|
622
|
+
visibility: Z | me,
|
|
623
|
+
buffer: { type: "uniform" }
|
|
624
|
+
}, {
|
|
625
|
+
binding: 1,
|
|
626
|
+
visibility: Z,
|
|
627
|
+
buffer: { type: "read-only-storage" }
|
|
628
|
+
}]
|
|
629
|
+
}), S = e.createRenderPipeline({
|
|
630
|
+
label: "[DotFlowField] render-pipeline",
|
|
631
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [x] }),
|
|
632
|
+
vertex: {
|
|
633
|
+
module: d,
|
|
634
|
+
entryPoint: "vs_main"
|
|
635
|
+
},
|
|
636
|
+
fragment: {
|
|
637
|
+
module: d,
|
|
638
|
+
entryPoint: "fs_main",
|
|
639
|
+
targets: [{
|
|
640
|
+
format: c,
|
|
641
|
+
blend: {
|
|
642
|
+
color: {
|
|
643
|
+
srcFactor: "one",
|
|
644
|
+
dstFactor: "one-minus-src-alpha",
|
|
645
|
+
operation: "add"
|
|
646
|
+
},
|
|
647
|
+
alpha: {
|
|
648
|
+
srcFactor: "one",
|
|
649
|
+
dstFactor: "one-minus-src-alpha",
|
|
650
|
+
operation: "add"
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}]
|
|
654
|
+
},
|
|
655
|
+
primitive: { topology: "triangle-list" }
|
|
656
|
+
}), C = e.createBindGroup({
|
|
657
|
+
label: "[DotFlowField] render-bg",
|
|
658
|
+
layout: x,
|
|
659
|
+
entries: [{
|
|
660
|
+
binding: 0,
|
|
661
|
+
resource: { buffer: h }
|
|
662
|
+
}, {
|
|
663
|
+
binding: 1,
|
|
664
|
+
resource: { buffer: p }
|
|
665
|
+
}]
|
|
666
|
+
}), w = G(), T = q(), E = -1;
|
|
667
|
+
function D() {
|
|
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
|
+
};
|
|
675
|
+
}
|
|
676
|
+
function O(i) {
|
|
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,
|
|
686
|
+
clearValue: {
|
|
687
|
+
r: 0,
|
|
688
|
+
g: 0,
|
|
689
|
+
b: 0,
|
|
690
|
+
a: 0
|
|
691
|
+
},
|
|
692
|
+
loadOp: "clear",
|
|
693
|
+
storeOp: "store"
|
|
694
|
+
}] });
|
|
695
|
+
g.setPipeline(S), g.setBindGroup(0, C), g.draw(6, l.count, 0, 0), g.end(), e.queue.submit([d.finish()]);
|
|
696
|
+
}
|
|
697
|
+
return {
|
|
698
|
+
frame: O,
|
|
699
|
+
shouldContinue: i,
|
|
700
|
+
resize: D,
|
|
701
|
+
teardown: () => {
|
|
702
|
+
p.destroy(), m.destroy(), h.destroy();
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
};
|
|
706
|
+
}
|
|
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}`);
|
|
712
|
+
}
|
|
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);
|
|
738
|
+
}
|
|
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);
|
|
762
|
+
}
|
|
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
|
+
};
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
//#endregion
|
|
774
|
+
//#region src/components/custom/dot-flow-field/composables/useDotFlowField.ts
|
|
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
|
+
}
|
|
823
|
+
}),
|
|
824
|
+
setupGL: ve({
|
|
825
|
+
...e,
|
|
826
|
+
config: l,
|
|
827
|
+
onFrame: (e) => {
|
|
828
|
+
p(e), u();
|
|
829
|
+
}
|
|
830
|
+
})
|
|
831
|
+
}), d.armAsync();
|
|
832
|
+
}
|
|
833
|
+
return d;
|
|
834
|
+
};
|
|
835
|
+
queueMicrotask(() => b());
|
|
836
|
+
let x = {
|
|
837
|
+
get backend() {
|
|
838
|
+
return b()?.backend ?? "webgpu";
|
|
839
|
+
},
|
|
840
|
+
pause: () => b()?.suspend("manual"),
|
|
841
|
+
resume: () => b()?.resume("manual"),
|
|
842
|
+
wake: () => b()?.wake(),
|
|
843
|
+
renderAt: (e) => b()?.renderAt(e),
|
|
844
|
+
get reducedMotion() {
|
|
845
|
+
return d?.reducedMotion ?? !1;
|
|
846
|
+
},
|
|
847
|
+
dispose: () => {
|
|
848
|
+
let t = e.value;
|
|
849
|
+
t && y(t), o.dispose(), d?.dispose();
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
return m(() => x.dispose()), x;
|
|
853
|
+
}
|
|
854
|
+
//#endregion
|
|
855
|
+
//#region src/components/custom/dot-flow-field/DotFlowField.vue
|
|
856
|
+
var be = /* @__PURE__ */ e(/* @__PURE__ */ f({
|
|
857
|
+
__name: "DotFlowField",
|
|
858
|
+
props: {
|
|
859
|
+
config: { default: () => V },
|
|
860
|
+
paused: {
|
|
861
|
+
type: Boolean,
|
|
862
|
+
default: !1
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
emits: ["update:paused"],
|
|
866
|
+
setup(e, { expose: t }) {
|
|
867
|
+
let n = g("canvasRef"), r = ye(n, {
|
|
868
|
+
config: e.config,
|
|
869
|
+
getPalette: () => e.config.palette
|
|
870
|
+
});
|
|
871
|
+
_(() => e.paused, (e) => e ? r.pause() : r.resume(), { immediate: !0 });
|
|
872
|
+
let i = l(() => {
|
|
873
|
+
let t = e.config.background;
|
|
874
|
+
if (t !== "transparent") return `oklch(${t.L} ${t.C} ${t.h})`;
|
|
875
|
+
});
|
|
876
|
+
return t({
|
|
877
|
+
pause: r.pause,
|
|
878
|
+
resume: r.resume,
|
|
879
|
+
wake: r.wake,
|
|
880
|
+
renderAt: r.renderAt
|
|
881
|
+
}), (e, t) => (h(), u("div", {
|
|
882
|
+
class: "dot-flow-field-wrapper",
|
|
883
|
+
style: p(i.value ? { background: i.value } : void 0)
|
|
884
|
+
}, [d("canvas", {
|
|
885
|
+
ref_key: "canvasRef",
|
|
886
|
+
ref: n,
|
|
887
|
+
class: "dot-flow-field-canvas",
|
|
888
|
+
"aria-hidden": "true",
|
|
889
|
+
"data-testid": "dot-flow-field-canvas"
|
|
890
|
+
}, null, 512)], 4));
|
|
891
|
+
}
|
|
892
|
+
}), [["__scopeId", "data-v-01c7721a"]]);
|
|
893
|
+
//#endregion
|
|
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 };
|