use-scroll-animate 9.3.0 → 9.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 +28 -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/fx-video.cjs +111 -0
- package/dist/components/fx-video.cjs.map +1 -0
- package/dist/components/fx-video.d.cts +80 -0
- package/dist/components/fx-video.d.ts +80 -0
- package/dist/components/fx-video.js +105 -0
- package/dist/components/fx-video.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 +76 -1
- package/dist/components/fx2.d.ts +76 -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 +483 -181
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +94 -2
- package/dist/components/widgets.d.ts +94 -2
- package/dist/components/widgets.js +480 -182
- 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 +35 -0
- package/package.json +42 -2
package/docs/ROADMAP.md
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
- ✅ **v9.1** — 电影化叙事 2.0:镜头语言(推拉摇移、景深切换、转场);新组件 章节导航。
|
|
6
6
|
- ✅ **v9.2** — Lottie / Rive 导入(JSON → 动效时间线);新组件 动画图标集。
|
|
7
7
|
- ✅ **v9.3** — 生成艺术 2.0:风格化着色器;新组件 背景生成器。
|
|
8
|
-
- **v9.4** — 视频动效:滚动驱动视频、帧序列;新组件 视频卡片、英雄视频。
|
|
9
|
-
- **v9.5** — 无障碍动效 2.0:更细的动效偏好分级;新组件 动效偏好面板。
|
|
8
|
+
- ✅ **v9.4** — 视频动效:滚动驱动视频、帧序列;新组件 视频卡片、英雄视频。
|
|
9
|
+
- ✅ **v9.5** — 无障碍动效 2.0:更细的动效偏好分级;新组件 动效偏好面板。
|
|
10
10
|
- **v9.6** — 性能 3.0:OffscreenCanvas、Worker 渲染;新组件 性能监视器。
|
|
11
11
|
- **v9.7** — 设计工具集成:Figma 插件脚手架、Framer 导出。
|
|
12
12
|
- **v9.8** — 原生 2.0:React Native / Flutter 组件示例。
|
package/docs/components.md
CHANGED
|
@@ -1221,6 +1221,41 @@ hero.style.background = meshGradient(42, 'forest');
|
|
|
1221
1221
|
- `<usa-bg-generator palette style seed label>`: `css`, `shuffle()`, `copy()`; `usa:change`; `backgroundCss(style, seed, palette)`.
|
|
1222
1222
|
- Genart: `halftone-in` (`dot`) · `mesh-drift` (`seed`, `palette`) · `kaleido` (`color`, `segments`) · `grain-flicker` (`opacity`); `PALETTES`, `seededRandom`, `meshGradient`.
|
|
1223
1223
|
|
|
1224
|
+
### v9.4 Video motion (`motionary/fx/video`): `<usa-video-card>`, `<usa-hero-video>`
|
|
1225
|
+
|
|
1226
|
+
```html
|
|
1227
|
+
<usa-hero-video label="Welcome" poster="poster.jpg">
|
|
1228
|
+
<video src="hero.mp4" autoplay muted loop playsinline></video>
|
|
1229
|
+
<h1>Motion, declared.</h1>
|
|
1230
|
+
</usa-hero-video>
|
|
1231
|
+
<usa-video-card duration="2:41"><img src="poster.jpg" alt=""><video src="preview.mp4"></video><h3>Making of</h3></usa-video-card>
|
|
1232
|
+
```
|
|
1233
|
+
```js
|
|
1234
|
+
import { scrubVideo, frameSequence } from 'motionary/fx/video';
|
|
1235
|
+
scrubVideo(document.querySelector('#product-video'), document.querySelector('#product'));
|
|
1236
|
+
frameSequence(canvas, { count: 120, src: (i) => `/frames/${String(i).padStart(4, '0')}.webp` }, section);
|
|
1237
|
+
```
|
|
1238
|
+
- `<usa-video-card duration label>`: `previewing`; `usa:open` { src }.
|
|
1239
|
+
- `<usa-hero-video label poster scrub>`: `paused`, `toggle()`; `usa:play`, `usa:pause`.
|
|
1240
|
+
- Video: `scrubVideo`, `frameSequence`, `scrollProgress`; effects `film-burn` (`color`), `jump-cut`.
|
|
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
|
+
|
|
1224
1259
|
## Frameworks
|
|
1225
1260
|
|
|
1226
1261
|
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.5.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",
|
|
@@ -418,6 +418,26 @@
|
|
|
418
418
|
"default": "./dist/components/fx-genart.cjs"
|
|
419
419
|
}
|
|
420
420
|
},
|
|
421
|
+
"./fx/video": {
|
|
422
|
+
"import": {
|
|
423
|
+
"types": "./dist/components/fx-video.d.ts",
|
|
424
|
+
"default": "./dist/components/fx-video.js"
|
|
425
|
+
},
|
|
426
|
+
"require": {
|
|
427
|
+
"types": "./dist/components/fx-video.d.cts",
|
|
428
|
+
"default": "./dist/components/fx-video.cjs"
|
|
429
|
+
}
|
|
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
|
+
},
|
|
421
441
|
"./components/reveal": {
|
|
422
442
|
"import": {
|
|
423
443
|
"types": "./dist/components/reveal.d.ts",
|
|
@@ -1058,6 +1078,26 @@
|
|
|
1058
1078
|
"default": "./dist/components/fx-genart.cjs"
|
|
1059
1079
|
}
|
|
1060
1080
|
},
|
|
1081
|
+
"./components/fx-video": {
|
|
1082
|
+
"import": {
|
|
1083
|
+
"types": "./dist/components/fx-video.d.ts",
|
|
1084
|
+
"default": "./dist/components/fx-video.js"
|
|
1085
|
+
},
|
|
1086
|
+
"require": {
|
|
1087
|
+
"types": "./dist/components/fx-video.d.cts",
|
|
1088
|
+
"default": "./dist/components/fx-video.cjs"
|
|
1089
|
+
}
|
|
1090
|
+
},
|
|
1091
|
+
"./components/fx-safe": {
|
|
1092
|
+
"import": {
|
|
1093
|
+
"types": "./dist/components/fx-safe.d.ts",
|
|
1094
|
+
"default": "./dist/components/fx-safe.js"
|
|
1095
|
+
},
|
|
1096
|
+
"require": {
|
|
1097
|
+
"types": "./dist/components/fx-safe.d.cts",
|
|
1098
|
+
"default": "./dist/components/fx-safe.cjs"
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1061
1101
|
"./components/lite": {
|
|
1062
1102
|
"import": {
|
|
1063
1103
|
"types": "./dist/components/lite.d.ts",
|
|
@@ -1107,7 +1147,7 @@
|
|
|
1107
1147
|
"./dist/presets-extended.umd.js"
|
|
1108
1148
|
],
|
|
1109
1149
|
"scripts": {
|
|
1110
|
-
"build": "npm run clean && node --max-old-space-size=
|
|
1150
|
+
"build": "npm run clean && node --max-old-space-size=6144 ./node_modules/rollup/dist/bin/rollup -c rollup.config.mjs",
|
|
1111
1151
|
"dev": "rollup -c rollup.config.mjs -w",
|
|
1112
1152
|
"typecheck": "tsc --noEmit -p .",
|
|
1113
1153
|
"test": "vitest run",
|