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