fancy-ui-vue 0.1.1 → 0.3.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 +40 -13
- 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/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/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/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/typing-indicator/TypingIndicator.vue.js +1 -1
- package/dist/components/typing-indicator/TypingIndicator.vue2.js +7 -6
- package/dist/index.d.ts +6 -0
- package/dist/index.js +440 -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 +974 -571
- package/package.json +2 -2
- package/tailwind.css +9 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, createElementBlock, openBlock,
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, mergeProps, unref, renderSlot, createCommentVNode, createElementVNode } from "vue";
|
|
2
2
|
import { cn } from "../../utils.js";
|
|
3
3
|
import { useSoundCue } from "../../sound/use-sound.js";
|
|
4
4
|
const _hoisted_1 = ["href", "target", "aria-label", "rel"];
|
|
@@ -41,14 +41,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
41
|
playCue("press");
|
|
42
42
|
}
|
|
43
43
|
return (_ctx, _cache) => {
|
|
44
|
-
return openBlock(), createElementBlock("a", {
|
|
44
|
+
return openBlock(), createElementBlock("a", mergeProps({ onClick: handleClick }, _ctx.$attrs, {
|
|
45
45
|
href: __props.href,
|
|
46
46
|
target: __props.target,
|
|
47
47
|
"aria-label": __props.ariaLabel,
|
|
48
48
|
rel: relValue.value,
|
|
49
|
-
class:
|
|
50
|
-
|
|
51
|
-
}, [
|
|
49
|
+
class: unref(cn)("link-hover", `link-hover--${__props.variant}`, __props.class)
|
|
50
|
+
}), [
|
|
52
51
|
needsSpan.value ? (openBlock(), createElementBlock("span", _hoisted_2, [
|
|
53
52
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
54
53
|
])) : renderSlot(_ctx.$slots, "default", {}, void 0, true, 1),
|
|
@@ -63,7 +62,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
63
62
|
pathLength: "1"
|
|
64
63
|
}, null, -1)
|
|
65
64
|
])])) : createCommentVNode("", true)
|
|
66
|
-
],
|
|
65
|
+
], 16, _hoisted_1);
|
|
67
66
|
};
|
|
68
67
|
}
|
|
69
68
|
});
|
|
@@ -15,8 +15,10 @@ export interface LinkProps {
|
|
|
15
15
|
* required whenever `target` opens a new browsing context — any value other than
|
|
16
16
|
* `_self`, `_parent`, or `_top` (case-insensitively), not just `_blank` */
|
|
17
17
|
rel?: string;
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/** Click handler, called after the sound cue. `@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 "./Link.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const Link = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const Link = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-615ee652"]]);
|
|
5
5
|
export {
|
|
6
6
|
Link 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, Fragment, createElementVNode, toDisplayString } from "vue";
|
|
2
|
+
import { callListener } from "../../internals/call-listener.js";
|
|
2
3
|
import { cn } from "../../utils.js";
|
|
3
4
|
import { sound } from "../../sound/sound.js";
|
|
4
5
|
const _hoisted_1 = ["href", "target", "rel"];
|
|
@@ -12,7 +13,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12
13
|
underline: { default: "hover" },
|
|
13
14
|
target: {},
|
|
14
15
|
rel: {},
|
|
15
|
-
|
|
16
|
+
onClick: { type: [Function, Array] },
|
|
17
|
+
onclick: { type: [Function, Array] },
|
|
16
18
|
class: { type: [Boolean, null, String, Object, Array] },
|
|
17
19
|
sound: { type: Boolean, default: false }
|
|
18
20
|
},
|
|
@@ -41,18 +43,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
43
|
);
|
|
42
44
|
function handleClick(event) {
|
|
43
45
|
if (__props.sound) sound.play("press");
|
|
44
|
-
__props.onclick
|
|
46
|
+
callListener(__props.onClick ?? __props.onclick, event);
|
|
45
47
|
}
|
|
46
48
|
return (_ctx, _cache) => {
|
|
47
|
-
return openBlock(), createElementBlock("a", {
|
|
49
|
+
return openBlock(), createElementBlock("a", mergeProps({
|
|
48
50
|
ref_key: "el",
|
|
49
51
|
ref: el,
|
|
52
|
+
onClick: handleClick
|
|
53
|
+
}, _ctx.$attrs, {
|
|
50
54
|
href: __props.href,
|
|
51
55
|
target: computedTarget.value,
|
|
52
56
|
rel: computedRel.value,
|
|
53
|
-
class:
|
|
54
|
-
|
|
55
|
-
}, [
|
|
57
|
+
class: classes.value
|
|
58
|
+
}), [
|
|
56
59
|
renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
57
60
|
__props.external ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
58
61
|
_cache[0] || (_cache[0] = createElementVNode("svg", {
|
|
@@ -72,7 +75,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
72
75
|
], -1)),
|
|
73
76
|
_cache[1] || (_cache[1] = createElementVNode("span", { class: "sr-only" }, toDisplayString(" ") + "(opens in a new tab)", -1))
|
|
74
77
|
], 64)) : createCommentVNode("", true)
|
|
75
|
-
],
|
|
78
|
+
], 16, _hoisted_1);
|
|
76
79
|
};
|
|
77
80
|
}
|
|
78
81
|
});
|
|
@@ -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
|
});
|
|
@@ -55,6 +55,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
55
55
|
if (!listEl.value) return [];
|
|
56
56
|
return Array.from(listEl.value.querySelectorAll("[data-ft-nav-trigger]"));
|
|
57
57
|
}
|
|
58
|
+
function navigableTriggers() {
|
|
59
|
+
return triggerButtons().filter((el2) => !el2.disabled);
|
|
60
|
+
}
|
|
58
61
|
function getTriggerElement(itemValue) {
|
|
59
62
|
return triggerButtons().find((el2) => el2.dataset.value === itemValue) ?? null;
|
|
60
63
|
}
|
|
@@ -125,7 +128,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
130
|
function move(from, delta) {
|
|
128
|
-
const buttons =
|
|
131
|
+
const buttons = navigableTriggers();
|
|
129
132
|
if (buttons.length === 0) return;
|
|
130
133
|
const fromIndex = buttons.findIndex((el2) => el2.dataset.value === from);
|
|
131
134
|
const base = fromIndex === -1 ? 0 : fromIndex;
|
|
@@ -133,7 +136,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
133
136
|
goTo(buttons[nextIndex]);
|
|
134
137
|
}
|
|
135
138
|
function moveToEdge(edge) {
|
|
136
|
-
const buttons =
|
|
139
|
+
const buttons = navigableTriggers();
|
|
137
140
|
if (buttons.length === 0) return;
|
|
138
141
|
goTo(edge === "first" ? buttons[0] : buttons[buttons.length - 1]);
|
|
139
142
|
}
|
|
@@ -157,7 +160,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
157
160
|
}
|
|
158
161
|
if (order.length === 0) return null;
|
|
159
162
|
if (value.value !== "" && order.includes(value.value)) return value.value;
|
|
160
|
-
return
|
|
163
|
+
return navigableTriggers()[0]?.dataset.value ?? order[0];
|
|
161
164
|
},
|
|
162
165
|
get pendingFocusValue() {
|
|
163
166
|
return pendingFocusValue.value;
|