@mkbabb/glass-ui 3.10.1 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CardAction-DrAcAV4d.js → CardAction-DuArVky-.js} +2 -2
- package/dist/{CommandShortcut-mV2e1aG6.js → CommandShortcut-CefCj5mt.js} +2 -2
- package/dist/{DataTable-C3E6jZ5B.js → DataTable-CUHMukiQ.js} +2 -2
- package/dist/DeckProgress-Dmk4_AKN.js +23 -0
- package/dist/{DialogContent-BxaaafFi.js → DialogContent-BRkT1cjP.js} +1 -1
- package/dist/{HoverPopover-CDA_SaCe.js → HoverPopover-2LOIW34a.js} +1 -1
- package/dist/InstrumentRail-CUJ05YVG.js +44 -0
- package/dist/{MetricBadge-idgrkqoP.js → MetricBadge-BZVWIxNy.js} +7 -5
- package/dist/{Notification-Cu0nN17_.js → Notification-DLMhblXR.js} +1 -1
- package/dist/{NumberFieldContent-CHEWghnY.js → NumberFieldContent-BbLOh8RU.js} +2 -2
- package/dist/{PopoverContent-DpUvdYY-.js → PopoverContent-BId6ggf_.js} +1 -1
- package/dist/{Progress-BW-StFw2.js → Progress-iEuD9pxG.js} +1 -1
- package/dist/{ScrollingText-DruYCni_.js → ScrollingText-BPP84wKo.js} +1 -1
- package/dist/{SelectScrollDownButton-pirzjm--.js → SelectScrollDownButton-T32cVFeM.js} +3 -3
- package/dist/{Switch-DeAqg6pi.js → Switch-Ch-k3Rv-.js} +1 -1
- package/dist/{TabsList-BAVzOZpg.js → TabsList-B8CVOQPC.js} +2 -2
- package/dist/{Toaster-CvuuW_y9.js → Toaster-1rYWrmAm.js} +46 -49
- package/dist/{ToggleGroupItem-DtD37b4G.js → ToggleGroupItem-COu_4IW4.js} +21 -17
- package/dist/animated-digit.js +2 -2
- package/dist/api/index.d.ts +5 -4
- package/dist/api.js +2 -2
- package/dist/aurora.js +70 -70
- package/dist/{badge-NdCQMvvB.js → badge-CaoFJzRb.js} +1 -1
- package/dist/badge.js +1 -1
- package/dist/{button-DyiWFAOE.js → button-DN39cGqL.js} +12 -12
- package/dist/button.js +1 -1
- package/dist/canvas.js +2 -2
- package/dist/card.js +1 -1
- package/dist/carousel.js +5 -5
- package/dist/collapsible.js +1 -1
- package/dist/{color-B65wWyQz.js → color-C5ls_QF7.js} +7 -9
- package/dist/color.js +1 -1
- package/dist/command.js +1 -1
- package/dist/components/custom/aurora/constants/presets.d.ts +62 -5
- package/dist/components/custom/aurora/constants/shaders/mediums.glsl.d.ts +1 -1
- package/dist/components/custom/aurora/index.d.ts +1 -1
- package/dist/components/custom/constellation/Constellation.vue.d.ts +0 -12
- package/dist/components/custom/constellation/constellationField.d.ts +151 -10
- package/dist/components/custom/constellation/index.d.ts +1 -3
- package/dist/components/custom/controls/DarkModeToggle.vue.d.ts +0 -11
- package/dist/components/custom/deck-progress/DeckProgress.vue.d.ts +27 -0
- package/dist/components/custom/deck-progress/index.d.ts +2 -0
- package/dist/components/custom/dialog-native/GlassDialogNative.vue.d.ts +57 -0
- package/dist/components/custom/dialog-native/index.d.ts +1 -0
- package/dist/components/custom/dock/DockTabButton.vue.d.ts +4 -3
- package/dist/components/custom/dock/GlassDock.vue.d.ts +115 -3
- package/dist/components/custom/dock/composables/dockMorphContext.d.ts +0 -36
- package/dist/components/custom/dock/composables/useLayerTransition.d.ts +0 -44
- package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +37 -5
- package/dist/components/custom/fourier-field/index.d.ts +1 -1
- package/dist/components/custom/fourier-field/math.d.ts +0 -17
- package/dist/components/custom/glass-panel/GlassPanel.vue.d.ts +41 -0
- package/dist/components/custom/glass-panel/index.d.ts +2 -0
- package/dist/components/custom/goo-blob/composables/useBlobPointer.d.ts +3 -4
- package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +8 -11
- package/dist/components/custom/handmark/HandMark.vue.d.ts +29 -0
- package/dist/components/custom/handmark/brush.d.ts +242 -0
- package/dist/components/custom/handmark/freehand.d.ts +69 -0
- package/dist/components/custom/handmark/geometry.d.ts +50 -0
- package/dist/components/custom/handmark/index.d.ts +21 -0
- package/dist/components/custom/handmark/ink.d.ts +11 -0
- package/dist/components/custom/handmark/texture.d.ts +39 -0
- package/dist/components/custom/handmark/types.d.ts +53 -0
- package/dist/components/custom/handmark/useHandMark.d.ts +87 -0
- package/dist/components/custom/header-ribbon/HeaderRibbon.vue.d.ts +31 -0
- package/dist/components/custom/header-ribbon/index.d.ts +2 -0
- package/dist/components/custom/header-ribbon/types.d.ts +7 -0
- package/dist/components/custom/instrument-chassis/InstrumentChassis.vue.d.ts +2 -2
- package/dist/components/custom/instrument-rail/InstrumentRail.vue.d.ts +91 -0
- package/dist/components/custom/instrument-rail/index.d.ts +2 -0
- package/dist/components/custom/metric-badge/MetricBadge.vue.d.ts +8 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +2 -2
- package/dist/components/ui/slider/index.d.ts +19 -22
- package/dist/components/ui/toast/use-toast.d.ts +2 -2
- package/dist/components/ui/toggle/Toggle.vue.d.ts +1 -1
- package/dist/components/ui/toggle/index.d.ts +1 -1
- package/dist/components/ui/toggle-group/ToggleGroup.vue.d.ts +7 -1
- package/dist/components/ui/toggle-group/ToggleGroupItem.vue.d.ts +3 -1
- package/dist/components/ui/toggle-group/toggleGroupContext.d.ts +13 -0
- package/dist/composables/color/index.d.ts +0 -12
- package/dist/composables/dark/index.d.ts +1 -1
- package/dist/composables/dark/useGlobalDark.d.ts +21 -1
- package/dist/composables/glass/useSpecularTracking.d.ts +3 -12
- package/dist/composables/motion/core/index.d.ts +1 -0
- package/dist/composables/motion/index.d.ts +0 -2
- package/dist/composables/motion/useRouteTransition.d.ts +42 -0
- package/dist/composables/motion/useSpringMount.d.ts +1 -1
- package/dist/configurator.js +1 -1
- package/dist/confirm-dialog.js +2 -2
- package/dist/constellation.js +225 -260
- package/dist/controls.js +14 -48
- package/dist/dark.d.ts +1 -1
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/deck-progress.d.ts +1 -0
- package/dist/deck-progress.js +2 -0
- package/dist/dialog.js +2 -2
- package/dist/dock.js +345 -340
- package/dist/dockContext-BKeIMmNk.js +9 -0
- package/dist/{dropdown-menu-DVnQcA0E.js → dropdown-menu-D77jX6Df.js} +4 -7
- package/dist/dropdown-menu.js +1 -1
- package/dist/expandable-container.js +79 -38
- package/dist/forms.js +2 -2
- package/dist/fourier-field.js +102 -137
- package/dist/fourier-math.js +2 -2
- package/dist/glass-panel.d.ts +1 -0
- package/dist/glass-panel.js +44 -0
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +209 -287
- package/dist/goo-blob.js +212 -243
- package/dist/handmark.d.ts +1 -0
- package/dist/handmark.js +662 -0
- package/dist/header-ribbon.d.ts +1 -0
- package/dist/header-ribbon.js +63 -0
- package/dist/hover-popover.js +1 -1
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/instrument-rail.d.ts +1 -0
- package/dist/instrument-rail.js +2 -0
- package/dist/keyboard.js +1 -1
- package/dist/labeled-field.js +5 -5
- package/dist/{math-BUU9hHID.js → math-DTpRVC0e.js} +2 -18
- package/dist/metric-badge.js +1 -1
- package/dist/metric-stack.js +1 -1
- package/dist/motion-core.js +70 -69
- package/dist/motion.js +37 -38
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/{presets-1OhFpaIC.js → presets-BP_ALM0m.js} +14 -1
- package/dist/progress.js +1 -1
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +1 -1
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +6 -6
- package/dist/select.js +1 -1
- package/dist/{sheet-ChSXcJpU.js → sheet-VZEtNFvO.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-sfl8gFDD.js → slider-ClgpP7EB.js} +4 -4
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +2 -2
- package/dist/stacked-icons.js +6 -6
- package/dist/styles/animations.css +111 -15
- package/dist/styles/components.css +1 -1
- package/dist/styles/dock/layer-group.css +0 -22
- package/dist/styles/dock/layers.css +1 -11
- package/dist/styles/dock/morph.css +19 -95
- package/dist/styles/dock/shell.css +0 -12
- package/dist/styles/dock-controls.css +31 -28
- package/dist/styles/drawer.css +0 -2
- package/dist/styles/floating-panel.css +0 -2
- package/dist/styles/glass-refract.css +0 -2
- package/dist/styles/glass.css +1188 -31
- package/dist/styles/hover-popover.css +0 -2
- package/dist/styles/index.css +6 -24
- package/dist/styles/instrument-chassis.css +0 -4
- package/dist/styles/paper.css +68 -2
- package/dist/styles/theme.css +20 -13
- package/dist/styles/tokens.css +2360 -22
- package/dist/styles/typography.css +6 -18
- package/dist/styles/utilities.css +1291 -19
- package/dist/styles/view-transition.css +51 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +98 -98
- package/dist/timeline.js +2 -2
- package/dist/toast.js +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{useAnimatedNumber-DfVgP4te.js → useAnimatedNumber-Bcpy5Etf.js} +1 -1
- package/dist/{useConfiguratorState-BdQXh9ie.js → useConfiguratorState-DxAqksK6.js} +1 -1
- package/dist/useGlassRenderer-D7YGOYiM.js +69 -0
- package/dist/{useGlobalDark-D7R9OypB.js → useGlobalDark-D1wgEqfW.js} +21 -2
- package/dist/useSpecularTracking-BVRZsRHA.js +26 -0
- package/dist/useSpringMount-BJSHcLl3.js +113 -0
- package/dist/useViewTransition-DaN5Zrox.js +21 -0
- package/dist/vReveal-zUIQk-rJ.js +53 -0
- package/dist/watercolor-dot.js +2 -2
- package/package.json +57 -33
- package/src/styles/animations.css +111 -15
- package/src/styles/dock/layer-group.css +0 -22
- package/src/styles/dock/layers.css +1 -11
- package/src/styles/dock/morph.css +19 -95
- package/src/styles/dock/shell.css +0 -12
- package/src/styles/dock-controls.css +31 -28
- package/src/styles/glass.css +1188 -31
- package/src/styles/index.css +6 -24
- package/src/styles/paper.css +68 -2
- package/src/styles/theme.css +20 -13
- package/src/styles/tokens.css +2360 -22
- package/src/styles/typography.css +6 -18
- package/src/styles/utilities.css +1291 -19
- package/src/styles/view-transition.css +51 -0
- package/dist/components/custom/aurora/constants/shaders/vangogh-medium.glsl.d.ts +0 -1
- package/dist/components/custom/constellation/composables/createConstellationField.d.ts +0 -35
- package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +0 -35
- package/dist/components/custom/constellation/constants.d.ts +0 -36
- package/dist/components/custom/constellation/constellationDraw.d.ts +0 -18
- package/dist/components/custom/constellation/constellationInteraction.d.ts +0 -102
- package/dist/components/custom/dock/composables/useDockMorphWindow.d.ts +0 -15
- package/dist/components/custom/dock/composables/useDockShellProps.d.ts +0 -131
- package/dist/components/custom/dock/constants.d.ts +0 -23
- package/dist/components/custom/fourier-field/presets.d.ts +0 -54
- package/dist/components/custom/goo-blob/composables/buildMetaballProgram.d.ts +0 -18
- package/dist/components/custom/goo-blob/composables/uploadBlobUniforms.d.ts +0 -41
- package/dist/components/custom/goo-blob/constants.d.ts +0 -52
- package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +0 -1
- package/dist/components/custom/tabs/constants.d.ts +0 -12
- package/dist/components/custom/underline/GlassUnderline.vue.d.ts +0 -84
- package/dist/components/custom/underline/index.d.ts +0 -2
- package/dist/components/custom/underline/types.d.ts +0 -56
- package/dist/composables/motion/curves.d.ts +0 -48
- package/dist/composables/motion/springPresets.d.ts +0 -33
- package/dist/composables/motion/suite.d.ts +0 -2
- package/dist/dockContext-bho8B1A4.js +0 -17
- package/dist/motion-curves.d.ts +0 -1
- package/dist/motion-curves.js +0 -130
- package/dist/springPresets-aRSm-4_k.js +0 -40
- package/dist/styles/glass/a11y-fallback.css +0 -245
- package/dist/styles/glass/ladder.css +0 -304
- package/dist/styles/glass/material.css +0 -238
- package/dist/styles/glass/progress-rail.css +0 -78
- package/dist/styles/glass/squircle.css +0 -66
- package/dist/styles/glass/surfaces.css +0 -306
- package/dist/styles/tokens/color-radius.css +0 -250
- package/dist/styles/tokens/dark-arm.css +0 -194
- package/dist/styles/tokens/glass.css +0 -413
- package/dist/styles/tokens/light-dark.css +0 -158
- package/dist/styles/tokens/offsets-sizing.css +0 -406
- package/dist/styles/tokens/property-regs.css +0 -169
- package/dist/styles/tokens/scale-paper.css +0 -361
- package/dist/styles/tokens/scheme-motion.css +0 -334
- package/dist/styles/tokens/shadow.css +0 -132
- package/dist/styles/utilities/a11y-overrides.css +0 -140
- package/dist/styles/utilities/animate.css +0 -26
- package/dist/styles/utilities/base.css +0 -365
- package/dist/styles/utilities/btn.css +0 -399
- package/dist/styles/utilities/components.css +0 -317
- package/dist/underline.d.ts +0 -1
- package/dist/underline.js +0 -85
- package/dist/useSpecularTracking-DFK_fhpG.js +0 -32
- package/dist/useSpringMount-DXUzxBjV.js +0 -108
- package/dist/vReveal-CqaCz_mC.js +0 -44
- package/src/styles/glass/a11y-fallback.css +0 -245
- package/src/styles/glass/ladder.css +0 -304
- package/src/styles/glass/material.css +0 -238
- package/src/styles/glass/progress-rail.css +0 -78
- package/src/styles/glass/squircle.css +0 -66
- package/src/styles/glass/surfaces.css +0 -306
- package/src/styles/tokens/color-radius.css +0 -250
- package/src/styles/tokens/dark-arm.css +0 -194
- package/src/styles/tokens/glass.css +0 -413
- package/src/styles/tokens/light-dark.css +0 -158
- package/src/styles/tokens/offsets-sizing.css +0 -406
- package/src/styles/tokens/property-regs.css +0 -169
- package/src/styles/tokens/scale-paper.css +0 -361
- package/src/styles/tokens/scheme-motion.css +0 -334
- package/src/styles/tokens/shadow.css +0 -132
- package/src/styles/utilities/a11y-overrides.css +0 -140
- package/src/styles/utilities/animate.css +0 -26
- package/src/styles/utilities/base.css +0 -365
- package/src/styles/utilities/btn.css +0 -399
- package/src/styles/utilities/components.css +0 -317
- /package/dist/{CollapsibleContent-Drow5WkV.js → CollapsibleContent-CP9qF1v4.js} +0 -0
- /package/dist/{DialogFooter-DufLHi0y.js → DialogFooter-Gprw8H_A.js} +0 -0
- /package/dist/{IconTooltip-BrQ5p181.js → IconTooltip-Cus0fvK0.js} +0 -0
- /package/dist/{Input-B-F818RU.js → Input-xuDwALQR.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-DWghtRt7.js → _plugin-vue_export-helper-ok8pgSl5.js} +0 -0
- /package/dist/{compile-Ce_V55zi.js → compile-BOXjLUxu.js} +0 -0
- /package/dist/{constants-C8NMonuo.js → constants-yKeKnE84.js} +0 -0
- /package/dist/{prng-CjVgzjQT.js → prng-D27-B3tK.js} +0 -0
- /package/dist/{resolveCanvasColor-CRvVzOvP.js → resolveCanvasColor-BBiYfp8g.js} +0 -0
- /package/dist/{useCanvas2D-CSeH8h16.js → useCanvas2D-ClrQuZtp.js} +0 -0
- /package/dist/{useIntersectionPause-DAdVPVp4.js → useIntersectionPause-Cck5Uxk8.js} +0 -0
- /package/dist/{useInterval-D3USn0yc.js → useInterval-Dsmqwi03.js} +0 -0
- /package/dist/{useKeyboardShortcuts-i8tHd5WO.js → useKeyboardShortcuts-CyIYrndH.js} +0 -0
- /package/dist/{useScrollProgress-CcgmgMQt.js → useScrollProgress-CffFGLa5.js} +0 -0
- /package/dist/{useSortable-DnyGXKKY.js → useSortable-C8ReQ50P.js} +0 -0
- /package/dist/{useTextHighlight-B3b10W6r.js → useTextHighlight-CWEi25hf.js} +0 -0
package/dist/constellation.js
CHANGED
|
@@ -1,33 +1,41 @@
|
|
|
1
1
|
import { t as e } from "./cn-DJXf4yaB.js";
|
|
2
|
-
import { t } from "./useCanvas2D-
|
|
3
|
-
import { t as n } from "./_plugin-vue_export-helper-
|
|
4
|
-
import { n as r, t as i } from "./prng-
|
|
2
|
+
import { t } from "./useCanvas2D-ClrQuZtp.js";
|
|
3
|
+
import { t as n } from "./_plugin-vue_export-helper-ok8pgSl5.js";
|
|
4
|
+
import { n as r, t as i } from "./prng-D27-B3tK.js";
|
|
5
5
|
import { computed as a, createElementBlock as o, createElementVNode as s, defineComponent as c, getCurrentInstance as l, normalizeClass as u, onMounted as d, openBlock as f, ref as p, unref as m, useTemplateRef as h } from "vue";
|
|
6
|
-
//#region src/components/custom/constellation/
|
|
7
|
-
var g = 1280, _ = {
|
|
6
|
+
//#region src/components/custom/constellation/constellationField.ts
|
|
7
|
+
var g = 1280, _ = 8e3, v = 8e3, y = {
|
|
8
8
|
node: "#b4afa3",
|
|
9
9
|
nodeDim: "#cdc8bd",
|
|
10
10
|
line: "#1c1714",
|
|
11
11
|
edgeAlpha: .22,
|
|
12
12
|
edgeFocusAlpha: .34,
|
|
13
|
-
alpha: .
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
alpha: .84
|
|
14
|
+
};
|
|
15
|
+
function b(e) {
|
|
16
|
+
if (typeof window > "u") return { ...y };
|
|
17
|
+
let t = getComputedStyle(e), n = (e, n) => t.getPropertyValue(e).trim() || n, r = (e, n) => {
|
|
18
|
+
let r = t.getPropertyValue(e).trim();
|
|
19
|
+
if (!r) return n;
|
|
20
|
+
let i = Number.parseFloat(r);
|
|
21
|
+
return Number.isFinite(i) ? i : n;
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
node: n("--constellation-node", y.node),
|
|
25
|
+
nodeDim: n("--constellation-node-dim", y.nodeDim),
|
|
26
|
+
line: n("--constellation-line", y.line),
|
|
27
|
+
edgeAlpha: r("--constellation-edge-alpha", y.edgeAlpha),
|
|
28
|
+
edgeFocusAlpha: r("--constellation-edge-focus-alpha", y.edgeFocusAlpha),
|
|
29
|
+
alpha: r("--constellation-alpha", y.alpha)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function x(e) {
|
|
25
33
|
let t = {
|
|
26
|
-
response:
|
|
34
|
+
response: A,
|
|
27
35
|
zeta: 1
|
|
28
|
-
}, n = { ...
|
|
29
|
-
minIdle:
|
|
30
|
-
jitter:
|
|
36
|
+
}, n = { ...N }, r = {
|
|
37
|
+
minIdle: _,
|
|
38
|
+
jitter: v
|
|
31
39
|
};
|
|
32
40
|
if (typeof window > "u") return {
|
|
33
41
|
warp: t,
|
|
@@ -40,19 +48,61 @@ function C(e) {
|
|
|
40
48
|
let r = Number.parseFloat(n);
|
|
41
49
|
return Number.isFinite(r) ? r : t;
|
|
42
50
|
};
|
|
43
|
-
return t.response = a("--constellation-warp-response",
|
|
51
|
+
return t.response = a("--constellation-warp-response", A), t.zeta = a("--constellation-warp-zeta", 1), n.gain = a("--constellation-well-gain", N.gain), n.reach = a("--constellation-well-reach", N.reach), n.ramp = a("--constellation-well-ramp", N.ramp), n.maxSpeed = a("--constellation-well-max-speed", N.maxSpeed), n.holdMs = a("--constellation-well-hold-ms", N.holdMs), r.minIdle = a("--constellation-wander-idle", _), r.jitter = a("--constellation-wander-jitter", v), {
|
|
44
52
|
warp: t,
|
|
45
53
|
well: n,
|
|
46
54
|
wander: r
|
|
47
55
|
};
|
|
48
56
|
}
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
function S(e, t, n, r, i) {
|
|
58
|
+
let a = [];
|
|
59
|
+
for (let o = 0; o < t; o++) {
|
|
60
|
+
let t = e() * Math.PI * 2;
|
|
61
|
+
a.push({
|
|
62
|
+
x: e() * n,
|
|
63
|
+
y: e() * r,
|
|
64
|
+
vx: Math.cos(t) * i,
|
|
65
|
+
vy: Math.sin(t) * i,
|
|
66
|
+
r: 1.6 + e() * 1.6,
|
|
67
|
+
dim: e() < .45
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return a;
|
|
71
|
+
}
|
|
72
|
+
function C(e, t, n) {
|
|
73
|
+
if (!(t > 0) || !(n > 0) || t === e.w && n === e.h) return;
|
|
74
|
+
let r = e.w / t, i = e.h / n;
|
|
75
|
+
for (let t of e.nodes) t.x *= r, t.y *= i;
|
|
76
|
+
e.warp.x *= r, e.warp.y *= i;
|
|
77
|
+
}
|
|
78
|
+
function w(e, t, n, r, i = 0, a = 0, o = Math.random) {
|
|
79
|
+
let { nodes: s, w: c, h: l } = e;
|
|
80
|
+
for (let e = 0; e < s.length; e++) {
|
|
81
|
+
let n = s[e];
|
|
82
|
+
n.x += n.vx * t, n.y += n.vy * t, n.x < 0 ? (n.x = 0, n.vx *= -1) : n.x > c && (n.x = c, n.vx *= -1), n.y < 0 ? (n.y = 0, n.vy *= -1) : n.y > l && (n.y = l, n.vy *= -1);
|
|
83
|
+
}
|
|
84
|
+
if (r && r.x >= 0) {
|
|
85
|
+
let e = 180 * t;
|
|
86
|
+
for (let t = 0; t < s.length; t++) {
|
|
87
|
+
let i = s[t], a = r.x - i.x, o = r.y - i.y, c = Math.hypot(a, o);
|
|
88
|
+
if (c > .5 && c < e) {
|
|
89
|
+
let t = Math.hypot(i.vx, i.vy) || n, r = (1 - c / e) * .08, s = i.vx + a / c * r * t, l = i.vy + o / c * r * t, u = Math.hypot(s, l) || 1;
|
|
90
|
+
i.vx = s / u * t, i.vy = l / u * t;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (k(e, t, n, i), F(e, i), e.wander && a > 0) {
|
|
95
|
+
let t = e.wander;
|
|
96
|
+
t.nextAt < 0 ? t.nextAt = a + t.minIdle + o() * t.jitter : a >= t.nextAt && z(e) && (I(e, B(e, o)), t.nextAt = a + t.minIdle + o() * t.jitter);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
var T = .001, E = 1.5, D = 7, O = 22;
|
|
100
|
+
function k(e, t, n, r) {
|
|
51
101
|
let i = e.well;
|
|
52
102
|
if (!i || !(r > 0)) return;
|
|
53
|
-
let a = Math.min(r,
|
|
54
|
-
i.strength += (i.target - i.strength) * c, i.strength <
|
|
55
|
-
let { nodes: l } = e, u = o.reach * t, d = u * u, f = o.maxSpeed * t, p = i.target > 0 ?
|
|
103
|
+
let a = Math.min(r, M), o = i.cfg, s = i.target > 0 ? o.ramp : O, c = Math.min(s * a, 1);
|
|
104
|
+
i.strength += (i.target - i.strength) * c, i.strength < T && (i.strength = i.target <= 0 ? 0 : i.strength);
|
|
105
|
+
let { nodes: l } = e, u = o.reach * t, d = u * u, f = o.maxSpeed * t, p = i.target > 0 ? E : D, m = Math.min(p * a, 1), h = i.strength > T && i.x >= 0;
|
|
56
106
|
for (let e = 0; e < l.length; e++) {
|
|
57
107
|
let t = l[e];
|
|
58
108
|
if (h) {
|
|
@@ -69,8 +119,15 @@ function O(e, t, n, r) {
|
|
|
69
119
|
}
|
|
70
120
|
}
|
|
71
121
|
}
|
|
72
|
-
var
|
|
73
|
-
|
|
122
|
+
var A = .55, j = 1, M = .05, N = {
|
|
123
|
+
gain: 14e3,
|
|
124
|
+
reach: 340,
|
|
125
|
+
ramp: 4,
|
|
126
|
+
maxSpeed: 4,
|
|
127
|
+
soften: 8,
|
|
128
|
+
holdMs: 140
|
|
129
|
+
};
|
|
130
|
+
function P(e, t, n, r = -1) {
|
|
74
131
|
let { nodes: i } = e, a = -1, o = Infinity;
|
|
75
132
|
for (let e = 0; e < i.length; e++) {
|
|
76
133
|
if (e === r) continue;
|
|
@@ -79,13 +136,13 @@ function A(e, t, n, r = -1) {
|
|
|
79
136
|
}
|
|
80
137
|
return a;
|
|
81
138
|
}
|
|
82
|
-
function
|
|
139
|
+
function F(e, t) {
|
|
83
140
|
let { warp: n, nodes: r } = e;
|
|
84
141
|
if (!n || n.targetIdx < 0 || n.targetIdx >= r.length || !(t > 0)) return;
|
|
85
|
-
let i = Math.min(t,
|
|
142
|
+
let i = Math.min(t, M), a = e.warpCfg?.response ?? .55, o = e.warpCfg?.zeta ?? 1, s = 2 * Math.PI / a, c = r[n.targetIdx], l = -2 * o * s * n.vx - s * s * (n.x - c.x), u = -2 * o * s * n.vy - s * s * (n.y - c.y);
|
|
86
143
|
n.vx += l * i, n.vy += u * i, n.x += n.vx * i, n.y += n.vy * i;
|
|
87
144
|
}
|
|
88
|
-
function
|
|
145
|
+
function I(e, t) {
|
|
89
146
|
let { warp: n, nodes: r } = e;
|
|
90
147
|
if (t < 0 || t >= r.length) {
|
|
91
148
|
n.targetIdx = -1, e.focalIndex = -1;
|
|
@@ -93,20 +150,20 @@ function M(e, t) {
|
|
|
93
150
|
}
|
|
94
151
|
e.focalIndex = t, n.targetIdx = t;
|
|
95
152
|
}
|
|
96
|
-
function
|
|
97
|
-
let r =
|
|
153
|
+
function L(e, t, n) {
|
|
154
|
+
let r = P(e, t, n, -1);
|
|
98
155
|
if (r >= 0 && r === e.focalIndex) return e.focalIndex;
|
|
99
|
-
let i =
|
|
100
|
-
return i < 0 ? -1 : (
|
|
156
|
+
let i = P(e, t, n, e.focalIndex);
|
|
157
|
+
return i < 0 ? -1 : (I(e, i), i);
|
|
101
158
|
}
|
|
102
|
-
var
|
|
103
|
-
function
|
|
159
|
+
var R = 24;
|
|
160
|
+
function z(e) {
|
|
104
161
|
let { warp: t, nodes: n } = e;
|
|
105
162
|
if (!t || t.targetIdx < 0 || t.targetIdx >= n.length) return !0;
|
|
106
163
|
let r = n[t.targetIdx];
|
|
107
|
-
return Math.hypot(t.x - r.x, t.y - r.y) <
|
|
164
|
+
return Math.hypot(t.x - r.x, t.y - r.y) < R;
|
|
108
165
|
}
|
|
109
|
-
function
|
|
166
|
+
function B(e, t) {
|
|
110
167
|
let n = e.nodes.length;
|
|
111
168
|
if (n <= 1) return e.focalIndex;
|
|
112
169
|
let r = e.focalIndex;
|
|
@@ -114,208 +171,58 @@ function I(e, t) {
|
|
|
114
171
|
let i = Math.floor(t() * (n - 1));
|
|
115
172
|
return i < r ? i : i + 1;
|
|
116
173
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
let
|
|
121
|
-
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
y: e() * r,
|
|
126
|
-
vx: Math.cos(t) * i,
|
|
127
|
-
vy: Math.sin(t) * i,
|
|
128
|
-
r: 1.6 + e() * 1.6,
|
|
129
|
-
dim: e() < .45
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
return a;
|
|
133
|
-
}
|
|
134
|
-
function R(e, t, n) {
|
|
135
|
-
if (!(t > 0) || !(n > 0) || t === e.w && n === e.h) return;
|
|
136
|
-
let r = e.w / t, i = e.h / n;
|
|
137
|
-
for (let t of e.nodes) t.x *= r, t.y *= i;
|
|
138
|
-
e.warp.x *= r, e.warp.y *= i;
|
|
139
|
-
}
|
|
140
|
-
function z(e, t, n, r, i = 0, a = 0, o = Math.random) {
|
|
141
|
-
let { nodes: s, w: c, h: l } = e;
|
|
142
|
-
for (let e = 0; e < s.length; e++) {
|
|
143
|
-
let n = s[e];
|
|
144
|
-
n.x += n.vx * t, n.y += n.vy * t, n.x < 0 ? (n.x = 0, n.vx *= -1) : n.x > c && (n.x = c, n.vx *= -1), n.y < 0 ? (n.y = 0, n.vy *= -1) : n.y > l && (n.y = l, n.vy *= -1);
|
|
145
|
-
}
|
|
146
|
-
if (r && r.x >= 0) {
|
|
147
|
-
let e = 180 * t;
|
|
148
|
-
for (let t = 0; t < s.length; t++) {
|
|
149
|
-
let i = s[t], a = r.x - i.x, o = r.y - i.y, c = Math.hypot(a, o);
|
|
150
|
-
if (c > .5 && c < e) {
|
|
151
|
-
let t = Math.hypot(i.vx, i.vy) || n, r = (1 - c / e) * .08, s = i.vx + a / c * r * t, l = i.vy + o / c * r * t, u = Math.hypot(s, l) || 1;
|
|
152
|
-
i.vx = s / u * t, i.vy = l / u * t;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (O(e, t, n, i), j(e, i), e.wander && a > 0) {
|
|
157
|
-
let t = e.wander;
|
|
158
|
-
t.nextAt < 0 ? t.nextAt = a + t.minIdle + o() * t.jitter : a >= t.nextAt && F(e) && (M(e, I(e, o)), t.nextAt = a + t.minIdle + o() * t.jitter);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
//#endregion
|
|
162
|
-
//#region src/components/custom/constellation/constellationDraw.ts
|
|
163
|
-
function B(e) {
|
|
164
|
-
if (typeof window > "u") return { ..._ };
|
|
165
|
-
let t = getComputedStyle(e), n = (e, n) => t.getPropertyValue(e).trim() || n, r = (e, n) => {
|
|
166
|
-
let r = t.getPropertyValue(e).trim();
|
|
167
|
-
if (!r) return n;
|
|
168
|
-
let i = Number.parseFloat(r);
|
|
169
|
-
return Number.isFinite(i) ? i : n;
|
|
170
|
-
};
|
|
171
|
-
return {
|
|
172
|
-
node: n("--constellation-node", _.node),
|
|
173
|
-
nodeDim: n("--constellation-node-dim", _.nodeDim),
|
|
174
|
-
line: n("--constellation-line", _.line),
|
|
175
|
-
edgeAlpha: r("--constellation-edge-alpha", _.edgeAlpha),
|
|
176
|
-
edgeFocusAlpha: r("--constellation-edge-focus-alpha", _.edgeFocusAlpha),
|
|
177
|
-
alpha: r("--constellation-alpha", _.alpha)
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
function V(e, t, n, r, i = 1) {
|
|
181
|
-
let { nodes: a, k: o } = t, s = n * o, c = s * s, l = r.edgeAlpha * r.alpha * i;
|
|
182
|
-
e.strokeStyle = r.line, e.lineWidth = 1 * o;
|
|
183
|
-
for (let t = 0; t < a.length; t++) {
|
|
184
|
-
let n = a[t];
|
|
185
|
-
for (let r = t + 1; r < a.length; r++) {
|
|
186
|
-
let t = a[r], i = n.x - t.x, o = n.y - t.y, s = i * i + o * o;
|
|
187
|
-
s > c || (e.globalAlpha = l * (1 - s / c), e.beginPath(), e.moveTo(n.x, n.y), e.lineTo(t.x, t.y), e.stroke());
|
|
174
|
+
function V(e, t, n, r) {
|
|
175
|
+
let { nodes: i, k: a } = t, o = n * a, s = o * o, c = r.edgeAlpha * r.alpha;
|
|
176
|
+
e.strokeStyle = r.line, e.lineWidth = 1 * a;
|
|
177
|
+
for (let t = 0; t < i.length; t++) {
|
|
178
|
+
let n = i[t];
|
|
179
|
+
for (let r = t + 1; r < i.length; r++) {
|
|
180
|
+
let t = i[r], a = n.x - t.x, o = n.y - t.y, l = a * a + o * o;
|
|
181
|
+
l > s || (e.globalAlpha = c * (1 - l / s), e.beginPath(), e.moveTo(n.x, n.y), e.lineTo(t.x, t.y), e.stroke());
|
|
188
182
|
}
|
|
189
183
|
}
|
|
190
184
|
e.globalAlpha = 1;
|
|
191
185
|
}
|
|
192
|
-
function H(e, t, n
|
|
193
|
-
let { nodes:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
e.fillStyle = r.dim ? n.nodeDim : n.node, e.beginPath(), e.arc(r.x, r.y, r.r * a, 0, Math.PI * 2), e.fill();
|
|
186
|
+
function H(e, t, n) {
|
|
187
|
+
let { nodes: r, k: i } = t;
|
|
188
|
+
for (let t = 0; t < r.length; t++) {
|
|
189
|
+
let a = r[t];
|
|
190
|
+
e.fillStyle = a.dim ? n.nodeDim : n.node, e.beginPath(), e.arc(a.x, a.y, a.r * i, 0, Math.PI * 2), e.fill();
|
|
198
191
|
}
|
|
199
|
-
e.globalAlpha = 1;
|
|
200
192
|
}
|
|
201
|
-
function U(e, t, n, r, i
|
|
193
|
+
function U(e, t, n, r, i) {
|
|
202
194
|
if (!i || i.x < 0) return;
|
|
203
|
-
let { nodes:
|
|
204
|
-
e.strokeStyle = r.line, e.lineWidth = 1 *
|
|
205
|
-
for (let t of
|
|
195
|
+
let { nodes: a, k: o } = t, s = n * o, c = s * s, l = r.edgeFocusAlpha * r.alpha;
|
|
196
|
+
e.strokeStyle = r.line, e.lineWidth = 1 * o;
|
|
197
|
+
for (let t of a) {
|
|
206
198
|
let n = t.x - i.x, r = t.y - i.y, a = n * n + r * r;
|
|
207
|
-
a >
|
|
199
|
+
a > c || (e.globalAlpha = (1 - a / c) * l, e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(t.x, t.y), e.stroke());
|
|
208
200
|
}
|
|
209
|
-
e.globalAlpha = .55
|
|
201
|
+
e.globalAlpha = .55, e.fillStyle = r.node, e.beginPath(), e.arc(i.x, i.y, 2.6 * o, 0, Math.PI * 2), e.fill(), e.globalAlpha = 1;
|
|
210
202
|
}
|
|
211
|
-
function W(e, t, n, r, i
|
|
212
|
-
let { k:
|
|
203
|
+
function W(e, t, n, r, i) {
|
|
204
|
+
let { k: a } = t;
|
|
213
205
|
e.strokeStyle = i.line;
|
|
214
206
|
for (let t = r.length - 1; t >= 0; t--) {
|
|
215
207
|
let i = r[t];
|
|
216
208
|
i.start < 0 && (i.start = n);
|
|
217
|
-
let
|
|
218
|
-
if (
|
|
209
|
+
let o = (n - i.start) / 900;
|
|
210
|
+
if (o >= 1) {
|
|
219
211
|
r.splice(t, 1);
|
|
220
212
|
continue;
|
|
221
213
|
}
|
|
222
|
-
e.globalAlpha = (1 -
|
|
214
|
+
e.globalAlpha = (1 - o) * .5, e.lineWidth = 1.4 * a, e.beginPath(), e.arc(i.x, i.y, (8 + o * 130) * a, 0, Math.PI * 2), e.stroke();
|
|
223
215
|
}
|
|
224
216
|
e.globalAlpha = 1;
|
|
225
217
|
}
|
|
226
218
|
//#endregion
|
|
227
|
-
//#region src/components/custom/constellation/composables/useConstellationPointer.ts
|
|
228
|
-
function G(e) {
|
|
229
|
-
let { host: t, canvas: n, field: r, pointer: i, ripples: a, handle: o, toLocalRef: s, pointerReactive: c, warpOnClick: l, gravityWell: u, isFrozen: d } = e, f = (e) => {
|
|
230
|
-
let t = n.getBoundingClientRect();
|
|
231
|
-
if (!t.width || !t.height) return null;
|
|
232
|
-
let i = (e.clientX - t.left) / t.width, a = (e.clientY - t.top) / t.height;
|
|
233
|
-
return i < 0 || a < 0 || i > 1 || a > 1 ? null : {
|
|
234
|
-
x: i * r.w,
|
|
235
|
-
y: a * r.h
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
if (s.value = f, c && t && !d && !o.reducedMotion && (t.addEventListener("pointermove", (e) => {
|
|
239
|
-
let t = f(e);
|
|
240
|
-
t ? (i.x = t.x, i.y = t.y) : (i.x = -1, i.y = -1), o.wake();
|
|
241
|
-
}), t.addEventListener("pointerleave", () => {
|
|
242
|
-
i.x = -1, i.y = -1;
|
|
243
|
-
}), t.addEventListener("pointerdown", (e) => {
|
|
244
|
-
let t = f(e);
|
|
245
|
-
t && a.push({
|
|
246
|
-
x: t.x,
|
|
247
|
-
y: t.y,
|
|
248
|
-
start: -1
|
|
249
|
-
}), o.wake();
|
|
250
|
-
})), l && t && !d && !o.reducedMotion && t.addEventListener("pointerdown", (e) => {
|
|
251
|
-
let t = f(e);
|
|
252
|
-
t && (N(r, t.x, t.y), o.wake());
|
|
253
|
-
}), u && t && r.well && !d && !o.reducedMotion) {
|
|
254
|
-
let e = r.well, n, i = (t) => {
|
|
255
|
-
let r = f(t);
|
|
256
|
-
r && (e.x = r.x, e.y = r.y, n = window.setTimeout(() => {
|
|
257
|
-
e.target = 1, o.wake();
|
|
258
|
-
}, e.cfg.holdMs), o.wake());
|
|
259
|
-
}, a = (t) => {
|
|
260
|
-
if (e.target > 0) {
|
|
261
|
-
let n = f(t);
|
|
262
|
-
n && (e.x = n.x, e.y = n.y);
|
|
263
|
-
}
|
|
264
|
-
}, s = () => {
|
|
265
|
-
n !== void 0 && (clearTimeout(n), n = void 0), e.target = 0, o.wake();
|
|
266
|
-
};
|
|
267
|
-
t.addEventListener("pointerdown", i), t.addEventListener("pointermove", a), t.addEventListener("pointerup", s), t.addEventListener("pointerleave", s), t.addEventListener("pointercancel", s);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
//#endregion
|
|
271
|
-
//#region src/components/custom/constellation/composables/createConstellationField.ts
|
|
272
|
-
function K(e, t) {
|
|
273
|
-
let n = {
|
|
274
|
-
nodes: [],
|
|
275
|
-
canvas: null,
|
|
276
|
-
w: 0,
|
|
277
|
-
h: 0,
|
|
278
|
-
k: 1,
|
|
279
|
-
dpr: 1,
|
|
280
|
-
focalIndex: -1,
|
|
281
|
-
warp: {
|
|
282
|
-
x: 0,
|
|
283
|
-
y: 0,
|
|
284
|
-
vx: 0,
|
|
285
|
-
vy: 0,
|
|
286
|
-
targetIdx: -1
|
|
287
|
-
}
|
|
288
|
-
}, r = e && e !== !0 ? e : {};
|
|
289
|
-
n.wander = e ? {
|
|
290
|
-
nextAt: -1,
|
|
291
|
-
minIdle: r.minIdle ?? 8e3,
|
|
292
|
-
jitter: r.jitter ?? 8e3
|
|
293
|
-
} : void 0;
|
|
294
|
-
let i = t && t !== !0 ? t : {};
|
|
295
|
-
return n.well = t ? {
|
|
296
|
-
x: -1,
|
|
297
|
-
y: -1,
|
|
298
|
-
strength: 0,
|
|
299
|
-
target: 0,
|
|
300
|
-
cfg: {
|
|
301
|
-
...b,
|
|
302
|
-
...i
|
|
303
|
-
}
|
|
304
|
-
} : void 0, {
|
|
305
|
-
field: n,
|
|
306
|
-
wanderOverride: r,
|
|
307
|
-
wellOverride: i
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
//#endregion
|
|
311
219
|
//#region src/components/custom/constellation/Constellation.vue?vue&type=script&setup=true&lang.ts
|
|
312
|
-
var
|
|
220
|
+
var G = 0, K = /* @__PURE__ */ n(/* @__PURE__ */ c({
|
|
313
221
|
__name: "Constellation",
|
|
314
222
|
props: {
|
|
315
223
|
count: { default: 64 },
|
|
316
224
|
link: { default: 132 },
|
|
317
225
|
speed: { default: .16 },
|
|
318
|
-
opacityCeiling: { default: 1 },
|
|
319
226
|
seed: {},
|
|
320
227
|
pointerReactive: {
|
|
321
228
|
type: Boolean,
|
|
@@ -344,83 +251,141 @@ var q = 0, J = /* @__PURE__ */ n(/* @__PURE__ */ c({
|
|
|
344
251
|
drawOverlay: { type: Function }
|
|
345
252
|
},
|
|
346
253
|
setup(n, { expose: c }) {
|
|
347
|
-
let
|
|
254
|
+
let _ = h("hostRef"), v = h("canvasRef"), T = a(() => n.seed === void 0 ? Math.random : r(typeof n.seed == "string" ? i(n.seed) : n.seed)), E = () => typeof window < "u" && /[?&](export|print|freeze)\b/.test(window.location.search), D = l()?.vnode.props?.freeze, O = a(() => D === void 0 ? E() : D === !0 || D === ""), k = {
|
|
255
|
+
nodes: [],
|
|
256
|
+
canvas: null,
|
|
257
|
+
w: 0,
|
|
258
|
+
h: 0,
|
|
259
|
+
k: 1,
|
|
260
|
+
dpr: 1,
|
|
261
|
+
focalIndex: -1,
|
|
262
|
+
warp: {
|
|
263
|
+
x: 0,
|
|
264
|
+
y: 0,
|
|
265
|
+
vx: 0,
|
|
266
|
+
vy: 0,
|
|
267
|
+
targetIdx: -1
|
|
268
|
+
}
|
|
269
|
+
}, A = n.wander && n.wander !== !0 ? n.wander : {};
|
|
270
|
+
k.wander = n.wander ? {
|
|
271
|
+
nextAt: -1,
|
|
272
|
+
minIdle: A.minIdle ?? 8e3,
|
|
273
|
+
jitter: A.jitter ?? 8e3
|
|
274
|
+
} : void 0;
|
|
275
|
+
let j = n.gravityWell && n.gravityWell !== !0 ? n.gravityWell : {};
|
|
276
|
+
k.well = n.gravityWell ? {
|
|
277
|
+
x: -1,
|
|
278
|
+
y: -1,
|
|
279
|
+
strength: 0,
|
|
280
|
+
target: 0,
|
|
281
|
+
cfg: {
|
|
282
|
+
...N,
|
|
283
|
+
...j
|
|
284
|
+
}
|
|
285
|
+
} : void 0;
|
|
286
|
+
let M = {
|
|
348
287
|
x: -1,
|
|
349
288
|
y: -1
|
|
350
|
-
},
|
|
289
|
+
}, P = [], F = { ...y }, I = -1, R = !1, z = p(null);
|
|
351
290
|
return d(() => {
|
|
352
|
-
let e =
|
|
291
|
+
let e = v.value;
|
|
353
292
|
if (!e) return;
|
|
354
293
|
let r = t({
|
|
355
|
-
canvas:
|
|
294
|
+
canvas: v,
|
|
356
295
|
setup: (t) => ({ render(t, i) {
|
|
357
296
|
let a = e.clientWidth || e.offsetWidth || 1280, o = e.clientHeight || e.offsetHeight || 720, s = a / g;
|
|
358
|
-
if (
|
|
359
|
-
let t =
|
|
360
|
-
if (
|
|
361
|
-
|
|
362
|
-
let t =
|
|
363
|
-
|
|
297
|
+
if (k.canvas = e, k.dpr = Math.min(typeof window < "u" && window.devicePixelRatio || 1, 2), k.w !== a || k.h !== o) {
|
|
298
|
+
let t = k.w, r = k.h;
|
|
299
|
+
if (k.w = a, k.h = o, k.k = s, k.nodes.length ? C(k, t, r) : (k.nodes = S(T.value, n.count, a, o, n.speed), k.warp.x = a / 2, k.warp.y = o / 2), F = b(e), !R) {
|
|
300
|
+
R = !0;
|
|
301
|
+
let t = x(e);
|
|
302
|
+
k.warpCfg = t.warp, k.well && (k.well.cfg = {
|
|
364
303
|
...t.well,
|
|
365
|
-
...
|
|
366
|
-
}),
|
|
304
|
+
...j
|
|
305
|
+
}), k.wander && (k.wander.minIdle = A.minIdle ?? t.wander.minIdle, k.wander.jitter = A.jitter ?? t.wander.jitter);
|
|
367
306
|
}
|
|
368
307
|
}
|
|
369
|
-
|
|
370
|
-
let c =
|
|
371
|
-
|
|
372
|
-
let l =
|
|
373
|
-
if (l &&
|
|
374
|
-
let e = n.pointerReactive ?
|
|
375
|
-
|
|
308
|
+
k.k = s;
|
|
309
|
+
let c = I < 0 ? 0 : (i - I) / 1e3;
|
|
310
|
+
I = i;
|
|
311
|
+
let l = O.value || r.reducedMotion;
|
|
312
|
+
if (l && k.well && (k.well.strength = 0, k.well.target = 0, k.well.x = -1, k.well.y = -1), !l) {
|
|
313
|
+
let e = n.pointerReactive ? M : null;
|
|
314
|
+
w(k, s, n.speed, e, c, i, T.value);
|
|
376
315
|
}
|
|
377
|
-
t.clearRect(0, 0, a, o), V(t,
|
|
316
|
+
t.clearRect(0, 0, a, o), V(t, k, n.link, F), H(t, k, F), n.pointerReactive && !l && (U(t, k, n.link, F, M), W(t, k, i, P, F)), n.drawOverlay?.(t, k, l ? G : i);
|
|
378
317
|
} })
|
|
379
|
-
})
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
318
|
+
}), i = _.value, a = (t) => {
|
|
319
|
+
let n = e.getBoundingClientRect();
|
|
320
|
+
if (!n.width || !n.height) return null;
|
|
321
|
+
let r = (t.clientX - n.left) / n.width, i = (t.clientY - n.top) / n.height;
|
|
322
|
+
return r < 0 || i < 0 || r > 1 || i > 1 ? null : {
|
|
323
|
+
x: r * k.w,
|
|
324
|
+
y: i * k.h
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
if (z.value = a, n.pointerReactive && i && !O.value && !r.reducedMotion && (i.addEventListener("pointermove", (e) => {
|
|
328
|
+
let t = a(e);
|
|
329
|
+
t ? (M.x = t.x, M.y = t.y) : (M.x = -1, M.y = -1), r.wake();
|
|
330
|
+
}), i.addEventListener("pointerleave", () => {
|
|
331
|
+
M.x = -1, M.y = -1;
|
|
332
|
+
}), i.addEventListener("pointerdown", (e) => {
|
|
333
|
+
let t = a(e);
|
|
334
|
+
t && P.push({
|
|
335
|
+
x: t.x,
|
|
336
|
+
y: t.y,
|
|
337
|
+
start: -1
|
|
338
|
+
}), r.wake();
|
|
339
|
+
})), n.warpOnClick && i && !O.value && !r.reducedMotion && i.addEventListener("pointerdown", (e) => {
|
|
340
|
+
let t = a(e);
|
|
341
|
+
t && (L(k, t.x, t.y), r.wake());
|
|
342
|
+
}), n.gravityWell && i && k.well && !O.value && !r.reducedMotion) {
|
|
343
|
+
let e = k.well, t, n = (n) => {
|
|
344
|
+
let i = a(n);
|
|
345
|
+
i && (e.x = i.x, e.y = i.y, t = window.setTimeout(() => {
|
|
346
|
+
e.target = 1, r.wake();
|
|
347
|
+
}, e.cfg.holdMs), r.wake());
|
|
348
|
+
}, o = (t) => {
|
|
349
|
+
if (e.target > 0) {
|
|
350
|
+
let n = a(t);
|
|
351
|
+
n && (e.x = n.x, e.y = n.y);
|
|
352
|
+
}
|
|
353
|
+
}, s = () => {
|
|
354
|
+
t !== void 0 && (clearTimeout(t), t = void 0), e.target = 0, r.wake();
|
|
355
|
+
};
|
|
356
|
+
i.addEventListener("pointerdown", n), i.addEventListener("pointermove", o), i.addEventListener("pointerup", s), i.addEventListener("pointerleave", s), i.addEventListener("pointercancel", s);
|
|
357
|
+
}
|
|
393
358
|
}), c({
|
|
394
|
-
field:
|
|
395
|
-
isFrozen:
|
|
359
|
+
field: k,
|
|
360
|
+
isFrozen: O,
|
|
396
361
|
warpTo(e, t) {
|
|
397
362
|
if (typeof e == "number" && typeof t == "number") {
|
|
398
|
-
let n =
|
|
363
|
+
let n = z.value?.({
|
|
399
364
|
clientX: e,
|
|
400
365
|
clientY: t
|
|
401
366
|
});
|
|
402
|
-
return n ?
|
|
367
|
+
return n ? L(k, n.x, n.y) : -1;
|
|
403
368
|
}
|
|
404
369
|
let n = e;
|
|
405
|
-
return
|
|
370
|
+
return L(k, n.x, n.y);
|
|
406
371
|
},
|
|
407
372
|
holdWellAt(e, t) {
|
|
408
|
-
return
|
|
373
|
+
return k.well ? (k.well.x = e, k.well.y = t, k.well.target = 1, !0) : !1;
|
|
409
374
|
},
|
|
410
375
|
releaseWell() {
|
|
411
|
-
|
|
376
|
+
k.well && (k.well.target = 0);
|
|
412
377
|
}
|
|
413
378
|
}), (t, r) => (f(), o("div", {
|
|
414
379
|
ref_key: "hostRef",
|
|
415
|
-
ref:
|
|
380
|
+
ref: _,
|
|
416
381
|
class: u(m(e)("constellation", n.class))
|
|
417
382
|
}, [s("canvas", {
|
|
418
383
|
ref_key: "canvasRef",
|
|
419
|
-
ref:
|
|
384
|
+
ref: v,
|
|
420
385
|
class: "constellation-canvas",
|
|
421
386
|
"aria-hidden": "true"
|
|
422
387
|
}, null, 512)], 2));
|
|
423
388
|
}
|
|
424
|
-
}), [["__scopeId", "data-v-
|
|
389
|
+
}), [["__scopeId", "data-v-a8ae86fe"]]);
|
|
425
390
|
//#endregion
|
|
426
|
-
export { g as BASE_WIDTH,
|
|
391
|
+
export { g as BASE_WIDTH, K as Constellation, y as DEFAULT_PALETTE, _ as DEFAULT_WANDER_IDLE, v as DEFAULT_WANDER_JITTER, N as DEFAULT_WELL_CONFIG, A as WARP_RESPONSE, j as WARP_ZETA, V as drawEdges, H as drawNodes, U as drawPointerWeb, W as drawRipples, P as nearestNode, B as pickWanderTarget, x as readInteractionConfig, b as readPalette, C as refitField, S as seedField, I as setWarpTarget, w as stepField, k as stepWell, z as warpSettled, F as warpStep, L as warpTo };
|