@mkbabb/glass-ui 3.13.0 → 4.0.1
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-CW7a0m8M.js +253 -0
- package/dist/{CommandShortcut-RowNEO6i.js → CommandShortcut-DvZNQ_HF.js} +58 -53
- package/dist/ConfiguratorRow-BR4l-ixA.js +143 -0
- package/dist/{ContextMenuContent-CT3AS1WX.js → ContextMenuContent-uWnVxDab.js} +1 -1
- package/dist/{ContextMenuSubContent-BQmxTAdw.js → ContextMenuSubContent-xol4sD2q.js} +32 -37
- package/dist/{DataTable-BCddn3T3.js → DataTable-CuKwF7wr.js} +99 -97
- package/dist/DialogContent-DcKK8k9i.js +103 -0
- package/dist/{DialogFooter-Blu4t7tJ.js → DialogFooter-BZNX5aVr.js} +3 -3
- package/dist/FadingScroll-DI6hQhT9.js +76 -0
- package/dist/{HoverCardContent-Csywg3YF.js → HoverCardContent-b2uaAMRR.js} +1 -1
- package/dist/{HoverPopover-CISOJQuZ.js → HoverPopover-CbqbNwgU.js} +2 -2
- package/dist/IconChip-BTD-nay5.js +55 -0
- package/dist/{IconTooltip-DPzE09X9.js → IconTooltip-Bl8gFZ8d.js} +1 -1
- package/dist/{Input-DWQQIOC4.js → Input-h9v5LeXf.js} +1 -1
- package/dist/{MetricBadge-C9QMz1KT.js → MetricBadge-RHdBP72w.js} +1 -1
- package/dist/Notification-VUwexFUf.js +43 -0
- package/dist/NumberFieldContent-Cq7EzX-U.js +138 -0
- package/dist/PopoverContent-DL7E6vJP.js +127 -0
- package/dist/{Progress-DwlUKGbr.js → Progress-DctG61iZ.js} +98 -78
- package/dist/{ScrollingText-DfFrwSph.js → ScrollingText-yOpBzFYq.js} +2 -2
- package/dist/{SelectScrollDownButton-CiDUxfEj.js → SelectScrollDownButton-CrA8F0iV.js} +35 -20
- package/dist/{Switch-CsIuYP_e.js → Switch-CwYNf8bo.js} +1 -1
- package/dist/Toaster-Bw4xR8xV.js +274 -0
- package/dist/{ToggleGroupItem-D_AHlRw9.js → ToggleGroupItem-pEM9vIhs.js} +50 -37
- package/dist/{TooltipProvider-B3MkB_8P.js → TooltipProvider-rzvnXz60.js} +1 -1
- package/dist/animated-digit.js +2 -2
- package/dist/api/index.d.ts +16 -8
- package/dist/api/types-extra.d.ts +6 -0
- package/dist/api.js +2 -2
- package/dist/aurora.js +888 -230
- package/dist/badge.js +1 -1
- package/dist/border-progress.d.ts +1 -0
- package/dist/border-progress.js +106 -0
- package/dist/button-DYCUa-tH.js +126 -0
- package/dist/button.js +1 -1
- package/dist/canvas.js +2 -2
- package/dist/card.js +2 -2
- package/dist/carousel.d.ts +1 -1
- package/dist/carousel.js +90 -151
- package/dist/collapsible.js +1 -1
- package/dist/color-swatch.d.ts +1 -0
- package/dist/color-swatch.js +47 -0
- package/dist/color.js +1 -1
- package/dist/command.js +1 -1
- package/dist/compile-CQEFRTmx.js +19 -0
- 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/runtime.d.ts +19 -0
- package/dist/components/custom/aurora/composables/uniformBridge.d.ts +5 -1
- package/dist/components/custom/aurora/composables/uniformBridgeWGPU.d.ts +51 -0
- package/dist/components/custom/aurora/composables/wgpuSetup.d.ts +29 -0
- package/dist/components/custom/aurora/constants/budget.d.ts +21 -0
- package/dist/components/custom/aurora/constants/presets.d.ts +30 -2
- package/dist/components/custom/aurora/constants/renderMode.d.ts +63 -10
- 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 +3 -2
- package/dist/components/custom/border-progress/BorderProgress.vue.d.ts +46 -0
- package/dist/components/custom/border-progress/composables/useBorderSpectrum.d.ts +22 -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/color-swatch/ColorSwatch.vue.d.ts +22 -0
- package/dist/components/custom/color-swatch/index.d.ts +1 -0
- package/dist/components/custom/concentric/Concentric.vue.d.ts +39 -0
- package/dist/components/custom/concentric/composables/concentricGLSetup.d.ts +11 -0
- package/dist/components/custom/concentric/composables/concentricWGPUSetup.d.ts +13 -0
- package/dist/components/custom/concentric/composables/ringField.d.ts +44 -0
- package/dist/components/custom/concentric/composables/uniformBridgeWGPU.d.ts +13 -0
- package/dist/components/custom/concentric/composables/useConcentric.d.ts +35 -0
- package/dist/components/custom/concentric/constants.d.ts +43 -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/configurator/Configurator.vue.d.ts +19 -8
- package/dist/components/custom/constellation/Constellation.vue.d.ts +18 -206
- package/dist/components/custom/constellation/composables/useConstellation.d.ts +26 -0
- package/dist/components/custom/constellation/constellationField.d.ts +2 -369
- package/dist/components/custom/constellation/constellationTypes.d.ts +369 -0
- package/dist/components/custom/constellation/index.d.ts +1 -1
- package/dist/components/custom/dock/DockIconButton.vue.d.ts +13 -4
- package/dist/components/custom/dock/DockLayerGroup.vue.d.ts +10 -2
- package/dist/components/custom/dock/DockRail.vue.d.ts +17 -16
- package/dist/components/custom/dock/DockSection.vue.d.ts +69 -0
- package/dist/components/custom/dock/DockSeparator.vue.d.ts +49 -1
- package/dist/components/custom/dock/DockTabButton.vue.d.ts +5 -5
- package/dist/components/custom/dock/composables/dockMorphMeasure.d.ts +75 -0
- package/dist/components/custom/dock/composables/useLayerTransition.d.ts +13 -0
- package/dist/components/custom/dock/constants.d.ts +35 -0
- package/dist/components/custom/dock/index.d.ts +2 -0
- package/dist/components/custom/dot-flow-field/DotFlowField.vue.d.ts +38 -0
- package/dist/components/custom/dot-flow-field/composables/flowField.d.ts +41 -0
- package/dist/components/custom/dot-flow-field/composables/uniformBridgeWGPU.d.ts +24 -0
- package/dist/components/custom/dot-flow-field/composables/useDotFlowField.d.ts +34 -0
- package/dist/components/custom/dot-flow-field/composables/useFlowParticles.d.ts +18 -0
- package/dist/components/custom/dot-flow-field/constants.d.ts +48 -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 +20 -0
- package/dist/components/custom/dot-flow-field/shaders/flow-field.render.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 +75 -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 +10 -0
- package/dist/components/custom/fading-scroll/FadingScroll.vue.d.ts +25 -0
- package/dist/components/custom/fading-scroll/composables/useFadingScroll.d.ts +31 -0
- package/dist/components/custom/fading-scroll/constants.d.ts +19 -0
- package/dist/components/custom/fading-scroll/index.d.ts +2 -0
- package/dist/components/custom/fourier-field/FourierField.vue.d.ts +19 -2
- package/dist/components/custom/fourier-field/composables/useFourierField.d.ts +39 -0
- package/dist/components/custom/fourier-field/constants.d.ts +7 -0
- package/dist/components/custom/fourier-field/index.d.ts +1 -1
- package/dist/components/custom/fourier-field/math.d.ts +17 -0
- package/dist/components/custom/glass-panel/GlassPanel.vue.d.ts +9 -1
- package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +4 -2
- package/dist/components/custom/goo-blob/composables/uniformBridgeWGPU.d.ts +24 -0
- package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +29 -12
- package/dist/components/custom/goo-blob/composables/wgpuSetup.d.ts +23 -0
- package/dist/components/custom/goo-blob/constants.d.ts +6 -1
- package/dist/components/custom/goo-blob/shaders/metaball.wgsl.d.ts +1 -0
- package/dist/components/custom/handmark/HandMark.vue.d.ts +29 -0
- package/dist/components/custom/handmark/brush.d.ts +269 -0
- package/dist/components/custom/handmark/composables/useHandMark.d.ts +89 -0
- package/dist/components/custom/handmark/constants.d.ts +39 -0
- package/dist/components/custom/handmark/freehand.d.ts +69 -0
- package/dist/components/custom/handmark/geometry.d.ts +52 -0
- package/dist/components/custom/handmark/index.d.ts +27 -0
- package/dist/components/custom/handmark/ink.d.ts +11 -0
- package/dist/components/custom/handmark/texture.d.ts +39 -0
- package/dist/components/custom/handmark/types.d.ts +62 -0
- package/dist/components/custom/icon-chip/IconChip.vue.d.ts +4 -0
- package/dist/components/custom/icon-chip/index.d.ts +2 -0
- package/dist/components/custom/icon-chip/types.d.ts +82 -0
- package/dist/components/custom/instrument-chassis/InstrumentChassis.vue.d.ts +17 -2
- package/dist/components/custom/metric-stack/MetricStack.vue.d.ts +1 -1
- package/dist/components/custom/pager-dots/PagerDots.vue.d.ts +39 -0
- package/dist/components/custom/pager-dots/index.d.ts +2 -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/tabs/SegmentedTabs.vue.d.ts +29 -24
- package/dist/components/custom/tabs/composables/useTabDragMorph.d.ts +42 -0
- package/dist/components/custom/tabs/composables/useTabIndicator.d.ts +30 -21
- package/dist/components/custom/tabs/constants.d.ts +9 -3
- package/dist/components/custom/tabs/index.d.ts +1 -1
- package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +15 -1
- package/dist/components/ui/_shared/index.d.ts +2 -0
- package/dist/components/ui/_shared/menuItemVariants.d.ts +19 -0
- package/dist/components/ui/_shared/useSurfaceAxis.d.ts +41 -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 +34 -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 +2 -0
- 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/carousel/index.d.ts +0 -1
- package/dist/components/ui/command/Command.vue.d.ts +4 -1
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +8 -3
- package/dist/components/ui/drawer/Drawer.vue.d.ts +46 -33
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts +12 -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/focus-scope/FocusScope.vue.d.ts +20 -0
- package/dist/components/ui/focus-scope/index.d.ts +2 -0
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +3 -0
- package/dist/components/ui/progress/ProgressDefault.vue.d.ts +3 -2
- package/dist/components/ui/progress/ProgressSectioned.vue.d.ts +14 -3
- package/dist/components/ui/select/SelectContent.vue.d.ts +1 -1
- package/dist/components/ui/select/SelectTrigger.vue.d.ts +27 -4
- package/dist/components/ui/sheet/SheetContent.vue.d.ts +6 -0
- package/dist/components/ui/sheet/index.d.ts +1 -1
- package/dist/components/ui/skeleton/Skeleton.vue.d.ts +3 -0
- package/dist/components/ui/tags-input/TagsInput.vue.d.ts +2 -2
- 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/composables/dark/index.d.ts +1 -1
- package/dist/composables/dark/useGlobalDark.d.ts +23 -1
- 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/vSpecular.d.ts +2 -0
- package/dist/composables/glass/webgl/shaders/flow.glsl.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 +54 -0
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +84 -0
- package/dist/composables/motion/core/index.d.ts +1 -0
- package/dist/composables/motion/index.d.ts +4 -0
- package/dist/composables/motion/useDockCtaReceive.d.ts +59 -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/useViewTransition.d.ts +36 -1
- package/dist/concentric.d.ts +1 -0
- package/dist/concentric.js +562 -0
- package/dist/configurator.js +3 -2
- package/dist/confirm-dialog.js +22 -24
- package/dist/constellation.js +93 -95
- package/dist/context-menu.js +3 -3
- package/dist/controls.js +10 -4
- package/dist/createCanvasLifecycle-CHD5XrDW.js +82 -0
- package/dist/dark.d.ts +1 -1
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/dialog.js +2 -2
- package/dist/dock.js +738 -442
- package/dist/{dockContext-BegmJVmx.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 +604 -0
- package/dist/drawer.d.ts +1 -0
- package/dist/drawer.js +380 -0
- package/dist/{dropdown-menu-DzkkyBwX.js → dropdown-menu-CofSZuk8.js} +14 -15
- package/dist/dropdown-menu.js +1 -1
- package/dist/easing.d.ts +1 -0
- package/dist/easing.js +463 -0
- package/dist/expandable-container.js +45 -38
- package/dist/fading-scroll.d.ts +1 -0
- package/dist/fading-scroll.js +2 -0
- package/dist/focus-scope.d.ts +1 -0
- package/dist/focus-scope.js +23 -0
- package/dist/forms.js +7 -7
- package/dist/fourier-field.js +135 -122
- package/dist/fourier-math.js +2 -2
- package/dist/glass-panel.js +39 -36
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +154 -362
- package/dist/goo-blob.js +838 -227
- package/dist/handmark.d.ts +1 -0
- package/dist/handmark.js +707 -0
- 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.d.ts +1 -0
- package/dist/icon-chip.js +2 -0
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/instrument-chassis.js +1 -1
- package/dist/keyboard.js +1 -1
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +6 -6
- package/dist/{math-U6-RrLmV.js → math-BINYmg5z.js} +11 -3
- package/dist/{menuItemVariants-DPiEarb0.js → menuItemVariants-D8VNHq22.js} +10 -4
- package/dist/metric-badge.js +1 -1
- package/dist/metric-cell.js +25 -22
- package/dist/metric-stack.js +4 -8
- package/dist/motion-core.js +36 -35
- package/dist/motion-curves.js +1 -1
- package/dist/motion.js +157 -55
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.d.ts +1 -0
- package/dist/pager-dots.js +91 -0
- package/dist/paper-backdrop.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/{presets-BKVyQfbt.js → presets-BW2b-fr1.js} +14 -1
- package/dist/{compile-B7NGOBcP.js → procedural-color.glsl-CIFsJhwI.js} +1 -155
- package/dist/procedural-color.wgsl-CToRHugY.js +224 -0
- package/dist/progress.js +1 -1
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +2 -2
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +10 -12
- package/dist/select.js +3 -3
- package/dist/separator.js +1 -1
- package/dist/sheet-tZMg0E0w.js +218 -0
- package/dist/sheet.js +1 -1
- package/dist/{slider-B-JP2JlI.js → slider-DVb4HXU-.js} +7 -7
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +3 -3
- package/dist/spa-view.d.ts +1 -0
- package/dist/spa-view.js +46 -0
- package/dist/styles/animations.css +40 -31
- package/dist/styles/border-progress.css +109 -0
- package/dist/styles/cards.css +76 -0
- package/dist/styles/components.css +1 -1
- package/dist/styles/configurator.css +35 -0
- package/dist/styles/critical-partition.mjs +140 -0
- package/dist/styles/critical.css +12 -0
- package/dist/styles/deferred.css +31 -0
- package/dist/styles/dock/density.css +64 -0
- package/dist/styles/dock/layers.css +54 -30
- package/dist/styles/dock/morph.css +124 -7
- package/dist/styles/dock/overflow.css +31 -2
- package/dist/styles/dock/rail-extend.css +168 -71
- package/dist/styles/dock/section.css +59 -0
- package/dist/styles/dock/shell.css +83 -16
- package/dist/styles/dock-controls/icon-button.css +11 -1
- package/dist/styles/dock-controls/tab-button.css +24 -83
- package/dist/styles/dock-controls/triggers.css +7 -0
- package/dist/styles/dock.css +38 -3
- package/dist/styles/drawer.css +127 -35
- package/dist/styles/feedback-tone.css +104 -0
- package/dist/styles/glass/deep.css +44 -0
- package/dist/styles/glass/ladder.css +154 -52
- package/dist/styles/glass/material.css +78 -15
- package/dist/styles/glass/reveal.css +136 -0
- package/dist/styles/glass/rim.css +100 -0
- package/dist/styles/glass/surface-axis.css +113 -0
- package/dist/styles/glass/surfaces.css +189 -15
- package/dist/styles/glass-refract.css +96 -44
- package/dist/styles/glass-specular-track.css +7 -0
- package/dist/styles/glass.css +8 -2
- package/dist/styles/hover-popover.css +7 -6
- package/dist/styles/icon-chip.css +211 -0
- package/dist/styles/index.css +78 -4
- package/dist/styles/instrument-chassis.css +107 -2
- package/dist/styles/menu.css +127 -0
- package/dist/styles/scroll-choreography.css +300 -0
- package/dist/styles/segmented-tabs.css +188 -86
- package/dist/styles/select.css +50 -0
- package/dist/styles/theme/bridges.css +22 -1
- package/dist/styles/theme/literals.css +11 -2
- package/dist/styles/theme/radius.css +6 -1
- package/dist/styles/tokens/color-radius.css +40 -13
- package/dist/styles/tokens/dark-arm.css +200 -20
- package/dist/styles/tokens/glass-deep.css +75 -0
- package/dist/styles/tokens/glass-fx.css +333 -0
- package/dist/styles/tokens/glass.css +95 -315
- package/dist/styles/tokens/light-dark.css +64 -22
- package/dist/styles/tokens/offsets.css +116 -0
- package/dist/styles/tokens/on-glass-fg.css +39 -0
- package/dist/styles/tokens/property-regs.css +130 -10
- package/dist/styles/tokens/scale-paper.css +155 -84
- package/dist/styles/tokens/scheme-motion.css +102 -46
- package/dist/styles/tokens/scroll-tokens.css +123 -0
- package/dist/styles/tokens/{offsets-sizing.css → sizing.css} +88 -89
- package/dist/styles/tokens.css +9 -3
- package/dist/styles/transitions.css +7 -7
- package/dist/styles/typography/scale.css +153 -0
- package/dist/styles/typography/semantic.css +220 -0
- package/dist/styles/typography/utilities.css +174 -0
- package/dist/styles/typography.css +23 -507
- package/dist/styles/utilities/a11y-overrides.css +33 -4
- package/dist/styles/utilities/animate.css +27 -24
- package/dist/styles/utilities/base-misc.css +255 -0
- package/dist/styles/utilities/base.css +100 -138
- package/dist/styles/utilities/btn.css +21 -202
- package/dist/styles/utilities/metal.css +189 -0
- package/dist/styles/utilities.css +14 -7
- package/dist/styles/view-transition.css +4 -1
- package/dist/switch.js +1 -1
- package/dist/tabs.js +275 -191
- package/dist/timeline.js +2 -2
- package/dist/toast.js +1 -1
- package/dist/toggle-chip.js +3 -1
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{useAnimatedNumber-C5I3wWd8.js → useAnimatedNumber-BfUq2bUM.js} +1 -1
- package/dist/useCanvas2D-B8w_E3Rr.js +83 -0
- package/dist/useConfiguratorState-DNlOh6c8.js +161 -0
- package/dist/useDragMorph-DgxnsVJz.js +102 -0
- package/dist/{useGlobalDark-yhL4Wp-s.js → useGlobalDark-C28t0VWJ.js} +22 -3
- package/dist/useLiquidPress-kfb4KX79.js +39 -0
- package/dist/usePointerVelocityField-JbRd5CrM.js +137 -0
- package/dist/{useRAFLoop-Bxv0o6L5.js → useRAFLoop-UYa4zoiN.js} +1 -1
- package/dist/useSpring-C0jyvEJB.js +40 -0
- package/dist/useSpringMount-q1amq1SJ.js +71 -0
- package/dist/useSpringPress-BsqPr7FJ.js +34 -0
- package/dist/useSurfaceAxis-g0NloYEF.js +7 -0
- package/dist/{useTouchGate-Dg7MQI1G.js → useTouchGate-CBZTD4SD.js} +1 -1
- package/dist/vReveal-Czsb7zQC.js +10 -0
- package/dist/vSpecular-CQFmLNzA.js +68 -0
- package/dist/vendor-CKmzio-i.js +226 -0
- package/dist/watercolor-dot.js +12 -5
- package/package.json +193 -25
- package/src/styles/animations.css +40 -31
- package/src/styles/border-progress.css +109 -0
- package/src/styles/cards.css +76 -0
- package/src/styles/configurator.css +35 -0
- package/src/styles/critical-partition.mjs +140 -0
- package/src/styles/dock/density.css +64 -0
- package/src/styles/dock/layers.css +54 -30
- package/src/styles/dock/morph.css +124 -7
- package/src/styles/dock/overflow.css +31 -2
- package/src/styles/dock/rail-extend.css +168 -71
- package/src/styles/dock/section.css +59 -0
- package/src/styles/dock/shell.css +83 -16
- package/src/styles/dock-controls/icon-button.css +11 -1
- package/src/styles/dock-controls/tab-button.css +24 -83
- package/src/styles/dock-controls/triggers.css +7 -0
- package/src/styles/dock.css +38 -3
- package/src/styles/drawer.css +123 -35
- package/src/styles/feedback-tone.css +104 -0
- package/src/styles/glass/deep.css +44 -0
- package/src/styles/glass/ladder.css +154 -52
- package/src/styles/glass/material.css +78 -15
- package/src/styles/glass/reveal.css +136 -0
- package/src/styles/glass/rim.css +100 -0
- package/src/styles/glass/surface-axis.css +113 -0
- package/src/styles/glass/surfaces.css +189 -15
- package/src/styles/glass-refract.css +96 -44
- package/src/styles/glass-specular-track.css +7 -0
- package/src/styles/glass.css +8 -2
- package/src/styles/hover-popover.css +7 -6
- package/src/styles/icon-chip.css +211 -0
- package/src/styles/index.css +78 -4
- package/src/styles/instrument-chassis.css +107 -2
- package/src/styles/menu.css +127 -0
- package/src/styles/scroll-choreography.css +300 -0
- package/src/styles/segmented-tabs.css +184 -84
- package/src/styles/select.css +50 -0
- package/src/styles/theme/bridges.css +22 -1
- package/src/styles/theme/literals.css +11 -2
- package/src/styles/theme/radius.css +6 -1
- package/src/styles/tokens/color-radius.css +40 -13
- package/src/styles/tokens/dark-arm.css +200 -20
- package/src/styles/tokens/glass-deep.css +75 -0
- package/src/styles/tokens/glass-fx.css +333 -0
- package/src/styles/tokens/glass.css +95 -315
- package/src/styles/tokens/light-dark.css +64 -22
- package/src/styles/tokens/offsets.css +116 -0
- package/src/styles/tokens/on-glass-fg.css +39 -0
- package/src/styles/tokens/property-regs.css +130 -10
- package/src/styles/tokens/scale-paper.css +155 -84
- package/src/styles/tokens/scheme-motion.css +102 -46
- package/src/styles/tokens/scroll-tokens.css +123 -0
- package/src/styles/tokens/{offsets-sizing.css → sizing.css} +88 -89
- package/src/styles/tokens.css +9 -3
- package/src/styles/transitions.css +7 -7
- package/src/styles/typography/scale.css +153 -0
- package/src/styles/typography/semantic.css +220 -0
- package/src/styles/typography/utilities.css +174 -0
- package/src/styles/typography.css +23 -507
- package/src/styles/utilities/a11y-overrides.css +33 -4
- package/src/styles/utilities/animate.css +27 -24
- package/src/styles/utilities/base-misc.css +255 -0
- package/src/styles/utilities/base.css +100 -138
- package/src/styles/utilities/btn.css +21 -202
- package/src/styles/utilities/metal.css +189 -0
- package/src/styles/utilities.css +14 -7
- package/src/styles/view-transition.css +4 -1
- package/dist/CardAction-Cj2eycQ2.js +0 -157
- package/dist/DialogContent-Dl9WkAoS.js +0 -100
- package/dist/Notification-DdwNxIrI.js +0 -100
- package/dist/NumberFieldContent-CqaN-SvN.js +0 -145
- package/dist/PopoverContent-BYwt2-4x.js +0 -121
- package/dist/TabsList-Dttss653.js +0 -105
- package/dist/Toaster-D6q4HtXu.js +0 -263
- package/dist/button-ChXMfsud.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/components/custom/underline/GlassUnderline.vue.d.ts +0 -84
- package/dist/components/custom/underline/index.d.ts +0 -2
- package/dist/components/custom/underline/types.d.ts +0 -56
- package/dist/components/ui/carousel/CarouselDots.vue.d.ts +0 -4
- package/dist/createLucideIcon-DydS2qgk.js +0 -43
- package/dist/minimize-2-BV31Ob_h.js +0 -38
- package/dist/search-BSGrf2Sk.js +0 -12
- package/dist/sheet-1fChZjtw.js +0 -214
- package/dist/underline.d.ts +0 -1
- package/dist/underline.js +0 -85
- package/dist/useCanvas2D-ClrQuZtp.js +0 -96
- package/dist/useConfiguratorState-DAoeHVue.js +0 -287
- package/dist/useSpecularTracking-Bo5su68i.js +0 -32
- package/dist/useSpringMount-CI2jOstM.js +0 -108
- package/dist/vReveal-CqaCz_mC.js +0 -44
- package/dist/x-BUwTKe50.js +0 -10
- /package/dist/{CollapsibleContent-CP9qF1v4.js → CollapsibleContent-68dEXIAl.js} +0 -0
- /package/dist/{InstrumentChassis-UUJX0-mW.js → InstrumentChassis-Bx0F_q5g.js} +0 -0
- /package/dist/{Label-r3WzWrsj.js → Label-C2ejNWeC.js} +0 -0
- /package/dist/{ModalOverlay-DVLI2VRr.js → ModalOverlay-D1VrWyoi.js} +0 -0
- /package/dist/{PaperBackdrop-DIXTtVq6.js → PaperBackdrop-Vf3tlpvd.js} +0 -0
- /package/dist/{SelectGroup-aumMgWLs.js → SelectGroup-DwwjicPY.js} +0 -0
- /package/dist/{SelectSeparator-BQ_1Fcbp.js → SelectSeparator-DXswVdRz.js} +0 -0
- /package/dist/{Separator-0JE6LtNu.js → Separator-pKF0oA4M.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-ok8pgSl5.js → _plugin-vue_export-helper-C1je1s0u.js} +0 -0
- /package/dist/{badge-UILT_3pZ.js → badge-D9XWW4GT.js} +0 -0
- /package/dist/{color-CUYeFbgd.js → color-DweYl7pE.js} +0 -0
- /package/dist/{constants-CS75AWHG.js → constants-BPOqYJAm.js} +0 -0
- /package/dist/{createContext-BM46COQ-.js → createContext-CpBNTRMI.js} +0 -0
- /package/dist/{prng-D27-B3tK.js → prng-Za0Rmgag.js} +0 -0
- /package/dist/{resolveCanvasColor-BBiYfp8g.js → resolveCanvasColor-CUyHr5Uu.js} +0 -0
- /package/dist/{springPresets--YdWTHtm.js → springPresets-CFQGQfdl.js} +0 -0
- /package/dist/{useIntersectionPause-Cc-H9ees.js → useIntersectionPause-Bj4sPkMh.js} +0 -0
- /package/dist/{useInterval-iHludrxk.js → useInterval-CvK1mL92.js} +0 -0
- /package/dist/{useKeyboardShortcuts-Be3w_Rwk.js → useKeyboardShortcuts-BXWXOZ-9.js} +0 -0
- /package/dist/{useLiquidFlex-BL0lLLN2.js → useLiquidFlex-mZPMiNXh.js} +0 -0
- /package/dist/{useResizeObserver-BhgdhOIj.js → useResizeObserver-Bpoi7tRE.js} +0 -0
- /package/dist/{useResolveTokenColor-Dvn2RZJW.js → useResolveTokenColor-vAylyR0x.js} +0 -0
- /package/dist/{useScrollProgress-Dlvx-L3v.js → useScrollProgress-D7bYU2RK.js} +0 -0
- /package/dist/{useSortable-muI29agz.js → useSortable-DHjtZSEd.js} +0 -0
- /package/dist/{useTextHighlight-DmRYkOBx.js → useTextHighlight-CWEi25hf.js} +0 -0
- /package/dist/{useTimer-Dzarvzuk.js → useTimer-BHJOKr35.js} +0 -0
- /package/dist/{useUserInvalidAria-B2h6jAM_.js → useUserInvalidAria-y5namzeE.js} +0 -0
- /package/dist/{useViewportReady-B40FK4Pa.js → useViewportReady-anbac3m6.js} +0 -0
package/dist/dom.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "./useResizeObserver-
|
|
2
|
-
import { t } from "./useTouchGate-
|
|
3
|
-
import { a as n, i as r, n as i, o as a, r as o, t as s } from "./useViewportReady-
|
|
4
|
-
import { n as c, t as l } from "./useResolveTokenColor-
|
|
5
|
-
import { t as u } from "./useUserInvalidAria-
|
|
1
|
+
import { t as e } from "./useResizeObserver-Bpoi7tRE.js";
|
|
2
|
+
import { t } from "./useTouchGate-CBZTD4SD.js";
|
|
3
|
+
import { a as n, i as r, n as i, o as a, r as o, t as s } from "./useViewportReady-anbac3m6.js";
|
|
4
|
+
import { n as c, t as l } from "./useResolveTokenColor-vAylyR0x.js";
|
|
5
|
+
import { t as u } from "./useUserInvalidAria-y5namzeE.js";
|
|
6
6
|
export { r as copyToClipboard, l as createTokenColorCache, c as resolveTokenColor, o as useBreakpoint, n as useClipboard, i as useIdleReady, e as useResizeObserver, a as useTokenColor, t as useTouchGate, u as useUserInvalidAria, s as useViewportReady };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components/custom/dot-flow-field";
|
|
@@ -0,0 +1,604 @@
|
|
|
1
|
+
import { t as e } from "./useCanvas2D-B8w_E3Rr.js";
|
|
2
|
+
import { t } from "./_plugin-vue_export-helper-C1je1s0u.js";
|
|
3
|
+
import { a as n, n as r, o as i, r as a, u as o } from "./procedural-color.wgsl-CToRHugY.js";
|
|
4
|
+
import { c as s, o as c } from "./color-DweYl7pE.js";
|
|
5
|
+
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
|
+
//#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, age, seed)\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: (uDomainHalf, uReseedJitter, _pad, _pad)\n p1: vec4<f32>,\n // ints: (uWaveCount, uParticleCount, _pad, _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 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// ── 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).\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 * 1.7 + t * 0.15, p.y * 1.7));\n v = v + c * curlStrength;\n }\n return v;\n}\n\n// A particle that leaves the bounds re-spawns at a seed-derived position (so coverage\n// stays steady — the §3 re-seed-at-edge rule). The seed advances each re-spawn so a\n// re-seeded particle does not pile on the previous spawn.\nfn reseed(seed: f32, age: f32) -> vec2<f32> {\n let half = u.p1.x;\n let r1 = hash21(vec2<f32>(seed * 71.13, age * 13.7));\n let r2 = hash21(vec2<f32>(seed * 19.31 + 4.0, age * 7.3 + 2.0));\n return (vec2<f32>(r1, r2) * 2.0 - 1.0) * half;\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 half = u.p1.x;\n\n var pr = particles[idx];\n var pos = pr.data.xy;\n var age = pr.data.z;\n let seed = pr.data.w;\n\n let v = sampleVelocity(pos, t);\n // Forward Euler — p_{n+1} = p_n + v·dt.\n pos = pos + v * dt;\n age = age + dt;\n\n // Wrap / re-seed at the domain edge (re-spawn from the seed at a fresh position).\n if (abs(pos.x) > half || abs(pos.y) > half || age > 6.0) {\n pos = reseed(seed, age);\n age = 0.0;\n }\n\n particles[idx] = Particle(vec4<f32>(pos, age, seed));\n}\n", y = `
|
|
8
|
+
const PI: f32 = 3.141592653589793;
|
|
9
|
+
const TAU: f32 = 6.283185307179586;
|
|
10
|
+
const FLOW_GRAVITY: f32 = 9.81;
|
|
11
|
+
const MAX_WAVE_COMPONENTS: i32 = 8;
|
|
12
|
+
const MAX_FLOW_STOPS: i32 = 4;
|
|
13
|
+
|
|
14
|
+
struct Particle {
|
|
15
|
+
// (pos.x, pos.y, age, seed)
|
|
16
|
+
data: vec4<f32>,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// ── Render uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──
|
|
20
|
+
struct RenderUniforms {
|
|
21
|
+
// r0: (uTime, uWindSpeed, uCurlStrength, uDomainHalf)
|
|
22
|
+
r0: vec4<f32>,
|
|
23
|
+
// r1: (uDotSize, uDotSizeVelocity, uAspect, uVMax)
|
|
24
|
+
r1: vec4<f32>,
|
|
25
|
+
// ints: (uWaveCount, uStopCount, uParticleCount, _pad)
|
|
26
|
+
ints: vec4<i32>,
|
|
27
|
+
// bg: (background.rgb, hasBackground)
|
|
28
|
+
bg: vec4<f32>,
|
|
29
|
+
// each wave row: (amplitude, wavelength, directionDeg, phase)
|
|
30
|
+
waves: array<vec4<f32>, 8>,
|
|
31
|
+
// each palette stop: linear-sRGB rgb + _pad
|
|
32
|
+
palette: array<vec4<f32>, 4>,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
@group(0) @binding(0) var<uniform> u: RenderUniforms;
|
|
36
|
+
@group(0) @binding(1) var<storage, read> particles: array<Particle>;
|
|
37
|
+
|
|
38
|
+
${r}
|
|
39
|
+
${a}
|
|
40
|
+
|
|
41
|
+
// ── The Gerstner-sum velocity (the SAME transcription as the compute kernel, read here
|
|
42
|
+
// for the per-particle size + color tint — denser-where-calm). ──
|
|
43
|
+
fn gerstnerVelocity(p: vec2<f32>, t: f32) -> vec2<f32> {
|
|
44
|
+
var dhdx = 0.0;
|
|
45
|
+
var dhdy = 0.0;
|
|
46
|
+
let windSpeed = u.r0.y;
|
|
47
|
+
let waveCount = u.ints.x;
|
|
48
|
+
for (var i = 0; i < MAX_WAVE_COMPONENTS; i = i + 1) {
|
|
49
|
+
if (i >= waveCount) { break; }
|
|
50
|
+
let w = u.waves[i];
|
|
51
|
+
let k = TAU / max(w.y, 1e-4);
|
|
52
|
+
let dirRad = w.z * PI / 180.0;
|
|
53
|
+
let d = vec2<f32>(cos(dirRad), sin(dirRad));
|
|
54
|
+
let omega = sqrt(FLOW_GRAVITY * k) * windSpeed;
|
|
55
|
+
let theta = k * (d.x * p.x + d.y * p.y) - omega * t + w.w;
|
|
56
|
+
let akc = w.x * k * cos(theta);
|
|
57
|
+
dhdx = dhdx + akc * d.x;
|
|
58
|
+
dhdy = dhdy + akc * d.y;
|
|
59
|
+
}
|
|
60
|
+
return vec2<f32>(dhdy, -dhdx);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Sample the multi-stop palette (linear-sRGB stops, OKLab mix). t in [0,1].
|
|
64
|
+
fn samplePaletteLin(t: f32) -> vec3<f32> {
|
|
65
|
+
let stopCount = u.ints.y;
|
|
66
|
+
if (stopCount <= 1) { return u.palette[0].rgb; }
|
|
67
|
+
let n = f32(stopCount);
|
|
68
|
+
let ft = clamp(t, 0.0, 1.0) * (n - 1.0);
|
|
69
|
+
let i0 = i32(floor(ft));
|
|
70
|
+
let i1 = min(i0 + 1, stopCount - 1);
|
|
71
|
+
let f = ft - f32(i0);
|
|
72
|
+
let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i0].rgb);
|
|
73
|
+
let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i1].rgb);
|
|
74
|
+
return oklabToLinearSrgb(mix(labA, labB, f));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
struct VSOut {
|
|
78
|
+
@builtin(position) pos: vec4<f32>,
|
|
79
|
+
@location(0) local: vec2<f32>, // [-1,1] billboard-local coords for the soft circle
|
|
80
|
+
@location(1) tint: f32, // velocity-derived color/alpha tint [0,1]
|
|
81
|
+
@location(2) alphaScale: f32, // velocity-derived alpha scale (denser-where-calm)
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
@vertex
|
|
85
|
+
fn vs_main(
|
|
86
|
+
@builtin(vertex_index) vi: u32,
|
|
87
|
+
@builtin(instance_index) ii: u32,
|
|
88
|
+
) -> VSOut {
|
|
89
|
+
// Two-triangle quad corners in billboard-local space.
|
|
90
|
+
var corners = array<vec2<f32>, 6>(
|
|
91
|
+
vec2<f32>(-1.0, -1.0), vec2<f32>(1.0, -1.0), vec2<f32>(-1.0, 1.0),
|
|
92
|
+
vec2<f32>(-1.0, 1.0), vec2<f32>(1.0, -1.0), vec2<f32>(1.0, 1.0),
|
|
93
|
+
);
|
|
94
|
+
let local = corners[vi];
|
|
95
|
+
|
|
96
|
+
let pr = particles[ii].data;
|
|
97
|
+
let p = pr.xy;
|
|
98
|
+
let t = u.r0.x;
|
|
99
|
+
let half = u.r0.w;
|
|
100
|
+
|
|
101
|
+
// Per-particle velocity → size + tint (denser-where-calm: |v| thins the dot).
|
|
102
|
+
let v = gerstnerVelocity(p, t);
|
|
103
|
+
let speed = length(v);
|
|
104
|
+
let vMax = max(u.r1.w, 1e-4);
|
|
105
|
+
let speedNorm = clamp(speed / vMax, 0.0, 1.0);
|
|
106
|
+
let dotSizeVel = u.r1.y;
|
|
107
|
+
// size_i = base · (1 − speedNorm · sizeVel) — calm = larger dot.
|
|
108
|
+
let sizeWorld = u.r1.x * (1.0 - speedNorm * dotSizeVel);
|
|
109
|
+
let alphaScale = 1.0 - speedNorm * 0.35; // calm = denser/brighter
|
|
110
|
+
|
|
111
|
+
// Position the quad at the particle in clip space. Domain [-half,half] → NDC [-1,1];
|
|
112
|
+
// the quad half-extent rides sizeWorld (in the same domain units, aspect-corrected x).
|
|
113
|
+
let aspect = u.r1.z;
|
|
114
|
+
let ndc = p / half;
|
|
115
|
+
let off = local * sizeWorld / half;
|
|
116
|
+
let offX = off.x / max(aspect, 1e-4);
|
|
117
|
+
|
|
118
|
+
var out: VSOut;
|
|
119
|
+
out.pos = vec4<f32>(ndc.x + offX, ndc.y + off.y, 0.0, 1.0);
|
|
120
|
+
out.local = local;
|
|
121
|
+
out.tint = speedNorm;
|
|
122
|
+
out.alphaScale = alphaScale;
|
|
123
|
+
return out;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@fragment
|
|
127
|
+
fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
128
|
+
// Soft circle — radial smoothstep over the billboard-local radius.
|
|
129
|
+
let r = length(in.local);
|
|
130
|
+
let feather = 0.35;
|
|
131
|
+
let mask = 1.0 - smoothstep(1.0 - feather, 1.0, r);
|
|
132
|
+
if (mask < 0.002) { return vec4<f32>(0.0); }
|
|
133
|
+
|
|
134
|
+
let lin = samplePaletteLin(in.tint);
|
|
135
|
+
let alpha = mask * in.alphaScale;
|
|
136
|
+
let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
137
|
+
// Premultiplied-alpha output.
|
|
138
|
+
return vec4<f32>(rgb * alpha, alpha);
|
|
139
|
+
}
|
|
140
|
+
`, b = 9.81, x = Math.PI * 2;
|
|
141
|
+
function S(e) {
|
|
142
|
+
let t = e * Math.PI / 180;
|
|
143
|
+
return {
|
|
144
|
+
x: Math.cos(t),
|
|
145
|
+
y: Math.sin(t)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function C(e, t, n, r) {
|
|
149
|
+
let i = 0, a = 0;
|
|
150
|
+
for (let o of n) {
|
|
151
|
+
let n = x / Math.max(o.wavelength, 1e-4), s = S(o.direction), c = Math.sqrt(b * 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
|
+
i += d * s.x, a += d * s.y;
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
x: a,
|
|
156
|
+
y: -i
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
var w = .012;
|
|
160
|
+
function T(e, t) {
|
|
161
|
+
let n = e * .1031 % 1, r = t * .1031 % 1, i = e * .1031 % 1;
|
|
162
|
+
n < 0 && (n += 1), r < 0 && (r += 1), i < 0 && (i += 1);
|
|
163
|
+
let a = n * (r + 33.33) + r * (i + 33.33) + i * (n + 33.33);
|
|
164
|
+
n += a, r += a, i += a;
|
|
165
|
+
let o = (n + r) * i % 1;
|
|
166
|
+
return o < 0 && (o += 1), o;
|
|
167
|
+
}
|
|
168
|
+
function E(e, t, n) {
|
|
169
|
+
return e + (t - e) * n;
|
|
170
|
+
}
|
|
171
|
+
function D(e, t) {
|
|
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 = T(n, r), l = T(n + 1, r), u = T(n, r + 1), d = T(n + 1, r + 1);
|
|
173
|
+
return E(E(c, l, o), E(u, d, o), s);
|
|
174
|
+
}
|
|
175
|
+
function O(e, t) {
|
|
176
|
+
let n = 0, r = .5, i = 1, a = e, o = t;
|
|
177
|
+
for (let e = 0; e < 3; e++) {
|
|
178
|
+
n += r * D(a * i, o * i);
|
|
179
|
+
let e = .8 * a - .6 * o, t = .6 * a + .8 * o;
|
|
180
|
+
a = e, o = t, i *= 2, r *= .5;
|
|
181
|
+
}
|
|
182
|
+
return n;
|
|
183
|
+
}
|
|
184
|
+
function k(e) {
|
|
185
|
+
let t = O(e.x + w, e.y) - O(e.x - w, e.y), n = O(e.x, e.y + w) - O(e.x, e.y - w), r = t / (2 * w);
|
|
186
|
+
return {
|
|
187
|
+
x: n / (2 * w),
|
|
188
|
+
y: -r
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function A(e, t, n, r, i) {
|
|
192
|
+
let a = C(e, t, n, r);
|
|
193
|
+
if (i <= 0) return a;
|
|
194
|
+
let o = k({
|
|
195
|
+
x: e.x * 1.7 + t * .15,
|
|
196
|
+
y: e.y * 1.7
|
|
197
|
+
});
|
|
198
|
+
return {
|
|
199
|
+
x: a.x + o.x * i,
|
|
200
|
+
y: a.y + o.y * i
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function j(e, t = 6) {
|
|
204
|
+
let n = [], r = 2.4;
|
|
205
|
+
for (let i = 0; i < t; i++) {
|
|
206
|
+
let t = x / r, a = Math.exp(-1 / (t * 1.6) ** 2) / (t * t), o = (i % 2 == 0 ? 1 : -1) * (18 + i * 9);
|
|
207
|
+
n.push({
|
|
208
|
+
amplitude: a * .5,
|
|
209
|
+
wavelength: r,
|
|
210
|
+
direction: e + o,
|
|
211
|
+
phase: i * 1.618033 % x
|
|
212
|
+
}), r *= .62;
|
|
213
|
+
}
|
|
214
|
+
return n;
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/components/custom/dot-flow-field/constants.ts
|
|
218
|
+
var M = 16384, N = 8, P = 4, F = 4e3, I = [{
|
|
219
|
+
L: .92,
|
|
220
|
+
C: .03,
|
|
221
|
+
h: 78
|
|
222
|
+
}, {
|
|
223
|
+
L: .84,
|
|
224
|
+
C: .07,
|
|
225
|
+
h: 62
|
|
226
|
+
}], L = j(35, 6), R = {
|
|
227
|
+
particleCount: F,
|
|
228
|
+
waveComponents: L,
|
|
229
|
+
windDirection: 35,
|
|
230
|
+
windSpeed: 1,
|
|
231
|
+
curlStrength: .6,
|
|
232
|
+
dotSize: 2.4,
|
|
233
|
+
dotSizeVelocity: .5,
|
|
234
|
+
palette: I,
|
|
235
|
+
background: "transparent",
|
|
236
|
+
interactive: !1,
|
|
237
|
+
respectReducedMotion: !0
|
|
238
|
+
}, z = 176, B = {
|
|
239
|
+
p0: 0,
|
|
240
|
+
p1: 4,
|
|
241
|
+
ints: 8,
|
|
242
|
+
waves: 12
|
|
243
|
+
};
|
|
244
|
+
function V() {
|
|
245
|
+
let e = new ArrayBuffer(z);
|
|
246
|
+
return {
|
|
247
|
+
buffer: e,
|
|
248
|
+
f32: new Float32Array(e),
|
|
249
|
+
i32: new Int32Array(e)
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
var H = .85;
|
|
253
|
+
function U(e, t, n, r, i) {
|
|
254
|
+
let { f32: a, i32: o } = e;
|
|
255
|
+
a[B.p0 + 0] = n, a[B.p0 + 1] = r, a[B.p0 + 2] = t.windSpeed, a[B.p0 + 3] = t.curlStrength, a[B.p1 + 0] = H, a[B.p1 + 1] = 0, a[B.p1 + 2] = 0, a[B.p1 + 3] = 0;
|
|
256
|
+
let s = Math.min(t.waveComponents.length, 8);
|
|
257
|
+
return o[B.ints + 0] = s, o[B.ints + 1] = i, o[B.ints + 2] = 0, o[B.ints + 3] = 0, q(a, B.waves, t.waveComponents), e;
|
|
258
|
+
}
|
|
259
|
+
var W = 256, G = {
|
|
260
|
+
r0: 0,
|
|
261
|
+
r1: 4,
|
|
262
|
+
ints: 8,
|
|
263
|
+
bg: 12,
|
|
264
|
+
waves: 16,
|
|
265
|
+
palette: 48
|
|
266
|
+
};
|
|
267
|
+
function K() {
|
|
268
|
+
let e = new ArrayBuffer(W);
|
|
269
|
+
return {
|
|
270
|
+
buffer: e,
|
|
271
|
+
f32: new Float32Array(e),
|
|
272
|
+
i32: new Int32Array(e)
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function ee(e, t) {
|
|
276
|
+
let n = t / (2 * H);
|
|
277
|
+
return e / Math.max(n, 1e-4);
|
|
278
|
+
}
|
|
279
|
+
function te(e, t, n, r, i, a) {
|
|
280
|
+
let { f32: o, i32: c } = e;
|
|
281
|
+
o[G.r0 + 0] = n, o[G.r0 + 1] = t.windSpeed, o[G.r0 + 2] = t.curlStrength, o[G.r0 + 3] = H, o[G.r1 + 0] = ee(t.dotSize, i), o[G.r1 + 1] = t.dotSizeVelocity, o[G.r1 + 2] = r, o[G.r1 + 3] = 2;
|
|
282
|
+
let l = Math.min(t.waveComponents.length, 8), u = Math.min(a.length, 4);
|
|
283
|
+
if (c[G.ints + 0] = l, c[G.ints + 1] = u, c[G.ints + 2] = t.particleCount, c[G.ints + 3] = 0, t.background === "transparent") o[G.bg + 0] = 0, o[G.bg + 1] = 0, o[G.bg + 2] = 0, o[G.bg + 3] = 0;
|
|
284
|
+
else {
|
|
285
|
+
let e = s(t.background);
|
|
286
|
+
o[G.bg + 0] = e[0], o[G.bg + 1] = e[1], o[G.bg + 2] = e[2], o[G.bg + 3] = 1;
|
|
287
|
+
}
|
|
288
|
+
q(o, G.waves, t.waveComponents);
|
|
289
|
+
for (let e = 0; e < 4; e++) {
|
|
290
|
+
let t = G.palette + e * 4, n = s(a[Math.min(e, u - 1)] ?? a[0]);
|
|
291
|
+
o[t + 0] = n[0], o[t + 1] = n[1], o[t + 2] = n[2], o[t + 3] = 0;
|
|
292
|
+
}
|
|
293
|
+
return e;
|
|
294
|
+
}
|
|
295
|
+
function q(e, t, n) {
|
|
296
|
+
for (let r = 0; r < 8; r++) {
|
|
297
|
+
let i = t + r * 4, a = n[r];
|
|
298
|
+
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
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function ne(e) {
|
|
302
|
+
let t = new Float32Array(e * 4);
|
|
303
|
+
for (let n = 0; n < e; n++) {
|
|
304
|
+
let e = (n + 1) * .6180339887, r = Math.sin(e * 71.13) * 43758.5453;
|
|
305
|
+
r -= Math.floor(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;
|
|
310
|
+
}
|
|
311
|
+
return t;
|
|
312
|
+
}
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/components/custom/dot-flow-field/composables/useFlowParticles.ts
|
|
315
|
+
var J = 64, re = 128, Y = 8, X = 1, ie = 2, Z = 4, ae = 64;
|
|
316
|
+
function oe(e) {
|
|
317
|
+
let { canvas: t, config: n, getPalette: r, shouldContinue: i } = e;
|
|
318
|
+
return function(e, a, s) {
|
|
319
|
+
let c = Math.min(Math.max(n.particleCount, 1), M), l = e.createShaderModule({
|
|
320
|
+
label: "[DotFlowField] flow-field.compute.wgsl",
|
|
321
|
+
code: v
|
|
322
|
+
}), u = e.createShaderModule({
|
|
323
|
+
label: "[DotFlowField] flow-field.render.wgsl",
|
|
324
|
+
code: y
|
|
325
|
+
}), d = ne(c), f = e.createBuffer({
|
|
326
|
+
label: "[DotFlowField] particles",
|
|
327
|
+
size: c * 16,
|
|
328
|
+
usage: re | Y,
|
|
329
|
+
mappedAtCreation: !0
|
|
330
|
+
});
|
|
331
|
+
new Float32Array(f.getMappedRange()).set(d), f.unmap();
|
|
332
|
+
let p = e.createBuffer({
|
|
333
|
+
label: "[DotFlowField] compute-uniforms",
|
|
334
|
+
size: V().buffer.byteLength,
|
|
335
|
+
usage: J | Y
|
|
336
|
+
}), m = e.createBuffer({
|
|
337
|
+
label: "[DotFlowField] render-uniforms",
|
|
338
|
+
size: K().buffer.byteLength,
|
|
339
|
+
usage: J | Y
|
|
340
|
+
}), h = e.createBindGroupLayout({
|
|
341
|
+
label: "[DotFlowField] compute-bgl",
|
|
342
|
+
entries: [{
|
|
343
|
+
binding: 0,
|
|
344
|
+
visibility: Z,
|
|
345
|
+
buffer: { type: "uniform" }
|
|
346
|
+
}, {
|
|
347
|
+
binding: 1,
|
|
348
|
+
visibility: Z,
|
|
349
|
+
buffer: { type: "storage" }
|
|
350
|
+
}]
|
|
351
|
+
}), g = e.createComputePipeline({
|
|
352
|
+
label: "[DotFlowField] compute-pipeline",
|
|
353
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [h] }),
|
|
354
|
+
compute: {
|
|
355
|
+
module: l,
|
|
356
|
+
entryPoint: "cs_main"
|
|
357
|
+
}
|
|
358
|
+
}), _ = e.createBindGroup({
|
|
359
|
+
label: "[DotFlowField] compute-bg",
|
|
360
|
+
layout: h,
|
|
361
|
+
entries: [{
|
|
362
|
+
binding: 0,
|
|
363
|
+
resource: { buffer: p }
|
|
364
|
+
}, {
|
|
365
|
+
binding: 1,
|
|
366
|
+
resource: { buffer: f }
|
|
367
|
+
}]
|
|
368
|
+
}), b = e.createBindGroupLayout({
|
|
369
|
+
label: "[DotFlowField] render-bgl",
|
|
370
|
+
entries: [{
|
|
371
|
+
binding: 0,
|
|
372
|
+
visibility: X | ie,
|
|
373
|
+
buffer: { type: "uniform" }
|
|
374
|
+
}, {
|
|
375
|
+
binding: 1,
|
|
376
|
+
visibility: X,
|
|
377
|
+
buffer: { type: "read-only-storage" }
|
|
378
|
+
}]
|
|
379
|
+
}), x = e.createRenderPipeline({
|
|
380
|
+
label: "[DotFlowField] render-pipeline",
|
|
381
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [b] }),
|
|
382
|
+
vertex: {
|
|
383
|
+
module: u,
|
|
384
|
+
entryPoint: "vs_main"
|
|
385
|
+
},
|
|
386
|
+
fragment: {
|
|
387
|
+
module: u,
|
|
388
|
+
entryPoint: "fs_main",
|
|
389
|
+
targets: [{
|
|
390
|
+
format: s,
|
|
391
|
+
blend: {
|
|
392
|
+
color: {
|
|
393
|
+
srcFactor: "one",
|
|
394
|
+
dstFactor: "one-minus-src-alpha",
|
|
395
|
+
operation: "add"
|
|
396
|
+
},
|
|
397
|
+
alpha: {
|
|
398
|
+
srcFactor: "one",
|
|
399
|
+
dstFactor: "one-minus-src-alpha",
|
|
400
|
+
operation: "add"
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}]
|
|
404
|
+
},
|
|
405
|
+
primitive: { topology: "triangle-list" }
|
|
406
|
+
}), S = e.createBindGroup({
|
|
407
|
+
label: "[DotFlowField] render-bg",
|
|
408
|
+
layout: b,
|
|
409
|
+
entries: [{
|
|
410
|
+
binding: 0,
|
|
411
|
+
resource: { buffer: m }
|
|
412
|
+
}, {
|
|
413
|
+
binding: 1,
|
|
414
|
+
resource: { buffer: f }
|
|
415
|
+
}]
|
|
416
|
+
}), C = V(), w = K(), T = -1, E = Math.ceil(c / ae);
|
|
417
|
+
function D() {
|
|
418
|
+
let e = o(), n = t.clientWidth || 320, r = t.clientHeight || 320, i = Math.max(1, Math.round(n * e)), a = Math.max(1, Math.round(r * e));
|
|
419
|
+
(t.width !== i || t.height !== a) && (t.width = i, t.height = a);
|
|
420
|
+
}
|
|
421
|
+
function O(i) {
|
|
422
|
+
let o = T < 0 ? 0 : Math.min(Math.max(i - T, 0), .05);
|
|
423
|
+
T = i;
|
|
424
|
+
let s = Math.min(t.clientWidth || 320, t.clientHeight || 320), l = (t.clientWidth || 320) / Math.max(t.clientHeight || 320, 1);
|
|
425
|
+
U(C, n, i, o, c), e.queue.writeBuffer(p, 0, C.buffer), te(w, n, i, l, s, r()), e.queue.writeBuffer(m, 0, w.buffer);
|
|
426
|
+
let u = e.createCommandEncoder({ label: "[DotFlowField] frame" }), d = u.beginComputePass();
|
|
427
|
+
d.setPipeline(g), d.setBindGroup(0, _), d.dispatchWorkgroups(E), d.end();
|
|
428
|
+
let f = a.getCurrentTexture().createView(), h = u.beginRenderPass({ colorAttachments: [{
|
|
429
|
+
view: f,
|
|
430
|
+
clearValue: {
|
|
431
|
+
r: 0,
|
|
432
|
+
g: 0,
|
|
433
|
+
b: 0,
|
|
434
|
+
a: 0
|
|
435
|
+
},
|
|
436
|
+
loadOp: "clear",
|
|
437
|
+
storeOp: "store"
|
|
438
|
+
}] });
|
|
439
|
+
h.setPipeline(x), h.setBindGroup(0, S), h.draw(6, c, 0, 0), h.end(), e.queue.submit([u.finish()]);
|
|
440
|
+
}
|
|
441
|
+
return {
|
|
442
|
+
frame: O,
|
|
443
|
+
shouldContinue: i,
|
|
444
|
+
resize: D,
|
|
445
|
+
teardown: () => {
|
|
446
|
+
f.destroy(), p.destroy(), m.destroy();
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region src/components/custom/dot-flow-field/shaders/flow-field.glsl.ts
|
|
453
|
+
function Q(e, t) {
|
|
454
|
+
let n = Math.sin(e * 71.13 + t * 13.7) * 43758.5453;
|
|
455
|
+
return n -= Math.floor(n), n;
|
|
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
|
+
});
|
|
473
|
+
}
|
|
474
|
+
let a = e.waveComponents;
|
|
475
|
+
function o(t, o) {
|
|
476
|
+
let s = e.windSpeed, c = e.curlStrength;
|
|
477
|
+
for (let e of r) {
|
|
478
|
+
let r = A(e.pos, o, a, s, c);
|
|
479
|
+
e.pos.x += r.x * t, e.pos.y += r.y * t, e.age += t, (Math.abs(e.pos.x) > n || Math.abs(e.pos.y) > n || e.age > 6) && (e.pos = i(e.seed, e.age), e.age = 0);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function s(t, i, o, s, c) {
|
|
483
|
+
t.clearRect(0, 0, i, o);
|
|
484
|
+
let l = i / 2, u = o / 2, d = Math.min(i, o) / (2 * n);
|
|
485
|
+
t.fillStyle = c;
|
|
486
|
+
let f = e.windSpeed, p = e.curlStrength;
|
|
487
|
+
for (let n of r) {
|
|
488
|
+
let r = A(n.pos, s, a, f, p), i = Math.hypot(r.x, r.y), o = Math.min(i / 2, 1), c = e.dotSize * (1 - o * e.dotSizeVelocity), m = 1 - o * .35, h = l + n.pos.x * d, g = u + n.pos.y * d;
|
|
489
|
+
t.globalAlpha = Math.max(m, .1), t.beginPath(), t.arc(h, g, Math.max(c, .4), 0, Math.PI * 2), t.fill();
|
|
490
|
+
}
|
|
491
|
+
t.globalAlpha = 1;
|
|
492
|
+
}
|
|
493
|
+
return {
|
|
494
|
+
particles: r,
|
|
495
|
+
step: o,
|
|
496
|
+
paint: s
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region src/components/custom/dot-flow-field/composables/useDotFlowField.ts
|
|
501
|
+
function $(t, r) {
|
|
502
|
+
let { config: a, getPalette: o } = r, s = r.mode ?? "live";
|
|
503
|
+
if (i()) {
|
|
504
|
+
let e = null, r = () => {
|
|
505
|
+
let r = t.value;
|
|
506
|
+
return r ? (e || (e = n(r, {
|
|
507
|
+
mode: s,
|
|
508
|
+
respectReducedMotion: a.respectReducedMotion,
|
|
509
|
+
setupWGPU: oe({
|
|
510
|
+
canvas: r,
|
|
511
|
+
config: a,
|
|
512
|
+
getPalette: o,
|
|
513
|
+
shouldContinue: () => !0,
|
|
514
|
+
getReducedMotion: () => e?.reducedMotion ?? !1
|
|
515
|
+
}),
|
|
516
|
+
setupGL: () => ({
|
|
517
|
+
frame: () => {},
|
|
518
|
+
shouldContinue: () => !1,
|
|
519
|
+
resize: () => {}
|
|
520
|
+
})
|
|
521
|
+
}), e.armAsync()), e) : null;
|
|
522
|
+
};
|
|
523
|
+
queueMicrotask(() => r());
|
|
524
|
+
let i = {
|
|
525
|
+
get backend() {
|
|
526
|
+
return r()?.backend ?? "webgpu";
|
|
527
|
+
},
|
|
528
|
+
pause: () => r()?.suspend("manual"),
|
|
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();
|
|
556
|
+
},
|
|
557
|
+
get reducedMotion() {
|
|
558
|
+
return d.reducedMotion;
|
|
559
|
+
},
|
|
560
|
+
dispose: () => d.dispose()
|
|
561
|
+
};
|
|
562
|
+
return m(() => f.dispose()), f;
|
|
563
|
+
}
|
|
564
|
+
//#endregion
|
|
565
|
+
//#region src/components/custom/dot-flow-field/DotFlowField.vue
|
|
566
|
+
var ce = /* @__PURE__ */ t(/* @__PURE__ */ f({
|
|
567
|
+
__name: "DotFlowField",
|
|
568
|
+
props: {
|
|
569
|
+
config: { default: () => R },
|
|
570
|
+
paused: {
|
|
571
|
+
type: Boolean,
|
|
572
|
+
default: !1
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
emits: ["update:paused"],
|
|
576
|
+
setup(e, { expose: t }) {
|
|
577
|
+
let n = g("canvasRef"), r = $(n, {
|
|
578
|
+
config: e.config,
|
|
579
|
+
getPalette: () => e.config.palette
|
|
580
|
+
});
|
|
581
|
+
_(() => e.paused, (e) => e ? r.pause() : r.resume(), { immediate: !0 });
|
|
582
|
+
let i = l(() => {
|
|
583
|
+
let t = e.config.background;
|
|
584
|
+
if (t !== "transparent") return `oklch(${t.L} ${t.C} ${t.h})`;
|
|
585
|
+
});
|
|
586
|
+
return t({
|
|
587
|
+
pause: r.pause,
|
|
588
|
+
resume: r.resume,
|
|
589
|
+
wake: r.wake,
|
|
590
|
+
renderAt: r.renderAt
|
|
591
|
+
}), (e, t) => (h(), u("div", {
|
|
592
|
+
class: "dot-flow-field-wrapper",
|
|
593
|
+
style: p(i.value ? { background: i.value } : void 0)
|
|
594
|
+
}, [d("canvas", {
|
|
595
|
+
ref_key: "canvasRef",
|
|
596
|
+
ref: n,
|
|
597
|
+
class: "dot-flow-field-canvas",
|
|
598
|
+
"aria-hidden": "true",
|
|
599
|
+
"data-testid": "dot-flow-field-canvas"
|
|
600
|
+
}, null, 512)], 4));
|
|
601
|
+
}
|
|
602
|
+
}), [["__scopeId", "data-v-70541ba6"]]);
|
|
603
|
+
//#endregion
|
|
604
|
+
export { R as DEFAULT_FLOW_CONFIG, F as DEFAULT_PARTICLE_COUNT, L as DEFAULT_WAVE_COMPONENTS, ce as DotFlowField, b as FLOW_GRAVITY, P as MAX_FLOW_STOPS, M as MAX_PARTICLES, N as MAX_WAVE_COMPONENTS, I as WARM_IDENTITY_PALETTE, j as buildWaveLadder, k as curlFBM, C as gerstnerVelocity, A as sampleVelocity, $ as useDotFlowField };
|
package/dist/drawer.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components/ui/drawer";
|