cos-design 2.1.0 → 2.2.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,15 @@ 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.2.0] - 2026-06-18
9
+
10
+ ### Changed
11
+
12
+ - React 升级至 19,Vite 升级至 8
13
+ - TypeScript、ESLint 9(flat config)、Stylelint 17 等依赖升级至最新稳定版
14
+ - react-router 升级至 v7
15
+ - 最低 Node.js 版本要求提升至 20
16
+
8
17
  ## [2.1.0] - 2026-06-18
9
18
 
10
19
  ### Added
@@ -43,5 +52,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
43
52
  - Webpack 及相关 loader 依赖
44
53
  - UMD 格式产物
45
54
 
55
+ [2.2.0]: https://github.com/jiaxiantao/cos-design/compare/v2.1.0...v2.2.0
46
56
  [2.1.0]: https://github.com/jiaxiantao/cos-design/compare/v2.0.0...v2.1.0
47
57
  [2.0.0]: https://github.com/jiaxiantao/cos-design/compare/v1.7.5...v2.0.0
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![npm version](https://img.shields.io/npm/v/cos-design.svg)](https://www.npmjs.com/package/cos-design)
5
5
  [![license](https://img.shields.io/npm/l/cos-design.svg)](https://github.com/jiaxiantao/cos-design/blob/main/LICENSE)
6
6
 
7
- 基于 React 18 + Vite 6 + TypeScript 5 的 React 组件库。
7
+ 基于 React 19 + Vite 8 + TypeScript 5 的 React 组件库。
8
8
 
9
9
  ## 特性
10
10
 
@@ -50,7 +50,7 @@ function App() {
50
50
 
51
51
  ## 本地开发
52
52
 
53
- > **要求 Node.js >= 18**(项目含 `.nvmrc`,推荐使用 Node 20)
53
+ > **要求 Node.js >= 20**(项目含 `.nvmrc`,推荐使用 Node 22)
54
54
 
55
55
  ### 第一步:切换 Node 版本
56
56
 
@@ -101,6 +101,35 @@ which pnpm # 确认路径不在 corepack 下
101
101
  pnpm -v
102
102
  ```
103
103
 
104
+ ## 自动发布(CI/CD)
105
+
106
+ 推送到 `master` 分支后,GitHub Actions 会自动执行 lint、构建,并将**新版本**发布到 [npm](https://www.npmjs.com/package/cos-design)。
107
+
108
+ ### 首次配置(仅需一次)
109
+
110
+ 1. 打开 [npm Access Tokens](https://www.npmjs.com/settings/jiaxiantao/tokens)
111
+ 2. 创建 **Granular Access Token**:
112
+ - Permissions: Packages → **Read and write**
113
+ - 勾选 **Bypass 2FA for publish**(自动化发布必须)
114
+ 3. 打开 GitHub 仓库 → **Settings** → **Secrets and variables** → **Actions**
115
+ 4. 新建 Secret:`NPM_TOKEN`,值为上一步的 token
116
+
117
+ ### 发布新版本
118
+
119
+ ```bash
120
+ # 1. 更新 package.json 中的 version(如 2.2.0)
121
+ # 2. 更新 CHANGELOG.md
122
+ # 3. 提交并推送
123
+ git add .
124
+ git commit -m "chore: release v2.2.0"
125
+ git push origin master
126
+
127
+ # 4.(可选)打 tag
128
+ git tag v2.2.0 && git push origin v2.2.0
129
+ ```
130
+
131
+ 推送后可在 [Actions](https://github.com/jiaxiantao/cos-design/actions) 查看发布进度。若 npm 上已存在相同版本号,会自动跳过发布。
132
+
104
133
  ## 参与贡献
105
134
 
106
135
  欢迎提交 Issue 与 Pull Request,请参阅 [CONTRIBUTING.md](./CONTRIBUTING.md)。
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ export interface CanvasClockProps {
3
+ width?: number;
4
+ height?: number;
5
+ }
6
+ declare const CanvasClock: React.FC<CanvasClockProps>;
7
+ export default CanvasClock;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface ChargeProps {
3
+ initQuantity?: number;
4
+ }
5
+ declare const Charge: (props: ChargeProps) => React.ReactElement;
6
+ export default Charge;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ export interface FireworksProps {
3
+ width?: number;
4
+ height?: number;
5
+ /** 是否自动燃放,默认 true */
6
+ auto?: boolean;
7
+ }
8
+ declare const Fireworks: React.FC<FireworksProps>;
9
+ export default Fireworks;
@@ -0,0 +1,20 @@
1
+ export { default as CanvasClock } from './canvasClock';
2
+ export type { CanvasClockProps } from './canvasClock';
3
+ export { default as Charge } from './charge';
4
+ export type { ChargeProps } from './charge';
5
+ export { default as Fireworks } from './fireworks';
6
+ export type { FireworksProps } from './fireworks';
7
+ export { default as MatrixRain } from './matrixRain';
8
+ export type { MatrixRainProps } from './matrixRain';
9
+ export { default as NeonText } from './neonText';
10
+ export type { NeonTextProps } from './neonText';
11
+ export { default as ParticleNetwork } from './particleNetwork';
12
+ export type { ParticleNetworkProps } from './particleNetwork';
13
+ export { default as ReturnCity } from './returnCity';
14
+ export type { ReturnCityProps } from './returnCity';
15
+ export type { TurntablePrize, TurntableProps } from './turntable';
16
+ export { default as Turntable } from './turntable';
17
+ export { default as Typewriter } from './typewriter';
18
+ export type { TypewriterProps } from './typewriter';
19
+ export { default as WaveButton } from './waveButton';
20
+ export type { WaveButtonProps } from './waveButton';
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ export interface MatrixRainProps {
3
+ width?: number;
4
+ height?: number;
5
+ /** 列密度 0~1,默认 0.6 */
6
+ density?: number;
7
+ /** 主色调 */
8
+ color?: string;
9
+ }
10
+ declare const MatrixRain: React.FC<MatrixRainProps>;
11
+ export default MatrixRain;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export interface NeonTextProps {
3
+ /** 显示文字 */
4
+ text?: string;
5
+ /** 霓虹主色 */
6
+ color?: string;
7
+ /** 字号 */
8
+ fontSize?: number;
9
+ /** 是否闪烁 */
10
+ flicker?: boolean;
11
+ }
12
+ declare const NeonText: React.FC<NeonTextProps>;
13
+ export default NeonText;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export interface ParticleNetworkProps {
3
+ width?: number;
4
+ height?: number;
5
+ /** 粒子数量 */
6
+ particleCount?: number;
7
+ /** 连线距离 */
8
+ linkDistance?: number;
9
+ /** 粒子颜色 */
10
+ color?: string;
11
+ }
12
+ declare const ParticleNetwork: React.FC<ParticleNetworkProps>;
13
+ export default ParticleNetwork;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface ReturnCityProps {
3
+ shining?: number;
4
+ }
5
+ declare const ReturnCity: React.FC<ReturnCityProps>;
6
+ export default ReturnCity;
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ export interface TurntablePrize {
3
+ label: string;
4
+ color?: string;
5
+ }
6
+ export interface TurntableProps {
7
+ /** 奖品列表 */
8
+ prizes?: TurntablePrize[];
9
+ /** 转盘直径,默认 360 */
10
+ size?: number;
11
+ /** 旋转动画时长(毫秒),默认 4000 */
12
+ spinDuration?: number;
13
+ /** 旋转圈数,默认 5 */
14
+ spinRounds?: number;
15
+ /** 抽奖按钮文案 */
16
+ buttonText?: string;
17
+ /** 旋转结束回调 */
18
+ onSpinEnd?: (prize: TurntablePrize, index: number) => void;
19
+ }
20
+ declare const Turntable: React.FC<TurntableProps>;
21
+ export default Turntable;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export interface TypewriterProps {
3
+ /** 轮播文案列表 */
4
+ texts?: string[];
5
+ /** 打字速度(毫秒/字符) */
6
+ speed?: number;
7
+ /** 删除速度(毫秒/字符) */
8
+ deleteSpeed?: number;
9
+ /** 完整展示后的停顿(毫秒) */
10
+ pause?: number;
11
+ }
12
+ declare const Typewriter: React.FC<TypewriterProps>;
13
+ export default Typewriter;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ export interface WaveButtonProps {
3
+ /** 按钮文字 */
4
+ text?: string;
5
+ /** 点击回调 */
6
+ onClick?: () => void;
7
+ /** 主色 */
8
+ color?: string;
9
+ }
10
+ declare const WaveButton: React.FC<WaveButtonProps>;
11
+ export default WaveButton;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("react/jsx-runtime"),x=require("react"),K="cos-canvasClock",V="cos-canvasTarget",Q={canvasClock:K,canvasTarget:V},z=({width:s=400,height:a=400})=>{const u=x.useRef(null),l=Math.min(s,a),r=l/2-16,m=l/2,y=x.useCallback(t=>{t.clearRect(0,0,l,l),t.save(),t.translate(m,m),t.beginPath(),t.arc(0,0,r,0,Math.PI*2),t.fillStyle="#fff",t.fill(),t.strokeStyle="#d1d5db",t.lineWidth=2,t.stroke();for(let j=0;j<60;j++){const i=j/60*Math.PI*2,h=r-(j%5===0?14:8);t.beginPath(),t.moveTo(Math.cos(i)*h,Math.sin(i)*h),t.lineTo(Math.cos(i)*r,Math.sin(i)*r),t.strokeStyle=j%5===0?"#374151":"#9ca3af",t.lineWidth=j%5===0?2:1,t.stroke()}t.fillStyle="#111827",t.font=`bold ${Math.floor(l/22)}px system-ui, sans-serif`,t.textAlign="center",t.textBaseline="middle";for(let j=1;j<=12;j++){const i=j/12*Math.PI*2-Math.PI/2,h=r-32;t.fillText(String(j),Math.cos(i)*h,Math.sin(i)*h)}const c=new Date,g=c.getHours()%12,f=c.getMinutes(),v=c.getSeconds(),b=c.getMilliseconds(),o=(j,i,h,M,n)=>{t.save(),t.rotate(j),t.beginPath(),t.moveTo(0,h),t.lineTo(i,0),t.lineTo(0,-h),t.closePath(),t.fillStyle=M,t.shadowColor=n,t.shadowBlur=4,t.fill(),t.restore()},d=(g+f/60)/12*Math.PI*2-Math.PI/2,C=(f+v/60)/60*Math.PI*2-Math.PI/2,p=(v+b/1e3)/60*Math.PI*2-Math.PI/2;o(d,r*.5,4,"#111827","rgb(0 0 0 / 40%)"),o(C,r*.72,3,"#1e80ff","rgb(30 128 255 / 40%)"),o(p,r*.85,2,"#e9686b","rgb(233 104 107 / 40%)"),t.beginPath(),t.arc(0,0,5,0,Math.PI*2),t.fillStyle="#111827",t.fill(),t.restore()},[m,r,l]);return x.useEffect(()=>{const t=u.current;if(!t)return;const c=window.devicePixelRatio||1;t.width=l*c,t.height=l*c;const g=t.getContext("2d");if(!g)return;g.setTransform(c,0,0,c,0,0);let f=0;const v=()=>{y(g),f=requestAnimationFrame(v)};return v(),()=>cancelAnimationFrame(f)},[y,l]),e.jsx("div",{className:Q.canvasClock,style:{width:l,height:l},children:e.jsx("canvas",{ref:u,className:Q.canvasTarget,style:{width:l,height:l}})})},tt="cos-chargeContainer",et="cos-contrast",st="cos-text",nt="cos-circle",at="cos-button",k={chargeContainer:tt,contrast:et,text:st,circle:nt,button:at},ot=s=>{const{initQuantity:a=0}=s,[u,l]=x.useState(a);return x.useEffect(()=>{let r=u;setInterval(()=>{r=Number(Number(r+=.01).toFixed(2)),l(r)},500)},[]),e.jsx("div",{className:k.chargeContainer,children:e.jsxs("div",{className:k.contrast,children:[e.jsxs("div",{className:k.text,children:[u?u.toString().padEnd(4,"0"):0,"%"]}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{}),e.jsx("div",{className:k.circle}),e.jsx("div",{className:k.button})]})})},rt="cos-fireworks",ct="cos-canvas",lt="cos-hint",L={fireworks:rt,canvas:ct,hint:lt},U=["#ff6b6b","#ffd93d","#6bcb77","#4d96ff","#a66cff","#ff85c0"],G=()=>U[Math.floor(Math.random()*U.length)],it=(s,a,u)=>{const l=60+Math.floor(Math.random()*30);return Array.from({length:l},()=>{const r=Math.random()*Math.PI*2,m=Math.random()*4+2;return{x:s,y:a,vx:Math.cos(r)*m,vy:Math.sin(r)*m,alpha:1,color:Math.random()>.3?u:G(),decay:Math.random()*.015+.01}})},ut=({width:s=800,height:a=500,auto:u=!0})=>{const l=x.useRef(null),r=x.useRef([]),m=x.useRef(0),y=x.useCallback(c=>{const g=c??Math.random()*s*.6+s*.2;r.current.push({x:g,y:a,vy:-(Math.random()*4+6),targetY:Math.random()*a*.4+a*.1,color:G(),exploded:!1,particles:[]})},[a,s]);x.useEffect(()=>{const c=l.current;if(!c)return;const g=window.devicePixelRatio||1;c.width=s*g,c.height=a*g;const f=c.getContext("2d");if(!f)return;f.setTransform(g,0,0,g,0,0);let v=0;const b=()=>{m.current=requestAnimationFrame(b),f.fillStyle="rgb(15 23 42 / 25%)",f.fillRect(0,0,s,a),u&&Math.random()<.03&&y(),r.current=r.current.filter(o=>o.exploded?(o.particles=o.particles.filter(d=>(d.x+=d.vx,d.y+=d.vy,d.vy+=.06,d.alpha-=d.decay,d.alpha<=0?!1:(f.beginPath(),f.arc(d.x,d.y,2,0,Math.PI*2),f.fillStyle=d.color,f.globalAlpha=d.alpha,f.fill(),f.globalAlpha=1,!0))),o.particles.length>0):(o.y+=o.vy,o.vy*=.98,f.beginPath(),f.arc(o.x,o.y,2.5,0,Math.PI*2),f.fillStyle=o.color,f.fill(),(o.vy>=0||o.y<=o.targetY)&&(o.exploded=!0,o.particles=it(o.x,o.y,o.color)),!0))};return b(),u&&(v=window.setInterval(()=>y(),1200)),()=>{cancelAnimationFrame(m.current),clearInterval(v)}},[u,a,y,s]);const t=c=>{const g=c.currentTarget.getBoundingClientRect();y(c.clientX-g.left)};return e.jsxs("div",{className:L.fireworks,style:{width:s,height:a},children:[e.jsx("canvas",{ref:l,className:L.canvas,style:{width:s,height:a},onClick:t}),e.jsx("p",{className:L.hint,children:"点击画布燃放烟花"})]})},ft="cos-matrixRain",dt="cos-canvas",mt="cos-overlay",ht="cos-title",xt="cos-subtitle",F={matrixRain:ft,canvas:dt,overlay:mt,title:ht,subtitle:xt},Z="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*アイウエオカキクケコ",yt=({width:s=800,height:a=500,density:u=.6,color:l="#00ff41"})=>{const r=x.useRef(null);return x.useEffect(()=>{const m=r.current;if(!m)return;const y=window.devicePixelRatio||1;m.width=s*y,m.height=a*y;const t=m.getContext("2d");if(!t)return;t.setTransform(y,0,0,y,0,0);const c=16,g=Math.floor(s/c*u),f=Array.from({length:g},()=>Math.random()*-50);let v=0;const b=()=>{t.fillStyle="rgb(0 0 0 / 8%)",t.fillRect(0,0,s,a),t.fillStyle=l,t.font=`${c}px monospace`,f.forEach((o,d)=>{const C=Z[Math.floor(Math.random()*Z.length)],p=d/u*c;t.fillStyle=l,t.fillText(C,p,o*c),o*c>a&&Math.random()>.975&&(f[d]=0),f[d]+=1}),v=requestAnimationFrame(b)};return b(),()=>cancelAnimationFrame(v)},[l,u,a,s]),e.jsxs("div",{className:F.matrixRain,style:{width:s,height:a},children:[e.jsx("canvas",{ref:r,className:F.canvas,style:{width:s,height:a}}),e.jsxs("div",{className:F.overlay,children:[e.jsx("h2",{className:F.title,children:"MATRIX"}),e.jsx("p",{className:F.subtitle,children:"数字雨效果"})]})]})},vt="cos-neonText",gt="cos-text",Mt="cos-flicker",bt="cos-reflection",$={neonText:vt,text:gt,flicker:Mt,reflection:bt},pt=({text:s="NEON",color:a="#ff00de",fontSize:u=72,flicker:l=!0})=>e.jsxs("div",{className:$.neonText,children:[e.jsx("h1",{className:`${$.text} ${l?$.flicker:""}`,style:{fontSize:u,"--neon-color":a},children:s}),e.jsx("p",{className:$.reflection,style:{fontSize:u*.35,color:a},children:s})]}),jt="cos-particleNetwork",Rt="cos-canvas",Nt="cos-hint",O={particleNetwork:jt,canvas:Rt,hint:Nt},Ct=({width:s=800,height:a=500,particleCount:u=60,linkDistance:l=120,color:r="#38bdf8"})=>{const m=x.useRef(null),y=x.useRef([]),t=x.useRef({x:-1e3,y:-1e3}),c=x.useCallback(()=>{y.current=Array.from({length:u},()=>({x:Math.random()*s,y:Math.random()*a,vx:(Math.random()-.5)*1.2,vy:(Math.random()-.5)*1.2,radius:Math.random()*2+1}))},[a,u,s]);x.useEffect(()=>{c()},[c]),x.useEffect(()=>{const v=m.current;if(!v)return;const b=window.devicePixelRatio||1;v.width=s*b,v.height=a*b;const o=v.getContext("2d");if(!o)return;o.setTransform(b,0,0,b,0,0);let d=0;const C=()=>{o.fillStyle="#0f172a",o.fillRect(0,0,s,a);const p=y.current,j=t.current;p.forEach(i=>{i.x+=i.vx,i.y+=i.vy,(i.x<0||i.x>s)&&(i.vx*=-1),(i.y<0||i.y>a)&&(i.vy*=-1);const h=j.x-i.x,M=j.y-i.y;Math.sqrt(h*h+M*M)<150&&(i.vx-=h*3e-4,i.vy-=M*3e-4)});for(let i=0;i<p.length;i++)for(let h=i+1;h<p.length;h++){const M=p[i].x-p[h].x,n=p[i].y-p[h].y,R=Math.sqrt(M*M+n*n);R<l&&(o.beginPath(),o.moveTo(p[i].x,p[i].y),o.lineTo(p[h].x,p[h].y),o.strokeStyle=r,o.globalAlpha=1-R/l,o.lineWidth=.8,o.stroke(),o.globalAlpha=1)}p.forEach(i=>{o.beginPath(),o.arc(i.x,i.y,i.radius,0,Math.PI*2),o.fillStyle=r,o.fill()}),d=requestAnimationFrame(C)};return C(),()=>cancelAnimationFrame(d)},[r,a,c,l,s]);const g=v=>{const b=v.currentTarget.getBoundingClientRect();t.current={x:v.clientX-b.left,y:v.clientY-b.top}},f=()=>{t.current={x:-1e3,y:-1e3}};return e.jsxs("div",{className:O.particleNetwork,style:{width:s,height:a},children:[e.jsx("canvas",{ref:m,className:O.canvas,style:{width:s,height:a},onMouseMove:g,onMouseLeave:f}),e.jsx("p",{className:O.hint,children:"移动鼠标与粒子互动"})]})},Pt="cos-returnCityContainer",Tt="cos-star",wt="cos-glassWrap",It="cos-glassItem",q={returnCityContainer:Pt,star:Tt,glassWrap:wt,glassItem:It},At=()=>{const s=(u,l)=>{for(let r=0;r<l;r++)setTimeout(function(){const m=document.createElement("div");m.className=q.star;const y=document.body.clientWidth,t=document.body.clientHeight,c=Math.random()*y+"px",g=Math.random()*t+"px";m.style.top=g,m.style.left=c,u.append(m)},Math.random()*2e3)},a=()=>{const l="150px",r=document.getElementById("glassWrap");if(r)for(let m=0;m<6;m++){const y=document.createElement("div");y.className=q.glassItem,y.style.transform=`rotateY(${m*60}deg) translateZ(${l})`,r.appendChild(y),setTimeout(()=>{y.style.top="0px",y.style.opacity="1"},m*300)}};return x.useEffect(()=>{const u=document.getElementById("returnCityContainer");u&&s(u,document.documentElement.clientWidth/20),a()},[]),e.jsx("div",{id:"returnCityContainer",className:q.returnCityContainer,children:e.jsx("div",{id:"glassWrap",className:q.glassWrap})})},St="cos-turntable",Et="cos-wheelWrap",kt="cos-canvas",Ft="cos-pointer",Bt="cos-spinBtn",Wt="cos-result",I={turntable:St,wheelWrap:Et,canvas:kt,pointer:Ft,spinBtn:Bt,result:Wt},_=["#FF6B6B","#4ECDC4","#FFE66D","#A78BFA","#60A5FA","#F472B6","#34D399","#FB923C"],$t=[{label:"一等奖"},{label:"二等奖"},{label:"三等奖"},{label:"谢谢参与"},{label:"优惠券"},{label:"再来一次"}],qt=s=>1-Math.pow(1-s,3),Dt=({prizes:s=$t,size:a=360,spinDuration:u=4e3,spinRounds:l=5,buttonText:r="开始抽奖",onSpinEnd:m})=>{const y=x.useRef(null),t=x.useRef(0),c=x.useRef(0),g=x.useRef(1),[f,v]=x.useState(!1),[b,o]=x.useState(null),d=a+48,C=(h,M)=>M.color??_[h%_.length],p=x.useCallback(h=>{const M=y.current;if(!M)return;const n=M.getContext("2d");if(!n)return;const R=d/2,P=a/2,S=Math.PI*2/s.length;n.clearRect(0,0,d,d),n.save(),n.translate(R,R),n.rotate(h),s.forEach((N,w)=>{const T=w*S-Math.PI/2,E=T+S,D=C(w,N);n.beginPath(),n.moveTo(0,0),n.arc(0,0,P,T,E),n.closePath(),n.fillStyle=D,n.fill(),n.strokeStyle="rgb(255 255 255 / 35%)",n.lineWidth=2,n.stroke(),n.save(),n.rotate(T+S/2),n.textAlign="right",n.fillStyle="#fff",n.font=`bold ${Math.max(12,Math.floor(a/22))}px system-ui, sans-serif`,n.shadowColor="rgb(0 0 0 / 30%)",n.shadowBlur=4,n.fillText(N.label,P-18,6),n.restore()}),n.beginPath(),n.arc(0,0,P,0,Math.PI*2),n.strokeStyle="#fbbf24",n.lineWidth=6,n.stroke(),n.beginPath(),n.arc(0,0,P-4,0,Math.PI*2),n.strokeStyle="#f59e0b",n.lineWidth=2,n.stroke(),n.restore(),n.save(),n.translate(R,R);for(let N=0;N<12;N++){const w=N/12*Math.PI*2,T=Math.cos(w)*(P+14),E=Math.sin(w)*(P+14);n.beginPath(),n.arc(T,E,3,0,Math.PI*2),n.fillStyle=N%2===0?"#fde68a":"#f59e0b",n.fill()}n.restore()},[d,s,a]);x.useEffect(()=>{const h=y.current;if(!h)return;const M=window.devicePixelRatio||1;g.current=M,h.width=d*M,h.height=d*M;const n=h.getContext("2d");n&&n.setTransform(M,0,0,M,0,0),p(t.current)},[d,p]),x.useEffect(()=>()=>{c.current&&cancelAnimationFrame(c.current)},[]);const j=h=>{const M=360/s.length,n=(h*(180/Math.PI)%360+360)%360;return Math.floor((360-n+M/2)%360/M)%s.length},i=()=>{if(f||s.length===0)return;v(!0),o(null);const h=Math.PI*2/s.length,n=Math.floor(Math.random()*s.length)*h+h/2,R=t.current,P=l*Math.PI*2,S=R+P+(Math.PI*2-n)-R%(Math.PI*2),N=R,w=performance.now(),T=E=>{const D=E-w,H=Math.min(D/u,1),J=qt(H),W=N+(S-N)*J;if(t.current=W,p(W),H<1)c.current=requestAnimationFrame(T);else{const X=j(W),Y=s[X];t.current=W,v(!1),o(Y),m==null||m(Y,X)}};c.current=requestAnimationFrame(T)};return e.jsxs("div",{className:I.turntable,style:{width:d,height:d+80},children:[e.jsxs("div",{className:I.wheelWrap,style:{width:d,height:d},children:[e.jsx("div",{className:I.pointer}),e.jsx("canvas",{ref:y,className:I.canvas,style:{width:d,height:d}}),e.jsx("button",{type:"button",className:I.spinBtn,onClick:i,disabled:f,children:f?"抽奖中...":r})]}),b&&!f&&e.jsxs("p",{className:I.result,children:["恭喜获得:",e.jsx("strong",{children:b.label})]})]})},Lt="cos-typewriter",Ot="cos-terminal",Ht="cos-dots",Xt="cos-text",Yt="cos-prompt",Qt="cos-cursor",A={typewriter:Lt,terminal:Ot,dots:Ht,text:Xt,prompt:Yt,cursor:Qt},Ut=["Hello, cos-design!","欢迎来到组件库 ✨","Build something fun 🚀"],Zt=({texts:s=Ut,speed:a=100,deleteSpeed:u=50,pause:l=2e3})=>{const[r,m]=x.useState(""),[y,t]=x.useState(0),[c,g]=x.useState(!1);return x.useEffect(()=>{const f=s[y%s.length];let v;if(!c&&r===f)v=setTimeout(()=>g(!0),l);else if(c&&r==="")g(!1),t(b=>(b+1)%s.length);else{const b=c?f.slice(0,r.length-1):f.slice(0,r.length+1);v=setTimeout(()=>m(b),c?u:a)}return()=>clearTimeout(v)},[r,c,y,s,a,u,l]),e.jsx("div",{className:A.typewriter,children:e.jsxs("div",{className:A.terminal,children:[e.jsxs("div",{className:A.dots,children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]}),e.jsxs("p",{className:A.text,children:[e.jsx("span",{className:A.prompt,children:">"}),r,e.jsx("span",{className:A.cursor,children:"|"})]})]})})},_t="cos-waveButton",Gt="cos-btn",Jt="cos-label",Kt="cos-wave",B={waveButton:_t,btn:Gt,label:Jt,wave:Kt},Vt=({text:s="点我试试",onClick:a,color:u="#38bdf8"})=>e.jsx("div",{className:B.waveButton,children:e.jsxs("button",{type:"button",className:B.btn,style:{"--wave-color":u},onClick:a,children:[e.jsx("span",{className:B.wave}),e.jsx("span",{className:B.wave}),e.jsx("span",{className:B.label,children:s})]})});exports.CanvasClock=z;exports.Charge=ot;exports.Fireworks=ut;exports.MatrixRain=yt;exports.NeonText=pt;exports.ParticleNetwork=Ct;exports.ReturnCity=At;exports.Turntable=Dt;exports.Typewriter=Zt;exports.WaveButton=Vt;
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;
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- .cos-canvasClock{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background-color:#fff;box-shadow:0 8px 32px #00000040}.cos-canvasTarget{display:block;border-radius:50%}.cos-chargeContainer{width:100vw;height:100vh;background-color:#000;position:relative}.cos-chargeContainer .cos-contrast{width:100%;height:100%;background-color:#000;overflow:hidden;filter:contrast(15) hue-rotate(0);position:relative;animation:cos-hueRotate 6s linear infinite}.cos-chargeContainer .cos-contrast .cos-text{width:300px;height:300px;position:absolute;top:10px;left:50%;margin-left:-150px;text-align:center;z-index:9;font-size:30px;line-height:300px;color:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.cos-chargeContainer .cos-contrast span{filter:blur(5px);position:absolute;border-radius:10px;background:#00ff6f;animation:cos-moveUp ease-in-out infinite;bottom:0;transition:transform .3s linear;will-change:transform}.cos-chargeContainer .cos-contrast span:nth-child(1){width:20px;height:20px;left:50%;animation-duration:4s;animation-delay:2s}.cos-chargeContainer .cos-contrast span:nth-child(2){width:22px;height:22px;left:54%;animation-duration:4.2s;animation-delay:4s}.cos-chargeContainer .cos-contrast span:nth-child(3){width:24px;height:24px;left:45%;animation-duration:3s;animation-delay:1s}.cos-chargeContainer .cos-contrast span:nth-child(4){width:20px;height:22px;left:54%;animation-duration:5s;animation-delay:0s}.cos-chargeContainer .cos-contrast span:nth-child(5){width:22px;height:22px;left:52%;animation-duration:3.5s;animation-delay:5s}.cos-chargeContainer .cos-contrast span:nth-child(6){width:20px;height:20px;left:50%;animation-duration:4.7s;animation-delay:1.2s}.cos-chargeContainer .cos-contrast span:nth-child(7){width:22px;height:22px;left:54%;animation-duration:2.5s;animation-delay:3.5s}.cos-chargeContainer .cos-contrast span:nth-child(8){width:24px;height:24px;left:51%;animation-duration:5.6s;animation-delay:4.2s}.cos-chargeContainer .cos-contrast span:nth-child(9){width:26px;height:26px;left:42%;animation-duration:5.2s;animation-delay:4s}.cos-chargeContainer .cos-contrast span:nth-child(10){width:26px;height:22px;left:54%;animation-duration:3.8s;animation-delay:4.3s}.cos-chargeContainer .cos-contrast span:nth-child(11){width:22px;height:22px;left:42%;animation-duration:4.2s;animation-delay:.3s}.cos-chargeContainer .cos-contrast span:nth-child(12){width:24px;height:24px;left:46%;animation-duration:4.6s;animation-delay:2s}.cos-chargeContainer .cos-contrast span:nth-child(13){width:22px;height:22px;left:48%;animation-duration:3.8s;animation-delay:3.2s}.cos-chargeContainer .cos-contrast span:nth-child(14){width:26px;height:22px;left:55%;animation-duration:5.2s;animation-delay:2.9s}.cos-chargeContainer .cos-contrast span:nth-child(15){width:26px;height:22px;left:52%;animation-duration:4.9s;animation-delay:4.2s}.cos-chargeContainer .cos-contrast .cos-circle{width:300px;height:300px;position:absolute;top:10px;left:50%;margin-left:-150px;box-sizing:border-box;filter:blur(8px);animation:cos-circleRotate 6s linear infinite}.cos-chargeContainer .cos-contrast .cos-circle:before{content:"";height:200px;width:200px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) rotate(0);background:#00ff6f;border-radius:42% 38% 62% 49%/45%}.cos-chargeContainer .cos-contrast .cos-circle:after{content:"";width:176px;height:178px;background:#000;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.cos-chargeContainer .cos-contrast .cos-button{width:150px;height:50px;background:#00ff6f;position:absolute;left:50%;bottom:0;transform:translate(-50%);border-radius:100px 100px 0 0;filter:blur(5px)}@keyframes cos-circleRotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes cos-hueRotate{0%{filter:contrast(15) hue-rotate(0)}to{filter:contrast(15) hue-rotate(360deg)}}@keyframes cos-moveUp{0%{transform:translateY(0)}to{transform:translateY(calc(0% - 100vh + 245px))}}.cos-fireworks{position:relative;border-radius:12px;overflow:hidden;background:#0f172a}.cos-hint{position:absolute;bottom:12px;left:50%;margin:0;color:#94a3b8cc;font-size:13px;transform:translate(-50%);pointer-events:none}.cos-matrixRain{position:relative;border-radius:12px;overflow:hidden;background:#000}.cos-canvas{display:block}.cos-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}.cos-title{margin:0;color:#00ff41;font-size:48px;font-weight:800;letter-spacing:.3em;text-shadow:0 0 20px #00ff41;animation:cos-flicker 3s infinite}.cos-subtitle{margin:8px 0 0;color:#00ff4199;font-size:14px;letter-spacing:.2em}@keyframes cos-flicker{0%,to{opacity:1}50%{opacity:.85}52%{opacity:.6}54%{opacity:1}}.cos-neonText{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:240px;padding:40px;background:#0a0a0a;border-radius:12px}.cos-text{margin:0;color:var(--neon-color, #ff00de);font-weight:900;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)}.cos-flicker{animation:cos-neon-flicker 2.5s infinite alternate}.cos-reflection{margin:12px 0 0;opacity:.3;font-weight:700;letter-spacing:.15em;transform:scaleY(-1);filter:blur(2px)}@keyframes cos-neon-flicker{0%,19%,21%,23%,25%,54%,56%,to{opacity:1}20%,24%,55%{opacity:.6}}.cos-particleNetwork{position:relative;border-radius:12px;overflow:hidden}.cos-canvas{display:block;cursor:crosshair}.cos-hint{position:absolute;bottom:12px;left:50%;margin:0;color:#94a3b8b3;font-size:13px;transform:translate(-50%);pointer-events:none}.cos-returnCityContainer{width:100%;height:100%;overflow:hidden;background:#000;position:relative}.cos-returnCityContainer .cos-star{position:absolute;width:5px;height:5px;border-radius:50%;background:#fd400a;animation:cos-star infinite 2s}.cos-returnCityContainer .cos-glassWrap{width:100px;height:175px;position:absolute;left:50%;bottom:50%;transform:translate(-50%,50%);transform-style:preserve-3d;animation:cos-rotate 10s linear infinite}.cos-returnCityContainer .cos-glassWrap .cos-glassItem{position:absolute;left:0;opacity:0;top:-250px;width:100%;height:100%;transition:all .3s ease-in;border-radius:5px;box-shadow:0 0 10px 3px #ff0000b3;background:#ad470257}@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(0);opacity:0}50%{opacity:1;filter:blur(1px) contrast(15) hue-rotate(360deg)}to{opacity:0;filter:blur(1px) contrast(15) hue-rotate(0)}}.cos-turntable{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;margin:0 auto;padding:24px;box-sizing:border-box}.cos-wheelWrap{position:relative;display:flex;align-items:center;justify-content:center}.cos-canvas{display:block;border-radius:50%;filter:drop-shadow(0 12px 32px rgba(0,0,0,.35))}.cos-pointer{position:absolute;top:4px;left:50%;z-index:2;width:0;height:0;border-left:14px solid transparent;border-right:14px solid transparent;border-top:28px solid #ef4444;transform:translate(-50%);filter:drop-shadow(0 2px 4px rgba(0,0,0,.3))}.cos-pointer:after{content:"";position:absolute;top:-30px;left:-8px;width:16px;height:16px;border-radius:50%;background:#ef4444;box-shadow:inset 0 -2px 4px #0003}.cos-spinBtn{position:absolute;z-index:3;width:88px;height:88px;border:4px solid #fbbf24;border-radius:50%;background:linear-gradient(145deg,#fff,#f1f5f9);color:#b45309;font-size:14px;font-weight:700;line-height:1.3;cursor:pointer;box-shadow:0 4px 12px #00000026,inset 0 2px 4px #fffc;transition:transform .15s,box-shadow .15s}.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{margin:0;padding:10px 20px;border-radius:999px;background:linear-gradient(90deg,#fef3c7,#fde68a);color:#92400e;font-size:15px;animation:cos-fade-in .4s ease}.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{display:flex;align-items:center;justify-content:center;width:100%;min-height:200px;padding:24px;box-sizing:border-box}.cos-terminal{width:min(560px,100%);padding:20px 24px;border-radius:12px;background:#1e293b;box-shadow:0 16px 48px #00000059}.cos-dots{display:flex;gap:8px;margin-bottom:16px}.cos-dots span{width:12px;height:12px;border-radius:50%}.cos-dots span:nth-child(1){background:#ef4444}.cos-dots span:nth-child(2){background:#eab308}.cos-dots span:nth-child(3){background:#22c55e}.cos-text{margin:0;color:#e2e8f0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:20px;line-height:1.6;min-height:1.6em}.cos-prompt{margin-right:8px;color:#38bdf8}.cos-cursor{display:inline-block;margin-left:2px;color:#38bdf8;animation:cos-blink 1s step-end infinite}@keyframes cos-blink{50%{opacity:0}}.cos-waveButton{display:flex;align-items:center;justify-content:center;min-height:200px;padding:40px}.cos-btn{position:relative;padding:16px 48px;border:none;border-radius:50px;background:var(--wave-color, #38bdf8);color:#fff;font-size:18px;font-weight:600;overflow:hidden;cursor:pointer;box-shadow:0 8px 24px #38bdf859;transition:transform .2s}.cos-btn:hover{transform:scale(1.05)}.cos-btn:active{transform:scale(.97)}.cos-label{position:relative;z-index:1}.cos-wave{position:absolute;top:50%;left:50%;width:0;height:0;border-radius:50%;background:#ffffff4d;transform:translate(-50%,-50%);animation:cos-ripple 3s ease-out infinite}.cos-wave:nth-child(2){animation-delay:1s}@keyframes cos-ripple{0%{width:0;height:0;opacity:.6}to{width:300px;height:300px;opacity:0}}
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}}
package/dist/index.d.ts CHANGED
@@ -1,114 +1 @@
1
- import { default as default_2 } from 'react';
2
-
3
- export declare const CanvasClock: default_2.FC<CanvasClockProps>;
4
-
5
- export declare interface CanvasClockProps {
6
- width?: number;
7
- height?: number;
8
- }
9
-
10
- export declare const Charge: (props: ChargeProps) => JSX.Element;
11
-
12
- export declare interface ChargeProps {
13
- initQuantity?: number;
14
- }
15
-
16
- export declare const Fireworks: default_2.FC<FireworksProps>;
17
-
18
- export declare interface FireworksProps {
19
- width?: number;
20
- height?: number;
21
- /** 是否自动燃放,默认 true */
22
- auto?: boolean;
23
- }
24
-
25
- export declare const MatrixRain: default_2.FC<MatrixRainProps>;
26
-
27
- export declare interface MatrixRainProps {
28
- width?: number;
29
- height?: number;
30
- /** 列密度 0~1,默认 0.6 */
31
- density?: number;
32
- /** 主色调 */
33
- color?: string;
34
- }
35
-
36
- export declare const NeonText: default_2.FC<NeonTextProps>;
37
-
38
- export declare interface NeonTextProps {
39
- /** 显示文字 */
40
- text?: string;
41
- /** 霓虹主色 */
42
- color?: string;
43
- /** 字号 */
44
- fontSize?: number;
45
- /** 是否闪烁 */
46
- flicker?: boolean;
47
- }
48
-
49
- export declare const ParticleNetwork: default_2.FC<ParticleNetworkProps>;
50
-
51
- export declare interface ParticleNetworkProps {
52
- width?: number;
53
- height?: number;
54
- /** 粒子数量 */
55
- particleCount?: number;
56
- /** 连线距离 */
57
- linkDistance?: number;
58
- /** 粒子颜色 */
59
- color?: string;
60
- }
61
-
62
- export declare const ReturnCity: default_2.FC<ReturnCityProps>;
63
-
64
- export declare interface ReturnCityProps {
65
- shining?: number;
66
- }
67
-
68
- export declare const Turntable: default_2.FC<TurntableProps>;
69
-
70
- export declare interface TurntablePrize {
71
- label: string;
72
- color?: string;
73
- }
74
-
75
- export declare interface TurntableProps {
76
- /** 奖品列表 */
77
- prizes?: TurntablePrize[];
78
- /** 转盘直径,默认 360 */
79
- size?: number;
80
- /** 旋转动画时长(毫秒),默认 4000 */
81
- spinDuration?: number;
82
- /** 旋转圈数,默认 5 */
83
- spinRounds?: number;
84
- /** 抽奖按钮文案 */
85
- buttonText?: string;
86
- /** 旋转结束回调 */
87
- onSpinEnd?: (prize: TurntablePrize, index: number) => void;
88
- }
89
-
90
- export declare const Typewriter: default_2.FC<TypewriterProps>;
91
-
92
- export declare interface TypewriterProps {
93
- /** 轮播文案列表 */
94
- texts?: string[];
95
- /** 打字速度(毫秒/字符) */
96
- speed?: number;
97
- /** 删除速度(毫秒/字符) */
98
- deleteSpeed?: number;
99
- /** 完整展示后的停顿(毫秒) */
100
- pause?: number;
101
- }
102
-
103
- export declare const WaveButton: default_2.FC<WaveButtonProps>;
104
-
105
- export declare interface WaveButtonProps {
106
- /** 按钮文字 */
107
- text?: string;
108
- /** 点击回调 */
109
- onClick?: () => void;
110
- /** 主色 */
111
- color?: string;
112
- }
113
-
114
- export { }
1
+ export * from './components';