@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
package/dist/fourier-field.js
CHANGED
|
@@ -1,194 +1,853 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-C1je1s0u.js";
|
|
2
|
+
import { n as t } from "./useResolveTokenColor-vAylyR0x.js";
|
|
3
|
+
import { t as n } from "./usePointerVelocityField-QLsy3_kv.js";
|
|
4
|
+
import { n as r, o as i, r as a, s as o } from "./procedural-color.wgsl-m7Zgv35j.js";
|
|
5
|
+
import { a as s, t as c } from "./useGpuSubstrate-4pTcp6mX.js";
|
|
6
|
+
import { c as l, t as u } from "./color-Cs0-oxYL.js";
|
|
7
|
+
import { t as d } from "./useGlobalDark-CmjB9E32.js";
|
|
8
|
+
import { n as f, t as p } from "./prng-B-d9eYX8.js";
|
|
9
|
+
import { a as m, i as h, n as g, r as _, t as v } from "./math-Eb0w3LqU.js";
|
|
10
|
+
import { computed as y, createElementBlock as b, createElementVNode as x, defineComponent as S, normalizeClass as C, onMounted as w, onScopeDispose as T, openBlock as E, shallowRef as D, useTemplateRef as O, watch as k } from "vue";
|
|
11
|
+
//#region src/components/custom/fourier-field/constants.ts
|
|
12
|
+
var A = 64, j = 384, M = [{
|
|
13
|
+
L: .62,
|
|
14
|
+
C: .19,
|
|
15
|
+
h: 34
|
|
16
|
+
}, {
|
|
17
|
+
L: .86,
|
|
18
|
+
C: .06,
|
|
19
|
+
h: 70
|
|
20
|
+
}], N = {
|
|
21
|
+
source: "elliptic",
|
|
22
|
+
harmonics: 6,
|
|
23
|
+
showEpicycles: !0,
|
|
24
|
+
epicycleArms: 6,
|
|
25
|
+
rainbowChain: !0,
|
|
26
|
+
trailArc: .43,
|
|
27
|
+
trailWidth: 3,
|
|
28
|
+
intensity: 1,
|
|
29
|
+
harmonicScale: .24,
|
|
30
|
+
speed: 1,
|
|
31
|
+
palette: M,
|
|
32
|
+
respectReducedMotion: !0,
|
|
33
|
+
interactive: !0
|
|
34
|
+
}, P = "\nconst MAX_PHASORS: i32 = 64;\nconst TAU: f32 = 6.283185307179586;\n\nstruct Phasor {\n // (re, im, index, _pad)\n data: vec4<f32>,\n};\n\n// ── Compute uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──\nstruct ComputeUniforms {\n // c0: (headT, trailArc, _pad, _pad)\n c0: vec4<f32>,\n // ints: (harmonicN, epicycleArmN, sampleCount, phasorCount)\n ints: vec4<i32>,\n};\n\n@group(0) @binding(0) var<uniform> u: ComputeUniforms;\n@group(0) @binding(1) var<storage, read> phasors: array<Phasor>;\n// curveSamples[i] = (x, y, age, _pad)\n@group(0) @binding(2) var<storage, read_write> curveSamples: array<vec4<f32>>;\n// chainTips[k] = (x, y, _pad, _pad) — the running tip after stacking phasor k\n@group(0) @binding(3) var<storage, read_write> chainTips: array<vec4<f32>>;\n\n// The PARTIAL-SUM curve point at parameter t over the first n phasors — the WGSL\n// transcription of math.ts:78-95 (partialSumAt). EXACTLY:\n// c += vec2(re·cos − im·sin, re·sin + im·cos) with angle = TAU·index·t.\nfn partialSumAt(t: f32, n: i32) -> vec2<f32> {\n var c = vec2<f32>(0.0, 0.0);\n let phasorCount = u.ints.w;\n let lim = min(n, phasorCount);\n for (var i = 0; i < MAX_PHASORS; i = i + 1) {\n if (i >= lim) { break; }\n let p = phasors[i].data;\n let re = p.x;\n let im = p.y;\n let index = p.z;\n let angle = TAU * index * t;\n let cs = cos(angle);\n let sn = sin(angle);\n c = c + vec2<f32>(re * cs - im * sn, re * sn + im * cs);\n }\n return c;\n}\n\n// The epicycle chain tip after stacking the first k phasors at head_t — the WGSL\n// transcription of math.ts:41-60 (positionsAt, read at the running tip). The running tip\n// after phasor (k−1) is exactly the partial sum over the first k terms.\nfn epicycleChainTip(t: f32, k: i32) -> vec2<f32> {\n return partialSumAt(t, k);\n}\n\n@compute @workgroup_size(64)\nfn cs_main(@builtin(global_invocation_id) gid: vec3<u32>) {\n let i = i32(gid.x);\n let headT = u.c0.x;\n let trailArc = u.c0.y;\n let harmonicN = u.ints.x;\n let armN = u.ints.y;\n let sampleCount = u.ints.z;\n\n // ── The comet body samples ──\n if (i < sampleCount) {\n // age: 0 at the oldest tail (i = sampleCount−1), 1 at the head (i = 0).\n let denom = max(f32(sampleCount - 1), 1.0);\n let frac = f32(i) / denom; // 0 = head, 1 = tail\n let age = 1.0 - frac; // 1 = head, 0 = tail\n // sample back along the period from the head by trailArc.\n var t = headT - trailArc * frac;\n t = t - floor(t); // fract → [0,1)\n let pt = partialSumAt(t, harmonicN);\n curveSamples[i] = vec4<f32>(pt.x, pt.y, age, 0.0);\n }\n\n // ── The epicycle chain tips (k = 0..armN, capped to harmonicN) ──\n // chainTips[0] is the origin; chainTips[k] is the tip after phasor (k−1).\n let armLim = min(armN, harmonicN);\n if (i <= armLim && i <= MAX_PHASORS) {\n let tip = epicycleChainTip(headT, i);\n chainTips[i] = vec4<f32>(tip.x, tip.y, 0.0, 0.0);\n }\n}\n", F = `
|
|
35
|
+
const PI: f32 = 3.141592653589793;
|
|
36
|
+
const TAU: f32 = 6.283185307179586;
|
|
37
|
+
const MAX_CURVE_SAMPLES: i32 = 384;
|
|
38
|
+
const MAX_PHASORS: i32 = 64;
|
|
39
|
+
const MAX_FOURIER_STOPS: i32 = 4;
|
|
40
|
+
|
|
41
|
+
// ── Render uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──
|
|
42
|
+
struct RenderUniforms {
|
|
43
|
+
// r0: (centerX, centerY, scale, aspect) — model→clip fit transform
|
|
44
|
+
r0: vec4<f32>,
|
|
45
|
+
// r1: (trailWidth, peakAlpha, headGlowAlpha, trailFadeExp)
|
|
46
|
+
r1: vec4<f32>,
|
|
47
|
+
// r2: (trailFloor, intensity, showEpicycles, rainbowChain)
|
|
48
|
+
r2: vec4<f32>,
|
|
49
|
+
// ints: (sampleCount, armCount, stopCount, _pad)
|
|
50
|
+
ints: vec4<i32>,
|
|
51
|
+
// palette stops: linear-sRGB rgb + _pad
|
|
52
|
+
palette: array<vec4<f32>, 4>,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
@group(0) @binding(0) var<uniform> u: RenderUniforms;
|
|
56
|
+
// curveSamples[i] = (x, y, age, _pad) in MODEL space
|
|
57
|
+
@group(0) @binding(1) var<storage, read> curveSamples: array<vec4<f32>>;
|
|
58
|
+
// chainTips[k] = (x, y, _pad, _pad) in MODEL space
|
|
59
|
+
@group(0) @binding(2) var<storage, read> chainTips: array<vec4<f32>>;
|
|
60
|
+
|
|
61
|
+
${r}
|
|
62
|
+
${a}
|
|
63
|
+
|
|
64
|
+
// Sample the multi-stop palette (linear-sRGB stops, OKLab mix). t in [0,1].
|
|
65
|
+
fn samplePaletteLin(t: f32) -> vec3<f32> {
|
|
66
|
+
let stopCount = u.ints.z;
|
|
67
|
+
if (stopCount <= 1) { return u.palette[0].rgb; }
|
|
68
|
+
let n = f32(stopCount);
|
|
69
|
+
let ft = clamp(t, 0.0, 1.0) * (n - 1.0);
|
|
70
|
+
let i0 = i32(floor(ft));
|
|
71
|
+
let i1 = min(i0 + 1, stopCount - 1);
|
|
72
|
+
let f = ft - f32(i0);
|
|
73
|
+
let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i0].rgb);
|
|
74
|
+
let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i1].rgb);
|
|
75
|
+
return oklabToLinearSrgb(mix(labA, labB, f));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// A warm-anchored chain hue sweep over the palette base — the rainbow chain register.
|
|
79
|
+
// Tilts the base hue by a tight warm-ward band so the chain stays colourful but warm.
|
|
80
|
+
fn chainColorLin(seg: f32, rainbow: bool) -> vec3<f32> {
|
|
81
|
+
let baseLin = u.palette[0].rgb;
|
|
82
|
+
if (!rainbow) { return baseLin; }
|
|
83
|
+
let lab = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * baseLin);
|
|
84
|
+
let lch = oklabToOklch(lab);
|
|
85
|
+
// warm-anchored: a touch cool at the root climbing warm toward the tips.
|
|
86
|
+
let hueShift = mix(-0.45, 1.15, clamp(seg, 0.0, 1.0)); // radians (~ -26°..+66°)
|
|
87
|
+
let h = lch.z + hueShift;
|
|
88
|
+
let lifted = vec3<f32>(0.66, max(lch.y, 0.14), h);
|
|
89
|
+
return oklabToLinearSrgb(oklchToOklab(lifted));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Distance from point p to segment ab (model space).
|
|
93
|
+
fn segDist(p: vec2<f32>, a: vec2<f32>, b: vec2<f32>) -> f32 {
|
|
94
|
+
let pa = p - a;
|
|
95
|
+
let ba = b - a;
|
|
96
|
+
let h = clamp(dot(pa, ba) / max(dot(ba, ba), 1e-8), 0.0, 1.0);
|
|
97
|
+
return length(pa - ba * h);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
struct VSOut {
|
|
101
|
+
@builtin(position) pos: vec4<f32>,
|
|
102
|
+
@location(0) model: vec2<f32>, // model-space coordinate of this fragment
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
@vertex
|
|
106
|
+
fn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {
|
|
107
|
+
// Full-screen triangle (covers the viewport with 3 verts).
|
|
108
|
+
var p = array<vec2<f32>, 3>(
|
|
109
|
+
vec2<f32>(-1.0, -3.0), vec2<f32>(-1.0, 1.0), vec2<f32>(3.0, 1.0),
|
|
110
|
+
);
|
|
111
|
+
let clip = p[vi];
|
|
112
|
+
// Inverse of the model→clip fit: clip = (model − center)·scale, aspect-corrected x.
|
|
113
|
+
// → model = center + clip·(1/scale), x un-aspect-corrected.
|
|
114
|
+
let center = u.r0.xy;
|
|
115
|
+
let scale = max(u.r0.z, 1e-6);
|
|
116
|
+
let aspect = max(u.r0.w, 1e-4);
|
|
117
|
+
let model = center + vec2<f32>(clip.x * aspect, clip.y) / scale;
|
|
118
|
+
|
|
119
|
+
var out: VSOut;
|
|
120
|
+
out.pos = vec4<f32>(clip, 0.0, 1.0);
|
|
121
|
+
out.model = model;
|
|
122
|
+
return out;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@fragment
|
|
126
|
+
fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
127
|
+
let p = in.model;
|
|
128
|
+
// AA feather: one device pixel in model units (fwidth of the model coord).
|
|
129
|
+
let aa = max(fwidth(p.x) + fwidth(p.y), 1e-5) * 0.75;
|
|
130
|
+
|
|
131
|
+
let trailWidth = u.r1.x; // already in model units (packed CPU-side)
|
|
132
|
+
let peak = u.r1.y * u.r2.y; // peakAlpha · intensity
|
|
133
|
+
let headGlow = u.r1.z * u.r2.y;
|
|
134
|
+
let fadeExp = u.r1.w;
|
|
135
|
+
let trailFloor = u.r2.x;
|
|
136
|
+
let sampleCount = u.ints.x;
|
|
137
|
+
let armCount = u.ints.y;
|
|
138
|
+
let showEpicycles = u.r2.z > 0.5;
|
|
139
|
+
let rainbow = u.r2.w > 0.5;
|
|
140
|
+
let halfW = trailWidth * 0.5;
|
|
141
|
+
|
|
142
|
+
var accum = vec4<f32>(0.0); // premultiplied accumulation
|
|
143
|
+
|
|
144
|
+
// ── Epicycle scaffolding (orbit rings + arms + joint dots) UNDER the curve ──
|
|
145
|
+
if (showEpicycles && armCount >= 1) {
|
|
146
|
+
for (var k = 0; k < MAX_PHASORS; k = k + 1) {
|
|
147
|
+
if (k >= armCount) { break; }
|
|
148
|
+
let a = chainTips[k].xy;
|
|
149
|
+
let b = chainTips[k + 1].xy;
|
|
150
|
+
let seg = f32(k) / max(f32(armCount - 1), 1.0);
|
|
151
|
+
let lin = chainColorLin(seg, rainbow);
|
|
152
|
+
// orbit RING around a (radius = arm length).
|
|
153
|
+
let radius = length(b - a);
|
|
154
|
+
let dRing = abs(length(p - a) - radius);
|
|
155
|
+
let ringW = max(halfW * 0.45, aa);
|
|
156
|
+
let ringMask = (1.0 - smoothstep(ringW, ringW + aa, dRing)) * 0.5;
|
|
157
|
+
// ARM segment a→b.
|
|
158
|
+
let dArm = segDist(p, a, b);
|
|
159
|
+
let armMask = 1.0 - smoothstep(halfW * 0.55, halfW * 0.55 + aa, dArm);
|
|
160
|
+
// joint DOT at a.
|
|
161
|
+
let dotR = max(halfW * 0.7, aa * 2.0);
|
|
162
|
+
let dDot = length(p - a);
|
|
163
|
+
let dotMask = 1.0 - smoothstep(dotR, dotR + aa, dDot);
|
|
164
|
+
let m = clamp(max(max(ringMask, armMask), dotMask), 0.0, 1.0) * peak * 0.7;
|
|
165
|
+
let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
166
|
+
// over-composite (premultiplied).
|
|
167
|
+
accum = vec4<f32>(rgb * m, m) + accum * (1.0 - m);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// ── The comet TRAIL — min-distance to the curve polyline, per-segment age fade ──
|
|
172
|
+
for (var i = 0; i < MAX_CURVE_SAMPLES; i = i + 1) {
|
|
173
|
+
if (i >= sampleCount - 1) { break; }
|
|
174
|
+
let sa = curveSamples[i];
|
|
175
|
+
let sb = curveSamples[i + 1];
|
|
176
|
+
let d = segDist(p, sa.xy, sb.xy);
|
|
177
|
+
let cover = 1.0 - smoothstep(halfW, halfW + aa, d);
|
|
178
|
+
if (cover < 0.002) { continue; }
|
|
179
|
+
let age = max(sa.z, sb.z); // 1 at head, 0 at tail
|
|
180
|
+
var a = peak * pow(age, fadeExp);
|
|
181
|
+
a = max(a, peak * trailFloor);
|
|
182
|
+
a = a * cover;
|
|
183
|
+
let lin = samplePaletteLin(1.0 - age * 0.4); // warm core, lighter tail
|
|
184
|
+
let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
185
|
+
accum = vec4<f32>(rgb * a, a) + accum * (1.0 - a);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ── The comet HEAD — halo + saturated core + white specular at curveSamples[0] ──
|
|
189
|
+
if (sampleCount >= 1) {
|
|
190
|
+
let head = curveSamples[0].xy;
|
|
191
|
+
let dHead = length(p - head);
|
|
192
|
+
let coreR = halfW * 1.5;
|
|
193
|
+
let haloR = coreR * 3.0;
|
|
194
|
+
let headLin = samplePaletteLin(0.0);
|
|
195
|
+
let headRgb = clamp(linearToSrgb(headLin), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
196
|
+
// soft halo
|
|
197
|
+
let halo = (1.0 - smoothstep(0.0, haloR, dHead)) * headGlow * 0.35;
|
|
198
|
+
accum = vec4<f32>(headRgb * halo, halo) + accum * (1.0 - halo);
|
|
199
|
+
// saturated core
|
|
200
|
+
let core = (1.0 - smoothstep(coreR, coreR + aa, dHead)) * headGlow;
|
|
201
|
+
accum = vec4<f32>(headRgb * core, core) + accum * (1.0 - core);
|
|
202
|
+
// white specular
|
|
203
|
+
let spec = (1.0 - smoothstep(coreR * 0.4, coreR * 0.4 + aa, dHead)) * headGlow * 0.9;
|
|
204
|
+
accum = vec4<f32>(vec3<f32>(1.0) * spec, spec) + accum * (1.0 - spec);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return accum;
|
|
208
|
+
}
|
|
209
|
+
`, I = {
|
|
210
|
+
c0: 0,
|
|
211
|
+
ints: 4
|
|
212
|
+
};
|
|
213
|
+
function L() {
|
|
214
|
+
let e = /* @__PURE__ */ new ArrayBuffer(32);
|
|
215
|
+
return {
|
|
216
|
+
buffer: e,
|
|
217
|
+
f32: new Float32Array(e),
|
|
218
|
+
i32: new Int32Array(e)
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function R(e, t, n, r, i, a, o) {
|
|
222
|
+
let { f32: s, i32: c } = e;
|
|
223
|
+
return s[I.c0 + 0] = t, s[I.c0 + 1] = n, s[I.c0 + 2] = 0, s[I.c0 + 3] = 0, c[I.ints + 0] = r, c[I.ints + 1] = i, c[I.ints + 2] = a, c[I.ints + 3] = o, e;
|
|
224
|
+
}
|
|
225
|
+
var z = 128, B = {
|
|
226
|
+
r0: 0,
|
|
227
|
+
r1: 4,
|
|
228
|
+
r2: 8,
|
|
229
|
+
ints: 12,
|
|
230
|
+
palette: 16
|
|
231
|
+
};
|
|
232
|
+
function V() {
|
|
233
|
+
let e = new ArrayBuffer(z);
|
|
234
|
+
return {
|
|
235
|
+
buffer: e,
|
|
236
|
+
f32: new Float32Array(e),
|
|
237
|
+
i32: new Int32Array(e)
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
function H(e) {
|
|
241
|
+
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity, a = e;
|
|
242
|
+
for (let e = 0; e < 720; e++) {
|
|
243
|
+
let o = m(a, e / 720), [s, c] = o[o.length - 1];
|
|
244
|
+
s < t && (t = s), c < n && (n = c), s > r && (r = s), c > i && (i = c);
|
|
245
|
+
}
|
|
246
|
+
if (!isFinite(t)) return {
|
|
247
|
+
centerX: 0,
|
|
248
|
+
centerY: 0,
|
|
249
|
+
scale: 1
|
|
250
|
+
};
|
|
251
|
+
let o = Math.max(.001, r - t), s = Math.max(.001, i - n), c = 2 * .82 / Math.max(o, s);
|
|
252
|
+
return {
|
|
253
|
+
centerX: (t + r) / 2,
|
|
254
|
+
centerY: (n + i) / 2,
|
|
255
|
+
scale: c
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
function U(e, t, n) {
|
|
259
|
+
let r = Math.max(n, 1) / 2;
|
|
260
|
+
return e / Math.max(t, 1e-6) / r;
|
|
261
|
+
}
|
|
262
|
+
function W(e, t, n, r, i, a, o, s, c, u, d, f, p, m) {
|
|
263
|
+
let { f32: h, i32: g } = e;
|
|
264
|
+
h[B.r0 + 0] = t.centerX, h[B.r0 + 1] = t.centerY, h[B.r0 + 2] = t.scale, h[B.r0 + 3] = n, h[B.r1 + 0] = r, h[B.r1 + 1] = i, h[B.r1 + 2] = a, h[B.r1 + 3] = o, h[B.r2 + 0] = s, h[B.r2 + 1] = c, h[B.r2 + 2] = +!!u, h[B.r2 + 3] = +!!d;
|
|
265
|
+
let _ = Math.min(m.length, 4);
|
|
266
|
+
g[B.ints + 0] = f, g[B.ints + 1] = p, g[B.ints + 2] = _, g[B.ints + 3] = 0;
|
|
267
|
+
for (let e = 0; e < 4; e++) {
|
|
268
|
+
let t = B.palette + e * 4, n = l(m[Math.min(e, _ - 1)] ?? m[0]);
|
|
269
|
+
h[t + 0] = n[0], h[t + 1] = n[1], h[t + 2] = n[2], h[t + 3] = 0;
|
|
270
|
+
}
|
|
271
|
+
return e;
|
|
272
|
+
}
|
|
273
|
+
function ee(e) {
|
|
274
|
+
let t = Math.min(e.length, 64), n = new Float32Array(256);
|
|
275
|
+
for (let r = 0; r < t; r++) {
|
|
276
|
+
let t = e[r], i = r * 4;
|
|
277
|
+
n[i + 0] = t.coefficient[0], n[i + 1] = t.coefficient[1], n[i + 2] = t.index, n[i + 3] = 0;
|
|
278
|
+
}
|
|
279
|
+
return n;
|
|
280
|
+
}
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/components/custom/fourier-field/composables/fourierFieldWGPUSetup.ts
|
|
283
|
+
var G = 64, K = 128, q = 8, te = 1, J = 2, Y = 4, ne = 64, re = .92, ie = .95, ae = 1.35, oe = .34;
|
|
284
|
+
function se(e) {
|
|
285
|
+
let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: c } = e;
|
|
286
|
+
return function(e, l, u) {
|
|
287
|
+
let d = e.createShaderModule({
|
|
288
|
+
label: "[FourierField] fourier-field.compute.wgsl",
|
|
289
|
+
code: P
|
|
290
|
+
}), f = e.createShaderModule({
|
|
291
|
+
label: "[FourierField] fourier-field.render.wgsl",
|
|
292
|
+
code: F
|
|
293
|
+
}), p = e.createBuffer({
|
|
294
|
+
label: "[FourierField] phasors",
|
|
295
|
+
size: 1024,
|
|
296
|
+
usage: K | q
|
|
297
|
+
}), m = e.createBuffer({
|
|
298
|
+
label: "[FourierField] curve-samples",
|
|
299
|
+
size: 384 * 16,
|
|
300
|
+
usage: K
|
|
301
|
+
}), h = e.createBuffer({
|
|
302
|
+
label: "[FourierField] chain-tips",
|
|
303
|
+
size: 1040,
|
|
304
|
+
usage: K
|
|
305
|
+
}), g = e.createBuffer({
|
|
306
|
+
label: "[FourierField] compute-uniforms",
|
|
307
|
+
size: L().buffer.byteLength,
|
|
308
|
+
usage: G | q
|
|
309
|
+
}), _ = e.createBuffer({
|
|
310
|
+
label: "[FourierField] render-uniforms",
|
|
311
|
+
size: V().buffer.byteLength,
|
|
312
|
+
usage: G | q
|
|
313
|
+
}), v = e.createBindGroupLayout({
|
|
314
|
+
label: "[FourierField] compute-bgl",
|
|
315
|
+
entries: [
|
|
316
|
+
{
|
|
317
|
+
binding: 0,
|
|
318
|
+
visibility: Y,
|
|
319
|
+
buffer: { type: "uniform" }
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
binding: 1,
|
|
323
|
+
visibility: Y,
|
|
324
|
+
buffer: { type: "read-only-storage" }
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
binding: 2,
|
|
328
|
+
visibility: Y,
|
|
329
|
+
buffer: { type: "storage" }
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
binding: 3,
|
|
333
|
+
visibility: Y,
|
|
334
|
+
buffer: { type: "storage" }
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
}), y = e.createComputePipeline({
|
|
338
|
+
label: "[FourierField] compute-pipeline",
|
|
339
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [v] }),
|
|
340
|
+
compute: {
|
|
341
|
+
module: d,
|
|
342
|
+
entryPoint: "cs_main"
|
|
343
|
+
}
|
|
344
|
+
}), b = e.createBindGroup({
|
|
345
|
+
label: "[FourierField] compute-bg",
|
|
346
|
+
layout: v,
|
|
347
|
+
entries: [
|
|
348
|
+
{
|
|
349
|
+
binding: 0,
|
|
350
|
+
resource: { buffer: g }
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
binding: 1,
|
|
354
|
+
resource: { buffer: p }
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
binding: 2,
|
|
358
|
+
resource: { buffer: m }
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
binding: 3,
|
|
362
|
+
resource: { buffer: h }
|
|
363
|
+
}
|
|
364
|
+
]
|
|
365
|
+
}), x = e.createBindGroupLayout({
|
|
366
|
+
label: "[FourierField] render-bgl",
|
|
367
|
+
entries: [
|
|
368
|
+
{
|
|
369
|
+
binding: 0,
|
|
370
|
+
visibility: te | J,
|
|
371
|
+
buffer: { type: "uniform" }
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
binding: 1,
|
|
375
|
+
visibility: J,
|
|
376
|
+
buffer: { type: "read-only-storage" }
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
binding: 2,
|
|
380
|
+
visibility: J,
|
|
381
|
+
buffer: { type: "read-only-storage" }
|
|
382
|
+
}
|
|
383
|
+
]
|
|
384
|
+
}), S = e.createRenderPipeline({
|
|
385
|
+
label: "[FourierField] render-pipeline",
|
|
386
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [x] }),
|
|
387
|
+
vertex: {
|
|
388
|
+
module: f,
|
|
389
|
+
entryPoint: "vs_main"
|
|
390
|
+
},
|
|
391
|
+
fragment: {
|
|
392
|
+
module: f,
|
|
393
|
+
entryPoint: "fs_main",
|
|
394
|
+
targets: [{
|
|
395
|
+
format: u,
|
|
396
|
+
blend: {
|
|
397
|
+
color: {
|
|
398
|
+
srcFactor: "one",
|
|
399
|
+
dstFactor: "one-minus-src-alpha",
|
|
400
|
+
operation: "add"
|
|
401
|
+
},
|
|
402
|
+
alpha: {
|
|
403
|
+
srcFactor: "one",
|
|
404
|
+
dstFactor: "one-minus-src-alpha",
|
|
405
|
+
operation: "add"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}]
|
|
409
|
+
},
|
|
410
|
+
primitive: { topology: "triangle-list" }
|
|
411
|
+
}), C = e.createBindGroup({
|
|
412
|
+
label: "[FourierField] render-bg",
|
|
413
|
+
layout: x,
|
|
414
|
+
entries: [
|
|
415
|
+
{
|
|
416
|
+
binding: 0,
|
|
417
|
+
resource: { buffer: _ }
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
binding: 1,
|
|
421
|
+
resource: { buffer: m }
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
binding: 2,
|
|
425
|
+
resource: { buffer: h }
|
|
426
|
+
}
|
|
427
|
+
]
|
|
428
|
+
}), w = L(), T = V(), E = null, D = {
|
|
429
|
+
centerX: 0,
|
|
430
|
+
centerY: 0,
|
|
431
|
+
scale: 1
|
|
432
|
+
}, O = 0;
|
|
433
|
+
function k() {
|
|
434
|
+
let t = r();
|
|
435
|
+
t !== E && (E = t, O = Math.min(t.length, 64), D = H(t), e.queue.writeBuffer(p, 0, ee(t)));
|
|
436
|
+
}
|
|
437
|
+
function A() {
|
|
438
|
+
let e = s(), n = t.clientWidth || 320, r = t.clientHeight || 320, i = Math.max(1, Math.round(n * e)), a = Math.max(1, Math.round(r * e));
|
|
439
|
+
(t.width !== i || t.height !== a) && (t.width = i, t.height = a);
|
|
440
|
+
}
|
|
441
|
+
function j(r) {
|
|
442
|
+
c?.(r), k();
|
|
443
|
+
let o = a(), s = Math.max(1, Math.min(Math.round(n.harmonics), O)), u = n.showEpicycles ? Math.max(1, Math.min(Math.round(n.epicycleArms), s)) : 0;
|
|
444
|
+
R(w, o, n.trailArc, s, u, 384, O), e.queue.writeBuffer(g, 0, w.buffer);
|
|
445
|
+
let d = Math.min(t.clientWidth || 320, t.clientHeight || 320), f = (t.clientWidth || 320) / Math.max(t.clientHeight || 320, 1), p = U(n.trailWidth, D.scale, d);
|
|
446
|
+
W(T, D, f, p, re, ie, ae, oe, n.intensity, n.showEpicycles, n.rainbowChain, 384, u, i()), e.queue.writeBuffer(_, 0, T.buffer);
|
|
447
|
+
let m = e.createCommandEncoder({ label: "[FourierField] frame" }), h = m.beginComputePass();
|
|
448
|
+
h.setPipeline(y), h.setBindGroup(0, b), h.dispatchWorkgroups(Math.ceil(384 / ne)), h.end();
|
|
449
|
+
let v = l.getCurrentTexture().createView(), x = m.beginRenderPass({ colorAttachments: [{
|
|
450
|
+
view: v,
|
|
451
|
+
clearValue: {
|
|
452
|
+
r: 0,
|
|
453
|
+
g: 0,
|
|
454
|
+
b: 0,
|
|
455
|
+
a: 0
|
|
456
|
+
},
|
|
457
|
+
loadOp: "clear",
|
|
458
|
+
storeOp: "store"
|
|
459
|
+
}] });
|
|
460
|
+
x.setPipeline(S), x.setBindGroup(0, C), x.draw(3, 1, 0, 0), x.end(), e.queue.submit([m.finish()]);
|
|
461
|
+
}
|
|
462
|
+
return {
|
|
463
|
+
frame: j,
|
|
464
|
+
shouldContinue: o,
|
|
465
|
+
resize: A,
|
|
466
|
+
teardown: () => {
|
|
467
|
+
p.destroy(), m.destroy(), h.destroy(), g.destroy(), _.destroy();
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region src/components/custom/fourier-field/shaders/fourier-field.glsl.ts
|
|
474
|
+
var ce = "#version 300 es\nin vec2 aPosition;\nout vec2 vClip;\nvoid main() {\n vClip = aPosition;\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}\n", le = `#version 300 es
|
|
475
|
+
precision highp float;
|
|
476
|
+
|
|
477
|
+
#define MAX_CURVE_SAMPLES 256
|
|
478
|
+
#define MAX_PHASORS 64
|
|
479
|
+
|
|
480
|
+
in vec2 vClip;
|
|
481
|
+
out vec4 fragColor;
|
|
482
|
+
|
|
483
|
+
uniform vec4 uFit; // (centerX, centerY, scale, aspect)
|
|
484
|
+
uniform vec4 uTrail; // (trailWidth, peakAlpha, headGlowAlpha, trailFadeExp)
|
|
485
|
+
uniform vec4 uEnv; // (trailFloor, intensity, showEpicycles, rainbowChain)
|
|
486
|
+
uniform int uSampleCount;
|
|
487
|
+
uniform int uArmCount;
|
|
488
|
+
uniform int uStopCount;
|
|
489
|
+
uniform vec3 uPalette[4]; // linear-sRGB stops
|
|
490
|
+
// curveSamples[i] = (x, y, age) in MODEL space; chainTips[k] = (x, y) in MODEL space.
|
|
491
|
+
uniform vec3 uCurve[MAX_CURVE_SAMPLES];
|
|
492
|
+
uniform vec2 uChain[MAX_PHASORS];
|
|
493
|
+
|
|
494
|
+
const float PI = 3.141592653589793;
|
|
495
|
+
|
|
496
|
+
${i}
|
|
497
|
+
${o}
|
|
498
|
+
|
|
499
|
+
// Negative-safe cube root (the WGSL chunk's cbrt3 twin; the GLSL chunk inlines it).
|
|
500
|
+
vec3 cbrt3(vec3 v) { return sign(v) * pow(abs(v), vec3(1.0 / 3.0)); }
|
|
501
|
+
|
|
502
|
+
vec3 samplePaletteLin(float t) {
|
|
503
|
+
if (uStopCount <= 1) return uPalette[0];
|
|
504
|
+
float n = float(uStopCount);
|
|
505
|
+
float ft = clamp(t, 0.0, 1.0) * (n - 1.0);
|
|
506
|
+
int i0 = int(floor(ft));
|
|
507
|
+
int i1 = min(i0 + 1, uStopCount - 1);
|
|
508
|
+
float f = ft - float(i0);
|
|
509
|
+
vec3 labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * uPalette[i0]);
|
|
510
|
+
vec3 labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * uPalette[i1]);
|
|
511
|
+
return oklabToLinearSrgb(mix(labA, labB, f));
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
vec3 chainColorLin(float seg, bool rainbow) {
|
|
515
|
+
vec3 baseLin = uPalette[0];
|
|
516
|
+
if (!rainbow) return baseLin;
|
|
517
|
+
vec3 lab = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * baseLin);
|
|
518
|
+
vec3 lch = oklabToOklch(lab);
|
|
519
|
+
float hueShift = mix(-0.45, 1.15, clamp(seg, 0.0, 1.0));
|
|
520
|
+
vec3 lifted = vec3(0.66, max(lch.y, 0.14), lch.z + hueShift);
|
|
521
|
+
return oklabToLinearSrgb(oklchToOklab(lifted));
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
float segDist(vec2 p, vec2 a, vec2 b) {
|
|
525
|
+
vec2 pa = p - a;
|
|
526
|
+
vec2 ba = b - a;
|
|
527
|
+
float h = clamp(dot(pa, ba) / max(dot(ba, ba), 1e-8), 0.0, 1.0);
|
|
528
|
+
return length(pa - ba * h);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
void main() {
|
|
532
|
+
vec2 center = uFit.xy;
|
|
533
|
+
float scale = max(uFit.z, 1e-6);
|
|
534
|
+
float aspect = max(uFit.w, 1e-4);
|
|
535
|
+
// clip → model (the inverse of model→clip fit).
|
|
536
|
+
vec2 p = center + vec2(vClip.x * aspect, vClip.y) / scale;
|
|
537
|
+
|
|
538
|
+
float aa = max(fwidth(p.x) + fwidth(p.y), 1e-5) * 0.75;
|
|
539
|
+
float trailWidth = uTrail.x; // already in model units (packed CPU-side)
|
|
540
|
+
float peak = uTrail.y * uEnv.y;
|
|
541
|
+
float headGlow = uTrail.z * uEnv.y;
|
|
542
|
+
float fadeExp = uTrail.w;
|
|
543
|
+
float trailFloor = uEnv.x;
|
|
544
|
+
bool showEpicycles = uEnv.z > 0.5;
|
|
545
|
+
bool rainbow = uEnv.w > 0.5;
|
|
546
|
+
float halfW = trailWidth * 0.5;
|
|
547
|
+
|
|
548
|
+
vec4 accum = vec4(0.0);
|
|
549
|
+
|
|
550
|
+
if (showEpicycles && uArmCount >= 1) {
|
|
551
|
+
for (int k = 0; k < MAX_PHASORS; k++) {
|
|
552
|
+
if (k >= uArmCount) break;
|
|
553
|
+
vec2 a = uChain[k];
|
|
554
|
+
vec2 b = uChain[k + 1];
|
|
555
|
+
float seg = float(k) / max(float(uArmCount - 1), 1.0);
|
|
556
|
+
vec3 lin = chainColorLin(seg, rainbow);
|
|
557
|
+
float radius = length(b - a);
|
|
558
|
+
float dRing = abs(length(p - a) - radius);
|
|
559
|
+
float ringW = max(halfW * 0.45, aa);
|
|
560
|
+
float ringMask = (1.0 - smoothstep(ringW, ringW + aa, dRing)) * 0.5;
|
|
561
|
+
float dArm = segDist(p, a, b);
|
|
562
|
+
float armMask = 1.0 - smoothstep(halfW * 0.55, halfW * 0.55 + aa, dArm);
|
|
563
|
+
float dotR = max(halfW * 0.7, aa * 2.0);
|
|
564
|
+
float dDot = length(p - a);
|
|
565
|
+
float dotMask = 1.0 - smoothstep(dotR, dotR + aa, dDot);
|
|
566
|
+
float m = clamp(max(max(ringMask, armMask), dotMask), 0.0, 1.0) * peak * 0.7;
|
|
567
|
+
vec3 rgb = clamp(linearToSrgb(lin), vec3(0.0), vec3(1.0));
|
|
568
|
+
accum = vec4(rgb * m, m) + accum * (1.0 - m);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
for (int i = 0; i < MAX_CURVE_SAMPLES; i++) {
|
|
573
|
+
if (i >= uSampleCount - 1) break;
|
|
574
|
+
vec3 sa = uCurve[i];
|
|
575
|
+
vec3 sb = uCurve[i + 1];
|
|
576
|
+
float d = segDist(p, sa.xy, sb.xy);
|
|
577
|
+
float cover = 1.0 - smoothstep(halfW, halfW + aa, d);
|
|
578
|
+
if (cover < 0.002) continue;
|
|
579
|
+
float age = max(sa.z, sb.z);
|
|
580
|
+
float a = peak * pow(age, fadeExp);
|
|
581
|
+
a = max(a, peak * trailFloor) * cover;
|
|
582
|
+
vec3 lin = samplePaletteLin(1.0 - age * 0.4);
|
|
583
|
+
vec3 rgb = clamp(linearToSrgb(lin), vec3(0.0), vec3(1.0));
|
|
584
|
+
accum = vec4(rgb * a, a) + accum * (1.0 - a);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
if (uSampleCount >= 1) {
|
|
588
|
+
vec2 head = uCurve[0].xy;
|
|
589
|
+
float dHead = length(p - head);
|
|
590
|
+
float coreR = halfW * 1.5;
|
|
591
|
+
float haloR = coreR * 3.0;
|
|
592
|
+
vec3 headRgb = clamp(linearToSrgb(samplePaletteLin(0.0)), vec3(0.0), vec3(1.0));
|
|
593
|
+
float halo = (1.0 - smoothstep(0.0, haloR, dHead)) * headGlow * 0.35;
|
|
594
|
+
accum = vec4(headRgb * halo, halo) + accum * (1.0 - halo);
|
|
595
|
+
float core = (1.0 - smoothstep(coreR, coreR + aa, dHead)) * headGlow;
|
|
596
|
+
accum = vec4(headRgb * core, core) + accum * (1.0 - core);
|
|
597
|
+
float spec = (1.0 - smoothstep(coreR * 0.4, coreR * 0.4 + aa, dHead)) * headGlow * 0.9;
|
|
598
|
+
accum = vec4(vec3(1.0) * spec, spec) + accum * (1.0 - spec);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
fragColor = accum;
|
|
602
|
+
}
|
|
603
|
+
`, X = 256, Z = 64, ue = .92, de = .95, fe = 1.35, pe = .34;
|
|
604
|
+
function Q(e, t, n) {
|
|
605
|
+
let r = e.createShader(t);
|
|
606
|
+
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
607
|
+
let t = e.getShaderInfoLog(r);
|
|
608
|
+
throw e.deleteShader(r), Error(`[FourierField] shader compile failed: ${t}`);
|
|
609
|
+
}
|
|
610
|
+
return r;
|
|
611
|
+
}
|
|
612
|
+
function me(e) {
|
|
613
|
+
let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: c } = e;
|
|
614
|
+
return function(e) {
|
|
615
|
+
let u = Q(e, e.VERTEX_SHADER, ce), d = Q(e, e.FRAGMENT_SHADER, le), f = e.createProgram();
|
|
616
|
+
if (e.attachShader(f, u), e.attachShader(f, d), e.linkProgram(f), !e.getProgramParameter(f, e.LINK_STATUS)) throw Error(`[FourierField] link failed: ${e.getProgramInfoLog(f)}`);
|
|
617
|
+
e.deleteShader(u), e.deleteShader(d);
|
|
618
|
+
let p = e.createVertexArray();
|
|
619
|
+
e.bindVertexArray(p);
|
|
620
|
+
let m = e.createBuffer();
|
|
621
|
+
e.bindBuffer(e.ARRAY_BUFFER, m), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
|
|
622
|
+
-1,
|
|
623
|
+
-1,
|
|
624
|
+
3,
|
|
625
|
+
-1,
|
|
626
|
+
-1,
|
|
627
|
+
3
|
|
628
|
+
]), e.STATIC_DRAW);
|
|
629
|
+
let g = e.getAttribLocation(f, "aPosition");
|
|
630
|
+
e.enableVertexAttribArray(g), e.vertexAttribPointer(g, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
|
|
631
|
+
let _ = (t) => e.getUniformLocation(f, t), v = _("uFit"), y = _("uTrail"), b = _("uEnv"), x = _("uSampleCount"), S = _("uArmCount"), C = _("uStopCount"), w = _("uPalette[0]"), T = _("uCurve[0]"), E = _("uChain[0]"), D = new Float32Array(X * 3), O = new Float32Array((Z + 1) * 2), k = new Float32Array(12), A = null, j = {
|
|
632
|
+
centerX: 0,
|
|
633
|
+
centerY: 0,
|
|
634
|
+
scale: 1
|
|
635
|
+
}, M = 0;
|
|
636
|
+
function N() {
|
|
637
|
+
let e = r();
|
|
638
|
+
e !== A && (A = e, M = Math.min(e.length, Z), j = H(e));
|
|
639
|
+
}
|
|
640
|
+
function P() {
|
|
641
|
+
let n = s(), r = t.clientWidth || 320, i = t.clientHeight || 320, a = Math.max(1, Math.round(r * n)), o = Math.max(1, Math.round(i * n));
|
|
642
|
+
(t.width !== a || t.height !== o) && (t.width = a, t.height = o), e.viewport(0, 0, t.width, t.height);
|
|
643
|
+
}
|
|
644
|
+
function F(r) {
|
|
645
|
+
c?.(r), N();
|
|
646
|
+
let o = A;
|
|
647
|
+
if (!o) return;
|
|
648
|
+
let s = a(), u = Math.max(1, Math.min(Math.round(n.harmonics), M)), d = n.showEpicycles ? Math.max(1, Math.min(Math.round(n.epicycleArms), u)) : 0, m = X, g = Math.max(m - 1, 1);
|
|
649
|
+
for (let e = 0; e < m; e++) {
|
|
650
|
+
let t = e / g, r = 1 - t, i = s - n.trailArc * t;
|
|
651
|
+
i -= Math.floor(i);
|
|
652
|
+
let [a, c] = h(o, i, u), l = e * 3;
|
|
653
|
+
D[l + 0] = a, D[l + 1] = c, D[l + 2] = r;
|
|
654
|
+
}
|
|
655
|
+
let _ = Math.min(d, u);
|
|
656
|
+
for (let e = 0; e <= Z; e++) {
|
|
657
|
+
let t = e * 2;
|
|
658
|
+
if (e <= _) {
|
|
659
|
+
let [n, r] = h(o, s, e);
|
|
660
|
+
O[t + 0] = n, O[t + 1] = r;
|
|
661
|
+
} else O[t + 0] = 0, O[t + 1] = 0;
|
|
662
|
+
}
|
|
663
|
+
let P = t.clientWidth || 320, F = t.clientHeight || 320, I = Math.min(P, F), L = P / Math.max(F, 1), R = U(n.trailWidth, j.scale, I), z = i(), B = Math.min(z.length, 4);
|
|
664
|
+
for (let e = 0; e < 4; e++) {
|
|
665
|
+
let t = l(z[Math.min(e, B - 1)] ?? z[0]);
|
|
666
|
+
k[e * 3 + 0] = t[0], k[e * 3 + 1] = t[1], k[e * 3 + 2] = t[2];
|
|
667
|
+
}
|
|
668
|
+
e.useProgram(f), e.bindVertexArray(p), 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.uniform4f(v, j.centerX, j.centerY, j.scale, L), e.uniform4f(y, R, ue, de, fe), e.uniform4f(b, pe, n.intensity, +!!n.showEpicycles, +!!n.rainbowChain), e.uniform1i(x, m), e.uniform1i(S, d), e.uniform1i(C, B), e.uniform3fv(w, k), e.uniform3fv(T, D), e.uniform2fv(E, O), e.drawArrays(e.TRIANGLES, 0, 3);
|
|
669
|
+
}
|
|
670
|
+
return {
|
|
671
|
+
frame: F,
|
|
672
|
+
shouldContinue: o,
|
|
673
|
+
resize: P,
|
|
674
|
+
teardown: () => {
|
|
675
|
+
e.deleteProgram(f), e.deleteBuffer(m), e.deleteVertexArray(p);
|
|
676
|
+
}
|
|
677
|
+
};
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
//#endregion
|
|
681
|
+
//#region src/components/custom/fourier-field/composables/useFourierField.ts
|
|
682
|
+
function $(e, t) {
|
|
683
|
+
let { config: r, getSpectrum: i, getPalette: a } = t, o = t.mode ?? "live", s = t.frozenT ?? .34, l = t.periodS ?? 16, u = 0, d = -1, f = 0, p = n({ respectReducedMotion: r.respectReducedMotion }), m = () => (t.freeze?.() ?? !1) || (S?.reducedMotion ?? !1);
|
|
684
|
+
function h(e) {
|
|
685
|
+
let t = d >= 0 ? (e - d) * 1e3 : 16.7;
|
|
686
|
+
if (d = e, p.tick(t), m()) {
|
|
687
|
+
u = s, f = 0;
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
let n = Math.min(Math.max(t / 1e3, 0), .05);
|
|
691
|
+
if (r.interactive && p.active.value) {
|
|
692
|
+
u = p.smoothedPosition.value.x % 1, u < 0 && (u += 1), f = p.burst.value * 4;
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
let i = r.speed / l + f;
|
|
696
|
+
u = (u + i * n) % 1, u < 0 && (u += 1), f *= .92 ** (n * 60), Math.abs(f) < 1e-4 && (f = 0);
|
|
697
|
+
}
|
|
698
|
+
let g = () => u, _ = (e) => {
|
|
699
|
+
p.onPointerMove(e), r.interactive && S?.wake();
|
|
700
|
+
}, v = () => {
|
|
701
|
+
p.onPointerEnter(), r.interactive && S?.wake();
|
|
702
|
+
}, y = (e) => e.parentElement ?? e;
|
|
703
|
+
function b(e) {
|
|
704
|
+
let t = y(e);
|
|
705
|
+
t.addEventListener("pointermove", _), t.addEventListener("pointerenter", v), t.addEventListener("pointerleave", p.onPointerLeave);
|
|
706
|
+
}
|
|
707
|
+
function x(e) {
|
|
708
|
+
let t = y(e);
|
|
709
|
+
t.removeEventListener("pointermove", _), t.removeEventListener("pointerenter", v), t.removeEventListener("pointerleave", p.onPointerLeave);
|
|
710
|
+
}
|
|
711
|
+
let S = null, C = () => {
|
|
712
|
+
let t = e.value;
|
|
713
|
+
return t ? (S || (b(t), S = c(t, {
|
|
714
|
+
mode: o,
|
|
715
|
+
respectReducedMotion: r.respectReducedMotion,
|
|
716
|
+
setupWGPU: se({
|
|
717
|
+
canvas: t,
|
|
718
|
+
config: r,
|
|
719
|
+
getSpectrum: i,
|
|
720
|
+
getPalette: a,
|
|
721
|
+
getHeadT: g,
|
|
722
|
+
shouldContinue: () => !0,
|
|
723
|
+
onFrame: h
|
|
724
|
+
}),
|
|
725
|
+
setupGL: me({
|
|
726
|
+
canvas: t,
|
|
727
|
+
config: r,
|
|
728
|
+
getSpectrum: i,
|
|
729
|
+
getPalette: a,
|
|
730
|
+
getHeadT: g,
|
|
731
|
+
shouldContinue: () => !0,
|
|
732
|
+
onFrame: h
|
|
733
|
+
})
|
|
734
|
+
}), S.armAsync()), S) : null;
|
|
735
|
+
};
|
|
736
|
+
queueMicrotask(() => C());
|
|
737
|
+
let w = {
|
|
738
|
+
get backend() {
|
|
739
|
+
return C()?.backend ?? "webgpu";
|
|
27
740
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
741
|
+
pause: () => C()?.suspend("manual"),
|
|
742
|
+
resume: () => C()?.resume("manual"),
|
|
743
|
+
wake: () => C()?.wake(),
|
|
744
|
+
renderAt: (e) => C()?.renderAt(e),
|
|
745
|
+
get reducedMotion() {
|
|
746
|
+
return S?.reducedMotion ?? !1;
|
|
31
747
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
trailFloor: .34
|
|
35
|
-
},
|
|
36
|
-
final: {
|
|
37
|
-
harmonics: 11,
|
|
38
|
-
harmonicScale: .17,
|
|
39
|
-
epicycles: !1,
|
|
40
|
-
trailLength: 360,
|
|
41
|
-
epicycleHueShift: 36,
|
|
42
|
-
durationMs: 21e3,
|
|
43
|
-
frozenSeed: "fourier-field/final",
|
|
44
|
-
frozenT: .42,
|
|
45
|
-
peakAlpha: .88,
|
|
46
|
-
trailWidth: 3.2,
|
|
47
|
-
headGlowAlpha: .92,
|
|
48
|
-
headGlowBlur: 16,
|
|
49
|
-
headDotRadius: 4.5,
|
|
50
|
-
epicycleRatios: {
|
|
51
|
-
circle: 0,
|
|
52
|
-
arm: 0
|
|
748
|
+
get headT() {
|
|
749
|
+
return u;
|
|
53
750
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
arm: 0
|
|
751
|
+
setHeadT: (e) => {
|
|
752
|
+
u = (e % 1 + 1) % 1, C()?.wake();
|
|
57
753
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
754
|
+
dispose: () => {
|
|
755
|
+
let t = e.value;
|
|
756
|
+
t && x(t), p.dispose(), S?.dispose();
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
return T(() => w.dispose()), w;
|
|
760
|
+
}
|
|
761
|
+
//#endregion
|
|
762
|
+
//#region src/components/custom/fourier-field/FourierField.vue
|
|
763
|
+
var he = /* @__PURE__ */ e(/* @__PURE__ */ S({
|
|
63
764
|
__name: "FourierField",
|
|
64
765
|
props: {
|
|
65
|
-
|
|
766
|
+
config: {},
|
|
767
|
+
spectrum: {},
|
|
768
|
+
getPalette: {},
|
|
66
769
|
color: {},
|
|
67
|
-
colorResolver: {
|
|
770
|
+
colorResolver: {},
|
|
68
771
|
seed: { default: "" },
|
|
69
772
|
freeze: {
|
|
70
773
|
type: Boolean,
|
|
71
774
|
default: !1
|
|
72
775
|
},
|
|
73
|
-
intensity: {
|
|
74
|
-
clock: { type: Function }
|
|
776
|
+
intensity: {}
|
|
75
777
|
},
|
|
76
|
-
setup(
|
|
77
|
-
let
|
|
78
|
-
|
|
778
|
+
setup(e, { expose: n }) {
|
|
779
|
+
let r = e, i = O("hostRef"), a = O("canvasRef"), { isDark: o } = d(), s = y(() => {
|
|
780
|
+
let e = r.config ?? N, t = r.intensity == null ? e.intensity : Math.max(0, Math.min(2, r.intensity)), n = r.config ? e.interactive : !1;
|
|
781
|
+
return {
|
|
782
|
+
...e,
|
|
783
|
+
intensity: t,
|
|
784
|
+
interactive: n
|
|
785
|
+
};
|
|
786
|
+
}), c = y(() => r.spectrum && r.spectrum.length > 0 ? r.spectrum : _(f(p((r.freeze ? "fourier-field/frozen" : r.seed || "fourier-field") + r.seed)), {
|
|
787
|
+
harmonics: Math.min(s.value.harmonics + 4, 62),
|
|
788
|
+
harmonicScale: s.value.harmonicScale
|
|
789
|
+
})), l = () => c.value;
|
|
790
|
+
function m(e) {
|
|
79
791
|
if (!e.includes("var(") && !e.includes("light-dark(")) return e;
|
|
80
|
-
let
|
|
81
|
-
if (typeof window > "u" || !
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
let E = x[t.variant], D = 0;
|
|
88
|
-
function O() {
|
|
89
|
-
h.value = T(t.color);
|
|
90
|
-
let [e, a, o] = t.colorResolver(h.value).map((e) => Math.round(e * 255));
|
|
91
|
-
S.value = `rgb(${e}, ${a}, ${o})`;
|
|
92
|
-
let s = i(h.value), [c, l, u] = r({
|
|
93
|
-
L: s.L,
|
|
94
|
-
C: s.C,
|
|
95
|
-
h: n(s.h, "analogous", E.epicycleHueShift, 1)
|
|
96
|
-
}).map((e) => Math.round(e * 255));
|
|
97
|
-
if (C.value = `rgb(${c}, ${l}, ${u})`, E.epicycleRainbow && D > 0) {
|
|
98
|
-
let e = [];
|
|
99
|
-
for (let t = 0; t < D; t++) {
|
|
100
|
-
let n = D > 1 ? t / (D - 1) : 0, [i, a, o] = r({
|
|
101
|
-
L: .62,
|
|
102
|
-
C: .17,
|
|
103
|
-
h: s.h + -30 + n * 100
|
|
104
|
-
}).map((e) => Math.round(e * 255));
|
|
105
|
-
e.push(`rgb(${i}, ${a}, ${o})`);
|
|
106
|
-
}
|
|
107
|
-
w.value = e;
|
|
108
|
-
} else w.value = [];
|
|
792
|
+
let n = i.value;
|
|
793
|
+
if (typeof window > "u" || !n) return e;
|
|
794
|
+
if (e.includes("var(")) return t(e, n);
|
|
795
|
+
let r = n.style.color;
|
|
796
|
+
n.style.color = e;
|
|
797
|
+
let a = getComputedStyle(n).color;
|
|
798
|
+
return n.style.color = r, a || e;
|
|
109
799
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
let { isDark: A } = a();
|
|
117
|
-
return g(() => {
|
|
118
|
-
let n = f.value;
|
|
119
|
-
if (!n) return;
|
|
120
|
-
let r = x[t.variant], i = k(r), a = [...i].sort((e, t) => t.amplitude - e.amplitude);
|
|
121
|
-
D = a.length, O();
|
|
122
|
-
let o = Infinity, s = Infinity, d = -Infinity, p = -Infinity;
|
|
123
|
-
for (let e = 0; e < 720; e++) {
|
|
124
|
-
let t = c(i, e / 720), [n, r] = t[t.length - 1];
|
|
125
|
-
n < o && (o = n), r < s && (s = r), n > d && (d = n), r > p && (p = r);
|
|
800
|
+
let h = D(s.value.palette);
|
|
801
|
+
function g() {
|
|
802
|
+
if (r.getPalette) {
|
|
803
|
+
h.value = r.getPalette();
|
|
804
|
+
return;
|
|
126
805
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (v.length >= 2) {
|
|
163
|
-
e.save(), e.globalCompositeOperation = "source-over", e.shadowColor = E, e.shadowBlur = r.headGlowBlur, e.globalAlpha = Math.min(1, M), e.strokeStyle = E, e.lineWidth = r.trailWidth + .6;
|
|
164
|
-
let t = v.slice(-6);
|
|
165
|
-
e.beginPath(), e.moveTo(t[0][0], t[0][1]);
|
|
166
|
-
for (let n = 1; n < t.length; n++) e.lineTo(t[n][0], t[n][1]);
|
|
167
|
-
e.stroke(), e.restore();
|
|
168
|
-
}
|
|
169
|
-
if (r.headDotRadius > 0 && v.length >= 1) {
|
|
170
|
-
let [t, n] = v[v.length - 1];
|
|
171
|
-
e.globalCompositeOperation = "source-over", e.globalAlpha = Math.min(1, M * .4), e.fillStyle = E, e.beginPath(), e.arc(t, n, r.headDotRadius * 2.6, 0, Math.PI * 2), e.fill(), e.globalAlpha = Math.min(1, M), e.beginPath(), e.arc(t, n, r.headDotRadius, 0, Math.PI * 2), e.fill(), e.globalAlpha = Math.min(1, M * .95), e.fillStyle = "rgb(255, 255, 255)", e.beginPath(), e.arc(t, n, Math.max(1.2, r.headDotRadius * .38), 0, Math.PI * 2), e.fill();
|
|
172
|
-
}
|
|
173
|
-
e.shadowBlur = 0, e.globalCompositeOperation = "source-over", e.globalAlpha = 1;
|
|
174
|
-
} })
|
|
175
|
-
});
|
|
176
|
-
b(u, O, { immediate: !0 }), b(() => t.color, () => {
|
|
177
|
-
O(), y.wake();
|
|
178
|
-
}), b(A, () => {
|
|
179
|
-
O(), y.wake();
|
|
180
|
-
});
|
|
181
|
-
}), (e, t) => (_(), p("div", {
|
|
806
|
+
if (o.value, r.color) {
|
|
807
|
+
let e = m(r.color);
|
|
808
|
+
if (e.includes("var(") || e.includes("light-dark(")) return;
|
|
809
|
+
let t = u(e);
|
|
810
|
+
h.value = [{
|
|
811
|
+
L: Math.max(.5, t.L),
|
|
812
|
+
C: Math.max(.12, t.C),
|
|
813
|
+
h: t.h
|
|
814
|
+
}, {
|
|
815
|
+
L: Math.min(.9, t.L + .22),
|
|
816
|
+
C: t.C * .4,
|
|
817
|
+
h: t.h + 18
|
|
818
|
+
}];
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
h.value = s.value.palette;
|
|
822
|
+
}
|
|
823
|
+
let v = $(a, {
|
|
824
|
+
config: s.value,
|
|
825
|
+
getSpectrum: l,
|
|
826
|
+
getPalette: () => h.value,
|
|
827
|
+
freeze: () => r.freeze
|
|
828
|
+
});
|
|
829
|
+
return k([
|
|
830
|
+
() => r.color,
|
|
831
|
+
() => r.getPalette,
|
|
832
|
+
o
|
|
833
|
+
], g, { immediate: !0 }), w(g), k(o, () => v.wake()), k(() => r.freeze, () => v.wake()), n({
|
|
834
|
+
backend: () => v.backend,
|
|
835
|
+
pause: v.pause,
|
|
836
|
+
resume: v.resume,
|
|
837
|
+
wake: v.wake,
|
|
838
|
+
renderAt: v.renderAt,
|
|
839
|
+
setHeadT: v.setHeadT
|
|
840
|
+
}), (e, t) => (E(), b("div", {
|
|
182
841
|
ref_key: "hostRef",
|
|
183
|
-
ref:
|
|
184
|
-
class: "fourier-field"
|
|
185
|
-
}, [
|
|
842
|
+
ref: i,
|
|
843
|
+
class: C(["fourier-field", { "fourier-field--interactive": s.value.interactive }])
|
|
844
|
+
}, [x("canvas", {
|
|
186
845
|
ref_key: "canvasRef",
|
|
187
|
-
ref:
|
|
846
|
+
ref: a,
|
|
188
847
|
class: "fourier-field-canvas",
|
|
189
848
|
"aria-hidden": "true"
|
|
190
|
-
}, null, 512)],
|
|
849
|
+
}, null, 512)], 2));
|
|
191
850
|
}
|
|
192
|
-
}), [["__scopeId", "data-v-
|
|
851
|
+
}), [["__scopeId", "data-v-b0591225"]]);
|
|
193
852
|
//#endregion
|
|
194
|
-
export {
|
|
853
|
+
export { N as DEFAULT_FOURIER_CONFIG, he as FourierField, j as MAX_CURVE_SAMPLES, A as MAX_PHASORS, M as WARM_IDENTITY_PALETTE, v as comp, g as dftFromPoints, _ as makeEllipticSpectrum, h as partialSumAt, m as positionsAt, $ as useFourierField };
|