cos-design 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,40 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.4.0] - 2026-06-18
9
+
10
+ ### Added
11
+
12
+ - `FlipCounter` 数字翻牌器,机械翻牌风格数字展示
13
+ - `Countdown` 活动倒计时,支持目标时间与结束回调
14
+ - `Confetti` 彩纸庆祝喷射(Canvas),支持 `ref.burst()` 手动触发
15
+ - `GlitchText` 赛博朋克故障风文字
16
+ - `MeteorRain` 流星雨背景动画
17
+
18
+ ### Fixed
19
+
20
+ - `Fireworks` 修复部分烟花升空后不爆炸的问题(加入重力与多重爆炸判定)
21
+
22
+ ## [2.3.0] - 2026-06-18
23
+
24
+ ### Added
25
+
26
+ - Playground 首页支持组件搜索过滤
27
+ - 演示页新增「查看代码」侧栏,支持一键复制使用示例
28
+ - `Charge` 支持受控模式(`value` / `onChange`)及 `autoCharge`、`interval`、`step` 配置
29
+ - `Fireworks` 支持 `ref.launch()` 手动触发燃放,导出 `FireworksHandle` 类型
30
+ - `ReturnCity` 支持 `starCount`、`glassCount`、`glassRadius` 配置
31
+ - 新增项目介绍文档 `docs/cos-design-intro.md`
32
+
33
+ ### Changed
34
+
35
+ - `Charge` 修复 `setInterval` 未清理导致的内存泄漏
36
+ - `ReturnCity` 改用 ref 替代 `getElementById`,并清理定时器
37
+
38
+ ### Removed
39
+
40
+ - `ReturnCity` 移除未生效的 `shining` prop
41
+
8
42
  ## [2.2.0] - 2026-06-18
9
43
 
10
44
  ### Changed
@@ -52,6 +86,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
52
86
  - Webpack 及相关 loader 依赖
53
87
  - UMD 格式产物
54
88
 
89
+ [2.4.0]: https://github.com/jiaxiantao/cos-design/compare/v2.3.0...v2.4.0
90
+ [2.3.0]: https://github.com/jiaxiantao/cos-design/compare/v2.2.0...v2.3.0
55
91
  [2.2.0]: https://github.com/jiaxiantao/cos-design/compare/v2.1.0...v2.2.0
56
92
  [2.1.0]: https://github.com/jiaxiantao/cos-design/compare/v2.0.0...v2.1.0
57
93
  [2.0.0]: https://github.com/jiaxiantao/cos-design/compare/v1.7.5...v2.0.0
package/README.md CHANGED
@@ -47,6 +47,11 @@ function App() {
47
47
  | `Typewriter` | 打字机文字效果 |
48
48
  | `NeonText` | 霓虹灯发光文字 |
49
49
  | `WaveButton` | 波纹扩散按钮 |
50
+ | `FlipCounter` | 数字翻牌器 |
51
+ | `Countdown` | 活动倒计时 |
52
+ | `Confetti` | 彩纸庆祝喷射 |
53
+ | `GlitchText` | 故障风发光文字 |
54
+ | `MeteorRain` | 流星雨背景 |
50
55
 
51
56
  ## 本地开发
52
57
 
@@ -76,7 +81,7 @@ npm run setup
76
81
  npx --yes pnpm@9 dev
77
82
  ```
78
83
 
79
- 访问 `http://localhost:4000` 进入首页,点击卡片跳转到对应组件演示(共 10 个组件)。
84
+ 访问 `http://localhost:4000` 进入首页,点击卡片跳转到对应组件演示(共 15 个组件)。
80
85
 
81
86
  ## 脚本
82
87
 
@@ -130,6 +135,10 @@ git tag v2.2.0 && git push origin v2.2.0
130
135
 
131
136
  推送后可在 [Actions](https://github.com/jiaxiantao/cos-design/actions) 查看发布进度。若 npm 上已存在相同版本号,会自动跳过发布。
132
137
 
138
+ ## 文档
139
+
140
+ - [完整介绍与实践指南](./docs/cos-design-intro.md) — 项目背景、架构、组件能力与适用场景
141
+
133
142
  ## 参与贡献
134
143
 
135
144
  欢迎提交 Issue 与 Pull Request,请参阅 [CONTRIBUTING.md](./CONTRIBUTING.md)。
@@ -1,6 +1,17 @@
1
1
  import { default as React } from 'react';
2
2
  export interface ChargeProps {
3
+ /** 初始电量(非受控),默认 0 */
3
4
  initQuantity?: number;
5
+ /** 受控电量 0–100 */
6
+ value?: number;
7
+ /** 电量变化回调 */
8
+ onChange?: (value: number) => void;
9
+ /** 是否自动充电,默认 true */
10
+ autoCharge?: boolean;
11
+ /** 充电间隔(毫秒),默认 500 */
12
+ interval?: number;
13
+ /** 每次增量,默认 0.01 */
14
+ step?: number;
4
15
  }
5
16
  declare const Charge: (props: ChargeProps) => React.ReactElement;
6
17
  export default Charge;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ export interface ConfettiProps {
3
+ width?: number;
4
+ height?: number;
5
+ /** 挂载后自动播放,默认 true */
6
+ auto?: boolean;
7
+ /** 每次喷射粒子数,默认 120 */
8
+ particleCount?: number;
9
+ }
10
+ export interface ConfettiHandle {
11
+ /** 手动触发彩纸喷射 */
12
+ burst: () => void;
13
+ }
14
+ declare const Confetti: React.ForwardRefExoticComponent<ConfettiProps & React.RefAttributes<ConfettiHandle>>;
15
+ export default Confetti;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export interface CountdownProps {
3
+ /** 目标时间(Date、时间戳或 ISO 字符串) */
4
+ targetDate: Date | string | number;
5
+ /** 倒计时结束回调 */
6
+ onEnd?: () => void;
7
+ /** 是否显示单位标签,默认 true */
8
+ showLabels?: boolean;
9
+ /** 主色 */
10
+ color?: string;
11
+ }
12
+ declare const Countdown: React.FC<CountdownProps>;
13
+ export default Countdown;
@@ -5,5 +5,9 @@ export interface FireworksProps {
5
5
  /** 是否自动燃放,默认 true */
6
6
  auto?: boolean;
7
7
  }
8
- declare const Fireworks: React.FC<FireworksProps>;
8
+ export interface FireworksHandle {
9
+ /** 手动燃放烟花,可指定 x 坐标 */
10
+ launch: (x?: number) => void;
11
+ }
12
+ declare const Fireworks: React.ForwardRefExoticComponent<FireworksProps & React.RefAttributes<FireworksHandle>>;
9
13
  export default Fireworks;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export interface FlipCounterProps {
3
+ /** 显示数值 */
4
+ value: number;
5
+ /** 最少位数(左侧补零),默认 4 */
6
+ digits?: number;
7
+ /** 主色 */
8
+ color?: string;
9
+ /** 翻牌动画时长(毫秒),默认 600 */
10
+ duration?: number;
11
+ }
12
+ declare const FlipCounter: React.FC<FlipCounterProps>;
13
+ export default FlipCounter;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ export interface GlitchTextProps {
3
+ /** 显示文字 */
4
+ text?: string;
5
+ /** 主色 */
6
+ color?: string;
7
+ /** 故障色 1 */
8
+ glitchColor1?: string;
9
+ /** 故障色 2 */
10
+ glitchColor2?: string;
11
+ /** 字号 */
12
+ fontSize?: number;
13
+ }
14
+ declare const GlitchText: React.FC<GlitchTextProps>;
15
+ export default GlitchText;
@@ -2,10 +2,20 @@ export { default as CanvasClock } from './canvasClock';
2
2
  export type { CanvasClockProps } from './canvasClock';
3
3
  export { default as Charge } from './charge';
4
4
  export type { ChargeProps } from './charge';
5
+ export { default as Confetti } from './confetti';
6
+ export type { ConfettiHandle, ConfettiProps } from './confetti';
7
+ export { default as Countdown } from './countdown';
8
+ export type { CountdownProps } from './countdown';
5
9
  export { default as Fireworks } from './fireworks';
6
- export type { FireworksProps } from './fireworks';
10
+ export type { FireworksHandle, FireworksProps } from './fireworks';
11
+ export { default as FlipCounter } from './flipCounter';
12
+ export type { FlipCounterProps } from './flipCounter';
13
+ export { default as GlitchText } from './glitchText';
14
+ export type { GlitchTextProps } from './glitchText';
7
15
  export { default as MatrixRain } from './matrixRain';
8
16
  export type { MatrixRainProps } from './matrixRain';
17
+ export { default as MeteorRain } from './meteorRain';
18
+ export type { MeteorRainProps } from './meteorRain';
9
19
  export { default as NeonText } from './neonText';
10
20
  export type { NeonTextProps } from './neonText';
11
21
  export { default as ParticleNetwork } from './particleNetwork';
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ export interface MeteorRainProps {
3
+ width?: number;
4
+ height?: number;
5
+ /** 流星数量,默认 8 */
6
+ meteorCount?: number;
7
+ }
8
+ declare const MeteorRain: React.FC<MeteorRainProps>;
9
+ export default MeteorRain;
@@ -1,6 +1,11 @@
1
1
  import { default as React } from 'react';
2
2
  export interface ReturnCityProps {
3
- shining?: number;
3
+ /** 星星数量,默认按屏幕宽度自动计算 */
4
+ starCount?: number;
5
+ /** 光壁数量,默认 6 */
6
+ glassCount?: number;
7
+ /** 光壁半径(px),默认 150 */
8
+ glassRadius?: number;
4
9
  }
5
10
  declare const ReturnCity: React.FC<ReturnCityProps>;
6
11
  export default ReturnCity;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});require('./index.css');var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime");var u={canvasClock:`cos-canvasClock`,canvasTarget:`cos-canvasTarget`},d=({width:e=400,height:t=400})=>{let n=(0,c.useRef)(null),r=Math.min(e,t),i=r/2-16,a=r/2,o=(0,c.useCallback)(e=>{e.clearRect(0,0,r,r),e.save(),e.translate(a,a),e.beginPath(),e.arc(0,0,i,0,Math.PI*2),e.fillStyle=`#fff`,e.fill(),e.strokeStyle=`#d1d5db`,e.lineWidth=2,e.stroke();for(let t=0;t<60;t++){let n=t/60*Math.PI*2,r=i-(t%5==0?14:8);e.beginPath(),e.moveTo(Math.cos(n)*r,Math.sin(n)*r),e.lineTo(Math.cos(n)*i,Math.sin(n)*i),e.strokeStyle=t%5==0?`#374151`:`#9ca3af`,e.lineWidth=t%5==0?2:1,e.stroke()}e.fillStyle=`#111827`,e.font=`bold ${Math.floor(r/22)}px system-ui, sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`;for(let t=1;t<=12;t++){let n=t/12*Math.PI*2-Math.PI/2,r=i-32;e.fillText(String(t),Math.cos(n)*r,Math.sin(n)*r)}let t=new Date,n=t.getHours()%12,o=t.getMinutes(),s=t.getSeconds(),c=t.getMilliseconds(),l=(t,n,r,i,a)=>{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()},u=(n+o/60)/12*Math.PI*2-Math.PI/2,d=(o+s/60)/60*Math.PI*2-Math.PI/2,f=(s+c/1e3)/60*Math.PI*2-Math.PI/2;l(u,i*.5,4,`#111827`,`rgb(0 0 0 / 40%)`),l(d,i*.72,3,`#1e80ff`,`rgb(30 128 255 / 40%)`),l(f,i*.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()},[a,i,r]);return(0,c.useEffect)(()=>{let e=n.current;if(!e)return;let t=window.devicePixelRatio||1;e.width=r*t,e.height=r*t;let i=e.getContext(`2d`);if(!i)return;i.setTransform(t,0,0,t,0,0);let a=0,s=()=>{o(i),a=requestAnimationFrame(s)};return s(),()=>cancelAnimationFrame(a)},[o,r]),(0,l.jsx)(`div`,{className:u.canvasClock,style:{width:r,height:r},children:(0,l.jsx)(`canvas`,{ref:n,className:u.canvasTarget,style:{width:r,height:r}})})},f={chargeContainer:`cos-chargeContainer`,contrast:`cos-contrast`,hueRotate:`cos-hueRotate`,text:`cos-text`,moveUp:`cos-moveUp`,circle:`cos-circle`,circleRotate:`cos-circleRotate`,button:`cos-button`},p=e=>{let{initQuantity:t=0}=e,[n,r]=(0,c.useState)(t);return(0,c.useEffect)(()=>{let e=n;setInterval(()=>{e=Number(Number(e+=.01).toFixed(2)),r(e)},500)},[]),(0,l.jsx)(`div`,{className:f.chargeContainer,children:(0,l.jsxs)(`div`,{className:f.contrast,children:[(0,l.jsxs)(`div`,{className:f.text,children:[n?n.toString().padEnd(4,`0`):0,`%`]}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`div`,{className:f.circle}),(0,l.jsx)(`div`,{className:f.button})]})})},m={fireworks:`cos-fireworks`,canvas:`cos-canvas`,hint:`cos-hint`},h=[`#ff6b6b`,`#ffd93d`,`#6bcb77`,`#4d96ff`,`#a66cff`,`#ff85c0`],g=()=>h[Math.floor(Math.random()*h.length)],_=(e,t,n)=>{let r=60+Math.floor(Math.random()*30);return Array.from({length:r},()=>{let r=Math.random()*Math.PI*2,i=Math.random()*4+2;return{x:e,y:t,vx:Math.cos(r)*i,vy:Math.sin(r)*i,alpha:1,color:Math.random()>.3?n:g(),decay:Math.random()*.015+.01}})},v=({width:e=800,height:t=500,auto:n=!0})=>{let r=(0,c.useRef)(null),i=(0,c.useRef)([]),a=(0,c.useRef)(0),o=(0,c.useCallback)(n=>{let r=n??Math.random()*e*.6+e*.2;i.current.push({x:r,y:t,vy:-(Math.random()*4+6),targetY:Math.random()*t*.4+t*.1,color:g(),exploded:!1,particles:[]})},[t,e]);return(0,c.useEffect)(()=>{let s=r.current;if(!s)return;let c=window.devicePixelRatio||1;s.width=e*c,s.height=t*c;let l=s.getContext(`2d`);if(!l)return;l.setTransform(c,0,0,c,0,0);let u=0,d=()=>{a.current=requestAnimationFrame(d),l.fillStyle=`rgb(15 23 42 / 25%)`,l.fillRect(0,0,e,t),n&&Math.random()<.03&&o(),i.current=i.current.filter(e=>e.exploded?(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:(l.beginPath(),l.arc(e.x,e.y,2,0,Math.PI*2),l.fillStyle=e.color,l.globalAlpha=e.alpha,l.fill(),l.globalAlpha=1,!0))),e.particles.length>0):(e.y+=e.vy,e.vy*=.98,l.beginPath(),l.arc(e.x,e.y,2.5,0,Math.PI*2),l.fillStyle=e.color,l.fill(),(e.vy>=0||e.y<=e.targetY)&&(e.exploded=!0,e.particles=_(e.x,e.y,e.color)),!0))};return d(),n&&(u=window.setInterval(()=>o(),1200)),()=>{cancelAnimationFrame(a.current),clearInterval(u)}},[n,t,o,e]),(0,l.jsxs)(`div`,{className:m.fireworks,style:{width:e,height:t},children:[(0,l.jsx)(`canvas`,{ref:r,className:m.canvas,style:{width:e,height:t},onClick:e=>{let t=e.currentTarget.getBoundingClientRect();o(e.clientX-t.left)}}),(0,l.jsx)(`p`,{className:m.hint,children:`点击画布燃放烟花`})]})},y={matrixRain:`cos-matrixRain`,canvas:`cos-canvas`,overlay:`cos-overlay`,title:`cos-title`,flicker:`cos-flicker`,subtitle:`cos-subtitle`},b=`ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*アイウエオカキクケコ`,x=({width:e=800,height:t=500,density:n=.6,color:r=`#00ff41`})=>{let i=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let a=i.current;if(!a)return;let o=window.devicePixelRatio||1;a.width=e*o,a.height=t*o;let s=a.getContext(`2d`);if(!s)return;s.setTransform(o,0,0,o,0,0);let c=Math.floor(e/16*n),l=Array.from({length:c},()=>Math.random()*-50),u=0,d=()=>{s.fillStyle=`rgb(0 0 0 / 8%)`,s.fillRect(0,0,e,t),s.fillStyle=r,s.font=`16px monospace`,l.forEach((e,i)=>{let a=b[Math.floor(Math.random()*53)],o=i/n*16;s.fillStyle=r,s.fillText(a,o,e*16),e*16>t&&Math.random()>.975&&(l[i]=0),l[i]+=1}),u=requestAnimationFrame(d)};return d(),()=>cancelAnimationFrame(u)},[r,n,t,e]),(0,l.jsxs)(`div`,{className:y.matrixRain,style:{width:e,height:t},children:[(0,l.jsx)(`canvas`,{ref:i,className:y.canvas,style:{width:e,height:t}}),(0,l.jsxs)(`div`,{className:y.overlay,children:[(0,l.jsx)(`h2`,{className:y.title,children:`MATRIX`}),(0,l.jsx)(`p`,{className:y.subtitle,children:`数字雨效果`})]})]})},S={neonText:`cos-neonText`,text:`cos-text`,flicker:`cos-flicker`,"neon-flicker":`cos-neon-flicker`,reflection:`cos-reflection`},C=({text:e=`NEON`,color:t=`#ff00de`,fontSize:n=72,flicker:r=!0})=>(0,l.jsxs)(`div`,{className:S.neonText,children:[(0,l.jsx)(`h1`,{className:`${S.text} ${r?S.flicker:``}`,style:{fontSize:n,"--neon-color":t},children:e}),(0,l.jsx)(`p`,{className:S.reflection,style:{fontSize:n*.35,color:t},children:e})]}),w={particleNetwork:`cos-particleNetwork`,canvas:`cos-canvas`,hint:`cos-hint`},T=({width:e=800,height:t=500,particleCount:n=60,linkDistance:r=120,color:i=`#38bdf8`})=>{let a=(0,c.useRef)(null),o=(0,c.useRef)([]),s=(0,c.useRef)({x:-1e3,y:-1e3}),u=(0,c.useCallback)(()=>{o.current=Array.from({length:n},()=>({x:Math.random()*e,y:Math.random()*t,vx:(Math.random()-.5)*1.2,vy:(Math.random()-.5)*1.2,radius:Math.random()*2+1}))},[t,n,e]);return(0,c.useEffect)(()=>{u()},[u]),(0,c.useEffect)(()=>{let n=a.current;if(!n)return;let c=window.devicePixelRatio||1;n.width=e*c,n.height=t*c;let l=n.getContext(`2d`);if(!l)return;l.setTransform(c,0,0,c,0,0);let u=0,d=()=>{l.fillStyle=`#0f172a`,l.fillRect(0,0,e,t);let n=o.current,a=s.current;n.forEach(n=>{n.x+=n.vx,n.y+=n.vy,(n.x<0||n.x>e)&&(n.vx*=-1),(n.y<0||n.y>t)&&(n.vy*=-1);let r=a.x-n.x,i=a.y-n.y;Math.sqrt(r*r+i*i)<150&&(n.vx-=r*3e-4,n.vy-=i*3e-4)});for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++){let a=n[e].x-n[t].x,o=n[e].y-n[t].y,s=Math.sqrt(a*a+o*o);s<r&&(l.beginPath(),l.moveTo(n[e].x,n[e].y),l.lineTo(n[t].x,n[t].y),l.strokeStyle=i,l.globalAlpha=1-s/r,l.lineWidth=.8,l.stroke(),l.globalAlpha=1)}n.forEach(e=>{l.beginPath(),l.arc(e.x,e.y,e.radius,0,Math.PI*2),l.fillStyle=i,l.fill()}),u=requestAnimationFrame(d)};return d(),()=>cancelAnimationFrame(u)},[i,t,u,r,e]),(0,l.jsxs)(`div`,{className:w.particleNetwork,style:{width:e,height:t},children:[(0,l.jsx)(`canvas`,{ref:a,className:w.canvas,style:{width:e,height:t},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect();s.current={x:e.clientX-t.left,y:e.clientY-t.top}},onMouseLeave:()=>{s.current={x:-1e3,y:-1e3}}}),(0,l.jsx)(`p`,{className:w.hint,children:`移动鼠标与粒子互动`})]})},E={returnCityContainer:`cos-returnCityContainer`,star:`cos-star`,glassWrap:`cos-glassWrap`,rotate:`cos-rotate`,glassItem:`cos-glassItem`},D=()=>{let e=(e,t)=>{for(let n=0;n<t;n++)setTimeout(function(){let t=document.createElement(`div`);t.className=E.star;let n=document.body.clientWidth,r=document.body.clientHeight,i=Math.random()*n+`px`,a=Math.random()*r+`px`;t.style.top=a,t.style.left=i,e.append(t)},Math.random()*2e3)},t=()=>{let e=document.getElementById(`glassWrap`);if(e)for(let t=0;t<6;t++){let n=document.createElement(`div`);n.className=E.glassItem,n.style.transform=`rotateY(${360/6*t}deg) translateZ(150px)`,e.appendChild(n),setTimeout(()=>{n.style.top=`0px`,n.style.opacity=`1`},t*300)}};return(0,c.useEffect)(()=>{let n=document.getElementById(`returnCityContainer`);n&&e(n,document.documentElement.clientWidth/20),t()},[]),(0,l.jsx)(`div`,{id:`returnCityContainer`,className:E.returnCityContainer,children:(0,l.jsx)(`div`,{id:`glassWrap`,className:E.glassWrap})})},O={turntable:`cos-turntable`,wheelWrap:`cos-wheelWrap`,canvas:`cos-canvas`,pointer:`cos-pointer`,spinBtn:`cos-spinBtn`,result:`cos-result`,"fade-in":`cos-fade-in`},k=[`#FF6B6B`,`#4ECDC4`,`#FFE66D`,`#A78BFA`,`#60A5FA`,`#F472B6`,`#34D399`,`#FB923C`],A=[{label:`一等奖`},{label:`二等奖`},{label:`三等奖`},{label:`谢谢参与`},{label:`优惠券`},{label:`再来一次`}],j=e=>1-(1-e)**3,M=({prizes:e=A,size:t=360,spinDuration:n=4e3,spinRounds:r=5,buttonText:i=`开始抽奖`,onSpinEnd:a})=>{let o=(0,c.useRef)(null),s=(0,c.useRef)(0),u=(0,c.useRef)(0),d=(0,c.useRef)(1),[f,p]=(0,c.useState)(!1),[m,h]=(0,c.useState)(null),g=t+48,_=(e,t)=>t.color??k[e%k.length],v=(0,c.useCallback)(n=>{let r=o.current;if(!r)return;let i=r.getContext(`2d`);if(!i)return;let a=g/2,s=t/2,c=Math.PI*2/e.length;i.clearRect(0,0,g,g),i.save(),i.translate(a,a),i.rotate(n),e.forEach((e,n)=>{let r=n*c-Math.PI/2,a=r+c,o=_(n,e);i.beginPath(),i.moveTo(0,0),i.arc(0,0,s,r,a),i.closePath(),i.fillStyle=o,i.fill(),i.strokeStyle=`rgb(255 255 255 / 35%)`,i.lineWidth=2,i.stroke(),i.save(),i.rotate(r+c/2),i.textAlign=`right`,i.fillStyle=`#fff`,i.font=`bold ${Math.max(12,Math.floor(t/22))}px system-ui, sans-serif`,i.shadowColor=`rgb(0 0 0 / 30%)`,i.shadowBlur=4,i.fillText(e.label,s-18,6),i.restore()}),i.beginPath(),i.arc(0,0,s,0,Math.PI*2),i.strokeStyle=`#fbbf24`,i.lineWidth=6,i.stroke(),i.beginPath(),i.arc(0,0,s-4,0,Math.PI*2),i.strokeStyle=`#f59e0b`,i.lineWidth=2,i.stroke(),i.restore(),i.save(),i.translate(a,a);for(let e=0;e<12;e++){let t=e/12*Math.PI*2,n=Math.cos(t)*(s+14),r=Math.sin(t)*(s+14);i.beginPath(),i.arc(n,r,3,0,Math.PI*2),i.fillStyle=e%2==0?`#fde68a`:`#f59e0b`,i.fill()}i.restore()},[g,e,t]);(0,c.useEffect)(()=>{let e=o.current;if(!e)return;let t=window.devicePixelRatio||1;d.current=t,e.width=g*t,e.height=g*t;let n=e.getContext(`2d`);n&&n.setTransform(t,0,0,t,0,0),v(s.current)},[g,v]),(0,c.useEffect)(()=>()=>{u.current&&cancelAnimationFrame(u.current)},[]);let y=t=>{let n=360/e.length,r=(180/Math.PI*t%360+360)%360;return Math.floor((360-r+n/2)%360/n)%e.length};return(0,l.jsxs)(`div`,{className:O.turntable,style:{width:g,height:g+80},children:[(0,l.jsxs)(`div`,{className:O.wheelWrap,style:{width:g,height:g},children:[(0,l.jsx)(`div`,{className:O.pointer}),(0,l.jsx)(`canvas`,{ref:o,className:O.canvas,style:{width:g,height:g}}),(0,l.jsx)(`button`,{type:`button`,className:O.spinBtn,onClick:()=>{if(f||e.length===0)return;p(!0),h(null);let t=Math.PI*2/e.length,i=Math.floor(Math.random()*e.length)*t+t/2,o=s.current,c=o+r*Math.PI*2+(Math.PI*2-i)-o%(Math.PI*2),l=o,d=performance.now(),m=t=>{let r=t-d,i=Math.min(r/n,1),o=j(i),f=l+(c-l)*o;if(s.current=f,v(f),i<1)u.current=requestAnimationFrame(m);else{let t=y(f),n=e[t];s.current=f,p(!1),h(n),a?.(n,t)}};u.current=requestAnimationFrame(m)},disabled:f,children:f?`抽奖中...`:i})]}),m&&!f&&(0,l.jsxs)(`p`,{className:O.result,children:[`恭喜获得:`,(0,l.jsx)(`strong`,{children:m.label})]})]})},N={typewriter:`cos-typewriter`,terminal:`cos-terminal`,dots:`cos-dots`,text:`cos-text`,prompt:`cos-prompt`,cursor:`cos-cursor`,blink:`cos-blink`},P=[`Hello, cos-design!`,`欢迎来到组件库 ✨`,`Build something fun 🚀`],F=({texts:e=P,speed:t=100,deleteSpeed:n=50,pause:r=2e3})=>{let[i,a]=(0,c.useState)(``),[o,s]=(0,c.useState)(0),[u,d]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let c=e[o%e.length],l;if(!u&&i===c)l=setTimeout(()=>d(!0),r);else if(u&&i===``)l=setTimeout(()=>{d(!1),s(t=>(t+1)%e.length)},0);else{let e=u?c.slice(0,i.length-1):c.slice(0,i.length+1);l=setTimeout(()=>a(e),u?n:t)}return()=>clearTimeout(l)},[i,u,o,e,t,n,r]),(0,l.jsx)(`div`,{className:N.typewriter,children:(0,l.jsxs)(`div`,{className:N.terminal,children:[(0,l.jsxs)(`div`,{className:N.dots,children:[(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{})]}),(0,l.jsxs)(`p`,{className:N.text,children:[(0,l.jsx)(`span`,{className:N.prompt,children:`>`}),i,(0,l.jsx)(`span`,{className:N.cursor,children:`|`})]})]})})},I={waveButton:`cos-waveButton`,btn:`cos-btn`,label:`cos-label`,wave:`cos-wave`,ripple:`cos-ripple`},L=({text:e=`点我试试`,onClick:t,color:n=`#38bdf8`})=>(0,l.jsx)(`div`,{className:I.waveButton,children:(0,l.jsxs)(`button`,{type:`button`,className:I.btn,style:{"--wave-color":n},onClick:t,children:[(0,l.jsx)(`span`,{className:I.wave}),(0,l.jsx)(`span`,{className:I.wave}),(0,l.jsx)(`span`,{className:I.label,children:e})]})});exports.CanvasClock=d,exports.Charge=p,exports.Fireworks=v,exports.MatrixRain=x,exports.NeonText=C,exports.ParticleNetwork=T,exports.ReturnCity=D,exports.Turntable=M,exports.Typewriter=F,exports.WaveButton=L;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});require('./index.css');var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime");var u={canvasClock:`cos-canvasClock-QvdV3`,canvasTarget:`cos-canvasTarget-x-odC`},d=({width:e=400,height:t=400})=>{let n=(0,c.useRef)(null),r=Math.min(e,t),i=r/2-16,a=r/2,o=(0,c.useCallback)(e=>{e.clearRect(0,0,r,r),e.save(),e.translate(a,a),e.beginPath(),e.arc(0,0,i,0,Math.PI*2),e.fillStyle=`#fff`,e.fill(),e.strokeStyle=`#d1d5db`,e.lineWidth=2,e.stroke();for(let t=0;t<60;t++){let n=t/60*Math.PI*2,r=i-(t%5==0?14:8);e.beginPath(),e.moveTo(Math.cos(n)*r,Math.sin(n)*r),e.lineTo(Math.cos(n)*i,Math.sin(n)*i),e.strokeStyle=t%5==0?`#374151`:`#9ca3af`,e.lineWidth=t%5==0?2:1,e.stroke()}e.fillStyle=`#111827`,e.font=`bold ${Math.floor(r/22)}px system-ui, sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`;for(let t=1;t<=12;t++){let n=t/12*Math.PI*2-Math.PI/2,r=i-32;e.fillText(String(t),Math.cos(n)*r,Math.sin(n)*r)}let t=new Date,n=t.getHours()%12,o=t.getMinutes(),s=t.getSeconds(),c=t.getMilliseconds(),l=(t,n,r,i,a)=>{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()},u=(n+o/60)/12*Math.PI*2-Math.PI/2,d=(o+s/60)/60*Math.PI*2-Math.PI/2,f=(s+c/1e3)/60*Math.PI*2-Math.PI/2;l(u,i*.5,4,`#111827`,`rgb(0 0 0 / 40%)`),l(d,i*.72,3,`#1e80ff`,`rgb(30 128 255 / 40%)`),l(f,i*.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()},[a,i,r]);return(0,c.useEffect)(()=>{let e=n.current;if(!e)return;let t=window.devicePixelRatio||1;e.width=r*t,e.height=r*t;let i=e.getContext(`2d`);if(!i)return;i.setTransform(t,0,0,t,0,0);let a=0,s=()=>{o(i),a=requestAnimationFrame(s)};return s(),()=>cancelAnimationFrame(a)},[o,r]),(0,l.jsx)(`div`,{className:u.canvasClock,style:{width:r,height:r},children:(0,l.jsx)(`canvas`,{ref:n,className:u.canvasTarget,style:{width:r,height:r}})})},f={chargeContainer:`cos-chargeContainer-4t9qo`,contrast:`cos-contrast-PNep9`,hueRotate:`cos-hueRotate-bMJ-k`,text:`cos-text-2k7eH`,moveUp:`cos-moveUp-1Vz9j`,circle:`cos-circle-m4vwX`,circleRotate:`cos-circleRotate-bgFw5`,button:`cos-button-myCst`},p=e=>{let{initQuantity:t=0,value:n,onChange:r,autoCharge:i=!0,interval:a=500,step:o=.01}=e,s=n!==void 0,[u,d]=(0,c.useState)(t),p=s?n:u,m=(0,c.useRef)(p);(0,c.useEffect)(()=>{m.current=p},[p]),(0,c.useEffect)(()=>{if(!i)return;let e=window.setInterval(()=>{let e=Number((m.current+o).toFixed(2));s?r?.(e):d(e)},a);return()=>clearInterval(e)},[i,a,s,r,o]);let h=p?p.toString().padEnd(4,`0`):`0`;return(0,l.jsx)(`div`,{className:f.chargeContainer,children:(0,l.jsxs)(`div`,{className:f.contrast,children:[(0,l.jsxs)(`div`,{className:f.text,children:[h,`%`]}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`div`,{className:f.circle}),(0,l.jsx)(`div`,{className:f.button})]})})},m={confetti:`cos-confetti-MeNtU`,canvas:`cos-canvas-0T3Vs`,hint:`cos-hint-sGHEi`},h=[`#ff6b6b`,`#ffd93d`,`#6bcb77`,`#4d96ff`,`#a66cff`,`#ff85c0`,`#38bdf8`],g=()=>h[Math.floor(Math.random()*h.length)],_=(e,t,n)=>{let r=e/2,i=t*.6;return Array.from({length:n},()=>{let e=(Math.random()-.5)*Math.PI,t=Math.random()*12+6;return{x:r+(Math.random()-.5)*40,y:i,vx:Math.cos(e)*t,vy:Math.sin(e)*t-Math.random()*8,rotation:Math.random()*360,rotationSpeed:(Math.random()-.5)*12,color:g(),width:Math.random()*8+4,height:Math.random()*6+3,alpha:1,gravity:Math.random()*.15+.12}})},v=(0,c.forwardRef)(({width:e=800,height:t=400,auto:n=!0,particleCount:r=120},i)=>{let a=(0,c.useRef)(null),o=(0,c.useRef)([]),s=(0,c.useRef)(0),u=(0,c.useCallback)(()=>{o.current.push(..._(e,t,r))},[t,r,e]);return(0,c.useImperativeHandle)(i,()=>({burst:u}),[u]),(0,c.useEffect)(()=>{let r=a.current;if(!r)return;let i=window.devicePixelRatio||1;r.width=e*i,r.height=t*i;let c=r.getContext(`2d`);if(!c)return;c.setTransform(i,0,0,i,0,0),n&&u();let l=()=>{s.current=requestAnimationFrame(l),c.clearRect(0,0,e,t),o.current=o.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>t+20?!1:(c.save(),c.translate(e.x,e.y),c.rotate(e.rotation*Math.PI/180),c.globalAlpha=e.alpha,c.fillStyle=e.color,c.fillRect(-e.width/2,-e.height/2,e.width,e.height),c.restore(),!0)))};return l(),()=>cancelAnimationFrame(s.current)},[n,u,t,e]),(0,l.jsxs)(`div`,{className:m.confetti,style:{width:e,height:t},children:[(0,l.jsx)(`canvas`,{ref:a,className:m.canvas,style:{width:e,height:t},onClick:u}),(0,l.jsx)(`p`,{className:m.hint,children:`点击画布再次喷射`})]})});v.displayName=`Confetti`;var y={countdown:`cos-countdown-5ZKKP`,unit:`cos-unit-dth8N`,value:`cos-value-yVzcP`,label:`cos-label-pAMEs`,ended:`cos-ended-c0dsD`,pulse:`cos-pulse-krQd-`},b=e=>e instanceof Date?e.getTime():typeof e==`number`?e:new Date(e).getTime(),x=e=>{let t=Math.max(0,e-Date.now()),n=Math.floor(t/1e3);return{total:t,days:Math.floor(n/86400),hours:Math.floor(n%86400/3600),minutes:Math.floor(n%3600/60),seconds:n%60}},S=[{key:`days`,label:`天`},{key:`hours`,label:`时`},{key:`minutes`,label:`分`},{key:`seconds`,label:`秒`}],C=({targetDate:e,onEnd:t,showLabels:n=!0,color:r=`#f472b6`})=>{let i=(0,c.useMemo)(()=>b(e),[e]),[,a]=(0,c.useState)(0),o=(0,c.useRef)(!1),s=x(i);return(0,c.useEffect)(()=>{o.current=!1;let e=window.setInterval(()=>a(e=>e+1),1e3);return()=>clearInterval(e)},[i]),(0,c.useEffect)(()=>{s.total<=0&&!o.current&&(o.current=!0,t?.())},[s.total,t]),(0,l.jsxs)(`div`,{className:y.countdown,style:{"--countdown-color":r},children:[S.map(({key:e,label:t})=>(0,l.jsxs)(`div`,{className:y.unit,children:[(0,l.jsx)(`div`,{className:y.value,children:String(s[e]).padStart(2,`0`)}),n&&(0,l.jsx)(`span`,{className:y.label,children:t})]},e)),s.total<=0&&(0,l.jsx)(`p`,{className:y.ended,children:`时间到!`})]})},w={fireworks:`cos-fireworks-fsSqL`,canvas:`cos-canvas-spL8G`,hint:`cos-hint-5XDRH`},T=[`#ff6b6b`,`#ffd93d`,`#6bcb77`,`#4d96ff`,`#a66cff`,`#ff85c0`],E=.12,ee=240,D=()=>T[Math.floor(Math.random()*T.length)],O=(e,t,n)=>{let r=60+Math.floor(Math.random()*30);return Array.from({length:r},()=>{let r=Math.random()*Math.PI*2,i=Math.random()*4+2;return{x:e,y:t,vx:Math.cos(r)*i,vy:Math.sin(r)*i,alpha:1,color:Math.random()>.3?n:D(),decay:Math.random()*.015+.01}})},k=(0,c.forwardRef)(({width:e=800,height:t=500,auto:n=!0},r)=>{let i=(0,c.useRef)(null),a=(0,c.useRef)([]),o=(0,c.useRef)(0),s=(0,c.useCallback)(n=>{let r=n??Math.random()*e*.6+e*.2;a.current.push({x:r,y:t,vy:-(Math.random()*4+6),targetY:Math.random()*t*.35+t*.15,color:D(),exploded:!1,particles:[],age:0})},[t,e]);return(0,c.useImperativeHandle)(r,()=>({launch:s}),[s]),(0,c.useEffect)(()=>{let r=i.current;if(!r)return;let c=window.devicePixelRatio||1;r.width=e*c,r.height=t*c;let l=r.getContext(`2d`);if(!l)return;l.setTransform(c,0,0,c,0,0);let u=0,d=()=>{o.current=requestAnimationFrame(d),l.fillStyle=`rgb(15 23 42 / 25%)`,l.fillRect(0,0,e,t),n&&Math.random()<.03&&s(),a.current=a.current.filter(e=>{if(!e.exploded){e.age+=1,e.y+=e.vy,e.vy+=E,l.beginPath(),l.arc(e.x,e.y,2.5,0,Math.PI*2),l.fillStyle=e.color,l.fill();let t=e.vy>=0,n=e.y<=e.targetY,r=e.y<0,i=e.age>=ee;return(t||n||r||i)&&(e.exploded=!0,e.particles=O(e.x,e.y,e.color)),!0}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:(l.beginPath(),l.arc(e.x,e.y,2,0,Math.PI*2),l.fillStyle=e.color,l.globalAlpha=e.alpha,l.fill(),l.globalAlpha=1,!0))),e.particles.length>0})};return d(),n&&(u=window.setInterval(()=>s(),1200)),()=>{cancelAnimationFrame(o.current),clearInterval(u)}},[n,t,s,e]),(0,l.jsxs)(`div`,{className:w.fireworks,style:{width:e,height:t},children:[(0,l.jsx)(`canvas`,{ref:i,className:w.canvas,style:{width:e,height:t},onClick:e=>{let t=e.currentTarget.getBoundingClientRect();s(e.clientX-t.left)}}),(0,l.jsx)(`p`,{className:w.hint,children:`点击画布燃放烟花`})]})});k.displayName=`Fireworks`;var A={flipCounter:`cos-flipCounter-3LuI0`,digit:`cos-digit-yJRPy`,digitCard:`cos-digitCard-zZUzt`,staticTop:`cos-staticTop-aLQcm`,staticBottom:`cos-staticBottom-9y0gu`,flap:`cos-flap-i3YKR`,flapTop:`cos-flapTop-70z-k`,flapBottom:`cos-flapBottom-zhMZe`,isFlipping:`cos-isFlipping-EVEdI`,"fold-top":`cos-fold-top-v-6XJ`,"unfold-bottom":`cos-unfold-bottom-e2gzU`},j=(e,t)=>Math.max(0,Math.floor(e)).toString().padStart(t,`0`).slice(-t),M=({digit:e,color:t,duration:n})=>{let r=(0,c.useRef)(e),[i,a]=(0,c.useState)(!1),[o,s]=(0,c.useState)(e);(0,c.useEffect)(()=>{if(e===r.current)return;s(r.current),a(!0),r.current=e;let t=window.setTimeout(()=>a(!1),n);return()=>clearTimeout(t)},[e,n]);let u=i?o:e;return(0,l.jsx)(`div`,{className:A.digit,style:{"--flip-color":t,"--flip-duration":`${n}ms`},children:(0,l.jsxs)(`div`,{className:`${A.digitCard} ${i?A.isFlipping:``}`,children:[(0,l.jsx)(`div`,{className:A.staticTop,children:(0,l.jsx)(`span`,{children:u})}),(0,l.jsx)(`div`,{className:A.staticBottom,children:(0,l.jsx)(`span`,{children:u})}),i&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:`${A.flap} ${A.flapTop}`,children:(0,l.jsx)(`span`,{children:o})}),(0,l.jsx)(`div`,{className:`${A.flap} ${A.flapBottom}`,children:(0,l.jsx)(`span`,{children:e})})]})]})})},N=({value:e,digits:t=4,color:n=`#38bdf8`,duration:r=600})=>{let i=j(e,t).split(``);return(0,l.jsx)(`div`,{className:A.flipCounter,children:i.map((e,t)=>(0,l.jsx)(M,{digit:e,color:n,duration:r},t))})},P={glitchText:`cos-glitchText-dZ-sR`,text:`cos-text-JsPHN`,"glitch-1":`cos-glitch-1-s9pqH`,"glitch-2":`cos-glitch-2-GhFB-`},F=({text:e=`GLITCH`,color:t=`#f8fafc`,glitchColor1:n=`#ff00de`,glitchColor2:r=`#00f0ff`,fontSize:i=64})=>(0,l.jsx)(`div`,{className:P.glitchText,children:(0,l.jsx)(`h1`,{className:P.text,"data-text":e,style:{fontSize:i,"--glitch-color":t,"--glitch-c1":n,"--glitch-c2":r},children:e})}),I={matrixRain:`cos-matrixRain-qg9HC`,canvas:`cos-canvas--AvpG`,overlay:`cos-overlay-knj3b`,title:`cos-title-sDfhs`,flicker:`cos-flicker-smHxl`,subtitle:`cos-subtitle-CWheW`},L=`ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*アイウエオカキクケコ`,R=({width:e=800,height:t=500,density:n=.6,color:r=`#00ff41`})=>{let i=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let a=i.current;if(!a)return;let o=window.devicePixelRatio||1;a.width=e*o,a.height=t*o;let s=a.getContext(`2d`);if(!s)return;s.setTransform(o,0,0,o,0,0);let c=Math.floor(e/16*n),l=Array.from({length:c},()=>Math.random()*-50),u=0,d=()=>{s.fillStyle=`rgb(0 0 0 / 8%)`,s.fillRect(0,0,e,t),s.fillStyle=r,s.font=`16px monospace`,l.forEach((e,i)=>{let a=L[Math.floor(Math.random()*53)],o=i/n*16;s.fillStyle=r,s.fillText(a,o,e*16),e*16>t&&Math.random()>.975&&(l[i]=0),l[i]+=1}),u=requestAnimationFrame(d)};return d(),()=>cancelAnimationFrame(u)},[r,n,t,e]),(0,l.jsxs)(`div`,{className:I.matrixRain,style:{width:e,height:t},children:[(0,l.jsx)(`canvas`,{ref:i,className:I.canvas,style:{width:e,height:t}}),(0,l.jsxs)(`div`,{className:I.overlay,children:[(0,l.jsx)(`h2`,{className:I.title,children:`MATRIX`}),(0,l.jsx)(`p`,{className:I.subtitle,children:`数字雨效果`})]})]})},z={meteorRain:`cos-meteorRain-v8RNI`,canvas:`cos-canvas-hyFMr`},B=({width:e=800,height:t=500,meteorCount:n=8})=>{let r=(0,c.useRef)(null),i=(0,c.useRef)([]),a=(0,c.useRef)(0);return(0,c.useEffect)(()=>{i.current=Array.from({length:n},()=>({x:Math.random()*e,y:Math.random()*t*.5,length:Math.random()*60+40,speed:Math.random()*6+4,opacity:Math.random()*.5+.3}))},[t,n,e]),(0,c.useEffect)(()=>{let n=r.current;if(!n)return;let o=window.devicePixelRatio||1;n.width=e*o,n.height=t*o;let s=n.getContext(`2d`);if(!s)return;s.setTransform(o,0,0,o,0,0);let c=()=>{a.current=requestAnimationFrame(c),s.fillStyle=`rgb(15 23 42 / 15%)`,s.fillRect(0,0,e,t),i.current.forEach(n=>{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);let r=s.createLinearGradient(n.x,n.y,n.x-n.length,n.y-n.length*.6);r.addColorStop(0,`rgb(255 255 255 / ${n.opacity})`),r.addColorStop(1,`rgb(255 255 255 / 0)`),s.beginPath(),s.strokeStyle=r,s.lineWidth=2,s.moveTo(n.x,n.y),s.lineTo(n.x-n.length,n.y-n.length*.6),s.stroke()})};return c(),()=>cancelAnimationFrame(a.current)},[t,e]),(0,l.jsx)(`div`,{className:z.meteorRain,style:{width:e,height:t},children:(0,l.jsx)(`canvas`,{ref:r,className:z.canvas,style:{width:e,height:t}})})},V={neonText:`cos-neonText-JMP7i`,text:`cos-text-GTO-0`,flicker:`cos-flicker-nXceV`,"neon-flicker":`cos-neon-flicker-uDkmM`,reflection:`cos-reflection-aEYj6`},H=({text:e=`NEON`,color:t=`#ff00de`,fontSize:n=72,flicker:r=!0})=>(0,l.jsxs)(`div`,{className:V.neonText,children:[(0,l.jsx)(`h1`,{className:`${V.text} ${r?V.flicker:``}`,style:{fontSize:n,"--neon-color":t},children:e}),(0,l.jsx)(`p`,{className:V.reflection,style:{fontSize:n*.35,color:t},children:e})]}),U={particleNetwork:`cos-particleNetwork-GSZq-`,canvas:`cos-canvas-E-BGP`,hint:`cos-hint-LEO5o`},W=({width:e=800,height:t=500,particleCount:n=60,linkDistance:r=120,color:i=`#38bdf8`})=>{let a=(0,c.useRef)(null),o=(0,c.useRef)([]),s=(0,c.useRef)({x:-1e3,y:-1e3}),u=(0,c.useCallback)(()=>{o.current=Array.from({length:n},()=>({x:Math.random()*e,y:Math.random()*t,vx:(Math.random()-.5)*1.2,vy:(Math.random()-.5)*1.2,radius:Math.random()*2+1}))},[t,n,e]);return(0,c.useEffect)(()=>{u()},[u]),(0,c.useEffect)(()=>{let n=a.current;if(!n)return;let c=window.devicePixelRatio||1;n.width=e*c,n.height=t*c;let l=n.getContext(`2d`);if(!l)return;l.setTransform(c,0,0,c,0,0);let u=0,d=()=>{l.fillStyle=`#0f172a`,l.fillRect(0,0,e,t);let n=o.current,a=s.current;n.forEach(n=>{n.x+=n.vx,n.y+=n.vy,(n.x<0||n.x>e)&&(n.vx*=-1),(n.y<0||n.y>t)&&(n.vy*=-1);let r=a.x-n.x,i=a.y-n.y;Math.sqrt(r*r+i*i)<150&&(n.vx-=r*3e-4,n.vy-=i*3e-4)});for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++){let a=n[e].x-n[t].x,o=n[e].y-n[t].y,s=Math.sqrt(a*a+o*o);s<r&&(l.beginPath(),l.moveTo(n[e].x,n[e].y),l.lineTo(n[t].x,n[t].y),l.strokeStyle=i,l.globalAlpha=1-s/r,l.lineWidth=.8,l.stroke(),l.globalAlpha=1)}n.forEach(e=>{l.beginPath(),l.arc(e.x,e.y,e.radius,0,Math.PI*2),l.fillStyle=i,l.fill()}),u=requestAnimationFrame(d)};return d(),()=>cancelAnimationFrame(u)},[i,t,u,r,e]),(0,l.jsxs)(`div`,{className:U.particleNetwork,style:{width:e,height:t},children:[(0,l.jsx)(`canvas`,{ref:a,className:U.canvas,style:{width:e,height:t},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect();s.current={x:e.clientX-t.left,y:e.clientY-t.top}},onMouseLeave:()=>{s.current={x:-1e3,y:-1e3}}}),(0,l.jsx)(`p`,{className:U.hint,children:`移动鼠标与粒子互动`})]})},G={returnCityContainer:`cos-returnCityContainer-6XTxj`,star:`cos-star-a59Dx`,glassWrap:`cos-glassWrap-golMO`,rotate:`cos-rotate-7X9Jj`,glassItem:`cos-glassItem-OwlFI`},K=({starCount:e,glassCount:t=6,glassRadius:n=150})=>{let r=(0,c.useRef)(null),i=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let a=r.current,o=i.current;if(!a||!o)return;let s=[],c=[],l=[],u=e??Math.floor(document.documentElement.clientWidth/20);for(let e=0;e<u;e++){let e=window.setTimeout(()=>{let e=document.createElement(`div`);e.className=G.star;let t=document.body.clientWidth,n=document.body.clientHeight;e.style.top=`${Math.random()*n}px`,e.style.left=`${Math.random()*t}px`,a.append(e),c.push(e)},Math.random()*2e3);s.push(e)}for(let e=0;e<t;e++){let r=document.createElement(`div`);r.className=G.glassItem,r.style.transform=`rotateY(${360/t*e}deg) translateZ(${n}px)`,o.appendChild(r),l.push(r);let i=window.setTimeout(()=>{r.style.top=`0px`,r.style.opacity=`1`},e*300);s.push(i)}return()=>{s.forEach(clearTimeout),c.forEach(e=>e.remove()),l.forEach(e=>e.remove())}},[e,t,n]),(0,l.jsx)(`div`,{ref:r,className:G.returnCityContainer,children:(0,l.jsx)(`div`,{ref:i,className:G.glassWrap})})},q={turntable:`cos-turntable-dkc32`,wheelWrap:`cos-wheelWrap-n7lhc`,canvas:`cos-canvas-A1-4x`,pointer:`cos-pointer-Rk1S9`,spinBtn:`cos-spinBtn-l9JIC`,result:`cos-result-H8q2c`,"fade-in":`cos-fade-in-U9bUC`},J=[`#FF6B6B`,`#4ECDC4`,`#FFE66D`,`#A78BFA`,`#60A5FA`,`#F472B6`,`#34D399`,`#FB923C`],Y=[{label:`一等奖`},{label:`二等奖`},{label:`三等奖`},{label:`谢谢参与`},{label:`优惠券`},{label:`再来一次`}],X=e=>1-(1-e)**3,Z=({prizes:e=Y,size:t=360,spinDuration:n=4e3,spinRounds:r=5,buttonText:i=`开始抽奖`,onSpinEnd:a})=>{let o=(0,c.useRef)(null),s=(0,c.useRef)(0),u=(0,c.useRef)(0),d=(0,c.useRef)(1),[f,p]=(0,c.useState)(!1),[m,h]=(0,c.useState)(null),g=t+48,_=(e,t)=>t.color??J[e%J.length],v=(0,c.useCallback)(n=>{let r=o.current;if(!r)return;let i=r.getContext(`2d`);if(!i)return;let a=g/2,s=t/2,c=Math.PI*2/e.length;i.clearRect(0,0,g,g),i.save(),i.translate(a,a),i.rotate(n),e.forEach((e,n)=>{let r=n*c-Math.PI/2,a=r+c,o=_(n,e);i.beginPath(),i.moveTo(0,0),i.arc(0,0,s,r,a),i.closePath(),i.fillStyle=o,i.fill(),i.strokeStyle=`rgb(255 255 255 / 35%)`,i.lineWidth=2,i.stroke(),i.save(),i.rotate(r+c/2),i.textAlign=`right`,i.fillStyle=`#fff`,i.font=`bold ${Math.max(12,Math.floor(t/22))}px system-ui, sans-serif`,i.shadowColor=`rgb(0 0 0 / 30%)`,i.shadowBlur=4,i.fillText(e.label,s-18,6),i.restore()}),i.beginPath(),i.arc(0,0,s,0,Math.PI*2),i.strokeStyle=`#fbbf24`,i.lineWidth=6,i.stroke(),i.beginPath(),i.arc(0,0,s-4,0,Math.PI*2),i.strokeStyle=`#f59e0b`,i.lineWidth=2,i.stroke(),i.restore(),i.save(),i.translate(a,a);for(let e=0;e<12;e++){let t=e/12*Math.PI*2,n=Math.cos(t)*(s+14),r=Math.sin(t)*(s+14);i.beginPath(),i.arc(n,r,3,0,Math.PI*2),i.fillStyle=e%2==0?`#fde68a`:`#f59e0b`,i.fill()}i.restore()},[g,e,t]);(0,c.useEffect)(()=>{let e=o.current;if(!e)return;let t=window.devicePixelRatio||1;d.current=t,e.width=g*t,e.height=g*t;let n=e.getContext(`2d`);n&&n.setTransform(t,0,0,t,0,0),v(s.current)},[g,v]),(0,c.useEffect)(()=>()=>{u.current&&cancelAnimationFrame(u.current)},[]);let y=t=>{let n=360/e.length,r=(180/Math.PI*t%360+360)%360;return Math.floor((360-r+n/2)%360/n)%e.length};return(0,l.jsxs)(`div`,{className:q.turntable,style:{width:g,height:g+80},children:[(0,l.jsxs)(`div`,{className:q.wheelWrap,style:{width:g,height:g},children:[(0,l.jsx)(`div`,{className:q.pointer}),(0,l.jsx)(`canvas`,{ref:o,className:q.canvas,style:{width:g,height:g}}),(0,l.jsx)(`button`,{type:`button`,className:q.spinBtn,onClick:()=>{if(f||e.length===0)return;p(!0),h(null);let t=Math.PI*2/e.length,i=Math.floor(Math.random()*e.length)*t+t/2,o=s.current,c=o+r*Math.PI*2+(Math.PI*2-i)-o%(Math.PI*2),l=o,d=performance.now(),m=t=>{let r=t-d,i=Math.min(r/n,1),o=X(i),f=l+(c-l)*o;if(s.current=f,v(f),i<1)u.current=requestAnimationFrame(m);else{let t=y(f),n=e[t];s.current=f,p(!1),h(n),a?.(n,t)}};u.current=requestAnimationFrame(m)},disabled:f,children:f?`抽奖中...`:i})]}),m&&!f&&(0,l.jsxs)(`p`,{className:q.result,children:[`恭喜获得:`,(0,l.jsx)(`strong`,{children:m.label})]})]})},Q={typewriter:`cos-typewriter-7UhOL`,terminal:`cos-terminal-NWNVN`,dots:`cos-dots-oulNg`,text:`cos-text-ICV5T`,prompt:`cos-prompt-Y4hVD`,cursor:`cos-cursor-m8hGi`,blink:`cos-blink-XykM7`},te=[`Hello, cos-design!`,`欢迎来到组件库 ✨`,`Build something fun 🚀`],ne=({texts:e=te,speed:t=100,deleteSpeed:n=50,pause:r=2e3})=>{let[i,a]=(0,c.useState)(``),[o,s]=(0,c.useState)(0),[u,d]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let c=e[o%e.length],l;if(!u&&i===c)l=setTimeout(()=>d(!0),r);else if(u&&i===``)l=setTimeout(()=>{d(!1),s(t=>(t+1)%e.length)},0);else{let e=u?c.slice(0,i.length-1):c.slice(0,i.length+1);l=setTimeout(()=>a(e),u?n:t)}return()=>clearTimeout(l)},[i,u,o,e,t,n,r]),(0,l.jsx)(`div`,{className:Q.typewriter,children:(0,l.jsxs)(`div`,{className:Q.terminal,children:[(0,l.jsxs)(`div`,{className:Q.dots,children:[(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{}),(0,l.jsx)(`span`,{})]}),(0,l.jsxs)(`p`,{className:Q.text,children:[(0,l.jsx)(`span`,{className:Q.prompt,children:`>`}),i,(0,l.jsx)(`span`,{className:Q.cursor,children:`|`})]})]})})},$={waveButton:`cos-waveButton-Aa7G-`,btn:`cos-btn-WJrEN`,label:`cos-label-9BHOU`,wave:`cos-wave-GycLU`,ripple:`cos-ripple-5ZFpr`},re=({text:e=`点我试试`,onClick:t,color:n=`#38bdf8`})=>(0,l.jsx)(`div`,{className:$.waveButton,children:(0,l.jsxs)(`button`,{type:`button`,className:$.btn,style:{"--wave-color":n},onClick:t,children:[(0,l.jsx)(`span`,{className:$.wave}),(0,l.jsx)(`span`,{className:$.wave}),(0,l.jsx)(`span`,{className:$.label,children:e})]})});exports.CanvasClock=d,exports.Charge=p,exports.Confetti=v,exports.Countdown=C,exports.Fireworks=k,exports.FlipCounter=N,exports.GlitchText=F,exports.MatrixRain=R,exports.MeteorRain=B,exports.NeonText=H,exports.ParticleNetwork=W,exports.ReturnCity=K,exports.Turntable=Z,exports.Typewriter=ne,exports.WaveButton=re;
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- .cos-canvasClock{background-color:#fff;border-radius:50%;justify-content:center;align-items:center;display:inline-flex;box-shadow:0 8px 32px #00000040}.cos-canvasTarget{border-radius:50%;display:block}.cos-chargeContainer{background-color:#000;width:100vw;height:100vh;position:relative}.cos-chargeContainer .cos-contrast{filter:contrast(15)hue-rotate();background-color:#000;width:100%;height:100%;animation:6s linear infinite cos-hueRotate;position:relative;overflow:hidden}.cos-chargeContainer .cos-contrast .cos-text{text-align:center;z-index:9;color:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:300px;height:300px;margin-left:-150px;font-size:30px;line-height:300px;position:absolute;top:10px;left:50%}.cos-chargeContainer .cos-contrast span{filter:blur(5px);will-change:transform;background:#00ff6f;border-radius:10px;transition:transform .3s linear;animation:ease-in-out infinite cos-moveUp;position:absolute;bottom:0}.cos-chargeContainer .cos-contrast span:first-child{width:20px;height:20px;animation-duration:4s;animation-delay:2s;left:50%}.cos-chargeContainer .cos-contrast span:nth-child(2){width:22px;height:22px;animation-duration:4.2s;animation-delay:4s;left:54%}.cos-chargeContainer .cos-contrast span:nth-child(3){width:24px;height:24px;animation-duration:3s;animation-delay:1s;left:45%}.cos-chargeContainer .cos-contrast span:nth-child(4){width:20px;height:22px;animation-duration:5s;animation-delay:0s;left:54%}.cos-chargeContainer .cos-contrast span:nth-child(5){width:22px;height:22px;animation-duration:3.5s;animation-delay:5s;left:52%}.cos-chargeContainer .cos-contrast span:nth-child(6){width:20px;height:20px;animation-duration:4.7s;animation-delay:1.2s;left:50%}.cos-chargeContainer .cos-contrast span:nth-child(7){width:22px;height:22px;animation-duration:2.5s;animation-delay:3.5s;left:54%}.cos-chargeContainer .cos-contrast span:nth-child(8){width:24px;height:24px;animation-duration:5.6s;animation-delay:4.2s;left:51%}.cos-chargeContainer .cos-contrast span:nth-child(9){width:26px;height:26px;animation-duration:5.2s;animation-delay:4s;left:42%}.cos-chargeContainer .cos-contrast span:nth-child(10){width:26px;height:22px;animation-duration:3.8s;animation-delay:4.3s;left:54%}.cos-chargeContainer .cos-contrast span:nth-child(11){width:22px;height:22px;animation-duration:4.2s;animation-delay:.3s;left:42%}.cos-chargeContainer .cos-contrast span:nth-child(12){width:24px;height:24px;animation-duration:4.6s;animation-delay:2s;left:46%}.cos-chargeContainer .cos-contrast span:nth-child(13){width:22px;height:22px;animation-duration:3.8s;animation-delay:3.2s;left:48%}.cos-chargeContainer .cos-contrast span:nth-child(14){width:26px;height:22px;animation-duration:5.2s;animation-delay:2.9s;left:55%}.cos-chargeContainer .cos-contrast span:nth-child(15){width:26px;height:22px;animation-duration:4.9s;animation-delay:4.2s;left:52%}.cos-chargeContainer .cos-contrast .cos-circle{box-sizing:border-box;filter:blur(8px);width:300px;height:300px;margin-left:-150px;animation:6s linear infinite cos-circleRotate;position:absolute;top:10px;left:50%}.cos-chargeContainer .cos-contrast .cos-circle:before{content:"";background:#00ff6f;border-radius:42% 38% 62% 49%/45%;width:200px;height:200px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)rotate(0)}.cos-chargeContainer .cos-contrast .cos-circle:after{content:"";background:#000;border-radius:50%;width:176px;height:178px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.cos-chargeContainer .cos-contrast .cos-button{filter:blur(5px);background:#00ff6f;border-radius:100px 100px 0 0;width:150px;height:50px;position:absolute;bottom:0;left:50%;transform:translate(-50%)}@keyframes cos-circleRotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes cos-hueRotate{0%{filter:contrast(15)hue-rotate()}to{filter:contrast(15)hue-rotate(360deg)}}@keyframes cos-moveUp{0%{transform:translateY(0)}to{transform:translateY(calc(245px - 100vh))}}.cos-fireworks{background:#0f172a;border-radius:12px;position:relative;overflow:hidden}.cos-matrixRain{background:#000;border-radius:12px;position:relative;overflow:hidden}.cos-canvas{display:block}.cos-overlay{pointer-events:none;flex-direction:column;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.cos-title{color:#00ff41;letter-spacing:.3em;text-shadow:0 0 20px #00ff41;margin:0;font-size:48px;font-weight:800;animation:3s infinite cos-flicker}.cos-subtitle{color:#00ff4199;letter-spacing:.2em;margin:8px 0 0;font-size:14px}@keyframes cos-flicker{0%,to{opacity:1}50%{opacity:.85}52%{opacity:.6}54%{opacity:1}}.cos-neonText{background:#0a0a0a;border-radius:12px;flex-direction:column;justify-content:center;align-items:center;min-height:240px;padding:40px;display:flex}.cos-text{color:var(--neon-color,#ff00de);letter-spacing:.15em;text-shadow:0 0 5px var(--neon-color), 0 0 10px var(--neon-color), 0 0 20px var(--neon-color), 0 0 40px var(--neon-color), 0 0 80px var(--neon-color);margin:0;font-weight:900}.cos-flicker{animation:2.5s infinite alternate cos-neon-flicker}.cos-reflection{opacity:.3;letter-spacing:.15em;filter:blur(2px);margin:12px 0 0;font-weight:700;transform:scaleY(-1)}@keyframes cos-neon-flicker{0%,19%,21%,23%,25%,54%,56%,to{opacity:1}20%,24%,55%{opacity:.6}}.cos-particleNetwork{border-radius:12px;position:relative;overflow:hidden}.cos-canvas{cursor:crosshair;display:block}.cos-hint{color:#94a3b8b3;pointer-events:none;margin:0;font-size:13px;position:absolute;bottom:12px;left:50%;transform:translate(-50%)}.cos-returnCityContainer{background:#000;width:100%;height:100%;position:relative;overflow:hidden}.cos-returnCityContainer .cos-star{background:#fd400a;border-radius:50%;width:5px;height:5px;animation:2s infinite cos-star;position:absolute}.cos-returnCityContainer .cos-glassWrap{width:100px;height:175px;transform-style:preserve-3d;animation:10s linear infinite cos-rotate;position:absolute;bottom:50%;left:50%;transform:translate(-50%,50%)}.cos-returnCityContainer .cos-glassWrap .cos-glassItem{opacity:0;background:#ad470257;border-radius:5px;width:100%;height:100%;transition:all .3s ease-in;position:absolute;top:-250px;left:0;box-shadow:0 0 10px 3px #ff0000b3}@keyframes cos-rotate{0%{transform:translate(-50%,50%)rotateY(360deg)}to{transform:translate(-50%,50%)rotateY(0)}}@keyframes cos-star{0%{filter:blur(1px)contrast(15)hue-rotate();opacity:0}50%{opacity:1;filter:blur(1px)contrast(15)hue-rotate(360deg)}to{opacity:0;filter:blur(1px)contrast(15)hue-rotate()}}.cos-turntable{box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;gap:20px;margin:0 auto;padding:24px;display:flex}.cos-wheelWrap{justify-content:center;align-items:center;display:flex;position:relative}.cos-canvas{filter:drop-shadow(0 12px 32px #00000059);border-radius:50%;display:block}.cos-pointer{z-index:2;filter:drop-shadow(0 2px 4px #0000004d);border-top:28px solid #ef4444;border-left:14px solid #0000;border-right:14px solid #0000;width:0;height:0;position:absolute;top:4px;left:50%;transform:translate(-50%)}.cos-pointer:after{content:"";background:#ef4444;border-radius:50%;width:16px;height:16px;position:absolute;top:-30px;left:-8px;box-shadow:inset 0 -2px 4px #0003}.cos-spinBtn{z-index:3;color:#b45309;cursor:pointer;background:linear-gradient(145deg,#fff 0%,#f1f5f9 100%);border:4px solid #fbbf24;border-radius:50%;width:88px;height:88px;font-size:14px;font-weight:700;line-height:1.3;transition:transform .15s,box-shadow .15s;position:absolute;box-shadow:0 4px 12px #00000026,inset 0 2px 4px #fffc}.cos-spinBtn:hover:not(:disabled){transform:scale(1.05);box-shadow:0 6px 16px #0003,inset 0 2px 4px #fffc}.cos-spinBtn:active:not(:disabled){transform:scale(.97)}.cos-spinBtn:disabled{opacity:.75;cursor:not-allowed}.cos-result{color:#92400e;background:linear-gradient(90deg,#fef3c7,#fde68a);border-radius:999px;margin:0;padding:10px 20px;font-size:15px;animation:.4s cos-fade-in}.cos-result strong{color:#b45309;font-size:17px}@keyframes cos-fade-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.cos-typewriter{box-sizing:border-box;justify-content:center;align-items:center;width:100%;min-height:200px;padding:24px;display:flex}.cos-terminal{background:#1e293b;border-radius:12px;width:min(560px,100%);padding:20px 24px;box-shadow:0 16px 48px #00000059}.cos-dots{gap:8px;margin-bottom:16px;display:flex}.cos-dots span{border-radius:50%;width:12px;height:12px}.cos-dots span:first-child{background:#ef4444}.cos-dots span:nth-child(2){background:#eab308}.cos-dots span:nth-child(3){background:#22c55e}.cos-text{color:#e2e8f0;min-height:1.6em;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:20px;line-height:1.6}.cos-prompt{color:#38bdf8;margin-right:8px}.cos-cursor{color:#38bdf8;margin-left:2px;animation:1s step-end infinite cos-blink;display:inline-block}@keyframes cos-blink{50%{opacity:0}}.cos-waveButton{justify-content:center;align-items:center;min-height:200px;padding:40px;display:flex}.cos-btn{background:var(--wave-color,#38bdf8);color:#fff;cursor:pointer;border:none;border-radius:50px;padding:16px 48px;font-size:18px;font-weight:600;transition:transform .2s;position:relative;overflow:hidden;box-shadow:0 8px 24px #38bdf859}.cos-btn:hover{transform:scale(1.05)}.cos-btn:active{transform:scale(.97)}.cos-label{z-index:1;position:relative}.cos-wave{background:#ffffff4d;border-radius:50%;width:0;height:0;animation:3s ease-out infinite cos-ripple;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.cos-wave:nth-child(2){animation-delay:1s}@keyframes cos-ripple{0%{opacity:.6;width:0;height:0}to{opacity:0;width:300px;height:300px}}
1
+ .cos-canvasClock-QvdV3{background-color:#fff;border-radius:50%;justify-content:center;align-items:center;display:inline-flex;box-shadow:0 8px 32px #00000040}.cos-canvasTarget-x-odC{border-radius:50%;display:block}.cos-chargeContainer-4t9qo{background-color:#000;width:100vw;height:100vh;position:relative}.cos-chargeContainer-4t9qo .cos-contrast-PNep9{filter:contrast(15)hue-rotate();background-color:#000;width:100%;height:100%;animation:6s linear infinite cos-hueRotate-bMJ-k;position:relative;overflow:hidden}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 .cos-text-2k7eH{text-align:center;z-index:9;color:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:300px;height:300px;margin-left:-150px;font-size:30px;line-height:300px;position:absolute;top:10px;left:50%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span{filter:blur(5px);will-change:transform;background:#00ff6f;border-radius:10px;transition:transform .3s linear;animation:ease-in-out infinite cos-moveUp-1Vz9j;position:absolute;bottom:0}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:first-child{width:20px;height:20px;animation-duration:4s;animation-delay:2s;left:50%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(2){width:22px;height:22px;animation-duration:4.2s;animation-delay:4s;left:54%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(3){width:24px;height:24px;animation-duration:3s;animation-delay:1s;left:45%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(4){width:20px;height:22px;animation-duration:5s;animation-delay:0s;left:54%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(5){width:22px;height:22px;animation-duration:3.5s;animation-delay:5s;left:52%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(6){width:20px;height:20px;animation-duration:4.7s;animation-delay:1.2s;left:50%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(7){width:22px;height:22px;animation-duration:2.5s;animation-delay:3.5s;left:54%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(8){width:24px;height:24px;animation-duration:5.6s;animation-delay:4.2s;left:51%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(9){width:26px;height:26px;animation-duration:5.2s;animation-delay:4s;left:42%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(10){width:26px;height:22px;animation-duration:3.8s;animation-delay:4.3s;left:54%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(11){width:22px;height:22px;animation-duration:4.2s;animation-delay:.3s;left:42%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(12){width:24px;height:24px;animation-duration:4.6s;animation-delay:2s;left:46%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(13){width:22px;height:22px;animation-duration:3.8s;animation-delay:3.2s;left:48%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(14){width:26px;height:22px;animation-duration:5.2s;animation-delay:2.9s;left:55%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 span:nth-child(15){width:26px;height:22px;animation-duration:4.9s;animation-delay:4.2s;left:52%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 .cos-circle-m4vwX{box-sizing:border-box;filter:blur(8px);width:300px;height:300px;margin-left:-150px;animation:6s linear infinite cos-circleRotate-bgFw5;position:absolute;top:10px;left:50%}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 .cos-circle-m4vwX:before{content:"";background:#00ff6f;border-radius:42% 38% 62% 49%/45%;width:200px;height:200px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)rotate(0)}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 .cos-circle-m4vwX:after{content:"";background:#000;border-radius:50%;width:176px;height:178px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.cos-chargeContainer-4t9qo .cos-contrast-PNep9 .cos-button-myCst{filter:blur(5px);background:#00ff6f;border-radius:100px 100px 0 0;width:150px;height:50px;position:absolute;bottom:0;left:50%;transform:translate(-50%)}@keyframes cos-circleRotate-bgFw5{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes cos-hueRotate-bMJ-k{0%{filter:contrast(15)hue-rotate()}to{filter:contrast(15)hue-rotate(360deg)}}@keyframes cos-moveUp-1Vz9j{0%{transform:translateY(0)}to{transform:translateY(calc(245px - 100vh))}}.cos-confetti-MeNtU{background:#0f172a;border-radius:12px;position:relative;overflow:hidden}.cos-canvas-0T3Vs{cursor:pointer;display:block}.cos-hint-sGHEi{text-align:center;color:#94a3b8b3;pointer-events:none;margin:0;font-size:13px;position:absolute;bottom:12px;left:0;right:0}.cos-countdown-5ZKKP{flex-wrap:wrap;justify-content:center;align-items:center;gap:16px;padding:32px;display:flex;position:relative}.cos-unit-dth8N{flex-direction:column;align-items:center;gap:8px;display:flex}.cos-value-yVzcP{min-width:72px;color:var(--countdown-color,#f472b6);text-align:center;text-shadow:0 0 16px color-mix(in srgb, var(--countdown-color,#f472b6) 40%, transparent);background:linear-gradient(145deg,#1e293b,#0f172a);border:1px solid #94a3b833;border-radius:12px;padding:16px 12px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:36px;font-weight:700;box-shadow:0 8px 24px #0000004d,inset 0 1px #ffffff0d}.cos-label-pAMEs{color:#94a3b8;letter-spacing:.1em;font-size:13px}.cos-ended-c0dsD{color:var(--countdown-color,#f472b6);margin:0;font-size:14px;animation:1.5s ease-in-out infinite cos-pulse-krQd-;position:absolute;bottom:4px}@keyframes cos-pulse-krQd-{0%,to{opacity:1}50%{opacity:.5}}.cos-fireworks-fsSqL{background:#0f172a;border-radius:12px;position:relative;overflow:hidden}.cos-canvas-spL8G{cursor:crosshair;display:block}.cos-hint-5XDRH{color:#94a3b8cc;pointer-events:none;margin:0;font-size:13px;position:absolute;bottom:12px;left:50%;transform:translate(-50%)}.cos-flipCounter-3LuI0{justify-content:center;align-items:center;gap:6px;padding:24px;display:flex}.cos-digit-yJRPy{perspective:300px}.cos-digitCard-zZUzt{border-radius:8px;width:48px;height:64px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:36px;font-weight:700;position:relative;overflow:hidden;box-shadow:0 4px 12px #0006}.cos-staticTop-aLQcm,.cos-staticBottom-9y0gu,.cos-flap-i3YKR{background:linear-gradient(#1e293b 0%,#0f172a 100%);border:1px solid #94a3b833;width:100%;height:50%;position:absolute;left:0;overflow:hidden}.cos-staticTop-aLQcm span,.cos-staticBottom-9y0gu span,.cos-flap-i3YKR span{width:100%;height:200%;color:var(--flip-color,#38bdf8);text-shadow:0 0 10px #38bdf880;justify-content:center;align-items:center;display:flex;position:absolute;left:0}.cos-staticTop-aLQcm,.cos-flapTop-70z-k{border-bottom:1px solid #00000073;border-radius:8px 8px 0 0;top:0}.cos-staticTop-aLQcm span,.cos-flapTop-70z-k span{top:0}.cos-staticBottom-9y0gu,.cos-flapBottom-zhMZe{border-radius:0 0 8px 8px;bottom:0}.cos-staticBottom-9y0gu span,.cos-flapBottom-zhMZe span{bottom:0}.cos-flap-i3YKR{z-index:2;backface-visibility:hidden}.cos-flapTop-70z-k{transform-origin:bottom}.cos-flapBottom-zhMZe{transform-origin:top;transform:rotateX(90deg)}.cos-isFlipping-EVEdI .cos-flapTop-70z-k{animation:cos-fold-top-v-6XJ var(--flip-duration,.6s) ease-in forwards}.cos-isFlipping-EVEdI .cos-flapBottom-zhMZe{animation:cos-unfold-bottom-e2gzU var(--flip-duration,.6s) ease-out forwards}@keyframes cos-fold-top-v-6XJ{0%{transform:rotateX(0)}to{transform:rotateX(-90deg)}}@keyframes cos-unfold-bottom-e2gzU{0%{transform:rotateX(90deg)}to{transform:rotateX(0)}}.cos-glitchText-dZ-sR{background:#0a0a0a;border-radius:12px;justify-content:center;align-items:center;min-height:240px;padding:40px;display:flex}.cos-text-JsPHN{color:var(--glitch-color,#f8fafc);letter-spacing:.12em;text-transform:uppercase;margin:0;font-weight:900;position:relative}.cos-text-JsPHN:before,.cos-text-JsPHN:after{content:attr(data-text);width:100%;height:100%;position:absolute;top:0;left:0;overflow:hidden}.cos-text-JsPHN:before{color:var(--glitch-c1,#ff00de);clip-path:polygon(0 0,100% 0,100% 35%,0 35%);animation:2.5s linear infinite alternate-reverse cos-glitch-1-s9pqH;left:2px}.cos-text-JsPHN:after{color:var(--glitch-c2,#00f0ff);clip-path:polygon(0 65%,100% 65%,100% 100%,0 100%);animation:3s linear infinite alternate-reverse cos-glitch-2-GhFB-;left:-2px}@keyframes cos-glitch-1-s9pqH{0%{transform:translate(0)}20%{transform:translate(-3px,2px)}40%{transform:translate(3px,-1px)}60%{transform:translate(-2px,-2px)}80%{transform:translate(2px,1px)}to{transform:translate(0)}}@keyframes cos-glitch-2-GhFB-{0%{transform:translate(0)}20%{transform:translate(3px,-2px)}40%{transform:translate(-3px,1px)}60%{transform:translate(2px,2px)}80%{transform:translate(-2px,-1px)}to{transform:translate(0)}}.cos-matrixRain-qg9HC{background:#000;border-radius:12px;position:relative;overflow:hidden}.cos-canvas--AvpG{display:block}.cos-overlay-knj3b{pointer-events:none;flex-direction:column;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.cos-title-sDfhs{color:#00ff41;letter-spacing:.3em;text-shadow:0 0 20px #00ff41;margin:0;font-size:48px;font-weight:800;animation:3s infinite cos-flicker-smHxl}.cos-subtitle-CWheW{color:#00ff4199;letter-spacing:.2em;margin:8px 0 0;font-size:14px}@keyframes cos-flicker-smHxl{0%,to{opacity:1}50%{opacity:.85}52%{opacity:.6}54%{opacity:1}}.cos-meteorRain-v8RNI{background:#0f172a;border-radius:12px;overflow:hidden}.cos-canvas-hyFMr{display:block}.cos-neonText-JMP7i{background:#0a0a0a;border-radius:12px;flex-direction:column;justify-content:center;align-items:center;min-height:240px;padding:40px;display:flex}.cos-text-GTO-0{color:var(--neon-color,#ff00de);letter-spacing:.15em;text-shadow:0 0 5px var(--neon-color), 0 0 10px var(--neon-color), 0 0 20px var(--neon-color), 0 0 40px var(--neon-color), 0 0 80px var(--neon-color);margin:0;font-weight:900}.cos-flicker-nXceV{animation:2.5s infinite alternate cos-neon-flicker-uDkmM}.cos-reflection-aEYj6{opacity:.3;letter-spacing:.15em;filter:blur(2px);margin:12px 0 0;font-weight:700;transform:scaleY(-1)}@keyframes cos-neon-flicker-uDkmM{0%,19%,21%,23%,25%,54%,56%,to{opacity:1}20%,24%,55%{opacity:.6}}.cos-particleNetwork-GSZq-{border-radius:12px;position:relative;overflow:hidden}.cos-canvas-E-BGP{cursor:crosshair;display:block}.cos-hint-LEO5o{color:#94a3b8b3;pointer-events:none;margin:0;font-size:13px;position:absolute;bottom:12px;left:50%;transform:translate(-50%)}.cos-returnCityContainer-6XTxj{background:#000;width:100%;height:100%;position:relative;overflow:hidden}.cos-returnCityContainer-6XTxj .cos-star-a59Dx{background:#fd400a;border-radius:50%;width:5px;height:5px;animation:2s infinite cos-star-a59Dx;position:absolute}.cos-returnCityContainer-6XTxj .cos-glassWrap-golMO{width:100px;height:175px;transform-style:preserve-3d;animation:10s linear infinite cos-rotate-7X9Jj;position:absolute;bottom:50%;left:50%;transform:translate(-50%,50%)}.cos-returnCityContainer-6XTxj .cos-glassWrap-golMO .cos-glassItem-OwlFI{opacity:0;background:#ad470257;border-radius:5px;width:100%;height:100%;transition:all .3s ease-in;position:absolute;top:-250px;left:0;box-shadow:0 0 10px 3px #ff0000b3}@keyframes cos-rotate-7X9Jj{0%{transform:translate(-50%,50%)rotateY(360deg)}to{transform:translate(-50%,50%)rotateY(0)}}@keyframes cos-star-a59Dx{0%{filter:blur(1px)contrast(15)hue-rotate();opacity:0}50%{opacity:1;filter:blur(1px)contrast(15)hue-rotate(360deg)}to{opacity:0;filter:blur(1px)contrast(15)hue-rotate()}}.cos-turntable-dkc32{box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;gap:20px;margin:0 auto;padding:24px;display:flex}.cos-wheelWrap-n7lhc{justify-content:center;align-items:center;display:flex;position:relative}.cos-canvas-A1-4x{filter:drop-shadow(0 12px 32px #00000059);border-radius:50%;display:block}.cos-pointer-Rk1S9{z-index:2;filter:drop-shadow(0 2px 4px #0000004d);border-top:28px solid #ef4444;border-left:14px solid #0000;border-right:14px solid #0000;width:0;height:0;position:absolute;top:4px;left:50%;transform:translate(-50%)}.cos-pointer-Rk1S9:after{content:"";background:#ef4444;border-radius:50%;width:16px;height:16px;position:absolute;top:-30px;left:-8px;box-shadow:inset 0 -2px 4px #0003}.cos-spinBtn-l9JIC{z-index:3;color:#b45309;cursor:pointer;background:linear-gradient(145deg,#fff 0%,#f1f5f9 100%);border:4px solid #fbbf24;border-radius:50%;width:88px;height:88px;font-size:14px;font-weight:700;line-height:1.3;transition:transform .15s,box-shadow .15s;position:absolute;box-shadow:0 4px 12px #00000026,inset 0 2px 4px #fffc}.cos-spinBtn-l9JIC:hover:not(:disabled){transform:scale(1.05);box-shadow:0 6px 16px #0003,inset 0 2px 4px #fffc}.cos-spinBtn-l9JIC:active:not(:disabled){transform:scale(.97)}.cos-spinBtn-l9JIC:disabled{opacity:.75;cursor:not-allowed}.cos-result-H8q2c{color:#92400e;background:linear-gradient(90deg,#fef3c7,#fde68a);border-radius:999px;margin:0;padding:10px 20px;font-size:15px;animation:.4s cos-fade-in-U9bUC}.cos-result-H8q2c strong{color:#b45309;font-size:17px}@keyframes cos-fade-in-U9bUC{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.cos-typewriter-7UhOL{box-sizing:border-box;justify-content:center;align-items:center;width:100%;min-height:200px;padding:24px;display:flex}.cos-terminal-NWNVN{background:#1e293b;border-radius:12px;width:min(560px,100%);padding:20px 24px;box-shadow:0 16px 48px #00000059}.cos-dots-oulNg{gap:8px;margin-bottom:16px;display:flex}.cos-dots-oulNg span{border-radius:50%;width:12px;height:12px}.cos-dots-oulNg span:first-child{background:#ef4444}.cos-dots-oulNg span:nth-child(2){background:#eab308}.cos-dots-oulNg span:nth-child(3){background:#22c55e}.cos-text-ICV5T{color:#e2e8f0;min-height:1.6em;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:20px;line-height:1.6}.cos-prompt-Y4hVD{color:#38bdf8;margin-right:8px}.cos-cursor-m8hGi{color:#38bdf8;margin-left:2px;animation:1s step-end infinite cos-blink-XykM7;display:inline-block}@keyframes cos-blink-XykM7{50%{opacity:0}}.cos-waveButton-Aa7G-{justify-content:center;align-items:center;min-height:200px;padding:40px;display:flex}.cos-btn-WJrEN{background:var(--wave-color,#38bdf8);color:#fff;cursor:pointer;border:none;border-radius:50px;padding:16px 48px;font-size:18px;font-weight:600;transition:transform .2s;position:relative;overflow:hidden;box-shadow:0 8px 24px #38bdf859}.cos-btn-WJrEN:hover{transform:scale(1.05)}.cos-btn-WJrEN:active{transform:scale(.97)}.cos-label-9BHOU{z-index:1;position:relative}.cos-wave-GycLU{background:#ffffff4d;border-radius:50%;width:0;height:0;animation:3s ease-out infinite cos-ripple-5ZFpr;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.cos-wave-GycLU:nth-child(2){animation-delay:1s}@keyframes cos-ripple-5ZFpr{0%{opacity:.6;width:0;height:0}to{opacity:0;width:300px;height:300px}}