@mkbabb/glass-ui 4.1.0 → 4.2.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-8whJrLWt.js → CardAction-DlVP2evz.js} +58 -54
- package/dist/{CommandShortcut-D3yxgHNn.js → CommandShortcut-By-VQcLO.js} +3 -3
- package/dist/{ConfiguratorRow-CaP7U3ZA.js → ConfiguratorRow-YMXdINHx.js} +3 -3
- package/dist/{ContextMenuContent-B3ZsheLV.js → ContextMenuContent-CMWn6huB.js} +1 -1
- package/dist/{ContextMenuSubContent-DDRID3qC.js → ContextMenuSubContent-DvwWCUc0.js} +1 -1
- package/dist/{DataTable-Bc9kUtu_.js → DataTable-C4tG3eIJ.js} +4 -4
- package/dist/DialogContent-D8U9ZfWS.js +121 -0
- package/dist/{DialogScrollContent-TTuovQst.js → DialogScrollContent-BMekN7gq.js} +1 -1
- package/dist/{FadingScroll-DLRbH5Xr.js → FadingScroll-P8B30rAD.js} +1 -1
- package/dist/{HoverCardContent-Bel1gdLZ.js → HoverCardContent-DAmGYglo.js} +1 -1
- package/dist/{HoverPopover-BcIxvyqZ.js → HoverPopover-DYpBOzzF.js} +1 -1
- package/dist/{IconChip-DhbdGdFQ.js → IconChip-CQa7XZYc.js} +7 -5
- package/dist/{IconTooltip-B0zimd2H.js → IconTooltip-_df8M3xm.js} +1 -1
- package/dist/{Input-Cg9DF62r.js → Input-CyU4_hIC.js} +2 -2
- package/dist/{MetricBadge-RHdBP72w.js → MetricBadge-DQt_dGah.js} +1 -1
- package/dist/{Notification-CphK7AAm.js → Notification-BlSPJhtZ.js} +1 -1
- package/dist/{NumberFieldContent-D8cXeyO4.js → NumberFieldContent-Z3VxGu_6.js} +3 -3
- package/dist/PagerDots-CYlqVFd4.js +196 -0
- package/dist/PaperBackdrop-DYWgrnh8.js +42 -0
- package/dist/{PopoverContent-DL7E6vJP.js → PopoverContent-BuKyHZSz.js} +2 -2
- package/dist/{Progress-CnqB7gLm.js → Progress-C9SsdwIZ.js} +1 -1
- package/dist/{ScrollingText-CTZbA_cG.js → ScrollingText-DY3W1Jfh.js} +2 -2
- package/dist/{SelectScrollDownButton-DAKCBEdW.js → SelectScrollDownButton-3mFHX_R-.js} +15 -12
- package/dist/{Switch-B8RscmRu.js → Switch-uf-UKPA2.js} +1 -1
- package/dist/{Toaster-D9qIHjBI.js → Toaster-ozrsR4mP.js} +1 -1
- package/dist/{ToggleGroupItem-BLtr3TJq.js → ToggleGroupItem-BpzaVzNm.js} +4 -4
- package/dist/{TooltipProvider-BJ_Y5EGX.js → TooltipProvider-QQVM_80r.js} +1 -1
- package/dist/animated-digit.js +2 -2
- package/dist/api/index.d.ts +1 -0
- package/dist/api/types-extra.d.ts +3 -1
- package/dist/api.js +2 -2
- package/dist/aurora.js +163 -131
- package/dist/badge-Bt14yURi.js +72 -0
- package/dist/badge.js +1 -1
- package/dist/border-progress.js +1 -1
- package/dist/button-D1W9PrzI.js +130 -0
- package/dist/button.js +1 -1
- package/dist/canvas.js +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.js +227 -98
- package/dist/chipVariants-BJQ0I2kB.js +18 -0
- package/dist/collapsible.js +1 -1
- package/dist/color.js +1 -1
- package/dist/command.js +1 -1
- package/dist/components/custom/aurora/composables/glSetup.d.ts +1 -1
- package/dist/components/custom/aurora/composables/uniformBridgeWGPU.d.ts +1 -1
- package/dist/components/custom/aurora/constants/presets.d.ts +29 -0
- package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
- package/dist/components/custom/aurora/index.d.ts +1 -1
- package/dist/components/custom/concentric/Concentric.vue.d.ts +15 -12
- package/dist/components/custom/concentric/composables/concentricGLSetup.d.ts +8 -3
- package/dist/components/custom/concentric/composables/concentricWGPUSetup.d.ts +8 -4
- package/dist/components/custom/concentric/composables/levelField.d.ts +50 -0
- package/dist/components/custom/concentric/composables/uniformBridgeWGPU.d.ts +7 -4
- package/dist/components/custom/concentric/composables/useConcentric.d.ts +3 -3
- package/dist/components/custom/concentric/constants.d.ts +62 -41
- 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/configurator/Configurator.vue.d.ts +23 -2
- package/dist/components/custom/configurator/index.d.ts +1 -1
- package/dist/components/custom/dock/DockDropdownTrigger.vue.d.ts +4 -3
- package/dist/components/custom/dock/DockIconButton.vue.d.ts +10 -0
- package/dist/components/custom/dock/DockPopoverTrigger.vue.d.ts +19 -0
- package/dist/components/custom/dock/DockStack.vue.d.ts +35 -22
- package/dist/components/custom/dock/GlassDock.vue.d.ts +19 -3
- package/dist/components/custom/dock/composables/dockMorphContext.d.ts +18 -32
- package/dist/components/custom/dock/composables/dockMorphMeasure.d.ts +76 -145
- package/dist/components/custom/dock/composables/index.d.ts +1 -0
- package/dist/components/custom/dock/composables/railProjection.d.ts +45 -0
- package/dist/components/custom/dock/composables/useDockContextSilhouette.d.ts +192 -0
- package/dist/components/custom/dock/composables/useDockFission.d.ts +158 -0
- package/dist/components/custom/dock/composables/useDockItemDrag.d.ts +18 -0
- package/dist/components/custom/dock/composables/useDockShellProps.d.ts +38 -0
- package/dist/components/custom/dock/constants.d.ts +14 -3
- package/dist/components/custom/dock/index.d.ts +3 -0
- package/dist/components/custom/dot-flow-field/composables/flowField.d.ts +21 -0
- package/dist/components/custom/dot-flow-field/composables/flowGLProgram.d.ts +8 -0
- package/dist/components/custom/dot-flow-field/composables/flowSetupGL.d.ts +9 -0
- package/dist/components/custom/dot-flow-field/composables/flowSetupGLFlow.d.ts +12 -0
- package/dist/components/custom/dot-flow-field/composables/flowSetupWGPU.d.ts +7 -0
- package/dist/components/custom/dot-flow-field/composables/uniformBridgeWGPU.d.ts +28 -2
- package/dist/components/custom/dot-flow-field/composables/useFlowParticles.d.ts +18 -17
- package/dist/components/custom/dot-flow-field/constants.d.ts +51 -0
- package/dist/components/custom/dot-flow-field/index.d.ts +1 -1
- 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 +29 -0
- package/dist/components/custom/dot-flow-field/shaders/flow-field.render.wgsl.d.ts +2 -1
- package/dist/components/custom/dot-matrix/composables/uniformBridgeWGPU.d.ts +10 -1
- package/dist/components/custom/dot-matrix/composables/useDotSphere.d.ts +7 -0
- package/dist/components/custom/dot-matrix/constants.d.ts +14 -0
- package/dist/components/custom/dot-matrix/index.d.ts +1 -1
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.glsl.d.ts +2 -2
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.wgsl.d.ts +1 -1
- package/dist/components/custom/fourier-field/FourierField.vue.d.ts +4 -0
- package/dist/components/custom/fourier-field/composables/fourierFieldGLSetup.d.ts +9 -0
- package/dist/components/custom/fourier-field/composables/fourierFieldWGPUSetup.d.ts +11 -0
- package/dist/components/custom/fourier-field/composables/uniformBridgeWGPU.d.ts +16 -1
- package/dist/components/custom/fourier-field/composables/useFourierField.d.ts +22 -1
- package/dist/components/custom/fourier-field/constants.d.ts +53 -0
- package/dist/components/custom/fourier-field/shaders/fourier-field.glsl.d.ts +1 -1
- package/dist/components/custom/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/composables/easing.d.ts +1 -0
- package/dist/components/custom/goo-blob/composables/useBlobSatellites.d.ts +1 -0
- package/dist/components/custom/goo-blob/constants.d.ts +26 -1
- 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 +50 -1
- package/dist/components/custom/goo-dot-matrix/composables/gooDotSetup.d.ts +32 -3
- package/dist/components/custom/goo-dot-matrix/composables/uniformBridgeWGPU.d.ts +14 -4
- package/dist/components/custom/goo-dot-matrix/constants.d.ts +55 -16
- package/dist/components/custom/goo-dot-matrix/index.d.ts +1 -1
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.frag.d.ts +2 -0
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-filter/GooFilter.vue.d.ts +22 -0
- package/dist/components/custom/goo-filter/index.d.ts +1 -0
- package/dist/components/custom/handmark/brush.d.ts +17 -17
- package/dist/components/custom/handmark/constants.d.ts +28 -8
- package/dist/components/custom/handmark/geometry.d.ts +34 -1
- package/dist/components/custom/handmark/index.d.ts +1 -1
- package/dist/components/custom/icon-chip/types.d.ts +10 -0
- package/dist/components/custom/paper-backdrop/PaperBackdrop.vue.d.ts +18 -0
- package/dist/components/custom/paper-grid/composables/paperGrid.d.ts +44 -29
- package/dist/components/custom/paper-grid/composables/paperGridGLSetup.d.ts +2 -0
- package/dist/components/custom/paper-grid/composables/paperGridWGPUSetup.d.ts +3 -1
- package/dist/components/custom/paper-grid/composables/uniformBridgeWGPU.d.ts +2 -2
- package/dist/components/custom/paper-grid/constants.d.ts +44 -6
- package/dist/components/custom/paper-grid/index.d.ts +2 -2
- package/dist/components/custom/paper-grid/shaders/paper-grid.glsl.d.ts +1 -1
- package/dist/components/custom/paper-grid/shaders/paper-grid.wgsl.d.ts +1 -1
- package/dist/components/custom/selectable-chip/chipVariants.d.ts +39 -0
- package/dist/components/custom/selectable-chip/selectableChipVariants.d.ts +12 -20
- package/dist/components/custom/tabs/constants.d.ts +16 -8
- package/dist/components/custom/timeline/ScrubberTimeline.vue.d.ts +16 -0
- package/dist/components/custom/timeline/geometry.d.ts +0 -8
- package/dist/components/custom/toggle-chip/index.d.ts +15 -4
- package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +12 -10
- package/dist/components/ui/_shared/useSurfaceAxis.d.ts +17 -3
- package/dist/components/ui/badge/Badge.vue.d.ts +14 -0
- package/dist/components/ui/badge/index.d.ts +1 -0
- package/dist/components/ui/button/Button.vue.d.ts +1 -0
- package/dist/components/ui/card/Card.vue.d.ts +1 -1
- package/dist/components/ui/card/ScrollCard.vue.d.ts +1 -1
- package/dist/components/ui/carousel/CarouselContent.vue.d.ts +2 -4
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +9 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +33 -14
- package/dist/components/ui/drawer/constants.d.ts +8 -6
- package/dist/components/ui/drawer/index.d.ts +12 -2
- package/dist/components/ui/select/SelectContent.vue.d.ts +9 -0
- package/dist/components/ui/slider/Slider.vue.d.ts +9 -0
- package/dist/composables/dom/index.d.ts +1 -0
- package/dist/composables/dom/useDragVelocity.d.ts +46 -0
- package/dist/composables/glass/wave/index.d.ts +4 -0
- package/dist/composables/glass/wave/waveField.d.ts +115 -0
- package/dist/composables/glass/wave/waveField.glsl.d.ts +1 -0
- package/dist/composables/glass/wave/waveField.wgsl.d.ts +1 -0
- package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +95 -2
- package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +40 -2
- package/dist/composables/glass/webgpu/index.d.ts +1 -0
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +37 -0
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +49 -2
- package/dist/composables/glass/webgpu/webgpuDevice.d.ts +1 -1
- package/dist/composables/motion/core/index.d.ts +4 -0
- package/dist/composables/motion/core/useHaptic.d.ts +48 -0
- package/dist/composables/motion/core/writeVelocityWeight.d.ts +31 -0
- package/dist/composables/motion/index.d.ts +2 -0
- package/dist/composables/motion/springPresets.d.ts +16 -17
- package/dist/composables/motion/suite.d.ts +2 -2
- package/dist/composables/motion/useBloomUp.d.ts +97 -0
- package/dist/composables/motion/useCelebrationBurst.d.ts +50 -0
- package/dist/composables/motion/useDockCtaReceive.d.ts +10 -28
- package/dist/composables/motion/useGooMorph.d.ts +72 -0
- package/dist/composables/motion/useLiquidFlex.d.ts +18 -0
- package/dist/composables/motion/useLiquidMorph.d.ts +108 -0
- package/dist/composables/motion/useLiquidPress.d.ts +12 -0
- package/dist/composables/motion/useLiquidReveal.d.ts +7 -4
- package/dist/composables/motion/useMorphField.d.ts +157 -0
- package/dist/composables/motion/useScrollPin.d.ts +49 -0
- package/dist/composables/motion/useScrollScene.d.ts +67 -0
- package/dist/concentric.js +532 -563
- package/dist/configurator.js +2 -2
- package/dist/confirm-dialog.js +3 -3
- package/dist/constellation.js +4 -4
- package/dist/context-menu.js +2 -2
- package/dist/controls.js +2 -2
- package/dist/createCanvasLifecycle-CuCrGRfq.js +173 -0
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/deck.js +1 -1
- package/dist/dialog.js +3 -3
- package/dist/dock.js +1163 -618
- package/dist/dockContext-gFVS2gMg.js +18 -0
- package/dist/dom.js +7 -6
- package/dist/dot-flow-field.js +1114 -523
- package/dist/dot-matrix.js +348 -204
- package/dist/drawer.js +106 -96
- package/dist/{dropdown-menu-aJmV5SqE.js → dropdown-menu-CCfcCQ68.js} +3 -3
- package/dist/dropdown-menu.js +1 -1
- package/dist/easing.js +3 -3
- package/dist/expandable-container.js +2 -2
- package/dist/fading-scroll.js +1 -1
- package/dist/forms.js +6 -6
- package/dist/fourier-field.js +441 -197
- 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 +139 -135
- package/dist/goo-blob.js +11 -9
- package/dist/goo-dot-matrix.js +418 -198
- package/dist/handmark.js +137 -94
- 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 -0
- package/dist/instrument-chassis.js +1 -1
- package/dist/keyboard.js +1 -1
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +7 -7
- package/dist/metric-badge.js +1 -1
- package/dist/metric-cell.js +1 -1
- package/dist/metric-stack.js +1 -1
- package/dist/motion-core.js +42 -39
- package/dist/motion-curves.js +20 -14
- package/dist/motion.js +226 -26
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +1 -1
- package/dist/paper-backdrop.js +1 -1
- package/dist/paper-grid.js +315 -342
- package/dist/paperGrid-CXCSMbZ1.js +191 -0
- package/dist/popover.js +1 -1
- package/dist/{presets-CvOUqtdY.js → presets-QvYgnFIZ.js} +13 -12
- package/dist/progress.js +1 -1
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +2 -2
- package/dist/{resolveCanvasColor-yPyIpJt9.js → resolveCanvasColor-DsSJk06I.js} +5 -5
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +7 -7
- package/dist/select.js +3 -3
- package/dist/selectable-chip.js +18 -35
- package/dist/separator.js +1 -1
- package/dist/{sheet-B2flBfLH.js → sheet-DUCIoOe0.js} +3 -3
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/slider-CcICPe3u.js +149 -0
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +3 -3
- package/dist/{spectrum-walk-BVzA7Biz.js → spectrum-walk-cBNSx_zm.js} +1 -1
- package/dist/springPresets-DfoQ6XRY.js +64 -0
- package/dist/stacked-icons.js +54 -39
- package/dist/styles/cards.css +202 -2
- package/dist/styles/components.css +1 -3
- package/dist/styles/configurator.css +172 -7
- package/dist/styles/critical-partition.mjs +35 -2
- package/dist/styles/deferred.css +2 -0
- package/dist/styles/dock/adaptive-legibility.css +119 -0
- package/dist/styles/dock/density.css +18 -10
- package/dist/styles/dock/fission-bridge.css +552 -0
- package/dist/styles/dock/layers.css +88 -124
- package/dist/styles/dock/morph-bridge.css +15 -2
- package/dist/styles/dock/morph.css +45 -114
- package/dist/styles/dock/shape.css +137 -11
- package/dist/styles/dock/shell.css +1 -3
- package/dist/styles/dock/stack-rail.css +95 -7
- package/dist/styles/dock-controls/icon-button.css +34 -2
- package/dist/styles/dock-controls/triggers.css +23 -1
- package/dist/styles/dock-controls.css +18 -0
- package/dist/styles/dock.css +16 -1
- package/dist/styles/drawer.css +166 -0
- package/dist/styles/glass/glass-atom.css +244 -0
- package/dist/styles/glass/glass-capsule.css +143 -0
- package/dist/styles/glass/glass-chip.css +215 -0
- package/dist/styles/glass/liquid-enter.css +252 -0
- package/dist/styles/glass/liquid-morph.css +850 -0
- package/dist/styles/glass/material.css +70 -1
- package/dist/styles/glass/reveal.css +22 -2
- package/dist/styles/glass/rim.css +13 -1
- package/dist/styles/glass/surfaces.css +18 -8
- package/dist/styles/glass.css +11 -0
- package/dist/styles/icon-chip.css +45 -0
- package/dist/styles/index.css +11 -0
- package/dist/styles/jubilance.css +65 -0
- package/dist/styles/motion/morph-field.css +229 -0
- package/dist/styles/paper.css +230 -14
- package/dist/styles/scroll-choreography.css +135 -78
- package/dist/styles/segmented-tabs.css +85 -51
- package/dist/styles/select.css +151 -0
- package/dist/styles/tokens/color-radius.css +1 -1
- package/dist/styles/tokens/dark-arm.css +57 -8
- package/dist/styles/tokens/glass-deep.css +8 -4
- package/dist/styles/tokens/glass-fx.css +80 -2
- package/dist/styles/tokens/glass.css +140 -8
- package/dist/styles/tokens/light-dark.css +2 -2
- package/dist/styles/tokens/property-regs.css +144 -0
- package/dist/styles/tokens/scale-paper.css +20 -8
- package/dist/styles/tokens/scheme-motion.css +92 -157
- package/dist/styles/tokens/scheme-spring.css +239 -0
- package/dist/styles/tokens/scroll-tokens.css +15 -15
- package/dist/styles/tokens/shadow.css +73 -13
- package/dist/styles/tokens.css +9 -2
- package/dist/styles/utilities/btn.css +70 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +198 -181
- package/dist/timeline.js +241 -206
- package/dist/toast.js +1 -1
- package/dist/toggle-chip.js +14 -41
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{uniformBridgeWGPU-CtAKl45L.js → uniformBridgeWGPU-BCse1SHU.js} +191 -127
- package/dist/{useAnimatedNumber-CLrxicG9.js → useAnimatedNumber-BntskVdQ.js} +1 -1
- package/dist/{useConfiguratorState-4xblKfwd.js → useConfiguratorState-22BcULzF.js} +37 -35
- package/dist/useDockCtaReceive-DX7RDb6_.js +88 -0
- package/dist/{useDragMorph-BUgAC-zK.js → useDragMorph-DGLSewwB.js} +2 -2
- package/dist/useDragVelocity-CjcfX3dA.js +57 -0
- package/dist/useGooMorph-Cs13NgYL.js +104 -0
- package/dist/useGpuSubstrate-Ceet70xq.js +347 -0
- package/dist/{useViewTransition-CUI1nAgn.js → useHaptic-CPz5BT9I.js} +40 -1
- package/dist/{useLiquidFlex-UmA6LMZu.js → useLiquidFlex-Cc6PjVJD.js} +8 -3
- package/dist/useLiquidPress-CtOQ8Z0_.js +43 -0
- package/dist/useMorphField-ogBM7ubT.js +141 -0
- package/dist/{useScrollChrome-D66AVP7C.js → useScrollChrome-JuImi1DM.js} +2 -2
- package/dist/{useSpringMount-BWDnKIwh.js → useSpringMount-DFxtzmkR.js} +1 -1
- package/dist/{useSpringPress-B1-Czp-V.js → useSpringPress-VM9RgVq3.js} +1 -1
- package/dist/{useSurfaceAxis-g0NloYEF.js → useSurfaceAxis-Ci7Dnaw2.js} +1 -1
- package/dist/{useTouchGate-CBZTD4SD.js → useTouchGate-B1Lf9XqN.js} +1 -1
- package/dist/virtual.js +1 -1
- package/dist/watercolor-dot.js +16 -26
- package/dist/writeVelocityWeight-Bh83xZfs.js +19 -0
- package/package.json +14 -3
- package/src/styles/cards.css +202 -2
- package/src/styles/configurator.css +172 -7
- package/src/styles/critical-partition.mjs +35 -2
- package/src/styles/dock/adaptive-legibility.css +119 -0
- package/src/styles/dock/density.css +18 -10
- package/src/styles/dock/fission-bridge.css +552 -0
- package/src/styles/dock/layers.css +88 -124
- package/src/styles/dock/morph-bridge.css +15 -2
- package/src/styles/dock/morph.css +45 -114
- package/src/styles/dock/shape.css +137 -11
- package/src/styles/dock/shell.css +1 -3
- package/src/styles/dock/stack-rail.css +95 -7
- package/src/styles/dock-controls/icon-button.css +34 -2
- package/src/styles/dock-controls/triggers.css +23 -1
- package/src/styles/dock-controls.css +18 -0
- package/src/styles/dock.css +16 -1
- package/src/styles/drawer.css +164 -0
- package/src/styles/glass/glass-atom.css +244 -0
- package/src/styles/glass/glass-capsule.css +143 -0
- package/src/styles/glass/glass-chip.css +215 -0
- package/src/styles/glass/liquid-enter.css +252 -0
- package/src/styles/glass/liquid-morph.css +850 -0
- package/src/styles/glass/material.css +70 -1
- package/src/styles/glass/reveal.css +22 -2
- package/src/styles/glass/rim.css +13 -1
- package/src/styles/glass/surfaces.css +18 -8
- package/src/styles/glass.css +11 -0
- package/src/styles/icon-chip.css +45 -0
- package/src/styles/index.css +11 -0
- package/src/styles/jubilance.css +65 -0
- package/src/styles/motion/morph-field.css +229 -0
- package/src/styles/paper.css +230 -14
- package/src/styles/scroll-choreography.css +135 -78
- package/src/styles/segmented-tabs.css +85 -47
- package/src/styles/select.css +151 -0
- package/src/styles/tokens/color-radius.css +1 -1
- package/src/styles/tokens/dark-arm.css +57 -8
- package/src/styles/tokens/glass-deep.css +8 -4
- package/src/styles/tokens/glass-fx.css +80 -2
- package/src/styles/tokens/glass.css +140 -8
- package/src/styles/tokens/light-dark.css +2 -2
- package/src/styles/tokens/property-regs.css +144 -0
- package/src/styles/tokens/scale-paper.css +20 -8
- package/src/styles/tokens/scheme-motion.css +92 -157
- package/src/styles/tokens/scheme-spring.css +239 -0
- package/src/styles/tokens/scroll-tokens.css +15 -15
- package/src/styles/tokens/shadow.css +73 -13
- package/src/styles/tokens.css +9 -2
- package/src/styles/utilities/btn.css +70 -0
- package/dist/DialogContent-6JtTB5x2.js +0 -106
- package/dist/PagerDots-Cjx96la-.js +0 -98
- package/dist/PaperBackdrop-CqwjnfLv.js +0 -31
- package/dist/badge-D9XWW4GT.js +0 -53
- package/dist/button-5dY1Dvhd.js +0 -125
- package/dist/components/custom/concentric/composables/ringField.d.ts +0 -85
- package/dist/createCanvasLifecycle-Gh45Ce-p.js +0 -93
- package/dist/dockContext-BNfyPLe9.js +0 -17
- package/dist/slider-2A0rPn79.js +0 -142
- package/dist/springPresets-Ce7OYCm9.js +0 -46
- package/dist/useDockCtaReceive-DfFkmgL1.js +0 -82
- package/dist/useGpuSubstrate-4pTcp6mX.js +0 -294
- package/dist/useLiquidPress-BooG97RY.js +0 -39
- /package/dist/{CollapsibleContent-68dEXIAl.js → CollapsibleContent-D7UNsXQr.js} +0 -0
- /package/dist/{DialogFooter-9phqcRIS.js → DialogFooter-DoLy0ewI.js} +0 -0
- /package/dist/{InstrumentChassis-CxsHSyMj.js → InstrumentChassis-UUJX0-mW.js} +0 -0
- /package/dist/{Label-C2ejNWeC.js → Label-B_HPqi_q.js} +0 -0
- /package/dist/{ModalOverlay-D1VrWyoi.js → ModalOverlay-DfAf7o15.js} +0 -0
- /package/dist/{SelectGroup-BFiod7X2.js → SelectGroup-Dcczq44n.js} +0 -0
- /package/dist/{SelectSeparator-C2UGOkXF.js → SelectSeparator-CNRGG7Ew.js} +0 -0
- /package/dist/{Separator-DQcwC2TR.js → Separator-Cf9-JFgi.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-C1je1s0u.js → _plugin-vue_export-helper-gLzyemvl.js} +0 -0
- /package/dist/{color-Cs0-oxYL.js → color-B9jZdhJX.js} +0 -0
- /package/dist/{compile-nZ1xVYTp.js → compile-INR_tPk_.js} +0 -0
- /package/dist/{constants--C2DkLW8.js → constants-BWj7DkMn.js} +0 -0
- /package/dist/{createContext-CpBNTRMI.js → createContext-Cd23P9j0.js} +0 -0
- /package/dist/{dotMatrixField-D_x9_1qq.js → dotMatrixField-CRO0ZFk4.js} +0 -0
- /package/dist/{flow.glsl-B2P7e0MT.js → flow.glsl-DqEGRpl4.js} +0 -0
- /package/dist/{math-Eb0w3LqU.js → math-5RcIgCB4.js} +0 -0
- /package/dist/{menuItemVariants-D8VNHq22.js → menuItemVariants-DAXquKja.js} +0 -0
- /package/dist/{prng-B-d9eYX8.js → prng-B5tIXTtj.js} +0 -0
- /package/dist/{procedural-color.wgsl-m7Zgv35j.js → procedural-color.wgsl-C1Y5PkM6.js} +0 -0
- /package/dist/{scrollReader-DI1NWxUw.js → scrollReader-rc3Ns_NM.js} +0 -0
- /package/dist/{useControlSize-SH1UmJCi.js → useControlSize-DAZ062x7.js} +0 -0
- /package/dist/{useFuzzySearch-DIhcYtcw.js → useFuzzySearch-0fTYOhS4.js} +0 -0
- /package/dist/{useGlobalDark-CmjB9E32.js → useGlobalDark-B4HO9LXG.js} +0 -0
- /package/dist/{useIntersectionPause-Dbozzjgm.js → useIntersectionPause-DO8Vl4gs.js} +0 -0
- /package/dist/{useInterval-CNdua40W.js → useInterval-BVUI-sez.js} +0 -0
- /package/dist/{useKeyboardShortcuts-BPRp33Im.js → useKeyboardShortcuts-BEut54Tk.js} +0 -0
- /package/dist/{usePointerVelocityField-QLsy3_kv.js → usePointerVelocityField-BrkqZFhj.js} +0 -0
- /package/dist/{useResizeObserver-Bpoi7tRE.js → useResizeObserver-DdEn3v2f.js} +0 -0
- /package/dist/{useResolveTokenColor-vAylyR0x.js → useResolveTokenColor-ChOnCckA.js} +0 -0
- /package/dist/{useScrollProgress-c3yxmH6a.js → useScrollProgress-A0M6qRl7.js} +0 -0
- /package/dist/{useSortable-BVqlJRBR.js → useSortable-DQV_UNDw.js} +0 -0
- /package/dist/{useTextHighlight-NmBM5V_4.js → useTextHighlight-Bma3UlKA.js} +0 -0
- /package/dist/{useTimer-BHJOKr35.js → useTimer-BBLGPXR8.js} +0 -0
- /package/dist/{useUserInvalidAria-y5namzeE.js → useUserInvalidAria-EmmwWPOl.js} +0 -0
- /package/dist/{useViewportReady-anbac3m6.js → useViewportReady-C9pYnn7K.js} +0 -0
- /package/dist/{vReveal-D9k0jADx.js → vReveal-CT1KtwZA.js} +0 -0
package/dist/fourier-field.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { t as e } from "./_plugin-vue_export-helper-
|
|
2
|
-
import { n as t } from "./useResolveTokenColor-
|
|
3
|
-
import { t as n } from "./usePointerVelocityField-
|
|
4
|
-
import { n as r, o as i, r as a, s as o } from "./procedural-color.wgsl-
|
|
5
|
-
import { a as s, t as c } from "./useGpuSubstrate-
|
|
6
|
-
import { c as l, t as u } from "./color-
|
|
7
|
-
import { t as d } from "./useGlobalDark-
|
|
8
|
-
import { n as f, t as p } from "./prng-
|
|
9
|
-
import { a as m, i as h, n as g, r as _, t as v } from "./math-
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-gLzyemvl.js";
|
|
2
|
+
import { n as t } from "./useResolveTokenColor-ChOnCckA.js";
|
|
3
|
+
import { t as n } from "./usePointerVelocityField-BrkqZFhj.js";
|
|
4
|
+
import { n as r, o as i, r as a, s as o } from "./procedural-color.wgsl-C1Y5PkM6.js";
|
|
5
|
+
import { a as s, t as c } from "./useGpuSubstrate-Ceet70xq.js";
|
|
6
|
+
import { c as l, t as u } from "./color-B9jZdhJX.js";
|
|
7
|
+
import { t as d } from "./useGlobalDark-B4HO9LXG.js";
|
|
8
|
+
import { n as f, t as p } from "./prng-B5tIXTtj.js";
|
|
9
|
+
import { a as m, i as h, n as g, r as _, t as v } from "./math-5RcIgCB4.js";
|
|
10
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
11
|
//#region src/components/custom/fourier-field/constants.ts
|
|
12
|
-
var A = 64, j = 384, M = [{
|
|
12
|
+
var A = 64, j = 384, M = .15, N = .12, P = .55, F = .35, I = [{
|
|
13
13
|
L: .62,
|
|
14
14
|
C: .19,
|
|
15
15
|
h: 34
|
|
@@ -17,7 +17,7 @@ var A = 64, j = 384, M = [{
|
|
|
17
17
|
L: .86,
|
|
18
18
|
C: .06,
|
|
19
19
|
h: 70
|
|
20
|
-
}],
|
|
20
|
+
}], L = {
|
|
21
21
|
source: "elliptic",
|
|
22
22
|
harmonics: 6,
|
|
23
23
|
showEpicycles: !0,
|
|
@@ -28,15 +28,23 @@ var A = 64, j = 384, M = [{
|
|
|
28
28
|
intensity: 1,
|
|
29
29
|
harmonicScale: .24,
|
|
30
30
|
speed: 1,
|
|
31
|
-
palette:
|
|
31
|
+
palette: I,
|
|
32
32
|
respectReducedMotion: !0,
|
|
33
|
-
interactive: !0
|
|
34
|
-
|
|
33
|
+
interactive: !0,
|
|
34
|
+
squashGain: P,
|
|
35
|
+
celGain: F
|
|
36
|
+
}, R = "\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", z = `
|
|
35
37
|
const PI: f32 = 3.141592653589793;
|
|
36
38
|
const TAU: f32 = 6.283185307179586;
|
|
37
39
|
const MAX_CURVE_SAMPLES: i32 = 384;
|
|
38
40
|
const MAX_PHASORS: i32 = 64;
|
|
39
41
|
const MAX_FOURIER_STOPS: i32 = 4;
|
|
42
|
+
// BD.W-FOURIER-LOOM §2b — the degenerate-tangent guard (must equal FOURIER_TANGENT_EPS in
|
|
43
|
+
// constants.ts + the GL CPU bead path so a cusp resolves IDENTICALLY across both engines).
|
|
44
|
+
const TANGENT_EPS: f32 = 1e-4;
|
|
45
|
+
// The speed yardstick: the head speed (model units between curveSamples[0] and [1]) is
|
|
46
|
+
// normalized against this many trail half-widths so ŝ ∈ [0,1] is scale-free + parity-safe.
|
|
47
|
+
const SPEED_REF_HALFWIDTHS: f32 = 6.0;
|
|
40
48
|
|
|
41
49
|
// ── Render uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──
|
|
42
50
|
struct RenderUniforms {
|
|
@@ -46,6 +54,8 @@ struct RenderUniforms {
|
|
|
46
54
|
r1: vec4<f32>,
|
|
47
55
|
// r2: (trailFloor, intensity, showEpicycles, rainbowChain)
|
|
48
56
|
r2: vec4<f32>,
|
|
57
|
+
// r3: (squashGain, celGain, _pad, _pad) — FOURIER-LOOM §2b/§3b
|
|
58
|
+
r3: vec4<f32>,
|
|
49
59
|
// ints: (sampleCount, armCount, stopCount, _pad)
|
|
50
60
|
ints: vec4<i32>,
|
|
51
61
|
// palette stops: linear-sRGB rgb + _pad
|
|
@@ -97,6 +107,37 @@ fn segDist(p: vec2<f32>, a: vec2<f32>, b: vec2<f32>) -> f32 {
|
|
|
97
107
|
return length(pa - ba * h);
|
|
98
108
|
}
|
|
99
109
|
|
|
110
|
+
// BD.W-FOURIER-LOOM §2b — the head travel frame: the unit tangent T from curveSamples[0]
|
|
111
|
+
// (head) vs [1] (one step back) + the normalized speed ŝ ∈ [0,1]. The cusp guard returns
|
|
112
|
+
// the +x axis as the stable fallback when s ≤ TANGENT_EPS, identical to the GL CPU path.
|
|
113
|
+
struct HeadFrame { T: vec2<f32>, sHat: f32, };
|
|
114
|
+
fn headFrame(head: vec2<f32>, headBack: vec2<f32>, halfW: f32) -> HeadFrame {
|
|
115
|
+
let d = head - headBack;
|
|
116
|
+
let s = length(d);
|
|
117
|
+
var out: HeadFrame;
|
|
118
|
+
if (s <= TANGENT_EPS) {
|
|
119
|
+
out.T = vec2<f32>(1.0, 0.0);
|
|
120
|
+
out.sHat = 0.0;
|
|
121
|
+
return out;
|
|
122
|
+
}
|
|
123
|
+
out.T = d / s;
|
|
124
|
+
let refScale = max(halfW * SPEED_REF_HALFWIDTHS, 1e-6);
|
|
125
|
+
out.sHat = clamp(s / refScale, 0.0, 1.0);
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// The volume-preserving anisotropic head distance: project (p − head) onto T and T⊥, stretch
|
|
130
|
+
// the tangent extent by (1 + k·ŝ) and squeeze the normal extent by 1/(1 + k·ŝ), then length.
|
|
131
|
+
// k = 0 (or ŝ = 0) collapses to the round disc length(p − head) — byte-frozen at rest.
|
|
132
|
+
fn headAniso(p: vec2<f32>, head: vec2<f32>, fr: HeadFrame, k: f32) -> f32 {
|
|
133
|
+
let g = 1.0 + k * fr.sHat;
|
|
134
|
+
let n = vec2<f32>(-fr.T.y, fr.T.x);
|
|
135
|
+
let rel = p - head;
|
|
136
|
+
let along = dot(rel, fr.T) / g;
|
|
137
|
+
let across = dot(rel, n) * g;
|
|
138
|
+
return length(vec2<f32>(along, across));
|
|
139
|
+
}
|
|
140
|
+
|
|
100
141
|
struct VSOut {
|
|
101
142
|
@builtin(position) pos: vec4<f32>,
|
|
102
143
|
@location(0) model: vec2<f32>, // model-space coordinate of this fragment
|
|
@@ -137,10 +178,53 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
137
178
|
let armCount = u.ints.y;
|
|
138
179
|
let showEpicycles = u.r2.z > 0.5;
|
|
139
180
|
let rainbow = u.r2.w > 0.5;
|
|
181
|
+
let squashGain = u.r3.x; // FOURIER-LOOM §2b
|
|
182
|
+
let celGain = u.r3.y; // FOURIER-LOOM §3b
|
|
140
183
|
let halfW = trailWidth * 0.5;
|
|
141
184
|
|
|
185
|
+
// BD.W-FOURIER-LOOM §2b — the head travel frame (the SAME curveSamples[0]/[1] both engines
|
|
186
|
+
// read → parity by construction). The cel offset (§3b) rides −T (opposite travel).
|
|
187
|
+
var headFr: HeadFrame;
|
|
188
|
+
headFr.T = vec2<f32>(1.0, 0.0);
|
|
189
|
+
headFr.sHat = 0.0;
|
|
190
|
+
if (sampleCount >= 2) {
|
|
191
|
+
headFr = headFrame(curveSamples[0].xy, curveSamples[1].xy, halfW);
|
|
192
|
+
}
|
|
193
|
+
let celOff = -headFr.T * halfW * 1.4; // the ink lags behind the travel
|
|
194
|
+
|
|
142
195
|
var accum = vec4<f32>(0.0); // premultiplied accumulation
|
|
143
196
|
|
|
197
|
+
// ── §3b — the cartoon CEL-SHADOW: a darker offset copy of the chain + rope, opposite
|
|
198
|
+
// travel, painted FIRST (it sits UNDER the lit chain). PRM-static (the frozen-T travel
|
|
199
|
+
// frame is a fixed offset, no live sweep). celGain = 0 → no pass (byte-frozen). ──
|
|
200
|
+
if (celGain > 0.001) {
|
|
201
|
+
let ink = vec3<f32>(0.0); // pure ink — the technicolor 2-tone shadow
|
|
202
|
+
let celA = clamp(celGain, 0.0, 1.0);
|
|
203
|
+
// the rope cel (one offset distance-to-curve band).
|
|
204
|
+
for (var i = 0; i < MAX_CURVE_SAMPLES; i = i + 1) {
|
|
205
|
+
if (i >= sampleCount - 1) { break; }
|
|
206
|
+
let sa = curveSamples[i].xy + celOff;
|
|
207
|
+
let sb = curveSamples[i + 1].xy + celOff;
|
|
208
|
+
let d = segDist(p, sa, sb);
|
|
209
|
+
let cover = 1.0 - smoothstep(halfW, halfW + aa, d);
|
|
210
|
+
if (cover < 0.002) { continue; }
|
|
211
|
+
let m = cover * celA * peak;
|
|
212
|
+
accum = vec4<f32>(ink * m, m) + accum * (1.0 - m);
|
|
213
|
+
}
|
|
214
|
+
// the chain cel (arms only — the bold scaffold ink).
|
|
215
|
+
if (showEpicycles && armCount >= 1) {
|
|
216
|
+
for (var k = 0; k < MAX_PHASORS; k = k + 1) {
|
|
217
|
+
if (k >= armCount) { break; }
|
|
218
|
+
let a = chainTips[k].xy + celOff;
|
|
219
|
+
let b = chainTips[k + 1].xy + celOff;
|
|
220
|
+
let dArm = segDist(p, a, b);
|
|
221
|
+
let armMask = 1.0 - smoothstep(halfW * 0.55, halfW * 0.55 + aa, dArm);
|
|
222
|
+
let m = armMask * celA * peak * 0.7;
|
|
223
|
+
accum = vec4<f32>(ink * m, m) + accum * (1.0 - m);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
144
228
|
// ── Epicycle scaffolding (orbit rings + arms + joint dots) UNDER the curve ──
|
|
145
229
|
if (showEpicycles && armCount >= 1) {
|
|
146
230
|
for (var k = 0; k < MAX_PHASORS; k = k + 1) {
|
|
@@ -185,10 +269,12 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
185
269
|
accum = vec4<f32>(rgb * a, a) + accum * (1.0 - a);
|
|
186
270
|
}
|
|
187
271
|
|
|
188
|
-
// ── The comet HEAD — halo + saturated core + white specular
|
|
272
|
+
// ── The comet HEAD — squash-and-stretch (§2b) halo + saturated core + white specular.
|
|
273
|
+
// dHead is the volume-preserving anisotropic distance off the travel frame; at rest
|
|
274
|
+
// (sHat=0) or squashGain=0 it collapses to the round disc length(p − head). ──
|
|
189
275
|
if (sampleCount >= 1) {
|
|
190
276
|
let head = curveSamples[0].xy;
|
|
191
|
-
let dHead =
|
|
277
|
+
let dHead = headAniso(p, head, headFr, squashGain);
|
|
192
278
|
let coreR = halfW * 1.5;
|
|
193
279
|
let haloR = coreR * 3.0;
|
|
194
280
|
let headLin = samplePaletteLin(0.0);
|
|
@@ -206,11 +292,11 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
206
292
|
|
|
207
293
|
return accum;
|
|
208
294
|
}
|
|
209
|
-
`,
|
|
295
|
+
`, B = {
|
|
210
296
|
c0: 0,
|
|
211
297
|
ints: 4
|
|
212
298
|
};
|
|
213
|
-
function
|
|
299
|
+
function V() {
|
|
214
300
|
let e = /* @__PURE__ */ new ArrayBuffer(32);
|
|
215
301
|
return {
|
|
216
302
|
buffer: e,
|
|
@@ -218,26 +304,27 @@ function L() {
|
|
|
218
304
|
i32: new Int32Array(e)
|
|
219
305
|
};
|
|
220
306
|
}
|
|
221
|
-
function
|
|
307
|
+
function H(e, t, n, r, i, a, o) {
|
|
222
308
|
let { f32: s, i32: c } = e;
|
|
223
|
-
return s[
|
|
309
|
+
return s[B.c0 + 0] = t, s[B.c0 + 1] = n, s[B.c0 + 2] = 0, s[B.c0 + 3] = 0, c[B.ints + 0] = r, c[B.ints + 1] = i, c[B.ints + 2] = a, c[B.ints + 3] = o, e;
|
|
224
310
|
}
|
|
225
|
-
var
|
|
311
|
+
var U = 144, W = {
|
|
226
312
|
r0: 0,
|
|
227
313
|
r1: 4,
|
|
228
314
|
r2: 8,
|
|
229
|
-
|
|
230
|
-
|
|
315
|
+
r3: 12,
|
|
316
|
+
ints: 16,
|
|
317
|
+
palette: 20
|
|
231
318
|
};
|
|
232
|
-
function
|
|
233
|
-
let e = new ArrayBuffer(
|
|
319
|
+
function G() {
|
|
320
|
+
let e = new ArrayBuffer(U);
|
|
234
321
|
return {
|
|
235
322
|
buffer: e,
|
|
236
323
|
f32: new Float32Array(e),
|
|
237
324
|
i32: new Int32Array(e)
|
|
238
325
|
};
|
|
239
326
|
}
|
|
240
|
-
function
|
|
327
|
+
function K(e) {
|
|
241
328
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity, a = e;
|
|
242
329
|
for (let e = 0; e < 720; e++) {
|
|
243
330
|
let o = m(a, e / 720), [s, c] = o[o.length - 1];
|
|
@@ -255,22 +342,29 @@ function H(e) {
|
|
|
255
342
|
scale: c
|
|
256
343
|
};
|
|
257
344
|
}
|
|
258
|
-
function
|
|
345
|
+
function ee(e, t, n, r) {
|
|
346
|
+
let i = Math.max(r, 1e-4), a = (e - n.centerX) * n.scale / i, o = (t - n.centerY) * n.scale;
|
|
347
|
+
return {
|
|
348
|
+
x: a * .5 + .5,
|
|
349
|
+
y: 1 - (o * .5 + .5)
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
function q(e, t, n) {
|
|
259
353
|
let r = Math.max(n, 1) / 2;
|
|
260
354
|
return e / Math.max(t, 1e-6) / r;
|
|
261
355
|
}
|
|
262
|
-
function
|
|
263
|
-
let { f32:
|
|
264
|
-
|
|
265
|
-
let
|
|
266
|
-
|
|
356
|
+
function te(e, t, n, r, i, a, o, s, c, u, d, f, p, m, h, g) {
|
|
357
|
+
let { f32: _, i32: v } = e;
|
|
358
|
+
_[W.r0 + 0] = t.centerX, _[W.r0 + 1] = t.centerY, _[W.r0 + 2] = t.scale, _[W.r0 + 3] = n, _[W.r1 + 0] = r, _[W.r1 + 1] = i, _[W.r1 + 2] = a, _[W.r1 + 3] = o, _[W.r2 + 0] = s, _[W.r2 + 1] = c, _[W.r2 + 2] = +!!u, _[W.r2 + 3] = +!!d, _[W.r3 + 0] = f, _[W.r3 + 1] = p, _[W.r3 + 2] = 0, _[W.r3 + 3] = 0;
|
|
359
|
+
let y = Math.min(g.length, 4);
|
|
360
|
+
v[W.ints + 0] = m, v[W.ints + 1] = h, v[W.ints + 2] = y, v[W.ints + 3] = 0;
|
|
267
361
|
for (let e = 0; e < 4; e++) {
|
|
268
|
-
let t =
|
|
269
|
-
|
|
362
|
+
let t = W.palette + e * 4, n = l(g[Math.min(e, y - 1)] ?? g[0]);
|
|
363
|
+
_[t + 0] = n[0], _[t + 1] = n[1], _[t + 2] = n[2], _[t + 3] = 0;
|
|
270
364
|
}
|
|
271
365
|
return e;
|
|
272
366
|
}
|
|
273
|
-
function
|
|
367
|
+
function ne(e) {
|
|
274
368
|
let t = Math.min(e.length, 64), n = new Float32Array(256);
|
|
275
369
|
for (let r = 0; r < t; r++) {
|
|
276
370
|
let t = e[r], i = r * 4;
|
|
@@ -280,119 +374,119 @@ function ee(e) {
|
|
|
280
374
|
}
|
|
281
375
|
//#endregion
|
|
282
376
|
//#region src/components/custom/fourier-field/composables/fourierFieldWGPUSetup.ts
|
|
283
|
-
var
|
|
284
|
-
function
|
|
285
|
-
let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: c } = e;
|
|
286
|
-
return function(e,
|
|
287
|
-
let
|
|
377
|
+
var J = 64, Y = 128, X = 8, re = 1, Z = 2, Q = 4, ie = 64, ae = .92, oe = .95, se = 1.35, ce = .34;
|
|
378
|
+
function le(e) {
|
|
379
|
+
let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: c } = e, l = e.getPointerLean;
|
|
380
|
+
return function(e, u, d) {
|
|
381
|
+
let f = e.createShaderModule({
|
|
288
382
|
label: "[FourierField] fourier-field.compute.wgsl",
|
|
289
|
-
code:
|
|
290
|
-
}),
|
|
383
|
+
code: R
|
|
384
|
+
}), p = e.createShaderModule({
|
|
291
385
|
label: "[FourierField] fourier-field.render.wgsl",
|
|
292
|
-
code:
|
|
293
|
-
}),
|
|
386
|
+
code: z
|
|
387
|
+
}), m = e.createBuffer({
|
|
294
388
|
label: "[FourierField] phasors",
|
|
295
389
|
size: 1024,
|
|
296
|
-
usage:
|
|
297
|
-
}),
|
|
390
|
+
usage: Y | X
|
|
391
|
+
}), h = e.createBuffer({
|
|
298
392
|
label: "[FourierField] curve-samples",
|
|
299
393
|
size: 384 * 16,
|
|
300
|
-
usage:
|
|
301
|
-
}),
|
|
394
|
+
usage: Y
|
|
395
|
+
}), g = e.createBuffer({
|
|
302
396
|
label: "[FourierField] chain-tips",
|
|
303
397
|
size: 1040,
|
|
304
|
-
usage:
|
|
305
|
-
}), g = e.createBuffer({
|
|
306
|
-
label: "[FourierField] compute-uniforms",
|
|
307
|
-
size: L().buffer.byteLength,
|
|
308
|
-
usage: G | q
|
|
398
|
+
usage: Y
|
|
309
399
|
}), _ = e.createBuffer({
|
|
310
|
-
label: "[FourierField]
|
|
400
|
+
label: "[FourierField] compute-uniforms",
|
|
311
401
|
size: V().buffer.byteLength,
|
|
312
|
-
usage:
|
|
313
|
-
}), v = e.
|
|
402
|
+
usage: J | X
|
|
403
|
+
}), v = e.createBuffer({
|
|
404
|
+
label: "[FourierField] render-uniforms",
|
|
405
|
+
size: G().buffer.byteLength,
|
|
406
|
+
usage: J | X
|
|
407
|
+
}), y = e.createBindGroupLayout({
|
|
314
408
|
label: "[FourierField] compute-bgl",
|
|
315
409
|
entries: [
|
|
316
410
|
{
|
|
317
411
|
binding: 0,
|
|
318
|
-
visibility:
|
|
412
|
+
visibility: Q,
|
|
319
413
|
buffer: { type: "uniform" }
|
|
320
414
|
},
|
|
321
415
|
{
|
|
322
416
|
binding: 1,
|
|
323
|
-
visibility:
|
|
417
|
+
visibility: Q,
|
|
324
418
|
buffer: { type: "read-only-storage" }
|
|
325
419
|
},
|
|
326
420
|
{
|
|
327
421
|
binding: 2,
|
|
328
|
-
visibility:
|
|
422
|
+
visibility: Q,
|
|
329
423
|
buffer: { type: "storage" }
|
|
330
424
|
},
|
|
331
425
|
{
|
|
332
426
|
binding: 3,
|
|
333
|
-
visibility:
|
|
427
|
+
visibility: Q,
|
|
334
428
|
buffer: { type: "storage" }
|
|
335
429
|
}
|
|
336
430
|
]
|
|
337
|
-
}),
|
|
431
|
+
}), b = e.createComputePipeline({
|
|
338
432
|
label: "[FourierField] compute-pipeline",
|
|
339
|
-
layout: e.createPipelineLayout({ bindGroupLayouts: [
|
|
433
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [y] }),
|
|
340
434
|
compute: {
|
|
341
|
-
module:
|
|
435
|
+
module: f,
|
|
342
436
|
entryPoint: "cs_main"
|
|
343
437
|
}
|
|
344
|
-
}),
|
|
438
|
+
}), x = e.createBindGroup({
|
|
345
439
|
label: "[FourierField] compute-bg",
|
|
346
|
-
layout:
|
|
440
|
+
layout: y,
|
|
347
441
|
entries: [
|
|
348
442
|
{
|
|
349
443
|
binding: 0,
|
|
350
|
-
resource: { buffer:
|
|
444
|
+
resource: { buffer: _ }
|
|
351
445
|
},
|
|
352
446
|
{
|
|
353
447
|
binding: 1,
|
|
354
|
-
resource: { buffer:
|
|
448
|
+
resource: { buffer: m }
|
|
355
449
|
},
|
|
356
450
|
{
|
|
357
451
|
binding: 2,
|
|
358
|
-
resource: { buffer:
|
|
452
|
+
resource: { buffer: h }
|
|
359
453
|
},
|
|
360
454
|
{
|
|
361
455
|
binding: 3,
|
|
362
|
-
resource: { buffer:
|
|
456
|
+
resource: { buffer: g }
|
|
363
457
|
}
|
|
364
458
|
]
|
|
365
|
-
}),
|
|
459
|
+
}), S = e.createBindGroupLayout({
|
|
366
460
|
label: "[FourierField] render-bgl",
|
|
367
461
|
entries: [
|
|
368
462
|
{
|
|
369
463
|
binding: 0,
|
|
370
|
-
visibility:
|
|
464
|
+
visibility: re | Z,
|
|
371
465
|
buffer: { type: "uniform" }
|
|
372
466
|
},
|
|
373
467
|
{
|
|
374
468
|
binding: 1,
|
|
375
|
-
visibility:
|
|
469
|
+
visibility: Z,
|
|
376
470
|
buffer: { type: "read-only-storage" }
|
|
377
471
|
},
|
|
378
472
|
{
|
|
379
473
|
binding: 2,
|
|
380
|
-
visibility:
|
|
474
|
+
visibility: Z,
|
|
381
475
|
buffer: { type: "read-only-storage" }
|
|
382
476
|
}
|
|
383
477
|
]
|
|
384
|
-
}),
|
|
478
|
+
}), C = e.createRenderPipeline({
|
|
385
479
|
label: "[FourierField] render-pipeline",
|
|
386
|
-
layout: e.createPipelineLayout({ bindGroupLayouts: [
|
|
480
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [S] }),
|
|
387
481
|
vertex: {
|
|
388
|
-
module:
|
|
482
|
+
module: p,
|
|
389
483
|
entryPoint: "vs_main"
|
|
390
484
|
},
|
|
391
485
|
fragment: {
|
|
392
|
-
module:
|
|
486
|
+
module: p,
|
|
393
487
|
entryPoint: "fs_main",
|
|
394
488
|
targets: [{
|
|
395
|
-
format:
|
|
489
|
+
format: d,
|
|
396
490
|
blend: {
|
|
397
491
|
color: {
|
|
398
492
|
srcFactor: "one",
|
|
@@ -408,46 +502,53 @@ function se(e) {
|
|
|
408
502
|
}]
|
|
409
503
|
},
|
|
410
504
|
primitive: { topology: "triangle-list" }
|
|
411
|
-
}),
|
|
505
|
+
}), w = e.createBindGroup({
|
|
412
506
|
label: "[FourierField] render-bg",
|
|
413
|
-
layout:
|
|
507
|
+
layout: S,
|
|
414
508
|
entries: [
|
|
415
509
|
{
|
|
416
510
|
binding: 0,
|
|
417
|
-
resource: { buffer:
|
|
511
|
+
resource: { buffer: v }
|
|
418
512
|
},
|
|
419
513
|
{
|
|
420
514
|
binding: 1,
|
|
421
|
-
resource: { buffer:
|
|
515
|
+
resource: { buffer: h }
|
|
422
516
|
},
|
|
423
517
|
{
|
|
424
518
|
binding: 2,
|
|
425
|
-
resource: { buffer:
|
|
519
|
+
resource: { buffer: g }
|
|
426
520
|
}
|
|
427
521
|
]
|
|
428
|
-
}),
|
|
522
|
+
}), T = V(), E = G(), D = null, O = {
|
|
429
523
|
centerX: 0,
|
|
430
524
|
centerY: 0,
|
|
431
525
|
scale: 1
|
|
432
|
-
},
|
|
433
|
-
function
|
|
526
|
+
}, k = 0;
|
|
527
|
+
function A() {
|
|
434
528
|
let t = r();
|
|
435
|
-
t !==
|
|
529
|
+
t !== D && (D = t, k = Math.min(t.length, 64), O = K(t), e.queue.writeBuffer(m, 0, ne(t)));
|
|
436
530
|
}
|
|
437
|
-
function
|
|
531
|
+
function j() {
|
|
438
532
|
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
533
|
(t.width !== i || t.height !== a) && (t.width = i, t.height = a);
|
|
440
534
|
}
|
|
441
|
-
function
|
|
442
|
-
c?.(r),
|
|
443
|
-
let o = a(), s = Math.max(1, Math.min(Math.round(n.harmonics),
|
|
444
|
-
|
|
445
|
-
let
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
535
|
+
function M(r) {
|
|
536
|
+
c?.(r), A();
|
|
537
|
+
let o = a(), s = Math.max(1, Math.min(Math.round(n.harmonics), k)), d = n.showEpicycles ? Math.max(1, Math.min(Math.round(n.epicycleArms), s)) : 0;
|
|
538
|
+
H(T, o, n.trailArc, s, d, 384, k), e.queue.writeBuffer(_, 0, T.buffer);
|
|
539
|
+
let f = Math.min(t.clientWidth || 320, t.clientHeight || 320), p = (t.clientWidth || 320) / Math.max(t.clientHeight || 320, 1), m = q(n.trailWidth, O.scale, f), h = l?.() ?? {
|
|
540
|
+
x: 0,
|
|
541
|
+
y: 0
|
|
542
|
+
};
|
|
543
|
+
te(E, h.x !== 0 || h.y !== 0 ? {
|
|
544
|
+
...O,
|
|
545
|
+
centerX: O.centerX - h.x,
|
|
546
|
+
centerY: O.centerY - h.y
|
|
547
|
+
} : O, p, m, ae, oe, se, ce, n.intensity, n.showEpicycles, n.rainbowChain, n.squashGain, n.celGain, 384, d, i()), e.queue.writeBuffer(v, 0, E.buffer);
|
|
548
|
+
let g = e.createCommandEncoder({ label: "[FourierField] frame" }), y = g.beginComputePass();
|
|
549
|
+
y.setPipeline(b), y.setBindGroup(0, x), y.dispatchWorkgroups(Math.ceil(384 / ie)), y.end();
|
|
550
|
+
let S = u.getCurrentTexture().createView(), D = g.beginRenderPass({ colorAttachments: [{
|
|
551
|
+
view: S,
|
|
451
552
|
clearValue: {
|
|
452
553
|
r: 0,
|
|
453
554
|
g: 0,
|
|
@@ -457,25 +558,28 @@ function se(e) {
|
|
|
457
558
|
loadOp: "clear",
|
|
458
559
|
storeOp: "store"
|
|
459
560
|
}] });
|
|
460
|
-
|
|
561
|
+
D.setPipeline(C), D.setBindGroup(0, w), D.draw(3, 1, 0, 0), D.end(), e.queue.submit([g.finish()]);
|
|
461
562
|
}
|
|
462
563
|
return {
|
|
463
|
-
frame:
|
|
564
|
+
frame: M,
|
|
464
565
|
shouldContinue: o,
|
|
465
|
-
resize:
|
|
566
|
+
resize: j,
|
|
466
567
|
teardown: () => {
|
|
467
|
-
|
|
568
|
+
m.destroy(), h.destroy(), g.destroy(), _.destroy(), v.destroy();
|
|
468
569
|
}
|
|
469
570
|
};
|
|
470
571
|
};
|
|
471
572
|
}
|
|
472
573
|
//#endregion
|
|
473
574
|
//#region src/components/custom/fourier-field/shaders/fourier-field.glsl.ts
|
|
474
|
-
var
|
|
575
|
+
var ue = "#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", de = `#version 300 es
|
|
475
576
|
precision highp float;
|
|
476
577
|
|
|
477
578
|
#define MAX_CURVE_SAMPLES 256
|
|
478
579
|
#define MAX_PHASORS 64
|
|
580
|
+
// BD.W-FOURIER-LOOM §2b — MUST equal the WGSL twin + FOURIER_TANGENT_EPS (constants.ts).
|
|
581
|
+
#define TANGENT_EPS 1e-4
|
|
582
|
+
#define SPEED_REF_HALFWIDTHS 6.0
|
|
479
583
|
|
|
480
584
|
in vec2 vClip;
|
|
481
585
|
out vec4 fragColor;
|
|
@@ -483,6 +587,7 @@ out vec4 fragColor;
|
|
|
483
587
|
uniform vec4 uFit; // (centerX, centerY, scale, aspect)
|
|
484
588
|
uniform vec4 uTrail; // (trailWidth, peakAlpha, headGlowAlpha, trailFadeExp)
|
|
485
589
|
uniform vec4 uEnv; // (trailFloor, intensity, showEpicycles, rainbowChain)
|
|
590
|
+
uniform vec4 uLoom; // (squashGain, celGain, _pad, _pad) — FOURIER-LOOM §2b/§3b
|
|
486
591
|
uniform int uSampleCount;
|
|
487
592
|
uniform int uArmCount;
|
|
488
593
|
uniform int uStopCount;
|
|
@@ -528,6 +633,31 @@ float segDist(vec2 p, vec2 a, vec2 b) {
|
|
|
528
633
|
return length(pa - ba * h);
|
|
529
634
|
}
|
|
530
635
|
|
|
636
|
+
// BD.W-FOURIER-LOOM §2b — the head travel frame (T, ŝ), the GLSL twin of the WGSL headFrame.
|
|
637
|
+
// The cusp guard returns +x as the stable fallback when s ≤ TANGENT_EPS — identical to the
|
|
638
|
+
// WGSL twin + the CPU bead path.
|
|
639
|
+
struct HeadFrame { vec2 T; float sHat; };
|
|
640
|
+
HeadFrame headFrame(vec2 head, vec2 headBack, float halfW) {
|
|
641
|
+
vec2 d = head - headBack;
|
|
642
|
+
float s = length(d);
|
|
643
|
+
HeadFrame fr;
|
|
644
|
+
if (s <= TANGENT_EPS) { fr.T = vec2(1.0, 0.0); fr.sHat = 0.0; return fr; }
|
|
645
|
+
fr.T = d / s;
|
|
646
|
+
float refScale = max(halfW * SPEED_REF_HALFWIDTHS, 1e-6);
|
|
647
|
+
fr.sHat = clamp(s / refScale, 0.0, 1.0);
|
|
648
|
+
return fr;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// The volume-preserving anisotropic head distance (the WGSL headAniso twin).
|
|
652
|
+
float headAniso(vec2 p, vec2 head, HeadFrame fr, float k) {
|
|
653
|
+
float g = 1.0 + k * fr.sHat;
|
|
654
|
+
vec2 n = vec2(-fr.T.y, fr.T.x);
|
|
655
|
+
vec2 rel = p - head;
|
|
656
|
+
float along = dot(rel, fr.T) / g;
|
|
657
|
+
float across = dot(rel, n) * g;
|
|
658
|
+
return length(vec2(along, across));
|
|
659
|
+
}
|
|
660
|
+
|
|
531
661
|
void main() {
|
|
532
662
|
vec2 center = uFit.xy;
|
|
533
663
|
float scale = max(uFit.z, 1e-6);
|
|
@@ -543,10 +673,49 @@ void main() {
|
|
|
543
673
|
float trailFloor = uEnv.x;
|
|
544
674
|
bool showEpicycles = uEnv.z > 0.5;
|
|
545
675
|
bool rainbow = uEnv.w > 0.5;
|
|
676
|
+
float squashGain = uLoom.x; // FOURIER-LOOM §2b
|
|
677
|
+
float celGain = uLoom.y; // FOURIER-LOOM §3b
|
|
546
678
|
float halfW = trailWidth * 0.5;
|
|
547
679
|
|
|
680
|
+
// §2b — the head travel frame (SAME uCurve[0]/[1] the WGSL twin reads → parity).
|
|
681
|
+
HeadFrame headFr;
|
|
682
|
+
headFr.T = vec2(1.0, 0.0);
|
|
683
|
+
headFr.sHat = 0.0;
|
|
684
|
+
if (uSampleCount >= 2) {
|
|
685
|
+
headFr = headFrame(uCurve[0].xy, uCurve[1].xy, halfW);
|
|
686
|
+
}
|
|
687
|
+
vec2 celOff = -headFr.T * halfW * 1.4;
|
|
688
|
+
|
|
548
689
|
vec4 accum = vec4(0.0);
|
|
549
690
|
|
|
691
|
+
// §3b — the cartoon CEL-SHADOW: a darker offset copy of the rope + chain, opposite travel,
|
|
692
|
+
// painted FIRST (under the lit chain). PRM-static; celGain = 0 → no pass (byte-frozen).
|
|
693
|
+
if (celGain > 0.001) {
|
|
694
|
+
vec3 ink = vec3(0.0);
|
|
695
|
+
float celA = clamp(celGain, 0.0, 1.0);
|
|
696
|
+
for (int i = 0; i < MAX_CURVE_SAMPLES; i++) {
|
|
697
|
+
if (i >= uSampleCount - 1) break;
|
|
698
|
+
vec2 sa = uCurve[i].xy + celOff;
|
|
699
|
+
vec2 sb = uCurve[i + 1].xy + celOff;
|
|
700
|
+
float d = segDist(p, sa, sb);
|
|
701
|
+
float cover = 1.0 - smoothstep(halfW, halfW + aa, d);
|
|
702
|
+
if (cover < 0.002) continue;
|
|
703
|
+
float m = cover * celA * peak;
|
|
704
|
+
accum = vec4(ink * m, m) + accum * (1.0 - m);
|
|
705
|
+
}
|
|
706
|
+
if (showEpicycles && uArmCount >= 1) {
|
|
707
|
+
for (int k = 0; k < MAX_PHASORS; k++) {
|
|
708
|
+
if (k >= uArmCount) break;
|
|
709
|
+
vec2 a = uChain[k] + celOff;
|
|
710
|
+
vec2 b = uChain[k + 1] + celOff;
|
|
711
|
+
float dArm = segDist(p, a, b);
|
|
712
|
+
float armMask = 1.0 - smoothstep(halfW * 0.55, halfW * 0.55 + aa, dArm);
|
|
713
|
+
float m = armMask * celA * peak * 0.7;
|
|
714
|
+
accum = vec4(ink * m, m) + accum * (1.0 - m);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
550
719
|
if (showEpicycles && uArmCount >= 1) {
|
|
551
720
|
for (int k = 0; k < MAX_PHASORS; k++) {
|
|
552
721
|
if (k >= uArmCount) break;
|
|
@@ -586,7 +755,8 @@ void main() {
|
|
|
586
755
|
|
|
587
756
|
if (uSampleCount >= 1) {
|
|
588
757
|
vec2 head = uCurve[0].xy;
|
|
589
|
-
|
|
758
|
+
// §2b — the squash-and-stretch anisotropic head (collapses to the round disc at rest).
|
|
759
|
+
float dHead = headAniso(p, head, headFr, squashGain);
|
|
590
760
|
float coreR = halfW * 1.5;
|
|
591
761
|
float haloR = coreR * 3.0;
|
|
592
762
|
vec3 headRgb = clamp(linearToSrgb(samplePaletteLin(0.0)), vec3(0.0), vec3(1.0));
|
|
@@ -600,8 +770,8 @@ void main() {
|
|
|
600
770
|
|
|
601
771
|
fragColor = accum;
|
|
602
772
|
}
|
|
603
|
-
`,
|
|
604
|
-
function
|
|
773
|
+
`, fe = 256, $ = 64, pe = .92, me = .95, he = 1.35, ge = .34;
|
|
774
|
+
function _e(e, t, n) {
|
|
605
775
|
let r = e.createShader(t);
|
|
606
776
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
607
777
|
let t = e.getShaderInfoLog(r);
|
|
@@ -609,16 +779,16 @@ function Q(e, t, n) {
|
|
|
609
779
|
}
|
|
610
780
|
return r;
|
|
611
781
|
}
|
|
612
|
-
function
|
|
613
|
-
let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: c } = e;
|
|
782
|
+
function ve(e) {
|
|
783
|
+
let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: c } = e, u = e.getPointerLean;
|
|
614
784
|
return function(e) {
|
|
615
|
-
let
|
|
616
|
-
if (e.attachShader(
|
|
617
|
-
e.deleteShader(
|
|
618
|
-
let
|
|
619
|
-
e.bindVertexArray(
|
|
620
|
-
let
|
|
621
|
-
e.bindBuffer(e.ARRAY_BUFFER,
|
|
785
|
+
let d = _e(e, e.VERTEX_SHADER, ue), f = _e(e, e.FRAGMENT_SHADER, de), p = e.createProgram();
|
|
786
|
+
if (e.attachShader(p, d), e.attachShader(p, f), e.linkProgram(p), !e.getProgramParameter(p, e.LINK_STATUS)) throw Error(`[FourierField] link failed: ${e.getProgramInfoLog(p)}`);
|
|
787
|
+
e.deleteShader(d), e.deleteShader(f);
|
|
788
|
+
let m = e.createVertexArray();
|
|
789
|
+
e.bindVertexArray(m);
|
|
790
|
+
let g = e.createBuffer();
|
|
791
|
+
e.bindBuffer(e.ARRAY_BUFFER, g), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
|
|
622
792
|
-1,
|
|
623
793
|
-1,
|
|
624
794
|
3,
|
|
@@ -626,141 +796,195 @@ function me(e) {
|
|
|
626
796
|
-1,
|
|
627
797
|
3
|
|
628
798
|
]), e.STATIC_DRAW);
|
|
629
|
-
let
|
|
630
|
-
e.enableVertexAttribArray(
|
|
631
|
-
let
|
|
799
|
+
let _ = e.getAttribLocation(p, "aPosition");
|
|
800
|
+
e.enableVertexAttribArray(_), e.vertexAttribPointer(_, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
|
|
801
|
+
let v = (t) => e.getUniformLocation(p, t), y = v("uFit"), b = v("uTrail"), x = v("uEnv"), S = v("uLoom"), C = v("uSampleCount"), w = v("uArmCount"), T = v("uStopCount"), E = v("uPalette[0]"), D = v("uCurve[0]"), O = v("uChain[0]"), k = new Float32Array(fe * 3), A = new Float32Array(($ + 1) * 2), j = new Float32Array(12), M = null, N = {
|
|
632
802
|
centerX: 0,
|
|
633
803
|
centerY: 0,
|
|
634
804
|
scale: 1
|
|
635
|
-
},
|
|
636
|
-
function
|
|
805
|
+
}, P = 0;
|
|
806
|
+
function F() {
|
|
637
807
|
let e = r();
|
|
638
|
-
e !==
|
|
808
|
+
e !== M && (M = e, P = Math.min(e.length, $), N = K(e));
|
|
639
809
|
}
|
|
640
|
-
function
|
|
810
|
+
function I() {
|
|
641
811
|
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
812
|
(t.width !== a || t.height !== o) && (t.width = a, t.height = o), e.viewport(0, 0, t.width, t.height);
|
|
643
813
|
}
|
|
644
|
-
function
|
|
645
|
-
c?.(r),
|
|
646
|
-
let o =
|
|
814
|
+
function L(r) {
|
|
815
|
+
c?.(r), F();
|
|
816
|
+
let o = M;
|
|
647
817
|
if (!o) return;
|
|
648
|
-
let s = a(),
|
|
649
|
-
for (let e = 0; e <
|
|
650
|
-
let t = e /
|
|
818
|
+
let s = a(), d = Math.max(1, Math.min(Math.round(n.harmonics), P)), f = n.showEpicycles ? Math.max(1, Math.min(Math.round(n.epicycleArms), d)) : 0, g = fe, _ = Math.max(g - 1, 1);
|
|
819
|
+
for (let e = 0; e < g; e++) {
|
|
820
|
+
let t = e / _, r = 1 - t, i = s - n.trailArc * t;
|
|
651
821
|
i -= Math.floor(i);
|
|
652
|
-
let [a, c] = h(o, i,
|
|
653
|
-
|
|
822
|
+
let [a, c] = h(o, i, d), l = e * 3;
|
|
823
|
+
k[l + 0] = a, k[l + 1] = c, k[l + 2] = r;
|
|
654
824
|
}
|
|
655
|
-
let
|
|
656
|
-
for (let e = 0; e <=
|
|
825
|
+
let v = Math.min(f, d);
|
|
826
|
+
for (let e = 0; e <= $; e++) {
|
|
657
827
|
let t = e * 2;
|
|
658
|
-
if (e <=
|
|
828
|
+
if (e <= v) {
|
|
659
829
|
let [n, r] = h(o, s, e);
|
|
660
|
-
|
|
661
|
-
} else
|
|
830
|
+
A[t + 0] = n, A[t + 1] = r;
|
|
831
|
+
} else A[t + 0] = 0, A[t + 1] = 0;
|
|
662
832
|
}
|
|
663
|
-
let
|
|
833
|
+
let I = t.clientWidth || 320, L = t.clientHeight || 320, R = Math.min(I, L), z = I / Math.max(L, 1), B = q(n.trailWidth, N.scale, R), V = i(), H = Math.min(V.length, 4);
|
|
664
834
|
for (let e = 0; e < 4; e++) {
|
|
665
|
-
let t = l(
|
|
666
|
-
|
|
835
|
+
let t = l(V[Math.min(e, H - 1)] ?? V[0]);
|
|
836
|
+
j[e * 3 + 0] = t[0], j[e * 3 + 1] = t[1], j[e * 3 + 2] = t[2];
|
|
667
837
|
}
|
|
668
|
-
e.useProgram(
|
|
838
|
+
e.useProgram(p), e.bindVertexArray(m), 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);
|
|
839
|
+
let U = u?.() ?? {
|
|
840
|
+
x: 0,
|
|
841
|
+
y: 0
|
|
842
|
+
};
|
|
843
|
+
e.uniform4f(y, N.centerX - U.x, N.centerY - U.y, N.scale, z), e.uniform4f(b, B, pe, me, he), e.uniform4f(x, ge, n.intensity, +!!n.showEpicycles, +!!n.rainbowChain), e.uniform4f(S, n.squashGain, n.celGain, 0, 0), e.uniform1i(C, g), e.uniform1i(w, f), e.uniform1i(T, H), e.uniform3fv(E, j), e.uniform3fv(D, k), e.uniform2fv(O, A), e.drawArrays(e.TRIANGLES, 0, 3);
|
|
669
844
|
}
|
|
670
845
|
return {
|
|
671
|
-
frame:
|
|
846
|
+
frame: L,
|
|
672
847
|
shouldContinue: o,
|
|
673
|
-
resize:
|
|
848
|
+
resize: I,
|
|
674
849
|
teardown: () => {
|
|
675
|
-
e.deleteProgram(
|
|
850
|
+
e.deleteProgram(p), e.deleteBuffer(g), e.deleteVertexArray(m);
|
|
676
851
|
}
|
|
677
852
|
};
|
|
678
853
|
};
|
|
679
854
|
}
|
|
680
855
|
//#endregion
|
|
681
856
|
//#region src/components/custom/fourier-field/composables/useFourierField.ts
|
|
682
|
-
function
|
|
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 =
|
|
684
|
-
function
|
|
857
|
+
function ye(e, t) {
|
|
858
|
+
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 = 0;
|
|
859
|
+
function m(e) {
|
|
860
|
+
if (f === 0 && p === 0) return;
|
|
861
|
+
let t = -64 * f - 2 * .62 * 8 * p;
|
|
862
|
+
p += t * e, f += p * e, Math.abs(f) < 1e-4 && Math.abs(p) < 1e-4 && (f = 0, p = 0);
|
|
863
|
+
}
|
|
864
|
+
let g = n({ respectReducedMotion: r.respectReducedMotion }), _ = () => (t.freeze?.() ?? !1) || (F?.reducedMotion ?? !1);
|
|
865
|
+
function v(e) {
|
|
866
|
+
y(e), t.onHeadFrame?.(E());
|
|
867
|
+
}
|
|
868
|
+
function y(e) {
|
|
685
869
|
let t = d >= 0 ? (e - d) * 1e3 : 16.7;
|
|
686
|
-
if (d = e,
|
|
687
|
-
u = s, f = 0;
|
|
870
|
+
if (d = e, g.tick(t), _()) {
|
|
871
|
+
u = s, f = 0, p = 0;
|
|
688
872
|
return;
|
|
689
873
|
}
|
|
690
874
|
let n = Math.min(Math.max(t / 1e3, 0), .05);
|
|
691
|
-
if (r.interactive &&
|
|
692
|
-
|
|
875
|
+
if (r.interactive && g.active.value) {
|
|
876
|
+
let e = r.speed / l + g.velocity.value.x * M + f;
|
|
877
|
+
u = (u + e * n) % 1, u < 0 && (u += 1);
|
|
878
|
+
let t = g.burst.value * 4;
|
|
879
|
+
t !== 0 && (f = t, p = 0), m(n);
|
|
693
880
|
return;
|
|
694
881
|
}
|
|
695
882
|
let i = r.speed / l + f;
|
|
696
|
-
u = (u + i * n) % 1, u < 0 && (u += 1),
|
|
883
|
+
u = (u + i * n) % 1, u < 0 && (u += 1), m(n);
|
|
697
884
|
}
|
|
698
|
-
let
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
},
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
885
|
+
let b = () => u, x = null, S = {
|
|
886
|
+
centerX: 0,
|
|
887
|
+
centerY: 0,
|
|
888
|
+
scale: 1
|
|
889
|
+
}, C = () => {
|
|
890
|
+
let e = i();
|
|
891
|
+
return e !== x && (x = e, S = K(e)), S;
|
|
892
|
+
}, w = () => {
|
|
893
|
+
let e = i(), t = Math.max(1, Math.min(Math.round(r.harmonics), e.length, 64)), [n, a] = h(e, u, t);
|
|
894
|
+
return {
|
|
895
|
+
x: n,
|
|
896
|
+
y: a
|
|
897
|
+
};
|
|
898
|
+
}, E = () => {
|
|
899
|
+
let t = e.value;
|
|
900
|
+
if (!t) return null;
|
|
901
|
+
let n = t.clientWidth || 0, r = t.clientHeight || 0;
|
|
902
|
+
if (n <= 0 || r <= 0) return null;
|
|
903
|
+
let i = n / r, a = w(), o = C(), s = D(), c = s.x !== 0 || s.y !== 0 ? {
|
|
904
|
+
...o,
|
|
905
|
+
centerX: o.centerX - s.x,
|
|
906
|
+
centerY: o.centerY - s.y
|
|
907
|
+
} : o;
|
|
908
|
+
return ee(a.x, a.y, c, i);
|
|
909
|
+
}, D = () => {
|
|
910
|
+
if (!r.interactive || !g.active.value) return {
|
|
911
|
+
x: 0,
|
|
912
|
+
y: 0
|
|
913
|
+
};
|
|
914
|
+
let e = g.smoothedPosition.value;
|
|
915
|
+
return {
|
|
916
|
+
x: (e.x * 2 - 1) * N,
|
|
917
|
+
y: (e.y * 2 - 1) * N
|
|
918
|
+
};
|
|
919
|
+
}, O = (e) => {
|
|
920
|
+
g.onPointerMove(e), r.interactive && F?.wake();
|
|
921
|
+
}, k = () => {
|
|
922
|
+
g.onPointerEnter(), r.interactive && F?.wake();
|
|
923
|
+
}, A = (e) => e.parentElement ?? e;
|
|
924
|
+
function j(e) {
|
|
925
|
+
let t = A(e);
|
|
926
|
+
t.addEventListener("pointermove", O), t.addEventListener("pointerenter", k), t.addEventListener("pointerleave", g.onPointerLeave);
|
|
706
927
|
}
|
|
707
|
-
function
|
|
708
|
-
let t =
|
|
709
|
-
t.removeEventListener("pointermove",
|
|
928
|
+
function P(e) {
|
|
929
|
+
let t = A(e);
|
|
930
|
+
t.removeEventListener("pointermove", O), t.removeEventListener("pointerenter", k), t.removeEventListener("pointerleave", g.onPointerLeave);
|
|
710
931
|
}
|
|
711
|
-
let
|
|
932
|
+
let F = null, I = () => {
|
|
712
933
|
let t = e.value;
|
|
713
|
-
return t ? (
|
|
934
|
+
return t ? (F || (j(t), F = c(t, {
|
|
714
935
|
mode: o,
|
|
715
936
|
respectReducedMotion: r.respectReducedMotion,
|
|
716
|
-
setupWGPU:
|
|
937
|
+
setupWGPU: le({
|
|
717
938
|
canvas: t,
|
|
718
939
|
config: r,
|
|
719
940
|
getSpectrum: i,
|
|
720
941
|
getPalette: a,
|
|
721
|
-
getHeadT:
|
|
942
|
+
getHeadT: b,
|
|
722
943
|
shouldContinue: () => !0,
|
|
723
|
-
onFrame:
|
|
944
|
+
onFrame: v,
|
|
945
|
+
getPointerLean: D
|
|
724
946
|
}),
|
|
725
|
-
setupGL:
|
|
947
|
+
setupGL: ve({
|
|
726
948
|
canvas: t,
|
|
727
949
|
config: r,
|
|
728
950
|
getSpectrum: i,
|
|
729
951
|
getPalette: a,
|
|
730
|
-
getHeadT:
|
|
952
|
+
getHeadT: b,
|
|
731
953
|
shouldContinue: () => !0,
|
|
732
|
-
onFrame:
|
|
954
|
+
onFrame: v,
|
|
955
|
+
getPointerLean: D
|
|
733
956
|
})
|
|
734
|
-
}),
|
|
957
|
+
}), F.armAsync()), F) : null;
|
|
735
958
|
};
|
|
736
|
-
queueMicrotask(() =>
|
|
737
|
-
let
|
|
959
|
+
queueMicrotask(() => I());
|
|
960
|
+
let L = {
|
|
738
961
|
get backend() {
|
|
739
|
-
return
|
|
962
|
+
return I()?.backend ?? "webgpu";
|
|
740
963
|
},
|
|
741
|
-
pause: () =>
|
|
742
|
-
resume: () =>
|
|
743
|
-
wake: () =>
|
|
744
|
-
renderAt: (e) =>
|
|
964
|
+
pause: () => I()?.suspend("manual"),
|
|
965
|
+
resume: () => I()?.resume("manual"),
|
|
966
|
+
wake: () => I()?.wake(),
|
|
967
|
+
renderAt: (e) => I()?.renderAt(e),
|
|
745
968
|
get reducedMotion() {
|
|
746
|
-
return
|
|
969
|
+
return F?.reducedMotion ?? !1;
|
|
747
970
|
},
|
|
748
971
|
get headT() {
|
|
749
972
|
return u;
|
|
750
973
|
},
|
|
751
974
|
setHeadT: (e) => {
|
|
752
|
-
u = (e % 1 + 1) % 1,
|
|
975
|
+
u = (e % 1 + 1) % 1, I()?.wake();
|
|
753
976
|
},
|
|
977
|
+
headUnit: E,
|
|
754
978
|
dispose: () => {
|
|
755
979
|
let t = e.value;
|
|
756
|
-
t &&
|
|
980
|
+
t && P(t), g.dispose(), F?.dispose();
|
|
757
981
|
}
|
|
758
982
|
};
|
|
759
|
-
return T(() =>
|
|
983
|
+
return T(() => L.dispose()), L;
|
|
760
984
|
}
|
|
761
985
|
//#endregion
|
|
762
986
|
//#region src/components/custom/fourier-field/FourierField.vue
|
|
763
|
-
var
|
|
987
|
+
var be = /* @__PURE__ */ e(/* @__PURE__ */ S({
|
|
764
988
|
__name: "FourierField",
|
|
765
989
|
props: {
|
|
766
990
|
config: {},
|
|
@@ -777,7 +1001,7 @@ var he = /* @__PURE__ */ e(/* @__PURE__ */ S({
|
|
|
777
1001
|
},
|
|
778
1002
|
setup(e, { expose: n }) {
|
|
779
1003
|
let r = e, i = O("hostRef"), a = O("canvasRef"), { isDark: o } = d(), s = y(() => {
|
|
780
|
-
let e = r.config ??
|
|
1004
|
+
let e = r.config ?? L, t = r.intensity == null ? e.intensity : Math.max(0, Math.min(2, r.intensity)), n = r.config ? e.interactive : !1;
|
|
781
1005
|
return {
|
|
782
1006
|
...e,
|
|
783
1007
|
intensity: t,
|
|
@@ -820,23 +1044,43 @@ var he = /* @__PURE__ */ e(/* @__PURE__ */ S({
|
|
|
820
1044
|
}
|
|
821
1045
|
h.value = s.value.palette;
|
|
822
1046
|
}
|
|
823
|
-
let v =
|
|
824
|
-
|
|
1047
|
+
let v = () => h.value, S = new Proxy({}, {
|
|
1048
|
+
get: (e, t) => Reflect.get(s.value, t),
|
|
1049
|
+
has: (e, t) => Reflect.has(s.value, t),
|
|
1050
|
+
ownKeys: () => Reflect.ownKeys(s.value),
|
|
1051
|
+
getOwnPropertyDescriptor: (e, t) => Reflect.getOwnPropertyDescriptor(s.value, t)
|
|
1052
|
+
});
|
|
1053
|
+
function T(e) {
|
|
1054
|
+
let t = i.value;
|
|
1055
|
+
!t || !e || t.style.setProperty("--ff-head-xy", `${e.x.toFixed(4)} ${e.y.toFixed(4)}`);
|
|
1056
|
+
}
|
|
1057
|
+
let A = ye(a, {
|
|
1058
|
+
config: S,
|
|
825
1059
|
getSpectrum: l,
|
|
826
|
-
getPalette:
|
|
827
|
-
freeze: () => r.freeze
|
|
1060
|
+
getPalette: v,
|
|
1061
|
+
freeze: () => r.freeze,
|
|
1062
|
+
onHeadFrame: T
|
|
828
1063
|
});
|
|
829
|
-
|
|
1064
|
+
function j() {
|
|
1065
|
+
let e = i.value;
|
|
1066
|
+
if (!e) return;
|
|
1067
|
+
let t = h.value[0];
|
|
1068
|
+
t && e.style.setProperty("--ff-head-hue", `${t.h.toFixed(1)}`);
|
|
1069
|
+
}
|
|
1070
|
+
return k(() => r.config, () => A.wake(), { deep: !0 }), k([
|
|
830
1071
|
() => r.color,
|
|
831
1072
|
() => r.getPalette,
|
|
832
1073
|
o
|
|
833
|
-
], g, { immediate: !0 }),
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
1074
|
+
], g, { immediate: !0 }), k(h, j), w(() => {
|
|
1075
|
+
g(), j();
|
|
1076
|
+
}), k(o, () => A.wake()), k(() => r.freeze, () => A.wake()), n({
|
|
1077
|
+
backend: () => A.backend,
|
|
1078
|
+
pause: A.pause,
|
|
1079
|
+
resume: A.resume,
|
|
1080
|
+
wake: A.wake,
|
|
1081
|
+
renderAt: A.renderAt,
|
|
1082
|
+
setHeadT: A.setHeadT,
|
|
1083
|
+
headUnit: A.headUnit
|
|
840
1084
|
}), (e, t) => (E(), b("div", {
|
|
841
1085
|
ref_key: "hostRef",
|
|
842
1086
|
ref: i,
|
|
@@ -848,6 +1092,6 @@ var he = /* @__PURE__ */ e(/* @__PURE__ */ S({
|
|
|
848
1092
|
"aria-hidden": "true"
|
|
849
1093
|
}, null, 512)], 2));
|
|
850
1094
|
}
|
|
851
|
-
}), [["__scopeId", "data-v-
|
|
1095
|
+
}), [["__scopeId", "data-v-4914c4f3"]]);
|
|
852
1096
|
//#endregion
|
|
853
|
-
export {
|
|
1097
|
+
export { L as DEFAULT_FOURIER_CONFIG, be as FourierField, j as MAX_CURVE_SAMPLES, A as MAX_PHASORS, I as WARM_IDENTITY_PALETTE, v as comp, g as dftFromPoints, _ as makeEllipticSpectrum, h as partialSumAt, m as positionsAt, ye as useFourierField };
|