use-scroll-animate 5.9.0 → 6.0.1

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +3 -2
  3. package/README_ja.md +1 -0
  4. package/README_zh.md +2 -1
  5. package/dist/components/angular.d.cts +5 -4
  6. package/dist/components/angular.d.ts +5 -4
  7. package/dist/components/click.cjs +2 -23
  8. package/dist/components/click.cjs.map +1 -1
  9. package/dist/components/click.d.cts +3 -13
  10. package/dist/components/click.d.ts +3 -13
  11. package/dist/components/click.js +11 -29
  12. package/dist/components/click.js.map +1 -1
  13. package/dist/components/lite.cjs +19 -41
  14. package/dist/components/lite.cjs.map +1 -1
  15. package/dist/components/lite.js +20 -39
  16. package/dist/components/lite.js.map +1 -1
  17. package/dist/components/page.cjs +6 -7
  18. package/dist/components/page.cjs.map +1 -1
  19. package/dist/components/page.css +1 -1
  20. package/dist/components/page.d.cts +4 -3
  21. package/dist/components/page.d.ts +4 -3
  22. package/dist/components/page.js +7 -8
  23. package/dist/components/page.js.map +1 -1
  24. package/dist/components/solid.d.cts +5 -4
  25. package/dist/components/solid.d.ts +5 -4
  26. package/dist/components/svelte.d.cts +5 -4
  27. package/dist/components/svelte.d.ts +5 -4
  28. package/dist/components/vue.d.cts +5 -4
  29. package/dist/components/vue.d.ts +5 -4
  30. package/dist/components.cjs +0 -3
  31. package/dist/components.cjs.map +1 -1
  32. package/dist/components.css +1 -1
  33. package/dist/components.d.cts +7 -16
  34. package/dist/components.d.ts +7 -16
  35. package/dist/components.js +1 -1
  36. package/dist/components.umd.js +2 -2
  37. package/dist/components.umd.js.map +1 -1
  38. package/docs/ROADMAP.md +12 -12
  39. package/docs/components.md +3 -3
  40. package/docs/performance.md +1 -1
  41. package/docs/upgrading-6.md +1 -1
  42. package/package.json +1 -1
package/docs/ROADMAP.md CHANGED
@@ -1,14 +1,14 @@
1
- # 路线图(5.0 之后)
1
+ # 路线图(6.0 之后)
2
2
 
3
- > 5.0.0:现代浏览器基线(Custom Elements、WAAPI、IntersectionObserver、ResizeObserver、adoptedStyleSheets),移除 4.9 弃用的 API,新增统一的插件式效果注册(`registerEffect()` / `playEffect()` / `<usa-fx>`)。以下为 5.x → 6.0 的规划,每个版本一个 PR;新效果全部通过注册表提供,集中在新入口 `use-scroll-animate/components/effects`(不计入 `components/lite` 的 70 KB 预算)。
3
+ > 6.0.0:移除 5.9 弃用的 API(`burst()` / `confetti()` / `shake()`、`<usa-cursor mode="trail">`),所有效果统一通过注册表(`registerEffect()` / `playEffect()` / `<usa-fx>`)提供。以下为 6.x → 7.0 的规划,每个版本一个 PR;新效果继续集中在 `use-scroll-animate/components/effects`(`components/lite` 维持 70 KB 预算),全部兼容“减少动态效果”。
4
4
 
5
- - ✅ **v5.1** — 卡片与点击特效 2.0:全息镭射卡、扫光、3D 翻书、磁吸卡组、卡片倾倒;点击冲击波环、墨水飞溅、星星爆裂、果冻按压、涟漪环 —— 全部可用 `<usa-fx>` 触发。
6
- - ✅ **v5.2** — 弹跳与物理微交互:弹入、橡皮筋、弹性悬停、掉落回弹、重力文字、弹簧跟随指针、摇摆铃铛。
7
- - ✅ **v5.3** — 全页特效:幕布、光圈擦除、像素溶解、百叶窗转场、滚动速度倾斜、全页聚光灯、页面边缘光晕。
8
- - ✅ **v5.4** — 滚动叙事模板:`<usa-story>` —— 固定章节、横向长廊、缩放穿越、前后对比滑块、数据故事计数器、逐段高亮。
9
- - ✅ **v5.5** — 生成式背景:流场、Voronoi 细胞、网格渐变(mesh gradient)、星空、metaballs、等高线 —— Canvas 2D 实现,可见时才渲染,自适应质量。
10
- - ✅ **v5.6** — 声音响应特效:Web Audio 分析器驱动频谱柱、脉冲光环、波形环,节拍检测可触发任意已注册效果(需用户手势开启,减少动态效果时停用)。
11
- - ✅ **v5.7** — 光标与手势包:彗星拖尾、星光、丝带、磁吸点、聚光光标;甩动、双指旋转、长按蓄力手势 → 触发效果。
12
- - ✅ **v5.8** — 主题包与微交互库:霓虹、纸张、玻璃、复古、粗野主义主题包(令牌 + 效果预设);复制成功、开关变形、输入抖动、密码显隐、收藏星星、下载进度等 20+ 微交互。
13
- - ✅ **v5.9** — JSON 动画播放器 + 6.0 预备:`<usa-player>` 播放 JSON 动画(关键帧轨道 + 已注册效果,可由实验室导出);标记 6.0 将移除的 API 并输出一次性警告,发布 `upgrading-6.md` 与 `usa-codemod-6`。
14
- - **v6.0** — 破坏性清理:移除 5.9 弃用的 API,效果统一走注册表,迁移指南与自动迁移脚本,npm `latest`。
5
+ - **v6.1** — 粒子与流体 2.0:GPU 流体模拟背景、烟雾与火焰、墨滴扩散、萤火虫群、樱花与落叶飘散、点击溅起水花 —— WebGL2 实现,自动降级到 Canvas 2D。
6
+ - **v6.2** — 文字特效 3.0:液态文字、霓虹描边书写、文字粒子化聚散、故障(glitch)字、打字机光标拖影、可变字体呼吸、逐字 3D 翻转。
7
+ - **v6.3** — 光影与材质:动态光源投影、玻璃折射、金属拉丝反光、珠光 / 镭射材质、体积光(god rays)、跟随指针的实时阴影。
8
+ - **v6.4** — 3D 场景卡片:视差层叠景深卡、可旋转 3D 商品展示、立方体翻转画廊、折纸展开、轨道相机滚动叙事 —— CSS 3D 为主,可选 WebGL。
9
+ - **v6.5** — 形变与 SVG 2.0:路径自动补间形变、液态 blob 按钮、描边绘制动画、SVG 滤镜(湍流、置换)扭曲转场、图标一键变形。
10
+ - **v6.6** — 转场大全:涟漪溶解、碎片爆裂、马赛克翻牌、液体擦除、卷页、镜头推拉 —— View Transitions 优先,多页(MPA)同样可用。
11
+ - **v6.7** — 天气与氛围:雨滴打在玻璃上、雪花堆积、雷电闪光(限频的安全闪烁)、雾气、极光、随时间变化的昼夜光照。
12
+ - **v6.8** — 交互物理 2.0:可拖拽的软体与布料、绳索与链条、磁力吸附排列、碰撞弹球、重力翻转页面 —— 轻量 Verlet 求解器。
13
+ - **v6.9** — 7.0 预备:动画编辑器 2.0(曲线编辑、`<usa-player>` 关键帧录制)、效果市场清单格式;标记 7.0 将移除的 API 并输出一次性警告,发布 `upgrading-7.md` 与 `usa-codemod-7`。
14
+ - **v7.0** — 破坏性清理:移除 6.9 弃用的 API,效果包按需拆分入口,WebGPU 渲染后端(WebGL2 回退),迁移指南与自动迁移脚本,npm `latest`。
@@ -40,7 +40,7 @@ defineTypewriter();
40
40
  No build step (registers every `<usa-*>` and exposes the API as `window.UsaComponents`):
41
41
 
42
42
  ```html
43
- <script src="https://unpkg.com/use-scroll-animate@5/dist/components.umd.js"></script>
43
+ <script src="https://unpkg.com/use-scroll-animate@6/dist/components.umd.js"></script>
44
44
  <usa-typewriter words="Hello, Windows.|Hello, web."></usa-typewriter>
45
45
  <script>UsaComponents.toast('Ready', { type: 'success' });</script>
46
46
  ```
@@ -151,7 +151,7 @@ Presets (`SPRING_PRESETS`): `default` (170/26), `gentle` (120/14), `wobbly` (180
151
151
  | `<usa-hold>` | Hold-to-confirm ring | `duration` (1200), `label`, `color`, `haptic` | `progress`, `cancel()`; `usa:progress`, `usa:confirm`, `usa:cancel`; `--usa-hold` |
152
152
  | `<usa-double-tap>` | Double tap → heart at the point | `icon` (♥), `color`, `delay` (300), `haptic` | `pop(x?, y?)`; `usa:double-tap` |
153
153
  | `<usa-checkbox>` | Animated form-associated checkbox | `checked`, `indeterminate`, `name`, `value`, `label`, `shape` (`circle`) | `checked`, `toggle()`; `change`, `usa:change` |
154
- | `burst()` · `confetti()` · `shake()` · `haptic()` | The click-effect engine as functions | — | particles skip under reduced motion |
154
+ | `haptic()` · `playEffect(el, 'burst' \| 'confetti' \| 'shake', …)` | Haptics; the click effects from code go through the effect registry (6.0 removed `burst()` / `confetti()` / `shake()`) | — | particles skip under reduced motion |
155
155
 
156
156
  ### 10. UI components & variants — `components/ui`
157
157
 
@@ -180,7 +180,7 @@ Presets (`SPRING_PRESETS`): `default` (170/26), `gentle` (120/14), `wobbly` (180
180
180
  | `pageTransition(update, opts)` | SPA page transition (View Transitions) | `effect` (`fade` · `slide` · `slide-left` · `slide-right` · `slide-up` · `circle` · `blinds` · `pixel` · `zoom`), `x`, `y`, `duration`, `fallback` | Promise |
181
181
  | `enableMpaTransitions(effect)` | Cross-document (MPA) transitions | effect, duration | — |
182
182
  | `themeTransition(apply, { x, y })` | Circle-reveal theme switch | — | Promise |
183
- | `<usa-cursor>` | Custom cursor | `mode` (`dot` · `trail` · `magnetic` · `glow`), `color`, `size`, `hide-native`, `targets` | `active` |
183
+ | `<usa-cursor>` | Custom cursor | `mode` (`dot` · `magnetic` · `glow`; 6.0 removed `trail` → `comet-trail` effect), `color`, `size`, `hide-native`, `targets` | `active` |
184
184
  | `smoothScroll(opts)` · `scrollToTarget(to, opts)` | Wheel smoothing · spring scroll-to | `target`, `lerp` (0.12), `wheelMultiplier` · `offset`, `preset` | returns stop fn · Promise |
185
185
  | `<usa-fullpage>` | Full-screen snapping sections | `dots`, `axis` (`y` · `x`) | `index`, `go(i)`, `next()`, `prev()`; `usa:section` |
186
186
  | `<usa-loading-bar>` · `loadingBar` | Top loading bar | `color`, `height` (3), `position` | `start()`, `set(p)`, `done()`, `track(promise)` |
@@ -21,4 +21,4 @@ Same API as `use-scroll-animate/components`, but the light-DOM CSS is **not** in
21
21
  | `use-scroll-animate/components` (everything, CSS inlined) | ≈ 79 KB |
22
22
  | `use-scroll-animate/components/lite` (everything, CSS on demand) | **≈ 62 KB** (budget 70 KB, checked in CI) |
23
23
 
24
- Serve the CSS from somewhere else with `onDemandStyles('https://cdn.example/use-scroll-animate@5/dist/')`, or preload with `loadCategoryStyles('cards', base)`.
24
+ Serve the CSS from somewhere else with `onDemandStyles('https://cdn.example/use-scroll-animate@6/dist/')`, or preload with `loadCategoryStyles('cards', base)`.
@@ -1,6 +1,6 @@
1
1
  # Upgrading to 6.0
2
2
 
3
- 5.9 **warns once in the console** for everything below, and a codemod rewrites most of it:
3
+ 6.0.0 is released. 5.9 **warned once in the console** for everything below, and a codemod rewrites most of it:
4
4
 
5
5
  ```sh
6
6
  npx usa-codemod-6 src # dry run: lists every change (and what needs a manual edit)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-scroll-animate",
3
- "version": "5.9.0",
3
+ "version": "6.0.1",
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",