@mkbabb/glass-ui 5.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -56
- package/dist/DropdownMenuTrigger-ClIq8RJE.js +93 -0
- package/dist/FeedbackMark-DZq5001h.js +23 -0
- package/dist/Input-9BlLluik.js +77 -0
- package/dist/PagerDots-BEq0MgtH.js +311 -0
- package/dist/Surface-kFQeYrYv.js +82 -0
- package/dist/accent-tone-solve-Cw7WkRD9.js +14 -0
- package/dist/animated-digit.js +5 -5
- package/dist/asElement-CRnm6A2v.js +9 -0
- package/dist/aurora.js +858 -793
- package/dist/axes.js +25 -14
- package/dist/badge-u65NClWn.js +62 -0
- package/dist/badge.js +1 -1
- package/dist/blob-config.d.ts +0 -4
- package/dist/blob-config.js +1 -1
- package/dist/blob.js +490 -424
- package/dist/button-Bu9F4uU6.js +98 -0
- package/dist/button.js +2 -2
- package/dist/canvas.js +1 -1
- package/dist/card-Bk96VI2R.js +234 -0
- package/dist/card.js +2 -2
- package/dist/carousel.d.ts +1 -2
- package/dist/carousel.js +109 -238
- package/dist/chip-DFZQr6rV.js +129 -0
- package/dist/chip.d.ts +0 -9
- package/dist/chip.js +2 -81
- package/dist/{class-names-5jotTFzp.js → class-names-Cpy5eaBk.js} +11 -4
- package/dist/collapsible-BAP95XTt.js +154 -0
- package/dist/collapsible.js +1 -1
- package/dist/color.js +83 -3
- package/dist/{procedural-color.wgsl-ByduxnzV.js → color.wgsl-Ct5o9dpf.js} +410 -3
- package/dist/command-SFqDQ65h.js +320 -0
- package/dist/command.js +1 -1
- package/dist/completion-seal.js +72 -63
- package/dist/components/_shared/FeedbackMark.vue.d.ts +11 -0
- package/dist/components/_shared/axes.d.ts +9 -3
- package/dist/components/_shared/class-names.d.ts +9 -8
- package/dist/components/_shared/control-size.d.ts +2 -0
- package/dist/components/_shared/disclosure-context.d.ts +7 -0
- package/dist/components/_shared/disclosure.css +1 -0
- package/dist/components/_shared/feedback.d.ts +7 -0
- package/dist/components/_shared/field-control.css +1 -0
- package/dist/components/_shared/field-surfaces.css +1 -0
- package/dist/components/_shared/fieldControl.d.ts +13 -0
- package/dist/components/_shared/floating.d.ts +14 -0
- package/dist/components/_shared/index.d.ts +2 -6
- package/dist/components/_shared/interaction.d.ts +23 -0
- package/dist/components/_shared/menu.css +1 -0
- package/dist/components/_shared/menuRowClass.d.ts +2 -0
- package/dist/components/_shared/primitive.d.ts +19 -0
- package/dist/components/_shared/resolveSurfaceClass.d.ts +3 -0
- package/dist/components/_shared/selection.d.ts +7 -0
- package/dist/components/_shared/useMotionAxis.d.ts +5 -4
- package/dist/components/_shared/valueDomain.d.ts +6 -0
- package/dist/components/accordion/Accordion.vue.d.ts +41 -16
- package/dist/components/accordion/AccordionContent.vue.d.ts +11 -9
- package/dist/components/accordion/AccordionItem.vue.d.ts +12 -9
- package/dist/components/accordion/AccordionTrigger.vue.d.ts +8 -11
- package/dist/components/accordion/index.d.ts +4 -4
- package/dist/components/alert/Alert.vue.d.ts +9 -5
- package/dist/components/alert/index.d.ts +17 -8
- package/dist/components/animated-digit/AnimatedDigit.vue.d.ts +3 -4
- package/dist/components/aurora/Aurora.vue.d.ts +44 -43
- package/dist/components/aurora/composables/atoms-fields.d.ts +13 -2
- package/dist/components/aurora/composables/atoms.d.ts +52 -50
- package/dist/components/aurora/composables/auroraFallbackGround.d.ts +13 -13
- package/dist/components/aurora/composables/auroraImageSource.d.ts +4 -5
- package/dist/components/aurora/composables/color.d.ts +15 -20
- package/dist/components/aurora/composables/frameLoop.d.ts +14 -11
- package/dist/components/aurora/composables/glSetup.d.ts +19 -2
- package/dist/components/aurora/composables/runtime.d.ts +58 -60
- package/dist/components/aurora/composables/uniformBridge.d.ts +9 -14
- package/dist/components/aurora/composables/uniformBridgeWGPU.d.ts +21 -22
- package/dist/components/aurora/composables/uniformBridgeWGPUImage.d.ts +13 -13
- package/dist/components/aurora/composables/useAurora.d.ts +21 -30
- package/dist/components/aurora/composables/wgpuSetup.d.ts +10 -8
- package/dist/components/aurora/constants/budget.d.ts +12 -25
- package/dist/components/aurora/constants/presets.d.ts +47 -58
- package/dist/components/aurora/constants/renderMode.d.ts +21 -36
- package/dist/components/aurora/constants/shaders/aurora-image.wgsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/aurora-mediums.wgsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/aurora.wgsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/brush.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/composition.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/flow.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/metal-medium.glsl.d.ts +2 -2
- package/dist/components/aurora/constants/shaders/oil-modes.glsl.d.ts +1 -1
- package/dist/components/aurora/constants/shaders/vangogh-medium.glsl.d.ts +1 -1
- package/dist/components/aurora/index.d.ts +2 -1
- package/dist/components/avatar/Avatar.vue.d.ts +72 -11
- package/dist/components/avatar/AvatarFallback.vue.d.ts +1 -2
- package/dist/components/avatar/AvatarImage.vue.d.ts +12 -6
- package/dist/components/avatar/index.d.ts +3 -9
- package/dist/components/avatar/styles.css +1 -0
- package/dist/components/badge/Badge.vue.d.ts +2 -9
- package/dist/components/badge/index.d.ts +32 -9
- package/dist/components/blob/Blob.vue.d.ts +16 -12
- package/dist/components/blob/composables/blobSimulation.d.ts +80 -0
- package/dist/components/blob/composables/buildMetaballProgram.d.ts +1 -1
- package/dist/components/blob/composables/resolveBlobSurface.d.ts +6 -0
- package/dist/components/blob/composables/satelliteKinematics.d.ts +3 -3
- package/dist/components/blob/composables/uniformBridgeWGPU.d.ts +1 -1
- package/dist/components/blob/composables/uploadBlobUniforms.d.ts +4 -31
- package/dist/components/blob/composables/useBlobMood.d.ts +5 -5
- package/dist/components/blob/composables/useBlobPointer.d.ts +11 -12
- package/dist/components/blob/composables/useMetaballRenderer.d.ts +29 -24
- package/dist/components/blob/composables/wgpuSetup.d.ts +7 -5
- package/dist/components/blob/config.d.ts +1 -1
- package/dist/components/blob/index.d.ts +2 -2
- package/dist/components/blob/presets.d.ts +2 -2
- package/dist/components/blob/shaders/metaball-palette.wgsl.d.ts +1 -1
- package/dist/components/blob/shaders/metaball-uniforms.glsl.d.ts +1 -1
- package/dist/components/blob/shaders/metaball.wgsl.d.ts +1 -1
- package/dist/components/blob/shaders/sdf-body.glsl.d.ts +1 -1
- package/dist/components/blob/shaders/watercolor-edges.glsl.d.ts +1 -1
- package/dist/components/blob/types.d.ts +28 -60
- package/dist/components/button/Button.vue.d.ts +27 -19
- package/dist/components/button/index.d.ts +1 -9
- package/dist/components/button/styles.css +1 -0
- package/dist/components/card/Card.vue.d.ts +20 -155
- package/dist/components/card/CardAction.vue.d.ts +0 -7
- package/dist/components/card/CardContent.vue.d.ts +2 -2
- package/dist/components/card/CardDescription.vue.d.ts +2 -2
- package/dist/components/card/CardFooter.vue.d.ts +2 -2
- package/dist/components/card/CardHeader.vue.d.ts +3 -42
- package/dist/components/card/CardTitle.vue.d.ts +6 -3
- package/dist/components/card/card-scroll.css +1 -0
- package/dist/components/card/index.d.ts +1 -3
- package/dist/components/card/styles.css +1 -0
- package/dist/components/carousel/Carousel.vue.d.ts +2 -2
- package/dist/components/carousel/index.d.ts +0 -3
- package/dist/components/carousel/interface.d.ts +2 -0
- package/dist/components/carousel/useCarousel.d.ts +2 -2
- package/dist/components/checkbox/Checkbox.vue.d.ts +17 -9
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/styles.css +1 -0
- package/dist/components/chip/Chip.vue.d.ts +12 -7
- package/dist/components/chip/chipVariants.d.ts +20 -43
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip/types.d.ts +45 -30
- package/dist/components/collapsible/Collapsible.vue.d.ts +22 -9
- package/dist/components/collapsible/CollapsibleContent.vue.d.ts +11 -5
- package/dist/components/collapsible/CollapsibleTrigger.vue.d.ts +12 -9
- package/dist/components/collapsible/index.d.ts +3 -3
- package/dist/components/combobox/Combobox.vue.d.ts +10 -20
- package/dist/components/combobox/ComboboxAnchor.vue.d.ts +2 -6
- package/dist/components/combobox/ComboboxEmpty.vue.d.ts +2 -6
- package/dist/components/combobox/ComboboxGroup.vue.d.ts +2 -7
- package/dist/components/combobox/ComboboxInput.vue.d.ts +7 -12
- package/dist/components/combobox/ComboboxItem.vue.d.ts +7 -11
- package/dist/components/combobox/ComboboxItemIndicator.vue.d.ts +2 -6
- package/dist/components/combobox/ComboboxList.vue.d.ts +14 -17
- package/dist/components/combobox/ComboboxTrigger.vue.d.ts +16 -0
- package/dist/components/combobox/index.d.ts +2 -3
- package/dist/components/combobox/types.d.ts +87 -0
- package/dist/components/command/Command.vue.d.ts +9 -23
- package/dist/components/command/CommandDialog.vue.d.ts +8 -10
- package/dist/components/command/CommandEmpty.vue.d.ts +2 -6
- package/dist/components/command/CommandGroup.vue.d.ts +2 -7
- package/dist/components/command/CommandInput.vue.d.ts +6 -7
- package/dist/components/command/CommandItem.vue.d.ts +7 -11
- package/dist/components/command/CommandList.vue.d.ts +12 -19
- package/dist/components/command/CommandSeparator.vue.d.ts +2 -6
- package/dist/components/command/CommandShortcut.vue.d.ts +2 -2
- package/dist/components/command/dialogContext.d.ts +6 -0
- package/dist/components/command/index.d.ts +10 -10
- package/dist/components/command/styles.css +1 -0
- package/dist/components/command/types.d.ts +27 -0
- package/dist/components/completion-seal/CompletionSeal.vue.d.ts +2 -2
- package/dist/components/completion-seal/constants.d.ts +2 -2
- package/dist/components/completion-seal/styles.css +1 -0
- package/dist/components/configurator/Configurator.vue.d.ts +6 -6
- package/dist/components/configurator/ConfiguratorLayer.vue.d.ts +14 -18
- package/dist/components/configurator/ConfiguratorRow.vue.d.ts +14 -17
- package/dist/components/configurator/size.d.ts +5 -7
- package/dist/components/configurator/styles.css +1 -0
- package/dist/components/constellation/Constellation.vue.d.ts +7 -2
- package/dist/components/constellation/composables/createConstellationField.d.ts +2 -2
- package/dist/components/constellation/composables/useConstellation.d.ts +3 -16
- package/dist/components/constellation/constants.d.ts +14 -24
- package/dist/components/constellation/constellationField.d.ts +8 -11
- package/dist/components/constellation/constellationInteraction.d.ts +9 -9
- package/dist/components/constellation/constellationRender.d.ts +11 -21
- package/dist/components/constellation/constellationTypes.d.ts +64 -62
- package/dist/components/constellation/constellationWell.d.ts +2 -2
- package/dist/components/constellation/index.d.ts +1 -1
- package/dist/components/dark-mode-toggle/DarkModeToggle.vue.d.ts +12 -0
- package/dist/components/dark-mode-toggle/dark-mode-toggle.css +1 -0
- package/dist/components/dark-mode-toggle/index.d.ts +2 -0
- package/dist/components/data-table/DataTable.vue.d.ts +12 -48
- package/dist/components/data-table/composables/useDataTableRowIdentity.d.ts +5 -23
- package/dist/components/data-table/index.d.ts +1 -2
- package/dist/components/data-table/styles.css +1 -0
- package/dist/components/data-table/types.d.ts +36 -13
- package/dist/components/deck/constants.d.ts +0 -10
- package/dist/components/deck/index.d.ts +0 -2
- package/dist/components/dialog/Dialog.vue.d.ts +8 -3
- package/dist/components/dialog/DialogClose.vue.d.ts +3 -1
- package/dist/components/dialog/DialogContent.vue.d.ts +28 -85
- package/dist/components/dialog/DialogDescription.vue.d.ts +5 -6
- package/dist/components/dialog/DialogTitle.vue.d.ts +5 -6
- package/dist/components/dialog/DialogTrigger.vue.d.ts +3 -1
- package/dist/components/dialog/ModalOverlay.vue.d.ts +45 -0
- package/dist/components/dialog/dialogStageContext.d.ts +7 -0
- package/dist/components/dialog/index.d.ts +8 -9
- package/dist/components/dialog/placement.css +1 -0
- package/dist/components/dialog/sheet-motion.d.ts +17 -0
- package/dist/components/dock/DockControl.vue.d.ts +13 -16
- package/dist/components/dock/DockCrossfade.vue.d.ts +4 -8
- package/dist/components/dock/DockLayer.vue.d.ts +2 -3
- package/dist/components/dock/DockLayerGroup.vue.d.ts +6 -6
- package/dist/components/dock/DockSeparator.vue.d.ts +8 -8
- package/dist/components/dock/GlassDock.vue.d.ts +1 -0
- package/dist/components/dock/composables/dockContext.d.ts +4 -14
- package/dist/components/dock/composables/dockCrossfadeContext.d.ts +6 -7
- package/dist/components/dock/composables/dockMorphMeasure.d.ts +6 -75
- package/dist/components/dock/composables/index.d.ts +1 -1
- package/dist/components/dock/composables/useDockClickIntegrity.d.ts +5 -1
- package/dist/components/dock/composables/useDockHold.d.ts +4 -5
- package/dist/components/dock/composables/useDockMorph.d.ts +26 -0
- package/dist/components/dock/composables/useDockOverflowFit.d.ts +7 -9
- package/dist/components/dock/composables/useDockSearch.d.ts +8 -8
- package/dist/components/dock/composables/useDockShellProps.d.ts +53 -43
- package/dist/components/dock/composables/useDockSpring.d.ts +7 -11
- package/dist/components/dock/composables/useDockState.d.ts +14 -5
- package/dist/components/dock/composables/useDockTouchGate.d.ts +14 -23
- package/dist/components/dock/constants.d.ts +5 -90
- package/dist/components/dock/index.d.ts +2 -6
- package/dist/components/dock/styles/adaptive-legibility.css +1 -0
- package/dist/components/dock/styles/controls/icon-button.css +1 -0
- package/dist/{styles/dock-controls → components/dock/styles/controls}/touch-floor.css +1 -1
- package/dist/components/dock/styles/controls.css +1 -0
- package/dist/components/dock/styles/crossfade.css +1 -0
- package/dist/{styles/dock → components/dock/styles}/density.css +1 -1
- package/dist/components/dock/styles/dock.css +1 -0
- package/dist/components/dock/styles/index.css +1 -0
- package/dist/components/dock/styles/layer-group.css +1 -0
- package/dist/components/dock/styles/layers.css +1 -0
- package/dist/components/dock/styles/morph.css +1 -0
- package/dist/components/dock/styles/overflow.css +1 -0
- package/dist/components/dock/styles/shape.css +1 -0
- package/dist/components/dock/styles/shell.css +1 -0
- package/dist/components/drawer/Drawer.vue.d.ts +20 -23
- package/dist/components/drawer/DrawerContent.vue.d.ts +15 -16
- package/dist/components/drawer/DrawerDescription.vue.d.ts +5 -6
- package/dist/components/drawer/DrawerOverlay.vue.d.ts +6 -6
- package/dist/components/drawer/DrawerTitle.vue.d.ts +5 -6
- package/dist/components/drawer/composables/drawerSnapContext.d.ts +9 -1
- package/dist/components/drawer/composables/useDrawerSnap.d.ts +3 -1
- package/dist/components/drawer/constants.d.ts +10 -28
- package/dist/components/drawer/index.d.ts +13 -15
- package/dist/components/drawer/styles.css +1 -0
- package/dist/components/dropdown-menu/DropdownMenu.vue.d.ts +43 -16
- package/dist/components/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +22 -13
- package/dist/components/dropdown-menu/DropdownMenuContent.vue.d.ts +28 -19
- package/dist/components/dropdown-menu/DropdownMenuGroup.vue.d.ts +6 -4
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts +21 -9
- package/dist/components/dropdown-menu/DropdownMenuLabel.vue.d.ts +9 -9
- package/dist/components/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +13 -6
- package/dist/components/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +18 -11
- package/dist/components/dropdown-menu/DropdownMenuSeparator.vue.d.ts +5 -6
- package/dist/components/dropdown-menu/DropdownMenuShortcut.vue.d.ts +7 -8
- package/dist/components/dropdown-menu/DropdownMenuSub.vue.d.ts +15 -7
- package/dist/components/dropdown-menu/DropdownMenuSubContent.vue.d.ts +24 -17
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +11 -9
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.d.ts +18 -5
- package/dist/components/dropdown-menu/index.d.ts +15 -16
- package/dist/components/dropdown-menu/styles.css +1 -0
- package/dist/components/dropdown-menu/useMenuTrigger.d.ts +2 -9
- package/dist/components/easing/EasingConfigurator.vue.d.ts +1 -1
- package/dist/components/easing/EasingPicker.vue.d.ts +2 -2
- package/dist/components/easing/composables/useEasingPicker.d.ts +8 -7
- package/dist/components/easing/constants.d.ts +3 -1
- package/dist/components/expandable-container/ExpandableContainer.vue.d.ts +1 -25
- package/dist/components/expandable-container/styles.css +1 -0
- package/dist/components/fading-scroll/FadingScroll.vue.d.ts +4 -0
- package/dist/components/fading-scroll/composables/useFadingScroll.d.ts +7 -3
- package/dist/components/fading-scroll/constants.d.ts +1 -2
- package/dist/components/fourier-field/FourierField.vue.d.ts +10 -6
- package/dist/components/fourier-field/composables/fourierFieldGLSetup.d.ts +1 -1
- package/dist/components/fourier-field/composables/fourierFieldWGPUSetup.d.ts +1 -1
- package/dist/components/fourier-field/composables/useFourierField.d.ts +6 -5
- package/dist/components/fourier-field/constants.d.ts +10 -10
- package/dist/components/fourier-field/index.d.ts +3 -3
- package/dist/components/fourier-field/presets.d.ts +3 -3
- package/dist/components/fourier-field/shaders/fourier-field.glsl.d.ts +2 -2
- package/dist/components/fourier-field/shaders/fourier-field.render.wgsl.d.ts +1 -1
- package/dist/components/handmark/HandMark.vue.d.ts +2 -2
- package/dist/components/handmark/brush.d.ts +1 -1
- package/dist/components/handmark/composables/useHandMark.d.ts +4 -4
- package/dist/components/handmark/constants.d.ts +10 -10
- package/dist/components/handmark/geometry.d.ts +9 -9
- package/dist/components/handmark/index.d.ts +11 -14
- package/dist/components/handmark/noise.d.ts +3 -3
- package/dist/components/handmark/types.d.ts +2 -2
- package/dist/components/header-ribbon/HeaderRibbon.vue.d.ts +3 -21
- package/dist/components/header-ribbon/styles.css +1 -0
- package/dist/components/header-ribbon/types.d.ts +5 -2
- package/dist/components/index.d.ts +0 -4
- package/dist/components/infinite-scroll/composables/types.d.ts +1 -1
- package/dist/components/infinite-scroll/index.d.ts +1 -0
- package/dist/components/input/Input.vue.d.ts +10 -35
- package/dist/components/input/index.d.ts +2 -1
- package/dist/components/input/types.d.ts +22 -0
- package/dist/components/instrument-chassis/InstrumentChassis.vue.d.ts +10 -84
- package/dist/components/instrument-chassis/index.d.ts +1 -2
- package/dist/components/instrument-chassis/styles.css +1 -0
- package/dist/components/instrument-chassis/types.d.ts +13 -0
- package/dist/components/label/Label.vue.d.ts +9 -14
- package/dist/components/label/index.d.ts +1 -1
- package/dist/components/labeled-field/LabeledField.vue.d.ts +11 -99
- package/dist/components/labeled-field/LabeledInput.vue.d.ts +5 -18
- package/dist/components/labeled-field/LabeledSelect.vue.d.ts +12 -18
- package/dist/components/labeled-field/LabeledSlider.vue.d.ts +12 -18
- package/dist/components/labeled-field/LabeledSwitch.vue.d.ts +14 -17
- package/dist/components/labeled-field/index.d.ts +1 -0
- package/dist/components/labeled-field/types.d.ts +50 -0
- package/dist/components/liquid-grid/LiquidGrid.vue.d.ts +4 -0
- package/dist/components/liquid-grid/composables/liquidGrid.d.ts +5 -5
- package/dist/components/liquid-grid/composables/useLiquidGrid.d.ts +2 -1
- package/dist/components/liquid-grid/constants.d.ts +6 -7
- package/dist/components/liquid-grid/shaders/liquid-grid.glsl.d.ts +1 -1
- package/dist/components/liquid-grid/shaders/liquid-grid.wgsl.d.ts +1 -1
- package/dist/components/metric/Metric.vue.d.ts +24 -0
- package/dist/components/metric/MetricCell.vue.d.ts +26 -0
- package/dist/components/metric/MetricRow.vue.d.ts +22 -0
- package/dist/components/metric/MetricStack.vue.d.ts +16 -0
- package/dist/components/metric/coalesce-metric.d.ts +7 -28
- package/dist/components/metric/index.d.ts +5 -0
- package/dist/components/metric/styles.css +1 -0
- package/dist/components/metric/types.d.ts +32 -0
- package/dist/components/number-field/NumberField.vue.d.ts +21 -9
- package/dist/components/number-field/NumberFieldContent.vue.d.ts +2 -2
- package/dist/components/number-field/NumberFieldDecrement.vue.d.ts +6 -6
- package/dist/components/number-field/NumberFieldIncrement.vue.d.ts +6 -6
- package/dist/components/number-field/NumberFieldInput.vue.d.ts +1 -6
- package/dist/components/number-field/context.d.ts +6 -0
- package/dist/components/number-field/index.d.ts +5 -5
- package/dist/components/number-field/styles.css +1 -0
- package/dist/components/pager-dots/PagerDots.vue.d.ts +1 -1
- package/dist/components/pager-dots/constants.d.ts +1 -2
- package/dist/components/pager-dots/index.d.ts +0 -2
- package/dist/components/paper-backdrop/PaperBackdrop.vue.d.ts +1 -14
- package/dist/components/paper-backdrop/index.d.ts +1 -1
- package/dist/components/popover/Popover.vue.d.ts +24 -36
- package/dist/components/popover/PopoverContent.vue.d.ts +23 -29
- package/dist/components/popover/PopoverTrigger.vue.d.ts +12 -7
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popover/popoverContext.d.ts +3 -4
- package/dist/components/progress/Progress.vue.d.ts +6 -49
- package/dist/components/progress/index.d.ts +1 -5
- package/dist/components/progress/types.d.ts +19 -0
- package/dist/components/pulse/Pulse.vue.d.ts +8 -47
- package/dist/components/pulse/index.d.ts +1 -0
- package/dist/components/radio-group/RadioGroup.vue.d.ts +27 -15
- package/dist/components/radio-group/RadioGroupItem.vue.d.ts +9 -6
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/styles.css +1 -0
- package/dist/components/scroll-progress-rim/styles.css +1 -0
- package/dist/components/search/FuzzySearch.vue.d.ts +4 -2
- package/dist/components/search/SearchBar.vue.d.ts +3 -3
- package/dist/components/search/searchVariants.d.ts +15 -17
- package/dist/components/select/Select.vue.d.ts +25 -14
- package/dist/components/select/SelectContent.vue.d.ts +26 -29
- package/dist/components/select/SelectGroup.vue.d.ts +7 -11
- package/dist/components/select/SelectItem.vue.d.ts +24 -13
- package/dist/components/select/SelectLabel.vue.d.ts +7 -11
- package/dist/components/select/SelectScrollDownButton.vue.d.ts +3 -4
- package/dist/components/select/SelectScrollUpButton.vue.d.ts +3 -4
- package/dist/components/select/SelectSeparator.vue.d.ts +5 -6
- package/dist/components/select/SelectTrigger.vue.d.ts +15 -41
- package/dist/components/select/SelectValue.vue.d.ts +13 -7
- package/dist/components/select/index.d.ts +16 -10
- package/dist/components/separator/Separator.vue.d.ts +11 -6
- package/dist/components/separator/index.d.ts +1 -1
- package/dist/components/skeleton/Skeleton.vue.d.ts +3 -31
- package/dist/components/slider/Slider.vue.d.ts +10 -35
- package/dist/components/slider/index.d.ts +1 -45
- package/dist/components/slider/types.d.ts +25 -0
- package/dist/components/sortable-list/SortableList.vue.d.ts +1 -1
- package/dist/components/sortable-list/composables/ghostRenderer.d.ts +1 -1
- package/dist/components/sortable-list/composables/touchGate.d.ts +1 -1
- package/dist/components/sortable-list/composables/transitionTiming.d.ts +1 -1
- package/dist/components/status-dot/StatusDot.vue.d.ts +7 -10
- package/dist/components/status-dot/index.d.ts +1 -0
- package/dist/components/surface/Surface.vue.d.ts +13 -21
- package/dist/components/surface/index.d.ts +2 -2
- package/dist/components/switch/Switch.vue.d.ts +20 -11
- package/dist/components/switch/index.d.ts +2 -1
- package/dist/components/switch/styles.css +1 -0
- package/dist/components/table/Table.vue.d.ts +5 -1
- package/dist/components/tabs/SegmentedTabs.vue.d.ts +31 -13
- package/dist/components/tabs/composables/useTabDragMorph.d.ts +6 -6
- package/dist/components/tabs/composables/useTabResponsive.d.ts +5 -6
- package/dist/components/tabs/composables/useTabRovingFocus.d.ts +16 -16
- package/dist/components/tabs/constants.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/styles/drag.css +1 -0
- package/dist/components/tabs/styles/segmented.css +1 -0
- package/dist/components/tags-input/TagsInput.vue.d.ts +28 -15
- package/dist/components/tags-input/TagsInputInput.vue.d.ts +8 -6
- package/dist/components/tags-input/TagsInputItem.vue.d.ts +9 -8
- package/dist/components/tags-input/TagsInputItemDelete.vue.d.ts +5 -6
- package/dist/components/tags-input/TagsInputItemText.vue.d.ts +5 -6
- package/dist/components/tags-input/context.d.ts +5 -0
- package/dist/components/tags-input/index.d.ts +5 -5
- package/dist/components/tags-input/styles.css +1 -0
- package/dist/components/textarea/Textarea.vue.d.ts +10 -55
- package/dist/components/textarea/index.d.ts +2 -1
- package/dist/components/textarea/types.d.ts +22 -0
- package/dist/components/timeline/ContinuousMarkers.vue.d.ts +2 -4
- package/dist/components/timeline/ContinuousRail.vue.d.ts +3 -6
- package/dist/components/timeline/ContinuousTimeline.vue.d.ts +11 -12
- package/dist/components/timeline/GlassTimeline.vue.d.ts +9 -10
- package/dist/components/timeline/ScrubberTimeline.vue.d.ts +4 -4
- package/dist/components/timeline/SegmentedTimeline.vue.d.ts +2 -3
- package/dist/components/timeline/geometry.d.ts +3 -4
- package/dist/components/timeline/types.d.ts +3 -3
- package/dist/components/toast/Toast.vue.d.ts +38 -80
- package/dist/components/toast/ToastAction.vue.d.ts +5 -5
- package/dist/components/toast/ToastClose.vue.d.ts +4 -5
- package/dist/components/toast/ToastDescription.vue.d.ts +4 -5
- package/dist/components/toast/ToastTitle.vue.d.ts +4 -5
- package/dist/components/toast/Toaster.vue.d.ts +1 -1
- package/dist/components/toast/index.d.ts +8 -9
- package/dist/components/toast/use-toast.d.ts +20 -163
- package/dist/components/toggle-group/ToggleGroup.vue.d.ts +44 -22
- package/dist/components/toggle-group/ToggleGroupItem.vue.d.ts +11 -9
- package/dist/components/toggle-group/index.d.ts +3 -2
- package/dist/components/toggle-group/styles.css +1 -0
- package/dist/components/toggle-group/toggleGroupContext.d.ts +4 -15
- package/dist/components/tooltip/Tooltip.vue.d.ts +20 -7
- package/dist/components/tooltip/TooltipContent.vue.d.ts +20 -12
- package/dist/components/tooltip/TooltipProvider.vue.d.ts +12 -5
- package/dist/components/tooltip/TooltipTrigger.vue.d.ts +12 -5
- package/dist/components/tooltip/index.d.ts +4 -4
- package/dist/components/typewriter/TypewriterText.vue.d.ts +1 -4
- package/dist/components/typewriter/composables/useTypewriter.d.ts +1 -1
- package/dist/components/typewriter/utils/graphemes.d.ts +1 -0
- package/dist/components/typewriter/utils/timing.d.ts +0 -2
- package/dist/components/watercolor-dot/WatercolorDot.vue.d.ts +5 -18
- package/dist/components/watercolor-dot/useWatercolorBlob.d.ts +1 -4
- package/dist/composables/color/accent-tone-solve.d.ts +2 -5
- package/dist/composables/color/index.d.ts +31 -38
- package/dist/composables/color/useAccentTone.d.ts +0 -3
- package/dist/composables/color/value.d.ts +21 -0
- package/dist/composables/context/createContext.d.ts +2 -2
- package/dist/composables/dark/index.d.ts +1 -1
- package/dist/composables/dark/useGlobalDark.d.ts +7 -6
- package/dist/composables/dom/useBreakpoint.d.ts +2 -2
- package/dist/composables/dom/useClipboard.d.ts +28 -52
- package/dist/composables/dom/useDocumentVisibility.d.ts +3 -1
- package/dist/composables/dom/useIdleReady.d.ts +5 -6
- package/dist/composables/dom/useTokenColor.d.ts +2 -2
- package/dist/composables/dom/useUserInvalidAria.d.ts +2 -3
- package/dist/composables/dom/useViewportReady.d.ts +4 -4
- package/dist/composables/glass/backdropLuminanceSample.d.ts +7 -6
- package/dist/composables/glass/canvas2d/useCanvas2D.d.ts +7 -1
- package/dist/composables/glass/textureUpload.d.ts +8 -10
- package/dist/composables/glass/useGlassBackdropLuminance.d.ts +42 -19
- package/dist/composables/glass/useSpecularPointer.d.ts +6 -6
- package/dist/composables/glass/useSpecularTracking.d.ts +12 -15
- package/dist/composables/glass/wave/waveField.d.ts +2 -2
- package/dist/composables/glass/wave/waveField.glsl.d.ts +1 -1
- package/dist/composables/glass/wave/waveField.wgsl.d.ts +1 -1
- package/dist/composables/glass/webgl/backingSize.d.ts +5 -8
- package/dist/composables/glass/webgl/compile.d.ts +1 -1
- package/dist/composables/glass/webgl/createCanvasLifecycle.d.ts +20 -20
- package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +16 -28
- package/dist/composables/glass/webgl/visibility.d.ts +3 -4
- package/dist/composables/glass/webgpu/rendererStatus.d.ts +13 -0
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +13 -10
- package/dist/composables/glass/webgpu/useWebGPUCanvas.d.ts +1 -1
- package/dist/composables/glass/webgpu/webgpuCanvasTypes.d.ts +14 -10
- package/dist/composables/glass/webgpu/webgpuDevice.d.ts +15 -16
- package/dist/composables/motion/core/asElement.d.ts +2 -0
- package/dist/composables/motion/{constants.d.ts → core/constants.d.ts} +2 -3
- package/dist/composables/motion/core/index.d.ts +20 -23
- package/dist/composables/motion/core/useReducedMotion.d.ts +5 -0
- package/dist/composables/motion/core/useViewTransition.d.ts +44 -0
- package/dist/composables/motion/index.d.ts +14 -16
- package/dist/composables/motion/{useDockCtaReceive.d.ts → morph/useDockCtaReceive.d.ts} +57 -3
- package/dist/composables/motion/{useDragMorph.d.ts → morph/useDragMorph.d.ts} +7 -7
- package/dist/composables/motion/morph/useElementMorph.d.ts +50 -0
- package/dist/composables/motion/{useLeadTrail.d.ts → morph/useLeadTrail.d.ts} +6 -6
- package/dist/composables/motion/{useSelectionGroup.d.ts → morph/useSelectionGroup.d.ts} +7 -5
- package/dist/composables/motion/{useSelectionIndicator.d.ts → morph/useSelectionIndicator.d.ts} +9 -16
- package/dist/composables/motion/{useAnimatedNumber.d.ts → number/useAnimatedNumber.d.ts} +1 -6
- package/dist/composables/motion/{useCountup.d.ts → number/useCountup.d.ts} +1 -6
- package/dist/composables/motion/{useNumericTransition.d.ts → number/useNumericTransition.d.ts} +4 -2
- package/dist/composables/motion/{pointerFieldMappings.d.ts → pointer/pointerFieldMappings.d.ts} +7 -10
- package/dist/composables/motion/{usePointerVelocityField.d.ts → pointer/usePointerVelocityField.d.ts} +1 -1
- package/dist/composables/motion/{bloomUpField.d.ts → reveal/bloomUpField.d.ts} +1 -1
- package/dist/composables/motion/reveal/useBloomUp.d.ts +33 -0
- package/dist/composables/motion/{useLiquidReveal.d.ts → reveal/useLiquidReveal.d.ts} +5 -5
- package/dist/composables/motion/{useStagger.d.ts → reveal/useStagger.d.ts} +3 -3
- package/dist/composables/motion/reveal/useStaggerReveal.d.ts +28 -0
- package/dist/composables/motion/{useTextHighlight.d.ts → reveal/useTextHighlight.d.ts} +2 -1
- package/dist/composables/motion/{useScrollChrome.d.ts → scroll/useScrollChrome.d.ts} +2 -2
- package/dist/composables/motion/{useScrollProgress.d.ts → scroll/useScrollProgress.d.ts} +12 -2
- package/dist/composables/motion/{springPresets.d.ts → spring/springPresets.d.ts} +8 -7
- package/dist/composables/motion/spring/springProjection.d.ts +19 -0
- package/dist/composables/motion/{useLiquidFlex.d.ts → spring/useLiquidFlex.d.ts} +11 -12
- package/dist/composables/motion/{useLiquidPress.d.ts → spring/useLiquidPress.d.ts} +15 -7
- package/dist/composables/motion/{useSpring.d.ts → spring/useSpring.d.ts} +5 -2
- package/dist/composables/motion/{useSpringMount.d.ts → spring/useSpringMount.d.ts} +8 -1
- package/dist/composables/sidebar/types.d.ts +3 -3
- package/dist/configurator-M5OaIlJd.js +311 -0
- package/dist/configurator.js +2 -3
- package/dist/{constants-D8lSMkOz.js → constants-nBz23tJE.js} +1 -1
- package/dist/constellation.js +230 -565
- package/dist/createCanvasLifecycle-DbXRwjU_.js +214 -0
- package/dist/dark-mode-toggle.d.ts +1 -0
- package/dist/dark-mode-toggle.js +43 -0
- package/dist/dark-z_P5QwqI.js +70 -0
- package/dist/dark.d.ts +1 -2
- package/dist/dark.js +2 -20
- package/dist/data-table-BygKg6ZA.js +491 -0
- package/dist/data-table.js +2 -2
- package/dist/deck.js +12 -23
- package/dist/dialog-TNRDkcE4.js +385 -0
- package/dist/dialog.js +2 -3
- package/dist/dock.js +624 -908
- package/dist/dockContext-BUTlGRNJ.js +13 -0
- package/dist/dom.js +134 -7
- package/dist/drawer.js +291 -193
- package/dist/dropdown-menu-BlbnvMaZ.js +507 -0
- package/dist/dropdown-menu.js +3 -2
- package/dist/easing.d.ts +0 -9
- package/dist/easing.js +385 -222
- package/dist/expandable-container.js +107 -85
- package/dist/fading-scroll-DhxXIhm2.js +96 -0
- package/dist/fading-scroll.js +1 -1
- package/dist/field-control.css_vue_type_style_index_0_src_true_lang-CeLay9Tk.js +21 -0
- package/dist/floating-dB5TD88k.js +7 -0
- package/dist/{flow.glsl-CVqPSj8_.js → flow.wgsl-Cd2GUkPx.js} +2 -2
- package/dist/fonts/README.md +14 -18
- package/dist/forms.js +268 -204
- package/dist/fourier-field.js +298 -288
- package/dist/fourier-math.d.ts +0 -6
- package/dist/fourier-math.js +112 -2
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +512 -437
- package/dist/handmark.d.ts +0 -2
- package/dist/handmark.js +84 -84
- package/dist/header-ribbon.js +37 -57
- package/dist/index.d.ts +9 -19
- package/dist/infinite-scroll.d.ts +0 -1
- package/dist/infinite-scroll.js +39 -34
- package/dist/instrument-chassis.js +54 -2
- package/dist/keyboard.js +104 -2
- package/dist/label-DnMqH7jr.js +55 -0
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +295 -192
- package/dist/liquid-grid.js +199 -198
- package/dist/menuRowClass-Nh7CtMON.js +12 -0
- package/dist/metric.d.ts +1 -0
- package/dist/metric.js +192 -0
- package/dist/motion-core.js +73 -166
- package/dist/motion.js +111 -167
- package/dist/number-field-Boe09SvX.js +154 -0
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +2 -2
- package/dist/paper-backdrop.js +23 -2
- package/dist/{pointerFieldMappings-4VtmkOWv.js → pointerFieldMappings-DP5tla5z.js} +4 -7
- package/dist/popover-BQGYXZyO.js +244 -0
- package/dist/popover.js +1 -1
- package/dist/{presets-B07HzyKd.js → presets-5myqNv59.js} +1 -1
- package/dist/primitive-B2t2jdqM.js +11 -0
- package/dist/progress-DClbhRAT.js +88 -0
- package/dist/progress.js +2 -2
- package/dist/pulse.js +29 -41
- package/dist/reactive.js +19 -3
- package/dist/rendererStatus-BxUlBLVy.js +40 -0
- package/dist/resolveCanvasColor-DS_6DBxA.js +82 -0
- package/dist/resolveSurfaceClass-DCZ4PZcy.js +6 -0
- package/dist/scroll-progress-rim.js +1 -1
- package/dist/{scrollReader-DzYqPQ6V.js → scrollReader-Brf5cQNo.js} +1 -1
- package/dist/search.js +287 -218
- package/dist/select-BcBAyLXA.js +336 -0
- package/dist/select.js +2 -4
- package/dist/selection-DqIULxRG.js +6 -0
- package/dist/separator-CgZInrX-.js +75 -0
- package/dist/separator.js +1 -1
- package/dist/sidebar.js +53 -42
- package/dist/slider-DzqeQmMu.js +162 -0
- package/dist/slider.js +2 -2
- package/dist/sortable-list.js +51 -50
- package/dist/springPresets-rCii5KqX.js +52 -0
- package/dist/status-dot.js +26 -43
- package/dist/styles/accessibility.css +1 -0
- package/dist/styles/animations.css +1 -1
- package/dist/styles/components.css +1 -1
- package/dist/styles/glass/a11y-fallback.css +1 -1
- package/dist/styles/glass/accent-tone.css +1 -1
- package/dist/styles/glass/control-surfaces.css +1 -1
- package/dist/styles/glass/defined.css +1 -1
- package/dist/styles/glass/glass-atom.css +1 -1
- package/dist/styles/glass/glass-capsule.css +1 -1
- package/dist/styles/glass/glass-chip.css +1 -1
- package/dist/styles/glass/ladder.css +1 -1
- package/dist/styles/glass/liquid-fill.css +1 -1
- package/dist/styles/glass/material-roles.css +1 -0
- package/dist/styles/glass/material.css +1 -1
- package/dist/styles/glass/reveal.css +1 -1
- package/dist/styles/glass/squircle.css +1 -1
- package/dist/styles/glass/surface-axis.css +1 -1
- package/dist/styles/glass/surfaces-pager.css +1 -1
- package/dist/styles/glass/surfaces.css +1 -1
- package/dist/styles/glass-refract.css +1 -1
- package/dist/styles/glass.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/paper.css +1 -1
- package/dist/styles/scroll-driven.css +1 -1
- package/dist/styles/theme/bridges.css +1 -1
- package/dist/styles/theme/radius.css +1 -1
- package/dist/styles/tokens/color-radius.css +1 -1
- package/dist/styles/tokens/dark-arm.css +1 -1
- package/dist/styles/tokens/glass-deep.css +1 -1
- package/dist/styles/tokens/glass-fx.css +1 -1
- package/dist/styles/tokens/glass.css +1 -1
- package/dist/styles/tokens/light-dark.css +1 -1
- package/dist/styles/tokens/manifest.d.ts +14 -0
- package/dist/styles/tokens/manifest.ts +56 -0
- package/dist/styles/tokens/motion-registers.css +1 -1
- package/dist/styles/tokens/offsets.css +1 -1
- package/dist/styles/tokens/property-regs-specular.css +1 -1
- package/dist/styles/tokens/property-regs.css +1 -1
- package/dist/styles/tokens/scale-paper.css +1 -1
- package/dist/styles/tokens/scheme-motion.css +1 -1
- package/dist/styles/tokens/scheme-spring.css +1 -1
- package/dist/styles/tokens/scroll-tokens.css +1 -1
- package/dist/styles/tokens/shadow.css +1 -1
- package/dist/styles/tokens/sizing-config.css +1 -1
- package/dist/styles/tokens/sizing.css +1 -1
- package/dist/styles/tokens.d.ts +48 -0
- package/dist/styles/tokens.ts +54 -0
- package/dist/styles/transitions.css +1 -1
- package/dist/styles/typography/scale.css +1 -1
- package/dist/styles/typography/semantic.css +1 -1
- package/dist/styles/typography/utilities.css +1 -1
- package/dist/styles/utilities/a11y-overrides.css +1 -1
- package/dist/styles/utilities/base-misc.css +1 -1
- package/dist/styles/utilities/base.css +1 -1
- package/dist/styles/utilities/btn.css +1 -1
- package/dist/styles/utilities/components.css +1 -1
- package/dist/styles/utilities/metal.css +1 -1
- package/dist/styles/utilities/responsive.css +1 -0
- package/dist/styles/utilities.css +1 -1
- package/dist/styles/view-transition.css +1 -1
- package/dist/{supportsCssTimeline-Ie4xJFbD.js → supportsCssTimeline-C2zyWpl8.js} +1 -1
- package/dist/surface.js +2 -3
- package/dist/switch-DZjQuFLa.js +54 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +146 -168
- package/dist/timeline.js +86 -87
- package/dist/toast-CH5mnsYT.js +267 -0
- package/dist/toast.js +1 -1
- package/dist/toggle-group-O6jBo7AE.js +150 -0
- package/dist/toggle-group.js +1 -1
- package/dist/tokens.d.ts +1 -53
- package/dist/tokens.js +96 -5
- package/dist/tooltip-Drx5qnw_.js +148 -0
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +233 -219
- package/dist/{useAccentTone-D25DxviG.js → useAccentTone-DyInfHXE.js} +2 -2
- package/dist/{useAnimatedNumber-2XC4aRB6.js → useAnimatedNumber-WPtMz0AN.js} +2 -2
- package/dist/useClipboard-D36OTaeT.js +53 -0
- package/dist/useDockCtaReceive-DkrOTM0q.js +146 -0
- package/dist/useDocumentVisibility-Dh_TGXsU.js +21 -0
- package/dist/useDragMorph-BogSV_nv.js +293 -0
- package/dist/{useIntersectionPause-Cmt5Tnv9.js → useIntersectionPause-B5mAU6XY.js} +15 -15
- package/dist/useLeadTrail-AW1-zZcd.js +74 -0
- package/dist/{useLiquidFlex-Ch4exNvN.js → useLiquidFlex-TJZmRqyY.js} +1 -1
- package/dist/useLiquidPress-BOxuDkKa.js +101 -0
- package/dist/useMotionAxis-D-rtIhca.js +19 -0
- package/dist/usePointerVelocityField-DsIf7yyq.js +121 -0
- package/dist/useRAFLoop-B3YlWK4M.js +98 -0
- package/dist/useReducedMotion-vCXA_vyM.js +27 -0
- package/dist/useRoutePointer-B8itM7Ka.js +53 -0
- package/dist/useScrollProgress-CSFYXIZT.js +43 -0
- package/dist/useScrollTrigger-BDdqptlc.js +87 -0
- package/dist/useSelectionGroup-B5XplBbo.js +132 -0
- package/dist/{useSpring-BBSKFx_0.js → useSpring-9u2_shxV.js} +2 -2
- package/dist/useSpringMount-uQ8QL9Ff.js +74 -0
- package/dist/useTabRovingFocus-YnWh-Ytr.js +169 -0
- package/dist/useTextHighlight-mfwNIC1f.js +112 -0
- package/dist/{useTouchGate-BlegwvwL.js → useTouchGate-B4mzQcHJ.js} +1 -1
- package/dist/vSpecular-DMJo8pfD.js +68 -0
- package/dist/value-DMhh2R94.js +33 -0
- package/dist/valueDomain-SbVzoHMH.js +13 -0
- package/dist/watercolor-dot.js +77 -101
- package/package.json +166 -242
- package/dist/CardAction-2uUvjMQK.js +0 -285
- package/dist/CollapsibleContent-DiHcB_HH.js +0 -63
- package/dist/CommandShortcut-fmdbsEJL.js +0 -302
- package/dist/ConfiguratorRow-BV6zPjTM.js +0 -151
- package/dist/DataTable-Bxya8nBn.js +0 -518
- package/dist/DialogContent-Bl4v10AC.js +0 -192
- package/dist/DialogFooter-C0v4Hz2F.js +0 -168
- package/dist/FadingScroll-BSRLqQCx.js +0 -76
- package/dist/FocusScope-BzKwhsBn.js +0 -23
- package/dist/IconChip-CwLmBJ_K.js +0 -57
- package/dist/IconTooltip-D9sbK-Mk.js +0 -25
- package/dist/Input-DKf-XwUM.js +0 -57
- package/dist/InstrumentChassis-Dss5Tjcm.js +0 -65
- package/dist/Label-C84TaQiw.js +0 -36
- package/dist/Notification-DQv2cOh9.js +0 -43
- package/dist/NumberFieldContent-BkE7xPS9.js +0 -140
- package/dist/PagerDots-BP6jh7z4.js +0 -279
- package/dist/PaperBackdrop-BYwE8_kg.js +0 -31
- package/dist/PopoverContent-DOtszFWK.js +0 -251
- package/dist/Progress-uWLyXE7J.js +0 -308
- package/dist/SelectGroup-BuEptUsa.js +0 -31
- package/dist/SelectScrollDownButton-CDtwaWkZ.js +0 -261
- package/dist/SelectSeparator-4QGephvr.js +0 -49
- package/dist/Separator-DqJ6PfOd.js +0 -44
- package/dist/Surface-BWRfwyn8.js +0 -59
- package/dist/Switch-BPBfhMU3.js +0 -49
- package/dist/Toaster-C_-WeU9W.js +0 -281
- package/dist/ToggleGroupItem-DNWx2aSW.js +0 -175
- package/dist/TooltipProvider-GtfYdSVf.js +0 -110
- package/dist/accent-tone-solve-CBw3L0cy.js +0 -20
- package/dist/badge-C0C-rTBu.js +0 -80
- package/dist/button-BXzhydVB.js +0 -187
- package/dist/coalesce-metric-B8o7zT9u.js +0 -13
- package/dist/color-Bp5jmv4Z.js +0 -86
- package/dist/color-swatch.d.ts +0 -1
- package/dist/color-swatch.js +0 -47
- package/dist/components/_shared/ModalOverlay.vue.d.ts +0 -90
- package/dist/components/_shared/menuItemVariants.d.ts +0 -51
- package/dist/components/_shared/useControlSize.d.ts +0 -46
- package/dist/components/_shared/useStalePropWarning.d.ts +0 -27
- package/dist/components/_shared/useSurfaceAxis.d.ts +0 -64
- package/dist/components/card/ScrollCard.vue.d.ts +0 -33
- package/dist/components/card/ScrollCardHeader.vue.d.ts +0 -17
- package/dist/components/carousel/CarouselNext.vue.d.ts +0 -21
- package/dist/components/carousel/CarouselPrevious.vue.d.ts +0 -21
- package/dist/components/carousel/GlassCarouselPager.vue.d.ts +0 -50
- package/dist/components/color-swatch/ColorSwatch.vue.d.ts +0 -22
- package/dist/components/color-swatch/index.d.ts +0 -1
- package/dist/components/combobox/ComboboxSeparator.vue.d.ts +0 -18
- package/dist/components/combobox/ComboboxViewport.vue.d.ts +0 -18
- package/dist/components/constellation/composables/constellationGLSetup.d.ts +0 -10
- package/dist/components/constellation/composables/constellationWGPUSetup.d.ts +0 -19
- package/dist/components/constellation/composables/uniformBridgeWGPU.d.ts +0 -66
- package/dist/components/constellation/shaders/constellation-lines.glsl.d.ts +0 -2
- package/dist/components/constellation/shaders/constellation-lines.wgsl.d.ts +0 -1
- package/dist/components/constellation/shaders/constellation-points.glsl.d.ts +0 -2
- package/dist/components/constellation/shaders/constellation-points.wgsl.d.ts +0 -1
- package/dist/components/controls/DarkModeToggle.vue.d.ts +0 -34
- package/dist/components/controls/index.d.ts +0 -1
- package/dist/components/data-table/DataTablePagination.vue.d.ts +0 -13
- package/dist/components/deck/composables/useDeckSpring.d.ts +0 -22
- package/dist/components/dialog/DialogScrollContent.vue.d.ts +0 -33
- package/dist/components/dock/DockSection.vue.d.ts +0 -69
- package/dist/components/dock/DockStack.vue.d.ts +0 -73
- package/dist/components/dock/composables/dockMorphContext.d.ts +0 -89
- package/dist/components/dock/composables/useDockFisheye.d.ts +0 -24
- package/dist/components/dock/composables/useDockPopover.d.ts +0 -68
- package/dist/components/focus-scope/FocusScope.vue.d.ts +0 -20
- package/dist/components/focus-scope/index.d.ts +0 -2
- package/dist/components/goo-filter/GooFilter.vue.d.ts +0 -22
- package/dist/components/goo-filter/index.d.ts +0 -1
- package/dist/components/icon-chip/IconChip.vue.d.ts +0 -4
- package/dist/components/icon-chip/index.d.ts +0 -2
- package/dist/components/icon-chip/types.d.ts +0 -92
- package/dist/components/icon-tooltip/IconTooltip.vue.d.ts +0 -16
- package/dist/components/icon-tooltip/index.d.ts +0 -1
- package/dist/components/instrument-chassis/ChassisDivider.vue.d.ts +0 -30
- package/dist/components/metric-badge/MetricBadge.vue.d.ts +0 -40
- package/dist/components/metric-badge/index.d.ts +0 -2
- package/dist/components/metric-cell/MetricCell.vue.d.ts +0 -108
- package/dist/components/metric-cell/index.d.ts +0 -2
- package/dist/components/metric-stack/MetricRow.vue.d.ts +0 -120
- package/dist/components/metric-stack/MetricStack.vue.d.ts +0 -92
- package/dist/components/metric-stack/index.d.ts +0 -4
- package/dist/components/notification/Notification.vue.d.ts +0 -16
- package/dist/components/notification/index.d.ts +0 -1
- package/dist/components/progress/ProgressDefault.vue.d.ts +0 -25
- package/dist/components/progress/ProgressGradient.vue.d.ts +0 -25
- package/dist/components/progress/ProgressLiquid.vue.d.ts +0 -21
- package/dist/components/progress/ProgressSectioned.vue.d.ts +0 -47
- package/dist/components/progress/useProgressGeometry.d.ts +0 -60
- package/dist/components/section/Section.vue.d.ts +0 -73
- package/dist/components/section/index.d.ts +0 -1
- package/dist/components/spa-view/SpaView.vue.d.ts +0 -50
- package/dist/components/spa-view/index.d.ts +0 -2
- package/dist/components/split-chars/SplitChars.vue.d.ts +0 -53
- package/dist/components/split-chars/index.d.ts +0 -1
- package/dist/components/stacked-icons/StackedIconGroup.vue.d.ts +0 -30
- package/dist/components/stacked-icons/index.d.ts +0 -2
- package/dist/components/stacked-icons/types.d.ts +0 -19
- package/dist/components/tabs/composables/useEyeglassLive.d.ts +0 -17
- package/dist/components/toggle/Toggle.vue.d.ts +0 -29
- package/dist/components/toggle/index.d.ts +0 -26
- package/dist/composables/glass/webgl/shaders/glass-refract.glsl.d.ts +0 -36
- package/dist/composables/motion/curves.d.ts +0 -48
- package/dist/composables/motion/gooBarbellGeometry.d.ts +0 -79
- package/dist/composables/motion/morphSignatures.d.ts +0 -88
- package/dist/composables/motion/suite.d.ts +0 -2
- package/dist/composables/motion/useBloomUp.d.ts +0 -97
- package/dist/composables/motion/useCharStagger.d.ts +0 -44
- package/dist/composables/motion/useElementMorph.d.ts +0 -99
- package/dist/composables/motion/useGooMorph.d.ts +0 -72
- package/dist/composables/motion/usePrioritizedTask.d.ts +0 -41
- package/dist/composables/motion/useStaggerReveal.d.ts +0 -52
- package/dist/composables/motion/useViewTransition.d.ts +0 -81
- package/dist/composables/virtual/index.d.ts +0 -4
- package/dist/composables/virtual/useVirtualSectionWindow.d.ts +0 -72
- package/dist/composables/virtual/useWindowedStore.d.ts +0 -43
- package/dist/composables/virtual/virtualSectionLayout.d.ts +0 -103
- package/dist/controls.d.ts +0 -1
- package/dist/controls.js +0 -91
- package/dist/createCanvasLifecycle-DlrcvWbb.js +0 -209
- package/dist/dockContext-d-WpJN2Z.js +0 -13
- package/dist/dropdown-menu-DaGlVdp9.js +0 -421
- package/dist/focus-scope.d.ts +0 -1
- package/dist/focus-scope.js +0 -2
- package/dist/icon-chip.d.ts +0 -1
- package/dist/icon-chip.js +0 -2
- package/dist/icon-tooltip.d.ts +0 -1
- package/dist/icon-tooltip.js +0 -2
- package/dist/math-CIEcwsYi.js +0 -112
- package/dist/menuItemVariants-DbO-Fr74.js +0 -36
- package/dist/metric-badge.d.ts +0 -1
- package/dist/metric-badge.js +0 -79
- package/dist/metric-cell.d.ts +0 -1
- package/dist/metric-cell.js +0 -61
- package/dist/metric-stack.d.ts +0 -1
- package/dist/metric-stack.js +0 -113
- package/dist/motion-curves.d.ts +0 -21
- package/dist/motion-curves.js +0 -146
- package/dist/notification.d.ts +0 -1
- package/dist/notification.js +0 -2
- package/dist/resolveCanvasColor-B3L-akX0.js +0 -93
- package/dist/slider-Cxuj_W_H.js +0 -151
- package/dist/spa-view.d.ts +0 -1
- package/dist/spa-view.js +0 -46
- package/dist/springPresets-h5VKJQqG.js +0 -58
- package/dist/stacked-icons.d.ts +0 -1
- package/dist/stacked-icons.js +0 -98
- package/dist/styles/card-scroll.css +0 -1
- package/dist/styles/cards.css +0 -1
- package/dist/styles/completion-seal.css +0 -1
- package/dist/styles/configurator.css +0 -1
- package/dist/styles/dialog-placement.css +0 -1
- package/dist/styles/dock/adaptive-legibility.css +0 -1
- package/dist/styles/dock/crossfade.css +0 -1
- package/dist/styles/dock/dock.css +0 -1
- package/dist/styles/dock/fisheye.css +0 -1
- package/dist/styles/dock/layer-group.css +0 -1
- package/dist/styles/dock/layers.css +0 -1
- package/dist/styles/dock/morph.css +0 -1
- package/dist/styles/dock/overflow.css +0 -1
- package/dist/styles/dock/popover.css +0 -1
- package/dist/styles/dock/section.css +0 -1
- package/dist/styles/dock/shape.css +0 -1
- package/dist/styles/dock/shell.css +0 -1
- package/dist/styles/dock-controls/dark-mode-toggle.css +0 -1
- package/dist/styles/dock-controls/icon-button.css +0 -1
- package/dist/styles/dock-controls.css +0 -1
- package/dist/styles/dock.css +0 -1
- package/dist/styles/drawer.css +0 -1
- package/dist/styles/glass/progress-rail.css +0 -1
- package/dist/styles/icon-chip.css +0 -1
- package/dist/styles/instrument-chassis.css +0 -1
- package/dist/styles/menu.css +0 -1
- package/dist/styles/scroll-progress-rim.css +0 -1
- package/dist/styles/segmented-tabs.css +0 -1
- package/dist/styles/select.css +0 -1
- package/dist/styles/tabs/segmented-tabs-drag.css +0 -1
- package/dist/styles/utilities/animate.css +0 -0
- package/dist/useConfiguratorState-Dq35N_7t.js +0 -167
- package/dist/useControlSize-DJwe-7ZQ.js +0 -9
- package/dist/useDockCtaReceive-BgMmeINo.js +0 -161
- package/dist/useDocumentVisibility-CpJGUgcJ.js +0 -17
- package/dist/useDragMorph-65ihHePq.js +0 -93
- package/dist/useGlobalDark-DjKMEQE2.js +0 -53
- package/dist/useGooMorph-CU1pwuC6.js +0 -268
- package/dist/useGpuSubstrate-DcY584kE.js +0 -347
- package/dist/useInterval-ZATRi-1T.js +0 -18
- package/dist/useKeyboardShortcuts-ynVmNFo3.js +0 -104
- package/dist/useLeadTrail-DOH4XkL1.js +0 -74
- package/dist/useLiquidPress-BXNHydZh.js +0 -40
- package/dist/useMotionAxis-DCCXMC-i.js +0 -20
- package/dist/usePointerVelocityField-CwXyeW0Z.js +0 -122
- package/dist/useRAFLoop-CvOo_kgb.js +0 -109
- package/dist/useRoutePointer-DL7I0gY4.js +0 -52
- package/dist/useScrollProgress-C-yImzhU.js +0 -35
- package/dist/useSelectionGroup-Btpf24aY.js +0 -215
- package/dist/useSpringMount-CNvvgGiC.js +0 -71
- package/dist/useSpringPress-BypV_KO-.js +0 -36
- package/dist/useSurfaceAxis-DudiZVOR.js +0 -10
- package/dist/useTabRovingFocus-CG1H1k1J.js +0 -143
- package/dist/useTextHighlight-C46Le9u_.js +0 -72
- package/dist/useViewportReady-c0isoKL8.js +0 -191
- package/dist/vReveal-DUmiEkX_.js +0 -10
- package/dist/vSpecular-DlYN0UZy.js +0 -68
- package/src/fonts/README.md +0 -124
- package/src/fonts/fira-code/OFL.txt +0 -93
- package/src/fonts/fira-code/fira-code-latin-ext.woff2 +0 -0
- package/src/fonts/fira-code/fira-code-latin.woff2 +0 -0
- package/src/fonts/plus-jakarta-sans/OFL.txt +0 -93
- package/src/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-ext.woff2 +0 -0
- package/src/fonts/plus-jakarta-sans/plus-jakarta-sans-latin.woff2 +0 -0
- package/src/styles/animations.css +0 -468
- package/src/styles/card-scroll.css +0 -189
- package/src/styles/cards.css +0 -485
- package/src/styles/completion-seal.css +0 -205
- package/src/styles/configurator.css +0 -359
- package/src/styles/dialog-placement.css +0 -68
- package/src/styles/dock/adaptive-legibility.css +0 -119
- package/src/styles/dock/crossfade.css +0 -139
- package/src/styles/dock/cta-seat.css +0 -87
- package/src/styles/dock/density.css +0 -458
- package/src/styles/dock/dock.css +0 -199
- package/src/styles/dock/fisheye.css +0 -81
- package/src/styles/dock/layer-group.css +0 -329
- package/src/styles/dock/layers.css +0 -438
- package/src/styles/dock/morph.css +0 -455
- package/src/styles/dock/overflow.css +0 -332
- package/src/styles/dock/popover.css +0 -249
- package/src/styles/dock/search.css +0 -68
- package/src/styles/dock/section.css +0 -59
- package/src/styles/dock/shape.css +0 -188
- package/src/styles/dock/shell-regions.css +0 -73
- package/src/styles/dock/shell.css +0 -500
- package/src/styles/dock-controls/dark-mode-toggle.css +0 -123
- package/src/styles/dock-controls/icon-button.css +0 -221
- package/src/styles/dock-controls/tab-button.css +0 -143
- package/src/styles/dock-controls/touch-floor.css +0 -119
- package/src/styles/dock-controls/triggers.css +0 -157
- package/src/styles/dock-controls.css +0 -92
- package/src/styles/dock.css +0 -219
- package/src/styles/draw-in.css +0 -89
- package/src/styles/drawer.css +0 -434
- package/src/styles/feedback-tone.css +0 -104
- package/src/styles/fonts.css +0 -143
- package/src/styles/glass/a11y-fallback.css +0 -188
- package/src/styles/glass/accent-tone.css +0 -66
- package/src/styles/glass/control-surfaces.css +0 -171
- package/src/styles/glass/deep.css +0 -114
- package/src/styles/glass/defined.css +0 -88
- package/src/styles/glass/glass-atom.css +0 -247
- package/src/styles/glass/glass-capsule.css +0 -175
- package/src/styles/glass/glass-chip.css +0 -211
- package/src/styles/glass/grain-overlay.css +0 -79
- package/src/styles/glass/ladder-undershadow.css +0 -61
- package/src/styles/glass/ladder.css +0 -452
- package/src/styles/glass/liquid-enter.css +0 -240
- package/src/styles/glass/liquid-fill.css +0 -65
- package/src/styles/glass/material.css +0 -494
- package/src/styles/glass/progress-rail.css +0 -78
- package/src/styles/glass/reveal.css +0 -333
- package/src/styles/glass/rim.css +0 -122
- package/src/styles/glass/squircle.css +0 -58
- package/src/styles/glass/surface-axis.css +0 -136
- package/src/styles/glass/surfaces-pager.css +0 -79
- package/src/styles/glass/surfaces.css +0 -434
- package/src/styles/glass-refract.css +0 -112
- package/src/styles/glass-specular-track.css +0 -74
- package/src/styles/glass.css +0 -110
- package/src/styles/icon-chip.css +0 -256
- package/src/styles/index.css +0 -280
- package/src/styles/instrument-chassis.css +0 -449
- package/src/styles/menu.css +0 -187
- package/src/styles/paper.css +0 -187
- package/src/styles/scroll-choreography.css +0 -294
- package/src/styles/scroll-chrome.css +0 -123
- package/src/styles/scroll-driven.css +0 -123
- package/src/styles/scroll-progress-rim.css +0 -87
- package/src/styles/segmented-tabs.css +0 -424
- package/src/styles/select.css +0 -201
- package/src/styles/tabs/segmented-tabs-drag.css +0 -200
- package/src/styles/theme/bridges.css +0 -386
- package/src/styles/theme/dark.css +0 -7
- package/src/styles/theme/literals.css +0 -104
- package/src/styles/theme/radius.css +0 -148
- package/src/styles/theme.css +0 -33
- package/src/styles/tokens/color-radius.css +0 -308
- package/src/styles/tokens/dark-arm-glass.css +0 -55
- package/src/styles/tokens/dark-arm.css +0 -455
- package/src/styles/tokens/glass-deep.css +0 -126
- package/src/styles/tokens/glass-fx.css +0 -484
- package/src/styles/tokens/glass.css +0 -478
- package/src/styles/tokens/light-dark.css +0 -216
- package/src/styles/tokens/motion-registers.css +0 -93
- package/src/styles/tokens/offsets.css +0 -143
- package/src/styles/tokens/on-glass-fg.css +0 -39
- package/src/styles/tokens/property-regs-specular.css +0 -160
- package/src/styles/tokens/property-regs.css +0 -447
- package/src/styles/tokens/scale-paper.css +0 -496
- package/src/styles/tokens/scheme-motion.css +0 -422
- package/src/styles/tokens/scheme-spring.css +0 -292
- package/src/styles/tokens/scroll-tokens.css +0 -137
- package/src/styles/tokens/shadow.css +0 -232
- package/src/styles/tokens/sizing-config.css +0 -110
- package/src/styles/tokens/sizing.css +0 -505
- package/src/styles/tokens.css +0 -68
- package/src/styles/transitions.css +0 -228
- package/src/styles/typography/scale.css +0 -163
- package/src/styles/typography/semantic.css +0 -233
- package/src/styles/typography/utilities.css +0 -197
- package/src/styles/typography.css +0 -46
- package/src/styles/utilities/a11y-overrides.css +0 -184
- package/src/styles/utilities/animate.css +0 -29
- package/src/styles/utilities/base-misc.css +0 -307
- package/src/styles/utilities/base.css +0 -337
- package/src/styles/utilities/btn.css +0 -327
- package/src/styles/utilities/components.css +0 -337
- package/src/styles/utilities/metal.css +0 -272
- package/src/styles/utilities.css +0 -26
- package/src/styles/view-transition.css +0 -67
- package/src/styles/viz-reveal.css +0 -63
- /package/dist/{_plugin-vue_export-helper-C1je1s0u.js → _plugin-vue_export-helper-B3ysoDQm.js} +0 -0
- /package/dist/{compile-C55K3P9g.js → compile-D7VYG3gi.js} +0 -0
- /package/dist/{styles → components/_shared}/feedback-tone.css +0 -0
- /package/dist/{styles/dock-controls → components/dock/styles/controls}/tab-button.css +0 -0
- /package/dist/{styles/dock-controls → components/dock/styles/controls}/triggers.css +0 -0
- /package/dist/{styles/dock → components/dock/styles}/cta-seat.css +0 -0
- /package/dist/{styles/dock → components/dock/styles}/search.css +0 -0
- /package/dist/{styles/dock → components/dock/styles}/shell-regions.css +0 -0
- /package/dist/composables/glass/{webgl/shaders/procedural-color.glsl.d.ts → procedural/color.glsl.d.ts} +0 -0
- /package/dist/{components/aurora/constants/shaders/procedural-color.wgsl.d.ts → composables/glass/procedural/color.wgsl.d.ts} +0 -0
- /package/dist/composables/motion/{motionTempo.d.ts → core/motionTempo.d.ts} +0 -0
- /package/dist/composables/motion/{useIntersectionPause.d.ts → core/useIntersectionPause.d.ts} +0 -0
- /package/dist/composables/motion/{useRAFLoop.d.ts → core/useRAFLoop.d.ts} +0 -0
- /package/dist/composables/motion/{useYieldToMain.d.ts → core/useYieldToMain.d.ts} +0 -0
- /package/dist/composables/motion/{useAnimatedNumberMap.d.ts → number/useAnimatedNumberMap.d.ts} +0 -0
- /package/dist/composables/motion/{useRoutePointer.d.ts → pointer/useRoutePointer.d.ts} +0 -0
- /package/dist/composables/motion/{vReveal.d.ts → reveal/vReveal.d.ts} +0 -0
- /package/dist/composables/motion/{scrollReader.d.ts → scroll/scrollReader.d.ts} +0 -0
- /package/dist/composables/motion/{supportsCssTimeline.d.ts → scroll/supportsCssTimeline.d.ts} +0 -0
- /package/dist/composables/motion/{useScrollPin.d.ts → scroll/useScrollPin.d.ts} +0 -0
- /package/dist/composables/motion/{useScrollScene.d.ts → scroll/useScrollScene.d.ts} +0 -0
- /package/dist/composables/motion/{useScrollTrigger.d.ts → scroll/useScrollTrigger.d.ts} +0 -0
- /package/dist/composables/motion/{useSpringPress.d.ts → spring/useSpringPress.d.ts} +0 -0
- /package/dist/{createContext-BQ1Gy_LB.js → createContext-BhkE9mLH.js} +0 -0
- /package/dist/{motionTempo-CMS5b0Vu.js → motionTempo-tscp92Nm.js} +0 -0
- /package/dist/{prng-B0PLRmR6.js → prng-2uS6J_A1.js} +0 -0
- /package/dist/{useDragVelocity-BWcNMCux.js → useDragVelocity-6ONX0sr0.js} +0 -0
- /package/dist/{useFuzzySearch-KslRxiJY.js → useFuzzySearch-CUnZknpm.js} +0 -0
- /package/dist/{useResizeObserver-DDuoBeBo.js → useResizeObserver-CdUlm2QZ.js} +0 -0
- /package/dist/{useResolveTokenColor-DVT5kwv6.js → useResolveTokenColor-B2FfJnd9.js} +0 -0
- /package/dist/{useTimer-CkDV8SC2.js → useTimer-C3yfti4C.js} +0 -0
- /package/dist/{useUserInvalidAria-Bkruei7M.js → useUserInvalidAria-0GNrddMX.js} +0 -0
- /package/dist/{writeVelocityWeight-D1rvdxJu.js → writeVelocityWeight-DoGOCW3e.js} +0 -0
package/dist/blob.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { t as n } from "./usePointerVelocityField-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { SpringProgress as L } from "@mkbabb/keyframes.js";
|
|
1
|
+
import { t as e } from "./useResolveTokenColor-B2FfJnd9.js";
|
|
2
|
+
import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
3
|
+
import { t as n } from "./usePointerVelocityField-DsIf7yyq.js";
|
|
4
|
+
import { a as r, i, n as a, o, r as s, t as c } from "./presets-5myqNv59.js";
|
|
5
|
+
import { cssToOklch as l, oklchToGammaRgb as u } from "./color.js";
|
|
6
|
+
import { a as d, m as f, n as p, o as m, r as h, s as g, t as _, u as v } from "./color.wgsl-Ct5o9dpf.js";
|
|
7
|
+
import { a as y } from "./rendererStatus-BxUlBLVy.js";
|
|
8
|
+
import { n as b, t as x } from "./compile-D7VYG3gi.js";
|
|
9
|
+
import { n as S, t as C } from "./prng-2uS6J_A1.js";
|
|
10
|
+
import { computed as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, defineComponent as O, inject as k, normalizeStyle as A, onScopeDispose as j, onUnmounted as M, openBlock as N, readonly as P, ref as F, shallowRef as I, useTemplateRef as L, watch as R } from "vue";
|
|
11
|
+
import { SpringProgress as z } from "@mkbabb/keyframes.js";
|
|
13
12
|
//#region src/components/blob/constants.ts
|
|
14
|
-
var
|
|
13
|
+
var B = 1 / 1.6, V = {
|
|
15
14
|
idle: {
|
|
16
15
|
valence: 0,
|
|
17
16
|
arousal: .35
|
|
@@ -32,48 +31,48 @@ var R = 1 / 1.6, z = {
|
|
|
32
31
|
valence: .7,
|
|
33
32
|
arousal: 1
|
|
34
33
|
}
|
|
35
|
-
},
|
|
36
|
-
function
|
|
34
|
+
}, H = (e, t, n) => e + (t - e) * n;
|
|
35
|
+
function U({ valence: e, arousal: t }) {
|
|
37
36
|
return {
|
|
38
|
-
orbitSpeedScale:
|
|
39
|
-
wobbleScale:
|
|
40
|
-
pulseFreq:
|
|
41
|
-
pulseAmp:
|
|
42
|
-
noiseAmp:
|
|
43
|
-
hueRange:
|
|
44
|
-
satShift:
|
|
45
|
-
brightnessShift:
|
|
46
|
-
smoothK:
|
|
47
|
-
pointerAttraction:
|
|
48
|
-
mergeRate:
|
|
49
|
-
iridScale:
|
|
37
|
+
orbitSpeedScale: H(.4, 2.2, t),
|
|
38
|
+
wobbleScale: H(.5, 2, t),
|
|
39
|
+
pulseFreq: H(.15, 1.5, t),
|
|
40
|
+
pulseAmp: H(.008, .05, t),
|
|
41
|
+
noiseAmp: H(.015, .045, t),
|
|
42
|
+
hueRange: H(3, 25, t * .6 + (e * .5 + .5) * .4),
|
|
43
|
+
satShift: H(-.05, .1, e * .5 + .5),
|
|
44
|
+
brightnessShift: H(-.03, .08, e * .5 + .5),
|
|
45
|
+
smoothK: H(.85, 1.35, t),
|
|
46
|
+
pointerAttraction: H(-.2, .6, e * .5 + .5) * (.7 + .15 * t),
|
|
47
|
+
mergeRate: H(2, .3, t),
|
|
48
|
+
iridScale: H(.55, 1.35, t)
|
|
50
49
|
};
|
|
51
50
|
}
|
|
52
|
-
var
|
|
53
|
-
idle: V
|
|
54
|
-
happy: V
|
|
55
|
-
curious: V
|
|
56
|
-
sleepy: V
|
|
57
|
-
excited: V
|
|
58
|
-
},
|
|
51
|
+
var W = {
|
|
52
|
+
idle: U(V.idle),
|
|
53
|
+
happy: U(V.happy),
|
|
54
|
+
curious: U(V.curious),
|
|
55
|
+
sleepy: U(V.sleepy),
|
|
56
|
+
excited: U(V.excited)
|
|
57
|
+
}, ee = {
|
|
59
58
|
idle: 1500,
|
|
60
59
|
happy: 1200,
|
|
61
60
|
curious: 800,
|
|
62
61
|
sleepy: 2500,
|
|
63
62
|
excited: 600
|
|
64
|
-
},
|
|
63
|
+
}, te = 6e3, ne = .35, re = .85, ie = .2, G = .015, K = .02, ae = .01, oe = .015, q = .75, se = 2e3, ce = .4, le = .18, ue = 5200, de = /* @__PURE__ */ "uResolution.uTime.uBaseColor.uPointer.uPointerActive.uPointerAttraction.uPointerStrength.uBodyRadius.uPulsePhase.uPulseAmp.uNoiseAmp.uNoiseFreq.uNoiseSpeed.uWarpAmp.uSmoothK.uMerge.uStage.uMorphT.uMaxReach.uLit.uRimColor.uLightDir.uSpecStrength.uSpecShininess.uRimPower.uRimStrength.uShadow.uShadowSoftness.uIridescence.uIridHue.uIridSpeed.uSssScale.uSssPower.uCoreGlow.uHueRange.uSatShift.uBrightnessShift.uColorNoiseFreq.uColorNoiseSpeed.uStopCount.uSatCount.uSatColorActive.uTrailCount.uVelocity.uStretch".split(".");
|
|
65
64
|
//#endregion
|
|
66
65
|
//#region src/components/blob/composables/easing.ts
|
|
67
|
-
function
|
|
66
|
+
function fe(e) {
|
|
68
67
|
return e < .5 ? 2 * e * e : 1 - 2 * (1 - e) * (1 - e);
|
|
69
68
|
}
|
|
70
|
-
function
|
|
69
|
+
function pe(e) {
|
|
71
70
|
return e * e;
|
|
72
71
|
}
|
|
73
|
-
function
|
|
72
|
+
function me(e) {
|
|
74
73
|
return 1 - (1 - e) * (1 - e);
|
|
75
74
|
}
|
|
76
|
-
function
|
|
75
|
+
function he(e) {
|
|
77
76
|
let t = e < 0 ? 0 : e > 1 ? 1 : e;
|
|
78
77
|
if (t < .3) {
|
|
79
78
|
let e = t / .3;
|
|
@@ -88,7 +87,7 @@ function fe(e) {
|
|
|
88
87
|
}
|
|
89
88
|
//#endregion
|
|
90
89
|
//#region src/components/blob/composables/useBlobMood.ts
|
|
91
|
-
function
|
|
90
|
+
function ge(e, t, n) {
|
|
92
91
|
let r = (e, t) => e + (t - e) * n;
|
|
93
92
|
return {
|
|
94
93
|
orbitSpeedScale: r(e.orbitSpeedScale, t.orbitSpeedScale),
|
|
@@ -105,10 +104,10 @@ function pe(e, t, n) {
|
|
|
105
104
|
iridScale: r(e.iridScale, t.iridScale)
|
|
106
105
|
};
|
|
107
106
|
}
|
|
108
|
-
function
|
|
109
|
-
let e =
|
|
107
|
+
function _e() {
|
|
108
|
+
let e = F("idle"), t = F({ ...W.idle }), n = { ...W.idle }, r = { ...W.idle }, i = 0, a = 0, o = !1, s = 0, c = !1, l = !1, u = 0;
|
|
110
109
|
function d(s, l = {}) {
|
|
111
|
-
(l.source ?? "manual") === "manual" && (c = !0), !(s === e.value && !o) && (e.value = s, n = { ...t.value }, r =
|
|
110
|
+
(l.source ?? "manual") === "manual" && (c = !0), !(s === e.value && !o) && (e.value = s, n = { ...t.value }, r = W[s], a = ee[s], i = 0, o = !0);
|
|
112
111
|
}
|
|
113
112
|
function f(e) {
|
|
114
113
|
u = e.idleMs;
|
|
@@ -125,17 +124,17 @@ function me() {
|
|
|
125
124
|
return o || s > 0 || c && e.value !== "idle" ? !1 : !(!c && e.value !== "sleepy" && u < 6e3);
|
|
126
125
|
}
|
|
127
126
|
function m() {
|
|
128
|
-
return o || s > 0 || c || e.value === "sleepy" ? Infinity : Math.max(0,
|
|
127
|
+
return o || s > 0 || c || e.value === "sleepy" ? Infinity : Math.max(0, te - u);
|
|
129
128
|
}
|
|
130
129
|
function h(e) {
|
|
131
130
|
if (s > 0 && (s = Math.max(0, s - e)), !o) return;
|
|
132
131
|
i += e;
|
|
133
|
-
let c = Math.min(i / a, 1), l =
|
|
134
|
-
t.value =
|
|
132
|
+
let c = Math.min(i / a, 1), l = fe(c);
|
|
133
|
+
t.value = ge(n, r, l), c >= 1 && (o = !1);
|
|
135
134
|
}
|
|
136
135
|
return {
|
|
137
|
-
currentMood:
|
|
138
|
-
params:
|
|
136
|
+
currentMood: P(e),
|
|
137
|
+
params: P(t),
|
|
139
138
|
setMood: d,
|
|
140
139
|
update: f,
|
|
141
140
|
tick: h,
|
|
@@ -145,17 +144,17 @@ function me() {
|
|
|
145
144
|
}
|
|
146
145
|
//#endregion
|
|
147
146
|
//#region src/components/blob/composables/useBlobPointer.ts
|
|
148
|
-
function
|
|
149
|
-
let { hitRadius: n } = t, r =
|
|
147
|
+
function ve(e, t = {}) {
|
|
148
|
+
let { hitRadius: n } = t, r = F({
|
|
150
149
|
x: 0,
|
|
151
150
|
y: 0
|
|
152
|
-
}), i =
|
|
151
|
+
}), i = F({
|
|
153
152
|
x: 0,
|
|
154
153
|
y: 0
|
|
155
|
-
}), a =
|
|
154
|
+
}), a = F(!1), o = F(0), s = 0, c = 0, l = {
|
|
156
155
|
response: .18,
|
|
157
156
|
dampingFraction: 1
|
|
158
|
-
}, u = new
|
|
157
|
+
}, u = new z(l), d = new z(l), f = Array.from({ length: 15 }, () => ({
|
|
159
158
|
x: 0,
|
|
160
159
|
y: 0,
|
|
161
160
|
radius: 0
|
|
@@ -181,11 +180,11 @@ function he(e, t = {}) {
|
|
|
181
180
|
a.value = !1;
|
|
182
181
|
}
|
|
183
182
|
let x = null;
|
|
184
|
-
|
|
183
|
+
R(e, (e) => {
|
|
185
184
|
x &&= (x(), null), e && (e.addEventListener("pointermove", y), e.addEventListener("pointerleave", b), x = () => {
|
|
186
185
|
e.removeEventListener("pointermove", y), e.removeEventListener("pointerleave", b);
|
|
187
186
|
});
|
|
188
|
-
}, { immediate: !0 }),
|
|
187
|
+
}, { immediate: !0 }), M(() => x?.());
|
|
189
188
|
function S(e = 16) {
|
|
190
189
|
let t = Math.min(e, 50), n = t / 1e3;
|
|
191
190
|
a.value ? D = 0 : D += Math.min(e, 50);
|
|
@@ -197,7 +196,7 @@ function he(e, t = {}) {
|
|
|
197
196
|
x: u.velocity,
|
|
198
197
|
y: d.velocity
|
|
199
198
|
}, h !== 0 || g !== 0) {
|
|
200
|
-
let e = -324 * h - 2 *
|
|
199
|
+
let e = -324 * h - 2 * ne * 18 * g;
|
|
201
200
|
g += e * n, h += g * n, h < -.9 && (h = -.9), Math.abs(h) < 1e-4 && Math.abs(g) < 1e-4 && (h = 0, g = 0);
|
|
202
201
|
}
|
|
203
202
|
o.value = h;
|
|
@@ -207,10 +206,10 @@ function he(e, t = {}) {
|
|
|
207
206
|
function C(e) {
|
|
208
207
|
let t = [];
|
|
209
208
|
for (let n = 0; n < m; n++) {
|
|
210
|
-
let r =
|
|
209
|
+
let r = (p - n + 30) % 15, i = f[r];
|
|
211
210
|
t.push({
|
|
212
|
-
x:
|
|
213
|
-
y:
|
|
211
|
+
x: i.x,
|
|
212
|
+
y: i.y,
|
|
214
213
|
radius: e * (1 - n / 15)
|
|
215
214
|
});
|
|
216
215
|
}
|
|
@@ -241,14 +240,14 @@ function he(e, t = {}) {
|
|
|
241
240
|
return !(a.value || Math.hypot(u.velocity, d.velocity) > .001 || Math.abs(u.value) > .001 || Math.abs(d.value) > .001 || m > 0 || h !== 0 || g !== 0);
|
|
242
241
|
}
|
|
243
242
|
return {
|
|
244
|
-
pointer:
|
|
245
|
-
velocity:
|
|
246
|
-
active:
|
|
243
|
+
pointer: P(r),
|
|
244
|
+
velocity: P(i),
|
|
245
|
+
active: P(a),
|
|
247
246
|
rawPointer: () => ({
|
|
248
247
|
x: s,
|
|
249
248
|
y: c
|
|
250
249
|
}),
|
|
251
|
-
pulse:
|
|
250
|
+
pulse: P(o),
|
|
252
251
|
idleMs: () => D,
|
|
253
252
|
tick: S,
|
|
254
253
|
trailSources: C,
|
|
@@ -261,8 +260,8 @@ function he(e, t = {}) {
|
|
|
261
260
|
}
|
|
262
261
|
//#endregion
|
|
263
262
|
//#region src/components/blob/composables/satelliteKinematics.ts
|
|
264
|
-
function
|
|
265
|
-
let a = t / 4 * Math.PI * 2 + (e() - .5) * Math.PI, o = n * (
|
|
263
|
+
function ye(e, t, n, r, i) {
|
|
264
|
+
let a = t / 4 * Math.PI * 2 + (e() - .5) * Math.PI, o = n * (re + e() * ie), s = r * (.3 + e() * .7);
|
|
266
265
|
return {
|
|
267
266
|
phase: "orbiting",
|
|
268
267
|
phaseStart: i,
|
|
@@ -272,9 +271,9 @@ function ge(e, t, n, r, i) {
|
|
|
272
271
|
phaseOffset: a,
|
|
273
272
|
baseRadiusX: o * (1 - s),
|
|
274
273
|
baseRadiusY: o * (1 + s),
|
|
275
|
-
wobbleAmp1:
|
|
274
|
+
wobbleAmp1: G + e() * K,
|
|
276
275
|
wobbleFreq1: .08 + e() * .22,
|
|
277
|
-
wobbleAmp2:
|
|
276
|
+
wobbleAmp2: ae + e() * oe,
|
|
278
277
|
wobbleFreq2: .18 + e() * .32,
|
|
279
278
|
pertXAmp: .03 + e() * .05,
|
|
280
279
|
pertXFreq: .06 + e() * .18,
|
|
@@ -290,33 +289,33 @@ function ge(e, t, n, r, i) {
|
|
|
290
289
|
snapFired: !1
|
|
291
290
|
};
|
|
292
291
|
}
|
|
293
|
-
function
|
|
292
|
+
function J(e, t, n, r) {
|
|
294
293
|
let i = (t - e.timeOrigin) / 1e3, a = e.angularSpeed * n * i + e.phaseOffset, o = r * (e.wobbleAmp1 * Math.sin(e.wobbleFreq1 * i) + e.wobbleAmp2 * Math.sin(e.wobbleFreq2 * i + 1.3));
|
|
295
294
|
return {
|
|
296
295
|
x: (e.baseRadiusX + o) * Math.cos(a) + e.pertXAmp * Math.sin(e.pertXFreq * i + e.pertXPhase),
|
|
297
296
|
y: (e.baseRadiusY + o) * Math.sin(a) + e.pertYAmp * Math.cos(e.pertYFreq * i + e.pertYPhase)
|
|
298
297
|
};
|
|
299
298
|
}
|
|
300
|
-
function
|
|
299
|
+
function be(e, t, n, r, i) {
|
|
301
300
|
e.timeOrigin = i, e.angularSpeed = .08 + t() * .16, e.phaseOffset = t() * Math.PI * 2;
|
|
302
|
-
let a = n * (
|
|
303
|
-
e.baseRadiusX = a * (1 - o), e.baseRadiusY = a * (1 + o), e.wobbleAmp1 =
|
|
301
|
+
let a = n * (re + t() * ie), o = r * (.3 + t() * .7);
|
|
302
|
+
e.baseRadiusX = a * (1 - o), e.baseRadiusY = a * (1 + o), e.wobbleAmp1 = G + t() * K, e.wobbleFreq1 = .08 + t() * .22, e.wobbleAmp2 = ae + t() * oe, e.wobbleFreq2 = .18 + t() * .32, e.pertXAmp = .03 + t() * .05, e.pertXFreq = .06 + t() * .18, e.pertXPhase = t() * Math.PI * 2, e.pertYAmp = .03 + t() * .05, e.pertYFreq = .07 + t() * .17, e.pertYPhase = t() * Math.PI * 2;
|
|
304
303
|
}
|
|
305
304
|
//#endregion
|
|
306
305
|
//#region src/components/blob/composables/useBlobSatellites.ts
|
|
307
|
-
function
|
|
306
|
+
function Y(e, t, n) {
|
|
308
307
|
return t + e() * (n - t);
|
|
309
308
|
}
|
|
310
|
-
function
|
|
309
|
+
function X(e) {
|
|
311
310
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
312
311
|
}
|
|
313
|
-
function
|
|
312
|
+
function Z(e, t, n) {
|
|
314
313
|
return e + (t - e) * n;
|
|
315
314
|
}
|
|
316
|
-
function
|
|
315
|
+
function Q(e, t, n, r) {
|
|
317
316
|
e.phase = t, e.phaseStart = n, e.phaseDuration = r;
|
|
318
317
|
}
|
|
319
|
-
function
|
|
318
|
+
function xe(e, t) {
|
|
320
319
|
let n = S(C(t + "goo")), r = [], i = [], a = [], o = -Infinity, s = e.geometry.orbitRadius, c = -1, l = null;
|
|
321
320
|
function u() {
|
|
322
321
|
let t = e.geometry.orbitRadius;
|
|
@@ -328,7 +327,7 @@ function be(e, t) {
|
|
|
328
327
|
}
|
|
329
328
|
function d(t) {
|
|
330
329
|
let o = e.geometry.satelliteCount;
|
|
331
|
-
for (; r.length < o;) r.push(
|
|
330
|
+
for (; r.length < o;) r.push(ye(n, r.length, e.geometry.orbitRadius, e.geometry.eccentricity, t)), i.push({
|
|
332
331
|
x: 0,
|
|
333
332
|
y: 0,
|
|
334
333
|
radius: e.geometry.satelliteRadius,
|
|
@@ -343,73 +342,73 @@ function be(e, t) {
|
|
|
343
342
|
}
|
|
344
343
|
function f(t, s) {
|
|
345
344
|
d(t), u();
|
|
346
|
-
let f = r.length, p = s.mergeRate, m = e.geometry.satelliteRadius, h = e.satellites.mergeDuration, g = e.satellites.emergeDuration, _ = e.satellites.orbitDuration, v = e.satellites.absorbedDuration, y = e.surface.fissionAmp ?? 0, b = Math.max(0, Math.min(1, (2 - p) / 1.7)), x = Math.max(0, Math.min(1, y * (.4 + .6 * b))), S =
|
|
345
|
+
let f = r.length, p = s.mergeRate, m = e.geometry.satelliteRadius, h = e.satellites.mergeDuration, g = e.satellites.emergeDuration, _ = e.satellites.orbitDuration, v = e.satellites.absorbedDuration, y = e.surface.fissionAmp ?? 0, b = Math.max(0, Math.min(1, (2 - p) / 1.7)), x = Math.max(0, Math.min(1, y * (.4 + .6 * b))), S = ce - le;
|
|
347
346
|
for (let u = 0; u < f; u++) {
|
|
348
|
-
let d = r[u], f = t - d.phaseStart, y =
|
|
347
|
+
let d = r[u], f = t - d.phaseStart, y = X(d.phaseDuration > 0 ? f / d.phaseDuration : 1);
|
|
349
348
|
switch (d.phase) {
|
|
350
349
|
case "orbiting":
|
|
351
|
-
if (y >= 1) if (t - o < 3e3 * p) d.phaseStart = t, d.phaseDuration =
|
|
352
|
-
else if (x > 0 && c < 0 && n() < x * .75) d.phaseOffset = d.angularSpeed * s.orbitSpeedScale * ((t - d.timeOrigin) / 1e3) + d.phaseOffset, d.timeOrigin = t, d.fissioning = !0, d.snapFired = !1, c = u,
|
|
350
|
+
if (y >= 1) if (t - o < 3e3 * p) d.phaseStart = t, d.phaseDuration = Y(n, _[0], _[1]);
|
|
351
|
+
else if (x > 0 && c < 0 && n() < x * .75) d.phaseOffset = d.angularSpeed * s.orbitSpeedScale * ((t - d.timeOrigin) / 1e3) + d.phaseOffset, d.timeOrigin = t, d.fissioning = !0, d.snapFired = !1, c = u, Q(d, "fissioning", t, ue), o = t;
|
|
353
352
|
else {
|
|
354
|
-
let e =
|
|
353
|
+
let e = J(d, t, s.orbitSpeedScale, s.wobbleScale);
|
|
355
354
|
d.startX = e.x, d.startY = e.y;
|
|
356
355
|
let n = Math.hypot(e.x, e.y), r = n > .01 ? .08 / n : 0;
|
|
357
|
-
d.endX = e.x * r, d.endY = e.y * r,
|
|
356
|
+
d.endX = e.x * r, d.endY = e.y * r, Q(d, "merging", t, h), o = t;
|
|
358
357
|
}
|
|
359
358
|
break;
|
|
360
359
|
case "fissioning":
|
|
361
|
-
y >= 1 && (d.fissioning = !1, c === u && (c = -1), d.timeOrigin = t,
|
|
360
|
+
y >= 1 && (d.fissioning = !1, c === u && (c = -1), d.timeOrigin = t, Q(d, "orbiting", t, Y(n, _[0], _[1])));
|
|
362
361
|
break;
|
|
363
362
|
case "merging":
|
|
364
|
-
y >= 1 &&
|
|
363
|
+
y >= 1 && Q(d, "absorbed", t, Y(n, v[0], v[1]));
|
|
365
364
|
break;
|
|
366
365
|
case "absorbed":
|
|
367
366
|
if (y >= 1) {
|
|
368
|
-
|
|
369
|
-
let r =
|
|
367
|
+
be(d, n, e.geometry.orbitRadius, e.geometry.eccentricity, t);
|
|
368
|
+
let r = J(d, t + 3e3, s.orbitSpeedScale, s.wobbleScale);
|
|
370
369
|
d.endX = r.x, d.endY = r.y;
|
|
371
370
|
let i = Math.hypot(r.x, r.y), a = i > .01 ? .08 / i : 0;
|
|
372
|
-
d.startX = r.x * a, d.startY = r.y * a,
|
|
371
|
+
d.startX = r.x * a, d.startY = r.y * a, Q(d, "emerging", t, g);
|
|
373
372
|
}
|
|
374
373
|
break;
|
|
375
374
|
case "emerging":
|
|
376
375
|
if (y >= 1) {
|
|
377
376
|
let e = a[u];
|
|
378
|
-
e.x = d.endX, e.y = d.endY, e.start = t, d.timeOrigin = t, d.phaseOffset = Math.atan2(d.endY, d.endX),
|
|
377
|
+
e.x = d.endX, e.y = d.endY, e.start = t, d.timeOrigin = t, d.phaseOffset = Math.atan2(d.endY, d.endX), Q(d, "orbiting", t, Y(n, _[0], _[1]));
|
|
379
378
|
}
|
|
380
379
|
break;
|
|
381
380
|
}
|
|
382
381
|
let b, C, w, T;
|
|
383
382
|
switch (d.phase) {
|
|
384
383
|
case "orbiting": {
|
|
385
|
-
let e =
|
|
384
|
+
let e = J(d, t, s.orbitSpeedScale, s.wobbleScale), n = a[u], r = t - n.start;
|
|
386
385
|
if (n.start > 0 && r < 2e3) {
|
|
387
|
-
let t =
|
|
388
|
-
b =
|
|
386
|
+
let t = X(r / se), i = t * t * (3 - 2 * t);
|
|
387
|
+
b = Z(n.x, e.x, i), C = Z(n.y, e.y, i);
|
|
389
388
|
} else b = e.x, C = e.y;
|
|
390
|
-
w =
|
|
389
|
+
w = q, T = 1;
|
|
391
390
|
break;
|
|
392
391
|
}
|
|
393
392
|
case "merging": {
|
|
394
|
-
let e =
|
|
395
|
-
b =
|
|
396
|
-
let n =
|
|
397
|
-
w = n > .85 ?
|
|
393
|
+
let e = pe(X((t - d.phaseStart) / d.phaseDuration));
|
|
394
|
+
b = Z(d.startX, d.endX, e), C = Z(d.startY, d.endY, e);
|
|
395
|
+
let n = X((t - d.phaseStart) / d.phaseDuration);
|
|
396
|
+
w = n > .85 ? Z(q, 0, (n - .85) / .15) : q, T = Z(1, .65, e);
|
|
398
397
|
break;
|
|
399
398
|
}
|
|
400
399
|
case "absorbed":
|
|
401
400
|
b = 0, C = 0, w = 0, T = .5;
|
|
402
401
|
break;
|
|
403
402
|
case "emerging": {
|
|
404
|
-
let e =
|
|
405
|
-
b =
|
|
406
|
-
let n =
|
|
407
|
-
w = n < .1 ?
|
|
403
|
+
let e = me(X((t - d.phaseStart) / d.phaseDuration));
|
|
404
|
+
b = Z(d.startX, d.endX, e), C = Z(d.startY, d.endY, e);
|
|
405
|
+
let n = X((t - d.phaseStart) / d.phaseDuration);
|
|
406
|
+
w = n < .1 ? Z(0, q, n / .1) : q, T = Z(.65, 1, e);
|
|
408
407
|
break;
|
|
409
408
|
}
|
|
410
409
|
case "fissioning": {
|
|
411
|
-
let e =
|
|
412
|
-
b = o * r, C = c * r, w =
|
|
410
|
+
let e = X((t - d.phaseStart) / d.phaseDuration), n = he(e), r = le + S * n, i = J(d, t, s.orbitSpeedScale, s.wobbleScale), a = Math.hypot(i.x, i.y), o = a > 1e-4 ? i.x / a : Math.cos(d.phaseOffset), c = a > 1e-4 ? i.y / a : Math.sin(d.phaseOffset);
|
|
411
|
+
b = o * r, C = c * r, w = q, T = Z(.78, 1, X(n)), !d.snapFired && e >= .42 && (d.snapFired = !0, l?.(Math.min(.4, .18 + .22 * x)));
|
|
413
412
|
break;
|
|
414
413
|
}
|
|
415
414
|
}
|
|
@@ -450,7 +449,7 @@ function be(e, t) {
|
|
|
450
449
|
}
|
|
451
450
|
//#endregion
|
|
452
451
|
//#region src/components/blob/shaders/metaball.vert.ts
|
|
453
|
-
var
|
|
452
|
+
var Se = "#version 300 es\n\nin vec2 aPosition;\nout vec2 vUv;\n\nvoid main() {\n vUv = 0.5 * (aPosition + 1.0);\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}", Ce = "// --- SDF ---\n\nfloat sdCircle(vec2 p, vec2 center, float radius) {\n return length(p - center) - radius;\n}\n\n// Value and gradient circle: returns vec3(d, dd/dx, dd/dy). The circle\n// gradient is the UNIT radial direction (p - center)/length(p - center) (the\n// eikonal property holds EXACTLY for a circle), guarded at the degenerate centre.\n// This is the keystone of the analytic-gradient smin: carrying the gradient\n// through the scene field DELETES the per-pixel 4-tap normal (4 full sceneDist\n// evals, each running 3-octave FBM + the sat/trail loops).\nvec3 sdgCircle(vec2 p, vec2 center, float radius) {\n vec2 d = p - center;\n float len = length(d);\n vec2 grad = len > 1e-6 ? d / len : vec2(0.0, 1.0);\n return vec3(len - radius, grad);\n}\n\n// IQ 2024 quadratic-polynomial smin, NORMALIZED so k is a blend band in distance\n// units. The k *= 4.0 pre-scale makes the h*h*k*0.25 poly's effective blend width\n// equal to k (the un-normalized form's width was 0.25*k).\nfloat sminQuadratic(float a, float b, float k) {\n k *= 4.0;\n float h = max(k - abs(a - b), 0.0) / k;\n return min(a, b) - h * h * k * 0.25;\n}\n\n// IQ circular smin — a quarter-circle fillet at the seam (rounder than the\n// quadratic). The k *= 1.0/(1.0-sqrt(0.5)) factor normalizes k to the same\n// blend-band units so the merge axis swaps shape without re-tuning uSmoothK.\nfloat sminCircular(float a, float b, float k) {\n k *= 1.0 / (1.0 - sqrt(0.5));\n float h = max(k - abs(a - b), 0.0) / k;\n return min(a, b) - k * 0.5 * (1.0 + h - sqrt(1.0 - h * (h - 2.0)));\n}\n\n// Config-gated merge dispatch — uMerge 0 = quadratic, 1 = circular.\nfloat smin(float a, float b, float k) {\n if (uMerge > 0.5) return sminCircular(a, b, k);\n return sminQuadratic(a, b, k);\n}\n\n// Value and gradient smin. a/b are vec3(dist, grad.xy); the blended\n// gradient is mix(a.yz, b.yz, w) with the interpolation weight w the distance\n// blend uses (IQ's vec2-smin insight). This propagates the analytic gradient\n// through the merge so the surface normal reads the field gradient DIRECTLY — no\n// finite-difference tap. The blend weight matches each variant.\nvec3 sminQuadraticG(vec3 a, vec3 b, float k) {\n k *= 4.0;\n float h = max(k - abs(a.x - b.x), 0.0) / k;\n float m = h * h * k * 0.25;\n // h-weight that selects which surface dominates (0 → a, 1 → b).\n float w = (a.x < b.x) ? 0.5 * h * h : 1.0 - 0.5 * h * h;\n float dist = min(a.x, b.x) - m;\n vec2 grad = mix(a.yz, b.yz, w);\n return vec3(dist, grad);\n}\n\nvec3 sminCircularG(vec3 a, vec3 b, float k) {\n k *= 1.0 / (1.0 - sqrt(0.5));\n float h = max(k - abs(a.x - b.x), 0.0) / k;\n float m = k * 0.5 * (1.0 + h - sqrt(1.0 - h * (h - 2.0)));\n float w = (a.x < b.x) ? 0.5 * h : 1.0 - 0.5 * h;\n float dist = min(a.x, b.x) - m;\n vec2 grad = mix(a.yz, b.yz, w);\n return vec3(dist, grad);\n}\n\nvec3 sminG(vec3 a, vec3 b, float k) {\n if (uMerge > 0.5) return sminCircularG(a, b, k);\n return sminQuadraticG(a, b, k);\n}", we = "// --- Noise ---\n\nfloat hash21(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// IQ analytic-derivative gradient noise — value in .x, ANALYTIC gradient\n// (d/dx, d/dy) in .yz, from one eval. The quintic fade has a continuous 2nd\n// derivative so the gradient is smooth (a cubic smoothstep fade would crease it).\n// (Inigo Quilez, https://iquilezles.org/articles/gradientnoise/.)\nvec3 noised(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n\n // Quintic fade + its derivative.\n vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n vec2 du = 30.0 * f * f * (f * (f - 2.0) + 1.0);\n\n // Per-corner gradient vectors from the hash (centred to [-1, 1]).\n vec2 ga = -1.0 + 2.0 * vec2(hash21(i + vec2(0.0, 0.0)), hash21(i + vec2(7.3, 0.0)));\n vec2 gb = -1.0 + 2.0 * vec2(hash21(i + vec2(1.0, 0.0)), hash21(i + vec2(8.3, 0.0)));\n vec2 gc = -1.0 + 2.0 * vec2(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(7.3, 1.0)));\n vec2 gd = -1.0 + 2.0 * vec2(hash21(i + vec2(1.0, 1.0)), hash21(i + vec2(8.3, 1.0)));\n\n float va = dot(ga, f - vec2(0.0, 0.0));\n float vb = dot(gb, f - vec2(1.0, 0.0));\n float vc = dot(gc, f - vec2(0.0, 1.0));\n float vd = dot(gd, f - vec2(1.0, 1.0));\n\n // Value, remapped to [0,1] so it drops in as the valueNoise.\n float n = va + u.x * (vb - va) + u.y * (vc - va) + u.x * u.y * (va - vb - vc + vd);\n float value = 0.5 + 0.5 * n;\n\n // Analytic gradient (chain rule through the bilinear blend + the fade).\n vec2 grad =\n ga + u.x * (gb - ga) + u.y * (gc - ga) + u.x * u.y * (ga - gb - gc + gd) +\n du * (vec2(u.y, u.x) * (va - vb - vc + vd) + vec2(vb, vc) - va);\n return vec3(value, 0.5 * grad);\n}\n\n// Rotated-octave FBM over the analytic gradient noise: a fixed ~0.5 rad 2x2\n// rotation between octaves breaks the axis-aligned banding. The rotation CONSTANT\n// is spliced from the shared chunk; the loops below\n// stay blob-local (param octaves + the LIQUID lacunarity/persistence, per §3a).", Te = 1.8, Ee = .42, De = `float fbm(vec2 p, int octaves) {
|
|
454
453
|
float value = 0.0;
|
|
455
454
|
float amp = 0.5;
|
|
456
455
|
float freq = 1.0;
|
|
@@ -458,13 +457,13 @@ var xe = "#version 300 es\n\nin vec2 aPosition;\nout vec2 vUv;\n\nvoid main() {\
|
|
|
458
457
|
if (i >= octaves) break;
|
|
459
458
|
value += amp * noised(p * freq).x;
|
|
460
459
|
p = FBM_ROT * p;
|
|
461
|
-
freq *= ${
|
|
462
|
-
amp *= ${
|
|
460
|
+
freq *= ${Te.toFixed(1)};
|
|
461
|
+
amp *= ${Ee.toFixed(2)};
|
|
463
462
|
}
|
|
464
463
|
return value;
|
|
465
464
|
}
|
|
466
465
|
|
|
467
|
-
//
|
|
466
|
+
// FBM with analytic gradient. Returns vec3(value, ∂/∂x, ∂/∂y). The
|
|
468
467
|
// gradient accumulates noised()'s analytic gradient per octave, chain-ruled
|
|
469
468
|
// through the per-octave frequency scale AND the FBM_ROT rotation: octave i samples
|
|
470
469
|
// at R^i · (freq·p), so the gradient w.r.t. the ORIGINAL p picks up freq and
|
|
@@ -486,8 +485,8 @@ vec3 fbmG(vec2 p, int octaves) {
|
|
|
486
485
|
// d(value)/dp = amp · freq · (R^i)^T · noised.yz (the rotated chain rule).
|
|
487
486
|
grad += amp * freq * (transpose(rotAccum) * n.yz);
|
|
488
487
|
pp = FBM_ROT * pp;
|
|
489
|
-
freq *= ${
|
|
490
|
-
amp *= ${
|
|
488
|
+
freq *= ${Te.toFixed(1)};
|
|
489
|
+
amp *= ${Ee.toFixed(2)};
|
|
491
490
|
rotAccum = FBM_ROT * rotAccum;
|
|
492
491
|
}
|
|
493
492
|
return vec3(value, grad);
|
|
@@ -502,80 +501,25 @@ vec3 fbmWarpedG(vec2 p, int octaves, float warpAmp) {
|
|
|
502
501
|
vec2 q = vec2(fbm(p + vec2(0.0, 0.0), octaves), fbm(p + vec2(5.2, 1.3), octaves));
|
|
503
502
|
return fbmG(p + warpAmp * (q - 0.5), octaves);
|
|
504
503
|
}
|
|
505
|
-
`,
|
|
504
|
+
`, Oe = "// Edit #4's gamut step — hue-preserving inward chroma clamp. If the linear result\n// is out of [0,1], bisect chroma toward 0 (L + h fixed) until in gamut. Preserves\n// hue exactly (only C shrinks). 16 steps resolve C to < 2^-16 of its span.\nbool inGamut(vec3 lin) {\n return all(greaterThanEqual(lin, vec3(0.0))) && all(lessThanEqual(lin, vec3(1.0)));\n}\nvec3 gamutClampOklch(vec3 lch) {\n vec3 lin = oklabToLinearSrgb(oklchToOklab(lch));\n if (inGamut(lin)) return lch;\n float lo = 0.0;\n float hi = lch.y;\n for (int i = 0; i < 16; i++) {\n float mid = 0.5 * (lo + hi);\n vec3 test = vec3(lch.x, mid, lch.z);\n if (inGamut(oklabToLinearSrgb(oklchToOklab(test)))) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return vec3(lch.x, lo, lch.z);\n}", ke = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform vec2 uResolution;\nuniform float uTime;\nuniform vec3 uBaseColor;\n\n// Multi-stop palette — 2-4 in-family OKLCh stops (uploaded GAMMA sRGB, like\n// uBaseColor). uStopCount <= 1 falls back to uBaseColor (the single-color default,\n// zero regression). MAX_BLOB_STOPS is a compile-time #define.\n#define MAX_BLOB_STOPS 4\nuniform int uStopCount;\nuniform vec3 uPalette[MAX_BLOB_STOPS];\n\n// Pointer\nuniform vec2 uPointer;\nuniform float uPointerActive;\nuniform float uPointerAttraction;\nuniform float uPointerStrength;\n\n// Main body\nuniform float uBodyRadius;\n\n// Pulsation\nuniform float uPulsePhase;\nuniform float uPulseAmp;\n\n// Surface noise\nuniform float uNoiseAmp;\nuniform float uNoiseFreq;\nuniform float uNoiseSpeed;\n\n// Gooey\nuniform float uSmoothK;\nuniform float uMerge; // 0 = quadratic smin, 1 = circular smin (rounder menisci)\n\n// The stripped-surface gate. 1.0 = the flat shadowless fill-only floor; 0.0 = the\n// dressed pipeline. It is derived from the single uMorphT surface scalar.\nuniform float uStage;\n\n// The blob-to-meatball shading-morph scalar. 0.0 = the flat blob\n// fill (byte-identical to the STAGE-1 floor), 1.0 = the fully-dressed lit meatball; the\n// in-between LERPS the surface shading (NOT the geometry — the smin field is shared). The\n// renderer clamps it from config.morphT. Animating 0 to 1 gets the live morph.\nuniform float uMorphT;\n\n// The pre-FBM bounding-discard radius in UV space. main() early-outs\n// to a transparent write for any fragment OUTSIDE this radius BEFORE the two 3-octave\n// FBM calls + the OKLCh round-trip. The renderer uploads it PADDED by every\n// outward-expanding term (body + eccentric orbit + sat radius + smin band + FBM edge\n// amplitude + click-pulse + a lean/squash safety pad) so it NEVER clips the wet\n// meniscus (IQ: inflate the bound to match any outward op).\nuniform float uMaxReach;\n\n// Membrane — domain-warp strength on the FBM edge displacement (0 = plain fbm).\nuniform float uWarpAmp;\n\n// Lit glass surface — gated behind uLit so the flat fill stays default.\nuniform float uLit; // 0 = flat fill (default), 1 = lit droplet\nuniform vec3 uRimColor; // Fresnel rim tint (GAMMA sRGB, via the /color leaf)\nuniform vec3 uLightDir; // normalized light direction (x, y, z)\nuniform float uSpecStrength; // Blinn-Phong specular weight\nuniform float uSpecShininess; // specular exponent (16-64, tight glint)\nuniform float uRimPower; // Fresnel/Schlick exponent (~2-3)\nuniform float uRimStrength; // Fresnel rim weight\n\n// The procedural 2D SDF soft-shadow march, the GLSL twin of\n// the WGSL res.z/res.w lanes). uShadow gates the IQ rmshadows soft contact shadow that\n// FOLLOWS the irregular silhouette; uShadowSoftness is the penumbra hardness (4-48).\nuniform float uShadow; // 0 = no shadow, 1 = the soft contact shadow ON\nuniform float uShadowSoftness; // penumbra hardness (inverse light-source size, 4-48)\n\n// Iridescence + fake subsurface — translucent-gel read.\nuniform float uIridescence; // warm-pearl rim sheen weight (0 = off)\nuniform float uIridHue; // base hue (radians) the cosine palette biases toward (warm)\nuniform float uIridSpeed; // animated-thickness scroll for the iridescent t\nuniform float uSssScale; // fast-SSS back-light weight\nuniform float uSssPower; // fast-SSS exponent\nuniform float uCoreGlow; // thickness-driven inner-luminosity lift\n\n// Color perturbation (perceptually uniform — OKLCh L/C/h)\nuniform float uHueRange; // degrees of hue swing (converted to radians)\nuniform float uSatShift; // OKLCh chroma swing\nuniform float uBrightnessShift; // OKLCh lightness bias\nuniform float uColorNoiseFreq;\nuniform float uColorNoiseSpeed;\n\n// Satellites (max 4)\n#define MAX_SATS 4\nuniform int uSatCount;\nuniform vec2 uSatPos[MAX_SATS];\nuniform float uSatRadius[MAX_SATS];\nuniform float uSatOpacity[MAX_SATS];\n\n// The per-satellite explicit-shade seam widens the GL color contract for the hero blob.\n// uSatColorActive == 0 is the default (the derived\n// palette shade, UNCHANGED): blendSatColor() early-returns and touches\n// nothing. When a consumer supplies explicit per-satellite shades (uSatColor[i], GAMMA\n// sRGB, at uSatColorAmt[i] weight — typically 1) the fragment blends the base palette\n// OKLCh toward each satellite's shade, weighted by that satellite's smin-field proximity\n// at this pixel. The body keeps the derived base (the ask is per-SATELLITE).\nuniform int uSatColorActive;\nuniform vec3 uSatColor[MAX_SATS];\nuniform float uSatColorAmt[MAX_SATS];\n\n// Pointer trail — a decaying-radius pseudopod toward the cursor. uTrail is a\n// COMPILE-TIME-SIZED array (GLSL ES 3.00 forbids a uniform-sized array) with a\n// DYNAMIC break on uTrailCount, mirroring the satellite loop. Later samples paint\n// smaller metaballs (r *= 1 - i/N) so the trail tapers into a tail.\n#define TRAIL_N 15\nuniform int uTrailCount;\nuniform vec2 uTrailPos[TRAIL_N];\nuniform float uTrailRadius[TRAIL_N];\n\n// Velocity-driven volume-preserving squash-and-stretch.\nuniform vec2 uVelocity; // smoothed pointer velocity (motion direction + speed)\nuniform float uStretch; // squash-stretch magnitude (0 = off)\n\nconst float PI = 3.141592653589793;\n", Ae = "\n", je = ke + Ae + we + `
|
|
505
|
+
${d}
|
|
506
|
+
|
|
507
|
+
` + De + Ae + Ce + `
|
|
506
508
|
|
|
507
|
-
` + Ee + Q + Se + Q + `
|
|
508
509
|
// --- Color (Ottosson OKLab/OKLCh — value.js EXACT constants, transposed) ---
|
|
509
510
|
//
|
|
510
511
|
// The OETF (srgbToLinear/linearToSrgb) + the four Ottosson matrices + their space
|
|
511
|
-
// conversions are
|
|
512
|
-
//
|
|
512
|
+
// conversions are spliced from src/composables/glass/procedural/color.glsl.ts.
|
|
513
|
+
// They live there
|
|
513
514
|
// ONCE so the OETF can never diverge from aurora's; the line-for-line TS port
|
|
514
515
|
// (__tests__/metaball-color.glsl-port.ts) mirrors that chunk. The gamut-clamp
|
|
515
516
|
// below stays blob-local (aurora has no in-shader OKLCh path).
|
|
516
|
-
${
|
|
517
|
-
${
|
|
517
|
+
${m}
|
|
518
|
+
${g}
|
|
518
519
|
|
|
519
|
-
` + De + Q + "\n// AX.W15 — de-synced breath. The body throb was a single sin(uPulsePhase) — a\n// mechanical pulse that re-syncs every cycle. Three DETUNED sines at IRRATIONAL\n// frequency ratios (1, 0.13/0.09 ≈ 1.444, 0.31) never re-phase, so the membrane\n// breathes like a living creature (an asymmetric slower-exhale calm band) rather\n// than a metronome. Normalized so the composite stays in ~[-1, 1].\nfloat breath(float phase) {\n return (sin(phase)\n + 0.5 * sin(phase * 1.4444 + 1.7)\n + 0.28 * sin(phase * 0.31 + 4.1)) / 1.78;\n}\n\n// AX.W15 — the composite SDF field WITH its ANALYTIC GRADIENT, returned as\n// vec3(dist, ∂d/∂x, ∂d/∂y). The domain-warped body membrane smin-merged with the\n// satellites + trail; the gradient propagates through sminG's mix(a.yz, b.yz, h)\n// so the surface normal reads the field gradient DIRECTLY (the 4-tap finite\n// difference is DELETED — its 4 full evals per lit pixel are gone).\n//\n// The ANISOTROPIC SQUASH (W10 volume-preserving stretch) is a linear map\n// bodyUv = D·R·uv (R rotates world→(motion-axis, perp); D = diag(1/sa, sa)). The\n// body field's gradient is computed in bodyUv space, so it MUST be transformed back\n// to uv space by M^T = R^T·D (the inverse-transpose handling the SOTA-deepening [2]\n// warns the 4-tap did implicitly by sampling in screen space).\nvec3 sceneDistG(vec2 uv) {\n // De-synced pulsing body radius.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Velocity-driven VOLUME-PRESERVING squash-and-stretch (W10), SATURATED (AX.W46\n // D5). sa is the stretch along motion, EXACTLY 1/sa perpendicular (area-preserving).\n // The basis (ax, perp) is captured so the gradient can be transformed back below.\n //\n // The W10 form sa = 1 + speed*uStretch rode an UNBOUNDED critically-damped spring\n // velocity (O(5-8)/s on a fast flick) -> sa ~ 1.78-2.25x elongation, a violent\n // taffy-pull. A tanh saturation sa = 1 + tanh(speed*k)*uStretch caps the elongation\n // at 1 + uStretch (~1.5x at the default stretch 0.5) no matter how fast the flick —\n // the fastest flick reads as a lively bounce, never a rubber-band snap (the standard\n // volume-preserving squash-and-stretch restraint). k = 1.6 keeps the tanh in its\n // near-linear regime for a slow drag (the gentle squash still reads) and saturates\n // only the fast flick.\n vec2 bodyUv = uv;\n vec2 ax = vec2(1.0, 0.0);\n vec2 perp = vec2(0.0, 1.0);\n float sa = 1.0;\n float speed = length(uVelocity);\n bool squashed = uStretch > 0.0 && speed > 1e-4;\n if (squashed) {\n ax = uVelocity / speed;\n perp = vec2(-ax.y, ax.x);\n sa = 1.0 + tanh(speed * 1.6) * uStretch;\n bodyUv = vec2(dot(uv, ax) / sa, dot(uv, perp) * sa);\n }\n\n // Domain-warped FBM displacement WITH its analytic gradient (the warp-Jacobian\n // approximation per [2]). disp = (noiseVal - 0.5) · uNoiseAmp; its gradient in\n // bodyUv space is uNoiseAmp · uNoiseFreq · fbmGrad (the uNoiseFreq chain factor\n // from the bodyUv·uNoiseFreq argument).\n vec3 fbmv = fbmWarpedG(bodyUv * uNoiseFreq + uTime * uNoiseSpeed, 3, uWarpAmp);\n float bodyDisplacement = (fbmv.x - 0.5) * uNoiseAmp;\n vec2 dispGradBody = uNoiseAmp * uNoiseFreq * fbmv.yz;\n\n // Body circle WITH gradient (in bodyUv space). The displaced radius subtracts\n // the displacement, so the body gradient is circleGrad - dispGrad (sign per\n // [2]: d = circleDist - displacement ⇒ grad = circleGrad - dispGrad).\n vec3 bodyG = sdgCircle(bodyUv, vec2(0.0), bodyR + bodyDisplacement);\n vec2 bodyGradBody = bodyG.yz - dispGradBody;\n\n // Transform the body gradient back to uv space: g_uv = R^T · D · g_body, i.e.\n // scale by D = diag(1/sa, sa) in the (ax, perp) frame then reconstruct in world.\n vec2 bodyGradUv;\n if (squashed) {\n vec2 scaled = vec2(bodyGradBody.x / sa, bodyGradBody.y * sa);\n bodyGradUv = scaled.x * ax + scaled.y * perp;\n } else {\n bodyGradUv = bodyGradBody;\n }\n vec3 d = vec3(bodyG.x, bodyGradUv);\n\n // Satellites — smin-merged into the body (uMerge selects quadratic/circular).\n for (int i = 0; i < MAX_SATS; i++) {\n if (i >= uSatCount) break;\n vec3 satG = sdgCircle(uv, uSatPos[i], uSatRadius[i]);\n satG.x += (1.0 - uSatOpacity[i]) * 0.3;\n d = sminG(d, satG, uSmoothK);\n }\n\n // Pointer trail — a decaying-radius pseudopod reaching toward the cursor,\n // smin-merged so it stretches an elastic limb and snaps back.\n for (int i = 0; i < TRAIL_N; i++) {\n if (i >= uTrailCount) break;\n vec3 trailG = sdgCircle(uv, uTrailPos[i], uTrailRadius[i]);\n d = sminG(d, trailG, uSmoothK);\n }\n return d;\n}\n\n// AX.W15 — the analytic surface normal. The field gradient grad2d arrives\n// DIRECTLY from sceneDistG (no 4-tap). The smin field is sub-unit (the CD family\n// |grad| ≤ 1) so the gradient is NOT unit-length — normalize() before the dome\n// lift (the unit contract is on the FINAL lifted normal N, not the raw field\n// gradient). The Z dome: 'interior' is the normalized depth inward from the rim\n// (-d/bodyR); z = sqrt(1 - (1 - interior)^2) is the unit half-sphere profile (flat\n// centre, steep rim). N tilts outward along the field gradient near the rim and\n// points at the viewer deep inside.\nvec3 surfaceNormalFromGrad(vec2 grad2d, float d, float bodyR) {\n vec2 g = normalize(grad2d + vec2(1e-6));\n float interior = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0);\n float z = sqrt(max(0.0, 1.0 - (1.0 - interior) * (1.0 - interior)));\n return normalize(vec3(g * (1.0 - z), z) + vec3(0.0, 0.0, 1e-6));\n}\n\n// BC.W-GOOBLOB-MEATBALL — the 2D SDF soft-shadow march (IQ rmshadows improved-penumbra,\n// research/viz/goo-blob.md §2.3, §5). The GLSL twin of the WGSL softShadow2D — a procedural\n// soft contact shadow FOLLOWING the irregular metaball silhouette (NOT a hard disc/box\n// shadow). Marches from ro along rd (the in-plane projection of uLightDir),\n// accumulating the closest miss via the Aaltonen penumbra (y = h*h/(2*ph) + d =\n// sqrt(h*h - y*y)) that kills the banding the naive res = min(res, h/(w*t)) shows. CHEAP:\n// 24 steps, re-uses the SAME sceneDistG().x field (NO separate field re-eval, NO FBO/\n// multi-pass — the procedural field needs none). w is the penumbra hardness (inverse\n// light-source size -> uShadowSoftness). Derivative-FREE. Returns 1.0 (lit) -> 0.0 (occluded).\nfloat softShadow2D(vec2 ro, vec2 rd, float mint, float maxt, float w) {\n float res = 1.0;\n float ph = 1e20;\n float t = mint;\n for (int i = 0; i < 24; i++) {\n if (t >= maxt) break;\n float h = sceneDistG(ro + rd * t).x;\n if (h < 0.001) return 0.0;\n float y = h * h / (2.0 * ph);\n float dd = sqrt(max(h * h - y * y, 0.0));\n res = min(res, dd / (w * max(0.001, t - y)));\n ph = h;\n t += h;\n }\n return clamp(res, 0.0, 1.0);\n}\n\n// W11.b — sample the multi-stop palette at t in [0,1], interpolating adjacent\n// stops in OKLab with a MIDPOINT CHROMA-BUMP (a linear OKLab mix of a vivid pair\n// dips chroma through grey; the bump lifts it back). Falls back to uBaseColor when\n// uStopCount <= 1. Returns an OKLCh stop [L, C, h(rad)].\nvec3 samplePaletteOklch(float t) {\n if (uStopCount <= 1) return oklabToOklch(srgbToOklab(uBaseColor));\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 // Fetch adjacent stops (uPalette is gamma sRGB) → OKLab.\n vec3 labA = srgbToOklab(uPalette[i0]);\n vec3 labB = srgbToOklab(uPalette[i1]);\n vec3 lab = mix(labA, labB, f);\n vec3 lch = oklabToOklch(lab);\n // Midpoint chroma-bump: a bell (peaks at f=0.5) lifts C off the grey midpoint.\n lch.y += 0.03 * sin(PI * f);\n return lch;\n}\n\n// F9.R1 (BG.W-BLOB-SATELLITE-SHADE) — the per-satellite explicit-shade blend. The GL\n// color-seam widen value.js's hero blob asked for (the BA-VJS-5 / C-1 residual, the\n// W-GOO-REDRESS arm-B book discharged). DEFAULT OFF: uSatColorActive == 0 returns oklch\n// UNCHANGED (uniform control flow, zero cost, byte-identical to HEAD). When ON, each\n// satellite carrying a positive uSatColorAmt tints the fragments in its smin-field\n// neighbourhood toward its explicit shade — mixed in OKLab (the samplePaletteOklch\n// convention; no hue wrap). The proximity weight rides the SAME opacity-inflated distance\n// the sceneDistG satellite term uses, so a fading satellite's tint fades with it. The\n// body keeps the derived palette base (no uBodyColor fork — the ask is per-SATELLITE).\nvec3 blendSatColor(vec3 oklch, vec2 uv) {\n if (uSatColorActive == 0) return oklch;\n vec3 lab = oklchToOklab(oklch);\n for (int i = 0; i < MAX_SATS; i++) {\n if (i >= uSatCount) break;\n float amt = clamp(uSatColorAmt[i], 0.0, 1.0);\n if (amt <= 0.0) continue;\n // Proximity: 1 well inside satellite i, fading to 0 across the smin band. The\n // opacity-inflated distance matches sceneDistG's satellite term.\n float di = sdCircle(uv, uSatPos[i], uSatRadius[i]) + (1.0 - uSatOpacity[i]) * 0.3;\n float w = (1.0 - smoothstep(-uSatRadius[i], uSmoothK, di)) * amt;\n lab = mix(lab, srgbToOklab(uSatColor[i]), clamp(w, 0.0, 1.0));\n }\n return oklabToOklch(lab);\n}\n\nvoid main() {\n vec2 uv = vUv - 0.5;\n\n // AX.W16 (arm 5) — PRE-FBM bounding early-out. The oversized canvas (1.6x the\n // wrapper) runs the full fragment ALU — two 3-octave FBM evals + the OKLCh\n // round-trip + the lit/iridescence/SSS block — on a large transparent border\n // otherwise (~60% of the canvas is outside the droplet reach). Any fragment beyond\n // uMaxReach (the PADDED worst-case painted reach, uploaded so it never clips the\n // wet meniscus) writes transparent and returns BEFORE any of that work. This is a\n // transparent WRITE, NOT a GLSL discard: the pass is a pure premultiplied blend\n // with no depth, and discard disables the tiled-renderer fast path on mobile GPUs.\n // No fwidth is computed before the return, so there is no\n // derivative-in-non-uniform-control-flow hazard (the kept pixels compute their own\n // fwidth normally below). The pad covers the pointer-lean uv shift, so testing the\n // pre-deform uv is safe.\n if (dot(uv, uv) > uMaxReach * uMaxReach) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Pointer deformation — honor the SIGN of uPointerAttraction (W10): a positive\n // attraction leans the body IN toward the cursor, a negative shies it AWAY. The\n // signed influence flows straight into the UV shift (no hardcoded repulsion).\n //\n // AY.W-BLOB-CONFIG D2 — the SIGN was INVERTED in the rendered result. The\n // sample-shift sign here was uv -= dir*influence; the live readback (an attraction\n // sweep over a HELD pointer) measured the body shifting MORE toward the cursor as\n // attraction went MORE NEGATIVE (a=-1 -> +0.081, a=0 -> +0.063, a=+1 -> +0.042) —\n // exactly inverted: a shy-away -1 LUNGED at the cursor, a lean-in +1 pulled back.\n // pointerDir = uPointer - uv is the toward-pointer direction in SAMPLE space; to\n // MOVE the rendered body TOWARD the pointer the sample must shift ALONG pointerDir\n // (sample the field from where the pointer is), so the sign is uv += dir*influence.\n // A positive attraction now shifts the body toward the cursor (leans in), a negative\n // shifts it away (shies) — the sign the comment + the demo slider always promised,\n // now true in the render.\n //\n // AX.W46 D5 — the falloff radius NARROWS 0.65 → 0.5 (the calm-lean reconciliation).\n // The W15 REDRESS widened it to 0.65 to clear a synthetic floor; the live π-lane\n // read the result as a LUNGE. The drama lives in the STRENGTH (pointerStrength,\n // dropped to 0.18 in types.ts), NOT the falloff — the falloff's job is purely to keep\n // the lean COHERENT across the creature so the body, satellites and trail all tilt\n // toward the cursor as ONE. At 0.5 the body (sitting ≈0.2 uv from the cursor on a\n // hover-flick) is still well inside the cutoff, so the whole creature tilts as one —\n // a gentle, coherent \"it notices you\" lean rather than the body lunging a body-width.\n if (uPointerActive > 0.5) {\n vec2 pointerDir = uPointer - uv;\n float pointerDist = length(pointerDir);\n float influence = smoothstep(0.5, 0.0, pointerDist) * uPointerAttraction * uPointerStrength;\n uv += normalize(pointerDir + 1e-6) * influence;\n }\n\n // The de-synced pulsing body radius — also reused below for the inner-glow scale.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Composite domain-warped membrane field WITH its analytic gradient (AX.W15).\n vec3 scene = sceneDistG(uv);\n float d = scene.x;\n vec2 fieldGrad = scene.yz;\n\n // Edit #1 — fwidth-based anti-aliased edge: derive the smoothstep half-width\n // from the SDF screen-space gradient so the edge stays ~1px regardless of zoom.\n float aa = max(fwidth(d), 1e-6);\n float alpha = 1.0 - smoothstep(-aa, aa, d);\n\n if (alpha < 0.001) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Edit #4 — perceptually-uniform OKLCh variation. Gamma base → linear → OKLab\n // → OKLCh; perturb L/C/h; OKLCh → OKLab → linear; hue-preserving gamut clamp.\n // The base is the multi-stop palette sample (W11.b) — distributed across the\n // body/satellites by the color noise field — or uBaseColor when single-stop.\n float colorNoise = fbm(uv * uColorNoiseFreq + uTime * uColorNoiseSpeed, 3);\n vec3 oklch = samplePaletteOklch(colorNoise);\n // F9.R1 — per-satellite explicit shade (default no-op at uSatColorActive == 0).\n oklch = blendSatColor(oklch, uv);\n\n oklch.z += (colorNoise - 0.5) * uHueRange * (PI / 180.0); // hue swing, radians\n oklch.y = max(oklch.y + (colorNoise - 0.5) * uSatShift, 0.0); // chroma swing\n oklch.x = clamp(oklch.x + uBrightnessShift, 0.0, 1.0); // lightness bias\n\n // ── BD.W-GOO-CAROUSEL-DECK — the blob to meatball SHADING MORPH (uMorphT). ──\n // The user #1 ask: the goo should MORPH BLOB and MEATBALL from one to another\n // — a CONTINUOUS in-between, not a hard variant cut. The KEY FACT: the body\n // GEOMETRY is IDENTICAL across blob/meatball (the smin SDF field, the satellites,\n // the fwidth-AA — all computed ABOVE, before this gate). ONLY the SURFACE shading\n // (flat fill vs lit/shadow/iridescence/SSS) differs. So the morph is a uMorphT\n // scalar LERPING the SHADING — NOT a geometry rebuild, NOT a path interpolation.\n //\n // uMorphT = 0 -> the flat warm-cream blob (the STAGE-1 floor, byte-identical to\n // the old uStage > 0.5 early-return);\n // uMorphT = 1 -> the lit meatball (the full STAGE-2 dressing, byte-identical to\n // the old else path);\n // 0 < uMorphT < 1 -> the CONTINUOUS in-between (the morph the user asked for).\n //\n // uMorphT resolves from variant for back-compat (blob -> 0, meatball -> 1); a\n // consumer ANIMATING config.morphT 0..1 gets the live morph. The smin field is\n // byte-UNTOUCHED (the geometry is shared — that is the whole point).\n //\n // The flat color is computed ALWAYS (cheap); the EXPENSIVE dressing (the soft-shadow\n // secondary march) is gated uMorphT > 0.0 so a pure blob pays ZERO shadow-march\n // cost (the SLOW-fix discipline — a flat blob is as cheap as the old early-return).\n float morphT = clamp(uMorphT, 0.0, 1.0);\n\n // STAGE-1 flat fill — the warm-cream blob color, off the PRE-dressing oklch (the\n // dressing mutates oklch below, so the flat read must snapshot it here).\n vec3 flatOkl = gamutClampOklch(oklch);\n vec3 flatLin = oklabToLinearSrgb(oklchToOklab(flatOkl));\n vec3 flatRgb = clamp(linearToSrgb(flatLin), 0.0, 1.0);\n\n // If we are fully flat (a pure blob, morphT == 0), emit the flat fill + dither and\n // return — the byte-identical STAGE-1 floor, zero dressing cost.\n if (morphT <= 0.0) {\n float ign1 = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));\n flatRgb = clamp(flatRgb + (ign1 - 0.5) / 255.0, 0.0, 1.0);\n fragColor = vec4(flatRgb * alpha, alpha);\n return;\n }\n\n // Surface normal — from the ANALYTIC field gradient (AX.W15: the 4-tap is\n // deleted). Computed ONCE here and reused by the iridescence (W11.a), the\n // fake-SSS (W11.a), and the lit glass block (W9.b).\n vec3 N = surfaceNormalFromGrad(fieldGrad, d, bodyR);\n vec3 V = vec3(0.0, 0.0, 1.0);\n float thickness = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0); // 0 at rim, ~1 deep in\n float fres = pow(1.0 - max(dot(N, V), 0.0), 2.5); // rim-weighted angle\n\n // ── W11.a iridescence — warm-biased IQ cosine palette driving OKLCh HUE ──\n //\n // A thin-film-like sheen on the RIM (fres-weighted), NOT the cold-blue default:\n // an IQ cosine palette (a + b*cos(2pi(c*t + d))) maps the Fresnel/edge angle +\n // the FBM color field + an animated thickness onto a HUE OFFSET biased to the\n // warm arc (uIridHue), with the chroma clamped to a warm-pearl band so the rim\n // reads cream/gold (congruent with the warm-cream-glass identity). Mixed into\n // OKLCh BEFORE the gamut clamp. Default LOW.\n if (uIridescence > 0.0) {\n float t = fres + 0.3 * colorNoise + uTime * uIridSpeed;\n // Cosine palette in HUE space, centred on the warm uIridHue (~0.18 turn of\n // warm sweep so the sheen shimmers gold→peach, never swinging to cold blue).\n float iridHue = uIridHue + 0.18 * PI * cos(2.0 * PI * t);\n float w = fres * uIridescence; // rim-weighted blend\n oklch.z = mix(oklch.z, iridHue, w);\n // Warm-pearl chroma cap: lift chroma toward a pale-pearl band, clamped.\n oklch.y = min(oklch.y + 0.04 * w, oklch.y + 0.08);\n oklch.x = min(oklch.x + 0.05 * w, 1.0); // a touch brighter at the sheen\n }\n\n // ── W11.a fake subsurface translucency — thickness inner-glow + back-light ──\n //\n // A bright translucent CORE fading to a light-leaking EDGE (the -d ramp) plus\n // the fast-SSS back-light (light wrapping through the thin rim). Both lift OKLCh\n // L and warm the hue, consuming the W9 normal. In OKLCh before the gamut clamp.\n if (uCoreGlow > 0.0 || uSssScale > 0.0) {\n // Beer-Lambert inner luminosity (AX.W15): a SATURATING 1 - exp(-k·thickness)\n // curve — a flat thick core with a fast warm rim falloff — NOT the linear\n // coreGlow·thickness ramp (which over-brightens deep interiors). k ≈ 3 reads\n // as glass depth.\n oklch.x = min(oklch.x + uCoreGlow * (1.0 - exp(-3.0 * thickness)), 1.0);\n // Fast-SSS back-light: light wrapping through the thin (low-thickness) rim.\n vec3 L = normalize(uLightDir + vec3(1e-6));\n float back = pow(clamp(dot(V, -(L + N * thickness)), 0.0, 1.0), uSssPower);\n float sss = back * uSssScale * (1.0 - thickness);\n oklch.x = min(oklch.x + sss, 1.0);\n // Warm the THIN leaking rim only (scale by 1 - thickness): the SSS hue-warm\n // shift rides the rim, not the core (AX.W15 — only the thin rim warms).\n oklch.z += sss * 0.1 * (1.0 - thickness);\n }\n\n // ── BC.W-GOOBLOB-MEATBALL — the soft contact shadow (T2, the GLSL twin). A procedural\n // soft shadow FOLLOWING the irregular silhouette: march from this fragment's uv\n // toward the in-plane projection of uLightDir; where the metaball field occludes the\n // light, DARKEN the OKLCh L — a soft grounded contact band under the dome\n // (PROCEDURAL, silhouette-following, unlike the static CSS gel-dome drop-shadow).\n // Rim-weighted (1 - thickness) so the lit interior stays bright. Gated uShadow > 0.5;\n // variant=blob (STAGE 1) ships shadowless via the uStage early-return above. ──\n if (uShadow > 0.5) {\n vec2 L2 = normalize(uLightDir.xy + vec2(1e-6));\n float sh = softShadow2D(uv, L2, max(aa, 0.004), bodyR * 1.5, max(uShadowSoftness, 4.0));\n // The contact band sits on the LOWER rim (the side AWAY from the light), gated by\n // the away-facing rim weight + a thin-rim Gaussian band (peak thickness ≈ 0.18) so\n // the deep-lit interior + the light-facing edge stay BRIGHT (the warm-cream body\n // mean + the proof:blob-warm-default floor hold). The 0.20 cap is a soft grounding.\n float away = clamp(-dot(normalize(fieldGrad + vec2(1e-6)), L2), 0.0, 1.0);\n float band = exp(-pow((thickness - 0.18) / 0.16, 2.0));\n float shadowDarken = (1.0 - sh) * away * band * 0.20;\n oklch.x = max(oklch.x - shadowDarken, 0.0);\n }\n\n oklch = gamutClampOklch(oklch);\n\n vec3 lin = oklabToLinearSrgb(oklchToOklab(oklch));\n\n // ── W9.b lit glass surface — Blinn-Phong glint + Fresnel rim, in LINEAR ──\n //\n // The lit terms enter lin in LINEAR space BEFORE the OETF (linearToSrgb)\n // and BEFORE the * alpha premultiply — a post-OETF apply double-gammas the\n // highlight and fringes the premultiplied edge (the named A5/A2 trap). The\n // prior flat inner-glow lift is SUBSUMED by the Fresnel rim (the curvature\n // read now comes from the surface normal, not a flat smoothstep). Gated behind\n // uLit so the flat fill stays the default (zero regression).\n if (uLit > 0.5) {\n // N, V, thickness are already computed in main() (reused by iridescence/SSS).\n vec3 L = normalize(uLightDir + vec3(1e-6)); // light direction\n vec3 H = normalize(L + V); // Blinn-Phong half-vector\n\n // Warm-cream specular glint — a near-white OKLCh TINT (L~0.97, C~0.03,\n // hue~85°) routed through the SAME spliced OKLCh matrices, NOT hardcoded\n // sRGB white (pure white reads cheap-CG). Linearized for the linear add.\n vec3 warmCream = oklabToLinearSrgb(oklchToOklab(vec3(0.97, 0.03, radians(85.0))));\n\n // ENERGY-CONSERVING Blinn-Phong (AX.W15 [9]): the (shininess+2)/8 factor\n // DECOUPLES shininess from strength (without it, raising shininess dims the\n // glint, so the two knobs fight). SPECULAR ANTIALIASING: the FBM membrane\n // makes the normal vary fast, so a tight glint (16-64) STROBES on small\n // dock-grid blobs. Widen the effective lobe where the normal varies\n // (Toksvig-style fwidth clamp) — drop shininess, NOT raise it. nVar reads\n // the screen-space normal derivative; a high-variance pixel softens the\n // exponent so the glint stays stable.\n float nVar = length(fwidth(N));\n float shininess = uSpecShininess / (1.0 + 24.0 * nVar);\n float energyNorm = (shininess + 2.0) / 8.0;\n float spec = pow(max(dot(N, H), 0.0), shininess) * uSpecStrength * energyNorm;\n\n // Fresnel/Schlick rim — fed uRimColor (the --foreground warm rim via the\n // /color leaf). FOREGROUND-AWARE MIN-CONTRAST GUARD (AX.W15 [10]):\n // a var(--primary) blob in dark mode resolves a rim near the BODY color, so\n // the rim washes out (no contrast). When the rim's luminance sits too close\n // to the body's, the guard CHROMA-REDUCES and L-LIFTS the rim stop (a\n // perceptual move, NOT a re-tint) so the curved rim always reads. Computed in\n // OKLCh so the lift is perceptual.\n vec3 rimOkl = oklabToOklch(srgbToOklab(uRimColor));\n float bodyL = oklch.x; // the post-perturb body lightness\n float dL = abs(rimOkl.x - bodyL);\n // If the rim is within 0.22 L of the body, push it AWAY (lift if the body is\n // dark, the dark-mode primary case; the chroma-reduce keeps it neutral-warm).\n float lack = clamp((0.22 - dL) / 0.22, 0.0, 1.0);\n rimOkl.x = clamp(mix(rimOkl.x, (bodyL < 0.5 ? 0.92 : 0.18), lack), 0.0, 1.0);\n rimOkl.y *= mix(1.0, 0.5, lack); // chroma-reduce toward a pale pearl\n vec3 rimLin = oklabToLinearSrgb(oklchToOklab(rimOkl));\n\n float rimFres = pow(1.0 - max(dot(N, V), 0.0), uRimPower);\n float rim = rimFres * uRimStrength * (1.0 - 0.6 * thickness);\n\n // Combine the two warm highlights and add in LINEAR. max(spec, rim*scale)\n // keeps the glint from stacking on the rim into a blown hotspot.\n //\n // AX.W46 D4 — CLAMP the linear highlight below unity before the add (the\n // belt-and-braces guard the re-derived specStrength makes rarely-binding but\n // never lets a worst-case normal blow to a hard white spot). The energy-\n // conserving Blinn-Phong CAN still spike on a grazing normal where the Toksvig\n // widen has not kicked in; capping the highlight magnitude at 0.85 (a contained\n // warm gleam, sub-unity) means the OETF clamp below can never crush a\n // pure-white pixel over the dome. The cap is on the highlight ALONE (not the\n // composited lin), so the body color underneath is untouched — it caps only\n // the additive catch-light's energy.\n vec3 highlight = max(warmCream * spec, rimLin * rim);\n highlight = min(highlight, vec3(0.85));\n lin += highlight;\n }\n\n vec3 rgb = clamp(linearToSrgb(lin), 0.0, 1.0); // MANDATORY OETF — closes the seam\n\n // ── BD.W-GOO-CAROUSEL-DECK — the blob to meatball SHADING MORPH compose. ──\n // rgb is the fully-dressed meatball surface; flatRgb (snapshotted before the\n // dressing) is the flat blob fill. The morph is a CONTINUOUS lerp between them on\n // morphT — at morphT==1 it is byte-identical to the dressed meatball, and the\n // morphT==0 case already returned the flat fill above. The geometry (alpha/silhouette)\n // is shared, so only the SURFACE shading interpolates (the morph from one to\n // another). The dither below applies to the composited result.\n rgb = mix(flatRgb, rgb, morphT);\n\n // IGN dither (AX.W15 [2][9]) — the low-chroma warm-cream dome BANDS on 8-bit\n // panels (visible Mach steps in the smooth L roll). Interleaved-gradient noise at\n // 1/255, applied AFTER linearToSrgb and BEFORE the *alpha premultiply (aurora\n // ships the same splice). A triangular ±0.5 LSB dither decorrelates the steps.\n float ign = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));\n rgb = clamp(rgb + (ign - 0.5) / 255.0, 0.0, 1.0);\n\n // Edit #8 — premultiply AFTER the OETF: straight-alpha gamma → premultiplied.\n fragColor = vec4(rgb * alpha, alpha);\n}";
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
function Ae(e, t, n, r, i, a, o, s, c) {
|
|
523
|
-
let { U: l, satPosLocs: u, satRadLocs: d, satOpLocs: f, satColorLocs: p, satColorAmtLocs: m, trailPosLocs: h, trailRadLocs: g, paletteLocs: _ } = r, { params: v, rgb: y, simTimeMs: b, timeSec: x, resolveColor: S, rimColor: C, paletteStops: w } = c, { geometry: T, membrane: E, color: D, surface: O, interaction: k } = a;
|
|
524
|
-
e.useProgram(t), e.bindVertexArray(n), e.uniform2f(l.uResolution, i.width, i.height), e.uniform1f(l.uTime, b / 1e3), e.uniform3f(l.uBaseColor, y[0], y[1], y[2]);
|
|
525
|
-
let A = w, j = Math.min(A.length, 4);
|
|
526
|
-
e.uniform1i(l.uStopCount, j);
|
|
527
|
-
for (let t = 0; t < 4; t++) {
|
|
528
|
-
let n = _[t] ?? null, r = A[t];
|
|
529
|
-
if (r) {
|
|
530
|
-
let t = S(r);
|
|
531
|
-
e.uniform3f(n, t[0], t[1], t[2]);
|
|
532
|
-
} else e.uniform3f(n, y[0], y[1], y[2]);
|
|
533
|
-
}
|
|
534
|
-
let M = c.satColors ?? [], N = +!!M.some((e) => !!e);
|
|
535
|
-
e.uniform1i(l.uSatColorActive, N);
|
|
536
|
-
for (let t = 0; t < 4; t++) {
|
|
537
|
-
let n = p[t] ?? null, r = m[t] ?? null, i = M[t];
|
|
538
|
-
if (i) {
|
|
539
|
-
let t = S(i);
|
|
540
|
-
e.uniform3f(n, t[0], t[1], t[2]), e.uniform1f(r, 1);
|
|
541
|
-
} else e.uniform3f(n, y[0], y[1], y[2]), e.uniform1f(r, 0);
|
|
542
|
-
}
|
|
543
|
-
let P = o.pointer.value, F = k.pointerAttraction + v.pointerAttraction;
|
|
544
|
-
e.uniform2f(l.uPointer, P.x * .5 * R, P.y * .5 * R), e.uniform1f(l.uPointerActive, +!!o.active.value), e.uniform1f(l.uPointerAttraction, F), e.uniform1f(l.uPointerStrength, k.pointerStrength * R);
|
|
545
|
-
let I = Math.max(0, Math.min(1, F)), L = o.velocity.value;
|
|
546
|
-
e.uniform2f(l.uVelocity, L.x * .5 * R, L.y * .5 * R), e.uniform1f(l.uStretch, k.stretch);
|
|
547
|
-
let z = o.trailSources(T.satelliteRadius * .7 * I);
|
|
548
|
-
e.uniform1i(l.uTrailCount, z.count);
|
|
549
|
-
for (let t = 0; t < 15; t++) {
|
|
550
|
-
let n = h[t] ?? null, r = g[t] ?? null, i = z.sources[t];
|
|
551
|
-
i ? (e.uniform2f(n, i.x * .5 * R, i.y * .5 * R), e.uniform1f(r, i.radius * R)) : (e.uniform2f(n, 0, 0), e.uniform1f(r, 0));
|
|
552
|
-
}
|
|
553
|
-
e.uniform1f(l.uBodyRadius, T.bodyRadius * R), e.uniform1f(l.uPulsePhase, x * E.pulseFreq * v.pulseFreq * Math.PI * 2);
|
|
554
|
-
let B = o.pulse.value * k.clickImpulse;
|
|
555
|
-
e.uniform1f(l.uPulseAmp, (E.pulseAmp * v.pulseAmp / .015 + B) * R), e.uniform1f(l.uNoiseAmp, E.noiseAmp * v.noiseAmp / .025 * R), e.uniform1f(l.uNoiseFreq, E.noiseFreq), e.uniform1f(l.uNoiseSpeed, E.noiseSpeed), e.uniform1f(l.uWarpAmp, E.warpAmp);
|
|
556
|
-
let V = T.orbitRadius * 1.2 * (1 + T.eccentricity), H = E.smoothK * v.smoothK, U = Math.max(0, V - T.satelliteRadius - T.bodyRadius), ee = H > 0 ? Math.min(1.25, 1 + U / H) : 1;
|
|
557
|
-
e.uniform1f(l.uSmoothK, H * ee * R), e.uniform1f(l.uMerge, +(E.merge === "circular"));
|
|
558
|
-
let W = typeof a.morphT == "number" ? Math.max(0, Math.min(1, a.morphT)) : a.variant === "blob" ? 0 : 1;
|
|
559
|
-
e.uniform1f(l.uMorphT, W), e.uniform1f(l.uStage, +(W <= 0));
|
|
560
|
-
let te = (a.surface.fissionAmp ?? 0) > 0 ? ae * 1.12 : 0, ne = Math.max(V, te) + T.satelliteRadius, re = (Math.max(T.bodyRadius, ne) + H * ee + E.noiseAmp * v.noiseAmp / .025 + Math.abs(o.pulse.value) * k.clickImpulse) * R + .1;
|
|
561
|
-
e.uniform1f(l.uMaxReach, re), e.uniform1f(l.uHueRange, D.hueRange + v.hueRange), e.uniform1f(l.uSatShift, D.satShift + v.satShift), e.uniform1f(l.uBrightnessShift, D.brightnessShift + v.brightnessShift), e.uniform1f(l.uColorNoiseFreq, D.colorNoiseFreq), e.uniform1f(l.uColorNoiseSpeed, D.colorNoiseSpeed);
|
|
562
|
-
let G = W > 0;
|
|
563
|
-
e.uniform1f(l.uLit, G && O.lit ? 1 : 0);
|
|
564
|
-
let K = S(C);
|
|
565
|
-
e.uniform3f(l.uRimColor, K[0], K[1], K[2]), e.uniform3f(l.uLightDir, O.lightDir[0], O.lightDir[1], O.lightDir[2]), e.uniform1f(l.uSpecStrength, O.specStrength), e.uniform1f(l.uSpecShininess, O.specShininess), e.uniform1f(l.uRimPower, O.rimPower), e.uniform1f(l.uRimStrength, O.rimStrength), e.uniform1f(l.uShadow, G && O.shadow ? 1 : 0), e.uniform1f(l.uShadowSoftness, O.shadowSoftness), e.uniform1f(l.uIridescence, O.iridescence * v.iridScale), e.uniform1f(l.uIridHue, O.iridHue * (Math.PI / 180)), e.uniform1f(l.uIridSpeed, O.iridSpeed), e.uniform1f(l.uSssScale, O.sssScale * v.iridScale), e.uniform1f(l.uSssPower, O.sssPower), e.uniform1f(l.uCoreGlow, O.coreGlow);
|
|
566
|
-
let q = s.sources;
|
|
567
|
-
e.uniform1i(l.uSatCount, q.length);
|
|
568
|
-
for (let t = 0; t < 4; t++) {
|
|
569
|
-
let n = u[t] ?? null, r = d[t] ?? null, i = f[t] ?? null, a = q[t];
|
|
570
|
-
a ? (e.uniform2f(n, a.x * R, a.y * R), e.uniform1f(r, a.radius * R), e.uniform1f(i, a.opacity)) : (e.uniform2f(n, 0, 0), e.uniform1f(r, 0), e.uniform1f(i, 0));
|
|
571
|
-
}
|
|
572
|
-
e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), e.drawArrays(e.TRIANGLES, 0, 6), e.bindVertexArray(null);
|
|
573
|
-
}
|
|
574
|
-
//#endregion
|
|
575
|
-
//#region src/components/blob/composables/buildMetaballProgram.ts
|
|
576
|
-
var je = "[GooBlob]";
|
|
577
|
-
function Me(e) {
|
|
578
|
-
let t = p(e, e.VERTEX_SHADER, xe, je), n = p(e, e.FRAGMENT_SHADER, ke, je), r = f(e, t, n, je);
|
|
520
|
+
` + Oe + "\n\n// De-synced breath. The body throb was a single sin(uPulsePhase), a\n// mechanical pulse that re-syncs every cycle. Three DETUNED sines at IRRATIONAL\n// frequency ratios (1, 0.13/0.09 ≈ 1.444, 0.31) never re-phase, so the membrane\n// breathes like a living creature (an asymmetric slower-exhale calm band) rather\n// than a metronome. Normalized so the composite stays in ~[-1, 1].\nfloat breath(float phase) {\n return (sin(phase)\n + 0.5 * sin(phase * 1.4444 + 1.7)\n + 0.28 * sin(phase * 0.31 + 4.1)) / 1.78;\n}\n\n// The composite SDF field with its analytic gradient, returned as\n// vec3(dist, ∂d/∂x, ∂d/∂y). The domain-warped body membrane smin-merged with the\n// satellites + trail; the gradient propagates through sminG's mix(a.yz, b.yz, h)\n// so the surface normal reads the field gradient DIRECTLY (the 4-tap finite\n// difference is DELETED — its 4 full evals per lit pixel are gone).\n//\n// The ANISOTROPIC SQUASH (volume-preserving stretch) is a linear map\n// bodyUv = D·R·uv (R rotates world→(motion-axis, perp); D = diag(1/sa, sa)). The\n// body field's gradient is computed in bodyUv space, so it MUST be transformed back\n// to uv space by M^T = R^T·D (the inverse-transpose handling the SOTA-deepening [2]\n// warns the 4-tap did implicitly by sampling in screen space).\nvec3 sceneDistG(vec2 uv) {\n // De-synced pulsing body radius.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Velocity-driven, volume-preserving squash-and-stretch with saturated amplitude.\n // sa is the stretch along motion, exactly 1/sa perpendicular (area-preserving).\n // The basis (ax, perp) is captured so the gradient can be transformed back below.\n //\n // The form sa = 1 + speed*uStretch rode an UNBOUNDED critically-damped spring\n // velocity (O(5-8)/s on a fast flick) -> sa ~ 1.78-2.25x elongation, a violent\n // taffy-pull. A tanh saturation sa = 1 + tanh(speed*k)*uStretch caps the elongation\n // at 1 + uStretch (~1.5x at the default stretch 0.5) no matter how fast the flick —\n // the fastest flick reads as a lively bounce, never a rubber-band snap (the standard\n // volume-preserving squash-and-stretch restraint). k = 1.6 keeps the tanh in its\n // near-linear regime for a slow drag (the gentle squash still reads) and saturates\n // only the fast flick.\n vec2 bodyUv = uv;\n vec2 ax = vec2(1.0, 0.0);\n vec2 perp = vec2(0.0, 1.0);\n float sa = 1.0;\n float speed = length(uVelocity);\n bool squashed = uStretch > 0.0 && speed > 1e-4;\n if (squashed) {\n ax = uVelocity / speed;\n perp = vec2(-ax.y, ax.x);\n sa = 1.0 + tanh(speed * 1.6) * uStretch;\n bodyUv = vec2(dot(uv, ax) / sa, dot(uv, perp) * sa);\n }\n\n // Domain-warped FBM displacement WITH its analytic gradient (the warp-Jacobian\n // approximation per [2]). disp = (noiseVal - 0.5) · uNoiseAmp; its gradient in\n // bodyUv space is uNoiseAmp · uNoiseFreq · fbmGrad (the uNoiseFreq chain factor\n // from the bodyUv·uNoiseFreq argument).\n vec3 fbmv = fbmWarpedG(bodyUv * uNoiseFreq + uTime * uNoiseSpeed, 3, uWarpAmp);\n float bodyDisplacement = (fbmv.x - 0.5) * uNoiseAmp;\n vec2 dispGradBody = uNoiseAmp * uNoiseFreq * fbmv.yz;\n\n // Body circle WITH gradient (in bodyUv space). The displaced radius subtracts\n // the displacement, so the body gradient is circleGrad - dispGrad (sign per\n // [2]: d = circleDist - displacement ⇒ grad = circleGrad - dispGrad).\n vec3 bodyG = sdgCircle(bodyUv, vec2(0.0), bodyR + bodyDisplacement);\n vec2 bodyGradBody = bodyG.yz - dispGradBody;\n\n // Transform the body gradient back to uv space: g_uv = R^T · D · g_body, i.e.\n // scale by D = diag(1/sa, sa) in the (ax, perp) frame then reconstruct in world.\n vec2 bodyGradUv;\n if (squashed) {\n vec2 scaled = vec2(bodyGradBody.x / sa, bodyGradBody.y * sa);\n bodyGradUv = scaled.x * ax + scaled.y * perp;\n } else {\n bodyGradUv = bodyGradBody;\n }\n vec3 d = vec3(bodyG.x, bodyGradUv);\n\n // Satellites — smin-merged into the body (uMerge selects quadratic/circular).\n for (int i = 0; i < MAX_SATS; i++) {\n if (i >= uSatCount) break;\n vec3 satG = sdgCircle(uv, uSatPos[i], uSatRadius[i]);\n satG.x += (1.0 - uSatOpacity[i]) * 0.3;\n d = sminG(d, satG, uSmoothK);\n }\n\n // Pointer trail — a decaying-radius pseudopod reaching toward the cursor,\n // smin-merged so it stretches an elastic limb and snaps back.\n for (int i = 0; i < TRAIL_N; i++) {\n if (i >= uTrailCount) break;\n vec3 trailG = sdgCircle(uv, uTrailPos[i], uTrailRadius[i]);\n d = sminG(d, trailG, uSmoothK);\n }\n return d;\n}\n\n// The analytic surface normal. The field gradient grad2d arrives\n// DIRECTLY from sceneDistG (no 4-tap). The smin field is sub-unit (the CD family\n// |grad| ≤ 1) so the gradient is NOT unit-length — normalize() before the dome\n// lift (the unit contract is on the FINAL lifted normal N, not the raw field\n// gradient). The Z dome: 'interior' is the normalized depth inward from the rim\n// (-d/bodyR); z = sqrt(1 - (1 - interior)^2) is the unit half-sphere profile (flat\n// centre, steep rim). N tilts outward along the field gradient near the rim and\n// points at the viewer deep inside.\nvec3 surfaceNormalFromGrad(vec2 grad2d, float d, float bodyR) {\n vec2 g = normalize(grad2d + vec2(1e-6));\n float interior = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0);\n float z = sqrt(max(0.0, 1.0 - (1.0 - interior) * (1.0 - interior)));\n return normalize(vec3(g * (1.0 - z), z) + vec3(0.0, 0.0, 1e-6));\n}\n\n// The 2D SDF soft-shadow march (IQ rmshadows improved penumbra,\n// research/viz/goo-blob.md §2.3, §5). The GLSL twin of the WGSL softShadow2D — a procedural\n// soft contact shadow FOLLOWING the irregular metaball silhouette (NOT a hard disc/box\n// shadow). Marches from ro along rd (the in-plane projection of uLightDir),\n// accumulating the closest miss via the Aaltonen penumbra (y = h*h/(2*ph) + d =\n// sqrt(h*h - y*y)) that kills the banding the naive res = min(res, h/(w*t)) shows. CHEAP:\n// 24 steps, re-uses the SAME sceneDistG().x field (NO separate field re-eval, NO FBO/\n// multi-pass — the procedural field needs none). w is the penumbra hardness (inverse\n// light-source size -> uShadowSoftness). Derivative-FREE. Returns 1.0 (lit) -> 0.0 (occluded).\nfloat softShadow2D(vec2 ro, vec2 rd, float mint, float maxt, float w) {\n float res = 1.0;\n float ph = 1e20;\n float t = mint;\n for (int i = 0; i < 24; i++) {\n if (t >= maxt) break;\n float h = sceneDistG(ro + rd * t).x;\n if (h < 0.001) return 0.0;\n float y = h * h / (2.0 * ph);\n float dd = sqrt(max(h * h - y * y, 0.0));\n res = min(res, dd / (w * max(0.001, t - y)));\n ph = h;\n t += h;\n }\n return clamp(res, 0.0, 1.0);\n}\n\n// Sample the multi-stop palette at t in [0,1], interpolating adjacent\n// stops in OKLab with a MIDPOINT CHROMA-BUMP (a linear OKLab mix of a vivid pair\n// dips chroma through grey; the bump lifts it back). Falls back to uBaseColor when\n// uStopCount <= 1. Returns an OKLCh stop [L, C, h(rad)].\nvec3 samplePaletteOklch(float t) {\n if (uStopCount <= 1) return oklabToOklch(srgbToOklab(uBaseColor));\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 // Fetch adjacent stops (uPalette is gamma sRGB) → OKLab.\n vec3 labA = srgbToOklab(uPalette[i0]);\n vec3 labB = srgbToOklab(uPalette[i1]);\n vec3 lab = mix(labA, labB, f);\n vec3 lch = oklabToOklch(lab);\n // Midpoint chroma-bump: a bell (peaks at f=0.5) lifts C off the grey midpoint.\n lch.y += 0.03 * sin(PI * f);\n return lch;\n}\n\n// The per-satellite explicit-shade blend widens the GL color contract for the hero blob.\n// It is off by default: uSatColorActive == 0 returns oklch\n// UNCHANGED (uniform control flow, zero cost). When ON, each\n// satellite carrying a positive uSatColorAmt tints the fragments in its smin-field\n// neighbourhood toward its explicit shade — mixed in OKLab (the samplePaletteOklch\n// convention; no hue wrap). The proximity weight rides the SAME opacity-inflated distance\n// the sceneDistG satellite term uses, so a fading satellite's tint fades with it. The\n// body keeps the derived palette base (no uBodyColor fork — the ask is per-SATELLITE).\nvec3 blendSatColor(vec3 oklch, vec2 uv) {\n if (uSatColorActive == 0) return oklch;\n vec3 lab = oklchToOklab(oklch);\n for (int i = 0; i < MAX_SATS; i++) {\n if (i >= uSatCount) break;\n float amt = clamp(uSatColorAmt[i], 0.0, 1.0);\n if (amt <= 0.0) continue;\n // Proximity: 1 well inside satellite i, fading to 0 across the smin band. The\n // opacity-inflated distance matches sceneDistG's satellite term.\n float di = sdCircle(uv, uSatPos[i], uSatRadius[i]) + (1.0 - uSatOpacity[i]) * 0.3;\n float w = (1.0 - smoothstep(-uSatRadius[i], uSmoothK, di)) * amt;\n lab = mix(lab, srgbToOklab(uSatColor[i]), clamp(w, 0.0, 1.0));\n }\n return oklabToOklch(lab);\n}\n\nvoid main() {\n vec2 uv = vUv - 0.5;\n\n // Pre-FBM bounding early-out. The oversized canvas (1.6x the\n // wrapper) runs the full fragment ALU — two 3-octave FBM evals + the OKLCh\n // round-trip + the lit/iridescence/SSS block — on a large transparent border\n // otherwise (~60% of the canvas is outside the droplet reach). Any fragment beyond\n // uMaxReach (the PADDED worst-case painted reach, uploaded so it never clips the\n // wet meniscus) writes transparent and returns BEFORE any of that work. This is a\n // transparent WRITE, NOT a GLSL discard: the pass is a pure premultiplied blend\n // with no depth, and discard disables the tiled-renderer fast path on mobile GPUs.\n // No fwidth is computed before the return, so there is no\n // derivative-in-non-uniform-control-flow hazard (the kept pixels compute their own\n // fwidth normally below). The pad covers the pointer-lean uv shift, so testing the\n // pre-deform uv is safe.\n if (dot(uv, uv) > uMaxReach * uMaxReach) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Pointer deformation — honor the SIGN of uPointerAttraction: a positive\n // attraction leans the body IN toward the cursor, a negative shies it AWAY. The\n // signed influence flows straight into the UV shift (no hardcoded repulsion).\n //\n // The sign was inverted in the rendered result. The\n // sample-shift sign here was uv -= dir*influence; the live readback (an attraction\n // sweep over a HELD pointer) measured the body shifting MORE toward the cursor as\n // attraction went MORE NEGATIVE (a=-1 -> +0.081, a=0 -> +0.063, a=+1 -> +0.042) —\n // exactly inverted: a shy-away -1 LUNGED at the cursor, a lean-in +1 pulled back.\n // pointerDir = uPointer - uv is the toward-pointer direction in SAMPLE space; to\n // MOVE the rendered body TOWARD the pointer the sample must shift ALONG pointerDir\n // (sample the field from where the pointer is), so the sign is uv += dir*influence.\n // A positive attraction now shifts the body toward the cursor (leans in), a negative\n // shifts it away (shies) — the sign the comment + the demo slider always promised,\n // now true in the render.\n //\n // The falloff radius narrows from 0.65 to 0.5 for a calmer lean.\n // The REDRESS widened it to 0.65 to clear a synthetic floor; the live π-lane\n // read the result as a LUNGE. The drama lives in the STRENGTH (pointerStrength,\n // dropped to 0.18 in types.ts), NOT the falloff — the falloff's job is purely to keep\n // the lean COHERENT across the creature so the body, satellites and trail all tilt\n // toward the cursor as ONE. At 0.5 the body (sitting ≈0.2 uv from the cursor on a\n // hover-flick) is still well inside the cutoff, so the whole creature tilts as one —\n // a gentle, coherent \"it notices you\" lean rather than the body lunging a body-width.\n if (uPointerActive > 0.5) {\n vec2 pointerDir = uPointer - uv;\n float pointerDist = length(pointerDir);\n float influence = smoothstep(0.5, 0.0, pointerDist) * uPointerAttraction * uPointerStrength;\n uv += normalize(pointerDir + 1e-6) * influence;\n }\n\n // The de-synced pulsing body radius — also reused below for the inner-glow scale.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Composite domain-warped membrane field with its analytic gradient.\n vec3 scene = sceneDistG(uv);\n float d = scene.x;\n vec2 fieldGrad = scene.yz;\n\n // Edit #1 — fwidth-based anti-aliased edge: derive the smoothstep half-width\n // from the SDF screen-space gradient so the edge stays ~1px regardless of zoom.\n float aa = max(fwidth(d), 1e-6);\n float alpha = 1.0 - smoothstep(-aa, aa, d);\n\n if (alpha < 0.001) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Edit #4 — perceptually-uniform OKLCh variation. Gamma base → linear → OKLab\n // → OKLCh; perturb L/C/h; OKLCh → OKLab → linear; hue-preserving gamut clamp.\n // The base is the multi-stop palette sample — distributed across the\n // body/satellites by the color noise field — or uBaseColor when single-stop.\n float colorNoise = fbm(uv * uColorNoiseFreq + uTime * uColorNoiseSpeed, 3);\n vec3 oklch = samplePaletteOklch(colorNoise);\n // per-satellite explicit shade (default no-op at uSatColorActive == 0).\n oklch = blendSatColor(oklch, uv);\n\n oklch.z += (colorNoise - 0.5) * uHueRange * (PI / 180.0); // hue swing, radians\n oklch.y = max(oklch.y + (colorNoise - 0.5) * uSatShift, 0.0); // chroma swing\n oklch.x = clamp(oklch.x + uBrightnessShift, 0.0, 1.0); // lightness bias\n\n // ── Blob-to-meatball shading morph (uMorphT) ────────────────────────────\n // The user #1 ask: the goo should MORPH BLOB and MEATBALL from one to another\n // with a continuous in-between, not a hard cut. The key fact: the body\n // GEOMETRY is IDENTICAL across blob/meatball (the smin SDF field, the satellites,\n // the fwidth-AA — all computed ABOVE, before this gate). ONLY the SURFACE shading\n // (flat fill vs lit/shadow/iridescence/SSS) differs. So the morph is a uMorphT\n // scalar LERPING the SHADING — NOT a geometry rebuild, NOT a path interpolation.\n //\n // uMorphT = 0 -> the flat warm-cream blob (the STAGE-1 floor);\n // uMorphT = 1 -> the lit meatball (the full STAGE-2 dressing);\n // 0 < uMorphT < 1 -> the CONTINUOUS in-between (the morph the user asked for).\n //\n // uMorphT is the single clamped config surface axis; a consumer ANIMATING\n // config.morphT 0..1 gets the live morph. The smin field is\n // byte-UNTOUCHED (the geometry is shared — that is the whole point).\n //\n // The flat color is computed ALWAYS (cheap); the EXPENSIVE dressing (the soft-shadow\n // secondary march) is gated uMorphT > 0.0 so a pure blob pays ZERO shadow-march\n // cost (the SLOW-fix discipline — a flat blob is as cheap as an early-return).\n float morphT = clamp(uMorphT, 0.0, 1.0);\n\n // STAGE-1 flat fill — the warm-cream blob color, off the PRE-dressing oklch (the\n // dressing mutates oklch below, so the flat read must snapshot it here).\n vec3 flatOkl = gamutClampOklch(oklch);\n vec3 flatLin = oklabToLinearSrgb(oklchToOklab(flatOkl));\n vec3 flatRgb = clamp(linearToSrgb(flatLin), 0.0, 1.0);\n\n // If we are fully flat (a pure blob, morphT == 0), emit the flat fill + dither and\n // return — the byte-identical STAGE-1 floor, zero dressing cost.\n if (morphT <= 0.0) {\n float ign1 = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));\n flatRgb = clamp(flatRgb + (ign1 - 0.5) / 255.0, 0.0, 1.0);\n fragColor = vec4(flatRgb * alpha, alpha);\n return;\n }\n\n // Surface normal from the analytic field gradient; the 4-tap is\n // deleted. Computed once here and reused by the iridescence, the\n // fake-SSS, and the lit glass block.\n vec3 N = surfaceNormalFromGrad(fieldGrad, d, bodyR);\n vec3 V = vec3(0.0, 0.0, 1.0);\n float thickness = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0); // 0 at rim, ~1 deep in\n float fres = pow(1.0 - max(dot(N, V), 0.0), 2.5); // rim-weighted angle\n\n // ── iridescence — warm-biased IQ cosine palette driving OKLCh HUE ──\n //\n // A thin-film-like sheen on the RIM (fres-weighted), NOT the cold-blue default:\n // an IQ cosine palette (a + b*cos(2pi(c*t + d))) maps the Fresnel/edge angle +\n // the FBM color field + an animated thickness onto a HUE OFFSET biased to the\n // warm arc (uIridHue), with the chroma clamped to a warm-pearl band so the rim\n // reads cream/gold (congruent with the warm-cream-glass identity). Mixed into\n // OKLCh BEFORE the gamut clamp. Default LOW.\n if (uIridescence > 0.0) {\n float t = fres + 0.3 * colorNoise + uTime * uIridSpeed;\n // Cosine palette in HUE space, centred on the warm uIridHue (~0.18 turn of\n // warm sweep so the sheen shimmers gold→peach, never swinging to cold blue).\n float iridHue = uIridHue + 0.18 * PI * cos(2.0 * PI * t);\n float w = fres * uIridescence; // rim-weighted blend\n oklch.z = mix(oklch.z, iridHue, w);\n // Warm-pearl chroma cap: lift chroma toward a pale-pearl band, clamped.\n oklch.y = min(oklch.y + 0.04 * w, oklch.y + 0.08);\n oklch.x = min(oklch.x + 0.05 * w, 1.0); // a touch brighter at the sheen\n }\n\n // ── fake subsurface translucency — thickness inner-glow + back-light ──\n //\n // A bright translucent CORE fading to a light-leaking EDGE (the -d ramp) plus\n // the fast-SSS back-light (light wrapping through the thin rim). Both lift OKLCh\n // L and warm the hue, consuming the normal. In OKLCh before the gamut clamp.\n if (uCoreGlow > 0.0 || uSssScale > 0.0) {\n // Beer-Lambert inner luminosity uses a saturating 1 - exp(-k·thickness)\n // curve — a flat thick core with a fast warm rim falloff — NOT the linear\n // coreGlow·thickness ramp (which over-brightens deep interiors). k ≈ 3 reads\n // as glass depth.\n oklch.x = min(oklch.x + uCoreGlow * (1.0 - exp(-3.0 * thickness)), 1.0);\n // Fast-SSS back-light: light wrapping through the thin (low-thickness) rim.\n vec3 L = normalize(uLightDir + vec3(1e-6));\n float back = pow(clamp(dot(V, -(L + N * thickness)), 0.0, 1.0), uSssPower);\n float sss = back * uSssScale * (1.0 - thickness);\n oklch.x = min(oklch.x + sss, 1.0);\n // Warm the THIN leaking rim only (scale by 1 - thickness): the SSS hue-warm\n // shift rides the rim, not the core; only the thin rim warms.\n oklch.z += sss * 0.1 * (1.0 - thickness);\n }\n\n // ── Soft contact shadow (the GLSL twin) ─────────────────────────────────\n // A procedural\n // soft shadow FOLLOWING the irregular silhouette: march from this fragment's uv\n // toward the in-plane projection of uLightDir; where the metaball field occludes the\n // light, DARKEN the OKLCh L — a soft grounded contact band under the dome\n // (PROCEDURAL, silhouette-following, unlike the static CSS gel-dome drop-shadow).\n // Rim-weighted (1 - thickness) so the lit interior stays bright. Gated uShadow > 0.5;\n // morphT=0 ships shadowless via the uStage early-return above. ──\n if (uShadow > 0.5) {\n vec2 L2 = normalize(uLightDir.xy + vec2(1e-6));\n float sh = softShadow2D(uv, L2, max(aa, 0.004), bodyR * 1.5, max(uShadowSoftness, 4.0));\n // The contact band sits on the LOWER rim (the side AWAY from the light), gated by\n // the away-facing rim weight + a thin-rim Gaussian band (peak thickness ≈ 0.18) so\n // the deep-lit interior + the light-facing edge stay BRIGHT (the warm-cream body\n // mean and floor hold). The 0.20 cap is a soft grounding.\n float away = clamp(-dot(normalize(fieldGrad + vec2(1e-6)), L2), 0.0, 1.0);\n float band = exp(-pow((thickness - 0.18) / 0.16, 2.0));\n float shadowDarken = (1.0 - sh) * away * band * 0.20;\n oklch.x = max(oklch.x - shadowDarken, 0.0);\n }\n\n oklch = gamutClampOklch(oklch);\n\n vec3 lin = oklabToLinearSrgb(oklchToOklab(oklch));\n\n // ── lit glass surface — Blinn-Phong glint + Fresnel rim, in LINEAR ──\n //\n // The lit terms enter lin in LINEAR space BEFORE the OETF (linearToSrgb)\n // and BEFORE the * alpha premultiply — a post-OETF apply double-gammas the\n // highlight and fringes the premultiplied edge (the named A5/A2 trap). The\n // prior flat inner-glow lift is SUBSUMED by the Fresnel rim (the curvature\n // read now comes from the surface normal, not a flat smoothstep). Gated behind\n // uLit so the flat fill stays the default (zero regression).\n if (uLit > 0.5) {\n // N, V, thickness are already computed in main() (reused by iridescence/SSS).\n vec3 L = normalize(uLightDir + vec3(1e-6)); // light direction\n vec3 H = normalize(L + V); // Blinn-Phong half-vector\n\n // Warm-cream specular glint — a near-white OKLCh TINT (L~0.97, C~0.03,\n // hue~85°) routed through the SAME spliced OKLCh matrices, NOT hardcoded\n // sRGB white (pure white reads cheap-CG). Linearized for the linear add.\n vec3 warmCream = oklabToLinearSrgb(oklchToOklab(vec3(0.97, 0.03, radians(85.0))));\n\n // Energy-conserving Blinn-Phong: the (shininess+2)/8 factor\n // DECOUPLES shininess from strength (without it, raising shininess dims the\n // glint, so the two knobs fight). SPECULAR ANTIALIASING: the FBM membrane\n // makes the normal vary fast, so a tight glint (16-64) STROBES on small\n // dock-grid blobs. Widen the effective lobe where the normal varies\n // (Toksvig-style fwidth clamp) — drop shininess, NOT raise it. nVar reads\n // the screen-space normal derivative; a high-variance pixel softens the\n // exponent so the glint stays stable.\n float nVar = length(fwidth(N));\n float shininess = uSpecShininess / (1.0 + 24.0 * nVar);\n float energyNorm = (shininess + 2.0) / 8.0;\n float spec = pow(max(dot(N, H), 0.0), shininess) * uSpecStrength * energyNorm;\n\n // Fresnel/Schlick rim — fed uRimColor (the --foreground warm rim via the\n // /color leaf). Foreground-aware minimum-contrast guard:\n // a var(--primary) blob in dark mode resolves a rim near the BODY color, so\n // the rim washes out (no contrast). When the rim's luminance sits too close\n // to the body's, the guard CHROMA-REDUCES and L-LIFTS the rim stop (a\n // perceptual move, NOT a re-tint) so the curved rim always reads. Computed in\n // OKLCh so the lift is perceptual.\n vec3 rimOkl = oklabToOklch(srgbToOklab(uRimColor));\n float bodyL = oklch.x; // the post-perturb body lightness\n float dL = abs(rimOkl.x - bodyL);\n // If the rim is within 0.22 L of the body, push it AWAY (lift if the body is\n // dark, the dark-mode primary case; the chroma-reduce keeps it neutral-warm).\n float lack = clamp((0.22 - dL) / 0.22, 0.0, 1.0);\n rimOkl.x = clamp(mix(rimOkl.x, (bodyL < 0.5 ? 0.92 : 0.18), lack), 0.0, 1.0);\n rimOkl.y *= mix(1.0, 0.5, lack); // chroma-reduce toward a pale pearl\n vec3 rimLin = oklabToLinearSrgb(oklchToOklab(rimOkl));\n\n float rimFres = pow(1.0 - max(dot(N, V), 0.0), uRimPower);\n float rim = rimFres * uRimStrength * (1.0 - 0.6 * thickness);\n\n // Combine the two warm highlights and add in LINEAR. max(spec, rim*scale)\n // keeps the glint from stacking on the rim into a blown hotspot.\n //\n // Clamp the linear highlight below unity before the add (the\n // belt-and-braces guard the re-derived specStrength makes rarely-binding but\n // never lets a worst-case normal blow to a hard white spot). The energy-\n // conserving Blinn-Phong CAN still spike on a grazing normal where the Toksvig\n // widen has not kicked in; capping the highlight magnitude at 0.85 (a contained\n // warm gleam, sub-unity) means the OETF clamp below can never crush a\n // pure-white pixel over the dome. The cap is on the highlight ALONE (not the\n // composited lin), so the body color underneath is untouched — it caps only\n // the additive catch-light's energy.\n vec3 highlight = max(warmCream * spec, rimLin * rim);\n highlight = min(highlight, vec3(0.85));\n lin += highlight;\n }\n\n vec3 rgb = clamp(linearToSrgb(lin), 0.0, 1.0); // MANDATORY OETF — closes the seam\n\n // ── Compose the blob-to-meatball shading morph ─────────────────────────\n // rgb is the fully-dressed meatball surface; flatRgb (snapshotted before the\n // dressing) is the flat blob fill. The morph is a CONTINUOUS lerp between them on\n // morphT — at morphT==1 it is byte-identical to the dressed meatball, and the\n // morphT==0 case already returned the flat fill above. The geometry (alpha/silhouette)\n // is shared, so only the SURFACE shading interpolates (the morph from one to\n // another). The dither below applies to the composited result.\n rgb = mix(flatRgb, rgb, morphT);\n\n // IGN dither: the low-chroma warm-cream dome bands on 8-bit\n // panels (visible Mach steps in the smooth L roll). Interleaved-gradient noise at\n // 1/255, applied AFTER linearToSrgb and BEFORE the *alpha premultiply (aurora\n // ships the same splice). A triangular ±0.5 LSB dither decorrelates the steps.\n float ign = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));\n rgb = clamp(rgb + (ign - 0.5) / 255.0, 0.0, 1.0);\n\n // Edit #8 — premultiply AFTER the OETF: straight-alpha gamma → premultiplied.\n fragColor = vec4(rgb * alpha, alpha);\n}", Me = "[GooBlob]";
|
|
521
|
+
function Ne(e) {
|
|
522
|
+
let t = x(e, e.VERTEX_SHADER, Se, Me), n = x(e, e.FRAGMENT_SHADER, je, Me), r = b(e, t, n, Me);
|
|
579
523
|
e.useProgram(r);
|
|
580
524
|
let i = e.createVertexArray();
|
|
581
525
|
e.bindVertexArray(i);
|
|
@@ -597,13 +541,13 @@ function Me(e) {
|
|
|
597
541
|
let o = e.getAttribLocation(r, "aPosition");
|
|
598
542
|
e.enableVertexAttribArray(o), e.vertexAttribPointer(o, 2, e.FLOAT, !1, 0, 0);
|
|
599
543
|
let s = {};
|
|
600
|
-
for (let t of
|
|
601
|
-
let c = [], l = [], u = [], d = [],
|
|
602
|
-
for (let t = 0; t < 4; t++) c.push(e.getUniformLocation(r, `uSatPos[${t}]`)), l.push(e.getUniformLocation(r, `uSatRadius[${t}]`)), u.push(e.getUniformLocation(r, `uSatOpacity[${t}]`)), d.push(e.getUniformLocation(r, `uSatColor[${t}]`)),
|
|
603
|
-
let
|
|
604
|
-
for (let t = 0; t < 15; t++)
|
|
605
|
-
let
|
|
606
|
-
for (let t = 0; t < 4; t++)
|
|
544
|
+
for (let t of de) s[t] = e.getUniformLocation(r, t);
|
|
545
|
+
let c = [], l = [], u = [], d = [], f = [];
|
|
546
|
+
for (let t = 0; t < 4; t++) c.push(e.getUniformLocation(r, `uSatPos[${t}]`)), l.push(e.getUniformLocation(r, `uSatRadius[${t}]`)), u.push(e.getUniformLocation(r, `uSatOpacity[${t}]`)), d.push(e.getUniformLocation(r, `uSatColor[${t}]`)), f.push(e.getUniformLocation(r, `uSatColorAmt[${t}]`));
|
|
547
|
+
let p = [], m = [];
|
|
548
|
+
for (let t = 0; t < 15; t++) p.push(e.getUniformLocation(r, `uTrailPos[${t}]`)), m.push(e.getUniformLocation(r, `uTrailRadius[${t}]`));
|
|
549
|
+
let h = [];
|
|
550
|
+
for (let t = 0; t < 4; t++) h.push(e.getUniformLocation(r, `uPalette[${t}]`));
|
|
607
551
|
return e.enable(e.BLEND), e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA), {
|
|
608
552
|
prog: r,
|
|
609
553
|
vs: t,
|
|
@@ -616,25 +560,86 @@ function Me(e) {
|
|
|
616
560
|
satRadLocs: l,
|
|
617
561
|
satOpLocs: u,
|
|
618
562
|
satColorLocs: d,
|
|
619
|
-
satColorAmtLocs:
|
|
620
|
-
trailPosLocs:
|
|
621
|
-
trailRadLocs:
|
|
622
|
-
paletteLocs:
|
|
563
|
+
satColorAmtLocs: f,
|
|
564
|
+
trailPosLocs: p,
|
|
565
|
+
trailRadLocs: m,
|
|
566
|
+
paletteLocs: h
|
|
623
567
|
}
|
|
624
568
|
};
|
|
625
569
|
}
|
|
626
570
|
//#endregion
|
|
571
|
+
//#region src/components/blob/composables/resolveBlobSurface.ts
|
|
572
|
+
function Pe(e) {
|
|
573
|
+
let t = Math.max(0, Math.min(1, e.morphT));
|
|
574
|
+
return {
|
|
575
|
+
morphT: t,
|
|
576
|
+
dressed: t > 0
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region src/components/blob/composables/uploadBlobUniforms.ts
|
|
581
|
+
function Fe(e, t, n, r, i, a, o, s, c) {
|
|
582
|
+
let { U: l, satPosLocs: u, satRadLocs: d, satOpLocs: f, satColorLocs: p, satColorAmtLocs: m, trailPosLocs: h, trailRadLocs: g, paletteLocs: _ } = r, { params: v, rgb: y, simTimeMs: b, timeSec: x, resolveColor: S, rimColor: C, paletteStops: w } = c, { geometry: T, membrane: E, color: D, surface: O, interaction: k } = a;
|
|
583
|
+
e.useProgram(t), e.bindVertexArray(n), e.uniform2f(l.uResolution, i.width, i.height), e.uniform1f(l.uTime, b / 1e3), e.uniform3f(l.uBaseColor, y[0], y[1], y[2]);
|
|
584
|
+
let A = w, j = Math.min(A.length, 4);
|
|
585
|
+
e.uniform1i(l.uStopCount, j);
|
|
586
|
+
for (let t = 0; t < 4; t++) {
|
|
587
|
+
let n = _[t] ?? null, r = A[t];
|
|
588
|
+
if (r) {
|
|
589
|
+
let t = S(r);
|
|
590
|
+
e.uniform3f(n, t[0], t[1], t[2]);
|
|
591
|
+
} else e.uniform3f(n, y[0], y[1], y[2]);
|
|
592
|
+
}
|
|
593
|
+
let M = c.satColors ?? [], N = +!!M.some((e) => !!e);
|
|
594
|
+
e.uniform1i(l.uSatColorActive, N);
|
|
595
|
+
for (let t = 0; t < 4; t++) {
|
|
596
|
+
let n = p[t] ?? null, r = m[t] ?? null, i = M[t];
|
|
597
|
+
if (i) {
|
|
598
|
+
let t = S(i);
|
|
599
|
+
e.uniform3f(n, t[0], t[1], t[2]), e.uniform1f(r, 1);
|
|
600
|
+
} else e.uniform3f(n, y[0], y[1], y[2]), e.uniform1f(r, 0);
|
|
601
|
+
}
|
|
602
|
+
let P = o.pointer.value, F = k.pointerAttraction + v.pointerAttraction;
|
|
603
|
+
e.uniform2f(l.uPointer, P.x * .5 * B, P.y * .5 * B), e.uniform1f(l.uPointerActive, +!!o.active.value), e.uniform1f(l.uPointerAttraction, F), e.uniform1f(l.uPointerStrength, k.pointerStrength * B);
|
|
604
|
+
let I = Math.max(0, Math.min(1, F)), L = o.velocity.value;
|
|
605
|
+
e.uniform2f(l.uVelocity, L.x * .5 * B, L.y * .5 * B), e.uniform1f(l.uStretch, k.stretch);
|
|
606
|
+
let R = o.trailSources(T.satelliteRadius * .7 * I);
|
|
607
|
+
e.uniform1i(l.uTrailCount, R.count);
|
|
608
|
+
for (let t = 0; t < 15; t++) {
|
|
609
|
+
let n = h[t] ?? null, r = g[t] ?? null, i = R.sources[t];
|
|
610
|
+
i ? (e.uniform2f(n, i.x * .5 * B, i.y * .5 * B), e.uniform1f(r, i.radius * B)) : (e.uniform2f(n, 0, 0), e.uniform1f(r, 0));
|
|
611
|
+
}
|
|
612
|
+
e.uniform1f(l.uBodyRadius, T.bodyRadius * B), e.uniform1f(l.uPulsePhase, x * E.pulseFreq * v.pulseFreq * Math.PI * 2);
|
|
613
|
+
let z = o.pulse.value * k.clickImpulse;
|
|
614
|
+
e.uniform1f(l.uPulseAmp, (E.pulseAmp * v.pulseAmp / .015 + z) * B), e.uniform1f(l.uNoiseAmp, E.noiseAmp * v.noiseAmp / .025 * B), e.uniform1f(l.uNoiseFreq, E.noiseFreq), e.uniform1f(l.uNoiseSpeed, E.noiseSpeed), e.uniform1f(l.uWarpAmp, E.warpAmp);
|
|
615
|
+
let V = T.orbitRadius * 1.2 * (1 + T.eccentricity), H = E.smoothK * v.smoothK, U = Math.max(0, V - T.satelliteRadius - T.bodyRadius), W = H > 0 ? Math.min(1.25, 1 + U / H) : 1;
|
|
616
|
+
e.uniform1f(l.uSmoothK, H * W * B), e.uniform1f(l.uMerge, +(E.merge === "circular"));
|
|
617
|
+
let { morphT: ee, dressed: te } = Pe(a);
|
|
618
|
+
e.uniform1f(l.uMorphT, ee), e.uniform1f(l.uStage, +(ee <= 0));
|
|
619
|
+
let ne = (a.surface.fissionAmp ?? 0) > 0 ? ce * 1.12 : 0, re = Math.max(V, ne) + T.satelliteRadius, ie = (Math.max(T.bodyRadius, re) + H * W + E.noiseAmp * v.noiseAmp / .025 + Math.abs(o.pulse.value) * k.clickImpulse) * B + .1;
|
|
620
|
+
e.uniform1f(l.uMaxReach, ie), e.uniform1f(l.uHueRange, D.hueRange + v.hueRange), e.uniform1f(l.uSatShift, D.satShift + v.satShift), e.uniform1f(l.uBrightnessShift, D.brightnessShift + v.brightnessShift), e.uniform1f(l.uColorNoiseFreq, D.colorNoiseFreq), e.uniform1f(l.uColorNoiseSpeed, D.colorNoiseSpeed), e.uniform1f(l.uLit, te && O.lit ? 1 : 0);
|
|
621
|
+
let G = S(C);
|
|
622
|
+
e.uniform3f(l.uRimColor, G[0], G[1], G[2]), e.uniform3f(l.uLightDir, O.lightDir[0], O.lightDir[1], O.lightDir[2]), e.uniform1f(l.uSpecStrength, O.specStrength), e.uniform1f(l.uSpecShininess, O.specShininess), e.uniform1f(l.uRimPower, O.rimPower), e.uniform1f(l.uRimStrength, O.rimStrength), e.uniform1f(l.uShadow, te && O.shadow ? 1 : 0), e.uniform1f(l.uShadowSoftness, O.shadowSoftness), e.uniform1f(l.uIridescence, O.iridescence * v.iridScale), e.uniform1f(l.uIridHue, O.iridHue * (Math.PI / 180)), e.uniform1f(l.uIridSpeed, O.iridSpeed), e.uniform1f(l.uSssScale, O.sssScale * v.iridScale), e.uniform1f(l.uSssPower, O.sssPower), e.uniform1f(l.uCoreGlow, O.coreGlow);
|
|
623
|
+
let K = s.sources;
|
|
624
|
+
e.uniform1i(l.uSatCount, K.length);
|
|
625
|
+
for (let t = 0; t < 4; t++) {
|
|
626
|
+
let n = u[t] ?? null, r = d[t] ?? null, i = f[t] ?? null, a = K[t];
|
|
627
|
+
a ? (e.uniform2f(n, a.x * B, a.y * B), e.uniform1f(r, a.radius * B), e.uniform1f(i, a.opacity)) : (e.uniform2f(n, 0, 0), e.uniform1f(r, 0), e.uniform1f(i, 0));
|
|
628
|
+
}
|
|
629
|
+
e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), e.drawArrays(e.TRIANGLES, 0, 6), e.bindVertexArray(null);
|
|
630
|
+
}
|
|
631
|
+
//#endregion
|
|
627
632
|
//#region src/components/blob/shaders/metaball.wgsl.ts
|
|
628
|
-
var
|
|
633
|
+
var Ie = `
|
|
629
634
|
const MAX_SATS: i32 = 4;
|
|
630
635
|
const TRAIL_N: i32 = 15;
|
|
631
636
|
const MAX_BLOB_STOPS: i32 = 4;
|
|
632
637
|
const PI: f32 = 3.141592653589793;
|
|
633
638
|
|
|
634
639
|
// ── Uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──
|
|
635
|
-
// Scalars packed into vec4 lanes; per-satellite
|
|
640
|
+
// Scalars packed into vec4 lanes; per-satellite, per-trail, per-palette rows packed
|
|
636
641
|
// into a vec4 so the array stride is the natural 16 bytes (no std140 stride trap — the
|
|
637
|
-
// parity-blowout suspect
|
|
642
|
+
// parity-blowout suspect).
|
|
638
643
|
struct Uniforms {
|
|
639
644
|
// s0: (uTime, uBodyRadius, uPulsePhase, uPulseAmp)
|
|
640
645
|
s0: vec4<f32>,
|
|
@@ -651,10 +656,8 @@ struct Uniforms {
|
|
|
651
656
|
// s6: (uBrightnessShift, uColorNoiseFreq, uColorNoiseSpeed, uStretch)
|
|
652
657
|
s6: vec4<f32>,
|
|
653
658
|
// s7: (uPointerActive, uPointerAttraction, uPointerStrength, uStage)
|
|
654
|
-
//
|
|
655
|
-
//
|
|
656
|
-
// pipeline (variant="meatball" / STAGE 2). It rides the spare s7.w lane the typed-
|
|
657
|
-
// struct SoT (uniformBridgeWGPU.ts) reserved.
|
|
659
|
+
// uStage gates the stripped floor: 1.0 = flat and shadowless; 0.0 = dressed. It
|
|
660
|
+
// is derived from the single morph scalar and rides the spare s7.w lane.
|
|
658
661
|
s7: vec4<f32>,
|
|
659
662
|
// ptr: (uPointer.x, uPointer.y, uVelocity.x, uVelocity.y)
|
|
660
663
|
ptr: vec4<f32>,
|
|
@@ -665,9 +668,9 @@ struct Uniforms {
|
|
|
665
668
|
// light: (uLightDir.xyz, _pad)
|
|
666
669
|
light: vec4<f32>,
|
|
667
670
|
// res: (uResolution.x, uResolution.y, uShadow, uShadowSoftness)
|
|
668
|
-
//
|
|
671
|
+
// the soft-shadow march rides the spare res.z/res.w lanes the
|
|
669
672
|
// typed-struct SoT (uniformBridgeWGPU.ts) reserved (the EXTEND, never a re-fork): res.z
|
|
670
|
-
// = uShadow (1.0 = the
|
|
673
|
+
// = uShadow (1.0 = the dressed shadow ON), res.w = uShadowSoftness (the
|
|
671
674
|
// penumbra hardness, inverse light-source size → 4-48).
|
|
672
675
|
res: vec4<f32>,
|
|
673
676
|
// ints: (uStopCount, uSatCount, uTrailCount, _pad)
|
|
@@ -679,11 +682,11 @@ struct Uniforms {
|
|
|
679
682
|
|
|
680
683
|
@group(0) @binding(0) var<uniform> u: Uniforms;
|
|
681
684
|
|
|
682
|
-
// Noise + FBM
|
|
685
|
+
// Noise + FBM from metaball-noise.wgsl, spliced after the FBM_ROT_WGSL chunk
|
|
683
686
|
// below. NB: do NOT name the chunk with a template-interpolation form in a WGSL comment —
|
|
684
687
|
// it injects the whole multi-line chunk into this // comment line and breaks the parse
|
|
685
|
-
//
|
|
686
|
-
${
|
|
688
|
+
// at the first injected newline.
|
|
689
|
+
${_}
|
|
687
690
|
|
|
688
691
|
const FBM_LACUNARITY: f32 = 1.8;
|
|
689
692
|
const FBM_GAIN: f32 = 0.42;
|
|
@@ -805,14 +808,14 @@ fn sminG(a: vec3<f32>, b: vec3<f32>, k: f32) -> vec3<f32> {
|
|
|
805
808
|
return sminQuadraticG(a, b, k);
|
|
806
809
|
}
|
|
807
810
|
|
|
808
|
-
${
|
|
809
|
-
${
|
|
811
|
+
${p}
|
|
812
|
+
${h}
|
|
810
813
|
|
|
811
|
-
// OKLCh gamut clamp
|
|
812
|
-
//
|
|
814
|
+
// OKLCh gamut clamp, palette sample, and breath from metaball-palette.wgsl,
|
|
815
|
+
// spliced AFTER the OKLCH_MATRICES_WGSL chunk above (its matrix source). NB: do NOT
|
|
813
816
|
// write the chunk's identifier with a template-interpolation form in a WGSL comment — it
|
|
814
817
|
// would inject the whole multi-line matrices chunk INTO this // comment line and break the
|
|
815
|
-
// parse at the first injected newline
|
|
818
|
+
// parse at the first injected newline, the live WGSL syntax error
|
|
816
819
|
// that silently fell every metaball/goo-dot to the WebGL2 net, masking the WGSL primary).
|
|
817
820
|
|
|
818
821
|
// ── OKLCh gamut clamp (hue-preserving inward chroma clamp — blob-local) ──
|
|
@@ -832,7 +835,7 @@ fn gamutClampOklch(lch: vec3<f32>) -> vec3<f32> {
|
|
|
832
835
|
return vec3<f32>(lch.x, lo, lch.z);
|
|
833
836
|
}
|
|
834
837
|
|
|
835
|
-
//
|
|
838
|
+
// Sample the multi-stop palette at t, OKLab mix + midpoint chroma-bump. Returns
|
|
836
839
|
// an OKLCh stop [L, C, h(rad)]. Falls back to uBaseColor when uStopCount <= 1.
|
|
837
840
|
fn samplePaletteOklch(t: f32) -> vec3<f32> {
|
|
838
841
|
let uStopCount = u.ints.x;
|
|
@@ -850,13 +853,13 @@ fn samplePaletteOklch(t: f32) -> vec3<f32> {
|
|
|
850
853
|
return lch;
|
|
851
854
|
}
|
|
852
855
|
|
|
853
|
-
//
|
|
856
|
+
// De-synced breath using three detuned sines at irrational ratios.
|
|
854
857
|
fn breath(phase: f32) -> f32 {
|
|
855
858
|
return (sin(phase) + 0.5 * sin(phase * 1.4444 + 1.7) + 0.28 * sin(phase * 0.31 + 4.1)) / 1.78;
|
|
856
859
|
}
|
|
857
860
|
|
|
858
861
|
|
|
859
|
-
//
|
|
862
|
+
// The composite SDF field with its analytic gradient: vec3(dist, ∂/∂x, ∂/∂y).
|
|
860
863
|
fn sceneDistG(uv: vec2<f32>) -> vec3<f32> {
|
|
861
864
|
let uBodyRadius = u.s0.y;
|
|
862
865
|
let uPulsePhase = u.s0.z;
|
|
@@ -924,7 +927,7 @@ fn sceneDistG(uv: vec2<f32>) -> vec3<f32> {
|
|
|
924
927
|
return d;
|
|
925
928
|
}
|
|
926
929
|
|
|
927
|
-
//
|
|
930
|
+
// The analytic surface normal from the field gradient.
|
|
928
931
|
fn surfaceNormalFromGrad(grad2d: vec2<f32>, d: f32, bodyR: f32) -> vec3<f32> {
|
|
929
932
|
let g = normalize(grad2d + vec2<f32>(1e-6));
|
|
930
933
|
let interior = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0);
|
|
@@ -932,9 +935,9 @@ fn surfaceNormalFromGrad(grad2d: vec2<f32>, d: f32, bodyR: f32) -> vec3<f32> {
|
|
|
932
935
|
return normalize(vec3<f32>(g * (1.0 - z), z) + vec3<f32>(0.0, 0.0, 1e-6));
|
|
933
936
|
}
|
|
934
937
|
|
|
935
|
-
// ──
|
|
936
|
-
// research/viz/goo-blob.md §2.3
|
|
937
|
-
// irregular metaball silhouette (NOT a hard disc
|
|
938
|
+
// ── 2D SDF soft-shadow march (IQ rmshadows improved penumbra) ───────────────
|
|
939
|
+
// Based on research/viz/goo-blob.md §2.3. A procedural soft contact shadow that follows the
|
|
940
|
+
// irregular metaball silhouette (NOT a hard disc, box shadow). Marches a ray from ro
|
|
938
941
|
// along rd (the in-plane projection of uLightDir), accumulating the closest miss via
|
|
939
942
|
// the Aaltonen penumbra (y = h*h/(2*ph) + d = sqrt(h*h - y*y)) that kills the
|
|
940
943
|
// banding the naive res = min(res, h/(w*t)) shows. CHEAP: 24 steps, re-uses the SAME
|
|
@@ -989,9 +992,9 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
989
992
|
let uPointerActive = u.s7.x;
|
|
990
993
|
let uPointerAttraction = u.s7.y;
|
|
991
994
|
let uPointerStrength = u.s7.z;
|
|
992
|
-
//
|
|
995
|
+
// The stage-1 gate (1.0 = the plain shadowless fill-only floor).
|
|
993
996
|
let uStage = u.s7.w;
|
|
994
|
-
//
|
|
997
|
+
// The blob-to-meatball shading-morph scalar (the base.w pad
|
|
995
998
|
// lane; the typed-struct SoT writes it). 0 = flat blob, 1 = lit meatball, in-between
|
|
996
999
|
// lerps the surface shading (the smin geometry is shared).
|
|
997
1000
|
let uMorphT = clamp(u.base.w, 0.0, 1.0);
|
|
@@ -1013,13 +1016,13 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1013
1016
|
let uRimStrength = u.s3.w;
|
|
1014
1017
|
let uLightDir = u.light.xyz;
|
|
1015
1018
|
let uRimColor = u.rim.rgb;
|
|
1016
|
-
//
|
|
1019
|
+
// The soft-shadow gate + penumbra hardness (res.z/res.w lanes).
|
|
1017
1020
|
let uShadow = u.res.z;
|
|
1018
1021
|
let uShadowSoftness = u.res.w;
|
|
1019
1022
|
|
|
1020
1023
|
var uv = in.uv - 0.5;
|
|
1021
1024
|
|
|
1022
|
-
//
|
|
1025
|
+
// Pre-FBM bounding test, expressed for uniform derivative flow. The GLSL fallback
|
|
1023
1026
|
// EARLY-RETURNS transparent here (a perf skip of the FBM border); WGSL CANNOT — an early
|
|
1024
1027
|
// return predicated on the per-fragment uv makes the fwidth(d)/fwidth(Nh) calls below
|
|
1025
1028
|
// reachable only through non-uniform control flow, which the WGSL uniformity analyzer
|
|
@@ -1033,7 +1036,7 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1033
1036
|
// ALU (no correctness hazard); the real GPU swallows it.
|
|
1034
1037
|
let inBounds = dot(uv, uv) <= uMaxReach * uMaxReach;
|
|
1035
1038
|
|
|
1036
|
-
// Pointer deformation
|
|
1039
|
+
// Pointer deformation preserves the signed attraction direction.
|
|
1037
1040
|
if (uPointerActive > 0.5) {
|
|
1038
1041
|
let pointerDir = uPointer - uv;
|
|
1039
1042
|
let pointerDist = length(pointerDir);
|
|
@@ -1056,13 +1059,13 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1056
1059
|
// (the GLSL early-out's transparent WRITE, expressed as an alpha gate, not a return).
|
|
1057
1060
|
let alpha = (1.0 - smoothstep(-aa, aa, d)) * select(0.0, 1.0, inBounds);
|
|
1058
1061
|
|
|
1059
|
-
// ──
|
|
1062
|
+
// ── WGSL uniformity structure ────────────────────────────────────────────
|
|
1060
1063
|
// The Toksvig screen-space derivative (fwidth SITE #2) is hoisted HERE, into the SAME
|
|
1061
1064
|
// uniform control flow fwidth(d) above already arms in (top-level fs_main, before the
|
|
1062
1065
|
// per-fragment alpha < 0.001 early-return and the uLit/uShadow non-uniform branches).
|
|
1063
1066
|
// WGSL uniformity analysis rejects a fwidth() reached only through a return predicated
|
|
1064
1067
|
// on a per-fragment value (the alpha < 0.001 early-out) nested under further branches
|
|
1065
|
-
//
|
|
1068
|
+
// exactly the residual that kept the normal derivative inside the lit branch from
|
|
1066
1069
|
// compiling, so the WGSL primary never armed and GooBlob fell to the WebGL2 net. Nh is
|
|
1067
1070
|
// the uniform-flow surface normal computed for this derivative ONLY (byte-identical to
|
|
1068
1071
|
// the lit block's own N = surfaceNormalFromGrad(...) below — the SAME inputs, so
|
|
@@ -1090,18 +1093,18 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1090
1093
|
oklch.y = max(oklch.y + (colorNoise - 0.5) * uSatShift, 0.0);
|
|
1091
1094
|
oklch.x = clamp(oklch.x + uBrightnessShift, 0.0, 1.0);
|
|
1092
1095
|
|
|
1093
|
-
// ──
|
|
1096
|
+
// ── The stripped flat floor (morphT=0). ──
|
|
1094
1097
|
// The minimal verifiable floor: SDF + smin (the meatball field, already in d/
|
|
1095
1098
|
// alpha above) + fwidth-AA (the crisp alpha above) + warm-cream fill. NO surface
|
|
1096
1099
|
// normal, NO Fresnel, NO lit glint, NO iridescence, NO fake-SSS, NO shadow —
|
|
1097
1100
|
// deliberately FLAT. It returns BEFORE any of the STAGE-2 dressing is reached. The
|
|
1098
1101
|
// STAGE-1 path simply never READS the hoisted Nh/nVar or the lit/shadow blocks; the
|
|
1099
|
-
// normal
|
|
1100
|
-
//
|
|
1101
|
-
//
|
|
1102
|
+
// normal derivative is now in uniform control flow above, so both the stage-1 floor
|
|
1103
|
+
// and the stage-2 lit path arm on Metal. The residual that kept stage 2 falling to
|
|
1104
|
+
// the WebGL2 path is closed. The
|
|
1102
1105
|
// teaching contrast: this is the "it renders, it meatballs, it works on Safari"
|
|
1103
1106
|
// floor STAGE 2 layers the lit/shadow onto via the SAME uniforms.
|
|
1104
|
-
//
|
|
1107
|
+
// The flat blob fill is snapshotted from the pre-dressing
|
|
1105
1108
|
// oklch (the dressing mutates oklch below). At morphT <= 0 (a pure blob) emit the
|
|
1106
1109
|
// flat fill + dither and return — the byte-identical STAGE-1 floor, zero dressing cost.
|
|
1107
1110
|
let flatOkl = gamutClampOklch(oklch);
|
|
@@ -1122,7 +1125,7 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1122
1125
|
let thickness = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0);
|
|
1123
1126
|
let fres = pow(1.0 - max(dot(N, V), 0.0), 2.5);
|
|
1124
1127
|
|
|
1125
|
-
// ──
|
|
1128
|
+
// ── iridescence — warm-biased IQ cosine palette driving OKLCh HUE ──
|
|
1126
1129
|
if (uIridescence > 0.0) {
|
|
1127
1130
|
let t = fres + 0.3 * colorNoise + uTime * uIridSpeed;
|
|
1128
1131
|
let iridHue = uIridHue + 0.18 * PI * cos(2.0 * PI * t);
|
|
@@ -1132,7 +1135,7 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1132
1135
|
oklch.x = min(oklch.x + 0.05 * w, 1.0);
|
|
1133
1136
|
}
|
|
1134
1137
|
|
|
1135
|
-
// ──
|
|
1138
|
+
// ── fake subsurface translucency — thickness inner-glow + back-light ──
|
|
1136
1139
|
if (uCoreGlow > 0.0 || uSssScale > 0.0) {
|
|
1137
1140
|
oklch.x = min(oklch.x + uCoreGlow * (1.0 - exp(-3.0 * thickness)), 1.0);
|
|
1138
1141
|
let L = normalize(uLightDir + vec3<f32>(1e-6));
|
|
@@ -1142,7 +1145,8 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1142
1145
|
oklch.z = oklch.z + sss * 0.1 * (1.0 - thickness);
|
|
1143
1146
|
}
|
|
1144
1147
|
|
|
1145
|
-
// ──
|
|
1148
|
+
// ── Soft contact shadow ──────────────────────────────────────────────────
|
|
1149
|
+
// A procedural soft shadow that
|
|
1146
1150
|
// FOLLOWS the irregular silhouette: march from this fragment's uv toward the in-plane
|
|
1147
1151
|
// projection of uLightDir; where the metaball field occludes the light (the body
|
|
1148
1152
|
// shadows itself opposite the light, a satellite shadows the body across the neck), the
|
|
@@ -1151,7 +1155,7 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1151
1155
|
// drop-shadow. Concentrated on the AWAY-facing lower rim (an away-facing weight × a
|
|
1152
1156
|
// thin-rim Gaussian band) so the deep-lit interior + the light-facing edge stay bright
|
|
1153
1157
|
// and the grounded shadow reads at the lower silhouette edge — the warm-cream body mean
|
|
1154
|
-
// holds. Gated uShadow > 0.5;
|
|
1158
|
+
// holds. Gated uShadow > 0.5; morphT=0 ships shadowless. ──
|
|
1155
1159
|
if (uShadow > 0.5) {
|
|
1156
1160
|
let L2 = normalize(uLightDir.xy + vec2<f32>(1e-6));
|
|
1157
1161
|
// w increases with the inverse light-source size → uShadowSoftness (a harder penumbra at a
|
|
@@ -1162,8 +1166,8 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1162
1166
|
// dot(fieldGrad, L2) < 0 (the rim facing away from L2) AND the thin-rim weight
|
|
1163
1167
|
// (a Gaussian band peaking at thickness ≈ 0.18 so the deep-lit interior + the
|
|
1164
1168
|
// light-facing edge stay BRIGHT — the warm-cream body mean holds). The 0.20 cap keeps
|
|
1165
|
-
// it a soft
|
|
1166
|
-
//
|
|
1169
|
+
// it a soft grounding whisper, never a gouge (the warm-cream identity + the
|
|
1170
|
+
// floor hold).
|
|
1167
1171
|
let away = clamp(-dot(normalize(fieldGrad + vec2<f32>(1e-6)), L2), 0.0, 1.0);
|
|
1168
1172
|
let band = exp(-pow((thickness - 0.18) / 0.16, 2.0));
|
|
1169
1173
|
let shadowDarken = (1.0 - sh) * away * band * 0.20;
|
|
@@ -1174,7 +1178,7 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1174
1178
|
|
|
1175
1179
|
var lin = oklabToLinearSrgb(oklchToOklab(oklch));
|
|
1176
1180
|
|
|
1177
|
-
// ──
|
|
1181
|
+
// ── lit glass surface — Blinn-Phong glint + Fresnel rim, in LINEAR ──
|
|
1178
1182
|
if (uLit > 0.5) {
|
|
1179
1183
|
let L = normalize(uLightDir + vec3<f32>(1e-6));
|
|
1180
1184
|
let H = normalize(L + V);
|
|
@@ -1182,8 +1186,8 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1182
1186
|
let warmCream = oklabToLinearSrgb(oklchToOklab(vec3<f32>(0.97, 0.03, radians(85.0))));
|
|
1183
1187
|
|
|
1184
1188
|
// ── fwidth SITE #2 — Toksvig normal-variance specular clamp. nVar is the HOISTED
|
|
1185
|
-
// length(fwidth(N))
|
|
1186
|
-
// in uniform control flow
|
|
1189
|
+
// length(fwidth(N)), computed once at the top of fs_main
|
|
1190
|
+
// in uniform control flow so the WGSL primary arms on Metal. The math is
|
|
1187
1191
|
// byte-identical to the GLSL fallback (length(fwidth(N))); only its evaluation
|
|
1188
1192
|
// point moved out of this non-uniform if (uLit > 0.5) branch. ──
|
|
1189
1193
|
let shininess = uSpecShininess / (1.0 + 24.0 * nVar);
|
|
@@ -1196,8 +1200,8 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1196
1200
|
let lack = clamp((0.22 - dL) / 0.22, 0.0, 1.0);
|
|
1197
1201
|
// target is a WGSL RESERVED word (W3C WGSL 16.2) so a "var target" declaration is an
|
|
1198
1202
|
// invalid identifier: the shader module fails to compile and the WGSL primary never
|
|
1199
|
-
// arms
|
|
1200
|
-
//
|
|
1203
|
+
// arms, so it is named targetL, a valid identifier; the math + the value
|
|
1204
|
+
// are identical.
|
|
1201
1205
|
var targetL = 0.18;
|
|
1202
1206
|
if (bodyL < 0.5) { targetL = 0.92; }
|
|
1203
1207
|
rimOkl.x = clamp(mix(rimOkl.x, targetL, lack), 0.0, 1.0);
|
|
@@ -1214,7 +1218,7 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1214
1218
|
|
|
1215
1219
|
var rgb = clamp(linearToSrgb(lin), vec3<f32>(0.0), vec3<f32>(1.0));
|
|
1216
1220
|
|
|
1217
|
-
//
|
|
1221
|
+
// Compose the blob↔meatball shading morph: lerp the flat blob
|
|
1218
1222
|
// fill -> the dressed meatball surface on uMorphT (the geometry/alpha is shared; only
|
|
1219
1223
|
// the surface shading interpolates). morphT == 1 is byte-identical to the dressed
|
|
1220
1224
|
// meatball; the morphT == 0 case already returned the flat fill above.
|
|
@@ -1228,7 +1232,7 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1228
1232
|
// premultiply AFTER the OETF: straight-alpha gamma → premultiplied.
|
|
1229
1233
|
return vec4<f32>(rgb * alpha, alpha);
|
|
1230
1234
|
}
|
|
1231
|
-
`,
|
|
1235
|
+
`, Le = 592, $ = {
|
|
1232
1236
|
s0: 0,
|
|
1233
1237
|
s1: 4,
|
|
1234
1238
|
s2: 8,
|
|
@@ -1247,24 +1251,24 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
1247
1251
|
satPos: 72,
|
|
1248
1252
|
trailPos: 88
|
|
1249
1253
|
};
|
|
1250
|
-
function
|
|
1251
|
-
let e = new ArrayBuffer(
|
|
1254
|
+
function Re() {
|
|
1255
|
+
let e = new ArrayBuffer(Le);
|
|
1252
1256
|
return {
|
|
1253
1257
|
buffer: e,
|
|
1254
1258
|
f32: new Float32Array(e),
|
|
1255
1259
|
i32: new Int32Array(e)
|
|
1256
1260
|
};
|
|
1257
1261
|
}
|
|
1258
|
-
function
|
|
1259
|
-
let { f32: o, i32: s } = e, { params: c, rgb: l, simTimeMs: u, timeSec: d, resolveColor: f, rimColor: p, paletteStops: m } = a, { geometry: h, membrane: g, color: _, surface: v, interaction: y } = n, b = r.pointer.value, x = y.pointerAttraction + c.pointerAttraction, S = Math.max(0, Math.min(1, x)), C = r.velocity.value, w = r.pulse.value * y.clickImpulse, T = (g.pulseAmp * c.pulseAmp / .015 + w) *
|
|
1260
|
-
o[$.s0 + 0] = u / 1e3, o[$.s0 + 1] = h.bodyRadius *
|
|
1261
|
-
let
|
|
1262
|
-
o[$.s2 + 0] = M, o[$.s2 + 1] = +(g.merge === "circular"), o[$.s2 + 2] = F, o[$.s2 + 3] = L && v.lit ? 1 : 0, o[$.s3 + 0] = v.specStrength, o[$.s3 + 1] = v.specShininess, o[$.s3 + 2] = v.rimPower, o[$.s3 + 3] = v.rimStrength, o[$.s4 + 0] = v.iridescence * c.iridScale, o[$.s4 + 1] = v.iridHue * (Math.PI / 180), o[$.s4 + 2] = v.iridSpeed, o[$.s4 + 3] = v.sssScale * c.iridScale, o[$.s5 + 0] = v.sssPower, o[$.s5 + 1] = v.coreGlow, o[$.s5 + 2] = _.hueRange + c.hueRange, o[$.s5 + 3] = _.satShift + c.satShift, o[$.s6 + 0] = _.brightnessShift + c.brightnessShift, o[$.s6 + 1] = _.colorNoiseFreq, o[$.s6 + 2] = _.colorNoiseSpeed, o[$.s6 + 3] = y.stretch, o[$.s7 + 0] = +!!r.active.value, o[$.s7 + 1] = x, o[$.s7 + 2] = y.pointerStrength *
|
|
1263
|
-
let
|
|
1264
|
-
o[$.rim + 0] =
|
|
1265
|
-
let
|
|
1262
|
+
function ze(e, t, n, r, i, a) {
|
|
1263
|
+
let { f32: o, i32: s } = e, { params: c, rgb: l, simTimeMs: u, timeSec: d, resolveColor: f, rimColor: p, paletteStops: m } = a, { geometry: h, membrane: g, color: _, surface: v, interaction: y } = n, b = r.pointer.value, x = y.pointerAttraction + c.pointerAttraction, S = Math.max(0, Math.min(1, x)), C = r.velocity.value, w = r.pulse.value * y.clickImpulse, T = (g.pulseAmp * c.pulseAmp / .015 + w) * B, E = d * g.pulseFreq * c.pulseFreq * Math.PI * 2, D = g.noiseAmp * c.noiseAmp / .025 * B, O = h.orbitRadius * 1.2 * (1 + h.eccentricity), k = g.smoothK * c.smoothK, A = Math.max(0, O - h.satelliteRadius - h.bodyRadius), j = k > 0 ? Math.min(1.25, 1 + A / k) : 1, M = k * j * B, N = (n.surface.fissionAmp ?? 0) > 0 ? ce * 1.12 : 0, P = Math.max(O, N) + h.satelliteRadius, F = (Math.max(h.bodyRadius, P) + k * j + g.noiseAmp * c.noiseAmp / .025 + Math.abs(r.pulse.value) * y.clickImpulse) * B + .1;
|
|
1264
|
+
o[$.s0 + 0] = u / 1e3, o[$.s0 + 1] = h.bodyRadius * B, o[$.s0 + 2] = E, o[$.s0 + 3] = T, o[$.s1 + 0] = D, o[$.s1 + 1] = g.noiseFreq, o[$.s1 + 2] = g.noiseSpeed, o[$.s1 + 3] = g.warpAmp;
|
|
1265
|
+
let { morphT: I, dressed: L } = Pe(n);
|
|
1266
|
+
o[$.s2 + 0] = M, o[$.s2 + 1] = +(g.merge === "circular"), o[$.s2 + 2] = F, o[$.s2 + 3] = L && v.lit ? 1 : 0, o[$.s3 + 0] = v.specStrength, o[$.s3 + 1] = v.specShininess, o[$.s3 + 2] = v.rimPower, o[$.s3 + 3] = v.rimStrength, o[$.s4 + 0] = v.iridescence * c.iridScale, o[$.s4 + 1] = v.iridHue * (Math.PI / 180), o[$.s4 + 2] = v.iridSpeed, o[$.s4 + 3] = v.sssScale * c.iridScale, o[$.s5 + 0] = v.sssPower, o[$.s5 + 1] = v.coreGlow, o[$.s5 + 2] = _.hueRange + c.hueRange, o[$.s5 + 3] = _.satShift + c.satShift, o[$.s6 + 0] = _.brightnessShift + c.brightnessShift, o[$.s6 + 1] = _.colorNoiseFreq, o[$.s6 + 2] = _.colorNoiseSpeed, o[$.s6 + 3] = y.stretch, o[$.s7 + 0] = +!!r.active.value, o[$.s7 + 1] = x, o[$.s7 + 2] = y.pointerStrength * B, o[$.s7 + 3] = +(I <= 0), o[$.ptr + 0] = b.x * .5 * B, o[$.ptr + 1] = b.y * .5 * B, o[$.ptr + 2] = C.x * .5 * B, o[$.ptr + 3] = C.y * .5 * B, o[$.base + 0] = l[0], o[$.base + 1] = l[1], o[$.base + 2] = l[2], o[$.base + 3] = I;
|
|
1267
|
+
let R = f(p);
|
|
1268
|
+
o[$.rim + 0] = R[0], o[$.rim + 1] = R[1], o[$.rim + 2] = R[2], o[$.rim + 3] = 0, o[$.light + 0] = v.lightDir[0], o[$.light + 1] = v.lightDir[1], o[$.light + 2] = v.lightDir[2], o[$.light + 3] = 0, o[$.res + 0] = t.width, o[$.res + 1] = t.height, o[$.res + 2] = L && v.shadow ? 1 : 0, o[$.res + 3] = v.shadowSoftness;
|
|
1269
|
+
let z = m, V = Math.min(z.length, 4);
|
|
1266
1270
|
for (let e = 0; e < 4; e++) {
|
|
1267
|
-
let t = $.palette + e * 4, n =
|
|
1271
|
+
let t = $.palette + e * 4, n = z[e];
|
|
1268
1272
|
if (n) {
|
|
1269
1273
|
let e = f(n);
|
|
1270
1274
|
o[t + 0] = e[0], o[t + 1] = e[1], o[t + 2] = e[2];
|
|
@@ -1274,47 +1278,47 @@ function Ie(e, t, n, r, i, a) {
|
|
|
1274
1278
|
let H = i.sources;
|
|
1275
1279
|
for (let e = 0; e < 4; e++) {
|
|
1276
1280
|
let t = $.satPos + e * 4, n = H[e];
|
|
1277
|
-
n ? (o[t + 0] = n.x *
|
|
1281
|
+
n ? (o[t + 0] = n.x * B, o[t + 1] = n.y * B, o[t + 2] = n.radius * B, o[t + 3] = n.opacity) : (o[t + 0] = 0, o[t + 1] = 0, o[t + 2] = 0, o[t + 3] = 0);
|
|
1278
1282
|
}
|
|
1279
1283
|
let U = r.trailSources(h.satelliteRadius * .7 * S);
|
|
1280
1284
|
for (let e = 0; e < 15; e++) {
|
|
1281
1285
|
let t = $.trailPos + e * 4, n = U.sources[e];
|
|
1282
|
-
n ? (o[t + 0] = n.x * .5 *
|
|
1286
|
+
n ? (o[t + 0] = n.x * .5 * B, o[t + 1] = n.y * .5 * B, o[t + 2] = n.radius * B) : (o[t + 0] = 0, o[t + 1] = 0, o[t + 2] = 0), o[t + 3] = 0;
|
|
1283
1287
|
}
|
|
1284
1288
|
return s[$.ints + 0] = V, s[$.ints + 1] = H.length, s[$.ints + 2] = U.count, s[$.ints + 3] = 0, e;
|
|
1285
1289
|
}
|
|
1286
1290
|
//#endregion
|
|
1287
1291
|
//#region src/components/blob/composables/wgpuSetup.ts
|
|
1288
|
-
var
|
|
1289
|
-
function
|
|
1290
|
-
let { canvas: t, config: n, pointer: r, satellites: i, resolveFrame: a, shouldContinue: o } = e;
|
|
1291
|
-
return function(e,
|
|
1292
|
-
let
|
|
1292
|
+
var Be = 2;
|
|
1293
|
+
function Ve(e) {
|
|
1294
|
+
let { canvas: t, config: n, pointer: r, satellites: i, resolveFrame: a, shouldContinue: o, onResize: s, onDraw: c } = e;
|
|
1295
|
+
return function(e, l, u) {
|
|
1296
|
+
let d = e.createShaderModule({
|
|
1293
1297
|
label: "[GooBlob] metaball.wgsl",
|
|
1294
|
-
code:
|
|
1295
|
-
}),
|
|
1298
|
+
code: Ie
|
|
1299
|
+
}), f = e.createBuffer({
|
|
1296
1300
|
label: "[GooBlob] uniforms",
|
|
1297
|
-
size:
|
|
1298
|
-
usage:
|
|
1299
|
-
}),
|
|
1301
|
+
size: Le,
|
|
1302
|
+
usage: 72
|
|
1303
|
+
}), p = e.createBindGroupLayout({
|
|
1300
1304
|
label: "[GooBlob] bind-group-0",
|
|
1301
1305
|
entries: [{
|
|
1302
1306
|
binding: 0,
|
|
1303
|
-
visibility:
|
|
1307
|
+
visibility: Be,
|
|
1304
1308
|
buffer: { type: "uniform" }
|
|
1305
1309
|
}]
|
|
1306
|
-
}),
|
|
1310
|
+
}), m = e.createRenderPipeline({
|
|
1307
1311
|
label: "[GooBlob] pipeline",
|
|
1308
|
-
layout: e.createPipelineLayout({ bindGroupLayouts: [
|
|
1312
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [p] }),
|
|
1309
1313
|
vertex: {
|
|
1310
|
-
module:
|
|
1314
|
+
module: d,
|
|
1311
1315
|
entryPoint: "vs_main"
|
|
1312
1316
|
},
|
|
1313
1317
|
fragment: {
|
|
1314
|
-
module:
|
|
1318
|
+
module: d,
|
|
1315
1319
|
entryPoint: "fs_main",
|
|
1316
1320
|
targets: [{
|
|
1317
|
-
format:
|
|
1321
|
+
format: u,
|
|
1318
1322
|
blend: {
|
|
1319
1323
|
color: {
|
|
1320
1324
|
srcFactor: "one",
|
|
@@ -1330,21 +1334,22 @@ function Be(e) {
|
|
|
1330
1334
|
}]
|
|
1331
1335
|
},
|
|
1332
1336
|
primitive: { topology: "triangle-list" }
|
|
1333
|
-
}),
|
|
1337
|
+
}), h = e.createBindGroup({
|
|
1334
1338
|
label: "[GooBlob] bind-group",
|
|
1335
|
-
layout:
|
|
1339
|
+
layout: p,
|
|
1336
1340
|
entries: [{
|
|
1337
1341
|
binding: 0,
|
|
1338
|
-
resource: { buffer:
|
|
1342
|
+
resource: { buffer: f }
|
|
1339
1343
|
}]
|
|
1340
|
-
}),
|
|
1341
|
-
function
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1344
|
+
}), g = Re();
|
|
1345
|
+
function _(e) {
|
|
1346
|
+
e && s(e);
|
|
1347
|
+
}
|
|
1348
|
+
function v(o) {
|
|
1349
|
+
let s = a(o);
|
|
1350
|
+
ze(g, t, n, r, i, s), e.queue.writeBuffer(f, 0, g.buffer);
|
|
1351
|
+
let u = l.getCurrentTexture().createView(), d = e.createCommandEncoder({ label: "[GooBlob] frame" }), p = d.beginRenderPass({ colorAttachments: [{
|
|
1352
|
+
view: u,
|
|
1348
1353
|
clearValue: {
|
|
1349
1354
|
r: 0,
|
|
1350
1355
|
g: 0,
|
|
@@ -1354,84 +1359,125 @@ function Be(e) {
|
|
|
1354
1359
|
loadOp: "clear",
|
|
1355
1360
|
storeOp: "store"
|
|
1356
1361
|
}] });
|
|
1357
|
-
|
|
1362
|
+
p.setPipeline(m), p.setBindGroup(0, h), p.draw(3, 1, 0, 0), p.end(), e.queue.submit([d.finish()]), c(s);
|
|
1358
1363
|
}
|
|
1359
1364
|
return {
|
|
1360
|
-
frame:
|
|
1365
|
+
frame: v,
|
|
1361
1366
|
shouldContinue: o,
|
|
1362
|
-
resize:
|
|
1367
|
+
resize: _,
|
|
1363
1368
|
teardown: () => {
|
|
1364
|
-
|
|
1369
|
+
f.destroy();
|
|
1365
1370
|
}
|
|
1366
1371
|
};
|
|
1367
1372
|
};
|
|
1368
1373
|
}
|
|
1369
1374
|
//#endregion
|
|
1370
|
-
//#region src/components/blob/composables/
|
|
1371
|
-
function
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
w !== null && (clearTimeout(w), w = null);
|
|
1384
|
-
}
|
|
1385
|
-
function E(e) {
|
|
1386
|
-
if (T(), typeof setTimeout > "u") return;
|
|
1387
|
-
let t = Math.min(Math.max(e - _, 16), 3e4);
|
|
1388
|
-
w = setTimeout(() => {
|
|
1389
|
-
w = null, x?.wake();
|
|
1390
|
-
}, t);
|
|
1391
|
-
}
|
|
1392
|
-
r(t, {
|
|
1393
|
-
pause: () => x?.suspend("off-screen-io"),
|
|
1394
|
-
resume: () => x?.resume("off-screen-io")
|
|
1395
|
-
}, {
|
|
1396
|
-
rootMargin: "200px",
|
|
1397
|
-
pauseWhenHidden: !1
|
|
1398
|
-
});
|
|
1399
|
-
function D(e) {
|
|
1400
|
-
let t = g ? (e - g) * 1e3 : 16;
|
|
1401
|
-
g = e;
|
|
1402
|
-
let n = Math.max(0, Math.min(t, 50)), r = x?.reducedMotion ?? !1, u = r || S ? 0 : p.tempo, d = u * n;
|
|
1403
|
-
if (_ += d, v.setActive(l.active.value), u > 0 && l.active.value) {
|
|
1404
|
-
let e = l.rawPointer();
|
|
1405
|
-
v.setPointer(e.x * .5 + .5, e.y * .5 + .5);
|
|
1375
|
+
//#region src/components/blob/composables/blobSimulation.ts
|
|
1376
|
+
function He(e, t) {
|
|
1377
|
+
return e && t ? {
|
|
1378
|
+
timeSec: e.timeSec,
|
|
1379
|
+
simulationTimeMs: e.simTimeMs,
|
|
1380
|
+
buffer: {
|
|
1381
|
+
width: t.w,
|
|
1382
|
+
height: t.h,
|
|
1383
|
+
dpr: t.dpr
|
|
1384
|
+
},
|
|
1385
|
+
simulationOrigin: {
|
|
1386
|
+
x: .5,
|
|
1387
|
+
y: .5
|
|
1406
1388
|
}
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1389
|
+
} : null;
|
|
1390
|
+
}
|
|
1391
|
+
function Ue(e) {
|
|
1392
|
+
let t = n(), r = F(!1), i = I(null), a = /* @__PURE__ */ new Map(), o = 0, s = 0, c = !1, d = null, f = null, p = null;
|
|
1393
|
+
e.satellites.onPinch((t) => e.pointer.click(t));
|
|
1394
|
+
let m = (e) => {
|
|
1395
|
+
let t = a.get(e);
|
|
1396
|
+
if (t) return t;
|
|
1397
|
+
let n = u(l(e));
|
|
1398
|
+
return a.size > 256 && a.clear(), a.set(e, n), n;
|
|
1399
|
+
}, h = () => e.mood.isSettled() && e.pointer.isAtRest() && e.satellites.isQuiescent(), g = () => {
|
|
1400
|
+
let e = h();
|
|
1401
|
+
return r.value = e, e && (i.value = He(d, f)), e;
|
|
1402
|
+
}, _ = () => {
|
|
1403
|
+
p !== null && (clearTimeout(p), p = null);
|
|
1404
|
+
}, v = (t) => {
|
|
1405
|
+
if (_(), typeof setTimeout > "u") return;
|
|
1406
|
+
let n = Math.min(Math.max(t - s, 16), 3e4);
|
|
1407
|
+
p = setTimeout(() => {
|
|
1408
|
+
p = null, e.wake();
|
|
1409
|
+
}, n);
|
|
1410
|
+
};
|
|
1411
|
+
return {
|
|
1412
|
+
resolveFrame: (n) => {
|
|
1413
|
+
let r = o ? (n - o) * 1e3 : 16;
|
|
1414
|
+
o = n;
|
|
1415
|
+
let i = Math.max(0, Math.min(r, 50)), a = e.getReducedMotion(), l = a || c ? 0 : e.config.tempo, u = l * i;
|
|
1416
|
+
if (s += u, t.setActive(e.pointer.active.value), l > 0 && e.pointer.active.value) {
|
|
1417
|
+
let n = e.pointer.rawPointer();
|
|
1418
|
+
t.setPointer(n.x * .5 + .5, n.y * .5 + .5);
|
|
1419
|
+
}
|
|
1420
|
+
t.tick(l === 0 ? 0 : i);
|
|
1421
|
+
let d = t.acceleration.value, f = t.velocity.value, p = -(d.x * f.x + d.y * f.y);
|
|
1422
|
+
return p > 0 && l > 0 && e.pointer.click(Math.min(.5, p * 4 + t.burst.value * .2)), a || e.mood.update({
|
|
1423
|
+
pointerActive: e.pointer.active.value,
|
|
1424
|
+
clicked: e.pointer.consumeClick(),
|
|
1425
|
+
idleMs: e.pointer.idleMs()
|
|
1426
|
+
}), e.mood.tick(u), a ? e.pointer.rest() : e.pointer.tick(u), e.satellites.tick(s, e.mood.params.value), {
|
|
1427
|
+
params: e.mood.params.value,
|
|
1428
|
+
rgb: m(e.color.value),
|
|
1429
|
+
simTimeMs: s,
|
|
1430
|
+
timeSec: n,
|
|
1431
|
+
resolveColor: m,
|
|
1432
|
+
rimColor: e.rimColor.value,
|
|
1433
|
+
paletteStops: e.paletteStops.value,
|
|
1434
|
+
satColors: e.satelliteColors?.value
|
|
1435
|
+
};
|
|
1436
|
+
},
|
|
1437
|
+
shouldContinue: () => {
|
|
1438
|
+
let t = g();
|
|
1439
|
+
if (c) return !1;
|
|
1440
|
+
if (!t) return _(), !0;
|
|
1441
|
+
let n = e.satellites.nextEventMs(s), r = e.mood.nextAutoMoodMs(), i = Number.isFinite(r) ? s + r : Infinity;
|
|
1442
|
+
return v(Math.min(n, i)), !1;
|
|
1443
|
+
},
|
|
1444
|
+
recordBackingSize: (e) => {
|
|
1445
|
+
f = e;
|
|
1446
|
+
},
|
|
1447
|
+
recordDraw: (e) => {
|
|
1448
|
+
d = e, g();
|
|
1449
|
+
},
|
|
1450
|
+
pause: () => {
|
|
1451
|
+
c = !0, _();
|
|
1452
|
+
},
|
|
1453
|
+
resume: () => {
|
|
1454
|
+
c = !1;
|
|
1455
|
+
},
|
|
1456
|
+
dispose: _,
|
|
1457
|
+
settled: P(r),
|
|
1458
|
+
settledFrame: P(i)
|
|
1459
|
+
};
|
|
1460
|
+
}
|
|
1461
|
+
//#endregion
|
|
1462
|
+
//#region src/components/blob/composables/useMetaballRenderer.ts
|
|
1463
|
+
function We(e) {
|
|
1464
|
+
let { canvasRef: t, color: n, rimColor: r, paletteStops: i, satelliteColors: a, mood: o, pointer: s, satellites: c, config: l } = e, u = null, d = I(y("webgpu")), p = Ue({
|
|
1465
|
+
color: n,
|
|
1466
|
+
rimColor: r,
|
|
1467
|
+
paletteStops: i,
|
|
1468
|
+
satelliteColors: a,
|
|
1469
|
+
mood: o,
|
|
1470
|
+
pointer: s,
|
|
1471
|
+
satellites: c,
|
|
1472
|
+
config: l,
|
|
1473
|
+
getReducedMotion: () => u?.reducedMotion ?? !1,
|
|
1474
|
+
wake: () => u?.wake()
|
|
1475
|
+
}), m = () => f() * (l.quality === "half" ? .5 : 1);
|
|
1476
|
+
function h(t) {
|
|
1477
|
+
u = v(t, {
|
|
1478
|
+
dprPolicy: m,
|
|
1479
|
+
composeIntersectionPark: !0,
|
|
1480
|
+
intersectionRootMargin: "200px",
|
|
1435
1481
|
revealBloom: e.revealBloom ?? !0,
|
|
1436
1482
|
contextAttrs: {
|
|
1437
1483
|
alpha: !0,
|
|
@@ -1439,144 +1485,164 @@ function Ve(e) {
|
|
|
1439
1485
|
antialias: !1,
|
|
1440
1486
|
preserveDrawingBuffer: !1
|
|
1441
1487
|
},
|
|
1442
|
-
setupWGPU:
|
|
1488
|
+
setupWGPU: Ve({
|
|
1443
1489
|
canvas: t,
|
|
1444
|
-
config:
|
|
1445
|
-
pointer:
|
|
1446
|
-
satellites:
|
|
1447
|
-
resolveFrame:
|
|
1448
|
-
shouldContinue:
|
|
1449
|
-
|
|
1490
|
+
config: l,
|
|
1491
|
+
pointer: s,
|
|
1492
|
+
satellites: c,
|
|
1493
|
+
resolveFrame: p.resolveFrame,
|
|
1494
|
+
shouldContinue: p.shouldContinue,
|
|
1495
|
+
onResize: p.recordBackingSize,
|
|
1496
|
+
onDraw: p.recordDraw
|
|
1450
1497
|
}),
|
|
1451
1498
|
setupGL: (e) => {
|
|
1452
|
-
let { prog: n, vs: r, fs: i, vao: a, buf: o, locs:
|
|
1453
|
-
function
|
|
1454
|
-
e.viewport(0, 0, n?.w ?? t.width, n?.h ?? t.height);
|
|
1499
|
+
let { prog: n, vs: r, fs: i, vao: a, buf: o, locs: u } = Ne(e);
|
|
1500
|
+
function d(n) {
|
|
1501
|
+
n && p.recordBackingSize(n), e.viewport(0, 0, n?.w ?? t.width, n?.h ?? t.height);
|
|
1455
1502
|
}
|
|
1456
|
-
function
|
|
1457
|
-
|
|
1503
|
+
function f(r) {
|
|
1504
|
+
let i = p.resolveFrame(r);
|
|
1505
|
+
Fe(e, n, a, u, t, l, s, c, i), p.recordDraw(i);
|
|
1458
1506
|
}
|
|
1459
1507
|
return {
|
|
1460
|
-
frame:
|
|
1461
|
-
shouldContinue:
|
|
1462
|
-
resize:
|
|
1508
|
+
frame: f,
|
|
1509
|
+
shouldContinue: p.shouldContinue,
|
|
1510
|
+
resize: d,
|
|
1463
1511
|
teardown: () => {
|
|
1464
1512
|
e.deleteProgram(n), e.deleteShader(r), e.deleteShader(i), e.deleteBuffer(o), e.deleteVertexArray(a);
|
|
1465
1513
|
}
|
|
1466
1514
|
};
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1515
|
+
},
|
|
1516
|
+
onStatus: (e) => d.value = e
|
|
1517
|
+
}), u.armAsync().catch(() => void 0);
|
|
1469
1518
|
}
|
|
1470
|
-
return
|
|
1471
|
-
e && !
|
|
1472
|
-
}, { immediate: !0 }),
|
|
1473
|
-
|
|
1519
|
+
return R(t, (e) => {
|
|
1520
|
+
e && !u && h(e);
|
|
1521
|
+
}, { immediate: !0 }), R(n, () => u?.wake()), R(r, () => u?.wake()), R(i, () => u?.wake(), { deep: !0 }), a && R(a, () => u?.wake(), { deep: !0 }), M(() => {
|
|
1522
|
+
p.dispose(), u?.dispose(), u = null;
|
|
1474
1523
|
}), {
|
|
1475
1524
|
pause: () => {
|
|
1476
|
-
|
|
1525
|
+
p.pause(), u?.suspend("manual");
|
|
1477
1526
|
},
|
|
1478
1527
|
resume: () => {
|
|
1479
|
-
|
|
1528
|
+
p.resume(), u?.resume("manual");
|
|
1480
1529
|
},
|
|
1481
|
-
wake: () =>
|
|
1482
|
-
settled:
|
|
1530
|
+
wake: () => u?.wake(),
|
|
1531
|
+
settled: p.settled,
|
|
1532
|
+
settledFrame: p.settledFrame,
|
|
1533
|
+
rendererStatus: P(d)
|
|
1483
1534
|
};
|
|
1484
1535
|
}
|
|
1485
1536
|
//#endregion
|
|
1486
1537
|
//#region src/components/blob/Blob.vue?vue&type=script&setup=true&lang.ts
|
|
1487
|
-
var
|
|
1538
|
+
var Ge = ["aria-label", "disabled"], Ke = 1.3, qe = /*#__PURE__*/ t(/* @__PURE__ */ O({
|
|
1488
1539
|
__name: "Blob",
|
|
1489
1540
|
props: {
|
|
1490
1541
|
color: {},
|
|
1491
1542
|
config: {},
|
|
1492
|
-
variant: {},
|
|
1493
1543
|
seed: { default: "" },
|
|
1494
1544
|
paused: {
|
|
1495
1545
|
type: Boolean,
|
|
1496
1546
|
default: !1
|
|
1547
|
+
},
|
|
1548
|
+
pressLabel: {},
|
|
1549
|
+
disabled: {
|
|
1550
|
+
type: Boolean,
|
|
1551
|
+
default: !1
|
|
1497
1552
|
}
|
|
1498
1553
|
},
|
|
1499
|
-
emits: [
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1554
|
+
emits: [
|
|
1555
|
+
"click",
|
|
1556
|
+
"update:paused",
|
|
1557
|
+
"rendererStatus"
|
|
1558
|
+
],
|
|
1559
|
+
setup(t, { expose: n, emit: r }) {
|
|
1560
|
+
let i = r, a = k(o, null), s = t.config ?? a;
|
|
1561
|
+
if (!s) throw Error("[glass-ui] Blob: no blob config. Pass an explicit `config` prop (e.g. BLOB_CONFIG_DEFAULTS) or provide(BLOB_CONFIG_KEY, cfg) from an ancestor. There is no silent defaults synthesis.");
|
|
1562
|
+
let c = () => t.config ?? a ?? s, l = L("canvasRef"), u = L("wrapperRef"), d = L("hitLayerRef"), f = w(() => !!t.pressLabel?.trim()), p = w(() => f.value && !t.disabled && !t.paused), m = w(() => p.value ? d.value : null), h = Math.min(1, Math.max(.25, s.geometry.bodyRadius / B * Ke)), g = `${(h * 50).toFixed(2)}%`, _ = _e(), v = ve(m, { hitRadius: () => h }), y = xe(s, t.color + t.seed), b = e(), x = F(t.color), S = F(s.surface.rimColor), C = F([...s.color.paletteStops]), O = F([...s.color.satelliteColors ?? []]);
|
|
1563
|
+
function M() {
|
|
1564
|
+
let e = u.value, n = c();
|
|
1565
|
+
b.invalidate(), x.value = b.resolve(t.color, e), S.value = b.resolve(n.surface.rimColor, e), C.value = n.color.paletteStops.map((t) => b.resolve(t, e)), O.value = (n.color.satelliteColors ?? []).map((t) => b.resolve(t, e));
|
|
1509
1566
|
}
|
|
1510
|
-
let
|
|
1567
|
+
let P = We({
|
|
1511
1568
|
canvasRef: l,
|
|
1512
|
-
color:
|
|
1513
|
-
rimColor:
|
|
1514
|
-
paletteStops:
|
|
1515
|
-
satelliteColors:
|
|
1516
|
-
mood:
|
|
1517
|
-
pointer:
|
|
1518
|
-
satellites:
|
|
1519
|
-
config:
|
|
1569
|
+
color: x,
|
|
1570
|
+
rimColor: S,
|
|
1571
|
+
paletteStops: C,
|
|
1572
|
+
satelliteColors: O,
|
|
1573
|
+
mood: _,
|
|
1574
|
+
pointer: v,
|
|
1575
|
+
satellites: y,
|
|
1576
|
+
config: s
|
|
1520
1577
|
});
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1578
|
+
P.rendererStatus && R(P.rendererStatus, (e) => i("rendererStatus", e), {
|
|
1579
|
+
immediate: !0,
|
|
1580
|
+
flush: "sync"
|
|
1581
|
+
}), R(u, M, { immediate: !0 });
|
|
1582
|
+
let I = null;
|
|
1583
|
+
typeof document < "u" && (I = new MutationObserver(M), I.observe(document.documentElement, {
|
|
1524
1584
|
attributes: !0,
|
|
1525
1585
|
attributeFilter: ["class"]
|
|
1526
|
-
})),
|
|
1527
|
-
|
|
1528
|
-
}),
|
|
1529
|
-
let e =
|
|
1586
|
+
})), R(w(() => t.color), (e) => {
|
|
1587
|
+
M(), y.reseed(e + t.seed);
|
|
1588
|
+
}), R(() => {
|
|
1589
|
+
let e = c();
|
|
1530
1590
|
return [
|
|
1531
1591
|
e.color.paletteStops.join("|"),
|
|
1532
1592
|
(e.color.satelliteColors ?? []).join("|"),
|
|
1533
1593
|
e.surface.rimColor
|
|
1534
1594
|
];
|
|
1535
|
-
}, () =>
|
|
1536
|
-
e &&
|
|
1537
|
-
}),
|
|
1538
|
-
|
|
1595
|
+
}, () => M(), { deep: !0 }), R(() => v.active.value, (e) => {
|
|
1596
|
+
e && P.wake();
|
|
1597
|
+
}), R(() => t.paused, (e) => e ? P.pause() : P.resume(), { immediate: !0 }), j(() => {
|
|
1598
|
+
I?.disconnect(), I = null;
|
|
1539
1599
|
});
|
|
1540
|
-
function
|
|
1541
|
-
|
|
1600
|
+
function z() {
|
|
1601
|
+
y.nudge();
|
|
1542
1602
|
}
|
|
1543
|
-
function
|
|
1544
|
-
|
|
1603
|
+
function V(e) {
|
|
1604
|
+
_.setMood(e, { source: "manual" });
|
|
1545
1605
|
}
|
|
1546
|
-
function
|
|
1547
|
-
|
|
1606
|
+
function H() {
|
|
1607
|
+
v.click(s.interaction.clickImpulse);
|
|
1548
1608
|
}
|
|
1549
|
-
function
|
|
1550
|
-
|
|
1609
|
+
function U() {
|
|
1610
|
+
H(), i("click");
|
|
1551
1611
|
}
|
|
1552
1612
|
return n({
|
|
1553
|
-
nudge:
|
|
1554
|
-
setMood:
|
|
1555
|
-
pulse:
|
|
1556
|
-
currentMood:
|
|
1557
|
-
pause:
|
|
1558
|
-
resume:
|
|
1559
|
-
settled:
|
|
1560
|
-
|
|
1613
|
+
nudge: z,
|
|
1614
|
+
setMood: V,
|
|
1615
|
+
pulse: H,
|
|
1616
|
+
currentMood: _.currentMood,
|
|
1617
|
+
pause: P.pause,
|
|
1618
|
+
resume: P.resume,
|
|
1619
|
+
settled: P.settled,
|
|
1620
|
+
settledFrame: P.settledFrame,
|
|
1621
|
+
rendererStatus: P.rendererStatus
|
|
1622
|
+
}), (e, n) => (N(), E("div", {
|
|
1561
1623
|
ref_key: "wrapperRef",
|
|
1562
1624
|
ref: u,
|
|
1563
1625
|
class: "goo-blob-wrapper",
|
|
1564
|
-
style:
|
|
1565
|
-
}, [
|
|
1626
|
+
style: A({ "--blob-color": t.color })
|
|
1627
|
+
}, [D("canvas", {
|
|
1566
1628
|
ref_key: "canvasRef",
|
|
1567
1629
|
ref: l,
|
|
1568
1630
|
class: "goo-blob-canvas",
|
|
1569
1631
|
"aria-hidden": "true",
|
|
1570
1632
|
"data-testid": "goo-blob-canvas"
|
|
1571
|
-
}, null, 512), E("
|
|
1633
|
+
}, null, 512), f.value ? (N(), E("button", {
|
|
1634
|
+
key: 0,
|
|
1572
1635
|
ref_key: "hitLayerRef",
|
|
1573
1636
|
ref: d,
|
|
1637
|
+
type: "button",
|
|
1574
1638
|
class: "goo-blob-hit",
|
|
1575
|
-
|
|
1639
|
+
"aria-label": t.pressLabel,
|
|
1640
|
+
disabled: t.disabled || t.paused,
|
|
1641
|
+
style: A({ "--blob-hit-radius": g }),
|
|
1576
1642
|
"data-testid": "goo-blob-hit",
|
|
1577
|
-
onClick:
|
|
1578
|
-
}, null,
|
|
1643
|
+
onClick: U
|
|
1644
|
+
}, null, 12, Ge)) : T("", !0)], 4));
|
|
1579
1645
|
}
|
|
1580
|
-
}), [["__scopeId", "data-v-
|
|
1646
|
+
}), [["__scopeId", "data-v-bf4ba5b9"]]);
|
|
1581
1647
|
//#endregion
|
|
1582
|
-
export {
|
|
1648
|
+
export { r as BLOB_CONFIG_DEFAULTS, o as BLOB_CONFIG_KEY, c as BLOB_HERO, qe as Blob, a as LIGHTNESS_FLOOR_BRACKET, s as LIGHTNESS_FLOOR_DEFAULT, i as clampLightnessFloor, _e as useBlobMood, ve as useBlobPointer, xe as useBlobSatellites };
|