cos-design 2.4.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +26 -20
  3. package/dist/components/audioVisualizer/index.d.ts +9 -0
  4. package/dist/components/aurora/index.d.ts +9 -0
  5. package/dist/components/barcodeScan/index.d.ts +11 -0
  6. package/dist/components/burnAway/index.d.ts +11 -0
  7. package/dist/components/clickSpark/index.d.ts +10 -0
  8. package/dist/components/cursorTrail/index.d.ts +11 -0
  9. package/dist/components/cyberGrid/index.d.ts +11 -0
  10. package/dist/components/diceRoll/index.d.ts +9 -0
  11. package/dist/components/dnaHelix/index.d.ts +9 -0
  12. package/dist/components/electricArc/index.d.ts +8 -0
  13. package/dist/components/gradientFlow/index.d.ts +11 -0
  14. package/dist/components/gravityBalls/index.d.ts +8 -0
  15. package/dist/components/holographicCard/index.d.ts +8 -0
  16. package/dist/components/index.d.ts +68 -0
  17. package/dist/components/liquidGlass/index.d.ts +10 -0
  18. package/dist/components/liquidProgress/index.d.ts +9 -0
  19. package/dist/components/magneticButton/index.d.ts +10 -0
  20. package/dist/components/mazeGenerator/index.d.ts +9 -0
  21. package/dist/components/newtonCradle/index.d.ts +7 -0
  22. package/dist/components/orbitalChart/index.d.ts +12 -0
  23. package/dist/components/progressChest/index.d.ts +11 -0
  24. package/dist/components/radarScan/index.d.ts +9 -0
  25. package/dist/components/redPacketRain/index.d.ts +9 -0
  26. package/dist/components/rippleWater/index.d.ts +9 -0
  27. package/dist/components/scrambleText/index.d.ts +11 -0
  28. package/dist/components/scratchCard/index.d.ts +13 -0
  29. package/dist/components/slotMachine/index.d.ts +9 -0
  30. package/dist/components/smokeFog/index.d.ts +9 -0
  31. package/dist/components/snowfall/index.d.ts +11 -0
  32. package/dist/components/speedometer/index.d.ts +9 -0
  33. package/dist/components/splitReveal/index.d.ts +11 -0
  34. package/dist/components/spotlight/index.d.ts +10 -0
  35. package/dist/components/starfield/index.d.ts +11 -0
  36. package/dist/components/timelinePulse/index.d.ts +8 -0
  37. package/dist/components/waveText/index.d.ts +13 -0
  38. package/dist/index.cjs +1 -1
  39. package/dist/index.css +1 -1
  40. package/dist/index.js +2294 -353
  41. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,60 +1,272 @@
1
- import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a, useState as o } from "react";
2
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
3
- import './index.css';var u = {
1
+ import { forwardRef as e, useCallback as t, useEffect as n, useId as r, useImperativeHandle as i, useMemo as a, useRef as o, useState as s } from "react";
2
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
3
+ import './index.css';var d = {
4
+ barcodeScan: "cos-barcodeScan-aH9Ad",
5
+ content: "cos-content-F73ZD",
6
+ "glitch-skew": "cos-glitch-skew-inh6a",
7
+ placeholder: "cos-placeholder-yYVB8",
8
+ overlay: "cos-overlay-4AiY5",
9
+ scanLine: "cos-scanLine-VBsRv",
10
+ scan: "cos-scan-JD4wO",
11
+ glitchLayer: "cos-glitchLayer-nzkIa",
12
+ flicker: "cos-flicker-P0jQE",
13
+ corners: "cos-corners-1bjak"
14
+ }, f = ({ children: e, scanColor: t = "#22c55e", speed: n = 2.5 }) => /* @__PURE__ */ u("div", {
15
+ className: d.barcodeScan,
16
+ style: {
17
+ "--scan-color": t,
18
+ "--scan-speed": `${n}s`
19
+ },
20
+ children: [
21
+ /* @__PURE__ */ l("div", {
22
+ className: d.content,
23
+ children: e ?? /* @__PURE__ */ l("span", {
24
+ className: d.placeholder,
25
+ children: "SCAN ME"
26
+ })
27
+ }),
28
+ /* @__PURE__ */ u("div", {
29
+ className: d.overlay,
30
+ children: [/* @__PURE__ */ l("div", { className: d.scanLine }), /* @__PURE__ */ l("div", { className: d.glitchLayer })]
31
+ }),
32
+ /* @__PURE__ */ u("div", {
33
+ className: d.corners,
34
+ children: [
35
+ /* @__PURE__ */ l("span", {}),
36
+ /* @__PURE__ */ l("span", {}),
37
+ /* @__PURE__ */ l("span", {}),
38
+ /* @__PURE__ */ l("span", {})
39
+ ]
40
+ })
41
+ ]
42
+ }), p = {
43
+ burnAway: "cos-burnAway-QWIjy",
44
+ stage: "cos-stage-8VIfE",
45
+ text: "cos-text-0guk-",
46
+ canvas: "cos-canvas-Bwc-u",
47
+ trigger: "cos-trigger-UDZqV",
48
+ hint: "cos-hint-XQUfv"
49
+ }, m = ({ text: e = "BURN", fontSize: r = 64, onComplete: i }) => {
50
+ let a = o(null), c = o(null), [d, f] = s(!1), [m, h] = s(!1), g = o(!1), _ = t(() => {
51
+ d || m || f(!0);
52
+ }, [d, m]);
53
+ return n(() => {
54
+ if (!d || m) return;
55
+ let t = a.current, n = c.current;
56
+ if (!t || !n) return;
57
+ let o = t.getBoundingClientRect(), s = window.devicePixelRatio || 1, l = Math.ceil(o.width), u = Math.ceil(o.height);
58
+ n.width = l * s, n.height = u * s, n.style.width = `${l}px`, n.style.height = `${u}px`;
59
+ let f = n.getContext("2d");
60
+ if (!f) return;
61
+ f.scale(s, s);
62
+ let p = document.createElement("canvas");
63
+ p.width = l * s, p.height = u * s;
64
+ let _ = p.getContext("2d");
65
+ if (!_) return;
66
+ _.scale(s, s), _.font = `900 ${r}px system-ui, sans-serif`, _.textAlign = "center", _.textBaseline = "middle", _.fillStyle = "#f8fafc", _.fillText(e, l / 2, u / 2);
67
+ let v = _.getImageData(0, 0, l * s, u * s).data, y = [];
68
+ for (let e = 0; e < u; e += 4) for (let t = 0; t < l; t += 4) v[(Math.floor(e * s) * l * s + Math.floor(t * s)) * 4 + 3] > 128 && y.push({
69
+ x: t,
70
+ y: e,
71
+ vx: (Math.random() - .5) * 2,
72
+ vy: -Math.random() * 3 - 1,
73
+ life: 1,
74
+ maxLife: .6 + Math.random() * .6,
75
+ size: 2 + Math.random() * 3
76
+ });
77
+ let b = 0, x = 0, S = (e, t) => {
78
+ let n = Math.min((e - t) / 16, 2);
79
+ x += n * 16, f.clearRect(0, 0, l, u);
80
+ let r = 0;
81
+ for (let e of y) {
82
+ if (e.life -= n * .012 / e.maxLife, e.life <= 0) continue;
83
+ r++, e.x += e.vx * n, e.y += e.vy * n, e.vy += .04 * n;
84
+ let t = e.life, i = 1 - e.life, a = Math.max(0, 200 - i * 200), o = Math.max(0, 80 - i * 80);
85
+ f.globalAlpha = t, f.fillStyle = `rgb(255,${a},${o})`, f.beginPath(), f.arc(e.x, e.y, e.size * t, 0, Math.PI * 2), f.fill();
86
+ }
87
+ f.globalAlpha = 1, x < 2500 && r > 0 ? b = requestAnimationFrame((t) => S(t, e)) : (h(!0), g.current || (g.current = !0, i?.()));
88
+ };
89
+ return b = requestAnimationFrame((e) => S(e, e)), () => cancelAnimationFrame(b);
90
+ }, [
91
+ d,
92
+ m,
93
+ e,
94
+ r,
95
+ i
96
+ ]), /* @__PURE__ */ u("div", {
97
+ className: p.burnAway,
98
+ children: [
99
+ /* @__PURE__ */ u("div", {
100
+ ref: a,
101
+ className: p.stage,
102
+ children: [!m && /* @__PURE__ */ l("span", {
103
+ className: p.text,
104
+ style: {
105
+ fontSize: r,
106
+ opacity: +!d
107
+ },
108
+ children: e
109
+ }), /* @__PURE__ */ l("canvas", {
110
+ ref: c,
111
+ className: p.canvas
112
+ })]
113
+ }),
114
+ !d && !m && /* @__PURE__ */ l("button", {
115
+ type: "button",
116
+ className: p.trigger,
117
+ onClick: _,
118
+ children: "Ignite"
119
+ }),
120
+ m && /* @__PURE__ */ l("p", {
121
+ className: p.hint,
122
+ children: "Gone."
123
+ })
124
+ ]
125
+ });
126
+ }, h = {
127
+ aurora: "cos-aurora-dJJb8",
128
+ band: "cos-band-S5CoR",
129
+ "aurora-flow": "cos-aurora-flow-wU8TY"
130
+ }, g = [
131
+ "#00ff87",
132
+ "#60efff",
133
+ "#7b2ff7",
134
+ "#f107a3"
135
+ ], _ = ({ width: e = 800, height: t = 500, colors: n = g }) => {
136
+ let r = n.length >= 2 ? n : g;
137
+ return /* @__PURE__ */ l("div", {
138
+ className: h.aurora,
139
+ style: {
140
+ width: e,
141
+ height: t
142
+ },
143
+ children: r.map((e, t) => /* @__PURE__ */ l("div", {
144
+ className: h.band,
145
+ style: {
146
+ "--aurora-color": e,
147
+ "--aurora-delay": `${t * -3}s`,
148
+ "--aurora-duration": `${12 + t * 2}s`
149
+ }
150
+ }, e + t))
151
+ });
152
+ }, v = (e) => {
153
+ let t = () => e(document.hidden);
154
+ return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
155
+ }, y = (e, t, n) => Math.min(n, Math.max(t, e)), b = {
156
+ audioVisualizer: "cos-audioVisualizer-r5dHp",
157
+ canvas: "cos-canvas-UNEea"
158
+ }, x = ({ width: e = 400, height: t = 120, barCount: r = 32, useMic: i = !1 }) => {
159
+ let a = o(null);
160
+ return n(() => {
161
+ let n = a.current;
162
+ if (!n) return;
163
+ let o = window.devicePixelRatio || 1;
164
+ n.width = e * o, n.height = t * o;
165
+ let s = n.getContext("2d");
166
+ if (!s) return;
167
+ s.setTransform(o, 0, 0, o, 0, 0);
168
+ let c = 0, l = document.hidden, u = null, d = null, f = null, p = null, m = 0, h = !1, g = v((e) => {
169
+ l = e;
170
+ });
171
+ (async () => {
172
+ if (!(!i || !navigator.mediaDevices?.getUserMedia)) try {
173
+ if (p = await navigator.mediaDevices.getUserMedia({ audio: !0 }), h) return;
174
+ u = new AudioContext(), d = u.createAnalyser(), d.fftSize = 256, u.createMediaStreamSource(p).connect(d), f = new Uint8Array(d.frequencyBinCount);
175
+ } catch {}
176
+ })();
177
+ let _ = () => {
178
+ if (c = requestAnimationFrame(_), l) return;
179
+ let n = Array(r).fill(0);
180
+ if (d && f) {
181
+ d.getByteFrequencyData(f);
182
+ let e = Math.floor(f.length / r);
183
+ for (let t = 0; t < r; t++) n[t] = f[t * e] / 255;
184
+ } else {
185
+ m += .08;
186
+ for (let e = 0; e < r; e++) n[e] = (Math.sin(m + e * .35) + 1) * .35 + Math.random() * .15;
187
+ }
188
+ s.fillStyle = "#0f172a", s.fillRect(0, 0, e, t);
189
+ let i = (e - 3 * (r - 1)) / r;
190
+ for (let e = 0; e < r; e++) {
191
+ let r = Math.max(4, n[e] * t * .9), a = e * (i + 3), o = t - r, c = s.createLinearGradient(0, o, 0, t);
192
+ c.addColorStop(0, "#a78bfa"), c.addColorStop(1, "#38bdf8"), s.fillStyle = c, s.beginPath(), s.roundRect(a, o, i, r, 2), s.fill();
193
+ }
194
+ };
195
+ return _(), () => {
196
+ h = !0, cancelAnimationFrame(c), g(), p?.getTracks().forEach((e) => e.stop()), u?.close();
197
+ };
198
+ }, [
199
+ r,
200
+ t,
201
+ i,
202
+ e
203
+ ]), /* @__PURE__ */ l("div", {
204
+ className: b.audioVisualizer,
205
+ style: {
206
+ width: e,
207
+ height: t
208
+ },
209
+ children: /* @__PURE__ */ l("canvas", {
210
+ ref: a,
211
+ className: b.canvas,
212
+ style: {
213
+ width: e,
214
+ height: t
215
+ }
216
+ })
217
+ });
218
+ }, S = {
4
219
  canvasClock: "cos-canvasClock-QvdV3",
5
220
  canvasTarget: "cos-canvasTarget-x-odC"
6
- }, d = ({ width: e = 400, height: r = 400 }) => {
7
- let i = a(null), o = Math.min(e, r), s = o / 2 - 16, l = o / 2, d = t((e) => {
8
- e.clearRect(0, 0, o, o), e.save(), e.translate(l, l), e.beginPath(), e.arc(0, 0, s, 0, Math.PI * 2), e.fillStyle = "#fff", e.fill(), e.strokeStyle = "#d1d5db", e.lineWidth = 2, e.stroke();
221
+ }, ee = ({ width: e = 400, height: r = 400 }) => {
222
+ let i = o(null), a = Math.min(e, r), s = a / 2 - 16, c = a / 2, u = t((e) => {
223
+ e.clearRect(0, 0, a, a), e.save(), e.translate(c, c), e.beginPath(), e.arc(0, 0, s, 0, Math.PI * 2), e.fillStyle = "#fff", e.fill(), e.strokeStyle = "#d1d5db", e.lineWidth = 2, e.stroke();
9
224
  for (let t = 0; t < 60; t++) {
10
225
  let n = t / 60 * Math.PI * 2, r = s - (t % 5 == 0 ? 14 : 8);
11
226
  e.beginPath(), e.moveTo(Math.cos(n) * r, Math.sin(n) * r), e.lineTo(Math.cos(n) * s, Math.sin(n) * s), e.strokeStyle = t % 5 == 0 ? "#374151" : "#9ca3af", e.lineWidth = t % 5 == 0 ? 2 : 1, e.stroke();
12
227
  }
13
- e.fillStyle = "#111827", e.font = `bold ${Math.floor(o / 22)}px system-ui, sans-serif`, e.textAlign = "center", e.textBaseline = "middle";
228
+ e.fillStyle = "#111827", e.font = `bold ${Math.floor(a / 22)}px system-ui, sans-serif`, e.textAlign = "center", e.textBaseline = "middle";
14
229
  for (let t = 1; t <= 12; t++) {
15
230
  let n = t / 12 * Math.PI * 2 - Math.PI / 2, r = s - 32;
16
231
  e.fillText(String(t), Math.cos(n) * r, Math.sin(n) * r);
17
232
  }
18
- let t = /* @__PURE__ */ new Date(), n = t.getHours() % 12, r = t.getMinutes(), i = t.getSeconds(), a = t.getMilliseconds(), c = (t, n, r, i, a) => {
233
+ let t = /* @__PURE__ */ new Date(), n = t.getHours() % 12, r = t.getMinutes(), i = t.getSeconds(), o = t.getMilliseconds(), l = (t, n, r, i, a) => {
19
234
  e.save(), e.rotate(t), e.beginPath(), e.moveTo(0, r), e.lineTo(n, 0), e.lineTo(0, -r), e.closePath(), e.fillStyle = i, e.shadowColor = a, e.shadowBlur = 4, e.fill(), e.restore();
20
- }, u = (n + r / 60) / 12 * Math.PI * 2 - Math.PI / 2, d = (r + i / 60) / 60 * Math.PI * 2 - Math.PI / 2, f = (i + a / 1e3) / 60 * Math.PI * 2 - Math.PI / 2;
21
- c(u, s * .5, 4, "#111827", "rgb(0 0 0 / 40%)"), c(d, s * .72, 3, "#1e80ff", "rgb(30 128 255 / 40%)"), c(f, s * .85, 2, "#e9686b", "rgb(233 104 107 / 40%)"), e.beginPath(), e.arc(0, 0, 5, 0, Math.PI * 2), e.fillStyle = "#111827", e.fill(), e.restore();
235
+ }, u = (n + r / 60) / 12 * Math.PI * 2 - Math.PI / 2, d = (r + i / 60) / 60 * Math.PI * 2 - Math.PI / 2, f = (i + o / 1e3) / 60 * Math.PI * 2 - Math.PI / 2;
236
+ l(u, s * .5, 4, "#111827", "rgb(0 0 0 / 40%)"), l(d, s * .72, 3, "#1e80ff", "rgb(30 128 255 / 40%)"), l(f, s * .85, 2, "#e9686b", "rgb(233 104 107 / 40%)"), e.beginPath(), e.arc(0, 0, 5, 0, Math.PI * 2), e.fillStyle = "#111827", e.fill(), e.restore();
22
237
  }, [
23
- l,
238
+ c,
24
239
  s,
25
- o
240
+ a
26
241
  ]);
27
242
  return n(() => {
28
243
  let e = i.current;
29
244
  if (!e) return;
30
245
  let t = window.devicePixelRatio || 1;
31
- e.width = o * t, e.height = o * t;
246
+ e.width = a * t, e.height = a * t;
32
247
  let n = e.getContext("2d");
33
248
  if (!n) return;
34
249
  n.setTransform(t, 0, 0, t, 0, 0);
35
- let r = 0, a = () => {
36
- d(n), r = requestAnimationFrame(a);
250
+ let r = 0, o = () => {
251
+ u(n), r = requestAnimationFrame(o);
37
252
  };
38
- return a(), () => cancelAnimationFrame(r);
39
- }, [d, o]), /* @__PURE__ */ c("div", {
40
- className: u.canvasClock,
253
+ return o(), () => cancelAnimationFrame(r);
254
+ }, [u, a]), /* @__PURE__ */ l("div", {
255
+ className: S.canvasClock,
41
256
  style: {
42
- width: o,
43
- height: o
257
+ width: a,
258
+ height: a
44
259
  },
45
- children: /* @__PURE__ */ c("canvas", {
260
+ children: /* @__PURE__ */ l("canvas", {
46
261
  ref: i,
47
- className: u.canvasTarget,
262
+ className: S.canvasTarget,
48
263
  style: {
49
- width: o,
50
- height: o
264
+ width: a,
265
+ height: a
51
266
  }
52
267
  })
53
268
  });
54
- }, f = (e) => {
55
- let t = () => e(document.hidden);
56
- return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
57
- }, p = (e, t, n) => Math.min(n, Math.max(t, e)), m = {
269
+ }, C = {
58
270
  chargeContainer: "cos-chargeContainer-4t9qo",
59
271
  contrast: "cos-contrast-PNep9",
60
272
  hueRotate: "cos-hueRotate-bMJ-k",
@@ -63,13 +275,13 @@ import './index.css';var u = {
63
275
  circle: "cos-circle-m4vwX",
64
276
  circleRotate: "cos-circleRotate-bgFw5",
65
277
  button: "cos-button-myCst"
66
- }, h = (e) => {
67
- let { initQuantity: t = 0, value: r, onChange: i, autoCharge: s = !0, interval: u = 500, step: d = .01 } = e, f = a(null), h = r !== void 0, [g, _] = o(() => p(t, 0, 100)), v = p(h ? r : g, 0, 100), y = a(v), b = a(i);
278
+ }, te = (e) => {
279
+ 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);
68
280
  n(() => {
69
- b.current = i;
281
+ v.current = i;
70
282
  }, [i]), n(() => {
71
- y.current = v;
72
- }, [v]), n(() => {
283
+ _.current = g;
284
+ }, [g]), n(() => {
73
285
  let e = f.current;
74
286
  if (!e) return;
75
287
  let t = () => {
@@ -79,55 +291,118 @@ import './index.css';var u = {
79
291
  let n = new ResizeObserver(t);
80
292
  return n.observe(e), () => n.disconnect();
81
293
  }, []), n(() => {
82
- if (!s) return;
294
+ if (!a) return;
83
295
  let e = window.setInterval(() => {
84
- if (y.current >= 100) return;
85
- let e = Math.min(100, Number((y.current + d).toFixed(2)));
86
- h ? b.current?.(e) : _(e);
87
- }, u);
296
+ if (_.current >= 100) return;
297
+ let e = Math.min(100, Number((_.current + d).toFixed(2)));
298
+ p ? v.current?.(e) : h(e);
299
+ }, c);
88
300
  return () => clearInterval(e);
89
301
  }, [
90
- s,
91
- u,
92
- h,
302
+ a,
303
+ c,
304
+ p,
93
305
  d
94
306
  ]);
95
- let x = v.toFixed(2);
96
- return /* @__PURE__ */ c("div", {
307
+ let b = g.toFixed(2);
308
+ return /* @__PURE__ */ l("div", {
97
309
  ref: f,
98
- className: m.chargeContainer,
99
- children: /* @__PURE__ */ l("div", {
100
- className: m.contrast,
310
+ className: C.chargeContainer,
311
+ children: /* @__PURE__ */ u("div", {
312
+ className: C.contrast,
101
313
  children: [
102
- /* @__PURE__ */ l("div", {
103
- className: m.text,
104
- children: [x, "%"]
314
+ /* @__PURE__ */ u("div", {
315
+ className: C.text,
316
+ children: [b, "%"]
105
317
  }),
106
- /* @__PURE__ */ c("span", {}),
107
- /* @__PURE__ */ c("span", {}),
108
- /* @__PURE__ */ c("span", {}),
109
- /* @__PURE__ */ c("span", {}),
110
- /* @__PURE__ */ c("span", {}),
111
- /* @__PURE__ */ c("span", {}),
112
- /* @__PURE__ */ c("span", {}),
113
- /* @__PURE__ */ c("span", {}),
114
- /* @__PURE__ */ c("span", {}),
115
- /* @__PURE__ */ c("span", {}),
116
- /* @__PURE__ */ c("span", {}),
117
- /* @__PURE__ */ c("span", {}),
118
- /* @__PURE__ */ c("span", {}),
119
- /* @__PURE__ */ c("span", {}),
120
- /* @__PURE__ */ c("span", {}),
121
- /* @__PURE__ */ c("div", { className: m.circle }),
122
- /* @__PURE__ */ c("div", { className: m.button })
318
+ /* @__PURE__ */ l("span", {}),
319
+ /* @__PURE__ */ l("span", {}),
320
+ /* @__PURE__ */ l("span", {}),
321
+ /* @__PURE__ */ l("span", {}),
322
+ /* @__PURE__ */ l("span", {}),
323
+ /* @__PURE__ */ l("span", {}),
324
+ /* @__PURE__ */ l("span", {}),
325
+ /* @__PURE__ */ l("span", {}),
326
+ /* @__PURE__ */ l("span", {}),
327
+ /* @__PURE__ */ l("span", {}),
328
+ /* @__PURE__ */ l("span", {}),
329
+ /* @__PURE__ */ l("span", {}),
330
+ /* @__PURE__ */ l("span", {}),
331
+ /* @__PURE__ */ l("span", {}),
332
+ /* @__PURE__ */ l("span", {}),
333
+ /* @__PURE__ */ l("div", { className: C.circle }),
334
+ /* @__PURE__ */ l("div", { className: C.button })
123
335
  ]
124
336
  })
125
337
  });
126
- }, g = {
338
+ }, w = {
339
+ clickSpark: "cos-clickSpark-db9Om",
340
+ canvas: "cos-canvas-p9fnQ",
341
+ content: "cos-content-7uE4T",
342
+ hint: "cos-hint-UqpWX"
343
+ }, ne = ({ children: e, color: r = "#fbbf24", count: i = 16 }) => {
344
+ let a = o(null), s = o(null), c = o([]), d = o(0), f = t((e, t) => {
345
+ for (let n = 0; n < i; n++) {
346
+ let r = Math.PI * 2 * n / i + Math.random() * .3, a = Math.random() * 4 + 2;
347
+ c.current.push({
348
+ x: e,
349
+ y: t,
350
+ vx: Math.cos(r) * a,
351
+ vy: Math.sin(r) * a,
352
+ alpha: 1,
353
+ size: Math.random() * 3 + 2
354
+ });
355
+ }
356
+ }, [i]);
357
+ return n(() => {
358
+ let e = s.current, t = a.current;
359
+ if (!e || !t) return;
360
+ let n = e.getContext("2d");
361
+ if (!n) return;
362
+ let i = () => {
363
+ let r = window.devicePixelRatio || 1, { width: i, height: a } = t.getBoundingClientRect();
364
+ e.width = i * r, e.height = a * r, n.setTransform(r, 0, 0, r, 0, 0);
365
+ };
366
+ i();
367
+ let o = new ResizeObserver(i);
368
+ o.observe(t);
369
+ let l = document.hidden, u = v((e) => {
370
+ l = e;
371
+ }), f = () => {
372
+ if (d.current = requestAnimationFrame(f), l) return;
373
+ let { width: e, height: i } = t.getBoundingClientRect();
374
+ n.clearRect(0, 0, e, i), c.current = c.current.filter((e) => (e.x += e.vx, e.y += e.vy, e.vy += .15, e.alpha -= .03, e.alpha <= 0 ? !1 : (n.beginPath(), n.arc(e.x, e.y, e.size, 0, Math.PI * 2), n.fillStyle = r, n.globalAlpha = e.alpha, n.fill(), n.globalAlpha = 1, !0)));
375
+ };
376
+ return f(), () => {
377
+ cancelAnimationFrame(d.current), o.disconnect(), u();
378
+ };
379
+ }, [r]), /* @__PURE__ */ u("div", {
380
+ ref: a,
381
+ className: w.clickSpark,
382
+ onClick: (e) => {
383
+ let t = a.current?.getBoundingClientRect();
384
+ t && f(e.clientX - t.left, e.clientY - t.top);
385
+ },
386
+ children: [
387
+ /* @__PURE__ */ l("canvas", {
388
+ ref: s,
389
+ className: w.canvas
390
+ }),
391
+ e && /* @__PURE__ */ l("div", {
392
+ className: w.content,
393
+ children: e
394
+ }),
395
+ !e && /* @__PURE__ */ l("p", {
396
+ className: w.hint,
397
+ children: "点击任意位置产生火花"
398
+ })
399
+ ]
400
+ });
401
+ }, T = {
127
402
  confetti: "cos-confetti-MeNtU",
128
403
  canvas: "cos-canvas-0T3Vs",
129
404
  hint: "cos-hint-sGHEi"
130
- }, _ = [
405
+ }, re = [
131
406
  "#ff6b6b",
132
407
  "#ffd93d",
133
408
  "#6bcb77",
@@ -135,7 +410,7 @@ import './index.css';var u = {
135
410
  "#a66cff",
136
411
  "#ff85c0",
137
412
  "#38bdf8"
138
- ], v = () => _[Math.floor(Math.random() * _.length)], y = (e, t, n) => {
413
+ ], ie = () => re[Math.floor(Math.random() * re.length)], ae = (e, t, n) => {
139
414
  let r = e / 2, i = t * .6;
140
415
  return Array.from({ length: n }, () => {
141
416
  let e = (Math.random() - .5) * Math.PI, t = Math.random() * 12 + 6;
@@ -146,68 +421,127 @@ import './index.css';var u = {
146
421
  vy: Math.sin(e) * t - Math.random() * 8,
147
422
  rotation: Math.random() * 360,
148
423
  rotationSpeed: (Math.random() - .5) * 12,
149
- color: v(),
424
+ color: ie(),
150
425
  width: Math.random() * 8 + 4,
151
426
  height: Math.random() * 6 + 3,
152
427
  alpha: 1,
153
428
  gravity: Math.random() * .15 + .12
154
429
  };
155
430
  });
156
- }, b = e(({ width: e = 800, height: i = 400, auto: o = !0, particleCount: s = 120 }, u) => {
157
- let d = a(null), p = a([]), m = a(0), h = a({
431
+ }, oe = e(({ width: e = 800, height: r = 400, auto: a = !0, particleCount: s = 120 }, c) => {
432
+ let d = o(null), f = o([]), p = o(0), m = o({
158
433
  width: e,
159
- height: i,
434
+ height: r,
160
435
  particleCount: s
161
436
  });
162
- h.current = {
437
+ m.current = {
163
438
  width: e,
164
- height: i,
439
+ height: r,
165
440
  particleCount: s
166
441
  };
167
- let _ = t(() => {
168
- let { width: e, height: t, particleCount: n } = h.current;
169
- p.current.push(...y(e, t, n));
442
+ let h = t(() => {
443
+ let { width: e, height: t, particleCount: n } = m.current;
444
+ f.current.push(...ae(e, t, n));
170
445
  }, []);
171
- return r(u, () => ({ burst: _ }), [_]), n(() => {
172
- o && _();
173
- }, [o, _]), n(() => {
446
+ return i(c, () => ({ burst: h }), [h]), n(() => {
447
+ a && h();
448
+ }, [a, h]), n(() => {
174
449
  let t = d.current;
175
450
  if (!t) return;
176
451
  let n = window.devicePixelRatio || 1;
177
- t.width = e * n, t.height = i * n;
178
- let r = t.getContext("2d");
179
- if (!r) return;
180
- r.setTransform(n, 0, 0, n, 0, 0);
181
- let a = document.hidden, o = f((e) => {
452
+ t.width = e * n, t.height = r * n;
453
+ let i = t.getContext("2d");
454
+ if (!i) return;
455
+ i.setTransform(n, 0, 0, n, 0, 0);
456
+ let a = document.hidden, o = v((e) => {
182
457
  a = e;
183
458
  }), s = () => {
184
- m.current = requestAnimationFrame(s), !a && (r.clearRect(0, 0, e, i), p.current = p.current.filter((e) => (e.x += e.vx, e.y += e.vy, e.vy += e.gravity, e.vx *= .99, e.rotation += e.rotationSpeed, e.alpha -= .008, e.alpha <= 0 || e.y > i + 20 ? !1 : (r.save(), r.translate(e.x, e.y), r.rotate(e.rotation * Math.PI / 180), r.globalAlpha = e.alpha, r.fillStyle = e.color, r.fillRect(-e.width / 2, -e.height / 2, e.width, e.height), r.restore(), !0))));
459
+ p.current = requestAnimationFrame(s), !a && (i.clearRect(0, 0, e, r), f.current = f.current.filter((e) => (e.x += e.vx, e.y += e.vy, e.vy += e.gravity, e.vx *= .99, e.rotation += e.rotationSpeed, e.alpha -= .008, e.alpha <= 0 || e.y > r + 20 ? !1 : (i.save(), i.translate(e.x, e.y), i.rotate(e.rotation * Math.PI / 180), i.globalAlpha = e.alpha, i.fillStyle = e.color, i.fillRect(-e.width / 2, -e.height / 2, e.width, e.height), i.restore(), !0))));
185
460
  };
186
461
  return s(), () => {
187
- cancelAnimationFrame(m.current), o();
462
+ cancelAnimationFrame(p.current), o();
188
463
  };
189
- }, [i, e]), /* @__PURE__ */ l("div", {
190
- className: g.confetti,
464
+ }, [r, e]), /* @__PURE__ */ u("div", {
465
+ className: T.confetti,
191
466
  style: {
192
467
  width: e,
193
- height: i
468
+ height: r
194
469
  },
195
- children: [/* @__PURE__ */ c("canvas", {
470
+ children: [/* @__PURE__ */ l("canvas", {
196
471
  ref: d,
197
- className: g.canvas,
472
+ className: T.canvas,
198
473
  style: {
199
474
  width: e,
200
- height: i
475
+ height: r
201
476
  },
202
- onClick: _
203
- }), /* @__PURE__ */ c("p", {
204
- className: g.hint,
477
+ onClick: h
478
+ }), /* @__PURE__ */ l("p", {
479
+ className: T.hint,
205
480
  children: "点击画布再次喷射"
206
481
  })]
207
482
  });
208
483
  });
209
- b.displayName = "Confetti";
210
- var x = {
484
+ oe.displayName = "Confetti";
485
+ var se = {
486
+ cyberGrid: "cos-cyberGrid-VgJwl",
487
+ canvas: "cos-canvas--Mq-O"
488
+ }, ce = ({ width: e = 800, height: t = 500, color: r = "#00f0ff", speed: i = 1 }) => {
489
+ let a = o(null), s = o(0), c = o(0);
490
+ return n(() => {
491
+ let n = a.current;
492
+ if (!n) return;
493
+ let o = window.devicePixelRatio || 1;
494
+ n.width = e * o, n.height = t * o;
495
+ let l = n.getContext("2d");
496
+ if (!l) return;
497
+ l.setTransform(o, 0, 0, o, 0, 0);
498
+ let u = t * .45, d = document.hidden, f = v((e) => {
499
+ d = e;
500
+ }), p = () => {
501
+ if (s.current = requestAnimationFrame(p), d) return;
502
+ c.current = (c.current + i * 1.5) % 40, l.fillStyle = "#050510", l.fillRect(0, 0, e, t);
503
+ let n = l.createLinearGradient(0, 0, 0, u);
504
+ n.addColorStop(0, "#0a0a20"), n.addColorStop(1, "#050510"), l.fillStyle = n, l.fillRect(0, 0, e, u);
505
+ let a = e / 2;
506
+ l.strokeStyle = r, l.shadowColor = r, l.shadowBlur = 8, l.lineWidth = 1;
507
+ for (let n = -12; n <= 12; n++) {
508
+ let r = n / 12 * e * 1.2;
509
+ l.beginPath(), l.moveTo(a + r * .05, u), l.lineTo(a + r, t), l.globalAlpha = .3 + (1 - Math.abs(n) / 12) * .5, l.stroke();
510
+ }
511
+ l.globalAlpha = 1;
512
+ let o = Math.ceil(t / 40) + 2;
513
+ for (let n = 0; n < o; n++) {
514
+ let r = u + (n * 40 + c.current) / (t - u) * (t - u) % (t - u), i = (r - u) / (t - u) * .8;
515
+ l.beginPath(), l.moveTo(0, r), l.lineTo(e, r), l.globalAlpha = i, l.stroke();
516
+ }
517
+ l.shadowBlur = 0, l.globalAlpha = 1;
518
+ let f = l.createRadialGradient(a, u, 0, a, u, e * .4);
519
+ f.addColorStop(0, `${r}33`), f.addColorStop(1, "transparent"), l.fillStyle = f, l.fillRect(0, 0, e, t);
520
+ };
521
+ return p(), () => {
522
+ cancelAnimationFrame(s.current), f();
523
+ };
524
+ }, [
525
+ r,
526
+ t,
527
+ i,
528
+ e
529
+ ]), /* @__PURE__ */ l("div", {
530
+ className: se.cyberGrid,
531
+ style: {
532
+ width: e,
533
+ height: t
534
+ },
535
+ children: /* @__PURE__ */ l("canvas", {
536
+ ref: a,
537
+ className: se.canvas,
538
+ style: {
539
+ width: e,
540
+ height: t
541
+ }
542
+ })
543
+ });
544
+ }, E = {
211
545
  countdown: "cos-countdown-5ZKKP",
212
546
  unit: "cos-unit-dth8N",
213
547
  value: "cos-value-yVzcP",
@@ -215,7 +549,7 @@ var x = {
215
549
  ended: "cos-ended-c0dsD",
216
550
  pulse: "cos-pulse-krQd-",
217
551
  invalid: "cos-invalid-d6t-L"
218
- }, S = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : new Date(e).getTime(), C = (e) => {
552
+ }, le = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : new Date(e).getTime(), ue = (e) => {
219
553
  let t = Math.max(0, e - Date.now()), n = Math.floor(t / 1e3);
220
554
  return {
221
555
  total: t,
@@ -224,7 +558,7 @@ var x = {
224
558
  minutes: Math.floor(n % 3600 / 60),
225
559
  seconds: n % 60
226
560
  };
227
- }, ee = [
561
+ }, de = [
228
562
  {
229
563
  key: "days",
230
564
  label: "天"
@@ -241,8 +575,8 @@ var x = {
241
575
  key: "seconds",
242
576
  label: "秒"
243
577
  }
244
- ], w = ({ targetDate: e, onEnd: t, showLabels: r = !0, color: s = "#f472b6" }) => {
245
- let u = i(() => S(e), [e]), d = !Number.isNaN(u), [, f] = o(0), p = a(!1), m = a(t), h = d ? C(u) : {
578
+ ], fe = ({ targetDate: e, onEnd: t, showLabels: r = !0, color: i = "#f472b6" }) => {
579
+ let c = a(() => le(e), [e]), d = !Number.isNaN(c), [, f] = s(0), p = o(!1), m = o(t), h = d ? ue(c) : {
246
580
  days: 0,
247
581
  hours: 0,
248
582
  minutes: 0,
@@ -255,44 +589,333 @@ var x = {
255
589
  if (!d) return;
256
590
  p.current = !1;
257
591
  let e = window.setInterval(() => {
258
- f((e) => e + 1), Date.now() >= u && !p.current && (p.current = !0, m.current?.(), clearInterval(e));
592
+ f((e) => e + 1), Date.now() >= c && !p.current && (p.current = !0, m.current?.(), clearInterval(e));
259
593
  }, 1e3);
260
594
  return () => clearInterval(e);
261
- }, [d, u]), d ? /* @__PURE__ */ l("div", {
262
- className: x.countdown,
263
- style: { "--countdown-color": s },
264
- children: [ee.map(({ key: e, label: t }) => /* @__PURE__ */ l("div", {
265
- className: x.unit,
266
- children: [/* @__PURE__ */ c("div", {
267
- className: x.value,
595
+ }, [d, c]), d ? /* @__PURE__ */ u("div", {
596
+ className: E.countdown,
597
+ style: { "--countdown-color": i },
598
+ children: [de.map(({ key: e, label: t }) => /* @__PURE__ */ u("div", {
599
+ className: E.unit,
600
+ children: [/* @__PURE__ */ l("div", {
601
+ className: E.value,
268
602
  children: String(h[e]).padStart(2, "0")
269
- }), r && /* @__PURE__ */ c("span", {
270
- className: x.label,
603
+ }), r && /* @__PURE__ */ l("span", {
604
+ className: E.label,
271
605
  children: t
272
606
  })]
273
- }, e)), h.total <= 0 && /* @__PURE__ */ c("p", {
274
- className: x.ended,
607
+ }, e)), h.total <= 0 && /* @__PURE__ */ l("p", {
608
+ className: E.ended,
275
609
  children: "时间到!"
276
610
  })]
277
- }) : /* @__PURE__ */ c("div", {
278
- className: x.countdown,
279
- children: /* @__PURE__ */ c("p", {
280
- className: x.invalid,
611
+ }) : /* @__PURE__ */ l("div", {
612
+ className: E.countdown,
613
+ children: /* @__PURE__ */ l("p", {
614
+ className: E.invalid,
281
615
  children: "无效的目标时间"
282
616
  })
283
617
  });
284
- }, T = {
618
+ }, pe = {
619
+ dnaHelix: "cos-dnaHelix-nEQLW",
620
+ canvas: "cos-canvas-uEV8B"
621
+ }, me = ({ width: e = 200, height: t = 360, speed: r = 1, color: i = "#38bdf8" }) => {
622
+ let a = o(null);
623
+ return n(() => {
624
+ let n = a.current;
625
+ if (!n) return;
626
+ let o = window.devicePixelRatio || 1;
627
+ n.width = e * o, n.height = t * o;
628
+ let s = n.getContext("2d");
629
+ if (!s) return;
630
+ s.setTransform(o, 0, 0, o, 0, 0);
631
+ let c = 0, l = 0, u = document.hidden, d = v((e) => {
632
+ u = e;
633
+ }), f = () => {
634
+ if (l = requestAnimationFrame(f), u) return;
635
+ c += .03 * r, s.fillStyle = "#0f172a", s.fillRect(0, 0, e, t);
636
+ let n = e / 2, a = e * .32;
637
+ for (let e = 0; e < 18; e++) {
638
+ let r = e / 17 * (t - 40) + 20, o = c + e * .4, l = n + Math.sin(o) * a, u = n + Math.sin(o + Math.PI) * a, d = Math.cos(o), f = 5 + d * 2;
639
+ s.beginPath(), s.moveTo(l, r), s.lineTo(u, r), s.strokeStyle = `rgb(148 163 184 / ${30 + Math.abs(d) * 30}%)`, s.lineWidth = 1.5, s.stroke(), s.beginPath(), s.arc(l, r, f, 0, Math.PI * 2), s.fillStyle = d > 0 ? i : "#a78bfa", s.fill(), s.beginPath(), s.arc(u, r, f, 0, Math.PI * 2), s.fillStyle = d > 0 ? "#a78bfa" : i, s.fill();
640
+ }
641
+ };
642
+ return f(), () => {
643
+ cancelAnimationFrame(l), d();
644
+ };
645
+ }, [
646
+ i,
647
+ t,
648
+ r,
649
+ e
650
+ ]), /* @__PURE__ */ l("div", {
651
+ className: pe.dnaHelix,
652
+ style: {
653
+ width: e,
654
+ height: t
655
+ },
656
+ children: /* @__PURE__ */ l("canvas", {
657
+ ref: a,
658
+ className: pe.canvas,
659
+ style: {
660
+ width: e,
661
+ height: t
662
+ }
663
+ })
664
+ });
665
+ }, he = {
666
+ electricArc: "cos-electricArc-BFlY3",
667
+ canvas: "cos-canvas-iowDx"
668
+ }, D = (e, t, n, r, i, a) => {
669
+ if (a <= 0) return [[e, t], [n, r]];
670
+ let o = (e + n) / 2, s = (t + r) / 2, c = n - e, l = r - t, u = Math.hypot(c, l) || 1, d = (Math.random() - .5) * i, f = -l / u * d, p = c / u * d, m = D(e, t, o + f, s + p, i * .6, a - 1), h = D(o + f, s + p, n, r, i * .6, a - 1);
671
+ return [...m.slice(0, -1), ...h];
672
+ }, ge = ({ width: e = 320, height: t = 160, color: r = "#67e8f9" }) => {
673
+ let i = o(null);
674
+ return n(() => {
675
+ let n = i.current;
676
+ if (!n) return;
677
+ let a = window.devicePixelRatio || 1;
678
+ n.width = e * a, n.height = t * a;
679
+ let o = n.getContext("2d");
680
+ if (!o) return;
681
+ o.setTransform(a, 0, 0, a, 0, 0);
682
+ let s = t / 2, c = e - 40, l = t / 2, u = 0, d = document.hidden, f = v((e) => {
683
+ d = e;
684
+ }), p = () => {
685
+ if (u = requestAnimationFrame(p), d) return;
686
+ o.fillStyle = "#0f172a", o.fillRect(0, 0, e, t);
687
+ let n = D(40, s, c, l, 40, 5);
688
+ o.beginPath(), n.forEach(([e, t], n) => n === 0 ? o.moveTo(e, t) : o.lineTo(e, t)), o.strokeStyle = r, o.lineWidth = 2, o.shadowColor = r, o.shadowBlur = 12, o.stroke(), o.shadowBlur = 0, o.beginPath(), n.forEach(([e, t], n) => n === 0 ? o.moveTo(e, t) : o.lineTo(e, t)), o.strokeStyle = "#fff", o.lineWidth = .8, o.globalAlpha = .6, o.stroke(), o.globalAlpha = 1, [[40, s], [c, l]].forEach(([e, t]) => {
689
+ o.beginPath(), o.arc(e, t, 6, 0, Math.PI * 2), o.fillStyle = r, o.fill();
690
+ });
691
+ };
692
+ return p(), () => {
693
+ cancelAnimationFrame(u), f();
694
+ };
695
+ }, [
696
+ r,
697
+ t,
698
+ e
699
+ ]), /* @__PURE__ */ l("div", {
700
+ className: he.electricArc,
701
+ style: {
702
+ width: e,
703
+ height: t
704
+ },
705
+ children: /* @__PURE__ */ l("canvas", {
706
+ ref: i,
707
+ className: he.canvas,
708
+ style: {
709
+ width: e,
710
+ height: t
711
+ }
712
+ })
713
+ });
714
+ }, O = {
715
+ cursorTrail: "cos-cursorTrail-fpz5p",
716
+ canvas: "cos-canvas-Iuyp3",
717
+ hint: "cos-hint-9GLHx"
718
+ }, _e = ({ color: e = "#38bdf8", length: t = 20, width: r = 800, height: i = 400 }) => {
719
+ let a = o(null), s = o([]), c = o({
720
+ x: r / 2,
721
+ y: i / 2
722
+ }), d = o(0);
723
+ return n(() => {
724
+ let n = a.current;
725
+ if (!n) return;
726
+ let o = window.devicePixelRatio || 1;
727
+ n.width = r * o, n.height = i * o;
728
+ let l = n.getContext("2d");
729
+ if (!l) return;
730
+ l.setTransform(o, 0, 0, o, 0, 0);
731
+ let u = document.hidden, f = v((e) => {
732
+ u = e;
733
+ }), p = () => {
734
+ if (d.current = requestAnimationFrame(p), u) return;
735
+ let { x: n, y: a } = c.current;
736
+ s.current.unshift({
737
+ x: n,
738
+ y: a,
739
+ life: 1
740
+ }), s.current.length > t && (s.current.length = t), l.fillStyle = "rgb(15 23 42 / 15%)", l.fillRect(0, 0, r, i);
741
+ let o = s.current;
742
+ for (let t = 0; t < o.length; t++) {
743
+ let n = o[t], r = 1 - t / o.length, i = (1 - t / o.length) * 8 + 2;
744
+ l.beginPath(), l.arc(n.x, n.y, i, 0, Math.PI * 2), l.fillStyle = e, l.globalAlpha = r * .8, l.fill();
745
+ }
746
+ l.globalAlpha = 1;
747
+ };
748
+ return p(), () => {
749
+ cancelAnimationFrame(d.current), f();
750
+ };
751
+ }, [
752
+ e,
753
+ i,
754
+ t,
755
+ r
756
+ ]), /* @__PURE__ */ u("div", {
757
+ className: O.cursorTrail,
758
+ style: {
759
+ width: r,
760
+ height: i
761
+ },
762
+ children: [/* @__PURE__ */ l("canvas", {
763
+ ref: a,
764
+ className: O.canvas,
765
+ style: {
766
+ width: r,
767
+ height: i
768
+ },
769
+ onMouseMove: (e) => {
770
+ let t = e.currentTarget.getBoundingClientRect();
771
+ c.current = {
772
+ x: e.clientX - t.left,
773
+ y: e.clientY - t.top
774
+ };
775
+ }
776
+ }), /* @__PURE__ */ l("p", {
777
+ className: O.hint,
778
+ children: "移动鼠标查看粒子轨迹"
779
+ })]
780
+ });
781
+ }, k = {
782
+ diceRoll: "cos-diceRoll-GDwjV",
783
+ scene: "cos-scene-tmnKM",
784
+ cube: "cos-cube-RklEa",
785
+ rolling: "cos-rolling-2ocEq",
786
+ face: "cos-face-10eAF",
787
+ dot: "cos-dot-p5AzF",
788
+ face1: "cos-face1-Ev-x5",
789
+ face2: "cos-face2-2M17p",
790
+ face3: "cos-face3-Wd6T4",
791
+ face4: "cos-face4-RsRwQ",
792
+ face5: "cos-face5-PiJbu",
793
+ face6: "cos-face6-Yp-MX",
794
+ rollBtn: "cos-rollBtn-nXMWJ",
795
+ result: "cos-result-kXzu9"
796
+ }, ve = {
797
+ 1: {
798
+ x: 0,
799
+ y: 0
800
+ },
801
+ 2: {
802
+ x: 0,
803
+ y: 180
804
+ },
805
+ 3: {
806
+ x: 0,
807
+ y: -90
808
+ },
809
+ 4: {
810
+ x: 0,
811
+ y: 90
812
+ },
813
+ 5: {
814
+ x: -90,
815
+ y: 0
816
+ },
817
+ 6: {
818
+ x: 90,
819
+ y: 0
820
+ }
821
+ }, ye = ({ onRoll: e, sides: t = 6 }) => {
822
+ let [n, r] = s(!1), [i, a] = s(1), [o, c] = s({
823
+ x: 0,
824
+ y: 0,
825
+ z: 0
826
+ }), d = () => {
827
+ if (n) return;
828
+ r(!0);
829
+ let i = Math.floor(Math.random() * t) + 1, o = ve[i] ?? ve[1], s = 360 * (3 + Math.floor(Math.random() * 3)), l = 360 * (3 + Math.floor(Math.random() * 3));
830
+ c({
831
+ x: o.x + s,
832
+ y: o.y + l,
833
+ z: Math.random() * 360
834
+ }), window.setTimeout(() => {
835
+ a(i), r(!1), e?.(i);
836
+ }, 1200);
837
+ }, f = (e) => ({
838
+ 1: [[50, 50]],
839
+ 2: [[25, 25], [75, 75]],
840
+ 3: [
841
+ [25, 25],
842
+ [50, 50],
843
+ [75, 75]
844
+ ],
845
+ 4: [
846
+ [25, 25],
847
+ [75, 25],
848
+ [25, 75],
849
+ [75, 75]
850
+ ],
851
+ 5: [
852
+ [25, 25],
853
+ [75, 25],
854
+ [50, 50],
855
+ [25, 75],
856
+ [75, 75]
857
+ ],
858
+ 6: [
859
+ [25, 25],
860
+ [75, 25],
861
+ [25, 50],
862
+ [75, 50],
863
+ [25, 75],
864
+ [75, 75]
865
+ ]
866
+ }[e] ?? []).map(([e, t], n) => /* @__PURE__ */ l("span", {
867
+ className: k.dot,
868
+ style: {
869
+ left: `${e}%`,
870
+ top: `${t}%`
871
+ }
872
+ }, n));
873
+ return /* @__PURE__ */ u("div", {
874
+ className: k.diceRoll,
875
+ children: [
876
+ /* @__PURE__ */ l("div", {
877
+ className: k.scene,
878
+ children: /* @__PURE__ */ l("div", {
879
+ className: `${k.cube} ${n ? k.rolling : ""}`,
880
+ style: { transform: `rotateX(${o.x}deg) rotateY(${o.y}deg) rotateZ(${o.z}deg)` },
881
+ children: [
882
+ 1,
883
+ 2,
884
+ 3,
885
+ 4,
886
+ 5,
887
+ 6
888
+ ].map((e) => /* @__PURE__ */ l("div", {
889
+ className: `${k.face} ${k[`face${e}`]}`,
890
+ children: f(e)
891
+ }, e))
892
+ })
893
+ }),
894
+ /* @__PURE__ */ l("button", {
895
+ type: "button",
896
+ className: k.rollBtn,
897
+ onClick: d,
898
+ disabled: n,
899
+ children: n ? "掷骰中..." : "掷骰子"
900
+ }),
901
+ !n && /* @__PURE__ */ u("p", {
902
+ className: k.result,
903
+ children: ["点数: ", i]
904
+ })
905
+ ]
906
+ });
907
+ }, A = {
285
908
  fireworks: "cos-fireworks-fsSqL",
286
909
  canvas: "cos-canvas-spL8G",
287
910
  hint: "cos-hint-5XDRH"
288
- }, E = [
911
+ }, be = [
289
912
  "#ff6b6b",
290
913
  "#ffd93d",
291
914
  "#6bcb77",
292
915
  "#4d96ff",
293
916
  "#a66cff",
294
917
  "#ff85c0"
295
- ], D = .12, O = 240, k = () => E[Math.floor(Math.random() * E.length)], A = (e, t, n) => {
918
+ ], xe = .12, Se = 240, Ce = () => be[Math.floor(Math.random() * be.length)], we = (e, t, n) => {
296
919
  let r = 60 + Math.floor(Math.random() * 30);
297
920
  return Array.from({ length: r }, () => {
298
921
  let r = Math.random() * Math.PI * 2, i = Math.random() * 4 + 2;
@@ -302,77 +925,77 @@ var x = {
302
925
  vx: Math.cos(r) * i,
303
926
  vy: Math.sin(r) * i,
304
927
  alpha: 1,
305
- color: Math.random() > .3 ? n : k(),
928
+ color: Math.random() > .3 ? n : Ce(),
306
929
  decay: Math.random() * .015 + .01
307
930
  };
308
931
  });
309
- }, j = e(({ width: e = 800, height: i = 500, auto: o = !0 }, s) => {
310
- let u = a(null), d = a([]), p = a(0), m = t((t) => {
932
+ }, Te = e(({ width: e = 800, height: r = 500, auto: a = !0 }, s) => {
933
+ let c = o(null), d = o([]), f = o(0), p = t((t) => {
311
934
  let n = t ?? Math.random() * e * .6 + e * .2;
312
935
  d.current.push({
313
936
  x: n,
314
- y: i,
937
+ y: r,
315
938
  vy: -(Math.random() * 4 + 6),
316
- targetY: Math.random() * i * .35 + i * .15,
317
- color: k(),
939
+ targetY: Math.random() * r * .35 + r * .15,
940
+ color: Ce(),
318
941
  exploded: !1,
319
942
  particles: [],
320
943
  age: 0
321
944
  });
322
- }, [i, e]);
323
- return r(s, () => ({ launch: m }), [m]), n(() => {
324
- let t = u.current;
945
+ }, [r, e]);
946
+ return i(s, () => ({ launch: p }), [p]), n(() => {
947
+ let t = c.current;
325
948
  if (!t) return;
326
949
  let n = window.devicePixelRatio || 1;
327
- t.width = e * n, t.height = i * n;
328
- let r = t.getContext("2d");
329
- if (!r) return;
330
- r.setTransform(n, 0, 0, n, 0, 0);
331
- let a = 0, s = document.hidden, c = f((e) => {
950
+ t.width = e * n, t.height = r * n;
951
+ let i = t.getContext("2d");
952
+ if (!i) return;
953
+ i.setTransform(n, 0, 0, n, 0, 0);
954
+ let o = 0, s = document.hidden, l = v((e) => {
332
955
  s = e;
333
- }), l = () => {
334
- p.current = requestAnimationFrame(l), !s && (r.fillStyle = "rgb(15 23 42 / 25%)", r.fillRect(0, 0, e, i), d.current = d.current.filter((e) => {
956
+ }), u = () => {
957
+ f.current = requestAnimationFrame(u), !s && (i.fillStyle = "rgb(15 23 42 / 25%)", i.fillRect(0, 0, e, r), d.current = d.current.filter((e) => {
335
958
  if (!e.exploded) {
336
- e.age += 1, e.y += e.vy, e.vy += D, r.beginPath(), r.arc(e.x, e.y, 2.5, 0, Math.PI * 2), r.fillStyle = e.color, r.fill();
337
- let t = e.vy >= 0, n = e.y <= e.targetY, i = e.y < 0, a = e.age >= O;
338
- return (t || n || i || a) && (e.exploded = !0, e.particles = A(e.x, e.y, e.color)), !0;
959
+ e.age += 1, e.y += e.vy, e.vy += xe, i.beginPath(), i.arc(e.x, e.y, 2.5, 0, Math.PI * 2), i.fillStyle = e.color, i.fill();
960
+ let t = e.vy >= 0, n = e.y <= e.targetY, r = e.y < 0, a = e.age >= Se;
961
+ return (t || n || r || a) && (e.exploded = !0, e.particles = we(e.x, e.y, e.color)), !0;
339
962
  }
340
- 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 : (r.beginPath(), r.arc(e.x, e.y, 2, 0, Math.PI * 2), r.fillStyle = e.color, r.globalAlpha = e.alpha, r.fill(), r.globalAlpha = 1, !0))), e.particles.length > 0;
963
+ 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;
341
964
  }));
342
965
  };
343
- return l(), o && (a = window.setInterval(() => m(), 1200)), () => {
344
- cancelAnimationFrame(p.current), clearInterval(a), c();
966
+ return u(), a && (o = window.setInterval(() => p(), 1200)), () => {
967
+ cancelAnimationFrame(f.current), clearInterval(o), l();
345
968
  };
346
969
  }, [
347
- o,
348
- i,
349
- m,
970
+ a,
971
+ r,
972
+ p,
350
973
  e
351
- ]), /* @__PURE__ */ l("div", {
352
- className: T.fireworks,
974
+ ]), /* @__PURE__ */ u("div", {
975
+ className: A.fireworks,
353
976
  style: {
354
977
  width: e,
355
- height: i
978
+ height: r
356
979
  },
357
- children: [/* @__PURE__ */ c("canvas", {
358
- ref: u,
359
- className: T.canvas,
980
+ children: [/* @__PURE__ */ l("canvas", {
981
+ ref: c,
982
+ className: A.canvas,
360
983
  style: {
361
984
  width: e,
362
- height: i
985
+ height: r
363
986
  },
364
987
  onClick: (e) => {
365
988
  let t = e.currentTarget.getBoundingClientRect();
366
- m(e.clientX - t.left);
989
+ p(e.clientX - t.left);
367
990
  }
368
- }), /* @__PURE__ */ c("p", {
369
- className: T.hint,
991
+ }), /* @__PURE__ */ l("p", {
992
+ className: A.hint,
370
993
  children: "点击画布燃放烟花"
371
994
  })]
372
995
  });
373
996
  });
374
- j.displayName = "Fireworks";
375
- var M = {
997
+ Te.displayName = "Fireworks";
998
+ var j = {
376
999
  flipCounter: "cos-flipCounter-3LuI0",
377
1000
  digit: "cos-digit-yJRPy",
378
1001
  digitCard: "cos-digitCard-zZUzt",
@@ -384,61 +1007,84 @@ var M = {
384
1007
  isFlipping: "cos-isFlipping-EVEdI",
385
1008
  "fold-top": "cos-fold-top-v-6XJ",
386
1009
  "unfold-bottom": "cos-unfold-bottom-e2gzU"
387
- }, N = (e, t) => Math.max(0, Math.floor(e)).toString().padStart(t, "0").slice(-t), P = ({ digit: e, color: t, duration: r }) => {
388
- let i = a(e), [u, d] = o(!1), [f, p] = o(e);
1010
+ }, Ee = (e, t) => Math.max(0, Math.floor(e)).toString().padStart(t, "0").slice(-t), De = ({ digit: e, color: t, duration: r }) => {
1011
+ let i = o(e), [a, d] = s(!1), [f, p] = s(e);
389
1012
  n(() => {
390
1013
  if (e === i.current) return;
391
1014
  p(i.current), d(!0), i.current = e;
392
1015
  let t = window.setTimeout(() => d(!1), r);
393
1016
  return () => clearTimeout(t);
394
1017
  }, [e, r]);
395
- let m = u ? f : e;
396
- return /* @__PURE__ */ c("div", {
397
- className: M.digit,
1018
+ let m = a ? f : e;
1019
+ return /* @__PURE__ */ l("div", {
1020
+ className: j.digit,
398
1021
  style: {
399
1022
  "--flip-color": t,
400
1023
  "--flip-duration": `${r}ms`
401
1024
  },
402
- children: /* @__PURE__ */ l("div", {
403
- className: `${M.digitCard} ${u ? M.isFlipping : ""}`,
1025
+ children: /* @__PURE__ */ u("div", {
1026
+ className: `${j.digitCard} ${a ? j.isFlipping : ""}`,
404
1027
  children: [
405
- /* @__PURE__ */ c("div", {
406
- className: M.staticTop,
407
- children: /* @__PURE__ */ c("span", { children: m })
1028
+ /* @__PURE__ */ l("div", {
1029
+ className: j.staticTop,
1030
+ children: /* @__PURE__ */ l("span", { children: m })
408
1031
  }),
409
- /* @__PURE__ */ c("div", {
410
- className: M.staticBottom,
411
- children: /* @__PURE__ */ c("span", { children: m })
1032
+ /* @__PURE__ */ l("div", {
1033
+ className: j.staticBottom,
1034
+ children: /* @__PURE__ */ l("span", { children: m })
412
1035
  }),
413
- u && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", {
414
- className: `${M.flap} ${M.flapTop}`,
415
- children: /* @__PURE__ */ c("span", { children: f })
416
- }), /* @__PURE__ */ c("div", {
417
- className: `${M.flap} ${M.flapBottom}`,
418
- children: /* @__PURE__ */ c("span", { children: e })
1036
+ a && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
1037
+ className: `${j.flap} ${j.flapTop}`,
1038
+ children: /* @__PURE__ */ l("span", { children: f })
1039
+ }), /* @__PURE__ */ l("div", {
1040
+ className: `${j.flap} ${j.flapBottom}`,
1041
+ children: /* @__PURE__ */ l("span", { children: e })
419
1042
  })] })
420
1043
  ]
421
1044
  })
422
1045
  });
423
- }, F = ({ value: e, digits: t = 4, color: n = "#38bdf8", duration: r = 600 }) => {
424
- let i = N(e, t).split("");
425
- return /* @__PURE__ */ c("div", {
426
- className: M.flipCounter,
427
- children: i.map((e, t) => /* @__PURE__ */ c(P, {
1046
+ }, Oe = ({ value: e, digits: t = 4, color: n = "#38bdf8", duration: r = 600 }) => {
1047
+ let i = Ee(e, t).split("");
1048
+ return /* @__PURE__ */ l("div", {
1049
+ className: j.flipCounter,
1050
+ children: i.map((e, t) => /* @__PURE__ */ l(De, {
428
1051
  digit: e,
429
1052
  color: n,
430
1053
  duration: r
431
1054
  }, t))
432
1055
  });
433
- }, I = {
1056
+ }, ke = {
1057
+ gradientFlow: "cos-gradientFlow-XhN16",
1058
+ text: "cos-text-ORuqk",
1059
+ flow: "cos-flow-9FzMA"
1060
+ }, Ae = [
1061
+ "#ff00de",
1062
+ "#7c3aed",
1063
+ "#00f0ff",
1064
+ "#38bdf8",
1065
+ "#ff00de"
1066
+ ], je = ({ text: e = "GRADIENT", colors: t = Ae, fontSize: n = 64 }) => {
1067
+ let r = t.length >= 2 ? t.join(", ") : Ae.join(", ");
1068
+ return /* @__PURE__ */ l("div", {
1069
+ className: ke.gradientFlow,
1070
+ children: /* @__PURE__ */ l("h1", {
1071
+ className: ke.text,
1072
+ style: {
1073
+ fontSize: n,
1074
+ backgroundImage: `linear-gradient(90deg, ${r})`
1075
+ },
1076
+ children: e
1077
+ })
1078
+ });
1079
+ }, Me = {
434
1080
  glitchText: "cos-glitchText-dZ-sR",
435
1081
  text: "cos-text-JsPHN",
436
1082
  "glitch-1": "cos-glitch-1-s9pqH",
437
1083
  "glitch-2": "cos-glitch-2-GhFB-"
438
- }, te = ({ text: e = "GLITCH", color: t = "#f8fafc", glitchColor1: n = "#ff00de", glitchColor2: r = "#00f0ff", fontSize: i = 64 }) => /* @__PURE__ */ c("div", {
439
- className: I.glitchText,
440
- children: /* @__PURE__ */ c("h1", {
441
- className: I.text,
1084
+ }, Ne = ({ text: e = "GLITCH", color: t = "#f8fafc", glitchColor1: n = "#ff00de", glitchColor2: r = "#00f0ff", fontSize: i = 64 }) => /* @__PURE__ */ l("div", {
1085
+ className: Me.glitchText,
1086
+ children: /* @__PURE__ */ l("h1", {
1087
+ className: Me.text,
442
1088
  "data-text": e,
443
1089
  style: {
444
1090
  fontSize: i,
@@ -448,70 +1094,403 @@ var M = {
448
1094
  },
449
1095
  children: e
450
1096
  })
451
- }), L = {
452
- matrixRain: "cos-matrixRain-qg9HC",
453
- canvas: "cos-canvas--AvpG",
454
- overlay: "cos-overlay-knj3b",
455
- title: "cos-title-sDfhs",
456
- flicker: "cos-flicker-smHxl",
457
- subtitle: "cos-subtitle-CWheW"
458
- }, ne = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*アイウエオカキクケコ", R = ({ width: e = 800, height: t = 500, density: r = .6, color: i = "#00ff41", showOverlay: o = !0, title: s = "MATRIX", subtitle: u = "数字雨效果" }) => {
459
- let d = a(null);
1097
+ }), Pe = {
1098
+ gravityBalls: "cos-gravityBalls-LdwFo",
1099
+ canvas: "cos-canvas-n7esd"
1100
+ }, Fe = [
1101
+ "#38bdf8",
1102
+ "#a78bfa",
1103
+ "#f472b6",
1104
+ "#4ade80",
1105
+ "#fbbf24"
1106
+ ], Ie = ({ width: e = 400, height: t = 300, ballCount: r = 12 }) => {
1107
+ let i = o(null), a = o([]);
460
1108
  return n(() => {
461
- let n = d.current;
462
- if (!n) return;
463
- let a = window.devicePixelRatio || 1;
464
- n.width = e * a, n.height = t * a;
465
- let o = n.getContext("2d");
466
- if (!o) return;
467
- o.setTransform(a, 0, 0, a, 0, 0);
468
- let s = Math.floor(e / 16 * r), c = Array.from({ length: s }, () => Math.random() * -50), l = 0, u = document.hidden, p = f((e) => {
469
- u = e;
470
- }), m = () => {
471
- l = requestAnimationFrame(m), !u && (o.fillStyle = "rgb(0 0 0 / 8%)", o.fillRect(0, 0, e, t), o.font = "16px monospace", c.forEach((e, n) => {
472
- let a = ne[Math.floor(Math.random() * 53)], s = n / r * 16;
473
- o.fillStyle = i, o.fillText(a, s, e * 16), e * 16 > t && Math.random() > .975 && (c[n] = 0), c[n] += 1;
474
- }));
475
- };
476
- return m(), () => {
477
- cancelAnimationFrame(l), p();
478
- };
1109
+ a.current = Array.from({ length: r }, () => ({
1110
+ x: Math.random() * (e - 40) + 20,
1111
+ y: t * .5 * Math.random() + 10,
1112
+ vx: (Math.random() - .5) * 4,
1113
+ vy: Math.random() * 2,
1114
+ r: Math.random() * 10 + 8,
1115
+ color: Fe[Math.floor(Math.random() * Fe.length)]
1116
+ }));
479
1117
  }, [
480
- i,
481
1118
  r,
482
1119
  t,
483
1120
  e
484
- ]), /* @__PURE__ */ l("div", {
485
- className: L.matrixRain,
1121
+ ]), n(() => {
1122
+ let n = i.current;
1123
+ if (!n) return;
1124
+ let r = window.devicePixelRatio || 1;
1125
+ n.width = e * r, n.height = t * r;
1126
+ let o = n.getContext("2d");
1127
+ if (!o) return;
1128
+ o.setTransform(r, 0, 0, r, 0, 0);
1129
+ let s = 0, c = document.hidden, l = v((e) => {
1130
+ c = e;
1131
+ }), u = () => {
1132
+ if (s = requestAnimationFrame(u), c) return;
1133
+ let n = a.current;
1134
+ o.fillStyle = "#0f172a", o.fillRect(0, 0, e, t);
1135
+ for (let r of n) r.vy += .25, r.x += r.vx, r.y += r.vy, r.x - r.r < 0 ? (r.x = r.r, r.vx *= -.99) : r.x + r.r > e && (r.x = e - r.r, r.vx *= -.99), r.y + r.r > t && (r.y = t - r.r, r.vy *= -.99, r.vx *= .99), r.y - r.r < 0 && (r.y = r.r, r.vy *= -.99);
1136
+ for (let e = 0; e < n.length; e++) for (let t = e + 1; t < n.length; t++) {
1137
+ let r = n[e], i = n[t], a = i.x - r.x, o = i.y - r.y, s = Math.hypot(a, o) || .001, c = r.r + i.r;
1138
+ if (s < c) {
1139
+ let e = a / s, t = o / s, n = c - s;
1140
+ r.x -= e * n * .5, r.y -= t * n * .5, i.x += e * n * .5, i.y += t * n * .5;
1141
+ let l = (r.vx - i.vx) * e + (r.vy - i.vy) * t;
1142
+ l > 0 && (r.vx -= l * e, r.vy -= l * t, i.vx += l * e, i.vy += l * t);
1143
+ }
1144
+ }
1145
+ for (let e of n) {
1146
+ o.beginPath(), o.arc(e.x, e.y, e.r, 0, Math.PI * 2);
1147
+ let t = o.createRadialGradient(e.x - e.r * .3, e.y - e.r * .3, 0, e.x, e.y, e.r);
1148
+ t.addColorStop(0, "#fff"), t.addColorStop(.3, e.color), t.addColorStop(1, e.color), o.fillStyle = t, o.fill();
1149
+ }
1150
+ };
1151
+ return u(), () => {
1152
+ cancelAnimationFrame(s), l();
1153
+ };
1154
+ }, [t, e]), /* @__PURE__ */ l("div", {
1155
+ className: Pe.gravityBalls,
486
1156
  style: {
487
1157
  width: e,
488
1158
  height: t
489
1159
  },
490
- children: [/* @__PURE__ */ c("canvas", {
1160
+ children: /* @__PURE__ */ l("canvas", {
1161
+ ref: i,
1162
+ className: Pe.canvas,
1163
+ style: {
1164
+ width: e,
1165
+ height: t
1166
+ }
1167
+ })
1168
+ });
1169
+ }, M = {
1170
+ wrap: "cos-wrap-r1gGL",
1171
+ card: "cos-card-3W10s",
1172
+ shine: "cos-shine-0xjID",
1173
+ image: "cos-image-AV2XG",
1174
+ placeholder: "cos-placeholder-wuuL3",
1175
+ info: "cos-info-CNR0r"
1176
+ }, Le = ({ title: e = "全息卡片", subtitle: t = "移动鼠标体验 3D 效果", image: n }) => {
1177
+ let r = o(null);
1178
+ return /* @__PURE__ */ l("div", {
1179
+ className: M.wrap,
1180
+ children: /* @__PURE__ */ u("div", {
1181
+ ref: r,
1182
+ className: M.card,
1183
+ onMouseMove: (e) => {
1184
+ let t = r.current;
1185
+ if (!t) return;
1186
+ let n = t.getBoundingClientRect(), i = (e.clientX - n.left) / n.width - .5, a = (e.clientY - n.top) / n.height - .5;
1187
+ t.style.setProperty("--rx", `${-a * 20}deg`), t.style.setProperty("--ry", `${i * 20}deg`), t.style.setProperty("--gx", `${(i + .5) * 100}%`), t.style.setProperty("--gy", `${(a + .5) * 100}%`);
1188
+ },
1189
+ onMouseLeave: () => {
1190
+ let e = r.current;
1191
+ e && (e.style.setProperty("--rx", "0deg"), e.style.setProperty("--ry", "0deg"), e.style.setProperty("--gx", "50%"), e.style.setProperty("--gy", "50%"));
1192
+ },
1193
+ children: [
1194
+ /* @__PURE__ */ l("div", { className: M.shine }),
1195
+ n ? /* @__PURE__ */ l("img", {
1196
+ src: n,
1197
+ alt: e,
1198
+ className: M.image
1199
+ }) : /* @__PURE__ */ l("div", {
1200
+ className: M.placeholder,
1201
+ children: /* @__PURE__ */ l("span", { children: "✦" })
1202
+ }),
1203
+ /* @__PURE__ */ u("div", {
1204
+ className: M.info,
1205
+ children: [/* @__PURE__ */ l("h3", { children: e }), /* @__PURE__ */ l("p", { children: t })]
1206
+ })
1207
+ ]
1208
+ })
1209
+ });
1210
+ }, N = {
1211
+ liquidProgress: "cos-liquidProgress-ABZZA",
1212
+ svg: "cos-svg-YdTvy",
1213
+ track: "cos-track-IhMjO",
1214
+ ring: "cos-ring-6PKMg",
1215
+ fillBg: "cos-fillBg-pwLI1",
1216
+ wave: "cos-wave-CBwgG",
1217
+ label: "cos-label-WYDqS"
1218
+ }, Re = ({ value: e = 0, max: t = 100, size: i = 160, color: a = "#38bdf8" }) => {
1219
+ let s = o(null), c = r().replace(/:/g, ""), d = y(t > 0 ? e / t * 100 : 0, 0, 100), f = 100 - d;
1220
+ return n(() => {
1221
+ let e = 0, t = 0, n = () => {
1222
+ t += .04;
1223
+ let r = s.current;
1224
+ if (r) {
1225
+ let e = f + Math.sin(t) * 2;
1226
+ r.setAttribute("d", `M0,${e} Q25,${e - 4 + Math.sin(t * 1.3) * 3} 50,${e} T100,${e} V100 H0 Z`);
1227
+ }
1228
+ e = requestAnimationFrame(n);
1229
+ };
1230
+ return e = requestAnimationFrame(n), () => cancelAnimationFrame(e);
1231
+ }, [f]), /* @__PURE__ */ u("div", {
1232
+ className: N.liquidProgress,
1233
+ style: {
1234
+ width: i,
1235
+ height: i,
1236
+ "--liquid-color": a
1237
+ },
1238
+ children: [/* @__PURE__ */ u("svg", {
1239
+ viewBox: "0 0 100 100",
1240
+ className: N.svg,
1241
+ children: [
1242
+ /* @__PURE__ */ l("defs", { children: /* @__PURE__ */ l("clipPath", {
1243
+ id: `clip-${c}`,
1244
+ children: /* @__PURE__ */ l("circle", {
1245
+ cx: "50",
1246
+ cy: "50",
1247
+ r: 45
1248
+ })
1249
+ }) }),
1250
+ /* @__PURE__ */ l("circle", {
1251
+ cx: "50",
1252
+ cy: "50",
1253
+ r: 45,
1254
+ className: N.track,
1255
+ strokeWidth: 10,
1256
+ fill: "none"
1257
+ }),
1258
+ /* @__PURE__ */ u("g", {
1259
+ clipPath: `url(#clip-${c})`,
1260
+ children: [/* @__PURE__ */ l("rect", {
1261
+ x: "0",
1262
+ y: "0",
1263
+ width: "100",
1264
+ height: "100",
1265
+ className: N.fillBg
1266
+ }), /* @__PURE__ */ l("path", {
1267
+ ref: s,
1268
+ className: N.wave,
1269
+ d: `M0,${f} Q25,${f - 4} 50,${f} T100,${f} V100 H0 Z`
1270
+ })]
1271
+ }),
1272
+ /* @__PURE__ */ l("circle", {
1273
+ cx: "50",
1274
+ cy: "50",
1275
+ r: 45,
1276
+ className: N.ring,
1277
+ strokeWidth: 10,
1278
+ fill: "none"
1279
+ })
1280
+ ]
1281
+ }), /* @__PURE__ */ u("span", {
1282
+ className: N.label,
1283
+ children: [Math.round(d), "%"]
1284
+ })]
1285
+ });
1286
+ }, P = {
1287
+ liquidGlass: "cos-liquidGlass-Z3bQg",
1288
+ panel: "cos-panel-XYboD",
1289
+ content: "cos-content-MHfkS"
1290
+ }, ze = ({ children: e = "液态玻璃面板", blur: t = 16, borderRadius: n = 20 }) => /* @__PURE__ */ l("div", {
1291
+ className: P.liquidGlass,
1292
+ children: /* @__PURE__ */ l("div", {
1293
+ className: P.panel,
1294
+ style: {
1295
+ "--glass-blur": `${t}px`,
1296
+ "--glass-radius": `${n}px`
1297
+ },
1298
+ children: /* @__PURE__ */ l("div", {
1299
+ className: P.content,
1300
+ children: e
1301
+ })
1302
+ })
1303
+ }), Be = {
1304
+ magneticButton: "cos-magneticButton-GbRkE",
1305
+ btn: "cos-btn--b2BJ"
1306
+ }, Ve = ({ children: e = "磁吸按钮", strength: t = .4, color: n = "#6366f1" }) => {
1307
+ let r = o(null), i = o(null);
1308
+ return /* @__PURE__ */ l("div", {
1309
+ ref: r,
1310
+ className: Be.magneticButton,
1311
+ onMouseMove: (e) => {
1312
+ let n = r.current, a = i.current;
1313
+ if (!n || !a) return;
1314
+ let o = n.getBoundingClientRect(), s = o.left + o.width / 2, c = o.top + o.height / 2, l = (e.clientX - s) * t, u = (e.clientY - c) * t;
1315
+ a.style.transform = `translate(${l}px, ${u}px)`;
1316
+ },
1317
+ onMouseLeave: () => {
1318
+ let e = i.current;
1319
+ e && (e.style.transform = "translate(0, 0)");
1320
+ },
1321
+ children: /* @__PURE__ */ l("button", {
1322
+ ref: i,
1323
+ type: "button",
1324
+ className: Be.btn,
1325
+ style: { "--btn-color": n },
1326
+ children: e
1327
+ })
1328
+ });
1329
+ }, F = {
1330
+ matrixRain: "cos-matrixRain-qg9HC",
1331
+ canvas: "cos-canvas--AvpG",
1332
+ overlay: "cos-overlay-knj3b",
1333
+ title: "cos-title-sDfhs",
1334
+ flicker: "cos-flicker-smHxl",
1335
+ subtitle: "cos-subtitle-CWheW"
1336
+ }, He = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*アイウエオカキクケコ", Ue = ({ width: e = 800, height: t = 500, density: r = .6, color: i = "#00ff41", showOverlay: a = !0, title: s = "MATRIX", subtitle: c = "数字雨效果" }) => {
1337
+ let d = o(null);
1338
+ return n(() => {
1339
+ let n = d.current;
1340
+ if (!n) return;
1341
+ let a = window.devicePixelRatio || 1;
1342
+ n.width = e * a, n.height = t * a;
1343
+ let o = n.getContext("2d");
1344
+ if (!o) return;
1345
+ o.setTransform(a, 0, 0, a, 0, 0);
1346
+ let s = Math.floor(e / 16 * r), c = Array.from({ length: s }, () => Math.random() * -50), l = 0, u = document.hidden, f = v((e) => {
1347
+ u = e;
1348
+ }), p = () => {
1349
+ 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) => {
1350
+ let a = He[Math.floor(Math.random() * 53)], s = n / r * 16;
1351
+ o.fillStyle = i, o.fillText(a, s, e * 16), e * 16 > t && Math.random() > .975 && (c[n] = 0), c[n] += 1;
1352
+ }));
1353
+ };
1354
+ return p(), () => {
1355
+ cancelAnimationFrame(l), f();
1356
+ };
1357
+ }, [
1358
+ i,
1359
+ r,
1360
+ t,
1361
+ e
1362
+ ]), /* @__PURE__ */ u("div", {
1363
+ className: F.matrixRain,
1364
+ style: {
1365
+ width: e,
1366
+ height: t
1367
+ },
1368
+ children: [/* @__PURE__ */ l("canvas", {
491
1369
  ref: d,
492
- className: L.canvas,
1370
+ className: F.canvas,
493
1371
  style: {
494
1372
  width: e,
495
1373
  height: t
496
1374
  }
497
- }), o && /* @__PURE__ */ l("div", {
498
- className: L.overlay,
499
- children: [/* @__PURE__ */ c("h2", {
500
- className: L.title,
1375
+ }), a && /* @__PURE__ */ u("div", {
1376
+ className: F.overlay,
1377
+ children: [/* @__PURE__ */ l("h2", {
1378
+ className: F.title,
501
1379
  children: s
502
- }), /* @__PURE__ */ c("p", {
503
- className: L.subtitle,
504
- children: u
1380
+ }), /* @__PURE__ */ l("p", {
1381
+ className: F.subtitle,
1382
+ children: c
505
1383
  })]
506
1384
  })]
507
1385
  });
508
- }, z = {
1386
+ }, We = {
1387
+ mazeGenerator: "cos-mazeGenerator-QEa0s",
1388
+ canvas: "cos-canvas-emhxb"
1389
+ }, Ge = ({ width: e = 400, height: t = 300, cellSize: r = 20, onGenerated: i }) => {
1390
+ let a = o(null), s = o(i);
1391
+ return n(() => {
1392
+ s.current = i;
1393
+ }, [i]), n(() => {
1394
+ let n = a.current;
1395
+ if (!n) return;
1396
+ let i = window.devicePixelRatio || 1;
1397
+ n.width = e * i, n.height = t * i;
1398
+ let o = n.getContext("2d");
1399
+ if (!o) return;
1400
+ o.setTransform(i, 0, 0, i, 0, 0);
1401
+ let c = Math.floor(e / r), l = Math.floor(t / r), u = Array.from({ length: l }, () => Array.from({ length: c }, () => ({
1402
+ top: !0,
1403
+ right: !0,
1404
+ bottom: !0,
1405
+ left: !0,
1406
+ visited: !1
1407
+ }))), d = [[0, 0]];
1408
+ u[0][0].visited = !0;
1409
+ let f = [
1410
+ [
1411
+ 0,
1412
+ -1,
1413
+ "top"
1414
+ ],
1415
+ [
1416
+ 1,
1417
+ 0,
1418
+ "right"
1419
+ ],
1420
+ [
1421
+ 0,
1422
+ 1,
1423
+ "bottom"
1424
+ ],
1425
+ [
1426
+ -1,
1427
+ 0,
1428
+ "left"
1429
+ ]
1430
+ ], p = {
1431
+ top: "bottom",
1432
+ right: "left",
1433
+ bottom: "top",
1434
+ left: "right"
1435
+ };
1436
+ for (; d.length;) {
1437
+ let [e, t] = d[d.length - 1], n = f.map(([n, r, i]) => {
1438
+ let a = e + n, o = t + r;
1439
+ return a < 0 || o < 0 || a >= c || o >= l || u[o][a].visited ? null : {
1440
+ nx: a,
1441
+ ny: o,
1442
+ wall: i
1443
+ };
1444
+ }).filter(Boolean);
1445
+ if (!n.length) {
1446
+ d.pop();
1447
+ continue;
1448
+ }
1449
+ let r = n[Math.floor(Math.random() * n.length)];
1450
+ u[t][e][r.wall] = !1, u[r.ny][r.nx][p[r.wall]] = !1, u[r.ny][r.nx].visited = !0, d.push([r.nx, r.ny]);
1451
+ }
1452
+ s.current?.(c, l);
1453
+ let m = 0, h = 0, g = c * l * 2, _ = document.hidden, y = v((e) => {
1454
+ _ = e;
1455
+ }), b = () => {
1456
+ if (m = requestAnimationFrame(b), _) return;
1457
+ h = Math.min(g, h + 2), o.fillStyle = "#0f172a", o.fillRect(0, 0, e, t), o.strokeStyle = "#38bdf8", o.lineWidth = 1.5, o.shadowColor = "#38bdf8", o.shadowBlur = 4;
1458
+ let n = 0;
1459
+ for (let e = 0; e < l; e++) for (let t = 0; t < c; t++) {
1460
+ let i = u[e][t], a = t * r, s = e * r;
1461
+ i.top && n++ < h && (o.beginPath(), o.moveTo(a, s), o.lineTo(a + r, s), o.stroke()), i.right && n++ < h && (o.beginPath(), o.moveTo(a + r, s), o.lineTo(a + r, s + r), o.stroke()), e === l - 1 && i.bottom && n++ < h && (o.beginPath(), o.moveTo(a, s + r), o.lineTo(a + r, s + r), o.stroke()), t === 0 && i.left && n++ < h && (o.beginPath(), o.moveTo(a, s), o.lineTo(a, s + r), o.stroke());
1462
+ }
1463
+ o.shadowBlur = 0;
1464
+ };
1465
+ return b(), () => {
1466
+ cancelAnimationFrame(m), y();
1467
+ };
1468
+ }, [
1469
+ r,
1470
+ t,
1471
+ e
1472
+ ]), /* @__PURE__ */ l("div", {
1473
+ className: We.mazeGenerator,
1474
+ style: {
1475
+ width: e,
1476
+ height: t
1477
+ },
1478
+ children: /* @__PURE__ */ l("canvas", {
1479
+ ref: a,
1480
+ className: We.canvas,
1481
+ style: {
1482
+ width: e,
1483
+ height: t
1484
+ }
1485
+ })
1486
+ });
1487
+ }, Ke = {
509
1488
  meteorRain: "cos-meteorRain-v8RNI",
510
1489
  canvas: "cos-canvas-hyFMr"
511
- }, B = ({ width: e = 800, height: t = 500, meteorCount: r = 8 }) => {
512
- let i = a(null), o = a([]), s = a(0);
1490
+ }, qe = ({ width: e = 800, height: t = 500, meteorCount: r = 8 }) => {
1491
+ let i = o(null), a = o([]), s = o(0);
513
1492
  return n(() => {
514
- o.current = Array.from({ length: r }, () => ({
1493
+ a.current = Array.from({ length: r }, () => ({
515
1494
  x: Math.random() * e,
516
1495
  y: Math.random() * t * .5,
517
1496
  length: Math.random() * 60 + 40,
@@ -527,69 +1506,169 @@ var M = {
527
1506
  if (!n) return;
528
1507
  let r = window.devicePixelRatio || 1;
529
1508
  n.width = e * r, n.height = t * r;
530
- let a = n.getContext("2d");
531
- if (!a) return;
532
- a.setTransform(r, 0, 0, r, 0, 0);
533
- let c = document.hidden, l = f((e) => {
1509
+ let o = n.getContext("2d");
1510
+ if (!o) return;
1511
+ o.setTransform(r, 0, 0, r, 0, 0);
1512
+ let c = document.hidden, l = v((e) => {
534
1513
  c = e;
535
1514
  }), u = () => {
536
- s.current = requestAnimationFrame(u), !c && (a.fillStyle = "rgb(15 23 42 / 15%)", a.fillRect(0, 0, e, t), o.current.forEach((n) => {
1515
+ s.current = requestAnimationFrame(u), !c && (o.fillStyle = "rgb(15 23 42 / 15%)", o.fillRect(0, 0, e, t), a.current.forEach((n) => {
537
1516
  n.x += n.speed, n.y += n.speed * .6, (n.x > e + n.length || n.y > t + n.length) && (n.x = -n.length, n.y = Math.random() * t * .4, n.length = Math.random() * 60 + 40, n.speed = Math.random() * 6 + 4, n.opacity = Math.random() * .5 + .3);
538
1517
  let r = n.x - n.length, i = n.y - n.length * .6;
539
- a.beginPath(), a.strokeStyle = `rgb(255 255 255 / ${n.opacity})`, a.lineWidth = 2, a.moveTo(n.x, n.y), a.lineTo(r, i), a.stroke(), a.beginPath(), a.fillStyle = `rgb(255 255 255 / ${Math.min(1, n.opacity + .2)})`, a.arc(n.x, n.y, 1.5, 0, Math.PI * 2), a.fill();
1518
+ o.beginPath(), o.strokeStyle = `rgb(255 255 255 / ${n.opacity})`, o.lineWidth = 2, o.moveTo(n.x, n.y), o.lineTo(r, i), o.stroke(), o.beginPath(), o.fillStyle = `rgb(255 255 255 / ${Math.min(1, n.opacity + .2)})`, o.arc(n.x, n.y, 1.5, 0, Math.PI * 2), o.fill();
540
1519
  }));
541
1520
  };
542
1521
  return u(), () => {
543
1522
  cancelAnimationFrame(s.current), l();
544
1523
  };
545
- }, [t, e]), /* @__PURE__ */ c("div", {
546
- className: z.meteorRain,
1524
+ }, [t, e]), /* @__PURE__ */ l("div", {
1525
+ className: Ke.meteorRain,
547
1526
  style: {
548
1527
  width: e,
549
1528
  height: t
550
1529
  },
551
- children: /* @__PURE__ */ c("canvas", {
1530
+ children: /* @__PURE__ */ l("canvas", {
552
1531
  ref: i,
553
- className: z.canvas,
1532
+ className: Ke.canvas,
554
1533
  style: {
555
1534
  width: e,
556
1535
  height: t
557
1536
  }
558
1537
  })
559
1538
  });
560
- }, V = {
1539
+ }, I = {
561
1540
  neonText: "cos-neonText-JMP7i",
562
1541
  text: "cos-text-GTO-0",
563
1542
  flicker: "cos-flicker-nXceV",
564
1543
  "neon-flicker": "cos-neon-flicker-uDkmM",
565
1544
  reflection: "cos-reflection-aEYj6"
566
- }, H = ({ text: e = "NEON", color: t = "#ff00de", fontSize: n = 72, flicker: r = !0 }) => /* @__PURE__ */ l("div", {
567
- className: V.neonText,
568
- children: [/* @__PURE__ */ c("h1", {
569
- className: `${V.text} ${r ? V.flicker : ""}`,
1545
+ }, Je = ({ text: e = "NEON", color: t = "#ff00de", fontSize: n = 72, flicker: r = !0 }) => /* @__PURE__ */ u("div", {
1546
+ className: I.neonText,
1547
+ children: [/* @__PURE__ */ l("h1", {
1548
+ className: `${I.text} ${r ? I.flicker : ""}`,
570
1549
  style: {
571
1550
  fontSize: n,
572
1551
  "--neon-color": t
573
1552
  },
574
1553
  children: e
575
- }), /* @__PURE__ */ c("p", {
576
- className: V.reflection,
1554
+ }), /* @__PURE__ */ l("p", {
1555
+ className: I.reflection,
577
1556
  style: {
578
1557
  fontSize: n * .35,
579
1558
  color: t
580
1559
  },
581
1560
  children: e
582
1561
  })]
583
- }), U = {
1562
+ }), L = {
1563
+ newtonCradle: "cos-newtonCradle-mFl-b",
1564
+ frame: "cos-frame-pp818",
1565
+ pendulum: "cos-pendulum-mC9Bq",
1566
+ "swing-left": "cos-swing-left-Mf5fy",
1567
+ "swing-right": "cos-swing-right-gEH1F",
1568
+ string: "cos-string-UpYWC",
1569
+ ball: "cos-ball-sj82r"
1570
+ }, Ye = ({ ballCount: e = 5, color: t = "#38bdf8" }) => {
1571
+ let n = Math.max(2, Math.min(e, 7));
1572
+ return /* @__PURE__ */ l("div", {
1573
+ className: L.newtonCradle,
1574
+ style: { "--ball-color": t },
1575
+ children: /* @__PURE__ */ l("div", {
1576
+ className: L.frame,
1577
+ children: Array.from({ length: n }, (e, t) => /* @__PURE__ */ u("div", {
1578
+ className: L.pendulum,
1579
+ "data-role": t === 0 ? "left" : t === n - 1 ? "right" : "middle",
1580
+ children: [/* @__PURE__ */ l("span", { className: L.string }), /* @__PURE__ */ l("span", { className: L.ball })]
1581
+ }, t))
1582
+ })
1583
+ });
1584
+ }, R = {
1585
+ orbitalChart: "cos-orbitalChart-XLORB",
1586
+ canvas: "cos-canvas-hGVud",
1587
+ legend: "cos-legend-Np9Mm",
1588
+ swatch: "cos-swatch-xEKvA"
1589
+ }, Xe = [
1590
+ {
1591
+ label: "A",
1592
+ value: 30,
1593
+ color: "#38bdf8"
1594
+ },
1595
+ {
1596
+ label: "B",
1597
+ value: 25,
1598
+ color: "#a78bfa"
1599
+ },
1600
+ {
1601
+ label: "C",
1602
+ value: 20,
1603
+ color: "#f472b6"
1604
+ },
1605
+ {
1606
+ label: "D",
1607
+ value: 25,
1608
+ color: "#4ade80"
1609
+ }
1610
+ ], Ze = ({ data: e = Xe, size: t = 240 }) => {
1611
+ let r = o(null);
1612
+ return n(() => {
1613
+ let n = r.current;
1614
+ if (!n || e.length === 0) return;
1615
+ let i = window.devicePixelRatio || 1;
1616
+ n.width = t * i, n.height = t * i;
1617
+ let a = n.getContext("2d");
1618
+ if (!a) return;
1619
+ a.setTransform(i, 0, 0, i, 0, 0);
1620
+ let o = e.reduce((e, t) => e + t.value, 0) || 1, s = t / 2, c = t / 2, l = (t / 2 - 20) / (e.length + 1), u = 0, d = 0, f = document.hidden, p = v((e) => {
1621
+ f = e;
1622
+ }), m = () => {
1623
+ u = requestAnimationFrame(m), !f && (d += .012, a.fillStyle = "#0f172a", a.fillRect(0, 0, t, t), e.forEach((e, t) => {
1624
+ let n = l * (t + 1), r = e.value / o, i = y(Math.round(r * 12) + 1, 1, 16), u = .4 + t * .15;
1625
+ a.beginPath(), a.arc(s, c, n, 0, Math.PI * 2), a.strokeStyle = "rgb(148 163 184 / 15%)", a.lineWidth = 1, a.stroke();
1626
+ for (let t = 0; t < i; t++) {
1627
+ let r = d * u + t / i * Math.PI * 2, o = s + Math.cos(r) * n, l = c + Math.sin(r) * n;
1628
+ a.beginPath(), a.arc(o, l, 4, 0, Math.PI * 2), a.fillStyle = e.color, a.shadowColor = e.color, a.shadowBlur = 6, a.fill(), a.shadowBlur = 0;
1629
+ }
1630
+ }), a.fillStyle = "#e2e8f0", a.font = "12px system-ui", a.textAlign = "center", a.fillText(`${Math.round(e[0]?.value / o * 100) || 0}%`, s, c + 4));
1631
+ };
1632
+ return m(), () => {
1633
+ cancelAnimationFrame(u), p();
1634
+ };
1635
+ }, [e, t]), /* @__PURE__ */ u("div", {
1636
+ className: R.orbitalChart,
1637
+ style: {
1638
+ width: t,
1639
+ height: t
1640
+ },
1641
+ children: [/* @__PURE__ */ l("canvas", {
1642
+ ref: r,
1643
+ className: R.canvas,
1644
+ style: {
1645
+ width: t,
1646
+ height: t
1647
+ }
1648
+ }), /* @__PURE__ */ l("ul", {
1649
+ className: R.legend,
1650
+ children: e.map((e) => /* @__PURE__ */ u("li", { children: [
1651
+ /* @__PURE__ */ l("span", {
1652
+ className: R.swatch,
1653
+ style: { background: e.color }
1654
+ }),
1655
+ e.label,
1656
+ " (",
1657
+ e.value,
1658
+ ")"
1659
+ ] }, e.label))
1660
+ })]
1661
+ });
1662
+ }, z = {
584
1663
  particleNetwork: "cos-particleNetwork-GSZq-",
585
1664
  canvas: "cos-canvas-E-BGP",
586
1665
  hint: "cos-hint-LEO5o"
587
- }, W = ({ width: e = 800, height: r = 500, particleCount: i = 60, linkDistance: o = 120, repelRadius: s = 150, color: u = "#38bdf8" }) => {
588
- let d = a(null), p = a([]), m = a({
1666
+ }, Qe = ({ width: e = 800, height: r = 500, particleCount: i = 60, linkDistance: a = 120, repelRadius: s = 150, color: c = "#38bdf8" }) => {
1667
+ let d = o(null), f = o([]), p = o({
589
1668
  x: -1e3,
590
1669
  y: -1e3
591
- }), h = t(() => {
592
- p.current = Array.from({ length: i }, () => ({
1670
+ }), m = t(() => {
1671
+ f.current = Array.from({ length: i }, () => ({
593
1672
  x: Math.random() * e,
594
1673
  y: Math.random() * r,
595
1674
  vx: (Math.random() - .5) * 1.2,
@@ -602,8 +1681,8 @@ var M = {
602
1681
  e
603
1682
  ]);
604
1683
  n(() => {
605
- h();
606
- }, [h]), n(() => {
1684
+ m();
1685
+ }, [m]), n(() => {
607
1686
  let t = d.current;
608
1687
  if (!t) return;
609
1688
  let n = window.devicePixelRatio || 1;
@@ -611,105 +1690,476 @@ var M = {
611
1690
  let i = t.getContext("2d");
612
1691
  if (!i) return;
613
1692
  i.setTransform(n, 0, 0, n, 0, 0);
614
- let a = 0, c = document.hidden, l = f((e) => {
615
- c = e;
616
- }), h = () => {
617
- if (c) {
618
- a = requestAnimationFrame(h);
1693
+ let o = 0, l = document.hidden, u = v((e) => {
1694
+ l = e;
1695
+ }), m = () => {
1696
+ if (l) {
1697
+ o = requestAnimationFrame(m);
619
1698
  return;
620
1699
  }
621
1700
  i.fillStyle = "#0f172a", i.fillRect(0, 0, e, r);
622
- let t = p.current, n = m.current, l = s * s;
1701
+ let t = f.current, n = p.current, u = s * s;
623
1702
  t.forEach((t) => {
624
1703
  t.x += t.vx, t.y += t.vy, (t.x < 0 || t.x > e) && (t.vx *= -1), (t.y < 0 || t.y > r) && (t.vy *= -1);
625
1704
  let i = n.x - t.x, a = n.y - t.y, o = i * i + a * a;
626
- if (o < l && o > 0) {
1705
+ if (o < u && o > 0) {
627
1706
  let e = Math.sqrt(o);
628
1707
  t.vx -= i / e * .15, t.vy -= a / e * .15;
629
1708
  }
630
1709
  });
631
1710
  for (let e = 0; e < t.length; e++) for (let n = e + 1; n < t.length; n++) {
632
- let r = t[e].x - t[n].x, a = t[e].y - t[n].y, s = r * r + a * a;
633
- if (s < o * o) {
1711
+ let r = t[e].x - t[n].x, o = t[e].y - t[n].y, s = r * r + o * o;
1712
+ if (s < a * a) {
634
1713
  let r = Math.sqrt(s);
635
- i.beginPath(), i.moveTo(t[e].x, t[e].y), i.lineTo(t[n].x, t[n].y), i.strokeStyle = u, i.globalAlpha = 1 - r / o, i.lineWidth = .8, i.stroke(), i.globalAlpha = 1;
1714
+ i.beginPath(), i.moveTo(t[e].x, t[e].y), i.lineTo(t[n].x, t[n].y), i.strokeStyle = c, i.globalAlpha = 1 - r / a, i.lineWidth = .8, i.stroke(), i.globalAlpha = 1;
636
1715
  }
637
1716
  }
638
1717
  t.forEach((e) => {
639
- i.beginPath(), i.arc(e.x, e.y, e.radius, 0, Math.PI * 2), i.fillStyle = u, i.fill();
640
- }), a = requestAnimationFrame(h);
1718
+ i.beginPath(), i.arc(e.x, e.y, e.radius, 0, Math.PI * 2), i.fillStyle = c, i.fill();
1719
+ }), o = requestAnimationFrame(m);
641
1720
  };
642
- return h(), () => {
643
- cancelAnimationFrame(a), l();
1721
+ return m(), () => {
1722
+ cancelAnimationFrame(o), u();
644
1723
  };
645
1724
  }, [
646
- u,
1725
+ c,
647
1726
  r,
648
- h,
649
- o,
1727
+ m,
1728
+ a,
650
1729
  s,
651
1730
  e
652
1731
  ]);
653
- let g = (e, t, n) => {
654
- m.current = {
1732
+ let h = (e, t, n) => {
1733
+ p.current = {
655
1734
  x: e - n.left,
656
1735
  y: t - n.top
657
1736
  };
1737
+ }, g = (e) => {
1738
+ h(e.clientX, e.clientY, e.currentTarget.getBoundingClientRect());
658
1739
  }, _ = (e) => {
659
- g(e.clientX, e.clientY, e.currentTarget.getBoundingClientRect());
660
- }, v = (e) => {
661
1740
  let t = e.touches[0];
662
- t && g(t.clientX, t.clientY, e.currentTarget.getBoundingClientRect());
1741
+ t && h(t.clientX, t.clientY, e.currentTarget.getBoundingClientRect());
663
1742
  }, y = () => {
664
- m.current = {
1743
+ p.current = {
665
1744
  x: -1e3,
666
1745
  y: -1e3
667
1746
  };
668
1747
  };
669
- return /* @__PURE__ */ l("div", {
670
- className: U.particleNetwork,
1748
+ return /* @__PURE__ */ u("div", {
1749
+ className: z.particleNetwork,
671
1750
  style: {
672
1751
  width: e,
673
1752
  height: r
674
1753
  },
675
- children: [/* @__PURE__ */ c("canvas", {
1754
+ children: [/* @__PURE__ */ l("canvas", {
676
1755
  ref: d,
677
- className: U.canvas,
1756
+ className: z.canvas,
678
1757
  style: {
679
1758
  width: e,
680
1759
  height: r
681
1760
  },
682
- onMouseMove: _,
1761
+ onMouseMove: g,
683
1762
  onMouseLeave: y,
684
- onTouchMove: v,
1763
+ onTouchMove: _,
685
1764
  onTouchEnd: y
686
- }), /* @__PURE__ */ c("p", {
687
- className: U.hint,
1765
+ }), /* @__PURE__ */ l("p", {
1766
+ className: z.hint,
688
1767
  children: "移动鼠标或手指与粒子互动"
689
1768
  })]
690
1769
  });
691
- }, G = {
1770
+ }, $e = {
1771
+ smokeFog: "cos-smokeFog-SYlts",
1772
+ canvas: "cos-canvas-iOJV7"
1773
+ }, et = ({ width: e = 800, height: t = 500, density: r = .5 }) => {
1774
+ let i = o(null), a = o([]), s = o(0);
1775
+ return n(() => {
1776
+ let n = Math.floor(20 + r * 40);
1777
+ a.current = Array.from({ length: n }, () => ({
1778
+ x: Math.random() * e,
1779
+ y: Math.random() * t,
1780
+ radius: Math.random() * 80 + 40,
1781
+ vx: (Math.random() - .5) * .4,
1782
+ vy: (Math.random() - .5) * .3 - .1,
1783
+ alpha: Math.random() * .15 + .05
1784
+ }));
1785
+ }, [
1786
+ r,
1787
+ t,
1788
+ e
1789
+ ]), n(() => {
1790
+ let n = i.current;
1791
+ if (!n) return;
1792
+ let r = window.devicePixelRatio || 1;
1793
+ n.width = e * r, n.height = t * r;
1794
+ let o = n.getContext("2d");
1795
+ if (!o) return;
1796
+ o.setTransform(r, 0, 0, r, 0, 0);
1797
+ let c = 0, l = document.hidden, u = v((e) => {
1798
+ l = e;
1799
+ }), d = () => {
1800
+ if (s.current = requestAnimationFrame(d), l) return;
1801
+ c += .008, o.fillStyle = "#1a1a2e", o.fillRect(0, 0, e, t);
1802
+ let n = o.createRadialGradient(e * .5, t * .3, 0, e * .5, t * .5, e * .7);
1803
+ n.addColorStop(0, "#2d2d44"), n.addColorStop(1, "#1a1a2e"), o.fillStyle = n, o.fillRect(0, 0, e, t), a.current.forEach((n, r) => {
1804
+ n.x += n.vx + Math.sin(c + r) * .15, n.y += n.vy + Math.cos(c * .7 + r * .5) * .1, n.x < -n.radius && (n.x = e + n.radius), n.x > e + n.radius && (n.x = -n.radius), n.y < -n.radius && (n.y = t + n.radius), n.y > t + n.radius && (n.y = -n.radius);
1805
+ let i = o.createRadialGradient(n.x, n.y, 0, n.x, n.y, n.radius);
1806
+ i.addColorStop(0, `rgb(200 200 210 / ${n.alpha})`), i.addColorStop(.5, `rgb(160 160 175 / ${n.alpha * .5})`), i.addColorStop(1, "rgb(160 160 175 / 0)"), o.fillStyle = i, o.beginPath(), o.arc(n.x, n.y, n.radius, 0, Math.PI * 2), o.fill();
1807
+ });
1808
+ };
1809
+ return d(), () => {
1810
+ cancelAnimationFrame(s.current), u();
1811
+ };
1812
+ }, [t, e]), /* @__PURE__ */ l("div", {
1813
+ className: $e.smokeFog,
1814
+ style: {
1815
+ width: e,
1816
+ height: t
1817
+ },
1818
+ children: /* @__PURE__ */ l("canvas", {
1819
+ ref: i,
1820
+ className: $e.canvas,
1821
+ style: {
1822
+ width: e,
1823
+ height: t
1824
+ }
1825
+ })
1826
+ });
1827
+ }, tt = {
1828
+ snowfall: "cos-snowfall-Q-Dhg",
1829
+ canvas: "cos-canvas-bJVF8"
1830
+ }, nt = ({ width: e = 800, height: r = 500, mode: i = "snow", count: a = 120 }) => {
1831
+ let s = o(null), c = o([]), u = o(0), d = t((t) => ({
1832
+ x: Math.random() * e,
1833
+ y: t ?? Math.random() * r,
1834
+ size: i === "sakura" ? Math.random() * 6 + 4 : Math.random() * 3 + 1,
1835
+ speed: Math.random() * 1.5 + .5,
1836
+ drift: (Math.random() - .5) * .8,
1837
+ rotation: Math.random() * Math.PI * 2,
1838
+ rotationSpeed: (Math.random() - .5) * .04,
1839
+ opacity: Math.random() * .6 + .4
1840
+ }), [
1841
+ r,
1842
+ i,
1843
+ e
1844
+ ]);
1845
+ return n(() => {
1846
+ c.current = Array.from({ length: a }, () => d());
1847
+ }, [a, d]), n(() => {
1848
+ let t = s.current;
1849
+ if (!t) return;
1850
+ let n = window.devicePixelRatio || 1;
1851
+ t.width = e * n, t.height = r * n;
1852
+ let a = t.getContext("2d");
1853
+ if (!a) return;
1854
+ a.setTransform(n, 0, 0, n, 0, 0);
1855
+ let o = document.hidden, l = v((e) => {
1856
+ o = e;
1857
+ }), f = (e) => {
1858
+ a.globalAlpha = e.opacity, a.fillStyle = "#fff", a.beginPath(), a.arc(e.x, e.y, e.size, 0, Math.PI * 2), a.fill();
1859
+ }, p = (e) => {
1860
+ a.save(), a.translate(e.x, e.y), a.rotate(e.rotation), a.globalAlpha = e.opacity;
1861
+ let t = e.size;
1862
+ a.fillStyle = "#ffb7c5", a.beginPath(), a.ellipse(0, 0, t, t * .6, 0, 0, Math.PI * 2), a.fill(), a.fillStyle = "#ff8fa3", a.beginPath(), a.ellipse(t * .3, 0, t * .5, t * .35, .5, 0, Math.PI * 2), a.fill(), a.restore();
1863
+ }, m = () => {
1864
+ u.current = requestAnimationFrame(m), !o && (a.fillStyle = i === "sakura" ? "#1a1020" : "#0f172a", a.fillRect(0, 0, e, r), c.current.forEach((e) => {
1865
+ e.y += e.speed, e.x += e.drift + Math.sin(e.y * .02) * .3, e.rotation += e.rotationSpeed, e.y > r + 10 && Object.assign(e, d(-10)), i === "sakura" ? p(e) : f(e);
1866
+ }), a.globalAlpha = 1);
1867
+ };
1868
+ return m(), () => {
1869
+ cancelAnimationFrame(u.current), l();
1870
+ };
1871
+ }, [
1872
+ d,
1873
+ r,
1874
+ i,
1875
+ e
1876
+ ]), /* @__PURE__ */ l("div", {
1877
+ className: tt.snowfall,
1878
+ style: {
1879
+ width: e,
1880
+ height: r
1881
+ },
1882
+ children: /* @__PURE__ */ l("canvas", {
1883
+ ref: s,
1884
+ className: tt.canvas,
1885
+ style: {
1886
+ width: e,
1887
+ height: r
1888
+ }
1889
+ })
1890
+ });
1891
+ }, rt = {
1892
+ starfield: "cos-starfield-QTwia",
1893
+ canvas: "cos-canvas-C2t3g"
1894
+ }, it = ({ width: e = 800, height: t = 500, starCount: r = 400, speed: i = 1 }) => {
1895
+ let a = o(null), s = o([]), c = o(0);
1896
+ return n(() => {
1897
+ s.current = Array.from({ length: r }, () => ({
1898
+ x: (Math.random() - .5) * e,
1899
+ y: (Math.random() - .5) * t,
1900
+ z: Math.random() * e
1901
+ }));
1902
+ }, [
1903
+ t,
1904
+ r,
1905
+ e
1906
+ ]), n(() => {
1907
+ let n = a.current;
1908
+ if (!n) return;
1909
+ let r = window.devicePixelRatio || 1;
1910
+ n.width = e * r, n.height = t * r;
1911
+ let o = n.getContext("2d");
1912
+ if (!o) return;
1913
+ o.setTransform(r, 0, 0, r, 0, 0);
1914
+ let l = e / 2, u = t / 2, d = document.hidden, f = v((e) => {
1915
+ d = e;
1916
+ }), p = () => {
1917
+ c.current = requestAnimationFrame(p), !d && (o.fillStyle = "rgb(0 0 0 / 25%)", o.fillRect(0, 0, e, t), s.current.forEach((n) => {
1918
+ n.z -= i * 2, n.z <= 0 && (n.x = (Math.random() - .5) * e, n.y = (Math.random() - .5) * t, n.z = e);
1919
+ let r = 128 / n.z, a = n.x * r + l, s = n.y * r + u;
1920
+ if (a < 0 || a >= e || s < 0 || s >= t) return;
1921
+ let c = (1 - n.z / e) * 3, d = (1 - n.z / e) * 255;
1922
+ if (c > .5) {
1923
+ let e = 128 / (n.z + i * 4), t = n.x * e + l, r = n.y * e + u;
1924
+ o.beginPath(), o.strokeStyle = `rgb(${d} ${d} ${d + 30})`, o.lineWidth = c, o.moveTo(t, r), o.lineTo(a, s), o.stroke();
1925
+ } else o.fillStyle = `rgb(${d} ${d} ${d + 30})`, o.fillRect(a, s, c, c);
1926
+ }));
1927
+ };
1928
+ return p(), () => {
1929
+ cancelAnimationFrame(c.current), f();
1930
+ };
1931
+ }, [
1932
+ t,
1933
+ i,
1934
+ r,
1935
+ e
1936
+ ]), /* @__PURE__ */ l("div", {
1937
+ className: rt.starfield,
1938
+ style: {
1939
+ width: e,
1940
+ height: t
1941
+ },
1942
+ children: /* @__PURE__ */ l("canvas", {
1943
+ ref: a,
1944
+ className: rt.canvas,
1945
+ style: {
1946
+ width: e,
1947
+ height: t
1948
+ }
1949
+ })
1950
+ });
1951
+ }, B = {
1952
+ progressChest: "cos-progressChest-Bqcv1",
1953
+ barWrap: "cos-barWrap-E2pnl",
1954
+ barTrack: "cos-barTrack-dKLhs",
1955
+ barFill: "cos-barFill-NZJJe",
1956
+ pct: "cos-pct-D91IU",
1957
+ chest: "cos-chest-YebJO",
1958
+ lid: "cos-lid-K4GSD",
1959
+ open: "cos-open-eWo0Y",
1960
+ lidTop: "cos-lidTop-N-p2g",
1961
+ lock: "cos-lock--0AaQ",
1962
+ body: "cos-body-iqUt3",
1963
+ treasure: "cos-treasure-nx-6S",
1964
+ pop: "cos-pop-uRZvT",
1965
+ label: "cos-label-61hRe"
1966
+ }, at = ({ progress: e = 0, onOpen: t, label: r = "开启宝箱" }) => {
1967
+ let i = o(!1), a = y(e, 0, 100), s = a >= 100;
1968
+ return n(() => {
1969
+ s && !i.current && (i.current = !0, t?.()), s || (i.current = !1);
1970
+ }, [s, t]), /* @__PURE__ */ u("div", {
1971
+ className: B.progressChest,
1972
+ children: [
1973
+ /* @__PURE__ */ u("div", {
1974
+ className: B.barWrap,
1975
+ children: [/* @__PURE__ */ l("div", {
1976
+ className: B.barTrack,
1977
+ children: /* @__PURE__ */ l("div", {
1978
+ className: B.barFill,
1979
+ style: { width: `${a}%` }
1980
+ })
1981
+ }), /* @__PURE__ */ u("span", {
1982
+ className: B.pct,
1983
+ children: [a.toFixed(0), "%"]
1984
+ })]
1985
+ }),
1986
+ /* @__PURE__ */ u("div", {
1987
+ className: `${B.chest} ${s ? B.open : ""}`,
1988
+ children: [/* @__PURE__ */ u("div", {
1989
+ className: B.lid,
1990
+ children: [/* @__PURE__ */ l("div", { className: B.lidTop }), /* @__PURE__ */ l("div", { className: B.lock })]
1991
+ }), /* @__PURE__ */ l("div", {
1992
+ className: B.body,
1993
+ children: s && /* @__PURE__ */ u("div", {
1994
+ className: B.treasure,
1995
+ children: [
1996
+ /* @__PURE__ */ l("span", { children: "💎" }),
1997
+ /* @__PURE__ */ l("span", { children: "✨" }),
1998
+ /* @__PURE__ */ l("span", { children: "🪙" })
1999
+ ]
2000
+ })
2001
+ })]
2002
+ }),
2003
+ /* @__PURE__ */ l("p", {
2004
+ className: B.label,
2005
+ children: s ? "宝箱已开启!" : r
2006
+ })
2007
+ ]
2008
+ });
2009
+ }, ot = {
2010
+ radarScan: "cos-radarScan-PZaG8",
2011
+ canvas: "cos-canvas-fUw5N"
2012
+ }, st = ({ size: e = 300, color: t = "#22d3ee", blipCount: r = 5 }) => {
2013
+ let i = o(null), a = o(0), s = o([]), c = o(0);
2014
+ return n(() => {
2015
+ s.current = Array.from({ length: r }, () => ({
2016
+ angle: Math.random() * Math.PI * 2,
2017
+ dist: Math.random() * .7 + .15,
2018
+ alpha: Math.random() * .5 + .5
2019
+ }));
2020
+ }, [r]), n(() => {
2021
+ let n = i.current;
2022
+ if (!n) return;
2023
+ let r = window.devicePixelRatio || 1;
2024
+ n.width = e * r, n.height = e * r;
2025
+ let o = n.getContext("2d");
2026
+ if (!o) return;
2027
+ o.setTransform(r, 0, 0, r, 0, 0);
2028
+ let l = e / 2, u = e / 2, d = e / 2 - 10, f = document.hidden, p = v((e) => {
2029
+ f = e;
2030
+ }), m = () => {
2031
+ if (c.current = requestAnimationFrame(m), f) return;
2032
+ a.current += .03, o.fillStyle = "rgb(15 23 42 / 25%)", o.fillRect(0, 0, e, e);
2033
+ for (let e = 1; e <= 4; e++) o.beginPath(), o.arc(l, u, d / 4 * e, 0, Math.PI * 2), o.strokeStyle = `${t}33`, o.lineWidth = 1, o.stroke();
2034
+ o.beginPath(), o.moveTo(l, u - d), o.lineTo(l, u + d), o.moveTo(l - d, u), o.lineTo(l + d, u), o.strokeStyle = `${t}44`, o.stroke();
2035
+ let n = a.current, r = o.createConicGradient(n - .5, l, u);
2036
+ r.addColorStop(0, "transparent"), r.addColorStop(.15, `${t}66`), r.addColorStop(.3, "transparent"), o.beginPath(), o.moveTo(l, u), o.arc(l, u, d, n - .5, n), o.closePath(), o.fillStyle = r, o.fill(), o.beginPath(), o.moveTo(l, u), o.lineTo(l + Math.cos(n) * d, u + Math.sin(n) * d), o.strokeStyle = t, o.lineWidth = 2, o.stroke(), s.current.forEach((e) => {
2037
+ let r = e.angle, i = l + Math.cos(r) * d * e.dist, a = u + Math.sin(r) * d * e.dist;
2038
+ Math.abs((n - r + Math.PI) % (Math.PI * 2) - Math.PI) < .3 ? e.alpha = Math.min(1, e.alpha + .05) : e.alpha = Math.max(.2, e.alpha - .01), o.beginPath(), o.arc(i, a, 4, 0, Math.PI * 2), o.fillStyle = t, o.globalAlpha = e.alpha, o.fill(), o.globalAlpha = 1;
2039
+ }), o.beginPath(), o.arc(l, u, d, 0, Math.PI * 2), o.strokeStyle = t, o.lineWidth = 2, o.stroke();
2040
+ };
2041
+ return m(), () => {
2042
+ cancelAnimationFrame(c.current), p();
2043
+ };
2044
+ }, [
2045
+ r,
2046
+ t,
2047
+ e
2048
+ ]), /* @__PURE__ */ l("div", {
2049
+ className: ot.radarScan,
2050
+ style: {
2051
+ width: e,
2052
+ height: e
2053
+ },
2054
+ children: /* @__PURE__ */ l("canvas", {
2055
+ ref: i,
2056
+ className: ot.canvas,
2057
+ style: {
2058
+ width: e,
2059
+ height: e
2060
+ }
2061
+ })
2062
+ });
2063
+ }, V = {
2064
+ redPacketRain: "cos-redPacketRain-eJ7FW",
2065
+ canvas: "cos-canvas-direH",
2066
+ hud: "cos-hud-InqMq",
2067
+ end: "cos-end-u0J7o",
2068
+ hint: "cos-hint-sO6ld"
2069
+ }, ct = ({ duration: e = 1e4, onGrab: r }) => {
2070
+ let i = o(null), a = o([]), c = o(0), d = o(0), f = o(0), [p, m] = s(0), [h, g] = s(!0), _ = t(() => {
2071
+ a.current.push({
2072
+ id: d.current++,
2073
+ x: Math.random() * 350 + 25,
2074
+ y: -60,
2075
+ speed: Math.random() * 2 + 2,
2076
+ rotation: (Math.random() - .5) * .1,
2077
+ amount: [
2078
+ 1,
2079
+ 2,
2080
+ 5,
2081
+ 8,
2082
+ 10,
2083
+ 18,
2084
+ 66,
2085
+ 88
2086
+ ][Math.floor(Math.random() * 8)],
2087
+ grabbed: !1
2088
+ });
2089
+ }, []);
2090
+ return n(() => {
2091
+ let t = i.current;
2092
+ if (!t) return;
2093
+ let n = window.devicePixelRatio || 1;
2094
+ t.width = 400 * n, t.height = 500 * n;
2095
+ let r = t.getContext("2d");
2096
+ if (!r) return;
2097
+ r.setTransform(n, 0, 0, n, 0, 0);
2098
+ let o = document.hidden, s = v((e) => {
2099
+ o = e;
2100
+ }), l = window.setTimeout(() => g(!1), e), u = () => {
2101
+ c.current = requestAnimationFrame(u), !o && (f.current++, h && f.current % 20 == 0 && _(), r.fillStyle = "rgb(15 23 42 / 20%)", r.fillRect(0, 0, 400, 500), a.current = a.current.filter((e) => e.grabbed ? !1 : (e.y += e.speed, e.x += Math.sin(e.y * .02) * .5, r.save(), r.translate(e.x, e.y), r.rotate(e.rotation), r.fillStyle = "#dc2626", r.beginPath(), r.roundRect(-22, -28, 44, 56, 6), r.fill(), r.fillStyle = "#fbbf24", r.beginPath(), r.arc(0, -10, 8, 0, Math.PI * 2), r.fill(), r.fillStyle = "#fde68a", r.font = "bold 12px system-ui", r.textAlign = "center", r.fillText(`¥${e.amount}`, 0, 12), r.restore(), e.y < 560)));
2102
+ };
2103
+ return u(), () => {
2104
+ cancelAnimationFrame(c.current), clearTimeout(l), s();
2105
+ };
2106
+ }, [
2107
+ h,
2108
+ e,
2109
+ _
2110
+ ]), /* @__PURE__ */ u("div", {
2111
+ className: V.redPacketRain,
2112
+ children: [
2113
+ /* @__PURE__ */ l("canvas", {
2114
+ ref: i,
2115
+ className: V.canvas,
2116
+ style: {
2117
+ width: 400,
2118
+ height: 500
2119
+ },
2120
+ onClick: (e) => {
2121
+ let t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left, i = e.clientY - t.top, o = !1;
2122
+ a.current = a.current.map((e) => e.grabbed || o ? e : Math.abs(n - e.x) < 30 && Math.abs(i - e.y) < 35 ? (o = !0, m((t) => t + e.amount), r?.(e.amount), {
2123
+ ...e,
2124
+ grabbed: !0
2125
+ }) : e);
2126
+ }
2127
+ }),
2128
+ /* @__PURE__ */ u("div", {
2129
+ className: V.hud,
2130
+ children: [/* @__PURE__ */ u("span", { children: ["已抢: ¥", p] }), !h && /* @__PURE__ */ l("span", {
2131
+ className: V.end,
2132
+ children: "红包雨结束"
2133
+ })]
2134
+ }),
2135
+ /* @__PURE__ */ l("p", {
2136
+ className: V.hint,
2137
+ children: "点击红包抢夺"
2138
+ })
2139
+ ]
2140
+ });
2141
+ }, H = {
692
2142
  returnCityContainer: "cos-returnCityContainer-6XTxj",
693
2143
  star: "cos-star-a59Dx",
694
2144
  glassWrap: "cos-glassWrap-golMO",
695
2145
  rotate: "cos-rotate-7X9Jj",
696
2146
  glassItem: "cos-glassItem-OwlFI"
697
- }, K = ({ starCount: e, glassCount: t = 8, glassRadius: r = 150 }) => {
698
- let i = a(null), o = a(null);
2147
+ }, lt = ({ starCount: e, glassCount: t = 8, glassRadius: r = 150 }) => {
2148
+ let i = o(null), a = o(null);
699
2149
  return n(() => {
700
- let n = i.current, a = o.current;
701
- if (!n || !a) return;
2150
+ let n = i.current, o = a.current;
2151
+ if (!n || !o) return;
702
2152
  let s = [], c = [], l = [], { width: u, height: d } = n.getBoundingClientRect(), f = e ?? Math.max(20, Math.floor(u / 20));
703
2153
  for (let e = 0; e < f; e++) {
704
2154
  let e = window.setTimeout(() => {
705
2155
  let e = document.createElement("div");
706
- e.className = G.star, e.style.top = `${Math.random() * d}px`, e.style.left = `${Math.random() * u}px`, n.append(e), c.push(e);
2156
+ e.className = H.star, e.style.top = `${Math.random() * d}px`, e.style.left = `${Math.random() * u}px`, n.append(e), c.push(e);
707
2157
  }, Math.random() * 2e3);
708
2158
  s.push(e);
709
2159
  }
710
2160
  for (let e = 0; e < t; e++) {
711
2161
  let n = document.createElement("div");
712
- n.className = G.glassItem, n.style.transform = `rotateY(${360 / t * e}deg) translateZ(${r}px)`, a.appendChild(n), l.push(n);
2162
+ n.className = H.glassItem, n.style.transform = `rotateY(${360 / t * e}deg) translateZ(${r}px)`, o.appendChild(n), l.push(n);
713
2163
  let i = window.setTimeout(() => {
714
2164
  n.style.top = "0px", n.style.opacity = "1";
715
2165
  }, e * 300);
@@ -722,15 +2172,486 @@ var M = {
722
2172
  e,
723
2173
  t,
724
2174
  r
725
- ]), /* @__PURE__ */ c("div", {
2175
+ ]), /* @__PURE__ */ l("div", {
726
2176
  ref: i,
727
- className: G.returnCityContainer,
728
- children: /* @__PURE__ */ c("div", {
729
- ref: o,
730
- className: G.glassWrap
2177
+ className: H.returnCityContainer,
2178
+ children: /* @__PURE__ */ l("div", {
2179
+ ref: a,
2180
+ className: H.glassWrap
731
2181
  })
732
2182
  });
2183
+ }, U = {
2184
+ speedometer: "cos-speedometer-INc7F",
2185
+ svg: "cos-svg-HG-lE",
2186
+ track: "cos-track-5-922",
2187
+ valueArc: "cos-valueArc-eJn3E",
2188
+ tick: "cos-tick-vaiJh",
2189
+ needle: "cos-needle-PwRAD",
2190
+ hub: "cos-hub-4WaHw",
2191
+ valueText: "cos-valueText--q4Xi",
2192
+ label: "cos-label-hOPy1"
2193
+ }, W = (e, t, n, r) => {
2194
+ let i = (r - 90) * Math.PI / 180;
2195
+ return {
2196
+ x: e + n * Math.cos(i),
2197
+ y: t + n * Math.sin(i)
2198
+ };
2199
+ }, ut = ({ value: e = 0, max: t = 100, label: n = "SPEED", color: r = "#f97316" }) => {
2200
+ let i = -120 + y(t > 0 ? e / t : 0, 0, 1) * 240, o = a(() => {
2201
+ let e = W(100, 100, 72, -120), t = W(100, 100, 72, 120);
2202
+ return `M ${e.x} ${e.y} A 72 72 0 1 1 ${t.x} ${t.y}`;
2203
+ }, []), s = a(() => {
2204
+ let e = W(100, 100, 72, -120), t = W(100, 100, 72, i), n = +(i - -120 > 180);
2205
+ return `M ${e.x} ${e.y} A 72 72 0 ${n} 1 ${t.x} ${t.y}`;
2206
+ }, [i]), c = W(100, 100, 58, i);
2207
+ return /* @__PURE__ */ u("div", {
2208
+ className: U.speedometer,
2209
+ style: { "--gauge-color": r },
2210
+ children: [/* @__PURE__ */ u("svg", {
2211
+ viewBox: "0 0 200 130",
2212
+ className: U.svg,
2213
+ children: [
2214
+ /* @__PURE__ */ l("path", {
2215
+ d: o,
2216
+ className: U.track,
2217
+ fill: "none",
2218
+ strokeWidth: "12",
2219
+ strokeLinecap: "round"
2220
+ }),
2221
+ /* @__PURE__ */ l("path", {
2222
+ d: s,
2223
+ className: U.valueArc,
2224
+ fill: "none",
2225
+ strokeWidth: "12",
2226
+ strokeLinecap: "round"
2227
+ }),
2228
+ [
2229
+ -120,
2230
+ -60,
2231
+ 0,
2232
+ 60,
2233
+ 120
2234
+ ].map((e) => {
2235
+ let t = W(100, 100, 58, e), n = W(100, 100, 66, e);
2236
+ return /* @__PURE__ */ l("line", {
2237
+ x1: t.x,
2238
+ y1: t.y,
2239
+ x2: n.x,
2240
+ y2: n.y,
2241
+ className: U.tick
2242
+ }, e);
2243
+ }),
2244
+ /* @__PURE__ */ l("line", {
2245
+ x1: "100",
2246
+ y1: "100",
2247
+ x2: c.x,
2248
+ y2: c.y,
2249
+ className: U.needle
2250
+ }),
2251
+ /* @__PURE__ */ l("circle", {
2252
+ cx: "100",
2253
+ cy: "100",
2254
+ r: "6",
2255
+ className: U.hub
2256
+ }),
2257
+ /* @__PURE__ */ l("text", {
2258
+ x: "100",
2259
+ y: "118",
2260
+ className: U.valueText,
2261
+ children: Math.round(e)
2262
+ })
2263
+ ]
2264
+ }), /* @__PURE__ */ l("span", {
2265
+ className: U.label,
2266
+ children: n
2267
+ })]
2268
+ });
2269
+ }, G = {
2270
+ timelinePulse: "cos-timelinePulse-kcBM6",
2271
+ axis: "cos-axis-9DWis",
2272
+ track: "cos-track-jG-HV",
2273
+ progress: "cos-progress-gf7v1",
2274
+ steps: "cos-steps-Z-40O",
2275
+ step: "cos-step-UO2Ux",
2276
+ dot: "cos-dot-HJEVy",
2277
+ pulse: "cos-pulse-N6FD1",
2278
+ name: "cos-name-7zefJ"
2279
+ }, dt = ({ steps: e = [
2280
+ "Start",
2281
+ "Process",
2282
+ "Review",
2283
+ "Done"
2284
+ ], current: t = 0, color: n = "#22d3ee" }) => {
2285
+ let r = y(t, 0, Math.max(0, e.length - 1)), i = e.length > 1 ? r / (e.length - 1) : 0;
2286
+ return /* @__PURE__ */ l("div", {
2287
+ className: G.timelinePulse,
2288
+ style: {
2289
+ "--pulse-color": n,
2290
+ "--step-count": e.length,
2291
+ "--progress-ratio": i
2292
+ },
2293
+ children: /* @__PURE__ */ u("div", {
2294
+ className: G.axis,
2295
+ children: [
2296
+ /* @__PURE__ */ l("div", { className: G.track }),
2297
+ /* @__PURE__ */ l("div", { className: G.progress }),
2298
+ /* @__PURE__ */ l("ul", {
2299
+ className: G.steps,
2300
+ children: e.map((e, t) => {
2301
+ let n = t < r ? "done" : t === r ? "current" : "pending";
2302
+ return /* @__PURE__ */ u("li", {
2303
+ className: G.step,
2304
+ "data-state": n,
2305
+ children: [/* @__PURE__ */ l("span", { className: G.dot }), /* @__PURE__ */ l("span", {
2306
+ className: G.name,
2307
+ children: e
2308
+ })]
2309
+ }, e + t);
2310
+ })
2311
+ })
2312
+ ]
2313
+ })
2314
+ });
2315
+ }, K = {
2316
+ rippleWater: "cos-rippleWater-wsinI",
2317
+ canvas: "cos-canvas-XOdSF",
2318
+ hint: "cos-hint-0JH5D"
2319
+ }, ft = ({ width: e = 800, height: r = 500, color: i = "#38bdf8" }) => {
2320
+ let a = o(null), s = o([]), c = o(0), d = t((t, n) => {
2321
+ let i = a.current;
2322
+ if (!i) return;
2323
+ let o = i.getBoundingClientRect(), c = t - o.left, l = n - o.top, u = Math.max(e, r) * .45;
2324
+ s.current.push({
2325
+ x: c,
2326
+ y: l,
2327
+ radius: 0,
2328
+ maxRadius: u,
2329
+ alpha: .7
2330
+ });
2331
+ }, [r, e]);
2332
+ return n(() => {
2333
+ let e = a.current;
2334
+ if (!e) return;
2335
+ let t = (e) => d(e.clientX, e.clientY), n = (e) => {
2336
+ let t = e.touches[0];
2337
+ t && d(t.clientX, t.clientY);
2338
+ };
2339
+ return e.addEventListener("click", t), e.addEventListener("touchstart", n, { passive: !0 }), () => {
2340
+ e.removeEventListener("click", t), e.removeEventListener("touchstart", n);
2341
+ };
2342
+ }, [d]), n(() => {
2343
+ let t = a.current;
2344
+ if (!t) return;
2345
+ let n = window.devicePixelRatio || 1;
2346
+ t.width = e * n, t.height = r * n;
2347
+ let o = t.getContext("2d");
2348
+ if (!o) return;
2349
+ o.setTransform(n, 0, 0, n, 0, 0);
2350
+ let l = document.hidden, u = v((e) => {
2351
+ l = e;
2352
+ }), d = () => {
2353
+ if (c.current = requestAnimationFrame(d), l) return;
2354
+ o.fillStyle = "#0c1929", o.fillRect(0, 0, e, r);
2355
+ let t = o.createLinearGradient(0, 0, 0, r);
2356
+ t.addColorStop(0, "#0f2744"), t.addColorStop(1, "#061018"), o.fillStyle = t, o.fillRect(0, 0, e, r), s.current = s.current.filter((e) => (e.radius += 2.5, e.alpha -= .012, e.alpha <= 0 ? !1 : (o.beginPath(), o.arc(e.x, e.y, e.radius, 0, Math.PI * 2), o.strokeStyle = i, o.globalAlpha = e.alpha * (1 - e.radius / e.maxRadius), o.lineWidth = 2, o.stroke(), e.radius > 8 && (o.beginPath(), o.arc(e.x, e.y, e.radius * .6, 0, Math.PI * 2), o.strokeStyle = i, o.globalAlpha = e.alpha * .4, o.lineWidth = 1, o.stroke()), o.globalAlpha = 1, !0)));
2357
+ };
2358
+ return d(), () => {
2359
+ cancelAnimationFrame(c.current), u();
2360
+ };
2361
+ }, [
2362
+ i,
2363
+ r,
2364
+ e
2365
+ ]), /* @__PURE__ */ u("div", {
2366
+ className: K.rippleWater,
2367
+ style: {
2368
+ width: e,
2369
+ height: r
2370
+ },
2371
+ children: [/* @__PURE__ */ l("canvas", {
2372
+ ref: a,
2373
+ className: K.canvas,
2374
+ style: {
2375
+ width: e,
2376
+ height: r
2377
+ }
2378
+ }), /* @__PURE__ */ l("span", {
2379
+ className: K.hint,
2380
+ children: "点击水面产生涟漪"
2381
+ })]
2382
+ });
733
2383
  }, q = {
2384
+ scrambleText: "cos-scrambleText-hN4Wm",
2385
+ text: "cos-text-frsHs",
2386
+ cursor: "cos-cursor-3zQOy",
2387
+ blink: "cos-blink-OcKXu"
2388
+ }, pt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*", mt = ({ text: e = "DECRYPTED", duration: t = 2e3, charset: r = pt }) => {
2389
+ let [i, a] = s(""), c = o(0), d = o(0);
2390
+ return n(() => {
2391
+ let n = r.length > 0 ? r : pt, i = e;
2392
+ d.current = performance.now();
2393
+ let o = (e) => {
2394
+ let r = e - d.current, s = Math.min(r / t, 1), l = Math.floor(s * i.length);
2395
+ a(i.split("").map((e, t) => e === " " ? " " : t < l ? e : n[Math.floor(Math.random() * n.length)]).join("")), s < 1 ? c.current = requestAnimationFrame(o) : a(i);
2396
+ };
2397
+ return c.current = requestAnimationFrame(o), () => cancelAnimationFrame(c.current);
2398
+ }, [
2399
+ e,
2400
+ t,
2401
+ r
2402
+ ]), /* @__PURE__ */ l("div", {
2403
+ className: q.scrambleText,
2404
+ children: /* @__PURE__ */ u("p", {
2405
+ className: q.text,
2406
+ children: [i, /* @__PURE__ */ l("span", { className: q.cursor })]
2407
+ })
2408
+ });
2409
+ }, J = {
2410
+ scratchCard: "cos-scratchCard-McIEK",
2411
+ prize: "cos-prize-X0z5V",
2412
+ canvas: "cos-canvas-JqIlr",
2413
+ hidden: "cos-hidden-Lsfbt"
2414
+ }, ht = ({ coverColor: e = "#94a3b8", prize: r = "🎉 恭喜中奖!", onReveal: i, width: a = 300, height: c = 180 }) => {
2415
+ let d = o(null), f = o(!1), p = o(!1), [m, h] = s(!1), g = t((t) => {
2416
+ t.globalCompositeOperation = "source-over", t.fillStyle = e, t.fillRect(0, 0, a, c), t.fillStyle = "rgb(255 255 255 / 30%)", t.font = "bold 16px system-ui, sans-serif", t.textAlign = "center", t.fillText("刮开涂层", a / 2, c / 2);
2417
+ }, [
2418
+ e,
2419
+ c,
2420
+ a
2421
+ ]), _ = t((e) => {
2422
+ if (p.current) return;
2423
+ let t = e.getImageData(0, 0, a, c), n = 0;
2424
+ for (let e = 3; e < t.data.length; e += 4) t.data[e] < 128 && n++;
2425
+ n / (a * c) > .45 && (p.current = !0, h(!0), i?.());
2426
+ }, [
2427
+ c,
2428
+ i,
2429
+ a
2430
+ ]);
2431
+ n(() => {
2432
+ let e = d.current;
2433
+ if (!e) return;
2434
+ let t = window.devicePixelRatio || 1;
2435
+ e.width = a * t, e.height = c * t;
2436
+ let n = e.getContext("2d");
2437
+ n && (n.setTransform(t, 0, 0, t, 0, 0), g(n));
2438
+ }, [
2439
+ g,
2440
+ c,
2441
+ a
2442
+ ]);
2443
+ let v = (e, t) => {
2444
+ let n = d.current;
2445
+ if (!n || p.current) return;
2446
+ let r = n.getContext("2d");
2447
+ r && (r.globalCompositeOperation = "destination-out", r.beginPath(), r.arc(e, t, 20, 0, Math.PI * 2), r.fill(), _(r));
2448
+ }, y = (e) => {
2449
+ let t = d.current;
2450
+ if (!t) return null;
2451
+ let n = t.getBoundingClientRect();
2452
+ if ("touches" in e) {
2453
+ let t = e.touches[0];
2454
+ return {
2455
+ x: t.clientX - n.left,
2456
+ y: t.clientY - n.top
2457
+ };
2458
+ }
2459
+ return {
2460
+ x: e.clientX - n.left,
2461
+ y: e.clientY - n.top
2462
+ };
2463
+ }, b = (e) => {
2464
+ f.current = !0;
2465
+ let t = y(e);
2466
+ t && v(t.x, t.y);
2467
+ }, x = (e) => {
2468
+ if (!f.current) return;
2469
+ let t = y(e);
2470
+ t && v(t.x, t.y);
2471
+ }, S = () => {
2472
+ f.current = !1;
2473
+ };
2474
+ return /* @__PURE__ */ u("div", {
2475
+ className: J.scratchCard,
2476
+ style: {
2477
+ width: a,
2478
+ height: c
2479
+ },
2480
+ children: [/* @__PURE__ */ l("div", {
2481
+ className: J.prize,
2482
+ children: r
2483
+ }), /* @__PURE__ */ l("canvas", {
2484
+ ref: d,
2485
+ className: `${J.canvas} ${m ? J.hidden : ""}`,
2486
+ style: {
2487
+ width: a,
2488
+ height: c
2489
+ },
2490
+ onMouseDown: b,
2491
+ onMouseMove: x,
2492
+ onMouseUp: S,
2493
+ onMouseLeave: S,
2494
+ onTouchStart: b,
2495
+ onTouchMove: x,
2496
+ onTouchEnd: S
2497
+ })]
2498
+ });
2499
+ }, Y = {
2500
+ slotMachine: "cos-slotMachine-P6FyZ",
2501
+ machine: "cos-machine-B066r",
2502
+ reel: "cos-reel-eEpJ3",
2503
+ strip: "cos-strip-L5Z-a",
2504
+ item: "cos-item-WYJ6q",
2505
+ mask: "cos-mask-jdrj3",
2506
+ spinBtn: "cos-spinBtn-DvDE7",
2507
+ result: "cos-result-dLN5b"
2508
+ }, gt = [
2509
+ "🍒",
2510
+ "🍋",
2511
+ "🍊",
2512
+ "🍇",
2513
+ "⭐",
2514
+ "7️⃣"
2515
+ ], _t = (e) => 1 - (1 - e) ** 3, vt = ({ symbols: e = gt, onSpinEnd: r }) => {
2516
+ let [i, a] = s(!1), [c, d] = s([
2517
+ 0,
2518
+ 0,
2519
+ 0
2520
+ ]), [f, p] = s([]), m = o([
2521
+ 0,
2522
+ 0,
2523
+ 0
2524
+ ]), h = t(() => {
2525
+ let t = [];
2526
+ for (let n = 0; n < 20; n++) t.push(...e);
2527
+ return t;
2528
+ }, [e])();
2529
+ return n(() => {
2530
+ let e = m.current;
2531
+ return () => {
2532
+ e.forEach((e) => cancelAnimationFrame(e));
2533
+ };
2534
+ }, []), /* @__PURE__ */ u("div", {
2535
+ className: Y.slotMachine,
2536
+ children: [
2537
+ /* @__PURE__ */ l("div", {
2538
+ className: Y.machine,
2539
+ children: [
2540
+ 0,
2541
+ 1,
2542
+ 2
2543
+ ].map((e) => /* @__PURE__ */ u("div", {
2544
+ className: Y.reel,
2545
+ style: { height: 240 },
2546
+ children: [/* @__PURE__ */ l("div", {
2547
+ className: Y.strip,
2548
+ style: { transform: `translateY(${c[e]}px)` },
2549
+ children: h.map((e, t) => /* @__PURE__ */ l("div", {
2550
+ className: Y.item,
2551
+ style: { height: 80 },
2552
+ children: e
2553
+ }, t))
2554
+ }), /* @__PURE__ */ l("div", { className: Y.mask })]
2555
+ }, e))
2556
+ }),
2557
+ /* @__PURE__ */ l("button", {
2558
+ type: "button",
2559
+ className: Y.spinBtn,
2560
+ onClick: () => {
2561
+ if (i) return;
2562
+ a(!0), p([]);
2563
+ let t = [
2564
+ 0,
2565
+ 1,
2566
+ 2
2567
+ ].map(() => Math.floor(Math.random() * e.length)), n = t.map((t) => -(t + e.length * 10) * 80), o = [...c], s = [
2568
+ 0,
2569
+ 300,
2570
+ 600
2571
+ ], l = performance.now(), u = 0;
2572
+ [
2573
+ 0,
2574
+ 1,
2575
+ 2
2576
+ ].forEach((i) => {
2577
+ let c = s[i], f = (s) => {
2578
+ let h = s - l - c;
2579
+ if (h < 0) {
2580
+ m.current[i] = requestAnimationFrame(f);
2581
+ return;
2582
+ }
2583
+ let g = Math.min(h / 2e3, 1), _ = _t(g), v = o[i] + (n[i] - o[i]) * _;
2584
+ if (d((e) => {
2585
+ let t = [...e];
2586
+ return t[i] = v, t;
2587
+ }), g < 1) m.current[i] = requestAnimationFrame(f);
2588
+ else if (u++, u === 3) {
2589
+ let n = t.map((t) => e[t]);
2590
+ p(n), a(!1), r?.(n);
2591
+ }
2592
+ };
2593
+ m.current[i] = requestAnimationFrame(f);
2594
+ });
2595
+ },
2596
+ disabled: i,
2597
+ children: i ? "旋转中..." : "开始"
2598
+ }),
2599
+ f.length > 0 && !i && /* @__PURE__ */ l("p", {
2600
+ className: Y.result,
2601
+ children: f[0] === f[1] && f[1] === f[2] ? "🎰 大奖!" : `结果: ${f.join(" ")}`
2602
+ })
2603
+ ]
2604
+ });
2605
+ }, X = {
2606
+ splitReveal: "cos-splitReveal-6W8-6",
2607
+ text: "cos-text-miTsj",
2608
+ char: "cos-char-0gPJV",
2609
+ reveal: "cos-reveal-YGzz-",
2610
+ fromTop: "cos-fromTop-YXHUa",
2611
+ fromBottom: "cos-fromBottom-24D6g",
2612
+ fromLeft: "cos-fromLeft-OMiPY",
2613
+ fromRight: "cos-fromRight-EcMOR"
2614
+ }, yt = [
2615
+ "fromTop",
2616
+ "fromBottom",
2617
+ "fromLeft",
2618
+ "fromRight"
2619
+ ], bt = ({ text: e = "REVEAL", delay: t = 80, color: n = "#f8fafc" }) => /* @__PURE__ */ l("div", {
2620
+ className: X.splitReveal,
2621
+ children: /* @__PURE__ */ l("h1", {
2622
+ className: X.text,
2623
+ style: { "--reveal-color": n },
2624
+ children: e.split("").map((e, n) => /* @__PURE__ */ l("span", {
2625
+ className: `${X.char} ${X[yt[n % yt.length]]}`,
2626
+ style: { animationDelay: `${n * t}ms` },
2627
+ children: e === " " ? "\xA0" : e
2628
+ }, `${e}-${n}`))
2629
+ })
2630
+ }), xt = {
2631
+ spotlight: "cos-spotlight-OddY1",
2632
+ content: "cos-content-5I1Wy",
2633
+ overlay: "cos-overlay-F6CJ5"
2634
+ }, St = ({ children: e, radius: n = 120, dimColor: r = "rgba(0, 0, 0, 0.85)" }) => {
2635
+ let i = o(null), a = t((e) => {
2636
+ let t = i.current;
2637
+ if (!t) return;
2638
+ let n = t.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top;
2639
+ t.style.setProperty("--spot-x", `${r}px`), t.style.setProperty("--spot-y", `${a}px`);
2640
+ }, []);
2641
+ return /* @__PURE__ */ u("div", {
2642
+ ref: i,
2643
+ className: xt.spotlight,
2644
+ style: {
2645
+ "--spot-radius": `${n}px`,
2646
+ "--dim-color": r
2647
+ },
2648
+ onMouseMove: a,
2649
+ children: [/* @__PURE__ */ l("div", {
2650
+ className: xt.content,
2651
+ children: e
2652
+ }), /* @__PURE__ */ l("div", { className: xt.overlay })]
2653
+ });
2654
+ }, Z = {
734
2655
  turntable: "cos-turntable-dkc32",
735
2656
  wheelWrap: "cos-wheelWrap-n7lhc",
736
2657
  canvas: "cos-canvas-A1-4x",
@@ -738,7 +2659,7 @@ var M = {
738
2659
  spinBtn: "cos-spinBtn-l9JIC",
739
2660
  result: "cos-result-H8q2c",
740
2661
  "fade-in": "cos-fade-in-U9bUC"
741
- }, J = [
2662
+ }, Ct = [
742
2663
  "#FF6B6B",
743
2664
  "#4ECDC4",
744
2665
  "#FFE66D",
@@ -747,15 +2668,15 @@ var M = {
747
2668
  "#F472B6",
748
2669
  "#34D399",
749
2670
  "#FB923C"
750
- ], Y = [
2671
+ ], wt = [
751
2672
  { label: "一等奖" },
752
2673
  { label: "二等奖" },
753
2674
  { label: "三等奖" },
754
2675
  { label: "谢谢参与" },
755
2676
  { label: "优惠券" },
756
2677
  { label: "再来一次" }
757
- ], X = (e) => 1 - (1 - e) ** 3, re = ({ prizes: e = Y, size: r = 360, spinDuration: i = 4e3, spinRounds: s = 5, buttonText: u = "开始抽奖", onSpinEnd: d }) => {
758
- let f = a(null), p = a(0), m = a(0), h = a(1), [g, _] = o(!1), [v, y] = o(null), b = r + 48, x = (e, t) => t.color ?? J[e % J.length], S = t((t) => {
2678
+ ], Tt = (e) => 1 - (1 - e) ** 3, Et = ({ prizes: e = wt, size: r = 360, spinDuration: i = 4e3, spinRounds: a = 5, buttonText: c = "开始抽奖", onSpinEnd: d }) => {
2679
+ let f = o(null), p = o(0), m = o(0), h = o(1), [g, _] = s(!1), [v, y] = s(null), b = r + 48, x = (e, t) => t.color ?? Ct[e % Ct.length], S = t((t) => {
759
2680
  let n = f.current;
760
2681
  if (!n) return;
761
2682
  let i = n.getContext("2d");
@@ -785,58 +2706,58 @@ var M = {
785
2706
  }, [b, S]), n(() => () => {
786
2707
  m.current && cancelAnimationFrame(m.current);
787
2708
  }, []);
788
- let C = (t) => {
2709
+ let ee = (t) => {
789
2710
  let n = 360 / e.length, r = (180 / Math.PI * t % 360 + 360) % 360;
790
2711
  return Math.floor((360 - r + n / 2) % 360 / n) % e.length;
791
2712
  };
792
- return /* @__PURE__ */ l("div", {
793
- className: q.turntable,
2713
+ return /* @__PURE__ */ u("div", {
2714
+ className: Z.turntable,
794
2715
  style: {
795
2716
  width: b,
796
2717
  height: b + 80
797
2718
  },
798
- children: [/* @__PURE__ */ l("div", {
799
- className: q.wheelWrap,
2719
+ children: [/* @__PURE__ */ u("div", {
2720
+ className: Z.wheelWrap,
800
2721
  style: {
801
2722
  width: b,
802
2723
  height: b
803
2724
  },
804
2725
  children: [
805
- /* @__PURE__ */ c("div", { className: q.pointer }),
806
- /* @__PURE__ */ c("canvas", {
2726
+ /* @__PURE__ */ l("div", { className: Z.pointer }),
2727
+ /* @__PURE__ */ l("canvas", {
807
2728
  ref: f,
808
- className: q.canvas,
2729
+ className: Z.canvas,
809
2730
  style: {
810
2731
  width: b,
811
2732
  height: b
812
2733
  }
813
2734
  }),
814
- /* @__PURE__ */ c("button", {
2735
+ /* @__PURE__ */ l("button", {
815
2736
  type: "button",
816
- className: q.spinBtn,
2737
+ className: Z.spinBtn,
817
2738
  onClick: () => {
818
2739
  if (g || e.length === 0) return;
819
2740
  _(!0), y(null);
820
- let t = Math.PI * 2 / e.length, n = Math.floor(Math.random() * e.length) * t + t / 2, r = p.current, a = r + s * Math.PI * 2 + (Math.PI * 2 - n) - r % (Math.PI * 2), o = r, c = performance.now(), l = (t) => {
821
- let n = t - c, r = Math.min(n / i, 1), s = X(r), u = o + (a - o) * s;
2741
+ let t = Math.PI * 2 / e.length, n = Math.floor(Math.random() * e.length) * t + t / 2, r = p.current, o = r + a * Math.PI * 2 + (Math.PI * 2 - n) - r % (Math.PI * 2), s = r, c = performance.now(), l = (t) => {
2742
+ let n = t - c, r = Math.min(n / i, 1), a = Tt(r), u = s + (o - s) * a;
822
2743
  if (p.current = u, S(u), r < 1) m.current = requestAnimationFrame(l);
823
2744
  else {
824
- let t = C(u), n = e[t];
2745
+ let t = ee(u), n = e[t];
825
2746
  p.current = u, _(!1), y(n), d?.(n, t);
826
2747
  }
827
2748
  };
828
2749
  m.current = requestAnimationFrame(l);
829
2750
  },
830
2751
  disabled: g,
831
- children: g ? "抽奖中..." : u
2752
+ children: g ? "抽奖中..." : c
832
2753
  })
833
2754
  ]
834
- }), v && !g && /* @__PURE__ */ l("p", {
835
- className: q.result,
836
- children: ["恭喜获得:", /* @__PURE__ */ c("strong", { children: v.label })]
2755
+ }), v && !g && /* @__PURE__ */ u("p", {
2756
+ className: Z.result,
2757
+ children: ["恭喜获得:", /* @__PURE__ */ l("strong", { children: v.label })]
837
2758
  })]
838
2759
  });
839
- }, Z = {
2760
+ }, Q = {
840
2761
  typewriter: "cos-typewriter-7UhOL",
841
2762
  terminal: "cos-terminal-NWNVN",
842
2763
  dots: "cos-dots-oulNg",
@@ -844,61 +2765,61 @@ var M = {
844
2765
  prompt: "cos-prompt-Y4hVD",
845
2766
  cursor: "cos-cursor-m8hGi",
846
2767
  blink: "cos-blink-XykM7"
847
- }, Q = [
2768
+ }, Dt = [
848
2769
  "Hello, cos-design!",
849
2770
  "欢迎来到组件库 ✨",
850
2771
  "Build something fun 🚀"
851
- ], ie = ({ texts: e, speed: t, deleteSpeed: r, pause: i }) => {
852
- let [a, s] = o(""), [u, d] = o(0), [f, p] = o(!1);
2772
+ ], Ot = ({ texts: e, speed: t, deleteSpeed: r, pause: i }) => {
2773
+ let [a, o] = s(""), [c, d] = s(0), [f, p] = s(!1);
853
2774
  return n(() => {
854
- let n = e[u % e.length], o;
855
- if (!f && a === n) o = setTimeout(() => p(!0), i);
856
- else if (f && a === "") o = setTimeout(() => {
2775
+ let n = e[c % e.length], s;
2776
+ if (!f && a === n) s = setTimeout(() => p(!0), i);
2777
+ else if (f && a === "") s = setTimeout(() => {
857
2778
  p(!1), d((t) => (t + 1) % e.length);
858
2779
  }, 0);
859
2780
  else {
860
2781
  let e = f ? n.slice(0, a.length - 1) : n.slice(0, a.length + 1);
861
- o = setTimeout(() => s(e), f ? r : t);
2782
+ s = setTimeout(() => o(e), f ? r : t);
862
2783
  }
863
- return () => clearTimeout(o);
2784
+ return () => clearTimeout(s);
864
2785
  }, [
865
2786
  a,
866
2787
  f,
867
- u,
2788
+ c,
868
2789
  e,
869
2790
  t,
870
2791
  r,
871
2792
  i
872
- ]), /* @__PURE__ */ c("div", {
873
- className: Z.typewriter,
874
- children: /* @__PURE__ */ l("div", {
875
- className: Z.terminal,
876
- children: [/* @__PURE__ */ l("div", {
877
- className: Z.dots,
2793
+ ]), /* @__PURE__ */ l("div", {
2794
+ className: Q.typewriter,
2795
+ children: /* @__PURE__ */ u("div", {
2796
+ className: Q.terminal,
2797
+ children: [/* @__PURE__ */ u("div", {
2798
+ className: Q.dots,
878
2799
  children: [
879
- /* @__PURE__ */ c("span", {}),
880
- /* @__PURE__ */ c("span", {}),
881
- /* @__PURE__ */ c("span", {})
2800
+ /* @__PURE__ */ l("span", {}),
2801
+ /* @__PURE__ */ l("span", {}),
2802
+ /* @__PURE__ */ l("span", {})
882
2803
  ]
883
- }), /* @__PURE__ */ l("p", {
884
- className: Z.text,
2804
+ }), /* @__PURE__ */ u("p", {
2805
+ className: Q.text,
885
2806
  children: [
886
- /* @__PURE__ */ c("span", {
887
- className: Z.prompt,
2807
+ /* @__PURE__ */ l("span", {
2808
+ className: Q.prompt,
888
2809
  children: ">"
889
2810
  }),
890
2811
  a,
891
- /* @__PURE__ */ c("span", {
892
- className: Z.cursor,
2812
+ /* @__PURE__ */ l("span", {
2813
+ className: Q.cursor,
893
2814
  children: "|"
894
2815
  })
895
2816
  ]
896
2817
  })]
897
2818
  })
898
2819
  });
899
- }, ae = ({ texts: e = Q, speed: t = 100, deleteSpeed: n = 50, pause: r = 2e3 }) => {
900
- let i = e.length > 0 ? e : Q;
901
- return /* @__PURE__ */ c(ie, {
2820
+ }, kt = ({ texts: e = Dt, speed: t = 100, deleteSpeed: n = 50, pause: r = 2e3 }) => {
2821
+ let i = e.length > 0 ? e : Dt;
2822
+ return /* @__PURE__ */ l(Ot, {
902
2823
  texts: i,
903
2824
  speed: t,
904
2825
  deleteSpeed: n,
@@ -910,9 +2831,9 @@ var M = {
910
2831
  label: "cos-label-9BHOU",
911
2832
  wave: "cos-wave-GycLU",
912
2833
  ripple: "cos-ripple-5ZFpr"
913
- }, oe = ({ text: e = "点我试试", color: t = "#38bdf8", className: n, style: r, ...i }) => /* @__PURE__ */ c("div", {
2834
+ }, At = ({ text: e = "点我试试", color: t = "#38bdf8", className: n, style: r, ...i }) => /* @__PURE__ */ l("div", {
914
2835
  className: $.waveButton,
915
- children: /* @__PURE__ */ l("button", {
2836
+ children: /* @__PURE__ */ u("button", {
916
2837
  type: "button",
917
2838
  className: `${$.btn} ${n ?? ""}`,
918
2839
  style: {
@@ -921,14 +2842,34 @@ var M = {
921
2842
  },
922
2843
  ...i,
923
2844
  children: [
924
- /* @__PURE__ */ c("span", { className: $.wave }),
925
- /* @__PURE__ */ c("span", { className: $.wave }),
926
- /* @__PURE__ */ c("span", {
2845
+ /* @__PURE__ */ l("span", { className: $.wave }),
2846
+ /* @__PURE__ */ l("span", { className: $.wave }),
2847
+ /* @__PURE__ */ l("span", {
927
2848
  className: $.label,
928
2849
  children: e
929
2850
  })
930
2851
  ]
931
2852
  })
2853
+ }), jt = {
2854
+ waveText: "cos-waveText-Zy2Tp",
2855
+ text: "cos-text-el-KR",
2856
+ char: "cos-char-Y9-mV",
2857
+ wave: "cos-wave-jVRCz"
2858
+ }, Mt = ({ text: e = "WAVE", amplitude: t = 12, color: n = "#38bdf8", fontSize: r = 56 }) => /* @__PURE__ */ l("div", {
2859
+ className: jt.waveText,
2860
+ children: /* @__PURE__ */ l("h1", {
2861
+ className: jt.text,
2862
+ style: {
2863
+ fontSize: r,
2864
+ "--wave-color": n,
2865
+ "--wave-amp": `${t}px`
2866
+ },
2867
+ children: e.split("").map((e, t) => /* @__PURE__ */ l("span", {
2868
+ className: jt.char,
2869
+ style: { animationDelay: `${t * .1}s` },
2870
+ children: e === " " ? "\xA0" : e
2871
+ }, `${e}-${t}`))
2872
+ })
932
2873
  });
933
2874
  //#endregion
934
- export { d as CanvasClock, h as Charge, b as Confetti, w as Countdown, j as Fireworks, F as FlipCounter, te as GlitchText, R as MatrixRain, B as MeteorRain, H as NeonText, W as ParticleNetwork, K as ReturnCity, re as Turntable, ae as Typewriter, oe as WaveButton };
2875
+ export { x as AudioVisualizer, _ as Aurora, f as BarcodeScan, m as BurnAway, ee as CanvasClock, te as Charge, ne as ClickSpark, oe as Confetti, fe as Countdown, _e as CursorTrail, ce as CyberGrid, ye as DiceRoll, me as DnaHelix, ge as ElectricArc, Te as Fireworks, Oe as FlipCounter, Ne as GlitchText, je as GradientFlow, Ie as GravityBalls, Le as HolographicCard, ze as LiquidGlass, Re as LiquidProgress, Ve as MagneticButton, Ue as MatrixRain, Ge as MazeGenerator, qe as MeteorRain, Je as NeonText, Ye as NewtonCradle, Ze as OrbitalChart, Qe as ParticleNetwork, at as ProgressChest, st as RadarScan, ct as RedPacketRain, lt as ReturnCity, ft as RippleWater, mt as ScrambleText, ht as ScratchCard, vt as SlotMachine, et as SmokeFog, nt as Snowfall, ut as Speedometer, bt as SplitReveal, St as Spotlight, it as Starfield, dt as TimelinePulse, Et as Turntable, kt as Typewriter, At as WaveButton, Mt as WaveText };