@mkbabb/glass-ui 4.0.1 → 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-CW7a0m8M.js → CardAction-DlVP2evz.js} +72 -53
- package/dist/{CommandShortcut-DvZNQ_HF.js → CommandShortcut-By-VQcLO.js} +25 -14
- package/dist/{ConfiguratorRow-BR4l-ixA.js → ConfiguratorRow-YMXdINHx.js} +14 -14
- package/dist/ContextMenuContent-CMWn6huB.js +90 -0
- package/dist/{ContextMenuSubContent-xol4sD2q.js → ContextMenuSubContent-DvwWCUc0.js} +16 -16
- package/dist/{DataTable-CuKwF7wr.js → DataTable-C4tG3eIJ.js} +4 -4
- package/dist/DialogContent-D8U9ZfWS.js +121 -0
- package/dist/DialogFooter-DoLy0ewI.js +80 -0
- package/dist/DialogScrollContent-BMekN7gq.js +93 -0
- package/dist/{FadingScroll-DI6hQhT9.js → FadingScroll-P8B30rAD.js} +1 -1
- package/dist/HoverCardContent-DAmGYglo.js +88 -0
- package/dist/{HoverPopover-CbqbNwgU.js → HoverPopover-DYpBOzzF.js} +1 -1
- package/dist/{IconChip-BTD-nay5.js → IconChip-CQa7XZYc.js} +7 -5
- package/dist/{IconTooltip-Bl8gFZ8d.js → IconTooltip-_df8M3xm.js} +1 -1
- package/dist/Input-CyU4_hIC.js +57 -0
- package/dist/{MetricBadge-RHdBP72w.js → MetricBadge-DQt_dGah.js} +1 -1
- package/dist/{Notification-VUwexFUf.js → Notification-BlSPJhtZ.js} +4 -4
- package/dist/NumberFieldContent-Z3VxGu_6.js +140 -0
- 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-DctG61iZ.js → Progress-C9SsdwIZ.js} +1 -1
- package/dist/{ScrollingText-yOpBzFYq.js → ScrollingText-DY3W1Jfh.js} +2 -2
- package/dist/SelectScrollDownButton-3mFHX_R-.js +260 -0
- package/dist/{SelectSeparator-DXswVdRz.js → SelectSeparator-CNRGG7Ew.js} +1 -1
- package/dist/Separator-Cf9-JFgi.js +44 -0
- package/dist/Switch-uf-UKPA2.js +49 -0
- package/dist/{Toaster-Bw4xR8xV.js → Toaster-ozrsR4mP.js} +2 -2
- package/dist/{ToggleGroupItem-pEM9vIhs.js → ToggleGroupItem-BpzaVzNm.js} +6 -6
- package/dist/TooltipProvider-QQVM_80r.js +109 -0
- package/dist/animated-digit.js +2 -2
- package/dist/api/index.d.ts +16 -32
- package/dist/api/types-extra.d.ts +33 -0
- package/dist/api.js +2 -2
- package/dist/aurora.js +629 -269
- package/dist/badge-Bt14yURi.js +72 -0
- package/dist/badge.js +1 -1
- package/dist/border-progress.js +49 -57
- package/dist/button-D1W9PrzI.js +130 -0
- package/dist/button.js +1 -1
- package/dist/canvas.js +2 -3
- package/dist/card.js +1 -1
- package/dist/carousel.js +235 -106
- package/dist/chipVariants-BJQ0I2kB.js +18 -0
- package/dist/collapsible.js +1 -1
- package/dist/color-B9jZdhJX.js +116 -0
- package/dist/color.js +2 -2
- package/dist/command.js +1 -1
- package/dist/completion-seal.d.ts +1 -0
- package/dist/completion-seal.js +89 -0
- package/dist/components/custom/aurora/Aurora.vue.d.ts +10 -5
- package/dist/components/custom/aurora/composables/color.d.ts +13 -0
- package/dist/components/custom/aurora/composables/frameLoop.d.ts +9 -0
- package/dist/components/custom/aurora/composables/glSetup.d.ts +1 -1
- package/dist/components/custom/aurora/composables/runtime.d.ts +12 -0
- package/dist/components/custom/aurora/composables/uniformBridgeWGPU.d.ts +12 -3
- package/dist/components/custom/aurora/composables/wgpuSetup.d.ts +8 -0
- package/dist/components/custom/aurora/constants/presets.d.ts +47 -0
- package/dist/components/custom/aurora/constants/renderMode.d.ts +16 -8
- package/dist/components/custom/aurora/constants/shaders/aurora-mediums.wgsl.d.ts +1 -0
- package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
- package/dist/components/custom/aurora/index.d.ts +1 -1
- package/dist/components/custom/border-progress/composables/spectrum-walk.d.ts +25 -0
- package/dist/components/custom/border-progress/composables/useBorderSpectrum.d.ts +14 -18
- package/dist/components/custom/border-progress/index.d.ts +1 -1
- package/dist/components/custom/completion-seal/CompletionSeal.vue.d.ts +21 -0
- package/dist/components/custom/completion-seal/composables/useCompletionSeal.d.ts +37 -0
- package/dist/components/custom/completion-seal/constants.d.ts +46 -0
- package/dist/components/custom/completion-seal/index.d.ts +4 -0
- package/dist/components/custom/concentric/Concentric.vue.d.ts +15 -12
- package/dist/components/custom/concentric/composables/concentricGLSetup.d.ts +12 -0
- package/dist/components/custom/concentric/composables/concentricWGPUSetup.d.ts +13 -0
- package/dist/components/custom/concentric/composables/levelField.d.ts +50 -0
- package/dist/components/custom/concentric/composables/uniformBridgeWGPU.d.ts +7 -3
- package/dist/components/custom/concentric/composables/useConcentric.d.ts +3 -3
- package/dist/components/custom/concentric/constants.d.ts +69 -24
- 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/confirm-dialog/ConfirmDialog.vue.d.ts +3 -3
- package/dist/components/custom/constellation/Constellation.vue.d.ts +5 -4
- package/dist/components/custom/constellation/composables/constellationGLSetup.d.ts +10 -0
- package/dist/components/custom/constellation/composables/constellationWGPUSetup.d.ts +19 -0
- package/dist/components/custom/constellation/composables/uniformBridgeWGPU.d.ts +66 -0
- package/dist/components/custom/constellation/composables/useConstellation.d.ts +3 -10
- package/dist/components/custom/constellation/constants.d.ts +33 -0
- package/dist/components/custom/constellation/constellationField.d.ts +31 -1
- package/dist/components/custom/constellation/constellationInteraction.d.ts +23 -14
- package/dist/components/custom/constellation/constellationRender.d.ts +25 -0
- package/dist/components/custom/constellation/constellationTypes.d.ts +38 -0
- package/dist/components/custom/constellation/constellationWell.d.ts +15 -0
- package/dist/components/custom/constellation/index.d.ts +5 -5
- package/dist/components/custom/constellation/shaders/constellation-lines.glsl.d.ts +2 -0
- package/dist/components/custom/constellation/shaders/constellation-lines.wgsl.d.ts +1 -0
- package/dist/components/custom/constellation/shaders/constellation-points.glsl.d.ts +2 -0
- package/dist/components/custom/constellation/shaders/constellation-points.wgsl.d.ts +1 -0
- package/dist/components/custom/deck/DeckPager.vue.d.ts +29 -0
- package/dist/components/custom/deck/composables/useDeck.d.ts +27 -0
- package/dist/components/custom/deck/composables/useDeckKeyboard.d.ts +25 -0
- package/dist/components/custom/deck/composables/useDeckSpring.d.ts +22 -0
- package/dist/components/custom/deck/constants.d.ts +14 -0
- package/dist/components/custom/deck/index.d.ts +8 -0
- package/dist/components/custom/dock/DockDropdownTrigger.vue.d.ts +4 -3
- package/dist/components/custom/dock/DockIconButton.vue.d.ts +22 -0
- package/dist/components/custom/dock/DockPopoverTrigger.vue.d.ts +19 -0
- package/dist/components/custom/dock/DockStack.vue.d.ts +78 -0
- package/dist/components/custom/dock/GlassDock.vue.d.ts +21 -3
- package/dist/components/custom/dock/composables/dockMorphContext.d.ts +18 -32
- package/dist/components/custom/dock/composables/dockMorphMeasure.d.ts +78 -67
- package/dist/components/custom/dock/composables/index.d.ts +3 -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/useDockSearch.d.ts +85 -0
- package/dist/components/custom/dock/composables/useDockShellProps.d.ts +49 -0
- package/dist/components/custom/dock/constants.d.ts +32 -17
- package/dist/components/custom/dock/index.d.ts +8 -2
- package/dist/components/custom/dot-flow-field/DotFlowField.vue.d.ts +15 -11
- package/dist/components/custom/dot-flow-field/composables/flowField.d.ts +69 -6
- 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 +50 -9
- package/dist/components/custom/dot-flow-field/composables/useDotFlowField.d.ts +6 -5
- package/dist/components/custom/dot-flow-field/composables/useFlowParticles.d.ts +23 -9
- package/dist/components/custom/dot-flow-field/constants.d.ts +92 -20
- package/dist/components/custom/dot-flow-field/index.d.ts +2 -2
- package/dist/components/custom/dot-flow-field/shaders/flow-field.compute.wgsl.d.ts +1 -1
- package/dist/components/custom/dot-flow-field/shaders/flow-field.glsl.d.ts +31 -18
- package/dist/components/custom/dot-flow-field/shaders/flow-field.render.wgsl.d.ts +2 -1
- package/dist/components/custom/dot-matrix/DotMatrix.vue.d.ts +43 -0
- package/dist/components/custom/dot-matrix/composables/dotMatrixField.d.ts +89 -0
- package/dist/components/custom/dot-matrix/composables/uniformBridgeWGPU.d.ts +61 -0
- package/dist/components/custom/dot-matrix/composables/useDotMatrix.d.ts +34 -0
- package/dist/components/custom/dot-matrix/composables/useDotSphere.d.ts +34 -0
- package/dist/components/custom/dot-matrix/constants.d.ts +72 -0
- package/dist/components/custom/dot-matrix/index.d.ts +5 -0
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.glsl.d.ts +4 -0
- package/dist/components/custom/dot-matrix/shaders/dot-matrix.wgsl.d.ts +1 -0
- package/dist/components/custom/easing/EasingPicker.vue.d.ts +2 -2
- package/dist/components/custom/easing/composables/useEasingPicker.d.ts +5 -0
- package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +11 -0
- package/dist/components/custom/fourier-field/FourierField.vue.d.ts +44 -47
- package/dist/components/custom/fourier-field/composables/fourierFieldGLSetup.d.ts +24 -0
- package/dist/components/custom/fourier-field/composables/fourierFieldWGPUSetup.d.ts +31 -0
- package/dist/components/custom/fourier-field/composables/uniformBridgeWGPU.d.ts +56 -0
- package/dist/components/custom/fourier-field/composables/useFourierField.d.ts +61 -37
- package/dist/components/custom/fourier-field/constants.d.ts +114 -4
- package/dist/components/custom/fourier-field/index.d.ts +23 -18
- package/dist/components/custom/fourier-field/shaders/fourier-field.compute.wgsl.d.ts +1 -0
- package/dist/components/custom/fourier-field/shaders/fourier-field.glsl.d.ts +4 -0
- package/dist/components/custom/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +9 -1
- package/dist/components/custom/goo-blob/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/index.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/metaball-noise.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/metaball-palette.wgsl.d.ts +1 -0
- package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/shaders/metaball.wgsl.d.ts +1 -1
- package/dist/components/custom/goo-blob/types.d.ts +86 -1
- package/dist/components/custom/goo-dot-matrix/GooDotMatrix.vue.d.ts +49 -0
- package/dist/components/custom/goo-dot-matrix/composables/gooDotLattice.d.ts +24 -0
- package/dist/components/custom/goo-dot-matrix/composables/gooDotSetup.d.ts +79 -0
- package/dist/components/custom/goo-dot-matrix/composables/uniformBridgeWGPU.d.ts +45 -0
- package/dist/components/custom/goo-dot-matrix/composables/useGooDotMatrix.d.ts +31 -0
- package/dist/components/custom/goo-dot-matrix/constants.d.ts +115 -0
- package/dist/components/custom/goo-dot-matrix/index.d.ts +5 -0
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.frag.d.ts +13 -0
- package/dist/components/custom/goo-dot-matrix/shaders/goo-dot.wgsl.d.ts +4 -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/labeled-field/LabeledField.vue.d.ts +21 -2
- package/dist/components/custom/metric-stack/MetricRow.vue.d.ts +15 -0
- package/dist/components/custom/pager-dots/PagerDots.vue.d.ts +9 -0
- package/dist/components/custom/pager-dots/index.d.ts +2 -0
- package/dist/components/custom/pager-dots/pagerWindow.d.ts +9 -0
- package/dist/components/custom/paper-backdrop/PaperBackdrop.vue.d.ts +18 -0
- package/dist/components/custom/paper-grid/PaperGrid.vue.d.ts +42 -0
- package/dist/components/custom/paper-grid/composables/paperGrid.d.ts +105 -0
- package/dist/components/custom/paper-grid/composables/paperGridGLSetup.d.ts +18 -0
- package/dist/components/custom/paper-grid/composables/paperGridWGPUSetup.d.ts +21 -0
- package/dist/components/custom/paper-grid/composables/uniformBridgeWGPU.d.ts +16 -0
- package/dist/components/custom/paper-grid/composables/usePaperGrid.d.ts +31 -0
- package/dist/components/custom/paper-grid/constants.d.ts +95 -0
- package/dist/components/custom/paper-grid/index.d.ts +5 -0
- package/dist/components/custom/paper-grid/shaders/paper-grid.glsl.d.ts +4 -0
- package/dist/components/custom/paper-grid/shaders/paper-grid.wgsl.d.ts +1 -0
- package/dist/components/custom/search/FuzzySearch.vue.d.ts +8 -2
- package/dist/components/custom/search/SearchBar.vue.d.ts +8 -0
- package/dist/components/custom/search/index.d.ts +2 -0
- package/dist/components/custom/search/searchVariants.d.ts +19 -0
- package/dist/components/custom/selectable-chip/SelectableChip.vue.d.ts +50 -0
- package/dist/components/custom/selectable-chip/chipVariants.d.ts +39 -0
- package/dist/components/custom/selectable-chip/index.d.ts +2 -0
- package/dist/components/custom/selectable-chip/selectableChipVariants.d.ts +15 -0
- package/dist/components/custom/split-chars/SplitChars.vue.d.ts +39 -0
- package/dist/components/custom/split-chars/index.d.ts +1 -0
- package/dist/components/custom/tabs/SegmentedTabs.vue.d.ts +8 -6
- package/dist/components/custom/tabs/constants.d.ts +28 -2
- 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 +32 -17
- package/dist/components/custom/watercolor-dot/useWatercolorBlob.d.ts +10 -5
- package/dist/components/ui/_shared/index.d.ts +2 -0
- package/dist/components/ui/_shared/useControlSize.d.ts +46 -0
- 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/button/index.d.ts +1 -1
- package/dist/components/ui/card/Card.vue.d.ts +46 -1
- package/dist/components/ui/card/ScrollCard.vue.d.ts +1 -1
- package/dist/components/ui/card/index.d.ts +1 -1
- package/dist/components/ui/carousel/CarouselContent.vue.d.ts +2 -4
- package/dist/components/ui/carousel/CarouselNext.vue.d.ts +1 -1
- package/dist/components/ui/carousel/CarouselPrevious.vue.d.ts +1 -1
- package/dist/components/ui/command/CommandDialog.vue.d.ts +9 -3
- package/dist/components/ui/command/CommandList.vue.d.ts +3 -0
- package/dist/components/ui/context-menu/ContextMenuContent.vue.d.ts +5 -1
- package/dist/components/ui/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/dropdown-menu/DropdownMenuContent.vue.d.ts +4 -0
- package/dist/components/ui/hover-card/HoverCardContent.vue.d.ts +3 -0
- package/dist/components/ui/input/Input.vue.d.ts +3 -0
- package/dist/components/ui/number-field/NumberFieldInput.vue.d.ts +6 -1
- package/dist/components/ui/select/SelectContent.vue.d.ts +12 -0
- package/dist/components/ui/slider/Slider.vue.d.ts +9 -0
- package/dist/components/ui/switch/Switch.vue.d.ts +2 -0
- package/dist/components/ui/textarea/Textarea.vue.d.ts +3 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +3 -0
- package/dist/composables/color/index.d.ts +2 -0
- package/dist/composables/color/useAccentTone.d.ts +34 -0
- package/dist/composables/dom/index.d.ts +1 -0
- package/dist/composables/dom/useDragVelocity.d.ts +46 -0
- package/dist/composables/glass/useVizChoreography.d.ts +123 -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 +105 -2
- package/dist/composables/glass/webgl/shaders/flow.wgsl.d.ts +1 -0
- package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +40 -2
- package/dist/composables/glass/webgpu/index.d.ts +2 -1
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +65 -7
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +50 -2
- package/dist/composables/glass/webgpu/webgpuDevice.d.ts +42 -0
- package/dist/composables/motion/core/index.d.ts +7 -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/scrollReader.d.ts +25 -0
- package/dist/composables/motion/springPresets.d.ts +19 -1
- 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/useCharStagger.d.ts +44 -0
- package/dist/composables/motion/useDockCtaReceive.d.ts +29 -22
- 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/useScrollChrome.d.ts +58 -0
- package/dist/composables/motion/useScrollPin.d.ts +49 -0
- package/dist/composables/motion/useScrollScene.d.ts +67 -0
- package/dist/composables/motion/useScrollTrigger.d.ts +67 -0
- package/dist/composables/motion/useSpringPress.d.ts +5 -5
- package/dist/composables/motion/useStaggerReveal.d.ts +24 -0
- package/dist/composables/sidebar/index.d.ts +4 -1
- package/dist/composables/sidebar/types.d.ts +68 -3
- package/dist/composables/sidebar/useClickDelegate.d.ts +4 -0
- package/dist/composables/sidebar/useLazyLoader.d.ts +5 -0
- package/dist/composables/sidebar/useScrollTo.d.ts +5 -0
- package/dist/composables/virtual/index.d.ts +4 -0
- package/dist/composables/virtual/useVirtualSectionWindow.d.ts +72 -0
- package/dist/composables/virtual/useWindowedStore.d.ts +43 -0
- package/dist/composables/virtual/virtualSectionLayout.d.ts +103 -0
- package/dist/concentric.js +552 -309
- package/dist/configurator.js +2 -2
- package/dist/confirm-dialog.js +62 -47
- package/dist/constellation.js +635 -235
- package/dist/context-menu.js +2 -2
- package/dist/controls.js +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.d.ts +1 -0
- package/dist/deck.js +105 -0
- package/dist/dialog.js +4 -3
- package/dist/dock.js +1320 -631
- package/dist/dockContext-gFVS2gMg.js +18 -0
- package/dist/dom.js +7 -6
- package/dist/dot-flow-field.js +1268 -387
- package/dist/dot-matrix.d.ts +1 -0
- package/dist/dot-matrix.js +774 -0
- package/dist/dotMatrixField-CRO0ZFk4.js +48 -0
- package/dist/drawer.js +106 -96
- package/dist/{dropdown-menu-CofSZuk8.js → dropdown-menu-CCfcCQ68.js} +83 -79
- package/dist/dropdown-menu.js +1 -1
- package/dist/easing.js +188 -176
- package/dist/expandable-container.js +43 -21
- package/dist/fading-scroll.js +1 -1
- package/dist/flow.glsl-DqEGRpl4.js +4 -0
- package/dist/forms.js +64 -62
- package/dist/fourier-field.js +1069 -178
- 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 +164 -119
- package/dist/goo-blob.js +175 -1230
- package/dist/goo-dot-matrix.d.ts +1 -0
- package/dist/goo-dot-matrix.js +811 -0
- 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 +5 -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 +70 -60
- package/dist/metric-badge.js +1 -1
- package/dist/metric-cell.js +1 -1
- package/dist/metric-stack.js +12 -3
- package/dist/motion-core.js +59 -34
- package/dist/motion-curves.js +30 -14
- package/dist/motion.js +231 -96
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +2 -91
- package/dist/paper-backdrop.js +1 -1
- package/dist/paper-grid.d.ts +1 -0
- package/dist/paper-grid.js +761 -0
- package/dist/paperGrid-CXCSMbZ1.js +191 -0
- package/dist/popover.js +1 -1
- package/dist/{presets-BW2b-fr1.js → presets-QvYgnFIZ.js} +14 -13
- package/dist/{procedural-color.glsl-CIFsJhwI.js → procedural-color.wgsl-C1Y5PkM6.js} +2 -2
- package/dist/progress.js +1 -1
- package/dist/pulse.js +2 -2
- package/dist/reactive.js +2 -2
- package/dist/{useCanvas2D-B8w_E3Rr.js → resolveCanvasColor-DsSJk06I.js} +16 -6
- package/dist/scrollReader-rc3Ns_NM.js +42 -0
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +162 -306
- package/dist/select.js +3 -3
- package/dist/selectable-chip.d.ts +1 -0
- package/dist/selectable-chip.js +48 -0
- package/dist/separator.js +1 -1
- package/dist/{sheet-tZMg0E0w.js → sheet-DUCIoOe0.js} +4 -4
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +216 -114
- package/dist/slider-CcICPe3u.js +149 -0
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +3 -3
- package/dist/spectrum-walk-cBNSx_zm.js +33 -0
- package/dist/springPresets-DfoQ6XRY.js +64 -0
- package/dist/stacked-icons.js +54 -39
- package/dist/styles/animations.css +13 -3
- package/dist/styles/cards.css +271 -2
- package/dist/styles/completion-seal.css +131 -0
- package/dist/styles/components.css +1 -4
- package/dist/styles/configurator.css +221 -1
- package/dist/styles/critical-partition.mjs +66 -11
- package/dist/styles/deferred.css +4 -0
- package/dist/styles/dock/adaptive-legibility.css +119 -0
- package/dist/styles/dock/cta-seat.css +87 -0
- package/dist/styles/dock/density.css +167 -6
- package/dist/styles/dock/fission-bridge.css +552 -0
- package/dist/styles/dock/layers.css +90 -78
- package/dist/styles/dock/morph-bridge.css +67 -18
- package/dist/styles/dock/morph.css +57 -118
- package/dist/styles/dock/overflow.css +12 -0
- package/dist/styles/dock/search.css +68 -0
- package/dist/styles/dock/shape.css +250 -0
- package/dist/styles/dock/shell.css +24 -8
- package/dist/styles/dock/stack-rail.css +352 -0
- package/dist/styles/dock-controls/dark-mode-toggle.css +17 -4
- package/dist/styles/dock-controls/icon-button.css +46 -0
- package/dist/styles/dock-controls/triggers.css +23 -1
- package/dist/styles/dock-controls.css +18 -0
- package/dist/styles/dock.css +27 -2
- package/dist/styles/drawer.css +166 -0
- package/dist/styles/glass/accent-tone.css +66 -0
- package/dist/styles/glass/control-surfaces.css +167 -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/ladder.css +67 -17
- 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 +31 -9
- package/dist/styles/glass/surfaces.css +81 -150
- package/dist/styles/glass.css +21 -0
- package/dist/styles/icon-chip.css +45 -0
- package/dist/styles/index.css +26 -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/scroll-chrome.css +123 -0
- package/dist/styles/scroll-driven.css +38 -0
- package/dist/styles/segmented-tabs.css +110 -40
- package/dist/styles/select.css +151 -0
- package/dist/styles/theme/bridges.css +22 -0
- package/dist/styles/theme/radius.css +18 -1
- package/dist/styles/tokens/color-radius.css +14 -4
- package/dist/styles/tokens/dark-arm.css +94 -12
- package/dist/styles/tokens/glass-deep.css +33 -4
- package/dist/styles/tokens/glass-fx.css +122 -1
- package/dist/styles/tokens/glass.css +226 -34
- package/dist/styles/tokens/light-dark.css +3 -3
- package/dist/styles/tokens/offsets.css +27 -0
- package/dist/styles/tokens/property-regs.css +277 -0
- package/dist/styles/tokens/scale-paper.css +86 -30
- package/dist/styles/tokens/scheme-motion.css +106 -133
- 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/sizing-config.css +110 -0
- package/dist/styles/tokens/sizing.css +55 -104
- package/dist/styles/tokens.css +14 -2
- package/dist/styles/typography/semantic.css +18 -5
- package/dist/styles/utilities/a11y-overrides.css +20 -5
- package/dist/styles/utilities/base-misc.css +52 -0
- package/dist/styles/utilities/btn.css +84 -3
- package/dist/styles/utilities/components.css +31 -6
- package/dist/styles/utilities/metal.css +26 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +199 -182
- 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 +2 -2
- package/dist/uniformBridgeWGPU-BCse1SHU.js +1268 -0
- package/dist/{useAnimatedNumber-BfUq2bUM.js → useAnimatedNumber-BntskVdQ.js} +1 -1
- package/dist/{useConfiguratorState-DNlOh6c8.js → useConfiguratorState-22BcULzF.js} +41 -38
- package/dist/useControlSize-DAZ062x7.js +9 -0
- package/dist/useDockCtaReceive-DX7RDb6_.js +88 -0
- package/dist/{useDragMorph-DgxnsVJz.js → useDragMorph-DGLSewwB.js} +4 -4
- package/dist/useDragVelocity-CjcfX3dA.js +57 -0
- package/dist/useFuzzySearch-0fTYOhS4.js +177 -0
- package/dist/useGooMorph-Cs13NgYL.js +104 -0
- package/dist/useGpuSubstrate-Ceet70xq.js +347 -0
- package/dist/useHaptic-CPz5BT9I.js +134 -0
- package/dist/{useLiquidFlex-mZPMiNXh.js → useLiquidFlex-Cc6PjVJD.js} +8 -3
- package/dist/useLiquidPress-CtOQ8Z0_.js +43 -0
- package/dist/useMorphField-ogBM7ubT.js +141 -0
- package/dist/usePointerVelocityField-BrkqZFhj.js +91 -0
- package/dist/useScrollChrome-JuImi1DM.js +258 -0
- package/dist/{useSpringMount-q1amq1SJ.js → useSpringMount-DFxtzmkR.js} +1 -1
- package/dist/useSpringPress-VM9RgVq3.js +36 -0
- package/dist/{useSurfaceAxis-g0NloYEF.js → useSurfaceAxis-Ci7Dnaw2.js} +1 -1
- package/dist/{useTouchGate-CBZTD4SD.js → useTouchGate-B1Lf9XqN.js} +1 -1
- package/dist/{vendor-CKmzio-i.js → vendor-B2qOlYY3.js} +24 -11
- package/dist/virtual.d.ts +1 -0
- package/dist/virtual.js +225 -0
- package/dist/watercolor-dot.js +107 -74
- package/dist/writeVelocityWeight-Bh83xZfs.js +19 -0
- package/package.json +140 -9
- package/src/styles/animations.css +13 -3
- package/src/styles/cards.css +271 -2
- package/src/styles/completion-seal.css +131 -0
- package/src/styles/configurator.css +221 -1
- package/src/styles/critical-partition.mjs +66 -11
- package/src/styles/dock/adaptive-legibility.css +119 -0
- package/src/styles/dock/cta-seat.css +87 -0
- package/src/styles/dock/density.css +167 -6
- package/src/styles/dock/fission-bridge.css +552 -0
- package/src/styles/dock/layers.css +90 -78
- package/src/styles/dock/morph-bridge.css +67 -18
- package/src/styles/dock/morph.css +57 -118
- package/src/styles/dock/overflow.css +12 -0
- package/src/styles/dock/search.css +68 -0
- package/src/styles/dock/shape.css +250 -0
- package/src/styles/dock/shell.css +24 -8
- package/src/styles/dock/stack-rail.css +352 -0
- package/src/styles/dock-controls/dark-mode-toggle.css +17 -4
- package/src/styles/dock-controls/icon-button.css +46 -0
- package/src/styles/dock-controls/triggers.css +23 -1
- package/src/styles/dock-controls.css +18 -0
- package/src/styles/dock.css +27 -2
- package/src/styles/drawer.css +164 -0
- package/src/styles/glass/accent-tone.css +66 -0
- package/src/styles/glass/control-surfaces.css +167 -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/ladder.css +67 -17
- 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 +31 -9
- package/src/styles/glass/surfaces.css +81 -150
- package/src/styles/glass.css +21 -0
- package/src/styles/icon-chip.css +45 -0
- package/src/styles/index.css +26 -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/scroll-chrome.css +123 -0
- package/src/styles/scroll-driven.css +38 -0
- package/src/styles/segmented-tabs.css +110 -36
- package/src/styles/select.css +151 -0
- package/src/styles/theme/bridges.css +22 -0
- package/src/styles/theme/radius.css +18 -1
- package/src/styles/tokens/color-radius.css +14 -4
- package/src/styles/tokens/dark-arm.css +94 -12
- package/src/styles/tokens/glass-deep.css +33 -4
- package/src/styles/tokens/glass-fx.css +122 -1
- package/src/styles/tokens/glass.css +226 -34
- package/src/styles/tokens/light-dark.css +3 -3
- package/src/styles/tokens/offsets.css +27 -0
- package/src/styles/tokens/property-regs.css +277 -0
- package/src/styles/tokens/scale-paper.css +86 -30
- package/src/styles/tokens/scheme-motion.css +106 -133
- 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/sizing-config.css +110 -0
- package/src/styles/tokens/sizing.css +55 -104
- package/src/styles/tokens.css +14 -2
- package/src/styles/typography/semantic.css +18 -5
- package/src/styles/utilities/a11y-overrides.css +20 -5
- package/src/styles/utilities/base-misc.css +52 -0
- package/src/styles/utilities/btn.css +84 -3
- package/src/styles/utilities/components.css +31 -6
- package/src/styles/utilities/metal.css +26 -0
- package/dist/ContextMenuContent-uWnVxDab.js +0 -85
- package/dist/DialogContent-DcKK8k9i.js +0 -103
- package/dist/DialogFooter-BZNX5aVr.js +0 -165
- package/dist/HoverCardContent-b2uaAMRR.js +0 -83
- package/dist/Input-h9v5LeXf.js +0 -55
- package/dist/NumberFieldContent-Cq7EzX-U.js +0 -138
- package/dist/PaperBackdrop-Vf3tlpvd.js +0 -31
- package/dist/SelectScrollDownButton-CrA8F0iV.js +0 -252
- package/dist/Separator-pKF0oA4M.js +0 -37
- package/dist/Switch-CwYNf8bo.js +0 -47
- package/dist/TooltipProvider-rzvnXz60.js +0 -104
- package/dist/badge-D9XWW4GT.js +0 -53
- package/dist/button-DYCUa-tH.js +0 -126
- package/dist/color-DweYl7pE.js +0 -86
- package/dist/components/custom/concentric/composables/ringField.d.ts +0 -44
- package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +0 -35
- package/dist/components/custom/constellation/constellationDraw.d.ts +0 -30
- package/dist/components/custom/dock/DockRail.vue.d.ts +0 -89
- package/dist/createCanvasLifecycle-CHD5XrDW.js +0 -82
- package/dist/dockContext-BNfyPLe9.js +0 -17
- package/dist/procedural-color.wgsl-CToRHugY.js +0 -224
- package/dist/resolveCanvasColor-CUyHr5Uu.js +0 -11
- package/dist/slider-DVb4HXU-.js +0 -142
- package/dist/springPresets-CFQGQfdl.js +0 -40
- package/dist/styles/dock/rail-extend.css +0 -397
- package/dist/useLiquidPress-kfb4KX79.js +0 -39
- package/dist/usePointerVelocityField-JbRd5CrM.js +0 -137
- package/dist/useRAFLoop-UYa4zoiN.js +0 -109
- package/dist/useSpringPress-BsqPr7FJ.js +0 -34
- package/src/styles/dock/rail-extend.css +0 -397
- /package/dist/{CollapsibleContent-68dEXIAl.js → CollapsibleContent-D7UNsXQr.js} +0 -0
- /package/dist/{InstrumentChassis-Bx0F_q5g.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-DwwjicPY.js → SelectGroup-Dcczq44n.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-C1je1s0u.js → _plugin-vue_export-helper-gLzyemvl.js} +0 -0
- /package/dist/{compile-CQEFRTmx.js → compile-INR_tPk_.js} +0 -0
- /package/dist/{constants-BPOqYJAm.js → constants-BWj7DkMn.js} +0 -0
- /package/dist/{createContext-CpBNTRMI.js → createContext-Cd23P9j0.js} +0 -0
- /package/dist/{math-BINYmg5z.js → math-5RcIgCB4.js} +0 -0
- /package/dist/{menuItemVariants-D8VNHq22.js → menuItemVariants-DAXquKja.js} +0 -0
- /package/dist/{prng-Za0Rmgag.js → prng-B5tIXTtj.js} +0 -0
- /package/dist/{useGlobalDark-C28t0VWJ.js → useGlobalDark-B4HO9LXG.js} +0 -0
- /package/dist/{useIntersectionPause-Bj4sPkMh.js → useIntersectionPause-DO8Vl4gs.js} +0 -0
- /package/dist/{useInterval-CvK1mL92.js → useInterval-BVUI-sez.js} +0 -0
- /package/dist/{useKeyboardShortcuts-BXWXOZ-9.js → useKeyboardShortcuts-BEut54Tk.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-D7bYU2RK.js → useScrollProgress-A0M6qRl7.js} +0 -0
- /package/dist/{useSortable-DHjtZSEd.js → useSortable-DQV_UNDw.js} +0 -0
- /package/dist/{useTextHighlight-CWEi25hf.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-Czsb7zQC.js → vReveal-CT1KtwZA.js} +0 -0
- /package/dist/{vSpecular-CQFmLNzA.js → vSpecular-EX7loENl.js} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CompletionSealShape } from "./constants";
|
|
2
|
+
export interface CompletionSealProps {
|
|
3
|
+
/** The seal glyph — `check` (default) | `ring` | `wordmark`. */
|
|
4
|
+
shape?: CompletionSealShape;
|
|
5
|
+
/**
|
|
6
|
+
* The accessible completion announcement (the `role="status"`/`aria-live` text — a
|
|
7
|
+
* screen reader hears "Speedtest complete", etc.). The gold mark is the visual.
|
|
8
|
+
*/
|
|
9
|
+
label?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The draw trigger — the consumer fires it on completion. When it flips truthy the
|
|
12
|
+
* seal draws ONCE. Default (unset) plays on mount (the seal draws when it appears —
|
|
13
|
+
* the canonical completion moment).
|
|
14
|
+
*/
|
|
15
|
+
play?: boolean;
|
|
16
|
+
/** Pass-through class on the root. */
|
|
17
|
+
class?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const __VLS_export: import("vue").DefineComponent<CompletionSealProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CompletionSealProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
export interface UseCompletionSealOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The draw trigger. When it flips truthy the seal draws ONCE (the consumer fires it
|
|
5
|
+
* on completion). A `Ref` or a getter; default plays on mount (`play` unset → the
|
|
6
|
+
* seal draws when it appears, the canonical completion moment).
|
|
7
|
+
*/
|
|
8
|
+
play?: Ref<boolean | undefined> | (() => boolean | undefined);
|
|
9
|
+
/**
|
|
10
|
+
* Honor `prefers-reduced-motion: reduce` — under reduce the seal appears INSTANTLY
|
|
11
|
+
* fully-drawn (no stroke animation, no glint sweep). Default true. (Never forced
|
|
12
|
+
* false — the PRM-safe-by-construction fence.)
|
|
13
|
+
*/
|
|
14
|
+
respectReducedMotion?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface UseCompletionSeal {
|
|
17
|
+
/** The reactive `data-play` seam — bind it to `:data-play` on `.completion-seal`. */
|
|
18
|
+
playing: Readonly<Ref<boolean>>;
|
|
19
|
+
/** True once the seal has drawn (or snapped under PRM) — the static held state. */
|
|
20
|
+
drawn: Readonly<Ref<boolean>>;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the motion is suppressed (PRM) — the SFC snaps `--seal-draw: 100%` and
|
|
23
|
+
* omits the `data-play` arm so the recipe's no-preference gate never fires.
|
|
24
|
+
*/
|
|
25
|
+
reduced: Readonly<Ref<boolean>>;
|
|
26
|
+
/** Imperatively (re-)fire the one-shot draw (a second completion event). */
|
|
27
|
+
draw: () => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The one-shot completion-seal draw. Arms `playing` (the `data-play` seam) for the
|
|
31
|
+
* single draw pass, then settles to the static `drawn` state. Under reduced motion it
|
|
32
|
+
* never arms — `reduced` is true and the seal is the instant fully-drawn mark.
|
|
33
|
+
*
|
|
34
|
+
* Deterministic + SSR-safe (the matchMedia guard) — the recipe owns the paint, this
|
|
35
|
+
* leaf owns the boolean lifecycle.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useCompletionSeal(options?: UseCompletionSealOptions): UseCompletionSeal;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The seal glyph axis — the mark the gold stroke draws:
|
|
3
|
+
* - `check` (default) — a checkmark (the canonical "done" garnish).
|
|
4
|
+
* - `ring` — a ring/circle around the completion (a seal around the event).
|
|
5
|
+
* - `wordmark` — a self-contained seal mark (a stylized seal glyph).
|
|
6
|
+
*
|
|
7
|
+
* All three share the ONE gold-draw mechanism (the `--seal-draw` stroke-reveal on the
|
|
8
|
+
* `--seal-ink` gold stroke) — a `shape`-scoped path, NOT a second recipe. The seal is
|
|
9
|
+
* the GOLD-DRAW completion register, distinct from the HandMark hand-voice family.
|
|
10
|
+
*/
|
|
11
|
+
export type CompletionSealShape = "check" | "ring" | "wordmark";
|
|
12
|
+
/** The default seal glyph — the checkmark "done" garnish. */
|
|
13
|
+
export declare const COMPLETION_SEAL_DEFAULT_SHAPE: CompletionSealShape;
|
|
14
|
+
/**
|
|
15
|
+
* The normalized SVG viewBox the glyphs are authored in. The mark `pathLength="100"`
|
|
16
|
+
* normalizes every glyph's draw length so the `stroke-dashoffset` wipe is path-agnostic
|
|
17
|
+
* (the recipe reads `--seal-draw` 0..100% against the normalized length).
|
|
18
|
+
*/
|
|
19
|
+
export declare const COMPLETION_SEAL_VIEWBOX = "0 0 64 64";
|
|
20
|
+
/**
|
|
21
|
+
* The per-shape SVG path/element the gold stroke draws. `check`/`wordmark` are <path>
|
|
22
|
+
* `d`-strings; `ring` is drawn as a <circle> (the SFC branches on shape). Authored in
|
|
23
|
+
* the 64×64 viewBox, `pathLength="100"` normalized at the element.
|
|
24
|
+
*/
|
|
25
|
+
export declare const COMPLETION_SEAL_PATHS: Record<Exclude<CompletionSealShape, "ring">, string>;
|
|
26
|
+
/**
|
|
27
|
+
* The `ring` glyph geometry (a <circle>) — the centre + radius in the 64×64 viewBox.
|
|
28
|
+
* A near-perimeter ring so the seal reads hero-scale.
|
|
29
|
+
*/
|
|
30
|
+
export declare const COMPLETION_SEAL_RING: {
|
|
31
|
+
readonly cx: 32;
|
|
32
|
+
readonly cy: 32;
|
|
33
|
+
readonly r: 24;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The SPRING register the draw rides (SPRING-EASE / W-MOTION-CANON P2 enter-bouncy):
|
|
37
|
+
* - the SETTLE leg (the spatial overshoot) rides `--spring-bouncy` (an ENTER may
|
|
38
|
+
* overshoot on arrival);
|
|
39
|
+
* - the DRAW + GLINT legs ride the `--spring-snappy` CLOCK (the snappy settle duration)
|
|
40
|
+
* so the gold inks crisply, not languidly.
|
|
41
|
+
* The seal mints NO new spring token — it READS the SPRING-EASE register (the no-new-clock
|
|
42
|
+
* fence). These names are the recorded register choice; the actual curves live in the
|
|
43
|
+
* cascade (tokens/scheme-motion.css) and the recipe (completion-seal.css) reads them.
|
|
44
|
+
*/
|
|
45
|
+
export declare const COMPLETION_SEAL_SETTLE_SPRING = "--spring-bouncy";
|
|
46
|
+
export declare const COMPLETION_SEAL_DRAW_SPRING = "--spring-snappy";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as CompletionSeal } from "./CompletionSeal.vue";
|
|
2
|
+
export type { CompletionSealProps } from "./CompletionSeal.vue";
|
|
3
|
+
export type { CompletionSealShape } from "./constants";
|
|
4
|
+
export { useCompletionSeal, type UseCompletionSeal, type UseCompletionSealOptions, } from "./composables/useCompletionSeal";
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import type { ConcentricConfig } from "./constants";
|
|
2
2
|
/**
|
|
3
|
-
* Concentric — a
|
|
3
|
+
* Concentric — a living LEVEL-SET hypsometric SURVEY (paper-grid kin, BD.W-CONCENTRIC-RELIEF).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
5
|
+
* The iso-contours of a LOW-octave curl-warped height field H(p,t) — the SAME traveling-wave
|
|
6
|
+
* CELL-WARP that twists the paper-grid cells is applied to the SAMPLING coordinate, so the
|
|
7
|
+
* contours twist + flow as a wave passes OVER and THROUGH the topography; the ω=√(g·k) swell
|
|
8
|
+
* breathes the basins; the cursor HEAVES the topography toward the pointer (velocity-scaled
|
|
9
|
+
* gravity). The fragment paints an OPAQUE warm hypsometric FILL, lifts it into 2.5-D relief
|
|
10
|
+
* with one analytic hillshade, and inks it with a two-tier index/minor contour hierarchy via
|
|
11
|
+
* the KEPT IQ gradient-free `contourInk` (perfect GPU AA — density tracks 1/|∇H|). WebGPU-FIRST:
|
|
12
|
+
* a pure fullscreen fragment pass over the shared `waveField` leaf, with a clean WebGL2 GLSL
|
|
13
|
+
* fallback. It composes `useConcentric` → the `createGpuSubstrate` picker over the ONE canvas
|
|
14
|
+
* lifecycle leaf (offscreen-pause, live-PRM freeze, consumer-owned DPR).
|
|
14
15
|
*
|
|
15
|
-
* The DEFAULT
|
|
16
|
-
*
|
|
16
|
+
* The DEFAULT identity is the warm-DIVERGENT hypsometric tint (deep plum-rose basin → ember →
|
|
17
|
+
* amber → wheat crest), resolved per-mode by plain arms (NOT CSS `light-dark()`, NOT an
|
|
18
|
+
* in-shader `uMode` seam): the dark twin glows on a deep-ember ground. A consumer (the demo)
|
|
19
|
+
* themes it through a PRESET (presets-in-consumers — never a library token).
|
|
17
20
|
*/
|
|
18
21
|
type __VLS_Props = {
|
|
19
22
|
/** The full author schema (the studio's `useConfiguratorState` model). */
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import type { WebGLCanvasFrame } from "../../../../composables/glass/webgl/useWebGLCanvas";
|
|
2
2
|
import type { OklchStop } from "../../../../composables/color";
|
|
3
3
|
import { type ConcentricConfig } from "../constants";
|
|
4
|
+
import type { Vec2 } from "./levelField";
|
|
4
5
|
export interface ConcentricGLSetupDeps {
|
|
5
6
|
canvas: HTMLCanvasElement;
|
|
6
7
|
config: ConcentricConfig;
|
|
7
8
|
getPalette: () => OklchStop[];
|
|
9
|
+
/** The pointer in DOMAIN space (the cursor gravity well) — re-read each frame. */
|
|
10
|
+
getCursor: () => Vec2;
|
|
11
|
+
/** The spring-eased traveling-wave envelope amplitude (0..1; PRM → 0). */
|
|
12
|
+
getAmp: () => number;
|
|
13
|
+
/** The velocity-HEAVE multiplier on the cursor well (1.0 at rest → grows with speed). */
|
|
14
|
+
getWellScale: () => number;
|
|
8
15
|
shouldContinue: () => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The per-frame pointer hook — useConcentric advances the shared pointer field +
|
|
18
|
+
* derives the cursor in domain space here (the no-own-rAF discipline). ZERO own rAF.
|
|
19
|
+
*/
|
|
20
|
+
onFrame?: (timeSec: number) => void;
|
|
9
21
|
}
|
|
10
22
|
/** Build the `setupGL(gl)` callback the `createGpuSubstrate` WebGL2 path invokes. */
|
|
11
23
|
export declare function createConcentricGLSetup(deps: ConcentricGLSetupDeps): (gl: WebGL2RenderingContext) => WebGLCanvasFrame;
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import type { WebGPUCanvasFrame } from "../../../../composables/glass/webgpu/useWebGPUCanvas";
|
|
2
2
|
import type { OklchStop } from "../../../../composables/color";
|
|
3
3
|
import type { ConcentricConfig } from "../constants";
|
|
4
|
+
import type { Vec2 } from "./levelField";
|
|
4
5
|
export interface ConcentricWGPUSetupDeps {
|
|
5
6
|
canvas: HTMLCanvasElement;
|
|
6
7
|
config: ConcentricConfig;
|
|
7
8
|
/** The resolved (ColorResolver) palette stops as OKLCh — re-read each frame so a live edit reaches the buffer. */
|
|
8
9
|
getPalette: () => OklchStop[];
|
|
10
|
+
/** The pointer in DOMAIN space (the cursor gravity well) — re-read each frame. */
|
|
11
|
+
getCursor: () => Vec2;
|
|
12
|
+
/** The spring-eased traveling-wave envelope amplitude (0..1; PRM → 0). */
|
|
13
|
+
getAmp: () => number;
|
|
14
|
+
/** The velocity-HEAVE multiplier on the cursor well (1.0 at rest → grows with speed). */
|
|
15
|
+
getWellScale: () => number;
|
|
9
16
|
/** Demand-gate (the renderer's quiescence layer — substrate-agnostic). */
|
|
10
17
|
shouldContinue: () => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The per-frame pointer hook — useConcentric advances the shared `usePointerVelocityField`
|
|
20
|
+
* here (the no-own-rAF discipline: the renderer's frame loop FEEDS `tick(delta)`) and
|
|
21
|
+
* derives the cursor in domain space. ZERO own rAF.
|
|
22
|
+
*/
|
|
23
|
+
onFrame?: (timeSec: number) => void;
|
|
11
24
|
}
|
|
12
25
|
/** Build the concentric `setupWGPU(device, context, format)` callback. */
|
|
13
26
|
export declare function createConcentricWGPUSetup(deps: ConcentricWGPUSetupDeps): (device: GPUDevice, context: GPUCanvasContext, format: GPUTextureFormat) => WebGPUCanvasFrame;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type Vec2 } from "../../../../composables/glass/wave/waveField";
|
|
2
|
+
export type { Vec2 };
|
|
3
|
+
/** The level-set sample params (the round-trip anchor; mirrors the shader uniforms). */
|
|
4
|
+
export interface LevelFieldParams {
|
|
5
|
+
/** The traveling-wave front direction. */
|
|
6
|
+
waveDir: Vec2;
|
|
7
|
+
waveK: number;
|
|
8
|
+
waveOmega: number;
|
|
9
|
+
waveSigma: number;
|
|
10
|
+
twistMax: number;
|
|
11
|
+
shearMax: number;
|
|
12
|
+
/** The spring-eased envelope amplitude (0..1; PRM → 0). */
|
|
13
|
+
amp: number;
|
|
14
|
+
/** The topography cell pitch (domain units per cell — the contour-warp granularity). */
|
|
15
|
+
cellSize: number;
|
|
16
|
+
/** LOW octaves → clean nested loops. */
|
|
17
|
+
heightOctaves: number;
|
|
18
|
+
heightSeed: number;
|
|
19
|
+
/** The ω=√(g·k) breathing swell depth. */
|
|
20
|
+
swellAmp: number;
|
|
21
|
+
/** Per-contour wobble depth. */
|
|
22
|
+
perturbAmp: number;
|
|
23
|
+
/** The contour-level count. */
|
|
24
|
+
levels: number;
|
|
25
|
+
/** The cursor (domain space). */
|
|
26
|
+
cursor: Vec2;
|
|
27
|
+
/** The cursor Gaussian peak depth (the topography bulges under the pointer). */
|
|
28
|
+
cursorWell: number;
|
|
29
|
+
/** 1 = cursor on. */
|
|
30
|
+
interactive: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The warped level-set height at domain `p` and time `t` — the SINGLE math source. The
|
|
34
|
+
* sampling coordinate is twisted by the SHARED `cellTwist` (the kinship with paper-grid:
|
|
35
|
+
* the same wave flows both); the height is a low-octave fbm topography + the swell; the cursor
|
|
36
|
+
* adds a Gaussian peak. Returns the un-normalized height (the shader contours + tints it).
|
|
37
|
+
*/
|
|
38
|
+
export declare function sampleHeight(p: Vec2, t: number, q: LevelFieldParams): number;
|
|
39
|
+
/** The SHARED hillshade finite-diff epsilon — pinned ONCE, consumed by both shaders + this
|
|
40
|
+
* oracle (challenge R8: a per-backend `e` drift would red L6). */
|
|
41
|
+
export declare const HILLSHADE_EPSILON = 0.012;
|
|
42
|
+
/** The hypsometric tone — expands the compressed height band so basins+ridges hit the ramp
|
|
43
|
+
* ENDS. `tone = 0.5 + 0.5·tanh(H·toneGain)`. Maps un-normalized H → [0,1] palette param. */
|
|
44
|
+
export declare function toneFromHeight(H: number, toneGain: number): number;
|
|
45
|
+
/** The analytic hillshade at domain `p` — one ∇H finite-diff at the SHARED `e`, dotted with
|
|
46
|
+
* the fixed cel light → [0,1] (0.5 = flat). A read-only re-sample of `sampleHeight`. */
|
|
47
|
+
export declare function hillshade(p: Vec2, t: number, q: LevelFieldParams, lightDir: Vec2): number;
|
|
48
|
+
/** The two-tier index test — a PURE `f(level)` (floor + mod + threshold), stateless, no
|
|
49
|
+
* buffer. Returns 1.0 on an index (every `indexEvery`th) level, else 0.0. */
|
|
50
|
+
export declare function isIndexLevel(fN: number, indexEvery: number): number;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { OklchStop } from "../../../../composables/color";
|
|
2
2
|
import { type ConcentricConfig } from "../constants";
|
|
3
|
+
import type { Vec2 } from "./levelField";
|
|
3
4
|
export declare const CONCENTRIC_UNIFORM_BYTES: number;
|
|
4
|
-
/** The
|
|
5
|
+
/** The height-amplitude normalization scale (height → [0,1] for the topographic ramp). */
|
|
5
6
|
export declare const CONCENTRIC_FIELD_NORM = 0.55;
|
|
6
7
|
export interface ConcentricUniformScratch {
|
|
7
8
|
buffer: ArrayBuffer;
|
|
@@ -9,5 +10,8 @@ export interface ConcentricUniformScratch {
|
|
|
9
10
|
i32: Int32Array;
|
|
10
11
|
}
|
|
11
12
|
export declare function createConcentricScratch(): ConcentricUniformScratch;
|
|
12
|
-
/** Pack the concentric uniforms in place.
|
|
13
|
-
|
|
13
|
+
/** Pack the concentric uniforms in place. `cursor` is the pointer in DOMAIN space; `amp` the
|
|
14
|
+
* spring-eased traveling-wave envelope amplitude (PRM → 0); `wellScale` the velocity-HEAVE
|
|
15
|
+
* multiplier on the cursor well depth+radius (1.0 at rest → grows with pointer speed; JS-side
|
|
16
|
+
* so the heave costs no uniform lane). */
|
|
17
|
+
export declare function packConcentricUniforms(scratch: ConcentricUniformScratch, config: ConcentricConfig, timeSec: number, aspect: number, palette: OklchStop[], cursor: Vec2, amp: number, wellScale: number): ConcentricUniformScratch;
|
|
@@ -27,9 +27,9 @@ export interface ConcentricHandle {
|
|
|
27
27
|
dispose: () => void;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Mount the concentric renderer on `canvasRef`. The WebGPU primary + the WebGL2 fallback
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* Mount the concentric renderer on `canvasRef`. The WebGPU primary + the WebGL2 fallback are
|
|
31
|
+
* BOTH pure fullscreen fragment passes evaluating the SAME level-set topography (the ONE math
|
|
32
|
+
* source `levelField.ts` `sampleHeight`), so the picker is the only seam. Returns the uniform
|
|
33
33
|
* lifecycle handle.
|
|
34
34
|
*/
|
|
35
35
|
export declare function useConcentric(canvasRef: Ref<HTMLCanvasElement | null>, options: UseConcentricOptions): ConcentricHandle;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import type { RingComponent, RingCenter } from "./composables/ringField";
|
|
2
1
|
import type { OklchStop } from "../../../composables/color";
|
|
3
|
-
/** Compile-time ring-component cap — mirrors the WGSL `MAX_RINGS` #define. */
|
|
4
|
-
export declare const MAX_RINGS = 8;
|
|
5
|
-
/** Compile-time center cap — mirrors the WGSL `MAX_CENTERS` #define. */
|
|
6
|
-
export declare const MAX_CENTERS = 4;
|
|
7
2
|
/** Compile-time palette cap — mirrors the WGSL `MAX_RING_STOPS` #define. */
|
|
8
3
|
export declare const MAX_RING_STOPS = 4;
|
|
9
4
|
/**
|
|
@@ -11,33 +6,83 @@ export declare const MAX_RING_STOPS = 4;
|
|
|
11
6
|
* tunable the demo configurator drives; the SFC resolves it into the uniform table.
|
|
12
7
|
*/
|
|
13
8
|
export interface ConcentricConfig {
|
|
14
|
-
/** The
|
|
15
|
-
centers: RingCenter[];
|
|
16
|
-
/** The radial sum-of-sines table (1..MAX_RINGS). */
|
|
17
|
-
ringComponents: RingComponent[];
|
|
18
|
-
/** The ellipsoidal-norm axis ratio (a, b) — the 3D-tilt depth implication. */
|
|
19
|
-
axisRatio: [number, number];
|
|
20
|
-
/** The ring-travel speed (scales ω). */
|
|
9
|
+
/** The level-set flow speed (scales the traveling-wave time). */
|
|
21
10
|
speed: number;
|
|
11
|
+
/** The contour stroke half-width (px units; the IQ line thickness). */
|
|
12
|
+
lineWidth: number;
|
|
13
|
+
/** The stroke AA softness (px units; the edge feather). */
|
|
14
|
+
lineSoftness: number;
|
|
15
|
+
/** The contour-level count (the iso-line density; 4..24). */
|
|
16
|
+
contourLevels: number;
|
|
17
|
+
/** The topography cell pitch (domain units per cell — the contour-warp granularity). */
|
|
18
|
+
cellSize: number;
|
|
19
|
+
/** The height-field octaves (LOW → clean nested loops). */
|
|
20
|
+
heightOctaves: number;
|
|
21
|
+
/** The height-field seed (a different topography per seed). */
|
|
22
|
+
heightSeed: number;
|
|
23
|
+
/** The ω=√(g·k) breathing swell depth — basins inflate/deflate (weight). */
|
|
24
|
+
swellAmp: number;
|
|
25
|
+
/** Per-contour wobble depth — the contours wobble independently as the wave flows. */
|
|
26
|
+
perturbAmp: number;
|
|
27
|
+
/** Max per-cell twist angle at the wave crest (rad — the cell-warp the contours ride). */
|
|
28
|
+
twistMax: number;
|
|
29
|
+
/** Max per-cell shear at the crest. */
|
|
30
|
+
shearMax: number;
|
|
31
|
+
/** The traveling-wave front direction (a gentle diagonal). */
|
|
32
|
+
waveDir: [number, number];
|
|
33
|
+
/** The crest-band spatial frequency (LOW — cells per crest). */
|
|
34
|
+
waveK: number;
|
|
35
|
+
/** The front speed (slow — inertia). */
|
|
36
|
+
waveOmega: number;
|
|
37
|
+
/** The crest-band width (a localized front). */
|
|
38
|
+
waveSigma: number;
|
|
39
|
+
/** The cursor Gaussian peak depth — the topography HEAVES toward the pointer. */
|
|
40
|
+
cursorWell: number;
|
|
41
|
+
/** The hypsometric tone gain — `tone = 0.5 + 0.5·tanh(H·toneGain)` (fills the ramp ends). */
|
|
42
|
+
toneGain: number;
|
|
43
|
+
/** The analytic-hillshade relief depth (`fill *= mix(1-shadeAmp, 1+shadeAmp, shade)`). */
|
|
44
|
+
shadeAmp: number;
|
|
45
|
+
/** The fixed cartoon-sun direction (the raking cel light dotted with ∇H). */
|
|
46
|
+
lightDir: [number, number];
|
|
47
|
+
/** Index-contour stride — every Nth level is a bold index line (two-tier hierarchy). */
|
|
48
|
+
indexEvery: number;
|
|
49
|
+
/** The index-line width multiplier (index ~indexMul× the minor half-width). */
|
|
50
|
+
indexMul: number;
|
|
51
|
+
/** The ink darken factor — the contour is a darker ember of its OWN local fill band. */
|
|
52
|
+
inkDarken: number;
|
|
53
|
+
/** Cursor-HEAVE gain — pointer SPEED scales the well depth/radius (JS-side; free). */
|
|
54
|
+
velocityHeave: number;
|
|
22
55
|
/** The field-value color ramp (the demo themes it); resolved via the ColorResolver. */
|
|
23
56
|
palette: OklchStop[];
|
|
24
|
-
/** The
|
|
57
|
+
/** The opaque warm hypsometric ground (the survey reads standalone; per-mode resolved). */
|
|
25
58
|
background: OklchStop | "transparent";
|
|
26
|
-
/** Pointer
|
|
59
|
+
/** Pointer HEAVES the topography (gravity over the contour map). */
|
|
27
60
|
interactive: boolean;
|
|
28
|
-
/** ONE static frame then park under `prefers-reduced-motion: reduce`. */
|
|
61
|
+
/** ONE static survey frame then park under `prefers-reduced-motion: reduce`. */
|
|
29
62
|
respectReducedMotion: boolean;
|
|
30
63
|
}
|
|
31
64
|
/**
|
|
32
|
-
* The
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
65
|
+
* The WARM-DIVERGENT light identity — a true multi-warm hypsometric tint (NOT a mono-amber
|
|
66
|
+
* wash). Four stops spanning the warm wheel from a deep plum-rose basin through ember and
|
|
67
|
+
* amber to a wheat ridge crest. Every hue wraps through red — none lands in the teal/navy
|
|
68
|
+
* purge band [180,270]. Resolved via the ColorResolver; a consumer (the demo) themes it
|
|
69
|
+
* through a PRESET, never a token edit.
|
|
36
70
|
*/
|
|
37
71
|
export declare const WARM_IDENTITY_PALETTE: OklchStop[];
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
72
|
+
/**
|
|
73
|
+
* The WARM-DIVERGENT dark identity — the survey-at-night twin (plain per-mode arm, NOT a
|
|
74
|
+
* CSS `light-dark()` branch, NOT an in-shader `uMode` seam). A deep ember basin glowing up
|
|
75
|
+
* to a luminous amber ridge ladder. Hues stay warm [330..90] — never teal/navy.
|
|
76
|
+
*/
|
|
77
|
+
export declare const WARM_IDENTITY_PALETTE_DARK: OklchStop[];
|
|
78
|
+
/** The per-mode warm hypsometric GROUND (the opaque floor; resolved off `useGlobalDark`). */
|
|
79
|
+
export declare const WARM_GROUND_LIGHT: OklchStop;
|
|
80
|
+
export declare const WARM_GROUND_DARK: OklchStop;
|
|
81
|
+
/**
|
|
82
|
+
* The shipped warm-identity default config — a living LEVEL-SET hypsometric SURVEY (paper-grid
|
|
83
|
+
* kin): the iso-contours of a low-octave curl-warped height field, painted as an opaque warm
|
|
84
|
+
* hypsometric fill, hillshaded into 2.5-D relief, inked with a two-tier index/minor contour
|
|
85
|
+
* hierarchy, the cursor HEAVING the sheet with velocity-scaled weight. Reads standalone in
|
|
86
|
+
* BOTH modes — it CONTRIBUTES a colorful field rather than revealing a flat plate.
|
|
87
|
+
*/
|
|
43
88
|
export declare const DEFAULT_CONCENTRIC_CONFIG: ConcentricConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Concentric } from "./Concentric.vue";
|
|
2
2
|
export { useConcentric, type ConcentricHandle, type UseConcentricOptions, } from "./composables/useConcentric";
|
|
3
|
-
export { type ConcentricConfig, DEFAULT_CONCENTRIC_CONFIG,
|
|
4
|
-
export { type
|
|
3
|
+
export { type ConcentricConfig, DEFAULT_CONCENTRIC_CONFIG, WARM_IDENTITY_PALETTE, WARM_IDENTITY_PALETTE_DARK, WARM_GROUND_LIGHT, WARM_GROUND_DARK, MAX_RING_STOPS, } from "./constants";
|
|
4
|
+
export { type Vec2, type LevelFieldParams, sampleHeight, toneFromHeight, hillshade, isIndexLevel, HILLSHADE_EPSILON, } from "./composables/levelField";
|
|
5
5
|
export type { OklchStop } from "../../../composables/color";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** The full-screen-triangle vertex shader (the substrate's standard fullscreen pass). */
|
|
2
2
|
export declare const CONCENTRIC_VERT_GLSL = "#version 300 es\nprecision highp float;\nin vec2 aPosition;\nout vec2 vUv;\nvoid main() {\n vUv = aPosition; // [-1,1]\u00B2 domain\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}";
|
|
3
|
-
/** The concentric fragment source — the
|
|
4
|
-
export declare const CONCENTRIC_FRAG_GLSL = "#version 300 es\nprecision highp float;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define RING_GRAVITY 9.81\n#define MAX_RINGS 8\n#define MAX_CENTERS 4\n#define MAX_RING_STOPS 4\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform float uTime;\nuniform float uSpeed;\nuniform vec2 uAxis; // (a, b) ellipsoidal-norm axis ratio\nuniform float uFieldNorm; // field \u2192 [0,1] amplitude scale\nuniform float uAspect;\nuniform int uCenterCount;\nuniform int uRingCount;\nuniform int uStopCount;\nuniform float uHasBackground;\nuniform vec3 uRings[MAX_RINGS]; // (amplitude, wavelength, phase)\nuniform vec3 uCenters[MAX_CENTERS]; // (x, y, weight)\nuniform vec3 uPalette[MAX_RING_STOPS]; // linear-sRGB stops\n\n\nfloat srgbToLinearCh(float c) {\n return c <= 0.04045 ? c / 12.92 : pow((c + 0.055) / 1.055, 2.4);\n}\nvec3 srgbToLinear(vec3 c) {\n return vec3(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfloat linearToSrgbCh(float c) {\n return c <= 0.0031308 ? c * 12.92 : 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nvec3 linearToSrgb(vec3 c) {\n return vec3(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}\n\n// value.js LINEAR_SRGB_TO_LMS (constants.ts), row-major; written here as GLSL\n// columns (= the transpose) so mat3 * vec3 evaluates the row-major M\u00B7v.\nconst mat3 LINEAR_SRGB_TO_LMS = mat3(\n 0.4122214708, 0.2119034982, 0.0883024619,\n 0.5363325363, 0.6806995451, 0.2817188376,\n 0.0514459929, 0.1073969566, 0.6299787005\n);\n\n// value.js srgbToOKLab's INLINE LMS\u2192OKLab coefficients (gamut.ts lines 295-297 \u2014\n// these differ at the ~1e-9 digit from LMS_TO_OKLAB_MATRIX; use the inline ones to\n// mirror the exact value.js path), row-major \u2192 GLSL columns.\nconst mat3 LMS_TO_OKLAB = mat3(\n 0.2104542553, 1.9779984951, 0.0259040371,\n 0.7936177850, -2.4285922050, 0.7827717662,\n -0.0040720468, 0.4505937099, -0.8086757660\n);\n\n// value.js OKLAB_TO_LMS_COEFF (constants.ts), row-major \u2192 GLSL columns. Rows:\n// l = [1, 0.3963377774, 0.2158037573], m = [1, -0.1055613458, -0.0638541728],\n// s = [1, -0.0894841775, -1.2914855480].\nconst mat3 OKLAB_TO_LMS = mat3(\n 1.0, 1.0, 1.0,\n 0.3963377774, -0.1055613458, -0.0894841775,\n 0.2158037573, -0.0638541728, -1.2914855480\n);\n\n// value.js LMS_TO_LINEAR_SRGB (constants.ts), row-major \u2192 GLSL columns.\nconst mat3 LMS_TO_LINEAR_SRGB = mat3(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\n// Gamma sRGB \u2192 raw OKLab (L, a, b). Mirrors value.js srgbToOKLab.\nvec3 srgbToOklab(vec3 c) {\n vec3 lin = srgbToLinear(c);\n vec3 lms = LINEAR_SRGB_TO_LMS * lin;\n vec3 lmsCbrt = sign(lms) * pow(abs(lms), vec3(1.0 / 3.0));\n return LMS_TO_OKLAB * lmsCbrt;\n}\n\n// Raw OKLab (L, a, b) \u2192 linear sRGB. Mirrors value.js oklabToLinearSRGB.\nvec3 oklabToLinearSrgb(vec3 lab) {\n vec3 lms_ = OKLAB_TO_LMS * lab;\n vec3 lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\n\n// OKLab \u2192 OKLCh: H in RADIANS. Mirrors value.js rawOklabToOklch (which returns\n// degrees; we stay in radians and only fold to [0, 2pi)).\nvec3 oklabToOklch(vec3 lab) {\n float C = length(lab.yz);\n float H = atan(lab.z, lab.y);\n if (H < 0.0) H += 2.0 * PI;\n return vec3(lab.x, C, H);\n}\n\n// OKLCh (H radians) \u2192 OKLab. Mirrors value.js rawOklchToOklab.\nvec3 oklchToOklab(vec3 lch) {\n return vec3(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}\n\n// \u2016p \u2212 c\u2016_e = sqrt((dx/a)\u00B2 + (dy/b)\u00B2) \u2014 transcribes ringField.ts ellipsoidalRadius.\nfloat ellipsoidalRadius(vec2 p, vec2 center, float axisA, float axisB) {\n float dx = (p.x - center.x) / max(axisA, 1e-4);\n float dy = (p.y - center.y) / max(axisB, 1e-4);\n return sqrt(dx * dx + dy * dy);\n}\n\n// f(p,t) \u2014 the multi-center weighted radial sum (transcribes ringField.ts sampleRingField).\nfloat sampleRingField(vec2 p, float t) {\n float acc = 0.0;\n for (int j = 0; j < MAX_CENTERS; j++) {\n if (j >= uCenterCount) break;\n vec3 cj = uCenters[j];\n float radius = ellipsoidalRadius(p, cj.xy, uAxis.x, uAxis.y);\n float centerSum = 0.0;\n for (int i = 0; i < MAX_RINGS; i++) {\n if (i >= uRingCount) break;\n vec3 r = uRings[i];\n float k = TAU / max(r.y, 1e-4);\n float omega = sqrt(RING_GRAVITY * k) * uSpeed;\n float theta = k * radius - omega * t + r.z;\n centerSum += r.x * sin(theta);\n }\n acc += centerSum * cj.z;\n }\n return acc;\n}\n\n// Sample the multi-stop palette (linear-sRGB stops, OKLab mix). t in [0,1].\nvec3 samplePaletteLin(float t) {\n if (uStopCount <= 1) return uPalette[0];\n float n = float(uStopCount);\n float ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n int i0 = int(floor(ft));\n int i1 = min(i0 + 1, uStopCount - 1);\n float f = ft - float(i0);\n // cube-root LMS (the GLSL chunk inlines cbrt as sign(x)\u00B7pow(|x|,1/3) \u2014 no cbrt3 fn).\n vec3 lmsA = LINEAR_SRGB_TO_LMS * uPalette[i0];\n vec3 lmsB = LINEAR_SRGB_TO_LMS * uPalette[i1];\n vec3 labA = LMS_TO_OKLAB * (sign(lmsA) * pow(abs(lmsA), vec3(1.0 / 3.0)));\n vec3 labB = LMS_TO_OKLAB * (sign(lmsB) * pow(abs(lmsB), vec3(1.0 / 3.0)));\n return oklabToLinearSrgb(mix(labA, labB, f));\n}\n\nvoid main() {\n float aspect = max(uAspect, 1e-4);\n vec2 p = vec2(vUv.x * aspect, vUv.y);\n float raw = sampleRingField(p, uTime);\n float v = clamp(0.5 + raw * uFieldNorm, 0.0, 1.0);\n vec3 lin = samplePaletteLin(v);\n vec3 rgb = clamp(linearToSrgb(lin), vec3(0.0), vec3(1.0));\n if (uHasBackground > 0.5) {\n fragColor = vec4(rgb, 1.0);\n return;\n }\n float alpha = clamp(v * 0.92 + 0.08, 0.0, 1.0);\n fragColor = vec4(rgb * alpha, alpha);\n}";
|
|
3
|
+
/** The concentric fragment source — the level-set contour-map render (paper-grid kin). */
|
|
4
|
+
export declare const CONCENTRIC_FRAG_GLSL = "#version 300 es\nprecision highp float;\n\n#define PI 3.141592653589793\n#define TAU 6.283185307179586\n#define MAX_RING_STOPS 4\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform float uTime;\nuniform float uSpeed;\nuniform float uCellSize; // the topography cell pitch (the contour-warp granularity)\nuniform float uFieldNorm; // height \u2192 [0,1] tone scale\nuniform float uAspect;\nuniform int uStopCount;\nuniform float uHasBackground;\nuniform vec4 uLine; // (lineHalfWidth, aaSoftness, contourLevels, indexEvery)\nuniform vec2 uLightDir; // the fixed cel-light direction (folded norm.zw)\nuniform vec3 uBg; // themed background (linear-sRGB)\nuniform vec4 uWave; // (waveDirX, waveDirY, waveK, waveOmega)\nuniform vec4 uWave2; // (waveSigma, twistMax, shearMax, amp)\nuniform vec4 uTopo; // (heightOctaves, heightSeed, swellAmp, perturbAmp)\nuniform vec4 uCursor; // (cursorX, cursorY, cursorWell, interactive)\nuniform vec4 uTune; // (toneGain, shadeAmp, indexMul, inkDarken)\nuniform vec3 uPalette[MAX_RING_STOPS]; // linear-sRGB stops\n\n\nfloat srgbToLinearCh(float c) {\n return c <= 0.04045 ? c / 12.92 : pow((c + 0.055) / 1.055, 2.4);\n}\nvec3 srgbToLinear(vec3 c) {\n return vec3(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfloat linearToSrgbCh(float c) {\n return c <= 0.0031308 ? c * 12.92 : 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nvec3 linearToSrgb(vec3 c) {\n return vec3(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}\n\n// value.js LINEAR_SRGB_TO_LMS (constants.ts), row-major; written here as GLSL\n// columns (= the transpose) so mat3 * vec3 evaluates the row-major M\u00B7v.\nconst mat3 LINEAR_SRGB_TO_LMS = mat3(\n 0.4122214708, 0.2119034982, 0.0883024619,\n 0.5363325363, 0.6806995451, 0.2817188376,\n 0.0514459929, 0.1073969566, 0.6299787005\n);\n\n// value.js srgbToOKLab's INLINE LMS\u2192OKLab coefficients (gamut.ts lines 295-297 \u2014\n// these differ at the ~1e-9 digit from LMS_TO_OKLAB_MATRIX; use the inline ones to\n// mirror the exact value.js path), row-major \u2192 GLSL columns.\nconst mat3 LMS_TO_OKLAB = mat3(\n 0.2104542553, 1.9779984951, 0.0259040371,\n 0.7936177850, -2.4285922050, 0.7827717662,\n -0.0040720468, 0.4505937099, -0.8086757660\n);\n\n// value.js OKLAB_TO_LMS_COEFF (constants.ts), row-major \u2192 GLSL columns. Rows:\n// l = [1, 0.3963377774, 0.2158037573], m = [1, -0.1055613458, -0.0638541728],\n// s = [1, -0.0894841775, -1.2914855480].\nconst mat3 OKLAB_TO_LMS = mat3(\n 1.0, 1.0, 1.0,\n 0.3963377774, -0.1055613458, -0.0894841775,\n 0.2158037573, -0.0638541728, -1.2914855480\n);\n\n// value.js LMS_TO_LINEAR_SRGB (constants.ts), row-major \u2192 GLSL columns.\nconst mat3 LMS_TO_LINEAR_SRGB = mat3(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\n// Gamma sRGB \u2192 raw OKLab (L, a, b). Mirrors value.js srgbToOKLab.\nvec3 srgbToOklab(vec3 c) {\n vec3 lin = srgbToLinear(c);\n vec3 lms = LINEAR_SRGB_TO_LMS * lin;\n vec3 lmsCbrt = sign(lms) * pow(abs(lms), vec3(1.0 / 3.0));\n return LMS_TO_OKLAB * lmsCbrt;\n}\n\n// Raw OKLab (L, a, b) \u2192 linear sRGB. Mirrors value.js oklabToLinearSRGB.\nvec3 oklabToLinearSrgb(vec3 lab) {\n vec3 lms_ = OKLAB_TO_LMS * lab;\n vec3 lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\n\n// OKLab \u2192 OKLCh: H in RADIANS. Mirrors value.js rawOklabToOklch (which returns\n// degrees; we stay in radians and only fold to [0, 2pi)).\nvec3 oklabToOklch(vec3 lab) {\n float C = length(lab.yz);\n float H = atan(lab.z, lab.y);\n if (H < 0.0) H += 2.0 * PI;\n return vec3(lab.x, C, H);\n}\n\n// OKLCh (H radians) \u2192 OKLab. Mirrors value.js rawOklchToOklab.\nvec3 oklchToOklab(vec3 lch) {\n return vec3(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}\n\n// The shared curl operator (flow.glsl.ts \u2014 forward-declares potentialFBM).\n\nconst float CURL_EPS = 0.012;\n\n// Scalar fbm potential psi \u2014 the host's noise basis, wrapped so the curl operator is\n// basis-agnostic. A host carrying its own fbm defines this as: return fbm(p);\nfloat potentialFBM(vec2 p);\n\n// \u2207\u00D7\u03C8 in 2D \u2014 the divergence-free flow direction. Central finite differences of the\n// scalar potential give the partials; the cross-pairing (\u2202y, \u2212\u2202x) is the 2D curl.\nvec2 curlFBM(vec2 p) {\n float dx = potentialFBM(p + vec2(CURL_EPS, 0.0)) - potentialFBM(p - vec2(CURL_EPS, 0.0));\n float dy = potentialFBM(p + vec2(0.0, CURL_EPS)) - potentialFBM(p - vec2(0.0, CURL_EPS));\n // \u03C8-gradient is (dx, dy)/(2\u00B7eps); the curl rotates it 90\u00B0: (\u2202\u03C8/\u2202y, \u2212\u2202\u03C8/\u2202x).\n vec2 g = vec2(dx, dy) / (2.0 * CURL_EPS);\n return vec2(g.y, -g.x);\n}\n\n\n// \u2500\u2500 The host noise basis (the SAME quintic-faded value-noise the suite speaks) \u2500\u2500\nfloat hash21(float x, float y) {\n float px = fract(x * 0.1031);\n float py = fract(y * 0.1031);\n float pz = fract(x * 0.1031);\n float d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);\n px += d; py += d; pz += d;\n return fract((px + py) * pz);\n}\nfloat valueNoise(float x, float y) {\n float ix = floor(x); float iy = floor(y);\n float fx = x - ix; float fy = y - iy;\n float ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);\n float uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);\n float a = hash21(ix, iy);\n float b = hash21(ix + 1.0, iy);\n float c = hash21(ix, iy + 1.0);\n float d2 = hash21(ix + 1.0, iy + 1.0);\n return mix(mix(a, b, ux), mix(c, d2, ux), uy);\n}\n// The curl chunk's forward-declared potentialFBM body.\nfloat potentialFBM(vec2 p) {\n float v = 0.0; float amp = 0.5; float freq = 1.0;\n float px = p.x; float py = p.y;\n for (int i = 0; i < 3; i++) {\n v += amp * valueNoise(px * freq, py * freq);\n float rx = 0.8 * px - 0.6 * py;\n float ry = 0.6 * px + 0.8 * py;\n px = rx; py = ry; freq *= 2.0; amp *= 0.5;\n }\n return v;\n}\n\n// The shared traveling-wave CELL-WARP chunk (spliced AFTER valueNoise + potentialFBM + curl).\n\n#ifndef WAVE_FIELD_TAU\n#define WAVE_FIELD_TAU 6.283185307179586\n#endif\n\n// The traveling-wave envelope \u2014 a moving Gaussian crest band sweeping along waveDir.\nfloat travelingEnvelope(vec2 pivot, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma) {\n float coord = dot(pivot, waveDir) * waveK - t * waveOmega;\n float crest = fract(coord / WAVE_FIELD_TAU);\n float z = (crest - 0.5) * 2.0;\n return exp(-(z * z) / max(waveSigma, 1e-3));\n}\n\n// The curl-direction scalar \u2014 the smooth low-freq director the per-cell twist follows.\nfloat curlScalar(vec2 cc, float t) {\n vec2 f = curlFBM(vec2(cc.x * 0.5 + t * 0.08, cc.y * 0.5 - t * 0.06));\n return clamp(f.x, -1.0, 1.0);\n}\n\n// The directed-twist FLOOR (the visibility cure): keep the curl SIGN (adjacent cells lean\n// together) but floor the magnitude so a crest-band cell ALWAYS rotates decisively.\n#ifndef WAVE_FIELD_TWIST_FLOOR\n#define WAVE_FIELD_TWIST_FLOOR 0.62\n#endif\nfloat directedTwist(float s, float floorMag) {\n float mag = max(floorMag, abs(s));\n float sgn = tanh(s * 6.0);\n return sgn * mag;\n}\n\n// \u2500\u2500 The FACE leaf (the structurally-absent RE-INVENT \u2014 height-lit filled cell interior) \u2500\u2500\n// Defined ABOVE cellTwist: cellTwist rides cellHeight via the driver so twist + face read ONE\n// envelope.\n\n// The sheet displacement at a cell center = the EXACT traveling-wave scalar the twist rides.\nfloat cellHeight(vec2 cc, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma, float amp) {\n return travelingEnvelope(cc, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n}\n\n// The pre-twist driver (FOLD A): the cell pivot cc + the crest envelope env the twist AND the\n// face both ride. The face samples height/relief at THIS pre-twist cc (floor(twisted_g) at the\n// crest lights a NEIGHBOUR cell). cc in .xy, env in .z.\nvec3 cellDriver(vec2 g, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float amp) {\n float cs = max(cellSize, 1e-3);\n vec2 cc = (floor(g / cs) + 0.5) * cs;\n float env = cellHeight(cc, t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec3(cc, env);\n}\n\n// The central-difference slope of cellHeight across a cell (eps = 0.5\u00B7cellSize) \u2014 derivative-\n// FREE (NO dFdx on the height) \u2192 Safari WebGL2-safe. Returns \u2207H.\nvec2 faceRelief(vec2 cc, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float amp) {\n float eps = max(cellSize, 1e-3) * 0.5;\n float hxp = cellHeight(cc + vec2(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hxm = cellHeight(cc - vec2(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hyp = cellHeight(cc + vec2(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n float hym = cellHeight(cc - vec2(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec2((hxp - hxm) / (2.0 * eps), (hyp - hym) / (2.0 * eps));\n}\n\n// Soft inset-square coverage inside a (warped) cell \u2014 the filled FACE plateau. d is the distance\n// into the cell from the nearest gutter (the Golus triangle-wave); the inset retreats as it grows\n// (the squash). aa = the shader's fwidth(g) (JS passes a fixed uvDeriv).\nfloat facePlateau(vec2 g, float inset, vec2 uvDeriv) {\n vec2 tri = 1.0 - abs(fract(g) * 2.0 - 1.0);\n float d = min(tri.x, tri.y);\n float aa = max(uvDeriv.x, uvDeriv.y) * 1.5;\n return smoothstep(inset, inset + 2.0 * aa, d);\n}\n\n// The cell-local twist about each cell's own center, gated by the traveling wave + directed\n// by the curl flow. amp is the spring-eased envelope amplitude the JS host drives. FOLD C: the\n// TWIST_FLOOR is crest-gated by env so OFF-crest cells relax to flat calm paper (the traveling\n// read, not static foil).\nvec2 cellTwist(vec2 g, float cellSize, float t, vec2 waveDir, float waveK, float waveOmega,\n float waveSigma, float twistMax, float shearMax, float amp) {\n vec3 drv = cellDriver(g, cellSize, t, waveDir, waveK, waveOmega, waveSigma, amp);\n vec2 cc = drv.xy;\n float env = drv.z;\n float floorMag = WAVE_FIELD_TWIST_FLOOR * env; // FOLD C: crest-gated floor\n float theta = twistMax * env * directedTwist(curlScalar(cc, t), floorMag);\n float shear = shearMax * env * directedTwist(curlScalar(cc + vec2(17.3, 9.1), t), floorMag);\n vec2 local = g - cc;\n float ct = cos(theta);\n float st = sin(theta);\n vec2 rot = vec2(ct * local.x - st * local.y, st * local.x + ct * local.y);\n rot.x += shear * rot.y; // a small skew so the box MORPHS, not just rotates\n return cc + rot;\n}\n\n// The CONTINUOUS traveling-wave FLOW warp \u2014 the SMOOTH twin of cellTwist (no per-cell seam;\n// for the level-set contours that shatter into a mesh under the cell discontinuity).\nvec2 waveFlow(vec2 g, float t, vec2 waveDir, float waveK, float waveOmega, float waveSigma,\n float twistMax, float amp) {\n float env = travelingEnvelope(g, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n vec2 f = curlFBM(vec2(g.x * 0.6 + t * 0.05, g.y * 0.6 - t * 0.04));\n vec2 f2 = curlFBM(vec2(g.x * 1.1 - t * 0.03, g.y * 1.1 + t * 0.035));\n float k = twistMax * env;\n return g + (f + f2 * 0.5) * k;\n}\n\n// The local cursor swirl \u2014 the finger twists the cells around it (re-aimed cursorBulge).\nvec2 cursorSwirl(vec2 g, vec2 cursor, float strength, float radius) {\n vec2 to = g - cursor;\n float d2 = dot(to, to);\n float r = max(radius, 1e-4);\n float theta = strength * exp(-d2 / (2.0 * r * r));\n float ct = cos(theta);\n float st = sin(theta);\n return cursor + vec2(ct * to.x - st * to.y, st * to.x + ct * to.y);\n}\n\n// The LOW-octave value-noise topography \u2014 the scalar field concentric extracts contours of.\nfloat heightField(vec2 p, float octavesF, float seed) {\n float v = 0.0;\n float amp = 0.5;\n float freq = 1.0;\n float px = p.x + seed;\n float py = p.y - seed;\n int n = int(clamp(octavesF, 1.0, 6.0));\n for (int i = 0; i < 6; i++) {\n if (i >= n) break;\n v += amp * valueNoise(px * freq, py * freq);\n float rx = 0.8 * px - 0.6 * py;\n float ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq *= 2.0;\n amp *= 0.5;\n }\n return v;\n}\n\n// The \u03C9=\u221A(g\u00B7k) breathing swell \u2014 basins inflate/deflate with weight.\nfloat waveSwell(float t, float phase) {\n return sin(t * 0.35 + phase) * 0.5 + sin(t * 0.21 + phase * 1.7) * 0.5;\n}\n\n\nfloat smoothstepEdge(float e0, float e1, float x) {\n float t = clamp((x - e0) / max(e1 - e0, 1e-6), 0.0, 1.0);\n return t * t * (3.0 - 2.0 * t);\n}\n\n// The level-set height at domain p (transcribes levelField.ts sampleHeight).\nfloat sampleHeight(vec2 p, float t) {\n // The CONTINUOUS traveling-wave flow warp (no per-cell seam \u2014 the contours flow + twist as\n // the wave passes OVER and THROUGH them, the SAME wave that twists the paper-grid cells).\n vec2 g = waveFlow(p, t, uWave.xy, uWave.z, uWave.w, uWave2.x, uWave2.y, uWave2.w);\n if (uCursor.w > 0.5) {\n g = cursorSwirl(g, uCursor.xy, uCursor.z * 0.6, uCellSize * 2.5);\n }\n // LOW base frequency \u2192 BROAD nested loops (a readable contour map). Octaves carry detail.\n float H = heightField(g * 0.9, uTopo.x, uTopo.y);\n H += uTopo.z * waveSwell(t, uTopo.y);\n if (uCursor.w > 0.5) {\n vec2 d = p - uCursor.xy;\n float d2 = dot(d, d);\n // The cursor HEAVE \u2014 a SOFT bulge (a Gaussian peak feathered by a smoothstep falloff so\n // the heave is C1-smooth, NOT a hard-edged quad). The well depth/radius carry the\n // velocity-HEAVE scale (packed JS-side into uCursor.z).\n float g0 = exp(-d2 / 0.22);\n float fall = smoothstepEdge(0.0, 0.55, exp(-d2 / 0.6));\n H += uCursor.z * g0 * fall;\n }\n return H;\n}\n\n// The IQ gradient-free level-set contour ink \u2014 KEPT BYTE-FROZEN (the perfect GPU AA). It is\n// FED the per-level half-width 'hw' (a parameter, NOT a re-derivation). 'aaW' floors against a\n// DPR-aware minimum so the index line stays CONTINUOUS where the heave packs contours.\nfloat contourInk(float fN, float hw) {\n float band = abs(fract(fN + 0.5) - 0.5);\n float aaW = max(fwidth(fN), 6e-4);\n return 1.0 - smoothstepEdge(hw, hw + uLine.y, band / aaW);\n}\n\nvec3 samplePaletteLin(float t) {\n if (uStopCount <= 1) return uPalette[0];\n float n = float(uStopCount);\n float ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n int i0 = int(floor(ft));\n int i1 = min(i0 + 1, uStopCount - 1);\n float f = ft - float(i0);\n vec3 lmsA = LINEAR_SRGB_TO_LMS * uPalette[i0];\n vec3 lmsB = LINEAR_SRGB_TO_LMS * uPalette[i1];\n vec3 labA = LMS_TO_OKLAB * (sign(lmsA) * pow(abs(lmsA), vec3(1.0 / 3.0)));\n vec3 labB = LMS_TO_OKLAB * (sign(lmsB) * pow(abs(lmsB), vec3(1.0 / 3.0)));\n return oklabToLinearSrgb(mix(labA, labB, f));\n}\n\n// The SHARED hillshade finite-diff epsilon \u2014 pinned ONCE (mirrors levelField.HILLSHADE_EPSILON\n// + the WGSL twin; a per-backend drift would red the L6 numeric parity).\nconst float HILLSHADE_E = 0.012;\n\nvoid main() {\n float aspect = max(uAspect, 1e-4);\n vec2 p = vec2(vUv.x * aspect, vUv.y);\n float t = uTime * uSpeed;\n float levels = max(uLine.z, 1.0);\n\n // The level-set topography (the KEPT field \u2014 the PRIMARY path).\n float H = sampleHeight(p, t);\n\n // \u2500\u2500 1. HYPSOMETRIC TONE \u2014 tanh expands the compressed band (basins+ridges hit the ramp ENDS).\n float tone = 0.5 + 0.5 * tanh(H * uTune.x);\n vec3 fill = samplePaletteLin(tone);\n\n // \u2500\u2500 2. ANALYTIC HILLSHADE \u2014 one \u2207H finite-diff at the SHARED e, dotted with the cel light.\n float e = HILLSHADE_E;\n float hx = sampleHeight(p + vec2(e, 0.0), t) - sampleHeight(p - vec2(e, 0.0), t);\n float hy = sampleHeight(p + vec2(0.0, e), t) - sampleHeight(p - vec2(0.0, e), t);\n vec2 grad = vec2(hx, hy) / (2.0 * e);\n vec2 L = normalize(uLightDir + vec2(1e-5));\n float shade = 0.5 + 0.5 * clamp(dot(normalize(grad + vec2(1e-5)), L), -1.0, 1.0);\n fill *= mix(1.0 - uTune.y, 1.0 + uTune.y, shade);\n\n // \u2500\u2500 3. TWO-TIER INDEX/MINOR CONTOUR \u2014 isIndex a pure f(level); hw FED to the frozen contourInk.\n float fN = H * levels + uTopo.w * sin(floor(H * levels) * 2.4 + t * 0.7);\n float indexEvery = max(uLine.w, 1.0);\n float lvl = floor(fN);\n float isIndex = fract(lvl / indexEvery) < (0.5 / indexEvery) ? 1.0 : 0.0;\n float hw = mix(uLine.x, uLine.x * uTune.z, isIndex);\n float ink = clamp(contourInk(fN, hw), 0.0, 1.0);\n\n // \u2500\u2500 4. INK = a darker ember of the LOCAL fill (the edge-of-its-own-band signature).\n vec3 inkCol = mix(fill, fill * uTune.w, 0.85);\n\n // \u2500\u2500 5. ONE color path + OPAQUE OUT \u2014 the viz IS the colorful field.\n vec3 col = mix(fill, inkCol, ink);\n fragColor = vec4(clamp(linearToSrgb(col), vec3(0.0), vec3(1.0)), 1.0);\n}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CONCENTRIC_WGSL = "\nconst PI: f32 = 3.141592653589793;\nconst TAU: f32 = 6.283185307179586;\nconst RING_GRAVITY: f32 = 9.81;\nconst MAX_RINGS: i32 = 8;\nconst MAX_CENTERS: i32 = 4;\nconst MAX_RING_STOPS: i32 = 4;\n\n// \u2500\u2500 Concentric uniforms (the typed-struct source-of-truth \u2014 see uniformBridgeWGPU.ts) \u2500\u2500\nstruct ConcentricUniforms {\n // u0: (uTime, uSpeed, uAxisA, uAxisB)\n u0: vec4<f32>,\n // ints: (uCenterCount, uRingCount, uStopCount, _pad)\n ints: vec4<i32>,\n // bg: (background.rgb (linear), hasBackground)\n bg: vec4<f32>,\n // norm: (uFieldNorm, uAspect, _pad, _pad) \u2014 field \u2192 [0,1] scale\n norm: vec4<f32>,\n // each ring row: (amplitude, wavelength, phase, _pad)\n rings: array<vec4<f32>, 8>,\n // each center row: (x, y, weight, _pad)\n centers: array<vec4<f32>, 4>,\n // each palette stop: linear-sRGB rgb + _pad\n palette: array<vec4<f32>, 4>,\n};\n\n@group(0) @binding(0) var<uniform> u: ConcentricUniforms;\n\n\nfn srgbToLinearCh(c: f32) -> f32 {\n if (c <= 0.04045) { return c / 12.92; }\n return pow((c + 0.055) / 1.055, 2.4);\n}\nfn srgbToLinear(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfn linearToSrgbCh(c: f32) -> f32 {\n if (c <= 0.0031308) { return c * 12.92; }\n return 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nfn linearToSrgb(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}\n\n// value.js LINEAR_SRGB_TO_LMS, row-major \u2192 WGSL columns (= the transpose).\nconst LINEAR_SRGB_TO_LMS: mat3x3<f32> = mat3x3<f32>(\n 0.4122214708, 0.2119034982, 0.0883024619,\n 0.5363325363, 0.6806995451, 0.2817188376,\n 0.0514459929, 0.1073969566, 0.6299787005\n);\n\n// value.js srgbToOKLab's INLINE LMS\u2192OKLab coefficients, row-major \u2192 WGSL columns.\nconst LMS_TO_OKLAB: mat3x3<f32> = mat3x3<f32>(\n 0.2104542553, 1.9779984951, 0.0259040371,\n 0.7936177850, -2.4285922050, 0.7827717662,\n -0.0040720468, 0.4505937099, -0.8086757660\n);\n\n// value.js OKLAB_TO_LMS_COEFF, row-major \u2192 WGSL columns.\nconst OKLAB_TO_LMS: mat3x3<f32> = mat3x3<f32>(\n 1.0, 1.0, 1.0,\n 0.3963377774, -0.1055613458, -0.0894841775,\n 0.2158037573, -0.0638541728, -1.2914855480\n);\n\n// value.js LMS_TO_LINEAR_SRGB, row-major \u2192 WGSL columns.\nconst LMS_TO_LINEAR_SRGB: mat3x3<f32> = mat3x3<f32>(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\nfn cbrt3(v: vec3<f32>) -> vec3<f32> {\n return sign(v) * pow(abs(v), vec3<f32>(1.0 / 3.0));\n}\n\n// Gamma sRGB \u2192 raw OKLab (L, a, b). Mirrors value.js srgbToOKLab.\nfn srgbToOklab(c: vec3<f32>) -> vec3<f32> {\n let lin = srgbToLinear(c);\n let lms = LINEAR_SRGB_TO_LMS * lin;\n return LMS_TO_OKLAB * cbrt3(lms);\n}\n\n// Raw OKLab (L, a, b) \u2192 linear sRGB. Mirrors value.js oklabToLinearSRGB.\nfn oklabToLinearSrgb(lab: vec3<f32>) -> vec3<f32> {\n let lms_ = OKLAB_TO_LMS * lab;\n let lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\n\n// OKLab \u2192 OKLCh: H in RADIANS, folded to [0, 2pi). Mirrors value.js rawOklabToOklch.\nfn oklabToOklch(lab: vec3<f32>) -> vec3<f32> {\n let C = length(lab.yz);\n var H = atan2(lab.z, lab.y);\n if (H < 0.0) { H = H + 2.0 * PI; }\n return vec3<f32>(lab.x, C, H);\n}\n\n// OKLCh (H radians) \u2192 OKLab. Mirrors value.js rawOklchToOklab.\nfn oklchToOklab(lch: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}\n\n// Full-screen-triangle (the pilot idiom): NDC corners (-1,-1),(3,-1),(-1,3) cover the\n// viewport from a single 3-vertex draw \u2014 no vertex buffer.\nstruct VSOut {\n @builtin(position) pos: vec4<f32>,\n @location(0) uv: vec2<f32>, // domain [-1,1]\u00B2, aspect-corrected x\n};\n\n@vertex\nfn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {\n var corners = array<vec2<f32>, 3>(\n vec2<f32>(-1.0, -1.0), vec2<f32>(3.0, -1.0), vec2<f32>(-1.0, 3.0),\n );\n let c = corners[vi];\n var out: VSOut;\n out.pos = vec4<f32>(c, 0.0, 1.0);\n // aspect-correct so the rings stay circular under the ellipsoidal norm (NOT squashed\n // by the canvas aspect): widen the domain x by the aspect ratio.\n out.uv = vec2<f32>(c.x, c.y);\n return out;\n}\n\n// The ellipsoidal radial distance \u2016p \u2212 c\u2016_e = sqrt((dx/a)\u00B2 + (dy/b)\u00B2). The single radial\n// metric (transcribes ringField.ts ellipsoidalRadius).\nfn ellipsoidalRadius(p: vec2<f32>, center: vec2<f32>, axisA: f32, axisB: f32) -> f32 {\n let dx = (p.x - center.x) / max(axisA, 1e-4);\n let dy = (p.y - center.y) / max(axisB, 1e-4);\n return sqrt(dx * dx + dy * dy);\n}\n\n// The radial-Fourier ring-interference value f(p,t) \u2014 the multi-center weighted sum of\n// radial sinusoids (transcribes ringField.ts sampleRingField line-for-line).\nfn sampleRingField(p: vec2<f32>, t: f32) -> f32 {\n var acc = 0.0;\n let speed = u.u0.y;\n let axisA = u.u0.z;\n let axisB = u.u0.w;\n let centerCount = u.ints.x;\n let ringCount = u.ints.y;\n for (var j = 0; j < MAX_CENTERS; j = j + 1) {\n if (j >= centerCount) { break; }\n let cj = u.centers[j];\n let radius = ellipsoidalRadius(p, cj.xy, axisA, axisB);\n var centerSum = 0.0;\n for (var i = 0; i < MAX_RINGS; i = i + 1) {\n if (i >= ringCount) { break; }\n let r = u.rings[i];\n let k = TAU / max(r.y, 1e-4);\n // \u03C9 = \u221A(g\u00B7k); speed scales the travel (the shared dispersion law).\n let omega = sqrt(RING_GRAVITY * k) * speed;\n let theta = k * radius - omega * t + r.z;\n centerSum = centerSum + r.x * sin(theta);\n }\n acc = acc + centerSum * cj.z;\n }\n return acc;\n}\n\n// Sample the multi-stop palette (linear-sRGB stops, OKLab mix). t in [0,1].\nfn samplePaletteLin(t: f32) -> vec3<f32> {\n let stopCount = u.ints.z;\n if (stopCount <= 1) { return u.palette[0].rgb; }\n let n = f32(stopCount);\n let ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n let i0 = i32(floor(ft));\n let i1 = min(i0 + 1, stopCount - 1);\n let f = ft - f32(i0);\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i0].rgb);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i1].rgb);\n return oklabToLinearSrgb(mix(labA, labB, f));\n}\n\n@fragment\nfn fs_main(in: VSOut) -> @location(0) vec4<f32> {\n // aspect-correct the domain x so the rings read circular under the ellipsoidal norm.\n let aspect = max(u.norm.y, 1e-4);\n let p = vec2<f32>(in.uv.x * aspect, in.uv.y);\n let t = u.u0.x;\n\n let raw = sampleRingField(p, t);\n // Normalize the field \u2192 [0,1] for the palette ramp (uFieldNorm is the amplitude scale).\n let v = clamp(0.5 + raw * u.norm.x, 0.0, 1.0);\n\n let lin = samplePaletteLin(v);\n let rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));\n\n // Premultiplied-alpha output over the (transparent / themed) ground.\n let hasBg = u.bg.w;\n if (hasBg > 0.5) {\n // opaque themed ground: the field paints fully opaque.\n return vec4<f32>(rgb, 1.0);\n }\n // transparent ground: the field's alpha rides its own brightness so the page reads\n // through the troughs (the ring crests carry the ink; the calm field is faint).\n let alpha = clamp(v * 0.92 + 0.08, 0.0, 1.0);\n return vec4<f32>(rgb * alpha, alpha);\n}\n";
|
|
1
|
+
export declare const CONCENTRIC_WGSL = "\nconst PI: f32 = 3.141592653589793;\nconst TAU: f32 = 6.283185307179586;\nconst MAX_RING_STOPS: i32 = 4;\n\n// \u2500\u2500 Concentric uniforms (the typed-struct source-of-truth \u2014 see uniformBridgeWGPU.ts) \u2500\u2500\nstruct ConcentricUniforms {\n // u0: (uTime, uSpeed, uCellSize, _pad)\n u0: vec4<f32>,\n // ints: (_pad, _pad, uStopCount, _pad)\n ints: vec4<i32>,\n // bg: (background.rgb (linear), hasBackground)\n bg: vec4<f32>,\n // norm: (uFieldNorm, uAspect, lightDirX, lightDirY)\n norm: vec4<f32>,\n // line: (lineHalfWidth, aaSoftness, contourLevels, indexEvery)\n line: vec4<f32>,\n // wave: (waveDirX, waveDirY, waveK, waveOmega)\n wave: vec4<f32>,\n // wave2: (waveSigma, twistMax, shearMax, amp)\n wave2: vec4<f32>,\n // topo: (heightOctaves, heightSeed, swellAmp, perturbAmp)\n topo: vec4<f32>,\n // cursor: (cursorX, cursorY, cursorWell, interactive)\n cursor: vec4<f32>,\n // tune: (toneGain, shadeAmp, indexMul, inkDarken)\n tune: vec4<f32>,\n // each palette stop: linear-sRGB rgb + _pad\n palette: array<vec4<f32>, 4>,\n};\n\n@group(0) @binding(0) var<uniform> u: ConcentricUniforms;\n\n\nfn srgbToLinearCh(c: f32) -> f32 {\n if (c <= 0.04045) { return c / 12.92; }\n return pow((c + 0.055) / 1.055, 2.4);\n}\nfn srgbToLinear(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(srgbToLinearCh(c.r), srgbToLinearCh(c.g), srgbToLinearCh(c.b));\n}\n\nfn linearToSrgbCh(c: f32) -> f32 {\n if (c <= 0.0031308) { return c * 12.92; }\n return 1.055 * pow(c, 1.0 / 2.4) - 0.055;\n}\nfn linearToSrgb(c: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(linearToSrgbCh(c.r), linearToSrgbCh(c.g), linearToSrgbCh(c.b));\n}\n\n// value.js LINEAR_SRGB_TO_LMS, row-major \u2192 WGSL columns (= the transpose).\nconst LINEAR_SRGB_TO_LMS: mat3x3<f32> = mat3x3<f32>(\n 0.4122214708, 0.2119034982, 0.0883024619,\n 0.5363325363, 0.6806995451, 0.2817188376,\n 0.0514459929, 0.1073969566, 0.6299787005\n);\n\n// value.js srgbToOKLab's INLINE LMS\u2192OKLab coefficients, row-major \u2192 WGSL columns.\nconst LMS_TO_OKLAB: mat3x3<f32> = mat3x3<f32>(\n 0.2104542553, 1.9779984951, 0.0259040371,\n 0.7936177850, -2.4285922050, 0.7827717662,\n -0.0040720468, 0.4505937099, -0.8086757660\n);\n\n// value.js OKLAB_TO_LMS_COEFF, row-major \u2192 WGSL columns.\nconst OKLAB_TO_LMS: mat3x3<f32> = mat3x3<f32>(\n 1.0, 1.0, 1.0,\n 0.3963377774, -0.1055613458, -0.0894841775,\n 0.2158037573, -0.0638541728, -1.2914855480\n);\n\n// value.js LMS_TO_LINEAR_SRGB, row-major \u2192 WGSL columns.\nconst LMS_TO_LINEAR_SRGB: mat3x3<f32> = mat3x3<f32>(\n 4.0767416621, -1.2684380046, -0.0041960863,\n -3.3077115913, 2.6097574011, -0.7034186147,\n 0.2309699292, -0.3413193965, 1.7076147010\n);\n\nfn cbrt3(v: vec3<f32>) -> vec3<f32> {\n return sign(v) * pow(abs(v), vec3<f32>(1.0 / 3.0));\n}\n\n// Gamma sRGB \u2192 raw OKLab (L, a, b). Mirrors value.js srgbToOKLab.\nfn srgbToOklab(c: vec3<f32>) -> vec3<f32> {\n let lin = srgbToLinear(c);\n let lms = LINEAR_SRGB_TO_LMS * lin;\n return LMS_TO_OKLAB * cbrt3(lms);\n}\n\n// Raw OKLab (L, a, b) \u2192 linear sRGB. Mirrors value.js oklabToLinearSRGB.\nfn oklabToLinearSrgb(lab: vec3<f32>) -> vec3<f32> {\n let lms_ = OKLAB_TO_LMS * lab;\n let lms = lms_ * lms_ * lms_;\n return LMS_TO_LINEAR_SRGB * lms;\n}\n\n// OKLab \u2192 OKLCh: H in RADIANS, folded to [0, 2pi). Mirrors value.js rawOklabToOklch.\nfn oklabToOklch(lab: vec3<f32>) -> vec3<f32> {\n let C = length(lab.yz);\n var H = atan2(lab.z, lab.y);\n if (H < 0.0) { H = H + 2.0 * PI; }\n return vec3<f32>(lab.x, C, H);\n}\n\n// OKLCh (H radians) \u2192 OKLab. Mirrors value.js rawOklchToOklab.\nfn oklchToOklab(lch: vec3<f32>) -> vec3<f32> {\n return vec3<f32>(lch.x, lch.y * cos(lch.z), lch.y * sin(lch.z));\n}\n\n// Full-screen-triangle (the pilot idiom).\nstruct VSOut {\n @builtin(position) pos: vec4<f32>,\n @location(0) uv: vec2<f32>,\n};\n\n@vertex\nfn vs_main(@builtin(vertex_index) vi: u32) -> VSOut {\n var corners = array<vec2<f32>, 3>(\n vec2<f32>(-1.0, -1.0), vec2<f32>(3.0, -1.0), vec2<f32>(-1.0, 3.0),\n );\n let c = corners[vi];\n var out: VSOut;\n out.pos = vec4<f32>(c, 0.0, 1.0);\n out.uv = vec2<f32>(c.x, c.y);\n return out;\n}\n\n// \u2500\u2500 The host noise basis (the SAME quintic-faded value-noise the suite speaks) \u2500\u2500\nfn hash21(x: f32, y: f32) -> f32 {\n var px = fract(x * 0.1031);\n var py = fract(y * 0.1031);\n var pz = fract(x * 0.1031);\n let d = px * (py + 33.33) + py * (pz + 33.33) + pz * (px + 33.33);\n px = px + d; py = py + d; pz = pz + d;\n return fract((px + py) * pz);\n}\nfn valueNoise(x: f32, y: f32) -> f32 {\n let ix = floor(x); let iy = floor(y);\n let fx = x - ix; let fy = y - iy;\n let ux = fx * fx * fx * (fx * (fx * 6.0 - 15.0) + 10.0);\n let uy = fy * fy * fy * (fy * (fy * 6.0 - 15.0) + 10.0);\n let a = hash21(ix, iy);\n let b = hash21(ix + 1.0, iy);\n let c = hash21(ix, iy + 1.0);\n let d2 = hash21(ix + 1.0, iy + 1.0);\n return mix(mix(a, b, ux), mix(c, d2, ux), uy);\n}\n// The single-octave potential the curl operator wraps + the height field samples.\nfn potentialFBM(p: vec2f) -> f32 {\n var v = 0.0; var amp = 0.5; var freq = 1.0;\n var px = p.x; var py = p.y;\n for (var i = 0; i < 3; i = i + 1) {\n v = v + amp * valueNoise(px * freq, py * freq);\n let rx = 0.8 * px - 0.6 * py;\n let ry = 0.6 * px + 0.8 * py;\n px = rx; py = ry; freq = freq * 2.0; amp = amp * 0.5;\n }\n return v;\n}\n\n// The shared curl + wave chunks (splice AFTER valueNoise + potentialFBM are declared).\n\nconst CURL_EPS: f32 = 0.012;\n\n// \u2207\u00D7\u03C8 in 2D \u2014 the divergence-free flow direction. Central finite differences of the\n// scalar potential give the partials; the cross-pairing (\u2202y, \u2212\u2202x) is the 2D curl.\nfn curlFBM(p: vec2f) -> vec2f {\n let dx = potentialFBM(p + vec2f(CURL_EPS, 0.0)) - potentialFBM(p - vec2f(CURL_EPS, 0.0));\n let dy = potentialFBM(p + vec2f(0.0, CURL_EPS)) - potentialFBM(p - vec2f(0.0, CURL_EPS));\n // \u03C8-gradient is (dx, dy)/(2\u00B7eps); the curl rotates it 90\u00B0: (\u2202\u03C8/\u2202y, \u2212\u2202\u03C8/\u2202x).\n let g = vec2f(dx, dy) / (2.0 * CURL_EPS);\n return vec2f(g.y, -g.x);\n}\n\n\nconst WAVE_FIELD_TAU: f32 = 6.283185307179586;\n\n// The traveling-wave envelope \u2014 a moving Gaussian crest band sweeping along waveDir.\nfn travelingEnvelope(pivot: vec2f, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32, waveSigma: f32) -> f32 {\n let coord = dot(pivot, waveDir) * waveK - t * waveOmega;\n let crest = fract(coord / WAVE_FIELD_TAU);\n let z = (crest - 0.5) * 2.0;\n return exp(-(z * z) / max(waveSigma, 1e-3));\n}\n\n// The curl-direction scalar \u2014 the smooth low-freq director the per-cell twist follows.\nfn curlScalar(cc: vec2f, t: f32) -> f32 {\n let f = curlFBM(vec2f(cc.x * 0.5 + t * 0.08, cc.y * 0.5 - t * 0.06));\n return clamp(f.x, -1.0, 1.0);\n}\n\n// The directed-twist FLOOR (the visibility cure): keep the curl SIGN (adjacent cells lean\n// together) but floor the magnitude so a crest-band cell ALWAYS rotates decisively.\nconst WAVE_FIELD_TWIST_FLOOR: f32 = 0.62;\nfn directedTwist(s: f32, floorMag: f32) -> f32 {\n let mag = max(floorMag, abs(s));\n let sgn = tanh(s * 6.0);\n return sgn * mag;\n}\n\n// \u2500\u2500 The FACE leaf (the structurally-absent RE-INVENT \u2014 height-lit filled cell interior) \u2500\u2500\n// DECLARED ABOVE cellTwist (no WGSL forward declaration): cellTwist rides cellHeight via the\n// driver so twist + face read ONE envelope.\n\n// The sheet displacement at a cell center = the EXACT traveling-wave scalar the twist rides.\nfn cellHeight(cc: vec2f, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32, waveSigma: f32, amp: f32) -> f32 {\n return travelingEnvelope(cc, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n}\n\n// The pre-twist driver (FOLD A): the cell pivot cc + the crest envelope env the twist AND the\n// face both ride. The face samples height/relief at THIS pre-twist cc (the crest twist crosses\n// the cell boundary \u2192 floor(twisted_g) would light a NEIGHBOUR cell). cc in .xy, env in .z.\nfn cellDriver(g: vec2f, cellSize: f32, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32,\n waveSigma: f32, amp: f32) -> vec3f {\n let cs = max(cellSize, 1e-3);\n let cc = (floor(g / cs) + 0.5) * cs;\n let env = cellHeight(cc, t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec3f(cc, env);\n}\n\n// The central-difference slope of cellHeight across a cell (eps = 0.5\u00B7cellSize) \u2014 derivative-\n// FREE (NO dFdx on the height) \u2192 Safari WebGL2-safe. Returns \u2207H.\nfn faceRelief(cc: vec2f, cellSize: f32, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32,\n waveSigma: f32, amp: f32) -> vec2f {\n let eps = max(cellSize, 1e-3) * 0.5;\n let hxp = cellHeight(cc + vec2f(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n let hxm = cellHeight(cc - vec2f(eps, 0.0), t, waveDir, waveK, waveOmega, waveSigma, amp);\n let hyp = cellHeight(cc + vec2f(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n let hym = cellHeight(cc - vec2f(0.0, eps), t, waveDir, waveK, waveOmega, waveSigma, amp);\n return vec2f((hxp - hxm) / (2.0 * eps), (hyp - hym) / (2.0 * eps));\n}\n\n// Soft inset-square coverage inside a (warped) cell \u2014 the filled FACE plateau. d is the\n// distance into the cell from the nearest gutter (the Golus triangle-wave); the inset retreats\n// as it grows (the squash). aa = the shader's fwidth(g) (JS passes a fixed uvDeriv).\nfn facePlateau(g: vec2f, inset: f32, uvDeriv: vec2f) -> f32 {\n let tri = 1.0 - abs(fract(g) * 2.0 - 1.0);\n let d = min(tri.x, tri.y);\n let aa = max(uvDeriv.x, uvDeriv.y) * 1.5;\n return smoothstep(inset, inset + 2.0 * aa, d);\n}\n\n// The cell-local twist about each cell's own center, gated by the traveling wave + directed\n// by the curl flow. amp is the spring-eased envelope amplitude the JS host drives. FOLD C: the\n// TWIST_FLOOR is crest-gated by env so OFF-crest cells relax to flat calm paper (the traveling\n// read, not static foil).\nfn cellTwist(g: vec2f, cellSize: f32, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32,\n waveSigma: f32, twistMax: f32, shearMax: f32, amp: f32) -> vec2f {\n let drv = cellDriver(g, cellSize, t, waveDir, waveK, waveOmega, waveSigma, amp);\n let cc = drv.xy;\n let env = drv.z;\n let floorMag = WAVE_FIELD_TWIST_FLOOR * env; // FOLD C: crest-gated floor\n let theta = twistMax * env * directedTwist(curlScalar(cc, t), floorMag);\n let shear = shearMax * env * directedTwist(curlScalar(cc + vec2f(17.3, 9.1), t), floorMag);\n let local = g - cc;\n let ct = cos(theta);\n let st = sin(theta);\n var rot = vec2f(ct * local.x - st * local.y, st * local.x + ct * local.y);\n rot.x = rot.x + shear * rot.y; // a small skew so the box MORPHS, not just rotates\n return cc + rot;\n}\n\n// The CONTINUOUS traveling-wave FLOW warp \u2014 the SMOOTH twin of cellTwist (no per-cell seam;\n// for the level-set contours that shatter into a mesh under the cell discontinuity).\nfn waveFlow(g: vec2f, t: f32, waveDir: vec2f, waveK: f32, waveOmega: f32, waveSigma: f32,\n twistMax: f32, amp: f32) -> vec2f {\n let env = travelingEnvelope(g, t, waveDir, waveK, waveOmega, waveSigma) * amp;\n let f = curlFBM(vec2f(g.x * 0.6 + t * 0.05, g.y * 0.6 - t * 0.04));\n let f2 = curlFBM(vec2f(g.x * 1.1 - t * 0.03, g.y * 1.1 + t * 0.035));\n let k = twistMax * env;\n return g + (f + f2 * 0.5) * k;\n}\n\n// The local cursor swirl \u2014 the finger twists the cells around it (re-aimed cursorBulge).\nfn cursorSwirl(g: vec2f, cursor: vec2f, strength: f32, radius: f32) -> vec2f {\n let to = g - cursor;\n let d2 = dot(to, to);\n let r = max(radius, 1e-4);\n let theta = strength * exp(-d2 / (2.0 * r * r));\n let ct = cos(theta);\n let st = sin(theta);\n return cursor + vec2f(ct * to.x - st * to.y, st * to.x + ct * to.y);\n}\n\n// The LOW-octave value-noise topography \u2014 the scalar field concentric extracts contours of.\nfn heightField(p: vec2f, octavesF: f32, seed: f32) -> f32 {\n var v = 0.0;\n var amp = 0.5;\n var freq = 1.0;\n var px = p.x + seed;\n var py = p.y - seed;\n let n = i32(clamp(octavesF, 1.0, 6.0));\n for (var i = 0; i < 6; i = i + 1) {\n if (i >= n) { break; }\n v = v + amp * valueNoise(px * freq, py * freq);\n let rx = 0.8 * px - 0.6 * py;\n let ry = 0.6 * px + 0.8 * py;\n px = rx;\n py = ry;\n freq = freq * 2.0;\n amp = amp * 0.5;\n }\n return v;\n}\n\n// The \u03C9=\u221A(g\u00B7k) breathing swell \u2014 basins inflate/deflate with weight.\nfn waveSwell(t: f32, phase: f32) -> f32 {\n return sin(t * 0.35 + phase) * 0.5 + sin(t * 0.21 + phase * 1.7) * 0.5;\n}\n\n\nfn smoothstepEdge(e0: f32, e1: f32, x: f32) -> f32 {\n let t = clamp((x - e0) / max(e1 - e0, 1e-6), 0.0, 1.0);\n return t * t * (3.0 - 2.0 * t);\n}\n\n// The level-set height at domain p (transcribes levelField.ts sampleHeight). The sampling\n// coordinate is cell-twisted (the SAME wave that twists paper-grid cells \u2014 kinship); the\n// height is a low-octave topography + the swell + the cursor peak.\nfn sampleHeight(p: vec2f, t: f32) -> f32 {\n // The CONTINUOUS traveling-wave flow warp (no per-cell seam \u2014 the contours flow + twist as\n // the wave passes OVER and THROUGH them, the SAME wave that twists the paper-grid cells).\n var g = waveFlow(p, t, u.wave.xy, u.wave.z, u.wave.w, u.wave2.x, u.wave2.y, u.wave2.w);\n if (u.cursor.w > 0.5) {\n g = cursorSwirl(g, u.cursor.xy, u.cursor.z * 0.6, u.u0.z * 2.5);\n }\n // Sample the topography at a LOW base frequency so the basins are BROAD nested loops (a\n // readable contour map \u2014 not a fine speckle). heightOctaves carries the fractal detail.\n var H = heightField(g * 0.9, u.topo.x, u.topo.y);\n H = H + u.topo.z * waveSwell(t, u.topo.y);\n if (u.cursor.w > 0.5) {\n let d = p - u.cursor.xy;\n let d2 = dot(d, d);\n // The cursor HEAVE \u2014 a SOFT bulge (a Gaussian peak feathered by a smoothstep falloff so\n // the heave is C1-smooth, NOT the hard-edged quad the old dark render showed). The well\n // depth/radius already carry the velocity-HEAVE scale (packed JS-side into u.cursor.z).\n let g0 = exp(-d2 / 0.22);\n let fall = smoothstepEdge(0.0, 0.55, exp(-d2 / 0.6));\n H = H + u.cursor.z * g0 * fall;\n }\n return H;\n}\n\n// The IQ gradient-free level-set contour ink \u2014 KEPT BYTE-FROZEN (the perfect GPU AA). It is\n// FED the per-level half-width 'hw' (a parameter, NOT a re-derivation): de_contour =\n// |fract(fN + 0.5) \u2212 0.5| / fwidth(fN). The contour density tracks 1/|\u2207H| automatically.\n// 'aaW' floors against a DPR-aware minimum so the index line stays CONTINUOUS where the heave\n// packs contours (steep |\u2207H| saturates fwidth \u2014 challenge R4).\nfn contourInk(fN: f32, hw: f32) -> f32 {\n let band = abs(fract(fN + 0.5) - 0.5);\n let aaW = max(fwidth(fN), 6e-4);\n return 1.0 - smoothstepEdge(hw, hw + u.line.y, band / aaW);\n}\n\n// Sample the multi-stop palette (linear-sRGB stops, OKLab mix). t in [0,1].\nfn samplePaletteLin(t: f32) -> vec3<f32> {\n let stopCount = u.ints.z;\n if (stopCount <= 1) { return u.palette[0].rgb; }\n let n = f32(stopCount);\n let ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n let i0 = i32(floor(ft));\n let i1 = min(i0 + 1, stopCount - 1);\n let f = ft - f32(i0);\n let labA = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i0].rgb);\n let labB = LMS_TO_OKLAB * cbrt3(LINEAR_SRGB_TO_LMS * u.palette[i1].rgb);\n return oklabToLinearSrgb(mix(labA, labB, f));\n}\n\n// The SHARED hillshade finite-diff epsilon \u2014 pinned ONCE (mirrors levelField.HILLSHADE_EPSILON\n// + the GLSL twin; a per-backend drift would red the L6 numeric parity).\nconst HILLSHADE_E: f32 = 0.012;\n\n@fragment\nfn fs_main(in: VSOut) -> @location(0) vec4<f32> {\n let aspect = max(u.norm.y, 1e-4);\n let p = vec2<f32>(in.uv.x * aspect, in.uv.y);\n let t = u.u0.x * u.u0.y;\n let levels = max(u.line.z, 1.0);\n\n // The level-set topography (the KEPT field \u2014 the PRIMARY path).\n let H = sampleHeight(p, t);\n\n // \u2500\u2500 1. HYPSOMETRIC TONE \u2014 tanh expands the compressed band so basins+ridges hit the ramp\n // ENDS (the live lumVar-flat cause). samplePaletteLin is the KEPT OKLab operator.\n let tone = 0.5 + 0.5 * tanh(H * u.tune.x);\n var fill = samplePaletteLin(tone);\n\n // \u2500\u2500 2. ANALYTIC HILLSHADE \u2014 one \u2207H finite-diff at the SHARED e, dotted with the fixed cel\n // light \u2192 2.5-D relief. A read-only re-sample of sampleHeight (no second field).\n let e = HILLSHADE_E;\n let hx = sampleHeight(p + vec2<f32>(e, 0.0), t) - sampleHeight(p - vec2<f32>(e, 0.0), t);\n let hy = sampleHeight(p + vec2<f32>(0.0, e), t) - sampleHeight(p - vec2<f32>(0.0, e), t);\n let grad = vec2<f32>(hx, hy) / (2.0 * e);\n let L = normalize(u.norm.zw + vec2<f32>(1e-5, 1e-5));\n let shade = 0.5 + 0.5 * clamp(dot(normalize(grad + vec2<f32>(1e-5)), L), -1.0, 1.0);\n fill = fill * mix(1.0 - u.tune.y, 1.0 + u.tune.y, shade);\n\n // \u2500\u2500 3. TWO-TIER INDEX/MINOR CONTOUR \u2014 isIndex a pure f(level) (floor + mod + select, NOT a\n // state buffer); the per-level half-width hw is FED to the byte-frozen contourInk.\n let fN = H * levels + u.topo.w * sin(floor(H * levels) * 2.4 + t * 0.7);\n let indexEvery = max(u.line.w, 1.0);\n let lvl = floor(fN);\n let isIndex = select(0.0, 1.0, fract(lvl / indexEvery) < (0.5 / indexEvery));\n let hw = mix(u.line.x, u.line.x * u.tune.z, isIndex);\n let ink = clamp(contourInk(fN, hw), 0.0, 1.0);\n\n // \u2500\u2500 4. INK = a darker ember of the LOCAL fill (the edge-of-its-own-band signature).\n let inkCol = mix(fill, fill * u.tune.w, 0.85);\n\n // \u2500\u2500 5. ONE color path + OPAQUE OUT \u2014 the viz IS the colorful field, never lines-over-nothing.\n // Per-mode is resolved in the CONSUMED stops + the bg token (no in-shader uMode branch).\n let col = mix(fill, inkCol, ink);\n return vec4<f32>(clamp(linearToSrgb(col), vec3<f32>(0.0), vec3<f32>(1.0)), 1.0);\n}\n";
|
|
@@ -23,6 +23,20 @@ export type ConfiguratorScrollMode = "auto" | "always" | "never";
|
|
|
23
23
|
* Below `lg` the layout is a single column and the side has no meaning.
|
|
24
24
|
*/
|
|
25
25
|
export type ConfiguratorAsideSide = "left" | "right";
|
|
26
|
+
/**
|
|
27
|
+
* Where the preset gallery sits.
|
|
28
|
+
*
|
|
29
|
+
* `aside` (default) keeps the preset row inside the right-hand aside (the
|
|
30
|
+
* inspector idiom — the legacy placement, unchanged).
|
|
31
|
+
*
|
|
32
|
+
* `top` lifts the gallery OUT of the 360px aside and pins it as a large,
|
|
33
|
+
* full-width, horizontally-scrollable glass dock across the TOP of the studio
|
|
34
|
+
* frame — the §2.1 reflow (gallery up-top + larger + scrollable). The stage +
|
|
35
|
+
* controls reclaim the full height below it. An additive axis: the grid arm is
|
|
36
|
+
* the precompiled `[data-slot=configurator][data-gallery=top]` rule in
|
|
37
|
+
* configurator.css (never a dead JIT bracket — the BC.W-CONFIG-RIGHT lesson).
|
|
38
|
+
*/
|
|
39
|
+
export type ConfiguratorGalleryPlacement = "aside" | "top";
|
|
26
40
|
/**
|
|
27
41
|
* Generic preset descriptor. Consumers pass `T` as the live config shape.
|
|
28
42
|
* The primitive carries no preset semantics beyond `key + label` for
|
|
@@ -68,6 +82,13 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
68
82
|
* stays stage→aside. No effect below `lg` (single-column).
|
|
69
83
|
*/
|
|
70
84
|
asideSide?: ConfiguratorAsideSide;
|
|
85
|
+
/**
|
|
86
|
+
* Where the preset gallery sits. Default `"aside"` (the inspector idiom).
|
|
87
|
+
* `"top"` pins the gallery as a large full-width scrollable glass dock
|
|
88
|
+
* across the top of the studio (the §2.1 up-top reflow), driven by the
|
|
89
|
+
* precompiled `[data-gallery="top"]` rule in configurator.css.
|
|
90
|
+
*/
|
|
91
|
+
galleryPlacement?: ConfiguratorGalleryPlacement;
|
|
71
92
|
/**
|
|
72
93
|
* Aside width band at `lg`+ width, as a CSS length pair driving
|
|
73
94
|
* `minmax(--configurator-aside-min, --configurator-aside-max)`. The
|
|
@@ -89,12 +110,12 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
89
110
|
expose: (exposed: {}) => void;
|
|
90
111
|
attrs: any;
|
|
91
112
|
slots: {
|
|
92
|
-
stage?: (props: {}) => any;
|
|
93
|
-
} & {
|
|
94
113
|
presets?: (props: {
|
|
95
114
|
presets: readonly ConfiguratorPreset<T>[] | undefined;
|
|
96
115
|
activePreset: string | undefined;
|
|
97
116
|
}) => any;
|
|
117
|
+
} & {
|
|
118
|
+
stage?: (props: {}) => any;
|
|
98
119
|
} & {
|
|
99
120
|
controls?: (props: {
|
|
100
121
|
layers: readonly {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as Configurator } from "./Configurator.vue";
|
|
2
2
|
export { default as ConfiguratorLayer } from "./ConfiguratorLayer.vue";
|
|
3
3
|
export { default as ConfiguratorRow } from "./ConfiguratorRow.vue";
|
|
4
|
-
export type { ConfiguratorAsideSide, ConfiguratorPreset, ConfiguratorScrollMode, } from "./Configurator.vue";
|
|
4
|
+
export type { ConfiguratorAsideSide, ConfiguratorGalleryPlacement, ConfiguratorPreset, ConfiguratorScrollMode, } from "./Configurator.vue";
|
|
5
5
|
export { CONFIGURATOR_DENSITY_KEY, provideConfiguratorDensity, useOptionalConfiguratorDensity, type ConfiguratorDensity, } from "./density";
|
|
6
6
|
export { useConfiguratorState, type ConfiguratorCloneMode, type ConfiguratorState, type ConfiguratorStateOptions, } from "./useConfiguratorState";
|