cos-design 3.5.2 → 3.5.3
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 +7 -0
- package/dist/index.cjs +93 -1
- package/dist/index.js +574 -462
- package/dist/src/components/rippleWater/index.d.ts +27 -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
|
+
}, P = 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
|
+
P.displayName = "Confetti";
|
|
490
|
+
var ee = {
|
|
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: ee.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: ee.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
|
+
}, V = {
|
|
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
|
+
}, Ze = ({ text: e = "NEON", color: t = "#ff00de", fontSize: n = 72, flicker: r = !0 }) => /* @__PURE__ */ u("div", {
|
|
1796
|
+
className: V.neonText,
|
|
1797
1797
|
children: [/* @__PURE__ */ l("h1", {
|
|
1798
|
-
className: `${
|
|
1798
|
+
className: `${V.text} ${r ? V.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: V.reflection,
|
|
1806
1806
|
style: {
|
|
1807
1807
|
fontSize: n * .35,
|
|
1808
1808
|
color: t
|
|
1809
1809
|
},
|
|
1810
1810
|
children: e
|
|
1811
1811
|
})]
|
|
1812
|
-
}),
|
|
1812
|
+
}), Qe = {
|
|
1813
1813
|
newtonCradle: "cos-newtonCradle-mFl-b",
|
|
1814
1814
|
canvas: "cos-canvas-TWKl5"
|
|
1815
|
-
},
|
|
1815
|
+
}, $e = ({ 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: Qe.newtonCradle,
|
|
1879
1879
|
style: {
|
|
1880
1880
|
width: r,
|
|
1881
1881
|
height: i,
|
|
@@ -1883,19 +1883,19 @@ var P = {
|
|
|
1883
1883
|
},
|
|
1884
1884
|
children: /* @__PURE__ */ l("canvas", {
|
|
1885
1885
|
ref: a,
|
|
1886
|
-
className:
|
|
1886
|
+
className: Qe.canvas,
|
|
1887
1887
|
style: {
|
|
1888
1888
|
width: r,
|
|
1889
1889
|
height: i
|
|
1890
1890
|
}
|
|
1891
1891
|
})
|
|
1892
1892
|
});
|
|
1893
|
-
},
|
|
1893
|
+
}, H = {
|
|
1894
1894
|
orbitalChart: "cos-orbitalChart-XLORB",
|
|
1895
1895
|
canvas: "cos-canvas-hGVud",
|
|
1896
1896
|
legend: "cos-legend-Np9Mm",
|
|
1897
1897
|
swatch: "cos-swatch-xEKvA"
|
|
1898
|
-
},
|
|
1898
|
+
}, et = [
|
|
1899
1899
|
{
|
|
1900
1900
|
label: "A",
|
|
1901
1901
|
value: 30,
|
|
@@ -1916,7 +1916,7 @@ var P = {
|
|
|
1916
1916
|
value: 25,
|
|
1917
1917
|
color: "#4ade80"
|
|
1918
1918
|
}
|
|
1919
|
-
],
|
|
1919
|
+
], tt = ({ data: e = et, size: t = 240 }) => {
|
|
1920
1920
|
let r = o(null);
|
|
1921
1921
|
return n(() => {
|
|
1922
1922
|
let n = r.current;
|
|
@@ -1945,23 +1945,23 @@ var P = {
|
|
|
1945
1945
|
cancelAnimationFrame(u), p();
|
|
1946
1946
|
};
|
|
1947
1947
|
}, [e, t]), /* @__PURE__ */ u("div", {
|
|
1948
|
-
className:
|
|
1948
|
+
className: H.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: H.canvas,
|
|
1956
1956
|
style: {
|
|
1957
1957
|
width: t,
|
|
1958
1958
|
height: t
|
|
1959
1959
|
}
|
|
1960
1960
|
}), /* @__PURE__ */ l("ul", {
|
|
1961
|
-
className:
|
|
1961
|
+
className: H.legend,
|
|
1962
1962
|
children: e.map((e) => /* @__PURE__ */ u("li", { children: [
|
|
1963
1963
|
/* @__PURE__ */ l("span", {
|
|
1964
|
-
className:
|
|
1964
|
+
className: H.swatch,
|
|
1965
1965
|
style: { background: e.color }
|
|
1966
1966
|
}),
|
|
1967
1967
|
e.label,
|
|
@@ -1971,11 +1971,11 @@ var P = {
|
|
|
1971
1971
|
] }, e.label))
|
|
1972
1972
|
})]
|
|
1973
1973
|
});
|
|
1974
|
-
},
|
|
1974
|
+
}, nt = {
|
|
1975
1975
|
particleNetwork: "cos-particleNetwork-GSZq-",
|
|
1976
1976
|
canvas: "cos-canvas-E-BGP",
|
|
1977
1977
|
hint: "cos-hint-LEO5o"
|
|
1978
|
-
},
|
|
1978
|
+
}, rt = ({ width: e = 800, height: r = 500, particleCount: i = 60, linkDistance: a = 120, repelRadius: s = 150, color: c = "#38bdf8" }) => {
|
|
1979
1979
|
let d = o(null), f = o([]), p = o({
|
|
1980
1980
|
x: -1e3,
|
|
1981
1981
|
y: -1e3
|
|
@@ -2058,14 +2058,14 @@ var P = {
|
|
|
2058
2058
|
};
|
|
2059
2059
|
};
|
|
2060
2060
|
return /* @__PURE__ */ u("div", {
|
|
2061
|
-
className:
|
|
2061
|
+
className: nt.particleNetwork,
|
|
2062
2062
|
style: {
|
|
2063
2063
|
width: e,
|
|
2064
2064
|
height: r
|
|
2065
2065
|
},
|
|
2066
2066
|
children: [/* @__PURE__ */ l("canvas", {
|
|
2067
2067
|
ref: d,
|
|
2068
|
-
className:
|
|
2068
|
+
className: nt.canvas,
|
|
2069
2069
|
style: {
|
|
2070
2070
|
width: e,
|
|
2071
2071
|
height: r
|
|
@@ -2075,14 +2075,14 @@ var P = {
|
|
|
2075
2075
|
onTouchMove: _,
|
|
2076
2076
|
onTouchEnd: y
|
|
2077
2077
|
}), /* @__PURE__ */ l("p", {
|
|
2078
|
-
className:
|
|
2078
|
+
className: nt.hint,
|
|
2079
2079
|
children: "移动鼠标或手指与粒子互动"
|
|
2080
2080
|
})]
|
|
2081
2081
|
});
|
|
2082
|
-
},
|
|
2082
|
+
}, it = {
|
|
2083
2083
|
plasmaBall: "cos-plasmaBall-xGHSj",
|
|
2084
2084
|
canvas: "cos-canvas-V1CgL"
|
|
2085
|
-
},
|
|
2085
|
+
}, at = ({ width: e = 320, height: t = 320, color: r = "#a78bfa", arcCount: i = 8 }) => {
|
|
2086
2086
|
let a = o(null), s = o({
|
|
2087
2087
|
x: e / 2,
|
|
2088
2088
|
y: t / 2,
|
|
@@ -2143,24 +2143,24 @@ var P = {
|
|
|
2143
2143
|
t,
|
|
2144
2144
|
e
|
|
2145
2145
|
]), /* @__PURE__ */ l("div", {
|
|
2146
|
-
className:
|
|
2146
|
+
className: it.plasmaBall,
|
|
2147
2147
|
style: {
|
|
2148
2148
|
width: e,
|
|
2149
2149
|
height: t
|
|
2150
2150
|
},
|
|
2151
2151
|
children: /* @__PURE__ */ l("canvas", {
|
|
2152
2152
|
ref: a,
|
|
2153
|
-
className:
|
|
2153
|
+
className: it.canvas,
|
|
2154
2154
|
style: {
|
|
2155
2155
|
width: e,
|
|
2156
2156
|
height: t
|
|
2157
2157
|
}
|
|
2158
2158
|
})
|
|
2159
2159
|
});
|
|
2160
|
-
},
|
|
2160
|
+
}, ot = {
|
|
2161
2161
|
smokeFog: "cos-smokeFog-SYlts",
|
|
2162
2162
|
canvas: "cos-canvas-iOJV7"
|
|
2163
|
-
},
|
|
2163
|
+
}, st = (e, t) => {
|
|
2164
2164
|
let n = Math.random() * 80 + 40, r = (Math.random() - .5) * .4, i = (Math.random() - .5) * .3 - .1, a = Math.random() * .15 + .05;
|
|
2165
2165
|
return {
|
|
2166
2166
|
x: Math.random() * e,
|
|
@@ -2177,14 +2177,14 @@ var P = {
|
|
|
2177
2177
|
receptivity: .45 + Math.random() * .9,
|
|
2178
2178
|
phase: Math.random() * Math.PI * 2
|
|
2179
2179
|
};
|
|
2180
|
-
},
|
|
2180
|
+
}, ct = (e, t, n, r) => {
|
|
2181
2181
|
let i = Math.cos(-n), a = Math.sin(-n), o = e * i - t * a, s = e * a + t * i;
|
|
2182
2182
|
return Math.hypot(o / r, s * r);
|
|
2183
|
-
},
|
|
2183
|
+
}, lt = ({ width: e = 800, height: r = 500, density: i = .5 }) => {
|
|
2184
2184
|
let a = o(null), s = o([]), c = o([]), u = o(0);
|
|
2185
2185
|
n(() => {
|
|
2186
2186
|
let t = Math.floor(20 + i * 40);
|
|
2187
|
-
s.current = Array.from({ length: t }, () =>
|
|
2187
|
+
s.current = Array.from({ length: t }, () => st(e, r));
|
|
2188
2188
|
}, [
|
|
2189
2189
|
i,
|
|
2190
2190
|
r,
|
|
@@ -2233,7 +2233,7 @@ var P = {
|
|
|
2233
2233
|
for (let e = a.length - 1; e >= 0; e--) {
|
|
2234
2234
|
let t = a[e], r = t.life * t.life, i = t.life > .92 ? 1 : .22;
|
|
2235
2235
|
for (let e of n) {
|
|
2236
|
-
let n = e.x - t.x, a = e.y - t.y, s =
|
|
2236
|
+
let n = e.x - t.x, a = e.y - t.y, s = ct(n, a, t.windAngle, t.stretch);
|
|
2237
2237
|
if (s > t.radius) continue;
|
|
2238
2238
|
let c = (1 - s / t.radius) ** 1.6, l = .55 + .7 * Math.sin(e.phase * 3.1 + s * .05 + o * 1.7), u = c * e.receptivity * l * i;
|
|
2239
2239
|
if (u < .06) continue;
|
|
@@ -2254,24 +2254,24 @@ var P = {
|
|
|
2254
2254
|
cancelAnimationFrame(u.current), d();
|
|
2255
2255
|
};
|
|
2256
2256
|
}, [r, e]), /* @__PURE__ */ l("div", {
|
|
2257
|
-
className:
|
|
2257
|
+
className: ot.smokeFog,
|
|
2258
2258
|
style: {
|
|
2259
2259
|
width: e,
|
|
2260
2260
|
height: r
|
|
2261
2261
|
},
|
|
2262
2262
|
children: /* @__PURE__ */ l("canvas", {
|
|
2263
2263
|
ref: a,
|
|
2264
|
-
className:
|
|
2264
|
+
className: ot.canvas,
|
|
2265
2265
|
style: {
|
|
2266
2266
|
width: e,
|
|
2267
2267
|
height: r
|
|
2268
2268
|
}
|
|
2269
2269
|
})
|
|
2270
2270
|
});
|
|
2271
|
-
},
|
|
2271
|
+
}, ut = {
|
|
2272
2272
|
solarSystem: "cos-solarSystem-27h8F",
|
|
2273
2273
|
canvas: "cos-canvas-C0nRa"
|
|
2274
|
-
},
|
|
2274
|
+
}, dt = [
|
|
2275
2275
|
{
|
|
2276
2276
|
name: "Mercury",
|
|
2277
2277
|
radius: 0,
|
|
@@ -2329,10 +2329,10 @@ var P = {
|
|
|
2329
2329
|
size: 2,
|
|
2330
2330
|
parent: 2
|
|
2331
2331
|
}
|
|
2332
|
-
],
|
|
2332
|
+
], ft = ({ width: e = 400, height: t = 400, speed: r = 1, showOrbits: i = !0 }) => {
|
|
2333
2333
|
let a = o(null), s = o([]), c = o([]);
|
|
2334
2334
|
return n(() => {
|
|
2335
|
-
s.current =
|
|
2335
|
+
s.current = dt.map((e) => ({
|
|
2336
2336
|
...e,
|
|
2337
2337
|
angle: Math.random() * Math.PI * 2
|
|
2338
2338
|
})), c.current = Array.from({ length: 80 }, () => ({
|
|
@@ -2381,24 +2381,24 @@ var P = {
|
|
|
2381
2381
|
r,
|
|
2382
2382
|
e
|
|
2383
2383
|
]), /* @__PURE__ */ l("div", {
|
|
2384
|
-
className:
|
|
2384
|
+
className: ut.solarSystem,
|
|
2385
2385
|
style: {
|
|
2386
2386
|
width: e,
|
|
2387
2387
|
height: t
|
|
2388
2388
|
},
|
|
2389
2389
|
children: /* @__PURE__ */ l("canvas", {
|
|
2390
2390
|
ref: a,
|
|
2391
|
-
className:
|
|
2391
|
+
className: ut.canvas,
|
|
2392
2392
|
style: {
|
|
2393
2393
|
width: e,
|
|
2394
2394
|
height: t
|
|
2395
2395
|
}
|
|
2396
2396
|
})
|
|
2397
2397
|
});
|
|
2398
|
-
},
|
|
2398
|
+
}, pt = {
|
|
2399
2399
|
snowfall: "cos-snowfall-Q-Dhg",
|
|
2400
2400
|
canvas: "cos-canvas-bJVF8"
|
|
2401
|
-
},
|
|
2401
|
+
}, mt = ({ width: e = 800, height: r = 500, mode: i = "snow", count: a = 120 }) => {
|
|
2402
2402
|
let s = o(null), c = o([]), u = o(0), d = t((t) => ({
|
|
2403
2403
|
x: Math.random() * e,
|
|
2404
2404
|
y: t ?? Math.random() * r,
|
|
@@ -2445,24 +2445,24 @@ var P = {
|
|
|
2445
2445
|
i,
|
|
2446
2446
|
e
|
|
2447
2447
|
]), /* @__PURE__ */ l("div", {
|
|
2448
|
-
className:
|
|
2448
|
+
className: pt.snowfall,
|
|
2449
2449
|
style: {
|
|
2450
2450
|
width: e,
|
|
2451
2451
|
height: r
|
|
2452
2452
|
},
|
|
2453
2453
|
children: /* @__PURE__ */ l("canvas", {
|
|
2454
2454
|
ref: s,
|
|
2455
|
-
className:
|
|
2455
|
+
className: pt.canvas,
|
|
2456
2456
|
style: {
|
|
2457
2457
|
width: e,
|
|
2458
2458
|
height: r
|
|
2459
2459
|
}
|
|
2460
2460
|
})
|
|
2461
2461
|
});
|
|
2462
|
-
},
|
|
2462
|
+
}, ht = {
|
|
2463
2463
|
starfield: "cos-starfield-QTwia",
|
|
2464
2464
|
canvas: "cos-canvas-C2t3g"
|
|
2465
|
-
},
|
|
2465
|
+
}, gt = ({ width: e = 800, height: t = 500, starCount: r = 400, speed: i = 1 }) => {
|
|
2466
2466
|
let a = o(null), s = o([]), c = o(0);
|
|
2467
2467
|
return n(() => {
|
|
2468
2468
|
s.current = Array.from({ length: r }, () => ({
|
|
@@ -2505,21 +2505,21 @@ var P = {
|
|
|
2505
2505
|
r,
|
|
2506
2506
|
e
|
|
2507
2507
|
]), /* @__PURE__ */ l("div", {
|
|
2508
|
-
className:
|
|
2508
|
+
className: ht.starfield,
|
|
2509
2509
|
style: {
|
|
2510
2510
|
width: e,
|
|
2511
2511
|
height: t
|
|
2512
2512
|
},
|
|
2513
2513
|
children: /* @__PURE__ */ l("canvas", {
|
|
2514
2514
|
ref: a,
|
|
2515
|
-
className:
|
|
2515
|
+
className: ht.canvas,
|
|
2516
2516
|
style: {
|
|
2517
2517
|
width: e,
|
|
2518
2518
|
height: t
|
|
2519
2519
|
}
|
|
2520
2520
|
})
|
|
2521
2521
|
});
|
|
2522
|
-
},
|
|
2522
|
+
}, U = {
|
|
2523
2523
|
progressChest: "cos-progressChest-Bqcv1",
|
|
2524
2524
|
barWrap: "cos-barWrap-E2pnl",
|
|
2525
2525
|
barTrack: "cos-barTrack-dKLhs",
|
|
@@ -2534,37 +2534,37 @@ var P = {
|
|
|
2534
2534
|
treasure: "cos-treasure-nx-6S",
|
|
2535
2535
|
pop: "cos-pop-uRZvT",
|
|
2536
2536
|
label: "cos-label-61hRe"
|
|
2537
|
-
},
|
|
2537
|
+
}, _t = ({ progress: e = 0, onOpen: t, label: r = "开启宝箱" }) => {
|
|
2538
2538
|
let i = o(!1), a = o(t), s = y(e, 0, 100), c = s >= 100;
|
|
2539
2539
|
return n(() => {
|
|
2540
2540
|
a.current = t;
|
|
2541
2541
|
}, [t]), n(() => {
|
|
2542
2542
|
c && !i.current && (i.current = !0, a.current?.()), c || (i.current = !1);
|
|
2543
2543
|
}, [c]), /* @__PURE__ */ u("div", {
|
|
2544
|
-
className:
|
|
2544
|
+
className: U.progressChest,
|
|
2545
2545
|
children: [
|
|
2546
2546
|
/* @__PURE__ */ u("div", {
|
|
2547
|
-
className:
|
|
2547
|
+
className: U.barWrap,
|
|
2548
2548
|
children: [/* @__PURE__ */ l("div", {
|
|
2549
|
-
className:
|
|
2549
|
+
className: U.barTrack,
|
|
2550
2550
|
children: /* @__PURE__ */ l("div", {
|
|
2551
|
-
className:
|
|
2551
|
+
className: U.barFill,
|
|
2552
2552
|
style: { width: `${s}%` }
|
|
2553
2553
|
})
|
|
2554
2554
|
}), /* @__PURE__ */ u("span", {
|
|
2555
|
-
className:
|
|
2555
|
+
className: U.pct,
|
|
2556
2556
|
children: [s.toFixed(0), "%"]
|
|
2557
2557
|
})]
|
|
2558
2558
|
}),
|
|
2559
2559
|
/* @__PURE__ */ u("div", {
|
|
2560
|
-
className: `${
|
|
2560
|
+
className: `${U.chest} ${c ? U.open : ""}`,
|
|
2561
2561
|
children: [/* @__PURE__ */ u("div", {
|
|
2562
|
-
className:
|
|
2563
|
-
children: [/* @__PURE__ */ l("div", { className:
|
|
2562
|
+
className: U.lid,
|
|
2563
|
+
children: [/* @__PURE__ */ l("div", { className: U.lidTop }), /* @__PURE__ */ l("div", { className: U.lock })]
|
|
2564
2564
|
}), /* @__PURE__ */ l("div", {
|
|
2565
|
-
className:
|
|
2565
|
+
className: U.body,
|
|
2566
2566
|
children: c && /* @__PURE__ */ u("div", {
|
|
2567
|
-
className:
|
|
2567
|
+
className: U.treasure,
|
|
2568
2568
|
children: [
|
|
2569
2569
|
/* @__PURE__ */ l("span", { children: "💎" }),
|
|
2570
2570
|
/* @__PURE__ */ l("span", { children: "✨" }),
|
|
@@ -2574,15 +2574,15 @@ var P = {
|
|
|
2574
2574
|
})]
|
|
2575
2575
|
}),
|
|
2576
2576
|
/* @__PURE__ */ l("p", {
|
|
2577
|
-
className:
|
|
2577
|
+
className: U.label,
|
|
2578
2578
|
children: c ? "宝箱已开启!" : r
|
|
2579
2579
|
})
|
|
2580
2580
|
]
|
|
2581
2581
|
});
|
|
2582
|
-
},
|
|
2582
|
+
}, vt = {
|
|
2583
2583
|
radarScan: "cos-radarScan-PZaG8",
|
|
2584
2584
|
canvas: "cos-canvas-fUw5N"
|
|
2585
|
-
},
|
|
2585
|
+
}, yt = ({ size: e = 300, color: t = "#22d3ee", blipCount: r = 5 }) => {
|
|
2586
2586
|
let i = o(null), a = o(0), s = o([]), c = o(0);
|
|
2587
2587
|
return n(() => {
|
|
2588
2588
|
s.current = Array.from({ length: r }, () => ({
|
|
@@ -2619,27 +2619,27 @@ var P = {
|
|
|
2619
2619
|
t,
|
|
2620
2620
|
e
|
|
2621
2621
|
]), /* @__PURE__ */ l("div", {
|
|
2622
|
-
className:
|
|
2622
|
+
className: vt.radarScan,
|
|
2623
2623
|
style: {
|
|
2624
2624
|
width: e,
|
|
2625
2625
|
height: e
|
|
2626
2626
|
},
|
|
2627
2627
|
children: /* @__PURE__ */ l("canvas", {
|
|
2628
2628
|
ref: i,
|
|
2629
|
-
className:
|
|
2629
|
+
className: vt.canvas,
|
|
2630
2630
|
style: {
|
|
2631
2631
|
width: e,
|
|
2632
2632
|
height: e
|
|
2633
2633
|
}
|
|
2634
2634
|
})
|
|
2635
2635
|
});
|
|
2636
|
-
},
|
|
2636
|
+
}, W = {
|
|
2637
2637
|
redPacketRain: "cos-redPacketRain-eJ7FW",
|
|
2638
2638
|
canvas: "cos-canvas-direH",
|
|
2639
2639
|
hud: "cos-hud-InqMq",
|
|
2640
2640
|
end: "cos-end-u0J7o",
|
|
2641
2641
|
hint: "cos-hint-sO6ld"
|
|
2642
|
-
},
|
|
2642
|
+
}, bt = ({ duration: e = 1e4, onGrab: r }) => {
|
|
2643
2643
|
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
2644
|
n(() => {
|
|
2645
2645
|
y.current = r;
|
|
@@ -2685,11 +2685,11 @@ var P = {
|
|
|
2685
2685
|
cancelAnimationFrame(c.current), clearTimeout(l), s();
|
|
2686
2686
|
};
|
|
2687
2687
|
}, [e, b]), /* @__PURE__ */ u("div", {
|
|
2688
|
-
className:
|
|
2688
|
+
className: W.redPacketRain,
|
|
2689
2689
|
children: [
|
|
2690
2690
|
/* @__PURE__ */ l("canvas", {
|
|
2691
2691
|
ref: i,
|
|
2692
|
-
className:
|
|
2692
|
+
className: W.canvas,
|
|
2693
2693
|
style: {
|
|
2694
2694
|
width: 400,
|
|
2695
2695
|
height: 500
|
|
@@ -2703,25 +2703,25 @@ var P = {
|
|
|
2703
2703
|
}
|
|
2704
2704
|
}),
|
|
2705
2705
|
/* @__PURE__ */ u("div", {
|
|
2706
|
-
className:
|
|
2706
|
+
className: W.hud,
|
|
2707
2707
|
children: [/* @__PURE__ */ u("span", { children: ["已抢: ¥", p] }), !h && /* @__PURE__ */ l("span", {
|
|
2708
|
-
className:
|
|
2708
|
+
className: W.end,
|
|
2709
2709
|
children: "红包雨结束"
|
|
2710
2710
|
})]
|
|
2711
2711
|
}),
|
|
2712
2712
|
/* @__PURE__ */ l("p", {
|
|
2713
|
-
className:
|
|
2713
|
+
className: W.hint,
|
|
2714
2714
|
children: "点击红包抢夺"
|
|
2715
2715
|
})
|
|
2716
2716
|
]
|
|
2717
2717
|
});
|
|
2718
|
-
},
|
|
2718
|
+
}, G = {
|
|
2719
2719
|
returnCityContainer: "cos-returnCityContainer-6XTxj",
|
|
2720
2720
|
star: "cos-star-a59Dx",
|
|
2721
2721
|
glassWrap: "cos-glassWrap-golMO",
|
|
2722
2722
|
rotate: "cos-rotate-7X9Jj",
|
|
2723
2723
|
glassItem: "cos-glassItem-OwlFI"
|
|
2724
|
-
},
|
|
2724
|
+
}, xt = ({ starCount: e, glassCount: t = 8, glassRadius: r = 150 }) => {
|
|
2725
2725
|
let i = o(null), a = o(null);
|
|
2726
2726
|
return n(() => {
|
|
2727
2727
|
let n = i.current, o = a.current;
|
|
@@ -2730,13 +2730,13 @@ var P = {
|
|
|
2730
2730
|
for (let e = 0; e < f; e++) {
|
|
2731
2731
|
let e = window.setTimeout(() => {
|
|
2732
2732
|
let e = document.createElement("div");
|
|
2733
|
-
e.className =
|
|
2733
|
+
e.className = G.star, e.style.top = `${Math.random() * d}px`, e.style.left = `${Math.random() * u}px`, n.append(e), c.push(e);
|
|
2734
2734
|
}, Math.random() * 2e3);
|
|
2735
2735
|
s.push(e);
|
|
2736
2736
|
}
|
|
2737
2737
|
for (let e = 0; e < t; e++) {
|
|
2738
2738
|
let n = document.createElement("div");
|
|
2739
|
-
n.className =
|
|
2739
|
+
n.className = G.glassItem, n.style.transform = `rotateY(${360 / t * e}deg) translateZ(${r}px)`, o.appendChild(n), l.push(n);
|
|
2740
2740
|
let i = window.setTimeout(() => {
|
|
2741
2741
|
n.style.top = "0px", n.style.opacity = "1";
|
|
2742
2742
|
}, e * 300);
|
|
@@ -2751,16 +2751,16 @@ var P = {
|
|
|
2751
2751
|
r
|
|
2752
2752
|
]), /* @__PURE__ */ l("div", {
|
|
2753
2753
|
ref: i,
|
|
2754
|
-
className:
|
|
2754
|
+
className: G.returnCityContainer,
|
|
2755
2755
|
children: /* @__PURE__ */ l("div", {
|
|
2756
2756
|
ref: a,
|
|
2757
|
-
className:
|
|
2757
|
+
className: G.glassWrap
|
|
2758
2758
|
})
|
|
2759
2759
|
});
|
|
2760
|
-
},
|
|
2760
|
+
}, St = {
|
|
2761
2761
|
ropeChain: "cos-ropeChain-gYaSK",
|
|
2762
2762
|
canvas: "cos-canvas-5i95N"
|
|
2763
|
-
},
|
|
2763
|
+
}, Ct = ({ width: e = 400, height: t = 400, segments: r = 16, color: i = "#38bdf8", gravity: a = .4 }) => {
|
|
2764
2764
|
let s = o(null), c = o([]), u = o({
|
|
2765
2765
|
active: !1,
|
|
2766
2766
|
index: -1
|
|
@@ -2845,21 +2845,21 @@ var P = {
|
|
|
2845
2845
|
r,
|
|
2846
2846
|
e
|
|
2847
2847
|
]), /* @__PURE__ */ l("div", {
|
|
2848
|
-
className:
|
|
2848
|
+
className: St.ropeChain,
|
|
2849
2849
|
style: {
|
|
2850
2850
|
width: e,
|
|
2851
2851
|
height: t
|
|
2852
2852
|
},
|
|
2853
2853
|
children: /* @__PURE__ */ l("canvas", {
|
|
2854
2854
|
ref: s,
|
|
2855
|
-
className:
|
|
2855
|
+
className: St.canvas,
|
|
2856
2856
|
style: {
|
|
2857
2857
|
width: e,
|
|
2858
2858
|
height: t
|
|
2859
2859
|
}
|
|
2860
2860
|
})
|
|
2861
2861
|
});
|
|
2862
|
-
},
|
|
2862
|
+
}, K = {
|
|
2863
2863
|
speedometer: "cos-speedometer-INc7F",
|
|
2864
2864
|
svg: "cos-svg-HG-lE",
|
|
2865
2865
|
track: "cos-track-5-922",
|
|
@@ -2869,37 +2869,37 @@ var P = {
|
|
|
2869
2869
|
hub: "cos-hub-4WaHw",
|
|
2870
2870
|
valueText: "cos-valueText--q4Xi",
|
|
2871
2871
|
label: "cos-label-hOPy1"
|
|
2872
|
-
},
|
|
2872
|
+
}, q = (e, t, n, r) => {
|
|
2873
2873
|
let i = (r - 90) * Math.PI / 180;
|
|
2874
2874
|
return {
|
|
2875
2875
|
x: e + n * Math.cos(i),
|
|
2876
2876
|
y: t + n * Math.sin(i)
|
|
2877
2877
|
};
|
|
2878
|
-
},
|
|
2878
|
+
}, wt = ({ value: e = 0, max: t = 100, label: n = "SPEED", color: r = "#f97316" }) => {
|
|
2879
2879
|
let i = -120 + y(t > 0 ? e / t : 0, 0, 1) * 240, o = a(() => {
|
|
2880
|
-
let e =
|
|
2880
|
+
let e = q(100, 100, 72, -120), t = q(100, 100, 72, 120);
|
|
2881
2881
|
return `M ${e.x} ${e.y} A 72 72 0 1 1 ${t.x} ${t.y}`;
|
|
2882
2882
|
}, []), s = a(() => {
|
|
2883
|
-
let e =
|
|
2883
|
+
let e = q(100, 100, 72, -120), t = q(100, 100, 72, i), n = +(i - -120 > 180);
|
|
2884
2884
|
return `M ${e.x} ${e.y} A 72 72 0 ${n} 1 ${t.x} ${t.y}`;
|
|
2885
|
-
}, [i]), c =
|
|
2885
|
+
}, [i]), c = q(100, 100, 58, i);
|
|
2886
2886
|
return /* @__PURE__ */ u("div", {
|
|
2887
|
-
className:
|
|
2887
|
+
className: K.speedometer,
|
|
2888
2888
|
style: { "--gauge-color": r },
|
|
2889
2889
|
children: [/* @__PURE__ */ u("svg", {
|
|
2890
2890
|
viewBox: "0 0 200 130",
|
|
2891
|
-
className:
|
|
2891
|
+
className: K.svg,
|
|
2892
2892
|
children: [
|
|
2893
2893
|
/* @__PURE__ */ l("path", {
|
|
2894
2894
|
d: o,
|
|
2895
|
-
className:
|
|
2895
|
+
className: K.track,
|
|
2896
2896
|
fill: "none",
|
|
2897
2897
|
strokeWidth: "12",
|
|
2898
2898
|
strokeLinecap: "round"
|
|
2899
2899
|
}),
|
|
2900
2900
|
/* @__PURE__ */ l("path", {
|
|
2901
2901
|
d: s,
|
|
2902
|
-
className:
|
|
2902
|
+
className: K.valueArc,
|
|
2903
2903
|
fill: "none",
|
|
2904
2904
|
strokeWidth: "12",
|
|
2905
2905
|
strokeLinecap: "round"
|
|
@@ -2911,13 +2911,13 @@ var P = {
|
|
|
2911
2911
|
60,
|
|
2912
2912
|
120
|
|
2913
2913
|
].map((e) => {
|
|
2914
|
-
let t =
|
|
2914
|
+
let t = q(100, 100, 58, e), n = q(100, 100, 66, e);
|
|
2915
2915
|
return /* @__PURE__ */ l("line", {
|
|
2916
2916
|
x1: t.x,
|
|
2917
2917
|
y1: t.y,
|
|
2918
2918
|
x2: n.x,
|
|
2919
2919
|
y2: n.y,
|
|
2920
|
-
className:
|
|
2920
|
+
className: K.tick
|
|
2921
2921
|
}, e);
|
|
2922
2922
|
}),
|
|
2923
2923
|
/* @__PURE__ */ l("line", {
|
|
@@ -2925,27 +2925,27 @@ var P = {
|
|
|
2925
2925
|
y1: "100",
|
|
2926
2926
|
x2: c.x,
|
|
2927
2927
|
y2: c.y,
|
|
2928
|
-
className:
|
|
2928
|
+
className: K.needle
|
|
2929
2929
|
}),
|
|
2930
2930
|
/* @__PURE__ */ l("circle", {
|
|
2931
2931
|
cx: "100",
|
|
2932
2932
|
cy: "100",
|
|
2933
2933
|
r: "6",
|
|
2934
|
-
className:
|
|
2934
|
+
className: K.hub
|
|
2935
2935
|
}),
|
|
2936
2936
|
/* @__PURE__ */ l("text", {
|
|
2937
2937
|
x: "100",
|
|
2938
2938
|
y: "118",
|
|
2939
|
-
className:
|
|
2939
|
+
className: K.valueText,
|
|
2940
2940
|
children: Math.round(e)
|
|
2941
2941
|
})
|
|
2942
2942
|
]
|
|
2943
2943
|
}), /* @__PURE__ */ l("span", {
|
|
2944
|
-
className:
|
|
2944
|
+
className: K.label,
|
|
2945
2945
|
children: n
|
|
2946
2946
|
})]
|
|
2947
2947
|
});
|
|
2948
|
-
},
|
|
2948
|
+
}, J = {
|
|
2949
2949
|
timelinePulse: "cos-timelinePulse-kcBM6",
|
|
2950
2950
|
axis: "cos-axis-9DWis",
|
|
2951
2951
|
track: "cos-track-jG-HV",
|
|
@@ -2955,7 +2955,7 @@ var P = {
|
|
|
2955
2955
|
dot: "cos-dot-HJEVy",
|
|
2956
2956
|
pulse: "cos-pulse-N6FD1",
|
|
2957
2957
|
name: "cos-name-7zefJ"
|
|
2958
|
-
},
|
|
2958
|
+
}, Tt = ({ steps: e = [
|
|
2959
2959
|
"Start",
|
|
2960
2960
|
"Process",
|
|
2961
2961
|
"Review",
|
|
@@ -2963,26 +2963,26 @@ var P = {
|
|
|
2963
2963
|
], current: t = 0, color: n = "#22d3ee" }) => {
|
|
2964
2964
|
let r = y(t, 0, Math.max(0, e.length - 1)), i = e.length > 1 ? r / (e.length - 1) : 0;
|
|
2965
2965
|
return /* @__PURE__ */ l("div", {
|
|
2966
|
-
className:
|
|
2966
|
+
className: J.timelinePulse,
|
|
2967
2967
|
style: {
|
|
2968
2968
|
"--pulse-color": n,
|
|
2969
2969
|
"--step-count": e.length,
|
|
2970
2970
|
"--progress-ratio": i
|
|
2971
2971
|
},
|
|
2972
2972
|
children: /* @__PURE__ */ u("div", {
|
|
2973
|
-
className:
|
|
2973
|
+
className: J.axis,
|
|
2974
2974
|
children: [
|
|
2975
|
-
/* @__PURE__ */ l("div", { className:
|
|
2976
|
-
/* @__PURE__ */ l("div", { className:
|
|
2975
|
+
/* @__PURE__ */ l("div", { className: J.track }),
|
|
2976
|
+
/* @__PURE__ */ l("div", { className: J.progress }),
|
|
2977
2977
|
/* @__PURE__ */ l("ul", {
|
|
2978
|
-
className:
|
|
2978
|
+
className: J.steps,
|
|
2979
2979
|
children: e.map((e, t) => {
|
|
2980
2980
|
let n = t < r ? "done" : t === r ? "current" : "pending";
|
|
2981
2981
|
return /* @__PURE__ */ u("li", {
|
|
2982
|
-
className:
|
|
2982
|
+
className: J.step,
|
|
2983
2983
|
"data-state": n,
|
|
2984
|
-
children: [/* @__PURE__ */ l("span", { className:
|
|
2985
|
-
className:
|
|
2984
|
+
children: [/* @__PURE__ */ l("span", { className: J.dot }), /* @__PURE__ */ l("span", {
|
|
2985
|
+
className: J.name,
|
|
2986
2986
|
children: e
|
|
2987
2987
|
})]
|
|
2988
2988
|
}, e + t);
|
|
@@ -2991,83 +2991,195 @@ var P = {
|
|
|
2991
2991
|
]
|
|
2992
2992
|
})
|
|
2993
2993
|
});
|
|
2994
|
-
},
|
|
2994
|
+
}, Et = {
|
|
2995
2995
|
rippleWater: "cos-rippleWater-wsinI",
|
|
2996
2996
|
canvas: "cos-canvas-XOdSF",
|
|
2997
2997
|
hint: "cos-hint-0JH5D"
|
|
2998
|
-
},
|
|
2999
|
-
let
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
2998
|
+
}, Dt = "\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", Ot = "\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", kt = (e) => {
|
|
2999
|
+
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = Number.parseInt(n, 16);
|
|
3000
|
+
return Number.isNaN(r) ? [
|
|
3001
|
+
.22,
|
|
3002
|
+
.74,
|
|
3003
|
+
.97
|
|
3004
|
+
] : [
|
|
3005
|
+
(r >> 16 & 255) / 255,
|
|
3006
|
+
(r >> 8 & 255) / 255,
|
|
3007
|
+
(r & 255) / 255
|
|
3008
|
+
];
|
|
3009
|
+
}, At = (e, t, n) => {
|
|
3010
|
+
let r = e.createShader(t);
|
|
3011
|
+
return r ? (e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (e.deleteShader(r), null)) : null;
|
|
3012
|
+
}, jt = (e, t, n) => {
|
|
3013
|
+
let r = At(e, e.VERTEX_SHADER, t), i = At(e, e.FRAGMENT_SHADER, n);
|
|
3014
|
+
if (!r || !i) return null;
|
|
3015
|
+
let a = e.createProgram();
|
|
3016
|
+
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;
|
|
3017
|
+
}, Y = 192, Mt = ({ 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 = "点击水面产生涟漪" }) => {
|
|
3018
|
+
let C = o(null), w = o(0), T = o(null), E = o({
|
|
3019
|
+
fromColor: i,
|
|
3020
|
+
toColor: a,
|
|
3021
|
+
color: s,
|
|
3022
|
+
waveAmplitude: c,
|
|
3023
|
+
waveSpeed: d,
|
|
3024
|
+
shimmer: f,
|
|
3025
|
+
reflection: p,
|
|
3026
|
+
rippleStrength: m,
|
|
3027
|
+
rippleRadius: h,
|
|
3028
|
+
damping: g,
|
|
3029
|
+
spread: _,
|
|
3030
|
+
interactive: b
|
|
3031
|
+
});
|
|
3032
|
+
n(() => {
|
|
3033
|
+
E.current = {
|
|
3034
|
+
fromColor: i,
|
|
3035
|
+
toColor: a,
|
|
3036
|
+
color: s,
|
|
3037
|
+
waveAmplitude: c,
|
|
3038
|
+
waveSpeed: d,
|
|
3039
|
+
shimmer: f,
|
|
3040
|
+
reflection: p,
|
|
3041
|
+
rippleStrength: m,
|
|
3042
|
+
rippleRadius: h,
|
|
3043
|
+
damping: g,
|
|
3044
|
+
spread: _,
|
|
3045
|
+
interactive: b
|
|
3046
|
+
};
|
|
3047
|
+
}, [
|
|
3048
|
+
i,
|
|
3049
|
+
a,
|
|
3050
|
+
s,
|
|
3051
|
+
c,
|
|
3052
|
+
d,
|
|
3053
|
+
f,
|
|
3054
|
+
p,
|
|
3055
|
+
m,
|
|
3056
|
+
h,
|
|
3057
|
+
g,
|
|
3058
|
+
_,
|
|
3059
|
+
b
|
|
3060
|
+
]);
|
|
3061
|
+
let D = t((e, t) => {
|
|
3062
|
+
if (!E.current.interactive) return;
|
|
3063
|
+
let n = C.current;
|
|
3064
|
+
if (!n) return;
|
|
3065
|
+
let r = n.getBoundingClientRect();
|
|
3066
|
+
T.current = {
|
|
3067
|
+
x: (e - r.left) / r.width,
|
|
3068
|
+
y: 1 - (t - r.top) / r.height,
|
|
3069
|
+
strength: E.current.rippleStrength
|
|
3070
|
+
};
|
|
3071
|
+
}, []);
|
|
3011
3072
|
return n(() => {
|
|
3012
|
-
let e =
|
|
3073
|
+
let e = C.current;
|
|
3013
3074
|
if (!e) return;
|
|
3014
|
-
let t = (e) =>
|
|
3075
|
+
let t = (e) => D(e.clientX, e.clientY), n = (e) => {
|
|
3015
3076
|
let t = e.touches[0];
|
|
3016
|
-
t &&
|
|
3077
|
+
t && D(t.clientX, t.clientY);
|
|
3017
3078
|
};
|
|
3018
3079
|
return e.addEventListener("click", t), e.addEventListener("touchstart", n, { passive: !0 }), () => {
|
|
3019
3080
|
e.removeEventListener("click", t), e.removeEventListener("touchstart", n);
|
|
3020
3081
|
};
|
|
3021
|
-
}, [
|
|
3022
|
-
let t =
|
|
3082
|
+
}, [D]), n(() => {
|
|
3083
|
+
let t = C.current;
|
|
3023
3084
|
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
|
-
|
|
3085
|
+
let n = Math.min(window.devicePixelRatio || 1, 2);
|
|
3086
|
+
t.width = Math.floor(e * n), t.height = Math.floor(r * n);
|
|
3087
|
+
let i = t.getContext("webgl", {
|
|
3088
|
+
alpha: !1,
|
|
3089
|
+
antialias: !1,
|
|
3090
|
+
depth: !1,
|
|
3091
|
+
stencil: !1,
|
|
3092
|
+
premultipliedAlpha: !1
|
|
3093
|
+
});
|
|
3094
|
+
if (!i) return;
|
|
3095
|
+
let a = jt(i, Dt, Ot);
|
|
3096
|
+
if (!a) return;
|
|
3097
|
+
let o = i.createBuffer();
|
|
3098
|
+
i.bindBuffer(i.ARRAY_BUFFER, o), i.bufferData(i.ARRAY_BUFFER, new Float32Array([
|
|
3099
|
+
-1,
|
|
3100
|
+
-1,
|
|
3101
|
+
1,
|
|
3102
|
+
-1,
|
|
3103
|
+
-1,
|
|
3104
|
+
1,
|
|
3105
|
+
1,
|
|
3106
|
+
1
|
|
3107
|
+
]), i.STATIC_DRAW);
|
|
3108
|
+
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();
|
|
3109
|
+
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);
|
|
3110
|
+
let A = new Uint8Array(x * 4), j = () => {
|
|
3111
|
+
for (let e = 0; e < x; e++) {
|
|
3112
|
+
let t = Math.max(0, Math.min(255, Math.floor((D[e] * .5 + .5) * 255))), n = e * 4;
|
|
3113
|
+
A[n] = t, A[n + 1] = t, A[n + 2] = t, A[n + 3] = 255;
|
|
3114
|
+
}
|
|
3115
|
+
i.bindTexture(i.TEXTURE_2D, k), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, Y, Y, 0, i.RGBA, i.UNSIGNED_BYTE, A);
|
|
3116
|
+
}, M = (e, t, n, r) => {
|
|
3117
|
+
let i = e * (Y - 1), a = t * (Y - 1), o = y(r, 2, 12);
|
|
3118
|
+
for (let e = -o - 1; e <= o + 1; e++) for (let t = -o - 1; t <= o + 1; t++) {
|
|
3119
|
+
let r = Math.round(i + t), s = Math.round(a + e);
|
|
3120
|
+
if (r <= 0 || r >= Y - 1 || s <= 0 || s >= Y - 1) continue;
|
|
3121
|
+
let c = Math.sqrt(t * t + e * e), l = Math.exp(-c * c * .55) * -.35, u = Math.exp(-((c - o * .55) ** 2) * .9);
|
|
3122
|
+
D[s * Y + r] += n * (l + u * 1.1);
|
|
3123
|
+
}
|
|
3124
|
+
}, N = (e, t) => {
|
|
3125
|
+
let n = y(e, .9, .999), r = y(t, .3, .7);
|
|
3126
|
+
for (let e = 0; e < 2; e++) {
|
|
3127
|
+
for (let e = 1; e < Y - 1; e++) {
|
|
3128
|
+
let t = e * Y;
|
|
3129
|
+
for (let e = 1; e < Y - 1; e++) {
|
|
3130
|
+
let i = t + e, a = D[i - 1] + D[i + 1] + D[i - Y] + D[i + Y];
|
|
3131
|
+
O[i] = (a * r - S[i]) * n, O[i] > 1.5 ? O[i] = 1.5 : O[i] < -1.5 && (O[i] = -1.5);
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
let e = S;
|
|
3135
|
+
S = D, D = O, O = e, O.fill(0);
|
|
3136
|
+
}
|
|
3137
|
+
}, P = document.hidden, ee = v((e) => {
|
|
3138
|
+
P = e;
|
|
3139
|
+
}), te = performance.now();
|
|
3140
|
+
j();
|
|
3141
|
+
let F = (e) => {
|
|
3142
|
+
if (w.current = requestAnimationFrame(F), P) return;
|
|
3143
|
+
let n = E.current;
|
|
3144
|
+
if (T.current) {
|
|
3145
|
+
let e = T.current, t = y(e.strength, 0, 3), r = n.rippleRadius;
|
|
3146
|
+
M(e.x, e.y, t, r), M(e.x + .004, e.y - .003, t * .35, r), T.current = null;
|
|
3147
|
+
}
|
|
3148
|
+
N(n.damping, n.spread), j();
|
|
3149
|
+
let r = kt(n.color), v = kt(n.fromColor), x = kt(n.toColor);
|
|
3150
|
+
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 - te) / 1e3), i.uniform2f(l, t.width, t.height), i.uniform3f(u, r[0], r[1], r[2]), i.uniform3f(d, v[0], v[1], v[2]), i.uniform3f(f, x[0], x[1], x[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
3151
|
};
|
|
3037
|
-
return
|
|
3038
|
-
cancelAnimationFrame(
|
|
3152
|
+
return w.current = requestAnimationFrame(F), () => {
|
|
3153
|
+
cancelAnimationFrame(w.current), ee(), i.deleteTexture(k), i.deleteBuffer(o), i.deleteProgram(a);
|
|
3039
3154
|
};
|
|
3040
|
-
}, [
|
|
3041
|
-
|
|
3042
|
-
r,
|
|
3043
|
-
e
|
|
3044
|
-
]), /* @__PURE__ */ u("div", {
|
|
3045
|
-
className: Ot.rippleWater,
|
|
3155
|
+
}, [r, e]), /* @__PURE__ */ u("div", {
|
|
3156
|
+
className: Et.rippleWater,
|
|
3046
3157
|
style: {
|
|
3047
3158
|
width: e,
|
|
3048
3159
|
height: r
|
|
3049
3160
|
},
|
|
3050
3161
|
children: [/* @__PURE__ */ l("canvas", {
|
|
3051
|
-
ref:
|
|
3052
|
-
className:
|
|
3162
|
+
ref: C,
|
|
3163
|
+
className: Et.canvas,
|
|
3053
3164
|
style: {
|
|
3054
3165
|
width: e,
|
|
3055
|
-
height: r
|
|
3166
|
+
height: r,
|
|
3167
|
+
cursor: b ? "pointer" : "default"
|
|
3056
3168
|
}
|
|
3057
|
-
}), /* @__PURE__ */ l("span", {
|
|
3058
|
-
className:
|
|
3059
|
-
children:
|
|
3060
|
-
})]
|
|
3169
|
+
}), x ? /* @__PURE__ */ l("span", {
|
|
3170
|
+
className: Et.hint,
|
|
3171
|
+
children: S
|
|
3172
|
+
}) : null]
|
|
3061
3173
|
});
|
|
3062
|
-
},
|
|
3174
|
+
}, Nt = {
|
|
3063
3175
|
scrambleText: "cos-scrambleText-hN4Wm",
|
|
3064
3176
|
text: "cos-text-frsHs",
|
|
3065
3177
|
cursor: "cos-cursor-3zQOy",
|
|
3066
3178
|
blink: "cos-blink-OcKXu"
|
|
3067
|
-
},
|
|
3179
|
+
}, Pt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*", Ft = ({ text: e = "DECRYPTED", duration: t = 2e3, charset: r = Pt }) => {
|
|
3068
3180
|
let [i, a] = s(""), c = o(0), d = o(0);
|
|
3069
3181
|
return n(() => {
|
|
3070
|
-
let n = r.length > 0 ? r :
|
|
3182
|
+
let n = r.length > 0 ? r : Pt, i = e;
|
|
3071
3183
|
d.current = performance.now();
|
|
3072
3184
|
let o = (e) => {
|
|
3073
3185
|
let r = e - d.current, s = Math.min(r / t, 1), l = Math.floor(s * i.length);
|
|
@@ -3079,18 +3191,18 @@ var P = {
|
|
|
3079
3191
|
t,
|
|
3080
3192
|
r
|
|
3081
3193
|
]), /* @__PURE__ */ l("div", {
|
|
3082
|
-
className:
|
|
3194
|
+
className: Nt.scrambleText,
|
|
3083
3195
|
children: /* @__PURE__ */ u("p", {
|
|
3084
|
-
className:
|
|
3085
|
-
children: [i, /* @__PURE__ */ l("span", { className:
|
|
3196
|
+
className: Nt.text,
|
|
3197
|
+
children: [i, /* @__PURE__ */ l("span", { className: Nt.cursor })]
|
|
3086
3198
|
})
|
|
3087
3199
|
});
|
|
3088
|
-
},
|
|
3200
|
+
}, It = {
|
|
3089
3201
|
scratchCard: "cos-scratchCard-McIEK",
|
|
3090
3202
|
prize: "cos-prize-X0z5V",
|
|
3091
3203
|
canvas: "cos-canvas-JqIlr",
|
|
3092
3204
|
hidden: "cos-hidden-Lsfbt"
|
|
3093
|
-
},
|
|
3205
|
+
}, Lt = ({ coverColor: e = "#94a3b8", prize: r = "🎉 恭喜中奖!", onReveal: i, width: a = 300, height: c = 180 }) => {
|
|
3094
3206
|
let d = o(null), f = o(!1), p = o(!1), m = o(i), [h, g] = s(!1);
|
|
3095
3207
|
n(() => {
|
|
3096
3208
|
m.current = i;
|
|
@@ -3153,17 +3265,17 @@ var P = {
|
|
|
3153
3265
|
f.current = !1;
|
|
3154
3266
|
};
|
|
3155
3267
|
return /* @__PURE__ */ u("div", {
|
|
3156
|
-
className:
|
|
3268
|
+
className: It.scratchCard,
|
|
3157
3269
|
style: {
|
|
3158
3270
|
width: a,
|
|
3159
3271
|
height: c
|
|
3160
3272
|
},
|
|
3161
3273
|
children: [/* @__PURE__ */ l("div", {
|
|
3162
|
-
className:
|
|
3274
|
+
className: It.prize,
|
|
3163
3275
|
children: r
|
|
3164
3276
|
}), /* @__PURE__ */ l("canvas", {
|
|
3165
3277
|
ref: d,
|
|
3166
|
-
className: `${
|
|
3278
|
+
className: `${It.canvas} ${h ? It.hidden : ""}`,
|
|
3167
3279
|
style: {
|
|
3168
3280
|
width: a,
|
|
3169
3281
|
height: c
|
|
@@ -3177,7 +3289,7 @@ var P = {
|
|
|
3177
3289
|
onTouchEnd: C
|
|
3178
3290
|
})]
|
|
3179
3291
|
});
|
|
3180
|
-
},
|
|
3292
|
+
}, X = {
|
|
3181
3293
|
slotMachine: "cos-slotMachine-P6FyZ",
|
|
3182
3294
|
machine: "cos-machine-B066r",
|
|
3183
3295
|
reel: "cos-reel-eEpJ3",
|
|
@@ -3186,14 +3298,14 @@ var P = {
|
|
|
3186
3298
|
mask: "cos-mask-jdrj3",
|
|
3187
3299
|
spinBtn: "cos-spinBtn-DvDE7",
|
|
3188
3300
|
result: "cos-result-dLN5b"
|
|
3189
|
-
},
|
|
3301
|
+
}, Rt = [
|
|
3190
3302
|
"🍒",
|
|
3191
3303
|
"🍋",
|
|
3192
3304
|
"🍊",
|
|
3193
3305
|
"🍇",
|
|
3194
3306
|
"⭐",
|
|
3195
3307
|
"7️⃣"
|
|
3196
|
-
],
|
|
3308
|
+
], zt = (e) => 1 - (1 - e) ** 3, Bt = ({ symbols: e = Rt, onSpinEnd: r }) => {
|
|
3197
3309
|
let [i, a] = s(!1), [c, d] = s([
|
|
3198
3310
|
0,
|
|
3199
3311
|
0,
|
|
@@ -3210,31 +3322,31 @@ var P = {
|
|
|
3210
3322
|
return n(() => () => {
|
|
3211
3323
|
g.current && (g.current.cancelled = !0), cancelAnimationFrame(m.current);
|
|
3212
3324
|
}, []), /* @__PURE__ */ u("div", {
|
|
3213
|
-
className:
|
|
3325
|
+
className: X.slotMachine,
|
|
3214
3326
|
children: [
|
|
3215
3327
|
/* @__PURE__ */ l("div", {
|
|
3216
|
-
className:
|
|
3328
|
+
className: X.machine,
|
|
3217
3329
|
children: [
|
|
3218
3330
|
0,
|
|
3219
3331
|
1,
|
|
3220
3332
|
2
|
|
3221
3333
|
].map((e) => /* @__PURE__ */ u("div", {
|
|
3222
|
-
className:
|
|
3334
|
+
className: X.reel,
|
|
3223
3335
|
style: { height: 240 },
|
|
3224
3336
|
children: [/* @__PURE__ */ l("div", {
|
|
3225
|
-
className:
|
|
3337
|
+
className: X.strip,
|
|
3226
3338
|
style: { transform: `translateY(${c[e]}px)` },
|
|
3227
3339
|
children: _.map((e, t) => /* @__PURE__ */ l("div", {
|
|
3228
|
-
className:
|
|
3340
|
+
className: X.item,
|
|
3229
3341
|
style: { height: 80 },
|
|
3230
3342
|
children: e
|
|
3231
3343
|
}, t))
|
|
3232
|
-
}), /* @__PURE__ */ l("div", { className:
|
|
3344
|
+
}), /* @__PURE__ */ l("div", { className: X.mask })]
|
|
3233
3345
|
}, e))
|
|
3234
3346
|
}),
|
|
3235
3347
|
/* @__PURE__ */ l("button", {
|
|
3236
3348
|
type: "button",
|
|
3237
|
-
className:
|
|
3349
|
+
className: X.spinBtn,
|
|
3238
3350
|
onClick: () => {
|
|
3239
3351
|
if (i) return;
|
|
3240
3352
|
a(!0), p([]);
|
|
@@ -3253,7 +3365,7 @@ var P = {
|
|
|
3253
3365
|
if (d(r.map((e, t) => {
|
|
3254
3366
|
let r = i - l - s[t];
|
|
3255
3367
|
if (r < 0) return e;
|
|
3256
|
-
let a =
|
|
3368
|
+
let a = zt(Math.min(r / o, 1));
|
|
3257
3369
|
return e + (n[t] - e) * a;
|
|
3258
3370
|
})), !s.every((e) => i - l - e >= o)) m.current = requestAnimationFrame(f);
|
|
3259
3371
|
else if (!u.cancelled) {
|
|
@@ -3268,12 +3380,12 @@ var P = {
|
|
|
3268
3380
|
children: i ? "旋转中..." : "开始"
|
|
3269
3381
|
}),
|
|
3270
3382
|
f.length > 0 && !i && /* @__PURE__ */ l("p", {
|
|
3271
|
-
className:
|
|
3383
|
+
className: X.result,
|
|
3272
3384
|
children: f[0] === f[1] && f[1] === f[2] ? "🎰 大奖!" : `结果: ${f.join(" ")}`
|
|
3273
3385
|
})
|
|
3274
3386
|
]
|
|
3275
3387
|
});
|
|
3276
|
-
},
|
|
3388
|
+
}, Vt = {
|
|
3277
3389
|
splitReveal: "cos-splitReveal-6W8-6",
|
|
3278
3390
|
text: "cos-text-miTsj",
|
|
3279
3391
|
char: "cos-char-0gPJV",
|
|
@@ -3282,27 +3394,27 @@ var P = {
|
|
|
3282
3394
|
fromBottom: "cos-fromBottom-24D6g",
|
|
3283
3395
|
fromLeft: "cos-fromLeft-OMiPY",
|
|
3284
3396
|
fromRight: "cos-fromRight-EcMOR"
|
|
3285
|
-
},
|
|
3397
|
+
}, Ht = [
|
|
3286
3398
|
"fromTop",
|
|
3287
3399
|
"fromBottom",
|
|
3288
3400
|
"fromLeft",
|
|
3289
3401
|
"fromRight"
|
|
3290
|
-
],
|
|
3291
|
-
className:
|
|
3402
|
+
], Ut = ({ text: e = "REVEAL", delay: t = 80, color: n = "#f8fafc" }) => /* @__PURE__ */ l("div", {
|
|
3403
|
+
className: Vt.splitReveal,
|
|
3292
3404
|
children: /* @__PURE__ */ l("h1", {
|
|
3293
|
-
className:
|
|
3405
|
+
className: Vt.text,
|
|
3294
3406
|
style: { "--reveal-color": n },
|
|
3295
3407
|
children: e.split("").map((e, n) => /* @__PURE__ */ l("span", {
|
|
3296
|
-
className: `${
|
|
3408
|
+
className: `${Vt.char} ${Vt[Ht[n % Ht.length]]}`,
|
|
3297
3409
|
style: { animationDelay: `${n * t}ms` },
|
|
3298
3410
|
children: e === " " ? "\xA0" : e
|
|
3299
3411
|
}, `${e}-${n}`))
|
|
3300
3412
|
})
|
|
3301
|
-
}),
|
|
3413
|
+
}), Wt = {
|
|
3302
3414
|
spotlight: "cos-spotlight-OddY1",
|
|
3303
3415
|
content: "cos-content-5I1Wy",
|
|
3304
3416
|
overlay: "cos-overlay-F6CJ5"
|
|
3305
|
-
},
|
|
3417
|
+
}, Gt = ({ children: e, radius: n = 120, dimColor: r = "rgba(0, 0, 0, 0.85)" }) => {
|
|
3306
3418
|
let i = o(null), a = t((e) => {
|
|
3307
3419
|
let t = i.current;
|
|
3308
3420
|
if (!t) return;
|
|
@@ -3311,18 +3423,18 @@ var P = {
|
|
|
3311
3423
|
}, []);
|
|
3312
3424
|
return /* @__PURE__ */ u("div", {
|
|
3313
3425
|
ref: i,
|
|
3314
|
-
className:
|
|
3426
|
+
className: Wt.spotlight,
|
|
3315
3427
|
style: {
|
|
3316
3428
|
"--spot-radius": `${n}px`,
|
|
3317
3429
|
"--dim-color": r
|
|
3318
3430
|
},
|
|
3319
3431
|
onMouseMove: a,
|
|
3320
3432
|
children: [/* @__PURE__ */ l("div", {
|
|
3321
|
-
className:
|
|
3433
|
+
className: Wt.content,
|
|
3322
3434
|
children: e
|
|
3323
|
-
}), /* @__PURE__ */ l("div", { className:
|
|
3435
|
+
}), /* @__PURE__ */ l("div", { className: Wt.overlay })]
|
|
3324
3436
|
});
|
|
3325
|
-
},
|
|
3437
|
+
}, Z = {
|
|
3326
3438
|
turntable: "cos-turntable-dkc32",
|
|
3327
3439
|
wheelWrap: "cos-wheelWrap-n7lhc",
|
|
3328
3440
|
canvas: "cos-canvas-A1-4x",
|
|
@@ -3330,7 +3442,7 @@ var P = {
|
|
|
3330
3442
|
spinBtn: "cos-spinBtn-l9JIC",
|
|
3331
3443
|
result: "cos-result-H8q2c",
|
|
3332
3444
|
"fade-in": "cos-fade-in-U9bUC"
|
|
3333
|
-
},
|
|
3445
|
+
}, Kt = [
|
|
3334
3446
|
"#FF6B6B",
|
|
3335
3447
|
"#4ECDC4",
|
|
3336
3448
|
"#FFE66D",
|
|
@@ -3339,19 +3451,19 @@ var P = {
|
|
|
3339
3451
|
"#F472B6",
|
|
3340
3452
|
"#34D399",
|
|
3341
3453
|
"#FB923C"
|
|
3342
|
-
],
|
|
3454
|
+
], qt = [
|
|
3343
3455
|
{ label: "一等奖" },
|
|
3344
3456
|
{ label: "二等奖" },
|
|
3345
3457
|
{ label: "三等奖" },
|
|
3346
3458
|
{ label: "谢谢参与" },
|
|
3347
3459
|
{ label: "优惠券" },
|
|
3348
3460
|
{ label: "再来一次" }
|
|
3349
|
-
],
|
|
3461
|
+
], Jt = (e) => 1 - (1 - e) ** 3, Yt = ({ prizes: e = qt, size: r = 360, spinDuration: i = 4e3, spinRounds: a = 5, buttonText: c = "开始抽奖", onSpinEnd: d }) => {
|
|
3350
3462
|
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
3463
|
n(() => {
|
|
3352
3464
|
b.current = d;
|
|
3353
3465
|
}, [d]);
|
|
3354
|
-
let S = r + 48, C = (e, t) => t.color ??
|
|
3466
|
+
let S = r + 48, C = (e, t) => t.color ?? Kt[e % Kt.length], w = t((t) => {
|
|
3355
3467
|
let n = f.current;
|
|
3356
3468
|
if (!n) return;
|
|
3357
3469
|
let i = n.getContext("2d");
|
|
@@ -3386,22 +3498,22 @@ var P = {
|
|
|
3386
3498
|
return Math.floor((360 - r + n / 2) % 360 / n) % e.length;
|
|
3387
3499
|
};
|
|
3388
3500
|
return /* @__PURE__ */ u("div", {
|
|
3389
|
-
className:
|
|
3501
|
+
className: Z.turntable,
|
|
3390
3502
|
style: {
|
|
3391
3503
|
width: S,
|
|
3392
3504
|
height: S + 80
|
|
3393
3505
|
},
|
|
3394
3506
|
children: [/* @__PURE__ */ u("div", {
|
|
3395
|
-
className:
|
|
3507
|
+
className: Z.wheelWrap,
|
|
3396
3508
|
style: {
|
|
3397
3509
|
width: S,
|
|
3398
3510
|
height: S
|
|
3399
3511
|
},
|
|
3400
3512
|
children: [
|
|
3401
|
-
/* @__PURE__ */ l("div", { className:
|
|
3513
|
+
/* @__PURE__ */ l("div", { className: Z.pointer }),
|
|
3402
3514
|
/* @__PURE__ */ l("canvas", {
|
|
3403
3515
|
ref: f,
|
|
3404
|
-
className:
|
|
3516
|
+
className: Z.canvas,
|
|
3405
3517
|
style: {
|
|
3406
3518
|
width: S,
|
|
3407
3519
|
height: S
|
|
@@ -3409,7 +3521,7 @@ var P = {
|
|
|
3409
3521
|
}),
|
|
3410
3522
|
/* @__PURE__ */ l("button", {
|
|
3411
3523
|
type: "button",
|
|
3412
|
-
className:
|
|
3524
|
+
className: Z.spinBtn,
|
|
3413
3525
|
onClick: () => {
|
|
3414
3526
|
if (g || e.length === 0) return;
|
|
3415
3527
|
_(!0), y(null);
|
|
@@ -3417,7 +3529,7 @@ var P = {
|
|
|
3417
3529
|
x.current = l;
|
|
3418
3530
|
let u = (t) => {
|
|
3419
3531
|
if (l.cancelled) return;
|
|
3420
|
-
let n = t - c, r = Math.min(n / i, 1), a =
|
|
3532
|
+
let n = t - c, r = Math.min(n / i, 1), a = Jt(r), d = s + (o - s) * a;
|
|
3421
3533
|
if (p.current = d, w(d), r < 1) m.current = requestAnimationFrame(u);
|
|
3422
3534
|
else if (!l.cancelled) {
|
|
3423
3535
|
let t = T(d), n = e[t];
|
|
@@ -3431,11 +3543,11 @@ var P = {
|
|
|
3431
3543
|
})
|
|
3432
3544
|
]
|
|
3433
3545
|
}), v && !g && /* @__PURE__ */ u("p", {
|
|
3434
|
-
className:
|
|
3546
|
+
className: Z.result,
|
|
3435
3547
|
children: ["恭喜获得:", /* @__PURE__ */ l("strong", { children: v.label })]
|
|
3436
3548
|
})]
|
|
3437
3549
|
});
|
|
3438
|
-
},
|
|
3550
|
+
}, Q = {
|
|
3439
3551
|
typewriter: "cos-typewriter-7UhOL",
|
|
3440
3552
|
terminal: "cos-terminal-NWNVN",
|
|
3441
3553
|
dots: "cos-dots-oulNg",
|
|
@@ -3443,11 +3555,11 @@ var P = {
|
|
|
3443
3555
|
prompt: "cos-prompt-Y4hVD",
|
|
3444
3556
|
cursor: "cos-cursor-m8hGi",
|
|
3445
3557
|
blink: "cos-blink-XykM7"
|
|
3446
|
-
},
|
|
3558
|
+
}, Xt = [
|
|
3447
3559
|
"Hello, cos-design!",
|
|
3448
3560
|
"欢迎来到组件库 ✨",
|
|
3449
3561
|
"Build something fun 🚀"
|
|
3450
|
-
],
|
|
3562
|
+
], Zt = ({ texts: e, speed: t, deleteSpeed: r, pause: i }) => {
|
|
3451
3563
|
let [a, o] = s(""), [c, d] = s(0), [f, p] = s(!1);
|
|
3452
3564
|
return n(() => {
|
|
3453
3565
|
let n = e[c % e.length], s;
|
|
@@ -3469,66 +3581,66 @@ var P = {
|
|
|
3469
3581
|
r,
|
|
3470
3582
|
i
|
|
3471
3583
|
]), /* @__PURE__ */ l("div", {
|
|
3472
|
-
className:
|
|
3584
|
+
className: Q.typewriter,
|
|
3473
3585
|
children: /* @__PURE__ */ u("div", {
|
|
3474
|
-
className:
|
|
3586
|
+
className: Q.terminal,
|
|
3475
3587
|
children: [/* @__PURE__ */ u("div", {
|
|
3476
|
-
className:
|
|
3588
|
+
className: Q.dots,
|
|
3477
3589
|
children: [
|
|
3478
3590
|
/* @__PURE__ */ l("span", {}),
|
|
3479
3591
|
/* @__PURE__ */ l("span", {}),
|
|
3480
3592
|
/* @__PURE__ */ l("span", {})
|
|
3481
3593
|
]
|
|
3482
3594
|
}), /* @__PURE__ */ u("p", {
|
|
3483
|
-
className:
|
|
3595
|
+
className: Q.text,
|
|
3484
3596
|
children: [
|
|
3485
3597
|
/* @__PURE__ */ l("span", {
|
|
3486
|
-
className:
|
|
3598
|
+
className: Q.prompt,
|
|
3487
3599
|
children: ">"
|
|
3488
3600
|
}),
|
|
3489
3601
|
a,
|
|
3490
3602
|
/* @__PURE__ */ l("span", {
|
|
3491
|
-
className:
|
|
3603
|
+
className: Q.cursor,
|
|
3492
3604
|
children: "|"
|
|
3493
3605
|
})
|
|
3494
3606
|
]
|
|
3495
3607
|
})]
|
|
3496
3608
|
})
|
|
3497
3609
|
});
|
|
3498
|
-
},
|
|
3499
|
-
let i = e.length > 0 ? e :
|
|
3500
|
-
return /* @__PURE__ */ l(
|
|
3610
|
+
}, Qt = ({ texts: e = Xt, speed: t = 100, deleteSpeed: n = 50, pause: r = 2e3 }) => {
|
|
3611
|
+
let i = e.length > 0 ? e : Xt;
|
|
3612
|
+
return /* @__PURE__ */ l(Zt, {
|
|
3501
3613
|
texts: i,
|
|
3502
3614
|
speed: t,
|
|
3503
3615
|
deleteSpeed: n,
|
|
3504
3616
|
pause: r
|
|
3505
3617
|
}, i.join("\0"));
|
|
3506
|
-
},
|
|
3618
|
+
}, $ = {
|
|
3507
3619
|
waveButton: "cos-waveButton-Aa7G-",
|
|
3508
3620
|
btn: "cos-btn-WJrEN",
|
|
3509
3621
|
label: "cos-label-9BHOU",
|
|
3510
3622
|
wave: "cos-wave-GycLU",
|
|
3511
3623
|
ripple: "cos-ripple-5ZFpr"
|
|
3512
|
-
},
|
|
3513
|
-
className:
|
|
3624
|
+
}, $t = ({ text: e = "点我试试", color: t = "#38bdf8", className: n, style: r, ...i }) => /* @__PURE__ */ l("div", {
|
|
3625
|
+
className: $.waveButton,
|
|
3514
3626
|
children: /* @__PURE__ */ u("button", {
|
|
3515
3627
|
type: "button",
|
|
3516
|
-
className: `${
|
|
3628
|
+
className: `${$.btn} ${n ?? ""}`,
|
|
3517
3629
|
style: {
|
|
3518
3630
|
"--wave-color": t,
|
|
3519
3631
|
...r
|
|
3520
3632
|
},
|
|
3521
3633
|
...i,
|
|
3522
3634
|
children: [
|
|
3523
|
-
/* @__PURE__ */ l("span", { className:
|
|
3524
|
-
/* @__PURE__ */ l("span", { className:
|
|
3635
|
+
/* @__PURE__ */ l("span", { className: $.wave }),
|
|
3636
|
+
/* @__PURE__ */ l("span", { className: $.wave }),
|
|
3525
3637
|
/* @__PURE__ */ l("span", {
|
|
3526
|
-
className:
|
|
3638
|
+
className: $.label,
|
|
3527
3639
|
children: e
|
|
3528
3640
|
})
|
|
3529
3641
|
]
|
|
3530
3642
|
})
|
|
3531
|
-
}),
|
|
3643
|
+
}), en = 39, tn = {
|
|
3532
3644
|
0: "sunny",
|
|
3533
3645
|
1: "sunny",
|
|
3534
3646
|
2: "partlyCloudy",
|
|
@@ -3557,26 +3669,26 @@ var P = {
|
|
|
3557
3669
|
95: "thunderstorm",
|
|
3558
3670
|
96: "hail",
|
|
3559
3671
|
99: "hail"
|
|
3560
|
-
},
|
|
3561
|
-
let n =
|
|
3562
|
-
return (n === "sunny" || n === "partlyCloudy" || n === "overcast") && t >=
|
|
3563
|
-
},
|
|
3672
|
+
}, nn = (e, t = 0) => {
|
|
3673
|
+
let n = tn[e] ?? "overcast";
|
|
3674
|
+
return (n === "sunny" || n === "partlyCloudy" || n === "overcast") && t >= en ? "gale" : n;
|
|
3675
|
+
}, rn = {
|
|
3564
3676
|
weather: null,
|
|
3565
3677
|
status: "idle",
|
|
3566
3678
|
error: null,
|
|
3567
3679
|
current: null
|
|
3568
|
-
},
|
|
3680
|
+
}, an = {
|
|
3569
3681
|
weather: null,
|
|
3570
3682
|
status: "locating",
|
|
3571
3683
|
error: null,
|
|
3572
3684
|
current: null
|
|
3573
|
-
},
|
|
3685
|
+
}, on = {
|
|
3574
3686
|
weather: null,
|
|
3575
3687
|
status: "fetching",
|
|
3576
3688
|
error: null,
|
|
3577
3689
|
current: null
|
|
3578
|
-
},
|
|
3579
|
-
let r =
|
|
3690
|
+
}, sn = (e) => e != null && Number.isFinite(e.latitude) && Number.isFinite(e.longitude), cn = (e = !0, t) => {
|
|
3691
|
+
let r = sn(t), i = r ? t.latitude : null, a = r ? t.longitude : null, o = e ? r ? on : an : rn, c = `${e}:${i},${a}`, [l, u] = s(o), [d, f] = s(c);
|
|
3580
3692
|
return d !== c && (f(c), u((t) => e && t.weather ? {
|
|
3581
3693
|
...o,
|
|
3582
3694
|
weather: t.weather,
|
|
@@ -3596,7 +3708,7 @@ var P = {
|
|
|
3596
3708
|
let c = Number(o?.current?.wind_speed_10m ?? 0);
|
|
3597
3709
|
if (t) return;
|
|
3598
3710
|
u({
|
|
3599
|
-
weather:
|
|
3711
|
+
weather: nn(s, c),
|
|
3600
3712
|
status: "success",
|
|
3601
3713
|
error: null,
|
|
3602
3714
|
current: {
|
|
@@ -3654,31 +3766,31 @@ var P = {
|
|
|
3654
3766
|
};
|
|
3655
3767
|
//#endregion
|
|
3656
3768
|
//#region src/components/weatherBackground/scene/draw-atmosphere.ts
|
|
3657
|
-
function
|
|
3769
|
+
function ln(e) {
|
|
3658
3770
|
let t = e.activeWeather === "gale" ? 7 : 1;
|
|
3659
3771
|
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
3772
|
}
|
|
3661
|
-
function
|
|
3773
|
+
function un(e) {
|
|
3662
3774
|
let t = e.fogSprite;
|
|
3663
3775
|
if (!t || e.state.fogBanks.length === 0) return;
|
|
3664
3776
|
let { canvas: n, baseR: r } = t;
|
|
3665
3777
|
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
3778
|
}
|
|
3667
|
-
function
|
|
3779
|
+
function dn(e) {
|
|
3668
3780
|
if (e.cfg.haze <= 0) return;
|
|
3669
3781
|
let t = e.activeWeather === "smog" ? "177, 164, 135" : "220, 226, 232";
|
|
3670
3782
|
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
3783
|
}
|
|
3672
3784
|
//#endregion
|
|
3673
3785
|
//#region src/components/weatherBackground/lightning.ts
|
|
3674
|
-
function
|
|
3786
|
+
function fn(e, t, n, r, i, a) {
|
|
3675
3787
|
if (a <= 0) return [[e, t], [n, r]];
|
|
3676
|
-
let o = (e + n) / 2 + (Math.random() - .5) * i, s = (t + r) / 2, c =
|
|
3788
|
+
let o = (e + n) / 2 + (Math.random() - .5) * i, s = (t + r) / 2, c = fn(e, t, o, s, i * .55, a - 1), l = fn(o, s, n, r, i * .55, a - 1);
|
|
3677
3789
|
return [...c.slice(0, -1), ...l];
|
|
3678
3790
|
}
|
|
3679
3791
|
//#endregion
|
|
3680
3792
|
//#region src/components/weatherBackground/scene/draw-effects.ts
|
|
3681
|
-
function
|
|
3793
|
+
function pn(e) {
|
|
3682
3794
|
if (e.state.windStreaks.length !== 0) for (let t of e.state.windStreaks) {
|
|
3683
3795
|
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
3796
|
let n = Math.sin(t.wave) * 8, r = t.x + t.length;
|
|
@@ -3688,12 +3800,12 @@ function cn(e) {
|
|
|
3688
3800
|
}
|
|
3689
3801
|
}
|
|
3690
3802
|
}
|
|
3691
|
-
function
|
|
3803
|
+
function mn(e) {
|
|
3692
3804
|
if (e.cfg.lightning) {
|
|
3693
3805
|
if (e.state.t >= e.state.nextStrike) {
|
|
3694
3806
|
e.state.nextStrike = e.state.t + 150 + Math.random() * 300, e.state.flashAlpha = .5, e.state.boltLife = 9;
|
|
3695
3807
|
let t = e.width * (.15 + Math.random() * .7);
|
|
3696
|
-
e.state.boltPoints =
|
|
3808
|
+
e.state.boltPoints = fn(t, e.height * .12, t + (Math.random() - .5) * e.width * .2, e.height * .92, 60, 6);
|
|
3697
3809
|
}
|
|
3698
3810
|
if (e.state.boltLife > 0) {
|
|
3699
3811
|
--e.state.boltLife;
|
|
@@ -3705,7 +3817,7 @@ function ln(e) {
|
|
|
3705
3817
|
}
|
|
3706
3818
|
//#endregion
|
|
3707
3819
|
//#region src/components/weatherBackground/sprites/hail.ts
|
|
3708
|
-
var
|
|
3820
|
+
var hn = 3.2, gn = (e) => {
|
|
3709
3821
|
let t = Math.ceil(e * 2.8 + 4), n = document.createElement("canvas");
|
|
3710
3822
|
n.width = t, n.height = t;
|
|
3711
3823
|
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 +3850,9 @@ var un = 3.2, dn = (e) => {
|
|
|
3738
3850
|
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
3851
|
}
|
|
3740
3852
|
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
|
-
},
|
|
3853
|
+
}, _n = (e = 16) => Array.from({ length: e }, () => gn(hn)), vn = (e) => e[Math.floor(Math.random() * e.length)], yn = (e, t, n, r, i = !0) => {
|
|
3854
|
+
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 = vn(r), e.drawSize = e.r * 2.8 + 4, e.rotation = Math.random() * Math.PI * 2, e.rotationSpeed = (Math.random() - .5) * .06;
|
|
3855
|
+
}, bn = (e, t, n) => {
|
|
3744
3856
|
let r = {
|
|
3745
3857
|
x: 0,
|
|
3746
3858
|
y: 0,
|
|
@@ -3759,11 +3871,11 @@ var un = 3.2, dn = (e) => {
|
|
|
3759
3871
|
rotation: 0,
|
|
3760
3872
|
rotationSpeed: 0
|
|
3761
3873
|
};
|
|
3762
|
-
return
|
|
3874
|
+
return yn(r, e, t, n, Math.random() < .72), r;
|
|
3763
3875
|
};
|
|
3764
3876
|
//#endregion
|
|
3765
3877
|
//#region src/components/weatherBackground/scene/draw-precipitation.ts
|
|
3766
|
-
function
|
|
3878
|
+
function xn(e) {
|
|
3767
3879
|
if (!e.cfg.rain) return;
|
|
3768
3880
|
let { wind: t, alpha: n, splash: r } = e.cfg.rain;
|
|
3769
3881
|
e.ctx.strokeStyle = `rgba(214, 228, 240, ${n})`, e.ctx.lineWidth = 1.2, e.ctx.beginPath();
|
|
@@ -3785,14 +3897,14 @@ function gn(e) {
|
|
|
3785
3897
|
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
3898
|
}
|
|
3787
3899
|
}
|
|
3788
|
-
function
|
|
3900
|
+
function Sn(e) {
|
|
3789
3901
|
for (let t of e.state.flakes) {
|
|
3790
3902
|
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
3903
|
let n = t.drawSize / 2;
|
|
3792
3904
|
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
3905
|
}
|
|
3794
3906
|
}
|
|
3795
|
-
function
|
|
3907
|
+
function Cn(e) {
|
|
3796
3908
|
if (e.state.hailstones.length === 0) return;
|
|
3797
3909
|
let t = e.state.hailPool;
|
|
3798
3910
|
for (let n of e.state.hailstones) {
|
|
@@ -3803,7 +3915,7 @@ function vn(e) {
|
|
|
3803
3915
|
let r = n.x, i = n.y;
|
|
3804
3916
|
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
3917
|
else {
|
|
3806
|
-
|
|
3918
|
+
yn(n, e.width, e.height, t, !0);
|
|
3807
3919
|
continue;
|
|
3808
3920
|
}
|
|
3809
3921
|
let a = n.drawSize / 2;
|
|
@@ -3812,31 +3924,31 @@ function vn(e) {
|
|
|
3812
3924
|
}
|
|
3813
3925
|
//#endregion
|
|
3814
3926
|
//#region src/components/weatherBackground/scene/draw-sky.ts
|
|
3815
|
-
function
|
|
3927
|
+
function wn(e) {
|
|
3816
3928
|
e.ctx.fillStyle = e.skyGradient, e.ctx.fillRect(0, 0, e.width, e.height);
|
|
3817
3929
|
}
|
|
3818
|
-
function
|
|
3930
|
+
function Tn(e) {
|
|
3819
3931
|
if (e.state.stars.length !== 0) for (let t of e.state.stars) {
|
|
3820
3932
|
let n = .35 + (Math.sin(e.state.t * t.speed + t.phase) + 1) * .325;
|
|
3821
3933
|
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
3934
|
}
|
|
3823
3935
|
}
|
|
3824
|
-
function
|
|
3936
|
+
function En(e) {
|
|
3825
3937
|
let t = e.celestial;
|
|
3826
3938
|
if (!t) return;
|
|
3827
3939
|
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
3940
|
n.drawImage(t.canvas, r - s, i - s, c, c);
|
|
3829
3941
|
}
|
|
3830
|
-
function
|
|
3942
|
+
function Dn(e) {
|
|
3831
3943
|
if (e.activeNight) {
|
|
3832
|
-
|
|
3944
|
+
Tn(e), En(e);
|
|
3833
3945
|
return;
|
|
3834
3946
|
}
|
|
3835
|
-
|
|
3947
|
+
En(e);
|
|
3836
3948
|
}
|
|
3837
3949
|
//#endregion
|
|
3838
3950
|
//#region src/components/weatherBackground/configs.ts
|
|
3839
|
-
var
|
|
3951
|
+
var On = {
|
|
3840
3952
|
sunny: {
|
|
3841
3953
|
sky: ["#4a9fe0", "#c8e8fb"],
|
|
3842
3954
|
sun: "full",
|
|
@@ -4146,8 +4258,8 @@ var Cn = {
|
|
|
4146
4258
|
lightning: !1
|
|
4147
4259
|
}
|
|
4148
4260
|
};
|
|
4149
|
-
|
|
4150
|
-
var
|
|
4261
|
+
On.snow = On.moderateSnow;
|
|
4262
|
+
var kn = {
|
|
4151
4263
|
sunny: {
|
|
4152
4264
|
sky: ["#0b1a33", "#27476e"],
|
|
4153
4265
|
stars: 110
|
|
@@ -4213,15 +4325,15 @@ var wn = {
|
|
|
4213
4325
|
stars: 8
|
|
4214
4326
|
}
|
|
4215
4327
|
};
|
|
4216
|
-
|
|
4217
|
-
var
|
|
4328
|
+
kn.snow = kn.moderateSnow;
|
|
4329
|
+
var An = ([e, t, n]) => [
|
|
4218
4330
|
Math.round(e * .3 + 18),
|
|
4219
4331
|
Math.round(t * .3 + 24),
|
|
4220
4332
|
Math.round(n * .3 + 42)
|
|
4221
4333
|
];
|
|
4222
4334
|
//#endregion
|
|
4223
4335
|
//#region src/components/weatherBackground/sprites/cloud.ts
|
|
4224
|
-
function
|
|
4336
|
+
function jn(e, t, n, r) {
|
|
4225
4337
|
let [i, a, o] = n, s = Infinity, c = Infinity, l = -Infinity, u = -Infinity;
|
|
4226
4338
|
for (let n of t) {
|
|
4227
4339
|
let t = n.dx * e, r = n.dy * e, i = n.r * e;
|
|
@@ -4240,12 +4352,12 @@ function En(e, t, n, r) {
|
|
|
4240
4352
|
oy: f
|
|
4241
4353
|
};
|
|
4242
4354
|
}
|
|
4243
|
-
function
|
|
4355
|
+
function Mn(e, t, n, r, i) {
|
|
4244
4356
|
let a = .7 + Math.random() * .9, o = 4 + Math.floor(Math.random() * 3), s = Array.from({ length: o }, (e, t) => ({
|
|
4245
4357
|
dx: (t - o / 2) * 26 + (Math.random() - .5) * 14,
|
|
4246
4358
|
dy: (Math.random() - .5) * 14,
|
|
4247
4359
|
r: 22 + Math.random() * 20
|
|
4248
|
-
})), { sprite: c, ox: l, oy: u } =
|
|
4360
|
+
})), { sprite: c, ox: l, oy: u } = jn(a, s, r, i);
|
|
4249
4361
|
return {
|
|
4250
4362
|
x: Math.random() * (e + 240) - 120,
|
|
4251
4363
|
y: t * .06 + Math.random() * t * n,
|
|
@@ -4257,7 +4369,7 @@ function Dn(e, t, n, r, i) {
|
|
|
4257
4369
|
oy: u
|
|
4258
4370
|
};
|
|
4259
4371
|
}
|
|
4260
|
-
function
|
|
4372
|
+
function Nn(e, t = 120) {
|
|
4261
4373
|
let n = t * 2, r = document.createElement("canvas");
|
|
4262
4374
|
r.width = n, r.height = n;
|
|
4263
4375
|
let i = r.getContext("2d"), a = i.createRadialGradient(t, t, 0, t, t, t);
|
|
@@ -4268,7 +4380,7 @@ function On(e, t = 120) {
|
|
|
4268
4380
|
}
|
|
4269
4381
|
//#endregion
|
|
4270
4382
|
//#region src/components/weatherBackground/sprites/celestial.ts
|
|
4271
|
-
function
|
|
4383
|
+
function Pn(e, t) {
|
|
4272
4384
|
let n = e.sun;
|
|
4273
4385
|
if (n === "none") return null;
|
|
4274
4386
|
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 +4408,7 @@ function kn(e, t) {
|
|
|
4296
4408
|
breathAmp: .018
|
|
4297
4409
|
};
|
|
4298
4410
|
}
|
|
4299
|
-
function
|
|
4411
|
+
function Fn(e, t, n) {
|
|
4300
4412
|
if (e.sun === "none") return null;
|
|
4301
4413
|
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
4414
|
l.width = c, l.height = c;
|
|
@@ -4350,12 +4462,12 @@ function An(e, t, n) {
|
|
|
4350
4462
|
}
|
|
4351
4463
|
//#endregion
|
|
4352
4464
|
//#region src/components/weatherBackground/sprites/snow.ts
|
|
4353
|
-
var
|
|
4465
|
+
var In = (e) => {
|
|
4354
4466
|
let t = Math.ceil(e * 2 + 4), n = document.createElement("canvas");
|
|
4355
4467
|
n.width = t, n.height = t;
|
|
4356
4468
|
let r = n.getContext("2d"), i = r.createRadialGradient(t / 2, t / 2, 0, t / 2, t / 2, e + 1);
|
|
4357
4469
|
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
|
-
},
|
|
4470
|
+
}, Ln = (e) => {
|
|
4359
4471
|
let t = Math.ceil(e * 2 + 6), n = document.createElement("canvas");
|
|
4360
4472
|
n.width = t, n.height = t;
|
|
4361
4473
|
let r = n.getContext("2d");
|
|
@@ -4382,22 +4494,22 @@ var jn = (e) => {
|
|
|
4382
4494
|
r.closePath(), r.stroke();
|
|
4383
4495
|
}
|
|
4384
4496
|
return n;
|
|
4385
|
-
},
|
|
4497
|
+
}, Rn = () => ({
|
|
4386
4498
|
dots: [
|
|
4387
4499
|
1.2,
|
|
4388
4500
|
1.6,
|
|
4389
4501
|
2,
|
|
4390
4502
|
2.3
|
|
4391
|
-
].map((e) =>
|
|
4503
|
+
].map((e) => In(e)),
|
|
4392
4504
|
crystals: [
|
|
4393
4505
|
2.6,
|
|
4394
4506
|
3.2,
|
|
4395
4507
|
3.8,
|
|
4396
4508
|
4.4,
|
|
4397
4509
|
5
|
|
4398
|
-
].map((e) =>
|
|
4399
|
-
}),
|
|
4400
|
-
let i = 1 + Math.random() ** 1.6 * 4.2, a = i >= 2.4, o =
|
|
4510
|
+
].map((e) => Ln(e * 2.4))
|
|
4511
|
+
}), zn = (e) => e[Math.floor(Math.random() * e.length)], Bn = (e, t, n, r) => {
|
|
4512
|
+
let i = 1 + Math.random() ** 1.6 * 4.2, a = i >= 2.4, o = zn(a ? n.crystals : n.dots), s = a ? i * 4.8 + 6 : i * 2 + 4;
|
|
4401
4513
|
return {
|
|
4402
4514
|
x: Math.random() * e,
|
|
4403
4515
|
y: r ?? Math.random() * t,
|
|
@@ -4411,9 +4523,9 @@ var jn = (e) => {
|
|
|
4411
4523
|
sprite: o,
|
|
4412
4524
|
drawSize: s
|
|
4413
4525
|
};
|
|
4414
|
-
},
|
|
4415
|
-
function
|
|
4416
|
-
let { ctx: t, width: n, height: r, activeWeather: i, activeNight: a } = e, o =
|
|
4526
|
+
}, Vn = (e, t) => t ? e === "smog" ? "96, 88, 66" : "138, 150, 168" : e === "smog" ? "168, 155, 126" : "226, 232, 238";
|
|
4527
|
+
function Hn(e) {
|
|
4528
|
+
let { ctx: t, width: n, height: r, activeWeather: i, activeNight: a } = e, o = On[i], s = kn[i], c = a ? s.sky : o.sky, l = a ? An(o.cloudColor) : o.cloudColor, u = n * .72, d = r * .26, f = Math.min(n, r) * .09, p = t.createLinearGradient(0, 0, 0, r);
|
|
4417
4529
|
p.addColorStop(0, c[0]), p.addColorStop(1, c[1]);
|
|
4418
4530
|
let m = a ? Array.from({ length: s.stars }, () => ({
|
|
4419
4531
|
x: Math.random() * n,
|
|
@@ -4442,7 +4554,7 @@ function Ln(e) {
|
|
|
4442
4554
|
dy: .24,
|
|
4443
4555
|
r: .07
|
|
4444
4556
|
}
|
|
4445
|
-
], g = a ?
|
|
4557
|
+
], g = a ? Fn(o, f, h) : Pn(o, f), _ = Array.from({ length: o.cloudCount }, () => Mn(n, r, o.cloudSpread, l, o.cloudAlpha)), v = o.rain ? Array.from({ length: o.rain.count }, () => ({
|
|
4446
4558
|
x: Math.random() * (n + 160) - 80,
|
|
4447
4559
|
y: Math.random() * r,
|
|
4448
4560
|
len: 8 + Math.random() * 10,
|
|
@@ -4454,7 +4566,7 @@ function Ln(e) {
|
|
|
4454
4566
|
rh: r * (.08 + Math.random() * .08),
|
|
4455
4567
|
speed: (.1 + Math.random() * .25) * (t % 2 == 0 ? 1 : -1),
|
|
4456
4568
|
alpha: .16 + Math.random() * .14
|
|
4457
|
-
})), x = o.fogBanks > 0 ?
|
|
4569
|
+
})), x = o.fogBanks > 0 ? Nn(Vn(i, a)) : null, S = o.snowCount > 0 ? Rn() : null, C = S == null ? [] : Array.from({ length: o.snowCount }, () => Bn(n, r, S)), w = i === "hail" ? _n() : null, T = w == null ? [] : Array.from({ length: 145 }, () => bn(n, r, w)), E = i === "gale" ? Array.from({ length: 46 }, () => ({
|
|
4458
4570
|
x: Math.random() * n,
|
|
4459
4571
|
y: Math.random() * r,
|
|
4460
4572
|
length: 45 + Math.random() * 130,
|
|
@@ -4462,7 +4574,7 @@ function Ln(e) {
|
|
|
4462
4574
|
wave: Math.random() * Math.PI * 2,
|
|
4463
4575
|
alpha: .12 + Math.random() * .3,
|
|
4464
4576
|
width: .6 + Math.random() * 1.2
|
|
4465
|
-
})) : [],
|
|
4577
|
+
})) : [], D = [], O = 120 + Math.random() * 240;
|
|
4466
4578
|
return {
|
|
4467
4579
|
sky: c,
|
|
4468
4580
|
cloudRgb: l,
|
|
@@ -4483,47 +4595,47 @@ function Ln(e) {
|
|
|
4483
4595
|
flakes: C,
|
|
4484
4596
|
hailstones: T,
|
|
4485
4597
|
hailPool: w ?? [],
|
|
4486
|
-
windStreaks:
|
|
4598
|
+
windStreaks: E,
|
|
4487
4599
|
t: 0,
|
|
4488
4600
|
flashAlpha: 0,
|
|
4489
4601
|
boltLife: 0,
|
|
4490
|
-
boltPoints:
|
|
4491
|
-
nextStrike:
|
|
4602
|
+
boltPoints: D,
|
|
4603
|
+
nextStrike: O
|
|
4492
4604
|
}
|
|
4493
4605
|
};
|
|
4494
4606
|
}
|
|
4495
4607
|
//#endregion
|
|
4496
4608
|
//#region src/components/weatherBackground/scene/create-weather-scene.ts
|
|
4497
|
-
function
|
|
4498
|
-
t && (e.state.t += 1),
|
|
4609
|
+
function Un(e, t) {
|
|
4610
|
+
t && (e.state.t += 1), wn(e), Dn(e), ln(e), un(e), dn(e), xn(e), Sn(e), Cn(e), pn(e), mn(e);
|
|
4499
4611
|
}
|
|
4500
|
-
function
|
|
4612
|
+
function Wn(e) {
|
|
4501
4613
|
let { ctx: t, width: n, height: r, activeWeather: i, activeNight: a } = e, o = {
|
|
4502
4614
|
ctx: t,
|
|
4503
4615
|
width: n,
|
|
4504
4616
|
height: r,
|
|
4505
4617
|
activeWeather: i,
|
|
4506
4618
|
activeNight: a,
|
|
4507
|
-
...
|
|
4619
|
+
...Hn(e)
|
|
4508
4620
|
};
|
|
4509
|
-
if (typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return
|
|
4621
|
+
if (typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return Un(o, !1), () => void 0;
|
|
4510
4622
|
let s = 0, c = document.hidden, l = v((e) => {
|
|
4511
4623
|
c = e;
|
|
4512
4624
|
}), u = () => {
|
|
4513
|
-
s = requestAnimationFrame(u), !c &&
|
|
4625
|
+
s = requestAnimationFrame(u), !c && Un(o, !0);
|
|
4514
4626
|
};
|
|
4515
4627
|
return u(), () => {
|
|
4516
4628
|
cancelAnimationFrame(s), l();
|
|
4517
4629
|
};
|
|
4518
4630
|
}
|
|
4519
|
-
var
|
|
4631
|
+
var Gn = {
|
|
4520
4632
|
weatherBackground: "cos-weatherBackground-Mnm22",
|
|
4521
4633
|
canvas: "cos-canvas-nvqMt",
|
|
4522
4634
|
loadingOverlay: "cos-loadingOverlay-O58B7",
|
|
4523
4635
|
loadingSpinner: "cos-loadingSpinner-NQ9yG",
|
|
4524
4636
|
"weather-loading-spin": "cos-weather-loading-spin-IPFWZ"
|
|
4525
|
-
},
|
|
4526
|
-
let p = o(null), m =
|
|
4637
|
+
}, Kn = ({ width: e = 800, height: t = 450, weather: r = "sunny", night: i = !1, live: a = !1, latitude: s, longitude: c, onLiveWeather: d, loading: f = !1 }) => {
|
|
4638
|
+
let p = o(null), m = cn(a, s != null && c != null ? {
|
|
4527
4639
|
latitude: s,
|
|
4528
4640
|
longitude: c
|
|
4529
4641
|
} : 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 +4649,7 @@ var $ = {
|
|
|
4537
4649
|
let r = window.devicePixelRatio || 1;
|
|
4538
4650
|
n.width = e * r, n.height = t * r;
|
|
4539
4651
|
let i = n.getContext("2d");
|
|
4540
|
-
if (i) return i.setTransform(r, 0, 0, r, 0, 0),
|
|
4652
|
+
if (i) return i.setTransform(r, 0, 0, r, 0, 0), Wn({
|
|
4541
4653
|
ctx: i,
|
|
4542
4654
|
width: e,
|
|
4543
4655
|
height: t,
|
|
@@ -4550,14 +4662,14 @@ var $ = {
|
|
|
4550
4662
|
t,
|
|
4551
4663
|
e
|
|
4552
4664
|
]), /* @__PURE__ */ u("div", {
|
|
4553
|
-
className:
|
|
4665
|
+
className: Gn.weatherBackground,
|
|
4554
4666
|
style: {
|
|
4555
4667
|
width: e,
|
|
4556
4668
|
height: t
|
|
4557
4669
|
},
|
|
4558
4670
|
children: [/* @__PURE__ */ l("canvas", {
|
|
4559
4671
|
ref: p,
|
|
4560
|
-
className:
|
|
4672
|
+
className: Gn.canvas,
|
|
4561
4673
|
style: {
|
|
4562
4674
|
width: e,
|
|
4563
4675
|
height: t
|
|
@@ -4565,35 +4677,35 @@ var $ = {
|
|
|
4565
4677
|
role: "img",
|
|
4566
4678
|
"aria-label": `天气背景:${h}${g ? "(夜间)" : ""}`
|
|
4567
4679
|
}), _ && /* @__PURE__ */ u("div", {
|
|
4568
|
-
className:
|
|
4680
|
+
className: Gn.loadingOverlay,
|
|
4569
4681
|
role: "status",
|
|
4570
4682
|
"aria-live": "polite",
|
|
4571
4683
|
children: [/* @__PURE__ */ l("div", {
|
|
4572
|
-
className:
|
|
4684
|
+
className: Gn.loadingSpinner,
|
|
4573
4685
|
"aria-hidden": !0
|
|
4574
4686
|
}), /* @__PURE__ */ l("span", { children: "天气加载中…" })]
|
|
4575
4687
|
})]
|
|
4576
4688
|
});
|
|
4577
|
-
},
|
|
4689
|
+
}, qn = {
|
|
4578
4690
|
waveText: "cos-waveText-Zy2Tp",
|
|
4579
4691
|
text: "cos-text-el-KR",
|
|
4580
4692
|
char: "cos-char-Y9-mV",
|
|
4581
4693
|
wave: "cos-wave-jVRCz"
|
|
4582
|
-
},
|
|
4583
|
-
className:
|
|
4694
|
+
}, Jn = ({ text: e = "WAVE", amplitude: t = 12, color: n = "#38bdf8", fontSize: r = 56 }) => /* @__PURE__ */ l("div", {
|
|
4695
|
+
className: qn.waveText,
|
|
4584
4696
|
children: /* @__PURE__ */ l("h1", {
|
|
4585
|
-
className:
|
|
4697
|
+
className: qn.text,
|
|
4586
4698
|
style: {
|
|
4587
4699
|
fontSize: r,
|
|
4588
4700
|
"--wave-color": n,
|
|
4589
4701
|
"--wave-amp": `${t}px`
|
|
4590
4702
|
},
|
|
4591
4703
|
children: e.split("").map((e, t) => /* @__PURE__ */ l("span", {
|
|
4592
|
-
className:
|
|
4704
|
+
className: qn.char,
|
|
4593
4705
|
style: { animationDelay: `${t * .1}s` },
|
|
4594
4706
|
children: e === " " ? "\xA0" : e
|
|
4595
4707
|
}, `${e}-${t}`))
|
|
4596
4708
|
})
|
|
4597
4709
|
});
|
|
4598
4710
|
//#endregion
|
|
4599
|
-
export { x as AudioVisualizer, _ as Aurora, f as BarcodeScan, m as BurnAway, C as CanvasClock,
|
|
4711
|
+
export { x as AudioVisualizer, _ as Aurora, f as BarcodeScan, m as BurnAway, C as CanvasClock, D as Charge, k as ClickSpark, P 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, Ze as NeonText, $e as NewtonCradle, tt as OrbitalChart, rt as ParticleNetwork, at as PlasmaBall, _t as ProgressChest, yt as RadarScan, bt as RedPacketRain, xt as ReturnCity, Mt as RippleWater, Ct as RopeChain, Ft as ScrambleText, Lt as ScratchCard, Bt as SlotMachine, lt as SmokeFog, mt as Snowfall, ft as SolarSystem, wt as Speedometer, Ut as SplitReveal, Gt as Spotlight, gt as Starfield, Tt as TimelinePulse, Yt as Turntable, Qt as Typewriter, $t as WaveButton, Jn as WaveText, Kn as WeatherBackground, nn as mapWmoCodeToWeatherType, cn as useLiveWeather };
|