@mkbabb/glass-ui 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CardAction-CW7a0m8M.js → CardAction-8whJrLWt.js} +23 -8
- package/dist/{CommandShortcut-DvZNQ_HF.js → CommandShortcut-D3yxgHNn.js} +23 -12
- package/dist/{ConfiguratorRow-BR4l-ixA.js → ConfiguratorRow-CaP7U3ZA.js} +11 -11
- package/dist/ContextMenuContent-B3ZsheLV.js +90 -0
- package/dist/{ContextMenuSubContent-xol4sD2q.js → ContextMenuSubContent-DDRID3qC.js} +15 -15
- package/dist/{DataTable-CuKwF7wr.js → DataTable-Bc9kUtu_.js} +2 -2
- package/dist/{DialogContent-DcKK8k9i.js → DialogContent-6JtTB5x2.js} +8 -5
- package/dist/DialogFooter-9phqcRIS.js +80 -0
- package/dist/DialogScrollContent-TTuovQst.js +93 -0
- package/dist/HoverCardContent-Bel1gdLZ.js +88 -0
- package/dist/{IconChip-BTD-nay5.js → IconChip-DhbdGdFQ.js} +1 -1
- package/dist/{IconTooltip-Bl8gFZ8d.js → IconTooltip-B0zimd2H.js} +1 -1
- package/dist/Input-Cg9DF62r.js +57 -0
- package/dist/{Notification-VUwexFUf.js → Notification-CphK7AAm.js} +3 -3
- package/dist/NumberFieldContent-D8cXeyO4.js +140 -0
- package/dist/PagerDots-Cjx96la-.js +98 -0
- package/dist/{SelectScrollDownButton-CrA8F0iV.js → SelectScrollDownButton-DAKCBEdW.js} +62 -57
- package/dist/{SelectSeparator-DXswVdRz.js → SelectSeparator-C2UGOkXF.js} +1 -1
- package/dist/Separator-DQcwC2TR.js +44 -0
- package/dist/Switch-B8RscmRu.js +49 -0
- package/dist/{Toaster-Bw4xR8xV.js → Toaster-D9qIHjBI.js} +1 -1
- package/dist/{ToggleGroupItem-pEM9vIhs.js → ToggleGroupItem-BLtr3TJq.js} +2 -2
- package/dist/TooltipProvider-BJ_Y5EGX.js +109 -0
- package/dist/animated-digit.js +1 -1
- package/dist/api/index.d.ts +15 -32
- package/dist/api/types-extra.d.ts +31 -0
- package/dist/api.js +1 -1
- package/dist/aurora.js +579 -251
- package/dist/border-progress.js +49 -57
- package/dist/{button-DYCUa-tH.js → button-5dY1Dvhd.js} +13 -14
- package/dist/button.js +1 -1
- package/dist/canvas.js +2 -3
- package/dist/card.js +1 -1
- package/dist/carousel.js +20 -20
- package/dist/color-Cs0-oxYL.js +116 -0
- package/dist/color.js +2 -2
- package/dist/command.js +1 -1
- package/dist/completion-seal.d.ts +1 -0
- package/dist/completion-seal.js +89 -0
- package/dist/components/custom/aurora/Aurora.vue.d.ts +10 -5
- package/dist/components/custom/aurora/composables/color.d.ts +13 -0
- package/dist/components/custom/aurora/composables/frameLoop.d.ts +9 -0
- package/dist/components/custom/aurora/composables/runtime.d.ts +12 -0
- package/dist/components/custom/aurora/composables/uniformBridgeWGPU.d.ts +11 -2
- package/dist/components/custom/aurora/composables/wgpuSetup.d.ts +8 -0
- package/dist/components/custom/aurora/constants/presets.d.ts +18 -0
- package/dist/components/custom/aurora/constants/renderMode.d.ts +16 -8
- package/dist/components/custom/aurora/constants/shaders/aurora-mediums.wgsl.d.ts +1 -0
- package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
- package/dist/components/custom/border-progress/composables/spectrum-walk.d.ts +25 -0
- package/dist/components/custom/border-progress/composables/useBorderSpectrum.d.ts +14 -18
- package/dist/components/custom/border-progress/index.d.ts +1 -1
- package/dist/components/custom/completion-seal/CompletionSeal.vue.d.ts +21 -0
- package/dist/components/custom/completion-seal/composables/useCompletionSeal.d.ts +37 -0
- package/dist/components/custom/completion-seal/constants.d.ts +46 -0
- package/dist/components/custom/completion-seal/index.d.ts +4 -0
- package/dist/components/custom/concentric/composables/concentricGLSetup.d.ts +7 -0
- package/dist/components/custom/concentric/composables/concentricWGPUSetup.d.ts +9 -0
- package/dist/components/custom/concentric/composables/ringField.d.ts +57 -16
- package/dist/components/custom/concentric/composables/uniformBridgeWGPU.d.ts +2 -1
- package/dist/components/custom/concentric/composables/useConcentric.d.ts +4 -4
- package/dist/components/custom/concentric/constants.d.ts +30 -6
- package/dist/components/custom/concentric/index.d.ts +2 -2
- package/dist/components/custom/concentric/shaders/concentric.glsl.d.ts +2 -2
- package/dist/components/custom/concentric/shaders/concentric.wgsl.d.ts +1 -1
- package/dist/components/custom/confirm-dialog/ConfirmDialog.vue.d.ts +3 -3
- package/dist/components/custom/constellation/Constellation.vue.d.ts +5 -4
- package/dist/components/custom/constellation/composables/constellationGLSetup.d.ts +10 -0
- package/dist/components/custom/constellation/composables/constellationWGPUSetup.d.ts +19 -0
- package/dist/components/custom/constellation/composables/uniformBridgeWGPU.d.ts +66 -0
- package/dist/components/custom/constellation/composables/useConstellation.d.ts +3 -10
- package/dist/components/custom/constellation/constants.d.ts +33 -0
- package/dist/components/custom/constellation/constellationField.d.ts +31 -1
- package/dist/components/custom/constellation/constellationInteraction.d.ts +23 -14
- package/dist/components/custom/constellation/constellationRender.d.ts +25 -0
- package/dist/components/custom/constellation/constellationTypes.d.ts +38 -0
- package/dist/components/custom/constellation/constellationWell.d.ts +15 -0
- package/dist/components/custom/constellation/index.d.ts +5 -5
- package/dist/components/custom/constellation/shaders/constellation-lines.glsl.d.ts +2 -0
- package/dist/components/custom/constellation/shaders/constellation-lines.wgsl.d.ts +1 -0
- package/dist/components/custom/constellation/shaders/constellation-points.glsl.d.ts +2 -0
- package/dist/components/custom/constellation/shaders/constellation-points.wgsl.d.ts +1 -0
- package/dist/components/custom/deck/DeckPager.vue.d.ts +29 -0
- package/dist/components/custom/deck/composables/useDeck.d.ts +27 -0
- package/dist/components/custom/deck/composables/useDeckKeyboard.d.ts +25 -0
- package/dist/components/custom/deck/composables/useDeckSpring.d.ts +22 -0
- package/dist/components/custom/deck/constants.d.ts +14 -0
- package/dist/components/custom/deck/index.d.ts +8 -0
- package/dist/components/custom/dock/DockIconButton.vue.d.ts +12 -0
- package/dist/components/custom/dock/DockStack.vue.d.ts +65 -0
- package/dist/components/custom/dock/GlassDock.vue.d.ts +4 -2
- package/dist/components/custom/dock/composables/dockMorphMeasure.d.ts +80 -0
- package/dist/components/custom/dock/composables/index.d.ts +2 -0
- package/dist/components/custom/dock/composables/useDockSearch.d.ts +85 -0
- package/dist/components/custom/dock/composables/useDockShellProps.d.ts +11 -0
- package/dist/components/custom/dock/constants.d.ts +18 -14
- package/dist/components/custom/dock/index.d.ts +5 -2
- package/dist/components/custom/dot-flow-field/DotFlowField.vue.d.ts +15 -11
- package/dist/components/custom/dot-flow-field/composables/flowField.d.ts +48 -6
- package/dist/components/custom/dot-flow-field/composables/uniformBridgeWGPU.d.ts +23 -8
- package/dist/components/custom/dot-flow-field/composables/useDotFlowField.d.ts +6 -5
- package/dist/components/custom/dot-flow-field/composables/useFlowParticles.d.ts +18 -5
- package/dist/components/custom/dot-flow-field/constants.d.ts +42 -21
- package/dist/components/custom/dot-flow-field/index.d.ts +2 -2
- package/dist/components/custom/dot-flow-field/shaders/flow-field.compute.wgsl.d.ts +1 -1
- package/dist/components/custom/dot-flow-field/shaders/flow-field.glsl.d.ts +4 -20
- package/dist/components/custom/dot-flow-field/shaders/flow-field.render.wgsl.d.ts +1 -1
- package/dist/components/custom/dot-matrix/DotMatrix.vue.d.ts +43 -0
- package/dist/components/custom/dot-matrix/composables/dotMatrixField.d.ts +89 -0
- package/dist/components/custom/dot-matrix/composables/uniformBridgeWGPU.d.ts +52 -0
- package/dist/components/custom/dot-matrix/composables/useDotMatrix.d.ts +34 -0
- package/dist/components/custom/dot-matrix/composables/useDotSphere.d.ts +27 -0
- package/dist/components/custom/dot-matrix/constants.d.ts +58 -0
- package/dist/components/custom/dot-matrix/index.d.ts +5 -0
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.glsl.d.ts +4 -0
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.wgsl.d.ts +1 -0
- package/dist/components/custom/easing/EasingPicker.vue.d.ts +2 -2
- package/dist/components/custom/easing/composables/useEasingPicker.d.ts +5 -0
- package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +11 -0
- package/dist/components/custom/fourier-field/FourierField.vue.d.ts +40 -47
- package/dist/components/custom/fourier-field/composables/fourierFieldGLSetup.d.ts +15 -0
- package/dist/components/custom/fourier-field/composables/fourierFieldWGPUSetup.d.ts +20 -0
- package/dist/components/custom/fourier-field/composables/uniformBridgeWGPU.d.ts +41 -0
- package/dist/components/custom/fourier-field/composables/useFourierField.d.ts +40 -37
- package/dist/components/custom/fourier-field/constants.d.ts +61 -4
- package/dist/components/custom/fourier-field/index.d.ts +23 -18
- package/dist/components/custom/fourier-field/shaders/fourier-field.compute.wgsl.d.ts +1 -0
- package/dist/components/custom/fourier-field/shaders/fourier-field.glsl.d.ts +4 -0
- package/dist/components/custom/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +9 -1
- package/dist/components/custom/goo-blob/constants.d.ts +1 -1
- package/dist/components/custom/goo-blob/index.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/metaball-noise.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/metaball-palette.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/metaball.wgsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/types.d.ts +36 -0
- package/dist/components/custom/goo-dot-matrix/GooDotMatrix.vue.d.ts +49 -0
- package/dist/components/custom/goo-dot-matrix/composables/gooDotLattice.d.ts +24 -0
- package/dist/components/custom/goo-dot-matrix/composables/gooDotSetup.d.ts +50 -0
- package/dist/components/custom/goo-dot-matrix/composables/uniformBridgeWGPU.d.ts +35 -0
- package/dist/components/custom/goo-dot-matrix/composables/useGooDotMatrix.d.ts +31 -0
- package/dist/components/custom/goo-dot-matrix/constants.d.ts +76 -0
- package/dist/components/custom/goo-dot-matrix/index.d.ts +5 -0
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.frag.d.ts +11 -0
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.wgsl.d.ts +3 -0
- package/dist/components/custom/labeled-field/LabeledField.vue.d.ts +21 -2
- package/dist/components/custom/metric-stack/MetricRow.vue.d.ts +15 -0
- package/dist/components/custom/pager-dots/PagerDots.vue.d.ts +9 -0
- package/dist/components/custom/pager-dots/index.d.ts +2 -0
- package/dist/components/custom/pager-dots/pagerWindow.d.ts +9 -0
- package/dist/components/custom/paper-grid/PaperGrid.vue.d.ts +42 -0
- package/dist/components/custom/paper-grid/composables/paperGrid.d.ts +90 -0
- package/dist/components/custom/paper-grid/composables/paperGridGLSetup.d.ts +16 -0
- package/dist/components/custom/paper-grid/composables/paperGridWGPUSetup.d.ts +19 -0
- package/dist/components/custom/paper-grid/composables/uniformBridgeWGPU.d.ts +16 -0
- package/dist/components/custom/paper-grid/composables/usePaperGrid.d.ts +31 -0
- package/dist/components/custom/paper-grid/constants.d.ts +57 -0
- package/dist/components/custom/paper-grid/index.d.ts +5 -0
- package/dist/components/custom/paper-grid/shaders/paper-grid.glsl.d.ts +4 -0
- package/dist/components/custom/paper-grid/shaders/paper-grid.wgsl.d.ts +1 -0
- package/dist/components/custom/search/FuzzySearch.vue.d.ts +8 -2
- package/dist/components/custom/search/SearchBar.vue.d.ts +8 -0
- package/dist/components/custom/search/index.d.ts +2 -0
- package/dist/components/custom/search/searchVariants.d.ts +19 -0
- package/dist/components/custom/selectable-chip/SelectableChip.vue.d.ts +50 -0
- package/dist/components/custom/selectable-chip/index.d.ts +2 -0
- package/dist/components/custom/selectable-chip/selectableChipVariants.d.ts +23 -0
- package/dist/components/custom/split-chars/SplitChars.vue.d.ts +39 -0
- package/dist/components/custom/split-chars/index.d.ts +1 -0
- package/dist/components/custom/tabs/SegmentedTabs.vue.d.ts +8 -6
- package/dist/components/custom/tabs/constants.d.ts +20 -2
- package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +29 -16
- package/dist/components/custom/watercolor-dot/useWatercolorBlob.d.ts +10 -5
- package/dist/components/ui/_shared/index.d.ts +2 -0
- package/dist/components/ui/_shared/useControlSize.d.ts +46 -0
- package/dist/components/ui/button/index.d.ts +1 -1
- package/dist/components/ui/card/Card.vue.d.ts +45 -0
- package/dist/components/ui/card/index.d.ts +1 -1
- package/dist/components/ui/carousel/CarouselNext.vue.d.ts +1 -1
- package/dist/components/ui/carousel/CarouselPrevious.vue.d.ts +1 -1
- package/dist/components/ui/command/CommandDialog.vue.d.ts +9 -3
- package/dist/components/ui/command/CommandList.vue.d.ts +3 -0
- package/dist/components/ui/context-menu/ContextMenuContent.vue.d.ts +5 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +4 -0
- package/dist/components/ui/hover-card/HoverCardContent.vue.d.ts +3 -0
- package/dist/components/ui/input/Input.vue.d.ts +3 -0
- package/dist/components/ui/number-field/NumberFieldInput.vue.d.ts +6 -1
- package/dist/components/ui/select/SelectContent.vue.d.ts +3 -0
- package/dist/components/ui/switch/Switch.vue.d.ts +2 -0
- package/dist/components/ui/textarea/Textarea.vue.d.ts +3 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +3 -0
- package/dist/composables/color/index.d.ts +2 -0
- package/dist/composables/color/useAccentTone.d.ts +34 -0
- package/dist/composables/glass/useVizChoreography.d.ts +123 -0
- package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +10 -0
- package/dist/composables/glass/webgl/shaders/flow.wgsl.d.ts +1 -0
- package/dist/composables/glass/webgpu/index.d.ts +1 -1
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +28 -7
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +1 -0
- package/dist/composables/glass/webgpu/webgpuDevice.d.ts +42 -0
- package/dist/composables/motion/core/index.d.ts +3 -0
- package/dist/composables/motion/scrollReader.d.ts +25 -0
- package/dist/composables/motion/springPresets.d.ts +20 -1
- package/dist/composables/motion/useCharStagger.d.ts +44 -0
- package/dist/composables/motion/useDockCtaReceive.d.ts +31 -6
- package/dist/composables/motion/useScrollChrome.d.ts +58 -0
- package/dist/composables/motion/useScrollTrigger.d.ts +67 -0
- package/dist/composables/motion/useSpringPress.d.ts +5 -5
- package/dist/composables/motion/useStaggerReveal.d.ts +24 -0
- package/dist/composables/sidebar/index.d.ts +4 -1
- package/dist/composables/sidebar/types.d.ts +68 -3
- package/dist/composables/sidebar/useClickDelegate.d.ts +4 -0
- package/dist/composables/sidebar/useLazyLoader.d.ts +5 -0
- package/dist/composables/sidebar/useScrollTo.d.ts +5 -0
- package/dist/composables/virtual/index.d.ts +4 -0
- package/dist/composables/virtual/useVirtualSectionWindow.d.ts +72 -0
- package/dist/composables/virtual/useWindowedStore.d.ts +43 -0
- package/dist/composables/virtual/virtualSectionLayout.d.ts +103 -0
- package/dist/concentric.js +495 -221
- package/dist/configurator.js +2 -2
- package/dist/confirm-dialog.js +62 -47
- package/dist/constellation.js +635 -235
- package/dist/context-menu.js +2 -2
- package/dist/controls.js +1 -1
- package/dist/createCanvasLifecycle-Gh45Ce-p.js +93 -0
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/deck.d.ts +1 -0
- package/dist/deck.js +105 -0
- package/dist/dialog.js +4 -3
- package/dist/dock.js +602 -458
- package/dist/dot-flow-field.js +580 -290
- package/dist/dot-matrix.d.ts +1 -0
- package/dist/dot-matrix.js +630 -0
- package/dist/dotMatrixField-D_x9_1qq.js +48 -0
- package/dist/{dropdown-menu-CofSZuk8.js → dropdown-menu-aJmV5SqE.js} +83 -79
- package/dist/dropdown-menu.js +1 -1
- package/dist/easing.js +188 -176
- package/dist/expandable-container.js +42 -20
- package/dist/fading-scroll.js +1 -1
- package/dist/flow.glsl-B2P7e0MT.js +4 -0
- package/dist/forms.js +62 -60
- package/dist/fourier-field.js +825 -178
- package/dist/fourier-math.js +1 -1
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +145 -104
- package/dist/goo-blob.js +171 -1228
- package/dist/goo-dot-matrix.d.ts +1 -0
- package/dist/goo-dot-matrix.js +591 -0
- package/dist/handmark.js +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/hover-popover.js +1 -1
- package/dist/icon-chip.js +1 -1
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/instrument-chassis.js +1 -1
- package/dist/keyboard.js +1 -1
- package/dist/labeled-field.js +70 -60
- package/dist/metric-cell.js +1 -1
- package/dist/metric-stack.js +11 -2
- package/dist/motion-core.js +54 -32
- package/dist/motion-curves.js +11 -1
- package/dist/motion.js +46 -111
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +2 -91
- package/dist/paper-backdrop.js +1 -1
- package/dist/paper-grid.d.ts +1 -0
- package/dist/paper-grid.js +788 -0
- package/dist/{presets-BW2b-fr1.js → presets-CvOUqtdY.js} +3 -3
- package/dist/{procedural-color.glsl-CIFsJhwI.js → procedural-color.wgsl-m7Zgv35j.js} +2 -2
- package/dist/progress.js +1 -1
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +1 -1
- package/dist/{useCanvas2D-B8w_E3Rr.js → resolveCanvasColor-yPyIpJt9.js} +12 -2
- package/dist/scrollReader-DI1NWxUw.js +42 -0
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +160 -304
- package/dist/select.js +3 -3
- package/dist/selectable-chip.d.ts +1 -0
- package/dist/selectable-chip.js +65 -0
- package/dist/separator.js +1 -1
- package/dist/{sheet-tZMg0E0w.js → sheet-B2flBfLH.js} +2 -2
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +216 -114
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +1 -1
- package/dist/spectrum-walk-BVzA7Biz.js +33 -0
- package/dist/{springPresets-CFQGQfdl.js → springPresets-Ce7OYCm9.js} +12 -6
- package/dist/styles/animations.css +13 -3
- package/dist/styles/cards.css +69 -0
- package/dist/styles/completion-seal.css +131 -0
- package/dist/styles/components.css +2 -3
- package/dist/styles/configurator.css +55 -0
- package/dist/styles/critical-partition.mjs +33 -11
- package/dist/styles/deferred.css +2 -0
- package/dist/styles/dock/cta-seat.css +87 -0
- package/dist/styles/dock/density.css +153 -0
- package/dist/styles/dock/layers.css +55 -7
- package/dist/styles/dock/morph-bridge.css +54 -18
- package/dist/styles/dock/morph.css +41 -33
- package/dist/styles/dock/overflow.css +12 -0
- package/dist/styles/dock/search.css +68 -0
- package/dist/styles/dock/shape.css +124 -0
- package/dist/styles/dock/shell.css +23 -5
- package/dist/styles/dock/stack-rail.css +264 -0
- package/dist/styles/dock-controls/dark-mode-toggle.css +17 -4
- package/dist/styles/dock-controls/icon-button.css +14 -0
- package/dist/styles/dock.css +11 -1
- package/dist/styles/glass/accent-tone.css +66 -0
- package/dist/styles/glass/control-surfaces.css +167 -0
- package/dist/styles/glass/ladder.css +67 -17
- package/dist/styles/glass/rim.css +19 -9
- package/dist/styles/glass/surfaces.css +69 -148
- package/dist/styles/glass.css +10 -0
- package/dist/styles/index.css +15 -0
- package/dist/styles/scroll-chrome.css +123 -0
- package/dist/styles/scroll-driven.css +38 -0
- package/dist/styles/segmented-tabs.css +50 -14
- package/dist/styles/theme/bridges.css +22 -0
- package/dist/styles/theme/radius.css +18 -1
- package/dist/styles/tokens/color-radius.css +13 -3
- package/dist/styles/tokens/dark-arm.css +39 -6
- package/dist/styles/tokens/glass-deep.css +28 -3
- package/dist/styles/tokens/glass-fx.css +44 -1
- package/dist/styles/tokens/glass.css +91 -31
- package/dist/styles/tokens/light-dark.css +1 -1
- package/dist/styles/tokens/offsets.css +27 -0
- package/dist/styles/tokens/property-regs.css +133 -0
- package/dist/styles/tokens/scale-paper.css +73 -29
- package/dist/styles/tokens/scheme-motion.css +44 -6
- package/dist/styles/tokens/sizing-config.css +110 -0
- package/dist/styles/tokens/sizing.css +55 -104
- package/dist/styles/tokens.css +5 -0
- package/dist/styles/typography/semantic.css +18 -5
- package/dist/styles/utilities/a11y-overrides.css +20 -5
- package/dist/styles/utilities/base-misc.css +52 -0
- package/dist/styles/utilities/btn.css +14 -3
- package/dist/styles/utilities/components.css +31 -6
- package/dist/styles/utilities/metal.css +26 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +8 -8
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/toggle-chip.js +10 -10
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/uniformBridgeWGPU-CtAKl45L.js +1204 -0
- package/dist/{useAnimatedNumber-BfUq2bUM.js → useAnimatedNumber-CLrxicG9.js} +1 -1
- package/dist/{useConfiguratorState-DNlOh6c8.js → useConfiguratorState-4xblKfwd.js} +25 -24
- package/dist/useControlSize-SH1UmJCi.js +9 -0
- package/dist/useDockCtaReceive-DfFkmgL1.js +82 -0
- package/dist/{useDragMorph-DgxnsVJz.js → useDragMorph-BUgAC-zK.js} +4 -4
- package/dist/useFuzzySearch-DIhcYtcw.js +177 -0
- package/dist/useGpuSubstrate-4pTcp6mX.js +294 -0
- package/dist/{useLiquidPress-kfb4KX79.js → useLiquidPress-BooG97RY.js} +2 -2
- package/dist/usePointerVelocityField-QLsy3_kv.js +91 -0
- package/dist/useScrollChrome-D66AVP7C.js +258 -0
- package/dist/{useSpringMount-q1amq1SJ.js → useSpringMount-BWDnKIwh.js} +1 -1
- package/dist/useSpringPress-B1-Czp-V.js +36 -0
- package/dist/useViewTransition-CUI1nAgn.js +95 -0
- package/dist/{vendor-CKmzio-i.js → vendor-B2qOlYY3.js} +24 -11
- package/dist/virtual.d.ts +1 -0
- package/dist/virtual.js +225 -0
- package/dist/watercolor-dot.js +116 -73
- package/package.json +127 -7
- package/src/styles/animations.css +13 -3
- package/src/styles/cards.css +69 -0
- package/src/styles/completion-seal.css +131 -0
- package/src/styles/configurator.css +55 -0
- package/src/styles/critical-partition.mjs +33 -11
- package/src/styles/dock/cta-seat.css +87 -0
- package/src/styles/dock/density.css +153 -0
- package/src/styles/dock/layers.css +55 -7
- package/src/styles/dock/morph-bridge.css +54 -18
- package/src/styles/dock/morph.css +41 -33
- package/src/styles/dock/overflow.css +12 -0
- package/src/styles/dock/search.css +68 -0
- package/src/styles/dock/shape.css +124 -0
- package/src/styles/dock/shell.css +23 -5
- package/src/styles/dock/stack-rail.css +264 -0
- package/src/styles/dock-controls/dark-mode-toggle.css +17 -4
- package/src/styles/dock-controls/icon-button.css +14 -0
- package/src/styles/dock.css +11 -1
- package/src/styles/glass/accent-tone.css +66 -0
- package/src/styles/glass/control-surfaces.css +167 -0
- package/src/styles/glass/ladder.css +67 -17
- package/src/styles/glass/rim.css +19 -9
- package/src/styles/glass/surfaces.css +69 -148
- package/src/styles/glass.css +10 -0
- package/src/styles/index.css +15 -0
- package/src/styles/scroll-chrome.css +123 -0
- package/src/styles/scroll-driven.css +38 -0
- package/src/styles/segmented-tabs.css +50 -14
- package/src/styles/theme/bridges.css +22 -0
- package/src/styles/theme/radius.css +18 -1
- package/src/styles/tokens/color-radius.css +13 -3
- package/src/styles/tokens/dark-arm.css +39 -6
- package/src/styles/tokens/glass-deep.css +28 -3
- package/src/styles/tokens/glass-fx.css +44 -1
- package/src/styles/tokens/glass.css +91 -31
- package/src/styles/tokens/light-dark.css +1 -1
- package/src/styles/tokens/offsets.css +27 -0
- package/src/styles/tokens/property-regs.css +133 -0
- package/src/styles/tokens/scale-paper.css +73 -29
- package/src/styles/tokens/scheme-motion.css +44 -6
- package/src/styles/tokens/sizing-config.css +110 -0
- package/src/styles/tokens/sizing.css +55 -104
- package/src/styles/tokens.css +5 -0
- package/src/styles/typography/semantic.css +18 -5
- package/src/styles/utilities/a11y-overrides.css +20 -5
- package/src/styles/utilities/base-misc.css +52 -0
- package/src/styles/utilities/btn.css +14 -3
- package/src/styles/utilities/components.css +31 -6
- package/src/styles/utilities/metal.css +26 -0
- package/dist/ContextMenuContent-uWnVxDab.js +0 -85
- package/dist/DialogFooter-BZNX5aVr.js +0 -165
- package/dist/HoverCardContent-b2uaAMRR.js +0 -83
- package/dist/Input-h9v5LeXf.js +0 -55
- package/dist/NumberFieldContent-Cq7EzX-U.js +0 -138
- package/dist/Separator-pKF0oA4M.js +0 -37
- package/dist/Switch-CwYNf8bo.js +0 -47
- package/dist/TooltipProvider-rzvnXz60.js +0 -104
- package/dist/color-DweYl7pE.js +0 -86
- package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +0 -35
- package/dist/components/custom/constellation/constellationDraw.d.ts +0 -30
- package/dist/components/custom/dock/DockRail.vue.d.ts +0 -89
- package/dist/createCanvasLifecycle-CHD5XrDW.js +0 -82
- package/dist/procedural-color.wgsl-CToRHugY.js +0 -224
- package/dist/resolveCanvasColor-CUyHr5Uu.js +0 -11
- package/dist/styles/dock/rail-extend.css +0 -397
- package/dist/usePointerVelocityField-JbRd5CrM.js +0 -137
- package/dist/useRAFLoop-UYa4zoiN.js +0 -109
- package/dist/useSpringPress-BsqPr7FJ.js +0 -34
- package/src/styles/dock/rail-extend.css +0 -397
- /package/dist/{FadingScroll-DI6hQhT9.js → FadingScroll-DLRbH5Xr.js} +0 -0
- /package/dist/{HoverPopover-CbqbNwgU.js → HoverPopover-BcIxvyqZ.js} +0 -0
- /package/dist/{InstrumentChassis-Bx0F_q5g.js → InstrumentChassis-CxsHSyMj.js} +0 -0
- /package/dist/{PaperBackdrop-Vf3tlpvd.js → PaperBackdrop-CqwjnfLv.js} +0 -0
- /package/dist/{Progress-DctG61iZ.js → Progress-CnqB7gLm.js} +0 -0
- /package/dist/{ScrollingText-yOpBzFYq.js → ScrollingText-CTZbA_cG.js} +0 -0
- /package/dist/{SelectGroup-DwwjicPY.js → SelectGroup-BFiod7X2.js} +0 -0
- /package/dist/{compile-CQEFRTmx.js → compile-nZ1xVYTp.js} +0 -0
- /package/dist/{constants-BPOqYJAm.js → constants--C2DkLW8.js} +0 -0
- /package/dist/{math-BINYmg5z.js → math-Eb0w3LqU.js} +0 -0
- /package/dist/{prng-Za0Rmgag.js → prng-B-d9eYX8.js} +0 -0
- /package/dist/{slider-DVb4HXU-.js → slider-2A0rPn79.js} +0 -0
- /package/dist/{useGlobalDark-C28t0VWJ.js → useGlobalDark-CmjB9E32.js} +0 -0
- /package/dist/{useIntersectionPause-Bj4sPkMh.js → useIntersectionPause-Dbozzjgm.js} +0 -0
- /package/dist/{useInterval-CvK1mL92.js → useInterval-CNdua40W.js} +0 -0
- /package/dist/{useKeyboardShortcuts-BXWXOZ-9.js → useKeyboardShortcuts-BPRp33Im.js} +0 -0
- /package/dist/{useLiquidFlex-mZPMiNXh.js → useLiquidFlex-UmA6LMZu.js} +0 -0
- /package/dist/{useScrollProgress-D7bYU2RK.js → useScrollProgress-c3yxmH6a.js} +0 -0
- /package/dist/{useSortable-DHjtZSEd.js → useSortable-BVqlJRBR.js} +0 -0
- /package/dist/{useTextHighlight-CWEi25hf.js → useTextHighlight-NmBM5V_4.js} +0 -0
- /package/dist/{vReveal-Czsb7zQC.js → vReveal-D9k0jADx.js} +0 -0
- /package/dist/{vSpecular-CQFmLNzA.js → vSpecular-EX7loENl.js} +0 -0
package/dist/constellation.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { t as e } from "./cn-DJXf4yaB.js";
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { t as n } from "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { t } from "./_plugin-vue_export-helper-C1je1s0u.js";
|
|
3
|
+
import { t as n } from "./usePointerVelocityField-QLsy3_kv.js";
|
|
4
|
+
import { a as r, t as i } from "./useGpuSubstrate-4pTcp6mX.js";
|
|
5
|
+
import { n as a, t as o } from "./prng-B-d9eYX8.js";
|
|
6
|
+
import { computed as s, createElementBlock as c, createElementVNode as l, defineComponent as u, getCurrentInstance as d, normalizeClass as f, onMounted as p, onUnmounted as m, openBlock as h, ref as g, unref as _, useTemplateRef as v } from "vue";
|
|
6
7
|
//#region src/components/custom/constellation/constants.ts
|
|
7
|
-
var
|
|
8
|
+
var y = 1280, b = {
|
|
8
9
|
node: "#b4afa3",
|
|
9
10
|
nodeDim: "#cdc8bd",
|
|
10
11
|
line: "#1c1714",
|
|
@@ -14,23 +15,46 @@ var g = 1280, _ = {
|
|
|
14
15
|
accent: "#b35030",
|
|
15
16
|
edgeFloor: 0,
|
|
16
17
|
edgeAccentAlpha: .3
|
|
17
|
-
},
|
|
18
|
-
gain:
|
|
18
|
+
}, x = .55, S = 1, C = {
|
|
19
|
+
gain: 19e3,
|
|
19
20
|
reach: 340,
|
|
20
|
-
ramp:
|
|
21
|
+
ramp: 8,
|
|
21
22
|
maxSpeed: 4,
|
|
22
23
|
soften: 8,
|
|
23
24
|
holdMs: 140
|
|
24
|
-
},
|
|
25
|
+
}, w = 8e3, T = 8e3, E = .14, D = 2600, O = 6e3, k = 8e3, A = .72, j = 256, M = 12, N = 256 * 12, P = .08, F = 1.6, I = 1.6, L = .001, R = .6, z = 11, B = 22, V = .05;
|
|
26
|
+
function H(e, t, n, r) {
|
|
27
|
+
let i = e.well;
|
|
28
|
+
if (!i || !(r > 0)) return;
|
|
29
|
+
let a = Math.min(r, V), o = i.cfg, s = i.target > 0 ? o.ramp : B, c = Math.min(s * a, 1);
|
|
30
|
+
i.strength += (i.target - i.strength) * c, i.strength < L && (i.strength = i.target <= 0 ? 0 : i.strength);
|
|
31
|
+
let { nodes: l } = e, u = o.reach * t, d = u * u, f = o.maxSpeed * t, p = i.target > 0 ? R : z, m = Math.min(p * a, 1), h = i.strength > L && i.x >= 0, g = e.pinnedIndex;
|
|
32
|
+
for (let e = 0; e < l.length; e++) {
|
|
33
|
+
if (e === g) continue;
|
|
34
|
+
let t = l[e];
|
|
35
|
+
if (h) {
|
|
36
|
+
let e = i.x - t.x, n = i.y - t.y, r = e * e + n * n;
|
|
37
|
+
if (r <= d) {
|
|
38
|
+
let s = Math.max(Math.sqrt(r), o.soften), c = o.gain * i.strength / (s * s), l = t.vx + e / s * c * a, u = t.vy + n / s * c * a, d = Math.hypot(l, u);
|
|
39
|
+
d > f && (l = l / d * f, u = u / d * f), t.vx = l, t.vy = u;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
let r = Math.hypot(t.vx, t.vy);
|
|
43
|
+
if (r > 1e-9) {
|
|
44
|
+
let e = (r + (n - r) * m) / r;
|
|
45
|
+
t.vx *= e, t.vy *= e;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
25
49
|
//#endregion
|
|
26
50
|
//#region src/components/custom/constellation/constellationInteraction.ts
|
|
27
|
-
function
|
|
51
|
+
function ee(e) {
|
|
28
52
|
let t = {
|
|
29
|
-
response:
|
|
53
|
+
response: x,
|
|
30
54
|
zeta: 1
|
|
31
|
-
}, n = { ...
|
|
32
|
-
minIdle:
|
|
33
|
-
jitter:
|
|
55
|
+
}, n = { ...C }, r = {
|
|
56
|
+
minIdle: w,
|
|
57
|
+
jitter: T
|
|
34
58
|
};
|
|
35
59
|
if (typeof window > "u") return {
|
|
36
60
|
warp: t,
|
|
@@ -43,38 +67,14 @@ function O(e) {
|
|
|
43
67
|
let r = Number.parseFloat(n);
|
|
44
68
|
return Number.isFinite(r) ? r : t;
|
|
45
69
|
};
|
|
46
|
-
return t.response = a("--constellation-warp-response",
|
|
70
|
+
return t.response = a("--constellation-warp-response", x), t.zeta = a("--constellation-warp-zeta", 1), n.gain = a("--constellation-well-gain", C.gain), n.reach = a("--constellation-well-reach", C.reach), n.ramp = a("--constellation-well-ramp", C.ramp), n.maxSpeed = a("--constellation-well-max-speed", C.maxSpeed), n.holdMs = a("--constellation-well-hold-ms", C.holdMs), r.minIdle = a("--constellation-wander-idle", w), r.jitter = a("--constellation-wander-jitter", T), {
|
|
47
71
|
warp: t,
|
|
48
72
|
well: n,
|
|
49
73
|
wander: r
|
|
50
74
|
};
|
|
51
75
|
}
|
|
52
|
-
var
|
|
53
|
-
function
|
|
54
|
-
let i = e.well;
|
|
55
|
-
if (!i || !(r > 0)) return;
|
|
56
|
-
let a = Math.min(r, P), o = i.cfg, s = i.target > 0 ? o.ramp : M, c = Math.min(s * a, 1);
|
|
57
|
-
i.strength += (i.target - i.strength) * c, i.strength < k && (i.strength = i.target <= 0 ? 0 : i.strength);
|
|
58
|
-
let { nodes: l } = e, u = o.reach * t, d = u * u, f = o.maxSpeed * t, p = i.target > 0 ? A : j, m = Math.min(p * a, 1), h = i.strength > k && i.x >= 0, g = e.pinnedIndex;
|
|
59
|
-
for (let e = 0; e < l.length; e++) {
|
|
60
|
-
if (e === g) continue;
|
|
61
|
-
let t = l[e];
|
|
62
|
-
if (h) {
|
|
63
|
-
let e = i.x - t.x, n = i.y - t.y, r = e * e + n * n;
|
|
64
|
-
if (r <= d) {
|
|
65
|
-
let s = Math.max(Math.sqrt(r), o.soften), c = o.gain * i.strength / (s * s), l = t.vx + e / s * c * a, u = t.vy + n / s * c * a, d = Math.hypot(l, u);
|
|
66
|
-
d > f && (l = l / d * f, u = u / d * f), t.vx = l, t.vy = u;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
let r = Math.hypot(t.vx, t.vy);
|
|
70
|
-
if (r > 1e-9) {
|
|
71
|
-
let e = (r + (n - r) * m) / r;
|
|
72
|
-
t.vx *= e, t.vy *= e;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
var P = .05;
|
|
77
|
-
function F(e, t, n, r = -1) {
|
|
76
|
+
var te = .05;
|
|
77
|
+
function U(e, t, n, r = -1) {
|
|
78
78
|
let { nodes: i } = e, a = -1, o = Infinity;
|
|
79
79
|
for (let e = 0; e < i.length; e++) {
|
|
80
80
|
if (e === r) continue;
|
|
@@ -83,13 +83,13 @@ function F(e, t, n, r = -1) {
|
|
|
83
83
|
}
|
|
84
84
|
return a;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function W(e, t) {
|
|
87
87
|
let { warp: n, nodes: r } = e;
|
|
88
88
|
if (!n || n.targetIdx < 0 || n.targetIdx >= r.length || !(t > 0)) return;
|
|
89
|
-
let i = Math.min(t,
|
|
89
|
+
let i = Math.min(t, te), a = e.warpCfg?.response ?? .55, o = e.warpCfg?.zeta ?? 1, s = 2 * Math.PI / a, c = r[n.targetIdx], l = -2 * o * s * n.vx - s * s * (n.x - c.x), u = -2 * o * s * n.vy - s * s * (n.y - c.y);
|
|
90
90
|
n.vx += l * i, n.vy += u * i, n.x += n.vx * i, n.y += n.vy * i;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function G(e, t) {
|
|
93
93
|
let { warp: n, nodes: r } = e;
|
|
94
94
|
if (t < 0 || t >= r.length) {
|
|
95
95
|
n.targetIdx = -1, e.focalIndex = -1;
|
|
@@ -97,20 +97,20 @@ function L(e, t) {
|
|
|
97
97
|
}
|
|
98
98
|
e.focalIndex = t, n.targetIdx = t;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
let r =
|
|
100
|
+
function K(e, t, n) {
|
|
101
|
+
let r = U(e, t, n, -1);
|
|
102
102
|
if (r >= 0 && r === e.focalIndex) return e.focalIndex;
|
|
103
|
-
let i =
|
|
104
|
-
return i < 0 ? -1 : (
|
|
103
|
+
let i = U(e, t, n, e.focalIndex);
|
|
104
|
+
return i < 0 ? -1 : (G(e, i), i);
|
|
105
105
|
}
|
|
106
|
-
var
|
|
107
|
-
function
|
|
106
|
+
var ne = 24;
|
|
107
|
+
function q(e) {
|
|
108
108
|
let { warp: t, nodes: n } = e;
|
|
109
109
|
if (!t || t.targetIdx < 0 || t.targetIdx >= n.length) return !0;
|
|
110
110
|
let r = n[t.targetIdx];
|
|
111
|
-
return Math.hypot(t.x - r.x, t.y - r.y) <
|
|
111
|
+
return Math.hypot(t.x - r.x, t.y - r.y) < ne;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function re(e, t) {
|
|
114
114
|
let n = e.nodes.length;
|
|
115
115
|
if (n <= 1) return e.focalIndex;
|
|
116
116
|
let r = e.focalIndex;
|
|
@@ -118,7 +118,7 @@ function V(e, t) {
|
|
|
118
118
|
let i = Math.floor(t() * (n - 1));
|
|
119
119
|
return i < r ? i : i + 1;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function ie(e = {}) {
|
|
122
122
|
return {
|
|
123
123
|
anchorX: 0,
|
|
124
124
|
anchorY: 0,
|
|
@@ -134,10 +134,10 @@ function H(e = {}) {
|
|
|
134
134
|
jitter: e.jitter ?? 8e3
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function ae(e) {
|
|
138
138
|
return e < .5 ? 2 * e * e : 1 - (-2 * e + 2) ** 2 / 2;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function oe(e, t, n) {
|
|
141
141
|
let r = e.pinnedDrift;
|
|
142
142
|
if (!r || e.pinnedIndex < 0 || e.pinnedIndex >= e.nodes.length || !(t > 0)) return;
|
|
143
143
|
let i = e.nodes[e.pinnedIndex];
|
|
@@ -151,12 +151,20 @@ function W(e, t, n) {
|
|
|
151
151
|
let a = r.wanderFrac, o = r.anchorX + (n() * 2 - 1) * a * e.w, s = r.anchorY + (n() * 2 - 1) * a * e.h;
|
|
152
152
|
r.toX = Math.max(.04 * e.w, Math.min(.96 * e.w, o)), r.toY = Math.max(.04 * e.h, Math.min(.96 * e.h, s)), r.legStart = t;
|
|
153
153
|
}
|
|
154
|
-
let a = Math.min((t - r.legStart) / r.durMs, 1), o =
|
|
154
|
+
let a = Math.min((t - r.legStart) / r.durMs, 1), o = ae(a);
|
|
155
155
|
i.x = r.fromX + (r.toX - r.fromX) * o, i.y = r.fromY + (r.toY - r.fromY) * o, a >= 1 && (r.legStart = -1, r.nextAt = t + r.minIdle + n() * r.jitter);
|
|
156
156
|
}
|
|
157
|
+
var se = .45;
|
|
158
|
+
function ce(e, t, n, r) {
|
|
159
|
+
return n >= .45 ? (K(e, t.x, t.y), r.push({
|
|
160
|
+
x: e.warp.x,
|
|
161
|
+
y: e.warp.y,
|
|
162
|
+
start: -1
|
|
163
|
+
}), !0) : !1;
|
|
164
|
+
}
|
|
157
165
|
//#endregion
|
|
158
166
|
//#region src/components/custom/constellation/constellationField.ts
|
|
159
|
-
function
|
|
167
|
+
function le(e, t, n, r, i) {
|
|
160
168
|
let a = [];
|
|
161
169
|
for (let o = 0; o < t; o++) {
|
|
162
170
|
let t = e() * Math.PI * 2;
|
|
@@ -165,48 +173,98 @@ function G(e, t, n, r, i) {
|
|
|
165
173
|
y: e() * r,
|
|
166
174
|
vx: Math.cos(t) * i,
|
|
167
175
|
vy: Math.sin(t) * i,
|
|
168
|
-
r:
|
|
169
|
-
dim: e() < .45
|
|
176
|
+
r: F + e() * I,
|
|
177
|
+
dim: e() < .45,
|
|
178
|
+
z: e()
|
|
170
179
|
});
|
|
171
180
|
}
|
|
172
181
|
return a;
|
|
173
182
|
}
|
|
174
|
-
function
|
|
183
|
+
function ue(e, t, n) {
|
|
175
184
|
if (!(t > 0) || !(n > 0) || t === e.w && n === e.h) return;
|
|
176
185
|
let r = e.w / t, i = e.h / n;
|
|
177
186
|
for (let t of e.nodes) t.x *= r, t.y *= i;
|
|
178
187
|
e.warp.x *= r, e.warp.y *= i;
|
|
179
188
|
}
|
|
180
|
-
function
|
|
181
|
-
let { nodes:
|
|
182
|
-
for (let e = 0; e <
|
|
183
|
-
if (e ===
|
|
184
|
-
let n =
|
|
185
|
-
n.x += n.vx * t, n.y += n.vy * t, n.x < 0 ? (n.x = 0, n.vx *= -1) : n.x >
|
|
189
|
+
function de(e, t, n, r, i = 0, a = 0, o = Math.random, s = null) {
|
|
190
|
+
let { nodes: c, w: l, h: u } = e, d = e.pinnedIndex;
|
|
191
|
+
for (let e = 0; e < c.length; e++) {
|
|
192
|
+
if (e === d) continue;
|
|
193
|
+
let n = c[e];
|
|
194
|
+
n.x += n.vx * t, n.y += n.vy * t, n.x < 0 ? (n.x = 0, n.vx *= -1) : n.x > l && (n.x = l, n.vx *= -1), n.y < 0 ? (n.y = 0, n.vy *= -1) : n.y > u && (n.y = u, n.vy *= -1);
|
|
186
195
|
}
|
|
187
196
|
if (r && r.x >= 0) {
|
|
188
|
-
let e = 180 * t;
|
|
189
|
-
for (let t = 0; t <
|
|
190
|
-
if (t ===
|
|
191
|
-
let i =
|
|
192
|
-
if (
|
|
193
|
-
let t = Math.hypot(i.vx, i.vy) || n, r =
|
|
194
|
-
i.vx =
|
|
197
|
+
let e = 180 * t, i = s ? Math.hypot(s.x, s.y) : 0, a = Math.min(i * .05, .16), o = i > 1e-4 && s ? i : 0, l = o > 0 && s ? s.x / o : 0, u = o > 0 && s ? s.y / o : 0;
|
|
198
|
+
for (let t = 0; t < c.length; t++) {
|
|
199
|
+
if (t === d) continue;
|
|
200
|
+
let i = c[t], o = r.x - i.x, s = r.y - i.y, f = Math.hypot(o, s);
|
|
201
|
+
if (f > .5 && f < e) {
|
|
202
|
+
let t = Math.hypot(i.vx, i.vy) || n, r = 1 - f / e, c = r * .08, d = r * a, p = i.vx + (o / f * c + l * d) * t, m = i.vy + (s / f * c + u * d) * t, h = Math.hypot(p, m) || 1;
|
|
203
|
+
i.vx = p / h * t, i.vy = m / h * t;
|
|
195
204
|
}
|
|
196
205
|
}
|
|
197
206
|
}
|
|
198
|
-
if (
|
|
207
|
+
if (H(e, t, n, i), oe(e, a, o), W(e, i), e.warpAutoRelease && e.warp.targetIdx >= 0 && q(e) && (e.warp.targetIdx = -1), e.wander && a > 0) {
|
|
199
208
|
let t = e.wander;
|
|
200
|
-
t.nextAt < 0 ? t.nextAt = a + t.minIdle + o() * t.jitter : a >= t.nextAt &&
|
|
209
|
+
t.nextAt < 0 ? t.nextAt = a + t.minIdle + o() * t.jitter : a >= t.nextAt && q(e) && (G(e, re(e, o)), t.nextAt = a + t.minIdle + o() * t.jitter);
|
|
201
210
|
}
|
|
202
211
|
}
|
|
212
|
+
function fe(e, t, n = -1, r = Infinity) {
|
|
213
|
+
let { nodes: i, k: a } = e, o = t * a, s = o * o, c = [];
|
|
214
|
+
for (let e = 0; e < i.length; e++) {
|
|
215
|
+
let t = i[e];
|
|
216
|
+
for (let r = e + 1; r < i.length; r++) {
|
|
217
|
+
let a = i[r], o = t.x - a.x, l = t.y - a.y, u = o * o + l * l;
|
|
218
|
+
if (u > s) continue;
|
|
219
|
+
let d = 1 - u / s, f = +(n >= 0 && (e === n || r === n));
|
|
220
|
+
c.push({
|
|
221
|
+
ax: t.x,
|
|
222
|
+
ay: t.y,
|
|
223
|
+
bx: a.x,
|
|
224
|
+
by: a.y,
|
|
225
|
+
alpha: d,
|
|
226
|
+
accent: f,
|
|
227
|
+
focus: 0
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return c.length > r && (c.sort((e, t) => t.alpha - e.alpha), c.length = r), c;
|
|
232
|
+
}
|
|
233
|
+
function pe(e, t, n, r, i = Infinity) {
|
|
234
|
+
if (!r || r.x < 0) return;
|
|
235
|
+
let { nodes: a, k: o } = t, s = n * o, c = s * s;
|
|
236
|
+
for (let t of a) {
|
|
237
|
+
if (e.length >= i) break;
|
|
238
|
+
let n = t.x - r.x, a = t.y - r.y, o = n * n + a * a;
|
|
239
|
+
o > c || e.push({
|
|
240
|
+
ax: r.x,
|
|
241
|
+
ay: r.y,
|
|
242
|
+
bx: t.x,
|
|
243
|
+
by: t.y,
|
|
244
|
+
alpha: 1 - o / c,
|
|
245
|
+
accent: 0,
|
|
246
|
+
focus: 1
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function me(e, t, n, r, i) {
|
|
251
|
+
if (!t || t.x < 0 || i <= 0) return {
|
|
252
|
+
x: e.x,
|
|
253
|
+
y: e.y
|
|
254
|
+
};
|
|
255
|
+
let a = e.z ?? .5, o = n / 2, s = r / 2, c = (t.x - o) / Math.max(n, 1) * i * a * n, l = (t.y - s) / Math.max(r, 1) * i * a * r;
|
|
256
|
+
return {
|
|
257
|
+
x: e.x + c,
|
|
258
|
+
y: e.y + l
|
|
259
|
+
};
|
|
260
|
+
}
|
|
203
261
|
//#endregion
|
|
204
|
-
//#region src/components/custom/constellation/
|
|
205
|
-
function
|
|
262
|
+
//#region src/components/custom/constellation/constellationRender.ts
|
|
263
|
+
function he(e) {
|
|
206
264
|
return Math.max(e.k, e.kFloor ?? .72);
|
|
207
265
|
}
|
|
208
|
-
function
|
|
209
|
-
if (typeof window > "u") return { ...
|
|
266
|
+
function ge(e) {
|
|
267
|
+
if (typeof window > "u") return { ...b };
|
|
210
268
|
let t = getComputedStyle(e), n = (e, n) => t.getPropertyValue(e).trim() || n, r = (e, n) => {
|
|
211
269
|
let r = t.getPropertyValue(e).trim();
|
|
212
270
|
if (!r) return n;
|
|
@@ -214,111 +272,105 @@ function Y(e) {
|
|
|
214
272
|
return Number.isFinite(i) ? i : n;
|
|
215
273
|
};
|
|
216
274
|
return {
|
|
217
|
-
node: n("--constellation-node",
|
|
218
|
-
nodeDim: n("--constellation-node-dim",
|
|
219
|
-
line: n("--constellation-line",
|
|
220
|
-
edgeAlpha: r("--constellation-edge-alpha",
|
|
221
|
-
edgeFocusAlpha: r("--constellation-edge-focus-alpha",
|
|
222
|
-
alpha: r("--constellation-alpha",
|
|
223
|
-
accent: n("--constellation-accent",
|
|
224
|
-
edgeFloor: r("--constellation-edge-floor",
|
|
225
|
-
edgeAccentAlpha: r("--constellation-edge-accent-alpha",
|
|
275
|
+
node: n("--constellation-node", b.node),
|
|
276
|
+
nodeDim: n("--constellation-node-dim", b.nodeDim),
|
|
277
|
+
line: n("--constellation-line", b.line),
|
|
278
|
+
edgeAlpha: r("--constellation-edge-alpha", b.edgeAlpha),
|
|
279
|
+
edgeFocusAlpha: r("--constellation-edge-focus-alpha", b.edgeFocusAlpha),
|
|
280
|
+
alpha: r("--constellation-alpha", b.alpha),
|
|
281
|
+
accent: n("--constellation-accent", b.accent),
|
|
282
|
+
edgeFloor: r("--constellation-edge-floor", b.edgeFloor),
|
|
283
|
+
edgeAccentAlpha: r("--constellation-edge-accent-alpha", b.edgeAccentAlpha)
|
|
226
284
|
};
|
|
227
285
|
}
|
|
228
|
-
function
|
|
229
|
-
let
|
|
230
|
-
|
|
231
|
-
let
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
286
|
+
function J(e) {
|
|
287
|
+
let t = (e || "").trim(), n = t.match(/^#([0-9a-fA-F]{3,8})$/);
|
|
288
|
+
if (n) {
|
|
289
|
+
let e = n[1];
|
|
290
|
+
if (e.length === 3) return [
|
|
291
|
+
parseInt(e[0] + e[0], 16) / 255,
|
|
292
|
+
parseInt(e[1] + e[1], 16) / 255,
|
|
293
|
+
parseInt(e[2] + e[2], 16) / 255,
|
|
294
|
+
1
|
|
295
|
+
];
|
|
296
|
+
if (e.length === 6 || e.length === 8) {
|
|
297
|
+
let t = e.length === 8 ? parseInt(e.slice(6, 8), 16) / 255 : 1;
|
|
298
|
+
return [
|
|
299
|
+
parseInt(e.slice(0, 2), 16) / 255,
|
|
300
|
+
parseInt(e.slice(2, 4), 16) / 255,
|
|
301
|
+
parseInt(e.slice(4, 6), 16) / 255,
|
|
302
|
+
t
|
|
303
|
+
];
|
|
237
304
|
}
|
|
238
305
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
e.globalAlpha = 1;
|
|
249
|
-
}
|
|
250
|
-
function Q(e, t, n, r, i, a = 1) {
|
|
251
|
-
if (!i || i.x < 0) return;
|
|
252
|
-
let { nodes: o, k: s } = t, c = J(t), l = n * s, u = l * l, d = r.edgeFocusAlpha * r.alpha * a;
|
|
253
|
-
e.strokeStyle = r.line, e.lineWidth = 1 * c;
|
|
254
|
-
for (let t of o) {
|
|
255
|
-
let n = t.x - i.x, r = t.y - i.y, a = n * n + r * r;
|
|
256
|
-
a > u || (e.globalAlpha = (1 - a / u) * d, e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(t.x, t.y), e.stroke());
|
|
306
|
+
let r = t.match(/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?\s*\)$/i);
|
|
307
|
+
if (r) {
|
|
308
|
+
let e = r[4] == null ? 1 : _e(r[4]);
|
|
309
|
+
return [
|
|
310
|
+
Y(Number(r[1]) / 255),
|
|
311
|
+
Y(Number(r[2]) / 255),
|
|
312
|
+
Y(Number(r[3]) / 255),
|
|
313
|
+
e
|
|
314
|
+
];
|
|
257
315
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
if (s >= 1) {
|
|
268
|
-
r.splice(t, 1);
|
|
269
|
-
continue;
|
|
270
|
-
}
|
|
271
|
-
e.globalAlpha = (1 - s) * .5 * a, e.lineWidth = 1.4 * o, e.beginPath(), e.arc(i.x, i.y, (8 + s * 130) * o, 0, Math.PI * 2), e.stroke();
|
|
316
|
+
let i = t.match(/^hsla?\(\s*([\d.]+)(?:deg)?[\s,]+([\d.]+)%[\s,]+([\d.]+)%(?:[\s,/]+([\d.]+%?))?\s*\)$/i);
|
|
317
|
+
if (i) {
|
|
318
|
+
let e = i[4] == null ? 1 : _e(i[4]), [t, n, r] = ve(Number(i[1]), Number(i[2]) / 100, Number(i[3]) / 100);
|
|
319
|
+
return [
|
|
320
|
+
t,
|
|
321
|
+
n,
|
|
322
|
+
r,
|
|
323
|
+
e
|
|
324
|
+
];
|
|
272
325
|
}
|
|
273
|
-
|
|
326
|
+
return [
|
|
327
|
+
.11,
|
|
328
|
+
.09,
|
|
329
|
+
.08,
|
|
330
|
+
1
|
|
331
|
+
];
|
|
274
332
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
}, s = () => {
|
|
314
|
-
n !== void 0 && (clearTimeout(n), n = void 0), e.target = 0, o.wake();
|
|
315
|
-
};
|
|
316
|
-
t.addEventListener("pointerdown", i), t.addEventListener("pointermove", a), t.addEventListener("pointerup", s), t.addEventListener("pointerleave", s), t.addEventListener("pointercancel", s);
|
|
317
|
-
}
|
|
333
|
+
function Y(e) {
|
|
334
|
+
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
335
|
+
}
|
|
336
|
+
function _e(e) {
|
|
337
|
+
return Y(e.endsWith("%") ? Number(e.slice(0, -1)) / 100 : Number(e));
|
|
338
|
+
}
|
|
339
|
+
function ve(e, t, n) {
|
|
340
|
+
let r = (e % 360 + 360) % 360, i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(r / 60 % 2 - 1)), o = n - i / 2, s = 0, c = 0, l = 0;
|
|
341
|
+
return r < 60 ? [s, c, l] = [
|
|
342
|
+
i,
|
|
343
|
+
a,
|
|
344
|
+
0
|
|
345
|
+
] : r < 120 ? [s, c, l] = [
|
|
346
|
+
a,
|
|
347
|
+
i,
|
|
348
|
+
0
|
|
349
|
+
] : r < 180 ? [s, c, l] = [
|
|
350
|
+
0,
|
|
351
|
+
i,
|
|
352
|
+
a
|
|
353
|
+
] : r < 240 ? [s, c, l] = [
|
|
354
|
+
0,
|
|
355
|
+
a,
|
|
356
|
+
i
|
|
357
|
+
] : r < 300 ? [s, c, l] = [
|
|
358
|
+
a,
|
|
359
|
+
0,
|
|
360
|
+
i
|
|
361
|
+
] : [s, c, l] = [
|
|
362
|
+
i,
|
|
363
|
+
0,
|
|
364
|
+
a
|
|
365
|
+
], [
|
|
366
|
+
Y(s + o),
|
|
367
|
+
Y(c + o),
|
|
368
|
+
Y(l + o)
|
|
369
|
+
];
|
|
318
370
|
}
|
|
319
371
|
//#endregion
|
|
320
372
|
//#region src/components/custom/constellation/composables/createConstellationField.ts
|
|
321
|
-
function
|
|
373
|
+
function ye(e, t, n = !1, r = !1, i = !1) {
|
|
322
374
|
let a = {
|
|
323
375
|
nodes: [],
|
|
324
376
|
canvas: null,
|
|
@@ -337,7 +389,7 @@ function te(e, t, n = !1, r = !1, i = !1) {
|
|
|
337
389
|
pinnedIndex: n === !1 ? -1 : n === !0 ? 0 : Math.max(0, Math.trunc(n)),
|
|
338
390
|
warpAutoRelease: !!i
|
|
339
391
|
};
|
|
340
|
-
a.pinnedDrift = r ?
|
|
392
|
+
a.pinnedDrift = r ? ie(r === !0 ? {} : r) : void 0;
|
|
341
393
|
let o = e && e !== !0 ? e : {};
|
|
342
394
|
a.wander = e ? {
|
|
343
395
|
nextAt: -1,
|
|
@@ -351,7 +403,7 @@ function te(e, t, n = !1, r = !1, i = !1) {
|
|
|
351
403
|
strength: 0,
|
|
352
404
|
target: 0,
|
|
353
405
|
cfg: {
|
|
354
|
-
...
|
|
406
|
+
...C,
|
|
355
407
|
...s
|
|
356
408
|
}
|
|
357
409
|
} : void 0, {
|
|
@@ -361,92 +413,440 @@ function te(e, t, n = !1, r = !1, i = !1) {
|
|
|
361
413
|
};
|
|
362
414
|
}
|
|
363
415
|
//#endregion
|
|
416
|
+
//#region src/components/custom/constellation/shaders/constellation-points.wgsl.ts
|
|
417
|
+
var be = "\n// ── Node storage row + uniforms (the typed-struct source-of-truth — uniformBridgeWGPU.ts) ──\nstruct Node {\n // (pos.x, pos.y, radius, dim)\n data: vec4<f32>,\n};\n\nstruct ConstellationUniforms {\n // u0: (resolution.x, resolution.y, dpr, kVis)\n u0: vec4<f32>,\n // u1: (time, lineWidth, opacityCeiling, alpha)\n u1: vec4<f32>,\n // uEdge: (edgeAlpha, edgeFocusAlpha, edgeAccentAlpha, edgeFloor)\n uEdge: vec4<f32>,\n // colours (premultiplied-ready rgba)\n uNode: vec4<f32>,\n uNodeDim: vec4<f32>,\n uLine: vec4<f32>,\n uAccent: vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> u: ConstellationUniforms;\n@group(0) @binding(1) var<storage, read> nodes: array<Node>;\n\nstruct VSOut {\n @builtin(position) pos: vec4<f32>,\n @location(0) uv: vec2<f32>, // [-1,1] billboard-local → fragment SDF coord\n @location(1) dim: f32, // 0 = full node, 1 = dim node\n};\n\n@vertex\nfn vs_main(\n @builtin(vertex_index) vIdx: u32,\n @builtin(instance_index) iIdx: u32,\n) -> VSOut {\n // Two-triangle quad corners in billboard-local space.\n var QUAD = array<vec2<f32>, 6>(\n vec2<f32>(-1.0, -1.0), vec2<f32>(1.0, -1.0), vec2<f32>(-1.0, 1.0),\n vec2<f32>(-1.0, 1.0), vec2<f32>(1.0, -1.0), vec2<f32>(1.0, 1.0),\n );\n let corner = QUAD[vIdx];\n\n let node = nodes[iIdx].data;\n let res = u.u0.xy;\n let dpr = u.u0.z;\n let kVis = u.u0.w;\n\n // center: node px → clip space (y-flip — px is y-down, clip is y-up).\n let centerPx = node.xy;\n let centerNdc = vec2<f32>(\n centerPx.x / max(res.x, 1.0) * 2.0 - 1.0,\n 1.0 - centerPx.y / max(res.y, 1.0) * 2.0,\n );\n // half-extent: radius·kVis in CSS px → backing-store px (·dpr) → NDC half (·2/res).\n // (the DPR-aware crispness leg — the disc samples at device resolution.)\n // (half is a WGSL reserved keyword — name it halfExt.)\n let radPx = node.z * kVis * dpr;\n let halfExt = vec2<f32>(radPx / max(res.x, 1.0) * 2.0, radPx / max(res.y, 1.0) * 2.0);\n\n var out: VSOut;\n out.pos = vec4<f32>(centerNdc + corner * halfExt, 0.0, 1.0);\n out.uv = corner;\n out.dim = node.w;\n return out;\n}\n\n@fragment\nfn fs_main(in: VSOut) -> @location(0) vec4<f32> {\n // SDF: distance to the unit-circle edge in billboard-local space (0 at the rim, neg inside).\n let d = length(in.uv) - 1.0;\n // fwidth(d) = |dpdx(d)| + |dpdy(d)| — the pixel footprint of the SDF, the resolution-\n // independent AA width (~1px band at ANY DPR/zoom/size).\n let aa = max(fwidth(d), 1e-4);\n let coverage = 1.0 - smoothstep(-aa, aa, d);\n if (coverage <= 0.0) { discard; }\n let col = mix(u.uNode, u.uNodeDim, in.dim);\n let a = col.a * coverage * u.u1.z; // ·opacityCeiling\n // premultiplied-alpha output.\n return vec4<f32>(col.rgb * a, a);\n}\n", xe = "\nstruct Edge {\n // vec4 0: (a.x, a.y, b.x, b.y)\n ab: vec4<f32>,\n // vec4 1: (alpha, accent, focus, _pad)\n w: vec4<f32>,\n};\n\nstruct ConstellationUniforms {\n // u0: (resolution.x, resolution.y, dpr, kVis)\n u0: vec4<f32>,\n // u1: (time, lineWidth, opacityCeiling, alpha)\n u1: vec4<f32>,\n // uEdge: (edgeAlpha, edgeFocusAlpha, edgeAccentAlpha, edgeFloor)\n uEdge: vec4<f32>,\n uNode: vec4<f32>,\n uNodeDim: vec4<f32>,\n uLine: vec4<f32>,\n uAccent: vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> u: ConstellationUniforms;\n@group(0) @binding(1) var<storage, read> edges: array<Edge>;\n\nstruct VSOut {\n @builtin(position) pos: vec4<f32>,\n @location(0) lineCoord: f32, // [-1,1] cross-line → fragment AA\n @location(1) alpha: f32, // distance-falloff weight\n @location(2) accent: f32, // accent flag (the flagged-node tether tint)\n @location(3) focus: f32, // focus flag (the pointer-web tether)\n};\n\n@vertex\nfn vs_main(\n @builtin(vertex_index) vIdx: u32,\n @builtin(instance_index) iIdx: u32,\n) -> VSOut {\n var QUAD = array<vec2<f32>, 6>(\n vec2<f32>(-1.0, -1.0), vec2<f32>(1.0, -1.0), vec2<f32>(-1.0, 1.0),\n vec2<f32>(-1.0, 1.0), vec2<f32>(1.0, -1.0), vec2<f32>(1.0, 1.0),\n );\n let alongQuad = QUAD[vIdx];\n\n let e = edges[iIdx];\n let a = e.ab.xy;\n let b = e.ab.zw;\n let res = u.u0.xy;\n let dpr = u.u0.z;\n let kVis = u.u0.w;\n let lineW = u.u1.y;\n\n // Screen-space segment direction + orthogonal (the half-width offset axis).\n let dir = normalize(b - a + vec2<f32>(1e-6, 0.0));\n let ortho = vec2<f32>(-dir.y, dir.x);\n // Lerp along the segment (alongQuad.x ∈ [-1,1] → [0,1]); offset by ortho × half-width.\n // The accent tether reads a touch heavier (1.1× the neutral width).\n let halfWPx = lineW * kVis * dpr * 0.5 * mix(1.0, 1.1, e.w.y);\n let p = mix(a, b, alongQuad.x * 0.5 + 0.5) + ortho * (alongQuad.y) * halfWPx;\n\n // px (y-down) → clip (y-up).\n let ndc = vec2<f32>(\n p.x / max(res.x, 1.0) * 2.0 - 1.0,\n 1.0 - p.y / max(res.y, 1.0) * 2.0,\n );\n\n var out: VSOut;\n out.pos = vec4<f32>(ndc, 0.0, 1.0);\n out.lineCoord = alongQuad.y;\n out.alpha = e.w.x;\n out.accent = e.w.y;\n out.focus = e.w.z;\n return out;\n}\n\n@fragment\nfn fs_main(in: VSOut) -> @location(0) vec4<f32> {\n // Cross-line AA — a smoothstep on |lineCoord| so the hairline edge is crisp.\n let aaBand = 0.6;\n let cross = 1.0 - smoothstep(1.0 - aaBand, 1.0, abs(in.lineCoord));\n if (cross <= 0.0) { discard; }\n\n let dim = u.u1.w * u.u1.z; // alpha · opacityCeiling\n // Resolve the edge class: accent tether · focus pointer-web · neutral ambient.\n var col = u.uLine;\n var weight = (u.uEdge.x * in.alpha + u.uEdge.w) * dim; // edgeAlpha·falloff + edgeFloor\n if (in.accent > 0.5) {\n col = u.uAccent;\n weight = u.uEdge.z * in.alpha * dim; // edgeAccentAlpha\n } else if (in.focus > 0.5) {\n col = u.uLine;\n weight = u.uEdge.y * u.u1.w * u.u1.z * in.alpha; // edgeFocusAlpha · alpha · ceiling\n }\n\n let a = col.a * weight * cross;\n if (a <= 0.0) { discard; }\n return vec4<f32>(col.rgb * a, a);\n}\n", Se = 256 * 16, Ce = N * 32, X = {
|
|
418
|
+
u0: 0,
|
|
419
|
+
u1: 4,
|
|
420
|
+
uEdge: 8,
|
|
421
|
+
uNode: 12,
|
|
422
|
+
uNodeDim: 16,
|
|
423
|
+
uLine: 20,
|
|
424
|
+
uAccent: 24
|
|
425
|
+
};
|
|
426
|
+
function we() {
|
|
427
|
+
let e = /* @__PURE__ */ new ArrayBuffer(112);
|
|
428
|
+
return {
|
|
429
|
+
buffer: e,
|
|
430
|
+
f32: new Float32Array(e)
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
function Te(e, t) {
|
|
434
|
+
let { f32: n } = e;
|
|
435
|
+
return n[X.u0 + 0] = t.resolutionX, n[X.u0 + 1] = t.resolutionY, n[X.u0 + 2] = t.dpr, n[X.u0 + 3] = t.kVis, n[X.u1 + 0] = t.time, n[X.u1 + 1] = t.lineWidth, n[X.u1 + 2] = t.opacityCeiling, n[X.u1 + 3] = t.alpha, n[X.uEdge + 0] = t.edgeAlpha, n[X.uEdge + 1] = t.edgeFocusAlpha, n[X.uEdge + 2] = t.edgeAccentAlpha, n[X.uEdge + 3] = t.edgeFloor, Z(n, X.uNode, t.node), Z(n, X.uNodeDim, t.nodeDim), Z(n, X.uLine, t.line), Z(n, X.uAccent, t.accent), e;
|
|
436
|
+
}
|
|
437
|
+
function Z(e, t, n) {
|
|
438
|
+
e[t + 0] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3];
|
|
439
|
+
}
|
|
440
|
+
function Ee() {
|
|
441
|
+
return new Float32Array(256 * 4);
|
|
442
|
+
}
|
|
443
|
+
function De() {
|
|
444
|
+
return new Float32Array(N * 8);
|
|
445
|
+
}
|
|
446
|
+
function Oe(e, t) {
|
|
447
|
+
let n = Math.min(t.length, 256);
|
|
448
|
+
for (let r = 0; r < n; r++) {
|
|
449
|
+
let n = r * 4, i = t[r];
|
|
450
|
+
e[n + 0] = i.x, e[n + 1] = i.y, e[n + 2] = i.r, e[n + 3] = i.dim;
|
|
451
|
+
}
|
|
452
|
+
return n;
|
|
453
|
+
}
|
|
454
|
+
function ke(e, t) {
|
|
455
|
+
let n = Math.min(t.length, N);
|
|
456
|
+
for (let r = 0; r < n; r++) {
|
|
457
|
+
let n = r * 8, i = t[r];
|
|
458
|
+
e[n + 0] = i.ax, e[n + 1] = i.ay, e[n + 2] = i.bx, e[n + 3] = i.by, e[n + 4] = i.alpha, e[n + 5] = i.accent, e[n + 6] = i.focus, e[n + 7] = 0;
|
|
459
|
+
}
|
|
460
|
+
return n;
|
|
461
|
+
}
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region src/components/custom/constellation/composables/constellationWGPUSetup.ts
|
|
464
|
+
var Ae = 64, je = 128, Me = 8, Q = 1, Ne = 2;
|
|
465
|
+
function Pe(e) {
|
|
466
|
+
let { canvas: t, resolveFrame: n, onResize: i, shouldContinue: a } = e;
|
|
467
|
+
return function(e, o, s) {
|
|
468
|
+
let c = e.createShaderModule({
|
|
469
|
+
label: "[Constellation] constellation-points.wgsl",
|
|
470
|
+
code: be
|
|
471
|
+
}), l = e.createShaderModule({
|
|
472
|
+
label: "[Constellation] constellation-lines.wgsl",
|
|
473
|
+
code: xe
|
|
474
|
+
}), u = e.createBuffer({
|
|
475
|
+
label: "[Constellation] uniforms",
|
|
476
|
+
size: 112,
|
|
477
|
+
usage: Ae | Me
|
|
478
|
+
}), d = e.createBuffer({
|
|
479
|
+
label: "[Constellation] nodes",
|
|
480
|
+
size: Se,
|
|
481
|
+
usage: je | Me
|
|
482
|
+
}), f = e.createBuffer({
|
|
483
|
+
label: "[Constellation] edges",
|
|
484
|
+
size: Ce,
|
|
485
|
+
usage: je | Me
|
|
486
|
+
}), p = e.createBindGroupLayout({
|
|
487
|
+
label: "[Constellation] points-bgl",
|
|
488
|
+
entries: [{
|
|
489
|
+
binding: 0,
|
|
490
|
+
visibility: Q | Ne,
|
|
491
|
+
buffer: { type: "uniform" }
|
|
492
|
+
}, {
|
|
493
|
+
binding: 1,
|
|
494
|
+
visibility: Q,
|
|
495
|
+
buffer: { type: "read-only-storage" }
|
|
496
|
+
}]
|
|
497
|
+
}), m = e.createBindGroupLayout({
|
|
498
|
+
label: "[Constellation] lines-bgl",
|
|
499
|
+
entries: [{
|
|
500
|
+
binding: 0,
|
|
501
|
+
visibility: Q | Ne,
|
|
502
|
+
buffer: { type: "uniform" }
|
|
503
|
+
}, {
|
|
504
|
+
binding: 1,
|
|
505
|
+
visibility: Q,
|
|
506
|
+
buffer: { type: "read-only-storage" }
|
|
507
|
+
}]
|
|
508
|
+
}), h = {
|
|
509
|
+
color: {
|
|
510
|
+
srcFactor: "one",
|
|
511
|
+
dstFactor: "one-minus-src-alpha",
|
|
512
|
+
operation: "add"
|
|
513
|
+
},
|
|
514
|
+
alpha: {
|
|
515
|
+
srcFactor: "one",
|
|
516
|
+
dstFactor: "one-minus-src-alpha",
|
|
517
|
+
operation: "add"
|
|
518
|
+
}
|
|
519
|
+
}, g = e.createRenderPipeline({
|
|
520
|
+
label: "[Constellation] points-pipeline",
|
|
521
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [p] }),
|
|
522
|
+
vertex: {
|
|
523
|
+
module: c,
|
|
524
|
+
entryPoint: "vs_main"
|
|
525
|
+
},
|
|
526
|
+
fragment: {
|
|
527
|
+
module: c,
|
|
528
|
+
entryPoint: "fs_main",
|
|
529
|
+
targets: [{
|
|
530
|
+
format: s,
|
|
531
|
+
blend: h
|
|
532
|
+
}]
|
|
533
|
+
},
|
|
534
|
+
primitive: { topology: "triangle-list" }
|
|
535
|
+
}), _ = e.createRenderPipeline({
|
|
536
|
+
label: "[Constellation] lines-pipeline",
|
|
537
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [m] }),
|
|
538
|
+
vertex: {
|
|
539
|
+
module: l,
|
|
540
|
+
entryPoint: "vs_main"
|
|
541
|
+
},
|
|
542
|
+
fragment: {
|
|
543
|
+
module: l,
|
|
544
|
+
entryPoint: "fs_main",
|
|
545
|
+
targets: [{
|
|
546
|
+
format: s,
|
|
547
|
+
blend: h
|
|
548
|
+
}]
|
|
549
|
+
},
|
|
550
|
+
primitive: { topology: "triangle-list" }
|
|
551
|
+
}), v = e.createBindGroup({
|
|
552
|
+
label: "[Constellation] points-bg",
|
|
553
|
+
layout: p,
|
|
554
|
+
entries: [{
|
|
555
|
+
binding: 0,
|
|
556
|
+
resource: { buffer: u }
|
|
557
|
+
}, {
|
|
558
|
+
binding: 1,
|
|
559
|
+
resource: { buffer: d }
|
|
560
|
+
}]
|
|
561
|
+
}), y = e.createBindGroup({
|
|
562
|
+
label: "[Constellation] lines-bg",
|
|
563
|
+
layout: m,
|
|
564
|
+
entries: [{
|
|
565
|
+
binding: 0,
|
|
566
|
+
resource: { buffer: u }
|
|
567
|
+
}, {
|
|
568
|
+
binding: 1,
|
|
569
|
+
resource: { buffer: f }
|
|
570
|
+
}]
|
|
571
|
+
}), b = we(), x = Ee(), S = De();
|
|
572
|
+
function C() {
|
|
573
|
+
let e = r(), n = t.clientWidth || 320, a = t.clientHeight || 320, o = Math.max(1, Math.round(n * e)), s = Math.max(1, Math.round(a * e));
|
|
574
|
+
(t.width !== o || t.height !== s) && (t.width = o, t.height = s), i?.(t.width, t.height);
|
|
575
|
+
}
|
|
576
|
+
function w(t) {
|
|
577
|
+
let r = n(t);
|
|
578
|
+
if (!r) return;
|
|
579
|
+
let i = Oe(x, r.nodes), a = ke(S, r.edges);
|
|
580
|
+
Te(b, r.uniforms), e.queue.writeBuffer(u, 0, b.buffer), i > 0 && e.queue.writeBuffer(d, 0, x.buffer, x.byteOffset, i * 4 * 4), a > 0 && e.queue.writeBuffer(f, 0, S.buffer, S.byteOffset, a * 8 * 4);
|
|
581
|
+
let s = o.getCurrentTexture().createView(), c = e.createCommandEncoder({ label: "[Constellation] frame" }), l = c.beginRenderPass({ colorAttachments: [{
|
|
582
|
+
view: s,
|
|
583
|
+
clearValue: {
|
|
584
|
+
r: 0,
|
|
585
|
+
g: 0,
|
|
586
|
+
b: 0,
|
|
587
|
+
a: 0
|
|
588
|
+
},
|
|
589
|
+
loadOp: "clear",
|
|
590
|
+
storeOp: "store"
|
|
591
|
+
}] });
|
|
592
|
+
a > 0 && (l.setPipeline(_), l.setBindGroup(0, y), l.draw(6, a, 0, 0)), i > 0 && (l.setPipeline(g), l.setBindGroup(0, v), l.draw(6, i, 0, 0)), l.end(), e.queue.submit([c.finish()]);
|
|
593
|
+
}
|
|
594
|
+
return {
|
|
595
|
+
frame: w,
|
|
596
|
+
shouldContinue: a,
|
|
597
|
+
resize: C,
|
|
598
|
+
teardown: () => {
|
|
599
|
+
u.destroy(), d.destroy(), f.destroy();
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region src/components/custom/constellation/shaders/constellation-points.glsl.ts
|
|
606
|
+
var Fe = "#version 300 es\nprecision highp float;\n\n// per-instance node row (x, y, radius, dim) — vertexAttribDivisor(1).\nlayout(location = 0) in vec4 aNode;\n\nuniform vec2 uResolution;\nuniform float uDpr;\nuniform float uKVis;\n\nout vec2 vUv; // [-1,1] billboard-local → fragment SDF coord\nout float vDim;\n\nvoid main() {\n // Two-triangle quad corners (the SAME order as the WGSL QUAD).\n vec2 quad[6] = vec2[6](\n vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0),\n vec2(-1.0, 1.0), vec2(1.0, -1.0), vec2(1.0, 1.0)\n );\n vec2 corner = quad[gl_VertexID];\n\n vec2 centerPx = aNode.xy;\n // px (y-down) → clip (y-up).\n vec2 centerNdc = vec2(\n centerPx.x / max(uResolution.x, 1.0) * 2.0 - 1.0,\n 1.0 - centerPx.y / max(uResolution.y, 1.0) * 2.0\n );\n // half-extent: radius·kVis CSS px → backing-store px (·dpr) → NDC half (·2/res).\n // (half is a GLSL reserved word — name it halfExt.)\n float radPx = aNode.z * uKVis * uDpr;\n vec2 halfExt = vec2(\n radPx / max(uResolution.x, 1.0) * 2.0,\n radPx / max(uResolution.y, 1.0) * 2.0\n );\n\n gl_Position = vec4(centerNdc + corner * halfExt, 0.0, 1.0);\n vUv = corner;\n vDim = aNode.w;\n}\n", Ie = "#version 300 es\nprecision highp float;\n\nuniform vec4 uNode; // premultiplied-ready rgba\nuniform vec4 uNodeDim;\nuniform float uOpacityCeiling;\n\nin vec2 vUv;\nin float vDim;\nout vec4 fragColor;\n\nvoid main() {\n // SDF: distance to the unit-circle edge (0 at the rim, neg inside).\n float d = length(vUv) - 1.0;\n // fwidth(d) — the pixel footprint, the resolution-independent AA width.\n float aa = max(fwidth(d), 1e-4);\n float coverage = 1.0 - smoothstep(-aa, aa, d);\n if (coverage <= 0.0) { discard; }\n vec4 col = mix(uNode, uNodeDim, vDim);\n float a = col.a * coverage * uOpacityCeiling;\n fragColor = vec4(col.rgb * a, a); // premultiplied\n}\n", Le = "#version 300 es\nprecision highp float;\n\n// per-instance edge rows — vertexAttribDivisor(1).\nlayout(location = 0) in vec4 aAB; // (a.x, a.y, b.x, b.y)\nlayout(location = 1) in vec4 aW; // (alpha, accent, focus, _pad)\n\nuniform vec2 uResolution;\nuniform float uDpr;\nuniform float uKVis;\nuniform float uLineWidth;\n\nout float vLineCoord;\nout float vAlpha;\nout float vAccent;\nout float vFocus;\n\nvoid main() {\n vec2 quad[6] = vec2[6](\n vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0),\n vec2(-1.0, 1.0), vec2(1.0, -1.0), vec2(1.0, 1.0)\n );\n vec2 alongQuad = quad[gl_VertexID];\n\n vec2 a = aAB.xy;\n vec2 b = aAB.zw;\n vec2 dir = normalize(b - a + vec2(1e-6, 0.0));\n vec2 ortho = vec2(-dir.y, dir.x);\n // accent tether reads a touch heavier (1.1×).\n float halfWPx = uLineWidth * uKVis * uDpr * 0.5 * mix(1.0, 1.1, aW.y);\n vec2 p = mix(a, b, alongQuad.x * 0.5 + 0.5) + ortho * alongQuad.y * halfWPx;\n\n vec2 ndc = vec2(\n p.x / max(uResolution.x, 1.0) * 2.0 - 1.0,\n 1.0 - p.y / max(uResolution.y, 1.0) * 2.0\n );\n\n gl_Position = vec4(ndc, 0.0, 1.0);\n vLineCoord = alongQuad.y;\n vAlpha = aW.x;\n vAccent = aW.y;\n vFocus = aW.z;\n}\n", Re = "#version 300 es\nprecision highp float;\n\nuniform vec4 uLine; // premultiplied-ready rgba\nuniform vec4 uAccent;\nuniform float uAlphaGlobal; // --constellation-alpha\nuniform float uOpacityCeiling;\nuniform float uEdgeAlpha;\nuniform float uEdgeFocusAlpha;\nuniform float uEdgeAccentAlpha;\nuniform float uEdgeFloor;\n\nin float vLineCoord;\nin float vAlpha;\nin float vAccent;\nin float vFocus;\nout vec4 fragColor;\n\nvoid main() {\n float aaBand = 0.6;\n float cross = 1.0 - smoothstep(1.0 - aaBand, 1.0, abs(vLineCoord));\n if (cross <= 0.0) { discard; }\n\n float dim = uAlphaGlobal * uOpacityCeiling;\n vec4 col = uLine;\n float weight = (uEdgeAlpha * vAlpha + uEdgeFloor) * dim;\n if (vAccent > 0.5) {\n col = uAccent;\n weight = uEdgeAccentAlpha * vAlpha * dim;\n } else if (vFocus > 0.5) {\n col = uLine;\n weight = uEdgeFocusAlpha * uAlphaGlobal * uOpacityCeiling * vAlpha;\n }\n\n float a = col.a * weight * cross;\n if (a <= 0.0) { discard; }\n fragColor = vec4(col.rgb * a, a);\n}\n";
|
|
607
|
+
//#endregion
|
|
608
|
+
//#region src/components/custom/constellation/composables/constellationGLSetup.ts
|
|
609
|
+
function $(e, t, n) {
|
|
610
|
+
let r = e.createShader(t);
|
|
611
|
+
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
612
|
+
let t = e.getShaderInfoLog(r);
|
|
613
|
+
throw e.deleteShader(r), Error(`[Constellation] shader compile failed: ${t}`);
|
|
614
|
+
}
|
|
615
|
+
return r;
|
|
616
|
+
}
|
|
617
|
+
function ze(e, t, n) {
|
|
618
|
+
let r = e.createProgram();
|
|
619
|
+
if (e.attachShader(r, t), e.attachShader(r, n), e.linkProgram(r), !e.getProgramParameter(r, e.LINK_STATUS)) throw Error(`[Constellation] link failed: ${e.getProgramInfoLog(r)}`);
|
|
620
|
+
return e.deleteShader(t), e.deleteShader(n), r;
|
|
621
|
+
}
|
|
622
|
+
function Be(e) {
|
|
623
|
+
let { canvas: t, resolveFrame: n, onResize: i, shouldContinue: a } = e;
|
|
624
|
+
return function(e) {
|
|
625
|
+
let o = ze(e, $(e, e.VERTEX_SHADER, Fe), $(e, e.FRAGMENT_SHADER, Ie)), s = ze(e, $(e, e.VERTEX_SHADER, Le), $(e, e.FRAGMENT_SHADER, Re)), c = e.createVertexArray();
|
|
626
|
+
e.bindVertexArray(c);
|
|
627
|
+
let l = e.createBuffer();
|
|
628
|
+
e.bindBuffer(e.ARRAY_BUFFER, l), e.bufferData(e.ARRAY_BUFFER, 256 * 4 * 4, e.DYNAMIC_DRAW), e.enableVertexAttribArray(0), e.vertexAttribPointer(0, 4, e.FLOAT, !1, 16, 0), e.vertexAttribDivisor(0, 1), e.bindVertexArray(null);
|
|
629
|
+
let u = e.createVertexArray();
|
|
630
|
+
e.bindVertexArray(u);
|
|
631
|
+
let d = e.createBuffer();
|
|
632
|
+
e.bindBuffer(e.ARRAY_BUFFER, d), e.bufferData(e.ARRAY_BUFFER, N * 8 * 4, e.DYNAMIC_DRAW), e.enableVertexAttribArray(0), e.vertexAttribPointer(0, 4, e.FLOAT, !1, 32, 0), e.vertexAttribDivisor(0, 1), e.enableVertexAttribArray(1), e.vertexAttribPointer(1, 4, e.FLOAT, !1, 32, 16), e.vertexAttribDivisor(1, 1), e.bindVertexArray(null);
|
|
633
|
+
let f = (t) => e.getUniformLocation(o, t), p = (t) => e.getUniformLocation(s, t), m = f("uResolution"), h = f("uDpr"), g = f("uKVis"), _ = f("uNode"), v = f("uNodeDim"), y = f("uOpacityCeiling"), b = p("uResolution"), x = p("uDpr"), S = p("uKVis"), C = p("uLineWidth"), w = p("uLine"), T = p("uAccent"), E = p("uAlphaGlobal"), D = p("uOpacityCeiling"), O = p("uEdgeAlpha"), k = p("uEdgeFocusAlpha"), A = p("uEdgeAccentAlpha"), j = p("uEdgeFloor"), M = Ee(), P = De();
|
|
634
|
+
function F() {
|
|
635
|
+
let n = r(), a = t.clientWidth || 320, o = t.clientHeight || 320, s = Math.max(1, Math.round(a * n)), c = Math.max(1, Math.round(o * n));
|
|
636
|
+
(t.width !== s || t.height !== c) && (t.width = s, t.height = c), e.viewport(0, 0, t.width, t.height), i?.(t.width, t.height);
|
|
637
|
+
}
|
|
638
|
+
function I(r) {
|
|
639
|
+
let i = n(r);
|
|
640
|
+
if (!i) return;
|
|
641
|
+
let a = Oe(M, i.nodes), f = ke(P, i.edges), p = i.uniforms;
|
|
642
|
+
e.viewport(0, 0, t.width, t.height), 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), f > 0 && (e.useProgram(s), e.bindVertexArray(u), e.bindBuffer(e.ARRAY_BUFFER, d), e.bufferSubData(e.ARRAY_BUFFER, 0, P.subarray(0, f * 8)), e.uniform2f(b, p.resolutionX, p.resolutionY), e.uniform1f(x, p.dpr), e.uniform1f(S, p.kVis), e.uniform1f(C, p.lineWidth), e.uniform4f(w, p.line[0], p.line[1], p.line[2], p.line[3]), e.uniform4f(T, p.accent[0], p.accent[1], p.accent[2], p.accent[3]), e.uniform1f(E, p.alpha), e.uniform1f(D, p.opacityCeiling), e.uniform1f(O, p.edgeAlpha), e.uniform1f(k, p.edgeFocusAlpha), e.uniform1f(A, p.edgeAccentAlpha), e.uniform1f(j, p.edgeFloor), e.drawArraysInstanced(e.TRIANGLES, 0, 6, f)), a > 0 && (e.useProgram(o), e.bindVertexArray(c), e.bindBuffer(e.ARRAY_BUFFER, l), e.bufferSubData(e.ARRAY_BUFFER, 0, M.subarray(0, a * 4)), e.uniform2f(m, p.resolutionX, p.resolutionY), e.uniform1f(h, p.dpr), e.uniform1f(g, p.kVis), e.uniform4f(_, p.node[0], p.node[1], p.node[2], p.node[3]), e.uniform4f(v, p.nodeDim[0], p.nodeDim[1], p.nodeDim[2], p.nodeDim[3]), e.uniform1f(y, p.opacityCeiling), e.drawArraysInstanced(e.TRIANGLES, 0, 6, a)), e.bindVertexArray(null);
|
|
643
|
+
}
|
|
644
|
+
return {
|
|
645
|
+
frame: I,
|
|
646
|
+
shouldContinue: a,
|
|
647
|
+
resize: F,
|
|
648
|
+
teardown: () => {
|
|
649
|
+
e.deleteProgram(o), e.deleteProgram(s), e.deleteVertexArray(c), e.deleteVertexArray(u), e.deleteBuffer(l), e.deleteBuffer(d);
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
//#endregion
|
|
364
655
|
//#region src/components/custom/constellation/composables/useConstellation.ts
|
|
365
|
-
function
|
|
366
|
-
let
|
|
656
|
+
function Ve(e, t, r) {
|
|
657
|
+
let c = Math.min(e.count ?? 64, 256), l = e.link ?? 132, u = e.speed ?? .16, f = e.parallax ?? .08, h = e.seed, _ = e.warpOnClick ?? !1, v = e.wander ?? !1, x = e.gravityWell ?? !1, S = e.pinned ?? !1, C = e.pinnedDrift ?? !1, w = e.warpAutoRelease ?? !1, T = s(() => h === void 0 ? Math.random : a(typeof h == "string" ? o(h) : h)), E = () => typeof window < "u" && /[?&](export|print|freeze)\b/.test(window.location.search), D = d()?.vnode.props?.freeze, O = s(() => D === void 0 ? E() : D === !0 || D === ""), { field: k, wanderOverride: A, wellOverride: j } = ye(v, x, S, C, w), M = {
|
|
367
658
|
x: -1,
|
|
368
659
|
y: -1
|
|
369
|
-
},
|
|
370
|
-
return
|
|
371
|
-
let
|
|
372
|
-
if (!
|
|
373
|
-
let
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
660
|
+
}, P = [], F = { ...b }, I = -1, L = !1, R = n({ respectReducedMotion: !0 }), z = null, B = "webgpu", V = g(null), H = [], te = He();
|
|
661
|
+
return p(() => {
|
|
662
|
+
let n = r.value;
|
|
663
|
+
if (!n) return;
|
|
664
|
+
let a = () => z ? z.reducedMotion : typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, o = t.value, s = (e) => {
|
|
665
|
+
let t = n.getBoundingClientRect();
|
|
666
|
+
if (!t.width || !t.height) return null;
|
|
667
|
+
let r = (e.clientX - t.left) / t.width, i = (e.clientY - t.top) / t.height;
|
|
668
|
+
return r < 0 || i < 0 || r > 1 || i > 1 ? null : {
|
|
669
|
+
x: r * k.w,
|
|
670
|
+
y: i * k.h
|
|
671
|
+
};
|
|
672
|
+
};
|
|
673
|
+
V.value = s;
|
|
674
|
+
let d = () => e.pointerReactive ?? !0, p = (e) => {
|
|
675
|
+
if (O.value || a()) return;
|
|
676
|
+
if (R.onPointerMove(e), !d()) {
|
|
677
|
+
M.x = -1, M.y = -1;
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
let t = s(e);
|
|
681
|
+
t && (M.x = t.x, M.y = t.y), z?.wake();
|
|
682
|
+
}, h = () => {
|
|
683
|
+
R.onPointerLeave(), M.x = -1, M.y = -1;
|
|
684
|
+
}, g = () => {
|
|
685
|
+
R.onPointerEnter(), z?.wake();
|
|
686
|
+
}, v = (e) => {
|
|
687
|
+
if (!_ || O.value || a()) return;
|
|
688
|
+
let t = s(e);
|
|
689
|
+
t && K(k, t.x, t.y), z?.wake();
|
|
690
|
+
}, b = o ?? n;
|
|
691
|
+
O.value || (b.addEventListener("pointermove", p), b.addEventListener("pointerenter", g), b.addEventListener("pointerleave", h), _ && b.addEventListener("pointerdown", v)), m(() => {
|
|
692
|
+
b.removeEventListener("pointermove", p), b.removeEventListener("pointerenter", g), b.removeEventListener("pointerleave", h), b.removeEventListener("pointerdown", v), R.dispose(), z?.dispose();
|
|
693
|
+
});
|
|
694
|
+
let x = {
|
|
695
|
+
resolveFrame: (t) => {
|
|
696
|
+
let r = n.clientWidth || n.offsetWidth || 1280, i = n.clientHeight || n.offsetHeight || 720, o = r / y;
|
|
697
|
+
k.canvas = n;
|
|
698
|
+
let s = parseFloat(getComputedStyle(n).getPropertyValue("--constellation-k-floor"));
|
|
699
|
+
if (k.kFloor = Number.isFinite(s) ? s : void 0, k.dpr = Math.min(typeof window < "u" && window.devicePixelRatio || 1, 2), k.w !== r || k.h !== i) {
|
|
700
|
+
let e = k.w, t = k.h;
|
|
701
|
+
if (k.w = r, k.h = i, k.k = o, k.nodes.length ? ue(k, e, t) : (k.nodes = le(T.value, c, r, i, u), k.warp.x = r / 2, k.warp.y = i / 2), F = ge(n), !L) {
|
|
702
|
+
L = !0;
|
|
703
|
+
let e = ee(n);
|
|
704
|
+
k.warpCfg = e.warp, k.well && (k.well.cfg = {
|
|
386
705
|
...e.well,
|
|
387
|
-
...
|
|
388
|
-
}),
|
|
706
|
+
...j
|
|
707
|
+
}), k.wander && (k.wander.minIdle = A.minIdle ?? e.wander.minIdle, k.wander.jitter = A.jitter ?? e.wander.jitter);
|
|
389
708
|
}
|
|
390
709
|
}
|
|
391
|
-
|
|
392
|
-
let
|
|
393
|
-
|
|
394
|
-
let
|
|
395
|
-
|
|
396
|
-
let
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
710
|
+
k.k = o;
|
|
711
|
+
let d = t * 1e3, p = I < 0 ? 0 : (d - I) / 1e3, m = I < 0 ? 0 : d - I;
|
|
712
|
+
I = d;
|
|
713
|
+
let h = O.value || a();
|
|
714
|
+
h && k.well && (k.well.strength = 0, k.well.target = 0, k.well.x = -1, k.well.y = -1), R.tick(h ? 0 : m);
|
|
715
|
+
let g = e.pointerReactive ?? !0, _ = e.opacityCeiling ?? 1, v = e.accentEdges ?? !1, b = g ? M : null, x = null;
|
|
716
|
+
if (b && !h) {
|
|
717
|
+
let e = R.velocity.value;
|
|
718
|
+
x = {
|
|
719
|
+
x: e.x * r / 60,
|
|
720
|
+
y: e.y * i / 60
|
|
721
|
+
}, M.x >= 0 && ce(k, M, R.burst.value, P);
|
|
722
|
+
}
|
|
723
|
+
h || de(k, o, u, b, p, d, T.value, x);
|
|
724
|
+
let S = k.dpr, C = he(k), w = n.width || Math.round(r * S), E = n.height || Math.round(i * S), D = te;
|
|
725
|
+
D.resolutionX = w, D.resolutionY = E, D.dpr = S, D.kVis = C, D.time = t, D.lineWidth = 1, D.opacityCeiling = _, D.alpha = F.alpha, D.edgeAlpha = F.edgeAlpha, D.edgeFocusAlpha = F.edgeFocusAlpha, D.edgeAccentAlpha = F.edgeAccentAlpha, D.edgeFloor = F.edgeFloor, D.node = J(F.node), D.nodeDim = J(F.nodeDim), D.line = J(F.line), D.accent = J(F.accent);
|
|
726
|
+
let z = h ? 0 : f, B = g ? M : null;
|
|
727
|
+
H.length = 0;
|
|
728
|
+
let V = w / Math.max(r, 1), U = E / Math.max(i, 1);
|
|
729
|
+
for (let e = 0; e < k.nodes.length; e++) {
|
|
730
|
+
let t = k.nodes[e], n = me(t, B, r, i, z);
|
|
731
|
+
H.push({
|
|
732
|
+
x: n.x * V,
|
|
733
|
+
y: n.y * U,
|
|
734
|
+
r: t.r,
|
|
735
|
+
dim: +!!t.dim
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
let W = fe(k, l, v ? k.pinnedIndex >= 0 ? k.pinnedIndex : k.focalIndex : -1, N);
|
|
739
|
+
g && !h && pe(W, k, l, M, N);
|
|
740
|
+
let G = [];
|
|
741
|
+
for (let e of W) G.push({
|
|
742
|
+
ax: e.ax * V,
|
|
743
|
+
ay: e.ay * U,
|
|
744
|
+
bx: e.bx * V,
|
|
745
|
+
by: e.by * U,
|
|
746
|
+
alpha: e.alpha,
|
|
747
|
+
accent: e.accent,
|
|
748
|
+
focus: e.focus
|
|
749
|
+
});
|
|
750
|
+
return {
|
|
751
|
+
nodes: H,
|
|
752
|
+
edges: G,
|
|
753
|
+
uniforms: D
|
|
754
|
+
};
|
|
755
|
+
},
|
|
756
|
+
shouldContinue: () => !0
|
|
757
|
+
};
|
|
758
|
+
z = i(n, {
|
|
759
|
+
mode: "live",
|
|
760
|
+
respectReducedMotion: !0,
|
|
761
|
+
setupWGPU: Pe({
|
|
762
|
+
canvas: n,
|
|
763
|
+
...x
|
|
764
|
+
}),
|
|
765
|
+
setupGL: Be({
|
|
766
|
+
canvas: n,
|
|
767
|
+
...x
|
|
768
|
+
})
|
|
769
|
+
}), z.armAsync().then(() => {
|
|
770
|
+
B = z?.backend ?? "webgpu";
|
|
413
771
|
});
|
|
414
772
|
}), {
|
|
415
|
-
field:
|
|
416
|
-
isFrozen:
|
|
773
|
+
field: k,
|
|
774
|
+
isFrozen: O,
|
|
775
|
+
backend: () => B,
|
|
417
776
|
warpTo(e, t) {
|
|
418
777
|
if (typeof e == "number" && typeof t == "number") {
|
|
419
|
-
let n =
|
|
778
|
+
let n = V.value?.({
|
|
420
779
|
clientX: e,
|
|
421
780
|
clientY: t
|
|
422
781
|
});
|
|
423
|
-
return n ?
|
|
782
|
+
return n ? K(k, n.x, n.y) : -1;
|
|
424
783
|
}
|
|
425
784
|
let n = e;
|
|
426
|
-
return
|
|
785
|
+
return K(k, n.x, n.y);
|
|
427
786
|
},
|
|
428
787
|
holdWellAt(e, t) {
|
|
429
|
-
return
|
|
788
|
+
return k.well ? (k.well.x = e, k.well.y = t, k.well.target = 1, !0) : !1;
|
|
430
789
|
},
|
|
431
790
|
releaseWell() {
|
|
432
|
-
|
|
791
|
+
k.well && (k.well.target = 0);
|
|
433
792
|
},
|
|
434
793
|
warpSettled() {
|
|
435
|
-
return
|
|
794
|
+
return q(k);
|
|
436
795
|
},
|
|
437
796
|
pinNode(e) {
|
|
438
|
-
|
|
797
|
+
k.pinnedIndex = e, k.pinnedDrift && (k.pinnedDrift.nextAt = -1);
|
|
439
798
|
}
|
|
440
799
|
};
|
|
441
800
|
}
|
|
801
|
+
function He() {
|
|
802
|
+
return {
|
|
803
|
+
resolutionX: 0,
|
|
804
|
+
resolutionY: 0,
|
|
805
|
+
dpr: 1,
|
|
806
|
+
kVis: 1,
|
|
807
|
+
time: 0,
|
|
808
|
+
lineWidth: 1,
|
|
809
|
+
opacityCeiling: 1,
|
|
810
|
+
alpha: b.alpha,
|
|
811
|
+
edgeAlpha: b.edgeAlpha,
|
|
812
|
+
edgeFocusAlpha: b.edgeFocusAlpha,
|
|
813
|
+
edgeAccentAlpha: b.edgeAccentAlpha,
|
|
814
|
+
edgeFloor: b.edgeFloor,
|
|
815
|
+
node: [
|
|
816
|
+
.7,
|
|
817
|
+
.69,
|
|
818
|
+
.64,
|
|
819
|
+
1
|
|
820
|
+
],
|
|
821
|
+
nodeDim: [
|
|
822
|
+
.8,
|
|
823
|
+
.78,
|
|
824
|
+
.74,
|
|
825
|
+
1
|
|
826
|
+
],
|
|
827
|
+
line: [
|
|
828
|
+
.11,
|
|
829
|
+
.09,
|
|
830
|
+
.08,
|
|
831
|
+
1
|
|
832
|
+
],
|
|
833
|
+
accent: [
|
|
834
|
+
.7,
|
|
835
|
+
.31,
|
|
836
|
+
.19,
|
|
837
|
+
1
|
|
838
|
+
]
|
|
839
|
+
};
|
|
840
|
+
}
|
|
442
841
|
//#endregion
|
|
443
842
|
//#region src/components/custom/constellation/Constellation.vue
|
|
444
|
-
var
|
|
843
|
+
var Ue = /* @__PURE__ */ t(/* @__PURE__ */ u({
|
|
445
844
|
__name: "Constellation",
|
|
446
845
|
props: {
|
|
447
846
|
count: { default: 64 },
|
|
448
847
|
link: { default: 132 },
|
|
449
848
|
speed: { default: .16 },
|
|
849
|
+
parallax: { default: .08 },
|
|
450
850
|
opacityCeiling: { default: 1 },
|
|
451
851
|
seed: {},
|
|
452
852
|
pointerReactive: {
|
|
@@ -486,18 +886,18 @@ var re = /* @__PURE__ */ n(/* @__PURE__ */ c({
|
|
|
486
886
|
drawOverlay: {}
|
|
487
887
|
},
|
|
488
888
|
setup(t, { expose: n }) {
|
|
489
|
-
let r = t, i =
|
|
490
|
-
return n(
|
|
889
|
+
let r = t, i = v("hostRef"), a = v("canvasRef");
|
|
890
|
+
return n(Ve(r, i, a)), (t, n) => (h(), c("div", {
|
|
491
891
|
ref_key: "hostRef",
|
|
492
892
|
ref: i,
|
|
493
|
-
class:
|
|
494
|
-
}, [
|
|
893
|
+
class: f(_(e)("constellation", r.class))
|
|
894
|
+
}, [l("canvas", {
|
|
495
895
|
ref_key: "canvasRef",
|
|
496
896
|
ref: a,
|
|
497
897
|
class: "constellation-canvas",
|
|
498
898
|
"aria-hidden": "true"
|
|
499
899
|
}, null, 512)], 2));
|
|
500
900
|
}
|
|
501
|
-
}), [["__scopeId", "data-v-
|
|
901
|
+
}), [["__scopeId", "data-v-a177fa6a"]]);
|
|
502
902
|
//#endregion
|
|
503
|
-
export {
|
|
903
|
+
export { y as BASE_WIDTH, se as BURST_FIRE_THRESHOLD, Ue as Constellation, A as DEFAULT_K_FLOOR, b as DEFAULT_PALETTE, P as DEFAULT_PARALLAX, D as DEFAULT_PINNED_DRIFT_DUR, E as DEFAULT_PINNED_DRIFT_FRAC, O as DEFAULT_PINNED_DRIFT_IDLE, k as DEFAULT_PINNED_DRIFT_JITTER, w as DEFAULT_WANDER_IDLE, T as DEFAULT_WANDER_JITTER, C as DEFAULT_WELL_CONFIG, N as E_MAX, M as MAX_DEGREE, j as MAX_NODES, x as WARP_RESPONSE, S as WARP_ZETA, pe as appendPointerWeb, fe as buildEdges, ce as fireBurst, he as kVisOf, ie as makePinnedDrift, U as nearestNode, me as parallaxNodePos, J as parseColorRGBA, re as pickWanderTarget, ee as readInteractionConfig, ge as readPalette, ue as refitField, le as seedField, G as setWarpTarget, de as stepField, oe as stepPinnedDrift, H as stepWell, q as warpSettled, W as warpStep, K as warpTo };
|