cos-design 3.1.0 → 3.3.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 +27 -0
- package/README.md +34 -27
- package/dist/components/doublePendulum/index.d.ts +10 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/lorenzAttractor/index.d.ts +10 -0
- package/dist/components/metaballPool/index.d.ts +9 -0
- package/dist/components/newtonCradle/index.d.ts +2 -0
- package/dist/components/plasmaBall/index.d.ts +9 -0
- package/dist/components/ropeChain/index.d.ts +10 -0
- package/dist/components/solarSystem/index.d.ts +9 -0
- package/dist/components/weatherBackground/index.d.ts +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1425 -300
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,33 @@ 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
|
+
## [3.3.0] - 2026-07-21
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- 新增 `WeatherBackground` 天气背景组件,支持 15 种天气:大晴天 / 多云 / 阴天 / 小中大雨 / 雷阵雨 / 雾 / 小中大雪 / 雨夹雪 / 冰雹 / 霾 / 大风
|
|
13
|
+
- 雪天使用程序化六重对称冰晶贴图,每片雪花形态各不相同
|
|
14
|
+
- Props 提取脚本自动展开字符串联合类型别名(如 `WeatherType` → `'sunny' | ...`)
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- 配置参数表将长字符串联合类型拆分为可换行标签,默认值列不再强制断词换行
|
|
19
|
+
- `WeatherBackground` 置于背景动效分类首位
|
|
20
|
+
|
|
21
|
+
## [3.2.0] - 2026-06-23
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- 物理创意分类新增 6 个组件:`DoublePendulum`、`PlasmaBall`、`MetaballPool`、`SolarSystem`、`LorenzAttractor`、`RopeChain`
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- `NewtonCradle` 改为 Canvas 单摆物理模拟,碰撞后动量正确传递至对端小球
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- Playground 顶栏搜索图标放大,统计徽章文字居中
|
|
34
|
+
|
|
8
35
|
## [3.1.0] - 2026-06-23
|
|
9
36
|
|
|
10
37
|
### Added
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# cos-design
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**56 个 React 视觉特效组件 · 活动页 / 品牌页 / 创意展示开箱即用**
|
|
6
6
|
|
|
7
7
|
[](https://github.com/jiaxiantao/cos-design/actions/workflows/ci.yml)
|
|
8
8
|
[](https://www.npmjs.com/package/cos-design)
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
| 数据大屏 | 翻牌器、仪表盘、液体进度环 |
|
|
30
30
|
| 创意作品集 | 牛顿摆、DNA 螺旋、迷宫生成 |
|
|
31
31
|
|
|
32
|
-
> 15 个组件太单薄,
|
|
32
|
+
> 15 个组件太单薄,56 个刚好组成一套完整的「视觉工具箱」。
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
@@ -73,24 +73,25 @@ export default function Page() {
|
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
76
|
-
## 组件一览(
|
|
76
|
+
## 组件一览(56 个 · 6 大分类)
|
|
77
77
|
|
|
78
78
|
<details open>
|
|
79
|
-
<summary><strong>背景动效</strong> —
|
|
79
|
+
<summary><strong>背景动效</strong> — 10 个 · 动态场景与粒子背景</summary>
|
|
80
80
|
|
|
81
81
|
<br>
|
|
82
82
|
|
|
83
|
-
| 组件
|
|
84
|
-
|
|
|
85
|
-
| `MatrixRain`
|
|
86
|
-
| `MeteorRain`
|
|
87
|
-
| `ParticleNetwork`
|
|
88
|
-
| `Aurora`
|
|
89
|
-
| `RippleWater`
|
|
90
|
-
| `SmokeFog`
|
|
91
|
-
| `CyberGrid`
|
|
92
|
-
| `Snowfall`
|
|
93
|
-
| `Starfield`
|
|
83
|
+
| 组件 | 说明 |
|
|
84
|
+
| ------------------- | --------------------------------------------------- |
|
|
85
|
+
| `MatrixRain` | 黑客帝国数字雨 |
|
|
86
|
+
| `MeteorRain` | 流星雨穿越 |
|
|
87
|
+
| `ParticleNetwork` | 粒子连线网络(支持触摸) |
|
|
88
|
+
| `Aurora` | 极光渐变光带 |
|
|
89
|
+
| `RippleWater` | 点击水波纹 |
|
|
90
|
+
| `SmokeFog` | 烟雾雾气飘动 |
|
|
91
|
+
| `CyberGrid` | 赛博透视地面 |
|
|
92
|
+
| `Snowfall` | 雪花 / 樱花飘落 |
|
|
93
|
+
| `Starfield` | 3D 纵深星空 |
|
|
94
|
+
| `WeatherBackground` | 天气背景(晴 / 雨 / 雪 / 霾 / 冰雹 / 大风等 15 种) |
|
|
94
95
|
|
|
95
96
|
</details>
|
|
96
97
|
|
|
@@ -168,19 +169,25 @@ export default function Page() {
|
|
|
168
169
|
</details>
|
|
169
170
|
|
|
170
171
|
<details>
|
|
171
|
-
<summary><strong>物理创意</strong> —
|
|
172
|
+
<summary><strong>物理创意</strong> — 13 个 · 物理模拟与视觉实验</summary>
|
|
172
173
|
|
|
173
174
|
<br>
|
|
174
175
|
|
|
175
|
-
| 组件
|
|
176
|
-
|
|
|
177
|
-
| `Fireworks`
|
|
178
|
-
| `ReturnCity`
|
|
179
|
-
| `NewtonCradle`
|
|
180
|
-
| `GravityBalls`
|
|
181
|
-
| `DnaHelix`
|
|
182
|
-
| `ElectricArc`
|
|
183
|
-
| `MazeGenerator`
|
|
176
|
+
| 组件 | 说明 |
|
|
177
|
+
| ----------------- | ------------ |
|
|
178
|
+
| `Fireworks` | 烟花燃放 |
|
|
179
|
+
| `ReturnCity` | 回城传送特效 |
|
|
180
|
+
| `NewtonCradle` | 牛顿摆 |
|
|
181
|
+
| `GravityBalls` | 重力球池 |
|
|
182
|
+
| `DnaHelix` | DNA 双螺旋 |
|
|
183
|
+
| `ElectricArc` | 电弧闪电 |
|
|
184
|
+
| `MazeGenerator` | 迷宫生成器 |
|
|
185
|
+
| `DoublePendulum` | 双摆混沌轨迹 |
|
|
186
|
+
| `PlasmaBall` | 等离子静电球 |
|
|
187
|
+
| `MetaballPool` | 液态融合球 |
|
|
188
|
+
| `SolarSystem` | 太阳系公转 |
|
|
189
|
+
| `LorenzAttractor` | 洛伦兹吸引子 |
|
|
190
|
+
| `RopeChain` | 绳索链条摆动 |
|
|
184
191
|
|
|
185
192
|
</details>
|
|
186
193
|
|
|
@@ -188,7 +195,7 @@ export default function Page() {
|
|
|
188
195
|
|
|
189
196
|
## 特性
|
|
190
197
|
|
|
191
|
-
- **
|
|
198
|
+
- **56 个组件**,覆盖背景、文字、交互、营销、数据、物理六大场景
|
|
192
199
|
- **React 19** + **Vite 8** + **TypeScript 5** 现代技术栈
|
|
193
200
|
- **ESM / CJS** 双格式,完整 `.d.ts` 类型
|
|
194
201
|
- **样式自动注入**,无需 `import 'cos-design/dist/index.css'`
|
|
@@ -209,7 +216,7 @@ npm run setup # 安装依赖(绕过 corepack 问题)
|
|
|
209
216
|
npx --yes pnpm@9 dev # 启动 Playground
|
|
210
217
|
```
|
|
211
218
|
|
|
212
|
-
访问 **http://localhost:4000** — 按分类浏览全部
|
|
219
|
+
访问 **http://localhost:4000** — 按分类浏览全部 56 个组件,右侧可查看与复制示例代码。
|
|
213
220
|
|
|
214
221
|
---
|
|
215
222
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface DoublePendulumProps {
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
trailLength?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
color2?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const DoublePendulum: React.FC<DoublePendulumProps>;
|
|
10
|
+
export default DoublePendulum;
|
|
@@ -26,6 +26,8 @@ export { default as CursorTrail } from './cursorTrail';
|
|
|
26
26
|
export type { CursorTrailProps } from './cursorTrail';
|
|
27
27
|
export { default as DiceRoll } from './diceRoll';
|
|
28
28
|
export type { DiceRollProps } from './diceRoll';
|
|
29
|
+
export { default as DoublePendulum } from './doublePendulum';
|
|
30
|
+
export type { DoublePendulumProps } from './doublePendulum';
|
|
29
31
|
export { default as Fireworks } from './fireworks';
|
|
30
32
|
export type { FireworksHandle, FireworksProps } from './fireworks';
|
|
31
33
|
export { default as FlipCounter } from './flipCounter';
|
|
@@ -40,11 +42,15 @@ export { default as HolographicCard } from './holographicCard';
|
|
|
40
42
|
export type { HolographicCardProps } from './holographicCard';
|
|
41
43
|
export { default as LiquidProgress } from './liquidProgress';
|
|
42
44
|
export type { LiquidProgressProps } from './liquidProgress';
|
|
45
|
+
export { default as LorenzAttractor } from './lorenzAttractor';
|
|
46
|
+
export type { LorenzAttractorProps } from './lorenzAttractor';
|
|
43
47
|
export { default as LiquidGlass } from './liquidGlass';
|
|
44
48
|
export type { LiquidGlassProps } from './liquidGlass';
|
|
45
49
|
export { default as MagneticButton } from './magneticButton';
|
|
46
50
|
export type { MagneticButtonProps } from './magneticButton';
|
|
47
51
|
export { default as MatrixRain } from './matrixRain';
|
|
52
|
+
export { default as MetaballPool } from './metaballPool';
|
|
53
|
+
export type { MetaballPoolProps } from './metaballPool';
|
|
48
54
|
export { default as MazeGenerator } from './mazeGenerator';
|
|
49
55
|
export type { MazeGeneratorProps } from './mazeGenerator';
|
|
50
56
|
export type { MatrixRainProps } from './matrixRain';
|
|
@@ -57,7 +63,11 @@ export type { NeonTextProps } from './neonText';
|
|
|
57
63
|
export { default as OrbitalChart } from './orbitalChart';
|
|
58
64
|
export type { OrbitalChartItem, OrbitalChartProps } from './orbitalChart';
|
|
59
65
|
export { default as ParticleNetwork } from './particleNetwork';
|
|
66
|
+
export { default as PlasmaBall } from './plasmaBall';
|
|
67
|
+
export type { PlasmaBallProps } from './plasmaBall';
|
|
60
68
|
export { default as SmokeFog } from './smokeFog';
|
|
69
|
+
export { default as SolarSystem } from './solarSystem';
|
|
70
|
+
export type { SolarSystemProps } from './solarSystem';
|
|
61
71
|
export type { SmokeFogProps } from './smokeFog';
|
|
62
72
|
export { default as Snowfall } from './snowfall';
|
|
63
73
|
export type { SnowfallProps } from './snowfall';
|
|
@@ -71,6 +81,8 @@ export type { RadarScanProps } from './radarScan';
|
|
|
71
81
|
export { default as RedPacketRain } from './redPacketRain';
|
|
72
82
|
export type { RedPacketRainProps } from './redPacketRain';
|
|
73
83
|
export { default as ReturnCity } from './returnCity';
|
|
84
|
+
export { default as RopeChain } from './ropeChain';
|
|
85
|
+
export type { RopeChainProps } from './ropeChain';
|
|
74
86
|
export { default as Speedometer } from './speedometer';
|
|
75
87
|
export type { SpeedometerProps } from './speedometer';
|
|
76
88
|
export { default as TimelinePulse } from './timelinePulse';
|
|
@@ -94,5 +106,7 @@ export { default as Typewriter } from './typewriter';
|
|
|
94
106
|
export type { TypewriterProps } from './typewriter';
|
|
95
107
|
export { default as WaveButton } from './waveButton';
|
|
96
108
|
export type { WaveButtonProps } from './waveButton';
|
|
109
|
+
export { default as WeatherBackground } from './weatherBackground';
|
|
110
|
+
export type { WeatherBackgroundProps, WeatherType } from './weatherBackground';
|
|
97
111
|
export { default as WaveText } from './waveText';
|
|
98
112
|
export type { WaveTextProps } from './waveText';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface LorenzAttractorProps {
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
speed?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
pointCount?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const LorenzAttractor: React.FC<LorenzAttractorProps>;
|
|
10
|
+
export default LorenzAttractor;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type WeatherType = 'sunny' | 'partlyCloudy' | 'overcast' | 'lightRain' | 'moderateRain' | 'heavyRain' | 'thunderstorm' | 'fog' | 'lightSnow' | 'moderateSnow' | 'heavySnow' | 'sleet' | 'hail' | 'smog' | 'gale'
|
|
3
|
+
/** @deprecated 请使用 moderateSnow */
|
|
4
|
+
| 'snow';
|
|
5
|
+
export interface WeatherBackgroundProps {
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
/** 天气类型:sunny 大晴天 / partlyCloudy 多云 / overcast 阴天 / lightRain 小雨 / moderateRain 中雨 / heavyRain 大雨 / thunderstorm 雷阵雨 / fog 雾 / lightSnow 小雪 / moderateSnow 中雪 / heavySnow 大雪 / sleet 雨夹雪 / hail 冰雹 / smog 霾 / gale 大风 */
|
|
9
|
+
weather?: WeatherType;
|
|
10
|
+
}
|
|
11
|
+
declare const WeatherBackground: React.FC<WeatherBackgroundProps>;
|
|
12
|
+
export default WeatherBackground;
|