use-scroll-animate 5.4.0 → 5.5.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 +10 -0
- package/dist/components/effects.cjs +296 -0
- package/dist/components/effects.cjs.map +1 -1
- package/dist/components/effects.d.cts +45 -2
- package/dist/components/effects.d.ts +45 -2
- package/dist/components/effects.js +292 -1
- package/dist/components/effects.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/docs/ROADMAP.md +1 -1
- package/docs/components.md +16 -0
- package/package.json +1 -1
package/docs/ROADMAP.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
- ✅ **v5.2** — 弹跳与物理微交互:弹入、橡皮筋、弹性悬停、掉落回弹、重力文字、弹簧跟随指针、摇摆铃铛。
|
|
7
7
|
- ✅ **v5.3** — 全页特效:幕布、光圈擦除、像素溶解、百叶窗转场、滚动速度倾斜、全页聚光灯、页面边缘光晕。
|
|
8
8
|
- ✅ **v5.4** — 滚动叙事模板:`<usa-story>` —— 固定章节、横向长廊、缩放穿越、前后对比滑块、数据故事计数器、逐段高亮。
|
|
9
|
-
- **v5.5** — 生成式背景:流场、Voronoi 细胞、网格渐变(mesh gradient)、星空、metaballs、等高线 —— Canvas 2D 实现,可见时才渲染,自适应质量。
|
|
9
|
+
- ✅ **v5.5** — 生成式背景:流场、Voronoi 细胞、网格渐变(mesh gradient)、星空、metaballs、等高线 —— Canvas 2D 实现,可见时才渲染,自适应质量。
|
|
10
10
|
- **v5.6** — 声音响应特效:Web Audio 分析器驱动频谱柱、脉冲光环、波形环,节拍检测可触发任意已注册效果(需用户手势开启,减少动态效果时停用)。
|
|
11
11
|
- **v5.7** — 光标与手势包:彗星拖尾、星光、丝带、磁吸点、聚光光标;甩动、双指旋转、长按蓄力手势 → 触发效果。
|
|
12
12
|
- **v5.8** — 主题包与微交互库:霓虹、纸张、玻璃、复古、粗野主义主题包(令牌 + 效果预设);复制成功、开关变形、输入抖动、密码显隐、收藏星星、下载进度等 20+ 微交互。
|
package/docs/components.md
CHANGED
|
@@ -400,6 +400,22 @@ defineStory();
|
|
|
400
400
|
|
|
401
401
|
Templates `pin` · `gallery` · `zoom` (`zoom="6"`) · `compare` · `counter` · `highlight`. Each sets `--usa-story-progress`, fires `usa-story-step`, and exposes `progress`, `step`, `update()`. Reduced motion: no sliding / zooming, final counter values. Demo: `showcase/story.html`.
|
|
402
402
|
|
|
403
|
+
### v5.5 Generative backgrounds (`components/effects`)
|
|
404
|
+
|
|
405
|
+
`flow-field` · `voronoi` · `mesh-gradient` · `starfield` · `metaballs` · `contours` (kind `background`) — Canvas 2D behind the element’s content, rendering only while visible, with adaptive quality; reduced motion draws one static frame.
|
|
406
|
+
|
|
407
|
+
```html
|
|
408
|
+
<usa-fx effect="mesh-gradient" trigger="load" self class="hero" options='{"colors":["#7c5cff","#ff5c8a","#22d3ee"],"speed":0.6}'>
|
|
409
|
+
<h1>Hello</h1>
|
|
410
|
+
</usa-fx>
|
|
411
|
+
```
|
|
412
|
+
```js
|
|
413
|
+
import { registerEffect } from 'use-scroll-animate/components/fx';
|
|
414
|
+
import { canvasBackground } from 'use-scroll-animate/components/effects';
|
|
415
|
+
registerEffect({ name: 'pulse-bg', kind: 'background', reduced: 'run',
|
|
416
|
+
run: (el, o, ctx) => canvasBackground(el, ctx, { draw: ({ ctx: g, w, h, t }) => { g.fillStyle = `hsl(${t * 40} 70% 50%)`; g.fillRect(0, 0, w, h); } }, o) });
|
|
417
|
+
```
|
|
418
|
+
|
|
403
419
|
## Frameworks
|
|
404
420
|
|
|
405
421
|
Custom elements work in every framework. Register once (e.g. in your entry file), then use the tags.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "use-scroll-animate",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "A lightweight, high-performance, dependency-free scroll animation library and animated UI components (Web Components) for the web and Windows web-view apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|