cos-design 3.5.2 → 3.5.4
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 +17 -0
- package/dist/index.cjs +93 -1
- package/dist/index.css +1 -1
- package/dist/index.js +796 -518
- package/dist/src/components/rippleWater/index.d.ts +27 -1
- package/dist/src/components/smokeFog/index.d.ts +13 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -289,7 +289,7 @@ import './index.css';var d = {
|
|
|
289
289
|
circle: "cos-circle-m4vwX",
|
|
290
290
|
circleRotate: "cos-circleRotate-bgFw5",
|
|
291
291
|
button: "cos-button-myCst"
|
|
292
|
-
}, T = 15,
|
|
292
|
+
}, T = 15, E = 258, D = (e) => {
|
|
293
293
|
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);
|
|
294
294
|
n(() => {
|
|
295
295
|
v.current = i;
|
|
@@ -299,7 +299,7 @@ import './index.css';var d = {
|
|
|
299
299
|
let e = f.current;
|
|
300
300
|
if (!e) return;
|
|
301
301
|
let t = () => {
|
|
302
|
-
let t = Math.max(0, e.clientHeight -
|
|
302
|
+
let t = Math.max(0, e.clientHeight - E);
|
|
303
303
|
e.style.setProperty("--charge-rise-max", `${t}px`);
|
|
304
304
|
};
|
|
305
305
|
t();
|
|
@@ -340,12 +340,12 @@ import './index.css';var d = {
|
|
|
340
340
|
children: [b, "%"]
|
|
341
341
|
})]
|
|
342
342
|
});
|
|
343
|
-
},
|
|
343
|
+
}, O = {
|
|
344
344
|
clickSpark: "cos-clickSpark-db9Om",
|
|
345
345
|
canvas: "cos-canvas-p9fnQ",
|
|
346
346
|
content: "cos-content-7uE4T",
|
|
347
347
|
hint: "cos-hint-UqpWX"
|
|
348
|
-
},
|
|
348
|
+
}, k = ({ children: e, color: r = "#fbbf24", count: i = 16 }) => {
|
|
349
349
|
let a = o(null), s = o(null), c = o([]), d = o(0), f = t((e, t) => {
|
|
350
350
|
for (let n = 0; n < i; n++) {
|
|
351
351
|
let r = Math.PI * 2 * n / i + Math.random() * .3, a = Math.random() * 4 + 2;
|
|
@@ -383,7 +383,7 @@ import './index.css';var d = {
|
|
|
383
383
|
};
|
|
384
384
|
}, [r]), /* @__PURE__ */ u("div", {
|
|
385
385
|
ref: a,
|
|
386
|
-
className:
|
|
386
|
+
className: O.clickSpark,
|
|
387
387
|
onClick: (e) => {
|
|
388
388
|
let t = a.current?.getBoundingClientRect();
|
|
389
389
|
t && f(e.clientX - t.left, e.clientY - t.top);
|
|
@@ -391,23 +391,23 @@ import './index.css';var d = {
|
|
|
391
391
|
children: [
|
|
392
392
|
/* @__PURE__ */ l("canvas", {
|
|
393
393
|
ref: s,
|
|
394
|
-
className:
|
|
394
|
+
className: O.canvas
|
|
395
395
|
}),
|
|
396
396
|
e && /* @__PURE__ */ l("div", {
|
|
397
|
-
className:
|
|
397
|
+
className: O.content,
|
|
398
398
|
children: e
|
|
399
399
|
}),
|
|
400
400
|
!e && /* @__PURE__ */ l("p", {
|
|
401
|
-
className:
|
|
401
|
+
className: O.hint,
|
|
402
402
|
children: "点击任意位置产生火花"
|
|
403
403
|
})
|
|
404
404
|
]
|
|
405
405
|
});
|
|
406
|
-
},
|
|
406
|
+
}, A = {
|
|
407
407
|
confetti: "cos-confetti-MeNtU",
|
|
408
408
|
canvas: "cos-canvas-0T3Vs",
|
|
409
409
|
hint: "cos-hint-sGHEi"
|
|
410
|
-
},
|
|
410
|
+
}, j = [
|
|
411
411
|
"#ff6b6b",
|
|
412
412
|
"#ffd93d",
|
|
413
413
|
"#6bcb77",
|
|
@@ -415,7 +415,7 @@ import './index.css';var d = {
|
|
|
415
415
|
"#a66cff",
|
|
416
416
|
"#ff85c0",
|
|
417
417
|
"#38bdf8"
|
|
418
|
-
],
|
|
418
|
+
], M = () => j[Math.floor(Math.random() * j.length)], N = (e, t, n) => {
|
|
419
419
|
let r = e / 2, i = t * .6;
|
|
420
420
|
return Array.from({ length: n }, () => {
|
|
421
421
|
let e = (Math.random() - .5) * Math.PI, t = Math.random() * 12 + 6;
|
|
@@ -426,14 +426,14 @@ import './index.css';var d = {
|
|
|
426
426
|
vy: Math.sin(e) * t - Math.random() * 8,
|
|
427
427
|
rotation: Math.random() * 360,
|
|
428
428
|
rotationSpeed: (Math.random() - .5) * 12,
|
|
429
|
-
color:
|
|
429
|
+
color: M(),
|
|
430
430
|
width: Math.random() * 8 + 4,
|
|
431
431
|
height: Math.random() * 6 + 3,
|
|
432
432
|
alpha: 1,
|
|
433
433
|
gravity: Math.random() * .15 + .12
|
|
434
434
|
};
|
|
435
435
|
});
|
|
436
|
-
},
|
|
436
|
+
}, ee = e(({ width: e = 800, height: r = 400, auto: a = !0, particleCount: s = 120 }, c) => {
|
|
437
437
|
let d = o(null), f = o([]), p = o(0), m = o({
|
|
438
438
|
width: e,
|
|
439
439
|
height: r,
|
|
@@ -446,7 +446,7 @@ import './index.css';var d = {
|
|
|
446
446
|
};
|
|
447
447
|
let h = t(() => {
|
|
448
448
|
let { width: e, height: t, particleCount: n } = m.current;
|
|
449
|
-
f.current.push(...
|
|
449
|
+
f.current.push(...N(e, t, n));
|
|
450
450
|
}, []);
|
|
451
451
|
return i(c, () => ({ burst: h }), [h]), n(() => {
|
|
452
452
|
a && h();
|
|
@@ -467,30 +467,30 @@ import './index.css';var d = {
|
|
|
467
467
|
cancelAnimationFrame(p.current), o();
|
|
468
468
|
};
|
|
469
469
|
}, [r, e]), /* @__PURE__ */ u("div", {
|
|
470
|
-
className:
|
|
470
|
+
className: A.confetti,
|
|
471
471
|
style: {
|
|
472
472
|
width: e,
|
|
473
473
|
height: r
|
|
474
474
|
},
|
|
475
475
|
children: [/* @__PURE__ */ l("canvas", {
|
|
476
476
|
ref: d,
|
|
477
|
-
className:
|
|
477
|
+
className: A.canvas,
|
|
478
478
|
style: {
|
|
479
479
|
width: e,
|
|
480
480
|
height: r
|
|
481
481
|
},
|
|
482
482
|
onClick: h
|
|
483
483
|
}), /* @__PURE__ */ l("p", {
|
|
484
|
-
className:
|
|
484
|
+
className: A.hint,
|
|
485
485
|
children: "点击画布再次喷射"
|
|
486
486
|
})]
|
|
487
487
|
});
|
|
488
488
|
});
|
|
489
|
-
|
|
490
|
-
var
|
|
489
|
+
ee.displayName = "Confetti";
|
|
490
|
+
var P = {
|
|
491
491
|
cyberGrid: "cos-cyberGrid-VgJwl",
|
|
492
492
|
canvas: "cos-canvas--Mq-O"
|
|
493
|
-
},
|
|
493
|
+
}, te = ({ width: e = 800, height: t = 500, color: r = "#00f0ff", speed: i = 1 }) => {
|
|
494
494
|
let a = o(null), s = o(0), c = o(0);
|
|
495
495
|
return n(() => {
|
|
496
496
|
let n = a.current;
|
|
@@ -532,21 +532,21 @@ var re = {
|
|
|
532
532
|
i,
|
|
533
533
|
e
|
|
534
534
|
]), /* @__PURE__ */ l("div", {
|
|
535
|
-
className:
|
|
535
|
+
className: P.cyberGrid,
|
|
536
536
|
style: {
|
|
537
537
|
width: e,
|
|
538
538
|
height: t
|
|
539
539
|
},
|
|
540
540
|
children: /* @__PURE__ */ l("canvas", {
|
|
541
541
|
ref: a,
|
|
542
|
-
className:
|
|
542
|
+
className: P.canvas,
|
|
543
543
|
style: {
|
|
544
544
|
width: e,
|
|
545
545
|
height: t
|
|
546
546
|
}
|
|
547
547
|
})
|
|
548
548
|
});
|
|
549
|
-
},
|
|
549
|
+
}, F = {
|
|
550
550
|
countdown: "cos-countdown-5ZKKP",
|
|
551
551
|
unit: "cos-unit-dth8N",
|
|
552
552
|
value: "cos-value-yVzcP",
|
|
@@ -554,7 +554,7 @@ var re = {
|
|
|
554
554
|
ended: "cos-ended-c0dsD",
|
|
555
555
|
pulse: "cos-pulse-krQd-",
|
|
556
556
|
invalid: "cos-invalid-d6t-L"
|
|
557
|
-
},
|
|
557
|
+
}, ne = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : new Date(e).getTime(), re = (e) => {
|
|
558
558
|
let t = Math.max(0, e - Date.now()), n = Math.floor(t / 1e3);
|
|
559
559
|
return {
|
|
560
560
|
total: t,
|
|
@@ -563,7 +563,7 @@ var re = {
|
|
|
563
563
|
minutes: Math.floor(n % 3600 / 60),
|
|
564
564
|
seconds: n % 60
|
|
565
565
|
};
|
|
566
|
-
},
|
|
566
|
+
}, ie = [
|
|
567
567
|
{
|
|
568
568
|
key: "days",
|
|
569
569
|
label: "天"
|
|
@@ -580,8 +580,8 @@ var re = {
|
|
|
580
580
|
key: "seconds",
|
|
581
581
|
label: "秒"
|
|
582
582
|
}
|
|
583
|
-
],
|
|
584
|
-
let c = a(() =>
|
|
583
|
+
], ae = ({ targetDate: e, onEnd: t, showLabels: r = !0, color: i = "#f472b6" }) => {
|
|
584
|
+
let c = a(() => ne(e), [e]), d = !Number.isNaN(c), [, f] = s(0), p = o(!1), m = o(t), h = d ? re(c) : {
|
|
585
585
|
days: 0,
|
|
586
586
|
hours: 0,
|
|
587
587
|
minutes: 0,
|
|
@@ -601,32 +601,32 @@ var re = {
|
|
|
601
601
|
}, 1e3);
|
|
602
602
|
return () => clearInterval(e);
|
|
603
603
|
}, [d, c]), d ? /* @__PURE__ */ u("div", {
|
|
604
|
-
className:
|
|
604
|
+
className: F.countdown,
|
|
605
605
|
style: { "--countdown-color": i },
|
|
606
|
-
children: [
|
|
607
|
-
className:
|
|
606
|
+
children: [ie.map(({ key: e, label: t }) => /* @__PURE__ */ u("div", {
|
|
607
|
+
className: F.unit,
|
|
608
608
|
children: [/* @__PURE__ */ l("div", {
|
|
609
|
-
className:
|
|
609
|
+
className: F.value,
|
|
610
610
|
children: String(h[e]).padStart(2, "0")
|
|
611
611
|
}), r && /* @__PURE__ */ l("span", {
|
|
612
|
-
className:
|
|
612
|
+
className: F.label,
|
|
613
613
|
children: t
|
|
614
614
|
})]
|
|
615
615
|
}, e)), h.total <= 0 && /* @__PURE__ */ l("p", {
|
|
616
|
-
className:
|
|
616
|
+
className: F.ended,
|
|
617
617
|
children: "时间到!"
|
|
618
618
|
})]
|
|
619
619
|
}) : /* @__PURE__ */ l("div", {
|
|
620
|
-
className:
|
|
620
|
+
className: F.countdown,
|
|
621
621
|
children: /* @__PURE__ */ l("p", {
|
|
622
|
-
className:
|
|
622
|
+
className: F.invalid,
|
|
623
623
|
children: "无效的目标时间"
|
|
624
624
|
})
|
|
625
625
|
});
|
|
626
|
-
},
|
|
626
|
+
}, oe = {
|
|
627
627
|
dnaHelix: "cos-dnaHelix-nEQLW",
|
|
628
628
|
canvas: "cos-canvas-uEV8B"
|
|
629
|
-
},
|
|
629
|
+
}, se = ({ width: e = 200, height: t = 360, speed: r = 1, color: i = "#38bdf8" }) => {
|
|
630
630
|
let a = o(null);
|
|
631
631
|
return n(() => {
|
|
632
632
|
let n = a.current;
|
|
@@ -656,28 +656,28 @@ var re = {
|
|
|
656
656
|
r,
|
|
657
657
|
e
|
|
658
658
|
]), /* @__PURE__ */ l("div", {
|
|
659
|
-
className:
|
|
659
|
+
className: oe.dnaHelix,
|
|
660
660
|
style: {
|
|
661
661
|
width: e,
|
|
662
662
|
height: t
|
|
663
663
|
},
|
|
664
664
|
children: /* @__PURE__ */ l("canvas", {
|
|
665
665
|
ref: a,
|
|
666
|
-
className:
|
|
666
|
+
className: oe.canvas,
|
|
667
667
|
style: {
|
|
668
668
|
width: e,
|
|
669
669
|
height: t
|
|
670
670
|
}
|
|
671
671
|
})
|
|
672
672
|
});
|
|
673
|
-
},
|
|
673
|
+
}, ce = {
|
|
674
674
|
electricArc: "cos-electricArc-BFlY3",
|
|
675
675
|
canvas: "cos-canvas-iowDx"
|
|
676
|
-
},
|
|
676
|
+
}, le = (e, t, n, r, i, a) => {
|
|
677
677
|
if (a <= 0) return [[e, t], [n, r]];
|
|
678
|
-
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 =
|
|
678
|
+
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 = le(e, t, o + f, s + p, i * .6, a - 1), h = le(o + f, s + p, n, r, i * .6, a - 1);
|
|
679
679
|
return [...m.slice(0, -1), ...h];
|
|
680
|
-
},
|
|
680
|
+
}, ue = ({ width: e = 320, height: t = 160, color: r = "#67e8f9" }) => {
|
|
681
681
|
let i = o(null);
|
|
682
682
|
return n(() => {
|
|
683
683
|
let n = i.current;
|
|
@@ -692,7 +692,7 @@ var re = {
|
|
|
692
692
|
}), p = () => {
|
|
693
693
|
if (u = requestAnimationFrame(p), d) return;
|
|
694
694
|
o.fillStyle = "#0f172a", o.fillRect(0, 0, e, t);
|
|
695
|
-
let n =
|
|
695
|
+
let n = le(40, s, c, l, 40, 5);
|
|
696
696
|
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]) => {
|
|
697
697
|
o.beginPath(), o.arc(e, t, 6, 0, Math.PI * 2), o.fillStyle = r, o.fill();
|
|
698
698
|
});
|
|
@@ -705,25 +705,25 @@ var re = {
|
|
|
705
705
|
t,
|
|
706
706
|
e
|
|
707
707
|
]), /* @__PURE__ */ l("div", {
|
|
708
|
-
className:
|
|
708
|
+
className: ce.electricArc,
|
|
709
709
|
style: {
|
|
710
710
|
width: e,
|
|
711
711
|
height: t
|
|
712
712
|
},
|
|
713
713
|
children: /* @__PURE__ */ l("canvas", {
|
|
714
714
|
ref: i,
|
|
715
|
-
className:
|
|
715
|
+
className: ce.canvas,
|
|
716
716
|
style: {
|
|
717
717
|
width: e,
|
|
718
718
|
height: t
|
|
719
719
|
}
|
|
720
720
|
})
|
|
721
721
|
});
|
|
722
|
-
},
|
|
722
|
+
}, de = {
|
|
723
723
|
cursorTrail: "cos-cursorTrail-fpz5p",
|
|
724
724
|
canvas: "cos-canvas-Iuyp3",
|
|
725
725
|
hint: "cos-hint-9GLHx"
|
|
726
|
-
},
|
|
726
|
+
}, fe = ({ color: e = "#38bdf8", length: t = 20, width: r = 800, height: i = 400 }) => {
|
|
727
727
|
let a = o(null), s = o([]), c = o({
|
|
728
728
|
x: r / 2,
|
|
729
729
|
y: i / 2
|
|
@@ -762,14 +762,14 @@ var re = {
|
|
|
762
762
|
t,
|
|
763
763
|
r
|
|
764
764
|
]), /* @__PURE__ */ u("div", {
|
|
765
|
-
className:
|
|
765
|
+
className: de.cursorTrail,
|
|
766
766
|
style: {
|
|
767
767
|
width: r,
|
|
768
768
|
height: i
|
|
769
769
|
},
|
|
770
770
|
children: [/* @__PURE__ */ l("canvas", {
|
|
771
771
|
ref: a,
|
|
772
|
-
className:
|
|
772
|
+
className: de.canvas,
|
|
773
773
|
style: {
|
|
774
774
|
width: r,
|
|
775
775
|
height: i
|
|
@@ -782,11 +782,11 @@ var re = {
|
|
|
782
782
|
};
|
|
783
783
|
}
|
|
784
784
|
}), /* @__PURE__ */ l("p", {
|
|
785
|
-
className:
|
|
785
|
+
className: de.hint,
|
|
786
786
|
children: "移动鼠标查看粒子轨迹"
|
|
787
787
|
})]
|
|
788
788
|
});
|
|
789
|
-
},
|
|
789
|
+
}, I = {
|
|
790
790
|
diceRoll: "cos-diceRoll-GDwjV",
|
|
791
791
|
scene: "cos-scene-tmnKM",
|
|
792
792
|
cube: "cos-cube-RklEa",
|
|
@@ -801,7 +801,7 @@ var re = {
|
|
|
801
801
|
face6: "cos-face6-Yp-MX",
|
|
802
802
|
rollBtn: "cos-rollBtn-nXMWJ",
|
|
803
803
|
result: "cos-result-kXzu9"
|
|
804
|
-
},
|
|
804
|
+
}, pe = {
|
|
805
805
|
1: {
|
|
806
806
|
x: 0,
|
|
807
807
|
y: 0
|
|
@@ -826,7 +826,7 @@ var re = {
|
|
|
826
826
|
x: 90,
|
|
827
827
|
y: 0
|
|
828
828
|
}
|
|
829
|
-
},
|
|
829
|
+
}, me = ({ onRoll: e, sides: t = 6 }) => {
|
|
830
830
|
let [r, i] = s(!1), [a, c] = s(1), [d, f] = s({
|
|
831
831
|
x: 0,
|
|
832
832
|
y: 0,
|
|
@@ -838,7 +838,7 @@ var re = {
|
|
|
838
838
|
let h = () => {
|
|
839
839
|
if (r) return;
|
|
840
840
|
i(!0);
|
|
841
|
-
let e = Math.floor(Math.random() * t) + 1, n =
|
|
841
|
+
let e = Math.floor(Math.random() * t) + 1, n = pe[e] ?? pe[1], a = 360 * (3 + Math.floor(Math.random() * 3)), o = 360 * (3 + Math.floor(Math.random() * 3));
|
|
842
842
|
f({
|
|
843
843
|
x: n.x + a,
|
|
844
844
|
y: n.y + o,
|
|
@@ -876,19 +876,19 @@ var re = {
|
|
|
876
876
|
[75, 75]
|
|
877
877
|
]
|
|
878
878
|
}[e] ?? []).map(([e, t], n) => /* @__PURE__ */ l("span", {
|
|
879
|
-
className:
|
|
879
|
+
className: I.dot,
|
|
880
880
|
style: {
|
|
881
881
|
left: `${e}%`,
|
|
882
882
|
top: `${t}%`
|
|
883
883
|
}
|
|
884
884
|
}, n));
|
|
885
885
|
return /* @__PURE__ */ u("div", {
|
|
886
|
-
className:
|
|
886
|
+
className: I.diceRoll,
|
|
887
887
|
children: [
|
|
888
888
|
/* @__PURE__ */ l("div", {
|
|
889
|
-
className:
|
|
889
|
+
className: I.scene,
|
|
890
890
|
children: /* @__PURE__ */ l("div", {
|
|
891
|
-
className: `${
|
|
891
|
+
className: `${I.cube} ${r ? I.rolling : ""}`,
|
|
892
892
|
style: { transform: `rotateX(${d.x}deg) rotateY(${d.y}deg) rotateZ(${d.z}deg)` },
|
|
893
893
|
children: [
|
|
894
894
|
1,
|
|
@@ -898,28 +898,28 @@ var re = {
|
|
|
898
898
|
5,
|
|
899
899
|
6
|
|
900
900
|
].map((e) => /* @__PURE__ */ l("div", {
|
|
901
|
-
className: `${
|
|
901
|
+
className: `${I.face} ${I[`face${e}`]}`,
|
|
902
902
|
children: g(e)
|
|
903
903
|
}, e))
|
|
904
904
|
})
|
|
905
905
|
}),
|
|
906
906
|
/* @__PURE__ */ l("button", {
|
|
907
907
|
type: "button",
|
|
908
|
-
className:
|
|
908
|
+
className: I.rollBtn,
|
|
909
909
|
onClick: h,
|
|
910
910
|
disabled: r,
|
|
911
911
|
children: r ? "掷骰中..." : "掷骰子"
|
|
912
912
|
}),
|
|
913
913
|
!r && /* @__PURE__ */ u("p", {
|
|
914
|
-
className:
|
|
914
|
+
className: I.result,
|
|
915
915
|
children: ["点数: ", a]
|
|
916
916
|
})
|
|
917
917
|
]
|
|
918
918
|
});
|
|
919
|
-
},
|
|
919
|
+
}, he = {
|
|
920
920
|
doublePendulum: "cos-doublePendulum-FUEeK",
|
|
921
921
|
canvas: "cos-canvas-OVkhW"
|
|
922
|
-
},
|
|
922
|
+
}, ge = ({ width: e = 400, height: t = 400, trailLength: r = 120, color: i = "#38bdf8", color2: a = "#a78bfa" }) => {
|
|
923
923
|
let s = o(null), c = o({
|
|
924
924
|
theta1: Math.PI / 2 + .1,
|
|
925
925
|
theta2: Math.PI / 2 - .2,
|
|
@@ -938,13 +938,13 @@ var re = {
|
|
|
938
938
|
y = e;
|
|
939
939
|
}), x = () => {
|
|
940
940
|
if (_ = requestAnimationFrame(x), y) return;
|
|
941
|
-
let n = c.current, { theta1: o, theta2: s, omega1: v, omega2: b } = n, S = Math.sin(o), C = Math.sin(o - s), w = Math.cos(o - s), T = Math.cos(o),
|
|
942
|
-
n.omega1 +=
|
|
943
|
-
let
|
|
944
|
-
|
|
945
|
-
x:
|
|
946
|
-
y:
|
|
947
|
-
}),
|
|
941
|
+
let n = c.current, { theta1: o, theta2: s, omega1: v, omega2: b } = n, S = Math.sin(o), C = Math.sin(o - s), w = Math.cos(o - s), T = Math.cos(o), E = p * (3 - 1 * Math.cos(2 * o - 2 * s)), D = (-9.8 * 3 * S - 1 * h * Math.sin(o - 2 * s) - 2 * C * 1 * (b * b * m + v * v * p * w)) / E, O = 2 * C * (v * v * p * 2 + h * 2 * T + b * b * m * 1 * w) / (m * (3 - 1 * Math.cos(2 * o - 2 * s)));
|
|
942
|
+
n.omega1 += D * g, n.omega2 += O * g, n.theta1 += n.omega1 * g, n.theta2 += n.omega2 * g;
|
|
943
|
+
let k = d + p * Math.sin(n.theta1), A = f + p * Math.cos(n.theta1), j = k + m * Math.sin(n.theta2), M = A + m * Math.cos(n.theta2), N = u.current;
|
|
944
|
+
N.push({
|
|
945
|
+
x: j,
|
|
946
|
+
y: M
|
|
947
|
+
}), N.length > r && N.shift(), l.fillStyle = "rgba(15, 23, 42, 0.22)", l.fillRect(0, 0, e, t), N.length > 1 && (l.beginPath(), N.forEach((e, t) => t === 0 ? l.moveTo(e.x, e.y) : l.lineTo(e.x, e.y)), l.strokeStyle = a, l.lineWidth = 1.5, l.globalAlpha = .7, l.stroke(), l.globalAlpha = 1), l.beginPath(), l.moveTo(d, f), l.lineTo(k, A), l.lineTo(j, M), l.strokeStyle = "#64748b", l.lineWidth = 2, l.stroke(), l.beginPath(), l.arc(d, f, 5, 0, Math.PI * 2), l.fillStyle = "#94a3b8", l.fill(), l.beginPath(), l.arc(k, A, 10, 0, Math.PI * 2), l.fillStyle = i, l.shadowColor = i, l.shadowBlur = 10, l.fill(), l.shadowBlur = 0, l.beginPath(), l.arc(j, M, 10, 0, Math.PI * 2), l.fillStyle = a, l.shadowColor = a, l.shadowBlur = 10, l.fill(), l.shadowBlur = 0;
|
|
948
948
|
};
|
|
949
949
|
return l.fillStyle = "#0f172a", l.fillRect(0, 0, e, t), x(), () => {
|
|
950
950
|
cancelAnimationFrame(_), b();
|
|
@@ -956,32 +956,32 @@ var re = {
|
|
|
956
956
|
r,
|
|
957
957
|
e
|
|
958
958
|
]), /* @__PURE__ */ l("div", {
|
|
959
|
-
className:
|
|
959
|
+
className: he.doublePendulum,
|
|
960
960
|
style: {
|
|
961
961
|
width: e,
|
|
962
962
|
height: t
|
|
963
963
|
},
|
|
964
964
|
children: /* @__PURE__ */ l("canvas", {
|
|
965
965
|
ref: s,
|
|
966
|
-
className:
|
|
966
|
+
className: he.canvas,
|
|
967
967
|
style: {
|
|
968
968
|
width: e,
|
|
969
969
|
height: t
|
|
970
970
|
}
|
|
971
971
|
})
|
|
972
972
|
});
|
|
973
|
-
},
|
|
973
|
+
}, _e = {
|
|
974
974
|
fireworks: "cos-fireworks-fsSqL",
|
|
975
975
|
canvas: "cos-canvas-spL8G",
|
|
976
976
|
hint: "cos-hint-5XDRH"
|
|
977
|
-
},
|
|
977
|
+
}, ve = [
|
|
978
978
|
"#ff6b6b",
|
|
979
979
|
"#ffd93d",
|
|
980
980
|
"#6bcb77",
|
|
981
981
|
"#4d96ff",
|
|
982
982
|
"#a66cff",
|
|
983
983
|
"#ff85c0"
|
|
984
|
-
],
|
|
984
|
+
], ye = .12, be = 240, xe = () => ve[Math.floor(Math.random() * ve.length)], Se = (e, t, n) => {
|
|
985
985
|
let r = 60 + Math.floor(Math.random() * 30);
|
|
986
986
|
return Array.from({ length: r }, () => {
|
|
987
987
|
let r = Math.random() * Math.PI * 2, i = Math.random() * 4 + 2;
|
|
@@ -991,11 +991,11 @@ var re = {
|
|
|
991
991
|
vx: Math.cos(r) * i,
|
|
992
992
|
vy: Math.sin(r) * i,
|
|
993
993
|
alpha: 1,
|
|
994
|
-
color: Math.random() > .3 ? n :
|
|
994
|
+
color: Math.random() > .3 ? n : xe(),
|
|
995
995
|
decay: Math.random() * .015 + .01
|
|
996
996
|
};
|
|
997
997
|
});
|
|
998
|
-
},
|
|
998
|
+
}, Ce = e(({ width: e = 800, height: r = 500, auto: a = !0 }, s) => {
|
|
999
999
|
let c = o(null), d = o([]), f = o(0), p = t((t) => {
|
|
1000
1000
|
let n = t ?? Math.random() * e * .6 + e * .2;
|
|
1001
1001
|
d.current.push({
|
|
@@ -1003,7 +1003,7 @@ var re = {
|
|
|
1003
1003
|
y: r,
|
|
1004
1004
|
vy: -(Math.random() * 4 + 6),
|
|
1005
1005
|
targetY: Math.random() * r * .35 + r * .15,
|
|
1006
|
-
color:
|
|
1006
|
+
color: xe(),
|
|
1007
1007
|
exploded: !1,
|
|
1008
1008
|
particles: [],
|
|
1009
1009
|
age: 0
|
|
@@ -1022,9 +1022,9 @@ var re = {
|
|
|
1022
1022
|
}), u = () => {
|
|
1023
1023
|
f.current = requestAnimationFrame(u), !s && (i.fillStyle = "rgb(15 23 42 / 25%)", i.fillRect(0, 0, e, r), d.current = d.current.filter((e) => {
|
|
1024
1024
|
if (!e.exploded) {
|
|
1025
|
-
e.age += 1, e.y += e.vy, e.vy +=
|
|
1026
|
-
let t = e.vy >= 0, n = e.y <= e.targetY, r = e.y < 0, a = e.age >=
|
|
1027
|
-
return (t || n || r || a) && (e.exploded = !0, e.particles =
|
|
1025
|
+
e.age += 1, e.y += e.vy, e.vy += ye, i.beginPath(), i.arc(e.x, e.y, 2.5, 0, Math.PI * 2), i.fillStyle = e.color, i.fill();
|
|
1026
|
+
let t = e.vy >= 0, n = e.y <= e.targetY, r = e.y < 0, a = e.age >= be;
|
|
1027
|
+
return (t || n || r || a) && (e.exploded = !0, e.particles = Se(e.x, e.y, e.color)), !0;
|
|
1028
1028
|
}
|
|
1029
1029
|
return e.particles = e.particles.filter((e) => (e.x += e.vx, e.y += e.vy, e.vy += .06, e.alpha -= e.decay, e.alpha <= 0 ? !1 : (i.beginPath(), i.arc(e.x, e.y, 2, 0, Math.PI * 2), i.fillStyle = e.color, i.globalAlpha = e.alpha, i.fill(), i.globalAlpha = 1, !0))), e.particles.length > 0;
|
|
1030
1030
|
}));
|
|
@@ -1038,14 +1038,14 @@ var re = {
|
|
|
1038
1038
|
p,
|
|
1039
1039
|
e
|
|
1040
1040
|
]), /* @__PURE__ */ u("div", {
|
|
1041
|
-
className:
|
|
1041
|
+
className: _e.fireworks,
|
|
1042
1042
|
style: {
|
|
1043
1043
|
width: e,
|
|
1044
1044
|
height: r
|
|
1045
1045
|
},
|
|
1046
1046
|
children: [/* @__PURE__ */ l("canvas", {
|
|
1047
1047
|
ref: c,
|
|
1048
|
-
className:
|
|
1048
|
+
className: _e.canvas,
|
|
1049
1049
|
style: {
|
|
1050
1050
|
width: e,
|
|
1051
1051
|
height: r
|
|
@@ -1055,13 +1055,13 @@ var re = {
|
|
|
1055
1055
|
p(e.clientX - t.left);
|
|
1056
1056
|
}
|
|
1057
1057
|
}), /* @__PURE__ */ l("p", {
|
|
1058
|
-
className:
|
|
1058
|
+
className: _e.hint,
|
|
1059
1059
|
children: "点击画布燃放烟花"
|
|
1060
1060
|
})]
|
|
1061
1061
|
});
|
|
1062
1062
|
});
|
|
1063
|
-
|
|
1064
|
-
var
|
|
1063
|
+
Ce.displayName = "Fireworks";
|
|
1064
|
+
var L = {
|
|
1065
1065
|
flipCounter: "cos-flipCounter-3LuI0",
|
|
1066
1066
|
digit: "cos-digit-yJRPy",
|
|
1067
1067
|
digitCard: "cos-digitCard-zZUzt",
|
|
@@ -1073,7 +1073,7 @@ var P = {
|
|
|
1073
1073
|
isFlipping: "cos-isFlipping-EVEdI",
|
|
1074
1074
|
"fold-top": "cos-fold-top-v-6XJ",
|
|
1075
1075
|
"unfold-bottom": "cos-unfold-bottom-e2gzU"
|
|
1076
|
-
},
|
|
1076
|
+
}, we = (e, t) => Math.max(0, Math.floor(e)).toString().padStart(t, "0").slice(-t), Te = ({ digit: e, color: t, duration: r }) => {
|
|
1077
1077
|
let i = o(e), [a, d] = s(!1), [f, p] = s(e);
|
|
1078
1078
|
n(() => {
|
|
1079
1079
|
if (e === i.current) return;
|
|
@@ -1083,58 +1083,58 @@ var P = {
|
|
|
1083
1083
|
}, [e, r]);
|
|
1084
1084
|
let m = a ? f : e;
|
|
1085
1085
|
return /* @__PURE__ */ l("div", {
|
|
1086
|
-
className:
|
|
1086
|
+
className: L.digit,
|
|
1087
1087
|
style: {
|
|
1088
1088
|
"--flip-color": t,
|
|
1089
1089
|
"--flip-duration": `${r}ms`
|
|
1090
1090
|
},
|
|
1091
1091
|
children: /* @__PURE__ */ u("div", {
|
|
1092
|
-
className: `${
|
|
1092
|
+
className: `${L.digitCard} ${a ? L.isFlipping : ""}`,
|
|
1093
1093
|
children: [
|
|
1094
1094
|
/* @__PURE__ */ l("div", {
|
|
1095
|
-
className:
|
|
1095
|
+
className: L.staticTop,
|
|
1096
1096
|
children: /* @__PURE__ */ l("span", { children: m })
|
|
1097
1097
|
}),
|
|
1098
1098
|
/* @__PURE__ */ l("div", {
|
|
1099
|
-
className:
|
|
1099
|
+
className: L.staticBottom,
|
|
1100
1100
|
children: /* @__PURE__ */ l("span", { children: m })
|
|
1101
1101
|
}),
|
|
1102
1102
|
a && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
|
|
1103
|
-
className: `${
|
|
1103
|
+
className: `${L.flap} ${L.flapTop}`,
|
|
1104
1104
|
children: /* @__PURE__ */ l("span", { children: f })
|
|
1105
1105
|
}), /* @__PURE__ */ l("div", {
|
|
1106
|
-
className: `${
|
|
1106
|
+
className: `${L.flap} ${L.flapBottom}`,
|
|
1107
1107
|
children: /* @__PURE__ */ l("span", { children: e })
|
|
1108
1108
|
})] })
|
|
1109
1109
|
]
|
|
1110
1110
|
})
|
|
1111
1111
|
});
|
|
1112
|
-
},
|
|
1113
|
-
let i =
|
|
1112
|
+
}, Ee = ({ value: e, digits: t = 4, color: n = "#38bdf8", duration: r = 600 }) => {
|
|
1113
|
+
let i = we(e, t).split("");
|
|
1114
1114
|
return /* @__PURE__ */ l("div", {
|
|
1115
|
-
className:
|
|
1116
|
-
children: i.map((e, t) => /* @__PURE__ */ l(
|
|
1115
|
+
className: L.flipCounter,
|
|
1116
|
+
children: i.map((e, t) => /* @__PURE__ */ l(Te, {
|
|
1117
1117
|
digit: e,
|
|
1118
1118
|
color: n,
|
|
1119
1119
|
duration: r
|
|
1120
1120
|
}, t))
|
|
1121
1121
|
});
|
|
1122
|
-
},
|
|
1122
|
+
}, De = {
|
|
1123
1123
|
gradientFlow: "cos-gradientFlow-XhN16",
|
|
1124
1124
|
text: "cos-text-ORuqk",
|
|
1125
1125
|
flow: "cos-flow-9FzMA"
|
|
1126
|
-
},
|
|
1126
|
+
}, Oe = [
|
|
1127
1127
|
"#ff00de",
|
|
1128
1128
|
"#7c3aed",
|
|
1129
1129
|
"#00f0ff",
|
|
1130
1130
|
"#38bdf8",
|
|
1131
1131
|
"#ff00de"
|
|
1132
|
-
],
|
|
1133
|
-
let r = t.length >= 2 ? t.join(", ") :
|
|
1132
|
+
], ke = ({ text: e = "GRADIENT", colors: t = Oe, fontSize: n = 64 }) => {
|
|
1133
|
+
let r = t.length >= 2 ? t.join(", ") : Oe.join(", ");
|
|
1134
1134
|
return /* @__PURE__ */ l("div", {
|
|
1135
|
-
className:
|
|
1135
|
+
className: De.gradientFlow,
|
|
1136
1136
|
children: /* @__PURE__ */ l("h1", {
|
|
1137
|
-
className:
|
|
1137
|
+
className: De.text,
|
|
1138
1138
|
style: {
|
|
1139
1139
|
fontSize: n,
|
|
1140
1140
|
backgroundImage: `linear-gradient(90deg, ${r})`
|
|
@@ -1142,15 +1142,15 @@ var P = {
|
|
|
1142
1142
|
children: e
|
|
1143
1143
|
})
|
|
1144
1144
|
});
|
|
1145
|
-
},
|
|
1145
|
+
}, Ae = {
|
|
1146
1146
|
glitchText: "cos-glitchText-dZ-sR",
|
|
1147
1147
|
text: "cos-text-JsPHN",
|
|
1148
1148
|
"glitch-1": "cos-glitch-1-s9pqH",
|
|
1149
1149
|
"glitch-2": "cos-glitch-2-GhFB-"
|
|
1150
|
-
},
|
|
1151
|
-
className:
|
|
1150
|
+
}, je = ({ text: e = "GLITCH", color: t = "#f8fafc", glitchColor1: n = "#ff00de", glitchColor2: r = "#00f0ff", fontSize: i = 64 }) => /* @__PURE__ */ l("div", {
|
|
1151
|
+
className: Ae.glitchText,
|
|
1152
1152
|
children: /* @__PURE__ */ l("h1", {
|
|
1153
|
-
className:
|
|
1153
|
+
className: Ae.text,
|
|
1154
1154
|
"data-text": e,
|
|
1155
1155
|
style: {
|
|
1156
1156
|
fontSize: i,
|
|
@@ -1160,16 +1160,16 @@ var P = {
|
|
|
1160
1160
|
},
|
|
1161
1161
|
children: e
|
|
1162
1162
|
})
|
|
1163
|
-
}),
|
|
1163
|
+
}), Me = {
|
|
1164
1164
|
gravityBalls: "cos-gravityBalls-LdwFo",
|
|
1165
1165
|
canvas: "cos-canvas-n7esd"
|
|
1166
|
-
},
|
|
1166
|
+
}, Ne = [
|
|
1167
1167
|
"#38bdf8",
|
|
1168
1168
|
"#a78bfa",
|
|
1169
1169
|
"#f472b6",
|
|
1170
1170
|
"#4ade80",
|
|
1171
1171
|
"#fbbf24"
|
|
1172
|
-
],
|
|
1172
|
+
], Pe = ({ width: e = 400, height: t = 300, ballCount: r = 12 }) => {
|
|
1173
1173
|
let i = o(null), a = o([]);
|
|
1174
1174
|
return n(() => {
|
|
1175
1175
|
a.current = Array.from({ length: r }, () => ({
|
|
@@ -1178,7 +1178,7 @@ var P = {
|
|
|
1178
1178
|
vx: (Math.random() - .5) * 4,
|
|
1179
1179
|
vy: Math.random() * 2,
|
|
1180
1180
|
r: Math.random() * 10 + 8,
|
|
1181
|
-
color:
|
|
1181
|
+
color: Ne[Math.floor(Math.random() * Ne.length)]
|
|
1182
1182
|
}));
|
|
1183
1183
|
}, [
|
|
1184
1184
|
r,
|
|
@@ -1218,34 +1218,34 @@ var P = {
|
|
|
1218
1218
|
cancelAnimationFrame(s), l();
|
|
1219
1219
|
};
|
|
1220
1220
|
}, [t, e]), /* @__PURE__ */ l("div", {
|
|
1221
|
-
className:
|
|
1221
|
+
className: Me.gravityBalls,
|
|
1222
1222
|
style: {
|
|
1223
1223
|
width: e,
|
|
1224
1224
|
height: t
|
|
1225
1225
|
},
|
|
1226
1226
|
children: /* @__PURE__ */ l("canvas", {
|
|
1227
1227
|
ref: i,
|
|
1228
|
-
className:
|
|
1228
|
+
className: Me.canvas,
|
|
1229
1229
|
style: {
|
|
1230
1230
|
width: e,
|
|
1231
1231
|
height: t
|
|
1232
1232
|
}
|
|
1233
1233
|
})
|
|
1234
1234
|
});
|
|
1235
|
-
},
|
|
1235
|
+
}, R = {
|
|
1236
1236
|
wrap: "cos-wrap-r1gGL",
|
|
1237
1237
|
card: "cos-card-3W10s",
|
|
1238
1238
|
shine: "cos-shine-0xjID",
|
|
1239
1239
|
image: "cos-image-AV2XG",
|
|
1240
1240
|
placeholder: "cos-placeholder-wuuL3",
|
|
1241
1241
|
info: "cos-info-CNR0r"
|
|
1242
|
-
},
|
|
1242
|
+
}, Fe = ({ title: e = "全息卡片", subtitle: t = "移动鼠标体验 3D 效果", image: n }) => {
|
|
1243
1243
|
let r = o(null);
|
|
1244
1244
|
return /* @__PURE__ */ l("div", {
|
|
1245
|
-
className:
|
|
1245
|
+
className: R.wrap,
|
|
1246
1246
|
children: /* @__PURE__ */ u("div", {
|
|
1247
1247
|
ref: r,
|
|
1248
|
-
className:
|
|
1248
|
+
className: R.card,
|
|
1249
1249
|
onMouseMove: (e) => {
|
|
1250
1250
|
let t = r.current;
|
|
1251
1251
|
if (!t) return;
|
|
@@ -1257,23 +1257,23 @@ var P = {
|
|
|
1257
1257
|
e && (e.style.setProperty("--rx", "0deg"), e.style.setProperty("--ry", "0deg"), e.style.setProperty("--gx", "50%"), e.style.setProperty("--gy", "50%"));
|
|
1258
1258
|
},
|
|
1259
1259
|
children: [
|
|
1260
|
-
/* @__PURE__ */ l("div", { className:
|
|
1260
|
+
/* @__PURE__ */ l("div", { className: R.shine }),
|
|
1261
1261
|
n ? /* @__PURE__ */ l("img", {
|
|
1262
1262
|
src: n,
|
|
1263
1263
|
alt: e,
|
|
1264
|
-
className:
|
|
1264
|
+
className: R.image
|
|
1265
1265
|
}) : /* @__PURE__ */ l("div", {
|
|
1266
|
-
className:
|
|
1266
|
+
className: R.placeholder,
|
|
1267
1267
|
children: /* @__PURE__ */ l("span", { children: "✦" })
|
|
1268
1268
|
}),
|
|
1269
1269
|
/* @__PURE__ */ u("div", {
|
|
1270
|
-
className:
|
|
1270
|
+
className: R.info,
|
|
1271
1271
|
children: [/* @__PURE__ */ l("h3", { children: e }), /* @__PURE__ */ l("p", { children: t })]
|
|
1272
1272
|
})
|
|
1273
1273
|
]
|
|
1274
1274
|
})
|
|
1275
1275
|
});
|
|
1276
|
-
},
|
|
1276
|
+
}, z = {
|
|
1277
1277
|
liquidProgress: "cos-liquidProgress-ABZZA",
|
|
1278
1278
|
svg: "cos-svg-YdTvy",
|
|
1279
1279
|
track: "cos-track-IhMjO",
|
|
@@ -1281,7 +1281,7 @@ var P = {
|
|
|
1281
1281
|
fillBg: "cos-fillBg-pwLI1",
|
|
1282
1282
|
wave: "cos-wave-CBwgG",
|
|
1283
1283
|
label: "cos-label-WYDqS"
|
|
1284
|
-
},
|
|
1284
|
+
}, Ie = ({ value: e = 0, max: t = 100, size: i = 160, color: a = "#38bdf8" }) => {
|
|
1285
1285
|
let s = o(null), c = r().replace(/:/g, ""), d = y(t > 0 ? e / t * 100 : 0, 0, 100), f = 100 - d;
|
|
1286
1286
|
return n(() => {
|
|
1287
1287
|
let e = 0, t = 0, n = document.hidden, r = v((e) => {
|
|
@@ -1301,7 +1301,7 @@ var P = {
|
|
|
1301
1301
|
cancelAnimationFrame(e), r();
|
|
1302
1302
|
};
|
|
1303
1303
|
}, [f]), /* @__PURE__ */ u("div", {
|
|
1304
|
-
className:
|
|
1304
|
+
className: z.liquidProgress,
|
|
1305
1305
|
style: {
|
|
1306
1306
|
width: i,
|
|
1307
1307
|
height: i,
|
|
@@ -1309,7 +1309,7 @@ var P = {
|
|
|
1309
1309
|
},
|
|
1310
1310
|
children: [/* @__PURE__ */ u("svg", {
|
|
1311
1311
|
viewBox: "0 0 100 100",
|
|
1312
|
-
className:
|
|
1312
|
+
className: z.svg,
|
|
1313
1313
|
children: [
|
|
1314
1314
|
/* @__PURE__ */ l("defs", { children: /* @__PURE__ */ l("clipPath", {
|
|
1315
1315
|
id: `clip-${c}`,
|
|
@@ -1323,7 +1323,7 @@ var P = {
|
|
|
1323
1323
|
cx: "50",
|
|
1324
1324
|
cy: "50",
|
|
1325
1325
|
r: 45,
|
|
1326
|
-
className:
|
|
1326
|
+
className: z.track,
|
|
1327
1327
|
strokeWidth: 10,
|
|
1328
1328
|
fill: "none"
|
|
1329
1329
|
}),
|
|
@@ -1334,10 +1334,10 @@ var P = {
|
|
|
1334
1334
|
y: "0",
|
|
1335
1335
|
width: "100",
|
|
1336
1336
|
height: "100",
|
|
1337
|
-
className:
|
|
1337
|
+
className: z.fillBg
|
|
1338
1338
|
}), /* @__PURE__ */ l("path", {
|
|
1339
1339
|
ref: s,
|
|
1340
|
-
className:
|
|
1340
|
+
className: z.wave,
|
|
1341
1341
|
d: `M0,${f} Q25,${f - 4} 50,${f} T100,${f} V100 H0 Z`
|
|
1342
1342
|
})]
|
|
1343
1343
|
}),
|
|
@@ -1345,20 +1345,20 @@ var P = {
|
|
|
1345
1345
|
cx: "50",
|
|
1346
1346
|
cy: "50",
|
|
1347
1347
|
r: 45,
|
|
1348
|
-
className:
|
|
1348
|
+
className: z.ring,
|
|
1349
1349
|
strokeWidth: 10,
|
|
1350
1350
|
fill: "none"
|
|
1351
1351
|
})
|
|
1352
1352
|
]
|
|
1353
1353
|
}), /* @__PURE__ */ u("span", {
|
|
1354
|
-
className:
|
|
1354
|
+
className: z.label,
|
|
1355
1355
|
children: [Math.round(d), "%"]
|
|
1356
1356
|
})]
|
|
1357
1357
|
});
|
|
1358
|
-
},
|
|
1358
|
+
}, Le = {
|
|
1359
1359
|
lorenzAttractor: "cos-lorenzAttractor--UAI7",
|
|
1360
1360
|
canvas: "cos-canvas-oeXce"
|
|
1361
|
-
},
|
|
1361
|
+
}, Re = ({ width: e = 400, height: t = 360, speed: r = 1, color: i = "#f472b6", pointCount: a = 2e3 }) => {
|
|
1362
1362
|
let s = o(null), c = o(0);
|
|
1363
1363
|
return n(() => {
|
|
1364
1364
|
let n = s.current;
|
|
@@ -1408,45 +1408,45 @@ var P = {
|
|
|
1408
1408
|
r,
|
|
1409
1409
|
e
|
|
1410
1410
|
]), /* @__PURE__ */ l("div", {
|
|
1411
|
-
className:
|
|
1411
|
+
className: Le.lorenzAttractor,
|
|
1412
1412
|
style: {
|
|
1413
1413
|
width: e,
|
|
1414
1414
|
height: t
|
|
1415
1415
|
},
|
|
1416
1416
|
children: /* @__PURE__ */ l("canvas", {
|
|
1417
1417
|
ref: s,
|
|
1418
|
-
className:
|
|
1418
|
+
className: Le.canvas,
|
|
1419
1419
|
style: {
|
|
1420
1420
|
width: e,
|
|
1421
1421
|
height: t
|
|
1422
1422
|
}
|
|
1423
1423
|
})
|
|
1424
1424
|
});
|
|
1425
|
-
},
|
|
1425
|
+
}, ze = {
|
|
1426
1426
|
liquidGlass: "cos-liquidGlass-Z3bQg",
|
|
1427
1427
|
panel: "cos-panel-XYboD",
|
|
1428
1428
|
content: "cos-content-MHfkS"
|
|
1429
|
-
},
|
|
1430
|
-
className:
|
|
1429
|
+
}, Be = ({ children: e = "液态玻璃面板", blur: t = 16, borderRadius: n = 20 }) => /* @__PURE__ */ l("div", {
|
|
1430
|
+
className: ze.liquidGlass,
|
|
1431
1431
|
children: /* @__PURE__ */ l("div", {
|
|
1432
|
-
className:
|
|
1432
|
+
className: ze.panel,
|
|
1433
1433
|
style: {
|
|
1434
1434
|
"--glass-blur": `${t}px`,
|
|
1435
1435
|
"--glass-radius": `${n}px`
|
|
1436
1436
|
},
|
|
1437
1437
|
children: /* @__PURE__ */ l("div", {
|
|
1438
|
-
className:
|
|
1438
|
+
className: ze.content,
|
|
1439
1439
|
children: e
|
|
1440
1440
|
})
|
|
1441
1441
|
})
|
|
1442
|
-
}),
|
|
1442
|
+
}), Ve = {
|
|
1443
1443
|
magneticButton: "cos-magneticButton-GbRkE",
|
|
1444
1444
|
btn: "cos-btn--b2BJ"
|
|
1445
|
-
},
|
|
1445
|
+
}, He = ({ children: e = "磁吸按钮", strength: t = .4, color: n = "#6366f1" }) => {
|
|
1446
1446
|
let r = o(null), i = o(null);
|
|
1447
1447
|
return /* @__PURE__ */ l("div", {
|
|
1448
1448
|
ref: r,
|
|
1449
|
-
className:
|
|
1449
|
+
className: Ve.magneticButton,
|
|
1450
1450
|
onMouseMove: (e) => {
|
|
1451
1451
|
let n = r.current, a = i.current;
|
|
1452
1452
|
if (!n || !a) return;
|
|
@@ -1460,19 +1460,19 @@ var P = {
|
|
|
1460
1460
|
children: /* @__PURE__ */ l("button", {
|
|
1461
1461
|
ref: i,
|
|
1462
1462
|
type: "button",
|
|
1463
|
-
className:
|
|
1463
|
+
className: Ve.btn,
|
|
1464
1464
|
style: { "--btn-color": n },
|
|
1465
1465
|
children: e
|
|
1466
1466
|
})
|
|
1467
1467
|
});
|
|
1468
|
-
},
|
|
1468
|
+
}, B = {
|
|
1469
1469
|
matrixRain: "cos-matrixRain-qg9HC",
|
|
1470
1470
|
canvas: "cos-canvas--AvpG",
|
|
1471
1471
|
overlay: "cos-overlay-knj3b",
|
|
1472
1472
|
title: "cos-title-sDfhs",
|
|
1473
1473
|
flicker: "cos-flicker-smHxl",
|
|
1474
1474
|
subtitle: "cos-subtitle-CWheW"
|
|
1475
|
-
},
|
|
1475
|
+
}, Ue = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*アイウエオカキクケコ", We = ({ width: e = 800, height: t = 500, density: r = .6, color: i = "#00ff41", showOverlay: a = !0, title: s = "MATRIX", subtitle: c = "数字雨效果" }) => {
|
|
1476
1476
|
let d = o(null);
|
|
1477
1477
|
return n(() => {
|
|
1478
1478
|
let n = d.current;
|
|
@@ -1486,7 +1486,7 @@ var P = {
|
|
|
1486
1486
|
u = e;
|
|
1487
1487
|
}), p = () => {
|
|
1488
1488
|
l = requestAnimationFrame(p), !u && (o.fillStyle = "rgb(0 0 0 / 8%)", o.fillRect(0, 0, e, t), o.font = "16px monospace", c.forEach((e, n) => {
|
|
1489
|
-
let a =
|
|
1489
|
+
let a = Ue[Math.floor(Math.random() * 53)], s = n / r * 16;
|
|
1490
1490
|
o.fillStyle = i, o.fillText(a, s, e * 16), e * 16 > t && Math.random() > .975 && (c[n] = 0), c[n] += 1;
|
|
1491
1491
|
}));
|
|
1492
1492
|
};
|
|
@@ -1499,33 +1499,33 @@ var P = {
|
|
|
1499
1499
|
t,
|
|
1500
1500
|
e
|
|
1501
1501
|
]), /* @__PURE__ */ u("div", {
|
|
1502
|
-
className:
|
|
1502
|
+
className: B.matrixRain,
|
|
1503
1503
|
style: {
|
|
1504
1504
|
width: e,
|
|
1505
1505
|
height: t
|
|
1506
1506
|
},
|
|
1507
1507
|
children: [/* @__PURE__ */ l("canvas", {
|
|
1508
1508
|
ref: d,
|
|
1509
|
-
className:
|
|
1509
|
+
className: B.canvas,
|
|
1510
1510
|
style: {
|
|
1511
1511
|
width: e,
|
|
1512
1512
|
height: t
|
|
1513
1513
|
}
|
|
1514
1514
|
}), a && /* @__PURE__ */ u("div", {
|
|
1515
|
-
className:
|
|
1515
|
+
className: B.overlay,
|
|
1516
1516
|
children: [/* @__PURE__ */ l("h2", {
|
|
1517
|
-
className:
|
|
1517
|
+
className: B.title,
|
|
1518
1518
|
children: s
|
|
1519
1519
|
}), /* @__PURE__ */ l("p", {
|
|
1520
|
-
className:
|
|
1520
|
+
className: B.subtitle,
|
|
1521
1521
|
children: c
|
|
1522
1522
|
})]
|
|
1523
1523
|
})]
|
|
1524
1524
|
});
|
|
1525
|
-
},
|
|
1525
|
+
}, Ge = {
|
|
1526
1526
|
metaballPool: "cos-metaballPool-JJaI9",
|
|
1527
1527
|
canvas: "cos-canvas-S7fDD"
|
|
1528
|
-
},
|
|
1528
|
+
}, Ke = ({ width: e = 400, height: t = 300, ballCount: r = 5, color: i = "#38bdf8" }) => {
|
|
1529
1529
|
let a = o(null), s = o([]), c = o({
|
|
1530
1530
|
x: -999,
|
|
1531
1531
|
y: -999,
|
|
@@ -1615,7 +1615,7 @@ var P = {
|
|
|
1615
1615
|
t,
|
|
1616
1616
|
e
|
|
1617
1617
|
]), /* @__PURE__ */ l("div", {
|
|
1618
|
-
className:
|
|
1618
|
+
className: Ge.metaballPool,
|
|
1619
1619
|
style: {
|
|
1620
1620
|
width: e,
|
|
1621
1621
|
height: t,
|
|
@@ -1623,17 +1623,17 @@ var P = {
|
|
|
1623
1623
|
},
|
|
1624
1624
|
children: /* @__PURE__ */ l("canvas", {
|
|
1625
1625
|
ref: a,
|
|
1626
|
-
className:
|
|
1626
|
+
className: Ge.canvas,
|
|
1627
1627
|
style: {
|
|
1628
1628
|
width: e,
|
|
1629
1629
|
height: t
|
|
1630
1630
|
}
|
|
1631
1631
|
})
|
|
1632
1632
|
});
|
|
1633
|
-
},
|
|
1633
|
+
}, qe = {
|
|
1634
1634
|
mazeGenerator: "cos-mazeGenerator-QEa0s",
|
|
1635
1635
|
canvas: "cos-canvas-emhxb"
|
|
1636
|
-
},
|
|
1636
|
+
}, Je = ({ width: e = 400, height: t = 300, cellSize: r = 20, onGenerated: i }) => {
|
|
1637
1637
|
let a = o(null), s = o(i);
|
|
1638
1638
|
return n(() => {
|
|
1639
1639
|
s.current = i;
|
|
@@ -1720,24 +1720,24 @@ var P = {
|
|
|
1720
1720
|
t,
|
|
1721
1721
|
e
|
|
1722
1722
|
]), /* @__PURE__ */ l("div", {
|
|
1723
|
-
className:
|
|
1723
|
+
className: qe.mazeGenerator,
|
|
1724
1724
|
style: {
|
|
1725
1725
|
width: e,
|
|
1726
1726
|
height: t
|
|
1727
1727
|
},
|
|
1728
1728
|
children: /* @__PURE__ */ l("canvas", {
|
|
1729
1729
|
ref: a,
|
|
1730
|
-
className:
|
|
1730
|
+
className: qe.canvas,
|
|
1731
1731
|
style: {
|
|
1732
1732
|
width: e,
|
|
1733
1733
|
height: t
|
|
1734
1734
|
}
|
|
1735
1735
|
})
|
|
1736
1736
|
});
|
|
1737
|
-
},
|
|
1737
|
+
}, Ye = {
|
|
1738
1738
|
meteorRain: "cos-meteorRain-v8RNI",
|
|
1739
1739
|
canvas: "cos-canvas-hyFMr"
|
|
1740
|
-
},
|
|
1740
|
+
}, Xe = ({ width: e = 800, height: t = 500, meteorCount: r = 8 }) => {
|
|
1741
1741
|
let i = o(null), a = o([]), s = o(0);
|
|
1742
1742
|
return n(() => {
|
|
1743
1743
|
a.current = Array.from({ length: r }, () => ({
|
|
@@ -1772,47 +1772,47 @@ var P = {
|
|
|
1772
1772
|
cancelAnimationFrame(s.current), l();
|
|
1773
1773
|
};
|
|
1774
1774
|
}, [t, e]), /* @__PURE__ */ l("div", {
|
|
1775
|
-
className:
|
|
1775
|
+
className: Ye.meteorRain,
|
|
1776
1776
|
style: {
|
|
1777
1777
|
width: e,
|
|
1778
1778
|
height: t
|
|
1779
1779
|
},
|
|
1780
1780
|
children: /* @__PURE__ */ l("canvas", {
|
|
1781
1781
|
ref: i,
|
|
1782
|
-
className:
|
|
1782
|
+
className: Ye.canvas,
|
|
1783
1783
|
style: {
|
|
1784
1784
|
width: e,
|
|
1785
1785
|
height: t
|
|
1786
1786
|
}
|
|
1787
1787
|
})
|
|
1788
1788
|
});
|
|
1789
|
-
},
|
|
1789
|
+
}, Ze = {
|
|
1790
1790
|
neonText: "cos-neonText-JMP7i",
|
|
1791
1791
|
text: "cos-text-GTO-0",
|
|
1792
1792
|
flicker: "cos-flicker-nXceV",
|
|
1793
1793
|
"neon-flicker": "cos-neon-flicker-uDkmM",
|
|
1794
1794
|
reflection: "cos-reflection-aEYj6"
|
|
1795
|
-
},
|
|
1796
|
-
className:
|
|
1795
|
+
}, Qe = ({ text: e = "NEON", color: t = "#ff00de", fontSize: n = 72, flicker: r = !0 }) => /* @__PURE__ */ u("div", {
|
|
1796
|
+
className: Ze.neonText,
|
|
1797
1797
|
children: [/* @__PURE__ */ l("h1", {
|
|
1798
|
-
className: `${
|
|
1798
|
+
className: `${Ze.text} ${r ? Ze.flicker : ""}`,
|
|
1799
1799
|
style: {
|
|
1800
1800
|
fontSize: n,
|
|
1801
1801
|
"--neon-color": t
|
|
1802
1802
|
},
|
|
1803
1803
|
children: e
|
|
1804
1804
|
}), /* @__PURE__ */ l("p", {
|
|
1805
|
-
className:
|
|
1805
|
+
className: Ze.reflection,
|
|
1806
1806
|
style: {
|
|
1807
1807
|
fontSize: n * .35,
|
|
1808
1808
|
color: t
|
|
1809
1809
|
},
|
|
1810
1810
|
children: e
|
|
1811
1811
|
})]
|
|
1812
|
-
}),
|
|
1812
|
+
}), $e = {
|
|
1813
1813
|
newtonCradle: "cos-newtonCradle-mFl-b",
|
|
1814
1814
|
canvas: "cos-canvas-TWKl5"
|
|
1815
|
-
},
|
|
1815
|
+
}, et = ({ ballCount: e = 5, color: t = "#38bdf8", width: r = 280, height: i = 200 }) => {
|
|
1816
1816
|
let a = o(null), s = Math.max(2, Math.min(e, 7));
|
|
1817
1817
|
return n(() => {
|
|
1818
1818
|
let e = a.current;
|
|
@@ -1875,7 +1875,7 @@ var P = {
|
|
|
1875
1875
|
i,
|
|
1876
1876
|
r
|
|
1877
1877
|
]), /* @__PURE__ */ l("div", {
|
|
1878
|
-
className:
|
|
1878
|
+
className: $e.newtonCradle,
|
|
1879
1879
|
style: {
|
|
1880
1880
|
width: r,
|
|
1881
1881
|
height: i,
|
|
@@ -1883,14 +1883,14 @@ var P = {
|
|
|
1883
1883
|
},
|
|
1884
1884
|
children: /* @__PURE__ */ l("canvas", {
|
|
1885
1885
|
ref: a,
|
|
1886
|
-
className:
|
|
1886
|
+
className: $e.canvas,
|
|
1887
1887
|
style: {
|
|
1888
1888
|
width: r,
|
|
1889
1889
|
height: i
|
|
1890
1890
|
}
|
|
1891
1891
|
})
|
|
1892
1892
|
});
|
|
1893
|
-
},
|
|
1893
|
+
}, tt = {
|
|
1894
1894
|
orbitalChart: "cos-orbitalChart-XLORB",
|
|
1895
1895
|
canvas: "cos-canvas-hGVud",
|
|
1896
1896
|
legend: "cos-legend-Np9Mm",
|
|
@@ -1945,23 +1945,23 @@ var P = {
|
|
|
1945
1945
|
cancelAnimationFrame(u), p();
|
|
1946
1946
|
};
|
|
1947
1947
|
}, [e, t]), /* @__PURE__ */ u("div", {
|
|
1948
|
-
className:
|
|
1948
|
+
className: tt.orbitalChart,
|
|
1949
1949
|
style: {
|
|
1950
1950
|
width: t,
|
|
1951
1951
|
height: t
|
|
1952
1952
|
},
|
|
1953
1953
|
children: [/* @__PURE__ */ l("canvas", {
|
|
1954
1954
|
ref: r,
|
|
1955
|
-
className:
|
|
1955
|
+
className: tt.canvas,
|
|
1956
1956
|
style: {
|
|
1957
1957
|
width: t,
|
|
1958
1958
|
height: t
|
|
1959
1959
|
}
|
|
1960
1960
|
}), /* @__PURE__ */ l("ul", {
|
|
1961
|
-
className:
|
|
1961
|
+
className: tt.legend,
|
|
1962
1962
|
children: e.map((e) => /* @__PURE__ */ u("li", { children: [
|
|
1963
1963
|
/* @__PURE__ */ l("span", {
|
|
1964
|
-
className:
|
|
1964
|
+
className: tt.swatch,
|
|
1965
1965
|
style: { background: e.color }
|
|
1966
1966
|
}),
|
|
1967
1967
|
e.label,
|
|
@@ -2160,98 +2160,245 @@ var P = {
|
|
|
2160
2160
|
}, ct = {
|
|
2161
2161
|
smokeFog: "cos-smokeFog-SYlts",
|
|
2162
2162
|
canvas: "cos-canvas-iOJV7"
|
|
2163
|
-
}, lt =
|
|
2164
|
-
|
|
2163
|
+
}, lt = 10, V = 128, ut = "#d2d4d8", dt = [
|
|
2164
|
+
"#14151c",
|
|
2165
|
+
"#1a1b24",
|
|
2166
|
+
"#0e0f14"
|
|
2167
|
+
], ft = (e, t) => {
|
|
2168
|
+
let n = Math.sin(e * 127.1 + t * 311.7) * 43758.5453;
|
|
2169
|
+
return n - Math.floor(n);
|
|
2170
|
+
}, pt = (e, t) => {
|
|
2171
|
+
let n = Math.floor(e), r = Math.floor(t), i = e - n, a = t - r, o = i * i * (3 - 2 * i), s = a * a * (3 - 2 * a), c = ft(n, r), l = ft(n + 1, r), u = ft(n, r + 1), d = ft(n + 1, r + 1);
|
|
2172
|
+
return c + (l - c) * o + (u - c) * s + (c - l - u + d) * o * s;
|
|
2173
|
+
}, mt = (e, t) => {
|
|
2174
|
+
let n = 0, r = .5, i = 1;
|
|
2175
|
+
for (let a = 0; a < 4; a++) n += r * pt(e * i, t * i), i *= 2.05, r *= .5;
|
|
2176
|
+
return n;
|
|
2177
|
+
}, H = (e, t) => {
|
|
2178
|
+
let n = e.replace("#", "").trim(), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
|
|
2179
|
+
if (r.length !== 6) return t;
|
|
2180
|
+
let i = Number.parseInt(r, 16);
|
|
2181
|
+
return Number.isNaN(i) ? t : [
|
|
2182
|
+
i >> 16 & 255,
|
|
2183
|
+
i >> 8 & 255,
|
|
2184
|
+
i & 255
|
|
2185
|
+
];
|
|
2186
|
+
}, ht = (e, t, n) => [
|
|
2187
|
+
Math.round(e[0] + (t[0] - e[0]) * n),
|
|
2188
|
+
Math.round(e[1] + (t[1] - e[1]) * n),
|
|
2189
|
+
Math.round(e[2] + (t[2] - e[2]) * n)
|
|
2190
|
+
], U = (e, t = 1) => t >= 1 ? `rgb(${e[0]} ${e[1]} ${e[2]})` : `rgb(${e[0]} ${e[1]} ${e[2]} / ${t})`, gt = (e) => {
|
|
2191
|
+
if (Array.isArray(e) && e.length >= 3) return [
|
|
2192
|
+
e[0],
|
|
2193
|
+
e[1],
|
|
2194
|
+
e[2]
|
|
2195
|
+
];
|
|
2196
|
+
let t = H(typeof e == "string" ? e : dt[2], [
|
|
2197
|
+
14,
|
|
2198
|
+
15,
|
|
2199
|
+
20
|
|
2200
|
+
]), n = ht(t, [
|
|
2201
|
+
255,
|
|
2202
|
+
255,
|
|
2203
|
+
255
|
|
2204
|
+
], .06);
|
|
2205
|
+
return [
|
|
2206
|
+
U(ht(t, [
|
|
2207
|
+
255,
|
|
2208
|
+
255,
|
|
2209
|
+
255
|
|
2210
|
+
], .1)),
|
|
2211
|
+
U(n),
|
|
2212
|
+
U(t)
|
|
2213
|
+
];
|
|
2214
|
+
}, _t = (e, t) => {
|
|
2215
|
+
let n = document.createElement("canvas");
|
|
2216
|
+
n.width = V, n.height = V;
|
|
2217
|
+
let r = n.getContext("2d"), i = r.createImageData(V, V), a = i.data, o = V / 2, s = V / 2, c = V * .48;
|
|
2218
|
+
for (let n = 0; n < V; n++) for (let r = 0; r < V; r++) {
|
|
2219
|
+
let i = (r - o) / c, l = (n - s) / c, u = Math.hypot(i, l);
|
|
2220
|
+
if (u > 1.15) continue;
|
|
2221
|
+
let d = mt(r * .045 + e * 17.1, n * .045 + e * 9.3) * .7 + mt(r * .09 - e * 3.2, n * .09 + e * 5.7) * .3, f = u + (d - .45) * .55, p = 1 - Math.max(0, f);
|
|
2222
|
+
if (p = Math.max(0, p) ** 1.35, p *= .55 + d * .7, p < .01) continue;
|
|
2223
|
+
let m = (n * V + r) * 4, h = .88 + d * .18;
|
|
2224
|
+
a[m] = Math.min(255, t[0] * h), a[m + 1] = Math.min(255, t[1] * h + 1), a[m + 2] = Math.min(255, t[2] * h + 3), a[m + 3] = Math.min(255, p * 210);
|
|
2225
|
+
}
|
|
2226
|
+
return r.putImageData(i, 0, 0), n;
|
|
2227
|
+
}, vt = (e) => Array.from({ length: lt }, (t, n) => _t(n + 1, e)), yt = (e, t, n = 0) => {
|
|
2228
|
+
let r = 70 + Math.random() * 110, i = Math.min(.92, n * .88), a = t * (1 - n * .92) + r * (.15 - n * .1), o = (.32 + Math.random() * .28) * (1 - n * .55);
|
|
2165
2229
|
return {
|
|
2166
2230
|
x: Math.random() * e,
|
|
2167
|
-
y:
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2231
|
+
y: a,
|
|
2232
|
+
vx: (Math.random() - .5) * .18,
|
|
2233
|
+
vy: -(.08 + Math.random() * .16),
|
|
2234
|
+
size: r * (.7 + i * .55),
|
|
2235
|
+
birthSize: r,
|
|
2236
|
+
maxSize: r * (1.8 + Math.random() * 1.4),
|
|
2237
|
+
rotation: Math.random() * Math.PI * 2,
|
|
2238
|
+
spin: (Math.random() - .5) * .004,
|
|
2239
|
+
age: i,
|
|
2240
|
+
ageSpeed: 4e-4 + Math.random() * 65e-5,
|
|
2241
|
+
opacity: o,
|
|
2242
|
+
sprite: Math.floor(Math.random() * lt),
|
|
2243
|
+
stretch: .85 + Math.random() * .55 + n * .25,
|
|
2244
|
+
receptivity: .5 + Math.random() * .85,
|
|
2245
|
+
mass: .5 + Math.random() * .9,
|
|
2246
|
+
phase: Math.random() * Math.PI * 2,
|
|
2247
|
+
warmth: Math.random()
|
|
2179
2248
|
};
|
|
2180
|
-
},
|
|
2181
|
-
let
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2249
|
+
}, bt = (e, t) => {
|
|
2250
|
+
let n = Math.hypot(e.vx, e.vy);
|
|
2251
|
+
if (n <= t) return;
|
|
2252
|
+
let r = t / n;
|
|
2253
|
+
e.vx *= r, e.vy *= r;
|
|
2254
|
+
}, xt = (e) => e < .06 ? e / .06 : e > .55 ? Math.max(0, 1 - (e - .55) / .45) : 1, St = (e, t) => .22 + Math.min(1, Math.max(0, e / t)) ** 1.15 * .78, Ct = ({ width: e = 800, height: r = 500, density: i = .5, color: a = ut, backgroundColor: s = dt, speed: c = 1, disperseStrength: u = 1, disperseRadius: d = 1, interactive: f = !0 }) => {
|
|
2255
|
+
let p = o(null), m = o([]), h = o([]), g = o(null), _ = o(""), b = o(0), x = o({
|
|
2256
|
+
speed: c,
|
|
2257
|
+
disperseStrength: u,
|
|
2258
|
+
disperseRadius: d,
|
|
2259
|
+
interactive: f,
|
|
2260
|
+
color: a,
|
|
2261
|
+
backgroundColor: s
|
|
2262
|
+
});
|
|
2185
2263
|
n(() => {
|
|
2186
|
-
|
|
2187
|
-
|
|
2264
|
+
x.current = {
|
|
2265
|
+
speed: c,
|
|
2266
|
+
disperseStrength: u,
|
|
2267
|
+
disperseRadius: d,
|
|
2268
|
+
interactive: f,
|
|
2269
|
+
color: a,
|
|
2270
|
+
backgroundColor: s
|
|
2271
|
+
};
|
|
2272
|
+
}, [
|
|
2273
|
+
c,
|
|
2274
|
+
u,
|
|
2275
|
+
d,
|
|
2276
|
+
f,
|
|
2277
|
+
a,
|
|
2278
|
+
s
|
|
2279
|
+
]), n(() => {
|
|
2280
|
+
g.current = vt(H(a, [
|
|
2281
|
+
210,
|
|
2282
|
+
212,
|
|
2283
|
+
216
|
|
2284
|
+
])), _.current = a;
|
|
2285
|
+
}, [a]), n(() => {
|
|
2286
|
+
let t = Math.floor(56 + i * 100);
|
|
2287
|
+
m.current = Array.from({ length: t }, () => yt(e, r, Math.random() ** 1.75));
|
|
2188
2288
|
}, [
|
|
2189
2289
|
i,
|
|
2190
2290
|
r,
|
|
2191
2291
|
e
|
|
2192
2292
|
]);
|
|
2193
|
-
let
|
|
2194
|
-
let i =
|
|
2195
|
-
if (!i) return;
|
|
2196
|
-
let
|
|
2197
|
-
|
|
2293
|
+
let S = t((t, n) => {
|
|
2294
|
+
let i = x.current;
|
|
2295
|
+
if (!i.interactive) return;
|
|
2296
|
+
let a = p.current;
|
|
2297
|
+
if (!a) return;
|
|
2298
|
+
let o = a.getBoundingClientRect(), s = (t - o.left) / o.width * e, c = (n - o.top) / o.height * r, l = y(i.disperseRadius, 0, 3), u = y(i.disperseStrength, 0, 3);
|
|
2299
|
+
h.current.length > 3 && h.current.shift(), h.current.push({
|
|
2198
2300
|
x: s,
|
|
2199
|
-
y:
|
|
2301
|
+
y: c,
|
|
2200
2302
|
life: 1,
|
|
2201
|
-
windAngle: Math.random() * Math.PI * 2,
|
|
2202
2303
|
swirl: Math.random() < .5 ? -1 : 1,
|
|
2203
|
-
|
|
2204
|
-
|
|
2304
|
+
radius: Math.min(e, r) * .08 * l,
|
|
2305
|
+
maxRadius: Math.min(e, r) * (.42 + Math.random() * .12) * l,
|
|
2306
|
+
strength: (.7 + Math.random() * .25) * u
|
|
2205
2307
|
});
|
|
2206
2308
|
}, [r, e]);
|
|
2207
2309
|
return n(() => {
|
|
2208
|
-
let e =
|
|
2310
|
+
let e = p.current;
|
|
2209
2311
|
if (!e) return;
|
|
2210
|
-
let t = (e) =>
|
|
2211
|
-
|
|
2212
|
-
t && d(t.clientX, t.clientY);
|
|
2312
|
+
let t = (e) => {
|
|
2313
|
+
e.pointerType === "mouse" && e.button !== 0 || S(e.clientX, e.clientY);
|
|
2213
2314
|
};
|
|
2214
|
-
return e.addEventListener("
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
}, [d]), n(() => {
|
|
2218
|
-
let t = a.current;
|
|
2315
|
+
return e.addEventListener("pointerdown", t), () => e.removeEventListener("pointerdown", t);
|
|
2316
|
+
}, [S]), n(() => {
|
|
2317
|
+
let t = p.current;
|
|
2219
2318
|
if (!t) return;
|
|
2220
|
-
let n = window.devicePixelRatio || 1;
|
|
2221
|
-
t.width = e * n, t.height = r * n;
|
|
2319
|
+
let n = Math.min(window.devicePixelRatio || 1, 2);
|
|
2320
|
+
t.width = Math.floor(e * n), t.height = Math.floor(r * n);
|
|
2222
2321
|
let i = t.getContext("2d");
|
|
2223
2322
|
if (!i) return;
|
|
2224
2323
|
i.setTransform(n, 0, 0, n, 0, 0);
|
|
2225
|
-
let
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2324
|
+
let a = H(x.current.color, [
|
|
2325
|
+
210,
|
|
2326
|
+
212,
|
|
2327
|
+
216
|
|
2328
|
+
]);
|
|
2329
|
+
g.current || (g.current = vt(a), _.current = x.current.color);
|
|
2330
|
+
let o = g.current, s = 0, c = document.hidden, l = v((e) => {
|
|
2331
|
+
c = e;
|
|
2332
|
+
}), u = typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, d = () => {
|
|
2333
|
+
let [t, n, a] = gt(x.current.backgroundColor), o = i.createLinearGradient(0, 0, 0, r);
|
|
2334
|
+
o.addColorStop(0, t), o.addColorStop(.45, n), o.addColorStop(1, a), i.fillStyle = o, i.fillRect(0, 0, e, r);
|
|
2335
|
+
let s = H(a, [
|
|
2336
|
+
14,
|
|
2337
|
+
15,
|
|
2338
|
+
20
|
|
2339
|
+
]), c = ht(s, [
|
|
2340
|
+
255,
|
|
2341
|
+
255,
|
|
2342
|
+
255
|
|
2343
|
+
], .22), l = i.createRadialGradient(e * .5, r * .75, 0, e * .5, r, e * .55);
|
|
2344
|
+
l.addColorStop(0, U(c, .35)), l.addColorStop(1, U(s, 0)), i.fillStyle = l, i.fillRect(0, 0, e, r);
|
|
2345
|
+
}, f = (e) => {
|
|
2346
|
+
let t = xt(e.age) * St(e.y, r);
|
|
2347
|
+
if (t <= .01) return;
|
|
2348
|
+
let n = o[e.sprite], a = e.birthSize + (e.maxSize - e.birthSize) * Math.min(1, e.age * 1.15), s = e.size + (a - e.size) * .35, c = s, l = s * e.stretch;
|
|
2349
|
+
i.save(), i.translate(e.x, e.y), i.rotate(e.rotation), i.globalAlpha = e.opacity * t * (.85 + e.warmth * .2), i.globalCompositeOperation = "screen", i.drawImage(n, -c / 2, -l / 2, c, l), i.restore();
|
|
2350
|
+
}, S = () => {
|
|
2351
|
+
if (b.current = requestAnimationFrame(S), c) return;
|
|
2352
|
+
let t = y(x.current.speed, 0, 3), n = y(x.current.disperseStrength, 0, 3);
|
|
2353
|
+
s += .01 * Math.max(t, .001), d(), _.current !== x.current.color && (g.current = vt(H(x.current.color, [
|
|
2354
|
+
210,
|
|
2355
|
+
212,
|
|
2356
|
+
216
|
|
2357
|
+
])), _.current = x.current.color);
|
|
2358
|
+
let a = g.current ?? o, l = m.current, u = h.current;
|
|
2359
|
+
for (let e = u.length - 1; e >= 0; e--) {
|
|
2360
|
+
let t = u[e], r = 1 - t.life, i = Math.sin(Math.PI * Math.min(1, r * 1.05)) * t.strength;
|
|
2361
|
+
t.radius += (t.maxRadius - t.radius) * .055;
|
|
2362
|
+
for (let e of l) {
|
|
2363
|
+
let r = e.x - t.x, a = e.y - t.y, o = Math.hypot(r, a) || .001;
|
|
2364
|
+
if (o > t.radius) continue;
|
|
2365
|
+
let c = o / t.radius, l = Math.exp(-c * c * 2.2) * (1 - c * .35), u = Math.exp(-(((c - .72) / .32) ** 2)), d = l * .55 + u * .45, f = .72 + .28 * Math.sin(e.phase * 2.7 + s * 1.2 + o * .03), p = d * e.receptivity * f * i;
|
|
2366
|
+
if (p < .02) continue;
|
|
2367
|
+
let m = r / o, h = a / o, g = -h * t.swirl, _ = m * t.swirl, v = 1 / (.65 + e.mass * .7), y = Math.sin(e.phase * 4.2 + s * 1.6) * .35;
|
|
2368
|
+
e.vx += (m * .55 + g * .22 + y * .12) * p * v, e.vy += (h * .48 + _ * .22 - .06) * p * v, e.opacity *= 1 - p * .028, e.maxSize *= 1 + p * .02, e.stretch += p * .012, e.spin += y * p * .004, bt(e, 2.4 * Math.max(n, .35));
|
|
2242
2369
|
}
|
|
2243
|
-
t.life *= .
|
|
2370
|
+
t.life *= .972, t.life < .04 && u.splice(e, 1);
|
|
2244
2371
|
}
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
let
|
|
2248
|
-
|
|
2249
|
-
let
|
|
2250
|
-
|
|
2251
|
-
|
|
2372
|
+
i.save();
|
|
2373
|
+
for (let n = 0; n < l.length; n++) {
|
|
2374
|
+
let o = l[n], c = Math.sin(s * .55 + o.phase) * .16, u = Math.cos(s * .4 + o.phase * 1.3) * .05;
|
|
2375
|
+
o.vx += c * .018 * t, o.vy += u * .01 * t - .0035 * t;
|
|
2376
|
+
let d = Math.hypot(o.vx, o.vy), f = d > .8 ? .975 : .99;
|
|
2377
|
+
o.vx *= f, o.vy *= f, o.x += o.vx * t, o.y += o.vy * t, o.rotation += (o.spin + o.vx * .002) * t, o.age += o.ageSpeed * t;
|
|
2378
|
+
let p = o.birthSize + (o.maxSize - o.birthSize) * Math.min(1, o.age * 1.15);
|
|
2379
|
+
o.size += (p - o.size) * .04;
|
|
2380
|
+
let m = (.3 + o.warmth * .1) * St(o.y, r), h = .006 + .008 * Math.max(0, 1 - d / 2.2);
|
|
2381
|
+
if (o.opacity += (m - o.opacity) * h, o.stretch += (1.05 + (1 - o.y / r) * .55 - o.stretch) * .01, o.age >= 1 || o.y < -o.size || o.opacity < .02) {
|
|
2382
|
+
l[n] = yt(e, r, 0);
|
|
2383
|
+
continue;
|
|
2384
|
+
}
|
|
2385
|
+
o.x < -o.size && (o.x = e + o.size * .5), o.x > e + o.size && (o.x = -o.size * .5);
|
|
2386
|
+
let g = xt(o.age) * St(o.y, r);
|
|
2387
|
+
if (g <= .01) continue;
|
|
2388
|
+
let _ = a[o.sprite], v = o.birthSize + (o.maxSize - o.birthSize) * Math.min(1, o.age * 1.15), y = o.size + (v - o.size) * .35, b = y, x = y * o.stretch;
|
|
2389
|
+
i.save(), i.translate(o.x, o.y), i.rotate(o.rotation), i.globalAlpha = o.opacity * g * (.85 + o.warmth * .2), i.globalCompositeOperation = "screen", i.drawImage(_, -b / 2, -x / 2, b, x), i.restore();
|
|
2390
|
+
}
|
|
2391
|
+
i.restore(), i.globalCompositeOperation = "source-over", i.globalAlpha = 1;
|
|
2252
2392
|
};
|
|
2253
|
-
|
|
2254
|
-
|
|
2393
|
+
if (u) {
|
|
2394
|
+
d();
|
|
2395
|
+
for (let e of m.current) f(e);
|
|
2396
|
+
return i.globalCompositeOperation = "source-over", i.globalAlpha = 1, () => {
|
|
2397
|
+
l();
|
|
2398
|
+
};
|
|
2399
|
+
}
|
|
2400
|
+
return S(), () => {
|
|
2401
|
+
cancelAnimationFrame(b.current), l();
|
|
2255
2402
|
};
|
|
2256
2403
|
}, [r, e]), /* @__PURE__ */ l("div", {
|
|
2257
2404
|
className: ct.smokeFog,
|
|
@@ -2260,18 +2407,21 @@ var P = {
|
|
|
2260
2407
|
height: r
|
|
2261
2408
|
},
|
|
2262
2409
|
children: /* @__PURE__ */ l("canvas", {
|
|
2263
|
-
ref:
|
|
2410
|
+
ref: p,
|
|
2264
2411
|
className: ct.canvas,
|
|
2265
2412
|
style: {
|
|
2266
2413
|
width: e,
|
|
2267
|
-
height: r
|
|
2268
|
-
|
|
2414
|
+
height: r,
|
|
2415
|
+
cursor: f ? "pointer" : "default"
|
|
2416
|
+
},
|
|
2417
|
+
role: "img",
|
|
2418
|
+
"aria-label": f ? "烟雾背景,点击可驱散" : "烟雾背景"
|
|
2269
2419
|
})
|
|
2270
2420
|
});
|
|
2271
|
-
},
|
|
2421
|
+
}, wt = {
|
|
2272
2422
|
solarSystem: "cos-solarSystem-27h8F",
|
|
2273
2423
|
canvas: "cos-canvas-C0nRa"
|
|
2274
|
-
},
|
|
2424
|
+
}, Tt = [
|
|
2275
2425
|
{
|
|
2276
2426
|
name: "Mercury",
|
|
2277
2427
|
radius: 0,
|
|
@@ -2329,10 +2479,10 @@ var P = {
|
|
|
2329
2479
|
size: 2,
|
|
2330
2480
|
parent: 2
|
|
2331
2481
|
}
|
|
2332
|
-
],
|
|
2482
|
+
], Et = ({ width: e = 400, height: t = 400, speed: r = 1, showOrbits: i = !0 }) => {
|
|
2333
2483
|
let a = o(null), s = o([]), c = o([]);
|
|
2334
2484
|
return n(() => {
|
|
2335
|
-
s.current =
|
|
2485
|
+
s.current = Tt.map((e) => ({
|
|
2336
2486
|
...e,
|
|
2337
2487
|
angle: Math.random() * Math.PI * 2
|
|
2338
2488
|
})), c.current = Array.from({ length: 80 }, () => ({
|
|
@@ -2381,24 +2531,24 @@ var P = {
|
|
|
2381
2531
|
r,
|
|
2382
2532
|
e
|
|
2383
2533
|
]), /* @__PURE__ */ l("div", {
|
|
2384
|
-
className:
|
|
2534
|
+
className: wt.solarSystem,
|
|
2385
2535
|
style: {
|
|
2386
2536
|
width: e,
|
|
2387
2537
|
height: t
|
|
2388
2538
|
},
|
|
2389
2539
|
children: /* @__PURE__ */ l("canvas", {
|
|
2390
2540
|
ref: a,
|
|
2391
|
-
className:
|
|
2541
|
+
className: wt.canvas,
|
|
2392
2542
|
style: {
|
|
2393
2543
|
width: e,
|
|
2394
2544
|
height: t
|
|
2395
2545
|
}
|
|
2396
2546
|
})
|
|
2397
2547
|
});
|
|
2398
|
-
},
|
|
2548
|
+
}, Dt = {
|
|
2399
2549
|
snowfall: "cos-snowfall-Q-Dhg",
|
|
2400
2550
|
canvas: "cos-canvas-bJVF8"
|
|
2401
|
-
},
|
|
2551
|
+
}, Ot = ({ width: e = 800, height: r = 500, mode: i = "snow", count: a = 120 }) => {
|
|
2402
2552
|
let s = o(null), c = o([]), u = o(0), d = t((t) => ({
|
|
2403
2553
|
x: Math.random() * e,
|
|
2404
2554
|
y: t ?? Math.random() * r,
|
|
@@ -2445,24 +2595,24 @@ var P = {
|
|
|
2445
2595
|
i,
|
|
2446
2596
|
e
|
|
2447
2597
|
]), /* @__PURE__ */ l("div", {
|
|
2448
|
-
className:
|
|
2598
|
+
className: Dt.snowfall,
|
|
2449
2599
|
style: {
|
|
2450
2600
|
width: e,
|
|
2451
2601
|
height: r
|
|
2452
2602
|
},
|
|
2453
2603
|
children: /* @__PURE__ */ l("canvas", {
|
|
2454
2604
|
ref: s,
|
|
2455
|
-
className:
|
|
2605
|
+
className: Dt.canvas,
|
|
2456
2606
|
style: {
|
|
2457
2607
|
width: e,
|
|
2458
2608
|
height: r
|
|
2459
2609
|
}
|
|
2460
2610
|
})
|
|
2461
2611
|
});
|
|
2462
|
-
},
|
|
2612
|
+
}, kt = {
|
|
2463
2613
|
starfield: "cos-starfield-QTwia",
|
|
2464
2614
|
canvas: "cos-canvas-C2t3g"
|
|
2465
|
-
},
|
|
2615
|
+
}, At = ({ width: e = 800, height: t = 500, starCount: r = 400, speed: i = 1 }) => {
|
|
2466
2616
|
let a = o(null), s = o([]), c = o(0);
|
|
2467
2617
|
return n(() => {
|
|
2468
2618
|
s.current = Array.from({ length: r }, () => ({
|
|
@@ -2505,21 +2655,21 @@ var P = {
|
|
|
2505
2655
|
r,
|
|
2506
2656
|
e
|
|
2507
2657
|
]), /* @__PURE__ */ l("div", {
|
|
2508
|
-
className:
|
|
2658
|
+
className: kt.starfield,
|
|
2509
2659
|
style: {
|
|
2510
2660
|
width: e,
|
|
2511
2661
|
height: t
|
|
2512
2662
|
},
|
|
2513
2663
|
children: /* @__PURE__ */ l("canvas", {
|
|
2514
2664
|
ref: a,
|
|
2515
|
-
className:
|
|
2665
|
+
className: kt.canvas,
|
|
2516
2666
|
style: {
|
|
2517
2667
|
width: e,
|
|
2518
2668
|
height: t
|
|
2519
2669
|
}
|
|
2520
2670
|
})
|
|
2521
2671
|
});
|
|
2522
|
-
},
|
|
2672
|
+
}, W = {
|
|
2523
2673
|
progressChest: "cos-progressChest-Bqcv1",
|
|
2524
2674
|
barWrap: "cos-barWrap-E2pnl",
|
|
2525
2675
|
barTrack: "cos-barTrack-dKLhs",
|
|
@@ -2534,37 +2684,37 @@ var P = {
|
|
|
2534
2684
|
treasure: "cos-treasure-nx-6S",
|
|
2535
2685
|
pop: "cos-pop-uRZvT",
|
|
2536
2686
|
label: "cos-label-61hRe"
|
|
2537
|
-
},
|
|
2687
|
+
}, jt = ({ progress: e = 0, onOpen: t, label: r = "开启宝箱" }) => {
|
|
2538
2688
|
let i = o(!1), a = o(t), s = y(e, 0, 100), c = s >= 100;
|
|
2539
2689
|
return n(() => {
|
|
2540
2690
|
a.current = t;
|
|
2541
2691
|
}, [t]), n(() => {
|
|
2542
2692
|
c && !i.current && (i.current = !0, a.current?.()), c || (i.current = !1);
|
|
2543
2693
|
}, [c]), /* @__PURE__ */ u("div", {
|
|
2544
|
-
className:
|
|
2694
|
+
className: W.progressChest,
|
|
2545
2695
|
children: [
|
|
2546
2696
|
/* @__PURE__ */ u("div", {
|
|
2547
|
-
className:
|
|
2697
|
+
className: W.barWrap,
|
|
2548
2698
|
children: [/* @__PURE__ */ l("div", {
|
|
2549
|
-
className:
|
|
2699
|
+
className: W.barTrack,
|
|
2550
2700
|
children: /* @__PURE__ */ l("div", {
|
|
2551
|
-
className:
|
|
2701
|
+
className: W.barFill,
|
|
2552
2702
|
style: { width: `${s}%` }
|
|
2553
2703
|
})
|
|
2554
2704
|
}), /* @__PURE__ */ u("span", {
|
|
2555
|
-
className:
|
|
2705
|
+
className: W.pct,
|
|
2556
2706
|
children: [s.toFixed(0), "%"]
|
|
2557
2707
|
})]
|
|
2558
2708
|
}),
|
|
2559
2709
|
/* @__PURE__ */ u("div", {
|
|
2560
|
-
className: `${
|
|
2710
|
+
className: `${W.chest} ${c ? W.open : ""}`,
|
|
2561
2711
|
children: [/* @__PURE__ */ u("div", {
|
|
2562
|
-
className:
|
|
2563
|
-
children: [/* @__PURE__ */ l("div", { className:
|
|
2712
|
+
className: W.lid,
|
|
2713
|
+
children: [/* @__PURE__ */ l("div", { className: W.lidTop }), /* @__PURE__ */ l("div", { className: W.lock })]
|
|
2564
2714
|
}), /* @__PURE__ */ l("div", {
|
|
2565
|
-
className:
|
|
2715
|
+
className: W.body,
|
|
2566
2716
|
children: c && /* @__PURE__ */ u("div", {
|
|
2567
|
-
className:
|
|
2717
|
+
className: W.treasure,
|
|
2568
2718
|
children: [
|
|
2569
2719
|
/* @__PURE__ */ l("span", { children: "💎" }),
|
|
2570
2720
|
/* @__PURE__ */ l("span", { children: "✨" }),
|
|
@@ -2574,15 +2724,15 @@ var P = {
|
|
|
2574
2724
|
})]
|
|
2575
2725
|
}),
|
|
2576
2726
|
/* @__PURE__ */ l("p", {
|
|
2577
|
-
className:
|
|
2727
|
+
className: W.label,
|
|
2578
2728
|
children: c ? "宝箱已开启!" : r
|
|
2579
2729
|
})
|
|
2580
2730
|
]
|
|
2581
2731
|
});
|
|
2582
|
-
},
|
|
2732
|
+
}, Mt = {
|
|
2583
2733
|
radarScan: "cos-radarScan-PZaG8",
|
|
2584
2734
|
canvas: "cos-canvas-fUw5N"
|
|
2585
|
-
},
|
|
2735
|
+
}, Nt = ({ size: e = 300, color: t = "#22d3ee", blipCount: r = 5 }) => {
|
|
2586
2736
|
let i = o(null), a = o(0), s = o([]), c = o(0);
|
|
2587
2737
|
return n(() => {
|
|
2588
2738
|
s.current = Array.from({ length: r }, () => ({
|
|
@@ -2619,27 +2769,27 @@ var P = {
|
|
|
2619
2769
|
t,
|
|
2620
2770
|
e
|
|
2621
2771
|
]), /* @__PURE__ */ l("div", {
|
|
2622
|
-
className:
|
|
2772
|
+
className: Mt.radarScan,
|
|
2623
2773
|
style: {
|
|
2624
2774
|
width: e,
|
|
2625
2775
|
height: e
|
|
2626
2776
|
},
|
|
2627
2777
|
children: /* @__PURE__ */ l("canvas", {
|
|
2628
2778
|
ref: i,
|
|
2629
|
-
className:
|
|
2779
|
+
className: Mt.canvas,
|
|
2630
2780
|
style: {
|
|
2631
2781
|
width: e,
|
|
2632
2782
|
height: e
|
|
2633
2783
|
}
|
|
2634
2784
|
})
|
|
2635
2785
|
});
|
|
2636
|
-
},
|
|
2786
|
+
}, G = {
|
|
2637
2787
|
redPacketRain: "cos-redPacketRain-eJ7FW",
|
|
2638
2788
|
canvas: "cos-canvas-direH",
|
|
2639
2789
|
hud: "cos-hud-InqMq",
|
|
2640
2790
|
end: "cos-end-u0J7o",
|
|
2641
2791
|
hint: "cos-hint-sO6ld"
|
|
2642
|
-
},
|
|
2792
|
+
}, Pt = ({ duration: e = 1e4, onGrab: r }) => {
|
|
2643
2793
|
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), y = o(r);
|
|
2644
2794
|
n(() => {
|
|
2645
2795
|
y.current = r;
|
|
@@ -2685,11 +2835,11 @@ var P = {
|
|
|
2685
2835
|
cancelAnimationFrame(c.current), clearTimeout(l), s();
|
|
2686
2836
|
};
|
|
2687
2837
|
}, [e, b]), /* @__PURE__ */ u("div", {
|
|
2688
|
-
className:
|
|
2838
|
+
className: G.redPacketRain,
|
|
2689
2839
|
children: [
|
|
2690
2840
|
/* @__PURE__ */ l("canvas", {
|
|
2691
2841
|
ref: i,
|
|
2692
|
-
className:
|
|
2842
|
+
className: G.canvas,
|
|
2693
2843
|
style: {
|
|
2694
2844
|
width: 400,
|
|
2695
2845
|
height: 500
|
|
@@ -2703,25 +2853,25 @@ var P = {
|
|
|
2703
2853
|
}
|
|
2704
2854
|
}),
|
|
2705
2855
|
/* @__PURE__ */ u("div", {
|
|
2706
|
-
className:
|
|
2856
|
+
className: G.hud,
|
|
2707
2857
|
children: [/* @__PURE__ */ u("span", { children: ["已抢: ¥", p] }), !h && /* @__PURE__ */ l("span", {
|
|
2708
|
-
className:
|
|
2858
|
+
className: G.end,
|
|
2709
2859
|
children: "红包雨结束"
|
|
2710
2860
|
})]
|
|
2711
2861
|
}),
|
|
2712
2862
|
/* @__PURE__ */ l("p", {
|
|
2713
|
-
className:
|
|
2863
|
+
className: G.hint,
|
|
2714
2864
|
children: "点击红包抢夺"
|
|
2715
2865
|
})
|
|
2716
2866
|
]
|
|
2717
2867
|
});
|
|
2718
|
-
},
|
|
2868
|
+
}, Ft = {
|
|
2719
2869
|
returnCityContainer: "cos-returnCityContainer-6XTxj",
|
|
2720
2870
|
star: "cos-star-a59Dx",
|
|
2721
2871
|
glassWrap: "cos-glassWrap-golMO",
|
|
2722
2872
|
rotate: "cos-rotate-7X9Jj",
|
|
2723
2873
|
glassItem: "cos-glassItem-OwlFI"
|
|
2724
|
-
},
|
|
2874
|
+
}, It = ({ starCount: e, glassCount: t = 8, glassRadius: r = 150 }) => {
|
|
2725
2875
|
let i = o(null), a = o(null);
|
|
2726
2876
|
return n(() => {
|
|
2727
2877
|
let n = i.current, o = a.current;
|
|
@@ -2730,13 +2880,13 @@ var P = {
|
|
|
2730
2880
|
for (let e = 0; e < f; e++) {
|
|
2731
2881
|
let e = window.setTimeout(() => {
|
|
2732
2882
|
let e = document.createElement("div");
|
|
2733
|
-
e.className =
|
|
2883
|
+
e.className = Ft.star, e.style.top = `${Math.random() * d}px`, e.style.left = `${Math.random() * u}px`, n.append(e), c.push(e);
|
|
2734
2884
|
}, Math.random() * 2e3);
|
|
2735
2885
|
s.push(e);
|
|
2736
2886
|
}
|
|
2737
2887
|
for (let e = 0; e < t; e++) {
|
|
2738
2888
|
let n = document.createElement("div");
|
|
2739
|
-
n.className =
|
|
2889
|
+
n.className = Ft.glassItem, n.style.transform = `rotateY(${360 / t * e}deg) translateZ(${r}px)`, o.appendChild(n), l.push(n);
|
|
2740
2890
|
let i = window.setTimeout(() => {
|
|
2741
2891
|
n.style.top = "0px", n.style.opacity = "1";
|
|
2742
2892
|
}, e * 300);
|
|
@@ -2751,16 +2901,16 @@ var P = {
|
|
|
2751
2901
|
r
|
|
2752
2902
|
]), /* @__PURE__ */ l("div", {
|
|
2753
2903
|
ref: i,
|
|
2754
|
-
className:
|
|
2904
|
+
className: Ft.returnCityContainer,
|
|
2755
2905
|
children: /* @__PURE__ */ l("div", {
|
|
2756
2906
|
ref: a,
|
|
2757
|
-
className:
|
|
2907
|
+
className: Ft.glassWrap
|
|
2758
2908
|
})
|
|
2759
2909
|
});
|
|
2760
|
-
},
|
|
2910
|
+
}, Lt = {
|
|
2761
2911
|
ropeChain: "cos-ropeChain-gYaSK",
|
|
2762
2912
|
canvas: "cos-canvas-5i95N"
|
|
2763
|
-
},
|
|
2913
|
+
}, Rt = ({ width: e = 400, height: t = 400, segments: r = 16, color: i = "#38bdf8", gravity: a = .4 }) => {
|
|
2764
2914
|
let s = o(null), c = o([]), u = o({
|
|
2765
2915
|
active: !1,
|
|
2766
2916
|
index: -1
|
|
@@ -2845,21 +2995,21 @@ var P = {
|
|
|
2845
2995
|
r,
|
|
2846
2996
|
e
|
|
2847
2997
|
]), /* @__PURE__ */ l("div", {
|
|
2848
|
-
className:
|
|
2998
|
+
className: Lt.ropeChain,
|
|
2849
2999
|
style: {
|
|
2850
3000
|
width: e,
|
|
2851
3001
|
height: t
|
|
2852
3002
|
},
|
|
2853
3003
|
children: /* @__PURE__ */ l("canvas", {
|
|
2854
3004
|
ref: s,
|
|
2855
|
-
className:
|
|
3005
|
+
className: Lt.canvas,
|
|
2856
3006
|
style: {
|
|
2857
3007
|
width: e,
|
|
2858
3008
|
height: t
|
|
2859
3009
|
}
|
|
2860
3010
|
})
|
|
2861
3011
|
});
|
|
2862
|
-
},
|
|
3012
|
+
}, K = {
|
|
2863
3013
|
speedometer: "cos-speedometer-INc7F",
|
|
2864
3014
|
svg: "cos-svg-HG-lE",
|
|
2865
3015
|
track: "cos-track-5-922",
|
|
@@ -2869,37 +3019,37 @@ var P = {
|
|
|
2869
3019
|
hub: "cos-hub-4WaHw",
|
|
2870
3020
|
valueText: "cos-valueText--q4Xi",
|
|
2871
3021
|
label: "cos-label-hOPy1"
|
|
2872
|
-
},
|
|
3022
|
+
}, q = (e, t, n, r) => {
|
|
2873
3023
|
let i = (r - 90) * Math.PI / 180;
|
|
2874
3024
|
return {
|
|
2875
3025
|
x: e + n * Math.cos(i),
|
|
2876
3026
|
y: t + n * Math.sin(i)
|
|
2877
3027
|
};
|
|
2878
|
-
},
|
|
3028
|
+
}, zt = ({ value: e = 0, max: t = 100, label: n = "SPEED", color: r = "#f97316" }) => {
|
|
2879
3029
|
let i = -120 + y(t > 0 ? e / t : 0, 0, 1) * 240, o = a(() => {
|
|
2880
|
-
let e =
|
|
3030
|
+
let e = q(100, 100, 72, -120), t = q(100, 100, 72, 120);
|
|
2881
3031
|
return `M ${e.x} ${e.y} A 72 72 0 1 1 ${t.x} ${t.y}`;
|
|
2882
3032
|
}, []), s = a(() => {
|
|
2883
|
-
let e =
|
|
3033
|
+
let e = q(100, 100, 72, -120), t = q(100, 100, 72, i), n = +(i - -120 > 180);
|
|
2884
3034
|
return `M ${e.x} ${e.y} A 72 72 0 ${n} 1 ${t.x} ${t.y}`;
|
|
2885
|
-
}, [i]), c =
|
|
3035
|
+
}, [i]), c = q(100, 100, 58, i);
|
|
2886
3036
|
return /* @__PURE__ */ u("div", {
|
|
2887
|
-
className:
|
|
3037
|
+
className: K.speedometer,
|
|
2888
3038
|
style: { "--gauge-color": r },
|
|
2889
3039
|
children: [/* @__PURE__ */ u("svg", {
|
|
2890
3040
|
viewBox: "0 0 200 130",
|
|
2891
|
-
className:
|
|
3041
|
+
className: K.svg,
|
|
2892
3042
|
children: [
|
|
2893
3043
|
/* @__PURE__ */ l("path", {
|
|
2894
3044
|
d: o,
|
|
2895
|
-
className:
|
|
3045
|
+
className: K.track,
|
|
2896
3046
|
fill: "none",
|
|
2897
3047
|
strokeWidth: "12",
|
|
2898
3048
|
strokeLinecap: "round"
|
|
2899
3049
|
}),
|
|
2900
3050
|
/* @__PURE__ */ l("path", {
|
|
2901
3051
|
d: s,
|
|
2902
|
-
className:
|
|
3052
|
+
className: K.valueArc,
|
|
2903
3053
|
fill: "none",
|
|
2904
3054
|
strokeWidth: "12",
|
|
2905
3055
|
strokeLinecap: "round"
|
|
@@ -2911,13 +3061,13 @@ var P = {
|
|
|
2911
3061
|
60,
|
|
2912
3062
|
120
|
|
2913
3063
|
].map((e) => {
|
|
2914
|
-
let t =
|
|
3064
|
+
let t = q(100, 100, 58, e), n = q(100, 100, 66, e);
|
|
2915
3065
|
return /* @__PURE__ */ l("line", {
|
|
2916
3066
|
x1: t.x,
|
|
2917
3067
|
y1: t.y,
|
|
2918
3068
|
x2: n.x,
|
|
2919
3069
|
y2: n.y,
|
|
2920
|
-
className:
|
|
3070
|
+
className: K.tick
|
|
2921
3071
|
}, e);
|
|
2922
3072
|
}),
|
|
2923
3073
|
/* @__PURE__ */ l("line", {
|
|
@@ -2925,27 +3075,27 @@ var P = {
|
|
|
2925
3075
|
y1: "100",
|
|
2926
3076
|
x2: c.x,
|
|
2927
3077
|
y2: c.y,
|
|
2928
|
-
className:
|
|
3078
|
+
className: K.needle
|
|
2929
3079
|
}),
|
|
2930
3080
|
/* @__PURE__ */ l("circle", {
|
|
2931
3081
|
cx: "100",
|
|
2932
3082
|
cy: "100",
|
|
2933
3083
|
r: "6",
|
|
2934
|
-
className:
|
|
3084
|
+
className: K.hub
|
|
2935
3085
|
}),
|
|
2936
3086
|
/* @__PURE__ */ l("text", {
|
|
2937
3087
|
x: "100",
|
|
2938
3088
|
y: "118",
|
|
2939
|
-
className:
|
|
3089
|
+
className: K.valueText,
|
|
2940
3090
|
children: Math.round(e)
|
|
2941
3091
|
})
|
|
2942
3092
|
]
|
|
2943
3093
|
}), /* @__PURE__ */ l("span", {
|
|
2944
|
-
className:
|
|
3094
|
+
className: K.label,
|
|
2945
3095
|
children: n
|
|
2946
3096
|
})]
|
|
2947
3097
|
});
|
|
2948
|
-
},
|
|
3098
|
+
}, J = {
|
|
2949
3099
|
timelinePulse: "cos-timelinePulse-kcBM6",
|
|
2950
3100
|
axis: "cos-axis-9DWis",
|
|
2951
3101
|
track: "cos-track-jG-HV",
|
|
@@ -2955,7 +3105,7 @@ var P = {
|
|
|
2955
3105
|
dot: "cos-dot-HJEVy",
|
|
2956
3106
|
pulse: "cos-pulse-N6FD1",
|
|
2957
3107
|
name: "cos-name-7zefJ"
|
|
2958
|
-
},
|
|
3108
|
+
}, Bt = ({ steps: e = [
|
|
2959
3109
|
"Start",
|
|
2960
3110
|
"Process",
|
|
2961
3111
|
"Review",
|
|
@@ -2963,26 +3113,26 @@ var P = {
|
|
|
2963
3113
|
], current: t = 0, color: n = "#22d3ee" }) => {
|
|
2964
3114
|
let r = y(t, 0, Math.max(0, e.length - 1)), i = e.length > 1 ? r / (e.length - 1) : 0;
|
|
2965
3115
|
return /* @__PURE__ */ l("div", {
|
|
2966
|
-
className:
|
|
3116
|
+
className: J.timelinePulse,
|
|
2967
3117
|
style: {
|
|
2968
3118
|
"--pulse-color": n,
|
|
2969
3119
|
"--step-count": e.length,
|
|
2970
3120
|
"--progress-ratio": i
|
|
2971
3121
|
},
|
|
2972
3122
|
children: /* @__PURE__ */ u("div", {
|
|
2973
|
-
className:
|
|
3123
|
+
className: J.axis,
|
|
2974
3124
|
children: [
|
|
2975
|
-
/* @__PURE__ */ l("div", { className:
|
|
2976
|
-
/* @__PURE__ */ l("div", { className:
|
|
3125
|
+
/* @__PURE__ */ l("div", { className: J.track }),
|
|
3126
|
+
/* @__PURE__ */ l("div", { className: J.progress }),
|
|
2977
3127
|
/* @__PURE__ */ l("ul", {
|
|
2978
|
-
className:
|
|
3128
|
+
className: J.steps,
|
|
2979
3129
|
children: e.map((e, t) => {
|
|
2980
3130
|
let n = t < r ? "done" : t === r ? "current" : "pending";
|
|
2981
3131
|
return /* @__PURE__ */ u("li", {
|
|
2982
|
-
className:
|
|
3132
|
+
className: J.step,
|
|
2983
3133
|
"data-state": n,
|
|
2984
|
-
children: [/* @__PURE__ */ l("span", { className:
|
|
2985
|
-
className:
|
|
3134
|
+
children: [/* @__PURE__ */ l("span", { className: J.dot }), /* @__PURE__ */ l("span", {
|
|
3135
|
+
className: J.name,
|
|
2986
3136
|
children: e
|
|
2987
3137
|
})]
|
|
2988
3138
|
}, e + t);
|
|
@@ -2991,83 +3141,211 @@ var P = {
|
|
|
2991
3141
|
]
|
|
2992
3142
|
})
|
|
2993
3143
|
});
|
|
2994
|
-
},
|
|
3144
|
+
}, Vt = {
|
|
2995
3145
|
rippleWater: "cos-rippleWater-wsinI",
|
|
2996
3146
|
canvas: "cos-canvas-XOdSF",
|
|
2997
3147
|
hint: "cos-hint-0JH5D"
|
|
2998
|
-
},
|
|
2999
|
-
let
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3148
|
+
}, Ht = "\nattribute vec2 a_pos;\nvarying vec2 v_uv;\nvoid main() {\n v_uv = a_pos * 0.5 + 0.5;\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}\n", Ut = "\nprecision highp float;\n\nuniform float u_time;\nuniform vec2 u_res;\nuniform vec3 u_tint;\nuniform vec3 u_from;\nuniform vec3 u_to;\nuniform sampler2D u_height;\nuniform vec2 u_sim;\nuniform float u_waveAmp;\nuniform float u_waveSpeed;\nuniform float u_shimmer;\nuniform float u_reflection;\n\nvarying vec2 v_uv;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n}\n\nfloat ambientH(vec2 p, float t) {\n float h = 0.0;\n h += sin(p.x * 3.2 + t * 1.3) * cos(p.y * 2.4 - t * 0.9) * 0.45;\n h += sin(p.x * 6.8 - t * 1.7 + p.y * 1.1) * 0.22;\n h += sin(p.x * 12.0 + p.y * 9.0 + t * 2.4) * 0.08;\n h += sin(p.x * 1.4 + p.y * 1.8 + t * 0.55) * 0.35;\n return h;\n}\n\nfloat sampleHeight(vec2 uv) {\n float rip = texture2D(u_height, uv).r * 2.0 - 1.0;\n vec2 p = uv * vec2(u_res.x / u_res.y, 1.0) * 2.8;\n float amb = ambientH(p, u_time * u_waveSpeed) * 0.035 * u_waveAmp;\n return rip * 0.55 + amb;\n}\n\nvec3 calcNormal(vec2 uv) {\n vec2 e = vec2(1.5 / u_sim.x, 1.5 / u_sim.y);\n float hL = sampleHeight(uv - vec2(e.x, 0.0));\n float hR = sampleHeight(uv + vec2(e.x, 0.0));\n float hD = sampleHeight(uv - vec2(0.0, e.y));\n float hU = sampleHeight(uv + vec2(0.0, e.y));\n return normalize(vec3((hL - hR) * 14.0, (hD - hU) * 14.0, 1.0));\n}\n\nvoid main() {\n vec2 uv = v_uv;\n vec3 n = calcNormal(uv);\n float h = sampleHeight(uv);\n\n vec3 V = normalize(vec3(0.0, 0.25, 1.0));\n vec3 L = normalize(vec3(0.45, 0.75, 0.55));\n\n float ndotl = max(dot(n, L), 0.0);\n float fresnel = pow(1.0 - max(dot(n, V), 0.0), 3.2);\n\n float g = clamp((uv.x + (1.0 - uv.y)) * 0.5, 0.0, 1.0);\n vec3 water = mix(u_from, u_to, g);\n water = mix(water, u_from, clamp(h * 1.8 + ndotl * 0.12, 0.0, 0.28));\n water *= 0.92 + n.y * 0.1;\n\n vec3 sky = mix(u_from * 1.15, vec3(0.85, 0.92, 1.0), 0.45);\n vec3 reflectCol = mix(sky, vec3(0.9, 0.95, 1.0), pow(max(n.y, 0.0), 2.0));\n water = mix(water, reflectCol, fresnel * u_reflection);\n\n vec3 H = normalize(L + V);\n float spec = pow(max(dot(n, H), 0.0), 180.0);\n float glitter = pow(max(dot(n, H), 0.0), 48.0);\n float sparkThresh = step(0.992, glitter) * glitter;\n vec3 sparkle = u_tint * (spec * 1.8 + sparkThresh * 2.5) * u_shimmer\n + vec3(1.0) * sparkThresh * 0.8 * u_shimmer;\n\n float softSpec = pow(max(dot(n, H), 0.0), 16.0) * 0.22 * u_shimmer;\n water += u_tint * softSpec + sparkle;\n\n float crest = smoothstep(0.02, 0.12, abs(h)) * fresnel;\n water += mix(u_tint, vec3(1.0), 0.4) * crest * 0.35;\n\n float vig = smoothstep(1.15, 0.35, length((uv - 0.5) * vec2(1.1, 1.0)));\n water *= 0.88 + 0.12 * vig;\n water += (hash(uv * u_res + u_time) - 0.5) * 0.015;\n\n gl_FragColor = vec4(water, 1.0);\n}\n", Wt = (e) => {
|
|
3149
|
+
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = Number.parseInt(n, 16);
|
|
3150
|
+
return Number.isNaN(r) ? [
|
|
3151
|
+
.22,
|
|
3152
|
+
.74,
|
|
3153
|
+
.97
|
|
3154
|
+
] : [
|
|
3155
|
+
(r >> 16 & 255) / 255,
|
|
3156
|
+
(r >> 8 & 255) / 255,
|
|
3157
|
+
(r & 255) / 255
|
|
3158
|
+
];
|
|
3159
|
+
}, Gt = (e, t, n) => {
|
|
3160
|
+
let r = e.createShader(t);
|
|
3161
|
+
return r ? (e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (e.deleteShader(r), null)) : null;
|
|
3162
|
+
}, Kt = (e, t, n) => {
|
|
3163
|
+
let r = Gt(e, e.VERTEX_SHADER, t), i = Gt(e, e.FRAGMENT_SHADER, n);
|
|
3164
|
+
if (!r || !i) return null;
|
|
3165
|
+
let a = e.createProgram();
|
|
3166
|
+
return a ? (e.attachShader(a, r), e.attachShader(a, i), e.linkProgram(a), e.deleteShader(r), e.deleteShader(i), e.getProgramParameter(a, e.LINK_STATUS) ? a : (e.deleteProgram(a), null)) : null;
|
|
3167
|
+
}, Y = 192, qt = (e) => ({
|
|
3168
|
+
from: Wt(e.fromColor),
|
|
3169
|
+
to: Wt(e.toColor),
|
|
3170
|
+
tint: Wt(e.color),
|
|
3171
|
+
waveAmplitude: e.waveAmplitude,
|
|
3172
|
+
waveSpeed: e.waveSpeed,
|
|
3173
|
+
shimmer: e.shimmer,
|
|
3174
|
+
reflection: e.reflection,
|
|
3175
|
+
rippleStrength: e.rippleStrength,
|
|
3176
|
+
rippleRadius: e.rippleRadius,
|
|
3177
|
+
damping: e.damping,
|
|
3178
|
+
spread: e.spread,
|
|
3179
|
+
interactive: e.interactive
|
|
3180
|
+
}), Jt = ({ width: e = 800, height: r = 500, fromColor: i = "#52ade3", toColor: a = "#013565", color: s = "#a8d8f5", waveAmplitude: c = 1, waveSpeed: d = 1, shimmer: f = 1, reflection: p = .38, rippleStrength: m = 1, rippleRadius: h = 6, damping: g = .985, spread: _ = .5, interactive: b = !0, showHint: x = !0, hint: S = "点击水面产生涟漪" }) => {
|
|
3181
|
+
let C = o(null), w = o(0), T = o(null), E = o(qt({
|
|
3182
|
+
fromColor: i,
|
|
3183
|
+
toColor: a,
|
|
3184
|
+
color: s,
|
|
3185
|
+
waveAmplitude: c,
|
|
3186
|
+
waveSpeed: d,
|
|
3187
|
+
shimmer: f,
|
|
3188
|
+
reflection: p,
|
|
3189
|
+
rippleStrength: m,
|
|
3190
|
+
rippleRadius: h,
|
|
3191
|
+
damping: g,
|
|
3192
|
+
spread: _,
|
|
3193
|
+
interactive: b
|
|
3194
|
+
}));
|
|
3195
|
+
n(() => {
|
|
3196
|
+
E.current = qt({
|
|
3197
|
+
fromColor: i,
|
|
3198
|
+
toColor: a,
|
|
3199
|
+
color: s,
|
|
3200
|
+
waveAmplitude: c,
|
|
3201
|
+
waveSpeed: d,
|
|
3202
|
+
shimmer: f,
|
|
3203
|
+
reflection: p,
|
|
3204
|
+
rippleStrength: m,
|
|
3205
|
+
rippleRadius: h,
|
|
3206
|
+
damping: g,
|
|
3207
|
+
spread: _,
|
|
3208
|
+
interactive: b
|
|
3009
3209
|
});
|
|
3010
|
-
}, [
|
|
3210
|
+
}, [
|
|
3211
|
+
i,
|
|
3212
|
+
a,
|
|
3213
|
+
s,
|
|
3214
|
+
c,
|
|
3215
|
+
d,
|
|
3216
|
+
f,
|
|
3217
|
+
p,
|
|
3218
|
+
m,
|
|
3219
|
+
h,
|
|
3220
|
+
g,
|
|
3221
|
+
_,
|
|
3222
|
+
b
|
|
3223
|
+
]);
|
|
3224
|
+
let D = t((e, t) => {
|
|
3225
|
+
if (!E.current.interactive) return;
|
|
3226
|
+
let n = C.current;
|
|
3227
|
+
if (!n) return;
|
|
3228
|
+
let r = n.getBoundingClientRect();
|
|
3229
|
+
T.current = {
|
|
3230
|
+
x: (e - r.left) / r.width,
|
|
3231
|
+
y: 1 - (t - r.top) / r.height,
|
|
3232
|
+
strength: E.current.rippleStrength
|
|
3233
|
+
};
|
|
3234
|
+
}, []);
|
|
3011
3235
|
return n(() => {
|
|
3012
|
-
let e =
|
|
3236
|
+
let e = C.current;
|
|
3013
3237
|
if (!e) return;
|
|
3014
|
-
let t = (e) =>
|
|
3015
|
-
|
|
3016
|
-
t && d(t.clientX, t.clientY);
|
|
3017
|
-
};
|
|
3018
|
-
return e.addEventListener("click", t), e.addEventListener("touchstart", n, { passive: !0 }), () => {
|
|
3019
|
-
e.removeEventListener("click", t), e.removeEventListener("touchstart", n);
|
|
3238
|
+
let t = (e) => {
|
|
3239
|
+
e.pointerType === "mouse" && e.button !== 0 || D(e.clientX, e.clientY);
|
|
3020
3240
|
};
|
|
3021
|
-
|
|
3022
|
-
|
|
3241
|
+
return e.addEventListener("pointerdown", t), () => e.removeEventListener("pointerdown", t);
|
|
3242
|
+
}, [D]), n(() => {
|
|
3243
|
+
let t = C.current;
|
|
3023
3244
|
if (!t) return;
|
|
3024
|
-
let n = window.devicePixelRatio || 1;
|
|
3025
|
-
t.width = e * n, t.height = r * n;
|
|
3026
|
-
let
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3245
|
+
let n = Math.min(window.devicePixelRatio || 1, 2);
|
|
3246
|
+
t.width = Math.floor(e * n), t.height = Math.floor(r * n);
|
|
3247
|
+
let i = t.getContext("webgl", {
|
|
3248
|
+
alpha: !1,
|
|
3249
|
+
antialias: !1,
|
|
3250
|
+
depth: !1,
|
|
3251
|
+
stencil: !1,
|
|
3252
|
+
premultipliedAlpha: !1
|
|
3253
|
+
});
|
|
3254
|
+
if (!i) return;
|
|
3255
|
+
let a = Kt(i, Ht, Ut);
|
|
3256
|
+
if (!a) return;
|
|
3257
|
+
let o = i.createBuffer();
|
|
3258
|
+
i.bindBuffer(i.ARRAY_BUFFER, o), i.bufferData(i.ARRAY_BUFFER, new Float32Array([
|
|
3259
|
+
-1,
|
|
3260
|
+
-1,
|
|
3261
|
+
1,
|
|
3262
|
+
-1,
|
|
3263
|
+
-1,
|
|
3264
|
+
1,
|
|
3265
|
+
1,
|
|
3266
|
+
1
|
|
3267
|
+
]), i.STATIC_DRAW);
|
|
3268
|
+
let s = i.getAttribLocation(a, "a_pos"), c = i.getUniformLocation(a, "u_time"), l = i.getUniformLocation(a, "u_res"), u = i.getUniformLocation(a, "u_tint"), d = i.getUniformLocation(a, "u_from"), f = i.getUniformLocation(a, "u_to"), p = i.getUniformLocation(a, "u_height"), m = i.getUniformLocation(a, "u_sim"), h = i.getUniformLocation(a, "u_waveAmp"), g = i.getUniformLocation(a, "u_waveSpeed"), _ = i.getUniformLocation(a, "u_shimmer"), b = i.getUniformLocation(a, "u_reflection"), x = Y * Y, S = new Float32Array(x), D = new Float32Array(x), O = new Float32Array(x), k = i.createTexture();
|
|
3269
|
+
i.bindTexture(i.TEXTURE_2D, k), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MIN_FILTER, i.LINEAR), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MAG_FILTER, i.LINEAR), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_S, i.CLAMP_TO_EDGE), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_T, i.CLAMP_TO_EDGE);
|
|
3270
|
+
let A = new Uint8Array(x * 4), j = () => {
|
|
3271
|
+
for (let e = 0; e < x; e++) {
|
|
3272
|
+
let t = Math.max(0, Math.min(255, Math.floor((D[e] * .5 + .5) * 255))), n = e * 4;
|
|
3273
|
+
A[n] = t, A[n + 1] = t, A[n + 2] = t, A[n + 3] = 255;
|
|
3274
|
+
}
|
|
3275
|
+
i.bindTexture(i.TEXTURE_2D, k), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, Y, Y, 0, i.RGBA, i.UNSIGNED_BYTE, A);
|
|
3276
|
+
}, M = (e, t, n, r) => {
|
|
3277
|
+
let i = e * (Y - 1), a = t * (Y - 1), o = y(r, 2, 12);
|
|
3278
|
+
for (let e = -o - 1; e <= o + 1; e++) for (let t = -o - 1; t <= o + 1; t++) {
|
|
3279
|
+
let r = Math.round(i + t), s = Math.round(a + e);
|
|
3280
|
+
if (r <= 0 || r >= Y - 1 || s <= 0 || s >= Y - 1) continue;
|
|
3281
|
+
let c = Math.sqrt(t * t + e * e), l = Math.exp(-c * c * .55) * -.35, u = Math.exp(-((c - o * .55) ** 2) * .9);
|
|
3282
|
+
D[s * Y + r] += n * (l + u * 1.1);
|
|
3283
|
+
}
|
|
3284
|
+
}, N = (e, t) => {
|
|
3285
|
+
let n = y(e, .9, .999), r = y(t, .3, .7);
|
|
3286
|
+
for (let e = 0; e < 2; e++) {
|
|
3287
|
+
for (let e = 1; e < Y - 1; e++) {
|
|
3288
|
+
let t = e * Y;
|
|
3289
|
+
for (let e = 1; e < Y - 1; e++) {
|
|
3290
|
+
let i = t + e, a = D[i - 1] + D[i + 1] + D[i - Y] + D[i + Y];
|
|
3291
|
+
O[i] = (a * r - S[i]) * n, O[i] > 1.5 ? O[i] = 1.5 : O[i] < -1.5 && (O[i] = -1.5);
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
let e = S;
|
|
3295
|
+
S = D, D = O, O = e, O.fill(0);
|
|
3296
|
+
}
|
|
3297
|
+
}, ee = (e) => {
|
|
3298
|
+
let n = E.current;
|
|
3299
|
+
i.viewport(0, 0, t.width, t.height), i.useProgram(a), i.bindBuffer(i.ARRAY_BUFFER, o), i.enableVertexAttribArray(s), i.vertexAttribPointer(s, 2, i.FLOAT, !1, 0, 0), i.activeTexture(i.TEXTURE0), i.bindTexture(i.TEXTURE_2D, k), i.uniform1i(p, 0), i.uniform1f(c, e), i.uniform2f(l, t.width, t.height), i.uniform3f(u, n.tint[0], n.tint[1], n.tint[2]), i.uniform3f(d, n.from[0], n.from[1], n.from[2]), i.uniform3f(f, n.to[0], n.to[1], n.to[2]), i.uniform2f(m, Y, Y), i.uniform1f(h, y(n.waveAmplitude, 0, 2)), i.uniform1f(g, y(n.waveSpeed, 0, 3)), i.uniform1f(_, y(n.shimmer, 0, 2)), i.uniform1f(b, y(n.reflection, 0, 1)), i.drawArrays(i.TRIANGLE_STRIP, 0, 4);
|
|
3036
3300
|
};
|
|
3037
|
-
return
|
|
3038
|
-
|
|
3301
|
+
if (j(), typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return ee(0), () => {
|
|
3302
|
+
i.deleteTexture(k), i.deleteBuffer(o), i.deleteProgram(a);
|
|
3039
3303
|
};
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3304
|
+
let P = document.hidden, te = v((e) => {
|
|
3305
|
+
P = e;
|
|
3306
|
+
}), F = performance.now(), ne = (e) => {
|
|
3307
|
+
if (w.current = requestAnimationFrame(ne), P) return;
|
|
3308
|
+
let t = E.current;
|
|
3309
|
+
if (T.current) {
|
|
3310
|
+
let e = T.current, n = y(e.strength, 0, 3), r = t.rippleRadius;
|
|
3311
|
+
M(e.x, e.y, n, r), M(e.x + .004, e.y - .003, n * .35, r), T.current = null;
|
|
3312
|
+
}
|
|
3313
|
+
N(t.damping, t.spread), j(), ee((e - F) / 1e3);
|
|
3314
|
+
};
|
|
3315
|
+
return w.current = requestAnimationFrame(ne), () => {
|
|
3316
|
+
cancelAnimationFrame(w.current), te(), i.deleteTexture(k), i.deleteBuffer(o), i.deleteProgram(a);
|
|
3317
|
+
};
|
|
3318
|
+
}, [r, e]), /* @__PURE__ */ u("div", {
|
|
3319
|
+
className: Vt.rippleWater,
|
|
3046
3320
|
style: {
|
|
3047
3321
|
width: e,
|
|
3048
3322
|
height: r
|
|
3049
3323
|
},
|
|
3050
3324
|
children: [/* @__PURE__ */ l("canvas", {
|
|
3051
|
-
ref:
|
|
3052
|
-
className:
|
|
3325
|
+
ref: C,
|
|
3326
|
+
className: Vt.canvas,
|
|
3053
3327
|
style: {
|
|
3054
3328
|
width: e,
|
|
3055
|
-
height: r
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
})
|
|
3329
|
+
height: r,
|
|
3330
|
+
cursor: b ? "pointer" : "default"
|
|
3331
|
+
},
|
|
3332
|
+
role: "img",
|
|
3333
|
+
"aria-label": S || "涟漪水面"
|
|
3334
|
+
}), x ? /* @__PURE__ */ l("span", {
|
|
3335
|
+
className: Vt.hint,
|
|
3336
|
+
"aria-hidden": !0,
|
|
3337
|
+
children: S
|
|
3338
|
+
}) : null]
|
|
3061
3339
|
});
|
|
3062
|
-
},
|
|
3340
|
+
}, Yt = {
|
|
3063
3341
|
scrambleText: "cos-scrambleText-hN4Wm",
|
|
3064
3342
|
text: "cos-text-frsHs",
|
|
3065
3343
|
cursor: "cos-cursor-3zQOy",
|
|
3066
3344
|
blink: "cos-blink-OcKXu"
|
|
3067
|
-
},
|
|
3345
|
+
}, Xt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*", Zt = ({ text: e = "DECRYPTED", duration: t = 2e3, charset: r = Xt }) => {
|
|
3068
3346
|
let [i, a] = s(""), c = o(0), d = o(0);
|
|
3069
3347
|
return n(() => {
|
|
3070
|
-
let n = r.length > 0 ? r :
|
|
3348
|
+
let n = r.length > 0 ? r : Xt, i = e;
|
|
3071
3349
|
d.current = performance.now();
|
|
3072
3350
|
let o = (e) => {
|
|
3073
3351
|
let r = e - d.current, s = Math.min(r / t, 1), l = Math.floor(s * i.length);
|
|
@@ -3079,18 +3357,18 @@ var P = {
|
|
|
3079
3357
|
t,
|
|
3080
3358
|
r
|
|
3081
3359
|
]), /* @__PURE__ */ l("div", {
|
|
3082
|
-
className:
|
|
3360
|
+
className: Yt.scrambleText,
|
|
3083
3361
|
children: /* @__PURE__ */ u("p", {
|
|
3084
|
-
className:
|
|
3085
|
-
children: [i, /* @__PURE__ */ l("span", { className:
|
|
3362
|
+
className: Yt.text,
|
|
3363
|
+
children: [i, /* @__PURE__ */ l("span", { className: Yt.cursor })]
|
|
3086
3364
|
})
|
|
3087
3365
|
});
|
|
3088
|
-
},
|
|
3366
|
+
}, Qt = {
|
|
3089
3367
|
scratchCard: "cos-scratchCard-McIEK",
|
|
3090
3368
|
prize: "cos-prize-X0z5V",
|
|
3091
3369
|
canvas: "cos-canvas-JqIlr",
|
|
3092
3370
|
hidden: "cos-hidden-Lsfbt"
|
|
3093
|
-
},
|
|
3371
|
+
}, $t = ({ coverColor: e = "#94a3b8", prize: r = "🎉 恭喜中奖!", onReveal: i, width: a = 300, height: c = 180 }) => {
|
|
3094
3372
|
let d = o(null), f = o(!1), p = o(!1), m = o(i), [h, g] = s(!1);
|
|
3095
3373
|
n(() => {
|
|
3096
3374
|
m.current = i;
|
|
@@ -3153,17 +3431,17 @@ var P = {
|
|
|
3153
3431
|
f.current = !1;
|
|
3154
3432
|
};
|
|
3155
3433
|
return /* @__PURE__ */ u("div", {
|
|
3156
|
-
className:
|
|
3434
|
+
className: Qt.scratchCard,
|
|
3157
3435
|
style: {
|
|
3158
3436
|
width: a,
|
|
3159
3437
|
height: c
|
|
3160
3438
|
},
|
|
3161
3439
|
children: [/* @__PURE__ */ l("div", {
|
|
3162
|
-
className:
|
|
3440
|
+
className: Qt.prize,
|
|
3163
3441
|
children: r
|
|
3164
3442
|
}), /* @__PURE__ */ l("canvas", {
|
|
3165
3443
|
ref: d,
|
|
3166
|
-
className: `${
|
|
3444
|
+
className: `${Qt.canvas} ${h ? Qt.hidden : ""}`,
|
|
3167
3445
|
style: {
|
|
3168
3446
|
width: a,
|
|
3169
3447
|
height: c
|
|
@@ -3177,7 +3455,7 @@ var P = {
|
|
|
3177
3455
|
onTouchEnd: C
|
|
3178
3456
|
})]
|
|
3179
3457
|
});
|
|
3180
|
-
},
|
|
3458
|
+
}, X = {
|
|
3181
3459
|
slotMachine: "cos-slotMachine-P6FyZ",
|
|
3182
3460
|
machine: "cos-machine-B066r",
|
|
3183
3461
|
reel: "cos-reel-eEpJ3",
|
|
@@ -3186,14 +3464,14 @@ var P = {
|
|
|
3186
3464
|
mask: "cos-mask-jdrj3",
|
|
3187
3465
|
spinBtn: "cos-spinBtn-DvDE7",
|
|
3188
3466
|
result: "cos-result-dLN5b"
|
|
3189
|
-
},
|
|
3467
|
+
}, en = [
|
|
3190
3468
|
"🍒",
|
|
3191
3469
|
"🍋",
|
|
3192
3470
|
"🍊",
|
|
3193
3471
|
"🍇",
|
|
3194
3472
|
"⭐",
|
|
3195
3473
|
"7️⃣"
|
|
3196
|
-
],
|
|
3474
|
+
], tn = (e) => 1 - (1 - e) ** 3, nn = ({ symbols: e = en, onSpinEnd: r }) => {
|
|
3197
3475
|
let [i, a] = s(!1), [c, d] = s([
|
|
3198
3476
|
0,
|
|
3199
3477
|
0,
|
|
@@ -3210,31 +3488,31 @@ var P = {
|
|
|
3210
3488
|
return n(() => () => {
|
|
3211
3489
|
g.current && (g.current.cancelled = !0), cancelAnimationFrame(m.current);
|
|
3212
3490
|
}, []), /* @__PURE__ */ u("div", {
|
|
3213
|
-
className:
|
|
3491
|
+
className: X.slotMachine,
|
|
3214
3492
|
children: [
|
|
3215
3493
|
/* @__PURE__ */ l("div", {
|
|
3216
|
-
className:
|
|
3494
|
+
className: X.machine,
|
|
3217
3495
|
children: [
|
|
3218
3496
|
0,
|
|
3219
3497
|
1,
|
|
3220
3498
|
2
|
|
3221
3499
|
].map((e) => /* @__PURE__ */ u("div", {
|
|
3222
|
-
className:
|
|
3500
|
+
className: X.reel,
|
|
3223
3501
|
style: { height: 240 },
|
|
3224
3502
|
children: [/* @__PURE__ */ l("div", {
|
|
3225
|
-
className:
|
|
3503
|
+
className: X.strip,
|
|
3226
3504
|
style: { transform: `translateY(${c[e]}px)` },
|
|
3227
3505
|
children: _.map((e, t) => /* @__PURE__ */ l("div", {
|
|
3228
|
-
className:
|
|
3506
|
+
className: X.item,
|
|
3229
3507
|
style: { height: 80 },
|
|
3230
3508
|
children: e
|
|
3231
3509
|
}, t))
|
|
3232
|
-
}), /* @__PURE__ */ l("div", { className:
|
|
3510
|
+
}), /* @__PURE__ */ l("div", { className: X.mask })]
|
|
3233
3511
|
}, e))
|
|
3234
3512
|
}),
|
|
3235
3513
|
/* @__PURE__ */ l("button", {
|
|
3236
3514
|
type: "button",
|
|
3237
|
-
className:
|
|
3515
|
+
className: X.spinBtn,
|
|
3238
3516
|
onClick: () => {
|
|
3239
3517
|
if (i) return;
|
|
3240
3518
|
a(!0), p([]);
|
|
@@ -3253,7 +3531,7 @@ var P = {
|
|
|
3253
3531
|
if (d(r.map((e, t) => {
|
|
3254
3532
|
let r = i - l - s[t];
|
|
3255
3533
|
if (r < 0) return e;
|
|
3256
|
-
let a =
|
|
3534
|
+
let a = tn(Math.min(r / o, 1));
|
|
3257
3535
|
return e + (n[t] - e) * a;
|
|
3258
3536
|
})), !s.every((e) => i - l - e >= o)) m.current = requestAnimationFrame(f);
|
|
3259
3537
|
else if (!u.cancelled) {
|
|
@@ -3268,12 +3546,12 @@ var P = {
|
|
|
3268
3546
|
children: i ? "旋转中..." : "开始"
|
|
3269
3547
|
}),
|
|
3270
3548
|
f.length > 0 && !i && /* @__PURE__ */ l("p", {
|
|
3271
|
-
className:
|
|
3549
|
+
className: X.result,
|
|
3272
3550
|
children: f[0] === f[1] && f[1] === f[2] ? "🎰 大奖!" : `结果: ${f.join(" ")}`
|
|
3273
3551
|
})
|
|
3274
3552
|
]
|
|
3275
3553
|
});
|
|
3276
|
-
},
|
|
3554
|
+
}, rn = {
|
|
3277
3555
|
splitReveal: "cos-splitReveal-6W8-6",
|
|
3278
3556
|
text: "cos-text-miTsj",
|
|
3279
3557
|
char: "cos-char-0gPJV",
|
|
@@ -3282,27 +3560,27 @@ var P = {
|
|
|
3282
3560
|
fromBottom: "cos-fromBottom-24D6g",
|
|
3283
3561
|
fromLeft: "cos-fromLeft-OMiPY",
|
|
3284
3562
|
fromRight: "cos-fromRight-EcMOR"
|
|
3285
|
-
},
|
|
3563
|
+
}, an = [
|
|
3286
3564
|
"fromTop",
|
|
3287
3565
|
"fromBottom",
|
|
3288
3566
|
"fromLeft",
|
|
3289
3567
|
"fromRight"
|
|
3290
|
-
],
|
|
3291
|
-
className:
|
|
3568
|
+
], on = ({ text: e = "REVEAL", delay: t = 80, color: n = "#f8fafc" }) => /* @__PURE__ */ l("div", {
|
|
3569
|
+
className: rn.splitReveal,
|
|
3292
3570
|
children: /* @__PURE__ */ l("h1", {
|
|
3293
|
-
className:
|
|
3571
|
+
className: rn.text,
|
|
3294
3572
|
style: { "--reveal-color": n },
|
|
3295
3573
|
children: e.split("").map((e, n) => /* @__PURE__ */ l("span", {
|
|
3296
|
-
className: `${
|
|
3574
|
+
className: `${rn.char} ${rn[an[n % an.length]]}`,
|
|
3297
3575
|
style: { animationDelay: `${n * t}ms` },
|
|
3298
3576
|
children: e === " " ? "\xA0" : e
|
|
3299
3577
|
}, `${e}-${n}`))
|
|
3300
3578
|
})
|
|
3301
|
-
}),
|
|
3579
|
+
}), sn = {
|
|
3302
3580
|
spotlight: "cos-spotlight-OddY1",
|
|
3303
3581
|
content: "cos-content-5I1Wy",
|
|
3304
3582
|
overlay: "cos-overlay-F6CJ5"
|
|
3305
|
-
},
|
|
3583
|
+
}, cn = ({ children: e, radius: n = 120, dimColor: r = "rgba(0, 0, 0, 0.85)" }) => {
|
|
3306
3584
|
let i = o(null), a = t((e) => {
|
|
3307
3585
|
let t = i.current;
|
|
3308
3586
|
if (!t) return;
|
|
@@ -3311,18 +3589,18 @@ var P = {
|
|
|
3311
3589
|
}, []);
|
|
3312
3590
|
return /* @__PURE__ */ u("div", {
|
|
3313
3591
|
ref: i,
|
|
3314
|
-
className:
|
|
3592
|
+
className: sn.spotlight,
|
|
3315
3593
|
style: {
|
|
3316
3594
|
"--spot-radius": `${n}px`,
|
|
3317
3595
|
"--dim-color": r
|
|
3318
3596
|
},
|
|
3319
3597
|
onMouseMove: a,
|
|
3320
3598
|
children: [/* @__PURE__ */ l("div", {
|
|
3321
|
-
className:
|
|
3599
|
+
className: sn.content,
|
|
3322
3600
|
children: e
|
|
3323
|
-
}), /* @__PURE__ */ l("div", { className:
|
|
3601
|
+
}), /* @__PURE__ */ l("div", { className: sn.overlay })]
|
|
3324
3602
|
});
|
|
3325
|
-
},
|
|
3603
|
+
}, Z = {
|
|
3326
3604
|
turntable: "cos-turntable-dkc32",
|
|
3327
3605
|
wheelWrap: "cos-wheelWrap-n7lhc",
|
|
3328
3606
|
canvas: "cos-canvas-A1-4x",
|
|
@@ -3330,7 +3608,7 @@ var P = {
|
|
|
3330
3608
|
spinBtn: "cos-spinBtn-l9JIC",
|
|
3331
3609
|
result: "cos-result-H8q2c",
|
|
3332
3610
|
"fade-in": "cos-fade-in-U9bUC"
|
|
3333
|
-
},
|
|
3611
|
+
}, ln = [
|
|
3334
3612
|
"#FF6B6B",
|
|
3335
3613
|
"#4ECDC4",
|
|
3336
3614
|
"#FFE66D",
|
|
@@ -3339,19 +3617,19 @@ var P = {
|
|
|
3339
3617
|
"#F472B6",
|
|
3340
3618
|
"#34D399",
|
|
3341
3619
|
"#FB923C"
|
|
3342
|
-
],
|
|
3620
|
+
], un = [
|
|
3343
3621
|
{ label: "一等奖" },
|
|
3344
3622
|
{ label: "二等奖" },
|
|
3345
3623
|
{ label: "三等奖" },
|
|
3346
3624
|
{ label: "谢谢参与" },
|
|
3347
3625
|
{ label: "优惠券" },
|
|
3348
3626
|
{ label: "再来一次" }
|
|
3349
|
-
],
|
|
3627
|
+
], dn = (e) => 1 - (1 - e) ** 3, fn = ({ prizes: e = un, size: r = 360, spinDuration: i = 4e3, spinRounds: a = 5, buttonText: c = "开始抽奖", onSpinEnd: d }) => {
|
|
3350
3628
|
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);
|
|
3351
3629
|
n(() => {
|
|
3352
3630
|
b.current = d;
|
|
3353
3631
|
}, [d]);
|
|
3354
|
-
let S = r + 48, C = (e, t) => t.color ??
|
|
3632
|
+
let S = r + 48, C = (e, t) => t.color ?? ln[e % ln.length], w = t((t) => {
|
|
3355
3633
|
let n = f.current;
|
|
3356
3634
|
if (!n) return;
|
|
3357
3635
|
let i = n.getContext("2d");
|
|
@@ -3386,22 +3664,22 @@ var P = {
|
|
|
3386
3664
|
return Math.floor((360 - r + n / 2) % 360 / n) % e.length;
|
|
3387
3665
|
};
|
|
3388
3666
|
return /* @__PURE__ */ u("div", {
|
|
3389
|
-
className:
|
|
3667
|
+
className: Z.turntable,
|
|
3390
3668
|
style: {
|
|
3391
3669
|
width: S,
|
|
3392
3670
|
height: S + 80
|
|
3393
3671
|
},
|
|
3394
3672
|
children: [/* @__PURE__ */ u("div", {
|
|
3395
|
-
className:
|
|
3673
|
+
className: Z.wheelWrap,
|
|
3396
3674
|
style: {
|
|
3397
3675
|
width: S,
|
|
3398
3676
|
height: S
|
|
3399
3677
|
},
|
|
3400
3678
|
children: [
|
|
3401
|
-
/* @__PURE__ */ l("div", { className:
|
|
3679
|
+
/* @__PURE__ */ l("div", { className: Z.pointer }),
|
|
3402
3680
|
/* @__PURE__ */ l("canvas", {
|
|
3403
3681
|
ref: f,
|
|
3404
|
-
className:
|
|
3682
|
+
className: Z.canvas,
|
|
3405
3683
|
style: {
|
|
3406
3684
|
width: S,
|
|
3407
3685
|
height: S
|
|
@@ -3409,7 +3687,7 @@ var P = {
|
|
|
3409
3687
|
}),
|
|
3410
3688
|
/* @__PURE__ */ l("button", {
|
|
3411
3689
|
type: "button",
|
|
3412
|
-
className:
|
|
3690
|
+
className: Z.spinBtn,
|
|
3413
3691
|
onClick: () => {
|
|
3414
3692
|
if (g || e.length === 0) return;
|
|
3415
3693
|
_(!0), y(null);
|
|
@@ -3417,7 +3695,7 @@ var P = {
|
|
|
3417
3695
|
x.current = l;
|
|
3418
3696
|
let u = (t) => {
|
|
3419
3697
|
if (l.cancelled) return;
|
|
3420
|
-
let n = t - c, r = Math.min(n / i, 1), a =
|
|
3698
|
+
let n = t - c, r = Math.min(n / i, 1), a = dn(r), d = s + (o - s) * a;
|
|
3421
3699
|
if (p.current = d, w(d), r < 1) m.current = requestAnimationFrame(u);
|
|
3422
3700
|
else if (!l.cancelled) {
|
|
3423
3701
|
let t = T(d), n = e[t];
|
|
@@ -3431,11 +3709,11 @@ var P = {
|
|
|
3431
3709
|
})
|
|
3432
3710
|
]
|
|
3433
3711
|
}), v && !g && /* @__PURE__ */ u("p", {
|
|
3434
|
-
className:
|
|
3712
|
+
className: Z.result,
|
|
3435
3713
|
children: ["恭喜获得:", /* @__PURE__ */ l("strong", { children: v.label })]
|
|
3436
3714
|
})]
|
|
3437
3715
|
});
|
|
3438
|
-
},
|
|
3716
|
+
}, Q = {
|
|
3439
3717
|
typewriter: "cos-typewriter-7UhOL",
|
|
3440
3718
|
terminal: "cos-terminal-NWNVN",
|
|
3441
3719
|
dots: "cos-dots-oulNg",
|
|
@@ -3443,11 +3721,11 @@ var P = {
|
|
|
3443
3721
|
prompt: "cos-prompt-Y4hVD",
|
|
3444
3722
|
cursor: "cos-cursor-m8hGi",
|
|
3445
3723
|
blink: "cos-blink-XykM7"
|
|
3446
|
-
},
|
|
3724
|
+
}, pn = [
|
|
3447
3725
|
"Hello, cos-design!",
|
|
3448
3726
|
"欢迎来到组件库 ✨",
|
|
3449
3727
|
"Build something fun 🚀"
|
|
3450
|
-
],
|
|
3728
|
+
], mn = ({ texts: e, speed: t, deleteSpeed: r, pause: i }) => {
|
|
3451
3729
|
let [a, o] = s(""), [c, d] = s(0), [f, p] = s(!1);
|
|
3452
3730
|
return n(() => {
|
|
3453
3731
|
let n = e[c % e.length], s;
|
|
@@ -3469,66 +3747,66 @@ var P = {
|
|
|
3469
3747
|
r,
|
|
3470
3748
|
i
|
|
3471
3749
|
]), /* @__PURE__ */ l("div", {
|
|
3472
|
-
className:
|
|
3750
|
+
className: Q.typewriter,
|
|
3473
3751
|
children: /* @__PURE__ */ u("div", {
|
|
3474
|
-
className:
|
|
3752
|
+
className: Q.terminal,
|
|
3475
3753
|
children: [/* @__PURE__ */ u("div", {
|
|
3476
|
-
className:
|
|
3754
|
+
className: Q.dots,
|
|
3477
3755
|
children: [
|
|
3478
3756
|
/* @__PURE__ */ l("span", {}),
|
|
3479
3757
|
/* @__PURE__ */ l("span", {}),
|
|
3480
3758
|
/* @__PURE__ */ l("span", {})
|
|
3481
3759
|
]
|
|
3482
3760
|
}), /* @__PURE__ */ u("p", {
|
|
3483
|
-
className:
|
|
3761
|
+
className: Q.text,
|
|
3484
3762
|
children: [
|
|
3485
3763
|
/* @__PURE__ */ l("span", {
|
|
3486
|
-
className:
|
|
3764
|
+
className: Q.prompt,
|
|
3487
3765
|
children: ">"
|
|
3488
3766
|
}),
|
|
3489
3767
|
a,
|
|
3490
3768
|
/* @__PURE__ */ l("span", {
|
|
3491
|
-
className:
|
|
3769
|
+
className: Q.cursor,
|
|
3492
3770
|
children: "|"
|
|
3493
3771
|
})
|
|
3494
3772
|
]
|
|
3495
3773
|
})]
|
|
3496
3774
|
})
|
|
3497
3775
|
});
|
|
3498
|
-
},
|
|
3499
|
-
let i = e.length > 0 ? e :
|
|
3500
|
-
return /* @__PURE__ */ l(
|
|
3776
|
+
}, hn = ({ texts: e = pn, speed: t = 100, deleteSpeed: n = 50, pause: r = 2e3 }) => {
|
|
3777
|
+
let i = e.length > 0 ? e : pn;
|
|
3778
|
+
return /* @__PURE__ */ l(mn, {
|
|
3501
3779
|
texts: i,
|
|
3502
3780
|
speed: t,
|
|
3503
3781
|
deleteSpeed: n,
|
|
3504
3782
|
pause: r
|
|
3505
3783
|
}, i.join("\0"));
|
|
3506
|
-
},
|
|
3784
|
+
}, $ = {
|
|
3507
3785
|
waveButton: "cos-waveButton-Aa7G-",
|
|
3508
3786
|
btn: "cos-btn-WJrEN",
|
|
3509
3787
|
label: "cos-label-9BHOU",
|
|
3510
3788
|
wave: "cos-wave-GycLU",
|
|
3511
3789
|
ripple: "cos-ripple-5ZFpr"
|
|
3512
|
-
},
|
|
3513
|
-
className:
|
|
3790
|
+
}, gn = ({ text: e = "点我试试", color: t = "#38bdf8", className: n, style: r, ...i }) => /* @__PURE__ */ l("div", {
|
|
3791
|
+
className: $.waveButton,
|
|
3514
3792
|
children: /* @__PURE__ */ u("button", {
|
|
3515
3793
|
type: "button",
|
|
3516
|
-
className: `${
|
|
3794
|
+
className: `${$.btn} ${n ?? ""}`,
|
|
3517
3795
|
style: {
|
|
3518
3796
|
"--wave-color": t,
|
|
3519
3797
|
...r
|
|
3520
3798
|
},
|
|
3521
3799
|
...i,
|
|
3522
3800
|
children: [
|
|
3523
|
-
/* @__PURE__ */ l("span", { className:
|
|
3524
|
-
/* @__PURE__ */ l("span", { className:
|
|
3801
|
+
/* @__PURE__ */ l("span", { className: $.wave }),
|
|
3802
|
+
/* @__PURE__ */ l("span", { className: $.wave }),
|
|
3525
3803
|
/* @__PURE__ */ l("span", {
|
|
3526
|
-
className:
|
|
3804
|
+
className: $.label,
|
|
3527
3805
|
children: e
|
|
3528
3806
|
})
|
|
3529
3807
|
]
|
|
3530
3808
|
})
|
|
3531
|
-
}),
|
|
3809
|
+
}), _n = 39, vn = {
|
|
3532
3810
|
0: "sunny",
|
|
3533
3811
|
1: "sunny",
|
|
3534
3812
|
2: "partlyCloudy",
|
|
@@ -3557,26 +3835,26 @@ var P = {
|
|
|
3557
3835
|
95: "thunderstorm",
|
|
3558
3836
|
96: "hail",
|
|
3559
3837
|
99: "hail"
|
|
3560
|
-
},
|
|
3561
|
-
let n =
|
|
3562
|
-
return (n === "sunny" || n === "partlyCloudy" || n === "overcast") && t >=
|
|
3563
|
-
},
|
|
3838
|
+
}, yn = (e, t = 0) => {
|
|
3839
|
+
let n = vn[e] ?? "overcast";
|
|
3840
|
+
return (n === "sunny" || n === "partlyCloudy" || n === "overcast") && t >= _n ? "gale" : n;
|
|
3841
|
+
}, bn = {
|
|
3564
3842
|
weather: null,
|
|
3565
3843
|
status: "idle",
|
|
3566
3844
|
error: null,
|
|
3567
3845
|
current: null
|
|
3568
|
-
},
|
|
3846
|
+
}, xn = {
|
|
3569
3847
|
weather: null,
|
|
3570
3848
|
status: "locating",
|
|
3571
3849
|
error: null,
|
|
3572
3850
|
current: null
|
|
3573
|
-
},
|
|
3851
|
+
}, Sn = {
|
|
3574
3852
|
weather: null,
|
|
3575
3853
|
status: "fetching",
|
|
3576
3854
|
error: null,
|
|
3577
3855
|
current: null
|
|
3578
|
-
},
|
|
3579
|
-
let r =
|
|
3856
|
+
}, Cn = (e) => e != null && Number.isFinite(e.latitude) && Number.isFinite(e.longitude), wn = (e = !0, t) => {
|
|
3857
|
+
let r = Cn(t), i = r ? t.latitude : null, a = r ? t.longitude : null, o = e ? r ? Sn : xn : bn, c = `${e}:${i},${a}`, [l, u] = s(o), [d, f] = s(c);
|
|
3580
3858
|
return d !== c && (f(c), u((t) => e && t.weather ? {
|
|
3581
3859
|
...o,
|
|
3582
3860
|
weather: t.weather,
|
|
@@ -3596,7 +3874,7 @@ var P = {
|
|
|
3596
3874
|
let c = Number(o?.current?.wind_speed_10m ?? 0);
|
|
3597
3875
|
if (t) return;
|
|
3598
3876
|
u({
|
|
3599
|
-
weather:
|
|
3877
|
+
weather: yn(s, c),
|
|
3600
3878
|
status: "success",
|
|
3601
3879
|
error: null,
|
|
3602
3880
|
current: {
|
|
@@ -3654,31 +3932,31 @@ var P = {
|
|
|
3654
3932
|
};
|
|
3655
3933
|
//#endregion
|
|
3656
3934
|
//#region src/components/weatherBackground/scene/draw-atmosphere.ts
|
|
3657
|
-
function
|
|
3935
|
+
function Tn(e) {
|
|
3658
3936
|
let t = e.activeWeather === "gale" ? 7 : 1;
|
|
3659
3937
|
for (let n of e.state.clouds) n.x += n.speed * t, n.x - 140 * n.scale > e.width && (n.x = -160 * n.scale), e.ctx.drawImage(n.sprite, n.x + n.ox, n.y + n.oy);
|
|
3660
3938
|
}
|
|
3661
|
-
function
|
|
3939
|
+
function En(e) {
|
|
3662
3940
|
let t = e.fogSprite;
|
|
3663
3941
|
if (!t || e.state.fogBanks.length === 0) return;
|
|
3664
3942
|
let { canvas: n, baseR: r } = t;
|
|
3665
3943
|
for (let t of e.state.fogBanks) t.x += t.speed, t.speed > 0 && t.x - t.rw > e.width && (t.x = -t.rw), t.speed < 0 && t.x + t.rw < 0 && (t.x = e.width + t.rw), e.ctx.save(), e.ctx.translate(t.x, t.y), e.ctx.scale(t.rw / r, t.rh / r), e.ctx.globalAlpha = t.alpha, e.ctx.drawImage(n, -r, -r), e.ctx.restore();
|
|
3666
3944
|
}
|
|
3667
|
-
function
|
|
3945
|
+
function Dn(e) {
|
|
3668
3946
|
if (e.cfg.haze <= 0) return;
|
|
3669
3947
|
let t = e.activeWeather === "smog" ? "177, 164, 135" : "220, 226, 232";
|
|
3670
3948
|
e.activeNight && (t = e.activeWeather === "smog" ? "82, 74, 54" : "116, 128, 145"), e.ctx.fillStyle = `rgba(${t}, ${e.cfg.haze})`, e.ctx.fillRect(0, 0, e.width, e.height);
|
|
3671
3949
|
}
|
|
3672
3950
|
//#endregion
|
|
3673
3951
|
//#region src/components/weatherBackground/lightning.ts
|
|
3674
|
-
function
|
|
3952
|
+
function On(e, t, n, r, i, a) {
|
|
3675
3953
|
if (a <= 0) return [[e, t], [n, r]];
|
|
3676
|
-
let o = (e + n) / 2 + (Math.random() - .5) * i, s = (t + r) / 2, c =
|
|
3954
|
+
let o = (e + n) / 2 + (Math.random() - .5) * i, s = (t + r) / 2, c = On(e, t, o, s, i * .55, a - 1), l = On(o, s, n, r, i * .55, a - 1);
|
|
3677
3955
|
return [...c.slice(0, -1), ...l];
|
|
3678
3956
|
}
|
|
3679
3957
|
//#endregion
|
|
3680
3958
|
//#region src/components/weatherBackground/scene/draw-effects.ts
|
|
3681
|
-
function
|
|
3959
|
+
function kn(e) {
|
|
3682
3960
|
if (e.state.windStreaks.length !== 0) for (let t of e.state.windStreaks) {
|
|
3683
3961
|
t.x += t.speed, t.wave += .04, t.x - t.length > e.width && (t.x = -t.length - Math.random() * e.width * .3, t.y = Math.random() * e.height);
|
|
3684
3962
|
let n = Math.sin(t.wave) * 8, r = t.x + t.length;
|
|
@@ -3688,12 +3966,12 @@ function cn(e) {
|
|
|
3688
3966
|
}
|
|
3689
3967
|
}
|
|
3690
3968
|
}
|
|
3691
|
-
function
|
|
3969
|
+
function An(e) {
|
|
3692
3970
|
if (e.cfg.lightning) {
|
|
3693
3971
|
if (e.state.t >= e.state.nextStrike) {
|
|
3694
3972
|
e.state.nextStrike = e.state.t + 150 + Math.random() * 300, e.state.flashAlpha = .5, e.state.boltLife = 9;
|
|
3695
3973
|
let t = e.width * (.15 + Math.random() * .7);
|
|
3696
|
-
e.state.boltPoints =
|
|
3974
|
+
e.state.boltPoints = On(t, e.height * .12, t + (Math.random() - .5) * e.width * .2, e.height * .92, 60, 6);
|
|
3697
3975
|
}
|
|
3698
3976
|
if (e.state.boltLife > 0) {
|
|
3699
3977
|
--e.state.boltLife;
|
|
@@ -3705,7 +3983,7 @@ function ln(e) {
|
|
|
3705
3983
|
}
|
|
3706
3984
|
//#endregion
|
|
3707
3985
|
//#region src/components/weatherBackground/sprites/hail.ts
|
|
3708
|
-
var
|
|
3986
|
+
var jn = 3.2, Mn = (e) => {
|
|
3709
3987
|
let t = Math.ceil(e * 2.8 + 4), n = document.createElement("canvas");
|
|
3710
3988
|
n.width = t, n.height = t;
|
|
3711
3989
|
let r = n.getContext("2d"), i = t / 2, a = t / 2, o = 9 + Math.floor(Math.random() * 5), s = Array.from({ length: o }, (t, n) => {
|
|
@@ -3738,9 +4016,9 @@ var un = 3.2, dn = (e) => {
|
|
|
3738
4016
|
r.beginPath(), r.arc(n, o, e * (.1 + Math.random() * .08), 0, Math.PI * 2), r.fillStyle = "rgba(255, 255, 255, 0.55)", r.fill();
|
|
3739
4017
|
}
|
|
3740
4018
|
return r.beginPath(), r.ellipse(i - e * .34, a - e * .36, e * .24, e * .17, -.35, 0, Math.PI * 2), r.fillStyle = "rgba(255, 255, 255, 0.78)", r.fill(), n;
|
|
3741
|
-
},
|
|
3742
|
-
e.r = 1.4 + Math.random() ** 1.35 * 3.4, e.x = Math.random() * (t + 260) - 130 + (Math.random() - .5) * 40, e.y = i ? -e.r - Math.random() * n * .55 : Math.random() * n, e.vx = -1.2 - Math.random() * 4.8 + (Math.random() - .5) * 1.2, e.vy = 5.5 + Math.random() * 11, e.bounces = 0, e.opacity = .45 + Math.random() * .55, e.delay = Math.floor(Math.random() * (i ? 110 : 45)), e.gravity = .11 + Math.random() * .14, e.phase = Math.random() * Math.PI * 2, e.gust = (Math.random() - .5) * 1.4, e.maxBounces = +(Math.random() < .62), e.sprite =
|
|
3743
|
-
},
|
|
4019
|
+
}, Nn = (e = 16) => Array.from({ length: e }, () => Mn(jn)), Pn = (e) => e[Math.floor(Math.random() * e.length)], Fn = (e, t, n, r, i = !0) => {
|
|
4020
|
+
e.r = 1.4 + Math.random() ** 1.35 * 3.4, e.x = Math.random() * (t + 260) - 130 + (Math.random() - .5) * 40, e.y = i ? -e.r - Math.random() * n * .55 : Math.random() * n, e.vx = -1.2 - Math.random() * 4.8 + (Math.random() - .5) * 1.2, e.vy = 5.5 + Math.random() * 11, e.bounces = 0, e.opacity = .45 + Math.random() * .55, e.delay = Math.floor(Math.random() * (i ? 110 : 45)), e.gravity = .11 + Math.random() * .14, e.phase = Math.random() * Math.PI * 2, e.gust = (Math.random() - .5) * 1.4, e.maxBounces = +(Math.random() < .62), e.sprite = Pn(r), e.drawSize = e.r * 2.8 + 4, e.rotation = Math.random() * Math.PI * 2, e.rotationSpeed = (Math.random() - .5) * .06;
|
|
4021
|
+
}, In = (e, t, n) => {
|
|
3744
4022
|
let r = {
|
|
3745
4023
|
x: 0,
|
|
3746
4024
|
y: 0,
|
|
@@ -3759,11 +4037,11 @@ var un = 3.2, dn = (e) => {
|
|
|
3759
4037
|
rotation: 0,
|
|
3760
4038
|
rotationSpeed: 0
|
|
3761
4039
|
};
|
|
3762
|
-
return
|
|
4040
|
+
return Fn(r, e, t, n, Math.random() < .72), r;
|
|
3763
4041
|
};
|
|
3764
4042
|
//#endregion
|
|
3765
4043
|
//#region src/components/weatherBackground/scene/draw-precipitation.ts
|
|
3766
|
-
function
|
|
4044
|
+
function Ln(e) {
|
|
3767
4045
|
if (!e.cfg.rain) return;
|
|
3768
4046
|
let { wind: t, alpha: n, splash: r } = e.cfg.rain;
|
|
3769
4047
|
e.ctx.strokeStyle = `rgba(214, 228, 240, ${n})`, e.ctx.lineWidth = 1.2, e.ctx.beginPath();
|
|
@@ -3785,14 +4063,14 @@ function gn(e) {
|
|
|
3785
4063
|
e.ctx.beginPath(), e.ctx.ellipse(n.x, e.height - 3, n.r, n.r * .35, 0, Math.PI, Math.PI * 2), e.ctx.strokeStyle = `rgba(214, 228, 240, ${n.alpha})`, e.ctx.lineWidth = 1, e.ctx.stroke();
|
|
3786
4064
|
}
|
|
3787
4065
|
}
|
|
3788
|
-
function
|
|
4066
|
+
function Rn(e) {
|
|
3789
4067
|
for (let t of e.state.flakes) {
|
|
3790
4068
|
t.y += t.speed, t.x += Math.sin(e.state.t * .02 + t.phase) * (.3 + t.size * .08) + t.drift, t.rotation += t.rotationSpeed, t.y - t.drawSize > e.height && (t.y = -t.drawSize, t.x = Math.random() * e.width, t.phase = Math.random() * Math.PI * 2, t.drift = (Math.random() - .5) * .4, t.opacity = .55 + Math.random() * .45), t.x > e.width + 20 && (t.x = -20), t.x < -20 && (t.x = e.width + 20);
|
|
3791
4069
|
let n = t.drawSize / 2;
|
|
3792
4070
|
e.ctx.save(), e.ctx.globalAlpha = t.opacity, e.ctx.translate(t.x, t.y), e.ctx.rotate(t.rotation), e.ctx.drawImage(t.sprite, -n, -n, t.drawSize, t.drawSize), e.ctx.restore();
|
|
3793
4071
|
}
|
|
3794
4072
|
}
|
|
3795
|
-
function
|
|
4073
|
+
function zn(e) {
|
|
3796
4074
|
if (e.state.hailstones.length === 0) return;
|
|
3797
4075
|
let t = e.state.hailPool;
|
|
3798
4076
|
for (let n of e.state.hailstones) {
|
|
@@ -3803,7 +4081,7 @@ function vn(e) {
|
|
|
3803
4081
|
let r = n.x, i = n.y;
|
|
3804
4082
|
if (n.vy += n.gravity, n.vx += n.gust * .004 + (Math.random() - .5) * .06, n.x += n.vx + Math.sin(e.state.t * .028 + n.phase) * .35, n.y += n.vy, e.ctx.beginPath(), e.ctx.moveTo(r, i), e.ctx.lineTo(n.x, n.y), e.ctx.strokeStyle = `rgba(225, 239, 250, ${n.opacity * .18})`, e.ctx.lineWidth = n.r * .35, e.ctx.stroke(), n.y + n.r >= e.height) if (n.bounces < n.maxBounces) n.y = e.height - n.r, n.vy *= -(.22 + Math.random() * .28), n.vx = n.vx * (.55 + Math.random() * .25) + (Math.random() - .5) * 1.6, n.bounces += 1;
|
|
3805
4083
|
else {
|
|
3806
|
-
|
|
4084
|
+
Fn(n, e.width, e.height, t, !0);
|
|
3807
4085
|
continue;
|
|
3808
4086
|
}
|
|
3809
4087
|
let a = n.drawSize / 2;
|
|
@@ -3812,31 +4090,31 @@ function vn(e) {
|
|
|
3812
4090
|
}
|
|
3813
4091
|
//#endregion
|
|
3814
4092
|
//#region src/components/weatherBackground/scene/draw-sky.ts
|
|
3815
|
-
function
|
|
4093
|
+
function Bn(e) {
|
|
3816
4094
|
e.ctx.fillStyle = e.skyGradient, e.ctx.fillRect(0, 0, e.width, e.height);
|
|
3817
4095
|
}
|
|
3818
|
-
function
|
|
4096
|
+
function Vn(e) {
|
|
3819
4097
|
if (e.state.stars.length !== 0) for (let t of e.state.stars) {
|
|
3820
4098
|
let n = .35 + (Math.sin(e.state.t * t.speed + t.phase) + 1) * .325;
|
|
3821
4099
|
e.ctx.beginPath(), e.ctx.arc(t.x, t.y, t.r, 0, Math.PI * 2), e.ctx.fillStyle = `rgba(226, 235, 255, ${n})`, e.ctx.fill();
|
|
3822
4100
|
}
|
|
3823
4101
|
}
|
|
3824
|
-
function
|
|
4102
|
+
function Hn(e) {
|
|
3825
4103
|
let t = e.celestial;
|
|
3826
4104
|
if (!t) return;
|
|
3827
4105
|
let { ctx: n, sunX: r, sunY: i, state: a } = e, o = 1 + Math.sin(a.t * t.breathSpeed) * t.breathAmp, s = t.half * o, c = s * 2;
|
|
3828
4106
|
n.drawImage(t.canvas, r - s, i - s, c, c);
|
|
3829
4107
|
}
|
|
3830
|
-
function
|
|
4108
|
+
function Un(e) {
|
|
3831
4109
|
if (e.activeNight) {
|
|
3832
|
-
|
|
4110
|
+
Vn(e), Hn(e);
|
|
3833
4111
|
return;
|
|
3834
4112
|
}
|
|
3835
|
-
|
|
4113
|
+
Hn(e);
|
|
3836
4114
|
}
|
|
3837
4115
|
//#endregion
|
|
3838
4116
|
//#region src/components/weatherBackground/configs.ts
|
|
3839
|
-
var
|
|
4117
|
+
var Wn = {
|
|
3840
4118
|
sunny: {
|
|
3841
4119
|
sky: ["#4a9fe0", "#c8e8fb"],
|
|
3842
4120
|
sun: "full",
|
|
@@ -4146,8 +4424,8 @@ var Cn = {
|
|
|
4146
4424
|
lightning: !1
|
|
4147
4425
|
}
|
|
4148
4426
|
};
|
|
4149
|
-
|
|
4150
|
-
var
|
|
4427
|
+
Wn.snow = Wn.moderateSnow;
|
|
4428
|
+
var Gn = {
|
|
4151
4429
|
sunny: {
|
|
4152
4430
|
sky: ["#0b1a33", "#27476e"],
|
|
4153
4431
|
stars: 110
|
|
@@ -4213,15 +4491,15 @@ var wn = {
|
|
|
4213
4491
|
stars: 8
|
|
4214
4492
|
}
|
|
4215
4493
|
};
|
|
4216
|
-
|
|
4217
|
-
var
|
|
4494
|
+
Gn.snow = Gn.moderateSnow;
|
|
4495
|
+
var Kn = ([e, t, n]) => [
|
|
4218
4496
|
Math.round(e * .3 + 18),
|
|
4219
4497
|
Math.round(t * .3 + 24),
|
|
4220
4498
|
Math.round(n * .3 + 42)
|
|
4221
4499
|
];
|
|
4222
4500
|
//#endregion
|
|
4223
4501
|
//#region src/components/weatherBackground/sprites/cloud.ts
|
|
4224
|
-
function
|
|
4502
|
+
function qn(e, t, n, r) {
|
|
4225
4503
|
let [i, a, o] = n, s = Infinity, c = Infinity, l = -Infinity, u = -Infinity;
|
|
4226
4504
|
for (let n of t) {
|
|
4227
4505
|
let t = n.dx * e, r = n.dy * e, i = n.r * e;
|
|
@@ -4240,12 +4518,12 @@ function En(e, t, n, r) {
|
|
|
4240
4518
|
oy: f
|
|
4241
4519
|
};
|
|
4242
4520
|
}
|
|
4243
|
-
function
|
|
4521
|
+
function Jn(e, t, n, r, i) {
|
|
4244
4522
|
let a = .7 + Math.random() * .9, o = 4 + Math.floor(Math.random() * 3), s = Array.from({ length: o }, (e, t) => ({
|
|
4245
4523
|
dx: (t - o / 2) * 26 + (Math.random() - .5) * 14,
|
|
4246
4524
|
dy: (Math.random() - .5) * 14,
|
|
4247
4525
|
r: 22 + Math.random() * 20
|
|
4248
|
-
})), { sprite: c, ox: l, oy: u } =
|
|
4526
|
+
})), { sprite: c, ox: l, oy: u } = qn(a, s, r, i);
|
|
4249
4527
|
return {
|
|
4250
4528
|
x: Math.random() * (e + 240) - 120,
|
|
4251
4529
|
y: t * .06 + Math.random() * t * n,
|
|
@@ -4257,7 +4535,7 @@ function Dn(e, t, n, r, i) {
|
|
|
4257
4535
|
oy: u
|
|
4258
4536
|
};
|
|
4259
4537
|
}
|
|
4260
|
-
function
|
|
4538
|
+
function Yn(e, t = 120) {
|
|
4261
4539
|
let n = t * 2, r = document.createElement("canvas");
|
|
4262
4540
|
r.width = n, r.height = n;
|
|
4263
4541
|
let i = r.getContext("2d"), a = i.createRadialGradient(t, t, 0, t, t, t);
|
|
@@ -4268,7 +4546,7 @@ function On(e, t = 120) {
|
|
|
4268
4546
|
}
|
|
4269
4547
|
//#endregion
|
|
4270
4548
|
//#region src/components/weatherBackground/sprites/celestial.ts
|
|
4271
|
-
function
|
|
4549
|
+
function Xn(e, t) {
|
|
4272
4550
|
let n = e.sun;
|
|
4273
4551
|
if (n === "none") return null;
|
|
4274
4552
|
let r = n === "full" ? 1 : n === "soft" ? .62 : .32, i = t * (n === "full" ? .72 : n === "soft" ? .62 : .5), a = t * (n === "full" ? 7.2 : n === "soft" ? 5.2 : 3.6), o = a;
|
|
@@ -4296,7 +4574,7 @@ function kn(e, t) {
|
|
|
4296
4574
|
breathAmp: .018
|
|
4297
4575
|
};
|
|
4298
4576
|
}
|
|
4299
|
-
function
|
|
4577
|
+
function Zn(e, t, n) {
|
|
4300
4578
|
if (e.sun === "none") return null;
|
|
4301
4579
|
let r = t * .82, i = e.sun === "dim", a = i ? .45 : 1, o = r * (i ? 4.2 : 6.2), s = Math.ceil(Math.max(o, r * 2.6, r * 1.35) + 2), c = s * 2, l = document.createElement("canvas");
|
|
4302
4580
|
l.width = c, l.height = c;
|
|
@@ -4350,12 +4628,12 @@ function An(e, t, n) {
|
|
|
4350
4628
|
}
|
|
4351
4629
|
//#endregion
|
|
4352
4630
|
//#region src/components/weatherBackground/sprites/snow.ts
|
|
4353
|
-
var
|
|
4631
|
+
var Qn = (e) => {
|
|
4354
4632
|
let t = Math.ceil(e * 2 + 4), n = document.createElement("canvas");
|
|
4355
4633
|
n.width = t, n.height = t;
|
|
4356
4634
|
let r = n.getContext("2d"), i = r.createRadialGradient(t / 2, t / 2, 0, t / 2, t / 2, e + 1);
|
|
4357
4635
|
return i.addColorStop(0, "rgba(255, 255, 255, 1)"), i.addColorStop(.6, "rgba(255, 255, 255, 0.85)"), i.addColorStop(1, "rgba(255, 255, 255, 0)"), r.fillStyle = i, r.fillRect(0, 0, t, t), n;
|
|
4358
|
-
},
|
|
4636
|
+
}, $n = (e) => {
|
|
4359
4637
|
let t = Math.ceil(e * 2 + 6), n = document.createElement("canvas");
|
|
4360
4638
|
n.width = t, n.height = t;
|
|
4361
4639
|
let r = n.getContext("2d");
|
|
@@ -4382,22 +4660,22 @@ var jn = (e) => {
|
|
|
4382
4660
|
r.closePath(), r.stroke();
|
|
4383
4661
|
}
|
|
4384
4662
|
return n;
|
|
4385
|
-
},
|
|
4663
|
+
}, er = () => ({
|
|
4386
4664
|
dots: [
|
|
4387
4665
|
1.2,
|
|
4388
4666
|
1.6,
|
|
4389
4667
|
2,
|
|
4390
4668
|
2.3
|
|
4391
|
-
].map((e) =>
|
|
4669
|
+
].map((e) => Qn(e)),
|
|
4392
4670
|
crystals: [
|
|
4393
4671
|
2.6,
|
|
4394
4672
|
3.2,
|
|
4395
4673
|
3.8,
|
|
4396
4674
|
4.4,
|
|
4397
4675
|
5
|
|
4398
|
-
].map((e) =>
|
|
4399
|
-
}),
|
|
4400
|
-
let i = 1 + Math.random() ** 1.6 * 4.2, a = i >= 2.4, o =
|
|
4676
|
+
].map((e) => $n(e * 2.4))
|
|
4677
|
+
}), tr = (e) => e[Math.floor(Math.random() * e.length)], nr = (e, t, n, r) => {
|
|
4678
|
+
let i = 1 + Math.random() ** 1.6 * 4.2, a = i >= 2.4, o = tr(a ? n.crystals : n.dots), s = a ? i * 4.8 + 6 : i * 2 + 4;
|
|
4401
4679
|
return {
|
|
4402
4680
|
x: Math.random() * e,
|
|
4403
4681
|
y: r ?? Math.random() * t,
|
|
@@ -4411,9 +4689,9 @@ var jn = (e) => {
|
|
|
4411
4689
|
sprite: o,
|
|
4412
4690
|
drawSize: s
|
|
4413
4691
|
};
|
|
4414
|
-
},
|
|
4415
|
-
function
|
|
4416
|
-
let { ctx: t, width: n, height: r, activeWeather: i, activeNight: a } = e, o =
|
|
4692
|
+
}, rr = (e, t) => t ? e === "smog" ? "96, 88, 66" : "138, 150, 168" : e === "smog" ? "168, 155, 126" : "226, 232, 238";
|
|
4693
|
+
function ir(e) {
|
|
4694
|
+
let { ctx: t, width: n, height: r, activeWeather: i, activeNight: a } = e, o = Wn[i], s = Gn[i], c = a ? s.sky : o.sky, l = a ? Kn(o.cloudColor) : o.cloudColor, u = n * .72, d = r * .26, f = Math.min(n, r) * .09, p = t.createLinearGradient(0, 0, 0, r);
|
|
4417
4695
|
p.addColorStop(0, c[0]), p.addColorStop(1, c[1]);
|
|
4418
4696
|
let m = a ? Array.from({ length: s.stars }, () => ({
|
|
4419
4697
|
x: Math.random() * n,
|
|
@@ -4442,7 +4720,7 @@ function Ln(e) {
|
|
|
4442
4720
|
dy: .24,
|
|
4443
4721
|
r: .07
|
|
4444
4722
|
}
|
|
4445
|
-
], g = a ?
|
|
4723
|
+
], g = a ? Zn(o, f, h) : Xn(o, f), _ = Array.from({ length: o.cloudCount }, () => Jn(n, r, o.cloudSpread, l, o.cloudAlpha)), v = o.rain ? Array.from({ length: o.rain.count }, () => ({
|
|
4446
4724
|
x: Math.random() * (n + 160) - 80,
|
|
4447
4725
|
y: Math.random() * r,
|
|
4448
4726
|
len: 8 + Math.random() * 10,
|
|
@@ -4454,7 +4732,7 @@ function Ln(e) {
|
|
|
4454
4732
|
rh: r * (.08 + Math.random() * .08),
|
|
4455
4733
|
speed: (.1 + Math.random() * .25) * (t % 2 == 0 ? 1 : -1),
|
|
4456
4734
|
alpha: .16 + Math.random() * .14
|
|
4457
|
-
})), x = o.fogBanks > 0 ?
|
|
4735
|
+
})), x = o.fogBanks > 0 ? Yn(rr(i, a)) : null, S = o.snowCount > 0 ? er() : null, C = S == null ? [] : Array.from({ length: o.snowCount }, () => nr(n, r, S)), w = i === "hail" ? Nn() : null, T = w == null ? [] : Array.from({ length: 145 }, () => In(n, r, w)), E = i === "gale" ? Array.from({ length: 46 }, () => ({
|
|
4458
4736
|
x: Math.random() * n,
|
|
4459
4737
|
y: Math.random() * r,
|
|
4460
4738
|
length: 45 + Math.random() * 130,
|
|
@@ -4462,7 +4740,7 @@ function Ln(e) {
|
|
|
4462
4740
|
wave: Math.random() * Math.PI * 2,
|
|
4463
4741
|
alpha: .12 + Math.random() * .3,
|
|
4464
4742
|
width: .6 + Math.random() * 1.2
|
|
4465
|
-
})) : [],
|
|
4743
|
+
})) : [], D = [], O = 120 + Math.random() * 240;
|
|
4466
4744
|
return {
|
|
4467
4745
|
sky: c,
|
|
4468
4746
|
cloudRgb: l,
|
|
@@ -4483,47 +4761,47 @@ function Ln(e) {
|
|
|
4483
4761
|
flakes: C,
|
|
4484
4762
|
hailstones: T,
|
|
4485
4763
|
hailPool: w ?? [],
|
|
4486
|
-
windStreaks:
|
|
4764
|
+
windStreaks: E,
|
|
4487
4765
|
t: 0,
|
|
4488
4766
|
flashAlpha: 0,
|
|
4489
4767
|
boltLife: 0,
|
|
4490
|
-
boltPoints:
|
|
4491
|
-
nextStrike:
|
|
4768
|
+
boltPoints: D,
|
|
4769
|
+
nextStrike: O
|
|
4492
4770
|
}
|
|
4493
4771
|
};
|
|
4494
4772
|
}
|
|
4495
4773
|
//#endregion
|
|
4496
4774
|
//#region src/components/weatherBackground/scene/create-weather-scene.ts
|
|
4497
|
-
function
|
|
4498
|
-
t && (e.state.t += 1),
|
|
4775
|
+
function ar(e, t) {
|
|
4776
|
+
t && (e.state.t += 1), Bn(e), Un(e), Tn(e), En(e), Dn(e), Ln(e), Rn(e), zn(e), kn(e), An(e);
|
|
4499
4777
|
}
|
|
4500
|
-
function
|
|
4778
|
+
function or(e) {
|
|
4501
4779
|
let { ctx: t, width: n, height: r, activeWeather: i, activeNight: a } = e, o = {
|
|
4502
4780
|
ctx: t,
|
|
4503
4781
|
width: n,
|
|
4504
4782
|
height: r,
|
|
4505
4783
|
activeWeather: i,
|
|
4506
4784
|
activeNight: a,
|
|
4507
|
-
...
|
|
4785
|
+
...ir(e)
|
|
4508
4786
|
};
|
|
4509
|
-
if (typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return
|
|
4787
|
+
if (typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return ar(o, !1), () => void 0;
|
|
4510
4788
|
let s = 0, c = document.hidden, l = v((e) => {
|
|
4511
4789
|
c = e;
|
|
4512
4790
|
}), u = () => {
|
|
4513
|
-
s = requestAnimationFrame(u), !c &&
|
|
4791
|
+
s = requestAnimationFrame(u), !c && ar(o, !0);
|
|
4514
4792
|
};
|
|
4515
4793
|
return u(), () => {
|
|
4516
4794
|
cancelAnimationFrame(s), l();
|
|
4517
4795
|
};
|
|
4518
4796
|
}
|
|
4519
|
-
var
|
|
4797
|
+
var sr = {
|
|
4520
4798
|
weatherBackground: "cos-weatherBackground-Mnm22",
|
|
4521
4799
|
canvas: "cos-canvas-nvqMt",
|
|
4522
4800
|
loadingOverlay: "cos-loadingOverlay-O58B7",
|
|
4523
4801
|
loadingSpinner: "cos-loadingSpinner-NQ9yG",
|
|
4524
4802
|
"weather-loading-spin": "cos-weather-loading-spin-IPFWZ"
|
|
4525
|
-
},
|
|
4526
|
-
let p = o(null), m =
|
|
4803
|
+
}, cr = ({ width: e = 800, height: t = 450, weather: r = "sunny", night: i = !1, live: a = !1, latitude: s, longitude: c, onLiveWeather: d, loading: f = !1 }) => {
|
|
4804
|
+
let p = o(null), m = wn(a, s != null && c != null ? {
|
|
4527
4805
|
latitude: s,
|
|
4528
4806
|
longitude: c
|
|
4529
4807
|
} : void 0), h = a && m.weather ? m.weather : r, g = a && m.current ? !m.current.isDay : i, _ = f || a && (m.status === "locating" || m.status === "fetching"), v = o(d);
|
|
@@ -4537,7 +4815,7 @@ var $ = {
|
|
|
4537
4815
|
let r = window.devicePixelRatio || 1;
|
|
4538
4816
|
n.width = e * r, n.height = t * r;
|
|
4539
4817
|
let i = n.getContext("2d");
|
|
4540
|
-
if (i) return i.setTransform(r, 0, 0, r, 0, 0),
|
|
4818
|
+
if (i) return i.setTransform(r, 0, 0, r, 0, 0), or({
|
|
4541
4819
|
ctx: i,
|
|
4542
4820
|
width: e,
|
|
4543
4821
|
height: t,
|
|
@@ -4550,14 +4828,14 @@ var $ = {
|
|
|
4550
4828
|
t,
|
|
4551
4829
|
e
|
|
4552
4830
|
]), /* @__PURE__ */ u("div", {
|
|
4553
|
-
className:
|
|
4831
|
+
className: sr.weatherBackground,
|
|
4554
4832
|
style: {
|
|
4555
4833
|
width: e,
|
|
4556
4834
|
height: t
|
|
4557
4835
|
},
|
|
4558
4836
|
children: [/* @__PURE__ */ l("canvas", {
|
|
4559
4837
|
ref: p,
|
|
4560
|
-
className:
|
|
4838
|
+
className: sr.canvas,
|
|
4561
4839
|
style: {
|
|
4562
4840
|
width: e,
|
|
4563
4841
|
height: t
|
|
@@ -4565,35 +4843,35 @@ var $ = {
|
|
|
4565
4843
|
role: "img",
|
|
4566
4844
|
"aria-label": `天气背景:${h}${g ? "(夜间)" : ""}`
|
|
4567
4845
|
}), _ && /* @__PURE__ */ u("div", {
|
|
4568
|
-
className:
|
|
4846
|
+
className: sr.loadingOverlay,
|
|
4569
4847
|
role: "status",
|
|
4570
4848
|
"aria-live": "polite",
|
|
4571
4849
|
children: [/* @__PURE__ */ l("div", {
|
|
4572
|
-
className:
|
|
4850
|
+
className: sr.loadingSpinner,
|
|
4573
4851
|
"aria-hidden": !0
|
|
4574
4852
|
}), /* @__PURE__ */ l("span", { children: "天气加载中…" })]
|
|
4575
4853
|
})]
|
|
4576
4854
|
});
|
|
4577
|
-
},
|
|
4855
|
+
}, lr = {
|
|
4578
4856
|
waveText: "cos-waveText-Zy2Tp",
|
|
4579
4857
|
text: "cos-text-el-KR",
|
|
4580
4858
|
char: "cos-char-Y9-mV",
|
|
4581
4859
|
wave: "cos-wave-jVRCz"
|
|
4582
|
-
},
|
|
4583
|
-
className:
|
|
4860
|
+
}, ur = ({ text: e = "WAVE", amplitude: t = 12, color: n = "#38bdf8", fontSize: r = 56 }) => /* @__PURE__ */ l("div", {
|
|
4861
|
+
className: lr.waveText,
|
|
4584
4862
|
children: /* @__PURE__ */ l("h1", {
|
|
4585
|
-
className:
|
|
4863
|
+
className: lr.text,
|
|
4586
4864
|
style: {
|
|
4587
4865
|
fontSize: r,
|
|
4588
4866
|
"--wave-color": n,
|
|
4589
4867
|
"--wave-amp": `${t}px`
|
|
4590
4868
|
},
|
|
4591
4869
|
children: e.split("").map((e, t) => /* @__PURE__ */ l("span", {
|
|
4592
|
-
className:
|
|
4870
|
+
className: lr.char,
|
|
4593
4871
|
style: { animationDelay: `${t * .1}s` },
|
|
4594
4872
|
children: e === " " ? "\xA0" : e
|
|
4595
4873
|
}, `${e}-${t}`))
|
|
4596
4874
|
})
|
|
4597
4875
|
});
|
|
4598
4876
|
//#endregion
|
|
4599
|
-
export { x as AudioVisualizer, _ as Aurora, f as BarcodeScan, m as BurnAway, C as CanvasClock,
|
|
4877
|
+
export { x as AudioVisualizer, _ as Aurora, f as BarcodeScan, m as BurnAway, C as CanvasClock, D as Charge, k as ClickSpark, ee as Confetti, ae as Countdown, fe as CursorTrail, te as CyberGrid, me as DiceRoll, se as DnaHelix, ge as DoublePendulum, ue as ElectricArc, Ce as Fireworks, Ee as FlipCounter, je as GlitchText, ke as GradientFlow, Pe as GravityBalls, Fe as HolographicCard, Be as LiquidGlass, Ie as LiquidProgress, Re as LorenzAttractor, He as MagneticButton, We as MatrixRain, Je as MazeGenerator, Ke as MetaballPool, Xe as MeteorRain, Qe as NeonText, et as NewtonCradle, rt as OrbitalChart, at as ParticleNetwork, st as PlasmaBall, jt as ProgressChest, Nt as RadarScan, Pt as RedPacketRain, It as ReturnCity, Jt as RippleWater, Rt as RopeChain, Zt as ScrambleText, $t as ScratchCard, nn as SlotMachine, Ct as SmokeFog, Ot as Snowfall, Et as SolarSystem, zt as Speedometer, on as SplitReveal, cn as Spotlight, At as Starfield, Bt as TimelinePulse, fn as Turntable, hn as Typewriter, gn as WaveButton, ur as WaveText, cr as WeatherBackground, yn as mapWmoCodeToWeatherType, wn as useLiveWeather };
|