@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,788 @@
|
|
|
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 } from "./procedural-color.wgsl-m7Zgv35j.js";
|
|
4
|
+
import { t as i } from "./flow.glsl-B2P7e0MT.js";
|
|
5
|
+
import { a, t as o } from "./useGpuSubstrate-4pTcp6mX.js";
|
|
6
|
+
import { c as s, t as c } from "./color-Cs0-oxYL.js";
|
|
7
|
+
import { computed as l, createElementBlock as u, createElementVNode as d, defineComponent as f, normalizeStyle as p, onMounted as m, onScopeDispose as h, openBlock as g, reactive as _, useTemplateRef as v, watch as y } from "vue";
|
|
8
|
+
//#region src/components/custom/paper-grid/composables/paperGrid.ts
|
|
9
|
+
Math.PI * 2;
|
|
10
|
+
var b = .012;
|
|
11
|
+
function x(e, t) {
|
|
12
|
+
let n = e * .1031 % 1, r = t * .1031 % 1, i = e * .1031 % 1;
|
|
13
|
+
n < 0 && (n += 1), r < 0 && (r += 1), i < 0 && (i += 1);
|
|
14
|
+
let a = n * (r + 33.33) + r * (i + 33.33) + i * (n + 33.33);
|
|
15
|
+
n += a, r += a, i += a;
|
|
16
|
+
let o = (n + r) * i % 1;
|
|
17
|
+
return o < 0 && (o += 1), o;
|
|
18
|
+
}
|
|
19
|
+
function S(e, t, n) {
|
|
20
|
+
return e + (t - e) * n;
|
|
21
|
+
}
|
|
22
|
+
function C(e, t) {
|
|
23
|
+
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 = x(n, r), l = x(n + 1, r), u = x(n, r + 1), d = x(n + 1, r + 1);
|
|
24
|
+
return S(S(c, l, o), S(u, d, o), s);
|
|
25
|
+
}
|
|
26
|
+
function w(e) {
|
|
27
|
+
let t = 0, n = .5, r = 1, i = e.x, a = e.y;
|
|
28
|
+
for (let e = 0; e < 3; e++) {
|
|
29
|
+
t += n * C(i * r, a * r);
|
|
30
|
+
let e = .8 * i - .6 * a, o = .6 * i + .8 * a;
|
|
31
|
+
i = e, a = o, r *= 2, n *= .5;
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
35
|
+
function T(e) {
|
|
36
|
+
let t = w({
|
|
37
|
+
x: e.x + b,
|
|
38
|
+
y: e.y
|
|
39
|
+
}) - w({
|
|
40
|
+
x: e.x - b,
|
|
41
|
+
y: e.y
|
|
42
|
+
}), n = w({
|
|
43
|
+
x: e.x,
|
|
44
|
+
y: e.y + b
|
|
45
|
+
}) - w({
|
|
46
|
+
x: e.x,
|
|
47
|
+
y: e.y - b
|
|
48
|
+
}), r = t / (2 * b);
|
|
49
|
+
return {
|
|
50
|
+
x: n / (2 * b),
|
|
51
|
+
y: -r
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function E(e, t, n, r, i, a, o) {
|
|
55
|
+
let s = T({
|
|
56
|
+
x: e.x * n + t * r,
|
|
57
|
+
y: e.y * n + t * r
|
|
58
|
+
}), c = T({
|
|
59
|
+
x: e.x * i - t * a,
|
|
60
|
+
y: e.y * i - t * a
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
x: s.x * o + c.x * o * .5,
|
|
64
|
+
y: s.y * o + c.y * o * .5
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function D(e, t, n, r) {
|
|
68
|
+
let i = e.x - t.x, a = e.y - t.y, o = Math.hypot(i, a), s = Math.max(r, 1e-4), c = n * Math.exp(-(o * o) / (2 * s * s));
|
|
69
|
+
if (o < 1e-5) return {
|
|
70
|
+
x: 0,
|
|
71
|
+
y: 0
|
|
72
|
+
};
|
|
73
|
+
let l = 1 / o;
|
|
74
|
+
return {
|
|
75
|
+
x: i * l * c,
|
|
76
|
+
y: a * l * c
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function O(e, t, n) {
|
|
80
|
+
let r = t - e, i = Math.abs(r) < 1e-9 ? r < 0 ? -1e-9 : 1e-9 : r, a = Math.min(Math.max((n - e) / i, 0), 1);
|
|
81
|
+
return a * a * (3 - 2 * a);
|
|
82
|
+
}
|
|
83
|
+
function k(e, t, n) {
|
|
84
|
+
return Math.min(Math.max(e, t), n);
|
|
85
|
+
}
|
|
86
|
+
function A(e, t, n) {
|
|
87
|
+
let r = 1 - Math.abs((e.x - Math.floor(e.x)) * 2 - 1), i = 1 - Math.abs((e.y - Math.floor(e.y)) * 2 - 1), a = k(t, n.x, .5), o = k(t, n.y, .5), s = n.x * 1.5, c = n.y * 1.5, l = O(a + s, a - s, r), u = O(o + c, o - c, i);
|
|
88
|
+
return l *= k(t / Math.max(a, 1e-6), 0, 1), u *= k(t / Math.max(o, 1e-6), 0, 1), l = S(l, t, k(n.x * 2 - 1, 0, 1)), u = S(u, t, k(n.y * 2 - 1, 0, 1)), Math.max(l, u);
|
|
89
|
+
}
|
|
90
|
+
function j(e, t, n) {
|
|
91
|
+
let r = {
|
|
92
|
+
x: e.x * n.gridScale,
|
|
93
|
+
y: e.y * n.gridScale
|
|
94
|
+
}, i = E(r, t, n.warpScale, n.warpSpeed, n.warpScale2, n.warpSpeed2, n.amplitude);
|
|
95
|
+
r = {
|
|
96
|
+
x: r.x + i.x,
|
|
97
|
+
y: r.y + i.y
|
|
98
|
+
};
|
|
99
|
+
let a = D(r, n.cursor, n.bulgeStrength * n.bulgeMode, n.bulgeRadius);
|
|
100
|
+
r = {
|
|
101
|
+
x: r.x + a.x,
|
|
102
|
+
y: r.y + a.y
|
|
103
|
+
};
|
|
104
|
+
let o = A(r, n.targetWidth, n.uvDeriv), s = Math.max(n.majorEvery, 1), c = {
|
|
105
|
+
x: r.x / s,
|
|
106
|
+
y: r.y / s
|
|
107
|
+
}, l = {
|
|
108
|
+
x: n.uvDeriv.x / s,
|
|
109
|
+
y: n.uvDeriv.y / s
|
|
110
|
+
}, u = A(c, n.targetWidthMajor, l), d = Math.max(o * n.minorAlpha, u * n.majorAlpha);
|
|
111
|
+
return {
|
|
112
|
+
line: d,
|
|
113
|
+
alpha: d * n.fieldAlpha
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function M(e, t) {
|
|
117
|
+
return e / Math.max(t, 1);
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/components/custom/paper-grid/shaders/paper-grid.wgsl.ts
|
|
121
|
+
var N = `
|
|
122
|
+
const TAU: f32 = 6.283185307179586;
|
|
123
|
+
|
|
124
|
+
// ── Paper-grid uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──
|
|
125
|
+
struct PaperGridUniforms {
|
|
126
|
+
// u0: (uTime, uGridScale, uMinorPitch, uMajorEvery)
|
|
127
|
+
u0: vec4<f32>,
|
|
128
|
+
// warp: (uWarpScale, uWarpSpeed, uWarpScale2, uWarpSpeed2)
|
|
129
|
+
warp: vec4<f32>,
|
|
130
|
+
// warp2: (uAmplitude, uAspect, _pad, _pad)
|
|
131
|
+
warp2: vec4<f32>,
|
|
132
|
+
// grid: (uTargetWidth, uTargetWidthMajor, uMinorAlpha, uMajorAlpha)
|
|
133
|
+
grid: vec4<f32>,
|
|
134
|
+
// field: (uFieldAlpha, uHasBackground, _pad, _pad)
|
|
135
|
+
field: vec4<f32>,
|
|
136
|
+
// cursor: (uCursorX, uCursorY, uBulgeStrength, uBulgeRadius)
|
|
137
|
+
cursor: vec4<f32>,
|
|
138
|
+
// cursor2: (uBulgeMode, uInteractive, _pad, _pad)
|
|
139
|
+
cursor2: vec4<f32>,
|
|
140
|
+
// line: (uLineColor.rgb (linear), _pad)
|
|
141
|
+
line: vec4<f32>,
|
|
142
|
+
// bg: (uBg.rgb (linear), _pad)
|
|
143
|
+
bg: vec4<f32>,
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
@group(0) @binding(0) var<uniform> u: PaperGridUniforms;
|
|
147
|
+
|
|
148
|
+
${n}
|
|
149
|
+
|
|
150
|
+
// ── The host noise basis (transcribes paperGrid.ts hash21/valueNoise/potentialFBM) ──
|
|
151
|
+
// A quintic-faded 2D value-noise fbm potential — the SAME basis the dot-flow-field carries
|
|
152
|
+
// (so the suite speaks ONE noise basis). DECLARED ABOVE the curl splice (WGSL has no forward
|
|
153
|
+
// declaration — a function may only call one declared earlier).
|
|
154
|
+
fn hash21(x: f32, y: f32) -> f32 {
|
|
155
|
+
var px = fract(x * 0.1031);
|
|
156
|
+
var py = fract(y * 0.1031);
|
|
157
|
+
var pz = fract(x * 0.1031);
|
|
158
|
+
let d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);
|
|
159
|
+
px = px + d;
|
|
160
|
+
py = py + d;
|
|
161
|
+
pz = pz + d;
|
|
162
|
+
return fract((px + py) * pz);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
fn valueNoise(x: f32, y: f32) -> f32 {
|
|
166
|
+
let ix = floor(x);
|
|
167
|
+
let iy = floor(y);
|
|
168
|
+
let fx = x - ix;
|
|
169
|
+
let fy = y - iy;
|
|
170
|
+
let ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);
|
|
171
|
+
let uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);
|
|
172
|
+
let a = hash21(ix, iy);
|
|
173
|
+
let b = hash21(ix + 1.0, iy);
|
|
174
|
+
let c = hash21(ix, iy + 1.0);
|
|
175
|
+
let d2 = hash21(ix + 1.0, iy + 1.0);
|
|
176
|
+
return mix(mix(a, b, ux), mix(c, d2, ux), uy);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// The 3-octave scalar fbm potential — the host noise basis the curl operator wraps.
|
|
180
|
+
fn potentialFBM(p: vec2f) -> f32 {
|
|
181
|
+
var v = 0.0;
|
|
182
|
+
var amp = 0.5;
|
|
183
|
+
var freq = 1.0;
|
|
184
|
+
var px = p.x;
|
|
185
|
+
var py = p.y;
|
|
186
|
+
for (var i = 0; i < 3; i = i + 1) {
|
|
187
|
+
v = v + amp * valueNoise(px * freq, py * freq);
|
|
188
|
+
// FBM_ROT mat2(0.8, 0.6, -0.6, 0.8) — same rotation as the shared chunk.
|
|
189
|
+
let rx = 0.8 * px - 0.6 * py;
|
|
190
|
+
let ry = 0.6 * px + 0.8 * py;
|
|
191
|
+
px = rx;
|
|
192
|
+
py = ry;
|
|
193
|
+
freq = freq * 2.0;
|
|
194
|
+
amp = amp * 0.5;
|
|
195
|
+
}
|
|
196
|
+
return v;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// The shared divergence-free 2D-curl operator (flow.wgsl.ts — the FIRST WGSL curl consumer).
|
|
200
|
+
|
|
201
|
+
const CURL_EPS: f32 = 0.012;
|
|
202
|
+
|
|
203
|
+
// ∇×ψ in 2D — the divergence-free flow direction. Central finite differences of the
|
|
204
|
+
// scalar potential give the partials; the cross-pairing (∂y, −∂x) is the 2D curl.
|
|
205
|
+
fn curlFBM(p: vec2f) -> vec2f {
|
|
206
|
+
let dx = potentialFBM(p + vec2f(CURL_EPS, 0.0)) - potentialFBM(p - vec2f(CURL_EPS, 0.0));
|
|
207
|
+
let dy = potentialFBM(p + vec2f(0.0, CURL_EPS)) - potentialFBM(p - vec2f(0.0, CURL_EPS));
|
|
208
|
+
// ψ-gradient is (dx, dy)/(2·eps); the curl rotates it 90°: (∂ψ/∂y, −∂ψ/∂x).
|
|
209
|
+
let g = vec2f(dx, dy) / (2.0 * CURL_EPS);
|
|
210
|
+
return vec2f(g.y, -g.x);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
// ── §3 The "liquid": the global curl-flow domain warp (transcribes paperGrid.ts curlWarp) ──
|
|
215
|
+
// TWO counter-flowing curl terms at different scales/speeds (Alex Harri counter-flow — never
|
|
216
|
+
// visibly loops). A SHALLOW, LOW-frequency warp keeps the lines a clearly-readable grid.
|
|
217
|
+
fn curlWarp(g: vec2f, t: f32) -> vec2f {
|
|
218
|
+
let warpScale = u.warp.x;
|
|
219
|
+
let warpSpeed = u.warp.y;
|
|
220
|
+
let warpScale2 = u.warp.z;
|
|
221
|
+
let warpSpeed2 = u.warp.w;
|
|
222
|
+
let amp = u.warp2.x;
|
|
223
|
+
let a = curlFBM(vec2f(g.x * warpScale + t * warpSpeed, g.y * warpScale + t * warpSpeed));
|
|
224
|
+
let b = curlFBM(vec2f(g.x * warpScale2 - t * warpSpeed2, g.y * warpScale2 - t * warpSpeed2));
|
|
225
|
+
return vec2f(a.x * amp + b.x * amp * 0.5, a.y * amp + b.y * amp * 0.5);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// ── §4 The pointer bulge: a LOCAL Gaussian warp (transcribes paperGrid.ts cursorBulge) ──
|
|
229
|
+
fn cursorBulge(g: vec2f) -> vec2f {
|
|
230
|
+
let cursor = u.cursor.xy;
|
|
231
|
+
let strength = u.cursor.z * u.cursor2.x; // bulgeStrength × bulgeMode (+repel / −attract)
|
|
232
|
+
let radius = max(u.cursor.w, 1e-4);
|
|
233
|
+
let toC = g - cursor;
|
|
234
|
+
let d = length(toC);
|
|
235
|
+
let bulge = strength * exp(-(d * d) / (2.0 * radius * radius));
|
|
236
|
+
if (d < 1e-5) { return vec2f(0.0); }
|
|
237
|
+
return (toC / d) * bulge;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// ── §1 The crisp line: Ben Golus derivative-AA grid coverage (transcribes gridCoverage) ──
|
|
241
|
+
// targetWidth is the line half-width in GRID UNITS (lineWidthPx / minorPitchPx); uvDeriv is
|
|
242
|
+
// the per-axis screen-space derivative of g (length(vec2(dpdx, dpdy)) per axis). Returns
|
|
243
|
+
// line coverage [0..1] — exactly N device-pixels wide at ANY DPR/zoom (the blur-kill).
|
|
244
|
+
fn gridCoverage(g: vec2f, targetWidth: f32, uvDeriv: vec2f) -> f32 {
|
|
245
|
+
// triangle wave per axis: 0 at a line, 1 at the cell center.
|
|
246
|
+
let gridUV = 1.0 - abs(fract(g) * 2.0 - 1.0);
|
|
247
|
+
let drawWidth = clamp(vec2f(targetWidth), uvDeriv, vec2f(0.5));
|
|
248
|
+
let lineAA = uvDeriv * 1.5;
|
|
249
|
+
// smoothstep with edge0 > edge1 (Golus) → a falling edge.
|
|
250
|
+
var grid2 = smoothstep(drawWidth + lineAA, drawWidth - lineAA, gridUV);
|
|
251
|
+
// preserve thin-line intensity where the line is sub-drawWidth.
|
|
252
|
+
grid2 = grid2 * clamp(vec2f(targetWidth) / max(drawWidth, vec2f(1e-6)), vec2f(0.0), vec2f(1.0));
|
|
253
|
+
// Moiré suppression: fade toward the average where the cell packs tighter than a pixel.
|
|
254
|
+
grid2 = mix(grid2, vec2f(targetWidth), clamp(uvDeriv * 2.0 - 1.0, vec2f(0.0), vec2f(1.0)));
|
|
255
|
+
return max(grid2.x, grid2.y);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Full-screen-triangle (the pilot idiom): NDC corners (-1,-1),(3,-1),(-1,3) cover the
|
|
259
|
+
// viewport from a single 3-vertex draw — no vertex buffer.
|
|
260
|
+
struct VSOut {
|
|
261
|
+
@builtin(position) pos: vec4f,
|
|
262
|
+
@location(0) uv: vec2f, // domain [-1,1]², aspect-corrected x
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
@vertex
|
|
266
|
+
fn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {
|
|
267
|
+
var corners = array<vec2f, 3>(
|
|
268
|
+
vec2f(-1.0, -1.0), vec2f(3.0, -1.0), vec2f(-1.0, 3.0),
|
|
269
|
+
);
|
|
270
|
+
let c = corners[vi];
|
|
271
|
+
var out: VSOut;
|
|
272
|
+
out.pos = vec4f(c, 0.0, 1.0);
|
|
273
|
+
out.uv = vec2f(c.x, c.y);
|
|
274
|
+
return out;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@fragment
|
|
278
|
+
fn fs_main(in: VSOut) -> @location(0) vec4f {
|
|
279
|
+
let aspect = max(u.warp2.y, 1e-4);
|
|
280
|
+
// aspect-correct the domain x so the cells read square.
|
|
281
|
+
let uv = vec2f(in.uv.x * aspect, in.uv.y);
|
|
282
|
+
let t = u.u0.x;
|
|
283
|
+
let gridScale = u.u0.y;
|
|
284
|
+
|
|
285
|
+
// §5 the per-pixel kernel: warp + bulge the grid coordinate, then two-tier Golus.
|
|
286
|
+
var g = uv * gridScale;
|
|
287
|
+
g = g + curlWarp(g, t);
|
|
288
|
+
g = g + cursorBulge(g);
|
|
289
|
+
|
|
290
|
+
// The screen-space derivative of g (Golus): length(vec2(dpdx, dpdy)) per axis. fwidth-class
|
|
291
|
+
// derivative reads the ACTUAL backing-store pixel (NOT fwidthFine — Compatibility-Mode safe).
|
|
292
|
+
let dv = vec2f(
|
|
293
|
+
length(vec2f(dpdx(g.x), dpdy(g.x))),
|
|
294
|
+
length(vec2f(dpdx(g.y), dpdy(g.y))),
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
let minor = gridCoverage(g, u.grid.x, dv);
|
|
298
|
+
// The major tier evals at g / majorEvery with its own derivative scaling.
|
|
299
|
+
let me = max(u.u0.w, 1.0);
|
|
300
|
+
let major = gridCoverage(g / me, u.grid.y, dv / me);
|
|
301
|
+
let line = max(minor * u.grid.z, major * u.grid.w);
|
|
302
|
+
|
|
303
|
+
let col = clamp(linearToSrgb(u.line.rgb), vec3f(0.0), vec3f(1.0));
|
|
304
|
+
let hasBg = u.field.y;
|
|
305
|
+
if (hasBg > 0.5) {
|
|
306
|
+
// opaque ground: composite the ink over the themed bg.
|
|
307
|
+
let bg = clamp(linearToSrgb(u.bg.rgb), vec3f(0.0), vec3f(1.0));
|
|
308
|
+
let a = line * u.field.x;
|
|
309
|
+
let outRgb = mix(bg, col, a);
|
|
310
|
+
return vec4f(outRgb, 1.0);
|
|
311
|
+
}
|
|
312
|
+
// transparent ground: the LINE carries the alpha — the page reads through the cells.
|
|
313
|
+
let a = line * u.field.x;
|
|
314
|
+
return vec4f(col * a, a); // premultiplied over transparent
|
|
315
|
+
}
|
|
316
|
+
`, P = {
|
|
317
|
+
u0: 0,
|
|
318
|
+
warp: 4,
|
|
319
|
+
warp2: 8,
|
|
320
|
+
grid: 12,
|
|
321
|
+
field: 16,
|
|
322
|
+
cursor: 20,
|
|
323
|
+
cursor2: 24,
|
|
324
|
+
line: 28,
|
|
325
|
+
bg: 32
|
|
326
|
+
};
|
|
327
|
+
function F() {
|
|
328
|
+
let e = /* @__PURE__ */ new ArrayBuffer(144);
|
|
329
|
+
return {
|
|
330
|
+
buffer: e,
|
|
331
|
+
f32: new Float32Array(e)
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
function I(e, t, n, r, i, a) {
|
|
335
|
+
let { f32: o } = e, c = M(i, t.cellSize);
|
|
336
|
+
o[P.u0 + 0] = n, o[P.u0 + 1] = c, o[P.u0 + 2] = t.cellSize, o[P.u0 + 3] = t.majorEvery;
|
|
337
|
+
let l = t.waveScale, u = t.waveScale * 1.7, d = t.waveSpeed, f = t.waveSpeed * .6;
|
|
338
|
+
o[P.warp + 0] = l, o[P.warp + 1] = d, o[P.warp + 2] = u, o[P.warp + 3] = f, o[P.warp2 + 0] = t.waveAmplitude, o[P.warp2 + 1] = r, o[P.warp2 + 2] = 0, o[P.warp2 + 3] = 0;
|
|
339
|
+
let p = Math.max(t.cellSize, 1), m = t.lineWidth / p, h = t.lineWidth * 1.6 / p;
|
|
340
|
+
o[P.grid + 0] = m, o[P.grid + 1] = h, o[P.grid + 2] = t.minorAlpha, o[P.grid + 3] = t.majorAlpha;
|
|
341
|
+
let g = t.background === "transparent" ? 0 : 1;
|
|
342
|
+
o[P.field + 0] = t.fieldAlpha, o[P.field + 1] = g, o[P.field + 2] = 0, o[P.field + 3] = 0, o[P.cursor + 0] = a.x, o[P.cursor + 1] = a.y, o[P.cursor + 2] = t.bulgeStrength, o[P.cursor + 3] = t.bulgeRadius, o[P.cursor2 + 0] = t.bulgeMode === "attract" ? -1 : 1, o[P.cursor2 + 1] = +!!t.interactive, o[P.cursor2 + 2] = 0, o[P.cursor2 + 3] = 0;
|
|
343
|
+
let _ = s(t.lineColor);
|
|
344
|
+
if (o[P.line + 0] = _[0], o[P.line + 1] = _[1], o[P.line + 2] = _[2], o[P.line + 3] = 0, t.background === "transparent") o[P.bg + 0] = 0, o[P.bg + 1] = 0, o[P.bg + 2] = 0, o[P.bg + 3] = 0;
|
|
345
|
+
else {
|
|
346
|
+
let e = s(t.background);
|
|
347
|
+
o[P.bg + 0] = e[0], o[P.bg + 1] = e[1], o[P.bg + 2] = e[2], o[P.bg + 3] = 0;
|
|
348
|
+
}
|
|
349
|
+
return e;
|
|
350
|
+
}
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/components/custom/paper-grid/composables/paperGridWGPUSetup.ts
|
|
353
|
+
var L = 64, R = 8, z = 2;
|
|
354
|
+
function B(e) {
|
|
355
|
+
let { canvas: t, config: n, getCursor: r, shouldContinue: i, onFrame: o } = e;
|
|
356
|
+
return function(e, s, c) {
|
|
357
|
+
let l = e.createShaderModule({
|
|
358
|
+
label: "[PaperGrid] paper-grid.wgsl",
|
|
359
|
+
code: N
|
|
360
|
+
}), u = F(), d = e.createBuffer({
|
|
361
|
+
label: "[PaperGrid] uniforms",
|
|
362
|
+
size: u.buffer.byteLength,
|
|
363
|
+
usage: L | R
|
|
364
|
+
}), f = e.createBindGroupLayout({
|
|
365
|
+
label: "[PaperGrid] bgl",
|
|
366
|
+
entries: [{
|
|
367
|
+
binding: 0,
|
|
368
|
+
visibility: z,
|
|
369
|
+
buffer: { type: "uniform" }
|
|
370
|
+
}]
|
|
371
|
+
}), p = e.createRenderPipeline({
|
|
372
|
+
label: "[PaperGrid] pipeline",
|
|
373
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [f] }),
|
|
374
|
+
vertex: {
|
|
375
|
+
module: l,
|
|
376
|
+
entryPoint: "vs_main"
|
|
377
|
+
},
|
|
378
|
+
fragment: {
|
|
379
|
+
module: l,
|
|
380
|
+
entryPoint: "fs_main",
|
|
381
|
+
targets: [{
|
|
382
|
+
format: c,
|
|
383
|
+
blend: {
|
|
384
|
+
color: {
|
|
385
|
+
srcFactor: "one",
|
|
386
|
+
dstFactor: "one-minus-src-alpha",
|
|
387
|
+
operation: "add"
|
|
388
|
+
},
|
|
389
|
+
alpha: {
|
|
390
|
+
srcFactor: "one",
|
|
391
|
+
dstFactor: "one-minus-src-alpha",
|
|
392
|
+
operation: "add"
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}]
|
|
396
|
+
},
|
|
397
|
+
primitive: { topology: "triangle-list" }
|
|
398
|
+
}), m = e.createBindGroup({
|
|
399
|
+
label: "[PaperGrid] bg",
|
|
400
|
+
layout: f,
|
|
401
|
+
entries: [{
|
|
402
|
+
binding: 0,
|
|
403
|
+
resource: { buffer: d }
|
|
404
|
+
}]
|
|
405
|
+
});
|
|
406
|
+
function h() {
|
|
407
|
+
let e = a(), n = t.clientWidth || 320, r = t.clientHeight || 320, i = Math.max(1, Math.round(n * e)), o = Math.max(1, Math.round(r * e));
|
|
408
|
+
(t.width !== i || t.height !== o) && (t.width = i, t.height = o);
|
|
409
|
+
}
|
|
410
|
+
function g(i) {
|
|
411
|
+
o?.(i);
|
|
412
|
+
let c = t.clientWidth || 320, l = t.clientHeight || 320;
|
|
413
|
+
I(u, n, i, c / Math.max(l, 1), t.height || Math.round(l * a()), r()), e.queue.writeBuffer(d, 0, u.buffer);
|
|
414
|
+
let f = e.createCommandEncoder({ label: "[PaperGrid] frame" }), h = s.getCurrentTexture().createView(), g = f.beginRenderPass({ colorAttachments: [{
|
|
415
|
+
view: h,
|
|
416
|
+
clearValue: {
|
|
417
|
+
r: 0,
|
|
418
|
+
g: 0,
|
|
419
|
+
b: 0,
|
|
420
|
+
a: 0
|
|
421
|
+
},
|
|
422
|
+
loadOp: "clear",
|
|
423
|
+
storeOp: "store"
|
|
424
|
+
}] });
|
|
425
|
+
g.setPipeline(p), g.setBindGroup(0, m), g.draw(3, 1, 0, 0), g.end(), e.queue.submit([f.finish()]);
|
|
426
|
+
}
|
|
427
|
+
return {
|
|
428
|
+
frame: g,
|
|
429
|
+
shouldContinue: i,
|
|
430
|
+
resize: h,
|
|
431
|
+
teardown: () => {
|
|
432
|
+
d.destroy();
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/components/custom/paper-grid/shaders/paper-grid.glsl.ts
|
|
439
|
+
var V = "#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}", H = `#version 300 es
|
|
440
|
+
precision highp float;
|
|
441
|
+
|
|
442
|
+
#define TAU 6.283185307179586
|
|
443
|
+
|
|
444
|
+
in vec2 vUv;
|
|
445
|
+
out vec4 fragColor;
|
|
446
|
+
|
|
447
|
+
uniform float uTime;
|
|
448
|
+
uniform float uGridScale;
|
|
449
|
+
uniform float uMajorEvery;
|
|
450
|
+
uniform float uAspect;
|
|
451
|
+
uniform vec4 uWarp; // (warpScale, warpSpeed, warpScale2, warpSpeed2)
|
|
452
|
+
uniform float uAmplitude;
|
|
453
|
+
uniform vec4 uGrid; // (targetWidth, targetWidthMajor, minorAlpha, majorAlpha)
|
|
454
|
+
uniform float uFieldAlpha;
|
|
455
|
+
uniform float uHasBackground;
|
|
456
|
+
uniform vec4 uCursor; // (cursorX, cursorY, bulgeStrength, bulgeRadius)
|
|
457
|
+
uniform float uBulgeMode; // +1 repel / −1 attract
|
|
458
|
+
uniform vec3 uLineColor; // linear-sRGB ink
|
|
459
|
+
uniform vec3 uBg; // linear-sRGB themed bg
|
|
460
|
+
|
|
461
|
+
${r}
|
|
462
|
+
|
|
463
|
+
// The shared divergence-free 2D-curl operator (flow.glsl.ts) — the prototype declares
|
|
464
|
+
// potentialFBM; the host defines its BODY below the splice (GLSL forward-declaration).
|
|
465
|
+
${i}
|
|
466
|
+
|
|
467
|
+
// ── The host noise basis (transcribes paperGrid.ts hash21/valueNoise/potentialFBM) ──
|
|
468
|
+
float hash21(float x, float y) {
|
|
469
|
+
float px = fract(x * 0.1031);
|
|
470
|
+
float py = fract(y * 0.1031);
|
|
471
|
+
float pz = fract(x * 0.1031);
|
|
472
|
+
float d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);
|
|
473
|
+
px += d;
|
|
474
|
+
py += d;
|
|
475
|
+
pz += d;
|
|
476
|
+
return fract((px + py) * pz);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
float valueNoise(float x, float y) {
|
|
480
|
+
float ix = floor(x);
|
|
481
|
+
float iy = floor(y);
|
|
482
|
+
float fx = x - ix;
|
|
483
|
+
float fy = y - iy;
|
|
484
|
+
float ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);
|
|
485
|
+
float uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);
|
|
486
|
+
float a = hash21(ix, iy);
|
|
487
|
+
float b = hash21(ix + 1.0, iy);
|
|
488
|
+
float c = hash21(ix, iy + 1.0);
|
|
489
|
+
float d2 = hash21(ix + 1.0, iy + 1.0);
|
|
490
|
+
return mix(mix(a, b, ux), mix(c, d2, ux), uy);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// The 3-octave scalar fbm potential — the curl chunk's forward-declared potentialFBM body.
|
|
494
|
+
float potentialFBM(vec2 p) {
|
|
495
|
+
float v = 0.0;
|
|
496
|
+
float amp = 0.5;
|
|
497
|
+
float freq = 1.0;
|
|
498
|
+
float px = p.x;
|
|
499
|
+
float py = p.y;
|
|
500
|
+
for (int i = 0; i < 3; i++) {
|
|
501
|
+
v += amp * valueNoise(px * freq, py * freq);
|
|
502
|
+
// FBM_ROT mat2(0.8, 0.6, -0.6, 0.8) — same rotation as the shared chunk.
|
|
503
|
+
float rx = 0.8 * px - 0.6 * py;
|
|
504
|
+
float ry = 0.6 * px + 0.8 * py;
|
|
505
|
+
px = rx;
|
|
506
|
+
py = ry;
|
|
507
|
+
freq *= 2.0;
|
|
508
|
+
amp *= 0.5;
|
|
509
|
+
}
|
|
510
|
+
return v;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// ── §3 The global curl-flow domain warp (transcribes paperGrid.ts curlWarp) ──
|
|
514
|
+
vec2 curlWarp(vec2 g, float t) {
|
|
515
|
+
float warpScale = uWarp.x;
|
|
516
|
+
float warpSpeed = uWarp.y;
|
|
517
|
+
float warpScale2 = uWarp.z;
|
|
518
|
+
float warpSpeed2 = uWarp.w;
|
|
519
|
+
vec2 a = curlFBM(vec2(g.x * warpScale + t * warpSpeed, g.y * warpScale + t * warpSpeed));
|
|
520
|
+
vec2 b = curlFBM(vec2(g.x * warpScale2 - t * warpSpeed2, g.y * warpScale2 - t * warpSpeed2));
|
|
521
|
+
return vec2(a.x * uAmplitude + b.x * uAmplitude * 0.5, a.y * uAmplitude + b.y * uAmplitude * 0.5);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// ── §4 The local pointer bulge (transcribes paperGrid.ts cursorBulge) ──
|
|
525
|
+
vec2 cursorBulge(vec2 g) {
|
|
526
|
+
vec2 cursor = uCursor.xy;
|
|
527
|
+
float strength = uCursor.z * uBulgeMode; // bulgeStrength × bulgeMode (+repel / −attract)
|
|
528
|
+
float radius = max(uCursor.w, 1e-4);
|
|
529
|
+
vec2 toC = g - cursor;
|
|
530
|
+
float d = length(toC);
|
|
531
|
+
float bulge = strength * exp(-(d * d) / (2.0 * radius * radius));
|
|
532
|
+
if (d < 1e-5) return vec2(0.0);
|
|
533
|
+
return (toC / d) * bulge;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// ── §1 The Ben Golus derivative-AA grid coverage (transcribes paperGrid.ts gridCoverage) ──
|
|
537
|
+
float gridCoverage(vec2 g, float targetWidth, vec2 uvDeriv) {
|
|
538
|
+
vec2 gridUV = 1.0 - abs(fract(g) * 2.0 - 1.0);
|
|
539
|
+
vec2 drawWidth = clamp(vec2(targetWidth), uvDeriv, vec2(0.5));
|
|
540
|
+
vec2 lineAA = uvDeriv * 1.5;
|
|
541
|
+
vec2 grid2 = smoothstep(drawWidth + lineAA, drawWidth - lineAA, gridUV);
|
|
542
|
+
grid2 *= clamp(vec2(targetWidth) / max(drawWidth, vec2(1e-6)), vec2(0.0), vec2(1.0));
|
|
543
|
+
grid2 = mix(grid2, vec2(targetWidth), clamp(uvDeriv * 2.0 - 1.0, vec2(0.0), vec2(1.0)));
|
|
544
|
+
return max(grid2.x, grid2.y);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
void main() {
|
|
548
|
+
float aspect = max(uAspect, 1e-4);
|
|
549
|
+
vec2 uv = vec2(vUv.x * aspect, vUv.y);
|
|
550
|
+
|
|
551
|
+
// §5 the per-pixel kernel: warp + bulge the grid coordinate, then two-tier Golus.
|
|
552
|
+
vec2 g = uv * uGridScale;
|
|
553
|
+
g += curlWarp(g, uTime);
|
|
554
|
+
g += cursorBulge(g);
|
|
555
|
+
|
|
556
|
+
// The screen-space derivative of g (Golus): length(vec2(dFdx, dFdy)) per axis (the actual
|
|
557
|
+
// backing-store pixel — NOT a CSS sub-pixel, the blur-kill).
|
|
558
|
+
vec2 dv = vec2(
|
|
559
|
+
length(vec2(dFdx(g.x), dFdy(g.x))),
|
|
560
|
+
length(vec2(dFdx(g.y), dFdy(g.y)))
|
|
561
|
+
);
|
|
562
|
+
|
|
563
|
+
float minor = gridCoverage(g, uGrid.x, dv);
|
|
564
|
+
float me = max(uMajorEvery, 1.0);
|
|
565
|
+
float major = gridCoverage(g / me, uGrid.y, dv / me);
|
|
566
|
+
float line = max(minor * uGrid.z, major * uGrid.w);
|
|
567
|
+
|
|
568
|
+
vec3 col = clamp(linearToSrgb(uLineColor), vec3(0.0), vec3(1.0));
|
|
569
|
+
if (uHasBackground > 0.5) {
|
|
570
|
+
vec3 bg = clamp(linearToSrgb(uBg), vec3(0.0), vec3(1.0));
|
|
571
|
+
float a = line * uFieldAlpha;
|
|
572
|
+
fragColor = vec4(mix(bg, col, a), 1.0);
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
float a = line * uFieldAlpha;
|
|
576
|
+
fragColor = vec4(col * a, a); // premultiplied over transparent
|
|
577
|
+
}`;
|
|
578
|
+
//#endregion
|
|
579
|
+
//#region src/components/custom/paper-grid/composables/paperGridGLSetup.ts
|
|
580
|
+
function U(e, t, n) {
|
|
581
|
+
let r = e.createShader(t);
|
|
582
|
+
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
583
|
+
let t = e.getShaderInfoLog(r);
|
|
584
|
+
throw e.deleteShader(r), Error(`[PaperGrid] shader compile failed: ${t}`);
|
|
585
|
+
}
|
|
586
|
+
return r;
|
|
587
|
+
}
|
|
588
|
+
function W(e) {
|
|
589
|
+
let { canvas: t, config: n, getCursor: r, shouldContinue: i, onFrame: o } = e;
|
|
590
|
+
return function(e) {
|
|
591
|
+
let c = U(e, e.VERTEX_SHADER, V), l = U(e, e.FRAGMENT_SHADER, H), u = e.createProgram();
|
|
592
|
+
if (e.attachShader(u, c), e.attachShader(u, l), e.linkProgram(u), !e.getProgramParameter(u, e.LINK_STATUS)) throw Error(`[PaperGrid] link failed: ${e.getProgramInfoLog(u)}`);
|
|
593
|
+
e.deleteShader(c), e.deleteShader(l);
|
|
594
|
+
let d = e.createVertexArray();
|
|
595
|
+
e.bindVertexArray(d);
|
|
596
|
+
let f = e.createBuffer();
|
|
597
|
+
e.bindBuffer(e.ARRAY_BUFFER, f), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
|
|
598
|
+
-1,
|
|
599
|
+
-1,
|
|
600
|
+
3,
|
|
601
|
+
-1,
|
|
602
|
+
-1,
|
|
603
|
+
3
|
|
604
|
+
]), e.STATIC_DRAW);
|
|
605
|
+
let p = e.getAttribLocation(u, "aPosition");
|
|
606
|
+
e.enableVertexAttribArray(p), e.vertexAttribPointer(p, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
|
|
607
|
+
let m = (t) => e.getUniformLocation(u, t), h = m("uTime"), g = m("uGridScale"), _ = m("uMajorEvery"), v = m("uAspect"), y = m("uWarp"), b = m("uAmplitude"), x = m("uGrid"), S = m("uFieldAlpha"), C = m("uHasBackground"), w = m("uCursor"), T = m("uBulgeMode"), E = m("uLineColor"), D = m("uBg");
|
|
608
|
+
function O() {
|
|
609
|
+
let n = a(), r = t.clientWidth || 320, i = t.clientHeight || 320, o = Math.max(1, Math.round(r * n)), s = Math.max(1, Math.round(i * n));
|
|
610
|
+
(t.width !== o || t.height !== s) && (t.width = o, t.height = s), e.viewport(0, 0, t.width, t.height);
|
|
611
|
+
}
|
|
612
|
+
function k(i) {
|
|
613
|
+
o?.(i);
|
|
614
|
+
let c = t.clientWidth || 320, l = t.clientHeight || 320, f = c / Math.max(l, 1), p = M(t.height || Math.round(l * a()), n.cellSize);
|
|
615
|
+
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, p), e.uniform1f(_, n.majorEvery), e.uniform1f(v, f);
|
|
616
|
+
let m = n.waveScale, O = n.waveScale * 1.7, k = n.waveSpeed, A = n.waveSpeed * .6;
|
|
617
|
+
e.uniform4f(y, m, k, O, A), e.uniform1f(b, n.waveAmplitude);
|
|
618
|
+
let j = Math.max(n.cellSize, 1), N = n.lineWidth / j, P = n.lineWidth * 1.6 / j;
|
|
619
|
+
e.uniform4f(x, N, P, n.minorAlpha, n.majorAlpha), e.uniform1f(S, n.fieldAlpha);
|
|
620
|
+
let F = r();
|
|
621
|
+
e.uniform4f(w, F.x, F.y, n.bulgeStrength, n.bulgeRadius), e.uniform1f(T, n.bulgeMode === "attract" ? -1 : 1);
|
|
622
|
+
let I = s(n.lineColor);
|
|
623
|
+
if (e.uniform3f(E, I[0], I[1], I[2]), n.background === "transparent") e.uniform1f(C, 0), e.uniform3f(D, 0, 0, 0);
|
|
624
|
+
else {
|
|
625
|
+
e.uniform1f(C, 1);
|
|
626
|
+
let t = s(n.background);
|
|
627
|
+
e.uniform3f(D, t[0], t[1], t[2]);
|
|
628
|
+
}
|
|
629
|
+
e.drawArrays(e.TRIANGLES, 0, 3), e.bindVertexArray(null);
|
|
630
|
+
}
|
|
631
|
+
return {
|
|
632
|
+
frame: k,
|
|
633
|
+
shouldContinue: i,
|
|
634
|
+
resize: O,
|
|
635
|
+
teardown: () => {
|
|
636
|
+
e.deleteProgram(u), e.deleteVertexArray(d), e.deleteBuffer(f);
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
//#endregion
|
|
642
|
+
//#region src/components/custom/paper-grid/composables/usePaperGrid.ts
|
|
643
|
+
function G(e, n) {
|
|
644
|
+
let { config: r } = n, i = n.mode ?? "live", s = t({ respectReducedMotion: r.respectReducedMotion }), c = {
|
|
645
|
+
x: 1e6,
|
|
646
|
+
y: 1e6
|
|
647
|
+
}, l = () => c, u = 0, d = null;
|
|
648
|
+
function f(t) {
|
|
649
|
+
let n = u > 0 ? (t - u) * 1e3 : 16.7;
|
|
650
|
+
if (u = t, s.tick(n), !r.interactive || !s.active.value) {
|
|
651
|
+
c = {
|
|
652
|
+
x: 1e6,
|
|
653
|
+
y: 1e6
|
|
654
|
+
};
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
let i = e.value, o = i?.clientHeight || 320, l = (i?.clientWidth || 320) / Math.max(o, 1), d = M(i?.height || Math.round(o * a()) || 320, r.cellSize), f = s.smoothedPosition.value, p = s.velocity.value, m = s.burst.value, h = (f.x * 2 - 1) * l, g = -(f.y * 2 - 1), _ = .12 + Math.min(.4, m);
|
|
658
|
+
c = {
|
|
659
|
+
x: (h + p.x * _) * d,
|
|
660
|
+
y: (g - p.y * _) * d
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
let p = () => {
|
|
664
|
+
s.onPointerEnter(), r.interactive && d?.wake();
|
|
665
|
+
}, m = (e) => {
|
|
666
|
+
s.onPointerMove(e), r.interactive && d?.wake();
|
|
667
|
+
}, g = (e) => e.parentElement ?? e;
|
|
668
|
+
function _(e) {
|
|
669
|
+
let t = g(e);
|
|
670
|
+
t.addEventListener("pointermove", m), t.addEventListener("pointerenter", p), t.addEventListener("pointerleave", s.onPointerLeave);
|
|
671
|
+
}
|
|
672
|
+
function v(e) {
|
|
673
|
+
let t = g(e);
|
|
674
|
+
t.removeEventListener("pointermove", m), t.removeEventListener("pointerenter", p), t.removeEventListener("pointerleave", s.onPointerLeave);
|
|
675
|
+
}
|
|
676
|
+
let y = () => {
|
|
677
|
+
let t = e.value;
|
|
678
|
+
return t ? (d || (_(t), d = o(t, {
|
|
679
|
+
mode: i,
|
|
680
|
+
respectReducedMotion: r.respectReducedMotion,
|
|
681
|
+
setupWGPU: B({
|
|
682
|
+
canvas: t,
|
|
683
|
+
config: r,
|
|
684
|
+
getCursor: l,
|
|
685
|
+
shouldContinue: () => !0,
|
|
686
|
+
onFrame: f
|
|
687
|
+
}),
|
|
688
|
+
setupGL: W({
|
|
689
|
+
canvas: t,
|
|
690
|
+
config: r,
|
|
691
|
+
getCursor: l,
|
|
692
|
+
shouldContinue: () => !0,
|
|
693
|
+
onFrame: f
|
|
694
|
+
})
|
|
695
|
+
}), d.armAsync()), d) : null;
|
|
696
|
+
};
|
|
697
|
+
queueMicrotask(() => y());
|
|
698
|
+
let b = {
|
|
699
|
+
get backend() {
|
|
700
|
+
return y()?.backend ?? "webgpu";
|
|
701
|
+
},
|
|
702
|
+
pause: () => y()?.suspend("manual"),
|
|
703
|
+
resume: () => y()?.resume("manual"),
|
|
704
|
+
wake: () => y()?.wake(),
|
|
705
|
+
renderAt: (e) => y()?.renderAt(e),
|
|
706
|
+
get reducedMotion() {
|
|
707
|
+
return d?.reducedMotion ?? !1;
|
|
708
|
+
},
|
|
709
|
+
dispose: () => {
|
|
710
|
+
let t = e.value;
|
|
711
|
+
t && v(t), s.dispose(), d?.dispose();
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
return h(() => b.dispose()), b;
|
|
715
|
+
}
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/components/custom/paper-grid/constants.ts
|
|
718
|
+
var K = 16, q = {
|
|
719
|
+
L: .62,
|
|
720
|
+
C: .05,
|
|
721
|
+
h: 62
|
|
722
|
+
}, J = {
|
|
723
|
+
cellSize: 64,
|
|
724
|
+
majorEvery: 5,
|
|
725
|
+
minorAlpha: .04,
|
|
726
|
+
majorAlpha: .11,
|
|
727
|
+
lineWidth: 1,
|
|
728
|
+
waveAmplitude: .1,
|
|
729
|
+
waveScale: .5,
|
|
730
|
+
waveSpeed: .15,
|
|
731
|
+
fieldAlpha: 1,
|
|
732
|
+
bulgeStrength: .12,
|
|
733
|
+
bulgeRadius: 3,
|
|
734
|
+
bulgeMode: "repel",
|
|
735
|
+
lineColor: q,
|
|
736
|
+
background: "transparent",
|
|
737
|
+
interactive: !0,
|
|
738
|
+
respectReducedMotion: !0
|
|
739
|
+
}, Y = /* @__PURE__ */ e(/* @__PURE__ */ f({
|
|
740
|
+
__name: "PaperGrid",
|
|
741
|
+
props: {
|
|
742
|
+
config: { default: () => J },
|
|
743
|
+
paused: {
|
|
744
|
+
type: Boolean,
|
|
745
|
+
default: !1
|
|
746
|
+
}
|
|
747
|
+
},
|
|
748
|
+
emits: ["update:paused"],
|
|
749
|
+
setup(e, { expose: t }) {
|
|
750
|
+
let n = v("wrapperRef"), r = v("canvasRef"), i = _({ ...e.config });
|
|
751
|
+
y(() => e.config, (e) => Object.assign(i, e), { deep: !0 }), m(() => {
|
|
752
|
+
if (e.config.lineColor === J.lineColor) {
|
|
753
|
+
let e = n.value;
|
|
754
|
+
if (e) {
|
|
755
|
+
let t = getComputedStyle(e).getPropertyValue("--foreground").trim();
|
|
756
|
+
if (t) try {
|
|
757
|
+
i.lineColor = c(t);
|
|
758
|
+
} catch {}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
let a = G(r, { config: i });
|
|
763
|
+
y(() => e.paused, (e) => e ? a.pause() : a.resume(), { immediate: !0 });
|
|
764
|
+
let o = l(() => {
|
|
765
|
+
let t = e.config.background;
|
|
766
|
+
if (t !== "transparent") return `oklch(${t.L} ${t.C} ${t.h})`;
|
|
767
|
+
});
|
|
768
|
+
return t({
|
|
769
|
+
pause: a.pause,
|
|
770
|
+
resume: a.resume,
|
|
771
|
+
wake: a.wake,
|
|
772
|
+
renderAt: a.renderAt
|
|
773
|
+
}), (e, t) => (g(), u("div", {
|
|
774
|
+
ref_key: "wrapperRef",
|
|
775
|
+
ref: n,
|
|
776
|
+
class: "paper-grid-wrapper",
|
|
777
|
+
style: p(o.value ? { background: o.value } : void 0)
|
|
778
|
+
}, [d("canvas", {
|
|
779
|
+
ref_key: "canvasRef",
|
|
780
|
+
ref: r,
|
|
781
|
+
class: "paper-grid-canvas",
|
|
782
|
+
"aria-hidden": "true",
|
|
783
|
+
"data-testid": "paper-grid-canvas"
|
|
784
|
+
}, null, 512)], 4));
|
|
785
|
+
}
|
|
786
|
+
}), [["__scopeId", "data-v-fc108d7d"]]);
|
|
787
|
+
//#endregion
|
|
788
|
+
export { b as CURL_EPS, J as DEFAULT_PAPER_GRID_CONFIG, K as PAPER_GRID_MAX_MAJOR_EVERY, Y as PaperGrid, q as WARM_IDENTITY_INK, T as curlFBM, E as curlWarp, D as cursorBulge, A as gridCoverage, M as gridScaleFor, w as potentialFBM, j as samplePaperGrid, G as usePaperGrid };
|