motionary 0.0.0-stage → 6.2.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.
Files changed (374) hide show
  1. package/CHANGELOG.md +803 -0
  2. package/LICENSE +21 -0
  3. package/README.md +218 -2
  4. package/README_ja.md +219 -0
  5. package/README_zh.md +219 -0
  6. package/bin/usa-codemod-5.mjs +79 -0
  7. package/bin/usa-codemod-6.mjs +146 -0
  8. package/dist/chunks/base-BaQV-2ha.cjs +436 -0
  9. package/dist/chunks/base-BaQV-2ha.cjs.map +1 -0
  10. package/dist/chunks/base-C_3cAoRz.js +404 -0
  11. package/dist/chunks/base-C_3cAoRz.js.map +1 -0
  12. package/dist/chunks/bind-B_CTL6Qn.js +22 -0
  13. package/dist/chunks/bind-B_CTL6Qn.js.map +1 -0
  14. package/dist/chunks/bind-Ui43-n2d.cjs +25 -0
  15. package/dist/chunks/bind-Ui43-n2d.cjs.map +1 -0
  16. package/dist/chunks/core-B5T0dhFH.cjs +920 -0
  17. package/dist/chunks/core-B5T0dhFH.cjs.map +1 -0
  18. package/dist/chunks/core-BGAyaY6L.cjs +265 -0
  19. package/dist/chunks/core-BGAyaY6L.cjs.map +1 -0
  20. package/dist/chunks/core-D7cVumUu.js +909 -0
  21. package/dist/chunks/core-D7cVumUu.js.map +1 -0
  22. package/dist/chunks/core-VEBw36QK.js +260 -0
  23. package/dist/chunks/core-VEBw36QK.js.map +1 -0
  24. package/dist/chunks/core-ps8uvYuN.js +181 -0
  25. package/dist/chunks/core-ps8uvYuN.js.map +1 -0
  26. package/dist/chunks/core-zq17EeCI.cjs +185 -0
  27. package/dist/chunks/core-zq17EeCI.cjs.map +1 -0
  28. package/dist/chunks/fx-Bs6IrV4Q.js +109 -0
  29. package/dist/chunks/fx-Bs6IrV4Q.js.map +1 -0
  30. package/dist/chunks/fx-lBGVtQO1.cjs +114 -0
  31. package/dist/chunks/fx-lBGVtQO1.cjs.map +1 -0
  32. package/dist/chunks/generative-D2YyhaeO.js +336 -0
  33. package/dist/chunks/generative-D2YyhaeO.js.map +1 -0
  34. package/dist/chunks/generative-DzIZq-_g.cjs +348 -0
  35. package/dist/chunks/generative-DzIZq-_g.cjs.map +1 -0
  36. package/dist/chunks/gpu-Bu7qwugO.js +380 -0
  37. package/dist/chunks/gpu-Bu7qwugO.js.map +1 -0
  38. package/dist/chunks/gpu-CenK2l6b.cjs +387 -0
  39. package/dist/chunks/gpu-CenK2l6b.cjs.map +1 -0
  40. package/dist/chunks/index-tags-DucKMQr_.js +26 -0
  41. package/dist/chunks/index-tags-DucKMQr_.js.map +1 -0
  42. package/dist/chunks/index-tags-wv0R_vkO.cjs +28 -0
  43. package/dist/chunks/index-tags-wv0R_vkO.cjs.map +1 -0
  44. package/dist/chunks/presets-BYBVJVeP.js +226 -0
  45. package/dist/chunks/presets-BYBVJVeP.js.map +1 -0
  46. package/dist/chunks/presets-CUHys3sK.cjs +233 -0
  47. package/dist/chunks/presets-CUHys3sK.cjs.map +1 -0
  48. package/dist/chunks/registry-CKNLQpwd.js +121 -0
  49. package/dist/chunks/registry-CKNLQpwd.js.map +1 -0
  50. package/dist/chunks/registry-DehBVRDV.cjs +131 -0
  51. package/dist/chunks/registry-DehBVRDV.cjs.map +1 -0
  52. package/dist/chunks/spring-CbvHfVtP.js +219 -0
  53. package/dist/chunks/spring-CbvHfVtP.js.map +1 -0
  54. package/dist/chunks/spring-Dgx187Vh.cjs +232 -0
  55. package/dist/chunks/spring-Dgx187Vh.cjs.map +1 -0
  56. package/dist/chunks/stagger-CCFyhzSw.cjs +86 -0
  57. package/dist/chunks/stagger-CCFyhzSw.cjs.map +1 -0
  58. package/dist/chunks/stagger-DtMKo2SK.js +84 -0
  59. package/dist/chunks/stagger-DtMKo2SK.js.map +1 -0
  60. package/dist/chunks/variants-BhjyddG8.cjs +39 -0
  61. package/dist/chunks/variants-BhjyddG8.cjs.map +1 -0
  62. package/dist/chunks/variants-DRlKVHvu.js +35 -0
  63. package/dist/chunks/variants-DRlKVHvu.js.map +1 -0
  64. package/dist/components/a11y.cjs +276 -0
  65. package/dist/components/a11y.cjs.map +1 -0
  66. package/dist/components/a11y.d.cts +131 -0
  67. package/dist/components/a11y.d.ts +131 -0
  68. package/dist/components/a11y.js +259 -0
  69. package/dist/components/a11y.js.map +1 -0
  70. package/dist/components/angular.cjs +76 -0
  71. package/dist/components/angular.cjs.map +1 -0
  72. package/dist/components/angular.d.cts +1734 -0
  73. package/dist/components/angular.d.ts +1734 -0
  74. package/dist/components/angular.js +70 -0
  75. package/dist/components/angular.js.map +1 -0
  76. package/dist/components/background.cjs +659 -0
  77. package/dist/components/background.cjs.map +1 -0
  78. package/dist/components/background.css +9 -0
  79. package/dist/components/background.d.cts +166 -0
  80. package/dist/components/background.d.ts +166 -0
  81. package/dist/components/background.js +647 -0
  82. package/dist/components/background.js.map +1 -0
  83. package/dist/components/bridge.cjs +154 -0
  84. package/dist/components/bridge.cjs.map +1 -0
  85. package/dist/components/bridge.d.cts +63 -0
  86. package/dist/components/bridge.d.ts +63 -0
  87. package/dist/components/bridge.js +147 -0
  88. package/dist/components/bridge.js.map +1 -0
  89. package/dist/components/cards.cjs +561 -0
  90. package/dist/components/cards.cjs.map +1 -0
  91. package/dist/components/cards.css +6 -0
  92. package/dist/components/cards.d.cts +115 -0
  93. package/dist/components/cards.d.ts +115 -0
  94. package/dist/components/cards.js +554 -0
  95. package/dist/components/cards.js.map +1 -0
  96. package/dist/components/click.cjs +877 -0
  97. package/dist/components/click.cjs.map +1 -0
  98. package/dist/components/click.css +9 -0
  99. package/dist/components/click.d.cts +218 -0
  100. package/dist/components/click.d.ts +218 -0
  101. package/dist/components/click.js +863 -0
  102. package/dist/components/click.js.map +1 -0
  103. package/dist/components/depth.cjs +250 -0
  104. package/dist/components/depth.cjs.map +1 -0
  105. package/dist/components/depth.css +3 -0
  106. package/dist/components/depth.d.cts +86 -0
  107. package/dist/components/depth.d.ts +86 -0
  108. package/dist/components/depth.js +242 -0
  109. package/dist/components/depth.js.map +1 -0
  110. package/dist/components/effects.cjs +2258 -0
  111. package/dist/components/effects.cjs.map +1 -0
  112. package/dist/components/effects.d.cts +545 -0
  113. package/dist/components/effects.d.ts +545 -0
  114. package/dist/components/effects.js +2200 -0
  115. package/dist/components/effects.js.map +1 -0
  116. package/dist/components/feedback.cjs +442 -0
  117. package/dist/components/feedback.cjs.map +1 -0
  118. package/dist/components/feedback.css +7 -0
  119. package/dist/components/feedback.d.cts +144 -0
  120. package/dist/components/feedback.d.ts +144 -0
  121. package/dist/components/feedback.js +433 -0
  122. package/dist/components/feedback.js.map +1 -0
  123. package/dist/components/fx-gpu.cjs +12 -0
  124. package/dist/components/fx-gpu.cjs.map +1 -0
  125. package/dist/components/fx-gpu.d.cts +63 -0
  126. package/dist/components/fx-gpu.d.ts +63 -0
  127. package/dist/components/fx-gpu.js +5 -0
  128. package/dist/components/fx-gpu.js.map +1 -0
  129. package/dist/components/fx.cjs +169 -0
  130. package/dist/components/fx.cjs.map +1 -0
  131. package/dist/components/fx.css +3 -0
  132. package/dist/components/fx.d.cts +114 -0
  133. package/dist/components/fx.d.ts +114 -0
  134. package/dist/components/fx.js +156 -0
  135. package/dist/components/fx.js.map +1 -0
  136. package/dist/components/fx2.cjs +25 -0
  137. package/dist/components/fx2.cjs.map +1 -0
  138. package/dist/components/fx2.d.cts +136 -0
  139. package/dist/components/fx2.d.ts +136 -0
  140. package/dist/components/fx2.js +17 -0
  141. package/dist/components/fx2.js.map +1 -0
  142. package/dist/components/gesture.cjs +209 -0
  143. package/dist/components/gesture.cjs.map +1 -0
  144. package/dist/components/gesture.css +3 -0
  145. package/dist/components/gesture.d.cts +134 -0
  146. package/dist/components/gesture.d.ts +134 -0
  147. package/dist/components/gesture.js +203 -0
  148. package/dist/components/gesture.js.map +1 -0
  149. package/dist/components/interaction.cjs +424 -0
  150. package/dist/components/interaction.cjs.map +1 -0
  151. package/dist/components/interaction.css +8 -0
  152. package/dist/components/interaction.d.cts +115 -0
  153. package/dist/components/interaction.d.ts +115 -0
  154. package/dist/components/interaction.js +416 -0
  155. package/dist/components/interaction.js.map +1 -0
  156. package/dist/components/jsx.cjs +3 -0
  157. package/dist/components/jsx.cjs.map +1 -0
  158. package/dist/components/jsx.d.cts +53 -0
  159. package/dist/components/jsx.d.ts +53 -0
  160. package/dist/components/jsx.js +2 -0
  161. package/dist/components/jsx.js.map +1 -0
  162. package/dist/components/layout.cjs +257 -0
  163. package/dist/components/layout.cjs.map +1 -0
  164. package/dist/components/layout.css +3 -0
  165. package/dist/components/layout.d.cts +99 -0
  166. package/dist/components/layout.d.ts +99 -0
  167. package/dist/components/layout.js +249 -0
  168. package/dist/components/layout.js.map +1 -0
  169. package/dist/components/lazy.cjs +92 -0
  170. package/dist/components/lazy.cjs.map +1 -0
  171. package/dist/components/lazy.d.cts +48 -0
  172. package/dist/components/lazy.d.ts +48 -0
  173. package/dist/components/lazy.js +87 -0
  174. package/dist/components/lazy.js.map +1 -0
  175. package/dist/components/lite.cjs +11095 -0
  176. package/dist/components/lite.cjs.map +1 -0
  177. package/dist/components/lite.d.cts +4 -0
  178. package/dist/components/lite.d.ts +4 -0
  179. package/dist/components/lite.js +10827 -0
  180. package/dist/components/lite.js.map +1 -0
  181. package/dist/components/packs.cjs +192 -0
  182. package/dist/components/packs.cjs.map +1 -0
  183. package/dist/components/packs.css +3 -0
  184. package/dist/components/packs.d.cts +72 -0
  185. package/dist/components/packs.d.ts +72 -0
  186. package/dist/components/packs.js +184 -0
  187. package/dist/components/packs.js.map +1 -0
  188. package/dist/components/page.cjs +824 -0
  189. package/dist/components/page.cjs.map +1 -0
  190. package/dist/components/page.css +11 -0
  191. package/dist/components/page.d.cts +249 -0
  192. package/dist/components/page.d.ts +249 -0
  193. package/dist/components/page.js +799 -0
  194. package/dist/components/page.js.map +1 -0
  195. package/dist/components/perf.cjs +120 -0
  196. package/dist/components/perf.cjs.map +1 -0
  197. package/dist/components/perf.d.cts +98 -0
  198. package/dist/components/perf.d.ts +98 -0
  199. package/dist/components/perf.js +110 -0
  200. package/dist/components/perf.js.map +1 -0
  201. package/dist/components/physics.cjs +448 -0
  202. package/dist/components/physics.cjs.map +1 -0
  203. package/dist/components/physics.css +5 -0
  204. package/dist/components/physics.d.cts +189 -0
  205. package/dist/components/physics.d.ts +189 -0
  206. package/dist/components/physics.js +430 -0
  207. package/dist/components/physics.js.map +1 -0
  208. package/dist/components/react.cjs +96 -0
  209. package/dist/components/react.cjs.map +1 -0
  210. package/dist/components/react.d.cts +18 -0
  211. package/dist/components/react.d.ts +18 -0
  212. package/dist/components/react.js +91 -0
  213. package/dist/components/react.js.map +1 -0
  214. package/dist/components/reveal.cjs +362 -0
  215. package/dist/components/reveal.cjs.map +1 -0
  216. package/dist/components/reveal.css +5 -0
  217. package/dist/components/reveal.d.cts +105 -0
  218. package/dist/components/reveal.d.ts +105 -0
  219. package/dist/components/reveal.js +353 -0
  220. package/dist/components/reveal.js.map +1 -0
  221. package/dist/components/solid.cjs +86 -0
  222. package/dist/components/solid.cjs.map +1 -0
  223. package/dist/components/solid.d.cts +1751 -0
  224. package/dist/components/solid.d.ts +1751 -0
  225. package/dist/components/solid.js +82 -0
  226. package/dist/components/solid.js.map +1 -0
  227. package/dist/components/svelte.cjs +68 -0
  228. package/dist/components/svelte.cjs.map +1 -0
  229. package/dist/components/svelte.d.cts +1733 -0
  230. package/dist/components/svelte.d.ts +1733 -0
  231. package/dist/components/svelte.js +64 -0
  232. package/dist/components/svelte.js.map +1 -0
  233. package/dist/components/svg.cjs +359 -0
  234. package/dist/components/svg.cjs.map +1 -0
  235. package/dist/components/svg.css +3 -0
  236. package/dist/components/svg.d.cts +113 -0
  237. package/dist/components/svg.d.ts +113 -0
  238. package/dist/components/svg.js +347 -0
  239. package/dist/components/svg.js.map +1 -0
  240. package/dist/components/text.cjs +968 -0
  241. package/dist/components/text.cjs.map +1 -0
  242. package/dist/components/text.css +8 -0
  243. package/dist/components/text.d.cts +342 -0
  244. package/dist/components/text.d.ts +342 -0
  245. package/dist/components/text.js +947 -0
  246. package/dist/components/text.js.map +1 -0
  247. package/dist/components/timeline.cjs +109 -0
  248. package/dist/components/timeline.cjs.map +1 -0
  249. package/dist/components/timeline.css +3 -0
  250. package/dist/components/timeline.d.cts +155 -0
  251. package/dist/components/timeline.d.ts +155 -0
  252. package/dist/components/timeline.js +103 -0
  253. package/dist/components/timeline.js.map +1 -0
  254. package/dist/components/tokens.cjs +226 -0
  255. package/dist/components/tokens.cjs.map +1 -0
  256. package/dist/components/tokens.d.cts +74 -0
  257. package/dist/components/tokens.d.ts +74 -0
  258. package/dist/components/tokens.js +211 -0
  259. package/dist/components/tokens.js.map +1 -0
  260. package/dist/components/transitions.cjs +430 -0
  261. package/dist/components/transitions.cjs.map +1 -0
  262. package/dist/components/transitions.css +5 -0
  263. package/dist/components/transitions.d.cts +126 -0
  264. package/dist/components/transitions.d.ts +126 -0
  265. package/dist/components/transitions.js +423 -0
  266. package/dist/components/transitions.js.map +1 -0
  267. package/dist/components/ui.cjs +1050 -0
  268. package/dist/components/ui.cjs.map +1 -0
  269. package/dist/components/ui.css +14 -0
  270. package/dist/components/ui.d.cts +224 -0
  271. package/dist/components/ui.d.ts +224 -0
  272. package/dist/components/ui.js +1034 -0
  273. package/dist/components/ui.js.map +1 -0
  274. package/dist/components/vue.cjs +67 -0
  275. package/dist/components/vue.cjs.map +1 -0
  276. package/dist/components/vue.d.cts +1722 -0
  277. package/dist/components/vue.d.ts +1722 -0
  278. package/dist/components/vue.js +64 -0
  279. package/dist/components/vue.js.map +1 -0
  280. package/dist/components/webgl.cjs +459 -0
  281. package/dist/components/webgl.cjs.map +1 -0
  282. package/dist/components/webgl.css +3 -0
  283. package/dist/components/webgl.d.cts +133 -0
  284. package/dist/components/webgl.d.ts +133 -0
  285. package/dist/components/webgl.js +442 -0
  286. package/dist/components/webgl.js.map +1 -0
  287. package/dist/components/widgets.cjs +591 -0
  288. package/dist/components/widgets.cjs.map +1 -0
  289. package/dist/components/widgets.d.cts +110 -0
  290. package/dist/components/widgets.d.ts +110 -0
  291. package/dist/components/widgets.js +581 -0
  292. package/dist/components/widgets.js.map +1 -0
  293. package/dist/components.cjs +351 -0
  294. package/dist/components.cjs.map +1 -0
  295. package/dist/components.css +75 -0
  296. package/dist/components.d.cts +2997 -0
  297. package/dist/components.d.ts +2997 -0
  298. package/dist/components.js +106 -0
  299. package/dist/components.js.map +1 -0
  300. package/dist/components.umd.js +23 -0
  301. package/dist/components.umd.js.map +1 -0
  302. package/dist/element.cjs +97 -0
  303. package/dist/element.cjs.map +1 -0
  304. package/dist/element.d.cts +215 -0
  305. package/dist/element.d.ts +215 -0
  306. package/dist/element.js +95 -0
  307. package/dist/element.js.map +1 -0
  308. package/dist/element.umd.js +2 -0
  309. package/dist/element.umd.js.map +1 -0
  310. package/dist/index.cjs +149 -0
  311. package/dist/index.cjs.map +1 -0
  312. package/dist/index.d.cts +425 -0
  313. package/dist/index.d.ts +425 -0
  314. package/dist/index.js +131 -0
  315. package/dist/index.js.map +1 -0
  316. package/dist/index.umd.js +15 -0
  317. package/dist/index.umd.js.map +1 -0
  318. package/dist/presets/extended.cjs +243 -0
  319. package/dist/presets/extended.cjs.map +1 -0
  320. package/dist/presets/extended.d.cts +37 -0
  321. package/dist/presets/extended.d.ts +37 -0
  322. package/dist/presets/extended.js +239 -0
  323. package/dist/presets/extended.js.map +1 -0
  324. package/dist/presets-extended.umd.js +2 -0
  325. package/dist/presets-extended.umd.js.map +1 -0
  326. package/dist/react.cjs +68 -0
  327. package/dist/react.cjs.map +1 -0
  328. package/dist/react.d.cts +158 -0
  329. package/dist/react.d.ts +158 -0
  330. package/dist/react.js +65 -0
  331. package/dist/react.js.map +1 -0
  332. package/dist/solid.cjs +93 -0
  333. package/dist/solid.cjs.map +1 -0
  334. package/dist/solid.d.cts +249 -0
  335. package/dist/solid.d.ts +249 -0
  336. package/dist/solid.js +89 -0
  337. package/dist/solid.js.map +1 -0
  338. package/dist/svelte.cjs +66 -0
  339. package/dist/svelte.cjs.map +1 -0
  340. package/dist/svelte.d.cts +243 -0
  341. package/dist/svelte.d.ts +243 -0
  342. package/dist/svelte.js +63 -0
  343. package/dist/svelte.js.map +1 -0
  344. package/dist/vue.cjs +62 -0
  345. package/dist/vue.cjs.map +1 -0
  346. package/dist/vue.d.cts +158 -0
  347. package/dist/vue.d.ts +158 -0
  348. package/dist/vue.js +60 -0
  349. package/dist/vue.js.map +1 -0
  350. package/dist/widgets.umd.js +2 -0
  351. package/dist/widgets.umd.js.map +1 -0
  352. package/docs/API.md +147 -0
  353. package/docs/ROADMAP.md +14 -0
  354. package/docs/accessibility.md +60 -0
  355. package/docs/components.md +564 -0
  356. package/docs/deprecations.md +30 -0
  357. package/docs/frameworks-ssr.md +100 -0
  358. package/docs/hybrid-apps.md +145 -0
  359. package/docs/images/showcase-detail.png +0 -0
  360. package/docs/images/showcase-grid.png +0 -0
  361. package/docs/images/showcase-mobile.png +0 -0
  362. package/docs/migration-from-aos.md +67 -0
  363. package/docs/migration-from-gsap-scrolltrigger.md +80 -0
  364. package/docs/motion-tokens.css +31 -0
  365. package/docs/motion-tokens.md +46 -0
  366. package/docs/motion.tokens.json +132 -0
  367. package/docs/performance.md +24 -0
  368. package/docs/presets.md +310 -0
  369. package/docs/upgrading-3.md +21 -0
  370. package/docs/upgrading-4.md +65 -0
  371. package/docs/upgrading-5.md +31 -0
  372. package/docs/upgrading-6.md +32 -0
  373. package/docs/windows-apps.md +119 -0
  374. package/package.json +562 -4
@@ -0,0 +1,310 @@
1
+ # Presets
2
+
3
+ `motionary` ships **214 scroll-reveal presets**: 33 in the core (always available) and **181 extended presets** added in 6.1 ("Scroll presets 2.0").
4
+
5
+ ```js
6
+ import ScrollAnimate from 'motionary';
7
+ import 'motionary/presets/extended'; // registers the extended set (≈ 4 kB gzip, separate entry)
8
+
9
+ ScrollAnimate.observe('.card', { animation: 'bounce-in-up', duration: 900 });
10
+ ```
11
+
12
+ ```html
13
+ <!-- No build: the UMD core, then the extended set (registers itself) -->
14
+ <script src="https://unpkg.com/motionary@6/dist/index.umd.js"></script>
15
+ <script src="https://unpkg.com/motionary@6/dist/presets-extended.umd.js"></script>
16
+ <div data-sa data-sa-animation="clip-diamond">…</div>
17
+ <script>ScrollAnimate.default.init();</script>
18
+ ```
19
+
20
+ Every preset works everywhere a preset name is accepted: `animation` / `exit` options, `data-sa-animation`, the framework hooks (`useScrollAnimate`, `use:scrollAnimate`, …), `<scroll-animate animation="…">`, and `<usa-reveal effect="…">` / `<usa-stagger effect="…">` (any registered preset name that is not one of their own effects).
21
+
22
+ All presets animate only `transform`, `opacity`, `filter` and `clip-path` (plus a constant `transform-origin`), and are skipped entirely under `prefers-reduced-motion: reduce` (the element is simply shown). Presets marked **keyframes** use intermediate `frames` (overshoot, bounce, glitch); they play as written and are ignored when presets are combined in an array.
23
+
24
+ **Scroll-linked (`scrub-*`)** presets are designed for the native engine across the whole crossing: `{ engine: 'css', viewRange: ['cover 0%', 'cover 100%'] }` (`data-sa-engine="css" data-sa-view-range="cover 0%, cover 100%"`). Played as a one-shot reveal they end on their last frame (e.g. `scrub-fade-through` ends transparent).
25
+
26
+ **Stagger-ready (`stagger-*`)** presets use small distances that stay calm across long lists: `staggerChildren(list, { animation: 'stagger-pop', stagger: 60 })`.
27
+
28
+ ## Fade (19)
29
+
30
+ | Preset | Set | What it does |
31
+ |---|---|---|
32
+ | `fade-in` | core | The quiet classic: content simply fades into view. |
33
+ | `fade-in-up` | core | Rises 40px while fading in. The library default. |
34
+ | `fade-in-down` | core | Drops in from above while fading in. |
35
+ | `fade-in-left` | core | Glides in from the left. |
36
+ | `fade-in-right` | core | Glides in from the right. |
37
+ | `fade-in-up-sm` | extended | Rises a subtle 16px — calm body copy. |
38
+ | `fade-in-down-sm` | extended | Settles down 16px. |
39
+ | `fade-in-left-sm` | extended | Nudges in 16px from the left. |
40
+ | `fade-in-right-sm` | extended | Nudges in 16px from the right. |
41
+ | `fade-in-up-lg` | extended | A long 120px rise for hero blocks. |
42
+ | `fade-in-down-lg` | extended | Drops 120px from above. |
43
+ | `fade-in-left-lg` | extended | Travels 120px in from the left. |
44
+ | `fade-in-right-lg` | extended | Travels 120px in from the right. |
45
+ | `fade-in-up-left` | extended | Glides in diagonally (-40px, +40px). |
46
+ | `fade-in-up-right` | extended | Glides in diagonally (+40px, +40px). |
47
+ | `fade-in-down-left` | extended | Glides in diagonally (-40px, -40px). |
48
+ | `fade-in-down-right` | extended | Glides in diagonally (+40px, -40px). |
49
+ | `fade-in-scale` | extended | Rises 20px from 95% — the "card appears" default. |
50
+ | `fade-in-half` | extended | Starts half visible — for content that should never vanish. |
51
+
52
+ ## Zoom & scale (23)
53
+
54
+ | Preset | Set | What it does |
55
+ |---|---|---|
56
+ | `zoom-in` | core | Grows from 80% to full size. |
57
+ | `zoom-out` | core | Settles down from 120%. |
58
+ | `scale-up` | core | Pops up from half size — great with spring easing. |
59
+ | `scale-x` | core | Unrolls horizontally — ideal for dividers and bars. |
60
+ | `scale-y` | core | Unrolls vertically. |
61
+ | `zoom-in-up` | extended | Grows from 60% while rising 60px. |
62
+ | `zoom-in-down` | extended | Grows from 60% while dropping in. |
63
+ | `zoom-in-left` | extended | Grows in from the left. |
64
+ | `zoom-in-right` | extended | Grows in from the right. |
65
+ | `zoom-out-up` | extended | Shrinks from 140% while rising. |
66
+ | `zoom-out-down` | extended | Shrinks from 140% while dropping in. |
67
+ | `zoom-out-left` | extended | Shrinks in from the left. |
68
+ | `zoom-out-right` | extended | Shrinks in from the right. |
69
+ | `zoom-in-big` | extended | Grows all the way from nothing. |
70
+ | `zoom-out-big` | extended | Lands from double size, like a stamp. |
71
+ | `zoom-bounce` | extended · keyframes | Overshoots to 110%, dips, settles. |
72
+ | `zoom-in-rotate` | extended | Grows from 50% while untwisting 30°. |
73
+ | `scale-x-left` | extended | Unrolls left → right — underlines, bars. |
74
+ | `scale-x-right` | extended | Unrolls right → left. |
75
+ | `scale-y-top` | extended | Unrolls downwards like a blind. |
76
+ | `scale-y-bottom` | extended | Grows upwards — chart bars. |
77
+ | `stretch-x` | extended | Snaps back from a wide, flat stretch. |
78
+ | `stretch-y` | extended | Snaps back from a tall, thin stretch. |
79
+
80
+ ## Flip 3D (22)
81
+
82
+ | Preset | Set | What it does |
83
+ |---|---|---|
84
+ | `flip-x` | core | Flips in around the X axis. |
85
+ | `flip-y` | core | Flips in around the Y axis, like a card. |
86
+ | `flip-up` | core | Tilts up into place with perspective. |
87
+ | `flip-down` | core | Tilts down into place with perspective. |
88
+ | `flip-x-reverse` | extended | Flips in around X from the other side. |
89
+ | `flip-y-reverse` | extended | Flips in around Y from the other side. |
90
+ | `flip-y-full` | extended | A full 180° card turn into place. |
91
+ | `flip-diagonal` | extended | Turns in around the ↘ diagonal. |
92
+ | `flip-diagonal-reverse` | extended | Turns in around the ↗ diagonal. |
93
+ | `flip-left` | extended | Hinged on the left edge, swings open toward you. |
94
+ | `flip-right` | extended | Hinged on the right edge. |
95
+ | `unfold-down` | extended | Unfolds from the top edge like a letter. |
96
+ | `unfold-up` | extended | Unfolds upwards from the bottom edge. |
97
+ | `door-open-left` | extended | A door swinging open on left hinges — no fade. |
98
+ | `door-open-right` | extended | A door swinging open on right hinges. |
99
+ | `fold-in` | extended | Unfolds from a flat, tilted strip. |
100
+ | `flip-x-bounce` | extended · keyframes | Flips in around X, overshoots and rocks to rest. |
101
+ | `flip-y-bounce` | extended · keyframes | Flips in around Y, overshoots and rocks to rest. |
102
+ | `swing-in-top` | extended · keyframes | Swings down from the top edge, then sways. |
103
+ | `swing-in-bottom` | extended · keyframes | Swings up from the bottom edge. |
104
+ | `swing-in-left` | extended · keyframes | Swings in on the left edge. |
105
+ | `swing-in-right` | extended · keyframes | Swings in on the right edge. |
106
+
107
+ ## Slide (20)
108
+
109
+ | Preset | Set | What it does |
110
+ |---|---|---|
111
+ | `slide-up` | core | Slides a full height up, no fade — pair with overflow: hidden. |
112
+ | `slide-down` | core | Slides a full height down. |
113
+ | `slide-left` | core | Slides a full width in from the left. |
114
+ | `slide-right` | core | Slides a full width in from the right. |
115
+ | `slide-up-spring` | extended · keyframes | Slides a full height up, overshoots 8%, settles. |
116
+ | `slide-down-spring` | extended · keyframes | Slides down with a small overshoot. |
117
+ | `slide-left-spring` | extended · keyframes | Slides in from the left and springs back. |
118
+ | `slide-right-spring` | extended · keyframes | Slides in from the right and springs back. |
119
+ | `slide-up-sm` | extended | Slides 30% of its height — no fade. |
120
+ | `slide-down-sm` | extended | Slides 30% of its height — no fade. |
121
+ | `back-in-up` | extended · keyframes | Arrives small from below, then scales to full size. |
122
+ | `back-in-down` | extended · keyframes | Arrives small from above, then scales up. |
123
+ | `back-in-left` | extended · keyframes | Arrives small from the left, then scales up. |
124
+ | `back-in-right` | extended · keyframes | Arrives small from the right, then scales up. |
125
+ | `light-speed-in-left` | extended · keyframes | Streaks in skewed, brakes hard and straightens. |
126
+ | `light-speed-in-right` | extended · keyframes | Streaks in skewed, brakes hard and straightens. |
127
+ | `rise-in` | extended | Rises 80px from slightly smaller — weightless. |
128
+ | `sink-in` | extended | Sinks 80px into place from slightly larger. |
129
+ | `float-in-up` | extended · keyframes | Drifts up with a slight tilt, like a leaf in reverse. |
130
+ | `float-in-down` | extended · keyframes | Drifts down and rocks gently to rest. |
131
+
132
+ ## Rotate & skew (20)
133
+
134
+ | Preset | Set | What it does |
135
+ |---|---|---|
136
+ | `rotate-in` | core | Spins half a turn while growing in. |
137
+ | `rotate-left` | core | Swings in from the left with a slight tilt. |
138
+ | `rotate-right` | core | Swings in from the right with a slight tilt. |
139
+ | `skew-in` | core | Straightens out of a 20° skew. |
140
+ | `roll-in-left` | extended | Rolls in from the left like a wheel. |
141
+ | `roll-in-right` | extended | Rolls in from the right. |
142
+ | `spiral-in` | extended | One and a half turns while growing from a point. |
143
+ | `spiral-in-reverse` | extended | Spirals in clockwise. |
144
+ | `spin-in` | extended | A full turn while fading in — no scaling. |
145
+ | `rotate-in-up-left` | extended | Pivots 45° around its left-bottom corner. |
146
+ | `rotate-in-up-right` | extended | Pivots 45° around its right-bottom corner. |
147
+ | `rotate-in-down-left` | extended | Pivots 45° around its left-bottom corner. |
148
+ | `rotate-in-down-right` | extended | Pivots 45° around its right-bottom corner. |
149
+ | `skew-in-left` | extended | Straightens out of a 30° skew from the left. |
150
+ | `skew-in-y` | extended | Rises out of a vertical 12° shear. |
151
+ | `shear-in` | extended | Untwists from a two-axis shear. |
152
+ | `shear-in-reverse` | extended | The mirror-image shear. |
153
+ | `twist-in` | extended | Rotates, skews and grows at once. |
154
+ | `tilt-in-left` | extended | Rises 30px out of an 8° tilt. |
155
+ | `tilt-in-right` | extended | Rises out of a clockwise tilt. |
156
+
157
+ ## Blur & mask (14)
158
+
159
+ | Preset | Set | What it does |
160
+ |---|---|---|
161
+ | `blur-in` | core | Comes into focus from a 12px blur. |
162
+ | `blur-in-up` | core | Focus pull plus a gentle rise. |
163
+ | `blur-in-down` | extended | Focus pull while travelling 40px. |
164
+ | `blur-in-left` | extended | Focus pull while travelling 40px. |
165
+ | `blur-in-right` | extended | Focus pull while travelling 40px. |
166
+ | `blur-in-strong` | extended | A heavy 24px defocus resolving. |
167
+ | `blur-in-zoom` | extended | Settles from 120% while focusing — cinematic. |
168
+ | `blur-in-scale` | extended | Grows from 80% while focusing. |
169
+ | `blur-in-x` | extended | Horizontal smear that snaps into focus. |
170
+ | `mask-up` | extended | Rises inside its own box — the classic headline reveal. |
171
+ | `mask-down` | extended | Drops in, clipped to its own box. |
172
+ | `mask-left` | extended | Slides left, clipped to its own box. |
173
+ | `mask-right` | extended | Slides right, clipped to its own box. |
174
+ | `blur-mask-up` | extended | Masked rise with a focus pull. |
175
+
176
+ ## Clip reveal (22)
177
+
178
+ | Preset | Set | What it does |
179
+ |---|---|---|
180
+ | `clip-up` | core | Uncovered from the bottom edge — nothing moves. |
181
+ | `clip-down` | core | Uncovered from the top edge. |
182
+ | `clip-left` | core | Uncovered from the right edge. |
183
+ | `clip-right` | core | Uncovered from the left edge. |
184
+ | `clip-circle` | core | An iris opening from the centre. |
185
+ | `clip-circle-top` | extended | A circle grows from 50% 0%. |
186
+ | `clip-circle-bottom` | extended | A circle grows from 50% 100%. |
187
+ | `clip-circle-left` | extended | A circle grows from 0% 50%. |
188
+ | `clip-circle-right` | extended | A circle grows from 100% 50%. |
189
+ | `clip-circle-corner` | extended | A circle grows from 0% 0%. |
190
+ | `clip-ellipse` | extended | An elliptical iris that follows the box shape. |
191
+ | `clip-diamond` | extended | A diamond opening from the centre. |
192
+ | `clip-split-x` | extended | Opens from a vertical centre line, like curtains. |
193
+ | `clip-split-y` | extended | Opens from a horizontal centre line. |
194
+ | `clip-box` | extended | A rectangle grows from the centre. |
195
+ | `clip-pill` | extended | A rounded pill that squares off as it opens. |
196
+ | `clip-blinds` | extended | Four horizontal slats open together. |
197
+ | `clip-blinds-x` | extended | Four vertical slats open together. |
198
+ | `clip-diagonal` | extended | Wipes in from the top-left corner. |
199
+ | `clip-diagonal-reverse` | extended | Wipes in from the bottom-right corner. |
200
+ | `clip-slant-right` | extended | A slanted edge sweeps left → right. |
201
+ | `clip-slant-left` | extended | A slanted edge sweeps right → left. |
202
+
203
+ ## Bounce & elastic (17)
204
+
205
+ | Preset | Set | What it does |
206
+ |---|---|---|
207
+ | `bounce-in` | extended · keyframes | Pops from 30% with a springy wobble. |
208
+ | `bounce-in-up` | extended · keyframes | Arrives 120px away, overshoots and bounces to rest. |
209
+ | `bounce-in-down` | extended · keyframes | Arrives 120px away, overshoots and bounces to rest. |
210
+ | `bounce-in-left` | extended · keyframes | Arrives 120px away, overshoots and bounces to rest. |
211
+ | `bounce-in-right` | extended · keyframes | Arrives 120px away, overshoots and bounces to rest. |
212
+ | `elastic-in` | extended · keyframes | Springs from zero to 120% and rings out. |
213
+ | `elastic-in-x` | extended · keyframes | Stretches out horizontally and twangs to rest. |
214
+ | `rubber-in` | extended · keyframes | Squashes and stretches like a rubber band. |
215
+ | `jello-in` | extended · keyframes | Wobbles in like jelly on a plate. |
216
+ | `wobble-in` | extended · keyframes | Wobbles side to side before standing still. |
217
+ | `tada-in` | extended · keyframes | Grows with a celebratory shimmy. |
218
+ | `heartbeat-in` | extended · keyframes | Two beats, then rest — great for likes and badges. |
219
+ | `drop-in` | extended · keyframes | Falls 150px and bounces on the floor. |
220
+ | `pop-in` | extended · keyframes | A quick pop past 112% — snappy UI feedback. |
221
+ | `squash-in` | extended · keyframes | Lands with cartoon squash and stretch. |
222
+ | `shake-in` | extended · keyframes | Arrives with a damped horizontal shake. |
223
+ | `swing-in` | extended · keyframes | Hangs from the top and swings to rest. |
224
+
225
+ ## Color & light (14)
226
+
227
+ | Preset | Set | What it does |
228
+ |---|---|---|
229
+ | `brightness-in` | extended | Fades in from an overexposed flash. |
230
+ | `darken-in` | extended | Lights up out of black — no fade. |
231
+ | `color-in` | extended | Black & white blooms into colour. |
232
+ | `saturate-in` | extended | Oversaturated colour settles to normal. |
233
+ | `hue-in` | extended | Colours spin half the wheel into place. |
234
+ | `sepia-in` | extended | An old photo developing into the present. |
235
+ | `invert-in` | extended | A negative that develops into the positive. |
236
+ | `contrast-in` | extended | Emerges from flat grey. |
237
+ | `exposure-in` | extended | Blown-out highlights pulled back. |
238
+ | `vintage-in` | extended | Soft, warm film look sharpening up. |
239
+ | `blur-bright-in` | extended | A glowing blur resolving. |
240
+ | `shadow-lift` | extended | Lifts off the page and casts a soft shadow. |
241
+ | `neon-glow-in` | extended · keyframes | Flares up in violet neon and keeps a soft glow. |
242
+ | `glow-in` | extended | Arrives wrapped in white light that fades away. |
243
+
244
+ ## Depth & perspective (10)
245
+
246
+ | Preset | Set | What it does |
247
+ |---|---|---|
248
+ | `perspective-in-up` | extended | Tilts up out of the floor plane. |
249
+ | `perspective-in-down` | extended | Tilts down from the ceiling plane. |
250
+ | `perspective-in-left` | extended | Swings in from a left-hand wall. |
251
+ | `perspective-in-right` | extended | Swings in from a right-hand wall. |
252
+ | `depth-push` | extended | Flies back from in front of the screen. |
253
+ | `depth-pull` | extended | Approaches from deep in the scene. |
254
+ | `depth-in-up` | extended | Rises up out of the depths. |
255
+ | `swoop-in-left` | extended | Swoops around from behind on the left. |
256
+ | `swoop-in-right` | extended | Swoops around from behind on the right. |
257
+ | `card-tilt-in` | extended | A product card turning to face you. |
258
+
259
+ ## Glitch & special (9)
260
+
261
+ | Preset | Set | What it does |
262
+ |---|---|---|
263
+ | `glitch-in` | extended · keyframes | Tears in with jittering slices, then locks. |
264
+ | `glitch-in-color` | extended · keyframes | Jitters through hue shifts before settling. |
265
+ | `typewriter` | extended | Uncovered left → right in 16 hard steps — one line of text. |
266
+ | `typewriter-lines` | extended | Uncovered top → bottom in 5 steps — a paragraph line by line. |
267
+ | `hinge-in` | extended · keyframes | Swings up on a top-left hinge and wobbles shut. |
268
+ | `flicker-in` | extended · keyframes | Two soft flickers, like a neon tube warming up. |
269
+ | `scan-in` | extended · keyframes | A bright scan line passes top → bottom. |
270
+ | `materialize` | extended | Condenses out of glowing haze. |
271
+ | `teleport-in` | extended · keyframes | Beams in as a bright sliver, then snaps to shape. |
272
+
273
+ ## Attention (4)
274
+
275
+ | Preset | Set | What it does |
276
+ |---|---|---|
277
+ | `bounce` | core | Drops 60px — try it with heavy-bounce easing. |
278
+ | `pulse` | core | A subtle 5% swell to draw the eye. |
279
+ | `swing` | core | Swings from -10° to 10°. |
280
+ | `shimmer` | core | Brightens up — good for badges and CTAs. |
281
+
282
+ ## Stagger-ready (8)
283
+
284
+ | Preset | Set | What it does |
285
+ |---|---|---|
286
+ | `stagger-fade-up` | extended | A tiny 12px rise that reads well 20 items deep. |
287
+ | `stagger-pop` | extended | Each item pops from 85% — icon grids. |
288
+ | `stagger-rise` | extended | Soft rise for card lists. |
289
+ | `stagger-slide` | extended | Rows slide in from the right — menus, tables. |
290
+ | `stagger-flip` | extended | Items flip down one after another like a departures board. |
291
+ | `stagger-blur` | extended | Light focus pull per item. |
292
+ | `stagger-zoom` | extended | Items settle down from 115%. |
293
+ | `stagger-drop` | extended | Tags and chips tumble in. |
294
+
295
+ ## Scroll-linked (12)
296
+
297
+ | Preset | Set | What it does |
298
+ |---|---|---|
299
+ | `scrub-parallax-up` | extended | Drifts upward faster than the page as you scroll. |
300
+ | `scrub-parallax-down` | extended | Lags behind the page — a background layer. |
301
+ | `scrub-rotate` | extended | Tilts from -25° to 25° as it crosses the viewport. |
302
+ | `scrub-spin` | extended | One full turn per viewport crossing — badges, logos. |
303
+ | `scrub-scale` | extended | Grows from 70% to 110% with scroll. |
304
+ | `scrub-shrink` | extended | Shrinks as it scrolls past — hero images. |
305
+ | `scrub-pan-left` | extended | Pans right → left with vertical scroll. |
306
+ | `scrub-pan-right` | extended | Pans left → right with vertical scroll. |
307
+ | `scrub-tilt` | extended | Pitches forward as it passes — 3D cards. |
308
+ | `scrub-fade-through` | extended · keyframes | Fades in, holds through the middle, fades out. |
309
+ | `scrub-blur-through` | extended · keyframes | Sharp only while centred — depth-of-field. |
310
+ | `scrub-reveal-x` | extended | Uncovered left → right in step with scroll. |
@@ -0,0 +1,21 @@
1
+ # Upgrading to 3.0
2
+
3
+ 3.0 removes the APIs deprecated in 2.9. Every change has a drop-in replacement; 2.9 logs a one-time console warning wherever old usage is found, so run your app on 2.9 first and fix the warnings.
4
+
5
+ | Removed in 3.0 | Use instead |
6
+ |---|---|
7
+ | `<usa-spinner variant="windows">`, `<usa-check variant="error">`, `<usa-dialog variant="drawer-end">`, `<usa-acrylic variant="mica">` (variant = kind) | `kind="windows"`, `kind="error"`, `kind="drawer-end"`, `kind="mica"`. `variant` now only selects a style variant (`minimal`, `neon`, `glass`, `brutalist`, `fluent`, `material`). |
8
+ | `spinner.variant` property | `spinner.kind` |
9
+ | `observe(el, { parallax: { y: 80 } })`, `data-sa-parallax-x/-y/-rotate/-scale/-speed` | `parallax(el, { speed: 0.3 })` (writes `--sa-parallax`, use it in CSS: `transform: translateY(calc(var(--sa-parallax) * -80px))`) or `progressVar: '--p'` |
10
+ | `ParallaxOptions` type | `ParallaxHelperOptions` |
11
+ | `data-variant` on spinner / check / dialog (internal styling hook) | `data-kind` |
12
+ | Node 18 for SSR imports | Node ≥ 20 (`engines`) |
13
+
14
+ Search & replace:
15
+
16
+ ```bash
17
+ # kinds
18
+ grep -rlE '<usa-(spinner|check|dialog|acrylic)[^>]*variant=' src | xargs sed -i -E 's/(<usa-(spinner|check|dialog|acrylic)[^>]*)variant=/\1kind=/g'
19
+ # legacy parallax
20
+ grep -rn 'data-sa-parallax\|parallax:' src
21
+ ```
@@ -0,0 +1,65 @@
1
+ # Upgrading to 4.0
2
+
3
+ 4.0 removes the three APIs that 3.9 deprecated, each replaced by a more capable one added during 3.x. **Run your app on 3.9 first**: it logs one console warning (`[use-scroll-animate] … deprecated …`) for every removed API you still use.
4
+
5
+ | Removed in 4.0 | Use instead | Since |
6
+ |---|---|---|
7
+ | `sequence(steps, opts)` (`use-scroll-animate`) | `timeline()` — `use-scroll-animate` (re-exported in 4.0) or `use-scroll-animate/components/timeline` | 3.1 |
8
+ | `connectedAnimation(from, to)` (`components/transitions`) | `sharedTransition(update)` with `data-shared="id"` (`components/layout`) | 3.6 |
9
+ | `<usa-flip-list>` / `defineFlipList()` (`components/transitions`) | `<usa-auto-animate>` / `autoAnimate(el)` (`components/layout`) | 3.6 |
10
+
11
+ ## `sequence()` → `timeline()`
12
+
13
+ ```js
14
+ // 3.x
15
+ sequence([
16
+ { target: '.title', animation: 'fade-in-up' },
17
+ { target: '.subtitle', animation: 'blur-in', gap: -300 },
18
+ { target: '.card', animation: 'scale-up', stagger: 80 },
19
+ ], { trigger: '.hero' });
20
+
21
+ // 4.0
22
+ import { timeline } from 'use-scroll-animate';
23
+ const tl = timeline({ defaults: { duration: 600 } })
24
+ .to('.title', 'fade-up')
25
+ .to('.subtitle', 'blur', { at: '-=300' }) // gap: -300 → at: '-=300'
26
+ .to('.card', 'scale', { stagger: 80 });
27
+ // trigger: '.hero' → play when it enters the view (or scrub it with scroll)
28
+ new IntersectionObserver(([e], io) => e.isIntersecting && (io.disconnect(), tl.play())).observe(document.querySelector('.hero'));
29
+ ```
30
+
31
+ Declaratively: wrap the section in `<usa-timeline>` and mark steps with `data-tl="fade-up"`, `data-at="-=300"`.
32
+
33
+ `gap: n` → `at: '+=n'` (negative → `'-=n'`), `at: ms` stays `at: ms`. Engine presets map to timeline presets: `fade-in-up` → `fade-up`, `blur-in` → `blur`, `scale-up` → `scale`, or pass keyframes.
34
+
35
+ ## `connectedAnimation()` → `sharedTransition()`
36
+
37
+ ```js
38
+ // 3.x
39
+ detail.hidden = false;
40
+ connectedAnimation(thumbnail, detail);
41
+
42
+ // 4.0 — give both ends the same data-shared id
43
+ // <img data-shared="photo-7"> in the grid and in the detail view
44
+ import { sharedTransition } from 'use-scroll-animate/components/layout';
45
+ await sharedTransition(() => { grid.hidden = true; detail.hidden = false; });
46
+ ```
47
+
48
+ Uses the View Transitions API where available (FLIP fallback elsewhere) and morphs any number of shared elements at once.
49
+
50
+ ## `<usa-flip-list>` → `<usa-auto-animate>`
51
+
52
+ ```html
53
+ <!-- 3.x -->
54
+ <usa-flip-list><li>…</li></usa-flip-list>
55
+ <!-- 4.0 -->
56
+ <usa-auto-animate><li>…</li></usa-auto-animate>
57
+ ```
58
+
59
+ `<usa-auto-animate>` also animates additions and removals, and size changes. Imperatively: `autoAnimate(ul)`.
60
+
61
+ ## Other changes in 4.0
62
+
63
+ - `timeline` is exported from the root entry (`import { timeline } from 'use-scroll-animate'`) in addition to `components/timeline`.
64
+ - CDN snippets in docs and the showcase use `use-scroll-animate@4`.
65
+ - npm `latest` moves to 4.0.0. 3.x stays available as `use-scroll-animate@3`.
@@ -0,0 +1,31 @@
1
+ # Upgrading to 5.0
2
+
3
+ 5.0.0 is released. 4.9 **warned once in the console** for everything below, and a codemod rewrites most of it:
4
+
5
+ ```sh
6
+ npx usa-codemod-5 src # dry run: lists every change
7
+ npx usa-codemod-5 --write src # apply
8
+ ```
9
+
10
+ ## Removed in 5.0 (deprecated in 4.9)
11
+
12
+ | 4.x | 5.0 | Codemod |
13
+ |---|---|---|
14
+ | `configureComponents({ motionIntensity: 'off' })`, `setMotionIntensity('off')` | `motionSensitivity: 'minimal'` / `setMotionSensitivity('minimal')` (4.4) — intensity is `'low' \| 'normal' \| 'high'` | ✅ |
15
+ | `configureComponents({ reducedMotion: 'no-preference' })` | removed — the OS "reduce motion" setting is always honoured; `'user'` (default) or `'reduce'` | ✅ (→ `'user'`) |
16
+ | `<usa-timeline scrub="js">` | `scrub` — the JS engine is picked automatically where native scroll timelines are missing; `smooth="…"` opts into smoothing | ✅ (→ `scrub smooth="0.1"`) |
17
+ | `configureComponents`, `prefersReducedMotion`, `ComponentsConfig`, `UsaElement` re-exported from every category entry (`use-scroll-animate/components/<category>`) | import them from `use-scroll-animate/components` | ✅ |
18
+
19
+ `<usa-motion-switch>` keeps its **Off** button; in 5.0 it maps to sensitivity `minimal`.
20
+
21
+ ## Modern-browser baseline
22
+
23
+ 5.0 requires **Custom Elements, Web Animations, IntersectionObserver, ResizeObserver and constructable stylesheets** (`adoptedStyleSheets`) — every evergreen browser since 2023 (Chrome / Edge ≥ 111, Safari ≥ 16.4, Firefox ≥ 115, WebView2, Electron ≥ 24). The legacy `experimental-webgl` context is no longer requested, and browsers without the required features are no longer tested or supported (the remaining no-WAAPI guards only keep SSR / test environments from throwing). View Transitions and scroll-driven animations stay **progressive** (used when present, JS fallback otherwise).
24
+
25
+ Check a browser with `baselineReport()` / `warnBaseline()` from `use-scroll-animate/components/a11y` (4.9).
26
+
27
+ ## New in 5.0
28
+
29
+ - **Unified plugin-style effect registration**: `registerEffect({ name, kind, run })`, `playEffect(el, name, options)`, `<usa-fx effect="…" trigger="…">` — every built-in click / card / hover effect is registered the same way, and so are yours.
30
+
31
+ See the [CHANGELOG](../CHANGELOG.md) for the full list.
@@ -0,0 +1,32 @@
1
+ # Upgrading to 6.0
2
+
3
+ 6.0.0 is released. 5.9 **warned once in the console** for everything below, and a codemod rewrites most of it:
4
+
5
+ ```sh
6
+ npx usa-codemod-6 src # dry run: lists every change (and what needs a manual edit)
7
+ npx usa-codemod-6 --write src # apply
8
+ ```
9
+
10
+ ## Removed in 6.0 (deprecated in 5.9)
11
+
12
+ 6.0 finishes the move to the 5.0 effect registry: every effect is registered once and played the same way (`playEffect()`, `bindEffect()`, `<usa-fx>`). The ad-hoc helpers that bypassed it go away.
13
+
14
+ | 5.x | 6.0 | Codemod |
15
+ |---|---|---|
16
+ | `burst(x, y, options)` from `use-scroll-animate/components` / `/components/click` | `playEffect(document.body, 'burst', { x, y, ...options })` from `use-scroll-animate/components/fx` | ✅ |
17
+ | `confetti(options)` | `playEffect(document.body, 'confetti', options)` (`x` / `y` in the options, or play it on the element to fire from its centre) | ✅ |
18
+ | `shake(el, intensity, duration)` | `playEffect(el, 'shake', { intensity, duration })` | ✅ |
19
+ | `UsaComponents.burst / confetti / shake` (UMD global) | `UsaComponents.playEffect(…)` | ✅ |
20
+ | `<usa-cursor mode="trail">` | wrap the content: `<usa-fx effect="comet-trail" trigger="load" self>…</usa-fx>` (5.7; scoped, touch-aware, overlay canvas). `mode="dot" \| "magnetic" \| "glow"` stay. | ⚠️ reported, manual |
21
+
22
+ `haptic()` stays. The registered `burst` effect accepts `x` / `y` since 5.9, so the rewrite keeps the exact origin.
23
+
24
+ ## Behaviour
25
+
26
+ - Nothing else changes in 6.0: the modern-browser baseline is the 5.0 one, every 5.1–5.9 pack keeps its API, and `<usa-player>` JSON (`format: "use-scroll-animate/animation"`, `version: 1`) stays readable.
27
+
28
+ ## New in 5.9 (before the break)
29
+
30
+ - `<usa-player>` plays JSON animations (keyframe tracks, timeline presets, registered effects) — exported from the playground's **`<usa-player> JSON`** tab. See [components.md](./components.md#v59-usa-player).
31
+
32
+ See the [CHANGELOG](../CHANGELOG.md) for the full list.
@@ -0,0 +1,119 @@
1
+ # Using the components in Windows desktop apps
2
+
3
+ The `<usa-*>` components are plain web platform code (Custom Elements v1, CSS, Web Animations API). Any Windows app whose UI is rendered by a modern web engine can use them unchanged:
4
+
5
+ | Stack | Engine on Windows | Works | Notes |
6
+ |---|---|---|---|
7
+ | **Electron** | Chromium (bundled) | ✅ | All features, incl. View Transitions. |
8
+ | **Tauri 1/2** | Microsoft Edge **WebView2** (Chromium) | ✅ | Same as Edge. |
9
+ | **WinUI 3 / WPF / WinForms + WebView2** | WebView2 | ✅ | Host a local HTML page (see below). |
10
+ | **.NET MAUI / Blazor Hybrid** | `BlazorWebView` → WebView2 | ✅ | Register in `wwwroot/index.html`. |
11
+ | **Installed PWA** (Edge / Chrome "Install app") | Edge / Chrome | ✅ | Runs in its own window with taskbar icon. |
12
+ | Neutralino, Wails, Flutter `webview_windows` | WebView2 | ✅ | Any WebView2-based shell. |
13
+ | Legacy MSHTML (`WebBrowser` control, IE11) | Trident | ❌ | No Custom Elements / WAAPI — migrate to WebView2. |
14
+
15
+ Requirements: Custom Elements, `IntersectionObserver` and `Element.animate()` — every Chromium ≥ 84 (all supported Electron/WebView2 versions). `viewTransition()` uses the View Transitions API (Chromium ≥ 111) and falls back to a cross-fade.
16
+
17
+ Every component respects the Windows setting **Settings → Accessibility → Visual effects → Animation effects** (exposed to web views as `prefers-reduced-motion`), and `<usa-acrylic>` turns solid when **Transparency effects** are off or a high-contrast theme is active (`prefers-reduced-transparency`, `forced-colors`).
18
+
19
+ ## Electron
20
+
21
+ Bundle the renderer as usual (Vite, webpack, esbuild…):
22
+
23
+ ```js
24
+ // renderer/main.js
25
+ import { defineComponents, toast } from 'motionary/components';
26
+ defineComponents();
27
+
28
+ window.api?.onSaved?.(() => toast('Saved', { type: 'success' }));
29
+ ```
30
+
31
+ ```html
32
+ <!-- renderer/index.html -->
33
+ <usa-acrylic kind="mica" style="min-height:100vh">
34
+ <usa-view-switch active="home">
35
+ <section data-view="home"><usa-typewriter words="Welcome back"></usa-typewriter></section>
36
+ <section data-view="settings"><usa-toggle checked>Start with Windows</usa-toggle></section>
37
+ </usa-view-switch>
38
+ </usa-acrylic>
39
+ ```
40
+
41
+ Without a bundler, copy `node_modules/motionary/dist/components.umd.js` next to your HTML and use `<script src="components.umd.js"></script>` — no `nodeIntegration` needed, it works with `contextIsolation: true` and `sandbox: true`.
42
+
43
+ **Content-Security-Policy.** Components inject styles via constructable stylesheets (`document.adoptedStyleSheets`), which are allowed by `style-src 'self'` without `'unsafe-inline'`. If you prefer files:
44
+
45
+ ```js
46
+ import 'motionary/components.css';
47
+ import { configureComponents, defineComponents } from 'motionary/components';
48
+ configureComponents({ injectStyles: false });
49
+ defineComponents();
50
+ ```
51
+
52
+ `<usa-grain>` and `<usa-acrylic>` use `data:` SVG noise images — allow `img-src 'self' data:`.
53
+
54
+ **Real Windows materials.** Electron ≥ 24 can draw real Mica / Acrylic behind a transparent window (`new BrowserWindow({ backgroundMaterial: 'mica' })`). Set the page background to transparent and use `<usa-acrylic tint-opacity="0.2">` for in-page panels on top of it.
55
+
56
+ ## Tauri
57
+
58
+ ```ts
59
+ // src/main.ts (Vite template)
60
+ import { defineFeedbackComponents } from 'motionary/components/feedback';
61
+ import { defineTransitionComponents } from 'motionary/components/transitions';
62
+ defineFeedbackComponents();
63
+ defineTransitionComponents();
64
+ ```
65
+
66
+ Nothing to configure in `tauri.conf.json`. For window-level Mica/Acrylic use Tauri's `windowEffects` (`"effects": ["mica"]`) with `"transparent": true`.
67
+
68
+ ## WinUI 3 / WPF / WinForms with WebView2
69
+
70
+ 1. Put your page and the bundle in a folder that is copied to the output, e.g. `wwwroot/index.html` and `wwwroot/components.umd.js` (from `node_modules/motionary/dist/`, or download it from unpkg).
71
+ 2. Map the folder to a virtual host and navigate to it:
72
+
73
+ ```csharp
74
+ // WinUI 3 (C#)
75
+ await MyWebView.EnsureCoreWebView2Async();
76
+ MyWebView.CoreWebView2.SetVirtualHostNameToFolderMapping(
77
+ "app.local", Path.Combine(AppContext.BaseDirectory, "wwwroot"),
78
+ CoreWebView2HostResourceAccessKind.Allow);
79
+ MyWebView.Source = new Uri("https://app.local/index.html");
80
+ ```
81
+
82
+ ```html
83
+ <!-- wwwroot/index.html -->
84
+ <!doctype html>
85
+ <meta name="color-scheme" content="light dark">
86
+ <script src="components.umd.js"></script>
87
+ <usa-progress id="p" value="0" label="Installing"></usa-progress>
88
+ <usa-spinner kind="fluent"></usa-spinner>
89
+ <script>
90
+ // messages from C#: CoreWebView2.PostWebMessageAsJson("{\"progress\":42}")
91
+ chrome.webview.addEventListener('message', (e) => (p.value = e.data.progress));
92
+ </script>
93
+ ```
94
+
95
+ Talk back to the host with `chrome.webview.postMessage(...)` from component events, e.g.
96
+ `dialog.addEventListener('usa:close', (e) => chrome.webview.postMessage({ closed: e.detail.returnValue }))`.
97
+
98
+ For a transparent WebView2 over a Mica window, set `DefaultBackgroundColor` to `Transparent` and keep the page background transparent.
99
+
100
+ ## PWA
101
+
102
+ Link the bundle (or import it in your module graph) and install the site from Edge/Chrome. Add `"display": "standalone"` (or `"window-controls-overlay"` for a custom title bar) to the manifest; the components behave exactly as on the web.
103
+
104
+ ## Performance checklist for desktop UIs
105
+
106
+ - Register only what you use (`define<Category>Components()` or single `define*()` calls) to keep start-up light.
107
+ - Background effects (`<usa-aurora>`, `<usa-particles>`, `<usa-marquee>`) stop animating when off-screen and when the window is hidden/minimised (`document.hidden`).
108
+ - All motion runs on the compositor (`transform` / `opacity`), so it stays smooth on integrated GPUs and in battery-saver mode; call `configureComponents({ reducedMotion: 'reduce' })` to force the calm variants (e.g. for a "Reduce animations" toggle in your app settings).
109
+
110
+ ## WinUI 3 sample app + Fluent preset (v2.8)
111
+
112
+ [`examples/webview2-winui/`](../examples/webview2-winui/) is a complete WinUI 3 app (Windows App SDK, native **Mica** backdrop, full-window WebView2 with `SetVirtualHostNameToFolderMapping`) whose UI is a plain `index.html` using `components.umd.js`.
113
+
114
+ ```js
115
+ import { fluentPreset } from 'motionary/components/background';
116
+ const off = fluentPreset({ reveal: true, mica: true }); // Fluent variant + Mica-style bg + Acrylic + Reveal highlight
117
+ ```
118
+
119
+ `fluentPreset()` sets `variant="fluent"` page-wide (Segoe UI Variable, Windows 11 accent `#0067c0` / `#4cc2ff` dark, 8 px radii), tints the body like Mica (skip with `mica: false` when the host window already uses `MicaBackdrop`), turns `.usa-acrylic` / `[data-acrylic]` into Acrylic surfaces and adds Reveal highlight to buttons and `[data-fluent-reveal]` items. Reduced motion / reduced transparency / high contrast fall back to solid materials without Reveal tracking.