@mkbabb/glass-ui 3.9.0 → 3.10.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.
Files changed (121) hide show
  1. package/dist/{MetricBadge-lTc002u2.js → MetricBadge-BZVWIxNy.js} +6 -4
  2. package/dist/{Notification-BxK8LZMw.js → Notification-DLMhblXR.js} +2 -2
  3. package/dist/{Switch-LDKLmmgx.js → Switch-Ch-k3Rv-.js} +1 -1
  4. package/dist/animated-digit.js +1 -1
  5. package/dist/api/index.d.ts +1 -0
  6. package/dist/api.js +1 -1
  7. package/dist/aurora.js +236 -545
  8. package/dist/{badge-BvwvT50i.js → badge-CaoFJzRb.js} +1 -1
  9. package/dist/badge.js +1 -1
  10. package/dist/color.js +1 -1
  11. package/dist/{compile-DAjIoEy2.js → compile-BOXjLUxu.js} +23 -23
  12. package/dist/components/custom/aurora/composables/atoms.d.ts +21 -4
  13. package/dist/components/custom/aurora/composables/runtime.d.ts +0 -9
  14. package/dist/components/custom/aurora/composables/uniformBridge.d.ts +0 -11
  15. package/dist/components/custom/aurora/constants/renderMode.d.ts +0 -32
  16. package/dist/components/custom/aurora/constants/shaders/brush.glsl.d.ts +1 -1
  17. package/dist/components/custom/aurora/constants/shaders/mediums.glsl.d.ts +2 -2
  18. package/dist/components/custom/aurora/constants/shaders/tonemap.glsl.d.ts +1 -1
  19. package/dist/components/custom/aurora/index.d.ts +1 -1
  20. package/dist/components/custom/constellation/Constellation.vue.d.ts +73 -1
  21. package/dist/components/custom/constellation/constellationField.d.ts +255 -3
  22. package/dist/components/custom/constellation/index.d.ts +2 -2
  23. package/dist/components/custom/dock/DockTabButton.vue.d.ts +4 -3
  24. package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +29 -0
  25. package/dist/components/custom/fourier-field/FourierField.vue.d.ts +6 -0
  26. package/dist/components/custom/fourier-field/index.d.ts +25 -1
  27. package/dist/components/custom/fourier-field/math.d.ts +3 -8
  28. package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +8 -10
  29. package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +6 -14
  30. package/dist/components/custom/goo-blob/index.d.ts +1 -1
  31. package/dist/components/custom/goo-blob/types.d.ts +59 -25
  32. package/dist/components/custom/handmark/HandMark.vue.d.ts +29 -0
  33. package/dist/components/custom/handmark/brush.d.ts +219 -0
  34. package/dist/components/custom/handmark/freehand.d.ts +69 -0
  35. package/dist/components/custom/handmark/geometry.d.ts +32 -0
  36. package/dist/components/custom/handmark/index.d.ts +21 -0
  37. package/dist/components/custom/handmark/ink.d.ts +11 -0
  38. package/dist/components/custom/handmark/texture.d.ts +39 -0
  39. package/dist/components/custom/handmark/types.d.ts +53 -0
  40. package/dist/components/custom/handmark/useHandMark.d.ts +66 -0
  41. package/dist/components/custom/metric-badge/MetricBadge.vue.d.ts +8 -0
  42. package/dist/components/ui/slider/index.d.ts +20 -16
  43. package/dist/composables/color/index.d.ts +12 -7
  44. package/dist/composables/glass/webgl/shaders/procedural-color.glsl.d.ts +1 -6
  45. package/dist/composables/motion/core/index.d.ts +1 -0
  46. package/dist/composables/motion/useRouteTransition.d.ts +42 -0
  47. package/dist/constellation.js +212 -72
  48. package/dist/controls.js +1 -1
  49. package/dist/dark.js +1 -1
  50. package/dist/dock.js +1 -0
  51. package/dist/expandable-container.js +61 -38
  52. package/dist/forms.js +2 -2
  53. package/dist/fourier-field.js +89 -97
  54. package/dist/fourier-math.d.ts +1 -0
  55. package/dist/fourier-math.js +2 -0
  56. package/dist/glass-panel.js +1 -1
  57. package/dist/glass-ui.css +1 -1
  58. package/dist/glass-ui.js +81 -80
  59. package/dist/goo-blob.js +299 -284
  60. package/dist/handmark.d.ts +1 -0
  61. package/dist/handmark.js +609 -0
  62. package/dist/icon-tooltip.js +1 -1
  63. package/dist/index.d.ts +1 -0
  64. package/dist/keyboard.js +1 -1
  65. package/dist/labeled-field.js +4 -4
  66. package/dist/math-DTpRVC0e.js +27 -0
  67. package/dist/metric-badge.js +1 -1
  68. package/dist/metric-stack.js +1 -1
  69. package/dist/motion-core.js +70 -69
  70. package/dist/motion.js +2 -2
  71. package/dist/notification.js +1 -1
  72. package/dist/search.js +2 -2
  73. package/dist/{slider-DC2mwuoe.js → slider-CyzcxBoh.js} +6 -6
  74. package/dist/slider.js +1 -1
  75. package/dist/styles/animations.css +74 -18
  76. package/dist/styles/cards.css +2 -2
  77. package/dist/styles/components.css +1 -1
  78. package/dist/styles/dock/layer-group.css +16 -4
  79. package/dist/styles/dock-controls.css +39 -23
  80. package/dist/styles/drawer.css +12 -4
  81. package/dist/styles/glass.css +145 -9
  82. package/dist/styles/paper.css +68 -2
  83. package/dist/styles/theme.css +7 -0
  84. package/dist/styles/tokens.css +101 -15
  85. package/dist/styles/transitions.css +20 -2
  86. package/dist/styles/utilities.css +130 -40
  87. package/dist/styles/view-transition.css +51 -0
  88. package/dist/switch.js +1 -1
  89. package/dist/{useAnimatedNumber-C5I3wWd8.js → useAnimatedNumber-Bcpy5Etf.js} +1 -1
  90. package/dist/{useGlassRenderer-5I0YkI4t.js → useGlassRenderer-D7YGOYiM.js} +1 -1
  91. package/dist/useViewTransition-DaN5Zrox.js +21 -0
  92. package/dist/vReveal-zUIQk-rJ.js +53 -0
  93. package/dist/watercolor-dot.js +1 -1
  94. package/package.json +51 -9
  95. package/src/styles/animations.css +74 -18
  96. package/src/styles/cards.css +2 -2
  97. package/src/styles/dock/layer-group.css +16 -4
  98. package/src/styles/dock-controls.css +39 -23
  99. package/src/styles/drawer.css +12 -4
  100. package/src/styles/glass.css +145 -9
  101. package/src/styles/paper.css +68 -2
  102. package/src/styles/theme.css +7 -0
  103. package/src/styles/tokens.css +101 -15
  104. package/src/styles/transitions.css +20 -2
  105. package/src/styles/utilities.css +130 -40
  106. package/src/styles/view-transition.css +51 -0
  107. package/dist/components/custom/aurora/composables/gpuRuntime.d.ts +0 -16
  108. package/dist/components/custom/aurora/constants/shaders/aurora.wgsl.d.ts +0 -7
  109. package/dist/composables/glass/createGPUCanvas.d.ts +0 -40
  110. package/dist/vReveal-CqaCz_mC.js +0 -44
  111. /package/dist/{IconTooltip-yefK7cJc.js → IconTooltip-Cus0fvK0.js} +0 -0
  112. /package/dist/{Input-DWQQIOC4.js → Input-xuDwALQR.js} +0 -0
  113. /package/dist/{color-8jBjWiJ6.js → color-C5ls_QF7.js} +0 -0
  114. /package/dist/{constants-CS75AWHG.js → constants-yKeKnE84.js} +0 -0
  115. /package/dist/{presets-BKVyQfbt.js → presets-Dkdv55Gt.js} +0 -0
  116. /package/dist/{prng-wHuHlNHE.js → prng-D27-B3tK.js} +0 -0
  117. /package/dist/{useGlobalDark-yhL4Wp-s.js → useGlobalDark-d6waty-X.js} +0 -0
  118. /package/dist/{useIntersectionPause-Cc-H9ees.js → useIntersectionPause-Cck5Uxk8.js} +0 -0
  119. /package/dist/{useKeyboardShortcuts-Be3w_Rwk.js → useKeyboardShortcuts-CyIYrndH.js} +0 -0
  120. /package/dist/{useScrollProgress-CAH8Ofwt.js → useScrollProgress-CffFGLa5.js} +0 -0
  121. /package/dist/{useTextHighlight-DON84L8w.js → useTextHighlight-CWEi25hf.js} +0 -0
package/dist/dark.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./useGlobalDark-yhL4Wp-s.js";
1
+ import { t as e } from "./useGlobalDark-d6waty-X.js";
2
2
  import { nextTick as t, watch as n } from "vue";
3
3
  //#region src/composables/dark/installDarkModeSync.ts
4
4
  function r(r) {
package/dist/dock.js CHANGED
@@ -627,6 +627,7 @@ var xe = { key: 1 }, $ = { key: 2 }, Se = /* @__PURE__ */ S({
627
627
  }, {
628
628
  default: V(() => [x(I(m), {
629
629
  class: E(["dock-layer-rail", e.railPosition]),
630
+ indicator: !1,
630
631
  onFocusin: U,
631
632
  onFocusout: W
632
633
  }, {
@@ -1,26 +1,25 @@
1
1
  import { n as e, t } from "./minimize-2-lcXOuc6V.js";
2
- import { i as n } from "./useKeyboardShortcuts-Be3w_Rwk.js";
3
- import { Fragment as r, Teleport as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeModels as d, mergeProps as f, normalizeClass as p, onMounted as m, onUnmounted as h, openBlock as g, renderSlot as _, unref as v, useModel as y, watch as b } from "vue";
2
+ import { t as n } from "./useViewTransition-DaN5Zrox.js";
3
+ import { i as r } from "./useKeyboardShortcuts-CyIYrndH.js";
4
+ import { Fragment as i, Teleport as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, mergeModels as p, mergeProps as m, normalizeClass as h, normalizeStyle as g, onMounted as _, onUnmounted as v, openBlock as y, renderSlot as b, unref as x, useId as S, useModel as C, watch as w } from "vue";
4
5
  //#region src/components/custom/expandable-container/ExpandableContainer.vue?vue&type=script&setup=true&lang.ts
5
- var x = ["aria-label"], S = {
6
- key: 0,
7
- class: "fixed inset-0 z-modal flex flex-col bg-background"
8
- }, C = ["aria-label"], w = { class: "h-full w-full" }, T = 0, E = null;
9
- function D() {
10
- return typeof document > "u" ? !1 : (T === 0 && (E = document.body.style.overflow, document.body.style.overflow = "hidden"), T += 1, !0);
6
+ var T = ["aria-label"], E = ["aria-label"], D = { class: "h-full w-full" }, O = 0, k = null;
7
+ function A() {
8
+ return typeof document > "u" ? !1 : (O === 0 && (k = document.body.style.overflow, document.body.style.overflow = "hidden"), O += 1, !0);
11
9
  }
12
- function O() {
13
- typeof document > "u" || T === 0 || (--T, T === 0 && (document.body.style.overflow = E ?? "", E = null));
10
+ function j() {
11
+ typeof document > "u" || O === 0 || (--O, O === 0 && (document.body.style.overflow = k ?? "", k = null));
14
12
  }
15
13
  //#endregion
16
14
  //#region src/components/custom/expandable-container/ExpandableContainer.vue
17
- var k = /* @__PURE__ */ u({
15
+ var M = /* @__PURE__ */ f({
18
16
  inheritAttrs: !1,
19
17
  __name: "ExpandableContainer",
20
- props: /* @__PURE__ */ d({
18
+ props: /* @__PURE__ */ p({
21
19
  buttonPosition: { default: "right" },
22
20
  expandLabel: { default: "Fullscreen" },
23
- collapseLabel: { default: "Exit fullscreen" }
21
+ collapseLabel: { default: "Exit fullscreen" },
22
+ viewTransitionName: { default: void 0 }
24
23
  }, {
25
24
  open: {
26
25
  type: Boolean,
@@ -29,42 +28,66 @@ var k = /* @__PURE__ */ u({
29
28
  openModifiers: {}
30
29
  }),
31
30
  emits: ["update:open"],
32
- setup(u) {
33
- let d = y(u, "open"), T = !1;
34
- function E(e) {
35
- if (e && !T) {
36
- T = D();
31
+ setup(f) {
32
+ let p = f, O = C(f, "open"), k = S(), M = o(() => p.viewTransitionName === void 0 ? void 0 : `gl-expand-${p.viewTransitionName}-${k}`), N = o(() => M.value === void 0 ? void 0 : { "view-transition-name": M.value });
33
+ function P() {
34
+ if (M.value === void 0) {
35
+ O.value = !0;
37
36
  return;
38
37
  }
39
- !e && T && (O(), T = !1);
38
+ n(() => {
39
+ O.value = !0;
40
+ });
41
+ }
42
+ function F() {
43
+ if (M.value === void 0) {
44
+ O.value = !1;
45
+ return;
46
+ }
47
+ n(() => {
48
+ O.value = !1;
49
+ });
40
50
  }
41
- b(d, E, { immediate: !0 });
42
- let k = null;
43
- return m(() => {
44
- k = n("Escape", () => {
45
- d.value &&= !1;
51
+ let I = !1;
52
+ function L(e) {
53
+ if (e && !I) {
54
+ I = A();
55
+ return;
56
+ }
57
+ !e && I && (j(), I = !1);
58
+ }
59
+ w(O, L, { immediate: !0 });
60
+ let R = null;
61
+ return _(() => {
62
+ R = r("Escape", () => {
63
+ O.value && F();
46
64
  }, {
47
65
  label: "Exit fullscreen",
48
66
  group: "UI",
49
67
  allowInInput: !0
50
68
  });
51
- }), h(() => {
52
- k?.(), E(!1);
53
- }), (n, m) => (g(), s(r, null, [d.value ? o("", !0) : (g(), s("div", f({
69
+ }), v(() => {
70
+ R?.(), L(!1);
71
+ }), (n, r) => (y(), l(i, null, [O.value ? c("", !0) : (y(), l("div", m({
54
72
  key: 0,
55
- class: "relative"
56
- }, n.$attrs), [c("button", {
57
- class: p(["expandable-container__trigger absolute z-10 rounded-button bg-card/70 [backdrop-filter:var(--glass-blur-wash)] p-1.5 text-muted-foreground hover:text-foreground transition-colors shadow-sm border border-border/40", u.buttonPosition === "left" ? "left-2 top-2" : "right-2 top-2"]),
73
+ class: ["relative", { "gl-expand": M.value !== void 0 }],
74
+ style: N.value
75
+ }, n.$attrs), [u("button", {
76
+ class: h(["expandable-container__trigger absolute z-10 rounded-button bg-card/70 [backdrop-filter:var(--glass-blur-wash)] p-1.5 text-muted-foreground hover:text-foreground transition-colors shadow-sm border border-border/40", f.buttonPosition === "left" ? "left-2 top-2" : "right-2 top-2"]),
58
77
  title: "Fullscreen",
59
- "aria-label": u.expandLabel,
60
- onClick: m[0] ||= (e) => d.value = !0
61
- }, [l(v(e), { class: "h-4 w-4" })], 10, x), _(n.$slots, "default", { fullscreen: !1 })], 16)), (g(), a(i, { to: "body" }, [d.value ? (g(), s("div", S, [c("button", {
62
- class: p(["expandable-container__trigger absolute z-10 rounded-button bg-card/70 [backdrop-filter:var(--glass-blur-wash)] p-2 text-muted-foreground hover:text-foreground transition-colors shadow-sm border border-border/40", u.buttonPosition === "left" ? "left-3 top-3" : "right-3 top-3"]),
78
+ "aria-label": f.expandLabel,
79
+ onClick: P
80
+ }, [d(x(e), { class: "h-4 w-4" })], 10, T), b(n.$slots, "default", { fullscreen: !1 })], 16)), (y(), s(a, { to: "body" }, [O.value ? (y(), l("div", {
81
+ key: 0,
82
+ class: h(["fixed inset-0 z-modal flex flex-col bg-background", { "gl-expand": M.value !== void 0 }]),
83
+ style: g(N.value)
84
+ }, [u("button", {
85
+ class: h(["expandable-container__trigger absolute z-10 rounded-button bg-card/70 [backdrop-filter:var(--glass-blur-wash)] p-2 text-muted-foreground hover:text-foreground transition-colors shadow-sm border border-border/40", f.buttonPosition === "left" ? "left-3 top-3" : "right-3 top-3"]),
63
86
  title: "Exit fullscreen",
64
- "aria-label": u.collapseLabel,
65
- onClick: m[1] ||= (e) => d.value = !1
66
- }, [l(v(t), { class: "h-4 w-4" })], 10, C), c("div", w, [_(n.$slots, "default", { fullscreen: !0 })])])) : o("", !0)]))], 64));
87
+ "aria-label": f.collapseLabel,
88
+ onClick: F
89
+ }, [d(x(t), { class: "h-4 w-4" })], 10, E), u("div", D, [b(n.$slots, "default", { fullscreen: !0 })])], 6)) : c("", !0)]))], 64));
67
90
  }
68
91
  });
69
92
  //#endregion
70
- export { k as ExpandableContainer };
93
+ export { M as ExpandableContainer };
package/dist/forms.js CHANGED
@@ -2,7 +2,7 @@ import { t as e } from "./cn-DJXf4yaB.js";
2
2
  import { t } from "./search-nbkvr2dC.js";
3
3
  import { t as n } from "./menuItemVariants-CCoBNkU5.js";
4
4
  import { t as r } from "./useUserInvalidAria-DoJKMZ3s.js";
5
- import { t as i } from "./Input-DWQQIOC4.js";
5
+ import { t as i } from "./Input-xuDwALQR.js";
6
6
  import { computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createTextVNode as l, createVNode as u, defineComponent as d, isRef as f, mergeProps as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _, vModelText as v, withCtx as y, withDirectives as b } from "vue";
7
7
  import { ComboboxAnchor as x, ComboboxCancel as S, ComboboxContent as C, ComboboxEmpty as w, ComboboxGroup as T, ComboboxInput as E, ComboboxItem as D, ComboboxItemIndicator as O, ComboboxLabel as k, ComboboxPortal as A, ComboboxRoot as j, ComboboxSeparator as M, ComboboxTrigger as N, ComboboxViewport as P, useForwardProps as F, useForwardPropsEmits as I } from "reka-ui";
8
8
  import { reactiveOmit as L, useVModel as R } from "@vueuse/core";
@@ -177,7 +177,7 @@ var z = ["data-autosize"], B = /* @__PURE__ */ d({
177
177
  let i = n, a = r, o = I(L(i, "class"), a);
178
178
  return (n, r) => (m(), c("div", G, [u(_(t), { class: "size-4 shrink-0 opacity-50" }), u(_(E), p({
179
179
  "data-slot": "command-input",
180
- class: _(e)("placeholder:text-muted-foreground flex h-[var(--dropdown-input-height)] w-full rounded-input bg-transparent py-3 text-dropdown outline-hidden disabled:cursor-not-allowed disabled:opacity-disabled aria-invalid:text-[var(--destructive)] aria-invalid:placeholder:text-[color-mix(in_srgb,var(--destructive)_60%,transparent)]", i.class)
180
+ class: _(e)("placeholder:text-muted-foreground flex h-[var(--dropdown-input-height)] w-full rounded-input bg-transparent py-3 text-dropdown outline-hidden disabled:cursor-not-allowed disabled:opacity-disabled aria-invalid:text-destructive aria-invalid:placeholder:text-[color-mix(in_srgb,var(--destructive)_60%,transparent)]", i.class)
181
181
  }, {
182
182
  ..._(o),
183
183
  ...n.$attrs
@@ -1,45 +1,13 @@
1
1
  import { t as e } from "./useCanvas2D-ClrQuZtp.js";
2
2
  import { t } from "./_plugin-vue_export-helper-ok8pgSl5.js";
3
- import { i as n, s as r, t as i } from "./color-8jBjWiJ6.js";
4
- import { t as a } from "./useGlobalDark-yhL4Wp-s.js";
5
- import { n as o, t as s } from "./prng-wHuHlNHE.js";
6
- import { createElementBlock as c, createElementVNode as l, defineComponent as u, onMounted as d, openBlock as f, ref as p, useTemplateRef as m, watch as h } from "vue";
7
- //#region src/components/custom/fourier-field/math.ts
8
- function g(e, t, n) {
9
- return {
10
- index: e,
11
- coefficient: [t, n],
12
- amplitude: Math.hypot(t, n),
13
- phase: Math.atan2(n, t)
14
- };
15
- }
16
- function _(e, t, n) {
17
- let r = 0, i = 0, a = n ?? e.length;
18
- for (let n = 0; n < a && n < e.length; n++) {
19
- let a = e[n], o = 2 * Math.PI * a.index * t, s = Math.cos(o), c = Math.sin(o);
20
- r += a.coefficient[0] * s - a.coefficient[1] * c, i += a.coefficient[0] * c + a.coefficient[1] * s;
21
- }
22
- return [r, i];
23
- }
24
- function v(e, t, n) {
25
- let r = [[0, 0]], i = 0, a = 0, o = n ?? e.length;
26
- for (let n = 0; n < o && n < e.length; n++) {
27
- let o = e[n], s = 2 * Math.PI * o.index * t, c = Math.cos(s), l = Math.sin(s);
28
- i += o.coefficient[0] * c - o.coefficient[1] * l, a += o.coefficient[0] * l + o.coefficient[1] * c, r.push([i, a]);
29
- }
30
- return r;
31
- }
32
- function y(e, t = {}) {
33
- let { harmonics: n = 4, harmonicScale: r = .22 } = t, i = .62 + e() * .18, a = i * (.34 + e() * .3), o = e() * Math.PI * 2, s = e() * Math.PI * 2, c = [g(1, i * Math.cos(o), i * Math.sin(o)), g(-1, a * Math.cos(s), a * Math.sin(s))];
34
- for (let t = 0; t < n; t++) {
35
- let n = 2 + Math.floor(t / 2), i = t % 2 == 0 ? n : -n, a = r / n * (.4 + e() * .6), o = e() * Math.PI * 2;
36
- c.push(g(i, a * Math.cos(o), a * Math.sin(o)));
37
- }
38
- return c;
39
- }
3
+ import { i as n, s as r, t as i } from "./color-C5ls_QF7.js";
4
+ import { t as a } from "./useGlobalDark-d6waty-X.js";
5
+ import { n as o, t as s } from "./prng-D27-B3tK.js";
6
+ import { n as c, r as l, t as u } from "./math-DTpRVC0e.js";
7
+ import { createElementBlock as d, createElementVNode as f, defineComponent as p, onMounted as m, openBlock as h, ref as g, useTemplateRef as _, watch as v } from "vue";
40
8
  //#endregion
41
- //#region src/components/custom/fourier-field/FourierField.vue?vue&type=script&setup=true&lang.ts
42
- var b = .24, x = /* @__PURE__ */ t(/* @__PURE__ */ u({
9
+ //#region src/components/custom/fourier-field/FourierField.vue
10
+ var y = /* @__PURE__ */ t(/* @__PURE__ */ p({
43
11
  __name: "FourierField",
44
12
  props: {
45
13
  variant: { default: "hero" },
@@ -49,10 +17,11 @@ var b = .24, x = /* @__PURE__ */ t(/* @__PURE__ */ u({
49
17
  freeze: {
50
18
  type: Boolean,
51
19
  default: !1
52
- }
20
+ },
21
+ intensity: { default: 1 }
53
22
  },
54
23
  setup(t) {
55
- let u = {
24
+ let u = Math.max(0, Math.min(2, t.intensity)), p = {
56
25
  hero: {
57
26
  harmonics: 4,
58
27
  harmonicScale: .22,
@@ -61,7 +30,16 @@ var b = .24, x = /* @__PURE__ */ t(/* @__PURE__ */ u({
61
30
  epicycleHueShift: 42,
62
31
  durationMs: 16e3,
63
32
  frozenSeed: "fourier-field/hero",
64
- frozenT: .18
33
+ frozenT: .18,
34
+ peakAlpha: .55,
35
+ headGlowAlpha: .62,
36
+ headGlowBlur: 16,
37
+ epicycleRatios: {
38
+ circle: .18,
39
+ arm: .3
40
+ },
41
+ trailFadeExp: 1.4,
42
+ trailFloor: .1
65
43
  },
66
44
  final: {
67
45
  harmonics: 9,
@@ -71,96 +49,110 @@ var b = .24, x = /* @__PURE__ */ t(/* @__PURE__ */ u({
71
49
  epicycleHueShift: 36,
72
50
  durationMs: 21e3,
73
51
  frozenSeed: "fourier-field/final",
74
- frozenT: .33
52
+ frozenT: .33,
53
+ peakAlpha: .45,
54
+ headGlowAlpha: .5,
55
+ headGlowBlur: 14,
56
+ epicycleRatios: {
57
+ circle: 0,
58
+ arm: 0
59
+ },
60
+ trailFadeExp: 1.5,
61
+ trailFloor: .08
75
62
  }
76
- }, g = m("hostRef"), _ = m("canvasRef"), x = p(t.color);
77
- function S(e) {
63
+ }, y = _("hostRef"), b = _("canvasRef"), x = g(t.color), S = g("rgb(0, 0, 0)"), C = g("rgb(0, 0, 0)");
64
+ function w(e) {
78
65
  if (!e.includes("var(") && !e.includes("light-dark(")) return e;
79
- let t = g.value;
66
+ let t = y.value;
80
67
  if (typeof window > "u" || !t) return e;
81
68
  let n = t.style.color;
82
69
  t.style.color = e;
83
70
  let r = getComputedStyle(t).color;
84
71
  return t.style.color = n, r || e;
85
72
  }
86
- function C() {
87
- x.value = S(t.color);
73
+ let T = p[t.variant];
74
+ function E() {
75
+ x.value = w(t.color);
76
+ let [e, a, o] = t.colorResolver(x.value).map((e) => Math.round(e * 255));
77
+ S.value = `rgb(${e}, ${a}, ${o})`;
78
+ let s = i(x.value), [c, l, u] = r({
79
+ L: s.L,
80
+ C: s.C,
81
+ h: n(s.h, "analogous", T.epicycleHueShift, 1)
82
+ }).map((e) => Math.round(e * 255));
83
+ C.value = `rgb(${c}, ${l}, ${u})`;
88
84
  }
89
- function w(e) {
90
- return y(o(s((t.freeze ? e.frozenSeed : `${Math.random()}`) + t.seed)), {
85
+ function D(e) {
86
+ return c(o(s((t.freeze ? e.frozenSeed : `${Math.random()}`) + t.seed)), {
91
87
  harmonics: e.harmonics,
92
88
  harmonicScale: e.harmonicScale
93
89
  });
94
90
  }
95
- let { isDark: T } = a();
96
- return d(() => {
97
- let a = _.value;
98
- if (!a) return;
99
- let o = u[t.variant], s = w(o), c = Infinity, l = Infinity, d = -Infinity, f = -Infinity;
91
+ let { isDark: O } = a();
92
+ return m(() => {
93
+ let n = b.value;
94
+ if (!n) return;
95
+ let r = p[t.variant], i = D(r), a = [...i].sort((e, t) => t.amplitude - e.amplitude), o = Infinity, s = Infinity, c = -Infinity, d = -Infinity;
100
96
  for (let e = 0; e < 720; e++) {
101
- let t = v(s, e / 720), [n, r] = t[t.length - 1];
102
- n < c && (c = n), r < l && (l = r), n > d && (d = n), r > f && (f = r);
97
+ let t = l(i, e / 720), [n, r] = t[t.length - 1];
98
+ n < o && (o = n), r < s && (s = r), n > c && (c = n), r > d && (d = r);
103
99
  }
104
- let p = Math.max(.001, d - c), m = Math.max(.001, f - l), y = (c + d) / 2, S = (l + f) / 2, E = [], D = e({
105
- canvas: _,
106
- setup: () => ({ render(e, c) {
107
- let l = a.clientWidth || a.offsetWidth || 0, u = a.clientHeight || a.offsetHeight || 0;
108
- if (!l || !u) return;
109
- let d = .82, f = Math.min(l / p * d, u / m * d), h = l / 2, g = u / 2, _ = (e, t) => [h + (e - y) * f, g + (t - S) * f], C = t.freeze || D.reducedMotion ? o.frozenT : c / o.durationMs % 1, [w, T, O] = t.colorResolver(x.value).map((e) => Math.round(e * 255)), k = `rgb(${w}, ${T}, ${O})`, A = i(x.value), [j, M, N] = r({
110
- L: A.L,
111
- C: A.C,
112
- h: n(A.h, "analogous", o.epicycleHueShift, 1)
113
- }).map((e) => Math.round(e * 255)), P = `rgb(${j}, ${M}, ${N})`;
114
- if (e.clearRect(0, 0, l, u), o.epicycles) {
115
- let t = v(s, C);
116
- e.lineWidth = 1;
100
+ let f = Math.max(.001, c - o), m = Math.max(.001, d - s), h = (o + c) / 2, g = (s + d) / 2, _ = [], x = e({
101
+ canvas: b,
102
+ setup: () => ({ render(e, o) {
103
+ let s = n.clientWidth || n.offsetWidth || 0, c = n.clientHeight || n.offsetHeight || 0;
104
+ if (!s || !c) return;
105
+ let d = .82, p = Math.min(s / f * d, c / m * d), v = s / 2, y = c / 2, b = (e, t) => [v + (e - h) * p, y + (t - g) * p], w = t.freeze || x.reducedMotion ? r.frozenT : o / r.durationMs % 1, T = S.value, E = C.value, D = r.peakAlpha * u, k = r.headGlowAlpha * u;
106
+ if (e.clearRect(0, 0, s, c), r.epicycleRatios.arm > 0) {
107
+ let t = l(a, w);
108
+ e.lineWidth = 1, e.strokeStyle = E;
117
109
  for (let n = 1; n < t.length; n++) {
118
- let [r, i] = _(t[n - 1][0], t[n - 1][1]), [a, o] = _(t[n][0], t[n][1]), s = Math.hypot(a - r, o - i);
119
- e.strokeStyle = P, e.globalAlpha = b * .6 * .5, e.beginPath(), e.arc(r, i, s, 0, Math.PI * 2), e.stroke(), e.globalAlpha = b * .6, e.beginPath(), e.moveTo(r, i), e.lineTo(a, o), e.stroke();
110
+ let [i, a] = b(t[n - 1][0], t[n - 1][1]), [o, s] = b(t[n][0], t[n][1]), c = Math.hypot(o - i, s - a);
111
+ e.globalAlpha = D * r.epicycleRatios.circle, e.beginPath(), e.arc(i, a, c, 0, Math.PI * 2), e.stroke(), e.globalAlpha = D * r.epicycleRatios.arm, e.beginPath(), e.moveTo(i, a), e.lineTo(o, s), e.stroke();
120
112
  }
121
113
  e.globalAlpha = 1;
122
114
  }
123
- let F = v(s, C), [I, L] = F[F.length - 1], R = _(I, L);
124
- if (t.freeze || D.reducedMotion) {
125
- if (E.length === 0) {
126
- let e = Math.min(o.trailLength, 48);
115
+ let A = l(i, w), [j, M] = A[A.length - 1], N = b(j, M);
116
+ if (t.freeze || x.reducedMotion) {
117
+ if (_.length === 0) {
118
+ let e = Math.min(r.trailLength, 48);
127
119
  for (let t = e; t >= 0; t--) {
128
- let n = v(s, (C - t / e * .06 + 1) % 1);
129
- E.push(_(n[n.length - 1][0], n[n.length - 1][1]));
120
+ let n = l(i, (w - t / e * .06 + 1) % 1);
121
+ _.push(b(n[n.length - 1][0], n[n.length - 1][1]));
130
122
  }
131
123
  }
132
- } else for (E.push(R); E.length > o.trailLength;) E.shift();
133
- e.strokeStyle = k, e.lineCap = "round", e.lineJoin = "round", e.lineWidth = 1.6;
134
- for (let t = 1; t < E.length; t++) {
135
- let n = t / (E.length - 1);
136
- e.globalAlpha = b * n * n, e.beginPath(), e.moveTo(E[t - 1][0], E[t - 1][1]), e.lineTo(E[t][0], E[t][1]), e.stroke();
124
+ } else for (_.push(N); _.length > r.trailLength;) _.shift();
125
+ e.globalCompositeOperation = O.value ? "lighter" : "source-over", e.strokeStyle = T, e.lineCap = "round", e.lineJoin = "round", e.lineWidth = 1.6;
126
+ for (let t = 1; t < _.length; t++) {
127
+ let n = D * (t / (_.length - 1)) ** r.trailFadeExp;
128
+ n = Math.max(n, D * r.trailFloor), e.globalAlpha = n, e.beginPath(), e.moveTo(_[t - 1][0], _[t - 1][1]), e.lineTo(_[t][0], _[t][1]), e.stroke();
137
129
  }
138
- if (E.length >= 2) {
139
- e.save(), e.shadowColor = k, e.shadowBlur = 14, e.globalAlpha = b, e.lineWidth = 2;
140
- let t = E.slice(-4);
130
+ if (_.length >= 2) {
131
+ e.save(), e.shadowColor = T, e.shadowBlur = r.headGlowBlur, e.globalAlpha = k, e.lineWidth = 2;
132
+ let t = _.slice(-4);
141
133
  e.beginPath(), e.moveTo(t[0][0], t[0][1]);
142
134
  for (let n = 1; n < t.length; n++) e.lineTo(t[n][0], t[n][1]);
143
135
  e.stroke(), e.restore();
144
136
  }
145
- e.globalAlpha = 1;
137
+ e.shadowBlur = 0, e.globalCompositeOperation = "source-over", e.globalAlpha = 1;
146
138
  } })
147
139
  });
148
- h(g, C, { immediate: !0 }), h(() => t.color, () => {
149
- C(), D.wake();
150
- }), h(T, () => {
151
- C(), D.wake();
140
+ v(y, E, { immediate: !0 }), v(() => t.color, () => {
141
+ E(), x.wake();
142
+ }), v(O, () => {
143
+ E(), x.wake();
152
144
  });
153
- }), (e, t) => (f(), c("div", {
145
+ }), (e, t) => (h(), d("div", {
154
146
  ref_key: "hostRef",
155
- ref: g,
147
+ ref: y,
156
148
  class: "fourier-field"
157
- }, [l("canvas", {
149
+ }, [f("canvas", {
158
150
  ref_key: "canvasRef",
159
- ref: _,
151
+ ref: b,
160
152
  class: "fourier-field-canvas",
161
153
  "aria-hidden": "true"
162
154
  }, null, 512)], 512));
163
155
  }
164
- }), [["__scopeId", "data-v-a18f3d0f"]]);
156
+ }), [["__scopeId", "data-v-d56269df"]]);
165
157
  //#endregion
166
- export { x as FourierField, g as comp, _ as evalFourier, y as makeEllipticSpectrum, v as positionsAt };
158
+ export { y as FourierField, u as comp, c as makeEllipticSpectrum, l as positionsAt };
@@ -0,0 +1 @@
1
+ export * from "./components/custom/fourier-field/math";
@@ -0,0 +1,2 @@
1
+ import { n as e, r as t, t as n } from "./math-DTpRVC0e.js";
2
+ export { n as comp, e as makeEllipticSpectrum, t as positionsAt };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./cn-DJXf4yaB.js";
2
- import { n as t, r as n, t as r } from "./useGlassRenderer-5I0YkI4t.js";
2
+ import { n as t, r as n, t as r } from "./useGlassRenderer-D7YGOYiM.js";
3
3
  import { t as i } from "./_plugin-vue_export-helper-ok8pgSl5.js";
4
4
  import { computed as a, createElementBlock as o, defineComponent as s, normalizeClass as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderSlot as p } from "vue";
5
5
  //#region src/components/custom/glass-panel/GlassPanel.vue?vue&type=script&setup=true&lang.ts