cos-design 2.1.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 +46 -0
- package/README.md +41 -3
- package/dist/components/canvasClock/index.d.ts +7 -0
- package/dist/components/charge/index.d.ts +17 -0
- package/dist/components/confetti/index.d.ts +15 -0
- package/dist/components/countdown/index.d.ts +13 -0
- package/dist/components/fireworks/index.d.ts +13 -0
- package/dist/components/flipCounter/index.d.ts +13 -0
- package/dist/components/glitchText/index.d.ts +15 -0
- package/dist/components/index.d.ts +30 -0
- package/dist/components/matrixRain/index.d.ts +11 -0
- package/dist/components/meteorRain/index.d.ts +9 -0
- package/dist/components/neonText/index.d.ts +13 -0
- package/dist/components/particleNetwork/index.d.ts +13 -0
- package/dist/components/returnCity/index.d.ts +11 -0
- package/dist/components/turntable/index.d.ts +21 -0
- package/dist/components/typewriter/index.d.ts +13 -0
- package/dist/components/waveButton/index.d.ts +11 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -114
- package/dist/index.js +852 -428
- package/package.json +34 -29
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,49 @@ 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
|
+
|
|
42
|
+
## [2.2.0] - 2026-06-18
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- React 升级至 19,Vite 升级至 8
|
|
47
|
+
- TypeScript、ESLint 9(flat config)、Stylelint 17 等依赖升级至最新稳定版
|
|
48
|
+
- react-router 升级至 v7
|
|
49
|
+
- 最低 Node.js 版本要求提升至 20
|
|
50
|
+
|
|
8
51
|
## [2.1.0] - 2026-06-18
|
|
9
52
|
|
|
10
53
|
### Added
|
|
@@ -43,5 +86,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
43
86
|
- Webpack 及相关 loader 依赖
|
|
44
87
|
- UMD 格式产物
|
|
45
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
|
|
91
|
+
[2.2.0]: https://github.com/jiaxiantao/cos-design/compare/v2.1.0...v2.2.0
|
|
46
92
|
[2.1.0]: https://github.com/jiaxiantao/cos-design/compare/v2.0.0...v2.1.0
|
|
47
93
|
[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
|
[](https://www.npmjs.com/package/cos-design)
|
|
5
5
|
[](https://github.com/jiaxiantao/cos-design/blob/main/LICENSE)
|
|
6
6
|
|
|
7
|
-
基于 React
|
|
7
|
+
基于 React 19 + Vite 8 + TypeScript 5 的 React 组件库。
|
|
8
8
|
|
|
9
9
|
## 特性
|
|
10
10
|
|
|
@@ -47,10 +47,15 @@ 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
|
|
|
53
|
-
> **要求 Node.js >=
|
|
58
|
+
> **要求 Node.js >= 20**(项目含 `.nvmrc`,推荐使用 Node 22)
|
|
54
59
|
|
|
55
60
|
### 第一步:切换 Node 版本
|
|
56
61
|
|
|
@@ -76,7 +81,7 @@ npm run setup
|
|
|
76
81
|
npx --yes pnpm@9 dev
|
|
77
82
|
```
|
|
78
83
|
|
|
79
|
-
访问 `http://localhost:4000` 进入首页,点击卡片跳转到对应组件演示(共
|
|
84
|
+
访问 `http://localhost:4000` 进入首页,点击卡片跳转到对应组件演示(共 15 个组件)。
|
|
80
85
|
|
|
81
86
|
## 脚本
|
|
82
87
|
|
|
@@ -101,6 +106,39 @@ which pnpm # 确认路径不在 corepack 下
|
|
|
101
106
|
pnpm -v
|
|
102
107
|
```
|
|
103
108
|
|
|
109
|
+
## 自动发布(CI/CD)
|
|
110
|
+
|
|
111
|
+
推送到 `master` 分支后,GitHub Actions 会自动执行 lint、构建,并将**新版本**发布到 [npm](https://www.npmjs.com/package/cos-design)。
|
|
112
|
+
|
|
113
|
+
### 首次配置(仅需一次)
|
|
114
|
+
|
|
115
|
+
1. 打开 [npm Access Tokens](https://www.npmjs.com/settings/jiaxiantao/tokens)
|
|
116
|
+
2. 创建 **Granular Access Token**:
|
|
117
|
+
- Permissions: Packages → **Read and write**
|
|
118
|
+
- 勾选 **Bypass 2FA for publish**(自动化发布必须)
|
|
119
|
+
3. 打开 GitHub 仓库 → **Settings** → **Secrets and variables** → **Actions**
|
|
120
|
+
4. 新建 Secret:`NPM_TOKEN`,值为上一步的 token
|
|
121
|
+
|
|
122
|
+
### 发布新版本
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# 1. 更新 package.json 中的 version(如 2.2.0)
|
|
126
|
+
# 2. 更新 CHANGELOG.md
|
|
127
|
+
# 3. 提交并推送
|
|
128
|
+
git add .
|
|
129
|
+
git commit -m "chore: release v2.2.0"
|
|
130
|
+
git push origin master
|
|
131
|
+
|
|
132
|
+
# 4.(可选)打 tag
|
|
133
|
+
git tag v2.2.0 && git push origin v2.2.0
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
推送后可在 [Actions](https://github.com/jiaxiantao/cos-design/actions) 查看发布进度。若 npm 上已存在相同版本号,会自动跳过发布。
|
|
137
|
+
|
|
138
|
+
## 文档
|
|
139
|
+
|
|
140
|
+
- [完整介绍与实践指南](./docs/cos-design-intro.md) — 项目背景、架构、组件能力与适用场景
|
|
141
|
+
|
|
104
142
|
## 参与贡献
|
|
105
143
|
|
|
106
144
|
欢迎提交 Issue 与 Pull Request,请参阅 [CONTRIBUTING.md](./CONTRIBUTING.md)。
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ChargeProps {
|
|
3
|
+
/** 初始电量(非受控),默认 0 */
|
|
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;
|
|
15
|
+
}
|
|
16
|
+
declare const Charge: (props: ChargeProps) => React.ReactElement;
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FireworksProps {
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
/** 是否自动燃放,默认 true */
|
|
6
|
+
auto?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface FireworksHandle {
|
|
9
|
+
/** 手动燃放烟花,可指定 x 坐标 */
|
|
10
|
+
launch: (x?: number) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const Fireworks: React.ForwardRefExoticComponent<FireworksProps & React.RefAttributes<FireworksHandle>>;
|
|
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;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 Confetti } from './confetti';
|
|
6
|
+
export type { ConfettiHandle, ConfettiProps } from './confetti';
|
|
7
|
+
export { default as Countdown } from './countdown';
|
|
8
|
+
export type { CountdownProps } from './countdown';
|
|
9
|
+
export { default as Fireworks } 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';
|
|
15
|
+
export { default as MatrixRain } from './matrixRain';
|
|
16
|
+
export type { MatrixRainProps } from './matrixRain';
|
|
17
|
+
export { default as MeteorRain } from './meteorRain';
|
|
18
|
+
export type { MeteorRainProps } from './meteorRain';
|
|
19
|
+
export { default as NeonText } from './neonText';
|
|
20
|
+
export type { NeonTextProps } from './neonText';
|
|
21
|
+
export { default as ParticleNetwork } from './particleNetwork';
|
|
22
|
+
export type { ParticleNetworkProps } from './particleNetwork';
|
|
23
|
+
export { default as ReturnCity } from './returnCity';
|
|
24
|
+
export type { ReturnCityProps } from './returnCity';
|
|
25
|
+
export type { TurntablePrize, TurntableProps } from './turntable';
|
|
26
|
+
export { default as Turntable } from './turntable';
|
|
27
|
+
export { default as Typewriter } from './typewriter';
|
|
28
|
+
export type { TypewriterProps } from './typewriter';
|
|
29
|
+
export { default as WaveButton } from './waveButton';
|
|
30
|
+
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,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ReturnCityProps {
|
|
3
|
+
/** 星星数量,默认按屏幕宽度自动计算 */
|
|
4
|
+
starCount?: number;
|
|
5
|
+
/** 光壁数量,默认 6 */
|
|
6
|
+
glassCount?: number;
|
|
7
|
+
/** 光壁半径(px),默认 150 */
|
|
8
|
+
glassRadius?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const ReturnCity: React.FC<ReturnCityProps>;
|
|
11
|
+
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-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{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-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}}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,114 +1 @@
|
|
|
1
|
-
|
|
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';
|