border-beam 1.0.1 → 1.1.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/README.md +41 -11
- package/dist/index.cjs.js +337 -102
- package/dist/index.d.ts +21 -7
- package/dist/index.es.js +855 -295
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
const
|
|
1
|
+
import { jsxs as he, Fragment as Ce, jsx as ze } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ge, useId as Me, useRef as Ie, useState as L, useEffect as P, useCallback as ye, useMemo as ke } from "react";
|
|
3
|
+
const Le = {
|
|
4
4
|
sm: {
|
|
5
|
-
borderRadius:
|
|
5
|
+
borderRadius: 32,
|
|
6
6
|
borderWidth: 1,
|
|
7
7
|
width: 70,
|
|
8
8
|
height: 36
|
|
@@ -14,60 +14,112 @@ const ce = {
|
|
|
14
14
|
line: {
|
|
15
15
|
borderRadius: 16,
|
|
16
16
|
borderWidth: 1
|
|
17
|
+
},
|
|
18
|
+
"pulse-outside": {
|
|
19
|
+
borderRadius: 16,
|
|
20
|
+
borderWidth: 1
|
|
21
|
+
},
|
|
22
|
+
"pulse-inner": {
|
|
23
|
+
borderRadius: 16,
|
|
24
|
+
borderWidth: 1
|
|
17
25
|
}
|
|
18
|
-
},
|
|
26
|
+
}, ne = {
|
|
19
27
|
sm: {
|
|
20
28
|
dark: {
|
|
21
|
-
strokeOpacity: 0.
|
|
22
|
-
innerOpacity: 0.
|
|
23
|
-
bloomOpacity: 0.
|
|
29
|
+
strokeOpacity: 0.46,
|
|
30
|
+
innerOpacity: 0.24,
|
|
31
|
+
bloomOpacity: 0.38,
|
|
24
32
|
innerShadow: "rgba(255, 255, 255, 0.3)",
|
|
25
33
|
saturation: 1.2
|
|
26
34
|
},
|
|
27
35
|
light: {
|
|
28
|
-
strokeOpacity: 0.
|
|
29
|
-
innerOpacity: 0.
|
|
30
|
-
bloomOpacity: 0.
|
|
36
|
+
strokeOpacity: 0.12,
|
|
37
|
+
innerOpacity: 0.3,
|
|
38
|
+
bloomOpacity: 0.16,
|
|
31
39
|
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
32
|
-
saturation:
|
|
40
|
+
saturation: 1.8
|
|
33
41
|
}
|
|
34
42
|
},
|
|
35
43
|
md: {
|
|
36
44
|
dark: {
|
|
37
|
-
strokeOpacity: 0.
|
|
38
|
-
innerOpacity: 0.
|
|
39
|
-
bloomOpacity: 0.
|
|
45
|
+
strokeOpacity: 0.26,
|
|
46
|
+
innerOpacity: 0.42,
|
|
47
|
+
bloomOpacity: 0.24,
|
|
40
48
|
innerShadow: "rgba(255, 255, 255, 0.27)",
|
|
41
49
|
saturation: 1.2
|
|
42
50
|
},
|
|
43
51
|
light: {
|
|
44
|
-
strokeOpacity: 0.
|
|
45
|
-
innerOpacity: 0.
|
|
46
|
-
bloomOpacity: 0.
|
|
52
|
+
strokeOpacity: 0.12,
|
|
53
|
+
innerOpacity: 0.26,
|
|
54
|
+
bloomOpacity: 0.34,
|
|
47
55
|
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
48
|
-
saturation:
|
|
56
|
+
saturation: 1.5
|
|
49
57
|
}
|
|
50
58
|
},
|
|
51
59
|
line: {
|
|
52
60
|
dark: {
|
|
53
|
-
strokeOpacity:
|
|
61
|
+
strokeOpacity: 1.14,
|
|
54
62
|
innerOpacity: 0.7,
|
|
55
63
|
bloomOpacity: 0.8,
|
|
56
64
|
innerShadow: "rgba(255, 255, 255, 0.1)",
|
|
57
65
|
saturation: 1.2
|
|
58
66
|
},
|
|
59
67
|
light: {
|
|
60
|
-
strokeOpacity: 0.
|
|
61
|
-
innerOpacity: 0.
|
|
62
|
-
bloomOpacity: 0.
|
|
68
|
+
strokeOpacity: 0.16,
|
|
69
|
+
innerOpacity: 0.32,
|
|
70
|
+
bloomOpacity: 0.3,
|
|
63
71
|
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
64
|
-
saturation: 1.
|
|
72
|
+
saturation: 1.95
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
// Pulse Outside — outward-blooming breathe (ported from v5 "Breathe Outside Uncropped" / c6)
|
|
76
|
+
"pulse-outside": {
|
|
77
|
+
dark: {
|
|
78
|
+
strokeOpacity: 0.94,
|
|
79
|
+
innerOpacity: 0.34,
|
|
80
|
+
bloomOpacity: 0.3,
|
|
81
|
+
innerShadow: "transparent",
|
|
82
|
+
saturation: 1.2,
|
|
83
|
+
brightness: 1.9,
|
|
84
|
+
// v5 Card 5 frames the card with a single 1px hairline (its box-shadow at
|
|
85
|
+
// 0.3). Wrapped components here already supply their own ~equivalent 1px
|
|
86
|
+
// border, so the beam must NOT add a second hairline on top or the edge
|
|
87
|
+
// reads brighter than v5. Kept at 0 to match v5's single-hairline look.
|
|
88
|
+
hairlineOpacity: 0
|
|
89
|
+
},
|
|
90
|
+
light: {
|
|
91
|
+
strokeOpacity: 1.96,
|
|
92
|
+
innerOpacity: 1.04,
|
|
93
|
+
bloomOpacity: 0.42,
|
|
94
|
+
innerShadow: "transparent",
|
|
95
|
+
saturation: 0.6,
|
|
96
|
+
brightness: 1.7,
|
|
97
|
+
hairlineOpacity: 0
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
// Pulse Inner — contained breathe (ported from v5 "Breathe" / c4)
|
|
101
|
+
"pulse-inner": {
|
|
102
|
+
dark: {
|
|
103
|
+
strokeOpacity: 1.54,
|
|
104
|
+
innerOpacity: 0.44,
|
|
105
|
+
bloomOpacity: 0.66,
|
|
106
|
+
innerShadow: "transparent",
|
|
107
|
+
saturation: 1.2,
|
|
108
|
+
brightness: 0.75
|
|
109
|
+
},
|
|
110
|
+
light: {
|
|
111
|
+
strokeOpacity: 0.32,
|
|
112
|
+
innerOpacity: 0.4,
|
|
113
|
+
bloomOpacity: 0.8,
|
|
114
|
+
innerShadow: "transparent",
|
|
115
|
+
saturation: 0.75,
|
|
116
|
+
brightness: 1.3
|
|
65
117
|
}
|
|
66
118
|
}
|
|
67
|
-
},
|
|
68
|
-
dark: { ...
|
|
69
|
-
light: { ...
|
|
70
|
-
},
|
|
119
|
+
}, ha = {
|
|
120
|
+
dark: { ...ne.md.dark },
|
|
121
|
+
light: { ...ne.md.light }
|
|
122
|
+
}, C = {
|
|
71
123
|
colorful: {
|
|
72
124
|
border: [
|
|
73
125
|
{ color: "rgb(255, 50, 100)", pos: "33% -7.4%", size: "70px 40px" },
|
|
@@ -128,7 +180,7 @@ const ce = {
|
|
|
128
180
|
spike: { primary: "rgb(255, 140, 80)", secondary: "rgba(255, 100, 60, 0.98)" },
|
|
129
181
|
spikeLt: { primary: "rgb(200, 80, 40)", secondary: "rgb(220, 120, 30)" }
|
|
130
182
|
}
|
|
131
|
-
},
|
|
183
|
+
}, He = {
|
|
132
184
|
colorful: {
|
|
133
185
|
border: [
|
|
134
186
|
{ color: "rgb(50, 200, 80)", pos: "2% 68%", size: "9px 18px" },
|
|
@@ -218,34 +270,34 @@ const ce = {
|
|
|
218
270
|
]
|
|
219
271
|
}
|
|
220
272
|
};
|
|
221
|
-
function
|
|
222
|
-
return
|
|
273
|
+
function Pe(t) {
|
|
274
|
+
return He[t].border.map((a) => `radial-gradient(ellipse ${a.size} at ${a.pos}, ${a.color}, transparent)`).join(`,
|
|
223
275
|
`);
|
|
224
276
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
277
|
+
function Be(t) {
|
|
278
|
+
return He[t].inner.map((a) => `radial-gradient(ellipse ${a.size} at ${a.pos}, ${a.color}, transparent)`).join(`,
|
|
227
279
|
`);
|
|
228
280
|
}
|
|
229
|
-
function
|
|
230
|
-
return
|
|
281
|
+
function Ee(t) {
|
|
282
|
+
return C[t].border.map((a) => `radial-gradient(ellipse ${a.size} at ${a.pos}, ${a.color}, transparent)`).join(`,
|
|
231
283
|
`);
|
|
232
284
|
}
|
|
233
|
-
function
|
|
234
|
-
const e =
|
|
235
|
-
return e.border.map((
|
|
236
|
-
const o =
|
|
237
|
-
return `radial-gradient(ellipse ${
|
|
238
|
-
const
|
|
239
|
-
return `${Math.round(
|
|
240
|
-
}).join(" ")} at ${
|
|
285
|
+
function Ae(t) {
|
|
286
|
+
const e = C[t], a = t === "mono" ? 0.225 : 0.45;
|
|
287
|
+
return e.border.map((r) => {
|
|
288
|
+
const o = r.color.replace("rgb(", "rgba(").replace(")", `, ${a})`);
|
|
289
|
+
return `radial-gradient(ellipse ${r.size.split(" ").map((n) => {
|
|
290
|
+
const c = parseInt(n);
|
|
291
|
+
return `${Math.round(c * 0.9)}px`;
|
|
292
|
+
}).join(" ")} at ${r.pos}, ${o}, transparent)`;
|
|
241
293
|
}).join(`,
|
|
242
294
|
`);
|
|
243
295
|
}
|
|
244
|
-
function
|
|
245
|
-
const a =
|
|
296
|
+
function _e(t, e) {
|
|
297
|
+
const a = C[t];
|
|
246
298
|
return e ? a.spike : a.spikeLt;
|
|
247
299
|
}
|
|
248
|
-
const
|
|
300
|
+
const je = {
|
|
249
301
|
colorful: {
|
|
250
302
|
dark: [
|
|
251
303
|
{ color: "rgb(255, 50, 100)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
@@ -343,14 +395,14 @@ const me = {
|
|
|
343
395
|
]
|
|
344
396
|
}
|
|
345
397
|
};
|
|
346
|
-
function
|
|
347
|
-
return
|
|
348
|
-
const
|
|
349
|
-
return `radial-gradient(ellipse calc(${o.sizeW}px * var(--beam-w-${a})) calc(${o.sizeH}px * var(--beam-h-${a})) at calc(var(--beam-x-${a}) * 100%${
|
|
398
|
+
function Te(t, e, a) {
|
|
399
|
+
return je[t][e ? "dark" : "light"].map((o) => {
|
|
400
|
+
const s = o.offsetX === 0 ? "" : o.offsetX > 0 ? ` + ${o.offsetX}px` : ` - ${Math.abs(o.offsetX)}px`, n = o.offsetY === 0 ? "" : o.offsetY > 0 ? ` + ${o.offsetY}px` : ` - ${Math.abs(o.offsetY)}px`;
|
|
401
|
+
return `radial-gradient(ellipse calc(${o.sizeW}px * var(--beam-w-${a})) calc(${o.sizeH}px * var(--beam-h-${a})) at calc(var(--beam-x-${a}) * 100%${s}) calc(100%${n}), ${o.color}, transparent)`;
|
|
350
402
|
}).join(`,
|
|
351
403
|
`);
|
|
352
404
|
}
|
|
353
|
-
const
|
|
405
|
+
const Ne = {
|
|
354
406
|
colorful: [
|
|
355
407
|
{ color: "rgba(255, 50, 100, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
356
408
|
{ color: "rgba(40, 180, 220, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
@@ -396,14 +448,14 @@ const xe = {
|
|
|
396
448
|
{ color: "rgba(255, 70, 70, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
397
449
|
]
|
|
398
450
|
};
|
|
399
|
-
function
|
|
400
|
-
return
|
|
401
|
-
const o =
|
|
402
|
-
return `radial-gradient(ellipse calc(${
|
|
451
|
+
function Ve(t, e) {
|
|
452
|
+
return Ne[t].map((r) => {
|
|
453
|
+
const o = r.offsetX === 0 ? "" : r.offsetX > 0 ? ` + ${r.offsetX}px` : ` - ${Math.abs(r.offsetX)}px`, s = r.offsetY === 0 ? "" : ` - ${Math.abs(r.offsetY)}px`;
|
|
454
|
+
return `radial-gradient(ellipse calc(${r.sizeW}px * var(--beam-w-${e})) calc(${r.sizeH}px * var(--beam-h-${e})) at calc(var(--beam-x-${e}) * 100%${o}) calc(100%${s}), ${r.color}, transparent)`;
|
|
403
455
|
}).join(`,
|
|
404
456
|
`);
|
|
405
457
|
}
|
|
406
|
-
const
|
|
458
|
+
const De = {
|
|
407
459
|
colorful: {
|
|
408
460
|
dark: {
|
|
409
461
|
spikes: [
|
|
@@ -495,83 +547,259 @@ const ze = {
|
|
|
495
547
|
}
|
|
496
548
|
}
|
|
497
549
|
};
|
|
498
|
-
function
|
|
499
|
-
const a =
|
|
550
|
+
function U(t, e) {
|
|
551
|
+
const a = t.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*[\d.]+\s*\)$/);
|
|
500
552
|
if (a) return `rgba(${a[1]}, ${a[2]}, ${a[3]}, ${e})`;
|
|
501
|
-
const
|
|
502
|
-
return
|
|
503
|
-
}
|
|
504
|
-
function
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
radial-gradient(ellipse calc(
|
|
517
|
-
radial-gradient(ellipse calc(
|
|
518
|
-
radial-gradient(ellipse calc(
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
radial-gradient(ellipse calc(
|
|
523
|
-
radial-gradient(ellipse calc(
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
radial-gradient(ellipse calc(
|
|
553
|
+
const r = t.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
554
|
+
return r ? `rgba(${r[1]}, ${r[2]}, ${r[3]}, ${e})` : t;
|
|
555
|
+
}
|
|
556
|
+
function q(t, e) {
|
|
557
|
+
const a = t.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
558
|
+
if (a) return `rgba(${a[1]}, ${a[2]}, ${a[3]}, ${(parseFloat(a[4]) * e).toFixed(2)})`;
|
|
559
|
+
const r = t.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
560
|
+
return r ? `rgba(${r[1]}, ${r[2]}, ${r[3]}, ${e.toFixed(2)})` : t;
|
|
561
|
+
}
|
|
562
|
+
function Ue(t, e, a) {
|
|
563
|
+
const r = _e(t, e), o = De[t][e ? "dark" : "light"], s = t === "mono", n = s ? 0.14 : 1, c = s ? q(r.primary, 0.14) : r.primary, f = s ? q(r.primary, 0.09) : r.primary, p = s ? q(r.secondary, 0.12) : r.secondary, m = s ? U(r.secondary, 0.06) : U(r.secondary, 0.49), i = o.spikes.map(
|
|
564
|
+
($) => s ? { color1: q($.color1, n), color2: q($.color2, n * 0.7) } : $
|
|
565
|
+
), b = s ? "12px" : "0.8px", l = s ? "14px" : "2px", v = s ? "12px" : "1.2px", d = s ? "10px" : "0.6px", g = s ? "42px" : "92px", w = s ? "38px" : "72px", Y = s ? "40px" : "85px", y = s ? "32px" : "60px", H = s ? "12px" : "1px", x = s ? "rgba(255, 255, 255, 0.5)" : "rgba(255, 255, 255, 1)", W = s ? "rgba(255, 255, 255, 0.45)" : "rgba(255, 255, 255, 0.9)", k = s ? "rgba(255, 255, 255, 0.25)" : "rgba(255, 255, 255, 0.5)", u = s ? "rgba(255, 255, 255, 0.15)" : "rgba(255, 255, 255, 0.3)", X = s ? "rgba(255, 255, 255, 0.06)" : "rgba(255, 255, 255, 0.12)", h = s ? "rgba(255, 255, 255, 0.015)" : "rgba(255, 255, 255, 0.03)";
|
|
566
|
+
if (e)
|
|
567
|
+
return `radial-gradient(ellipse calc(${b} * var(--beam-spike-${a})) calc(${g} * var(--beam-h-${a})) at 8% calc(100% - 2px), ${c}, ${f} 30%, transparent 88%),
|
|
568
|
+
radial-gradient(ellipse calc(10px * var(--beam-spike2-${a})) calc(35px * var(--beam-h-${a})) at 22% calc(100% - 4px), ${p}, ${m} 50%, transparent 95%),
|
|
569
|
+
radial-gradient(ellipse calc(${l} * (2 - var(--beam-spike-${a}))) calc(${w} * var(--beam-h-${a})) at 36% calc(100% - 3px), ${i[0].color1}, ${i[0].color2} 40%, transparent 90%),
|
|
570
|
+
radial-gradient(ellipse calc(14px * var(--beam-spike2-${a})) calc(28px * var(--beam-h-${a})) at 50% calc(100% - 2px), ${i[1].color1}, ${i[1].color2} 55%, transparent 96%),
|
|
571
|
+
radial-gradient(ellipse calc(${v} * (2 - var(--beam-spike2-${a}))) calc(${Y} * var(--beam-h-${a})) at 64% calc(100% - 4px), ${i[2].color1}, ${i[2].color2} 35%, transparent 89%),
|
|
572
|
+
radial-gradient(ellipse calc(7px * var(--beam-spike-${a})) calc(45px * var(--beam-h-${a})) at 78% calc(100% - 2px), ${i[3].color1}, ${i[3].color2} 48%, transparent 94%),
|
|
573
|
+
radial-gradient(ellipse calc(${d} * (2 - var(--beam-spike-${a}))) calc(${y} * var(--beam-h-${a})) at 92% calc(100% - 3px), ${i[4].color1}, ${i[4].color2} 42%, transparent 91%),
|
|
574
|
+
radial-gradient(ellipse calc(21px * var(--beam-spike-${a})) calc(15px * var(--beam-spike2-${a})) at calc(var(--beam-x-${a}) * 100%) calc(100% + 1px), ${x} 0%, ${W} 20%, ${k} 50%, transparent 100%),
|
|
575
|
+
radial-gradient(ellipse calc(42px * var(--beam-w-${a})) calc(40px * var(--beam-h-${a})) at calc(var(--beam-x-${a}) * 100%) 100%, ${u} 0%, ${X} 25%, ${h} 55%, transparent 80%)`;
|
|
576
|
+
{
|
|
577
|
+
const $ = s ? q(r.primary, 0.11) : U(r.primary, 0.85), S = s ? q(r.secondary, 0.09) : U(r.secondary, 0.7);
|
|
578
|
+
return `radial-gradient(ellipse calc(${b} * var(--beam-spike-${a})) calc(${g} * var(--beam-h-${a})) at 8% calc(100% - 2px), ${c}, ${$} 30%, transparent 88%),
|
|
579
|
+
radial-gradient(ellipse calc(10px * var(--beam-spike2-${a})) calc(35px * var(--beam-h-${a})) at 22% calc(100% - 4px), ${p}, ${S} 50%, transparent 95%),
|
|
580
|
+
radial-gradient(ellipse calc(${l} * (2 - var(--beam-spike-${a}))) calc(${w} * var(--beam-h-${a})) at 36% calc(100% - 3px), ${i[0].color1}, ${i[0].color2} 40%, transparent 90%),
|
|
581
|
+
radial-gradient(ellipse calc(14px * var(--beam-spike2-${a})) calc(28px * var(--beam-h-${a})) at 50% calc(100% - 2px), ${i[1].color1}, ${i[1].color2} 55%, transparent 96%),
|
|
582
|
+
radial-gradient(ellipse calc(${v} * (2 - var(--beam-spike2-${a}))) calc(${Y} * var(--beam-h-${a})) at 64% calc(100% - 4px), ${i[2].color1}, ${i[2].color2} 35%, transparent 89%),
|
|
583
|
+
radial-gradient(ellipse calc(7px * var(--beam-spike-${a})) calc(45px * var(--beam-h-${a})) at 78% calc(100% - 2px), ${i[3].color1}, ${i[3].color2} 48%, transparent 94%),
|
|
584
|
+
radial-gradient(ellipse calc(${H} * (2 - var(--beam-spike-${a}))) calc(${y} * var(--beam-h-${a})) at 92% calc(100% - 3px), ${i[4].color1}, ${i[4].color2} 42%, transparent 91%),
|
|
528
585
|
radial-gradient(ellipse calc(50px * var(--beam-w-${a})) calc(32px * var(--beam-h-${a})) at calc(var(--beam-x-${a}) * 100%) calc(100%), rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.18) 30%, rgba(0, 0, 0, 0.03) 60%, transparent 85%)`;
|
|
529
586
|
}
|
|
530
587
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
}
|
|
553
|
-
|
|
588
|
+
const Xe = [
|
|
589
|
+
{ region: 1, quad: "tl" },
|
|
590
|
+
{ region: 2, quad: "tl" },
|
|
591
|
+
{ region: 3, quad: "bl" },
|
|
592
|
+
{ region: 1, quad: "bl" },
|
|
593
|
+
{ region: 2, quad: "br" },
|
|
594
|
+
{ region: 3, quad: "br" },
|
|
595
|
+
{ region: 1, quad: "tr" },
|
|
596
|
+
{ region: 2, quad: "tr" },
|
|
597
|
+
{ region: 3, quad: "tr" }
|
|
598
|
+
], Ke = [
|
|
599
|
+
[65, 35],
|
|
600
|
+
[55, 30],
|
|
601
|
+
[35, 65],
|
|
602
|
+
[15, 30],
|
|
603
|
+
[173, 28],
|
|
604
|
+
[80, 22],
|
|
605
|
+
[69, 28],
|
|
606
|
+
[22, 38],
|
|
607
|
+
[47, 44]
|
|
608
|
+
], Qe = [
|
|
609
|
+
{ ci: 0, region: 1, quad: "tl", w: 84, h: 48 },
|
|
610
|
+
{ ci: 1, region: 2, quad: "tl", w: 72, h: 42 },
|
|
611
|
+
{ ci: 2, region: 3, quad: "bl", w: 48, h: 84 },
|
|
612
|
+
{ ci: 4, region: 2, quad: "br", w: 216, h: 38 },
|
|
613
|
+
{ ci: 5, region: 3, quad: "br", w: 102, h: 31 },
|
|
614
|
+
{ ci: 6, region: 1, quad: "tr", w: 89, h: 38 },
|
|
615
|
+
{ ci: 8, region: 3, quad: "tr", w: 62, h: 58 }
|
|
616
|
+
], ve = [
|
|
617
|
+
{ ci: 0, region: 1, quad: "tl", w: 80, h: 19, x: "27%", y: "0%" },
|
|
618
|
+
{ ci: 6, region: 2, quad: "tr", w: 74, h: 11, x: "73%", y: "-1%" },
|
|
619
|
+
{ ci: 7, region: 3, quad: "tr", w: 15, h: 44, x: "100%", y: "33%" },
|
|
620
|
+
{ ci: 8, region: 1, quad: "br", w: 19, h: 38, x: "101%", y: "72%" },
|
|
621
|
+
{ ci: 4, region: 2, quad: "br", w: 84, h: 13, x: "67%", y: "100%" },
|
|
622
|
+
{ ci: 1, region: 3, quad: "bl", w: 60, h: 21, x: "24%", y: "101%" },
|
|
623
|
+
{ ci: 2, region: 1, quad: "bl", w: 17, h: 40, x: "0%", y: "60%" },
|
|
624
|
+
{ ci: 3, region: 2, quad: "tl", w: 13, h: 32, x: "-1%", y: "28%" }
|
|
625
|
+
], Ze = [
|
|
626
|
+
{ ci: 0, region: 1, quad: "tl", w: 110, h: 30, x: "27%", y: "3%" },
|
|
627
|
+
{ ci: 6, region: 2, quad: "tr", w: 100, h: 20, x: "73%", y: "1%" },
|
|
628
|
+
{ ci: 7, region: 3, quad: "tr", w: 26, h: 62, x: "100%", y: "33%" },
|
|
629
|
+
{ ci: 8, region: 1, quad: "br", w: 30, h: 56, x: "101%", y: "72%" },
|
|
630
|
+
{ ci: 4, region: 2, quad: "br", w: 120, h: 22, x: "67%", y: "99%" },
|
|
631
|
+
{ ci: 1, region: 3, quad: "bl", w: 88, h: 32, x: "24%", y: "99%" },
|
|
632
|
+
{ ci: 2, region: 1, quad: "bl", w: 28, h: 58, x: "0%", y: "60%" }
|
|
633
|
+
];
|
|
634
|
+
function Je(t, e, a) {
|
|
635
|
+
const r = t.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
|
|
636
|
+
return `rgba(${r ? `${r[1]}, ${r[2]}, ${r[3]}` : "255, 255, 255"}, var(--bop-${e}-${a}))`;
|
|
637
|
+
}
|
|
638
|
+
function pe(t, e, a, r, o, s, n, c) {
|
|
639
|
+
return `radial-gradient(ellipse calc(${e}px * var(--bw${r}-${c}) * var(--pulse-glow-sx, 1)) calc(${a}px * var(--bh${r}-${c}) * var(--bgh-${c}) * var(--pulse-glow-sy, 1)) at calc(${s} + var(--bx${r}-${c})) calc(${n} + var(--by${r}-${c})), ${Je(t, o, c)}, transparent)`;
|
|
640
|
+
}
|
|
641
|
+
function ea(t, e) {
|
|
642
|
+
return C[t].border.map((a, r) => {
|
|
643
|
+
const { region: o, quad: s } = Xe[r], [n, c] = a.pos.split(" "), [f, p] = a.size.split(" ").map(parseFloat);
|
|
644
|
+
return pe(a.color, f, p, o, s, n, c, e);
|
|
645
|
+
}).join(`,
|
|
646
|
+
`);
|
|
647
|
+
}
|
|
648
|
+
function aa(t, e, a) {
|
|
649
|
+
const o = C[t].border.map((p, m) => {
|
|
650
|
+
const { region: i, quad: b } = Xe[m], [l, v] = p.pos.split(" "), [d, g] = Ke[m];
|
|
651
|
+
return pe(p.color, d, g, i, b, l, v, e);
|
|
652
|
+
}), s = a ? "255, 255, 255" : "0, 0, 0", n = a ? 0.18 : 0.08, f = [
|
|
653
|
+
["0%", "0%", "tl"],
|
|
654
|
+
["100%", "0%", "tr"],
|
|
655
|
+
["0%", "100%", "bl"],
|
|
656
|
+
["100%", "100%", "br"]
|
|
657
|
+
].map(
|
|
658
|
+
([p, m, i]) => `radial-gradient(ellipse 60px 60px at ${p} ${m}, rgba(${s}, calc(${n} * var(--bop-${i}-${e}))), transparent 70%)`
|
|
659
|
+
);
|
|
660
|
+
return [...o, ...f].join(`,
|
|
661
|
+
`);
|
|
662
|
+
}
|
|
663
|
+
function we(t, e, a) {
|
|
664
|
+
const r = C[e].border;
|
|
665
|
+
return t.map((o) => {
|
|
666
|
+
const s = r[o.ci], [n, c] = s.pos.split(" ");
|
|
667
|
+
return pe(s.color, o.w, o.h, o.region, o.quad, o.x ?? n, o.y ?? c, a);
|
|
668
|
+
}).join(`,
|
|
669
|
+
`);
|
|
670
|
+
}
|
|
671
|
+
function Ye(t, e, a) {
|
|
672
|
+
const r = C[e].border, o = +a.toFixed(3);
|
|
673
|
+
return t.map((s) => {
|
|
674
|
+
const n = r[s.ci], [c, f] = n.pos.split(" "), p = s.x ?? c, m = s.y ?? f, i = n.color.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/), b = i ? `${i[1]}, ${i[2]}, ${i[3]}` : "255, 255, 255";
|
|
675
|
+
return `radial-gradient(ellipse ${s.w}px ${s.h}px at ${p} ${m}, rgba(${b}, ${o}), transparent)`;
|
|
676
|
+
}).join(`,
|
|
677
|
+
`);
|
|
678
|
+
}
|
|
679
|
+
function A(t) {
|
|
680
|
+
return `
|
|
681
|
+
[data-beam="${t}"][data-paused],
|
|
682
|
+
[data-beam="${t}"][data-paused]::after,
|
|
683
|
+
[data-beam="${t}"][data-paused]::before,
|
|
684
|
+
[data-beam="${t}"][data-paused] [data-beam-bloom] {
|
|
685
|
+
animation-play-state: paused !important;
|
|
686
|
+
}`;
|
|
687
|
+
}
|
|
688
|
+
function Oe(t) {
|
|
689
|
+
const e = ["bw1", "bh1", "bw2", "bh2", "bw3", "bh3", "bgh", "bop-tl", "bop-tr", "bop-bl", "bop-br"], a = ["bx1", "by1", "bx2", "by2", "bx3", "by3"], r = e.map(
|
|
690
|
+
(s) => `@property --${s}-${t} {
|
|
691
|
+
syntax: "<number>";
|
|
692
|
+
initial-value: 1;
|
|
693
|
+
inherits: true;
|
|
694
|
+
}`
|
|
695
|
+
).join(`
|
|
696
|
+
|
|
697
|
+
`), o = a.map(
|
|
698
|
+
(s) => `@property --${s}-${t} {
|
|
699
|
+
syntax: "<length>";
|
|
700
|
+
initial-value: 0px;
|
|
701
|
+
inherits: true;
|
|
702
|
+
}`
|
|
703
|
+
).join(`
|
|
704
|
+
|
|
705
|
+
`);
|
|
706
|
+
return `${r}
|
|
707
|
+
|
|
708
|
+
${o}
|
|
709
|
+
|
|
710
|
+
@property --beam-opacity-${t} {
|
|
711
|
+
syntax: "<number>";
|
|
712
|
+
initial-value: 0;
|
|
713
|
+
inherits: true;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
@property --beam-hue-${t} {
|
|
717
|
+
syntax: "<angle>";
|
|
718
|
+
initial-value: 0deg;
|
|
719
|
+
inherits: true;
|
|
720
|
+
}`;
|
|
721
|
+
}
|
|
722
|
+
function be(t, e, a) {
|
|
723
|
+
const r = e === "dark", o = a / 2.3;
|
|
724
|
+
return t === "pulse-inner" ? {
|
|
725
|
+
sp: 0.28,
|
|
726
|
+
dr: r ? 33 : 40,
|
|
727
|
+
op: r ? 0.48 : 0.45,
|
|
728
|
+
gh: r ? 0.34 : 0.22,
|
|
729
|
+
bs: (r ? 1.9 : 2.6) * o,
|
|
730
|
+
ss: (r ? 2.6 : 4.6) * o,
|
|
731
|
+
ghs: (r ? 2.4 : 5.5) * o,
|
|
732
|
+
huePeriod: 12
|
|
733
|
+
} : {
|
|
734
|
+
sp: r ? 0.28 : 0.36,
|
|
735
|
+
dr: r ? 14 : 19,
|
|
736
|
+
op: r ? 0.46 : 0,
|
|
737
|
+
gh: r ? 0.16 : 0.58,
|
|
738
|
+
bs: (r ? 2.3 : 3.7) * o,
|
|
739
|
+
ss: (r ? 6.4 : 4.6) * o,
|
|
740
|
+
ghs: (r ? 2.4 : 3.8) * o,
|
|
741
|
+
huePeriod: 8
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
function ra(t, e) {
|
|
745
|
+
const { sp: a, dr: r, op: o, gh: s, bs: n, ss: c, ghs: f } = e;
|
|
746
|
+
return [
|
|
747
|
+
{ prop: `--bw1-${t}`, a: 1 - a, b: 1 + a * 1.1, period: c * 0.9, delay: 0, unit: "" },
|
|
748
|
+
{ prop: `--bh1-${t}`, a: 1 + a * 0.9, b: 1 - a * 0.85, period: c * 1.26, delay: 0, unit: "" },
|
|
749
|
+
{ prop: `--bx1-${t}`, a: -r, b: r * 0.9, period: n * 1.6, delay: 0, unit: "px" },
|
|
750
|
+
{ prop: `--by1-${t}`, a: r * 0.55, b: -r * 0.7, period: n * 1.6, delay: 0, unit: "px" },
|
|
751
|
+
{ prop: `--bw2-${t}`, a: 1 + a, b: 1 - a * 0.85, period: c * 1.1, delay: 0, unit: "" },
|
|
752
|
+
{ prop: `--bh2-${t}`, a: 1 - a * 0.8, b: 1 + a * 1.05, period: c * 0.81, delay: 0, unit: "" },
|
|
753
|
+
{ prop: `--bx2-${t}`, a: r * 0.8, b: -r * 0.9, period: n * 1.88, delay: 0, unit: "px" },
|
|
754
|
+
{ prop: `--by2-${t}`, a: -r, b: r * 0.65, period: n * 1.88, delay: 0, unit: "px" },
|
|
755
|
+
{ prop: `--bw3-${t}`, a: 1 - a * 0.6, b: 1 + a * 1.15, period: c * 0.98, delay: 0, unit: "" },
|
|
756
|
+
{ prop: `--bh3-${t}`, a: 1 + a * 0.75, b: 1 - a, period: c * 1.4, delay: 0, unit: "" },
|
|
757
|
+
{ prop: `--bx3-${t}`, a: -r * 0.6, b: r, period: n * 1.45, delay: 0, unit: "px" },
|
|
758
|
+
{ prop: `--by3-${t}`, a: -r * 0.85, b: r * 0.45, period: n * 1.45, delay: 0, unit: "px" },
|
|
759
|
+
{ prop: `--bgh-${t}`, a: 1 - s, b: 1 + s, period: f, delay: 0, unit: "" },
|
|
760
|
+
{ prop: `--bop-tl-${t}`, a: 1 - o, b: 1, period: n, delay: 0, unit: "" },
|
|
761
|
+
{ prop: `--bop-tr-${t}`, a: 1 - o, b: 1, period: n * 1.32, delay: n * 0.28, unit: "" },
|
|
762
|
+
{ prop: `--bop-bl-${t}`, a: 1 - o, b: 1, period: n * 0.84, delay: n * 0.55, unit: "" },
|
|
763
|
+
{ prop: `--bop-br-${t}`, a: 1 - o, b: 1, period: n * 1.58, delay: n * 0.83, unit: "" }
|
|
764
|
+
];
|
|
765
|
+
}
|
|
766
|
+
function ta(t, e, a, r, o, s) {
|
|
767
|
+
if (t !== "pulse-inner" && t !== "pulse-outside") return null;
|
|
768
|
+
const n = be(t, e, a);
|
|
769
|
+
return {
|
|
770
|
+
oscillators: ra(s, n),
|
|
771
|
+
hue: o ? null : { prop: `--beam-hue-${s}`, range: r, period: n.huePeriod }
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
function K(t, e, a) {
|
|
775
|
+
return ` animation: ${e}-${t} ${a}s ease forwards;`;
|
|
776
|
+
}
|
|
777
|
+
function oa(t) {
|
|
778
|
+
const { size: e } = t;
|
|
779
|
+
return e === "line" ? pa(t) : e === "sm" ? sa(t) : e === "pulse-inner" ? na(t) : e === "pulse-outside" ? ca(t) : ia(t);
|
|
780
|
+
}
|
|
781
|
+
function sa(t) {
|
|
554
782
|
const {
|
|
555
783
|
id: e,
|
|
556
784
|
borderRadius: a,
|
|
557
|
-
borderWidth:
|
|
785
|
+
borderWidth: r,
|
|
558
786
|
duration: o,
|
|
559
|
-
strokeOpacity:
|
|
560
|
-
innerOpacity:
|
|
561
|
-
bloomOpacity:
|
|
562
|
-
innerShadow:
|
|
563
|
-
colorVariant:
|
|
564
|
-
staticColors:
|
|
787
|
+
strokeOpacity: s,
|
|
788
|
+
innerOpacity: n,
|
|
789
|
+
bloomOpacity: c,
|
|
790
|
+
innerShadow: f,
|
|
791
|
+
colorVariant: p,
|
|
792
|
+
staticColors: m,
|
|
565
793
|
brightness: i,
|
|
566
|
-
saturation:
|
|
794
|
+
saturation: b,
|
|
567
795
|
hueRange: l,
|
|
568
|
-
theme:
|
|
569
|
-
} =
|
|
796
|
+
theme: v
|
|
797
|
+
} = t, d = Math.max(0, a - r), g = p === "mono" ? 0.5 : 1, w = s * g, Y = n * g, y = c * g, H = m ? "" : `animation: beam-hue-shift-${e} 12s ease-in-out infinite;`, x = m ? "" : `
|
|
570
798
|
@keyframes beam-hue-shift-${e} {
|
|
571
|
-
0% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
572
|
-
50% { filter: hue-rotate(${l}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
573
|
-
100% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
574
|
-
}`,
|
|
799
|
+
0% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
800
|
+
50% { filter: hue-rotate(${l}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
801
|
+
100% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
802
|
+
}`, W = v === "dark", k = W ? `conic-gradient(
|
|
575
803
|
from var(--beam-angle-${e}),
|
|
576
804
|
transparent 0%, transparent 54%,
|
|
577
805
|
rgba(255, 255, 255, 0.1) 57%,
|
|
@@ -593,7 +821,7 @@ function ve(r) {
|
|
|
593
821
|
rgba(0, 0, 0, 0.2) 72%,
|
|
594
822
|
rgba(0, 0, 0, 0.08) 75%,
|
|
595
823
|
transparent 78%, transparent 100%
|
|
596
|
-
)`,
|
|
824
|
+
)`, u = Pe(p), X = Be(p), h = W ? `conic-gradient(
|
|
597
825
|
from var(--beam-angle-${e}),
|
|
598
826
|
transparent 0%, transparent 58%,
|
|
599
827
|
rgba(255, 255, 255, 0.03) 62%,
|
|
@@ -621,7 +849,7 @@ function ve(r) {
|
|
|
621
849
|
rgba(0, 0, 0, 0.08) 75%,
|
|
622
850
|
rgba(0, 0, 0, 0.02) 78%,
|
|
623
851
|
transparent 82%
|
|
624
|
-
)`,
|
|
852
|
+
)`, $ = `conic-gradient(
|
|
625
853
|
from var(--beam-angle-${e}),
|
|
626
854
|
transparent 0%, transparent 22%,
|
|
627
855
|
rgba(255, 255, 255, 0.12) 28%, rgba(255, 255, 255, 0.4) 36%,
|
|
@@ -665,10 +893,10 @@ function ve(r) {
|
|
|
665
893
|
content: "";
|
|
666
894
|
position: absolute;
|
|
667
895
|
inset: 0;
|
|
668
|
-
border-radius: ${
|
|
669
|
-
padding: ${
|
|
896
|
+
border-radius: ${d}px;
|
|
897
|
+
padding: ${r}px;
|
|
670
898
|
clip-path: inset(0 round ${a}px);
|
|
671
|
-
background: ${
|
|
899
|
+
background: ${k},${u};
|
|
672
900
|
-webkit-mask:
|
|
673
901
|
conic-gradient(
|
|
674
902
|
from var(--beam-angle-${e}),
|
|
@@ -695,8 +923,8 @@ function ve(r) {
|
|
|
695
923
|
mask-composite: intersect, exclude;
|
|
696
924
|
pointer-events: none;
|
|
697
925
|
z-index: 2;
|
|
698
|
-
opacity: calc(var(--beam-opacity-${e}) * ${
|
|
699
|
-
${
|
|
926
|
+
opacity: calc(var(--beam-opacity-${e}) * ${w.toFixed(2)} * var(--beam-strength, 1));
|
|
927
|
+
${H}
|
|
700
928
|
}
|
|
701
929
|
|
|
702
930
|
[data-beam="${e}"][data-active]::before,
|
|
@@ -707,30 +935,30 @@ function ve(r) {
|
|
|
707
935
|
border-radius: ${a}px;
|
|
708
936
|
clip-path: inset(0 round ${a}px);
|
|
709
937
|
background: ${X};
|
|
710
|
-
box-shadow: inset 0 0 5px 1px ${
|
|
711
|
-
-webkit-mask-image: ${
|
|
938
|
+
box-shadow: inset 0 0 5px 1px ${f};
|
|
939
|
+
-webkit-mask-image: ${$};
|
|
712
940
|
-webkit-mask-composite: source-over;
|
|
713
|
-
mask-image: ${
|
|
941
|
+
mask-image: ${$};
|
|
714
942
|
mask-composite: add;
|
|
715
943
|
pointer-events: none;
|
|
716
944
|
z-index: 1;
|
|
717
|
-
opacity: calc(var(--beam-opacity-${e}) * ${
|
|
718
|
-
${
|
|
945
|
+
opacity: calc(var(--beam-opacity-${e}) * ${Y.toFixed(2)} * var(--beam-strength, 1));
|
|
946
|
+
${H}
|
|
719
947
|
}
|
|
720
948
|
|
|
721
949
|
[data-beam="${e}"] [data-beam-bloom] {
|
|
722
950
|
display: none;
|
|
723
951
|
position: absolute;
|
|
724
952
|
inset: 0;
|
|
725
|
-
border-radius: ${
|
|
953
|
+
border-radius: ${d}px;
|
|
726
954
|
clip-path: inset(0 round ${a}px);
|
|
727
|
-
background: ${
|
|
955
|
+
background: ${h};
|
|
728
956
|
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
729
957
|
-webkit-mask-composite: xor;
|
|
730
958
|
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
731
959
|
mask-composite: exclude;
|
|
732
|
-
padding: ${
|
|
733
|
-
filter: blur(8px) brightness(${i.toFixed(2)}) saturate(${
|
|
960
|
+
padding: ${r}px;
|
|
961
|
+
filter: blur(8px) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)});
|
|
734
962
|
pointer-events: none;
|
|
735
963
|
z-index: 3;
|
|
736
964
|
opacity: 0;
|
|
@@ -739,7 +967,7 @@ function ve(r) {
|
|
|
739
967
|
[data-beam="${e}"][data-active] [data-beam-bloom],
|
|
740
968
|
[data-beam="${e}"][data-fading] [data-beam-bloom] {
|
|
741
969
|
display: block;
|
|
742
|
-
opacity: calc(var(--beam-opacity-${e}) * ${
|
|
970
|
+
opacity: calc(var(--beam-opacity-${e}) * ${y.toFixed(2)} * var(--beam-strength, 1));
|
|
743
971
|
}
|
|
744
972
|
|
|
745
973
|
@keyframes beam-spin-${e} {
|
|
@@ -754,31 +982,32 @@ function ve(r) {
|
|
|
754
982
|
from { --beam-opacity-${e}: 1; }
|
|
755
983
|
to { --beam-opacity-${e}: 0; }
|
|
756
984
|
}
|
|
757
|
-
${
|
|
985
|
+
${x}
|
|
986
|
+
${A(e)}
|
|
758
987
|
`;
|
|
759
988
|
}
|
|
760
|
-
function
|
|
989
|
+
function ia(t) {
|
|
761
990
|
const {
|
|
762
991
|
id: e,
|
|
763
992
|
borderRadius: a,
|
|
764
|
-
borderWidth:
|
|
993
|
+
borderWidth: r,
|
|
765
994
|
duration: o,
|
|
766
|
-
strokeOpacity:
|
|
767
|
-
innerOpacity:
|
|
768
|
-
bloomOpacity:
|
|
769
|
-
innerShadow:
|
|
770
|
-
colorVariant:
|
|
771
|
-
staticColors:
|
|
995
|
+
strokeOpacity: s,
|
|
996
|
+
innerOpacity: n,
|
|
997
|
+
bloomOpacity: c,
|
|
998
|
+
innerShadow: f,
|
|
999
|
+
colorVariant: p,
|
|
1000
|
+
staticColors: m,
|
|
772
1001
|
brightness: i,
|
|
773
|
-
saturation:
|
|
1002
|
+
saturation: b,
|
|
774
1003
|
hueRange: l,
|
|
775
|
-
theme:
|
|
776
|
-
} =
|
|
1004
|
+
theme: v
|
|
1005
|
+
} = t, d = Math.max(0, a - r), g = p === "mono" ? 0.5 : 1, w = s * g, Y = n * g, y = c * g, H = m ? "" : `animation: beam-hue-shift-${e} 12s ease-in-out infinite;`, x = m ? "" : `
|
|
777
1006
|
@keyframes beam-hue-shift-${e} {
|
|
778
|
-
0% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
779
|
-
50% { filter: hue-rotate(${l}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
780
|
-
100% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
781
|
-
}`,
|
|
1007
|
+
0% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
1008
|
+
50% { filter: hue-rotate(${l}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
1009
|
+
100% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
1010
|
+
}`, W = v === "dark", k = W ? `conic-gradient(
|
|
782
1011
|
from var(--beam-angle-${e}),
|
|
783
1012
|
transparent 0%, transparent 54%,
|
|
784
1013
|
rgba(255, 255, 255, 0.1) 57%,
|
|
@@ -800,7 +1029,7 @@ function ye(r) {
|
|
|
800
1029
|
rgba(0, 0, 0, 0.2) 72%,
|
|
801
1030
|
rgba(0, 0, 0, 0.08) 75%,
|
|
802
1031
|
transparent 78%, transparent 100%
|
|
803
|
-
)`,
|
|
1032
|
+
)`, u = Ee(p), X = Ae(p), h = W ? `conic-gradient(
|
|
804
1033
|
from var(--beam-angle-${e}),
|
|
805
1034
|
transparent 0%, transparent 58%,
|
|
806
1035
|
rgba(255, 255, 255, 0.03) 62%,
|
|
@@ -865,10 +1094,10 @@ function ye(r) {
|
|
|
865
1094
|
content: "";
|
|
866
1095
|
position: absolute;
|
|
867
1096
|
inset: 0;
|
|
868
|
-
border-radius: ${
|
|
869
|
-
padding: ${
|
|
1097
|
+
border-radius: ${d}px;
|
|
1098
|
+
padding: ${r}px;
|
|
870
1099
|
clip-path: inset(0 round ${a}px);
|
|
871
|
-
background: ${
|
|
1100
|
+
background: ${k},${u};
|
|
872
1101
|
-webkit-mask:
|
|
873
1102
|
conic-gradient(
|
|
874
1103
|
from var(--beam-angle-${e}),
|
|
@@ -895,8 +1124,8 @@ function ye(r) {
|
|
|
895
1124
|
mask-composite: intersect, exclude;
|
|
896
1125
|
pointer-events: none;
|
|
897
1126
|
z-index: 2;
|
|
898
|
-
opacity: calc(var(--beam-opacity-${e}) * ${
|
|
899
|
-
${
|
|
1127
|
+
opacity: calc(var(--beam-opacity-${e}) * ${w.toFixed(2)} * var(--beam-strength, 1));
|
|
1128
|
+
${H}
|
|
900
1129
|
}
|
|
901
1130
|
|
|
902
1131
|
[data-beam="${e}"][data-active]::before,
|
|
@@ -906,7 +1135,7 @@ function ye(r) {
|
|
|
906
1135
|
inset: 0;
|
|
907
1136
|
border-radius: ${a}px;
|
|
908
1137
|
background: ${X};
|
|
909
|
-
box-shadow: inset 0 0 9px 1px ${
|
|
1138
|
+
box-shadow: inset 0 0 9px 1px ${f};
|
|
910
1139
|
-webkit-mask-image:
|
|
911
1140
|
conic-gradient(
|
|
912
1141
|
from var(--beam-angle-${e}),
|
|
@@ -933,24 +1162,24 @@ function ye(r) {
|
|
|
933
1162
|
mask-composite: intersect, add;
|
|
934
1163
|
pointer-events: none;
|
|
935
1164
|
z-index: 1;
|
|
936
|
-
opacity: calc(var(--beam-opacity-${e}) * ${
|
|
1165
|
+
opacity: calc(var(--beam-opacity-${e}) * ${Y.toFixed(2)} * var(--beam-strength, 1));
|
|
937
1166
|
clip-path: inset(0 round ${a}px);
|
|
938
|
-
${
|
|
1167
|
+
${H}
|
|
939
1168
|
}
|
|
940
1169
|
|
|
941
1170
|
[data-beam="${e}"] [data-beam-bloom] {
|
|
942
1171
|
display: none;
|
|
943
1172
|
position: absolute;
|
|
944
1173
|
inset: 0;
|
|
945
|
-
border-radius: ${
|
|
1174
|
+
border-radius: ${d}px;
|
|
946
1175
|
clip-path: inset(0 round ${a}px);
|
|
947
|
-
background: ${
|
|
1176
|
+
background: ${h};
|
|
948
1177
|
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
949
1178
|
-webkit-mask-composite: xor;
|
|
950
1179
|
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
951
1180
|
mask-composite: exclude;
|
|
952
|
-
padding: ${
|
|
953
|
-
filter: blur(8px) brightness(${i.toFixed(2)}) saturate(${
|
|
1181
|
+
padding: ${r}px;
|
|
1182
|
+
filter: blur(8px) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)});
|
|
954
1183
|
pointer-events: none;
|
|
955
1184
|
z-index: 3;
|
|
956
1185
|
opacity: 0;
|
|
@@ -959,7 +1188,7 @@ function ye(r) {
|
|
|
959
1188
|
[data-beam="${e}"][data-active] [data-beam-bloom],
|
|
960
1189
|
[data-beam="${e}"][data-fading] [data-beam-bloom] {
|
|
961
1190
|
display: block;
|
|
962
|
-
opacity: calc(var(--beam-opacity-${e}) * ${
|
|
1191
|
+
opacity: calc(var(--beam-opacity-${e}) * ${y.toFixed(2)} * var(--beam-strength, 1));
|
|
963
1192
|
}
|
|
964
1193
|
|
|
965
1194
|
@keyframes beam-spin-${e} {
|
|
@@ -974,37 +1203,284 @@ function ye(r) {
|
|
|
974
1203
|
from { --beam-opacity-${e}: 1; }
|
|
975
1204
|
to { --beam-opacity-${e}: 0; }
|
|
976
1205
|
}
|
|
977
|
-
${
|
|
1206
|
+
${x}
|
|
1207
|
+
${A(e)}
|
|
978
1208
|
`;
|
|
979
1209
|
}
|
|
980
|
-
function
|
|
1210
|
+
function na(t) {
|
|
981
1211
|
const {
|
|
982
1212
|
id: e,
|
|
983
1213
|
borderRadius: a,
|
|
984
|
-
borderWidth:
|
|
1214
|
+
borderWidth: r,
|
|
985
1215
|
duration: o,
|
|
986
|
-
strokeOpacity:
|
|
987
|
-
innerOpacity:
|
|
988
|
-
bloomOpacity:
|
|
989
|
-
|
|
1216
|
+
strokeOpacity: s,
|
|
1217
|
+
innerOpacity: n,
|
|
1218
|
+
bloomOpacity: c,
|
|
1219
|
+
colorVariant: f,
|
|
1220
|
+
staticColors: p,
|
|
1221
|
+
brightness: m,
|
|
1222
|
+
saturation: i,
|
|
1223
|
+
hueRange: b,
|
|
1224
|
+
theme: l
|
|
1225
|
+
} = t, v = l === "dark", d = f === "mono" ? 0.5 : 1, g = (s * d).toFixed(2), w = (n * d).toFixed(2), Y = (c * d).toFixed(2), { op: y } = be("pulse-inner", l, o), H = 8, x = m.toFixed(2), W = i.toFixed(2), k = p ? `filter: brightness(${x}) saturate(${W});` : `filter: hue-rotate(var(--beam-hue-${e})) brightness(${x}) saturate(${W});`, u = `filter: blur(${H}px) brightness(${x}) saturate(${W});`, X = ea(f, e), h = aa(f, e, v), $ = Ye(Qe, f, 1 - y * 0.5);
|
|
1226
|
+
return `
|
|
1227
|
+
${Oe(e)}
|
|
1228
|
+
|
|
1229
|
+
[data-beam="${e}"] {
|
|
1230
|
+
position: relative;
|
|
1231
|
+
border-radius: ${a}px;
|
|
1232
|
+
overflow: hidden;
|
|
1233
|
+
isolation: isolate;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
[data-beam="${e}"][data-active] {
|
|
1237
|
+
${K(e, "beam-fade-in", 0.6)}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
[data-beam="${e}"][data-fading] {
|
|
1241
|
+
${K(e, "beam-fade-out", 0.5)}
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
[data-beam="${e}"][data-active]::after,
|
|
1245
|
+
[data-beam="${e}"][data-fading]::after {
|
|
1246
|
+
content: "";
|
|
1247
|
+
position: absolute;
|
|
1248
|
+
inset: 0;
|
|
1249
|
+
border-radius: ${a}px;
|
|
1250
|
+
padding: ${r}px;
|
|
1251
|
+
clip-path: inset(0 round ${a}px);
|
|
1252
|
+
background: ${X};
|
|
1253
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1254
|
+
-webkit-mask-composite: xor;
|
|
1255
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1256
|
+
mask-composite: exclude;
|
|
1257
|
+
pointer-events: none;
|
|
1258
|
+
z-index: 2;
|
|
1259
|
+
will-change: opacity, filter;
|
|
1260
|
+
opacity: calc(var(--beam-opacity-${e}) * ${g} * var(--beam-strength, 1));
|
|
1261
|
+
${k}
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
[data-beam="${e}"][data-active]::before,
|
|
1265
|
+
[data-beam="${e}"][data-fading]::before {
|
|
1266
|
+
content: "";
|
|
1267
|
+
position: absolute;
|
|
1268
|
+
inset: 0;
|
|
1269
|
+
border-radius: ${a}px;
|
|
1270
|
+
clip-path: inset(0 round ${a}px);
|
|
1271
|
+
background: ${h};
|
|
1272
|
+
-webkit-mask-image:
|
|
1273
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
1274
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
1275
|
+
-webkit-mask-composite: source-over;
|
|
1276
|
+
mask-image:
|
|
1277
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
1278
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
1279
|
+
mask-composite: add;
|
|
1280
|
+
pointer-events: none;
|
|
1281
|
+
z-index: 1;
|
|
1282
|
+
will-change: opacity, filter;
|
|
1283
|
+
opacity: calc(var(--beam-opacity-${e}) * ${w} * var(--beam-strength, 1));
|
|
1284
|
+
${k}
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
[data-beam="${e}"] [data-beam-bloom] {
|
|
1288
|
+
display: none;
|
|
1289
|
+
position: absolute;
|
|
1290
|
+
inset: 0;
|
|
1291
|
+
border-radius: ${a}px;
|
|
1292
|
+
clip-path: inset(0 round ${a}px);
|
|
1293
|
+
background: ${$};
|
|
1294
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1295
|
+
-webkit-mask-composite: xor;
|
|
1296
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1297
|
+
mask-composite: exclude;
|
|
1298
|
+
padding: ${r}px;
|
|
1299
|
+
pointer-events: none;
|
|
1300
|
+
z-index: 3;
|
|
1301
|
+
will-change: opacity;
|
|
1302
|
+
opacity: 0;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
[data-beam="${e}"][data-active] [data-beam-bloom],
|
|
1306
|
+
[data-beam="${e}"][data-fading] [data-beam-bloom] {
|
|
1307
|
+
display: block;
|
|
1308
|
+
opacity: calc(var(--beam-opacity-${e}) * ${Y} * var(--beam-strength, 1));
|
|
1309
|
+
${u}
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
@keyframes beam-fade-in-${e} { to { --beam-opacity-${e}: 1; } }
|
|
1313
|
+
@keyframes beam-fade-out-${e} { from { --beam-opacity-${e}: 1; } to { --beam-opacity-${e}: 0; } }
|
|
1314
|
+
${A(e)}
|
|
1315
|
+
|
|
1316
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1317
|
+
[data-beam="${e}"][data-active],
|
|
1318
|
+
[data-beam="${e}"][data-fading],
|
|
1319
|
+
[data-beam="${e}"][data-active]::after,
|
|
1320
|
+
[data-beam="${e}"][data-fading]::after,
|
|
1321
|
+
[data-beam="${e}"][data-active]::before,
|
|
1322
|
+
[data-beam="${e}"][data-fading]::before,
|
|
1323
|
+
[data-beam="${e}"][data-active] [data-beam-bloom],
|
|
1324
|
+
[data-beam="${e}"][data-fading] [data-beam-bloom] {
|
|
1325
|
+
animation: none !important;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
`;
|
|
1329
|
+
}
|
|
1330
|
+
function ca(t) {
|
|
1331
|
+
const {
|
|
1332
|
+
id: e,
|
|
1333
|
+
borderRadius: a,
|
|
1334
|
+
duration: r,
|
|
1335
|
+
strokeOpacity: o,
|
|
1336
|
+
innerOpacity: s,
|
|
1337
|
+
bloomOpacity: n,
|
|
990
1338
|
colorVariant: c,
|
|
991
1339
|
staticColors: f,
|
|
1340
|
+
brightness: p,
|
|
1341
|
+
saturation: m,
|
|
1342
|
+
hueRange: i,
|
|
1343
|
+
theme: b,
|
|
1344
|
+
hairlineOpacity: l = 0
|
|
1345
|
+
} = t, v = b === "dark", d = c === "mono" ? 0.5 : 1, g = (o * d).toFixed(2), w = (s * d).toFixed(2), Y = (n * d).toFixed(2), y = v ? "70, 70, 70" : "0, 0, 0", H = l.toFixed(2), x = `linear-gradient(rgba(${y}, ${H}), rgba(${y}, ${H}))`, { op: W } = be("pulse-outside", b, r), k = 0.95, u = 0.9, X = v ? 3 : 6, h = v ? 22.5 : 15, $ = p.toFixed(2), S = m.toFixed(2), Z = f ? `filter: brightness(${$}) saturate(${S});` : `filter: hue-rotate(var(--beam-hue-${e})) brightness(${$}) saturate(${S});`, J = f ? `filter: blur(${X}px) brightness(${$}) saturate(${S});` : `filter: blur(${X}px) hue-rotate(var(--beam-hue-${e})) brightness(${$}) saturate(${S});`, ee = `filter: blur(${h}px) brightness(${$}) saturate(${S});`, E = we(ve, c, e), _ = we(ve, c, e), ae = Ye(Ze, c, 1 - W * 0.5), R = l > 0 ? `${E},
|
|
1346
|
+
${x}` : E;
|
|
1347
|
+
return `
|
|
1348
|
+
${Oe(e)}
|
|
1349
|
+
|
|
1350
|
+
[data-beam="${e}"] {
|
|
1351
|
+
position: relative;
|
|
1352
|
+
border-radius: ${a}px;
|
|
1353
|
+
overflow: visible;
|
|
1354
|
+
isolation: isolate;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
[data-beam="${e}"][data-active] {
|
|
1358
|
+
${K(e, "beam-fade-in", 0.6)}
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
[data-beam="${e}"][data-fading] {
|
|
1362
|
+
${K(e, "beam-fade-out", 0.5)}
|
|
1363
|
+
}
|
|
1364
|
+
${l > 0 ? `
|
|
1365
|
+
/* Idle hairline — painted above the (opaque) child in the inner 1px edge ring so
|
|
1366
|
+
it overlaps a standard inset component border exactly. */
|
|
1367
|
+
[data-beam="${e}"]::after {
|
|
1368
|
+
content: "";
|
|
1369
|
+
position: absolute;
|
|
1370
|
+
inset: 0;
|
|
1371
|
+
border-radius: ${a}px;
|
|
1372
|
+
padding: 1px;
|
|
1373
|
+
clip-path: inset(0 round ${a}px);
|
|
1374
|
+
background: ${x};
|
|
1375
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1376
|
+
-webkit-mask-composite: xor;
|
|
1377
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1378
|
+
mask-composite: exclude;
|
|
1379
|
+
pointer-events: none;
|
|
1380
|
+
z-index: 2;
|
|
1381
|
+
}
|
|
1382
|
+
` : ""}
|
|
1383
|
+
[data-beam="${e}"][data-active]::after,
|
|
1384
|
+
[data-beam="${e}"][data-fading]::after {
|
|
1385
|
+
content: "";
|
|
1386
|
+
position: absolute;
|
|
1387
|
+
inset: 0;
|
|
1388
|
+
border-radius: ${a}px;
|
|
1389
|
+
padding: 1px;
|
|
1390
|
+
clip-path: inset(0 round ${a}px);
|
|
1391
|
+
background: ${R};
|
|
1392
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1393
|
+
-webkit-mask-composite: xor;
|
|
1394
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
1395
|
+
mask-composite: exclude;
|
|
1396
|
+
pointer-events: none;
|
|
1397
|
+
z-index: 2;
|
|
1398
|
+
will-change: opacity, filter;
|
|
1399
|
+
opacity: calc(var(--beam-opacity-${e}) * ${g} * var(--beam-strength, 1));
|
|
1400
|
+
${Z}
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
[data-beam="${e}"][data-active]::before,
|
|
1404
|
+
[data-beam="${e}"][data-fading]::before {
|
|
1405
|
+
content: "";
|
|
1406
|
+
position: absolute;
|
|
1407
|
+
inset: -10px;
|
|
1408
|
+
z-index: -1;
|
|
1409
|
+
border-radius: ${a + 10}px;
|
|
1410
|
+
background: ${_};
|
|
1411
|
+
transform: scale(${k}, ${u});
|
|
1412
|
+
pointer-events: none;
|
|
1413
|
+
will-change: opacity, filter;
|
|
1414
|
+
opacity: calc(var(--beam-opacity-${e}) * ${w} * var(--beam-strength, 1));
|
|
1415
|
+
${J}
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
[data-beam="${e}"] [data-beam-bloom] {
|
|
1419
|
+
display: none;
|
|
1420
|
+
position: absolute;
|
|
1421
|
+
inset: -30px;
|
|
1422
|
+
z-index: -1;
|
|
1423
|
+
border-radius: ${a + 30}px;
|
|
1424
|
+
background: ${ae};
|
|
1425
|
+
transform: scale(${k}, ${u});
|
|
1426
|
+
pointer-events: none;
|
|
1427
|
+
will-change: transform;
|
|
1428
|
+
opacity: 0;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
[data-beam="${e}"][data-active] [data-beam-bloom],
|
|
1432
|
+
[data-beam="${e}"][data-fading] [data-beam-bloom] {
|
|
1433
|
+
display: block;
|
|
1434
|
+
opacity: calc(var(--beam-opacity-${e}) * ${Y} * var(--beam-strength, 1));
|
|
1435
|
+
${ee}
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
@keyframes beam-fade-in-${e} { to { --beam-opacity-${e}: 1; } }
|
|
1439
|
+
@keyframes beam-fade-out-${e} { from { --beam-opacity-${e}: 1; } to { --beam-opacity-${e}: 0; } }
|
|
1440
|
+
${A(e)}
|
|
1441
|
+
|
|
1442
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1443
|
+
[data-beam="${e}"][data-active],
|
|
1444
|
+
[data-beam="${e}"][data-fading],
|
|
1445
|
+
[data-beam="${e}"][data-active]::after,
|
|
1446
|
+
[data-beam="${e}"][data-fading]::after,
|
|
1447
|
+
[data-beam="${e}"][data-active]::before,
|
|
1448
|
+
[data-beam="${e}"][data-fading]::before,
|
|
1449
|
+
[data-beam="${e}"][data-active] [data-beam-bloom],
|
|
1450
|
+
[data-beam="${e}"][data-fading] [data-beam-bloom] {
|
|
1451
|
+
animation: none !important;
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
`;
|
|
1455
|
+
}
|
|
1456
|
+
function pa(t) {
|
|
1457
|
+
const {
|
|
1458
|
+
id: e,
|
|
1459
|
+
borderRadius: a,
|
|
1460
|
+
borderWidth: r,
|
|
1461
|
+
duration: o,
|
|
1462
|
+
strokeOpacity: s,
|
|
1463
|
+
innerOpacity: n,
|
|
1464
|
+
bloomOpacity: c,
|
|
1465
|
+
innerShadow: f,
|
|
1466
|
+
colorVariant: p,
|
|
1467
|
+
staticColors: m,
|
|
992
1468
|
brightness: i,
|
|
993
|
-
saturation:
|
|
1469
|
+
saturation: b,
|
|
994
1470
|
hueRange: l,
|
|
995
|
-
theme:
|
|
996
|
-
} =
|
|
1471
|
+
theme: v
|
|
1472
|
+
} = t, d = Math.max(0, a - r), g = v === "dark", w = s, Y = n, y = c, H = m ? "" : `animation: beam-hue-shift-${e} 12s ease-in-out infinite;`, x = m ? "" : `animation: beam-hue-shift-bloom-${e} 8s ease-in-out infinite;`, W = m ? "" : `
|
|
997
1473
|
@keyframes beam-hue-shift-${e} {
|
|
998
|
-
0% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
999
|
-
50% { filter: hue-rotate(${l}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
1000
|
-
100% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
1474
|
+
0% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
1475
|
+
50% { filter: hue-rotate(${l}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
1476
|
+
100% { filter: hue-rotate(-${l}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
1001
1477
|
}
|
|
1002
1478
|
|
|
1003
1479
|
@keyframes beam-hue-shift-bloom-${e} {
|
|
1004
|
-
0% { filter: blur(8px) hue-rotate(-${l + 10}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
1005
|
-
50% { filter: blur(8px) hue-rotate(${l + 10}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
1006
|
-
100% { filter: blur(8px) hue-rotate(-${l + 10}deg) brightness(${i.toFixed(2)}) saturate(${
|
|
1007
|
-
}`,
|
|
1480
|
+
0% { filter: blur(8px) hue-rotate(-${l + 10}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
1481
|
+
50% { filter: blur(8px) hue-rotate(${l + 10}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
1482
|
+
100% { filter: blur(8px) hue-rotate(-${l + 10}deg) brightness(${i.toFixed(2)}) saturate(${b.toFixed(2)}); }
|
|
1483
|
+
}`, k = g ? `radial-gradient(
|
|
1008
1484
|
ellipse calc(24px * var(--beam-w-${e})) calc(28px * var(--beam-h-${e})) at calc(var(--beam-x-${e}) * 100%) calc(100% + 2px),
|
|
1009
1485
|
rgba(255, 255, 255, 0.38) 0%,
|
|
1010
1486
|
rgba(255, 255, 255, 0.12) 30%,
|
|
@@ -1014,7 +1490,7 @@ function we(r) {
|
|
|
1014
1490
|
rgba(0, 0, 0, 0.6) 0%,
|
|
1015
1491
|
rgba(0, 0, 0, 0.25) 35%,
|
|
1016
1492
|
transparent 70%
|
|
1017
|
-
)`,
|
|
1493
|
+
)`, u = Te(p, g, e), X = Ve(p, e), h = Ue(p, g, e), $ = p === "mono" ? "filter: blur(6px);" : "";
|
|
1018
1494
|
return `
|
|
1019
1495
|
@property --beam-x-${e} {
|
|
1020
1496
|
syntax: "<number>";
|
|
@@ -1089,10 +1565,10 @@ function we(r) {
|
|
|
1089
1565
|
content: "";
|
|
1090
1566
|
position: absolute;
|
|
1091
1567
|
inset: 0;
|
|
1092
|
-
border-radius: ${
|
|
1093
|
-
padding: ${
|
|
1568
|
+
border-radius: ${d}px;
|
|
1569
|
+
padding: ${r}px;
|
|
1094
1570
|
clip-path: inset(0 round ${a}px);
|
|
1095
|
-
background: ${
|
|
1571
|
+
background: ${k}, ${u};
|
|
1096
1572
|
-webkit-mask:
|
|
1097
1573
|
radial-gradient(
|
|
1098
1574
|
ellipse calc(78px * var(--beam-w-${e})) calc(60px * var(--beam-h-${e})) at calc(var(--beam-x-${e}) * 100%) 100%,
|
|
@@ -1111,8 +1587,8 @@ function we(r) {
|
|
|
1111
1587
|
mask-composite: intersect, exclude;
|
|
1112
1588
|
pointer-events: none;
|
|
1113
1589
|
z-index: 2;
|
|
1114
|
-
opacity: calc(var(--beam-opacity-${e}) * var(--beam-edge-${e}) * ${
|
|
1115
|
-
${
|
|
1590
|
+
opacity: calc(var(--beam-opacity-${e}) * var(--beam-edge-${e}) * ${w.toFixed(2)} * var(--beam-strength, 1));
|
|
1591
|
+
${H}
|
|
1116
1592
|
}
|
|
1117
1593
|
|
|
1118
1594
|
[data-beam="${e}"][data-active]::before,
|
|
@@ -1122,7 +1598,7 @@ function we(r) {
|
|
|
1122
1598
|
inset: 0;
|
|
1123
1599
|
border-radius: ${a}px;
|
|
1124
1600
|
background: ${X};
|
|
1125
|
-
box-shadow: inset 0 0 9px 1px ${
|
|
1601
|
+
box-shadow: inset 0 0 9px 1px ${f};
|
|
1126
1602
|
-webkit-mask-image:
|
|
1127
1603
|
radial-gradient(
|
|
1128
1604
|
ellipse calc(78px * var(--beam-w-${e})) calc(60px * var(--beam-h-${e})) at calc(var(--beam-x-${e}) * 100%) 100%,
|
|
@@ -1141,16 +1617,16 @@ function we(r) {
|
|
|
1141
1617
|
mask-composite: intersect, add;
|
|
1142
1618
|
pointer-events: none;
|
|
1143
1619
|
z-index: 1;
|
|
1144
|
-
opacity: calc(var(--beam-opacity-${e}) * var(--beam-edge-${e}) * ${
|
|
1620
|
+
opacity: calc(var(--beam-opacity-${e}) * var(--beam-edge-${e}) * ${Y.toFixed(2)} * var(--beam-strength, 1));
|
|
1145
1621
|
clip-path: inset(0 round ${a}px);
|
|
1146
|
-
${
|
|
1622
|
+
${H}
|
|
1147
1623
|
}
|
|
1148
1624
|
|
|
1149
1625
|
[data-beam="${e}"] [data-beam-bloom] {
|
|
1150
1626
|
display: none;
|
|
1151
1627
|
position: absolute;
|
|
1152
1628
|
inset: 0;
|
|
1153
|
-
border-radius: ${
|
|
1629
|
+
border-radius: ${d}px;
|
|
1154
1630
|
clip-path: inset(0 round ${a}px);
|
|
1155
1631
|
padding: 0;
|
|
1156
1632
|
-webkit-mask: radial-gradient(
|
|
@@ -1163,7 +1639,8 @@ function we(r) {
|
|
|
1163
1639
|
white 0%, rgba(255, 255, 255, 0.5) 35%, transparent 100%
|
|
1164
1640
|
);
|
|
1165
1641
|
mask-composite: add;
|
|
1166
|
-
background: ${
|
|
1642
|
+
background: ${h};
|
|
1643
|
+
${$}
|
|
1167
1644
|
pointer-events: none;
|
|
1168
1645
|
z-index: 3;
|
|
1169
1646
|
opacity: 0;
|
|
@@ -1172,8 +1649,8 @@ function we(r) {
|
|
|
1172
1649
|
[data-beam="${e}"][data-active] [data-beam-bloom],
|
|
1173
1650
|
[data-beam="${e}"][data-fading] [data-beam-bloom] {
|
|
1174
1651
|
display: block;
|
|
1175
|
-
opacity: calc(var(--beam-opacity-${e}) * var(--beam-edge-${e}) * ${
|
|
1176
|
-
${
|
|
1652
|
+
opacity: calc(var(--beam-opacity-${e}) * var(--beam-edge-${e}) * ${y.toFixed(2)} * var(--beam-strength, 1));
|
|
1653
|
+
${x}
|
|
1177
1654
|
}
|
|
1178
1655
|
|
|
1179
1656
|
@keyframes beam-travel-${e} {
|
|
@@ -1230,126 +1707,209 @@ function we(r) {
|
|
|
1230
1707
|
from { --beam-opacity-${e}: 1; }
|
|
1231
1708
|
to { --beam-opacity-${e}: 0; }
|
|
1232
1709
|
}
|
|
1233
|
-
${
|
|
1710
|
+
${W}
|
|
1711
|
+
${A(e)}
|
|
1234
1712
|
`;
|
|
1235
1713
|
}
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1714
|
+
const Q = /* @__PURE__ */ new Set();
|
|
1715
|
+
let B = null, ce = 0;
|
|
1716
|
+
const ba = 1e3 / 30 - 2, la = Math.PI * 2;
|
|
1717
|
+
function We(t) {
|
|
1718
|
+
return (1 - Math.cos(la * t)) / 2;
|
|
1719
|
+
}
|
|
1720
|
+
function Fe(t) {
|
|
1721
|
+
if (B = requestAnimationFrame(Fe), t - ce < ba) return;
|
|
1722
|
+
ce = t;
|
|
1723
|
+
const e = t / 1e3;
|
|
1724
|
+
Q.forEach(({ el: a, config: r }) => {
|
|
1725
|
+
for (const o of r.oscillators) {
|
|
1726
|
+
const s = (e - o.delay) / o.period, n = o.a + (o.b - o.a) * We(s);
|
|
1727
|
+
a.style.setProperty(
|
|
1728
|
+
o.prop,
|
|
1729
|
+
o.unit === "px" ? `${n.toFixed(2)}px` : n.toFixed(4)
|
|
1730
|
+
);
|
|
1731
|
+
}
|
|
1732
|
+
if (r.hue) {
|
|
1733
|
+
const { prop: o, range: s, period: n } = r.hue, c = -s + 2 * s * We(e / n);
|
|
1734
|
+
a.style.setProperty(o, `${c.toFixed(2)}deg`);
|
|
1735
|
+
}
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
function fa() {
|
|
1739
|
+
B == null && (ce = 0, B = requestAnimationFrame(Fe));
|
|
1740
|
+
}
|
|
1741
|
+
function da() {
|
|
1742
|
+
Q.size === 0 && B != null && (cancelAnimationFrame(B), B = null);
|
|
1743
|
+
}
|
|
1744
|
+
function ga(t, e) {
|
|
1745
|
+
const a = { el: t, config: e };
|
|
1746
|
+
return Q.add(a), fa(), () => {
|
|
1747
|
+
Q.delete(a), da();
|
|
1748
|
+
};
|
|
1749
|
+
}
|
|
1750
|
+
function ma() {
|
|
1751
|
+
const [t, e] = L(() => typeof window > "u" || window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
|
1752
|
+
return P(() => {
|
|
1239
1753
|
if (typeof window > "u") return;
|
|
1240
|
-
const a = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
1754
|
+
const a = window.matchMedia("(prefers-color-scheme: dark)"), r = (o) => {
|
|
1241
1755
|
e(o.matches ? "dark" : "light");
|
|
1242
1756
|
};
|
|
1243
|
-
return a.addEventListener("change",
|
|
1244
|
-
}, []),
|
|
1757
|
+
return a.addEventListener("change", r), () => a.removeEventListener("change", r);
|
|
1758
|
+
}, []), t;
|
|
1245
1759
|
}
|
|
1246
|
-
function
|
|
1247
|
-
return
|
|
1760
|
+
function $a(t, e) {
|
|
1761
|
+
return t === "auto" ? e : t;
|
|
1248
1762
|
}
|
|
1249
|
-
const
|
|
1763
|
+
const za = Ge(
|
|
1250
1764
|
function({
|
|
1251
1765
|
children: e,
|
|
1252
1766
|
size: a = "md",
|
|
1253
|
-
colorVariant:
|
|
1767
|
+
colorVariant: r = "colorful",
|
|
1254
1768
|
theme: o = "dark",
|
|
1255
|
-
staticColors:
|
|
1256
|
-
duration:
|
|
1257
|
-
active:
|
|
1258
|
-
borderRadius:
|
|
1259
|
-
brightness:
|
|
1260
|
-
saturation:
|
|
1769
|
+
staticColors: s = !1,
|
|
1770
|
+
duration: n,
|
|
1771
|
+
active: c = !0,
|
|
1772
|
+
borderRadius: f,
|
|
1773
|
+
brightness: p,
|
|
1774
|
+
saturation: m,
|
|
1261
1775
|
hueRange: i = 30,
|
|
1262
|
-
strength:
|
|
1776
|
+
strength: b = 1,
|
|
1263
1777
|
className: l,
|
|
1264
|
-
style:
|
|
1265
|
-
onActivate:
|
|
1266
|
-
onDeactivate:
|
|
1267
|
-
onAnimationEnd:
|
|
1268
|
-
...
|
|
1269
|
-
},
|
|
1270
|
-
const
|
|
1271
|
-
|
|
1272
|
-
if (
|
|
1273
|
-
const
|
|
1274
|
-
if (!
|
|
1275
|
-
const
|
|
1276
|
-
const
|
|
1277
|
-
if (!
|
|
1278
|
-
const
|
|
1279
|
-
!isNaN(
|
|
1778
|
+
style: v,
|
|
1779
|
+
onActivate: d,
|
|
1780
|
+
onDeactivate: g,
|
|
1781
|
+
onAnimationEnd: w,
|
|
1782
|
+
...Y
|
|
1783
|
+
}, y) {
|
|
1784
|
+
const x = Me().replace(/:/g, "-"), W = ma(), k = Ie(null), [u, X] = L(c), [h, $] = L(!1), [S, Z] = L(!0), [J, ee] = L(null), [E, _] = L({ x: 1, y: 1 });
|
|
1785
|
+
P(() => {
|
|
1786
|
+
if (f != null) return;
|
|
1787
|
+
const z = k.current;
|
|
1788
|
+
if (!z) return;
|
|
1789
|
+
const O = () => {
|
|
1790
|
+
const M = z.firstElementChild;
|
|
1791
|
+
if (!M) return;
|
|
1792
|
+
const se = getComputedStyle(M), I = parseFloat(se.borderTopLeftRadius);
|
|
1793
|
+
!isNaN(I) && I > 0 && ee(I);
|
|
1280
1794
|
};
|
|
1281
|
-
|
|
1282
|
-
const
|
|
1283
|
-
return
|
|
1284
|
-
}, [
|
|
1285
|
-
|
|
1286
|
-
}, [
|
|
1287
|
-
|
|
1288
|
-
(u)
|
|
1289
|
-
|
|
1290
|
-
|
|
1795
|
+
O();
|
|
1796
|
+
const G = new MutationObserver(O);
|
|
1797
|
+
return G.observe(z, { childList: !0, subtree: !1 }), () => G.disconnect();
|
|
1798
|
+
}, [f, e]), P(() => {
|
|
1799
|
+
c && !u && !h ? X(!0) : !c && u && !h && $(!0);
|
|
1800
|
+
}, [c, u, h]), P(() => {
|
|
1801
|
+
const z = k.current;
|
|
1802
|
+
if (!z || typeof IntersectionObserver > "u") return;
|
|
1803
|
+
const O = new IntersectionObserver(
|
|
1804
|
+
(G) => {
|
|
1805
|
+
for (const M of G) Z(M.isIntersecting);
|
|
1806
|
+
},
|
|
1807
|
+
// Start animating slightly before the element scrolls into view.
|
|
1808
|
+
{ rootMargin: "256px" }
|
|
1809
|
+
);
|
|
1810
|
+
return O.observe(z), () => O.disconnect();
|
|
1811
|
+
}, []), P(() => {
|
|
1812
|
+
if (a !== "pulse-outside") {
|
|
1813
|
+
_({ x: 1, y: 1 });
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1816
|
+
const z = k.current;
|
|
1817
|
+
if (!z) return;
|
|
1818
|
+
const O = 350, G = 140, M = 0.35, se = 4, I = (V) => Math.max(M, Math.min(se, V)), ge = () => {
|
|
1819
|
+
const V = z.firstElementChild;
|
|
1820
|
+
if (!V) return;
|
|
1821
|
+
const D = V.getBoundingClientRect();
|
|
1822
|
+
if (!D.width || !D.height) return;
|
|
1823
|
+
const xe = +I(D.width / O).toFixed(3), ue = +I(D.height / G).toFixed(3);
|
|
1824
|
+
_((ie) => ie.x === xe && ie.y === ue ? ie : { x: xe, y: ue });
|
|
1825
|
+
};
|
|
1826
|
+
if (ge(), typeof ResizeObserver > "u") return;
|
|
1827
|
+
const me = z.firstElementChild;
|
|
1828
|
+
if (!me) return;
|
|
1829
|
+
const $e = new ResizeObserver(ge);
|
|
1830
|
+
return $e.observe(me), () => $e.disconnect();
|
|
1831
|
+
}, [a, e]);
|
|
1832
|
+
const ae = ye(
|
|
1833
|
+
(z) => {
|
|
1834
|
+
const O = z.animationName;
|
|
1835
|
+
O.includes("fade-out") ? (X(!1), $(!1), g == null || g()) : O.includes("fade-in") && (d == null || d()), w == null || w(z);
|
|
1291
1836
|
},
|
|
1292
|
-
[
|
|
1293
|
-
),
|
|
1294
|
-
() =>
|
|
1295
|
-
id:
|
|
1296
|
-
borderRadius:
|
|
1297
|
-
borderWidth:
|
|
1298
|
-
duration:
|
|
1299
|
-
strokeOpacity:
|
|
1300
|
-
innerOpacity:
|
|
1301
|
-
bloomOpacity:
|
|
1302
|
-
innerShadow:
|
|
1837
|
+
[d, g, w]
|
|
1838
|
+
), R = $a(o, W), F = ne[a][R], re = Le[a], te = a === "pulse-inner" || a === "pulse-outside", le = f ?? J ?? re.borderRadius, j = n ?? (a === "line" ? 3.1 : te ? 2.3 : 1.96), fe = m ?? F.saturation, de = p ?? F.brightness ?? 1.3, T = a === "line" ? Math.min(i, 13) : i, N = r === "mono" ? !0 : s, Se = ke(
|
|
1839
|
+
() => oa({
|
|
1840
|
+
id: x,
|
|
1841
|
+
borderRadius: le,
|
|
1842
|
+
borderWidth: re.borderWidth,
|
|
1843
|
+
duration: j,
|
|
1844
|
+
strokeOpacity: F.strokeOpacity,
|
|
1845
|
+
innerOpacity: F.innerOpacity,
|
|
1846
|
+
bloomOpacity: F.bloomOpacity,
|
|
1847
|
+
innerShadow: F.innerShadow,
|
|
1303
1848
|
size: a,
|
|
1304
|
-
colorVariant:
|
|
1305
|
-
staticColors:
|
|
1306
|
-
brightness:
|
|
1307
|
-
saturation:
|
|
1308
|
-
hueRange:
|
|
1309
|
-
theme:
|
|
1849
|
+
colorVariant: r,
|
|
1850
|
+
staticColors: N,
|
|
1851
|
+
brightness: de,
|
|
1852
|
+
saturation: fe,
|
|
1853
|
+
hueRange: T,
|
|
1854
|
+
theme: R,
|
|
1855
|
+
hairlineOpacity: F.hairlineOpacity
|
|
1310
1856
|
}),
|
|
1311
1857
|
[
|
|
1312
|
-
|
|
1858
|
+
x,
|
|
1859
|
+
le,
|
|
1860
|
+
re.borderWidth,
|
|
1313
1861
|
j,
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
w.innerShadow,
|
|
1862
|
+
F.strokeOpacity,
|
|
1863
|
+
F.innerOpacity,
|
|
1864
|
+
F.bloomOpacity,
|
|
1865
|
+
F.innerShadow,
|
|
1866
|
+
F.hairlineOpacity,
|
|
1320
1867
|
a,
|
|
1321
|
-
|
|
1322
|
-
_,
|
|
1323
|
-
c,
|
|
1324
|
-
P,
|
|
1868
|
+
r,
|
|
1325
1869
|
N,
|
|
1326
|
-
|
|
1870
|
+
de,
|
|
1871
|
+
fe,
|
|
1872
|
+
T,
|
|
1873
|
+
R
|
|
1327
1874
|
]
|
|
1328
|
-
),
|
|
1329
|
-
(
|
|
1330
|
-
|
|
1875
|
+
), oe = ke(
|
|
1876
|
+
() => te ? ta(a, R, j, T, N, x) : null,
|
|
1877
|
+
[te, a, R, j, T, N, x]
|
|
1878
|
+
);
|
|
1879
|
+
P(() => {
|
|
1880
|
+
var O;
|
|
1881
|
+
if (!oe || !(u || h) || !S) return;
|
|
1882
|
+
const z = k.current;
|
|
1883
|
+
if (z && !(typeof window < "u" && ((O = window.matchMedia) != null && O.call(window, "(prefers-reduced-motion: reduce)").matches)))
|
|
1884
|
+
return ga(z, oe);
|
|
1885
|
+
}, [oe, u, h, S]);
|
|
1886
|
+
const Re = ye(
|
|
1887
|
+
(z) => {
|
|
1888
|
+
k.current = z, typeof y == "function" ? y(z) : y && (y.current = z);
|
|
1331
1889
|
},
|
|
1332
|
-
[
|
|
1333
|
-
),
|
|
1334
|
-
...
|
|
1335
|
-
"--beam-strength": Math.max(0, Math.min(1,
|
|
1890
|
+
[y]
|
|
1891
|
+
), qe = {
|
|
1892
|
+
...v ?? {},
|
|
1893
|
+
"--beam-strength": Math.max(0, Math.min(1, b)),
|
|
1894
|
+
...a === "pulse-outside" ? { "--pulse-glow-sx": E.x, "--pulse-glow-sy": E.y } : {}
|
|
1336
1895
|
};
|
|
1337
|
-
return /* @__PURE__ */
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1896
|
+
return /* @__PURE__ */ he(Ce, { children: [
|
|
1897
|
+
/* @__PURE__ */ ze("style", { children: Se }),
|
|
1898
|
+
/* @__PURE__ */ he(
|
|
1340
1899
|
"div",
|
|
1341
1900
|
{
|
|
1342
|
-
...
|
|
1343
|
-
ref:
|
|
1344
|
-
"data-beam":
|
|
1345
|
-
"data-active":
|
|
1346
|
-
"data-fading":
|
|
1901
|
+
...Y,
|
|
1902
|
+
ref: Re,
|
|
1903
|
+
"data-beam": x,
|
|
1904
|
+
"data-active": u && !h ? "" : void 0,
|
|
1905
|
+
"data-fading": h ? "" : void 0,
|
|
1906
|
+
"data-paused": u && !h && !S ? "" : void 0,
|
|
1347
1907
|
className: l,
|
|
1348
|
-
style:
|
|
1349
|
-
onAnimationEnd:
|
|
1908
|
+
style: qe,
|
|
1909
|
+
onAnimationEnd: ae,
|
|
1350
1910
|
children: [
|
|
1351
1911
|
e,
|
|
1352
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ ze("div", { "data-beam-bloom": !0 })
|
|
1353
1913
|
]
|
|
1354
1914
|
}
|
|
1355
1915
|
)
|
|
@@ -1357,9 +1917,9 @@ const Se = te(
|
|
|
1357
1917
|
}
|
|
1358
1918
|
);
|
|
1359
1919
|
export {
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1920
|
+
za as BorderBeam,
|
|
1921
|
+
za as default,
|
|
1922
|
+
Le as sizePresets,
|
|
1923
|
+
ne as sizeThemePresets,
|
|
1924
|
+
ha as themeColors
|
|
1365
1925
|
};
|