@mkbabb/glass-ui 5.0.0 → 6.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 +30 -27
- package/dist/DropdownMenuTrigger-BzQtd9lt.js +65 -0
- package/dist/{FadingScroll-BSRLqQCx.js → FadingScroll-C1ZWEjmG.js} +32 -25
- package/dist/{Input-DKf-XwUM.js → Input-B4WQ_CMc.js} +1 -1
- package/dist/{PagerDots-BP6jh7z4.js → PagerDots-BoTQ7g5l.js} +123 -95
- package/dist/{accent-tone-solve-CBw3L0cy.js → accent-tone-solve-Dii9ePhK.js} +1 -1
- package/dist/animated-digit.js +1 -1
- package/dist/aurora.js +324 -314
- package/dist/blob-config.d.ts +0 -4
- package/dist/blob-config.js +1 -1
- package/dist/blob.js +280 -261
- package/dist/{button-BXzhydVB.js → button-32mg6xA8.js} +63 -56
- package/dist/button.js +1 -1
- package/dist/canvas.js +1 -1
- package/dist/{CardAction-2uUvjMQK.js → card-16xmzIr3.js} +29 -11
- package/dist/card.js +1 -1
- package/dist/carousel.d.ts +1 -2
- package/dist/carousel.js +26 -95
- package/dist/chip.d.ts +0 -9
- package/dist/chip.js +1 -1
- package/dist/collapsible.js +1 -1
- package/dist/color-swatch.js +1 -0
- package/dist/color.js +87 -3
- package/dist/{CommandShortcut-fmdbsEJL.js → command-BjPjUU9z.js} +56 -51
- package/dist/command.js +1 -1
- package/dist/completion-seal.js +64 -55
- package/dist/components/_shared/ModalOverlay.vue.d.ts +5 -52
- package/dist/components/_shared/field-surfaces.css +1 -0
- package/dist/components/_shared/menuItemVariants.d.ts +2 -2
- package/dist/components/_shared/useMotionAxis.d.ts +2 -2
- package/dist/components/_shared/valueDomain.d.ts +6 -0
- package/dist/components/alert/index.d.ts +1 -1
- package/dist/components/animated-digit/AnimatedDigit.vue.d.ts +1 -1
- package/dist/components/aurora/Aurora.vue.d.ts +7 -1
- package/dist/components/aurora/composables/runtime.d.ts +5 -3
- package/dist/components/aurora/composables/useAurora.d.ts +4 -2
- package/dist/components/avatar/AvatarImage.vue.d.ts +3 -1
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/blob/Blob.vue.d.ts +11 -0
- package/dist/components/blob/composables/useMetaballRenderer.d.ts +2 -0
- package/dist/components/button/Button.vue.d.ts +4 -2
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/card/Card.vue.d.ts +4 -4
- package/dist/components/card/ScrollCard.vue.d.ts +1 -1
- package/dist/components/card/styles.css +1 -0
- package/dist/components/carousel/Carousel.vue.d.ts +2 -2
- package/dist/components/carousel/CarouselNext.vue.d.ts +1 -1
- package/dist/components/carousel/CarouselPrevious.vue.d.ts +1 -1
- package/dist/components/carousel/index.d.ts +0 -1
- package/dist/components/carousel/useCarousel.d.ts +2 -2
- package/dist/components/combobox/ComboboxList.vue.d.ts +1 -1
- package/dist/components/combobox/index.d.ts +1 -3
- package/dist/components/command/Command.vue.d.ts +1 -1
- package/dist/components/command/CommandDialog.vue.d.ts +9 -6
- package/dist/components/completion-seal/styles.css +1 -0
- package/dist/components/constellation/Constellation.vue.d.ts +6 -1
- package/dist/components/constellation/composables/useConstellation.d.ts +3 -16
- package/dist/components/constellation/constants.d.ts +6 -16
- package/dist/components/constellation/constellationField.d.ts +3 -5
- package/dist/components/constellation/constellationInteraction.d.ts +1 -1
- package/dist/components/constellation/constellationRender.d.ts +11 -21
- package/dist/components/constellation/constellationTypes.d.ts +12 -9
- package/dist/components/constellation/index.d.ts +1 -1
- package/dist/components/controls/DarkModeToggle.vue.d.ts +0 -2
- package/dist/components/data-table/DataTable.vue.d.ts +14 -2
- package/dist/components/data-table/index.d.ts +1 -2
- package/dist/components/data-table/types.d.ts +26 -1
- package/dist/components/deck/constants.d.ts +0 -10
- package/dist/components/deck/index.d.ts +0 -1
- package/dist/components/dialog/DialogContent.vue.d.ts +7 -1
- package/dist/components/dialog/index.d.ts +0 -1
- package/dist/components/dock/DockControl.vue.d.ts +4 -4
- package/dist/components/dock/DockStack.vue.d.ts +2 -2
- package/dist/components/dock/GlassDock.vue.d.ts +1 -0
- package/dist/components/dock/composables/dockMorphContext.d.ts +2 -0
- package/dist/components/dock/composables/dockMorphMeasure.d.ts +11 -1
- package/dist/components/dock/composables/useDockClickIntegrity.d.ts +4 -0
- package/dist/components/dock/composables/useDockOverflowFit.d.ts +3 -3
- package/dist/components/dock/composables/useDockPopover.d.ts +2 -0
- package/dist/components/dock/composables/useDockShellProps.d.ts +7 -0
- package/dist/components/dock/composables/useDockState.d.ts +2 -2
- package/dist/components/dock/constants.d.ts +0 -12
- package/dist/components/dock/index.d.ts +1 -0
- 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/{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/overflow.css +1 -0
- package/dist/components/dock/styles/popover.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 +3 -3
- package/dist/components/drawer/composables/drawerSnapContext.d.ts +3 -1
- package/dist/components/drawer/constants.d.ts +6 -6
- package/dist/components/drawer/index.d.ts +4 -6
- package/dist/components/drawer/styles.css +1 -0
- package/dist/components/dropdown-menu/DropdownMenuContent.vue.d.ts +1 -1
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.d.ts +9 -3
- package/dist/components/dropdown-menu/index.d.ts +0 -1
- 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 +4 -0
- package/dist/components/easing/constants.d.ts +2 -0
- package/dist/components/fading-scroll/composables/useFadingScroll.d.ts +3 -3
- package/dist/components/fourier-field/FourierField.vue.d.ts +7 -1
- package/dist/components/fourier-field/composables/useFourierField.d.ts +2 -1
- package/dist/components/handmark/HandMark.vue.d.ts +1 -1
- package/dist/components/handmark/geometry.d.ts +1 -1
- package/dist/components/handmark/index.d.ts +4 -6
- package/dist/components/icon-chip/styles.css +1 -0
- package/dist/components/index.d.ts +0 -1
- package/dist/components/infinite-scroll/index.d.ts +1 -0
- package/dist/components/instrument-chassis/styles.css +1 -0
- package/dist/components/labeled-field/LabeledField.vue.d.ts +12 -2
- package/dist/components/labeled-field/LabeledInput.vue.d.ts +10 -3
- package/dist/components/liquid-grid/LiquidGrid.vue.d.ts +4 -0
- package/dist/components/liquid-grid/composables/useLiquidGrid.d.ts +2 -1
- package/dist/components/metric-stack/MetricStack.vue.d.ts +1 -1
- package/dist/components/pager-dots/PagerDots.vue.d.ts +1 -1
- package/dist/components/popover/PopoverContent.vue.d.ts +1 -1
- package/dist/components/progress/Progress.vue.d.ts +5 -40
- package/dist/components/progress/ProgressDefault.vue.d.ts +1 -17
- package/dist/components/progress/ProgressGradient.vue.d.ts +1 -0
- package/dist/components/progress/ProgressLiquid.vue.d.ts +1 -0
- package/dist/components/progress/index.d.ts +0 -5
- package/dist/components/progress/valueMarks.css +1 -0
- package/dist/components/pulse/Pulse.vue.d.ts +2 -2
- 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 +2 -2
- package/dist/components/search/searchVariants.d.ts +1 -1
- package/dist/components/select/SelectContent.vue.d.ts +1 -1
- package/dist/components/select/index.d.ts +0 -2
- package/dist/components/skeleton/Skeleton.vue.d.ts +1 -1
- package/dist/components/slider/Slider.vue.d.ts +2 -0
- package/dist/components/split-chars/SplitChars.vue.d.ts +1 -1
- package/dist/components/surface/Surface.vue.d.ts +1 -1
- package/dist/components/table/Table.vue.d.ts +4 -0
- package/dist/components/tabs/SegmentedTabs.vue.d.ts +10 -0
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/styles/drag.css +1 -0
- package/dist/components/tags-input/TagsInput.vue.d.ts +2 -2
- package/dist/components/timeline/ContinuousTimeline.vue.d.ts +1 -1
- package/dist/components/timeline/GlassTimeline.vue.d.ts +4 -4
- package/dist/components/toast/Toast.vue.d.ts +3 -3
- package/dist/components/toast/use-toast.d.ts +4 -4
- package/dist/components/typewriter/TypewriterText.vue.d.ts +1 -4
- package/dist/components/typewriter/composables/useTypewriter.d.ts +0 -1
- package/dist/components/typewriter/utils/graphemes.d.ts +1 -0
- package/dist/components/watercolor-dot/WatercolorDot.vue.d.ts +2 -2
- package/dist/composables/glass/useGlassBackdropLuminance.d.ts +31 -0
- package/dist/composables/glass/webgpu/rendererStatus.d.ts +13 -0
- package/dist/composables/glass/webgpu/useGpuSubstrate.d.ts +3 -0
- package/dist/composables/glass/webgpu/webgpuCanvasTypes.d.ts +2 -0
- package/dist/composables/motion/springProjection.d.ts +16 -0
- package/dist/composables/motion/useAnimatedNumber.d.ts +1 -6
- package/dist/composables/motion/useCountup.d.ts +1 -6
- package/dist/composables/motion/useDockCtaReceive.d.ts +55 -0
- package/dist/composables/motion/useElementMorph.d.ts +8 -0
- package/dist/composables/motion/useLiquidPress.d.ts +12 -4
- package/dist/composables/motion/useNumericTransition.d.ts +2 -0
- package/dist/composables/motion/useTextHighlight.d.ts +2 -1
- package/dist/configurator-CSENXXSy.js +311 -0
- package/dist/configurator.js +2 -3
- package/dist/constellation.js +235 -571
- package/dist/controls.js +55 -63
- package/dist/{createCanvasLifecycle-DlrcvWbb.js → createCanvasLifecycle-hsFkQVdl.js} +32 -32
- package/dist/dark-DIH-blY1.js +70 -0
- package/dist/dark.d.ts +1 -2
- package/dist/dark.js +2 -20
- package/dist/{DataTable-Bxya8nBn.js → data-table-DveMdgBM.js} +231 -120
- package/dist/data-table.js +2 -2
- package/dist/deck.js +10 -21
- package/dist/dialog-BzQxKrUr.js +281 -0
- package/dist/dialog.js +2 -3
- package/dist/dock.js +561 -428
- package/dist/{dockContext-d-WpJN2Z.js → dockContext-4S9qP0Z4.js} +1 -1
- package/dist/dom.js +196 -7
- package/dist/drawer.js +111 -66
- package/dist/dropdown-menu-DORIA52F.js +378 -0
- package/dist/dropdown-menu.js +3 -2
- package/dist/easing.d.ts +0 -9
- package/dist/easing.js +334 -187
- package/dist/expandable-container.js +12 -4
- package/dist/fading-scroll.js +1 -1
- package/dist/focus-scope.js +1 -1
- package/dist/forms.js +37 -78
- package/dist/fourier-field.js +273 -263
- 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 +131 -195
- package/dist/handmark.d.ts +0 -2
- package/dist/handmark.js +82 -82
- package/dist/header-ribbon.js +41 -30
- package/dist/{IconChip-CwLmBJ_K.js → icon-chip-BWuxz1-u.js} +1 -1
- package/dist/icon-chip.js +1 -1
- package/dist/{IconTooltip-D9sbK-Mk.js → icon-tooltip-CO6rw0dZ.js} +1 -1
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/infinite-scroll.d.ts +0 -1
- package/dist/infinite-scroll.js +17 -15
- package/dist/instrument-chassis.js +1 -1
- package/dist/keyboard.js +104 -2
- package/dist/label.js +1 -1
- package/dist/labeled-field.js +95 -69
- package/dist/liquid-grid.js +173 -162
- package/dist/metric-badge.js +3 -3
- package/dist/metric-cell.js +2 -2
- package/dist/metric-stack.js +1 -1
- package/dist/motion-core.js +15 -16
- package/dist/motion-curves.d.ts +0 -20
- package/dist/motion.js +59 -58
- package/dist/{Notification-DQv2cOh9.js → notification-DVs7ODMg.js} +17 -8
- package/dist/notification.js +1 -1
- package/dist/{NumberFieldContent-BkE7xPS9.js → number-field-PvkGedHk.js} +2 -2
- package/dist/number-field.js +1 -1
- package/dist/pager-dots.js +1 -1
- package/dist/paper-backdrop.js +31 -2
- package/dist/{PopoverContent-DOtszFWK.js → popover-WMgyRSyN.js} +7 -2
- package/dist/popover.js +1 -1
- package/dist/procedural-color.wgsl-B9mLK7v0.js +377 -0
- package/dist/progress-C-HHuFZy.js +192 -0
- package/dist/progress.js +2 -2
- package/dist/pulse.js +3 -1
- package/dist/reactive.js +19 -3
- package/dist/rendererStatus-C2-zC2Q-.js +40 -0
- package/dist/{resolveCanvasColor-B3L-akX0.js → resolveCanvasColor-yarP5bdk.js} +1 -1
- package/dist/scroll-progress-rim.js +1 -1
- package/dist/search.js +187 -146
- package/dist/{SelectScrollDownButton-CDtwaWkZ.js → select-BIv4R3Ir.js} +109 -44
- package/dist/select.js +2 -4
- package/dist/separator-CBU94kTM.js +62 -0
- package/dist/separator.js +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/slider-Cc_qw6GA.js +166 -0
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +43 -43
- package/dist/styles/accessibility.css +1 -0
- package/dist/styles/components.css +1 -1
- package/dist/styles/glass/control-surfaces.css +1 -1
- package/dist/styles/glass/glass-capsule.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/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.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/theme/bridges.css +1 -1
- package/dist/styles/tokens/glass-fx.css +1 -1
- package/dist/styles/tokens/glass.css +1 -1
- package/dist/styles/tokens/offsets.css +1 -1
- package/dist/styles/tokens/scale-paper.css +1 -1
- package/dist/styles/tokens/scheme-spring.css +1 -1
- package/dist/styles/tokens/shadow.css +1 -1
- package/dist/styles/tokens.d.ts +53 -0
- package/dist/styles/tokens.ts +58 -0
- 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/base.css +1 -1
- package/dist/styles/utilities/btn.css +1 -1
- package/dist/styles/utilities/components.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/{Switch-BPBfhMU3.js → switch-Boj4Ucn5.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/tabs.js +51 -45
- package/dist/timeline.js +2 -2
- package/dist/toast.js +1 -1
- package/dist/{ToggleGroupItem-DNWx2aSW.js → toggle-group-BPchFsns.js} +10 -7
- package/dist/toggle-group.js +1 -1
- package/dist/tokens.d.ts +1 -53
- package/dist/tokens.js +1 -1
- package/dist/{TooltipProvider-GtfYdSVf.js → tooltip-BmOQJzh0.js} +1 -0
- package/dist/tooltip.js +1 -1
- package/dist/typewriter.js +151 -166
- package/dist/{useAccentTone-D25DxviG.js → useAccentTone-C-p6WdPe.js} +1 -1
- package/dist/{useAnimatedNumber-2XC4aRB6.js → useAnimatedNumber-BRVVaFFc.js} +1 -1
- package/dist/useDockCtaReceive-CK-RLASa.js +257 -0
- package/dist/{useGooMorph-CU1pwuC6.js → useGooMorph-D1F6QJlH.js} +140 -59
- package/dist/{useIntersectionPause-Cmt5Tnv9.js → useIntersectionPause-B-dbxl9w.js} +1 -1
- package/dist/useLiquidPress-BYcwwGQV.js +68 -0
- package/dist/{useRAFLoop-CvOo_kgb.js → useRAFLoop-BtwQ9DyY.js} +1 -1
- package/dist/{useScrollProgress-C-yImzhU.js → useScrollProgress-DZI4nf4v.js} +1 -1
- package/dist/{useSelectionGroup-Btpf24aY.js → useSelectionGroup-LDzBdR1Y.js} +3 -3
- package/dist/{useTabRovingFocus-CG1H1k1J.js → useTabRovingFocus-DkLYwo4L.js} +1 -1
- package/dist/{useTouchGate-BlegwvwL.js → useTouchGate-Cj5fOkTv.js} +1 -1
- package/dist/valueDomain-B8L04u3U.js +13 -0
- package/dist/watercolor-dot.js +5 -3
- package/package.json +5 -12
- package/src/styles/accessibility.css +48 -0
- package/src/styles/glass/glass-capsule.css +2 -2
- package/src/styles/glass/ladder.css +1 -1
- package/src/styles/glass/material-roles.css +18 -0
- package/src/styles/glass/material.css +18 -12
- package/src/styles/glass.css +5 -5
- package/src/styles/index.css +38 -30
- package/src/styles/theme/bridges.css +0 -6
- package/src/styles/tokens/glass-fx.css +1 -5
- package/src/styles/tokens/glass.css +1 -2
- package/src/styles/tokens/offsets.css +0 -1
- package/src/styles/tokens/property-regs.css +11 -10
- package/src/styles/tokens/scale-paper.css +0 -1
- package/src/styles/tokens/scheme-motion.css +3 -0
- package/src/styles/tokens/scheme-spring.css +0 -10
- package/src/styles/tokens/shadow.css +3 -29
- package/src/styles/tokens.ts +58 -0
- package/src/styles/typography/scale.css +5 -2
- package/src/styles/typography/semantic.css +5 -5
- package/src/styles/typography/utilities.css +5 -5
- package/src/styles/utilities/base.css +5 -5
- package/src/styles/utilities/btn.css +6 -27
- package/src/styles/utilities.css +4 -6
- package/dist/ConfiguratorRow-BV6zPjTM.js +0 -151
- package/dist/DialogContent-Bl4v10AC.js +0 -192
- package/dist/DialogFooter-C0v4Hz2F.js +0 -168
- package/dist/PaperBackdrop-BYwE8_kg.js +0 -31
- package/dist/Progress-uWLyXE7J.js +0 -308
- package/dist/SelectGroup-BuEptUsa.js +0 -31
- package/dist/SelectSeparator-4QGephvr.js +0 -49
- package/dist/Separator-DqJ6PfOd.js +0 -44
- package/dist/color-Bp5jmv4Z.js +0 -86
- package/dist/components/carousel/GlassCarouselPager.vue.d.ts +0 -50
- 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/deck/composables/useDeckSpring.d.ts +0 -22
- package/dist/components/dialog/DialogScrollContent.vue.d.ts +0 -33
- 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/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/dropdown-menu-DaGlVdp9.js +0 -421
- package/dist/math-CIEcwsYi.js +0 -112
- package/dist/procedural-color.wgsl-ByduxnzV.js +0 -4
- package/dist/slider-Cxuj_W_H.js +0 -151
- package/dist/stacked-icons.d.ts +0 -1
- package/dist/stacked-icons.js +0 -98
- package/dist/styles/cards.css +0 -1
- package/dist/styles/completion-seal.css +0 -1
- package/dist/styles/dock/adaptive-legibility.css +0 -1
- package/dist/styles/dock/dock.css +0 -1
- package/dist/styles/dock/layer-group.css +0 -1
- package/dist/styles/dock/layers.css +0 -1
- package/dist/styles/dock/overflow.css +0 -1
- package/dist/styles/dock/popover.css +0 -1
- package/dist/styles/dock/shape.css +0 -1
- package/dist/styles/dock/shell.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/icon-chip.css +0 -1
- package/dist/styles/instrument-chassis.css +0 -1
- package/dist/styles/scroll-progress-rim.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/useDockCtaReceive-BgMmeINo.js +0 -161
- package/dist/useGlobalDark-DjKMEQE2.js +0 -53
- package/dist/useGpuSubstrate-DcY584kE.js +0 -347
- package/dist/useInterval-ZATRi-1T.js +0 -18
- package/dist/useKeyboardShortcuts-ynVmNFo3.js +0 -104
- package/dist/useLiquidPress-BXNHydZh.js +0 -40
- package/dist/useTextHighlight-C46Le9u_.js +0 -72
- package/dist/useViewportReady-c0isoKL8.js +0 -191
- 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/drawer.css +0 -434
- package/src/styles/feedback-tone.css +0 -104
- package/src/styles/icon-chip.css +0 -256
- package/src/styles/instrument-chassis.css +0 -449
- package/src/styles/menu.css +0 -187
- 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/utilities/animate.css +0 -29
- /package/dist/{coalesce-metric-B8o7zT9u.js → coalesce-metric-znAcLzkB.js} +0 -0
- /package/dist/{CollapsibleContent-DiHcB_HH.js → collapsible-bPzS1aQk.js} +0 -0
- /package/dist/{compile-C55K3P9g.js → compile-DK3Fri1B.js} +0 -0
- /package/dist/{styles → components/_shared}/feedback-tone.css +0 -0
- /package/dist/{styles → components/_shared}/menu.css +0 -0
- /package/dist/{styles → components/card}/card-scroll.css +0 -0
- /package/dist/{styles/configurator.css → components/configurator/styles.css} +0 -0
- /package/dist/{styles/dock-controls → components/controls}/dark-mode-toggle.css +0 -0
- /package/dist/{styles/dialog-placement.css → components/dialog/placement.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}/crossfade.css +0 -0
- /package/dist/{styles/dock → components/dock/styles}/cta-seat.css +0 -0
- /package/dist/{styles/dock → components/dock/styles}/fisheye.css +0 -0
- /package/dist/{styles/dock → components/dock/styles}/morph.css +0 -0
- /package/dist/{styles/dock → components/dock/styles}/search.css +0 -0
- /package/dist/{styles/dock → components/dock/styles}/section.css +0 -0
- /package/dist/{styles/dock → components/dock/styles}/shell-regions.css +0 -0
- /package/dist/{styles/segmented-tabs.css → components/tabs/styles/segmented.css} +0 -0
- /package/dist/{constants-D8lSMkOz.js → constants-DRZmNIY-.js} +0 -0
- /package/dist/{createContext-BQ1Gy_LB.js → createContext-FU0n5MGK.js} +0 -0
- /package/dist/{flow.glsl-CVqPSj8_.js → flow.glsl-DEGFGE11.js} +0 -0
- /package/dist/{FocusScope-BzKwhsBn.js → focus-scope-DUTKveod.js} +0 -0
- /package/dist/{InstrumentChassis-Dss5Tjcm.js → instrument-chassis-Cvstg4_U.js} +0 -0
- /package/dist/{Label-C84TaQiw.js → label-Cj38tJKG.js} +0 -0
- /package/dist/{menuItemVariants-DbO-Fr74.js → menuItemVariants-D6AOzzND.js} +0 -0
- /package/dist/{pointerFieldMappings-4VtmkOWv.js → pointerFieldMappings-CZojkgKj.js} +0 -0
- /package/dist/{presets-B07HzyKd.js → presets-CxeNvxuO.js} +0 -0
- /package/dist/{prng-B0PLRmR6.js → prng-Dz2_9RJu.js} +0 -0
- /package/dist/{scrollReader-DzYqPQ6V.js → scrollReader-C2oK9Hb8.js} +0 -0
- /package/dist/{supportsCssTimeline-Ie4xJFbD.js → supportsCssTimeline-Dz-GVxXM.js} +0 -0
- /package/dist/{Toaster-C_-WeU9W.js → toast-kAbchIN2.js} +0 -0
- /package/dist/{useControlSize-DJwe-7ZQ.js → useControlSize-CFfOk8I-.js} +0 -0
- /package/dist/{useDocumentVisibility-CpJGUgcJ.js → useDocumentVisibility-YeBDGqtI.js} +0 -0
- /package/dist/{useDragMorph-65ihHePq.js → useDragMorph-7ygF9O0m.js} +0 -0
- /package/dist/{useDragVelocity-BWcNMCux.js → useDragVelocity-CbMZEBaC.js} +0 -0
- /package/dist/{useFuzzySearch-KslRxiJY.js → useFuzzySearch-BOgep7RE.js} +0 -0
- /package/dist/{useLeadTrail-DOH4XkL1.js → useLeadTrail-BYu8dq4G.js} +0 -0
- /package/dist/{usePointerVelocityField-CwXyeW0Z.js → usePointerVelocityField-BdvnO0py.js} +0 -0
- /package/dist/{useResizeObserver-DDuoBeBo.js → useResizeObserver-BcUTquV7.js} +0 -0
- /package/dist/{useResolveTokenColor-DVT5kwv6.js → useResolveTokenColor-C07e-qaT.js} +0 -0
- /package/dist/{useRoutePointer-DL7I0gY4.js → useRoutePointer-BDNMFN73.js} +0 -0
- /package/dist/{useSpringMount-CNvvgGiC.js → useSpringMount-C6-DBx4e.js} +0 -0
- /package/dist/{useTimer-CkDV8SC2.js → useTimer-D8koDvJS.js} +0 -0
- /package/dist/{useUserInvalidAria-Bkruei7M.js → useUserInvalidAria-Cr4nR3tu.js} +0 -0
- /package/dist/{vReveal-DUmiEkX_.js → vReveal-DZfWl9XI.js} +0 -0
- /package/dist/{vSpecular-DlYN0UZy.js → vSpecular-CQFmLNzA.js} +0 -0
- /package/dist/{writeVelocityWeight-D1rvdxJu.js → writeVelocityWeight-D_AcvTsE.js} +0 -0
package/dist/fourier-field.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-C1je1s0u.js";
|
|
2
|
-
import { n as t } from "./useResolveTokenColor-
|
|
3
|
-
import { t as n } from "./usePointerVelocityField-
|
|
4
|
-
import { t as r } from "./useRoutePointer-
|
|
5
|
-
import { d as i, u as a } from "./pointerFieldMappings-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { computed as
|
|
2
|
+
import { n as t } from "./useResolveTokenColor-C07e-qaT.js";
|
|
3
|
+
import { t as n } from "./usePointerVelocityField-BdvnO0py.js";
|
|
4
|
+
import { t as r } from "./useRoutePointer-BDNMFN73.js";
|
|
5
|
+
import { d as i, u as a } from "./pointerFieldMappings-CZojkgKj.js";
|
|
6
|
+
import { i as o } from "./dark-DIH-blY1.js";
|
|
7
|
+
import { cssToOklch as s, oklchToLinear as c } from "./color.js";
|
|
8
|
+
import { FOURIER_FIGURES as l, FOURIER_FIGURE_KEYS as u, comp as d, dftFromPoints as f, makeEllipticSpectrum as p, makeHarmonicFigure as m, partialSumAt as h, positionsAt as g } from "./fourier-math.js";
|
|
9
|
+
import { a as _, d as v, f as y, l as b, n as x, r as S } from "./procedural-color.wgsl-B9mLK7v0.js";
|
|
10
|
+
import { a as C } from "./rendererStatus-C2-zC2Q-.js";
|
|
11
|
+
import { n as w, t as T } from "./prng-Dz2_9RJu.js";
|
|
12
|
+
import { computed as E, createElementBlock as D, createElementVNode as O, defineComponent as k, normalizeClass as A, onMounted as j, onScopeDispose as M, openBlock as N, readonly as P, shallowRef as F, useTemplateRef as I, watch as L } from "vue";
|
|
13
13
|
//#region src/components/fourier-field/constants.ts
|
|
14
|
-
var
|
|
14
|
+
var R = 64, z = 384, B = .15, V = .4, H = 2.5 / (V + (1 - V) * .5) + .05, ee = .55, te = .35, ne = [{
|
|
15
15
|
L: .62,
|
|
16
16
|
C: .19,
|
|
17
17
|
h: 34
|
|
@@ -19,7 +19,7 @@ var I = 64, ee = 384, te = .15, L = .4, R = 2.5 / (L + (1 - L) * .5) + .05, ne =
|
|
|
19
19
|
L: .86,
|
|
20
20
|
C: .06,
|
|
21
21
|
h: 70
|
|
22
|
-
}],
|
|
22
|
+
}], re = {
|
|
23
23
|
source: "elliptic",
|
|
24
24
|
harmonics: 6,
|
|
25
25
|
showEpicycles: !0,
|
|
@@ -30,12 +30,12 @@ var I = 64, ee = 384, te = .15, L = .4, R = 2.5 / (L + (1 - L) * .5) + .05, ne =
|
|
|
30
30
|
intensity: 1,
|
|
31
31
|
harmonicScale: .24,
|
|
32
32
|
speed: 1,
|
|
33
|
-
palette:
|
|
33
|
+
palette: ne,
|
|
34
34
|
respectReducedMotion: !0,
|
|
35
35
|
interactive: !0,
|
|
36
|
-
squashGain:
|
|
37
|
-
celGain:
|
|
38
|
-
},
|
|
36
|
+
squashGain: ee,
|
|
37
|
+
celGain: te
|
|
38
|
+
}, ie = "\nconst MAX_PHASORS: i32 = 64;\nconst TAU: f32 = 6.283185307179586;\n\nstruct Phasor {\n // (re, im, index, _pad)\n data: vec4<f32>,\n};\n\n// ── Compute uniforms (the typed-struct source-of-truth — see uniformBridgeWGPU.ts) ──\nstruct ComputeUniforms {\n // c0: (headT, trailArc, _pad, _pad)\n c0: vec4<f32>,\n // ints: (harmonicN, epicycleArmN, sampleCount, phasorCount)\n ints: vec4<i32>,\n};\n\n@group(0) @binding(0) var<uniform> u: ComputeUniforms;\n@group(0) @binding(1) var<storage, read> phasors: array<Phasor>;\n// curveSamples[i] = (x, y, age, _pad)\n@group(0) @binding(2) var<storage, read_write> curveSamples: array<vec4<f32>>;\n// chainTips[k] = (x, y, _pad, _pad) — the running tip after stacking phasor k\n@group(0) @binding(3) var<storage, read_write> chainTips: array<vec4<f32>>;\n\n// The PARTIAL-SUM curve point at parameter t over the first n phasors — the WGSL\n// transcription of math.ts:78-95 (partialSumAt). EXACTLY:\n// c += vec2(re·cos − im·sin, re·sin + im·cos) with angle = TAU·index·t.\nfn partialSumAt(t: f32, n: i32) -> vec2<f32> {\n var c = vec2<f32>(0.0, 0.0);\n let phasorCount = u.ints.w;\n let lim = min(n, phasorCount);\n for (var i = 0; i < MAX_PHASORS; i = i + 1) {\n if (i >= lim) { break; }\n let p = phasors[i].data;\n let re = p.x;\n let im = p.y;\n let index = p.z;\n let angle = TAU * index * t;\n let cs = cos(angle);\n let sn = sin(angle);\n c = c + vec2<f32>(re * cs - im * sn, re * sn + im * cs);\n }\n return c;\n}\n\n// The epicycle chain tip after stacking the first k phasors at head_t — the WGSL\n// transcription of math.ts:41-60 (positionsAt, read at the running tip). The running tip\n// after phasor (k−1) is exactly the partial sum over the first k terms.\nfn epicycleChainTip(t: f32, k: i32) -> vec2<f32> {\n return partialSumAt(t, k);\n}\n\n@compute @workgroup_size(64)\nfn cs_main(@builtin(global_invocation_id) gid: vec3<u32>) {\n let i = i32(gid.x);\n let headT = u.c0.x;\n let trailArc = u.c0.y;\n let harmonicN = u.ints.x;\n let armN = u.ints.y;\n let sampleCount = u.ints.z;\n\n // ── The comet body samples ──\n if (i < sampleCount) {\n // age: 0 at the oldest tail (i = sampleCount−1), 1 at the head (i = 0).\n let denom = max(f32(sampleCount - 1), 1.0);\n let frac = f32(i) / denom; // 0 = head, 1 = tail\n let age = 1.0 - frac; // 1 = head, 0 = tail\n // sample back along the period from the head by trailArc.\n var t = headT - trailArc * frac;\n t = t - floor(t); // fract → [0,1)\n let pt = partialSumAt(t, harmonicN);\n curveSamples[i] = vec4<f32>(pt.x, pt.y, age, 0.0);\n }\n\n // ── The epicycle chain tips (k = 0..armN, capped to harmonicN) ──\n // chainTips[0] is the origin; chainTips[k] is the tip after phasor (k−1).\n let armLim = min(armN, harmonicN);\n if (i <= armLim && i <= MAX_PHASORS) {\n let tip = epicycleChainTip(headT, i);\n chainTips[i] = vec4<f32>(tip.x, tip.y, 0.0, 0.0);\n }\n}\n", ae = `
|
|
39
39
|
// The instanced-ribbon LAYER selector (a pipeline-overridable constant — 5 pipelines share the
|
|
40
40
|
// ONE module, each specializing this): 0 trail · 1 epicycle · 2 head · 3 cel-rope · 4 cel-arm.
|
|
41
41
|
override LAYER: i32 = 0;
|
|
@@ -74,8 +74,8 @@ struct RenderUniforms {
|
|
|
74
74
|
// chainTips[k] = (x, y, _pad, _pad) in MODEL space.
|
|
75
75
|
@group(0) @binding(2) var<storage, read> chainTips: array<vec4<f32>>;
|
|
76
76
|
|
|
77
|
-
${
|
|
78
|
-
${
|
|
77
|
+
${x}
|
|
78
|
+
${S}
|
|
79
79
|
|
|
80
80
|
fn samplePaletteLin(t: f32) -> vec3<f32> {
|
|
81
81
|
let stopCount = u.ints.z;
|
|
@@ -309,14 +309,14 @@ fn fs_main(in: VSOut) -> @location(0) vec4<f32> {
|
|
|
309
309
|
return vec4<f32>(0.0, 0.0, 0.0, m);
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
-
`,
|
|
312
|
+
`, U = {
|
|
313
313
|
trail: 0,
|
|
314
314
|
epicycle: 1,
|
|
315
315
|
head: 2,
|
|
316
316
|
"cel-rope": 3,
|
|
317
317
|
"cel-arm": 4
|
|
318
318
|
};
|
|
319
|
-
function
|
|
319
|
+
function oe(e) {
|
|
320
320
|
let t = Math.max(0, Math.floor(e.sampleCount) - 1), n = e.showEpicycles ? Math.max(0, Math.floor(e.armCount)) : 0, r = e.celGain > .001, i = [];
|
|
321
321
|
return r && t > 0 && i.push({
|
|
322
322
|
kind: "cel-rope",
|
|
@@ -340,7 +340,7 @@ function se(e) {
|
|
|
340
340
|
blend: "over"
|
|
341
341
|
}), i;
|
|
342
342
|
}
|
|
343
|
-
var
|
|
343
|
+
var se = new Float32Array([
|
|
344
344
|
0,
|
|
345
345
|
0,
|
|
346
346
|
1,
|
|
@@ -349,11 +349,11 @@ var ce = new Float32Array([
|
|
|
349
349
|
1,
|
|
350
350
|
1,
|
|
351
351
|
1
|
|
352
|
-
]),
|
|
352
|
+
]), W = {
|
|
353
353
|
c0: 0,
|
|
354
354
|
ints: 4
|
|
355
355
|
};
|
|
356
|
-
function
|
|
356
|
+
function ce() {
|
|
357
357
|
let e = /* @__PURE__ */ new ArrayBuffer(32);
|
|
358
358
|
return {
|
|
359
359
|
buffer: e,
|
|
@@ -361,11 +361,11 @@ function H() {
|
|
|
361
361
|
i32: new Int32Array(e)
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function le(e, t, n, r, i, a, o) {
|
|
365
365
|
let { f32: s, i32: c } = e;
|
|
366
|
-
return s[
|
|
366
|
+
return s[W.c0 + 0] = t, s[W.c0 + 1] = n, s[W.c0 + 2] = 0, s[W.c0 + 3] = 0, c[W.ints + 0] = r, c[W.ints + 1] = i, c[W.ints + 2] = a, c[W.ints + 3] = o, e;
|
|
367
367
|
}
|
|
368
|
-
var
|
|
368
|
+
var G = 144, K = {
|
|
369
369
|
r0: 0,
|
|
370
370
|
r1: 4,
|
|
371
371
|
r2: 8,
|
|
@@ -373,18 +373,18 @@ var le = 144, W = {
|
|
|
373
373
|
ints: 16,
|
|
374
374
|
palette: 20
|
|
375
375
|
};
|
|
376
|
-
function
|
|
377
|
-
let e = new ArrayBuffer(
|
|
376
|
+
function q() {
|
|
377
|
+
let e = new ArrayBuffer(G);
|
|
378
378
|
return {
|
|
379
379
|
buffer: e,
|
|
380
380
|
f32: new Float32Array(e),
|
|
381
381
|
i32: new Int32Array(e)
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function J(e) {
|
|
385
385
|
let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity, a = e;
|
|
386
386
|
for (let e = 0; e < 720; e++) {
|
|
387
|
-
let o =
|
|
387
|
+
let o = g(a, e / 720), [s, c] = o[o.length - 1];
|
|
388
388
|
s < t && (t = s), c < n && (n = c), s > r && (r = s), c > i && (i = c);
|
|
389
389
|
}
|
|
390
390
|
if (!isFinite(t)) return {
|
|
@@ -400,21 +400,21 @@ function K(e) {
|
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
402
|
function ue(e, t, n) {
|
|
403
|
-
let r = Math.max(e,
|
|
403
|
+
let r = Math.max(e, H), i = Math.max(n, 1) / 2;
|
|
404
404
|
return r / Math.max(t, 1e-6) / i;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Y(e, t, n, r, i, a, o, s, l, u, d, f, p, m, h, g, _) {
|
|
407
407
|
let { f32: v, i32: y } = e;
|
|
408
|
-
v[
|
|
408
|
+
v[K.r0 + 0] = t.centerX, v[K.r0 + 1] = t.centerY, v[K.r0 + 2] = t.scale, v[K.r0 + 3] = n, v[K.r1 + 0] = r, v[K.r1 + 1] = i, v[K.r1 + 2] = a, v[K.r1 + 3] = o, v[K.r2 + 0] = s, v[K.r2 + 1] = l, v[K.r2 + 2] = +!!u, v[K.r2 + 3] = +!!d, v[K.r3 + 0] = f, v[K.r3 + 1] = p, v[K.r3 + 2] = m, v[K.r3 + 3] = 0;
|
|
409
409
|
let b = Math.min(_.length, 4);
|
|
410
|
-
y[
|
|
410
|
+
y[K.ints + 0] = h, y[K.ints + 1] = g, y[K.ints + 2] = b, y[K.ints + 3] = 0;
|
|
411
411
|
for (let e = 0; e < 4; e++) {
|
|
412
|
-
let t =
|
|
412
|
+
let t = K.palette + e * 4, n = c(_[Math.min(e, b - 1)] ?? _[0]);
|
|
413
413
|
v[t + 0] = n[0], v[t + 1] = n[1], v[t + 2] = n[2], v[t + 3] = 0;
|
|
414
414
|
}
|
|
415
415
|
return e;
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function X(e) {
|
|
418
418
|
let t = Math.min(e.length, 64), n = new Float32Array(256);
|
|
419
419
|
for (let r = 0; r < t; r++) {
|
|
420
420
|
let t = e[r], i = r * 4;
|
|
@@ -424,86 +424,86 @@ function fe(e) {
|
|
|
424
424
|
}
|
|
425
425
|
//#endregion
|
|
426
426
|
//#region src/components/fourier-field/composables/fourierFieldWGPUSetup.ts
|
|
427
|
-
var
|
|
428
|
-
function
|
|
427
|
+
var de = 64, Z = 128, Q = 8, $ = 1, fe = 2, pe = 4, me = 64, he = .92, ge = .95, _e = 1.35, ve = .34;
|
|
428
|
+
function ye(e) {
|
|
429
429
|
let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: s } = e, c = e.getPointerLean;
|
|
430
430
|
return function(e, l, u) {
|
|
431
|
-
let
|
|
431
|
+
let d = e.createShaderModule({
|
|
432
432
|
label: "[FourierField] fourier-field.compute.wgsl",
|
|
433
|
-
code:
|
|
434
|
-
}),
|
|
433
|
+
code: ie
|
|
434
|
+
}), f = e.createShaderModule({
|
|
435
435
|
label: "[FourierField] fourier-field.render.wgsl",
|
|
436
|
-
code:
|
|
437
|
-
}),
|
|
436
|
+
code: ae
|
|
437
|
+
}), p = e.createBuffer({
|
|
438
438
|
label: "[FourierField] phasors",
|
|
439
439
|
size: 1024,
|
|
440
|
-
usage:
|
|
441
|
-
}),
|
|
440
|
+
usage: Z | Q
|
|
441
|
+
}), m = e.createBuffer({
|
|
442
442
|
label: "[FourierField] curve-samples",
|
|
443
443
|
size: 384 * 16,
|
|
444
|
-
usage:
|
|
445
|
-
}),
|
|
444
|
+
usage: Z
|
|
445
|
+
}), h = e.createBuffer({
|
|
446
446
|
label: "[FourierField] chain-tips",
|
|
447
447
|
size: 1040,
|
|
448
|
-
usage:
|
|
449
|
-
}),
|
|
448
|
+
usage: Z
|
|
449
|
+
}), g = e.createBuffer({
|
|
450
450
|
label: "[FourierField] compute-uniforms",
|
|
451
|
-
size:
|
|
452
|
-
usage:
|
|
453
|
-
}),
|
|
451
|
+
size: ce().buffer.byteLength,
|
|
452
|
+
usage: de | Q
|
|
453
|
+
}), _ = e.createBuffer({
|
|
454
454
|
label: "[FourierField] render-uniforms",
|
|
455
|
-
size:
|
|
456
|
-
usage:
|
|
457
|
-
}),
|
|
455
|
+
size: q().buffer.byteLength,
|
|
456
|
+
usage: de | Q
|
|
457
|
+
}), v = e.createBindGroupLayout({
|
|
458
458
|
label: "[FourierField] compute-bgl",
|
|
459
459
|
entries: [
|
|
460
460
|
{
|
|
461
461
|
binding: 0,
|
|
462
|
-
visibility:
|
|
462
|
+
visibility: pe,
|
|
463
463
|
buffer: { type: "uniform" }
|
|
464
464
|
},
|
|
465
465
|
{
|
|
466
466
|
binding: 1,
|
|
467
|
-
visibility:
|
|
467
|
+
visibility: pe,
|
|
468
468
|
buffer: { type: "read-only-storage" }
|
|
469
469
|
},
|
|
470
470
|
{
|
|
471
471
|
binding: 2,
|
|
472
|
-
visibility:
|
|
472
|
+
visibility: pe,
|
|
473
473
|
buffer: { type: "storage" }
|
|
474
474
|
},
|
|
475
475
|
{
|
|
476
476
|
binding: 3,
|
|
477
|
-
visibility:
|
|
477
|
+
visibility: pe,
|
|
478
478
|
buffer: { type: "storage" }
|
|
479
479
|
}
|
|
480
480
|
]
|
|
481
|
-
}),
|
|
481
|
+
}), y = e.createComputePipeline({
|
|
482
482
|
label: "[FourierField] compute-pipeline",
|
|
483
|
-
layout: e.createPipelineLayout({ bindGroupLayouts: [
|
|
483
|
+
layout: e.createPipelineLayout({ bindGroupLayouts: [v] }),
|
|
484
484
|
compute: {
|
|
485
|
-
module:
|
|
485
|
+
module: d,
|
|
486
486
|
entryPoint: "cs_main"
|
|
487
487
|
}
|
|
488
488
|
}), x = e.createBindGroup({
|
|
489
489
|
label: "[FourierField] compute-bg",
|
|
490
|
-
layout:
|
|
490
|
+
layout: v,
|
|
491
491
|
entries: [
|
|
492
492
|
{
|
|
493
493
|
binding: 0,
|
|
494
|
-
resource: { buffer:
|
|
494
|
+
resource: { buffer: g }
|
|
495
495
|
},
|
|
496
496
|
{
|
|
497
497
|
binding: 1,
|
|
498
|
-
resource: { buffer:
|
|
498
|
+
resource: { buffer: p }
|
|
499
499
|
},
|
|
500
500
|
{
|
|
501
501
|
binding: 2,
|
|
502
|
-
resource: { buffer:
|
|
502
|
+
resource: { buffer: m }
|
|
503
503
|
},
|
|
504
504
|
{
|
|
505
505
|
binding: 3,
|
|
506
|
-
resource: { buffer:
|
|
506
|
+
resource: { buffer: h }
|
|
507
507
|
}
|
|
508
508
|
]
|
|
509
509
|
}), S = e.createBindGroupLayout({
|
|
@@ -511,17 +511,17 @@ function ve(e) {
|
|
|
511
511
|
entries: [
|
|
512
512
|
{
|
|
513
513
|
binding: 0,
|
|
514
|
-
visibility:
|
|
514
|
+
visibility: $ | fe,
|
|
515
515
|
buffer: { type: "uniform" }
|
|
516
516
|
},
|
|
517
517
|
{
|
|
518
518
|
binding: 1,
|
|
519
|
-
visibility:
|
|
519
|
+
visibility: $ | fe,
|
|
520
520
|
buffer: { type: "read-only-storage" }
|
|
521
521
|
},
|
|
522
522
|
{
|
|
523
523
|
binding: 2,
|
|
524
|
-
visibility:
|
|
524
|
+
visibility: $ | fe,
|
|
525
525
|
buffer: { type: "read-only-storage" }
|
|
526
526
|
}
|
|
527
527
|
]
|
|
@@ -551,12 +551,12 @@ function ve(e) {
|
|
|
551
551
|
label: `[FourierField] ribbon-pipeline-L${t}`,
|
|
552
552
|
layout: C,
|
|
553
553
|
vertex: {
|
|
554
|
-
module:
|
|
554
|
+
module: f,
|
|
555
555
|
entryPoint: "vs_main",
|
|
556
556
|
constants: { LAYER: t }
|
|
557
557
|
},
|
|
558
558
|
fragment: {
|
|
559
|
-
module:
|
|
559
|
+
module: f,
|
|
560
560
|
entryPoint: "fs_main",
|
|
561
561
|
constants: { LAYER: t },
|
|
562
562
|
targets: [{
|
|
@@ -566,53 +566,53 @@ function ve(e) {
|
|
|
566
566
|
},
|
|
567
567
|
primitive: { topology: "triangle-list" }
|
|
568
568
|
}), D = {
|
|
569
|
-
trail: E(
|
|
570
|
-
epicycle: E(
|
|
571
|
-
head: E(
|
|
572
|
-
"cel-rope": E(
|
|
573
|
-
"cel-arm": E(
|
|
569
|
+
trail: E(U.trail, w),
|
|
570
|
+
epicycle: E(U.epicycle, T),
|
|
571
|
+
head: E(U.head, w),
|
|
572
|
+
"cel-rope": E(U["cel-rope"], w),
|
|
573
|
+
"cel-arm": E(U["cel-arm"], w)
|
|
574
574
|
}, O = e.createBindGroup({
|
|
575
575
|
label: "[FourierField] render-bg",
|
|
576
576
|
layout: S,
|
|
577
577
|
entries: [
|
|
578
578
|
{
|
|
579
579
|
binding: 0,
|
|
580
|
-
resource: { buffer:
|
|
580
|
+
resource: { buffer: _ }
|
|
581
581
|
},
|
|
582
582
|
{
|
|
583
583
|
binding: 1,
|
|
584
|
-
resource: { buffer:
|
|
584
|
+
resource: { buffer: m }
|
|
585
585
|
},
|
|
586
586
|
{
|
|
587
587
|
binding: 2,
|
|
588
|
-
resource: { buffer:
|
|
588
|
+
resource: { buffer: h }
|
|
589
589
|
}
|
|
590
590
|
]
|
|
591
|
-
}), k =
|
|
591
|
+
}), k = ce(), A = q(), j = null, M = {
|
|
592
592
|
centerX: 0,
|
|
593
593
|
centerY: 0,
|
|
594
594
|
scale: 1
|
|
595
595
|
}, N = 0;
|
|
596
596
|
function P() {
|
|
597
597
|
let t = r();
|
|
598
|
-
t !== j && (j = t, N = Math.min(t.length, 64), M =
|
|
598
|
+
t !== j && (j = t, N = Math.min(t.length, 64), M = J(t), e.queue.writeBuffer(p, 0, X(t)));
|
|
599
599
|
}
|
|
600
600
|
function F(e) {}
|
|
601
601
|
function I(r) {
|
|
602
602
|
s?.(r), P();
|
|
603
|
-
let o = a(), u = Math.max(1, Math.min(Math.round(n.harmonics), N)),
|
|
604
|
-
|
|
605
|
-
let
|
|
603
|
+
let o = a(), u = Math.max(1, Math.min(Math.round(n.harmonics), N)), d = n.showEpicycles ? Math.max(1, Math.min(Math.round(n.epicycleArms), u)) : 0;
|
|
604
|
+
le(k, o, n.trailArc, u, d, 384, N), e.queue.writeBuffer(g, 0, k.buffer);
|
|
605
|
+
let f = Math.min(t.width, t.height) / Math.max(b(), 1), p = t.width / Math.max(t.height, 1), m = ue(n.trailWidth, M.scale, f), h = 12 / (Math.max(M.scale, 1e-6) * Math.max(f, 1)), v = c?.() ?? {
|
|
606
606
|
x: 0,
|
|
607
607
|
y: 0
|
|
608
608
|
};
|
|
609
|
-
|
|
609
|
+
Y(A, v.x !== 0 || v.y !== 0 ? {
|
|
610
610
|
...M,
|
|
611
|
-
centerX: M.centerX -
|
|
612
|
-
centerY: M.centerY -
|
|
613
|
-
} : M,
|
|
611
|
+
centerX: M.centerX - v.x,
|
|
612
|
+
centerY: M.centerY - v.y
|
|
613
|
+
} : M, p, m, he, ge, _e, ve, n.intensity, n.showEpicycles, n.rainbowChain, n.squashGain, n.celGain, h, 384, d, i()), e.queue.writeBuffer(_, 0, A.buffer);
|
|
614
614
|
let S = e.createCommandEncoder({ label: "[FourierField] frame" }), C = S.beginComputePass();
|
|
615
|
-
C.setPipeline(
|
|
615
|
+
C.setPipeline(y), C.setBindGroup(0, x), C.dispatchWorkgroups(Math.ceil(384 / me)), C.end();
|
|
616
616
|
let w = l.getCurrentTexture().createView(), T = S.beginRenderPass({ colorAttachments: [{
|
|
617
617
|
view: w,
|
|
618
618
|
clearValue: {
|
|
@@ -625,9 +625,9 @@ function ve(e) {
|
|
|
625
625
|
storeOp: "store"
|
|
626
626
|
}] });
|
|
627
627
|
T.setBindGroup(0, O);
|
|
628
|
-
let E =
|
|
628
|
+
let E = oe({
|
|
629
629
|
sampleCount: 384,
|
|
630
|
-
armCount:
|
|
630
|
+
armCount: d,
|
|
631
631
|
showEpicycles: n.showEpicycles,
|
|
632
632
|
celGain: n.celGain
|
|
633
633
|
});
|
|
@@ -639,14 +639,14 @@ function ve(e) {
|
|
|
639
639
|
shouldContinue: o,
|
|
640
640
|
resize: F,
|
|
641
641
|
teardown: () => {
|
|
642
|
-
|
|
642
|
+
p.destroy(), m.destroy(), h.destroy(), g.destroy(), _.destroy();
|
|
643
643
|
}
|
|
644
644
|
};
|
|
645
645
|
};
|
|
646
646
|
}
|
|
647
647
|
//#endregion
|
|
648
648
|
//#region src/components/fourier-field/shaders/fourier-field.glsl.ts
|
|
649
|
-
var
|
|
649
|
+
var be = "#version 300 es\n// BI.W-FOURIER-RIBBON §2b — MUST equal the WGSL twin + FOURIER_TANGENT_EPS (constants.ts).\n#define RIBBON_UNDERGLOW_SCALE 2.2\n\nin vec2 aCorner; // the unit quad corner ∈ [0,1]²\nin vec4 aSeg; // (ax, ay, bx, by) — segment endpoints in MODEL space\nin vec4 aData; // (age, strokeHalf, arg2, _pad) — strokeHalf/age/arg2 per layer\n\nuniform vec4 uFit; // (centerX, centerY, scale, aspect) — model→clip fit\nuniform int uLayer; // 0 trail · 1 epicycle · 2 head · 3 cel-rope · 4 cel-arm\nuniform float uEdgeMargin; // AA-feather slop in MODEL units (a few CSS px), padding the bbox\n\nout vec2 vP; // the MODEL-space fragment coordinate (the fs runs the SDF on it)\nout vec2 vA;\nout vec2 vB;\nout float vAge;\nout float vHalf;\nout float vArg2;\n\nvoid main() {\n vec2 a = aSeg.xy;\n vec2 b = aSeg.zw;\n float strokeHalf = aData.y;\n vA = a; vB = b; vAge = aData.x; vHalf = strokeHalf; vArg2 = aData.z;\n\n vec2 pos;\n if (uLayer == 1 || uLayer == 2) {\n // AABB around a — the epicycle orbit RING (radius = |b-a|) or the head HALO.\n float ext = (uLayer == 1) ? (length(b - a) + strokeHalf * 0.7) : (strokeHalf * 4.5);\n ext += uEdgeMargin;\n pos = a + (aCorner * 2.0 - 1.0) * ext;\n } else {\n // Capsule along a→b padded by the covered extent (trail under-glow / cel stroke).\n float ext = (uLayer == 0) ? (strokeHalf * RIBBON_UNDERGLOW_SCALE) : strokeHalf;\n ext += uEdgeMargin;\n vec2 d = b - a;\n float len = length(d);\n vec2 dir = len > 1e-6 ? d / len : vec2(1.0, 0.0);\n vec2 perp = vec2(-dir.y, dir.x);\n vec2 along = mix(a - dir * ext, b + dir * ext, aCorner.x);\n pos = along + perp * (aCorner.y * 2.0 - 1.0) * ext;\n }\n\n vP = pos;\n vec2 center = uFit.xy;\n float scale = max(uFit.z, 1e-6);\n float aspect = max(uFit.w, 1e-4);\n // model → clip (the inverse of the fs's p = center + vClip·aspect / scale).\n float clipX = (pos.x - center.x) * scale / aspect;\n float clipY = (pos.y - center.y) * scale;\n gl_Position = vec4(clipX, clipY, 0.0, 1.0);\n}\n", xe = `#version 300 es
|
|
650
650
|
precision highp float;
|
|
651
651
|
|
|
652
652
|
#define MAX_FOURIER_STOPS 4
|
|
@@ -677,8 +677,8 @@ uniform vec3 uPalette[MAX_FOURIER_STOPS]; // linear-sRGB stops
|
|
|
677
677
|
|
|
678
678
|
const float PI = 3.141592653589793;
|
|
679
679
|
|
|
680
|
-
${
|
|
681
|
-
${
|
|
680
|
+
${v}
|
|
681
|
+
${y}
|
|
682
682
|
|
|
683
683
|
// Negative-safe cube root (the WGSL chunk's cbrt3 twin; the GLSL chunk inlines it).
|
|
684
684
|
vec3 cbrt3(vec3 v) { return sign(v) * pow(abs(v), vec3(1.0 / 3.0)); }
|
|
@@ -806,8 +806,8 @@ void main() {
|
|
|
806
806
|
fragColor = vec4(0.0, 0.0, 0.0, m);
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
|
-
`,
|
|
810
|
-
function
|
|
809
|
+
`, Se = 256, Ce = 64, we = .92, Te = .95, Ee = 1.35, De = .34;
|
|
810
|
+
function Oe(e, t, n) {
|
|
811
811
|
let r = e.createShader(t);
|
|
812
812
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
813
813
|
let t = e.getShaderInfoLog(r);
|
|
@@ -815,147 +815,147 @@ function Ee(e, t, n) {
|
|
|
815
815
|
}
|
|
816
816
|
return r;
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: s } = e,
|
|
818
|
+
function ke(e) {
|
|
819
|
+
let { canvas: t, config: n, getSpectrum: r, getPalette: i, getHeadT: a, shouldContinue: o, onFrame: s } = e, l = e.getPointerLean;
|
|
820
820
|
return function(e) {
|
|
821
|
-
let
|
|
822
|
-
if (e.attachShader(f,
|
|
823
|
-
e.deleteShader(
|
|
824
|
-
let
|
|
825
|
-
e.bindVertexArray(
|
|
826
|
-
let
|
|
827
|
-
e.bindBuffer(e.ARRAY_BUFFER,
|
|
821
|
+
let u = Oe(e, e.VERTEX_SHADER, be), d = Oe(e, e.FRAGMENT_SHADER, xe), f = e.createProgram();
|
|
822
|
+
if (e.attachShader(f, u), e.attachShader(f, d), e.linkProgram(f), !e.getProgramParameter(f, e.LINK_STATUS)) throw Error(`[FourierField] link failed: ${e.getProgramInfoLog(f)}`);
|
|
823
|
+
e.deleteShader(u), e.deleteShader(d);
|
|
824
|
+
let p = e.createVertexArray();
|
|
825
|
+
e.bindVertexArray(p);
|
|
826
|
+
let m = e.createBuffer();
|
|
827
|
+
e.bindBuffer(e.ARRAY_BUFFER, m), e.bufferData(e.ARRAY_BUFFER, se, e.STATIC_DRAW);
|
|
828
828
|
let g = e.getAttribLocation(f, "aCorner");
|
|
829
829
|
e.enableVertexAttribArray(g), e.vertexAttribPointer(g, 2, e.FLOAT, !1, 0, 0), e.vertexAttribDivisor(g, 0);
|
|
830
|
-
let _ = (
|
|
830
|
+
let _ = (Se - 1) * 2 + Ce * 2 + 1, v = new Float32Array(_ * 8), y = e.createBuffer();
|
|
831
831
|
e.bindBuffer(e.ARRAY_BUFFER, y), e.bufferData(e.ARRAY_BUFFER, v.byteLength, e.DYNAMIC_DRAW);
|
|
832
|
-
let
|
|
833
|
-
e.enableVertexAttribArray(
|
|
834
|
-
let
|
|
832
|
+
let x = e.getAttribLocation(f, "aSeg"), S = e.getAttribLocation(f, "aData");
|
|
833
|
+
e.enableVertexAttribArray(x), e.enableVertexAttribArray(S), e.vertexAttribPointer(x, 4, e.FLOAT, !1, 32, 0), e.vertexAttribPointer(S, 4, e.FLOAT, !1, 32, 16), e.vertexAttribDivisor(x, 1), e.vertexAttribDivisor(S, 1), e.bindVertexArray(null);
|
|
834
|
+
let C = (t) => e.getUniformLocation(f, t), w = C("uFit"), T = C("uTrail"), E = C("uEnv"), D = C("uLoom"), O = C("uLayer"), k = C("uEdgeMargin"), A = C("uStopCount"), j = C("uPalette[0]"), M = new Float32Array(Se * 3), N = new Float32Array((Ce + 1) * 2), P = new Float32Array(12), F = null, I = {
|
|
835
835
|
centerX: 0,
|
|
836
836
|
centerY: 0,
|
|
837
837
|
scale: 1
|
|
838
|
-
},
|
|
839
|
-
function
|
|
838
|
+
}, L = 0;
|
|
839
|
+
function R() {
|
|
840
840
|
let e = r();
|
|
841
|
-
e !== F && (F = e,
|
|
841
|
+
e !== F && (F = e, L = Math.min(e.length, Ce), I = J(e));
|
|
842
842
|
}
|
|
843
|
-
function
|
|
843
|
+
function z(n) {
|
|
844
844
|
e.viewport(0, 0, n?.w ?? t.width, n?.h ?? t.height);
|
|
845
845
|
}
|
|
846
|
-
function
|
|
847
|
-
s?.(r),
|
|
846
|
+
function B(r) {
|
|
847
|
+
s?.(r), R();
|
|
848
848
|
let o = F;
|
|
849
849
|
if (!o) return;
|
|
850
|
-
let
|
|
850
|
+
let u = a(), d = Math.max(1, Math.min(Math.round(n.harmonics), L)), m = n.showEpicycles ? Math.max(1, Math.min(Math.round(n.epicycleArms), d)) : 0, g = Se, _ = Math.max(g - 1, 1);
|
|
851
851
|
for (let e = 0; e < g; e++) {
|
|
852
|
-
let t = e / _, r = 1 - t, i =
|
|
852
|
+
let t = e / _, r = 1 - t, i = u - n.trailArc * t;
|
|
853
853
|
i -= Math.floor(i);
|
|
854
|
-
let [a, s] =
|
|
854
|
+
let [a, s] = h(o, i, d), c = e * 3;
|
|
855
855
|
M[c + 0] = a, M[c + 1] = s, M[c + 2] = r;
|
|
856
856
|
}
|
|
857
|
-
let
|
|
858
|
-
for (let e = 0; e <=
|
|
857
|
+
let C = Math.min(m, d);
|
|
858
|
+
for (let e = 0; e <= Ce; e++) {
|
|
859
859
|
let t = e * 2;
|
|
860
|
-
if (e <=
|
|
861
|
-
let [n, r] =
|
|
860
|
+
if (e <= C) {
|
|
861
|
+
let [n, r] = h(o, u, e);
|
|
862
862
|
N[t + 0] = n, N[t + 1] = r;
|
|
863
863
|
} else N[t + 0] = 0, N[t + 1] = 0;
|
|
864
864
|
}
|
|
865
|
-
let
|
|
865
|
+
let z = t.width / Math.max(t.height, 1), B = Math.min(t.width, t.height) / Math.max(b(), 1), V = ue(n.trailWidth, I.scale, B), H = V * .5, ee = 12 / (Math.max(I.scale, 1e-6) * Math.max(B, 1)), te = M[0], ne = M[1], re = M[3], ie = M[4], ae = te - re, se = ne - ie, W = Math.hypot(ae, se), ce = W > 1e-4 ? ae / W : 1, le = W > 1e-4 ? se / W : 0, G = -ce * H * 1.4, K = -le * H * 1.4, q = oe({
|
|
866
866
|
sampleCount: g,
|
|
867
|
-
armCount:
|
|
867
|
+
armCount: m,
|
|
868
868
|
showEpicycles: n.showEpicycles,
|
|
869
869
|
celGain: n.celGain
|
|
870
|
-
}),
|
|
871
|
-
v[
|
|
870
|
+
}), J = /* @__PURE__ */ new Map(), Y = 0, X = (e, t, n, r, i, a, o) => {
|
|
871
|
+
v[Y++] = e, v[Y++] = t, v[Y++] = n, v[Y++] = r, v[Y++] = i, v[Y++] = a, v[Y++] = o, v[Y++] = 0;
|
|
872
872
|
};
|
|
873
|
-
for (let e of
|
|
873
|
+
for (let e of q) if (J.set(e.kind, Y), e.kind === "cel-rope") for (let e = 0; e < g - 1; e++) {
|
|
874
874
|
let t = e * 3;
|
|
875
|
-
|
|
875
|
+
X(M[t] + G, M[t + 1] + K, M[t + 3] + G, M[t + 4] + K, 0, H, 1);
|
|
876
876
|
}
|
|
877
|
-
else if (e.kind === "cel-arm") for (let e = 0; e <
|
|
877
|
+
else if (e.kind === "cel-arm") for (let e = 0; e < m; e++) {
|
|
878
878
|
let t = e * 2;
|
|
879
|
-
|
|
879
|
+
X(N[t] + G, N[t + 1] + K, N[t + 2] + G, N[t + 3] + K, 0, H * .55, .7);
|
|
880
880
|
}
|
|
881
881
|
else if (e.kind === "epicycle") {
|
|
882
|
-
let e = Math.max(
|
|
883
|
-
for (let t = 0; t <
|
|
882
|
+
let e = Math.max(m - 1, 1);
|
|
883
|
+
for (let t = 0; t < m; t++) {
|
|
884
884
|
let n = t * 2;
|
|
885
|
-
|
|
885
|
+
X(N[n], N[n + 1], N[n + 2], N[n + 3], 0, H, t / e);
|
|
886
886
|
}
|
|
887
887
|
} else if (e.kind === "trail") for (let e = 0; e < g - 1; e++) {
|
|
888
888
|
let t = e * 3, n = Math.max(M[t + 2], M[t + 5]);
|
|
889
|
-
|
|
889
|
+
X(M[t], M[t + 1], M[t + 3], M[t + 4], n, H, 0);
|
|
890
890
|
}
|
|
891
|
-
else
|
|
892
|
-
let
|
|
891
|
+
else X(M[0], M[1], M[3], M[4], 0, H, 0);
|
|
892
|
+
let de = Y, Z = i(), Q = Math.min(Z.length, 4);
|
|
893
893
|
for (let e = 0; e < 4; e++) {
|
|
894
|
-
let t =
|
|
894
|
+
let t = c(Z[Math.min(e, Q - 1)] ?? Z[0]);
|
|
895
895
|
P[e * 3 + 0] = t[0], P[e * 3 + 1] = t[1], P[e * 3 + 2] = t[2];
|
|
896
896
|
}
|
|
897
|
-
e.useProgram(f), e.bindVertexArray(
|
|
898
|
-
let
|
|
897
|
+
e.useProgram(f), e.bindVertexArray(p), e.enable(e.BLEND), e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), e.bindBuffer(e.ARRAY_BUFFER, y), e.bufferSubData(e.ARRAY_BUFFER, 0, v.subarray(0, de));
|
|
898
|
+
let $ = l?.() ?? {
|
|
899
899
|
x: 0,
|
|
900
900
|
y: 0
|
|
901
901
|
};
|
|
902
|
-
e.uniform4f(w, I.centerX -
|
|
903
|
-
for (let t of
|
|
904
|
-
let n = (
|
|
905
|
-
e.vertexAttribPointer(
|
|
902
|
+
e.uniform4f(w, I.centerX - $.x, I.centerY - $.y, I.scale, z), e.uniform4f(T, V, we, Te, Ee), e.uniform4f(E, De, n.intensity, +!!n.showEpicycles, +!!n.rainbowChain), e.uniform4f(D, n.squashGain, n.celGain, 0, 0), e.uniform1f(k, ee), e.uniform1i(A, Q), e.uniform3fv(j, P);
|
|
903
|
+
for (let t of q) {
|
|
904
|
+
let n = (J.get(t.kind) ?? 0) * 4;
|
|
905
|
+
e.vertexAttribPointer(x, 4, e.FLOAT, !1, 32, n), e.vertexAttribPointer(S, 4, e.FLOAT, !1, 32, n + 16), e.uniform1i(O, U[t.kind]), t.blend === "max" ? (e.blendEquation(e.MAX), e.blendFunc(e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA)), e.drawArraysInstanced(e.TRIANGLE_STRIP, 0, 4, t.instanceCount);
|
|
906
906
|
}
|
|
907
907
|
e.blendEquation(e.FUNC_ADD);
|
|
908
908
|
}
|
|
909
909
|
return {
|
|
910
|
-
frame:
|
|
910
|
+
frame: B,
|
|
911
911
|
shouldContinue: o,
|
|
912
|
-
resize:
|
|
912
|
+
resize: z,
|
|
913
913
|
teardown: () => {
|
|
914
|
-
e.deleteProgram(f), e.deleteBuffer(
|
|
914
|
+
e.deleteProgram(f), e.deleteBuffer(m), e.deleteBuffer(y), e.deleteVertexArray(p);
|
|
915
915
|
}
|
|
916
916
|
};
|
|
917
917
|
};
|
|
918
918
|
}
|
|
919
919
|
//#endregion
|
|
920
920
|
//#region src/components/fourier-field/composables/useFourierField.ts
|
|
921
|
-
function
|
|
922
|
-
let { config: r, getSpectrum: o, getPalette: s } = t, c = t.mode ?? "live", l = t.frozenT ?? .34, u = t.periodS ?? 16,
|
|
923
|
-
function
|
|
924
|
-
if (
|
|
925
|
-
let t = -64 *
|
|
926
|
-
|
|
921
|
+
function Ae(e, t) {
|
|
922
|
+
let { config: r, getSpectrum: o, getPalette: s } = t, c = t.mode ?? "live", l = t.frozenT ?? .34, u = t.periodS ?? 16, d = 0, f = -1, p = 0, m = 0;
|
|
923
|
+
function h(e) {
|
|
924
|
+
if (p === 0 && m === 0) return;
|
|
925
|
+
let t = -64 * p - 2 * .62 * 8 * m;
|
|
926
|
+
m += t * e, p += m * e, Math.abs(p) < 1e-4 && Math.abs(m) < 1e-4 && (p = 0, m = 0);
|
|
927
927
|
}
|
|
928
|
-
let
|
|
929
|
-
function
|
|
928
|
+
let g = n({ respectReducedMotion: r.respectReducedMotion }), v = () => (t.freeze?.() ?? !1) || (I?.reducedMotion ?? !1);
|
|
929
|
+
function y(e) {
|
|
930
930
|
x(e);
|
|
931
931
|
}
|
|
932
932
|
function x(e) {
|
|
933
|
-
let n =
|
|
934
|
-
|
|
933
|
+
let n = f >= 0 ? (e - f) * 1e3 : 16.7;
|
|
934
|
+
f = e;
|
|
935
935
|
let i = t.routePointer?.();
|
|
936
|
-
if (
|
|
937
|
-
|
|
936
|
+
if (t.routePointer && (g.setActive(i?.active ?? !1), i?.active && g.setPointer(i.x, i.y)), g.tick(n), v()) {
|
|
937
|
+
d = l, p = 0, m = 0;
|
|
938
938
|
return;
|
|
939
939
|
}
|
|
940
940
|
let a = Math.min(Math.max(n / 1e3, 0), .05);
|
|
941
|
-
if (r.interactive &&
|
|
942
|
-
let e = r.speed / u +
|
|
943
|
-
|
|
944
|
-
let t =
|
|
945
|
-
t !== 0 && (
|
|
941
|
+
if (r.interactive && g.active.value) {
|
|
942
|
+
let e = r.speed / u + g.velocity.value.x * B + p;
|
|
943
|
+
d = (d + e * a) % 1, d < 0 && (d += 1);
|
|
944
|
+
let t = g.burst.value * 4;
|
|
945
|
+
t !== 0 && (p = t, m = 0), h(a);
|
|
946
946
|
return;
|
|
947
947
|
}
|
|
948
|
-
let o = r.speed / u +
|
|
949
|
-
|
|
948
|
+
let o = r.speed / u + p;
|
|
949
|
+
d = (d + o * a) % 1, d < 0 && (d += 1), h(a);
|
|
950
950
|
}
|
|
951
|
-
let S = () =>
|
|
951
|
+
let S = () => d, w = null, T = {
|
|
952
952
|
centerX: 0,
|
|
953
953
|
centerY: 0,
|
|
954
954
|
scale: 1
|
|
955
|
-
}, T = () => {
|
|
956
|
-
let e = o();
|
|
957
|
-
return e !== C && (C = e, w = K(e)), w;
|
|
958
955
|
}, E = () => {
|
|
956
|
+
let e = o();
|
|
957
|
+
return e !== w && (w = e, T = J(e)), T;
|
|
958
|
+
}, D = () => {
|
|
959
959
|
if (!r.interactive) return {
|
|
960
960
|
x: 0,
|
|
961
961
|
y: 0
|
|
@@ -965,84 +965,89 @@ function Oe(e, t) {
|
|
|
965
965
|
x: 0,
|
|
966
966
|
y: 0
|
|
967
967
|
};
|
|
968
|
-
let { leanX: n, leanY: o } = a(i(
|
|
968
|
+
let { leanX: n, leanY: o } = a(i(g), {
|
|
969
969
|
aspect: t.width / t.height,
|
|
970
|
-
scale: Math.max(
|
|
970
|
+
scale: Math.max(E().scale, 1e-6)
|
|
971
971
|
});
|
|
972
972
|
return {
|
|
973
973
|
x: n,
|
|
974
974
|
y: o
|
|
975
975
|
};
|
|
976
|
-
},
|
|
977
|
-
|
|
978
|
-
},
|
|
979
|
-
|
|
980
|
-
},
|
|
981
|
-
function
|
|
982
|
-
let t =
|
|
983
|
-
t.addEventListener("pointermove",
|
|
976
|
+
}, O = (e) => {
|
|
977
|
+
g.onPointerMove(e), r.interactive && I?.wake();
|
|
978
|
+
}, k = () => {
|
|
979
|
+
g.onPointerEnter(), r.interactive && I?.wake();
|
|
980
|
+
}, A = (e) => e.parentElement ?? e;
|
|
981
|
+
function j(e) {
|
|
982
|
+
let t = A(e);
|
|
983
|
+
t.addEventListener("pointermove", O), t.addEventListener("pointerenter", k), t.addEventListener("pointerleave", g.onPointerLeave);
|
|
984
984
|
}
|
|
985
|
-
function
|
|
986
|
-
let t =
|
|
987
|
-
t.removeEventListener("pointermove",
|
|
985
|
+
function N(e) {
|
|
986
|
+
let t = A(e);
|
|
987
|
+
t.removeEventListener("pointermove", O), t.removeEventListener("pointerenter", k), t.removeEventListener("pointerleave", g.onPointerLeave);
|
|
988
988
|
}
|
|
989
|
-
let
|
|
989
|
+
let I = null, L = F(C("webgpu")), R = !1, z = () => {
|
|
990
|
+
if (R) return null;
|
|
990
991
|
let t = e.value;
|
|
991
|
-
return t ? (
|
|
992
|
+
return t ? (I || (j(t), I = _(t, {
|
|
992
993
|
mode: c,
|
|
993
994
|
respectReducedMotion: r.respectReducedMotion,
|
|
994
|
-
dprPolicy:
|
|
995
|
+
dprPolicy: b,
|
|
995
996
|
revealBloom: !0,
|
|
996
|
-
setupWGPU:
|
|
997
|
+
setupWGPU: ye({
|
|
997
998
|
canvas: t,
|
|
998
999
|
config: r,
|
|
999
1000
|
getSpectrum: o,
|
|
1000
1001
|
getPalette: s,
|
|
1001
1002
|
getHeadT: S,
|
|
1002
1003
|
shouldContinue: () => !0,
|
|
1003
|
-
onFrame:
|
|
1004
|
-
getPointerLean:
|
|
1004
|
+
onFrame: y,
|
|
1005
|
+
getPointerLean: D
|
|
1005
1006
|
}),
|
|
1006
|
-
setupGL:
|
|
1007
|
+
setupGL: ke({
|
|
1007
1008
|
canvas: t,
|
|
1008
1009
|
config: r,
|
|
1009
1010
|
getSpectrum: o,
|
|
1010
1011
|
getPalette: s,
|
|
1011
1012
|
getHeadT: S,
|
|
1012
1013
|
shouldContinue: () => !0,
|
|
1013
|
-
onFrame:
|
|
1014
|
-
getPointerLean:
|
|
1015
|
-
})
|
|
1016
|
-
|
|
1014
|
+
onFrame: y,
|
|
1015
|
+
getPointerLean: D
|
|
1016
|
+
}),
|
|
1017
|
+
onStatus: (e) => L.value = e
|
|
1018
|
+
}), I.armAsync().catch(() => void 0)), I) : null;
|
|
1017
1019
|
};
|
|
1018
|
-
queueMicrotask(() =>
|
|
1019
|
-
let
|
|
1020
|
+
queueMicrotask(() => z());
|
|
1021
|
+
let V = {
|
|
1020
1022
|
get backend() {
|
|
1021
|
-
return
|
|
1023
|
+
return z()?.backend ?? "webgpu";
|
|
1022
1024
|
},
|
|
1023
|
-
pause: () =>
|
|
1024
|
-
resume: () =>
|
|
1025
|
-
wake: () =>
|
|
1026
|
-
renderAt: (e) =>
|
|
1025
|
+
pause: () => z()?.suspend("manual"),
|
|
1026
|
+
resume: () => z()?.resume("manual"),
|
|
1027
|
+
wake: () => z()?.wake(),
|
|
1028
|
+
renderAt: (e) => z()?.renderAt(e),
|
|
1027
1029
|
get reducedMotion() {
|
|
1028
|
-
return
|
|
1030
|
+
return I?.reducedMotion ?? !1;
|
|
1029
1031
|
},
|
|
1030
1032
|
get headT() {
|
|
1031
|
-
return
|
|
1033
|
+
return d;
|
|
1032
1034
|
},
|
|
1035
|
+
rendererStatus: P(L),
|
|
1033
1036
|
setHeadT: (e) => {
|
|
1034
|
-
|
|
1037
|
+
d = (e % 1 + 1) % 1, z()?.wake();
|
|
1035
1038
|
},
|
|
1036
1039
|
dispose: () => {
|
|
1040
|
+
if (R) return;
|
|
1041
|
+
R = !0;
|
|
1037
1042
|
let t = e.value;
|
|
1038
|
-
t &&
|
|
1043
|
+
t && N(t), g.dispose(), I?.dispose();
|
|
1039
1044
|
}
|
|
1040
1045
|
};
|
|
1041
|
-
return
|
|
1046
|
+
return M(() => V.dispose()), V;
|
|
1042
1047
|
}
|
|
1043
1048
|
//#endregion
|
|
1044
1049
|
//#region src/components/fourier-field/FourierField.vue
|
|
1045
|
-
var
|
|
1050
|
+
var je = /* @__PURE__ */ e(/* @__PURE__ */ k({
|
|
1046
1051
|
__name: "FourierField",
|
|
1047
1052
|
props: {
|
|
1048
1053
|
config: {},
|
|
@@ -1057,29 +1062,30 @@ var ke = /* @__PURE__ */ e(/* @__PURE__ */ O({
|
|
|
1057
1062
|
},
|
|
1058
1063
|
intensity: {}
|
|
1059
1064
|
},
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1065
|
+
emits: ["rendererStatus"],
|
|
1066
|
+
setup(e, { expose: n, emit: i }) {
|
|
1067
|
+
let a = i, c = e, u = I("hostRef"), d = I("canvasRef"), { isDark: f } = o(), h = r(), g = E(() => {
|
|
1068
|
+
let e = c.config ?? re, t = c.intensity == null ? e.intensity : Math.max(0, Math.min(2, c.intensity)), n = c.config ? e.interactive : !0;
|
|
1063
1069
|
return {
|
|
1064
1070
|
...e,
|
|
1065
1071
|
intensity: t,
|
|
1066
1072
|
interactive: n
|
|
1067
1073
|
};
|
|
1068
|
-
}),
|
|
1069
|
-
x:
|
|
1070
|
-
y:
|
|
1071
|
-
active:
|
|
1072
|
-
}),
|
|
1073
|
-
if (
|
|
1074
|
-
let e =
|
|
1075
|
-
return e ?
|
|
1076
|
-
harmonics: Math.min(
|
|
1077
|
-
harmonicScale:
|
|
1074
|
+
}), _ = E(() => !!c.config && g.value.interactive), v = c.config ? void 0 : () => ({
|
|
1075
|
+
x: h.pointer.value.x,
|
|
1076
|
+
y: h.pointer.value.y,
|
|
1077
|
+
active: h.active.value
|
|
1078
|
+
}), y = E(() => {
|
|
1079
|
+
if (c.spectrum && c.spectrum.length > 0) return c.spectrum;
|
|
1080
|
+
let e = l[g.value.source];
|
|
1081
|
+
return e ? m(e) : p(w(T((c.freeze ? "fourier-field/frozen" : c.seed || "fourier-field") + c.seed)), {
|
|
1082
|
+
harmonics: Math.min(g.value.harmonics + 4, 62),
|
|
1083
|
+
harmonicScale: g.value.harmonicScale
|
|
1078
1084
|
});
|
|
1079
|
-
}),
|
|
1080
|
-
function
|
|
1085
|
+
}), b = () => y.value;
|
|
1086
|
+
function x(e) {
|
|
1081
1087
|
if (!e.includes("var(") && !e.includes("light-dark(")) return e;
|
|
1082
|
-
let n =
|
|
1088
|
+
let n = u.value;
|
|
1083
1089
|
if (typeof window > "u" || !n) return e;
|
|
1084
1090
|
if (e.includes("var(")) return t(e, n);
|
|
1085
1091
|
let r = n.style.color;
|
|
@@ -1087,17 +1093,17 @@ var ke = /* @__PURE__ */ e(/* @__PURE__ */ O({
|
|
|
1087
1093
|
let i = getComputedStyle(n).color;
|
|
1088
1094
|
return n.style.color = r, i || e;
|
|
1089
1095
|
}
|
|
1090
|
-
let
|
|
1091
|
-
function
|
|
1092
|
-
if (
|
|
1093
|
-
|
|
1096
|
+
let S = F(g.value.palette);
|
|
1097
|
+
function C() {
|
|
1098
|
+
if (c.getPalette) {
|
|
1099
|
+
S.value = c.getPalette();
|
|
1094
1100
|
return;
|
|
1095
1101
|
}
|
|
1096
|
-
if (
|
|
1097
|
-
let e =
|
|
1102
|
+
if (f.value, c.color) {
|
|
1103
|
+
let e = x(c.color);
|
|
1098
1104
|
if (e.includes("var(") || e.includes("light-dark(")) return;
|
|
1099
|
-
let t =
|
|
1100
|
-
|
|
1105
|
+
let t = s(e);
|
|
1106
|
+
S.value = [{
|
|
1101
1107
|
L: Math.max(.5, t.L),
|
|
1102
1108
|
C: Math.max(.12, t.C),
|
|
1103
1109
|
h: t.h
|
|
@@ -1108,44 +1114,48 @@ var ke = /* @__PURE__ */ e(/* @__PURE__ */ O({
|
|
|
1108
1114
|
}];
|
|
1109
1115
|
return;
|
|
1110
1116
|
}
|
|
1111
|
-
|
|
1117
|
+
S.value = g.value.palette;
|
|
1112
1118
|
}
|
|
1113
|
-
let
|
|
1119
|
+
let k = Ae(d, {
|
|
1114
1120
|
config: new Proxy({}, {
|
|
1115
|
-
get: (e, t) => Reflect.get(
|
|
1116
|
-
has: (e, t) => Reflect.has(
|
|
1117
|
-
ownKeys: () => Reflect.ownKeys(
|
|
1118
|
-
getOwnPropertyDescriptor: (e, t) => Reflect.getOwnPropertyDescriptor(
|
|
1121
|
+
get: (e, t) => Reflect.get(g.value, t),
|
|
1122
|
+
has: (e, t) => Reflect.has(g.value, t),
|
|
1123
|
+
ownKeys: () => Reflect.ownKeys(g.value),
|
|
1124
|
+
getOwnPropertyDescriptor: (e, t) => Reflect.getOwnPropertyDescriptor(g.value, t)
|
|
1119
1125
|
}),
|
|
1120
|
-
getSpectrum:
|
|
1121
|
-
getPalette: () =>
|
|
1122
|
-
freeze: () =>
|
|
1123
|
-
routePointer:
|
|
1126
|
+
getSpectrum: b,
|
|
1127
|
+
getPalette: () => S.value,
|
|
1128
|
+
freeze: () => c.freeze,
|
|
1129
|
+
routePointer: v
|
|
1124
1130
|
});
|
|
1125
|
-
return
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1131
|
+
return L(k.rendererStatus, (e) => a("rendererStatus", e), {
|
|
1132
|
+
immediate: !0,
|
|
1133
|
+
flush: "sync"
|
|
1134
|
+
}), L(() => c.config, () => k.wake(), { deep: !0 }), L([
|
|
1135
|
+
() => c.color,
|
|
1136
|
+
() => c.getPalette,
|
|
1137
|
+
f
|
|
1138
|
+
], C, { immediate: !0 }), j(() => {
|
|
1139
|
+
C();
|
|
1140
|
+
}), L(f, () => k.wake()), L(() => c.freeze, () => k.wake()), n({
|
|
1141
|
+
backend: () => k.backend,
|
|
1142
|
+
pause: k.pause,
|
|
1143
|
+
resume: k.resume,
|
|
1144
|
+
wake: k.wake,
|
|
1145
|
+
renderAt: k.renderAt,
|
|
1146
|
+
setHeadT: k.setHeadT,
|
|
1147
|
+
rendererStatus: k.rendererStatus
|
|
1148
|
+
}), (e, t) => (N(), D("div", {
|
|
1139
1149
|
ref_key: "hostRef",
|
|
1140
|
-
ref:
|
|
1141
|
-
class:
|
|
1142
|
-
}, [
|
|
1150
|
+
ref: u,
|
|
1151
|
+
class: A(["fourier-field", { "fourier-field--interactive": _.value }])
|
|
1152
|
+
}, [O("canvas", {
|
|
1143
1153
|
ref_key: "canvasRef",
|
|
1144
|
-
ref:
|
|
1154
|
+
ref: d,
|
|
1145
1155
|
class: "fourier-field-canvas",
|
|
1146
1156
|
"aria-hidden": "true"
|
|
1147
1157
|
}, null, 512)], 2));
|
|
1148
1158
|
}
|
|
1149
|
-
}), [["__scopeId", "data-v-
|
|
1159
|
+
}), [["__scopeId", "data-v-1fd521e9"]]);
|
|
1150
1160
|
//#endregion
|
|
1151
|
-
export {
|
|
1161
|
+
export { re as DEFAULT_FOURIER_CONFIG, l as FOURIER_FIGURES, u as FOURIER_FIGURE_KEYS, je as FourierField, z as MAX_CURVE_SAMPLES, R as MAX_PHASORS, ne as WARM_IDENTITY_PALETTE, d as comp, f as dftFromPoints, p as makeEllipticSpectrum, m as makeHarmonicFigure, h as partialSumAt, g as positionsAt, Ae as useFourierField };
|