fancy-ui-vue 0.2.0 → 0.4.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/PORTING.md +123 -2
- package/README.md +20 -15
- package/dist/components/accordion/Accordion.vue.d.ts +44 -0
- package/dist/components/accordion/Accordion.vue.js +88 -0
- package/dist/components/accordion/Accordion.vue2.js +4 -0
- package/dist/components/accordion/AccordionContent.vue.d.ts +25 -0
- package/dist/components/accordion/AccordionContent.vue.js +42 -0
- package/dist/components/accordion/AccordionContent.vue2.js +4 -0
- package/dist/components/accordion/AccordionItem.vue.d.ts +21 -0
- package/dist/components/accordion/AccordionItem.vue.js +66 -0
- package/dist/components/accordion/AccordionItem.vue2.js +4 -0
- package/dist/components/accordion/AccordionTrigger.vue.d.ts +24 -0
- package/dist/components/accordion/AccordionTrigger.vue.js +83 -0
- package/dist/components/accordion/AccordionTrigger.vue2.js +4 -0
- package/dist/components/accordion/accordion-core.d.ts +35 -0
- package/dist/components/accordion/accordion-core.js +44 -0
- package/dist/components/accordion/index.d.ts +11 -0
- package/dist/components/accordion/types.d.ts +45 -0
- package/dist/components/accordion/types.js +7 -0
- package/dist/components/alert-dialog/AlertDialog.vue.js +22 -3
- package/dist/components/animated-testimonials/AnimatedTestimonials.vue.js +3 -3
- package/dist/components/apple-card-carousel/AppleCard.vue.js +1 -1
- package/dist/components/autocomplete/Autocomplete.vue.js +1 -1
- package/dist/components/autocomplete/Autocomplete.vue2.js +22 -15
- package/dist/components/avatar/Avatar.vue.d.ts +27 -0
- package/dist/components/avatar/Avatar.vue.js +119 -0
- package/dist/components/avatar/Avatar.vue2.js +4 -0
- package/dist/components/avatar/avatar-core.d.ts +40 -0
- package/dist/components/avatar/avatar-core.js +57 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/badge/Badge.vue.d.ts +21 -0
- package/dist/components/badge/Badge.vue.js +46 -0
- package/dist/components/badge/Badge.vue2.js +4 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/bento-grid/BentoFrame.vue.js +1 -1
- package/dist/components/bento-grid/BentoFrame.vue2.js +6 -5
- package/dist/components/bento-grid/BentoGrid.vue.js +1 -1
- package/dist/components/bento-grid/BentoGrid.vue2.js +12 -12
- package/dist/components/bento-grid/BentoGridCard.vue.js +6 -5
- package/dist/components/bento-grid/BentoGridItem.vue.js +6 -5
- package/dist/components/bg-falling-stars/FallingStarsBg.vue.d.ts +1 -1
- package/dist/components/bg-falling-stars/FallingStarsBg.vue.js +1 -1
- package/dist/components/bg-falling-stars/bg-falling-stars-core.d.ts +1 -1
- package/dist/components/bg-falling-stars/bg-falling-stars-core.js +47 -12
- package/dist/components/book/Book.vue.js +8 -9
- package/dist/components/book/BookDescription.vue.js +6 -5
- package/dist/components/book/BookHeader.vue.js +6 -5
- package/dist/components/book/BookTitle.vue.js +6 -5
- package/dist/components/box-reveal/BoxReveal.vue.js +6 -5
- package/dist/components/button/Button.vue.d.ts +6 -4
- package/dist/components/button/Button.vue.js +1 -1
- package/dist/components/button/Button.vue2.js +50 -22
- package/dist/components/card-3d/CardContainer.vue.js +1 -1
- package/dist/components/card-3d/CardItem.vue.js +1 -1
- package/dist/components/card-spotlight/CardSpotlight.vue.js +1 -1
- package/dist/components/chat-message/ChatMessageAction.vue.d.ts +4 -2
- package/dist/components/chat-message/ChatMessageAction.vue.js +4 -2
- package/dist/components/checkbox/Checkbox.vue.d.ts +2 -0
- package/dist/components/checkbox/Checkbox.vue.js +1 -1
- package/dist/components/checkbox/Checkbox.vue2.js +17 -7
- package/dist/components/collapsible/Collapsible.vue.d.ts +31 -0
- package/dist/components/collapsible/Collapsible.vue.js +60 -0
- package/dist/components/collapsible/Collapsible.vue2.js +4 -0
- package/dist/components/collapsible/CollapsibleContent.vue.d.ts +26 -0
- package/dist/components/collapsible/CollapsibleContent.vue.js +81 -0
- package/dist/components/collapsible/CollapsibleContent.vue2.js +4 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue.d.ts +21 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue.js +57 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue2.js +4 -0
- package/dist/components/collapsible/collapsible-core.d.ts +47 -0
- package/dist/components/collapsible/collapsible-core.js +40 -0
- package/dist/components/collapsible/index.d.ts +8 -0
- package/dist/components/collapsible/types.d.ts +24 -0
- package/dist/components/collapsible/types.js +5 -0
- package/dist/components/combobox/Combobox.vue.js +1 -1
- package/dist/components/combobox/Combobox.vue2.js +24 -16
- package/dist/components/command-menu/CommandMenu.vue.d.ts +5 -0
- package/dist/components/command-menu/CommandMenu.vue.js +1 -1
- package/dist/components/command-menu/CommandMenu.vue2.js +5 -2
- package/dist/components/compare/Compare.vue.d.ts +15 -5
- package/dist/components/compare/Compare.vue.js +1 -1
- package/dist/components/compare/Compare.vue2.js +28 -13
- package/dist/components/composer/ComposerInput.vue.js +1 -1
- package/dist/components/composer/ComposerInput.vue2.js +11 -11
- package/dist/components/composer/ComposerModelPicker.vue.d.ts +4 -0
- package/dist/components/composer/ComposerModelPicker.vue.js +1 -1
- package/dist/components/composer/ComposerModelPicker.vue2.js +29 -15
- package/dist/components/composer/ComposerSubmit.vue.d.ts +2 -0
- package/dist/components/composer/ComposerSubmit.vue.js +16 -15
- package/dist/components/confetti/ConfettiButton.vue.d.ts +9 -2
- package/dist/components/confetti/ConfettiButton.vue.js +24 -6
- package/dist/components/container-text-flip/ContainerTextFlip.vue.js +1 -1
- package/dist/components/container-text-flip/ContainerTextFlip.vue2.js +12 -13
- package/dist/components/copy-button/CopyButton.vue.d.ts +5 -0
- package/dist/components/copy-button/CopyButton.vue.js +1 -1
- package/dist/components/copy-button/CopyButton.vue2.js +72 -11
- package/dist/components/datamosh-transition/DatamoshTransition.vue.d.ts +6 -2
- package/dist/components/datamosh-transition/DatamoshTransition.vue.js +7 -4
- package/dist/components/date-picker/DatePicker.vue.js +1 -1
- package/dist/components/date-picker/DatePicker.vue2.js +27 -21
- package/dist/components/dialog/Dialog.vue.js +20 -1
- package/dist/components/dialog/DialogSurface.vue.js +1 -1
- package/dist/components/dialog/DialogSurface.vue2.js +5 -2
- package/dist/components/dialog/types.d.ts +2 -0
- package/dist/components/direction-aware-hover/DirectionAwareHover.vue.js +1 -1
- package/dist/components/direction-aware-hover/DirectionAwareHover.vue2.js +9 -7
- package/dist/components/displacement-text/DisplacementText.vue.d.ts +4 -1
- package/dist/components/displacement-text/DisplacementText.vue.js +38 -11
- package/dist/components/displacement-text/displacement-text-core.d.ts +94 -4
- package/dist/components/displacement-text/displacement-text-core.js +287 -97
- package/dist/components/drawer/Drawer.vue.d.ts +5 -0
- package/dist/components/drawer/Drawer.vue.js +1 -1
- package/dist/components/drawer/Drawer.vue2.js +5 -2
- package/dist/components/dropdown-menu/DropdownMenuContent.vue.js +2 -1
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts +4 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.js +17 -10
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +8 -0
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.js +28 -13
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.d.ts +4 -0
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.js +1 -1
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue2.js +20 -10
- package/dist/components/editorial-engine/EditorialEngine.vue.js +1 -1
- package/dist/components/editorial-engine/engine.js +13 -0
- package/dist/components/file-upload/FileUpload.vue.d.ts +2 -0
- package/dist/components/file-upload/FileUpload.vue.js +1 -1
- package/dist/components/file-upload/FileUpload.vue2.js +20 -10
- package/dist/components/fireworks-hdr/FireworksHdr.vue.js +2 -2
- package/dist/components/flickering-grid/FlickeringGrid.vue.d.ts +1 -1
- package/dist/components/flickering-grid/FlickeringGrid.vue.js +1 -1
- package/dist/components/flickering-grid/flickering-grid-core.d.ts +1 -1
- package/dist/components/flickering-grid/flickering-grid-core.js +51 -9
- package/dist/components/flip-card/FlipCard.vue.d.ts +3 -1
- package/dist/components/flip-card/FlipCard.vue.js +1 -1
- package/dist/components/flip-card/FlipCard.vue2.js +5 -3
- package/dist/components/fluid-cursor/FluidCursor.vue.js +37 -9
- package/dist/components/fluid-cursor/fluid-cursor-core.js +3 -3
- package/dist/components/fluid-cursor/webgpu-engine.js +3 -3
- package/dist/components/focus/Focus.vue.js +1 -1
- package/dist/components/focus/Focus.vue2.js +2 -2
- package/dist/components/follow-button/FollowButton.vue.d.ts +69 -0
- package/dist/components/follow-button/FollowButton.vue.js +7 -0
- package/dist/components/follow-button/FollowButton.vue2.js +239 -0
- package/dist/components/follow-button/follow-core.d.ts +83 -0
- package/dist/components/follow-button/follow-core.js +92 -0
- package/dist/components/follow-button/index.d.ts +2 -0
- package/dist/components/frosted-glass/FrostedGlass.vue.js +1 -1
- package/dist/components/glare-card/GlareCard.vue.js +1 -1
- package/dist/components/glare-card/GlareCard.vue2.js +4 -4
- package/dist/components/glowing-effect/GlowingEffect.vue.js +3 -3
- package/dist/components/glowing-effect/glowing-effect-core.js +4 -1
- package/dist/components/gradient-button/GradientButton.vue.d.ts +6 -4
- package/dist/components/gradient-button/GradientButton.vue.js +1 -1
- package/dist/components/gradient-button/GradientButton.vue2.js +13 -3
- package/dist/components/icon-button/IconButton.vue.d.ts +6 -4
- package/dist/components/icon-button/IconButton.vue.js +11 -8
- package/dist/components/image-trail-cursor/ImageTrailCursor.vue.js +17 -7
- package/dist/components/image-trail-cursor/trail-variants.js +3 -6
- package/dist/components/inline-citation/InlineCitation.vue.js +1 -1
- package/dist/components/inline-citation/InlineCitation.vue2.js +20 -14
- package/dist/components/input/Input.vue.js +1 -1
- package/dist/components/input/Input.vue2.js +18 -8
- package/dist/components/interactive-grid-pattern/InteractiveGridPattern.vue.js +1 -1
- package/dist/components/interactive-grid-pattern/InteractiveGridPattern.vue2.js +1 -1
- package/dist/components/interactive-hover-button/InteractiveHoverButton.vue.d.ts +6 -3
- package/dist/components/interactive-hover-button/InteractiveHoverButton.vue.js +1 -1
- package/dist/components/interactive-hover-button/InteractiveHoverButton.vue2.js +12 -2
- package/dist/components/letter-pullup/LetterPullup.vue.js +4 -4
- package/dist/components/line-hover-link/LineHoverLink.vue.js +1 -1
- package/dist/components/line-hover-link/LineHoverLink.vue2.js +5 -6
- package/dist/components/link/Link.vue.d.ts +4 -2
- package/dist/components/link/Link.vue.js +1 -1
- package/dist/components/link/Link.vue2.js +11 -8
- package/dist/components/magnetic-field/MagnetPuck.vue.d.ts +51 -0
- package/dist/components/magnetic-field/MagnetPuck.vue.js +7 -0
- package/dist/components/magnetic-field/MagnetPuck.vue2.js +191 -0
- package/dist/components/magnetic-field/MagneticField.vue.d.ts +39 -0
- package/dist/components/magnetic-field/MagneticField.vue.js +7 -0
- package/dist/components/magnetic-field/MagneticField.vue2.js +157 -0
- package/dist/components/magnetic-field/MagneticItem.vue.d.ts +28 -0
- package/dist/components/magnetic-field/MagneticItem.vue.js +7 -0
- package/dist/components/magnetic-field/MagneticItem.vue2.js +72 -0
- package/dist/components/magnetic-field/index.d.ts +10 -0
- package/dist/components/magnetic-field/magnetic-field-core.d.ts +163 -0
- package/dist/components/magnetic-field/magnetic-field-core.js +534 -0
- package/dist/components/magnetic-field/magnetic-field-source.d.ts +58 -0
- package/dist/components/magnetic-field/magnetic-field-source.js +58 -0
- package/dist/components/magnetic-field/types.d.ts +14 -0
- package/dist/components/magnetic-field/types.js +5 -0
- package/dist/components/mosaic-glow/MosaicGlow.vue.d.ts +6 -0
- package/dist/components/mosaic-glow/MosaicGlow.vue.js +53 -9
- package/dist/components/mosaic-glow/mosaic-glow-core.d.ts +30 -0
- package/dist/components/mosaic-glow/mosaic-glow-core.js +27 -0
- package/dist/components/mosaic-glow/mosaic-glow-hdr.d.ts +24 -0
- package/dist/components/mosaic-glow/mosaic-glow-hdr.js +200 -0
- package/dist/components/navbar/NavbarLink.vue.d.ts +4 -2
- package/dist/components/navbar/NavbarLink.vue.js +1 -1
- package/dist/components/navbar/NavbarLink.vue2.js +16 -13
- package/dist/components/navigation-menu/NavigationMenu.vue.js +6 -3
- package/dist/components/navigation-menu/NavigationMenuLink.vue.js +1 -1
- package/dist/components/navigation-menu/NavigationMenuLink.vue2.js +8 -8
- package/dist/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +15 -0
- package/dist/components/navigation-menu/NavigationMenuTrigger.vue.js +1 -1
- package/dist/components/navigation-menu/NavigationMenuTrigger.vue2.js +36 -15
- package/dist/components/neon-border/NeonBorder.vue.js +1 -1
- package/dist/components/neon-border/NeonBorder.vue2.js +10 -11
- package/dist/components/number-input/NumberInput.vue.js +1 -1
- package/dist/components/number-input/NumberInput.vue2.js +22 -12
- package/dist/components/password-input/PasswordInput.vue.js +1 -1
- package/dist/components/password-input/PasswordInput.vue2.js +18 -11
- package/dist/components/pixel-loader/PixelLoader.vue.js +1 -1
- package/dist/components/pixel-loader/PixelLoader.vue2.js +6 -6
- package/dist/components/pixel-scene/PixelScene.vue.d.ts +60 -0
- package/dist/components/pixel-scene/PixelScene.vue.js +184 -0
- package/dist/components/pixel-scene/PixelScene.vue2.js +4 -0
- package/dist/components/pixel-scene/index.d.ts +4 -0
- package/dist/components/pixel-scene/pixel-scene-core.d.ts +256 -0
- package/dist/components/pixel-scene/pixel-scene-core.js +878 -0
- package/dist/components/pixel-scene/pixel-scene-hdr.d.ts +68 -0
- package/dist/components/pixel-scene/pixel-scene-hdr.js +312 -0
- package/dist/components/pixel-scene/pixel-scene-scenes.d.ts +31 -0
- package/dist/components/pixel-scene/pixel-scene-scenes.js +1074 -0
- package/dist/components/popover/Popover.vue.d.ts +4 -0
- package/dist/components/popover/Popover.vue.js +1 -1
- package/dist/components/popover/Popover.vue2.js +8 -6
- package/dist/components/popover/PopoverContent.vue.js +6 -2
- package/dist/components/pulse-beam/PulseBeam.vue.d.ts +6 -2
- package/dist/components/pulse-beam/PulseBeam.vue.js +1 -1
- package/dist/components/pulse-beam/PulseBeam.vue2.js +7 -4
- package/dist/components/radio-group/RadioGroup.vue.js +12 -11
- package/dist/components/radio-group/RadioGroupItem.vue.d.ts +2 -0
- package/dist/components/radio-group/RadioGroupItem.vue.js +1 -1
- package/dist/components/radio-group/RadioGroupItem.vue2.js +20 -7
- package/dist/components/rainbow-button/RainbowButton.vue.d.ts +11 -2
- package/dist/components/rainbow-button/RainbowButton.vue.js +1 -1
- package/dist/components/rainbow-button/RainbowButton.vue2.js +35 -18
- package/dist/components/ripple-button/RippleButton.vue.d.ts +6 -4
- package/dist/components/ripple-button/RippleButton.vue.js +1 -1
- package/dist/components/ripple-button/RippleButton.vue2.js +10 -5
- package/dist/components/search-input/SearchInput.vue.js +1 -1
- package/dist/components/search-input/SearchInput.vue2.js +19 -9
- package/dist/components/select/Select.vue.d.ts +1 -1
- package/dist/components/select/Select.vue.js +1 -1
- package/dist/components/select/Select.vue2.js +25 -17
- package/dist/components/sheet/Sheet.vue.d.ts +5 -0
- package/dist/components/sheet/Sheet.vue.js +5 -2
- package/dist/components/shimmer-button/ShimmerButton.vue.d.ts +2 -2
- package/dist/components/shimmer-button/ShimmerButton.vue.js +1 -1
- package/dist/components/shimmer-button/ShimmerButton.vue2.js +14 -6
- package/dist/components/sidebar/SidebarItem.vue.d.ts +4 -2
- package/dist/components/sidebar/SidebarItem.vue.js +1 -1
- package/dist/components/sidebar/SidebarItem.vue2.js +4 -2
- package/dist/components/slider/Slider.vue.d.ts +4 -0
- package/dist/components/slider/Slider.vue.js +1 -1
- package/dist/components/slider/Slider.vue2.js +20 -8
- package/dist/components/sources/SourcesTrigger.vue.js +1 -1
- package/dist/components/sources/SourcesTrigger.vue2.js +11 -11
- package/dist/components/sparkles/sparkles-core.d.ts +1 -1
- package/dist/components/sparkles/sparkles-core.js +36 -2
- package/dist/components/story-thread/StoryNode.vue.d.ts +11 -0
- package/dist/components/story-thread/StoryNode.vue.js +7 -0
- package/dist/components/story-thread/StoryNode.vue2.js +23 -0
- package/dist/components/story-thread/StoryThread.vue.d.ts +56 -0
- package/dist/components/story-thread/StoryThread.vue.js +7 -0
- package/dist/components/story-thread/StoryThread.vue2.js +103 -0
- package/dist/components/story-thread/index.d.ts +5 -0
- package/dist/components/story-thread/story-thread-core.d.ts +119 -0
- package/dist/components/story-thread/story-thread-core.js +491 -0
- package/dist/components/story-thread/types.d.ts +1 -0
- package/dist/components/sun-switch/SunSwitch.vue.d.ts +61 -0
- package/dist/components/sun-switch/SunSwitch.vue.js +7 -0
- package/dist/components/sun-switch/SunSwitch.vue2.js +559 -0
- package/dist/components/sun-switch/index.d.ts +4 -0
- package/dist/components/sun-switch/pixel-wave-core.d.ts +82 -0
- package/dist/components/sun-switch/pixel-wave-core.js +508 -0
- package/dist/components/sun-switch/sun-switch-core.d.ts +251 -0
- package/dist/components/sun-switch/sun-switch-core.js +546 -0
- package/dist/components/sun-switch/sun-switch-hdr.d.ts +70 -0
- package/dist/components/sun-switch/sun-switch-hdr.js +311 -0
- package/dist/components/switch/Switch.vue.d.ts +2 -0
- package/dist/components/switch/Switch.vue.js +1 -1
- package/dist/components/switch/Switch.vue2.js +16 -6
- package/dist/components/tabs/TabsTrigger.vue.d.ts +6 -0
- package/dist/components/tabs/TabsTrigger.vue.js +1 -1
- package/dist/components/tabs/TabsTrigger.vue2.js +28 -15
- package/dist/components/terminal-block/TerminalBlock.vue.js +1 -1
- package/dist/components/terminal-block/TerminalBlock.vue2.js +10 -9
- package/dist/components/text-reveal-card/TextRevealCard.vue.js +1 -2
- package/dist/components/textarea/Textarea.vue.js +1 -1
- package/dist/components/textarea/Textarea.vue2.js +19 -12
- package/dist/components/tick-nav/TickNav.vue.d.ts +71 -0
- package/dist/components/tick-nav/TickNav.vue.js +7 -0
- package/dist/components/tick-nav/TickNav.vue2.js +285 -0
- package/dist/components/tick-nav/index.d.ts +3 -0
- package/dist/components/tick-nav/tick-nav-core.d.ts +102 -0
- package/dist/components/tick-nav/tick-nav-core.js +398 -0
- package/dist/components/tick-nav/tick-nav-hdr.d.ts +60 -0
- package/dist/components/tick-nav/tick-nav-hdr.js +284 -0
- package/dist/components/tick-nav/types.d.ts +13 -0
- package/dist/components/time-picker/TimePicker.vue.js +1 -1
- package/dist/components/time-picker/TimePicker.vue2.js +25 -17
- package/dist/components/toast/Toast.vue.js +1 -1
- package/dist/components/toast/Toast.vue2.js +16 -4
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/toast/store.d.ts +23 -0
- package/dist/components/toast/store.js +35 -7
- package/dist/components/toggle/Toggle.vue.d.ts +12 -0
- package/dist/components/toggle/Toggle.vue.js +1 -1
- package/dist/components/toggle/Toggle.vue2.js +27 -11
- package/dist/components/toggle-group/ToggleGroup.vue.d.ts +11 -0
- package/dist/components/toggle-group/ToggleGroup.vue.js +1 -1
- package/dist/components/toggle-group/ToggleGroup.vue2.js +16 -3
- package/dist/components/toggle-group/ToggleGroupItem.vue.d.ts +6 -0
- package/dist/components/toggle-group/ToggleGroupItem.vue.js +1 -1
- package/dist/components/toggle-group/ToggleGroupItem.vue2.js +27 -14
- package/dist/components/tooltip/Tooltip.vue.js +13 -0
- package/dist/components/tracing-beam/TracingBeam.vue.d.ts +20 -1
- package/dist/components/tracing-beam/TracingBeam.vue.js +5 -164
- package/dist/components/tracing-beam/TracingBeam.vue2.js +168 -1
- package/dist/components/typing-indicator/TypingIndicator.vue.js +1 -1
- package/dist/components/typing-indicator/TypingIndicator.vue2.js +7 -6
- package/dist/index.d.ts +10 -0
- package/dist/index.js +466 -413
- package/dist/internals/anchor-position.js +3 -0
- package/dist/internals/call-listener.d.ts +11 -0
- package/dist/internals/call-listener.js +31 -0
- package/dist/internals/dismissable.d.ts +17 -0
- package/dist/internals/dismissable.js +44 -1
- package/dist/internals/env.d.ts +1 -0
- package/dist/internals/env.js +11 -0
- package/dist/internals/focus-trap.js +29 -4
- package/dist/internals/merge-ids.d.ts +6 -0
- package/dist/internals/merge-ids.js +11 -0
- package/dist/internals/motion/presence-core.d.ts +1 -1
- package/dist/sound/engine.js +23 -9
- package/dist/sound/themes.d.ts +4 -3
- package/dist/sound/themes.js +49 -211
- package/dist/sound/types.d.ts +9 -1
- package/dist/sound/types.js +2 -2
- package/dist/styles.css +1473 -571
- package/package.json +2 -2
- package/tailwind.css +9 -9
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MagneticField input adapters — framework-free, byte-identical in the Svelte,
|
|
3
|
+
* React and Vue trees (listed explicitly in shared-cores.json).
|
|
4
|
+
*
|
|
5
|
+
* The core (`magnetic-field-core.ts`) never listens to anything: it is fed a
|
|
6
|
+
* magnet position per channel and told when the layout may have moved. This
|
|
7
|
+
* module owns the two listener sets that do the feeding:
|
|
8
|
+
*
|
|
9
|
+
* - `attachPointerSource` turns a mouse or pen anywhere on the page into the
|
|
10
|
+
* `"pointer"` channel. It listens on the DOCUMENT, not the field root: the
|
|
11
|
+
* pull reaches `radius` px beyond every item, so most of the approach
|
|
12
|
+
* happens outside the root's box. The component gates the attachment with an
|
|
13
|
+
* in-view observer whose margin is that radius, so an off-screen field costs
|
|
14
|
+
* nothing.
|
|
15
|
+
* - `attachLayoutInvalidation` tells the core that rects may be stale after a
|
|
16
|
+
* scroll (of the page or of any scrolling ancestor) or a window resize.
|
|
17
|
+
*
|
|
18
|
+
* Handlers never compute anything: they store the latest client position in
|
|
19
|
+
* the core, which coalesces to at most one target pass per frame.
|
|
20
|
+
*
|
|
21
|
+
* Both functions return their own teardown and are safe to call during SSR
|
|
22
|
+
* (they attach nothing and return a no-op). No browser global is touched at
|
|
23
|
+
* import time.
|
|
24
|
+
*/
|
|
25
|
+
import type { MagneticFieldCore } from "./magnetic-field-core.js";
|
|
26
|
+
/**
|
|
27
|
+
* Feeds the core's `"pointer"` channel from a mouse or pen moving anywhere on
|
|
28
|
+
* `target` (the current document by default).
|
|
29
|
+
*
|
|
30
|
+
* - Touch is ignored: a finger has no hover, and a tap would yank the items
|
|
31
|
+
* toward it for one frame and drop them. Touch users drive the field with a
|
|
32
|
+
* `MagnetPuck` instead.
|
|
33
|
+
* - Only the primary pointer counts, so a second pen or mouse cannot fight the
|
|
34
|
+
* first.
|
|
35
|
+
* - A pointer over a `MagnetPuck` (hovering it, or dragging it with pointer
|
|
36
|
+
* capture) clears the channel instead of feeding it: the puck is the magnet
|
|
37
|
+
* there. Otherwise, letting go of a puck would release nothing, since the
|
|
38
|
+
* cursor resting on it would take over at the very same point. The channel
|
|
39
|
+
* comes back as soon as the pointer moves off the puck. With a `root`, only
|
|
40
|
+
* a puck inside it counts: another field's puck is that field's magnet.
|
|
41
|
+
* - The channel is cleared when the pointer leaves the page (to the browser
|
|
42
|
+
* chrome, another window, or a pen lifted out of hover range), when the
|
|
43
|
+
* window loses focus (a keyboard tab switch moves no pointer), and when the
|
|
44
|
+
* page is hidden. Without these, the last pull would freeze on screen until
|
|
45
|
+
* the pointer came back.
|
|
46
|
+
*/
|
|
47
|
+
export declare function attachPointerSource(core: Pick<MagneticFieldCore, "setClientSource" | "clearSource">, target?: Document, root?: Element): () => void;
|
|
48
|
+
/**
|
|
49
|
+
* Calls `core.invalidate()` whenever the field may have moved on screen
|
|
50
|
+
* without resizing: a scroll of the page or of any scrolling ancestor
|
|
51
|
+
* (captured on the window, since `scroll` does not bubble), or a window
|
|
52
|
+
* resize. Size changes of the root and the items themselves are the core's
|
|
53
|
+
* own `ResizeObserver`'s job.
|
|
54
|
+
*
|
|
55
|
+
* `invalidate()` only marks the cached rects dirty and wakes the loop when
|
|
56
|
+
* something is engaged, so a fast scroll costs one rect read per frame at most.
|
|
57
|
+
*/
|
|
58
|
+
export declare function attachLayoutInvalidation(core: Pick<MagneticFieldCore, "invalidate">): () => void;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const NOOP = () => {
|
|
2
|
+
};
|
|
3
|
+
const PUCK_SELECTOR = ".ft-magnet-puck";
|
|
4
|
+
function attachPointerSource(core, target, root) {
|
|
5
|
+
const doc = target ?? (typeof document === "undefined" ? void 0 : document);
|
|
6
|
+
if (!doc) return NOOP;
|
|
7
|
+
const win = doc.defaultView;
|
|
8
|
+
const clear = () => core.clearSource("pointer");
|
|
9
|
+
const onMove = (event) => {
|
|
10
|
+
if (event.pointerType === "touch" || !event.isPrimary) return;
|
|
11
|
+
const target2 = event.target;
|
|
12
|
+
const puck = typeof target2?.closest === "function" ? target2.closest(PUCK_SELECTOR) : null;
|
|
13
|
+
if (puck && (!root || root.contains(puck))) {
|
|
14
|
+
clear();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
core.setClientSource(event.clientX, event.clientY, "pointer");
|
|
18
|
+
};
|
|
19
|
+
const onOut = (event) => {
|
|
20
|
+
if (event.pointerType === "touch" || !event.isPrimary) return;
|
|
21
|
+
if (event.relatedTarget === null) clear();
|
|
22
|
+
};
|
|
23
|
+
const onLeave = (event) => {
|
|
24
|
+
if (event.pointerType === "touch" || !event.isPrimary) return;
|
|
25
|
+
clear();
|
|
26
|
+
};
|
|
27
|
+
const onVisibility = () => {
|
|
28
|
+
if (doc.visibilityState === "hidden") clear();
|
|
29
|
+
};
|
|
30
|
+
doc.addEventListener("pointermove", onMove, { passive: true });
|
|
31
|
+
doc.addEventListener("pointerout", onOut, { passive: true });
|
|
32
|
+
doc.addEventListener("pointerleave", onLeave, { passive: true });
|
|
33
|
+
doc.addEventListener("visibilitychange", onVisibility);
|
|
34
|
+
win?.addEventListener("blur", clear);
|
|
35
|
+
return () => {
|
|
36
|
+
doc.removeEventListener("pointermove", onMove);
|
|
37
|
+
doc.removeEventListener("pointerout", onOut);
|
|
38
|
+
doc.removeEventListener("pointerleave", onLeave);
|
|
39
|
+
doc.removeEventListener("visibilitychange", onVisibility);
|
|
40
|
+
win?.removeEventListener("blur", clear);
|
|
41
|
+
clear();
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function attachLayoutInvalidation(core) {
|
|
45
|
+
if (typeof window === "undefined") return NOOP;
|
|
46
|
+
const win = window;
|
|
47
|
+
const onChange = () => core.invalidate();
|
|
48
|
+
win.addEventListener("scroll", onChange, { capture: true, passive: true });
|
|
49
|
+
win.addEventListener("resize", onChange, { passive: true });
|
|
50
|
+
return () => {
|
|
51
|
+
win.removeEventListener("scroll", onChange, { capture: true });
|
|
52
|
+
win.removeEventListener("resize", onChange);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
attachLayoutInvalidation,
|
|
57
|
+
attachPointerSource
|
|
58
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contract between a `MagneticField` and the `MagneticItem`s and
|
|
3
|
+
* `MagnetPuck`s inside it.
|
|
4
|
+
*
|
|
5
|
+
* The context value is the field's registration hub (see
|
|
6
|
+
* `createMagneticFieldHub` in `magnetic-field-core.ts`): a stable object,
|
|
7
|
+
* created once per field, that buffers registrations until the field's core
|
|
8
|
+
* exists and replays them into it. Children only ever see these three methods.
|
|
9
|
+
*/
|
|
10
|
+
import { type InternalContext } from "../../internals/dom/context.js";
|
|
11
|
+
import type { MagneticFieldHub } from "./magnetic-field-core.js";
|
|
12
|
+
/** What a field publishes to its items and pucks. */
|
|
13
|
+
export type MagneticFieldContext = Pick<MagneticFieldHub, "register" | "updateItem" | "setSource">;
|
|
14
|
+
export declare const MAGNETIC_FIELD_KEY: InternalContext<MagneticFieldContext>;
|
|
@@ -45,6 +45,12 @@ export interface MosaicGlowProps {
|
|
|
45
45
|
interactive?: boolean;
|
|
46
46
|
/** Seed for the per-tile randomness — same seed, same mosaic */
|
|
47
47
|
seed?: number;
|
|
48
|
+
/**
|
|
49
|
+
* On a display that reports HDR, add the light above SDR white in a WebGPU
|
|
50
|
+
* layer with extended tone mapping: the hottest tiles peak around 1000
|
|
51
|
+
* nits and the halo gets a hot core. Elsewhere the mosaic is unchanged.
|
|
52
|
+
*/
|
|
53
|
+
hdr?: boolean;
|
|
48
54
|
}
|
|
49
55
|
declare const _default: typeof __VLS_export;
|
|
50
56
|
export default _default;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { defineComponent, computed, useAttrs, useTemplateRef, onMounted, onBeforeUnmount, watch, createElementBlock, openBlock, mergeProps, unref, createElementVNode, createCommentVNode, renderSlot } from "vue";
|
|
1
|
+
import { defineComponent, computed, useAttrs, useTemplateRef, ref, onMounted, onBeforeUnmount, watch, createElementBlock, openBlock, mergeProps, unref, createElementVNode, createCommentVNode, renderSlot } from "vue";
|
|
2
2
|
import { cn } from "../../utils.js";
|
|
3
3
|
import { useReducedMotion } from "../../internals/motion/use-media-query.js";
|
|
4
4
|
import { clamp01, normalizeRadius, normalizeTileSize, normalizeGap, createMosaicGlow } from "./mosaic-glow-core.js";
|
|
5
|
-
|
|
5
|
+
import { startMosaicGlowHdr } from "./mosaic-glow-hdr.js";
|
|
6
|
+
const _hoisted_1 = ["data-hdr"];
|
|
7
|
+
const _hoisted_2 = {
|
|
6
8
|
ref: "canvas",
|
|
7
9
|
class: "pointer-events-none absolute inset-0 block h-full w-full",
|
|
8
10
|
"aria-hidden": "true"
|
|
9
11
|
};
|
|
10
|
-
const
|
|
11
|
-
key:
|
|
12
|
+
const _hoisted_3 = {
|
|
13
|
+
key: 1,
|
|
12
14
|
class: "mosaic-glow__content relative z-[1] h-full w-full"
|
|
13
15
|
};
|
|
14
16
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -29,7 +31,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
31
|
flicker: { type: Boolean, default: true },
|
|
30
32
|
idle: { default: "drift" },
|
|
31
33
|
interactive: { type: Boolean, default: true },
|
|
32
|
-
seed: { default: 1 }
|
|
34
|
+
seed: { default: 1 },
|
|
35
|
+
hdr: { type: Boolean, default: true }
|
|
33
36
|
},
|
|
34
37
|
setup(__props, { expose: __expose }) {
|
|
35
38
|
const intensityC = computed(() => clamp01(__props.intensity));
|
|
@@ -44,6 +47,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
47
|
const reducedMotion = useReducedMotion();
|
|
45
48
|
const hostEl = useTemplateRef("host");
|
|
46
49
|
const canvasEl = useTemplateRef("canvas");
|
|
50
|
+
const hdrCanvas = useTemplateRef("hdrCanvas");
|
|
51
|
+
const hdrOn = ref(false);
|
|
52
|
+
const engineReady = ref(false);
|
|
47
53
|
let engine = null;
|
|
48
54
|
let ro;
|
|
49
55
|
let io;
|
|
@@ -73,6 +79,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
73
79
|
}
|
|
74
80
|
);
|
|
75
81
|
if (!engine) return;
|
|
82
|
+
engineReady.value = true;
|
|
76
83
|
if (typeof ResizeObserver !== "undefined") {
|
|
77
84
|
ro = new ResizeObserver(() => engine?.resize());
|
|
78
85
|
ro.observe(host);
|
|
@@ -90,6 +97,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
90
97
|
onBeforeUnmount(() => {
|
|
91
98
|
engine?.destroy();
|
|
92
99
|
engine = null;
|
|
100
|
+
engineReady.value = false;
|
|
93
101
|
ro?.disconnect();
|
|
94
102
|
ro = void 0;
|
|
95
103
|
io?.disconnect();
|
|
@@ -127,18 +135,54 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
127
135
|
(on) => engine?.setOptions({ interactive: on }),
|
|
128
136
|
{ flush: "post" }
|
|
129
137
|
);
|
|
138
|
+
watch(
|
|
139
|
+
[hdrCanvas, engineReady],
|
|
140
|
+
([canvas, ready], _old, onCleanup) => {
|
|
141
|
+
if (!canvas || !ready) return;
|
|
142
|
+
let cancelled = false;
|
|
143
|
+
let stop = null;
|
|
144
|
+
void startMosaicGlowHdr(canvas).then((light) => {
|
|
145
|
+
if (!light) return;
|
|
146
|
+
if (cancelled || !engine) {
|
|
147
|
+
light.destroy();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const target = engine;
|
|
151
|
+
target.setOptions({ onFrame: (frame) => light.render(frame) });
|
|
152
|
+
hdrOn.value = true;
|
|
153
|
+
stop = () => {
|
|
154
|
+
target.setOptions({ onFrame: null });
|
|
155
|
+
light.destroy();
|
|
156
|
+
hdrOn.value = false;
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
onCleanup(() => {
|
|
160
|
+
cancelled = true;
|
|
161
|
+
stop?.();
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
{ flush: "post" }
|
|
165
|
+
);
|
|
130
166
|
return (_ctx, _cache) => {
|
|
131
167
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
132
168
|
ref: "host",
|
|
133
|
-
class: unref(cn)("mosaic-glow relative overflow-hidden", __props.class)
|
|
169
|
+
class: unref(cn)("mosaic-glow relative overflow-hidden", __props.class),
|
|
170
|
+
"data-hdr": hdrOn.value ? "" : void 0
|
|
134
171
|
}, unref(attrs), {
|
|
135
172
|
style: { "background-color": __props.background }
|
|
136
173
|
}), [
|
|
137
|
-
createElementVNode("canvas",
|
|
138
|
-
|
|
174
|
+
createElementVNode("canvas", _hoisted_2, null, 512),
|
|
175
|
+
__props.hdr ? (openBlock(), createElementBlock("canvas", {
|
|
176
|
+
key: 0,
|
|
177
|
+
ref_key: "hdrCanvas",
|
|
178
|
+
ref: hdrCanvas,
|
|
179
|
+
class: "mosaic-glow__hdr pointer-events-none absolute inset-0 block h-full w-full",
|
|
180
|
+
"aria-hidden": "true"
|
|
181
|
+
}, null, 512)) : createCommentVNode("", true),
|
|
182
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
139
183
|
renderSlot(_ctx.$slots, "default")
|
|
140
184
|
])) : createCommentVNode("", true)
|
|
141
|
-
], 16);
|
|
185
|
+
], 16, _hoisted_1);
|
|
142
186
|
};
|
|
143
187
|
}
|
|
144
188
|
});
|
|
@@ -164,6 +164,36 @@ export interface MosaicGlowLiveOptions {
|
|
|
164
164
|
reducedMotion?: boolean;
|
|
165
165
|
/** The wrapper's visibility gate: false parks the loop. */
|
|
166
166
|
visible?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Called after every painted frame with the light field, for a renderer
|
|
169
|
+
* that adds light on top (the HDR layer). `null` removes it. A callback
|
|
170
|
+
* that throws is dropped; it never stops the mosaic.
|
|
171
|
+
*/
|
|
172
|
+
onFrame?: ((frame: MosaicGlowFrame) => void) | null;
|
|
173
|
+
}
|
|
174
|
+
/** What one painted frame looked like, in device px (the canvas backing store). */
|
|
175
|
+
export interface MosaicGlowFrame {
|
|
176
|
+
/** Per-tile lit level 0..1, row-major; live view, read it synchronously. */
|
|
177
|
+
heat: Float32Array;
|
|
178
|
+
cols: number;
|
|
179
|
+
rows: number;
|
|
180
|
+
/** Distance between tile origins and tile edge. */
|
|
181
|
+
pitch: number;
|
|
182
|
+
tile: number;
|
|
183
|
+
/** Backing-store size. */
|
|
184
|
+
width: number;
|
|
185
|
+
height: number;
|
|
186
|
+
/** Smoothed halo centre and radius; `fade` 0..1 (0 = no halo). */
|
|
187
|
+
halo: {
|
|
188
|
+
x: number;
|
|
189
|
+
y: number;
|
|
190
|
+
r: number;
|
|
191
|
+
fade: number;
|
|
192
|
+
};
|
|
193
|
+
/** 0..1, as passed. */
|
|
194
|
+
intensity: number;
|
|
195
|
+
/** Tile / halo colour, as passed. */
|
|
196
|
+
color: string;
|
|
167
197
|
}
|
|
168
198
|
export interface MosaicGlowEngine {
|
|
169
199
|
setOptions(next: Partial<MosaicGlowLiveOptions>): void;
|
|
@@ -199,6 +199,7 @@ function createMosaicGlow(el, options = {}, random = Math.random) {
|
|
|
199
199
|
let seed = options.seed ?? 1;
|
|
200
200
|
let reducedMotion = options.reducedMotion ?? false;
|
|
201
201
|
let visible = options.visible ?? true;
|
|
202
|
+
let onFrame = options.onFrame ?? null;
|
|
202
203
|
let glassLayer = null;
|
|
203
204
|
let grid = null;
|
|
204
205
|
let lut = null;
|
|
@@ -401,6 +402,25 @@ function createMosaicGlow(el, options = {}, random = Math.random) {
|
|
|
401
402
|
c.fillRect(sx - r, sy - r, r * 2, r * 2);
|
|
402
403
|
}
|
|
403
404
|
c.globalCompositeOperation = "source-over";
|
|
405
|
+
if (onFrame) {
|
|
406
|
+
try {
|
|
407
|
+
onFrame({
|
|
408
|
+
heat: g.heat,
|
|
409
|
+
cols,
|
|
410
|
+
rows,
|
|
411
|
+
pitch: pitchDev,
|
|
412
|
+
tile: tileDev,
|
|
413
|
+
width: w,
|
|
414
|
+
height: h,
|
|
415
|
+
halo: { x: sx, y: sy, r: (halo ? halo.r : radius * dpr) * 1.15, fade: haloFade },
|
|
416
|
+
intensity,
|
|
417
|
+
color
|
|
418
|
+
});
|
|
419
|
+
} catch (error) {
|
|
420
|
+
onFrame = null;
|
|
421
|
+
console.warn("[MosaicGlow] light layer disabled:", error);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
404
424
|
}
|
|
405
425
|
function onMove(e) {
|
|
406
426
|
const rect = host.getBoundingClientRect();
|
|
@@ -439,6 +459,8 @@ function createMosaicGlow(el, options = {}, random = Math.random) {
|
|
|
439
459
|
const motion = next.reducedMotion !== void 0;
|
|
440
460
|
const pointer = next.interactive !== void 0;
|
|
441
461
|
const visibility = next.visible !== void 0;
|
|
462
|
+
const layer = "onFrame" in next;
|
|
463
|
+
if (layer) onFrame = next.onFrame ?? null;
|
|
442
464
|
if (next.tileSize !== void 0) tile = normalizeTileSize(next.tileSize);
|
|
443
465
|
if (next.gap !== void 0) gap = normalizeGap(next.gap);
|
|
444
466
|
if (next.seed !== void 0) seed = next.seed;
|
|
@@ -481,6 +503,11 @@ function createMosaicGlow(el, options = {}, random = Math.random) {
|
|
|
481
503
|
if (visible) requestFrame();
|
|
482
504
|
else stopLoop();
|
|
483
505
|
}
|
|
506
|
+
if (layer) {
|
|
507
|
+
dirty = true;
|
|
508
|
+
if (reducedMotion) drawStatic(haloFade > 0 ? { x: sx, y: sy, r: radius * dpr } : null);
|
|
509
|
+
else requestFrame();
|
|
510
|
+
}
|
|
484
511
|
}
|
|
485
512
|
function resize() {
|
|
486
513
|
if (destroyed || !ctx) return;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MosaicGlow HDR light — framework-free, byte-identical in the Svelte, React
|
|
3
|
+
* and Vue trees (see shared-cores.json).
|
|
4
|
+
*
|
|
5
|
+
* The mosaic itself is painted in a 2D canvas, which stops at SDR white. This
|
|
6
|
+
* module lays a WebGPU canvas over it, configured with `rgba16float` +
|
|
7
|
+
* `toneMapping: { mode: "extended" }`, and adds only the light ABOVE white:
|
|
8
|
+
* hot tiles inside the halo climb toward {@link MOSAIC_GLOW_HDR_PEAK} (≈1000
|
|
9
|
+
* nits against a 203-nit SDR reference white) and the halo gets a hot core.
|
|
10
|
+
* Resting and ambient tiles get nothing, so the SDR picture is unchanged.
|
|
11
|
+
*
|
|
12
|
+
* It starts only when the browser keeps extended tone mapping AND the display
|
|
13
|
+
* reports `(dynamic-range: high)`; otherwise `startMosaicGlowHdr` resolves to
|
|
14
|
+
* null and the 2D mosaic runs alone. No browser global is touched at import.
|
|
15
|
+
*/
|
|
16
|
+
import { type MosaicGlowFrame } from "./mosaic-glow-core.js";
|
|
17
|
+
/** SDR white ≈ 203 nits; 1000 nits / 203 ≈ 4.9. */
|
|
18
|
+
export declare const MOSAIC_GLOW_HDR_PEAK = 4.9;
|
|
19
|
+
export interface MosaicGlowHdr {
|
|
20
|
+
/** Draws the light for one painted mosaic frame. */
|
|
21
|
+
render(frame: MosaicGlowFrame): void;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function startMosaicGlowHdr(canvas: HTMLCanvasElement): Promise<MosaicGlowHdr | null>;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { parseRgb, DEFAULT_COLOR } from "./mosaic-glow-core.js";
|
|
2
|
+
const MOSAIC_GLOW_HDR_PEAK = 4.9;
|
|
3
|
+
const FORMAT = "rgba16float";
|
|
4
|
+
const WGSL = (
|
|
5
|
+
/* wgsl */
|
|
6
|
+
`
|
|
7
|
+
struct Frame {
|
|
8
|
+
size: vec2f,
|
|
9
|
+
pitch: f32,
|
|
10
|
+
tile: f32,
|
|
11
|
+
halo: vec4f, // x, y, r, fade
|
|
12
|
+
accent: vec4f, // linear rgb, peak
|
|
13
|
+
grid: vec4u, // cols, rows, -, -
|
|
14
|
+
};
|
|
15
|
+
@group(0) @binding(0) var<uniform> frame: Frame;
|
|
16
|
+
@group(0) @binding(1) var<storage, read> heat: array<f32>;
|
|
17
|
+
|
|
18
|
+
@vertex
|
|
19
|
+
fn vs(@builtin(vertex_index) vi: u32) -> @builtin(position) vec4f {
|
|
20
|
+
let p = array<vec2f, 3>(vec2f(-1.0, -1.0), vec2f(3.0, -1.0), vec2f(-1.0, 3.0));
|
|
21
|
+
return vec4f(p[vi], 0.0, 1.0);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@fragment
|
|
25
|
+
fn fs(@builtin(position) pos: vec4f) -> @location(0) vec4f {
|
|
26
|
+
let p = pos.xy;
|
|
27
|
+
let cell = floor(p / frame.pitch);
|
|
28
|
+
let local = p - cell * frame.pitch;
|
|
29
|
+
var h = 0.0;
|
|
30
|
+
if (cell.x >= 0.0 && cell.y >= 0.0 && u32(cell.x) < frame.grid.x && u32(cell.y) < frame.grid.y
|
|
31
|
+
&& local.x < frame.tile && local.y < frame.tile) {
|
|
32
|
+
h = heat[u32(cell.y) * frame.grid.x + u32(cell.x)];
|
|
33
|
+
}
|
|
34
|
+
let peak = frame.accent.w;
|
|
35
|
+
// Only the hottest tiles leave SDR: the excess above white ramps in late.
|
|
36
|
+
let hot = smoothstep(0.5, 1.0, h);
|
|
37
|
+
let tileLight = hot * (peak - 1.0);
|
|
38
|
+
let d = distance(p, frame.halo.xy);
|
|
39
|
+
let core = frame.halo.z * 0.22;
|
|
40
|
+
let haloLight = frame.halo.w * 0.9 * exp(-(d * d) / max(core * core, 1.0));
|
|
41
|
+
let v = tileLight + haloLight;
|
|
42
|
+
let colour = mix(frame.accent.rgb, vec3f(1.0), 0.25 * hot);
|
|
43
|
+
return vec4f(colour * v, clamp(v * 0.05, 0.0, 1.0));
|
|
44
|
+
}
|
|
45
|
+
`
|
|
46
|
+
);
|
|
47
|
+
function srgbToLinear(c) {
|
|
48
|
+
const s = c / 255;
|
|
49
|
+
return s <= 0.04045 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
|
|
50
|
+
}
|
|
51
|
+
async function startMosaicGlowHdr(canvas) {
|
|
52
|
+
try {
|
|
53
|
+
let ensureHeat = function(count) {
|
|
54
|
+
if (heatBuffer && count <= heatCapacity) return;
|
|
55
|
+
heatBuffer?.destroy();
|
|
56
|
+
heatCapacity = Math.max(count, 64);
|
|
57
|
+
heatBuffer = device.createBuffer({
|
|
58
|
+
size: heatCapacity * 4,
|
|
59
|
+
usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST
|
|
60
|
+
});
|
|
61
|
+
scaled = new Float32Array(heatCapacity);
|
|
62
|
+
bindGroup = device.createBindGroup({
|
|
63
|
+
layout: pipeline.getBindGroupLayout(0),
|
|
64
|
+
entries: [
|
|
65
|
+
{ binding: 0, resource: { buffer: uniform } },
|
|
66
|
+
{ binding: 1, resource: { buffer: heatBuffer } }
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
if (typeof navigator === "undefined" || typeof window === "undefined") return null;
|
|
71
|
+
const hdrDisplay = typeof window.matchMedia === "function" && window.matchMedia("(dynamic-range: high)").matches;
|
|
72
|
+
if (!hdrDisplay) return null;
|
|
73
|
+
const gpu = navigator.gpu;
|
|
74
|
+
if (!gpu) return null;
|
|
75
|
+
const adapter = await gpu.requestAdapter();
|
|
76
|
+
if (!adapter) return null;
|
|
77
|
+
const device = await adapter.requestDevice();
|
|
78
|
+
const context = canvas.getContext("webgpu");
|
|
79
|
+
if (!context) {
|
|
80
|
+
device.destroy();
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
context.configure({
|
|
84
|
+
device,
|
|
85
|
+
format: FORMAT,
|
|
86
|
+
alphaMode: "premultiplied",
|
|
87
|
+
colorSpace: "display-p3",
|
|
88
|
+
toneMapping: { mode: "extended" }
|
|
89
|
+
});
|
|
90
|
+
let extended = false;
|
|
91
|
+
try {
|
|
92
|
+
const applied = context.getConfiguration?.();
|
|
93
|
+
extended = applied?.toneMapping?.mode === "extended";
|
|
94
|
+
} catch {
|
|
95
|
+
extended = false;
|
|
96
|
+
}
|
|
97
|
+
if (!extended) {
|
|
98
|
+
context.unconfigure();
|
|
99
|
+
device.destroy();
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
const module = device.createShaderModule({ code: WGSL });
|
|
103
|
+
const pipeline = device.createRenderPipeline({
|
|
104
|
+
layout: "auto",
|
|
105
|
+
vertex: { module, entryPoint: "vs" },
|
|
106
|
+
fragment: {
|
|
107
|
+
module,
|
|
108
|
+
entryPoint: "fs",
|
|
109
|
+
targets: [
|
|
110
|
+
{
|
|
111
|
+
format: FORMAT,
|
|
112
|
+
blend: {
|
|
113
|
+
color: { srcFactor: "one", dstFactor: "one", operation: "add" },
|
|
114
|
+
alpha: { srcFactor: "one", dstFactor: "one", operation: "add" }
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
primitive: { topology: "triangle-list" }
|
|
120
|
+
});
|
|
121
|
+
const uniform = device.createBuffer({
|
|
122
|
+
size: 64,
|
|
123
|
+
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST
|
|
124
|
+
});
|
|
125
|
+
const uniformData = new ArrayBuffer(64);
|
|
126
|
+
const f32 = new Float32Array(uniformData);
|
|
127
|
+
const u32 = new Uint32Array(uniformData);
|
|
128
|
+
let heatBuffer = null;
|
|
129
|
+
let heatCapacity = 0;
|
|
130
|
+
let scaled = new Float32Array(0);
|
|
131
|
+
let bindGroup = null;
|
|
132
|
+
let colourKey = "";
|
|
133
|
+
let accent = [1, 0.6, 0.1];
|
|
134
|
+
let destroyed = false;
|
|
135
|
+
return {
|
|
136
|
+
render(frame) {
|
|
137
|
+
if (destroyed || frame.width <= 0 || frame.height <= 0) return;
|
|
138
|
+
if (canvas.width !== frame.width) canvas.width = frame.width;
|
|
139
|
+
if (canvas.height !== frame.height) canvas.height = frame.height;
|
|
140
|
+
if (frame.color !== colourKey) {
|
|
141
|
+
colourKey = frame.color;
|
|
142
|
+
const rgb = parseRgb(frame.color) ?? DEFAULT_COLOR;
|
|
143
|
+
accent = [srgbToLinear(rgb[0]), srgbToLinear(rgb[1]), srgbToLinear(rgb[2])];
|
|
144
|
+
}
|
|
145
|
+
const count = frame.cols * frame.rows;
|
|
146
|
+
ensureHeat(count);
|
|
147
|
+
for (let i = 0; i < count; i++) scaled[i] = (frame.heat[i] ?? 0) * frame.intensity;
|
|
148
|
+
f32[0] = frame.width;
|
|
149
|
+
f32[1] = frame.height;
|
|
150
|
+
f32[2] = frame.pitch;
|
|
151
|
+
f32[3] = frame.tile;
|
|
152
|
+
f32[4] = frame.halo.x;
|
|
153
|
+
f32[5] = frame.halo.y;
|
|
154
|
+
f32[6] = frame.halo.r;
|
|
155
|
+
f32[7] = frame.halo.fade * frame.intensity;
|
|
156
|
+
f32[8] = accent[0];
|
|
157
|
+
f32[9] = accent[1];
|
|
158
|
+
f32[10] = accent[2];
|
|
159
|
+
f32[11] = MOSAIC_GLOW_HDR_PEAK;
|
|
160
|
+
u32[12] = frame.cols;
|
|
161
|
+
u32[13] = frame.rows;
|
|
162
|
+
device.queue.writeBuffer(uniform, 0, uniformData);
|
|
163
|
+
if (heatBuffer && count) device.queue.writeBuffer(heatBuffer, 0, scaled, 0, count);
|
|
164
|
+
const encoder = device.createCommandEncoder();
|
|
165
|
+
const pass = encoder.beginRenderPass({
|
|
166
|
+
colorAttachments: [
|
|
167
|
+
{
|
|
168
|
+
view: context.getCurrentTexture().createView(),
|
|
169
|
+
clearValue: { r: 0, g: 0, b: 0, a: 0 },
|
|
170
|
+
loadOp: "clear",
|
|
171
|
+
storeOp: "store"
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
});
|
|
175
|
+
if (bindGroup && count) {
|
|
176
|
+
pass.setPipeline(pipeline);
|
|
177
|
+
pass.setBindGroup(0, bindGroup);
|
|
178
|
+
pass.draw(3);
|
|
179
|
+
}
|
|
180
|
+
pass.end();
|
|
181
|
+
device.queue.submit([encoder.finish()]);
|
|
182
|
+
},
|
|
183
|
+
destroy() {
|
|
184
|
+
destroyed = true;
|
|
185
|
+
try {
|
|
186
|
+
context.unconfigure();
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
heatBuffer?.destroy();
|
|
190
|
+
device.destroy();
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
} catch {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
export {
|
|
198
|
+
MOSAIC_GLOW_HDR_PEAK,
|
|
199
|
+
startMosaicGlowHdr
|
|
200
|
+
};
|
|
@@ -15,8 +15,10 @@ export interface NavbarLinkProps {
|
|
|
15
15
|
external?: boolean;
|
|
16
16
|
/** Strips the link out of the click and keyboard-activation paths. */
|
|
17
17
|
disabled?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/** Click handler. Never called while `disabled`. `@click` reaches it. */
|
|
19
|
+
onClick?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
|
|
20
|
+
/** @deprecated Use `@click` / `onClick`. Only called when `onClick` is absent. */
|
|
21
|
+
onclick?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
|
|
20
22
|
/** Additional CSS classes */
|
|
21
23
|
class?: HTMLAttributes["class"];
|
|
22
24
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./NavbarLink.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const NavbarLink = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const NavbarLink = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6e312779"]]);
|
|
5
5
|
export {
|
|
6
6
|
NavbarLink as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, computed, createElementBlock, openBlock,
|
|
1
|
+
import { defineComponent, useTemplateRef, computed, createElementBlock, openBlock, mergeProps, renderSlot, createCommentVNode, toDisplayString } from "vue";
|
|
2
|
+
import { callListener } from "../../internals/call-listener.js";
|
|
2
3
|
import { cn } from "../../utils.js";
|
|
3
4
|
import { useSoundCue } from "../../sound/use-sound.js";
|
|
4
5
|
const _hoisted_1 = ["href", "target", "rel", "aria-current", "aria-disabled", "tabindex"];
|
|
@@ -14,7 +15,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14
15
|
current: { type: Boolean, default: false },
|
|
15
16
|
external: { type: Boolean, default: false },
|
|
16
17
|
disabled: { type: Boolean, default: false },
|
|
17
|
-
|
|
18
|
+
onClick: { type: [Function, Array] },
|
|
19
|
+
onclick: { type: [Function, Array] },
|
|
18
20
|
class: { type: [Boolean, null, String, Object, Array] },
|
|
19
21
|
sound: { type: Boolean, default: false }
|
|
20
22
|
},
|
|
@@ -37,24 +39,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
41
|
if (!__props.current) playCue("select");
|
|
40
|
-
__props.onclick
|
|
42
|
+
callListener(__props.onClick ?? __props.onclick, event);
|
|
41
43
|
}
|
|
42
44
|
return (_ctx, _cache) => {
|
|
43
|
-
return openBlock(), createElementBlock("a", {
|
|
45
|
+
return openBlock(), createElementBlock("a", mergeProps({
|
|
44
46
|
ref_key: "el",
|
|
45
47
|
ref: el,
|
|
46
|
-
href: __props.disabled ? void 0 : __props.href,
|
|
47
|
-
target: __props.external ? "_blank" : void 0,
|
|
48
|
-
rel: __props.external ? "noopener noreferrer" : void 0,
|
|
49
|
-
"aria-current": __props.current ? "page" : void 0,
|
|
50
|
-
"aria-disabled": __props.disabled ? "true" : void 0,
|
|
51
|
-
tabindex: __props.disabled ? -1 : void 0,
|
|
52
|
-
class: normalizeClass(classes.value),
|
|
53
48
|
onClick: handleClick
|
|
54
|
-
},
|
|
49
|
+
}, _ctx.$attrs, {
|
|
50
|
+
href: __props.disabled ? void 0 : __props.href,
|
|
51
|
+
target: __props.external ? "_blank" : _ctx.$attrs.target,
|
|
52
|
+
rel: __props.external ? "noopener noreferrer" : _ctx.$attrs.rel,
|
|
53
|
+
"aria-current": __props.current ? "page" : _ctx.$attrs["aria-current"],
|
|
54
|
+
"aria-disabled": __props.disabled ? "true" : _ctx.$attrs["aria-disabled"],
|
|
55
|
+
tabindex: __props.disabled ? -1 : _ctx.$attrs.tabindex,
|
|
56
|
+
class: classes.value
|
|
57
|
+
}), [
|
|
55
58
|
renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
56
59
|
__props.external ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(" ") + "(opens in a new tab)")) : createCommentVNode("", true)
|
|
57
|
-
],
|
|
60
|
+
], 16, _hoisted_1);
|
|
58
61
|
};
|
|
59
62
|
}
|
|
60
63
|
});
|