use-scroll-animate 9.4.0 → 9.6.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 +28 -0
- package/dist/components/fx-perf.cjs +161 -0
- package/dist/components/fx-perf.cjs.map +1 -0
- package/dist/components/fx-perf.d.cts +86 -0
- package/dist/components/fx-perf.d.ts +86 -0
- package/dist/components/fx-perf.js +155 -0
- package/dist/components/fx-perf.js.map +1 -0
- package/dist/components/fx-safe.cjs +155 -0
- package/dist/components/fx-safe.cjs.map +1 -0
- package/dist/components/fx-safe.d.cts +85 -0
- package/dist/components/fx-safe.d.ts +85 -0
- package/dist/components/fx-safe.js +145 -0
- package/dist/components/fx-safe.js.map +1 -0
- package/dist/components/fx2.cjs +20 -0
- package/dist/components/fx2.cjs.map +1 -1
- package/dist/components/fx2.d.cts +82 -1
- package/dist/components/fx2.d.ts +82 -1
- package/dist/components/fx2.js +9 -1
- package/dist/components/fx2.js.map +1 -1
- package/dist/components/marketplace.cjs +2 -0
- package/dist/components/marketplace.cjs.map +1 -1
- package/dist/components/marketplace.js +2 -0
- package/dist/components/marketplace.js.map +1 -1
- package/dist/components/widgets.cjs +445 -181
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +123 -2
- package/dist/components/widgets.d.ts +123 -2
- package/dist/components/widgets.js +442 -183
- package/dist/components/widgets.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +2 -2
- package/docs/components.md +33 -0
- package/package.json +42 -2
package/docs/ROADMAP.md
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
- ✅ **v9.2** — Lottie / Rive 导入(JSON → 动效时间线);新组件 动画图标集。
|
|
7
7
|
- ✅ **v9.3** — 生成艺术 2.0:风格化着色器;新组件 背景生成器。
|
|
8
8
|
- ✅ **v9.4** — 视频动效:滚动驱动视频、帧序列;新组件 视频卡片、英雄视频。
|
|
9
|
-
- **v9.5** — 无障碍动效 2.0:更细的动效偏好分级;新组件 动效偏好面板。
|
|
10
|
-
- **v9.6** — 性能 3.0:OffscreenCanvas、Worker 渲染;新组件 性能监视器。
|
|
9
|
+
- ✅ **v9.5** — 无障碍动效 2.0:更细的动效偏好分级;新组件 动效偏好面板。
|
|
10
|
+
- ✅ **v9.6** — 性能 3.0:OffscreenCanvas、Worker 渲染;新组件 性能监视器。
|
|
11
11
|
- **v9.7** — 设计工具集成:Figma 插件脚手架、Framer 导出。
|
|
12
12
|
- **v9.8** — 原生 2.0:React Native / Flutter 组件示例。
|
|
13
13
|
- **v9.9** — 10.0 预备:10.0 弃用警告、`upgrading-10.md` 与 `usa-codemod-10`。
|
package/docs/components.md
CHANGED
|
@@ -1239,6 +1239,39 @@ frameSequence(canvas, { count: 120, src: (i) => `/frames/${String(i).padStart(4,
|
|
|
1239
1239
|
- `<usa-hero-video label poster scrub>`: `paused`, `toggle()`; `usa:play`, `usa:pause`.
|
|
1240
1240
|
- Video: `scrubVideo`, `frameSequence`, `scrollProgress`; effects `film-burn` (`color`), `jump-cut`.
|
|
1241
1241
|
|
|
1242
|
+
### v9.5 Accessible motion 2.0: `<usa-motion-prefs>`, `<usa-pause-all>` + safe pack (`motionary/fx/safe`)
|
|
1243
|
+
|
|
1244
|
+
```html
|
|
1245
|
+
<usa-pause-all></usa-pause-all>
|
|
1246
|
+
<usa-motion-prefs></usa-motion-prefs>
|
|
1247
|
+
<usa-fx effect="focus-glow" trigger="click"><button>Notice me</button></usa-fx>
|
|
1248
|
+
```
|
|
1249
|
+
```js
|
|
1250
|
+
import { applyMotionPreferences, loadMotionPreferences, vestibularSafe, isFlashSafe } from 'motionary/fx/safe';
|
|
1251
|
+
applyMotionPreferences(loadMotionPreferences()); // restore the user's choice on load
|
|
1252
|
+
el.animate(vestibularSafe(frames), 400); // a movement-free twin
|
|
1253
|
+
console.assert(isFlashSafe(frames, 600, Infinity));
|
|
1254
|
+
```
|
|
1255
|
+
- `<usa-motion-prefs label>`: `prefs`, `reset()`; `usa:change` { prefs }.
|
|
1256
|
+
- `<usa-pause-all label resume-label scope>`: `paused`, `toggle()`; `usa:pause-all` { paused }.
|
|
1257
|
+
- Safe: `safe-fade` · `focus-glow` · `color-pulse` (`color`) · `underline-sweep`; `vestibularSafe`, `flashCount`, `isFlashSafe`, `applyMotionPreferences`, `loadMotionPreferences`.
|
|
1258
|
+
|
|
1259
|
+
### v9.6 Performance 3.0: `<usa-perf-monitor>`, `<usa-worker-canvas>` + perf pack (`motionary/fx/perf`)
|
|
1260
|
+
|
|
1261
|
+
```html
|
|
1262
|
+
<usa-perf-monitor corner="bottom-right"></usa-perf-monitor>
|
|
1263
|
+
<usa-worker-canvas scene="starfield" style="height:240px"></usa-worker-canvas>
|
|
1264
|
+
```
|
|
1265
|
+
```js
|
|
1266
|
+
import { offscreenRender, runInWorker, fpsMeter } from 'motionary/fx/perf';
|
|
1267
|
+
const r = offscreenRender(canvas, (ctx, t, w, h) => { ctx.clearRect(0, 0, w, h); ctx.fillRect((t / 5) % w, h / 2, 8, 8); });
|
|
1268
|
+
console.log(r.backend); // 'worker' when OffscreenCanvas is available
|
|
1269
|
+
const primes = await runInWorker((n) => { /* heavy */ return n * 2; }, 21);
|
|
1270
|
+
```
|
|
1271
|
+
- `<usa-perf-monitor corner collapsed warn>`: `stats`; `usa:jank` { fps }.
|
|
1272
|
+
- `<usa-worker-canvas scene label>`: `program`, `backend`; `usa:backend`.
|
|
1273
|
+
- Perf: `offscreenRender`, `runInWorker`, `fpsMeter`; effects `idle-reveal` (`timeout`), `gpu-lift` (`lift`).
|
|
1274
|
+
|
|
1242
1275
|
## Frameworks
|
|
1243
1276
|
|
|
1244
1277
|
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": "9.
|
|
3
|
+
"version": "9.6.0",
|
|
4
4
|
"description": "Compatibility alias of motionary (same build). The project was renamed to Motionary — install `motionary` instead. Motionary (formerly use-scroll-animate): dependency-free scroll animations + 94 animated Web Components — 214 scroll-reveal presets, card/click/button morphs, physics, page transitions, generative & sound-reactive backgrounds, cursor/gesture effects, themes, micro-interactions, <usa-player>, WebGL. React, Vue, Svelte, Solid, Angular or plain HTML.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -428,6 +428,26 @@
|
|
|
428
428
|
"default": "./dist/components/fx-video.cjs"
|
|
429
429
|
}
|
|
430
430
|
},
|
|
431
|
+
"./fx/safe": {
|
|
432
|
+
"import": {
|
|
433
|
+
"types": "./dist/components/fx-safe.d.ts",
|
|
434
|
+
"default": "./dist/components/fx-safe.js"
|
|
435
|
+
},
|
|
436
|
+
"require": {
|
|
437
|
+
"types": "./dist/components/fx-safe.d.cts",
|
|
438
|
+
"default": "./dist/components/fx-safe.cjs"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
"./fx/perf": {
|
|
442
|
+
"import": {
|
|
443
|
+
"types": "./dist/components/fx-perf.d.ts",
|
|
444
|
+
"default": "./dist/components/fx-perf.js"
|
|
445
|
+
},
|
|
446
|
+
"require": {
|
|
447
|
+
"types": "./dist/components/fx-perf.d.cts",
|
|
448
|
+
"default": "./dist/components/fx-perf.cjs"
|
|
449
|
+
}
|
|
450
|
+
},
|
|
431
451
|
"./components/reveal": {
|
|
432
452
|
"import": {
|
|
433
453
|
"types": "./dist/components/reveal.d.ts",
|
|
@@ -1078,6 +1098,26 @@
|
|
|
1078
1098
|
"default": "./dist/components/fx-video.cjs"
|
|
1079
1099
|
}
|
|
1080
1100
|
},
|
|
1101
|
+
"./components/fx-safe": {
|
|
1102
|
+
"import": {
|
|
1103
|
+
"types": "./dist/components/fx-safe.d.ts",
|
|
1104
|
+
"default": "./dist/components/fx-safe.js"
|
|
1105
|
+
},
|
|
1106
|
+
"require": {
|
|
1107
|
+
"types": "./dist/components/fx-safe.d.cts",
|
|
1108
|
+
"default": "./dist/components/fx-safe.cjs"
|
|
1109
|
+
}
|
|
1110
|
+
},
|
|
1111
|
+
"./components/fx-perf": {
|
|
1112
|
+
"import": {
|
|
1113
|
+
"types": "./dist/components/fx-perf.d.ts",
|
|
1114
|
+
"default": "./dist/components/fx-perf.js"
|
|
1115
|
+
},
|
|
1116
|
+
"require": {
|
|
1117
|
+
"types": "./dist/components/fx-perf.d.cts",
|
|
1118
|
+
"default": "./dist/components/fx-perf.cjs"
|
|
1119
|
+
}
|
|
1120
|
+
},
|
|
1081
1121
|
"./components/lite": {
|
|
1082
1122
|
"import": {
|
|
1083
1123
|
"types": "./dist/components/lite.d.ts",
|
|
@@ -1127,7 +1167,7 @@
|
|
|
1127
1167
|
"./dist/presets-extended.umd.js"
|
|
1128
1168
|
],
|
|
1129
1169
|
"scripts": {
|
|
1130
|
-
"build": "npm run clean && node --max-old-space-size=
|
|
1170
|
+
"build": "npm run clean && node --max-old-space-size=6144 ./node_modules/rollup/dist/bin/rollup -c rollup.config.mjs",
|
|
1131
1171
|
"dev": "rollup -c rollup.config.mjs -w",
|
|
1132
1172
|
"typecheck": "tsc --noEmit -p .",
|
|
1133
1173
|
"test": "vitest run",
|