cos-design 3.0.0 → 3.0.2
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/CHANGELOG.md +29 -0
- package/README.md +192 -93
- package/dist/index.cjs +1 -1
- package/dist/index.js +286 -263
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47,25 +47,29 @@ import './index.css';var d = {
|
|
|
47
47
|
trigger: "cos-trigger-UDZqV",
|
|
48
48
|
hint: "cos-hint-XQUfv"
|
|
49
49
|
}, m = ({ text: e = "BURN", fontSize: r = 64, onComplete: i }) => {
|
|
50
|
-
let a = o(null), c = o(null), [d, f] = s(!1), [m, h] = s(!1), g = o(!1), _ =
|
|
50
|
+
let a = o(null), c = o(null), [d, f] = s(!1), [m, h] = s(!1), g = o(!1), _ = o(i);
|
|
51
|
+
n(() => {
|
|
52
|
+
_.current = i;
|
|
53
|
+
}, [i]);
|
|
54
|
+
let v = t(() => {
|
|
51
55
|
d || m || f(!0);
|
|
52
56
|
}, [d, m]);
|
|
53
57
|
return n(() => {
|
|
54
58
|
if (!d || m) return;
|
|
55
59
|
let t = a.current, n = c.current;
|
|
56
60
|
if (!t || !n) return;
|
|
57
|
-
let
|
|
58
|
-
n.width =
|
|
59
|
-
let
|
|
60
|
-
if (!
|
|
61
|
-
|
|
62
|
-
let
|
|
63
|
-
|
|
64
|
-
let
|
|
65
|
-
if (!
|
|
66
|
-
|
|
67
|
-
let v =
|
|
68
|
-
for (let e = 0; e <
|
|
61
|
+
let i = t.getBoundingClientRect(), o = window.devicePixelRatio || 1, s = Math.ceil(i.width), l = Math.ceil(i.height);
|
|
62
|
+
n.width = s * o, n.height = l * o, n.style.width = `${s}px`, n.style.height = `${l}px`;
|
|
63
|
+
let u = n.getContext("2d");
|
|
64
|
+
if (!u) return;
|
|
65
|
+
u.scale(o, o);
|
|
66
|
+
let f = document.createElement("canvas");
|
|
67
|
+
f.width = s * o, f.height = l * o;
|
|
68
|
+
let p = f.getContext("2d");
|
|
69
|
+
if (!p) return;
|
|
70
|
+
p.scale(o, o), p.font = `900 ${r}px system-ui, sans-serif`, p.textAlign = "center", p.textBaseline = "middle", p.fillStyle = "#f8fafc", p.fillText(e, s / 2, l / 2);
|
|
71
|
+
let v = p.getImageData(0, 0, s * o, l * o).data, y = [];
|
|
72
|
+
for (let e = 0; e < l; e += 4) for (let t = 0; t < s; t += 4) v[(Math.floor(e * o) * s * o + Math.floor(t * o)) * 4 + 3] > 128 && y.push({
|
|
69
73
|
x: t,
|
|
70
74
|
y: e,
|
|
71
75
|
vx: (Math.random() - .5) * 2,
|
|
@@ -74,25 +78,27 @@ import './index.css';var d = {
|
|
|
74
78
|
maxLife: .6 + Math.random() * .6,
|
|
75
79
|
size: 2 + Math.random() * 3
|
|
76
80
|
});
|
|
77
|
-
let b = 0, x = 0, S = (e, t) => {
|
|
81
|
+
let b = 0, x = 0, S = !1, C = (e, t) => {
|
|
82
|
+
if (S) return;
|
|
78
83
|
let n = Math.min((e - t) / 16, 2);
|
|
79
|
-
x += n * 16,
|
|
84
|
+
x += n * 16, u.clearRect(0, 0, s, l);
|
|
80
85
|
let r = 0;
|
|
81
86
|
for (let e of y) {
|
|
82
87
|
if (e.life -= n * .012 / e.maxLife, e.life <= 0) continue;
|
|
83
88
|
r++, e.x += e.vx * n, e.y += e.vy * n, e.vy += .04 * n;
|
|
84
89
|
let t = e.life, i = 1 - e.life, a = Math.max(0, 200 - i * 200), o = Math.max(0, 80 - i * 80);
|
|
85
|
-
|
|
90
|
+
u.globalAlpha = t, u.fillStyle = `rgb(255,${a},${o})`, u.beginPath(), u.arc(e.x, e.y, e.size * t, 0, Math.PI * 2), u.fill();
|
|
86
91
|
}
|
|
87
|
-
|
|
92
|
+
u.globalAlpha = 1, x < 2500 && r > 0 ? b = requestAnimationFrame((t) => C(t, e)) : S || (h(!0), g.current || (g.current = !0, _.current?.()));
|
|
93
|
+
};
|
|
94
|
+
return b = requestAnimationFrame((e) => C(e, e)), () => {
|
|
95
|
+
S = !0, cancelAnimationFrame(b);
|
|
88
96
|
};
|
|
89
|
-
return b = requestAnimationFrame((e) => S(e, e)), () => cancelAnimationFrame(b);
|
|
90
97
|
}, [
|
|
91
98
|
d,
|
|
92
99
|
m,
|
|
93
100
|
e,
|
|
94
|
-
r
|
|
95
|
-
i
|
|
101
|
+
r
|
|
96
102
|
]), /* @__PURE__ */ u("div", {
|
|
97
103
|
className: p.burnAway,
|
|
98
104
|
children: [
|
|
@@ -114,7 +120,7 @@ import './index.css';var d = {
|
|
|
114
120
|
!d && !m && /* @__PURE__ */ l("button", {
|
|
115
121
|
type: "button",
|
|
116
122
|
className: p.trigger,
|
|
117
|
-
onClick:
|
|
123
|
+
onClick: v,
|
|
118
124
|
children: "Ignite"
|
|
119
125
|
}),
|
|
120
126
|
m && /* @__PURE__ */ l("p", {
|
|
@@ -170,7 +176,10 @@ import './index.css';var d = {
|
|
|
170
176
|
});
|
|
171
177
|
(async () => {
|
|
172
178
|
if (!(!i || !navigator.mediaDevices?.getUserMedia)) try {
|
|
173
|
-
if (p = await navigator.mediaDevices.getUserMedia({ audio: !0 }), h)
|
|
179
|
+
if (p = await navigator.mediaDevices.getUserMedia({ audio: !0 }), h) {
|
|
180
|
+
p.getTracks().forEach((e) => e.stop()), p = null;
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
174
183
|
u = new AudioContext(), d = u.createAnalyser(), d.fftSize = 256, u.createMediaStreamSource(p).connect(d), f = new Uint8Array(d.frequencyBinCount);
|
|
175
184
|
} catch {}
|
|
176
185
|
})();
|
|
@@ -218,7 +227,7 @@ import './index.css';var d = {
|
|
|
218
227
|
}, S = {
|
|
219
228
|
canvasClock: "cos-canvasClock-QvdV3",
|
|
220
229
|
canvasTarget: "cos-canvasTarget-x-odC"
|
|
221
|
-
},
|
|
230
|
+
}, C = ({ width: e = 400, height: r = 400 }) => {
|
|
222
231
|
let i = o(null), a = Math.min(e, r), s = a / 2 - 16, c = a / 2, u = t((e) => {
|
|
223
232
|
e.clearRect(0, 0, a, a), e.save(), e.translate(c, c), e.beginPath(), e.arc(0, 0, s, 0, Math.PI * 2), e.fillStyle = "#fff", e.fill(), e.strokeStyle = "#d1d5db", e.lineWidth = 2, e.stroke();
|
|
224
233
|
for (let t = 0; t < 60; t++) {
|
|
@@ -247,10 +256,14 @@ import './index.css';var d = {
|
|
|
247
256
|
let n = e.getContext("2d");
|
|
248
257
|
if (!n) return;
|
|
249
258
|
n.setTransform(t, 0, 0, t, 0, 0);
|
|
250
|
-
let r = 0, o = () => {
|
|
251
|
-
|
|
259
|
+
let r = 0, o = document.hidden, s = v((e) => {
|
|
260
|
+
o = e;
|
|
261
|
+
}), c = () => {
|
|
262
|
+
o || u(n), r = requestAnimationFrame(c);
|
|
263
|
+
};
|
|
264
|
+
return c(), () => {
|
|
265
|
+
cancelAnimationFrame(r), s();
|
|
252
266
|
};
|
|
253
|
-
return o(), () => cancelAnimationFrame(r);
|
|
254
267
|
}, [u, a]), /* @__PURE__ */ l("div", {
|
|
255
268
|
className: S.canvasClock,
|
|
256
269
|
style: {
|
|
@@ -266,7 +279,7 @@ import './index.css';var d = {
|
|
|
266
279
|
}
|
|
267
280
|
})
|
|
268
281
|
});
|
|
269
|
-
},
|
|
282
|
+
}, w = {
|
|
270
283
|
chargeContainer: "cos-chargeContainer-4t9qo",
|
|
271
284
|
contrast: "cos-contrast-PNep9",
|
|
272
285
|
hueRotate: "cos-hueRotate-bMJ-k",
|
|
@@ -275,7 +288,7 @@ import './index.css';var d = {
|
|
|
275
288
|
circle: "cos-circle-m4vwX",
|
|
276
289
|
circleRotate: "cos-circleRotate-bgFw5",
|
|
277
290
|
button: "cos-button-myCst"
|
|
278
|
-
},
|
|
291
|
+
}, ee = (e) => {
|
|
279
292
|
let { initQuantity: t = 0, value: r, onChange: i, autoCharge: a = !0, interval: c = 500, step: d = .01 } = e, f = o(null), p = r !== void 0, [m, h] = s(() => y(t, 0, 100)), g = y(p ? r : m, 0, 100), _ = o(g), v = o(i);
|
|
280
293
|
n(() => {
|
|
281
294
|
v.current = i;
|
|
@@ -307,12 +320,12 @@ import './index.css';var d = {
|
|
|
307
320
|
let b = g.toFixed(2);
|
|
308
321
|
return /* @__PURE__ */ l("div", {
|
|
309
322
|
ref: f,
|
|
310
|
-
className:
|
|
323
|
+
className: w.chargeContainer,
|
|
311
324
|
children: /* @__PURE__ */ u("div", {
|
|
312
|
-
className:
|
|
325
|
+
className: w.contrast,
|
|
313
326
|
children: [
|
|
314
327
|
/* @__PURE__ */ u("div", {
|
|
315
|
-
className:
|
|
328
|
+
className: w.text,
|
|
316
329
|
children: [b, "%"]
|
|
317
330
|
}),
|
|
318
331
|
/* @__PURE__ */ l("span", {}),
|
|
@@ -330,17 +343,17 @@ import './index.css';var d = {
|
|
|
330
343
|
/* @__PURE__ */ l("span", {}),
|
|
331
344
|
/* @__PURE__ */ l("span", {}),
|
|
332
345
|
/* @__PURE__ */ l("span", {}),
|
|
333
|
-
/* @__PURE__ */ l("div", { className:
|
|
334
|
-
/* @__PURE__ */ l("div", { className:
|
|
346
|
+
/* @__PURE__ */ l("div", { className: w.circle }),
|
|
347
|
+
/* @__PURE__ */ l("div", { className: w.button })
|
|
335
348
|
]
|
|
336
349
|
})
|
|
337
350
|
});
|
|
338
|
-
},
|
|
351
|
+
}, T = {
|
|
339
352
|
clickSpark: "cos-clickSpark-db9Om",
|
|
340
353
|
canvas: "cos-canvas-p9fnQ",
|
|
341
354
|
content: "cos-content-7uE4T",
|
|
342
355
|
hint: "cos-hint-UqpWX"
|
|
343
|
-
},
|
|
356
|
+
}, te = ({ children: e, color: r = "#fbbf24", count: i = 16 }) => {
|
|
344
357
|
let a = o(null), s = o(null), c = o([]), d = o(0), f = t((e, t) => {
|
|
345
358
|
for (let n = 0; n < i; n++) {
|
|
346
359
|
let r = Math.PI * 2 * n / i + Math.random() * .3, a = Math.random() * 4 + 2;
|
|
@@ -378,7 +391,7 @@ import './index.css';var d = {
|
|
|
378
391
|
};
|
|
379
392
|
}, [r]), /* @__PURE__ */ u("div", {
|
|
380
393
|
ref: a,
|
|
381
|
-
className:
|
|
394
|
+
className: T.clickSpark,
|
|
382
395
|
onClick: (e) => {
|
|
383
396
|
let t = a.current?.getBoundingClientRect();
|
|
384
397
|
t && f(e.clientX - t.left, e.clientY - t.top);
|
|
@@ -386,23 +399,23 @@ import './index.css';var d = {
|
|
|
386
399
|
children: [
|
|
387
400
|
/* @__PURE__ */ l("canvas", {
|
|
388
401
|
ref: s,
|
|
389
|
-
className:
|
|
402
|
+
className: T.canvas
|
|
390
403
|
}),
|
|
391
404
|
e && /* @__PURE__ */ l("div", {
|
|
392
|
-
className:
|
|
405
|
+
className: T.content,
|
|
393
406
|
children: e
|
|
394
407
|
}),
|
|
395
408
|
!e && /* @__PURE__ */ l("p", {
|
|
396
|
-
className:
|
|
409
|
+
className: T.hint,
|
|
397
410
|
children: "点击任意位置产生火花"
|
|
398
411
|
})
|
|
399
412
|
]
|
|
400
413
|
});
|
|
401
|
-
},
|
|
414
|
+
}, E = {
|
|
402
415
|
confetti: "cos-confetti-MeNtU",
|
|
403
416
|
canvas: "cos-canvas-0T3Vs",
|
|
404
417
|
hint: "cos-hint-sGHEi"
|
|
405
|
-
},
|
|
418
|
+
}, ne = [
|
|
406
419
|
"#ff6b6b",
|
|
407
420
|
"#ffd93d",
|
|
408
421
|
"#6bcb77",
|
|
@@ -410,7 +423,7 @@ import './index.css';var d = {
|
|
|
410
423
|
"#a66cff",
|
|
411
424
|
"#ff85c0",
|
|
412
425
|
"#38bdf8"
|
|
413
|
-
],
|
|
426
|
+
], re = () => ne[Math.floor(Math.random() * ne.length)], ie = (e, t, n) => {
|
|
414
427
|
let r = e / 2, i = t * .6;
|
|
415
428
|
return Array.from({ length: n }, () => {
|
|
416
429
|
let e = (Math.random() - .5) * Math.PI, t = Math.random() * 12 + 6;
|
|
@@ -421,14 +434,14 @@ import './index.css';var d = {
|
|
|
421
434
|
vy: Math.sin(e) * t - Math.random() * 8,
|
|
422
435
|
rotation: Math.random() * 360,
|
|
423
436
|
rotationSpeed: (Math.random() - .5) * 12,
|
|
424
|
-
color:
|
|
437
|
+
color: re(),
|
|
425
438
|
width: Math.random() * 8 + 4,
|
|
426
439
|
height: Math.random() * 6 + 3,
|
|
427
440
|
alpha: 1,
|
|
428
441
|
gravity: Math.random() * .15 + .12
|
|
429
442
|
};
|
|
430
443
|
});
|
|
431
|
-
},
|
|
444
|
+
}, ae = e(({ width: e = 800, height: r = 400, auto: a = !0, particleCount: s = 120 }, c) => {
|
|
432
445
|
let d = o(null), f = o([]), p = o(0), m = o({
|
|
433
446
|
width: e,
|
|
434
447
|
height: r,
|
|
@@ -441,7 +454,7 @@ import './index.css';var d = {
|
|
|
441
454
|
};
|
|
442
455
|
let h = t(() => {
|
|
443
456
|
let { width: e, height: t, particleCount: n } = m.current;
|
|
444
|
-
f.current.push(...
|
|
457
|
+
f.current.push(...ie(e, t, n));
|
|
445
458
|
}, []);
|
|
446
459
|
return i(c, () => ({ burst: h }), [h]), n(() => {
|
|
447
460
|
a && h();
|
|
@@ -462,30 +475,30 @@ import './index.css';var d = {
|
|
|
462
475
|
cancelAnimationFrame(p.current), o();
|
|
463
476
|
};
|
|
464
477
|
}, [r, e]), /* @__PURE__ */ u("div", {
|
|
465
|
-
className:
|
|
478
|
+
className: E.confetti,
|
|
466
479
|
style: {
|
|
467
480
|
width: e,
|
|
468
481
|
height: r
|
|
469
482
|
},
|
|
470
483
|
children: [/* @__PURE__ */ l("canvas", {
|
|
471
484
|
ref: d,
|
|
472
|
-
className:
|
|
485
|
+
className: E.canvas,
|
|
473
486
|
style: {
|
|
474
487
|
width: e,
|
|
475
488
|
height: r
|
|
476
489
|
},
|
|
477
490
|
onClick: h
|
|
478
491
|
}), /* @__PURE__ */ l("p", {
|
|
479
|
-
className:
|
|
492
|
+
className: E.hint,
|
|
480
493
|
children: "点击画布再次喷射"
|
|
481
494
|
})]
|
|
482
495
|
});
|
|
483
496
|
});
|
|
484
|
-
|
|
485
|
-
var
|
|
497
|
+
ae.displayName = "Confetti";
|
|
498
|
+
var oe = {
|
|
486
499
|
cyberGrid: "cos-cyberGrid-VgJwl",
|
|
487
500
|
canvas: "cos-canvas--Mq-O"
|
|
488
|
-
},
|
|
501
|
+
}, se = ({ width: e = 800, height: t = 500, color: r = "#00f0ff", speed: i = 1 }) => {
|
|
489
502
|
let a = o(null), s = o(0), c = o(0);
|
|
490
503
|
return n(() => {
|
|
491
504
|
let n = a.current;
|
|
@@ -527,21 +540,21 @@ var se = {
|
|
|
527
540
|
i,
|
|
528
541
|
e
|
|
529
542
|
]), /* @__PURE__ */ l("div", {
|
|
530
|
-
className:
|
|
543
|
+
className: oe.cyberGrid,
|
|
531
544
|
style: {
|
|
532
545
|
width: e,
|
|
533
546
|
height: t
|
|
534
547
|
},
|
|
535
548
|
children: /* @__PURE__ */ l("canvas", {
|
|
536
549
|
ref: a,
|
|
537
|
-
className:
|
|
550
|
+
className: oe.canvas,
|
|
538
551
|
style: {
|
|
539
552
|
width: e,
|
|
540
553
|
height: t
|
|
541
554
|
}
|
|
542
555
|
})
|
|
543
556
|
});
|
|
544
|
-
},
|
|
557
|
+
}, D = {
|
|
545
558
|
countdown: "cos-countdown-5ZKKP",
|
|
546
559
|
unit: "cos-unit-dth8N",
|
|
547
560
|
value: "cos-value-yVzcP",
|
|
@@ -549,7 +562,7 @@ var se = {
|
|
|
549
562
|
ended: "cos-ended-c0dsD",
|
|
550
563
|
pulse: "cos-pulse-krQd-",
|
|
551
564
|
invalid: "cos-invalid-d6t-L"
|
|
552
|
-
},
|
|
565
|
+
}, ce = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : new Date(e).getTime(), le = (e) => {
|
|
553
566
|
let t = Math.max(0, e - Date.now()), n = Math.floor(t / 1e3);
|
|
554
567
|
return {
|
|
555
568
|
total: t,
|
|
@@ -558,7 +571,7 @@ var se = {
|
|
|
558
571
|
minutes: Math.floor(n % 3600 / 60),
|
|
559
572
|
seconds: n % 60
|
|
560
573
|
};
|
|
561
|
-
},
|
|
574
|
+
}, ue = [
|
|
562
575
|
{
|
|
563
576
|
key: "days",
|
|
564
577
|
label: "天"
|
|
@@ -575,8 +588,8 @@ var se = {
|
|
|
575
588
|
key: "seconds",
|
|
576
589
|
label: "秒"
|
|
577
590
|
}
|
|
578
|
-
],
|
|
579
|
-
let c = a(() =>
|
|
591
|
+
], de = ({ targetDate: e, onEnd: t, showLabels: r = !0, color: i = "#f472b6" }) => {
|
|
592
|
+
let c = a(() => ce(e), [e]), d = !Number.isNaN(c), [, f] = s(0), p = o(!1), m = o(t), h = d ? le(c) : {
|
|
580
593
|
days: 0,
|
|
581
594
|
hours: 0,
|
|
582
595
|
minutes: 0,
|
|
@@ -593,32 +606,32 @@ var se = {
|
|
|
593
606
|
}, 1e3);
|
|
594
607
|
return () => clearInterval(e);
|
|
595
608
|
}, [d, c]), d ? /* @__PURE__ */ u("div", {
|
|
596
|
-
className:
|
|
609
|
+
className: D.countdown,
|
|
597
610
|
style: { "--countdown-color": i },
|
|
598
|
-
children: [
|
|
599
|
-
className:
|
|
611
|
+
children: [ue.map(({ key: e, label: t }) => /* @__PURE__ */ u("div", {
|
|
612
|
+
className: D.unit,
|
|
600
613
|
children: [/* @__PURE__ */ l("div", {
|
|
601
|
-
className:
|
|
614
|
+
className: D.value,
|
|
602
615
|
children: String(h[e]).padStart(2, "0")
|
|
603
616
|
}), r && /* @__PURE__ */ l("span", {
|
|
604
|
-
className:
|
|
617
|
+
className: D.label,
|
|
605
618
|
children: t
|
|
606
619
|
})]
|
|
607
620
|
}, e)), h.total <= 0 && /* @__PURE__ */ l("p", {
|
|
608
|
-
className:
|
|
621
|
+
className: D.ended,
|
|
609
622
|
children: "时间到!"
|
|
610
623
|
})]
|
|
611
624
|
}) : /* @__PURE__ */ l("div", {
|
|
612
|
-
className:
|
|
625
|
+
className: D.countdown,
|
|
613
626
|
children: /* @__PURE__ */ l("p", {
|
|
614
|
-
className:
|
|
627
|
+
className: D.invalid,
|
|
615
628
|
children: "无效的目标时间"
|
|
616
629
|
})
|
|
617
630
|
});
|
|
618
|
-
},
|
|
631
|
+
}, fe = {
|
|
619
632
|
dnaHelix: "cos-dnaHelix-nEQLW",
|
|
620
633
|
canvas: "cos-canvas-uEV8B"
|
|
621
|
-
},
|
|
634
|
+
}, pe = ({ width: e = 200, height: t = 360, speed: r = 1, color: i = "#38bdf8" }) => {
|
|
622
635
|
let a = o(null);
|
|
623
636
|
return n(() => {
|
|
624
637
|
let n = a.current;
|
|
@@ -648,28 +661,28 @@ var se = {
|
|
|
648
661
|
r,
|
|
649
662
|
e
|
|
650
663
|
]), /* @__PURE__ */ l("div", {
|
|
651
|
-
className:
|
|
664
|
+
className: fe.dnaHelix,
|
|
652
665
|
style: {
|
|
653
666
|
width: e,
|
|
654
667
|
height: t
|
|
655
668
|
},
|
|
656
669
|
children: /* @__PURE__ */ l("canvas", {
|
|
657
670
|
ref: a,
|
|
658
|
-
className:
|
|
671
|
+
className: fe.canvas,
|
|
659
672
|
style: {
|
|
660
673
|
width: e,
|
|
661
674
|
height: t
|
|
662
675
|
}
|
|
663
676
|
})
|
|
664
677
|
});
|
|
665
|
-
},
|
|
678
|
+
}, me = {
|
|
666
679
|
electricArc: "cos-electricArc-BFlY3",
|
|
667
680
|
canvas: "cos-canvas-iowDx"
|
|
668
|
-
},
|
|
681
|
+
}, O = (e, t, n, r, i, a) => {
|
|
669
682
|
if (a <= 0) return [[e, t], [n, r]];
|
|
670
|
-
let o = (e + n) / 2, s = (t + r) / 2, c = n - e, l = r - t, u = Math.hypot(c, l) || 1, d = (Math.random() - .5) * i, f = -l / u * d, p = c / u * d, m =
|
|
683
|
+
let o = (e + n) / 2, s = (t + r) / 2, c = n - e, l = r - t, u = Math.hypot(c, l) || 1, d = (Math.random() - .5) * i, f = -l / u * d, p = c / u * d, m = O(e, t, o + f, s + p, i * .6, a - 1), h = O(o + f, s + p, n, r, i * .6, a - 1);
|
|
671
684
|
return [...m.slice(0, -1), ...h];
|
|
672
|
-
},
|
|
685
|
+
}, he = ({ width: e = 320, height: t = 160, color: r = "#67e8f9" }) => {
|
|
673
686
|
let i = o(null);
|
|
674
687
|
return n(() => {
|
|
675
688
|
let n = i.current;
|
|
@@ -684,7 +697,7 @@ var se = {
|
|
|
684
697
|
}), p = () => {
|
|
685
698
|
if (u = requestAnimationFrame(p), d) return;
|
|
686
699
|
o.fillStyle = "#0f172a", o.fillRect(0, 0, e, t);
|
|
687
|
-
let n =
|
|
700
|
+
let n = O(40, s, c, l, 40, 5);
|
|
688
701
|
o.beginPath(), n.forEach(([e, t], n) => n === 0 ? o.moveTo(e, t) : o.lineTo(e, t)), o.strokeStyle = r, o.lineWidth = 2, o.shadowColor = r, o.shadowBlur = 12, o.stroke(), o.shadowBlur = 0, o.beginPath(), n.forEach(([e, t], n) => n === 0 ? o.moveTo(e, t) : o.lineTo(e, t)), o.strokeStyle = "#fff", o.lineWidth = .8, o.globalAlpha = .6, o.stroke(), o.globalAlpha = 1, [[40, s], [c, l]].forEach(([e, t]) => {
|
|
689
702
|
o.beginPath(), o.arc(e, t, 6, 0, Math.PI * 2), o.fillStyle = r, o.fill();
|
|
690
703
|
});
|
|
@@ -697,25 +710,25 @@ var se = {
|
|
|
697
710
|
t,
|
|
698
711
|
e
|
|
699
712
|
]), /* @__PURE__ */ l("div", {
|
|
700
|
-
className:
|
|
713
|
+
className: me.electricArc,
|
|
701
714
|
style: {
|
|
702
715
|
width: e,
|
|
703
716
|
height: t
|
|
704
717
|
},
|
|
705
718
|
children: /* @__PURE__ */ l("canvas", {
|
|
706
719
|
ref: i,
|
|
707
|
-
className:
|
|
720
|
+
className: me.canvas,
|
|
708
721
|
style: {
|
|
709
722
|
width: e,
|
|
710
723
|
height: t
|
|
711
724
|
}
|
|
712
725
|
})
|
|
713
726
|
});
|
|
714
|
-
},
|
|
727
|
+
}, k = {
|
|
715
728
|
cursorTrail: "cos-cursorTrail-fpz5p",
|
|
716
729
|
canvas: "cos-canvas-Iuyp3",
|
|
717
730
|
hint: "cos-hint-9GLHx"
|
|
718
|
-
},
|
|
731
|
+
}, ge = ({ color: e = "#38bdf8", length: t = 20, width: r = 800, height: i = 400 }) => {
|
|
719
732
|
let a = o(null), s = o([]), c = o({
|
|
720
733
|
x: r / 2,
|
|
721
734
|
y: i / 2
|
|
@@ -754,14 +767,14 @@ var se = {
|
|
|
754
767
|
t,
|
|
755
768
|
r
|
|
756
769
|
]), /* @__PURE__ */ u("div", {
|
|
757
|
-
className:
|
|
770
|
+
className: k.cursorTrail,
|
|
758
771
|
style: {
|
|
759
772
|
width: r,
|
|
760
773
|
height: i
|
|
761
774
|
},
|
|
762
775
|
children: [/* @__PURE__ */ l("canvas", {
|
|
763
776
|
ref: a,
|
|
764
|
-
className:
|
|
777
|
+
className: k.canvas,
|
|
765
778
|
style: {
|
|
766
779
|
width: r,
|
|
767
780
|
height: i
|
|
@@ -774,11 +787,11 @@ var se = {
|
|
|
774
787
|
};
|
|
775
788
|
}
|
|
776
789
|
}), /* @__PURE__ */ l("p", {
|
|
777
|
-
className:
|
|
790
|
+
className: k.hint,
|
|
778
791
|
children: "移动鼠标查看粒子轨迹"
|
|
779
792
|
})]
|
|
780
793
|
});
|
|
781
|
-
},
|
|
794
|
+
}, A = {
|
|
782
795
|
diceRoll: "cos-diceRoll-GDwjV",
|
|
783
796
|
scene: "cos-scene-tmnKM",
|
|
784
797
|
cube: "cos-cube-RklEa",
|
|
@@ -793,7 +806,7 @@ var se = {
|
|
|
793
806
|
face6: "cos-face6-Yp-MX",
|
|
794
807
|
rollBtn: "cos-rollBtn-nXMWJ",
|
|
795
808
|
result: "cos-result-kXzu9"
|
|
796
|
-
},
|
|
809
|
+
}, _e = {
|
|
797
810
|
1: {
|
|
798
811
|
x: 0,
|
|
799
812
|
y: 0
|
|
@@ -818,23 +831,27 @@ var se = {
|
|
|
818
831
|
x: 90,
|
|
819
832
|
y: 0
|
|
820
833
|
}
|
|
821
|
-
},
|
|
822
|
-
let [
|
|
834
|
+
}, ve = ({ onRoll: e, sides: t = 6 }) => {
|
|
835
|
+
let [r, i] = s(!1), [a, c] = s(1), [d, f] = s({
|
|
823
836
|
x: 0,
|
|
824
837
|
y: 0,
|
|
825
838
|
z: 0
|
|
826
|
-
}),
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
839
|
+
}), p = o(e), m = o(0);
|
|
840
|
+
n(() => {
|
|
841
|
+
p.current = e;
|
|
842
|
+
}, [e]), n(() => () => clearTimeout(m.current), []);
|
|
843
|
+
let h = () => {
|
|
844
|
+
if (r) return;
|
|
845
|
+
i(!0);
|
|
846
|
+
let e = Math.floor(Math.random() * t) + 1, n = _e[e] ?? _e[1], a = 360 * (3 + Math.floor(Math.random() * 3)), o = 360 * (3 + Math.floor(Math.random() * 3));
|
|
847
|
+
f({
|
|
848
|
+
x: n.x + a,
|
|
849
|
+
y: n.y + o,
|
|
833
850
|
z: Math.random() * 360
|
|
834
|
-
}), window.setTimeout(() => {
|
|
835
|
-
|
|
851
|
+
}), clearTimeout(m.current), m.current = window.setTimeout(() => {
|
|
852
|
+
c(e), i(!1), p.current?.(e);
|
|
836
853
|
}, 1200);
|
|
837
|
-
},
|
|
854
|
+
}, g = (e) => ({
|
|
838
855
|
1: [[50, 50]],
|
|
839
856
|
2: [[25, 25], [75, 75]],
|
|
840
857
|
3: [
|
|
@@ -864,20 +881,20 @@ var se = {
|
|
|
864
881
|
[75, 75]
|
|
865
882
|
]
|
|
866
883
|
}[e] ?? []).map(([e, t], n) => /* @__PURE__ */ l("span", {
|
|
867
|
-
className:
|
|
884
|
+
className: A.dot,
|
|
868
885
|
style: {
|
|
869
886
|
left: `${e}%`,
|
|
870
887
|
top: `${t}%`
|
|
871
888
|
}
|
|
872
889
|
}, n));
|
|
873
890
|
return /* @__PURE__ */ u("div", {
|
|
874
|
-
className:
|
|
891
|
+
className: A.diceRoll,
|
|
875
892
|
children: [
|
|
876
893
|
/* @__PURE__ */ l("div", {
|
|
877
|
-
className:
|
|
894
|
+
className: A.scene,
|
|
878
895
|
children: /* @__PURE__ */ l("div", {
|
|
879
|
-
className: `${
|
|
880
|
-
style: { transform: `rotateX(${
|
|
896
|
+
className: `${A.cube} ${r ? A.rolling : ""}`,
|
|
897
|
+
style: { transform: `rotateX(${d.x}deg) rotateY(${d.y}deg) rotateZ(${d.z}deg)` },
|
|
881
898
|
children: [
|
|
882
899
|
1,
|
|
883
900
|
2,
|
|
@@ -886,25 +903,25 @@ var se = {
|
|
|
886
903
|
5,
|
|
887
904
|
6
|
|
888
905
|
].map((e) => /* @__PURE__ */ l("div", {
|
|
889
|
-
className: `${
|
|
890
|
-
children:
|
|
906
|
+
className: `${A.face} ${A[`face${e}`]}`,
|
|
907
|
+
children: g(e)
|
|
891
908
|
}, e))
|
|
892
909
|
})
|
|
893
910
|
}),
|
|
894
911
|
/* @__PURE__ */ l("button", {
|
|
895
912
|
type: "button",
|
|
896
|
-
className:
|
|
897
|
-
onClick:
|
|
898
|
-
disabled:
|
|
899
|
-
children:
|
|
913
|
+
className: A.rollBtn,
|
|
914
|
+
onClick: h,
|
|
915
|
+
disabled: r,
|
|
916
|
+
children: r ? "掷骰中..." : "掷骰子"
|
|
900
917
|
}),
|
|
901
|
-
!
|
|
902
|
-
className:
|
|
903
|
-
children: ["点数: ",
|
|
918
|
+
!r && /* @__PURE__ */ u("p", {
|
|
919
|
+
className: A.result,
|
|
920
|
+
children: ["点数: ", a]
|
|
904
921
|
})
|
|
905
922
|
]
|
|
906
923
|
});
|
|
907
|
-
},
|
|
924
|
+
}, ye = {
|
|
908
925
|
fireworks: "cos-fireworks-fsSqL",
|
|
909
926
|
canvas: "cos-canvas-spL8G",
|
|
910
927
|
hint: "cos-hint-5XDRH"
|
|
@@ -972,14 +989,14 @@ var se = {
|
|
|
972
989
|
p,
|
|
973
990
|
e
|
|
974
991
|
]), /* @__PURE__ */ u("div", {
|
|
975
|
-
className:
|
|
992
|
+
className: ye.fireworks,
|
|
976
993
|
style: {
|
|
977
994
|
width: e,
|
|
978
995
|
height: r
|
|
979
996
|
},
|
|
980
997
|
children: [/* @__PURE__ */ l("canvas", {
|
|
981
998
|
ref: c,
|
|
982
|
-
className:
|
|
999
|
+
className: ye.canvas,
|
|
983
1000
|
style: {
|
|
984
1001
|
width: e,
|
|
985
1002
|
height: r
|
|
@@ -989,7 +1006,7 @@ var se = {
|
|
|
989
1006
|
p(e.clientX - t.left);
|
|
990
1007
|
}
|
|
991
1008
|
}), /* @__PURE__ */ l("p", {
|
|
992
|
-
className:
|
|
1009
|
+
className: ye.hint,
|
|
993
1010
|
children: "点击画布燃放烟花"
|
|
994
1011
|
})]
|
|
995
1012
|
});
|
|
@@ -1218,16 +1235,22 @@ var j = {
|
|
|
1218
1235
|
}, Re = ({ value: e = 0, max: t = 100, size: i = 160, color: a = "#38bdf8" }) => {
|
|
1219
1236
|
let s = o(null), c = r().replace(/:/g, ""), d = y(t > 0 ? e / t * 100 : 0, 0, 100), f = 100 - d;
|
|
1220
1237
|
return n(() => {
|
|
1221
|
-
let e = 0, t = 0, n = () => {
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
if (
|
|
1225
|
-
|
|
1226
|
-
|
|
1238
|
+
let e = 0, t = 0, n = document.hidden, r = v((e) => {
|
|
1239
|
+
n = e;
|
|
1240
|
+
}), i = () => {
|
|
1241
|
+
if (!n) {
|
|
1242
|
+
t += .04;
|
|
1243
|
+
let e = s.current;
|
|
1244
|
+
if (e) {
|
|
1245
|
+
let n = f + Math.sin(t) * 2;
|
|
1246
|
+
e.setAttribute("d", `M0,${n} Q25,${n - 4 + Math.sin(t * 1.3) * 3} 50,${n} T100,${n} V100 H0 Z`);
|
|
1247
|
+
}
|
|
1227
1248
|
}
|
|
1228
|
-
e = requestAnimationFrame(
|
|
1249
|
+
e = requestAnimationFrame(i);
|
|
1250
|
+
};
|
|
1251
|
+
return e = requestAnimationFrame(i), () => {
|
|
1252
|
+
cancelAnimationFrame(e), r();
|
|
1229
1253
|
};
|
|
1230
|
-
return e = requestAnimationFrame(n), () => cancelAnimationFrame(e);
|
|
1231
1254
|
}, [f]), /* @__PURE__ */ u("div", {
|
|
1232
1255
|
className: N.liquidProgress,
|
|
1233
1256
|
style: {
|
|
@@ -1620,14 +1643,17 @@ var j = {
|
|
|
1620
1643
|
let o = e.reduce((e, t) => e + t.value, 0) || 1, s = t / 2, c = t / 2, l = (t / 2 - 20) / (e.length + 1), u = 0, d = 0, f = document.hidden, p = v((e) => {
|
|
1621
1644
|
f = e;
|
|
1622
1645
|
}), m = () => {
|
|
1623
|
-
u = requestAnimationFrame(m),
|
|
1646
|
+
if (u = requestAnimationFrame(m), f) return;
|
|
1647
|
+
d += .012, a.fillStyle = "#0f172a", a.fillRect(0, 0, t, t), e.forEach((e, t) => {
|
|
1624
1648
|
let n = l * (t + 1), r = e.value / o, i = y(Math.round(r * 12) + 1, 1, 16), u = .4 + t * .15;
|
|
1625
1649
|
a.beginPath(), a.arc(s, c, n, 0, Math.PI * 2), a.strokeStyle = "rgb(148 163 184 / 15%)", a.lineWidth = 1, a.stroke();
|
|
1626
1650
|
for (let t = 0; t < i; t++) {
|
|
1627
1651
|
let r = d * u + t / i * Math.PI * 2, o = s + Math.cos(r) * n, l = c + Math.sin(r) * n;
|
|
1628
1652
|
a.beginPath(), a.arc(o, l, 4, 0, Math.PI * 2), a.fillStyle = e.color, a.shadowColor = e.color, a.shadowBlur = 6, a.fill(), a.shadowBlur = 0;
|
|
1629
1653
|
}
|
|
1630
|
-
})
|
|
1654
|
+
});
|
|
1655
|
+
let n = e.reduce((e, t) => t.value > e.value ? t : e, e[0]), r = Math.round(n.value / o * 100);
|
|
1656
|
+
a.fillStyle = "#e2e8f0", a.font = "bold 14px system-ui", a.textAlign = "center", a.fillText(`${r}%`, s, c + 2), a.font = "10px system-ui", a.fillStyle = "#94a3b8", a.fillText(n.label, s, c + 16);
|
|
1631
1657
|
};
|
|
1632
1658
|
return m(), () => {
|
|
1633
1659
|
cancelAnimationFrame(u), p();
|
|
@@ -2067,7 +2093,11 @@ var j = {
|
|
|
2067
2093
|
end: "cos-end-u0J7o",
|
|
2068
2094
|
hint: "cos-hint-sO6ld"
|
|
2069
2095
|
}, ct = ({ duration: e = 1e4, onGrab: r }) => {
|
|
2070
|
-
let i = o(null), a = o([]), c = o(0), d = o(0), f = o(0), [p, m] = s(0), [h, g] = s(!0), _ =
|
|
2096
|
+
let i = o(null), a = o([]), c = o(0), d = o(0), f = o(0), [p, m] = s(0), [h, g] = s(!0), _ = o(!0);
|
|
2097
|
+
n(() => {
|
|
2098
|
+
_.current = h;
|
|
2099
|
+
}, [h]);
|
|
2100
|
+
let y = t(() => {
|
|
2071
2101
|
a.current.push({
|
|
2072
2102
|
id: d.current++,
|
|
2073
2103
|
x: Math.random() * 350 + 25,
|
|
@@ -2097,17 +2127,15 @@ var j = {
|
|
|
2097
2127
|
r.setTransform(n, 0, 0, n, 0, 0);
|
|
2098
2128
|
let o = document.hidden, s = v((e) => {
|
|
2099
2129
|
o = e;
|
|
2100
|
-
}), l = window.setTimeout(() =>
|
|
2101
|
-
|
|
2130
|
+
}), l = window.setTimeout(() => {
|
|
2131
|
+
_.current = !1, g(!1);
|
|
2132
|
+
}, e), u = () => {
|
|
2133
|
+
c.current = requestAnimationFrame(u), !o && (f.current++, _.current && f.current % 20 == 0 && y(), r.fillStyle = "rgb(15 23 42 / 20%)", r.fillRect(0, 0, 400, 500), a.current = a.current.filter((e) => e.grabbed ? !1 : (e.y += e.speed, e.x += Math.sin(e.y * .02) * .5, r.save(), r.translate(e.x, e.y), r.rotate(e.rotation), r.fillStyle = "#dc2626", r.beginPath(), r.roundRect(-22, -28, 44, 56, 6), r.fill(), r.fillStyle = "#fbbf24", r.beginPath(), r.arc(0, -10, 8, 0, Math.PI * 2), r.fill(), r.fillStyle = "#fde68a", r.font = "bold 12px system-ui", r.textAlign = "center", r.fillText(`¥${e.amount}`, 0, 12), r.restore(), e.y < 560)));
|
|
2102
2134
|
};
|
|
2103
2135
|
return u(), () => {
|
|
2104
2136
|
cancelAnimationFrame(c.current), clearTimeout(l), s();
|
|
2105
2137
|
};
|
|
2106
|
-
}, [
|
|
2107
|
-
h,
|
|
2108
|
-
e,
|
|
2109
|
-
_
|
|
2110
|
-
]), /* @__PURE__ */ u("div", {
|
|
2138
|
+
}, [e, y]), /* @__PURE__ */ u("div", {
|
|
2111
2139
|
className: V.redPacketRain,
|
|
2112
2140
|
children: [
|
|
2113
2141
|
/* @__PURE__ */ l("canvas", {
|
|
@@ -2380,15 +2408,15 @@ var j = {
|
|
|
2380
2408
|
children: "点击水面产生涟漪"
|
|
2381
2409
|
})]
|
|
2382
2410
|
});
|
|
2383
|
-
},
|
|
2411
|
+
}, pt = {
|
|
2384
2412
|
scrambleText: "cos-scrambleText-hN4Wm",
|
|
2385
2413
|
text: "cos-text-frsHs",
|
|
2386
2414
|
cursor: "cos-cursor-3zQOy",
|
|
2387
2415
|
blink: "cos-blink-OcKXu"
|
|
2388
|
-
},
|
|
2416
|
+
}, mt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*", ht = ({ text: e = "DECRYPTED", duration: t = 2e3, charset: r = mt }) => {
|
|
2389
2417
|
let [i, a] = s(""), c = o(0), d = o(0);
|
|
2390
2418
|
return n(() => {
|
|
2391
|
-
let n = r.length > 0 ? r :
|
|
2419
|
+
let n = r.length > 0 ? r : mt, i = e;
|
|
2392
2420
|
d.current = performance.now();
|
|
2393
2421
|
let o = (e) => {
|
|
2394
2422
|
let r = e - d.current, s = Math.min(r / t, 1), l = Math.floor(s * i.length);
|
|
@@ -2400,18 +2428,18 @@ var j = {
|
|
|
2400
2428
|
t,
|
|
2401
2429
|
r
|
|
2402
2430
|
]), /* @__PURE__ */ l("div", {
|
|
2403
|
-
className:
|
|
2431
|
+
className: pt.scrambleText,
|
|
2404
2432
|
children: /* @__PURE__ */ u("p", {
|
|
2405
|
-
className:
|
|
2406
|
-
children: [i, /* @__PURE__ */ l("span", { className:
|
|
2433
|
+
className: pt.text,
|
|
2434
|
+
children: [i, /* @__PURE__ */ l("span", { className: pt.cursor })]
|
|
2407
2435
|
})
|
|
2408
2436
|
});
|
|
2409
|
-
},
|
|
2437
|
+
}, q = {
|
|
2410
2438
|
scratchCard: "cos-scratchCard-McIEK",
|
|
2411
2439
|
prize: "cos-prize-X0z5V",
|
|
2412
2440
|
canvas: "cos-canvas-JqIlr",
|
|
2413
2441
|
hidden: "cos-hidden-Lsfbt"
|
|
2414
|
-
},
|
|
2442
|
+
}, gt = ({ coverColor: e = "#94a3b8", prize: r = "🎉 恭喜中奖!", onReveal: i, width: a = 300, height: c = 180 }) => {
|
|
2415
2443
|
let d = o(null), f = o(!1), p = o(!1), [m, h] = s(!1), g = t((t) => {
|
|
2416
2444
|
t.globalCompositeOperation = "source-over", t.fillStyle = e, t.fillRect(0, 0, a, c), t.fillStyle = "rgb(255 255 255 / 30%)", t.font = "bold 16px system-ui, sans-serif", t.textAlign = "center", t.fillText("刮开涂层", a / 2, c / 2);
|
|
2417
2445
|
}, [
|
|
@@ -2420,14 +2448,12 @@ var j = {
|
|
|
2420
2448
|
a
|
|
2421
2449
|
]), _ = t((e) => {
|
|
2422
2450
|
if (p.current) return;
|
|
2423
|
-
let t = e.
|
|
2424
|
-
|
|
2425
|
-
n
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
a
|
|
2430
|
-
]);
|
|
2451
|
+
let t = e.getContext("2d");
|
|
2452
|
+
if (!t) return;
|
|
2453
|
+
let n = t.getImageData(0, 0, e.width, e.height), r = 0;
|
|
2454
|
+
for (let e = 3; e < n.data.length; e += 4) n.data[e] < 128 && r++;
|
|
2455
|
+
r / (e.width * e.height) > .45 && (p.current = !0, h(!0), i?.());
|
|
2456
|
+
}, [i]);
|
|
2431
2457
|
n(() => {
|
|
2432
2458
|
let e = d.current;
|
|
2433
2459
|
if (!e) return;
|
|
@@ -2444,7 +2470,7 @@ var j = {
|
|
|
2444
2470
|
let n = d.current;
|
|
2445
2471
|
if (!n || p.current) return;
|
|
2446
2472
|
let r = n.getContext("2d");
|
|
2447
|
-
r && (r.globalCompositeOperation = "destination-out", r.beginPath(), r.arc(e, t, 20, 0, Math.PI * 2), r.fill(), _(
|
|
2473
|
+
r && (r.globalCompositeOperation = "destination-out", r.beginPath(), r.arc(e, t, 20, 0, Math.PI * 2), r.fill(), _(n));
|
|
2448
2474
|
}, y = (e) => {
|
|
2449
2475
|
let t = d.current;
|
|
2450
2476
|
if (!t) return null;
|
|
@@ -2472,17 +2498,17 @@ var j = {
|
|
|
2472
2498
|
f.current = !1;
|
|
2473
2499
|
};
|
|
2474
2500
|
return /* @__PURE__ */ u("div", {
|
|
2475
|
-
className:
|
|
2501
|
+
className: q.scratchCard,
|
|
2476
2502
|
style: {
|
|
2477
2503
|
width: a,
|
|
2478
2504
|
height: c
|
|
2479
2505
|
},
|
|
2480
2506
|
children: [/* @__PURE__ */ l("div", {
|
|
2481
|
-
className:
|
|
2507
|
+
className: q.prize,
|
|
2482
2508
|
children: r
|
|
2483
2509
|
}), /* @__PURE__ */ l("canvas", {
|
|
2484
2510
|
ref: d,
|
|
2485
|
-
className: `${
|
|
2511
|
+
className: `${q.canvas} ${m ? q.hidden : ""}`,
|
|
2486
2512
|
style: {
|
|
2487
2513
|
width: a,
|
|
2488
2514
|
height: c
|
|
@@ -2496,7 +2522,7 @@ var j = {
|
|
|
2496
2522
|
onTouchEnd: S
|
|
2497
2523
|
})]
|
|
2498
2524
|
});
|
|
2499
|
-
},
|
|
2525
|
+
}, J = {
|
|
2500
2526
|
slotMachine: "cos-slotMachine-P6FyZ",
|
|
2501
2527
|
machine: "cos-machine-B066r",
|
|
2502
2528
|
reel: "cos-reel-eEpJ3",
|
|
@@ -2505,58 +2531,55 @@ var j = {
|
|
|
2505
2531
|
mask: "cos-mask-jdrj3",
|
|
2506
2532
|
spinBtn: "cos-spinBtn-DvDE7",
|
|
2507
2533
|
result: "cos-result-dLN5b"
|
|
2508
|
-
},
|
|
2534
|
+
}, _t = [
|
|
2509
2535
|
"🍒",
|
|
2510
2536
|
"🍋",
|
|
2511
2537
|
"🍊",
|
|
2512
2538
|
"🍇",
|
|
2513
2539
|
"⭐",
|
|
2514
2540
|
"7️⃣"
|
|
2515
|
-
],
|
|
2541
|
+
], vt = (e) => 1 - (1 - e) ** 3, yt = ({ symbols: e = _t, onSpinEnd: r }) => {
|
|
2516
2542
|
let [i, a] = s(!1), [c, d] = s([
|
|
2517
2543
|
0,
|
|
2518
2544
|
0,
|
|
2519
2545
|
0
|
|
2520
|
-
]), [f, p] = s([]), m = o(
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2546
|
+
]), [f, p] = s([]), m = o(0), h = o(r), g = o(null);
|
|
2547
|
+
n(() => {
|
|
2548
|
+
h.current = r;
|
|
2549
|
+
}, [r]);
|
|
2550
|
+
let _ = t(() => {
|
|
2525
2551
|
let t = [];
|
|
2526
2552
|
for (let n = 0; n < 20; n++) t.push(...e);
|
|
2527
2553
|
return t;
|
|
2528
2554
|
}, [e])();
|
|
2529
|
-
return n(() => {
|
|
2530
|
-
|
|
2531
|
-
return () => {
|
|
2532
|
-
e.forEach((e) => cancelAnimationFrame(e));
|
|
2533
|
-
};
|
|
2555
|
+
return n(() => () => {
|
|
2556
|
+
g.current && (g.current.cancelled = !0), cancelAnimationFrame(m.current);
|
|
2534
2557
|
}, []), /* @__PURE__ */ u("div", {
|
|
2535
|
-
className:
|
|
2558
|
+
className: J.slotMachine,
|
|
2536
2559
|
children: [
|
|
2537
2560
|
/* @__PURE__ */ l("div", {
|
|
2538
|
-
className:
|
|
2561
|
+
className: J.machine,
|
|
2539
2562
|
children: [
|
|
2540
2563
|
0,
|
|
2541
2564
|
1,
|
|
2542
2565
|
2
|
|
2543
2566
|
].map((e) => /* @__PURE__ */ u("div", {
|
|
2544
|
-
className:
|
|
2567
|
+
className: J.reel,
|
|
2545
2568
|
style: { height: 240 },
|
|
2546
2569
|
children: [/* @__PURE__ */ l("div", {
|
|
2547
|
-
className:
|
|
2570
|
+
className: J.strip,
|
|
2548
2571
|
style: { transform: `translateY(${c[e]}px)` },
|
|
2549
|
-
children:
|
|
2550
|
-
className:
|
|
2572
|
+
children: _.map((e, t) => /* @__PURE__ */ l("div", {
|
|
2573
|
+
className: J.item,
|
|
2551
2574
|
style: { height: 80 },
|
|
2552
2575
|
children: e
|
|
2553
2576
|
}, t))
|
|
2554
|
-
}), /* @__PURE__ */ l("div", { className:
|
|
2577
|
+
}), /* @__PURE__ */ l("div", { className: J.mask })]
|
|
2555
2578
|
}, e))
|
|
2556
2579
|
}),
|
|
2557
2580
|
/* @__PURE__ */ l("button", {
|
|
2558
2581
|
type: "button",
|
|
2559
|
-
className:
|
|
2582
|
+
className: J.spinBtn,
|
|
2560
2583
|
onClick: () => {
|
|
2561
2584
|
if (i) return;
|
|
2562
2585
|
a(!0), p([]);
|
|
@@ -2564,45 +2587,38 @@ var j = {
|
|
|
2564
2587
|
0,
|
|
2565
2588
|
1,
|
|
2566
2589
|
2
|
|
2567
|
-
].map(() => Math.floor(Math.random() * e.length)), n = t.map((t) => -(t + e.length * 10) * 80),
|
|
2590
|
+
].map(() => Math.floor(Math.random() * e.length)), n = t.map((t) => -(t - 1 + e.length * 10) * 80), r = [...c], o = 2e3, s = [
|
|
2568
2591
|
0,
|
|
2569
2592
|
300,
|
|
2570
2593
|
600
|
|
2571
|
-
], l = performance.now(), u =
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
}
|
|
2583
|
-
let g = Math.min(h / 2e3, 1), _ = _t(g), v = o[i] + (n[i] - o[i]) * _;
|
|
2584
|
-
if (d((e) => {
|
|
2585
|
-
let t = [...e];
|
|
2586
|
-
return t[i] = v, t;
|
|
2587
|
-
}), g < 1) m.current[i] = requestAnimationFrame(f);
|
|
2588
|
-
else if (u++, u === 3) {
|
|
2594
|
+
], l = performance.now(), u = { cancelled: !1 };
|
|
2595
|
+
g.current = u;
|
|
2596
|
+
let f = (i) => {
|
|
2597
|
+
if (!u.cancelled) {
|
|
2598
|
+
if (d(r.map((e, t) => {
|
|
2599
|
+
let r = i - l - s[t];
|
|
2600
|
+
if (r < 0) return e;
|
|
2601
|
+
let a = vt(Math.min(r / o, 1));
|
|
2602
|
+
return e + (n[t] - e) * a;
|
|
2603
|
+
})), !s.every((e) => i - l - e >= o)) m.current = requestAnimationFrame(f);
|
|
2604
|
+
else if (!u.cancelled) {
|
|
2589
2605
|
let n = t.map((t) => e[t]);
|
|
2590
|
-
p(n), a(!1),
|
|
2606
|
+
p(n), a(!1), h.current?.(n);
|
|
2591
2607
|
}
|
|
2592
|
-
}
|
|
2593
|
-
|
|
2594
|
-
|
|
2608
|
+
}
|
|
2609
|
+
};
|
|
2610
|
+
m.current = requestAnimationFrame(f);
|
|
2595
2611
|
},
|
|
2596
2612
|
disabled: i,
|
|
2597
2613
|
children: i ? "旋转中..." : "开始"
|
|
2598
2614
|
}),
|
|
2599
2615
|
f.length > 0 && !i && /* @__PURE__ */ l("p", {
|
|
2600
|
-
className:
|
|
2616
|
+
className: J.result,
|
|
2601
2617
|
children: f[0] === f[1] && f[1] === f[2] ? "🎰 大奖!" : `结果: ${f.join(" ")}`
|
|
2602
2618
|
})
|
|
2603
2619
|
]
|
|
2604
2620
|
});
|
|
2605
|
-
},
|
|
2621
|
+
}, Y = {
|
|
2606
2622
|
splitReveal: "cos-splitReveal-6W8-6",
|
|
2607
2623
|
text: "cos-text-miTsj",
|
|
2608
2624
|
char: "cos-char-0gPJV",
|
|
@@ -2611,27 +2627,27 @@ var j = {
|
|
|
2611
2627
|
fromBottom: "cos-fromBottom-24D6g",
|
|
2612
2628
|
fromLeft: "cos-fromLeft-OMiPY",
|
|
2613
2629
|
fromRight: "cos-fromRight-EcMOR"
|
|
2614
|
-
},
|
|
2630
|
+
}, bt = [
|
|
2615
2631
|
"fromTop",
|
|
2616
2632
|
"fromBottom",
|
|
2617
2633
|
"fromLeft",
|
|
2618
2634
|
"fromRight"
|
|
2619
|
-
],
|
|
2620
|
-
className:
|
|
2635
|
+
], xt = ({ text: e = "REVEAL", delay: t = 80, color: n = "#f8fafc" }) => /* @__PURE__ */ l("div", {
|
|
2636
|
+
className: Y.splitReveal,
|
|
2621
2637
|
children: /* @__PURE__ */ l("h1", {
|
|
2622
|
-
className:
|
|
2638
|
+
className: Y.text,
|
|
2623
2639
|
style: { "--reveal-color": n },
|
|
2624
2640
|
children: e.split("").map((e, n) => /* @__PURE__ */ l("span", {
|
|
2625
|
-
className: `${
|
|
2641
|
+
className: `${Y.char} ${Y[bt[n % bt.length]]}`,
|
|
2626
2642
|
style: { animationDelay: `${n * t}ms` },
|
|
2627
2643
|
children: e === " " ? "\xA0" : e
|
|
2628
2644
|
}, `${e}-${n}`))
|
|
2629
2645
|
})
|
|
2630
|
-
}),
|
|
2646
|
+
}), St = {
|
|
2631
2647
|
spotlight: "cos-spotlight-OddY1",
|
|
2632
2648
|
content: "cos-content-5I1Wy",
|
|
2633
2649
|
overlay: "cos-overlay-F6CJ5"
|
|
2634
|
-
},
|
|
2650
|
+
}, Ct = ({ children: e, radius: n = 120, dimColor: r = "rgba(0, 0, 0, 0.85)" }) => {
|
|
2635
2651
|
let i = o(null), a = t((e) => {
|
|
2636
2652
|
let t = i.current;
|
|
2637
2653
|
if (!t) return;
|
|
@@ -2640,18 +2656,18 @@ var j = {
|
|
|
2640
2656
|
}, []);
|
|
2641
2657
|
return /* @__PURE__ */ u("div", {
|
|
2642
2658
|
ref: i,
|
|
2643
|
-
className:
|
|
2659
|
+
className: St.spotlight,
|
|
2644
2660
|
style: {
|
|
2645
2661
|
"--spot-radius": `${n}px`,
|
|
2646
2662
|
"--dim-color": r
|
|
2647
2663
|
},
|
|
2648
2664
|
onMouseMove: a,
|
|
2649
2665
|
children: [/* @__PURE__ */ l("div", {
|
|
2650
|
-
className:
|
|
2666
|
+
className: St.content,
|
|
2651
2667
|
children: e
|
|
2652
|
-
}), /* @__PURE__ */ l("div", { className:
|
|
2668
|
+
}), /* @__PURE__ */ l("div", { className: St.overlay })]
|
|
2653
2669
|
});
|
|
2654
|
-
},
|
|
2670
|
+
}, X = {
|
|
2655
2671
|
turntable: "cos-turntable-dkc32",
|
|
2656
2672
|
wheelWrap: "cos-wheelWrap-n7lhc",
|
|
2657
2673
|
canvas: "cos-canvas-A1-4x",
|
|
@@ -2659,7 +2675,7 @@ var j = {
|
|
|
2659
2675
|
spinBtn: "cos-spinBtn-l9JIC",
|
|
2660
2676
|
result: "cos-result-H8q2c",
|
|
2661
2677
|
"fade-in": "cos-fade-in-U9bUC"
|
|
2662
|
-
},
|
|
2678
|
+
}, wt = [
|
|
2663
2679
|
"#FF6B6B",
|
|
2664
2680
|
"#4ECDC4",
|
|
2665
2681
|
"#FFE66D",
|
|
@@ -2668,22 +2684,26 @@ var j = {
|
|
|
2668
2684
|
"#F472B6",
|
|
2669
2685
|
"#34D399",
|
|
2670
2686
|
"#FB923C"
|
|
2671
|
-
],
|
|
2687
|
+
], Tt = [
|
|
2672
2688
|
{ label: "一等奖" },
|
|
2673
2689
|
{ label: "二等奖" },
|
|
2674
2690
|
{ label: "三等奖" },
|
|
2675
2691
|
{ label: "谢谢参与" },
|
|
2676
2692
|
{ label: "优惠券" },
|
|
2677
2693
|
{ label: "再来一次" }
|
|
2678
|
-
],
|
|
2679
|
-
let f = o(null), p = o(0), m = o(0), h = o(1), [g, _] = s(!1), [v, y] = s(null), b =
|
|
2694
|
+
], Et = (e) => 1 - (1 - e) ** 3, Dt = ({ prizes: e = Tt, size: r = 360, spinDuration: i = 4e3, spinRounds: a = 5, buttonText: c = "开始抽奖", onSpinEnd: d }) => {
|
|
2695
|
+
let f = o(null), p = o(0), m = o(0), h = o(1), [g, _] = s(!1), [v, y] = s(null), b = o(d), x = o(null);
|
|
2696
|
+
n(() => {
|
|
2697
|
+
b.current = d;
|
|
2698
|
+
}, [d]);
|
|
2699
|
+
let S = r + 48, C = (e, t) => t.color ?? wt[e % wt.length], w = t((t) => {
|
|
2680
2700
|
let n = f.current;
|
|
2681
2701
|
if (!n) return;
|
|
2682
2702
|
let i = n.getContext("2d");
|
|
2683
2703
|
if (!i) return;
|
|
2684
|
-
let a =
|
|
2685
|
-
i.clearRect(0, 0,
|
|
2686
|
-
let n = t * s - Math.PI / 2, a = n + s, c =
|
|
2704
|
+
let a = S / 2, o = r / 2, s = Math.PI * 2 / e.length;
|
|
2705
|
+
i.clearRect(0, 0, S, S), i.save(), i.translate(a, a), i.rotate(t), e.forEach((e, t) => {
|
|
2706
|
+
let n = t * s - Math.PI / 2, a = n + s, c = C(t, e);
|
|
2687
2707
|
i.beginPath(), i.moveTo(0, 0), i.arc(0, 0, o, n, a), i.closePath(), i.fillStyle = c, i.fill(), i.strokeStyle = "rgb(255 255 255 / 35%)", i.lineWidth = 2, i.stroke(), i.save(), i.rotate(n + s / 2), i.textAlign = "right", i.fillStyle = "#fff", i.font = `bold ${Math.max(12, Math.floor(r / 22))}px system-ui, sans-serif`, i.shadowColor = "rgb(0 0 0 / 30%)", i.shadowBlur = 4, i.fillText(e.label, o - 18, 6), i.restore();
|
|
2688
2708
|
}), i.beginPath(), i.arc(0, 0, o, 0, Math.PI * 2), i.strokeStyle = "#fbbf24", i.lineWidth = 6, i.stroke(), i.beginPath(), i.arc(0, 0, o - 4, 0, Math.PI * 2), i.strokeStyle = "#f59e0b", i.lineWidth = 2, i.stroke(), i.restore(), i.save(), i.translate(a, a);
|
|
2689
2709
|
for (let e = 0; e < 12; e++) {
|
|
@@ -2692,7 +2712,7 @@ var j = {
|
|
|
2692
2712
|
}
|
|
2693
2713
|
i.restore();
|
|
2694
2714
|
}, [
|
|
2695
|
-
|
|
2715
|
+
S,
|
|
2696
2716
|
e,
|
|
2697
2717
|
r
|
|
2698
2718
|
]);
|
|
@@ -2700,64 +2720,67 @@ var j = {
|
|
|
2700
2720
|
let e = f.current;
|
|
2701
2721
|
if (!e) return;
|
|
2702
2722
|
let t = window.devicePixelRatio || 1;
|
|
2703
|
-
h.current = t, e.width =
|
|
2723
|
+
h.current = t, e.width = S * t, e.height = S * t;
|
|
2704
2724
|
let n = e.getContext("2d");
|
|
2705
|
-
n && n.setTransform(t, 0, 0, t, 0, 0),
|
|
2706
|
-
}, [
|
|
2707
|
-
m.current && cancelAnimationFrame(m.current);
|
|
2725
|
+
n && n.setTransform(t, 0, 0, t, 0, 0), w(p.current);
|
|
2726
|
+
}, [S, w]), n(() => () => {
|
|
2727
|
+
x.current && (x.current.cancelled = !0), m.current && cancelAnimationFrame(m.current);
|
|
2708
2728
|
}, []);
|
|
2709
2729
|
let ee = (t) => {
|
|
2710
2730
|
let n = 360 / e.length, r = (180 / Math.PI * t % 360 + 360) % 360;
|
|
2711
2731
|
return Math.floor((360 - r + n / 2) % 360 / n) % e.length;
|
|
2712
2732
|
};
|
|
2713
2733
|
return /* @__PURE__ */ u("div", {
|
|
2714
|
-
className:
|
|
2734
|
+
className: X.turntable,
|
|
2715
2735
|
style: {
|
|
2716
|
-
width:
|
|
2717
|
-
height:
|
|
2736
|
+
width: S,
|
|
2737
|
+
height: S + 80
|
|
2718
2738
|
},
|
|
2719
2739
|
children: [/* @__PURE__ */ u("div", {
|
|
2720
|
-
className:
|
|
2740
|
+
className: X.wheelWrap,
|
|
2721
2741
|
style: {
|
|
2722
|
-
width:
|
|
2723
|
-
height:
|
|
2742
|
+
width: S,
|
|
2743
|
+
height: S
|
|
2724
2744
|
},
|
|
2725
2745
|
children: [
|
|
2726
|
-
/* @__PURE__ */ l("div", { className:
|
|
2746
|
+
/* @__PURE__ */ l("div", { className: X.pointer }),
|
|
2727
2747
|
/* @__PURE__ */ l("canvas", {
|
|
2728
2748
|
ref: f,
|
|
2729
|
-
className:
|
|
2749
|
+
className: X.canvas,
|
|
2730
2750
|
style: {
|
|
2731
|
-
width:
|
|
2732
|
-
height:
|
|
2751
|
+
width: S,
|
|
2752
|
+
height: S
|
|
2733
2753
|
}
|
|
2734
2754
|
}),
|
|
2735
2755
|
/* @__PURE__ */ l("button", {
|
|
2736
2756
|
type: "button",
|
|
2737
|
-
className:
|
|
2757
|
+
className: X.spinBtn,
|
|
2738
2758
|
onClick: () => {
|
|
2739
2759
|
if (g || e.length === 0) return;
|
|
2740
2760
|
_(!0), y(null);
|
|
2741
|
-
let t = Math.PI * 2 / e.length, n = Math.floor(Math.random() * e.length) * t + t / 2, r = p.current, o = r + a * Math.PI * 2 + (Math.PI * 2 - n) - r % (Math.PI * 2), s = r, c = performance.now(), l =
|
|
2742
|
-
|
|
2743
|
-
|
|
2761
|
+
let t = Math.PI * 2 / e.length, n = Math.floor(Math.random() * e.length) * t + t / 2, r = p.current, o = r + a * Math.PI * 2 + (Math.PI * 2 - n) - r % (Math.PI * 2), s = r, c = performance.now(), l = { cancelled: !1 };
|
|
2762
|
+
x.current = l;
|
|
2763
|
+
let u = (t) => {
|
|
2764
|
+
if (l.cancelled) return;
|
|
2765
|
+
let n = t - c, r = Math.min(n / i, 1), a = Et(r), d = s + (o - s) * a;
|
|
2766
|
+
if (p.current = d, w(d), r < 1) m.current = requestAnimationFrame(u);
|
|
2744
2767
|
else {
|
|
2745
|
-
let t = ee(
|
|
2746
|
-
p.current =
|
|
2768
|
+
let t = ee(d), n = e[t];
|
|
2769
|
+
p.current = d, _(!1), y(n), b.current?.(n, t);
|
|
2747
2770
|
}
|
|
2748
2771
|
};
|
|
2749
|
-
m.current = requestAnimationFrame(
|
|
2772
|
+
m.current = requestAnimationFrame(u);
|
|
2750
2773
|
},
|
|
2751
2774
|
disabled: g,
|
|
2752
2775
|
children: g ? "抽奖中..." : c
|
|
2753
2776
|
})
|
|
2754
2777
|
]
|
|
2755
2778
|
}), v && !g && /* @__PURE__ */ u("p", {
|
|
2756
|
-
className:
|
|
2779
|
+
className: X.result,
|
|
2757
2780
|
children: ["恭喜获得:", /* @__PURE__ */ l("strong", { children: v.label })]
|
|
2758
2781
|
})]
|
|
2759
2782
|
});
|
|
2760
|
-
},
|
|
2783
|
+
}, Z = {
|
|
2761
2784
|
typewriter: "cos-typewriter-7UhOL",
|
|
2762
2785
|
terminal: "cos-terminal-NWNVN",
|
|
2763
2786
|
dots: "cos-dots-oulNg",
|
|
@@ -2765,11 +2788,11 @@ var j = {
|
|
|
2765
2788
|
prompt: "cos-prompt-Y4hVD",
|
|
2766
2789
|
cursor: "cos-cursor-m8hGi",
|
|
2767
2790
|
blink: "cos-blink-XykM7"
|
|
2768
|
-
},
|
|
2791
|
+
}, Ot = [
|
|
2769
2792
|
"Hello, cos-design!",
|
|
2770
2793
|
"欢迎来到组件库 ✨",
|
|
2771
2794
|
"Build something fun 🚀"
|
|
2772
|
-
],
|
|
2795
|
+
], kt = ({ texts: e, speed: t, deleteSpeed: r, pause: i }) => {
|
|
2773
2796
|
let [a, o] = s(""), [c, d] = s(0), [f, p] = s(!1);
|
|
2774
2797
|
return n(() => {
|
|
2775
2798
|
let n = e[c % e.length], s;
|
|
@@ -2791,85 +2814,85 @@ var j = {
|
|
|
2791
2814
|
r,
|
|
2792
2815
|
i
|
|
2793
2816
|
]), /* @__PURE__ */ l("div", {
|
|
2794
|
-
className:
|
|
2817
|
+
className: Z.typewriter,
|
|
2795
2818
|
children: /* @__PURE__ */ u("div", {
|
|
2796
|
-
className:
|
|
2819
|
+
className: Z.terminal,
|
|
2797
2820
|
children: [/* @__PURE__ */ u("div", {
|
|
2798
|
-
className:
|
|
2821
|
+
className: Z.dots,
|
|
2799
2822
|
children: [
|
|
2800
2823
|
/* @__PURE__ */ l("span", {}),
|
|
2801
2824
|
/* @__PURE__ */ l("span", {}),
|
|
2802
2825
|
/* @__PURE__ */ l("span", {})
|
|
2803
2826
|
]
|
|
2804
2827
|
}), /* @__PURE__ */ u("p", {
|
|
2805
|
-
className:
|
|
2828
|
+
className: Z.text,
|
|
2806
2829
|
children: [
|
|
2807
2830
|
/* @__PURE__ */ l("span", {
|
|
2808
|
-
className:
|
|
2831
|
+
className: Z.prompt,
|
|
2809
2832
|
children: ">"
|
|
2810
2833
|
}),
|
|
2811
2834
|
a,
|
|
2812
2835
|
/* @__PURE__ */ l("span", {
|
|
2813
|
-
className:
|
|
2836
|
+
className: Z.cursor,
|
|
2814
2837
|
children: "|"
|
|
2815
2838
|
})
|
|
2816
2839
|
]
|
|
2817
2840
|
})]
|
|
2818
2841
|
})
|
|
2819
2842
|
});
|
|
2820
|
-
},
|
|
2821
|
-
let i = e.length > 0 ? e :
|
|
2822
|
-
return /* @__PURE__ */ l(
|
|
2843
|
+
}, At = ({ texts: e = Ot, speed: t = 100, deleteSpeed: n = 50, pause: r = 2e3 }) => {
|
|
2844
|
+
let i = e.length > 0 ? e : Ot;
|
|
2845
|
+
return /* @__PURE__ */ l(kt, {
|
|
2823
2846
|
texts: i,
|
|
2824
2847
|
speed: t,
|
|
2825
2848
|
deleteSpeed: n,
|
|
2826
2849
|
pause: r
|
|
2827
2850
|
}, i.join("\0"));
|
|
2828
|
-
},
|
|
2851
|
+
}, Q = {
|
|
2829
2852
|
waveButton: "cos-waveButton-Aa7G-",
|
|
2830
2853
|
btn: "cos-btn-WJrEN",
|
|
2831
2854
|
label: "cos-label-9BHOU",
|
|
2832
2855
|
wave: "cos-wave-GycLU",
|
|
2833
2856
|
ripple: "cos-ripple-5ZFpr"
|
|
2834
|
-
},
|
|
2835
|
-
className:
|
|
2857
|
+
}, jt = ({ text: e = "点我试试", color: t = "#38bdf8", className: n, style: r, ...i }) => /* @__PURE__ */ l("div", {
|
|
2858
|
+
className: Q.waveButton,
|
|
2836
2859
|
children: /* @__PURE__ */ u("button", {
|
|
2837
2860
|
type: "button",
|
|
2838
|
-
className: `${
|
|
2861
|
+
className: `${Q.btn} ${n ?? ""}`,
|
|
2839
2862
|
style: {
|
|
2840
2863
|
"--wave-color": t,
|
|
2841
2864
|
...r
|
|
2842
2865
|
},
|
|
2843
2866
|
...i,
|
|
2844
2867
|
children: [
|
|
2845
|
-
/* @__PURE__ */ l("span", { className:
|
|
2846
|
-
/* @__PURE__ */ l("span", { className:
|
|
2868
|
+
/* @__PURE__ */ l("span", { className: Q.wave }),
|
|
2869
|
+
/* @__PURE__ */ l("span", { className: Q.wave }),
|
|
2847
2870
|
/* @__PURE__ */ l("span", {
|
|
2848
|
-
className:
|
|
2871
|
+
className: Q.label,
|
|
2849
2872
|
children: e
|
|
2850
2873
|
})
|
|
2851
2874
|
]
|
|
2852
2875
|
})
|
|
2853
|
-
}),
|
|
2876
|
+
}), $ = {
|
|
2854
2877
|
waveText: "cos-waveText-Zy2Tp",
|
|
2855
2878
|
text: "cos-text-el-KR",
|
|
2856
2879
|
char: "cos-char-Y9-mV",
|
|
2857
2880
|
wave: "cos-wave-jVRCz"
|
|
2858
2881
|
}, Mt = ({ text: e = "WAVE", amplitude: t = 12, color: n = "#38bdf8", fontSize: r = 56 }) => /* @__PURE__ */ l("div", {
|
|
2859
|
-
className:
|
|
2882
|
+
className: $.waveText,
|
|
2860
2883
|
children: /* @__PURE__ */ l("h1", {
|
|
2861
|
-
className:
|
|
2884
|
+
className: $.text,
|
|
2862
2885
|
style: {
|
|
2863
2886
|
fontSize: r,
|
|
2864
2887
|
"--wave-color": n,
|
|
2865
2888
|
"--wave-amp": `${t}px`
|
|
2866
2889
|
},
|
|
2867
2890
|
children: e.split("").map((e, t) => /* @__PURE__ */ l("span", {
|
|
2868
|
-
className:
|
|
2891
|
+
className: $.char,
|
|
2869
2892
|
style: { animationDelay: `${t * .1}s` },
|
|
2870
2893
|
children: e === " " ? "\xA0" : e
|
|
2871
2894
|
}, `${e}-${t}`))
|
|
2872
2895
|
})
|
|
2873
2896
|
});
|
|
2874
2897
|
//#endregion
|
|
2875
|
-
export { x as AudioVisualizer, _ as Aurora, f as BarcodeScan, m as BurnAway,
|
|
2898
|
+
export { x as AudioVisualizer, _ as Aurora, f as BarcodeScan, m as BurnAway, C as CanvasClock, ee as Charge, te as ClickSpark, ae as Confetti, de as Countdown, ge as CursorTrail, se as CyberGrid, ve as DiceRoll, pe as DnaHelix, he as ElectricArc, Te as Fireworks, Oe as FlipCounter, Ne as GlitchText, je as GradientFlow, Ie as GravityBalls, Le as HolographicCard, ze as LiquidGlass, Re as LiquidProgress, Ve as MagneticButton, Ue as MatrixRain, Ge as MazeGenerator, qe as MeteorRain, Je as NeonText, Ye as NewtonCradle, Ze as OrbitalChart, Qe as ParticleNetwork, at as ProgressChest, st as RadarScan, ct as RedPacketRain, lt as ReturnCity, ft as RippleWater, ht as ScrambleText, gt as ScratchCard, yt as SlotMachine, et as SmokeFog, nt as Snowfall, ut as Speedometer, xt as SplitReveal, Ct as Spotlight, it as Starfield, dt as TimelinePulse, Dt as Turntable, At as Typewriter, jt as WaveButton, Mt as WaveText };
|