@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/concentric.js
CHANGED
|
@@ -1,139 +1,40 @@
|
|
|
1
|
-
import { t as e } from "./_plugin-vue_export-helper-
|
|
2
|
-
import { t } from "./usePointerVelocityField-
|
|
3
|
-
import { n, o as r, r as i, s as a } from "./procedural-color.wgsl-
|
|
4
|
-
import {
|
|
5
|
-
import { c } from "./
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
function x(e, t, n, r) {
|
|
14
|
-
let i = (e.x - t.x) / Math.max(n, 1e-4), a = (e.y - t.y) / Math.max(r, 1e-4);
|
|
15
|
-
return Math.sqrt(i * i + a * a);
|
|
16
|
-
}
|
|
17
|
-
function S(e, t, n, r) {
|
|
18
|
-
let i = Math.cos(t.rotAlpha), a = Math.sin(t.rotAlpha), o = e.x - t.x, s = e.y - t.y, c = i * o + a * s, l = -a * o + i * s, u = Math.max(n, 1e-4), d = Math.max(r, 1e-4), f = c / u, p = l / d, m = Math.sqrt(f * f + p * p), h = f / u, g = p / d;
|
|
19
|
-
return Math.sqrt(h * h + g * g) / Math.max(m, 1e-4);
|
|
20
|
-
}
|
|
21
|
-
function C(e, t, n, r, i, a, o) {
|
|
22
|
-
let s = 0;
|
|
23
|
-
for (let c of n) {
|
|
24
|
-
let n = b(e, c, i, a), l = 0;
|
|
25
|
-
for (let e of r) {
|
|
26
|
-
let r = y / Math.max(e.wavelength, 1e-4), i = Math.sqrt(v * r) * o, a = r * n - i * t + e.phase;
|
|
27
|
-
l += e.amplitude * Math.sin(a);
|
|
28
|
-
}
|
|
29
|
-
s += l * c.weight;
|
|
30
|
-
}
|
|
31
|
-
return s;
|
|
32
|
-
}
|
|
33
|
-
function w(e, t, n, r, i, a, o, s, c, l = .08) {
|
|
34
|
-
let u = 0, d = 0;
|
|
35
|
-
for (let f of n) {
|
|
36
|
-
let n = b(e, f, i, a), p = S(e, f, i, a);
|
|
37
|
-
for (let e of r) {
|
|
38
|
-
let r = y / Math.max(e.wavelength, 1e-4), i = Math.sqrt(v * r) * o, a = r * n - i * t + e.phase, m = Math.sin(a), h = Math.abs(Math.cos(a)), g = Math.max(r * p, 1e-4), _ = Math.abs(m) / Math.max(h * g, 1e-4) * g / Math.max(l, 1e-4), b = 1 - T(s, s + c, _), x = e.amplitude * f.weight;
|
|
39
|
-
u = Math.max(u, b * x), d += m * x;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return {
|
|
43
|
-
ink: E(u),
|
|
44
|
-
env: d
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function T(e, t, n) {
|
|
48
|
-
let r = E((n - e) / Math.max(t - e, 1e-6));
|
|
49
|
-
return r * r * (3 - 2 * r);
|
|
50
|
-
}
|
|
51
|
-
function E(e) {
|
|
52
|
-
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
53
|
-
}
|
|
54
|
-
function D(e, t = 1, n = 0) {
|
|
55
|
-
let r = [], i = Math.max(1, Math.min(2, t));
|
|
56
|
-
for (let t = 0; t < i; t++) r.push({
|
|
57
|
-
amplitude: t === 0 ? 1 : .45,
|
|
58
|
-
wavelength: e / (t + 1),
|
|
59
|
-
phase: (n + t * 1.618033) % y
|
|
60
|
-
});
|
|
61
|
-
return r;
|
|
62
|
-
}
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region src/components/custom/concentric/constants.ts
|
|
65
|
-
var O = 8, k = 4, A = 4;
|
|
66
|
-
function j(e) {
|
|
67
|
-
return e === "static-contour" ? 1 : e === "both" ? 2 : 0;
|
|
68
|
-
}
|
|
69
|
-
var M = [
|
|
70
|
-
{
|
|
71
|
-
L: .94,
|
|
72
|
-
C: .025,
|
|
73
|
-
h: 80
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
L: .82,
|
|
77
|
-
C: .075,
|
|
78
|
-
h: 62
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
L: .66,
|
|
82
|
-
C: .105,
|
|
83
|
-
h: 44
|
|
84
|
-
}
|
|
85
|
-
];
|
|
86
|
-
function N(e = .24, t = .04) {
|
|
87
|
-
return [D(e, 1, 0)[0], D(e * (1 + t), 1, 1.7)[0]];
|
|
88
|
-
}
|
|
89
|
-
var P = N(), F = [{
|
|
90
|
-
x: -.28,
|
|
91
|
-
y: -.18,
|
|
92
|
-
weight: 1,
|
|
93
|
-
rotAlpha: .35
|
|
94
|
-
}, {
|
|
95
|
-
x: .3,
|
|
96
|
-
y: .22,
|
|
97
|
-
weight: .85,
|
|
98
|
-
rotAlpha: -.55
|
|
99
|
-
}], I = {
|
|
100
|
-
centers: F,
|
|
101
|
-
ringComponents: P,
|
|
102
|
-
axisRatio: [1, .62],
|
|
103
|
-
speed: .5,
|
|
104
|
-
lineWidth: 1.4,
|
|
105
|
-
lineSoftness: 1,
|
|
106
|
-
renderMode: "traveling-rings",
|
|
107
|
-
contourLevels: 12,
|
|
108
|
-
beatDetune: .04,
|
|
109
|
-
palette: M,
|
|
110
|
-
background: "transparent",
|
|
111
|
-
interactive: !1,
|
|
112
|
-
respectReducedMotion: !0
|
|
113
|
-
}, L = `
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-gLzyemvl.js";
|
|
2
|
+
import { t } from "./usePointerVelocityField-BrkqZFhj.js";
|
|
3
|
+
import { n, o as r, r as i, s as a } from "./procedural-color.wgsl-C1Y5PkM6.js";
|
|
4
|
+
import { t as o } from "./flow.glsl-DqEGRpl4.js";
|
|
5
|
+
import { a as s, t as c } from "./useGpuSubstrate-Ceet70xq.js";
|
|
6
|
+
import { c as l } from "./color-B9jZdhJX.js";
|
|
7
|
+
import { t as u } from "./useGlobalDark-B4HO9LXG.js";
|
|
8
|
+
import { c as d, d as f, f as p, l as m, n as h, p as g, s as _, u as v } from "./paperGrid-CXCSMbZ1.js";
|
|
9
|
+
import { computed as y, createElementBlock as b, createElementVNode as x, defineComponent as S, normalizeStyle as C, onScopeDispose as w, openBlock as T, useTemplateRef as E, watch as D } from "vue";
|
|
10
|
+
//#region src/components/custom/concentric/shaders/concentric.wgsl.ts
|
|
11
|
+
var O = `
|
|
114
12
|
const PI: f32 = 3.141592653589793;
|
|
115
13
|
const TAU: f32 = 6.283185307179586;
|
|
116
|
-
const RING_GRAVITY: f32 = 9.81;
|
|
117
|
-
const MAX_RINGS: i32 = 8;
|
|
118
|
-
const MAX_CENTERS: i32 = 4;
|
|
119
14
|
const MAX_RING_STOPS: i32 = 4;
|
|
120
15
|
|
|
121
16
|
// ── Concentric uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──
|
|
122
17
|
struct ConcentricUniforms {
|
|
123
|
-
// u0: (uTime, uSpeed,
|
|
18
|
+
// u0: (uTime, uSpeed, uCellSize, _pad)
|
|
124
19
|
u0: vec4<f32>,
|
|
125
|
-
// ints: (
|
|
20
|
+
// ints: (_pad, _pad, uStopCount, _pad)
|
|
126
21
|
ints: vec4<i32>,
|
|
127
22
|
// bg: (background.rgb (linear), hasBackground)
|
|
128
23
|
bg: vec4<f32>,
|
|
129
|
-
// norm: (uFieldNorm, uAspect,
|
|
24
|
+
// norm: (uFieldNorm, uAspect, lightDirX, lightDirY)
|
|
130
25
|
norm: vec4<f32>,
|
|
131
|
-
// line: (lineHalfWidth, aaSoftness, contourLevels,
|
|
26
|
+
// line: (lineHalfWidth, aaSoftness, contourLevels, indexEvery)
|
|
132
27
|
line: vec4<f32>,
|
|
133
|
-
//
|
|
134
|
-
|
|
135
|
-
//
|
|
136
|
-
|
|
28
|
+
// wave: (waveDirX, waveDirY, waveK, waveOmega)
|
|
29
|
+
wave: vec4<f32>,
|
|
30
|
+
// wave2: (waveSigma, twistMax, shearMax, amp)
|
|
31
|
+
wave2: vec4<f32>,
|
|
32
|
+
// topo: (heightOctaves, heightSeed, swellAmp, perturbAmp)
|
|
33
|
+
topo: vec4<f32>,
|
|
34
|
+
// cursor: (cursorX, cursorY, cursorWell, interactive)
|
|
35
|
+
cursor: vec4<f32>,
|
|
36
|
+
// tune: (toneGain, shadeAmp, indexMul, inkDarken)
|
|
37
|
+
tune: vec4<f32>,
|
|
137
38
|
// each palette stop: linear-sRGB rgb + _pad
|
|
138
39
|
palette: array<vec4<f32>, 4>,
|
|
139
40
|
};
|
|
@@ -143,11 +44,10 @@ struct ConcentricUniforms {
|
|
|
143
44
|
${n}
|
|
144
45
|
${i}
|
|
145
46
|
|
|
146
|
-
// Full-screen-triangle (the pilot idiom)
|
|
147
|
-
// viewport from a single 3-vertex draw — no vertex buffer.
|
|
47
|
+
// Full-screen-triangle (the pilot idiom).
|
|
148
48
|
struct VSOut {
|
|
149
49
|
@builtin(position) pos: vec4<f32>,
|
|
150
|
-
@location(0) uv: vec2<f32>,
|
|
50
|
+
@location(0) uv: vec2<f32>,
|
|
151
51
|
};
|
|
152
52
|
|
|
153
53
|
@vertex
|
|
@@ -162,130 +62,84 @@ fn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {
|
|
|
162
62
|
return out;
|
|
163
63
|
}
|
|
164
64
|
|
|
165
|
-
// The
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
let
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
let
|
|
176
|
-
|
|
65
|
+
// ── The host noise basis (the SAME quintic-faded value-noise the suite speaks) ──
|
|
66
|
+
fn hash21(x: f32, y: f32) -> f32 {
|
|
67
|
+
var px = fract(x * 0.1031);
|
|
68
|
+
var py = fract(y * 0.1031);
|
|
69
|
+
var pz = fract(x * 0.1031);
|
|
70
|
+
let d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);
|
|
71
|
+
px = px + d; py = py + d; pz = pz + d;
|
|
72
|
+
return fract((px + py) * pz);
|
|
73
|
+
}
|
|
74
|
+
fn valueNoise(x: f32, y: f32) -> f32 {
|
|
75
|
+
let ix = floor(x); let iy = floor(y);
|
|
76
|
+
let fx = x - ix; let fy = y - iy;
|
|
77
|
+
let ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);
|
|
78
|
+
let uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);
|
|
79
|
+
let a = hash21(ix, iy);
|
|
80
|
+
let b = hash21(ix + 1.0, iy);
|
|
81
|
+
let c = hash21(ix, iy + 1.0);
|
|
82
|
+
let d2 = hash21(ix + 1.0, iy + 1.0);
|
|
83
|
+
return mix(mix(a, b, ux), mix(c, d2, ux), uy);
|
|
84
|
+
}
|
|
85
|
+
// The single-octave potential the curl operator wraps + the height field samples.
|
|
86
|
+
fn potentialFBM(p: vec2f) -> f32 {
|
|
87
|
+
var v = 0.0; var amp = 0.5; var freq = 1.0;
|
|
88
|
+
var px = p.x; var py = p.y;
|
|
89
|
+
for (var i = 0; i < 3; i = i + 1) {
|
|
90
|
+
v = v + amp * valueNoise(px * freq, py * freq);
|
|
91
|
+
let rx = 0.8 * px - 0.6 * py;
|
|
92
|
+
let ry = 0.6 * px + 0.8 * py;
|
|
93
|
+
px = rx; py = ry; freq = freq * 2.0; amp = amp * 0.5;
|
|
94
|
+
}
|
|
95
|
+
return v;
|
|
177
96
|
}
|
|
178
97
|
|
|
179
|
-
//
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
let ca = cos(rotAlpha);
|
|
183
|
-
let sa = sin(rotAlpha);
|
|
184
|
-
let px = p.x - center.x;
|
|
185
|
-
let py = p.y - center.y;
|
|
186
|
-
let rx = ca * px + sa * py;
|
|
187
|
-
let ry = -sa * px + ca * py;
|
|
188
|
-
let a = max(axisA, 1e-4);
|
|
189
|
-
let b = max(axisB, 1e-4);
|
|
190
|
-
let sx = rx / a;
|
|
191
|
-
let sy = ry / b;
|
|
192
|
-
let r = sqrt(sx * sx + sy * sy);
|
|
193
|
-
let gx = sx / a;
|
|
194
|
-
let gy = sy / b;
|
|
195
|
-
return sqrt(gx * gx + gy * gy) / max(r, 1e-4);
|
|
196
|
-
}
|
|
98
|
+
// The shared curl + wave chunks (splice AFTER valueNoise + potentialFBM are declared).
|
|
99
|
+
${g}
|
|
100
|
+
${p}
|
|
197
101
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
var acc = 0.0;
|
|
202
|
-
let speed = u.u0.y;
|
|
203
|
-
let axisA = u.u0.z;
|
|
204
|
-
let axisB = u.u0.w;
|
|
205
|
-
let centerCount = u.ints.x;
|
|
206
|
-
let ringCount = u.ints.y;
|
|
207
|
-
for (var j = 0; j < MAX_CENTERS; j = j + 1) {
|
|
208
|
-
if (j >= centerCount) { break; }
|
|
209
|
-
let cj = u.centers[j];
|
|
210
|
-
let radius = ellipsoidalRadiusRot(p, cj.xy, cj.w, axisA, axisB);
|
|
211
|
-
var centerSum = 0.0;
|
|
212
|
-
for (var i = 0; i < MAX_RINGS; i = i + 1) {
|
|
213
|
-
if (i >= ringCount) { break; }
|
|
214
|
-
let r = u.rings[i];
|
|
215
|
-
let k = TAU / max(r.y, 1e-4);
|
|
216
|
-
let omega = sqrt(RING_GRAVITY * k) * speed;
|
|
217
|
-
let theta = k * radius - omega * t + r.z;
|
|
218
|
-
centerSum = centerSum + r.x * sin(theta);
|
|
219
|
-
}
|
|
220
|
-
acc = acc + centerSum * cj.z;
|
|
221
|
-
}
|
|
222
|
-
return acc;
|
|
102
|
+
fn smoothstepEdge(e0: f32, e1: f32, x: f32) -> f32 {
|
|
103
|
+
let t = clamp((x - e0) / max(e1 - e0, 1e-6), 0.0, 1.0);
|
|
104
|
+
return t * t * (3.0 - 2.0 * t);
|
|
223
105
|
}
|
|
224
106
|
|
|
225
|
-
// The
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
var
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
let
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
let omega = sqrt(RING_GRAVITY * k) * speed;
|
|
249
|
-
let phase = k * radius - omega * t + r.z;
|
|
250
|
-
let s = sin(phase);
|
|
251
|
-
let cphase = abs(cos(phase));
|
|
252
|
-
let gradPhase = max(k * gradR, 1e-4);
|
|
253
|
-
// The IQ gradient-normalized distance-to-isoline (domain units; round-trips JS).
|
|
254
|
-
let de = abs(s) / max(cphase * gradPhase, 1e-4);
|
|
255
|
-
// Convert the domain-units distance to PIXELS via fwidth(phase) (the device
|
|
256
|
-
// per-pixel phase change) so the stroke is a constant pixel width everywhere —
|
|
257
|
-
// lineHalfW/aa are in pixels (NOT fwidthFine, Compatibility-Mode safe).
|
|
258
|
-
let dPx = max(fwidth(phase), 1e-4);
|
|
259
|
-
let dePx = de * gradPhase / dPx;
|
|
260
|
-
var lineV = 1.0 - smoothstep(lineHalfW, lineHalfW + aa, dePx);
|
|
261
|
-
// Analytic anti-aliasing: where the rings pack tighter than the pixel can resolve
|
|
262
|
-
// (fwidth(phase) ≳ π, near a center / under DPR), FADE the line out instead of
|
|
263
|
-
// flooding to a solid mass (IQ filterwidth — the aliasing-fade that keeps the field
|
|
264
|
-
// thin LINES, not a bright slab where the rings converge).
|
|
265
|
-
let aliasFade = 1.0 - smoothstep(PI * 0.6, PI * 1.2, dPx);
|
|
266
|
-
lineV = lineV * aliasFade;
|
|
267
|
-
let w = r.x * cj.z;
|
|
268
|
-
ink = max(ink, lineV * w);
|
|
269
|
-
env = env + s * w;
|
|
270
|
-
}
|
|
107
|
+
// The level-set height at domain p (transcribes levelField.ts sampleHeight). The sampling
|
|
108
|
+
// coordinate is cell-twisted (the SAME wave that twists paper-grid cells — kinship); the
|
|
109
|
+
// height is a low-octave topography + the swell + the cursor peak.
|
|
110
|
+
fn sampleHeight(p: vec2f, t: f32) -> f32 {
|
|
111
|
+
// The CONTINUOUS traveling-wave flow warp (no per-cell seam — the contours flow + twist as
|
|
112
|
+
// the wave passes OVER and THROUGH them, the SAME wave that twists the paper-grid cells).
|
|
113
|
+
var g = waveFlow(p, t, u.wave.xy, u.wave.z, u.wave.w, u.wave2.x, u.wave2.y, u.wave2.w);
|
|
114
|
+
if (u.cursor.w > 0.5) {
|
|
115
|
+
g = cursorSwirl(g, u.cursor.xy, u.cursor.z * 0.6, u.u0.z * 2.5);
|
|
116
|
+
}
|
|
117
|
+
// Sample the topography at a LOW base frequency so the basins are BROAD nested loops (a
|
|
118
|
+
// readable contour map — not a fine speckle). heightOctaves carries the fractal detail.
|
|
119
|
+
var H = heightField(g * 0.9, u.topo.x, u.topo.y);
|
|
120
|
+
H = H + u.topo.z * waveSwell(t, u.topo.y);
|
|
121
|
+
if (u.cursor.w > 0.5) {
|
|
122
|
+
let d = p - u.cursor.xy;
|
|
123
|
+
let d2 = dot(d, d);
|
|
124
|
+
// The cursor HEAVE — a SOFT bulge (a Gaussian peak feathered by a smoothstep falloff so
|
|
125
|
+
// the heave is C1-smooth, NOT the hard-edged quad the old dark render showed). The well
|
|
126
|
+
// depth/radius already carry the velocity-HEAVE scale (packed JS-side into u.cursor.z).
|
|
127
|
+
let g0 = exp(-d2 / 0.22);
|
|
128
|
+
let fall = smoothstepEdge(0.0, 0.55, exp(-d2 / 0.6));
|
|
129
|
+
H = H + u.cursor.z * g0 * fall;
|
|
271
130
|
}
|
|
272
|
-
|
|
273
|
-
oe.ink = clamp(ink, 0.0, 1.0);
|
|
274
|
-
oe.env = env;
|
|
275
|
-
return oe;
|
|
131
|
+
return H;
|
|
276
132
|
}
|
|
277
133
|
|
|
278
|
-
// The
|
|
279
|
-
//
|
|
280
|
-
//
|
|
281
|
-
//
|
|
282
|
-
|
|
283
|
-
|
|
134
|
+
// The IQ gradient-free level-set contour ink — KEPT BYTE-FROZEN (the perfect GPU AA). It is
|
|
135
|
+
// FED the per-level half-width 'hw' (a parameter, NOT a re-derivation): de_contour =
|
|
136
|
+
// |fract(fN + 0.5) − 0.5| / fwidth(fN). The contour density tracks 1/|∇H| automatically.
|
|
137
|
+
// 'aaW' floors against a DPR-aware minimum so the index line stays CONTINUOUS where the heave
|
|
138
|
+
// packs contours (steep |∇H| saturates fwidth — challenge R4).
|
|
139
|
+
fn contourInk(fN: f32, hw: f32) -> f32 {
|
|
284
140
|
let band = abs(fract(fN + 0.5) - 0.5);
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
let aaW = max(fwidth(fN), 1e-4);
|
|
288
|
-
return 1.0 - smoothstep(u.line.x, u.line.x + u.line.y, band / aaW);
|
|
141
|
+
let aaW = max(fwidth(fN), 6e-4);
|
|
142
|
+
return 1.0 - smoothstepEdge(hw, hw + u.line.y, band / aaW);
|
|
289
143
|
}
|
|
290
144
|
|
|
291
145
|
// Sample the multi-stop palette (linear-sRGB stops, OKLab mix). t in [0,1].
|
|
@@ -302,125 +156,199 @@ fn samplePaletteLin(t: f32) -> vec3<f32> {
|
|
|
302
156
|
return oklabToLinearSrgb(mix(labA, labB, f));
|
|
303
157
|
}
|
|
304
158
|
|
|
159
|
+
// The SHARED hillshade finite-diff epsilon — pinned ONCE (mirrors levelField.HILLSHADE_EPSILON
|
|
160
|
+
// + the GLSL twin; a per-backend drift would red the L6 numeric parity).
|
|
161
|
+
const HILLSHADE_E: f32 = 0.012;
|
|
162
|
+
|
|
305
163
|
@fragment
|
|
306
164
|
fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
307
|
-
// aspect-correct the domain x so the rings read circular under the ellipsoidal norm.
|
|
308
165
|
let aspect = max(u.norm.y, 1e-4);
|
|
309
166
|
let p = vec2<f32>(in.uv.x * aspect, in.uv.y);
|
|
310
|
-
let t = u.u0.x;
|
|
311
|
-
let
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
let
|
|
334
|
-
|
|
335
|
-
let
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
167
|
+
let t = u.u0.x * u.u0.y;
|
|
168
|
+
let levels = max(u.line.z, 1.0);
|
|
169
|
+
|
|
170
|
+
// The level-set topography (the KEPT field — the PRIMARY path).
|
|
171
|
+
let H = sampleHeight(p, t);
|
|
172
|
+
|
|
173
|
+
// ── 1. HYPSOMETRIC TONE — tanh expands the compressed band so basins+ridges hit the ramp
|
|
174
|
+
// ENDS (the live lumVar-flat cause). samplePaletteLin is the KEPT OKLab operator.
|
|
175
|
+
let tone = 0.5 + 0.5 * tanh(H * u.tune.x);
|
|
176
|
+
var fill = samplePaletteLin(tone);
|
|
177
|
+
|
|
178
|
+
// ── 2. ANALYTIC HILLSHADE — one ∇H finite-diff at the SHARED e, dotted with the fixed cel
|
|
179
|
+
// light → 2.5-D relief. A read-only re-sample of sampleHeight (no second field).
|
|
180
|
+
let e = HILLSHADE_E;
|
|
181
|
+
let hx = sampleHeight(p + vec2<f32>(e, 0.0), t) - sampleHeight(p - vec2<f32>(e, 0.0), t);
|
|
182
|
+
let hy = sampleHeight(p + vec2<f32>(0.0, e), t) - sampleHeight(p - vec2<f32>(0.0, e), t);
|
|
183
|
+
let grad = vec2<f32>(hx, hy) / (2.0 * e);
|
|
184
|
+
let L = normalize(u.norm.zw + vec2<f32>(1e-5, 1e-5));
|
|
185
|
+
let shade = 0.5 + 0.5 * clamp(dot(normalize(grad + vec2<f32>(1e-5)), L), -1.0, 1.0);
|
|
186
|
+
fill = fill * mix(1.0 - u.tune.y, 1.0 + u.tune.y, shade);
|
|
187
|
+
|
|
188
|
+
// ── 3. TWO-TIER INDEX/MINOR CONTOUR — isIndex a pure f(level) (floor + mod + select, NOT a
|
|
189
|
+
// state buffer); the per-level half-width hw is FED to the byte-frozen contourInk.
|
|
190
|
+
let fN = H * levels + u.topo.w * sin(floor(H * levels) * 2.4 + t * 0.7);
|
|
191
|
+
let indexEvery = max(u.line.w, 1.0);
|
|
192
|
+
let lvl = floor(fN);
|
|
193
|
+
let isIndex = select(0.0, 1.0, fract(lvl / indexEvery) < (0.5 / indexEvery));
|
|
194
|
+
let hw = mix(u.line.x, u.line.x * u.tune.z, isIndex);
|
|
195
|
+
let ink = clamp(contourInk(fN, hw), 0.0, 1.0);
|
|
196
|
+
|
|
197
|
+
// ── 4. INK = a darker ember of the LOCAL fill (the edge-of-its-own-band signature).
|
|
198
|
+
let inkCol = mix(fill, fill * u.tune.w, 0.85);
|
|
199
|
+
|
|
200
|
+
// ── 5. ONE color path + OPAQUE OUT — the viz IS the colorful field, never lines-over-nothing.
|
|
201
|
+
// Per-mode is resolved in the CONSUMED stops + the bg token (no in-shader uMode branch).
|
|
202
|
+
let col = mix(fill, inkCol, ink);
|
|
203
|
+
return vec4<f32>(clamp(linearToSrgb(col), vec3<f32>(0.0), vec3<f32>(1.0)), 1.0);
|
|
345
204
|
}
|
|
346
|
-
`,
|
|
205
|
+
`, k = 4, A = [
|
|
206
|
+
{
|
|
207
|
+
L: .5,
|
|
208
|
+
C: .115,
|
|
209
|
+
h: 350
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
L: .66,
|
|
213
|
+
C: .14,
|
|
214
|
+
h: 38
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
L: .8,
|
|
218
|
+
C: .115,
|
|
219
|
+
h: 70
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
L: .92,
|
|
223
|
+
C: .06,
|
|
224
|
+
h: 86
|
|
225
|
+
}
|
|
226
|
+
], j = [
|
|
227
|
+
{
|
|
228
|
+
L: .26,
|
|
229
|
+
C: .09,
|
|
230
|
+
h: 30
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
L: .45,
|
|
234
|
+
C: .15,
|
|
235
|
+
h: 42
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
L: .66,
|
|
239
|
+
C: .155,
|
|
240
|
+
h: 66
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
L: .84,
|
|
244
|
+
C: .13,
|
|
245
|
+
h: 84
|
|
246
|
+
}
|
|
247
|
+
], M = {
|
|
248
|
+
L: .96,
|
|
249
|
+
C: .018,
|
|
250
|
+
h: 78
|
|
251
|
+
}, N = {
|
|
252
|
+
L: .16,
|
|
253
|
+
C: .035,
|
|
254
|
+
h: 32
|
|
255
|
+
}, P = {
|
|
256
|
+
speed: .6,
|
|
257
|
+
lineWidth: 1.8,
|
|
258
|
+
lineSoftness: 1,
|
|
259
|
+
contourLevels: 13,
|
|
260
|
+
cellSize: 1.2,
|
|
261
|
+
heightOctaves: 3,
|
|
262
|
+
heightSeed: 7,
|
|
263
|
+
swellAmp: .22,
|
|
264
|
+
perturbAmp: .06,
|
|
265
|
+
twistMax: .6,
|
|
266
|
+
shearMax: .24,
|
|
267
|
+
waveDir: [.92, .39],
|
|
268
|
+
waveK: .42,
|
|
269
|
+
waveOmega: .7,
|
|
270
|
+
waveSigma: .85,
|
|
271
|
+
cursorWell: .5,
|
|
272
|
+
toneGain: 1.6,
|
|
273
|
+
shadeAmp: .18,
|
|
274
|
+
lightDir: [-.6, .8],
|
|
275
|
+
indexEvery: 5,
|
|
276
|
+
indexMul: 1.9,
|
|
277
|
+
inkDarken: .45,
|
|
278
|
+
velocityHeave: .4,
|
|
279
|
+
palette: A,
|
|
280
|
+
background: M,
|
|
281
|
+
interactive: !0,
|
|
282
|
+
respectReducedMotion: !0
|
|
283
|
+
}, F = 224, I = {
|
|
347
284
|
u0: 0,
|
|
348
285
|
ints: 4,
|
|
349
286
|
bg: 8,
|
|
350
287
|
norm: 12,
|
|
351
288
|
line: 16,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
289
|
+
wave: 20,
|
|
290
|
+
wave2: 24,
|
|
291
|
+
topo: 28,
|
|
292
|
+
cursor: 32,
|
|
293
|
+
tune: 36,
|
|
294
|
+
palette: 40
|
|
295
|
+
}, L = .55;
|
|
296
|
+
function R() {
|
|
297
|
+
let e = new ArrayBuffer(F);
|
|
358
298
|
return {
|
|
359
299
|
buffer: e,
|
|
360
300
|
f32: new Float32Array(e),
|
|
361
301
|
i32: new Int32Array(e)
|
|
362
302
|
};
|
|
363
303
|
}
|
|
364
|
-
function
|
|
365
|
-
let { f32:
|
|
366
|
-
|
|
367
|
-
let
|
|
368
|
-
if (
|
|
304
|
+
function z(e, t, n, r, i, a, o, s) {
|
|
305
|
+
let { f32: c, i32: u } = e;
|
|
306
|
+
c[I.u0 + 0] = n, c[I.u0 + 1] = t.speed, c[I.u0 + 2] = t.cellSize, c[I.u0 + 3] = 0;
|
|
307
|
+
let d = Math.min(i.length, 4);
|
|
308
|
+
if (u[I.ints + 0] = 0, u[I.ints + 1] = 0, u[I.ints + 2] = d, u[I.ints + 3] = 0, t.background === "transparent") c[I.bg + 0] = 0, c[I.bg + 1] = 0, c[I.bg + 2] = 0, c[I.bg + 3] = 0;
|
|
369
309
|
else {
|
|
370
|
-
let e =
|
|
371
|
-
|
|
310
|
+
let e = l(t.background);
|
|
311
|
+
c[I.bg + 0] = e[0], c[I.bg + 1] = e[1], c[I.bg + 2] = e[2], c[I.bg + 3] = 1;
|
|
372
312
|
}
|
|
373
|
-
|
|
313
|
+
c[I.norm + 0] = L, c[I.norm + 1] = r, c[I.norm + 2] = t.lightDir[0], c[I.norm + 3] = t.lightDir[1], c[I.line + 0] = t.lineWidth, c[I.line + 1] = t.lineSoftness, c[I.line + 2] = t.contourLevels, c[I.line + 3] = t.indexEvery, c[I.wave + 0] = t.waveDir[0], c[I.wave + 1] = t.waveDir[1], c[I.wave + 2] = t.waveK, c[I.wave + 3] = t.waveOmega, c[I.wave2 + 0] = t.waveSigma, c[I.wave2 + 1] = t.twistMax, c[I.wave2 + 2] = t.shearMax, c[I.wave2 + 3] = o, c[I.topo + 0] = t.heightOctaves, c[I.topo + 1] = t.heightSeed, c[I.topo + 2] = t.swellAmp, c[I.topo + 3] = t.perturbAmp, c[I.cursor + 0] = a.x, c[I.cursor + 1] = a.y, c[I.cursor + 2] = t.cursorWell * s, c[I.cursor + 3] = +!!t.interactive, c[I.tune + 0] = t.toneGain, c[I.tune + 1] = t.shadeAmp, c[I.tune + 2] = t.indexMul, c[I.tune + 3] = t.inkDarken;
|
|
374
314
|
for (let e = 0; e < 4; e++) {
|
|
375
|
-
let t =
|
|
376
|
-
|
|
315
|
+
let t = I.palette + e * 4, n = l(i[Math.min(e, d - 1)] ?? i[0]);
|
|
316
|
+
c[t + 0] = n[0], c[t + 1] = n[1], c[t + 2] = n[2], c[t + 3] = 0;
|
|
377
317
|
}
|
|
378
318
|
return e;
|
|
379
319
|
}
|
|
380
|
-
function U(e, t, n) {
|
|
381
|
-
for (let r = 0; r < 8; r++) {
|
|
382
|
-
let i = t + r * 4, a = n[r];
|
|
383
|
-
a ? (e[i + 0] = a.amplitude, e[i + 1] = a.wavelength, e[i + 2] = a.phase, e[i + 3] = 0) : (e[i + 0] = 0, e[i + 1] = 1, e[i + 2] = 0, e[i + 3] = 0);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
function W(e, t, n) {
|
|
387
|
-
for (let r = 0; r < 4; r++) {
|
|
388
|
-
let i = t + r * 4, a = n[r];
|
|
389
|
-
a ? (e[i + 0] = a.x, e[i + 1] = a.y, e[i + 2] = a.weight, e[i + 3] = a.rotAlpha) : (e[i + 0] = 0, e[i + 1] = 0, e[i + 2] = 0, e[i + 3] = 0);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
320
|
//#endregion
|
|
393
321
|
//#region src/components/custom/concentric/composables/concentricWGPUSetup.ts
|
|
394
|
-
var
|
|
395
|
-
function
|
|
396
|
-
let { canvas: t, config: n, getPalette: r,
|
|
397
|
-
return function(e,
|
|
398
|
-
let
|
|
322
|
+
var B = 64, V = 8, H = 2;
|
|
323
|
+
function U(e) {
|
|
324
|
+
let { canvas: t, config: n, getPalette: r, getCursor: i, getAmp: a, getWellScale: o, shouldContinue: c, onFrame: l } = e;
|
|
325
|
+
return function(e, u, d) {
|
|
326
|
+
let f = e.createShaderModule({
|
|
399
327
|
label: "[Concentric] concentric.wgsl",
|
|
400
|
-
code:
|
|
401
|
-
}),
|
|
328
|
+
code: O
|
|
329
|
+
}), p = R(), m = e.createBuffer({
|
|
402
330
|
label: "[Concentric] uniforms",
|
|
403
|
-
size:
|
|
404
|
-
usage:
|
|
405
|
-
}),
|
|
331
|
+
size: p.buffer.byteLength,
|
|
332
|
+
usage: B | V
|
|
333
|
+
}), h = e.createBindGroupLayout({
|
|
406
334
|
label: "[Concentric] bgl",
|
|
407
335
|
entries: [{
|
|
408
336
|
binding: 0,
|
|
409
|
-
visibility:
|
|
337
|
+
visibility: H,
|
|
410
338
|
buffer: { type: "uniform" }
|
|
411
339
|
}]
|
|
412
|
-
}),
|
|
340
|
+
}), g = e.createRenderPipeline({
|
|
413
341
|
label: "[Concentric] pipeline",
|
|
414
|
-
layout: e.createPipelineLayout({ bindGroupLayouts: [
|
|
342
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [h] }),
|
|
415
343
|
vertex: {
|
|
416
|
-
module:
|
|
344
|
+
module: f,
|
|
417
345
|
entryPoint: "vs_main"
|
|
418
346
|
},
|
|
419
347
|
fragment: {
|
|
420
|
-
module:
|
|
348
|
+
module: f,
|
|
421
349
|
entryPoint: "fs_main",
|
|
422
350
|
targets: [{
|
|
423
|
-
format:
|
|
351
|
+
format: d,
|
|
424
352
|
blend: {
|
|
425
353
|
color: {
|
|
426
354
|
srcFactor: "one",
|
|
@@ -436,22 +364,22 @@ function J(e) {
|
|
|
436
364
|
}]
|
|
437
365
|
},
|
|
438
366
|
primitive: { topology: "triangle-list" }
|
|
439
|
-
}),
|
|
367
|
+
}), _ = e.createBindGroup({
|
|
440
368
|
label: "[Concentric] bg",
|
|
441
|
-
layout:
|
|
369
|
+
layout: h,
|
|
442
370
|
entries: [{
|
|
443
371
|
binding: 0,
|
|
444
|
-
resource: { buffer:
|
|
372
|
+
resource: { buffer: m }
|
|
445
373
|
}]
|
|
446
374
|
});
|
|
447
|
-
function
|
|
448
|
-
let e =
|
|
375
|
+
function v() {
|
|
376
|
+
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));
|
|
449
377
|
(t.width !== i || t.height !== a) && (t.width = i, t.height = a);
|
|
450
378
|
}
|
|
451
|
-
function
|
|
452
|
-
|
|
453
|
-
let
|
|
454
|
-
view:
|
|
379
|
+
function y(s) {
|
|
380
|
+
l?.(s), z(p, n, s, (t.clientWidth || 320) / Math.max(t.clientHeight || 320, 1), r(), i(), a(), o()), e.queue.writeBuffer(m, 0, p.buffer);
|
|
381
|
+
let c = e.createCommandEncoder({ label: "[Concentric] frame" }), d = u.getCurrentTexture().createView(), f = c.beginRenderPass({ colorAttachments: [{
|
|
382
|
+
view: d,
|
|
455
383
|
clearValue: {
|
|
456
384
|
r: 0,
|
|
457
385
|
g: 0,
|
|
@@ -461,28 +389,25 @@ function J(e) {
|
|
|
461
389
|
loadOp: "clear",
|
|
462
390
|
storeOp: "store"
|
|
463
391
|
}] });
|
|
464
|
-
|
|
392
|
+
f.setPipeline(g), f.setBindGroup(0, _), f.draw(3, 1, 0, 0), f.end(), e.queue.submit([c.finish()]);
|
|
465
393
|
}
|
|
466
394
|
return {
|
|
467
|
-
frame:
|
|
468
|
-
shouldContinue:
|
|
469
|
-
resize:
|
|
395
|
+
frame: y,
|
|
396
|
+
shouldContinue: c,
|
|
397
|
+
resize: v,
|
|
470
398
|
teardown: () => {
|
|
471
|
-
|
|
399
|
+
m.destroy();
|
|
472
400
|
}
|
|
473
401
|
};
|
|
474
402
|
};
|
|
475
403
|
}
|
|
476
404
|
//#endregion
|
|
477
405
|
//#region src/components/custom/concentric/shaders/concentric.glsl.ts
|
|
478
|
-
var
|
|
406
|
+
var W = "#version 300 es\nprecision highp float;\nin vec2 aPosition;\nout vec2 vUv;\nvoid main() {\n vUv = aPosition; // [-1,1]² domain\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}", G = `#version 300 es
|
|
479
407
|
precision highp float;
|
|
480
408
|
|
|
481
409
|
#define PI 3.141592653589793
|
|
482
410
|
#define TAU 6.283185307179586
|
|
483
|
-
#define RING_GRAVITY 9.81
|
|
484
|
-
#define MAX_RINGS 8
|
|
485
|
-
#define MAX_CENTERS 4
|
|
486
411
|
#define MAX_RING_STOPS 4
|
|
487
412
|
|
|
488
413
|
in vec2 vUv;
|
|
@@ -490,121 +415,99 @@ out vec4 fragColor;
|
|
|
490
415
|
|
|
491
416
|
uniform float uTime;
|
|
492
417
|
uniform float uSpeed;
|
|
493
|
-
uniform
|
|
494
|
-
uniform float uFieldNorm; //
|
|
418
|
+
uniform float uCellSize; // the topography cell pitch (the contour-warp granularity)
|
|
419
|
+
uniform float uFieldNorm; // height → [0,1] tone scale
|
|
495
420
|
uniform float uAspect;
|
|
496
|
-
uniform int uCenterCount;
|
|
497
|
-
uniform int uRingCount;
|
|
498
421
|
uniform int uStopCount;
|
|
499
|
-
uniform int uRenderMode; // 0 traveling-rings · 1 static-contour · 2 both
|
|
500
422
|
uniform float uHasBackground;
|
|
501
|
-
uniform
|
|
423
|
+
uniform vec4 uLine; // (lineHalfWidth, aaSoftness, contourLevels, indexEvery)
|
|
424
|
+
uniform vec2 uLightDir; // the fixed cel-light direction (folded norm.zw)
|
|
502
425
|
uniform vec3 uBg; // themed background (linear-sRGB)
|
|
503
|
-
uniform
|
|
504
|
-
uniform vec4
|
|
426
|
+
uniform vec4 uWave; // (waveDirX, waveDirY, waveK, waveOmega)
|
|
427
|
+
uniform vec4 uWave2; // (waveSigma, twistMax, shearMax, amp)
|
|
428
|
+
uniform vec4 uTopo; // (heightOctaves, heightSeed, swellAmp, perturbAmp)
|
|
429
|
+
uniform vec4 uCursor; // (cursorX, cursorY, cursorWell, interactive)
|
|
430
|
+
uniform vec4 uTune; // (toneGain, shadeAmp, indexMul, inkDarken)
|
|
505
431
|
uniform vec3 uPalette[MAX_RING_STOPS]; // linear-sRGB stops
|
|
506
432
|
|
|
507
433
|
${r}
|
|
508
434
|
${a}
|
|
509
435
|
|
|
510
|
-
//
|
|
511
|
-
|
|
512
|
-
float ca = cos(rotAlpha);
|
|
513
|
-
float sa = sin(rotAlpha);
|
|
514
|
-
float px = p.x - center.x;
|
|
515
|
-
float py = p.y - center.y;
|
|
516
|
-
float rx = ca * px + sa * py;
|
|
517
|
-
float ry = -sa * px + ca * py;
|
|
518
|
-
float dx = rx / max(axisA, 1e-4);
|
|
519
|
-
float dy = ry / max(axisB, 1e-4);
|
|
520
|
-
return sqrt(dx * dx + dy * dy);
|
|
521
|
-
}
|
|
436
|
+
// The shared curl operator (flow.glsl.ts — forward-declares potentialFBM).
|
|
437
|
+
${o}
|
|
522
438
|
|
|
523
|
-
//
|
|
524
|
-
float
|
|
525
|
-
float
|
|
526
|
-
float
|
|
527
|
-
float
|
|
528
|
-
float
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
float
|
|
534
|
-
float
|
|
535
|
-
float
|
|
536
|
-
float
|
|
537
|
-
float
|
|
538
|
-
|
|
439
|
+
// ── The host noise basis (the SAME quintic-faded value-noise the suite speaks) ──
|
|
440
|
+
float hash21(float x, float y) {
|
|
441
|
+
float px = fract(x * 0.1031);
|
|
442
|
+
float py = fract(y * 0.1031);
|
|
443
|
+
float pz = fract(x * 0.1031);
|
|
444
|
+
float d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);
|
|
445
|
+
px += d; py += d; pz += d;
|
|
446
|
+
return fract((px + py) * pz);
|
|
447
|
+
}
|
|
448
|
+
float valueNoise(float x, float y) {
|
|
449
|
+
float ix = floor(x); float iy = floor(y);
|
|
450
|
+
float fx = x - ix; float fy = y - iy;
|
|
451
|
+
float ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);
|
|
452
|
+
float uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);
|
|
453
|
+
float a = hash21(ix, iy);
|
|
454
|
+
float b = hash21(ix + 1.0, iy);
|
|
455
|
+
float c = hash21(ix, iy + 1.0);
|
|
456
|
+
float d2 = hash21(ix + 1.0, iy + 1.0);
|
|
457
|
+
return mix(mix(a, b, ux), mix(c, d2, ux), uy);
|
|
458
|
+
}
|
|
459
|
+
// The curl chunk's forward-declared potentialFBM body.
|
|
460
|
+
float potentialFBM(vec2 p) {
|
|
461
|
+
float v = 0.0; float amp = 0.5; float freq = 1.0;
|
|
462
|
+
float px = p.x; float py = p.y;
|
|
463
|
+
for (int i = 0; i < 3; i++) {
|
|
464
|
+
v += amp * valueNoise(px * freq, py * freq);
|
|
465
|
+
float rx = 0.8 * px - 0.6 * py;
|
|
466
|
+
float ry = 0.6 * px + 0.8 * py;
|
|
467
|
+
px = rx; py = ry; freq *= 2.0; amp *= 0.5;
|
|
468
|
+
}
|
|
469
|
+
return v;
|
|
539
470
|
}
|
|
540
471
|
|
|
541
|
-
//
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
float radius = ellipsoidalRadiusRot(p, cj.xy, cj.w, uAxis.x, uAxis.y);
|
|
548
|
-
float centerSum = 0.0;
|
|
549
|
-
for (int i = 0; i < MAX_RINGS; i++) {
|
|
550
|
-
if (i >= uRingCount) break;
|
|
551
|
-
vec3 r = uRings[i];
|
|
552
|
-
float k = TAU / max(r.y, 1e-4);
|
|
553
|
-
float omega = sqrt(RING_GRAVITY * k) * uSpeed;
|
|
554
|
-
float theta = k * radius - omega * t + r.z;
|
|
555
|
-
centerSum += r.x * sin(theta);
|
|
556
|
-
}
|
|
557
|
-
acc += centerSum * cj.z;
|
|
558
|
-
}
|
|
559
|
-
return acc;
|
|
472
|
+
// The shared traveling-wave CELL-WARP chunk (spliced AFTER valueNoise + potentialFBM + curl).
|
|
473
|
+
${f}
|
|
474
|
+
|
|
475
|
+
float smoothstepEdge(float e0, float e1, float x) {
|
|
476
|
+
float t = clamp((x - e0) / max(e1 - e0, 1e-6), 0.0, 1.0);
|
|
477
|
+
return t * t * (3.0 - 2.0 * t);
|
|
560
478
|
}
|
|
561
479
|
|
|
562
|
-
// The
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
float gradPhase = max(k * gradR, 1e-4);
|
|
583
|
-
// The IQ gradient-normalized distance-to-isoline (domain units; round-trips JS).
|
|
584
|
-
float de = abs(s) / max(cphase * gradPhase, 1e-4);
|
|
585
|
-
// Convert to PIXELS via fwidth(phase) so the stroke is a constant pixel width.
|
|
586
|
-
float dPx = max(fwidth(phase), 1e-4);
|
|
587
|
-
float dePx = de * gradPhase / dPx;
|
|
588
|
-
float lineV = 1.0 - smoothstep(lineHalfW, lineHalfW + aa, dePx);
|
|
589
|
-
// Analytic anti-aliasing: fade lines where the rings pack tighter than a pixel can
|
|
590
|
-
// resolve (fwidth(phase) ≳ π, near a center / under DPR) so the field stays thin LINES
|
|
591
|
-
// instead of flooding to a bright slab (IQ filterwidth).
|
|
592
|
-
float aliasFade = 1.0 - smoothstep(PI * 0.6, PI * 1.2, dPx);
|
|
593
|
-
lineV *= aliasFade;
|
|
594
|
-
float w = r.x * cj.z;
|
|
595
|
-
ink = max(ink, lineV * w);
|
|
596
|
-
env += s * w;
|
|
597
|
-
}
|
|
480
|
+
// The level-set height at domain p (transcribes levelField.ts sampleHeight).
|
|
481
|
+
float sampleHeight(vec2 p, float t) {
|
|
482
|
+
// The CONTINUOUS traveling-wave flow warp (no per-cell seam — the contours flow + twist as
|
|
483
|
+
// the wave passes OVER and THROUGH them, the SAME wave that twists the paper-grid cells).
|
|
484
|
+
vec2 g = waveFlow(p, t, uWave.xy, uWave.z, uWave.w, uWave2.x, uWave2.y, uWave2.w);
|
|
485
|
+
if (uCursor.w > 0.5) {
|
|
486
|
+
g = cursorSwirl(g, uCursor.xy, uCursor.z * 0.6, uCellSize * 2.5);
|
|
487
|
+
}
|
|
488
|
+
// LOW base frequency → BROAD nested loops (a readable contour map). Octaves carry detail.
|
|
489
|
+
float H = heightField(g * 0.9, uTopo.x, uTopo.y);
|
|
490
|
+
H += uTopo.z * waveSwell(t, uTopo.y);
|
|
491
|
+
if (uCursor.w > 0.5) {
|
|
492
|
+
vec2 d = p - uCursor.xy;
|
|
493
|
+
float d2 = dot(d, d);
|
|
494
|
+
// The cursor HEAVE — a SOFT bulge (a Gaussian peak feathered by a smoothstep falloff so
|
|
495
|
+
// the heave is C1-smooth, NOT a hard-edged quad). The well depth/radius carry the
|
|
496
|
+
// velocity-HEAVE scale (packed JS-side into uCursor.z).
|
|
497
|
+
float g0 = exp(-d2 / 0.22);
|
|
498
|
+
float fall = smoothstepEdge(0.0, 0.55, exp(-d2 / 0.6));
|
|
499
|
+
H += uCursor.z * g0 * fall;
|
|
598
500
|
}
|
|
599
|
-
return
|
|
501
|
+
return H;
|
|
600
502
|
}
|
|
601
503
|
|
|
602
|
-
// The
|
|
603
|
-
|
|
604
|
-
|
|
504
|
+
// The IQ gradient-free level-set contour ink — KEPT BYTE-FROZEN (the perfect GPU AA). It is
|
|
505
|
+
// FED the per-level half-width 'hw' (a parameter, NOT a re-derivation). 'aaW' floors against a
|
|
506
|
+
// DPR-aware minimum so the index line stays CONTINUOUS where the heave packs contours.
|
|
507
|
+
float contourInk(float fN, float hw) {
|
|
605
508
|
float band = abs(fract(fN + 0.5) - 0.5);
|
|
606
|
-
float aaW = max(fwidth(fN),
|
|
607
|
-
return 1.0 -
|
|
509
|
+
float aaW = max(fwidth(fN), 6e-4);
|
|
510
|
+
return 1.0 - smoothstepEdge(hw, hw + uLine.y, band / aaW);
|
|
608
511
|
}
|
|
609
512
|
|
|
610
513
|
vec3 samplePaletteLin(float t) {
|
|
@@ -621,38 +524,50 @@ vec3 samplePaletteLin(float t) {
|
|
|
621
524
|
return oklabToLinearSrgb(mix(labA, labB, f));
|
|
622
525
|
}
|
|
623
526
|
|
|
527
|
+
// The SHARED hillshade finite-diff epsilon — pinned ONCE (mirrors levelField.HILLSHADE_EPSILON
|
|
528
|
+
// + the WGSL twin; a per-backend drift would red the L6 numeric parity).
|
|
529
|
+
const float HILLSHADE_E = 0.012;
|
|
530
|
+
|
|
624
531
|
void main() {
|
|
625
532
|
float aspect = max(uAspect, 1e-4);
|
|
626
533
|
vec2 p = vec2(vUv.x * aspect, vUv.y);
|
|
534
|
+
float t = uTime * uSpeed;
|
|
535
|
+
float levels = max(uLine.z, 1.0);
|
|
627
536
|
|
|
628
|
-
|
|
629
|
-
float
|
|
630
|
-
float env = ie.y;
|
|
537
|
+
// The level-set topography (the KEPT field — the PRIMARY path).
|
|
538
|
+
float H = sampleHeight(p, t);
|
|
631
539
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
float
|
|
651
|
-
|
|
540
|
+
// ── 1. HYPSOMETRIC TONE — tanh expands the compressed band (basins+ridges hit the ramp ENDS).
|
|
541
|
+
float tone = 0.5 + 0.5 * tanh(H * uTune.x);
|
|
542
|
+
vec3 fill = samplePaletteLin(tone);
|
|
543
|
+
|
|
544
|
+
// ── 2. ANALYTIC HILLSHADE — one ∇H finite-diff at the SHARED e, dotted with the cel light.
|
|
545
|
+
float e = HILLSHADE_E;
|
|
546
|
+
float hx = sampleHeight(p + vec2(e, 0.0), t) - sampleHeight(p - vec2(e, 0.0), t);
|
|
547
|
+
float hy = sampleHeight(p + vec2(0.0, e), t) - sampleHeight(p - vec2(0.0, e), t);
|
|
548
|
+
vec2 grad = vec2(hx, hy) / (2.0 * e);
|
|
549
|
+
vec2 L = normalize(uLightDir + vec2(1e-5));
|
|
550
|
+
float shade = 0.5 + 0.5 * clamp(dot(normalize(grad + vec2(1e-5)), L), -1.0, 1.0);
|
|
551
|
+
fill *= mix(1.0 - uTune.y, 1.0 + uTune.y, shade);
|
|
552
|
+
|
|
553
|
+
// ── 3. TWO-TIER INDEX/MINOR CONTOUR — isIndex a pure f(level); hw FED to the frozen contourInk.
|
|
554
|
+
float fN = H * levels + uTopo.w * sin(floor(H * levels) * 2.4 + t * 0.7);
|
|
555
|
+
float indexEvery = max(uLine.w, 1.0);
|
|
556
|
+
float lvl = floor(fN);
|
|
557
|
+
float isIndex = fract(lvl / indexEvery) < (0.5 / indexEvery) ? 1.0 : 0.0;
|
|
558
|
+
float hw = mix(uLine.x, uLine.x * uTune.z, isIndex);
|
|
559
|
+
float ink = clamp(contourInk(fN, hw), 0.0, 1.0);
|
|
560
|
+
|
|
561
|
+
// ── 4. INK = a darker ember of the LOCAL fill (the edge-of-its-own-band signature).
|
|
562
|
+
vec3 inkCol = mix(fill, fill * uTune.w, 0.85);
|
|
563
|
+
|
|
564
|
+
// ── 5. ONE color path + OPAQUE OUT — the viz IS the colorful field.
|
|
565
|
+
vec3 col = mix(fill, inkCol, ink);
|
|
566
|
+
fragColor = vec4(clamp(linearToSrgb(col), vec3(0.0), vec3(1.0)), 1.0);
|
|
652
567
|
}`;
|
|
653
568
|
//#endregion
|
|
654
569
|
//#region src/components/custom/concentric/composables/concentricGLSetup.ts
|
|
655
|
-
function
|
|
570
|
+
function K(e, t, n) {
|
|
656
571
|
let r = e.createShader(t);
|
|
657
572
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
658
573
|
let t = e.getShaderInfoLog(r);
|
|
@@ -660,16 +575,16 @@ function Z(e, t, n) {
|
|
|
660
575
|
}
|
|
661
576
|
return r;
|
|
662
577
|
}
|
|
663
|
-
function
|
|
664
|
-
let { canvas: t, config: n, getPalette: r,
|
|
578
|
+
function q(e) {
|
|
579
|
+
let { canvas: t, config: n, getPalette: r, getCursor: i, getAmp: a, getWellScale: o, shouldContinue: c, onFrame: u } = e;
|
|
665
580
|
return function(e) {
|
|
666
|
-
let
|
|
667
|
-
if (e.attachShader(
|
|
668
|
-
e.deleteShader(
|
|
669
|
-
let
|
|
670
|
-
e.bindVertexArray(
|
|
671
|
-
let
|
|
672
|
-
e.bindBuffer(e.ARRAY_BUFFER,
|
|
581
|
+
let d = K(e, e.VERTEX_SHADER, W), f = K(e, e.FRAGMENT_SHADER, G), p = e.createProgram();
|
|
582
|
+
if (e.attachShader(p, d), e.attachShader(p, f), e.linkProgram(p), !e.getProgramParameter(p, e.LINK_STATUS)) throw Error(`[Concentric] link failed: ${e.getProgramInfoLog(p)}`);
|
|
583
|
+
e.deleteShader(d), e.deleteShader(f);
|
|
584
|
+
let m = e.createVertexArray();
|
|
585
|
+
e.bindVertexArray(m);
|
|
586
|
+
let h = e.createBuffer();
|
|
587
|
+
e.bindBuffer(e.ARRAY_BUFFER, h), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
|
|
673
588
|
-1,
|
|
674
589
|
-1,
|
|
675
590
|
3,
|
|
@@ -677,128 +592,131 @@ function Q(e) {
|
|
|
677
592
|
-1,
|
|
678
593
|
3
|
|
679
594
|
]), e.STATIC_DRAW);
|
|
680
|
-
let
|
|
681
|
-
e.enableVertexAttribArray(
|
|
682
|
-
let
|
|
683
|
-
function
|
|
684
|
-
let n =
|
|
685
|
-
(t.width !== a || t.height !==
|
|
595
|
+
let g = e.getAttribLocation(p, "aPosition");
|
|
596
|
+
e.enableVertexAttribArray(g), e.vertexAttribPointer(g, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
|
|
597
|
+
let _ = (t) => e.getUniformLocation(p, t), v = _("uTime"), y = _("uSpeed"), b = _("uCellSize"), x = _("uFieldNorm"), S = _("uAspect"), C = _("uStopCount"), w = _("uHasBackground"), T = _("uLine"), E = _("uLightDir"), D = _("uBg"), O = _("uWave"), k = _("uWave2"), A = _("uTopo"), j = _("uCursor"), M = _("uTune"), N = _("uPalette[0]");
|
|
598
|
+
function P() {
|
|
599
|
+
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));
|
|
600
|
+
(t.width !== a || t.height !== o) && (t.width = a, t.height = o), e.viewport(0, 0, t.width, t.height);
|
|
686
601
|
}
|
|
687
|
-
function
|
|
688
|
-
|
|
689
|
-
let
|
|
690
|
-
e.useProgram(
|
|
691
|
-
let
|
|
692
|
-
|
|
602
|
+
function F(s) {
|
|
603
|
+
u?.(s);
|
|
604
|
+
let c = t.clientWidth || 320, d = t.clientHeight || 320, f = c / Math.max(d, 1);
|
|
605
|
+
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), e.uniform1f(v, s), e.uniform1f(y, n.speed), e.uniform1f(b, n.cellSize), e.uniform1f(x, L), e.uniform1f(S, f);
|
|
606
|
+
let h = r(), g = Math.min(h.length, 4);
|
|
607
|
+
e.uniform1i(C, g), e.uniform4f(T, n.lineWidth, n.lineSoftness, n.contourLevels, n.indexEvery), e.uniform2f(E, n.lightDir[0], n.lightDir[1]), e.uniform4f(O, n.waveDir[0], n.waveDir[1], n.waveK, n.waveOmega), e.uniform4f(k, n.waveSigma, n.twistMax, n.shearMax, a()), e.uniform4f(A, n.heightOctaves, n.heightSeed, n.swellAmp, n.perturbAmp);
|
|
608
|
+
let _ = i();
|
|
609
|
+
if (e.uniform4f(j, _.x, _.y, n.cursorWell * o(), +!!n.interactive), e.uniform4f(M, n.toneGain, n.shadeAmp, n.indexMul, n.inkDarken), n.background === "transparent") e.uniform1f(w, 0), e.uniform3f(D, 0, 0, 0);
|
|
693
610
|
else {
|
|
694
|
-
e.uniform1f(
|
|
695
|
-
let t =
|
|
611
|
+
e.uniform1f(w, 1);
|
|
612
|
+
let t = l(n.background);
|
|
696
613
|
e.uniform3f(D, t[0], t[1], t[2]);
|
|
697
614
|
}
|
|
698
|
-
let P = new Float32Array(
|
|
699
|
-
for (let e = 0; e < 8; e++) {
|
|
700
|
-
let t = n.ringComponents[e];
|
|
701
|
-
P[e * 3 + 0] = t?.amplitude ?? 0, P[e * 3 + 1] = t?.wavelength ?? 1, P[e * 3 + 2] = t?.phase ?? 0;
|
|
702
|
-
}
|
|
703
|
-
e.uniform3fv(O, P);
|
|
704
|
-
let F = new Float32Array(16);
|
|
615
|
+
let P = new Float32Array(12);
|
|
705
616
|
for (let e = 0; e < 4; e++) {
|
|
706
|
-
let t =
|
|
707
|
-
|
|
617
|
+
let t = l(h[Math.min(e, g - 1)] ?? h[0]);
|
|
618
|
+
P[e * 3 + 0] = t[0], P[e * 3 + 1] = t[1], P[e * 3 + 2] = t[2];
|
|
708
619
|
}
|
|
709
|
-
e.
|
|
710
|
-
let I = new Float32Array(12);
|
|
711
|
-
for (let e = 0; e < 4; e++) {
|
|
712
|
-
let t = c(M[Math.min(e, N - 1)] ?? M[0]);
|
|
713
|
-
I[e * 3 + 0] = t[0], I[e * 3 + 1] = t[1], I[e * 3 + 2] = t[2];
|
|
714
|
-
}
|
|
715
|
-
e.uniform3fv(A, I), e.drawArrays(e.TRIANGLES, 0, 3), e.bindVertexArray(null);
|
|
620
|
+
e.uniform3fv(N, P), e.drawArrays(e.TRIANGLES, 0, 3), e.bindVertexArray(null);
|
|
716
621
|
}
|
|
717
622
|
return {
|
|
718
|
-
frame:
|
|
719
|
-
shouldContinue:
|
|
720
|
-
resize:
|
|
623
|
+
frame: F,
|
|
624
|
+
shouldContinue: c,
|
|
625
|
+
resize: P,
|
|
721
626
|
teardown: () => {
|
|
722
|
-
e.deleteProgram(
|
|
627
|
+
e.deleteProgram(p), e.deleteVertexArray(m), e.deleteBuffer(h);
|
|
723
628
|
}
|
|
724
629
|
};
|
|
725
630
|
};
|
|
726
631
|
}
|
|
727
632
|
//#endregion
|
|
728
633
|
//#region src/components/custom/concentric/composables/useConcentric.ts
|
|
729
|
-
function
|
|
730
|
-
let { config: r, getPalette: i } = n, a = n.mode ?? "live", o = t({ respectReducedMotion: r.respectReducedMotion }),
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
634
|
+
function J(e, n) {
|
|
635
|
+
let { config: r, getPalette: i } = n, a = n.mode ?? "live", o = t({ respectReducedMotion: r.respectReducedMotion }), s = {
|
|
636
|
+
x: 1e6,
|
|
637
|
+
y: 1e6
|
|
638
|
+
}, l = () => s, u = 0, d = () => u, f = 1, p = () => f, m = 0, h = () => {
|
|
639
|
+
o.onPointerEnter(), r.interactive && x?.wake();
|
|
640
|
+
}, g = (e) => {
|
|
641
|
+
o.onPointerMove(e), r.interactive && x?.wake();
|
|
642
|
+
}, _ = (e) => e.parentElement ?? e;
|
|
643
|
+
function v(e) {
|
|
644
|
+
let t = _(e);
|
|
645
|
+
t.addEventListener("pointermove", g), t.addEventListener("pointerenter", h), t.addEventListener("pointerleave", o.onPointerLeave);
|
|
738
646
|
}
|
|
739
|
-
function
|
|
740
|
-
let t =
|
|
741
|
-
t.removeEventListener("pointermove",
|
|
647
|
+
function y(e) {
|
|
648
|
+
let t = _(e);
|
|
649
|
+
t.removeEventListener("pointermove", g), t.removeEventListener("pointerenter", h), t.removeEventListener("pointerleave", o.onPointerLeave);
|
|
742
650
|
}
|
|
743
|
-
function
|
|
744
|
-
let
|
|
745
|
-
if (
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
651
|
+
function b(t) {
|
|
652
|
+
let n = m > 0 ? (t - m) * 1e3 : 16.7;
|
|
653
|
+
if (m = t, o.tick(n), x?.reducedMotion ? (u = 0, f = 1) : (u += (1.06 - u) * .04, u > 1 && (u = 1 + (u - 1) * .85)), !r.interactive || !o.active.value) {
|
|
654
|
+
s = {
|
|
655
|
+
x: 1e6,
|
|
656
|
+
y: 1e6
|
|
657
|
+
}, f = 1;
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
let i = o.smoothedPosition.value, a = o.velocity.value, c = o.acceleration.value, l = .1, d = .04, p = e.value, h = (p?.clientWidth || 320) / Math.max(p?.clientHeight || 320, 1);
|
|
661
|
+
s = {
|
|
662
|
+
x: (i.x * 2 - 1 + a.x * l + c.x * d) * h,
|
|
663
|
+
y: -(i.y * 2 - 1) - a.y * l - c.y * d
|
|
664
|
+
};
|
|
665
|
+
let g = Math.hypot(a.x, a.y), _ = Math.min(g / 1.2, 1), v = _ * _ * (3 - 2 * _), y = o.burst.value;
|
|
666
|
+
f = 1 + r.velocityHeave * v + r.velocityHeave * .6 * y;
|
|
753
667
|
}
|
|
754
|
-
let
|
|
668
|
+
let x = null, S = () => {
|
|
755
669
|
let t = e.value;
|
|
756
|
-
return t ? (
|
|
670
|
+
return t ? (x || (v(t), x = c(t, {
|
|
757
671
|
mode: a,
|
|
758
672
|
respectReducedMotion: r.respectReducedMotion,
|
|
759
|
-
setupWGPU:
|
|
673
|
+
setupWGPU: U({
|
|
760
674
|
canvas: t,
|
|
761
675
|
config: r,
|
|
762
676
|
getPalette: i,
|
|
763
|
-
|
|
677
|
+
getCursor: l,
|
|
678
|
+
getAmp: d,
|
|
679
|
+
getWellScale: p,
|
|
764
680
|
shouldContinue: () => !0,
|
|
765
|
-
onFrame:
|
|
681
|
+
onFrame: b
|
|
766
682
|
}),
|
|
767
|
-
setupGL:
|
|
683
|
+
setupGL: q({
|
|
768
684
|
canvas: t,
|
|
769
685
|
config: r,
|
|
770
686
|
getPalette: i,
|
|
771
|
-
|
|
687
|
+
getCursor: l,
|
|
688
|
+
getAmp: d,
|
|
689
|
+
getWellScale: p,
|
|
772
690
|
shouldContinue: () => !0,
|
|
773
|
-
onFrame:
|
|
691
|
+
onFrame: b
|
|
774
692
|
})
|
|
775
|
-
}),
|
|
693
|
+
}), x.armAsync()), x) : null;
|
|
776
694
|
};
|
|
777
|
-
queueMicrotask(() =>
|
|
778
|
-
let
|
|
695
|
+
queueMicrotask(() => S());
|
|
696
|
+
let C = {
|
|
779
697
|
get backend() {
|
|
780
|
-
return
|
|
698
|
+
return S()?.backend ?? "webgpu";
|
|
781
699
|
},
|
|
782
|
-
pause: () =>
|
|
783
|
-
resume: () =>
|
|
784
|
-
wake: () =>
|
|
785
|
-
renderAt: (e) =>
|
|
700
|
+
pause: () => S()?.suspend("manual"),
|
|
701
|
+
resume: () => S()?.resume("manual"),
|
|
702
|
+
wake: () => S()?.wake(),
|
|
703
|
+
renderAt: (e) => S()?.renderAt(e),
|
|
786
704
|
get reducedMotion() {
|
|
787
|
-
return
|
|
705
|
+
return x?.reducedMotion ?? !1;
|
|
788
706
|
},
|
|
789
707
|
dispose: () => {
|
|
790
708
|
let t = e.value;
|
|
791
|
-
t &&
|
|
709
|
+
t && y(t), o.dispose(), x?.dispose();
|
|
792
710
|
}
|
|
793
711
|
};
|
|
794
|
-
return
|
|
712
|
+
return w(() => C.dispose()), C;
|
|
795
713
|
}
|
|
796
714
|
//#endregion
|
|
797
715
|
//#region src/components/custom/concentric/Concentric.vue
|
|
798
|
-
var
|
|
716
|
+
var Y = /* @__PURE__ */ e(/* @__PURE__ */ S({
|
|
799
717
|
__name: "Concentric",
|
|
800
718
|
props: {
|
|
801
|
-
config: { default: () =>
|
|
719
|
+
config: { default: () => P },
|
|
802
720
|
paused: {
|
|
803
721
|
type: Boolean,
|
|
804
722
|
default: !1
|
|
@@ -806,24 +724,24 @@ var ee = /* @__PURE__ */ e(/* @__PURE__ */ f({
|
|
|
806
724
|
},
|
|
807
725
|
emits: ["update:paused"],
|
|
808
726
|
setup(e, { expose: t }) {
|
|
809
|
-
let n =
|
|
727
|
+
let n = E("canvasRef"), { isDark: r } = u(), i = y(() => e.config.palette === A), a = () => i.value && r.value ? j : e.config.palette, o = y(() => i.value ? r.value ? N : M : e.config.background), s = J(n, {
|
|
810
728
|
config: e.config,
|
|
811
|
-
getPalette:
|
|
729
|
+
getPalette: a
|
|
812
730
|
});
|
|
813
|
-
|
|
814
|
-
let
|
|
815
|
-
let
|
|
816
|
-
if (
|
|
731
|
+
D(() => e.paused, (e) => e ? s.pause() : s.resume(), { immediate: !0 });
|
|
732
|
+
let c = y(() => {
|
|
733
|
+
let e = o.value;
|
|
734
|
+
if (e !== "transparent") return `oklch(${e.L} ${e.C} ${e.h})`;
|
|
817
735
|
});
|
|
818
736
|
return t({
|
|
819
|
-
pause:
|
|
820
|
-
resume:
|
|
821
|
-
wake:
|
|
822
|
-
renderAt:
|
|
823
|
-
}), (e, t) => (
|
|
737
|
+
pause: s.pause,
|
|
738
|
+
resume: s.resume,
|
|
739
|
+
wake: s.wake,
|
|
740
|
+
renderAt: s.renderAt
|
|
741
|
+
}), (e, t) => (T(), b("div", {
|
|
824
742
|
class: "concentric-wrapper",
|
|
825
|
-
style:
|
|
826
|
-
}, [
|
|
743
|
+
style: C(c.value ? { background: c.value } : void 0)
|
|
744
|
+
}, [x("canvas", {
|
|
827
745
|
ref_key: "canvasRef",
|
|
828
746
|
ref: n,
|
|
829
747
|
class: "concentric-canvas",
|
|
@@ -831,6 +749,57 @@ var ee = /* @__PURE__ */ e(/* @__PURE__ */ f({
|
|
|
831
749
|
"data-testid": "concentric-canvas"
|
|
832
750
|
}, null, 512)], 4));
|
|
833
751
|
}
|
|
834
|
-
}), [["__scopeId", "data-v-
|
|
752
|
+
}), [["__scopeId", "data-v-18ed696c"]]);
|
|
753
|
+
//#endregion
|
|
754
|
+
//#region src/components/custom/concentric/composables/levelField.ts
|
|
755
|
+
function X(e, t) {
|
|
756
|
+
let n = e * .1031 % 1, r = t * .1031 % 1, i = e * .1031 % 1;
|
|
757
|
+
n < 0 && (n += 1), r < 0 && (r += 1), i < 0 && (i += 1);
|
|
758
|
+
let a = n * (r + 33.33) + r * (i + 33.33) + i * (n + 33.33);
|
|
759
|
+
n += a, r += a, i += a;
|
|
760
|
+
let o = (n + r) * i % 1;
|
|
761
|
+
return o < 0 && (o += 1), o;
|
|
762
|
+
}
|
|
763
|
+
function Z(e, t) {
|
|
764
|
+
let n = Math.floor(e), r = Math.floor(t), i = e - n, a = t - r, o = i * i * i * (i * (i * 6 - 15) + 10), s = a * a * a * (a * (a * 6 - 15) + 10), c = X(n, r), l = X(n + 1, r), u = X(n, r + 1), d = X(n + 1, r + 1), f = (e, t, n) => e + (t - e) * n;
|
|
765
|
+
return f(f(c, l, o), f(u, d, o), s);
|
|
766
|
+
}
|
|
767
|
+
function Q(e, t, n) {
|
|
768
|
+
let r = m(h, e, t, n.waveDir, n.waveK, n.waveOmega, n.waveSigma, n.twistMax, n.amp);
|
|
769
|
+
n.interactive > .5 && (r = _(r, n.cursor, n.cursorWell * .6, n.cellSize * 2.5));
|
|
770
|
+
let i = d(Z, {
|
|
771
|
+
x: r.x * .9,
|
|
772
|
+
y: r.y * .9
|
|
773
|
+
}, n.heightOctaves, n.heightSeed);
|
|
774
|
+
if (i += n.swellAmp * v(t, n.heightSeed), n.interactive > .5) {
|
|
775
|
+
let t = e.x - n.cursor.x, r = e.y - n.cursor.y, a = t * t + r * r;
|
|
776
|
+
i += n.cursorWell * Math.exp(-a / .22);
|
|
777
|
+
}
|
|
778
|
+
return i;
|
|
779
|
+
}
|
|
780
|
+
var $ = .012;
|
|
781
|
+
function ee(e, t) {
|
|
782
|
+
return .5 + .5 * Math.tanh(e * t);
|
|
783
|
+
}
|
|
784
|
+
function te(e, t, n, r) {
|
|
785
|
+
let i = $, a = Q({
|
|
786
|
+
x: e.x + i,
|
|
787
|
+
y: e.y
|
|
788
|
+
}, t, n) - Q({
|
|
789
|
+
x: e.x - i,
|
|
790
|
+
y: e.y
|
|
791
|
+
}, t, n), o = Q({
|
|
792
|
+
x: e.x,
|
|
793
|
+
y: e.y + i
|
|
794
|
+
}, t, n) - Q({
|
|
795
|
+
x: e.x,
|
|
796
|
+
y: e.y - i
|
|
797
|
+
}, t, n), s = a / (2 * i), c = o / (2 * i), l = Math.hypot(s, c) + 1e-5, u = Math.hypot(r.x, r.y) + 1e-5, d = s / l * (r.x / u) + c / l * (r.y / u);
|
|
798
|
+
return .5 + .5 * Math.max(-1, Math.min(1, d));
|
|
799
|
+
}
|
|
800
|
+
function ne(e, t) {
|
|
801
|
+
let n = Math.floor(e);
|
|
802
|
+
return +(n / t - Math.floor(n / t) < .5 / t);
|
|
803
|
+
}
|
|
835
804
|
//#endregion
|
|
836
|
-
export {
|
|
805
|
+
export { Y as Concentric, P as DEFAULT_CONCENTRIC_CONFIG, $ as HILLSHADE_EPSILON, k as MAX_RING_STOPS, N as WARM_GROUND_DARK, M as WARM_GROUND_LIGHT, A as WARM_IDENTITY_PALETTE, j as WARM_IDENTITY_PALETTE_DARK, te as hillshade, ne as isIndexLevel, Q as sampleHeight, ee as toneFromHeight, J as useConcentric };
|