motionary 15.3.0 → 15.9.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 (1004) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +1 -1
  3. package/README_ja.md +1 -1
  4. package/README_zh.md +1 -1
  5. package/bin/motionary-mcp.mjs +35 -2
  6. package/bin/motionary.mjs +109 -1
  7. package/bin/public-paths.mjs +4 -0
  8. package/dist/chunks/{anim-image-B0z4979Y.cjs → anim-image-BscH1SqI.cjs} +2 -2
  9. package/dist/chunks/{anim-image-CWuge6hI.js → anim-image-HCHGeBav.js} +2 -2
  10. package/dist/chunks/audio-CWxlWX4e.js +1 -1
  11. package/dist/chunks/audio-D0LwPShE.cjs +1 -1
  12. package/dist/chunks/badge-wall-Bj-RRR7j.js +1 -1
  13. package/dist/chunks/badge-wall-CITexuW7.cjs +1 -1
  14. package/dist/chunks/base-BvH4nAcv.cjs +1 -1
  15. package/dist/chunks/base-QrtwTUOO.js +1 -1
  16. package/dist/chunks/bg-generator-CML8tPN8.cjs +1 -1
  17. package/dist/chunks/bg-generator-Dj1hH67O.js +1 -1
  18. package/dist/chunks/bind-B_CTL6Qn.js +1 -1
  19. package/dist/chunks/bind-Ui43-n2d.cjs +1 -1
  20. package/dist/chunks/builtins-DQ_KD-84.js +1 -1
  21. package/dist/chunks/builtins-DweCp29Z.cjs +1 -1
  22. package/dist/chunks/carousel-DEgoYGFx.js +1 -1
  23. package/dist/chunks/carousel-DU3rHTq0.cjs +1 -1
  24. package/dist/chunks/cart-drawer-C0pY0dmc.js +1 -1
  25. package/dist/chunks/cart-drawer-CkFMKMhx.cjs +1 -1
  26. package/dist/chunks/code-export-B-eHxa4Z.js +1 -1
  27. package/dist/chunks/code-export-PdGSl9WE.cjs +1 -1
  28. package/dist/chunks/color-picker-B_xWVH8H.cjs +1 -1
  29. package/dist/chunks/color-picker-D15wk7nJ.js +1 -1
  30. package/dist/chunks/command-palette-BDNe1gMK.js +1 -1
  31. package/dist/chunks/command-palette-ISetAeX1.cjs +1 -1
  32. package/dist/chunks/core-BgR-tTTI.js +1 -1
  33. package/dist/chunks/core-BjcOCpJt.cjs +1 -1
  34. package/dist/chunks/core-CC1UXXEC.js +1 -1
  35. package/dist/chunks/core-DbAYRKnS.cjs +1 -1
  36. package/dist/chunks/core-Dj6iomdc.js +1 -1
  37. package/dist/chunks/core-DjjKLmZ6.cjs +1 -1
  38. package/dist/chunks/countdown-CG0Ihedq.js +1 -1
  39. package/dist/chunks/countdown-RQViryt7.cjs +1 -1
  40. package/dist/chunks/date-picker-BgApzPNn.cjs +1 -1
  41. package/dist/chunks/date-picker-DdlDcukY.js +1 -1
  42. package/dist/chunks/ease-HwYZnZat.cjs +1 -1
  43. package/dist/chunks/ease-XN8_0sXu.js +1 -1
  44. package/dist/chunks/equalizer--Sk1CWfZ.js +1 -1
  45. package/dist/chunks/equalizer-_eD_ZdCl.cjs +1 -1
  46. package/dist/chunks/festival-banner-BBqV8cdf.js +1 -1
  47. package/dist/chunks/festival-banner-Bs18K0MJ.cjs +1 -1
  48. package/dist/chunks/field-DDv6HlpL.js +1 -1
  49. package/dist/chunks/field-Dwq8-CLN.cjs +1 -1
  50. package/dist/chunks/format-DrRrPbjl.cjs +1 -1
  51. package/dist/chunks/format-efFi6HuG.js +1 -1
  52. package/dist/chunks/fx-DaVuB89C.cjs +1 -1
  53. package/dist/chunks/fx-cO_b2EVv.js +1 -1
  54. package/dist/chunks/generative-BKoxWOSP.cjs +1 -1
  55. package/dist/chunks/generative-BNmS-QUD.js +1 -1
  56. package/dist/chunks/{gl-scene-o18Mdd0i.cjs → gl-scene-BKzlNb4E.cjs} +2 -2
  57. package/dist/chunks/{gl-scene-D7pGXpdm.js → gl-scene-DWEdwSYk.js} +2 -2
  58. package/dist/chunks/globe-DA0jyb6s.cjs +1 -1
  59. package/dist/chunks/globe-l0QidRYi.js +1 -1
  60. package/dist/chunks/gpu-B5AZJvCt.js +1 -1
  61. package/dist/chunks/gpu-C2C6iBQC.cjs +1 -1
  62. package/dist/chunks/gpu-particles-BCpT6_0b.js +1 -1
  63. package/dist/chunks/gpu-particles-wEO_rds1.cjs +1 -1
  64. package/dist/chunks/history-6uuzTeIv.js +1 -1
  65. package/dist/chunks/history-CLzpNgGy.cjs +1 -1
  66. package/dist/chunks/index-C9_FEsfz.cjs +1 -1
  67. package/dist/chunks/index-Pkno706C.js +1 -1
  68. package/dist/chunks/index-tags-B-JBecYg.js +1 -1
  69. package/dist/chunks/index-tags-hLIF2Clq.cjs +1 -1
  70. package/dist/chunks/key-click-BLm3BI8_.js +1 -1
  71. package/dist/chunks/key-click-v7I4K5Sr.cjs +1 -1
  72. package/dist/chunks/{keyframes-CF5ounkl.cjs → keyframes-Bk4ysJwz.cjs} +2 -2
  73. package/dist/chunks/{keyframes-qF612S3c.js → keyframes-DmwFPNdS.js} +2 -2
  74. package/dist/chunks/leaderboard-CbiWHJt6.js +1 -1
  75. package/dist/chunks/leaderboard-DvSSQ8o3.cjs +1 -1
  76. package/dist/chunks/location-card-BZn9anlf.js +1 -1
  77. package/dist/chunks/location-card-DSPTApUe.cjs +1 -1
  78. package/dist/chunks/lottie-icon-BoxkukMd.cjs +1 -1
  79. package/dist/chunks/lottie-icon-DeHawSTn.js +1 -1
  80. package/dist/chunks/{lottie-player-C0sIUD8N.cjs → lottie-player-CN-D4xgN.cjs} +2 -2
  81. package/dist/chunks/{lottie-player-ungwR9HV.js → lottie-player-x3lwdAOs.js} +2 -2
  82. package/dist/chunks/lyrics-CRB7dA1j.cjs +1 -1
  83. package/dist/chunks/lyrics-DVbmLBlN.js +1 -1
  84. package/dist/chunks/manifest-B0WJg6hn.js +1 -1
  85. package/dist/chunks/manifest-xr3WET80.cjs +1 -1
  86. package/dist/chunks/menu-CZ1zHTT9.cjs +1 -1
  87. package/dist/chunks/menu-CnQ_M2MQ.js +1 -1
  88. package/dist/chunks/menu-toggle-5XOYiIyd.js +1 -1
  89. package/dist/chunks/menu-toggle-DGXN4VsN.cjs +1 -1
  90. package/dist/chunks/nav-morph-C4rD3wrU.cjs +1 -1
  91. package/dist/chunks/nav-morph-ziuI5hHS.js +1 -1
  92. package/dist/chunks/otp-Cb48zoUe.js +1 -1
  93. package/dist/chunks/otp-DUyEWYMi.cjs +1 -1
  94. package/dist/chunks/pagination-BIufB-g3.js +1 -1
  95. package/dist/chunks/pagination-DHmYZZU9.cjs +1 -1
  96. package/dist/chunks/{physics-playground-rgctMsMe.js → physics-playground-BhGV5Hge.js} +2 -2
  97. package/dist/chunks/{physics-playground-COwtLu8i.cjs → physics-playground-CnOReDY0.cjs} +2 -2
  98. package/dist/chunks/play-CQqgxhgJ.js +1 -1
  99. package/dist/chunks/play-DCeKlDqE.cjs +1 -1
  100. package/dist/chunks/player-core-CeaR3esR.cjs +1 -1
  101. package/dist/chunks/player-core-DAEKafsQ.js +1 -1
  102. package/dist/chunks/presence-C-dO1CU4.js +1 -1
  103. package/dist/chunks/presence-DAthlALi.cjs +1 -1
  104. package/dist/chunks/presets-BYBVJVeP.js +1 -1
  105. package/dist/chunks/presets-CUHys3sK.cjs +1 -1
  106. package/dist/chunks/preview-CyTKsXQP.cjs +1 -1
  107. package/dist/chunks/preview-UQjXLU7f.js +1 -1
  108. package/dist/chunks/prize-wheel-emDopI5c.cjs +1 -1
  109. package/dist/chunks/prize-wheel-xiuulNSI.js +1 -1
  110. package/dist/chunks/product-gallery-BoiBGX9H.js +1 -1
  111. package/dist/chunks/product-gallery-CKtSVhZk.cjs +1 -1
  112. package/dist/chunks/progress-ring-BsEz1MN3.js +1 -1
  113. package/dist/chunks/progress-ring-C75O4MUi.cjs +1 -1
  114. package/dist/chunks/project-Blmkuhzk.js +1 -1
  115. package/dist/chunks/project-CX5rdp4c.cjs +1 -1
  116. package/dist/chunks/prop-panel-DFqga6H5.cjs +1 -1
  117. package/dist/chunks/prop-panel-DqIbmWmc.js +1 -1
  118. package/dist/chunks/radar-D-bZRrgs.cjs +1 -1
  119. package/dist/chunks/radar-t201zj2r.js +1 -1
  120. package/dist/chunks/reactions-BL2iO8iy.cjs +1 -1
  121. package/dist/chunks/reactions-CX-_6Suh.js +1 -1
  122. package/dist/chunks/registry-B1ipgYF7.js +1 -1
  123. package/dist/chunks/registry-CibnX7Ui.cjs +1 -1
  124. package/dist/chunks/{registry-CzFXHzUW.cjs → registry-DNhh5i4q.cjs} +2 -2
  125. package/dist/chunks/{registry-BipVzkQ6.js → registry-Vz-UooRN.js} +2 -2
  126. package/dist/chunks/retro-button-CPAMUUZ2.js +1 -1
  127. package/dist/chunks/retro-button-DrrBZ6w8.cjs +1 -1
  128. package/dist/chunks/rive-D6X4J0Mi.cjs +1 -1
  129. package/dist/chunks/rive-uSPb8arE.js +1 -1
  130. package/dist/chunks/{runtime-link-B3vMMXNb.cjs → runtime-link-C9fXED4A.cjs} +2 -2
  131. package/dist/chunks/{runtime-link-TCk8gbFK.js → runtime-link-CnsMVtL5.js} +2 -2
  132. package/dist/chunks/scene-C4h75wjo.cjs +1 -1
  133. package/dist/chunks/scene-Dn6a9Id1.js +1 -1
  134. package/dist/chunks/scroll-driven-CQbwzCdn.cjs +1 -1
  135. package/dist/chunks/scroll-driven-LghshrWq.js +1 -1
  136. package/dist/chunks/{scroll-scene-sI2itqAt.js → scroll-scene-CYChBOFX.js} +3 -3
  137. package/dist/chunks/{scroll-scene-uUgF4u31.cjs → scroll-scene-DF9Xe5Wi.cjs} +3 -3
  138. package/dist/chunks/segmented-CpB4mKIn.cjs +1 -1
  139. package/dist/chunks/segmented-KPw5KH1W.js +1 -1
  140. package/dist/chunks/shader-backdrop-BodjXMhw.cjs +1 -1
  141. package/dist/chunks/shader-backdrop-JPI5yk7O.js +1 -1
  142. package/dist/chunks/shared-Bf72wLyt.cjs +1 -1
  143. package/dist/chunks/shared-CkKHWrtJ.js +1 -1
  144. package/dist/chunks/shared-jkgRH-Hx.cjs +1 -1
  145. package/dist/chunks/shared-o9CtwHmi.js +1 -1
  146. package/dist/chunks/sheet-B38ylIEW.cjs +1 -1
  147. package/dist/chunks/sheet-CheLvhW_.js +1 -1
  148. package/dist/chunks/sign-DvZ1jHxE.js +1 -1
  149. package/dist/chunks/sign-RAkQIWrM.cjs +1 -1
  150. package/dist/chunks/skeleton-reveal-DDDWXmcC.js +1 -1
  151. package/dist/chunks/skeleton-reveal-Dsd3Wp0n.cjs +1 -1
  152. package/dist/chunks/sparkline-DeKhZpVo.cjs +1 -1
  153. package/dist/chunks/sparkline-u-Oxv7YR.js +1 -1
  154. package/dist/chunks/spring-XEl_diDJ.cjs +1 -1
  155. package/dist/chunks/spring-YKWCyYGf.js +1 -1
  156. package/dist/chunks/stagger-B9sKPwQB.js +1 -1
  157. package/dist/chunks/stagger-DFKwqOQG.cjs +1 -1
  158. package/dist/chunks/suggestion-chips-BlX6Fmt-.js +1 -1
  159. package/dist/chunks/suggestion-chips-CAcbFTr4.cjs +1 -1
  160. package/dist/chunks/switch-DiTlApGd.cjs +1 -1
  161. package/dist/chunks/switch-kilxiPM3.js +1 -1
  162. package/dist/chunks/tab-bar-BBlVAqbq.cjs +1 -1
  163. package/dist/chunks/tab-bar-CBtsdbcT.js +1 -1
  164. package/dist/chunks/{ticker-BMw46hu1.cjs → ticker-ByIIDwbV.cjs} +2 -2
  165. package/dist/chunks/{ticker-COpI6nJd.js → ticker-DiXl4Su3.js} +2 -2
  166. package/dist/chunks/tip-UhHR-P4Q.js +1 -1
  167. package/dist/chunks/tip-VGS3qAUm.cjs +1 -1
  168. package/dist/chunks/toast-stack-B_bO4fVO.js +1 -1
  169. package/dist/chunks/toast-stack-DprisNp_.cjs +1 -1
  170. package/dist/chunks/{tween-QCkXk8v-.js → tween-BWZ6Lovd.js} +2 -2
  171. package/dist/chunks/{tween-CXejUXdH.cjs → tween-js3sOVsg.cjs} +2 -2
  172. package/dist/chunks/upload-progress-CEAWkP-p.cjs +1 -1
  173. package/dist/chunks/upload-progress-kJz9Mw10.js +1 -1
  174. package/dist/chunks/v2-AmFfWfpi.js +1 -1
  175. package/dist/chunks/v2-BpVfM1Uo.cjs +1 -1
  176. package/dist/chunks/variants-BtqEJuki.cjs +1 -1
  177. package/dist/chunks/variants-CDG1W49e.js +1 -1
  178. package/dist/chunks/viewport-BAXHhZLV.js +1 -1
  179. package/dist/chunks/viewport-EFYGqMNa.cjs +1 -1
  180. package/dist/chunks/voice-button-9UauxvT9.cjs +1 -1
  181. package/dist/chunks/voice-button-leTq2whK.js +1 -1
  182. package/dist/chunks/weather-card-4Eg6e43D.cjs +1 -1
  183. package/dist/chunks/weather-card-CL5yJ4rw.js +1 -1
  184. package/dist/chunks/worker-canvas-BMBXAFWp.cjs +1 -1
  185. package/dist/chunks/worker-canvas-RGGXvIxH.js +1 -1
  186. package/dist/chunks/xp-bar-DgVUXJYh.js +1 -1
  187. package/dist/chunks/xp-bar-DkWfCTfB.cjs +1 -1
  188. package/dist/components/a11y.cjs +1 -1
  189. package/dist/components/a11y.js +1 -1
  190. package/dist/components/ai.cjs +1 -1
  191. package/dist/components/ai.js +1 -1
  192. package/dist/components/angular.cjs +1 -1
  193. package/dist/components/angular.js +1 -1
  194. package/dist/components/background.cjs +1 -1
  195. package/dist/components/background.js +1 -1
  196. package/dist/components/bridge.cjs +1 -1
  197. package/dist/components/bridge.js +1 -1
  198. package/dist/components/cards.cjs +1 -1
  199. package/dist/components/cards.js +1 -1
  200. package/dist/components/click.cjs +1 -1
  201. package/dist/components/click.js +1 -1
  202. package/dist/components/core.cjs +1 -1
  203. package/dist/components/core.js +1 -1
  204. package/dist/components/depth.cjs +1 -1
  205. package/dist/components/depth.js +1 -1
  206. package/dist/components/design.cjs +1 -1
  207. package/dist/components/design.js +1 -1
  208. package/dist/components/dotlottie.cjs +3 -3
  209. package/dist/components/dotlottie.js +3 -3
  210. package/dist/components/dsl.cjs +1 -1
  211. package/dist/components/dsl.js +1 -1
  212. package/dist/components/effects.cjs +1 -1
  213. package/dist/components/effects.js +1 -1
  214. package/dist/components/engine.cjs +1 -1
  215. package/dist/components/engine.js +1 -1
  216. package/dist/components/feedback.cjs +1 -1
  217. package/dist/components/feedback.js +1 -1
  218. package/dist/components/fx-3d.cjs +1 -1
  219. package/dist/components/fx-3d.js +1 -1
  220. package/dist/components/fx-ai.cjs +1 -1
  221. package/dist/components/fx-ai.js +1 -1
  222. package/dist/components/fx-chart.cjs +1 -1
  223. package/dist/components/fx-chart.js +1 -1
  224. package/dist/components/fx-cinema.cjs +1 -1
  225. package/dist/components/fx-cinema.js +1 -1
  226. package/dist/components/fx-cyber.cjs +1 -1
  227. package/dist/components/fx-cyber.js +1 -1
  228. package/dist/components/fx-festival.cjs +1 -1
  229. package/dist/components/fx-festival.js +1 -1
  230. package/dist/components/fx-focus.cjs +1 -1
  231. package/dist/components/fx-focus.js +1 -1
  232. package/dist/components/fx-form.cjs +1 -1
  233. package/dist/components/fx-form.js +1 -1
  234. package/dist/components/fx-game.cjs +1 -1
  235. package/dist/components/fx-game.js +1 -1
  236. package/dist/components/fx-genart.cjs +1 -1
  237. package/dist/components/fx-genart.js +1 -1
  238. package/dist/components/fx-geo.cjs +1 -1
  239. package/dist/components/fx-geo.js +1 -1
  240. package/dist/components/fx-gesture.cjs +1 -1
  241. package/dist/components/fx-gesture.js +1 -1
  242. package/dist/components/fx-gpu.cjs +1 -1
  243. package/dist/components/fx-gpu.js +1 -1
  244. package/dist/components/fx-light.cjs +1 -1
  245. package/dist/components/fx-light.js +1 -1
  246. package/dist/components/fx-lottie.cjs +1 -1
  247. package/dist/components/fx-lottie.js +1 -1
  248. package/dist/components/fx-morph.cjs +1 -1
  249. package/dist/components/fx-morph.js +1 -1
  250. package/dist/components/fx-music.cjs +1 -1
  251. package/dist/components/fx-music.js +1 -1
  252. package/dist/components/fx-organic.cjs +1 -1
  253. package/dist/components/fx-organic.js +1 -1
  254. package/dist/components/fx-paper.cjs +1 -1
  255. package/dist/components/fx-paper.js +1 -1
  256. package/dist/components/fx-perf.cjs +1 -1
  257. package/dist/components/fx-perf.js +1 -1
  258. package/dist/components/fx-physics.cjs +1 -1
  259. package/dist/components/fx-physics.js +1 -1
  260. package/dist/components/fx-retro.cjs +1 -1
  261. package/dist/components/fx-retro.js +1 -1
  262. package/dist/components/fx-safe.cjs +1 -1
  263. package/dist/components/fx-safe.js +1 -1
  264. package/dist/components/fx-shop.cjs +1 -1
  265. package/dist/components/fx-shop.js +1 -1
  266. package/dist/components/fx-social.cjs +1 -1
  267. package/dist/components/fx-social.js +1 -1
  268. package/dist/components/fx-spatial.cjs +1 -1
  269. package/dist/components/fx-spatial.js +1 -1
  270. package/dist/components/fx-surface.cjs +1 -1
  271. package/dist/components/fx-surface.js +1 -1
  272. package/dist/components/fx-text.cjs +1 -1
  273. package/dist/components/fx-text.js +1 -1
  274. package/dist/components/fx-transitions.cjs +1 -1
  275. package/dist/components/fx-transitions.js +1 -1
  276. package/dist/components/fx-video.cjs +1 -1
  277. package/dist/components/fx-video.js +1 -1
  278. package/dist/components/fx-weather.cjs +1 -1
  279. package/dist/components/fx-weather.js +1 -1
  280. package/dist/components/fx.cjs +1 -1
  281. package/dist/components/fx.js +1 -1
  282. package/dist/components/fx2.cjs +1 -1
  283. package/dist/components/fx2.js +1 -1
  284. package/dist/components/gesture.cjs +1 -1
  285. package/dist/components/gesture.js +1 -1
  286. package/dist/components/gl-model.cjs +3 -3
  287. package/dist/components/gl-model.js +3 -3
  288. package/dist/components/gl-pool.cjs +1 -1
  289. package/dist/components/gl-pool.js +1 -1
  290. package/dist/components/interaction.cjs +1 -1
  291. package/dist/components/interaction.js +1 -1
  292. package/dist/components/jsx.cjs +1 -1
  293. package/dist/components/jsx.js +1 -1
  294. package/dist/components/layout.cjs +1 -1
  295. package/dist/components/layout.js +1 -1
  296. package/dist/components/lazy.cjs +1 -1
  297. package/dist/components/lazy.js +1 -1
  298. package/dist/components/lite.cjs +1 -1
  299. package/dist/components/lite.js +1 -1
  300. package/dist/components/marketplace.cjs +1 -1
  301. package/dist/components/marketplace.js +1 -1
  302. package/dist/components/motion-layout.cjs +1 -1
  303. package/dist/components/motion-layout.js +1 -1
  304. package/dist/components/motion-scene.cjs +1 -1
  305. package/dist/components/motion-scene.js +1 -1
  306. package/dist/components/motion-tokens.cjs +1 -1
  307. package/dist/components/motion-tokens.js +1 -1
  308. package/dist/components/motion.cjs +1 -1
  309. package/dist/components/motion.js +1 -1
  310. package/dist/components/native.cjs +1 -1
  311. package/dist/components/native.js +1 -1
  312. package/dist/components/offscreen.cjs +1 -1
  313. package/dist/components/offscreen.js +1 -1
  314. package/dist/components/packs.cjs +1 -1
  315. package/dist/components/packs.js +1 -1
  316. package/dist/components/page.cjs +1 -1
  317. package/dist/components/page.js +1 -1
  318. package/dist/components/perf-tasks.cjs +1 -1
  319. package/dist/components/perf-tasks.js +1 -1
  320. package/dist/components/perf.cjs +1 -1
  321. package/dist/components/perf.js +1 -1
  322. package/dist/components/physics.cjs +1 -1
  323. package/dist/components/physics.js +1 -1
  324. package/dist/components/plugins.cjs +1 -1
  325. package/dist/components/plugins.js +1 -1
  326. package/dist/components/react.cjs +1 -1
  327. package/dist/components/react.js +1 -1
  328. package/dist/components/reveal.cjs +1 -1
  329. package/dist/components/reveal.js +1 -1
  330. package/dist/components/scene-v2.cjs +1 -1
  331. package/dist/components/scene-v2.js +1 -1
  332. package/dist/components/scene-v3-preview.cjs +584 -0
  333. package/dist/components/scene-v3-preview.d.cts +255 -0
  334. package/dist/components/scene-v3-preview.d.ts +255 -0
  335. package/dist/components/scene-v3-preview.js +572 -0
  336. package/dist/components/snap-carousel.cjs +2 -2
  337. package/dist/components/snap-carousel.js +2 -2
  338. package/dist/components/solid.cjs +1 -1
  339. package/dist/components/solid.js +1 -1
  340. package/dist/components/studio-a11y.cjs +1 -1
  341. package/dist/components/studio-a11y.js +1 -1
  342. package/dist/components/studio-ai.cjs +1 -1
  343. package/dist/components/studio-ai.js +1 -1
  344. package/dist/components/studio-app.cjs +2 -2
  345. package/dist/components/studio-app.d.cts +7 -1
  346. package/dist/components/studio-app.d.ts +7 -1
  347. package/dist/components/studio-app.js +2 -2
  348. package/dist/components/studio-assets.cjs +1 -1
  349. package/dist/components/studio-assets.js +1 -1
  350. package/dist/components/studio-canvas.cjs +1 -1
  351. package/dist/components/studio-canvas.js +1 -1
  352. package/dist/components/studio-export.cjs +1 -1
  353. package/dist/components/studio-export.js +1 -1
  354. package/dist/components/studio-native.cjs +1 -1
  355. package/dist/components/studio-native.js +1 -1
  356. package/dist/components/studio-provenance.cjs +1 -1
  357. package/dist/components/studio-provenance.js +1 -1
  358. package/dist/components/studio-store.cjs +264 -0
  359. package/dist/components/studio-store.d.cts +111 -0
  360. package/dist/components/studio-store.d.ts +111 -0
  361. package/dist/components/studio-store.js +253 -0
  362. package/dist/components/studio-templates.cjs +1 -1
  363. package/dist/components/studio-templates.js +1 -1
  364. package/dist/components/studio.cjs +14 -3
  365. package/dist/components/studio.d.cts +7 -2
  366. package/dist/components/studio.d.ts +7 -2
  367. package/dist/components/studio.js +14 -3
  368. package/dist/components/svelte.cjs +1 -1
  369. package/dist/components/svelte.js +1 -1
  370. package/dist/components/svg.cjs +1 -1
  371. package/dist/components/svg.js +1 -1
  372. package/dist/components/text.cjs +1 -1
  373. package/dist/components/text.js +1 -1
  374. package/dist/components/timeline-editor.cjs +1 -1
  375. package/dist/components/timeline-editor.js +1 -1
  376. package/dist/components/timeline.cjs +1 -1
  377. package/dist/components/timeline.js +1 -1
  378. package/dist/components/tokens.cjs +1 -1
  379. package/dist/components/tokens.js +1 -1
  380. package/dist/components/transitions.cjs +1 -1
  381. package/dist/components/transitions.js +1 -1
  382. package/dist/components/ui.cjs +1 -1
  383. package/dist/components/ui.js +1 -1
  384. package/dist/components/vue.cjs +1 -1
  385. package/dist/components/vue.js +1 -1
  386. package/dist/components/webgl.cjs +1 -1
  387. package/dist/components/webgl.js +1 -1
  388. package/dist/components/widgets.cjs +5 -5
  389. package/dist/components/widgets.js +7 -7
  390. package/dist/components.cjs +1 -1
  391. package/dist/components.js +1 -1
  392. package/dist/components.umd.js +1 -1
  393. package/dist/effects/achievement-unlock.cjs +1 -1
  394. package/dist/effects/achievement-unlock.js +1 -1
  395. package/dist/effects/aurora-veil.cjs +1 -1
  396. package/dist/effects/aurora-veil.js +1 -1
  397. package/dist/effects/badge-pop.cjs +1 -1
  398. package/dist/effects/badge-pop.js +1 -1
  399. package/dist/effects/bars-grow.cjs +1 -1
  400. package/dist/effects/bars-grow.js +1 -1
  401. package/dist/effects/beat-bounce.cjs +1 -1
  402. package/dist/effects/beat-bounce.js +1 -1
  403. package/dist/effects/blob-button.cjs +1 -1
  404. package/dist/effects/blob-button.js +1 -1
  405. package/dist/effects/bloom.cjs +1 -1
  406. package/dist/effects/bloom.js +1 -1
  407. package/dist/effects/breathe.cjs +1 -1
  408. package/dist/effects/breathe.js +1 -1
  409. package/dist/effects/brushed-metal.cjs +1 -1
  410. package/dist/effects/brushed-metal.js +1 -1
  411. package/dist/effects/camera-dolly.cjs +1 -1
  412. package/dist/effects/camera-dolly.js +1 -1
  413. package/dist/effects/card-flip-3d.cjs +1 -1
  414. package/dist/effects/card-flip-3d.js +1 -1
  415. package/dist/effects/chest-open.cjs +1 -1
  416. package/dist/effects/chest-open.js +1 -1
  417. package/dist/effects/cloth.cjs +1 -1
  418. package/dist/effects/cloth.js +1 -1
  419. package/dist/effects/coin-burst.cjs +1 -1
  420. package/dist/effects/coin-burst.js +1 -1
  421. package/dist/effects/color-pulse.cjs +1 -1
  422. package/dist/effects/color-pulse.js +1 -1
  423. package/dist/effects/crt-power.cjs +1 -1
  424. package/dist/effects/crt-power.js +1 -1
  425. package/dist/effects/crumple.cjs +1 -1
  426. package/dist/effects/crumple.js +1 -1
  427. package/dist/effects/data-decode.cjs +1 -1
  428. package/dist/effects/data-decode.js +1 -1
  429. package/dist/effects/day-cycle.cjs +1 -1
  430. package/dist/effects/day-cycle.js +1 -1
  431. package/dist/effects/depth-in.cjs +1 -1
  432. package/dist/effects/depth-in.js +1 -1
  433. package/dist/effects/depth-pop.cjs +1 -1
  434. package/dist/effects/depth-pop.js +1 -1
  435. package/dist/effects/depth-stack.cjs +1 -1
  436. package/dist/effects/depth-stack.js +1 -1
  437. package/dist/effects/dolly-in.cjs +1 -1
  438. package/dist/effects/dolly-in.js +1 -1
  439. package/dist/effects/dots-pop.cjs +1 -1
  440. package/dist/effects/dots-pop.js +1 -1
  441. package/dist/effects/field-shake.cjs +1 -1
  442. package/dist/effects/field-shake.js +1 -1
  443. package/dist/effects/field-success.cjs +1 -1
  444. package/dist/effects/field-success.js +1 -1
  445. package/dist/effects/film-burn.cjs +1 -1
  446. package/dist/effects/film-burn.js +1 -1
  447. package/dist/effects/fire.cjs +1 -1
  448. package/dist/effects/fire.js +1 -1
  449. package/dist/effects/fireflies.cjs +1 -1
  450. package/dist/effects/fireflies.js +1 -1
  451. package/dist/effects/firework-burst.cjs +1 -1
  452. package/dist/effects/firework-burst.js +1 -1
  453. package/dist/effects/flip-chars.cjs +1 -1
  454. package/dist/effects/flip-chars.js +1 -1
  455. package/dist/effects/fluid.cjs +1 -1
  456. package/dist/effects/fluid.js +1 -1
  457. package/dist/effects/fly-to-cart.cjs +1 -1
  458. package/dist/effects/fly-to-cart.js +1 -1
  459. package/dist/effects/focus-draw.cjs +1 -1
  460. package/dist/effects/focus-draw.js +1 -1
  461. package/dist/effects/focus-glow.cjs +1 -1
  462. package/dist/effects/focus-glow.js +1 -1
  463. package/dist/effects/fog.cjs +1 -1
  464. package/dist/effects/fog.js +1 -1
  465. package/dist/effects/font-breathe.cjs +1 -1
  466. package/dist/effects/font-breathe.js +1 -1
  467. package/dist/effects/form-cascade.cjs +1 -1
  468. package/dist/effects/form-cascade.js +1 -1
  469. package/dist/effects/gen-skeleton.cjs +1 -1
  470. package/dist/effects/gen-skeleton.js +1 -1
  471. package/dist/effects/glass-frost.cjs +1 -1
  472. package/dist/effects/glass-frost.js +1 -1
  473. package/dist/effects/glitch-text.cjs +1 -1
  474. package/dist/effects/glitch-text.js +1 -1
  475. package/dist/effects/globe-spin.cjs +1 -1
  476. package/dist/effects/globe-spin.js +1 -1
  477. package/dist/effects/god-rays.cjs +1 -1
  478. package/dist/effects/god-rays.js +1 -1
  479. package/dist/effects/gpu-lift.cjs +1 -1
  480. package/dist/effects/gpu-lift.js +1 -1
  481. package/dist/effects/grain-flicker.cjs +1 -1
  482. package/dist/effects/grain-flicker.js +1 -1
  483. package/dist/effects/halftone-in.cjs +1 -1
  484. package/dist/effects/halftone-in.js +1 -1
  485. package/dist/effects/highlight-sweep.cjs +1 -1
  486. package/dist/effects/highlight-sweep.js +1 -1
  487. package/dist/effects/hologram.cjs +1 -1
  488. package/dist/effects/hologram.js +1 -1
  489. package/dist/effects/hud-frame.cjs +1 -1
  490. package/dist/effects/hud-frame.js +1 -1
  491. package/dist/effects/icon-pop.cjs +1 -1
  492. package/dist/effects/icon-pop.js +1 -1
  493. package/dist/effects/icon-swap.cjs +1 -1
  494. package/dist/effects/icon-swap.js +1 -1
  495. package/dist/effects/idle-reveal.cjs +1 -1
  496. package/dist/effects/idle-reveal.js +1 -1
  497. package/dist/effects/ink.cjs +1 -1
  498. package/dist/effects/ink.js +1 -1
  499. package/dist/effects/jump-cut.cjs +1 -1
  500. package/dist/effects/jump-cut.js +1 -1
  501. package/dist/effects/kaleido.cjs +1 -1
  502. package/dist/effects/kaleido.js +1 -1
  503. package/dist/effects/label-float.cjs +1 -1
  504. package/dist/effects/label-float.js +1 -1
  505. package/dist/effects/lantern-rise.cjs +1 -1
  506. package/dist/effects/lantern-rise.js +1 -1
  507. package/dist/effects/leaves.cjs +1 -1
  508. package/dist/effects/leaves.js +1 -1
  509. package/dist/effects/letterbox.cjs +1 -1
  510. package/dist/effects/letterbox.js +1 -1
  511. package/dist/effects/level-up.cjs +1 -1
  512. package/dist/effects/level-up.js +1 -1
  513. package/dist/effects/light-follow.cjs +1 -1
  514. package/dist/effects/light-follow.js +1 -1
  515. package/dist/effects/lightning.cjs +1 -1
  516. package/dist/effects/lightning.js +1 -1
  517. package/dist/effects/line-draw.cjs +1 -1
  518. package/dist/effects/line-draw.js +1 -1
  519. package/dist/effects/liquid-text.cjs +1 -1
  520. package/dist/effects/liquid-text.js +1 -1
  521. package/dist/effects/liquid-wipe.cjs +1 -1
  522. package/dist/effects/liquid-wipe.js +1 -1
  523. package/dist/effects/lottie-play.cjs +1 -1
  524. package/dist/effects/lottie-play.js +1 -1
  525. package/dist/effects/magnet.cjs +1 -1
  526. package/dist/effects/magnet.js +1 -1
  527. package/dist/effects/marching-ants.cjs +1 -1
  528. package/dist/effects/marching-ants.js +1 -1
  529. package/dist/effects/marker-pulse.cjs +1 -1
  530. package/dist/effects/marker-pulse.js +1 -1
  531. package/dist/effects/mention-glow.cjs +1 -1
  532. package/dist/effects/mention-glow.js +1 -1
  533. package/dist/effects/mesh-drift.cjs +1 -1
  534. package/dist/effects/mesh-drift.js +1 -1
  535. package/dist/effects/message-in.cjs +1 -1
  536. package/dist/effects/message-in.js +1 -1
  537. package/dist/effects/mosaic-flip.cjs +1 -1
  538. package/dist/effects/mosaic-flip.js +1 -1
  539. package/dist/effects/neon-ignite.cjs +1 -1
  540. package/dist/effects/neon-ignite.js +1 -1
  541. package/dist/effects/neon-pulse.cjs +1 -1
  542. package/dist/effects/neon-pulse.js +1 -1
  543. package/dist/effects/neon-write.cjs +1 -1
  544. package/dist/effects/neon-write.js +1 -1
  545. package/dist/effects/neu-press.cjs +1 -1
  546. package/dist/effects/neu-press.js +1 -1
  547. package/dist/effects/noise-reveal.cjs +1 -1
  548. package/dist/effects/noise-reveal.js +1 -1
  549. package/dist/effects/number-roll.cjs +1 -1
  550. package/dist/effects/number-roll.js +1 -1
  551. package/dist/effects/orbit-camera.cjs +1 -1
  552. package/dist/effects/orbit-camera.js +1 -1
  553. package/dist/effects/orbit-in.cjs +1 -1
  554. package/dist/effects/orbit-in.js +1 -1
  555. package/dist/effects/origami.cjs +1 -1
  556. package/dist/effects/origami.js +1 -1
  557. package/dist/effects/page-curl.cjs +1 -1
  558. package/dist/effects/page-curl.js +1 -1
  559. package/dist/effects/pan-reveal.cjs +1 -1
  560. package/dist/effects/pan-reveal.js +1 -1
  561. package/dist/effects/paper-unfold.cjs +1 -1
  562. package/dist/effects/paper-unfold.js +1 -1
  563. package/dist/effects/particle-text.cjs +1 -1
  564. package/dist/effects/particle-text.js +1 -1
  565. package/dist/effects/path-morph.cjs +1 -1
  566. package/dist/effects/path-morph.js +1 -1
  567. package/dist/effects/pearlescent.cjs +1 -1
  568. package/dist/effects/pearlescent.js +1 -1
  569. package/dist/effects/pencil-sketch.cjs +1 -1
  570. package/dist/effects/pencil-sketch.js +1 -1
  571. package/dist/effects/pin-drop.cjs +1 -1
  572. package/dist/effects/pin-drop.js +1 -1
  573. package/dist/effects/pinball.cjs +1 -1
  574. package/dist/effects/pinball.js +1 -1
  575. package/dist/effects/pinch-hint.cjs +1 -1
  576. package/dist/effects/pinch-hint.js +1 -1
  577. package/dist/effects/pixelate-in.cjs +1 -1
  578. package/dist/effects/pixelate-in.js +1 -1
  579. package/dist/effects/pointer-shadow.cjs +1 -1
  580. package/dist/effects/pointer-shadow.js +1 -1
  581. package/dist/effects/portal-open.cjs +1 -1
  582. package/dist/effects/portal-open.js +1 -1
  583. package/dist/effects/price-flip.cjs +1 -1
  584. package/dist/effects/price-flip.js +1 -1
  585. package/dist/effects/product-spin.cjs +1 -1
  586. package/dist/effects/product-spin.js +1 -1
  587. package/dist/effects/rack-focus.cjs +1 -1
  588. package/dist/effects/rack-focus.js +1 -1
  589. package/dist/effects/radial-spectrum.cjs +1 -1
  590. package/dist/effects/radial-spectrum.js +1 -1
  591. package/dist/effects/rain-glass.cjs +1 -1
  592. package/dist/effects/rain-glass.js +1 -1
  593. package/dist/effects/reaction-burst.cjs +1 -1
  594. package/dist/effects/reaction-burst.js +1 -1
  595. package/dist/effects/read-receipt.cjs +1 -1
  596. package/dist/effects/read-receipt.js +1 -1
  597. package/dist/effects/refraction.cjs +1 -1
  598. package/dist/effects/refraction.js +1 -1
  599. package/dist/effects/ring-sweep.cjs +1 -1
  600. package/dist/effects/ring-sweep.js +1 -1
  601. package/dist/effects/ripple-dissolve.cjs +1 -1
  602. package/dist/effects/ripple-dissolve.js +1 -1
  603. package/dist/effects/rope.cjs +1 -1
  604. package/dist/effects/rope.js +1 -1
  605. package/dist/effects/route-draw.cjs +1 -1
  606. package/dist/effects/route-draw.js +1 -1
  607. package/dist/effects/safe-fade.cjs +1 -1
  608. package/dist/effects/safe-fade.js +1 -1
  609. package/dist/effects/sakura.cjs +1 -1
  610. package/dist/effects/sakura.js +1 -1
  611. package/dist/effects/sale-shine.cjs +1 -1
  612. package/dist/effects/sale-shine.js +1 -1
  613. package/dist/effects/sankey-flow.cjs +1 -1
  614. package/dist/effects/sankey-flow.js +1 -1
  615. package/dist/effects/scanline-sweep.cjs +1 -1
  616. package/dist/effects/scanline-sweep.js +1 -1
  617. package/dist/effects/shatter.cjs +1 -1
  618. package/dist/effects/shatter.js +1 -1
  619. package/dist/effects/smoke.cjs +1 -1
  620. package/dist/effects/smoke.js +1 -1
  621. package/dist/effects/snowfall.cjs +1 -1
  622. package/dist/effects/snowfall.js +1 -1
  623. package/dist/effects/soft-body.cjs +1 -1
  624. package/dist/effects/soft-body.js +1 -1
  625. package/dist/effects/sound-particles.cjs +1 -1
  626. package/dist/effects/sound-particles.js +1 -1
  627. package/dist/effects/spatial-float.cjs +1 -1
  628. package/dist/effects/spatial-float.js +1 -1
  629. package/dist/effects/spectrum-mirror.cjs +1 -1
  630. package/dist/effects/spectrum-mirror.js +1 -1
  631. package/dist/effects/splash.cjs +1 -1
  632. package/dist/effects/splash.js +1 -1
  633. package/dist/effects/spooky-float.cjs +1 -1
  634. package/dist/effects/spooky-float.js +1 -1
  635. package/dist/effects/stock-pulse.cjs +1 -1
  636. package/dist/effects/stock-pulse.js +1 -1
  637. package/dist/effects/stream-text.cjs +1 -1
  638. package/dist/effects/stream-text.js +1 -1
  639. package/dist/effects/stroke-draw.cjs +1 -1
  640. package/dist/effects/stroke-draw.js +1 -1
  641. package/dist/effects/success-check.cjs +1 -1
  642. package/dist/effects/success-check.js +1 -1
  643. package/dist/effects/swipe-hint.cjs +1 -1
  644. package/dist/effects/swipe-hint.js +1 -1
  645. package/dist/effects/text-trail.cjs +1 -1
  646. package/dist/effects/text-trail.js +1 -1
  647. package/dist/effects/thinking-glow.cjs +1 -1
  648. package/dist/effects/thinking-glow.js +1 -1
  649. package/dist/effects/tilt-wobble.cjs +1 -1
  650. package/dist/effects/tilt-wobble.js +1 -1
  651. package/dist/effects/typing-dots.cjs +1 -1
  652. package/dist/effects/typing-dots.js +1 -1
  653. package/dist/effects/underline-sweep.cjs +1 -1
  654. package/dist/effects/underline-sweep.js +1 -1
  655. package/dist/effects/vhs-glitch.cjs +1 -1
  656. package/dist/effects/vhs-glitch.js +1 -1
  657. package/dist/effects/vine-grow.cjs +1 -1
  658. package/dist/effects/vine-grow.js +1 -1
  659. package/dist/effects/vinyl-spin.cjs +1 -1
  660. package/dist/effects/vinyl-spin.js +1 -1
  661. package/dist/effects/voice-wave.cjs +1 -1
  662. package/dist/effects/voice-wave.js +1 -1
  663. package/dist/effects/water-drop.cjs +1 -1
  664. package/dist/effects/water-drop.js +1 -1
  665. package/dist/effects/watercolor.cjs +1 -1
  666. package/dist/effects/watercolor.js +1 -1
  667. package/dist/effects/waveform-scope.cjs +1 -1
  668. package/dist/effects/waveform-scope.js +1 -1
  669. package/dist/effects/xmas-snow.cjs +1 -1
  670. package/dist/effects/xmas-snow.js +1 -1
  671. package/dist/effects/xp-gain.cjs +1 -1
  672. package/dist/effects/xp-gain.js +1 -1
  673. package/dist/effects/y2k-shine.cjs +1 -1
  674. package/dist/effects/y2k-shine.js +1 -1
  675. package/dist/element.cjs +1 -1
  676. package/dist/element.js +1 -1
  677. package/dist/element.umd.js +1 -1
  678. package/dist/index.cjs +1 -1
  679. package/dist/index.js +1 -1
  680. package/dist/index.umd.js +1 -1
  681. package/dist/llms.txt +1 -1
  682. package/dist/manifest.json +1 -1
  683. package/dist/presets/extended.cjs +1 -1
  684. package/dist/presets/extended.js +1 -1
  685. package/dist/presets-extended.umd.js +1 -1
  686. package/dist/react.cjs +1 -1
  687. package/dist/react.js +1 -1
  688. package/dist/runtime/drag-snap.cjs +2 -2
  689. package/dist/runtime/drag-snap.iife.js +1 -1
  690. package/dist/runtime/drag-snap.js +2 -2
  691. package/dist/runtime/format-apng.cjs +3 -3
  692. package/dist/runtime/format-apng.iife.js +1 -1
  693. package/dist/runtime/format-apng.js +3 -3
  694. package/dist/runtime/format-css.cjs +3 -3
  695. package/dist/runtime/format-css.iife.js +1 -1
  696. package/dist/runtime/format-css.js +3 -3
  697. package/dist/runtime/format-gif.cjs +3 -3
  698. package/dist/runtime/format-gif.iife.js +1 -1
  699. package/dist/runtime/format-gif.js +3 -3
  700. package/dist/runtime/format-gltf.cjs +2 -2
  701. package/dist/runtime/format-gltf.iife.js +1 -1
  702. package/dist/runtime/format-gltf.js +2 -2
  703. package/dist/runtime/format-motion.cjs +4 -4
  704. package/dist/runtime/format-motion.iife.js +1 -1
  705. package/dist/runtime/format-motion.js +4 -4
  706. package/dist/runtime/format-obj.cjs +2 -2
  707. package/dist/runtime/format-obj.iife.js +1 -1
  708. package/dist/runtime/format-obj.js +2 -2
  709. package/dist/runtime/format-scene.cjs +2 -2
  710. package/dist/runtime/format-scene.iife.js +1 -1
  711. package/dist/runtime/format-scene.js +2 -2
  712. package/dist/runtime/format-sprite.cjs +3 -3
  713. package/dist/runtime/format-sprite.iife.js +1 -1
  714. package/dist/runtime/format-sprite.js +3 -3
  715. package/dist/runtime/format-svg.cjs +3 -3
  716. package/dist/runtime/format-svg.iife.js +1 -1
  717. package/dist/runtime/format-svg.js +3 -3
  718. package/dist/runtime/format-webp.cjs +3 -3
  719. package/dist/runtime/format-webp.iife.js +1 -1
  720. package/dist/runtime/format-webp.js +3 -3
  721. package/dist/runtime/gl.cjs +2 -2
  722. package/dist/runtime/gl.iife.js +1 -1
  723. package/dist/runtime/gl.js +2 -2
  724. package/dist/runtime/gltf-anim.cjs +2 -2
  725. package/dist/runtime/gltf-anim.iife.js +1 -1
  726. package/dist/runtime/gltf-anim.js +2 -2
  727. package/dist/runtime/gltf-decoders.cjs +2 -2
  728. package/dist/runtime/gltf-decoders.iife.js +1 -1
  729. package/dist/runtime/gltf-decoders.js +2 -2
  730. package/dist/runtime/lottie-state.cjs +2 -2
  731. package/dist/runtime/lottie-state.iife.js +1 -1
  732. package/dist/runtime/lottie-state.js +2 -2
  733. package/dist/runtime/physics.cjs +2 -2
  734. package/dist/runtime/physics.iife.js +1 -1
  735. package/dist/runtime/physics.js +2 -2
  736. package/dist/runtime/scroll.cjs +3 -3
  737. package/dist/runtime/scroll.iife.js +1 -1
  738. package/dist/runtime/scroll.js +3 -3
  739. package/dist/runtime/smooth.cjs +2 -2
  740. package/dist/runtime/smooth.iife.js +1 -1
  741. package/dist/runtime/smooth.js +2 -2
  742. package/dist/runtime/text.cjs +2 -2
  743. package/dist/runtime/text.iife.js +1 -1
  744. package/dist/runtime/text.js +2 -2
  745. package/dist/runtime/vector.cjs +3 -3
  746. package/dist/runtime/vector.iife.js +1 -1
  747. package/dist/runtime/vector.js +3 -3
  748. package/dist/runtime.cjs +4 -4
  749. package/dist/runtime.d.cts +1 -1
  750. package/dist/runtime.d.ts +1 -1
  751. package/dist/runtime.iife.js +2 -2
  752. package/dist/runtime.js +6 -6
  753. package/dist/solid.cjs +1 -1
  754. package/dist/solid.js +1 -1
  755. package/dist/svelte.cjs +1 -1
  756. package/dist/svelte.js +1 -1
  757. package/dist/vue.cjs +1 -1
  758. package/dist/vue.js +1 -1
  759. package/dist/widgets/add-to-cart.cjs +1 -1
  760. package/dist/widgets/add-to-cart.js +1 -1
  761. package/dist/widgets/badge-wall.cjs +1 -1
  762. package/dist/widgets/badge-wall.js +1 -1
  763. package/dist/widgets/bar-chart.cjs +1 -1
  764. package/dist/widgets/bar-chart.js +1 -1
  765. package/dist/widgets/bg-generator.cjs +1 -1
  766. package/dist/widgets/bg-generator.js +1 -1
  767. package/dist/widgets/carousel.cjs +1 -1
  768. package/dist/widgets/carousel.js +1 -1
  769. package/dist/widgets/cart-drawer.cjs +1 -1
  770. package/dist/widgets/cart-drawer.js +1 -1
  771. package/dist/widgets/chapter-nav.cjs +1 -1
  772. package/dist/widgets/chapter-nav.js +1 -1
  773. package/dist/widgets/chat-composer.cjs +1 -1
  774. package/dist/widgets/chat-composer.js +1 -1
  775. package/dist/widgets/clock-control.cjs +1 -1
  776. package/dist/widgets/clock-control.js +1 -1
  777. package/dist/widgets/code-export.cjs +1 -1
  778. package/dist/widgets/code-export.js +1 -1
  779. package/dist/widgets/color-picker.cjs +1 -1
  780. package/dist/widgets/color-picker.js +1 -1
  781. package/dist/widgets/command-palette.cjs +1 -1
  782. package/dist/widgets/command-palette.js +1 -1
  783. package/dist/widgets/compare.cjs +1 -1
  784. package/dist/widgets/compare.js +1 -1
  785. package/dist/widgets/countdown.cjs +1 -1
  786. package/dist/widgets/countdown.js +1 -1
  787. package/dist/widgets/cube-gallery.cjs +1 -1
  788. package/dist/widgets/cube-gallery.js +1 -1
  789. package/dist/widgets/date-picker.cjs +1 -1
  790. package/dist/widgets/date-picker.js +1 -1
  791. package/dist/widgets/disclosure.cjs +1 -1
  792. package/dist/widgets/disclosure.js +1 -1
  793. package/dist/widgets/dock.cjs +1 -1
  794. package/dist/widgets/dock.js +1 -1
  795. package/dist/widgets/dotlottie.cjs +1 -1
  796. package/dist/widgets/dotlottie.js +1 -1
  797. package/dist/widgets/equalizer.cjs +1 -1
  798. package/dist/widgets/equalizer.js +1 -1
  799. package/dist/widgets/festival-banner.cjs +1 -1
  800. package/dist/widgets/festival-banner.js +1 -1
  801. package/dist/widgets/field.cjs +1 -1
  802. package/dist/widgets/field.js +1 -1
  803. package/dist/widgets/file-drop.cjs +1 -1
  804. package/dist/widgets/file-drop.js +1 -1
  805. package/dist/widgets/gauge.cjs +1 -1
  806. package/dist/widgets/gauge.js +1 -1
  807. package/dist/widgets/gen-art.cjs +1 -1
  808. package/dist/widgets/gen-art.js +1 -1
  809. package/dist/widgets/gesture-sticker.cjs +1 -1
  810. package/dist/widgets/gesture-sticker.js +1 -1
  811. package/dist/widgets/gl-model.cjs +1 -1
  812. package/dist/widgets/gl-model.js +1 -1
  813. package/dist/widgets/gl-scene.cjs +2 -2
  814. package/dist/widgets/gl-scene.js +2 -2
  815. package/dist/widgets/globe.cjs +1 -1
  816. package/dist/widgets/globe.js +1 -1
  817. package/dist/widgets/gpu-particles.cjs +1 -1
  818. package/dist/widgets/gpu-particles.js +1 -1
  819. package/dist/widgets/gyro-card.cjs +1 -1
  820. package/dist/widgets/gyro-card.js +1 -1
  821. package/dist/widgets/hero-video.cjs +1 -1
  822. package/dist/widgets/hero-video.js +1 -1
  823. package/dist/widgets/hud-panel.cjs +1 -1
  824. package/dist/widgets/hud-panel.js +1 -1
  825. package/dist/widgets/hydrate.cjs +1 -1
  826. package/dist/widgets/hydrate.js +1 -1
  827. package/dist/widgets/install-button.cjs +1 -1
  828. package/dist/widgets/install-button.js +1 -1
  829. package/dist/widgets/kanban.cjs +1 -1
  830. package/dist/widgets/kanban.js +1 -1
  831. package/dist/widgets/keyframe-editor.cjs +1 -1
  832. package/dist/widgets/keyframe-editor.js +1 -1
  833. package/dist/widgets/kpi.cjs +1 -1
  834. package/dist/widgets/kpi.js +1 -1
  835. package/dist/widgets/leaderboard.cjs +1 -1
  836. package/dist/widgets/leaderboard.js +1 -1
  837. package/dist/widgets/liquid-nav.cjs +1 -1
  838. package/dist/widgets/liquid-nav.js +1 -1
  839. package/dist/widgets/location-card.cjs +1 -1
  840. package/dist/widgets/location-card.js +1 -1
  841. package/dist/widgets/lottie-icon.cjs +1 -1
  842. package/dist/widgets/lottie-icon.js +1 -1
  843. package/dist/widgets/lottie-player.cjs +2 -2
  844. package/dist/widgets/lottie-player.js +2 -2
  845. package/dist/widgets/lottie.cjs +1 -1
  846. package/dist/widgets/lottie.js +1 -1
  847. package/dist/widgets/lyrics.cjs +1 -1
  848. package/dist/widgets/lyrics.js +1 -1
  849. package/dist/widgets/masonry-flow.cjs +1 -1
  850. package/dist/widgets/masonry-flow.js +1 -1
  851. package/dist/widgets/menu-toggle.cjs +1 -1
  852. package/dist/widgets/menu-toggle.js +1 -1
  853. package/dist/widgets/menu.cjs +1 -1
  854. package/dist/widgets/menu.js +1 -1
  855. package/dist/widgets/message-list.cjs +1 -1
  856. package/dist/widgets/message-list.js +1 -1
  857. package/dist/widgets/milestones.cjs +1 -1
  858. package/dist/widgets/milestones.js +1 -1
  859. package/dist/widgets/modal.cjs +1 -1
  860. package/dist/widgets/modal.js +1 -1
  861. package/dist/widgets/motion-inspector.cjs +2 -2
  862. package/dist/widgets/motion-inspector.js +2 -2
  863. package/dist/widgets/motion-prefs.cjs +1 -1
  864. package/dist/widgets/motion-prefs.js +1 -1
  865. package/dist/widgets/motion-prompt.cjs +1 -1
  866. package/dist/widgets/motion-prompt.js +1 -1
  867. package/dist/widgets/motion-spec.cjs +1 -1
  868. package/dist/widgets/motion-spec.js +1 -1
  869. package/dist/widgets/motion.cjs +1 -1
  870. package/dist/widgets/motion.js +1 -1
  871. package/dist/widgets/music-player.cjs +1 -1
  872. package/dist/widgets/music-player.js +1 -1
  873. package/dist/widgets/native-preview.cjs +1 -1
  874. package/dist/widgets/native-preview.js +1 -1
  875. package/dist/widgets/nav-morph.cjs +1 -1
  876. package/dist/widgets/nav-morph.js +1 -1
  877. package/dist/widgets/notification-bell.cjs +1 -1
  878. package/dist/widgets/notification-bell.js +1 -1
  879. package/dist/widgets/odometer.cjs +1 -1
  880. package/dist/widgets/odometer.js +1 -1
  881. package/dist/widgets/organic-card.cjs +1 -1
  882. package/dist/widgets/organic-card.js +1 -1
  883. package/dist/widgets/otp.cjs +1 -1
  884. package/dist/widgets/otp.js +1 -1
  885. package/dist/widgets/pagination.cjs +1 -1
  886. package/dist/widgets/pagination.js +1 -1
  887. package/dist/widgets/panorama.cjs +1 -1
  888. package/dist/widgets/panorama.js +1 -1
  889. package/dist/widgets/parallax-layers.cjs +1 -1
  890. package/dist/widgets/parallax-layers.js +1 -1
  891. package/dist/widgets/pause-all.cjs +1 -1
  892. package/dist/widgets/pause-all.js +1 -1
  893. package/dist/widgets/perf-monitor.cjs +1 -1
  894. package/dist/widgets/perf-monitor.js +1 -1
  895. package/dist/widgets/physics-playground.cjs +2 -2
  896. package/dist/widgets/physics-playground.js +2 -2
  897. package/dist/widgets/plugin-card.cjs +3 -3
  898. package/dist/widgets/plugin-card.js +3 -3
  899. package/dist/widgets/plugin-store.cjs +1 -1
  900. package/dist/widgets/plugin-store.js +1 -1
  901. package/dist/widgets/presence.cjs +1 -1
  902. package/dist/widgets/presence.js +1 -1
  903. package/dist/widgets/prize-wheel.cjs +1 -1
  904. package/dist/widgets/prize-wheel.js +1 -1
  905. package/dist/widgets/product-gallery.cjs +1 -1
  906. package/dist/widgets/product-gallery.js +1 -1
  907. package/dist/widgets/progress-ring.cjs +1 -1
  908. package/dist/widgets/progress-ring.js +1 -1
  909. package/dist/widgets/prop-panel.cjs +1 -1
  910. package/dist/widgets/prop-panel.js +1 -1
  911. package/dist/widgets/pull-cord.cjs +1 -1
  912. package/dist/widgets/pull-cord.js +1 -1
  913. package/dist/widgets/radar.cjs +1 -1
  914. package/dist/widgets/radar.js +1 -1
  915. package/dist/widgets/reactions.cjs +1 -1
  916. package/dist/widgets/reactions.js +1 -1
  917. package/dist/widgets/red-envelope.cjs +1 -1
  918. package/dist/widgets/red-envelope.js +1 -1
  919. package/dist/widgets/retro-button.cjs +1 -1
  920. package/dist/widgets/retro-button.js +1 -1
  921. package/dist/widgets/rive.cjs +1 -1
  922. package/dist/widgets/rive.js +1 -1
  923. package/dist/widgets/route-transition.cjs +1 -1
  924. package/dist/widgets/route-transition.js +1 -1
  925. package/dist/widgets/scene.cjs +1 -1
  926. package/dist/widgets/scene.js +1 -1
  927. package/dist/widgets/scroll-ring.cjs +1 -1
  928. package/dist/widgets/scroll-ring.js +1 -1
  929. package/dist/widgets/scroll-scene.cjs +2 -2
  930. package/dist/widgets/scroll-scene.js +2 -2
  931. package/dist/widgets/segmented.cjs +1 -1
  932. package/dist/widgets/segmented.js +1 -1
  933. package/dist/widgets/shader-backdrop.cjs +1 -1
  934. package/dist/widgets/shader-backdrop.js +1 -1
  935. package/dist/widgets/sheet.cjs +1 -1
  936. package/dist/widgets/sheet.js +1 -1
  937. package/dist/widgets/shortcut.cjs +1 -1
  938. package/dist/widgets/shortcut.js +1 -1
  939. package/dist/widgets/skeleton-reveal.cjs +1 -1
  940. package/dist/widgets/skeleton-reveal.js +1 -1
  941. package/dist/widgets/sketch-chart.cjs +1 -1
  942. package/dist/widgets/sketch-chart.js +1 -1
  943. package/dist/widgets/smooth-scroll.cjs +2 -2
  944. package/dist/widgets/smooth-scroll.js +2 -2
  945. package/dist/widgets/snap-carousel.cjs +1 -1
  946. package/dist/widgets/snap-carousel.js +1 -1
  947. package/dist/widgets/sparkline.cjs +1 -1
  948. package/dist/widgets/sparkline.js +1 -1
  949. package/dist/widgets/spatial-card.cjs +1 -1
  950. package/dist/widgets/spatial-card.js +1 -1
  951. package/dist/widgets/star-rating.cjs +1 -1
  952. package/dist/widgets/star-rating.js +1 -1
  953. package/dist/widgets/stepper.cjs +1 -1
  954. package/dist/widgets/stepper.js +1 -1
  955. package/dist/widgets/sticky-wall.cjs +1 -1
  956. package/dist/widgets/sticky-wall.js +1 -1
  957. package/dist/widgets/stories.cjs +1 -1
  958. package/dist/widgets/stories.js +1 -1
  959. package/dist/widgets/suggestion-chips.cjs +1 -1
  960. package/dist/widgets/suggestion-chips.js +1 -1
  961. package/dist/widgets/swipe-deck.cjs +1 -1
  962. package/dist/widgets/swipe-deck.js +1 -1
  963. package/dist/widgets/switch.cjs +1 -1
  964. package/dist/widgets/switch.js +1 -1
  965. package/dist/widgets/tab-bar.cjs +1 -1
  966. package/dist/widgets/tab-bar.js +1 -1
  967. package/dist/widgets/terminal.cjs +1 -1
  968. package/dist/widgets/terminal.js +1 -1
  969. package/dist/widgets/text-splitter.cjs +3 -3
  970. package/dist/widgets/text-splitter.js +3 -3
  971. package/dist/widgets/theme-surface.cjs +1 -1
  972. package/dist/widgets/theme-surface.js +1 -1
  973. package/dist/widgets/theme-switcher.cjs +1 -1
  974. package/dist/widgets/theme-switcher.js +1 -1
  975. package/dist/widgets/tip.cjs +1 -1
  976. package/dist/widgets/tip.js +1 -1
  977. package/dist/widgets/toast-stack.cjs +1 -1
  978. package/dist/widgets/toast-stack.js +1 -1
  979. package/dist/widgets/token-editor.cjs +1 -1
  980. package/dist/widgets/token-editor.js +1 -1
  981. package/dist/widgets/upload-progress.cjs +1 -1
  982. package/dist/widgets/upload-progress.js +1 -1
  983. package/dist/widgets/video-card.cjs +1 -1
  984. package/dist/widgets/video-card.js +1 -1
  985. package/dist/widgets/voice-button.cjs +1 -1
  986. package/dist/widgets/voice-button.js +1 -1
  987. package/dist/widgets/volume-knob.cjs +1 -1
  988. package/dist/widgets/volume-knob.js +1 -1
  989. package/dist/widgets/weather-card.cjs +1 -1
  990. package/dist/widgets/weather-card.js +1 -1
  991. package/dist/widgets/worker-canvas.cjs +1 -1
  992. package/dist/widgets/worker-canvas.js +1 -1
  993. package/dist/widgets/xp-bar.cjs +1 -1
  994. package/dist/widgets/xp-bar.js +1 -1
  995. package/dist/widgets.umd.js +2 -2
  996. package/docs/deprecations-v16.md +79 -0
  997. package/docs/mcp-gateway-interop.md +1 -0
  998. package/docs/mcp.md +6 -0
  999. package/docs/migrating-to-v16.md +61 -0
  1000. package/docs/scene-v3.md +86 -0
  1001. package/docs/studio-store.md +61 -0
  1002. package/docs/versions.md +1 -1
  1003. package/package.json +43 -2
  1004. package/dist/llms-full.txt +0 -4021
@@ -1,4021 +0,0 @@
1
- # Motionary 15.3.0 — full component reference
2
-
3
- Generated from the source. Machine-readable version: https://harrisoncn.github.io/Motionary/components.json (schema https://harrisoncn.github.io/Motionary/components.schema.json).
4
-
5
- ## Runtime modules
6
-
7
- ### motionary/runtime — Runtime core
8
-
9
- Shared ticker (one rAF loop), tween + timeline engine with easing, module registry with clear errors.
10
-
11
- - Install: `npm i motionary`
12
- - Import: `motionary/runtime`
13
- - Register: `use();` — Import motionary/runtime and call use() once at start-up, before any runtime-powered component mounts. CDN: the IIFE registers itself (window.MotionaryRuntime).
14
- - CDN:
15
-
16
- ```html
17
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
18
- ```
19
-
20
- ```js
21
- import { use, tween, timeline } from 'motionary/runtime';
22
- use();
23
- tween('.box', { to: { x: 120, opacity: 1 }, duration: 500, ease: 'back-out' });
24
- timeline().to('.a', { to: { y: -20 } }).to('.b', { to: { scale: 1.2 } }, '<+=100');
25
- ```
26
-
27
- ### motionary/runtime/format-css — CSS @keyframes & WAAPI keyframes loader
28
-
29
- Import CSS @keyframes text or live CSSKeyframesRule objects and Web Animations API keyframes (array or property-indexed) into a runtime timeline.
30
-
31
- - Install: `npm i motionary`
32
- - Import: `motionary/runtime/format-css`
33
- - Register: `use(formatCss);` — Register the core first, then the module: use(formatCss) also registers the core. CDN: load runtime.iife.js, then runtime/format-css.iife.js (it registers itself).
34
- - CDN:
35
-
36
- ```html
37
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
38
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-css.iife.js"></script>
39
- ```
40
-
41
- ```js
42
- import { use } from 'motionary/runtime';
43
- import { formatCss, parseKeyframes, playKeyframes } from 'motionary/runtime/format-css';
44
- use(formatCss);
45
- const [pulse] = parseKeyframes('@keyframes pulse { from { opacity: .4 } 50% { opacity: 1; transform: scale(1.1) } to { opacity: .4 } }');
46
- playKeyframes(document.querySelector('.dot'), pulse, { duration: 1200, repeat: -1 });
47
- ```
48
-
49
- ### motionary/runtime/format-motion — Motion / Framer keyframe JSON loader
50
-
51
- Play Motion / Framer-style { initial, animate, transition } JSON (arrays as keyframes, times, repeatType, springs) with the runtime.
52
-
53
- - Install: `npm i motionary`
54
- - Import: `motionary/runtime/format-motion`
55
- - Register: `use(formatMotion);` — Register the core first, then the module: use(formatMotion) also registers the core. CDN: load runtime.iife.js, then runtime/format-motion.iife.js (it registers itself).
56
- - CDN:
57
-
58
- ```html
59
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
60
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-motion.iife.js"></script>
61
- ```
62
-
63
- ```js
64
- import { use } from 'motionary/runtime';
65
- import { formatMotion, playMotion } from 'motionary/runtime/format-motion';
66
- use(formatMotion);
67
- playMotion(document.querySelector('.card'), { initial: { opacity: 0, y: 40 }, animate: { opacity: 1, y: 0 }, transition: { type: 'spring', stiffness: 180, damping: 14 } });
68
- ```
69
-
70
- ### motionary/runtime/scroll — Scroll scenes
71
-
72
- Scroll-linked scenes: start / end rules, scrub (direct or smoothed), pin, markers, enter / leave callbacks and per-edge actions for a runtime tween or timeline.
73
-
74
- - Install: `npm i motionary`
75
- - Import: `motionary/runtime/scroll`
76
- - Register: `use(scroll);` — Register the core first, then the module: use(scroll) also registers the core. CDN: load runtime.iife.js, then runtime/scroll.iife.js (it registers itself).
77
- - CDN:
78
-
79
- ```html
80
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
81
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/scroll.iife.js"></script>
82
- ```
83
-
84
- ```js
85
- import { use, timeline } from 'motionary/runtime';
86
- import { scroll, scrollScene } from 'motionary/runtime/scroll';
87
- use(scroll);
88
- const tl = timeline({ paused: true }).to('.card', { to: { x: 200, rotate: 8 } });
89
- scrollScene({ trigger: '.section', start: 'top 80%', end: 'bottom 20%', scrub: 120, pin: true, markers: true, animation: tl });
90
- ```
91
-
92
- ### motionary/runtime/format-svg — SVG loader: SMIL playback + path morphing
93
-
94
- Replay SVG SMIL animations (animate, set, animateTransform, animateMotion) on the runtime timeline, morph between any two paths, and measure paths without the DOM.
95
-
96
- - Install: `npm i motionary`
97
- - Import: `motionary/runtime/format-svg`
98
- - Register: `use(formatSvg);` — Register the core first, then the module: use(formatSvg) also registers the core. CDN: load runtime.iife.js, then runtime/format-svg.iife.js (it registers itself).
99
- - CDN:
100
-
101
- ```html
102
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
103
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-svg.iife.js"></script>
104
- ```
105
-
106
- ```js
107
- import { use } from 'motionary/runtime';
108
- import { formatSvg, playSmil, morphPath } from 'motionary/runtime/format-svg';
109
- use(formatSvg);
110
- const player = playSmil(document.querySelector('svg'));
111
- player.timeline.timeScale = 0.5; // scrub / slow down / reverse like any runtime timeline
112
- const f = morphPath('M0 0 L100 0 L50 80 Z', 'M50 0 A40 40 0 1 1 49.9 0 Z');
113
- path.setAttribute('d', f(0.5));
114
- ```
115
-
116
- ### motionary/runtime/text — Text splitting
117
-
118
- Split text into characters (grapheme-aware), words and lines for animation while keeping it accessible (aria-label with the full text, pieces hidden from assistive tech).
119
-
120
- - Install: `npm i motionary`
121
- - Import: `motionary/runtime/text`
122
- - Register: `use(text);` — Register the core first, then the module: use(text) also registers the core. CDN: load runtime.iife.js, then runtime/text.iife.js (it registers itself).
123
- - CDN:
124
-
125
- ```html
126
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
127
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/text.iife.js"></script>
128
- ```
129
-
130
- ```js
131
- import { use, tween } from 'motionary/runtime';
132
- import { text, splitText } from 'motionary/runtime/text';
133
- use(text);
134
- const { chars } = splitText(document.querySelector('h1'), { type: 'chars,words' });
135
- tween(chars, { from: { y: '1em', opacity: 0 }, to: { y: '0em', opacity: 1 }, stagger: 30 });
136
- ```
137
-
138
- ### motionary/runtime/format-sprite — Sprite sheets & image sequences
139
-
140
- Play TexturePacker / Aseprite sprite sheets and numbered image sequences on a canvas or an element background, as runtime timelines (scrubbable).
141
-
142
- - Install: `npm i motionary`
143
- - Import: `motionary/runtime/format-sprite`
144
- - Register: `use(formatSprite);` — Register the core first, then the module: use(formatSprite) also registers the core. CDN: load runtime.iife.js, then runtime/format-sprite.iife.js (it registers itself).
145
- - CDN:
146
-
147
- ```html
148
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
149
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-sprite.iife.js"></script>
150
- ```
151
-
152
- ```js
153
- import { use } from 'motionary/runtime';
154
- import { formatSprite, parseSpriteSheet, spritePlayer } from 'motionary/runtime/format-sprite';
155
- use(formatSprite);
156
- const sheet = parseSpriteSheet(await (await fetch('/slime.json')).json());
157
- const img = new Image(); img.src = '/slime.png'; await img.decode();
158
- spritePlayer(document.querySelector('canvas'), sheet, img, { tag: 'bounce' });
159
- ```
160
-
161
- ### motionary/runtime/smooth — Smooth scrolling
162
-
163
- Smooth, inertial wheel scrolling (lerp or fixed-duration glide) for the window or any scroll container, anchor links that glide, off under prefers-reduced-motion; real scroll events keep scroll scenes and observers working.
164
-
165
- - Install: `npm i motionary`
166
- - Import: `motionary/runtime/smooth`
167
- - Register: `use(smooth);` — Register the core first, then the module: use(smooth) also registers the core. CDN: load runtime.iife.js, then runtime/smooth.iife.js (it registers itself).
168
- - CDN:
169
-
170
- ```html
171
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
172
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/smooth.iife.js"></script>
173
- ```
174
-
175
- ```js
176
- import { use } from 'motionary/runtime';
177
- import { smooth, smoothScroll } from 'motionary/runtime/smooth';
178
- use(smooth);
179
- const s = smoothScroll({ lerp: 0.1, anchors: { offset: -64 } });
180
- s.scrollTo('#pricing');
181
- ```
182
-
183
- ### motionary/runtime/format-gif — GIF decoder
184
-
185
- Decode animated GIFs (own LZW decoder, no DOM) into composited RGBA frames and play / scrub / reverse them on a canvas as a runtime timeline.
186
-
187
- - Install: `npm i motionary`
188
- - Import: `motionary/runtime/format-gif`
189
- - Register: `use(formatGif);` — Register the core first, then the module: use(formatGif) also registers the core. CDN: load runtime.iife.js, then runtime/format-gif.iife.js (it registers itself).
190
- - CDN:
191
-
192
- ```html
193
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
194
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-gif.iife.js"></script>
195
- ```
196
-
197
- ```js
198
- import { use } from 'motionary/runtime';
199
- import { formatGif, loadGif, animatedImagePlayer } from 'motionary/runtime/format-gif';
200
- use(formatGif);
201
- const gif = await loadGif('/loader.gif');
202
- const player = animatedImagePlayer(document.querySelector('canvas'), gif);
203
- player.pause(); player.progress = 0.5; // scrub
204
- ```
205
-
206
- ### motionary/runtime/format-apng — APNG loader
207
-
208
- Split animated PNGs into standalone frame PNGs (decoded by the browser), composite them (dispose / blend) and play them on a canvas as a runtime timeline.
209
-
210
- - Install: `npm i motionary`
211
- - Import: `motionary/runtime/format-apng`
212
- - Register: `use(formatApng);` — Register the core first, then the module: use(formatApng) also registers the core. CDN: load runtime.iife.js, then runtime/format-apng.iife.js (it registers itself).
213
- - CDN:
214
-
215
- ```html
216
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
217
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-apng.iife.js"></script>
218
- ```
219
-
220
- ```js
221
- import { use } from 'motionary/runtime';
222
- import { formatApng, loadApng, animatedImagePlayer } from 'motionary/runtime/format-apng';
223
- use(formatApng);
224
- const anim = await loadApng('/sticker.png');
225
- animatedImagePlayer(document.querySelector('canvas'), anim);
226
- ```
227
-
228
- ### motionary/runtime/format-webp — Animated WebP loader
229
-
230
- Split animated WebP files (ANIM / ANMF) into standalone frames (decoded by the browser), composite them (blend / dispose) and play them on a canvas as a runtime timeline.
231
-
232
- - Install: `npm i motionary`
233
- - Import: `motionary/runtime/format-webp`
234
- - Register: `use(formatWebp);` — Register the core first, then the module: use(formatWebp) also registers the core. CDN: load runtime.iife.js, then runtime/format-webp.iife.js (it registers itself).
235
- - CDN:
236
-
237
- ```html
238
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
239
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-webp.iife.js"></script>
240
- ```
241
-
242
- ```js
243
- import { use } from 'motionary/runtime';
244
- import { formatWebp, loadWebp, animatedImagePlayer } from 'motionary/runtime/format-webp';
245
- use(formatWebp);
246
- const anim = await loadWebp('/hero.webp');
247
- const p = animatedImagePlayer(document.querySelector('canvas'), anim, { speed: 0.5 });
248
- ```
249
-
250
- ### motionary/runtime/gl — WebGL2 scene renderer
251
-
252
- A small WebGL2 renderer with its own API: scene graph, camera, lights, box / plane / sphere / torus, PBR-style materials, shader materials, image and video textures, orbit controls — not a Three.js clone.
253
-
254
- - Install: `npm i motionary`
255
- - Import: `motionary/runtime/gl`
256
- - Register: `use(gl);` — Register the core first, then the module: use(gl) also registers the core. CDN: load runtime.iife.js, then runtime/gl.iife.js (it registers itself).
257
- - CDN:
258
-
259
- ```html
260
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
261
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/gl.iife.js"></script>
262
- ```
263
-
264
- ```js
265
- import { use } from 'motionary/runtime';
266
- import { gl, createRenderer, Scene, Camera, GlNode, torus, standardMaterial } from 'motionary/runtime/gl';
267
- use(gl);
268
- const r = createRenderer(canvas);
269
- const scene = new Scene();
270
- scene.add(new GlNode('donut', { geometry: torus(), material: standardMaterial({ color: [0.5, 0.55, 1, 1] }) }));
271
- r.resize(); r.render(scene, new Camera({ position: [0, 0.5, 3] }));
272
- ```
273
-
274
- ### motionary/runtime/format-gltf — glTF 2.0 / GLB loader
275
-
276
- Load glTF 2.0 (.gltf with external or data: buffers, .glb) into motionary/runtime/gl nodes: node hierarchy, meshes, PBR metallic-roughness materials, embedded / external images.
277
-
278
- - Install: `npm i motionary`
279
- - Import: `motionary/runtime/format-gltf`
280
- - Register: `use(formatGltf);` — Register the core first, then the module: use(formatGltf) also registers the core. CDN: load runtime.iife.js, then runtime/format-gltf.iife.js (it registers itself).
281
- - CDN:
282
-
283
- ```html
284
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
285
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-gltf.iife.js"></script>
286
- ```
287
-
288
- ```js
289
- import { use } from 'motionary/runtime';
290
- import { gl, createRenderer, Scene, Camera, frameNode } from 'motionary/runtime/gl';
291
- import { formatGltf, loadGltf } from 'motionary/runtime/format-gltf';
292
- use(gl, formatGltf);
293
- const model = await loadGltf('/models/chair.glb');
294
- const scene = new Scene().add(model), cam = new Camera();
295
- frameNode(cam, model);
296
- const r = createRenderer(canvas); r.resize(); r.render(scene, cam);
297
- ```
298
-
299
- ### motionary/runtime/format-obj — OBJ / MTL loader
300
-
301
- Load Wavefront OBJ (+ MTL materials and diffuse textures) into motionary/runtime/gl nodes: polygons triangulated, groups, per-material meshes.
302
-
303
- - Install: `npm i motionary`
304
- - Import: `motionary/runtime/format-obj`
305
- - Register: `use(formatObj);` — Register the core first, then the module: use(formatObj) also registers the core. CDN: load runtime.iife.js, then runtime/format-obj.iife.js (it registers itself).
306
- - CDN:
307
-
308
- ```html
309
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
310
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-obj.iife.js"></script>
311
- ```
312
-
313
- ```js
314
- import { use } from 'motionary/runtime';
315
- import { gl, Scene } from 'motionary/runtime/gl';
316
- import { formatObj, loadObj } from 'motionary/runtime/format-obj';
317
- use(gl, formatObj);
318
- const cube = await loadObj('/models/cube.obj'); // + cube.mtl + textures next to it
319
- new Scene().add(cube);
320
- ```
321
-
322
- ### motionary/runtime/vector — Lottie + dotLottie player
323
-
324
- Plays Lottie (bodymovin JSON) and dotLottie (.lottie) files on Canvas 2D with Motionary’s own renderer (no lottie-web code): shapes, gradients, trim paths, masks, track mattes, precomps, images; a runtime timeline you can seek, reverse and scrub.
325
-
326
- - Install: `npm i motionary`
327
- - Import: `motionary/runtime/vector`
328
- - Register: `use(vector);` — Register the core first, then the module: use(vector) also registers the core. CDN: load runtime.iife.js, then runtime/vector.iife.js (it registers itself).
329
- - CDN:
330
-
331
- ```html
332
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
333
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/vector.iife.js"></script>
334
- ```
335
-
336
- ```js
337
- import { use } from 'motionary/runtime';
338
- import { vector, loadLottie, lottiePlayer } from 'motionary/runtime/vector';
339
- use(vector);
340
- const { animation } = await loadLottie('/anim/hero.lottie');
341
- const player = lottiePlayer(canvas, animation, { loop: true });
342
- player.play();
343
- ```
344
-
345
- ### @rive-app/canvas — Official Rive runtime
346
-
347
- The official MIT-licensed Rive runtime, used by <usa-rive> to play .riv files (artboards, animations, state machines with inputs). Optional peer dependency: lazy-loaded on first use, never bundled into Motionary.
348
-
349
- - Install: `npm i @rive-app/canvas`
350
- - Import: `@rive-app/canvas`
351
- - Register: `provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts` — Install the official runtime next to motionary, then hand <usa-rive> a lazy loader with provideRiveRuntime(() => import('@rive-app/canvas')) before the element mounts — your bundler splits the runtime into its own chunk, fetched only when the first <usa-rive> appears. Without a bundler: load the official rive.js from a CDN before the component bundles (window.rive), use an import map, or set runtime-src on the element. Missing → a clear message in place + usa:runtime-missing.
352
- - CDN:
353
-
354
- ```html
355
- <script src="https://unpkg.com/@rive-app/canvas@2.44.1/rive.js"></script>
356
- ```
357
-
358
- ```js
359
- // npm i @rive-app/canvas
360
- import { defineRive } from 'motionary/components/widgets';
361
- defineRive();
362
- // <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay></usa-rive>
363
- ```
364
-
365
- ### motionary/runtime/physics — 2D rigid-body physics
366
-
367
- A small 2D rigid-body engine written for Motionary (own implementation and API — no Matter.js / Box2D code): circles, boxes and convex polygons, mass from density, restitution, friction, sensors, collision groups, sleeping, distance / spring / pin constraints, pointer drag, a fixed time step on the shared ticker.
368
-
369
- - Install: `npm i motionary`
370
- - Import: `motionary/runtime/physics`
371
- - Register: `use(physics);` — Register the core first, then the module: use(physics) also registers the core. CDN: load runtime.iife.js, then runtime/physics.iife.js (it registers itself).
372
- - CDN:
373
-
374
- ```html
375
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
376
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/physics.iife.js"></script>
377
- ```
378
-
379
- ```js
380
- import { use } from 'motionary/runtime';
381
- import { physics, createWorld } from 'motionary/runtime/physics';
382
- use(physics);
383
- const world = createWorld({ gravity: [0, 980] });
384
- world.bounds(600, 400);
385
- const ball = world.body({ shape: 'circle', x: 300, y: 40, radius: 20, restitution: 0.7 });
386
- world.run(); // steps on the shared ticker
387
- ```
388
-
389
- ### motionary/runtime/format-scene — Scene JSON (motionary-scene@1)
390
-
391
- The versioned motionary-scene@1 format: a JSON description of a 2D physics scene (world, named materials, bodies, constraints, per-body style) — validate, migrate older drafts, load into a physics world and save one back.
392
-
393
- - Install: `npm i motionary`
394
- - Import: `motionary/runtime/format-scene`
395
- - Register: `use(formatScene);` — Register the core first, then the module: use(formatScene) also registers the core. CDN: load runtime.iife.js, then runtime/format-scene.iife.js (it registers itself).
396
- - CDN:
397
-
398
- ```html
399
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
400
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-scene.iife.js"></script>
401
- ```
402
-
403
- ```js
404
- import { use } from 'motionary/runtime';
405
- import { physics } from 'motionary/runtime/physics';
406
- import { formatScene, sceneToWorld } from 'motionary/runtime/format-scene';
407
- use(physics, formatScene);
408
- const { world, bodies } = sceneToWorld(await (await fetch('/scenes/stack.json')).json());
409
- world.run();
410
- ```
411
-
412
- ### motionary/runtime/drag-snap — Drag, inertia and snap points
413
-
414
- Pointer drag along one axis with velocity tracking, inertial throws, rubber-band edges and spring-animated snap points on the shared ticker — the engine of <usa-snap-carousel>, usable for sheets, sliders and pickers (own implementation).
415
-
416
- - Install: `npm i motionary`
417
- - Import: `motionary/runtime/drag-snap`
418
- - Register: `use(dragSnap);` — Register the core first, then the module: use(dragSnap) also registers the core. CDN: load runtime.iife.js, then runtime/drag-snap.iife.js (it registers itself).
419
- - CDN:
420
-
421
- ```html
422
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
423
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/drag-snap.iife.js"></script>
424
- ```
425
-
426
- ```js
427
- import { use } from 'motionary/runtime';
428
- import { dragSnap, createDragSnap } from 'motionary/runtime/drag-snap';
429
- use(dragSnap);
430
- const track = document.querySelector('.track');
431
- const ds = createDragSnap(track, { axis: 'x', snap: [0, -320, -640], onUpdate: (x) => (track.style.transform = `translateX(${x}px)`) });
432
- ds.snapTo(1);
433
- ```
434
-
435
- ### motionary/runtime/gltf-anim — glTF animation, skinning and morph targets
436
-
437
- Plays glTF 2.0 animations on models loaded by motionary/runtime/format-gltf: translation / rotation / scale / weights channels with LINEAR, STEP and CUBICSPLINE samplers, skins (4 joints per vertex) and morph targets, deformed on the CPU and re-uploaded to motionary/runtime/gl (own implementation).
438
-
439
- - Install: `npm i motionary`
440
- - Import: `motionary/runtime/gltf-anim`
441
- - Register: `use(gltfAnim);` — Register the core first, then the module: use(gltfAnim) also registers the core. CDN: load runtime.iife.js, then runtime/gltf-anim.iife.js (it registers itself).
442
- - CDN:
443
-
444
- ```html
445
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
446
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/gltf-anim.iife.js"></script>
447
- ```
448
-
449
- ```js
450
- import { use } from 'motionary/runtime';
451
- import { gl } from 'motionary/runtime/gl';
452
- import { formatGltf, loadGltf } from 'motionary/runtime/format-gltf';
453
- import { gltfAnim, gltfAnimator } from 'motionary/runtime/gltf-anim';
454
- use(gl, formatGltf, gltfAnim);
455
- const model = await loadGltf('/models/robot.glb');
456
- const anim = gltfAnimator(model, { clip: 'walk' });
457
- anim.play(); // or anim.update(dt) in your own loop
458
- ```
459
-
460
- ### motionary/runtime/lottie-state — dotLottie themes + state machines
461
-
462
- Resolves Lottie slots with dotLottie themes (Color / Scalar / Vector / Text rules, static or keyframed) and runs a subset of dotLottie state machines (playback states, Event / Numeric / String / Boolean guards, pointer + completion interactions, input / theme / frame actions) for motionary/runtime/vector — own implementation, used by <usa-dotlottie>.
463
-
464
- - Install: `npm i motionary`
465
- - Import: `motionary/runtime/lottie-state`
466
- - Register: `use(lottieState);` — Register the core first, then the module: use(lottieState) also registers the core. CDN: load runtime.iife.js, then runtime/lottie-state.iife.js (it registers itself).
467
- - CDN:
468
-
469
- ```html
470
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
471
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/lottie-state.iife.js"></script>
472
- ```
473
-
474
- ```js
475
- import { use } from 'motionary/runtime';
476
- import { vector, loadLottie } from 'motionary/runtime/vector';
477
- import { lottieState, applyTheme, createStateMachine } from 'motionary/runtime/lottie-state';
478
- use(vector, lottieState);
479
- const { animation, dotLottie } = await loadLottie('/anim/button.lottie');
480
- const themed = applyTheme(animation, dotLottie.themes.dark);
481
- const sm = createStateMachine(dotLottie.stateMachines.toggle, { onState: (s) => console.log(s.name) });
482
- sm.fire('tap');
483
- ```
484
-
485
- ### motionary/runtime/gltf-decoders — glTF decoder hooks (Draco, KTX2)
486
-
487
- Lets motionary/runtime/format-gltf load KHR_draco_mesh_compression meshes and KHR_texture_basisu (KTX2) textures through the official decoders — Google draco3d and the Basis Universal transcoder — registered as lazy loaders; Motionary does not reimplement them.
488
-
489
- - Install: `npm i motionary`
490
- - Import: `motionary/runtime/gltf-decoders`
491
- - Register: `use(gltfDecoders);` — Register the core first, then the module: use(gltfDecoders) also registers the core. CDN: load runtime.iife.js, then runtime/gltf-decoders.iife.js (it registers itself).
492
- - CDN:
493
-
494
- ```html
495
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
496
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/gltf-decoders.iife.js"></script>
497
- ```
498
-
499
- ```js
500
- import { use } from 'motionary/runtime';
501
- import { gl } from 'motionary/runtime/gl';
502
- import { formatGltf, loadGltf } from 'motionary/runtime/format-gltf';
503
- import { gltfDecoders, provideGltfDecoder, prepareGltf } from 'motionary/runtime/gltf-decoders';
504
- use(gl, formatGltf, gltfDecoders);
505
- provideGltfDecoder('draco', () => import('draco3d'));
506
- const model = await loadGltf('/models/robot-draco.glb', { prepare: prepareGltf });
507
- ```
508
-
509
- ### draco3d — Official Draco decoder (Google)
510
-
511
- Google’s official Draco geometry decoder (Apache-2.0, WASM / JS), used by motionary/runtime/gltf-decoders for KHR_draco_mesh_compression meshes. Optional peer dependency: lazy-loaded when the first Draco file is opened, never bundled into Motionary.
512
-
513
- - Install: `npm i draco3d`
514
- - Import: `draco3d`
515
- - Register: `provideGltfDecoder('draco', () => import('draco3d')); // lazy: fetched when the first Draco-compressed model loads` — Install draco3d next to motionary, then register the lazy loader with provideGltfDecoder('draco', () => import('draco3d')) before a compressed model loads. Without a bundler: load Google’s draco_decoder.js from gstatic (window.DracoDecoderModule) and provideGltfDecoder('draco', () => window.DracoDecoderModule). Missing → a clear error naming the extension and this line.
516
- - CDN:
517
-
518
- ```html
519
- <script src="https://www.gstatic.com/draco/versioned/decoders/1.5.7/draco_decoder.js"></script>
520
- ```
521
-
522
- ```js
523
- import { provideGltfDecoder } from 'motionary/runtime/gltf-decoders';
524
- provideGltfDecoder('draco', () => import('draco3d'));
525
- ```
526
-
527
- ### basis_transcoder.js — Official Basis Universal transcoder (Binomial)
528
-
529
- Binomial’s official Basis Universal transcoder (Apache-2.0, basis_transcoder.js + .wasm from the basis_universal repository), used by motionary/runtime/gltf-decoders for KHR_texture_basisu (KTX2) textures. Optional: lazy-loaded when the first KTX2 texture is decoded, never bundled into Motionary.
530
-
531
- - Install: `curl -LO https://cdn.jsdelivr.net/gh/BinomialLLC/basis_universal@1.16.4/webgl/transcoder/build/basis_transcoder.js -LO https://cdn.jsdelivr.net/gh/BinomialLLC/basis_universal@1.16.4/webgl/transcoder/build/basis_transcoder.wasm`
532
- - Import: `basis_transcoder.js`
533
- - Register: `provideGltfDecoder('ktx2', () => import('/vendor/basis_transcoder.js').then((m) => m.default || window.BASIS)); // lazy: fetched with the first KTX2 texture` — The transcoder is not published on npm by Binomial: copy basis_transcoder.js + basis_transcoder.wasm (same folder) into your static files, then provideGltfDecoder('ktx2', …) before a KTX2 model loads; or load it from the CDN (window.BASIS) and provideGltfDecoder('ktx2', () => window.BASIS). Missing → a clear error naming the extension and this line.
534
- - CDN:
535
-
536
- ```html
537
- <script src="https://cdn.jsdelivr.net/gh/BinomialLLC/basis_universal@1.16.4/webgl/transcoder/build/basis_transcoder.js"></script>
538
- ```
539
-
540
- ```js
541
- import { provideGltfDecoder } from 'motionary/runtime/gltf-decoders';
542
- provideGltfDecoder('ktx2', () => window.BASIS);
543
- ```
544
-
545
- ## Components
546
-
547
- ### <usa-accordion> — Accordion
548
-
549
- Smooth expand / collapse for native <details> — semantics, keyboard and find-in-page kept; no wrapper elements.
550
-
551
- - Import: `import { defineAccordion } from 'motionary/components/transitions'; defineAccordion();`
552
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
553
- - Attributes: `multiple`, `duration`
554
- - Events: `usa:toggle`
555
- - Methods: `toggleItem()`
556
-
557
- ```html
558
- <usa-accordion>
559
- <details><summary>Shipping</summary><p>…</p></details>
560
- <details><summary>Returns</summary><p>…</p></details>
561
- </usa-accordion>
562
- ```
563
-
564
- ### <usa-acrylic> — Acrylic & Mica
565
-
566
- Windows Fluent materials: frosted acrylic (backdrop blur + tint + noise) and mica. Solid fallback when transparency is reduced.
567
-
568
- - Import: `import { defineAcrylic } from 'motionary/components/background'; defineAcrylic();`
569
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
570
- - Attributes: `tint`, `tint-opacity`, `blur`, `shimmer`
571
-
572
- ```html
573
- <usa-acrylic shimmer="hover">
574
- <nav>…</nav>
575
- </usa-acrylic>
576
- <usa-acrylic kind="mica">…</usa-acrylic>
577
- ```
578
-
579
- ### <usa-add-to-cart> — Add to cart (fly-to-cart)
580
-
581
- 7.3: a buy button — the product photo flies on an arc into the cart, the cart badge bumps and the button morphs into a ✓ “Added” state. Works with <usa-cart-drawer> (calls add(item)) or any [data-cart] icon.
582
-
583
- - Import: `import { defineAddToCart } from 'motionary/components/widgets'; defineAddToCart();`
584
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
585
- - Attributes: `label`, `added`, `item`, `cart`, `from`, `hold`
586
- - Events: `usa:add`
587
- - Methods: `add()`
588
-
589
- ```html
590
- <usa-cart-drawer id="cart"></usa-cart-drawer>
591
- <div data-product>
592
- <img src="shoe.jpg" alt="Sneaker">
593
- <usa-add-to-cart cart="#cart" item='{"name":"Sneaker","price":89}'></usa-add-to-cart>
594
- </div>
595
- ```
596
-
597
- ### <usa-ambient> — Ambient layer
598
-
599
- A fixed page-wide layer: drifting particles, falling snow, twinkling stars, film grain or a gradient that shifts with scroll.
600
-
601
- - Import: `import { defineAmbient } from 'motionary/components/page'; defineAmbient();`
602
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
603
- - Attributes: `effect`, `density`, `color`, `opacity`, `speed`
604
- - Methods: `mount()`, `upd()`, `resize()`, `resize()`, `draw()`, `draw()`, `unmount()`, `caf()`
605
-
606
- ```html
607
- <usa-ambient effect="snow" density="1.2"></usa-ambient>
608
- ```
609
-
610
- ### <usa-anim-icon> — Animated icons
611
-
612
- Stroke icons that move: the bell rings, the heart beats, the check draws, the gear turns. Hover, click, in view or loop; decorative unless labelled.
613
-
614
- - Import: `import { defineAnimIcon } from 'motionary/components/svg'; defineAnimIcon();`
615
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
616
- - Attributes: `name`, `size`, `label`, `trigger`
617
- - Methods: `play()`
618
-
619
- ```html
620
- <usa-anim-icon name="bell" label="Notifications"></usa-anim-icon>
621
- <usa-anim-icon name="heart" trigger="click"></usa-anim-icon>
622
- ```
623
-
624
- ### <usa-audio> — Beat-triggered effects
625
-
626
- 5.6: <usa-audio> renders a toggle (a user gesture starts Web Audio), detects beats and plays any registered effect on children with data-usa-beat="effect". JS: bindBeat(el, "pop"). Beats play nothing under reduced motion.
627
-
628
- - Import: `import { defineAudio } from 'motionary/components/effects'; defineAudio();`
629
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
630
- - Attributes: `source`, `label`, `threshold`, `cooldown`
631
- - Events: `usa:beat`, `usa:audio-error`
632
- - Methods: `toggle()`
633
-
634
- ```html
635
- <audio id="track" src="song.mp3" controls></audio>
636
- <usa-audio source="#track" label="Play with visuals">
637
- <div data-usa-beat="pop">♪</div>
638
- </usa-audio>
639
- ```
640
-
641
- ### <usa-aurora> — Aurora
642
-
643
- A slow drifting gradient mesh behind its content. Transforms only, paused off-screen, still under reduced motion.
644
-
645
- - Import: `import { defineAurora } from 'motionary/components/background'; defineAurora();`
646
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
647
- - Attributes: `colors`, `speed`, `intensity`
648
-
649
- ```html
650
- <usa-aurora colors="#7c5cff,#22d3ee,#f472b6">
651
- <h1>Hero</h1>
652
- </usa-aurora>
653
- ```
654
-
655
- ### <usa-auto-animate> — Auto-animate
656
-
657
- Wrap a list or grid: items that are added fade in, removed ones fade out in place, and everything else glides to its new spot — on sort, filter or resize. Zero code at the call site.
658
-
659
- - Import: `import { defineAutoAnimate } from 'motionary/components/layout'; defineAutoAnimate();`
660
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
661
- - Attributes: `duration`, `no-scale`
662
- - Methods: `enable()`, `disable()`
663
-
664
- ```html
665
- <usa-auto-animate>
666
- <ul class="todo"><li>Write the brief</li><li>Review</li></ul>
667
- </usa-auto-animate>
668
-
669
- <!-- or on any element: -->
670
- <ul class="grid"><li>A</li><li>B</li></ul>
671
- <script type="module">
672
- import { autoAnimate } from 'motionary/components/layout';
673
- autoAnimate(document.querySelector('.grid'));
674
- </script>
675
- ```
676
-
677
- ### <usa-auto-skeleton> — Auto skeleton
678
-
679
- Set loading and every heading, paragraph, image and button inside becomes a shimmering placeholder of its own size — no extra markup.
680
-
681
- - Import: `import { defineAutoSkeleton } from 'motionary/components/page'; defineAutoSkeleton();`
682
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
683
- - Attributes: `loading`
684
-
685
- ```html
686
- <usa-auto-skeleton loading>
687
- <h3>{{ title }}</h3>
688
- <p>{{ body }}</p>
689
- </usa-auto-skeleton>
690
- ```
691
-
692
- ### <usa-avatar-stack> — Avatar stack
693
-
694
- Overlapping avatars that spread apart with a spring on hover; extras collapse into “+N”.
695
-
696
- - Import: `import { defineAvatarStack } from 'motionary/components/ui'; defineAvatarStack();`
697
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
698
- - Attributes: `max`, `size`, `overlap`, `label`
699
- - Methods: `adoptVariants()`, `mount()`
700
-
701
- ```html
702
- <usa-avatar-stack max="4">
703
- <img src="a.jpg" alt="Ana">
704
- …
705
- </usa-avatar-stack>
706
- ```
707
-
708
- ### <usa-back-to-top> — Back to top
709
-
710
- Appears after you scroll, shows reading progress as a ring and springs the page back up, then moves focus to the top.
711
-
712
- - Import: `import { defineBackToTop } from 'motionary/components/page'; defineBackToTop();`
713
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
714
- - Attributes: `label`, `offset`, `focus-target`
715
-
716
- ```html
717
- <usa-back-to-top offset="400"></usa-back-to-top>
718
- ```
719
-
720
- ### <usa-badge> — Badge
721
-
722
- Count or dot badge that bumps with a spring when its value changes; 99+ capping, optional pulse.
723
-
724
- - Import: `import { defineBadge } from 'motionary/components/ui'; defineBadge();`
725
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
726
- - Attributes: `value`, `max`, `dot`, `label`, `show-zero`
727
-
728
- ```html
729
- <usa-badge value="3">
730
- <button>Inbox</button>
731
- </usa-badge>
732
- ```
733
-
734
- ### <usa-badge-wall> — Badge wall
735
-
736
- 7.5: an achievement grid — locked badges are grey with a 🔒; unlock(name) flips a badge to its colour side with a shine and the “n / m unlocked” counter updates.
737
-
738
- - Import: `import { defineBadgeWall } from 'motionary/components/widgets'; defineBadgeWall();`
739
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
740
- - Attributes: `label`
741
- - Events: `usa:unlock`
742
- - Methods: `unlock()`
743
-
744
- ```html
745
- <usa-badge-wall>
746
- <li data-icon="🏆">First win</li>
747
- <li data-icon="🔥" data-locked>7-day streak</li>
748
- </usa-badge-wall>
749
- <script>addEventListener('DOMContentLoaded', () => { const wall = document.querySelector('usa-badge-wall'); wall.unlock('7-day streak'); });</script>
750
- ```
751
-
752
- ### <usa-bar-chart> — Animated bar chart
753
-
754
- 7.2: bars grow from the baseline in a stagger on first view and new data glides every bar to its new height — bars that appear grow in, bars that leave shrink away. Data from values/labels, <data> children or the data property.
755
-
756
- - Import: `import { defineBarChart } from 'motionary/components/widgets'; defineBarChart();`
757
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
758
- - Attributes: `horizontal`, `unit`, `max`, `values`, `labels`, `label`
759
-
760
- ```html
761
- <usa-bar-chart values="12,19,8,15,22" labels="Mon,Tue,Wed,Thu,Fri" unit="k"></usa-bar-chart>
762
- <script>addEventListener('DOMContentLoaded', () => { document.querySelector('usa-bar-chart').data = [{ label: 'Mon', value: 18 }, { label: 'Tue', value: 12 }, { label: 'Wed', value: 21 }]; });</script>
763
- ```
764
-
765
- ### <usa-bg-generator> — Background generator
766
-
767
- 9.3: a background generator — pick a palette and a style (mesh gradient, grain, stripes, dots), shuffle the seed and copy the CSS.
768
-
769
- - Import: `import { defineBgGenerator } from 'motionary/components/widgets'; defineBgGenerator();`
770
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
771
- - Attributes: `label`, `palette`, `style`, `seed`
772
- - Events: `usa:change`
773
- - Methods: `shuffle()`, `copy()`
774
-
775
- ```html
776
- <usa-bg-generator palette="candy" style="mesh"></usa-bg-generator>
777
- ```
778
-
779
- ### <usa-blobs> — Fluid blobs
780
-
781
- Soft colour blobs that slowly morph and drift — a fluid gradient backdrop.
782
-
783
- - Import: `import { defineBlobs } from 'motionary/components/background'; defineBlobs();`
784
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
785
- - Attributes: `colors`, `speed`, `blur`
786
- - Methods: `mount()`
787
-
788
- ```html
789
- <usa-blobs colors="#7c5cff,#22d3ee,#f472b6">…</usa-blobs>
790
- ```
791
-
792
- ### <usa-bottom-sheet> — Bottom sheet
793
-
794
- A draggable sheet with snap points, inertia and drag-down-to-dismiss — the iOS / Android pattern for web and Windows web-view apps.
795
-
796
- - Import: `import { defineBottomSheet } from 'motionary/components/ui'; defineBottomSheet();`
797
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
798
- - Attributes: `open`, `snap`, `start`
799
- - Methods: `show()`, `close()`
800
-
801
- ```html
802
- <usa-bottom-sheet snap="0.4,0.9" label="Filters">…</usa-bottom-sheet>
803
- ```
804
-
805
- ### <usa-button> — Button deformation
806
-
807
- Spring-driven button click deformation: squash & stretch, elastic border-radius wobble, gooey liquid droplets, and a dent toward the pressed point. Combine them with deform="squash wobble".
808
-
809
- - Import: `import { defineButton } from 'motionary/components/click'; defineButton();`
810
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
811
- - Attributes: `deform`, `state`, `shape`, `disabled`, `morph`, `haptic`, `reset`
812
- - Events: `usa:submit`, `usa:state`
813
- - Methods: `morphTo()`
814
-
815
- ```html
816
- <usa-button deform="squash">
817
- <button>Squash</button>
818
- </usa-button>
819
- <usa-button deform="gooey"><button>Gooey</button></usa-button>
820
- <usa-button deform="dent"><button>Dent</button></usa-button>
821
- ```
822
-
823
- ### <usa-card> — Card
824
-
825
- Ten card effects you can combine (effect="lift sheen"): flip (hover or click, x/y axis), holo, glass, border-glow, conic-border, lift, spotlight, sheen, parallax-layers and expand (card → detail with FLIP + spring).
826
-
827
- - Import: `import { defineCard } from 'motionary/components/cards'; defineCard();`
828
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
829
- - Attributes: `effect`, `trigger`, `disabled`, `color`, `depth`
830
- - Events: `usa:flip`, `usa:expand`, `usa:collapse`
831
- - Methods: `flip()`, `expand()`, `collapse()`
832
-
833
- ```html
834
- <usa-card effect="lift sheen">
835
- <h3>Pro plan</h3>
836
- </usa-card>
837
- <usa-card effect="flip" trigger="click">
838
- <div data-front>Front</div>
839
- <div data-back>Back</div>
840
- </usa-card>
841
- <usa-card effect="expand">
842
- <h3>Title</h3>
843
- <div data-detail>Long text… <button data-close>Close</button></div>
844
- </usa-card>
845
- ```
846
-
847
- ### <usa-card-stack> — Swipe stack
848
-
849
- A deck where the top card swipes away left or right (pointer, touch, arrow keys) and the next springs forward. loop sends cards to the back.
850
-
851
- - Import: `import { defineCardStack } from 'motionary/components/cards'; defineCardStack();`
852
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
853
- - Attributes: `visible`, `offset`, `disabled`, `threshold`, `loop`
854
- - Events: `usa:swipe`, `usa:empty`
855
- - Methods: `swipe()`
856
-
857
- ```html
858
- <usa-card-stack loop>
859
- <article>1</article>
860
- <article>2</article>
861
- <article>3</article>
862
- </usa-card-stack>
863
- ```
864
-
865
- ### <usa-carousel> — Carousel / slider
866
-
867
- 6.2: swipe, drag, arrow keys, dots and autoplay (pauses on hover, focus, off screen). Four transitions — slide, fade, scale and a 3D "cards" coverflow. Reduced motion: slides switch without movement.
868
-
869
- - Import: `import { defineCarousel } from 'motionary/components/widgets'; defineCarousel();`
870
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
871
- - Attributes: `effect`, `autoplay`, `loop`, `no-controls`, `no-dots`, `label`, `index`
872
- - Events: `usa:change`
873
- - Methods: `next()`, `prev()`, `goTo()`
874
-
875
- ```html
876
- <usa-carousel effect="cards" loop autoplay="4000" label="Featured">
877
- <img src="a.jpg" alt="…">
878
- <img src="b.jpg" alt="…">
879
- <img src="c.jpg" alt="…">
880
- </usa-carousel>
881
- ```
882
-
883
- ### <usa-carousel-3d> — 3D carousel
884
-
885
- Items on a 3D ring, rotated by drag, arrow keys, clicks or autoplay — with spring motion. Reduced motion shows one flat item at a time.
886
-
887
- - Import: `import { defineCarousel3d } from 'motionary/components/cards'; defineCarousel3d();`
888
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
889
- - Attributes: `radius`, `perspective`, `autoplay`, `index`
890
- - Events: `usa:change`
891
- - Methods: `next()`, `prev()`, `goTo()`
892
-
893
- ```html
894
- <usa-carousel-3d autoplay="3000">
895
- <img src="1.jpg" alt="">
896
- <img src="2.jpg" alt="">
897
- …
898
- </usa-carousel-3d>
899
- ```
900
-
901
- ### <usa-cart-drawer> — Cart drawer
902
-
903
- 7.3: a cart button with a count badge and a drawer that slides in from the side — lines slide in (or bump their quantity), removed lines collapse, the badge bumps and the total rolls. Esc / backdrop close; focus is managed.
904
-
905
- - Import: `import { defineCartDrawer } from 'motionary/components/widgets'; defineCartDrawer();`
906
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
907
- - Attributes: `label`, `items`, `currency`
908
- - Events: `usa:open`, `usa:close`, `usa:change`
909
- - Methods: `add()`, `removeItem()`, `toggle()`
910
-
911
- ```html
912
- <usa-cart-drawer currency="$"></usa-cart-drawer>
913
- <script>addEventListener('DOMContentLoaded', () => { const cart = document.querySelector('usa-cart-drawer'); cart.add({ id: 'tee', name: 'T-shirt', price: 24 }); });</script>
914
- ```
915
-
916
- ### <usa-chapter-nav> — Chapter nav
917
-
918
- 9.1: chapter navigation for long-form stories — one entry per chapter with a reading-progress bar that fills as you scroll, the current chapter highlighted, click to glide there.
919
-
920
- - Import: `import { defineChapterNav } from 'motionary/components/widgets'; defineChapterNav();`
921
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
922
- - Attributes: `for`, `orientation`, `label`
923
- - Events: `usa:chapter`
924
- - Methods: `goTo()`
925
-
926
- ```html
927
- <usa-chapter-nav for="#story"></usa-chapter-nav>
928
- <article id="story">
929
- <section data-chapter="Prologue">…</section>
930
- <section data-chapter="The storm">…</section>
931
- </article>
932
- ```
933
-
934
- ### <usa-chat-composer> — AI chat composer
935
-
936
- 7.8: an AI chat input that grows with its text; Enter sends, the send button pops when there is text and morphs into Stop while busy, with a thinking glow running round the composer.
937
-
938
- - Import: `import { defineChatComposer } from 'motionary/components/widgets'; defineChatComposer();`
939
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
940
- - Attributes: `placeholder`, `label`, `rows`, `busy`, `value`
941
- - Events: `usa:stop`, `usa:send`
942
- - Methods: `send()`, `clear()`
943
-
944
- ```html
945
- <usa-chat-composer placeholder="Ask anything…"></usa-chat-composer>
946
- <script>const composer = document.querySelector('usa-chat-composer'); composer.addEventListener('usa:send', async (e) => { composer.busy = true; await ask(e.detail.text); composer.busy = false; });</script>
947
- ```
948
-
949
- ### <usa-check> — Result icon
950
-
951
- The circle draws itself, then a check, cross or exclamation strokes in with a pop. Great after a payment or upload.
952
-
953
- - Import: `import { defineCheck } from 'motionary/components/feedback'; defineCheck();`
954
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
955
- - Attributes: `kind`, `size`, `label`, `start`
956
- - Events: `usa:complete`
957
- - Methods: `play()`, `reset()`
958
-
959
- ```html
960
- <usa-check kind="success" label="Payment complete"></usa-check>
961
- ```
962
-
963
- ### <usa-checkbox> — Animated checkbox
964
-
965
- Form-associated checkbox: the box springs and the check draws itself; indeterminate state, circle shape.
966
-
967
- - Import: `import { defineCheckbox } from 'motionary/components/click'; defineCheckbox();`
968
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
969
- - Attributes: `checked`, `indeterminate`, `disabled`, `label`, `value`
970
- - Events: `usa:change`
971
- - Methods: `toggle()`
972
-
973
- ```html
974
- <usa-checkbox name="terms">I agree</usa-checkbox>
975
- ```
976
-
977
- ### <usa-click> — Click effects
978
-
979
- Wrap anything: ripple, burst (circle, star, heart, emoji), confetti, squish, press-spring and error shake — combinable, keyboard-friendly, optional haptics.
980
-
981
- - Import: `import { defineClick } from 'motionary/components/click'; defineClick();`
982
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
983
- - Attributes: `effect`, `disabled`, `trigger`, `color`, `count`, `shape`, `haptic`
984
- - Events: `usa:click-effect`
985
- - Methods: `play()`, `shake()`
986
-
987
- ```html
988
- <usa-click effect="press-spring burst" shape="star">
989
- <button>Celebrate</button>
990
- </usa-click>
991
- ```
992
-
993
- ### <usa-clock-control> — Motion clock control
994
-
995
- 8.0: a pause / speed bar for the unified motion clock — pause, slow down or speed up every Motionary animation and frame loop on the page at once (motionClock in motionary/engine).
996
-
997
- - Import: `import { defineClockControl } from 'motionary/components/widgets'; defineClockControl();`
998
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
999
- - Attributes: `speeds`, `label`
1000
- - Events: `usa:change`
1001
-
1002
- ```html
1003
- <usa-clock-control speeds="0.25,0.5,1,2"></usa-clock-control>
1004
- <div class="box">A</div> <div class="box">B</div>
1005
- <script type="module">
1006
- import { motionClock, createTimeline } from 'motionary/engine';
1007
- motionClock.rate = 0.5;
1008
- const [a, b] = document.querySelectorAll('.box');
1009
- createTimeline().add(a, [{ opacity: 0 }, { opacity: 1 }], 400).add(b, [{ transform: 'scale(0)' }, { transform: 'none' }], 500, '-=200').play();
1010
- </script>
1011
- ```
1012
-
1013
- ### <usa-code-export> — Code export
1014
-
1015
- 8.9 low-code: shows copy-paste code (HTML, React, Vue or JSON) for a live, configured component next to it, follows its attribute changes and copies with one click.
1016
-
1017
- - Import: `import { defineCodeExport } from 'motionary/components/widgets'; defineCodeExport();`
1018
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1019
- - Attributes: `for`, `formats`
1020
- - Events: `usa:copy`
1021
- - Methods: `copy()`
1022
-
1023
- ```html
1024
- <usa-code-export formats="html,react,vue">
1025
- <usa-star-rating value="4"></usa-star-rating>
1026
- </usa-code-export>
1027
- ```
1028
-
1029
- ### <usa-color-picker> — Color picker
1030
-
1031
- 6.9: a saturation / brightness square and a hue strip with spring-follow thumbs (both keyboard sliders), a preview chip that morphs to the new colour and swatches that pop.
1032
-
1033
- - Import: `import { defineColorPicker } from 'motionary/components/widgets'; defineColorPicker();`
1034
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1035
- - Attributes: `swatches`
1036
- - Events: `usa:change`, `usa:input`
1037
-
1038
- ```html
1039
- <usa-color-picker value="#7c5cff" swatches="#f43f5e,#f59e0b,#22c55e,#0ea5e9"></usa-color-picker>
1040
- ```
1041
-
1042
- ### <usa-command-palette> — Command palette (⌘K)
1043
-
1044
- 7.9: a ⌘K command palette on the native <dialog> — scales in, filters as you type with fuzzy matching and highlighted letters, results stagger in and a highlight glides between rows (↑ ↓ Enter).
1045
-
1046
- - Import: `import { defineCommandPalette } from 'motionary/components/widgets'; defineCommandPalette();`
1047
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1048
- - Attributes: `placeholder`, `label`, `hotkey`, `inline`
1049
- - Events: `usa:run`, `usa:open`, `usa:close`
1050
- - Methods: `setCommands()`, `show()`, `close()`, `toggle()`
1051
-
1052
- ```html
1053
- <usa-command-palette>
1054
- <option value="new" data-group="File" data-keys="mod+n">New file</option>
1055
- <option value="theme" data-group="View">Toggle theme</option>
1056
- </usa-command-palette>
1057
- <script>const palette = document.querySelector('usa-command-palette'); palette.addEventListener('usa:run', (e) => run(e.detail.id));</script>
1058
- ```
1059
-
1060
- ### <usa-compare> — Before / after compare
1061
-
1062
- 6.5: drag the handle (or hover with the hover attribute), click to jump, or use the keyboard slider; horizontal or vertical; an intro sweep plays once when it scrolls into view.
1063
-
1064
- - Import: `import { defineCompare } from 'motionary/components/widgets'; defineCompare();`
1065
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1066
- - Attributes: `orientation`, `labels`, `label`, `position`, `hover`, `intro`
1067
- - Events: `usa:change`
1068
-
1069
- ```html
1070
- <usa-compare labels="Before,After" intro>
1071
- <img src="before.jpg" alt="Before">
1072
- <img src="after.jpg" alt="After">
1073
- </usa-compare>
1074
- ```
1075
-
1076
- ### <usa-countdown> — Flip countdown
1077
-
1078
- 7.3: a split-flap countdown to a date (to) or for a number of seconds — every digit flips when it changes; fires usa:done at zero. The timer label updates once a minute so screen readers are not flooded.
1079
-
1080
- - Import: `import { defineCountdown } from 'motionary/components/widgets'; defineCountdown();`
1081
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1082
- - Attributes: `to`, `seconds`, `units`, `labels`, `label`
1083
- - Events: `usa:tick`, `usa:done`
1084
- - Methods: `start()`, `stop()`
1085
-
1086
- ```html
1087
- <usa-countdown to="2026-12-24T00:00:00" units="d,h,m,s"></usa-countdown>
1088
- ```
1089
-
1090
- ### <usa-counter> — Number counter
1091
-
1092
- Counts up to a number when visible, locale-formatted with tabular digits. Set .value to animate live dashboards.
1093
-
1094
- - Import: `import { defineCounter } from 'motionary/components/text'; defineCounter();`
1095
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1096
- - Attributes: `to`, `decimals`, `locale`, `prefix`, `suffix`, `grouping`, `from`, `start`, `duration`
1097
- - Events: `usa:complete`
1098
- - Methods: `play()`, `format()`
1099
-
1100
- ```html
1101
- <usa-counter to="128490" prefix="$" duration="2000"></usa-counter>
1102
- ```
1103
-
1104
- ### <usa-cube> — 3D cube
1105
-
1106
- Up to six children become the faces of a CSS 3D cube. Drag / swipe, arrow keys, autoplay or show("top"); spring-driven, the front face is the only one exposed to screen readers.
1107
-
1108
- - Import: `import { defineCube } from 'motionary/components/depth'; defineCube();`
1109
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1110
- - Attributes: `size`, `autoplay`, `perspective`
1111
- - Events: `usa:change`
1112
- - Methods: `show()`, `next()`, `prev()`
1113
-
1114
- ```html
1115
- <usa-cube size="200" autoplay="3000">
1116
- <div>Front</div><div>Right</div><div>Back</div><div>Left</div>
1117
- </usa-cube>
1118
- ```
1119
-
1120
- ### <usa-cube-gallery> — Cube gallery
1121
-
1122
- 6.5: slides sit on adjacent faces of a 3D cube that turns between them — swipe, arrow keys, buttons or autoplay (pauses on hover / focus / off screen); turn around the Y or X axis.
1123
-
1124
- - Import: `import { defineCubeGallery } from 'motionary/components/widgets'; defineCubeGallery();`
1125
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1126
- - Attributes: `axis`, `autoplay`, `label`
1127
- - Events: `usa:change`
1128
- - Methods: `next()`, `prev()`, `goTo()`
1129
-
1130
- ```html
1131
- <usa-cube-gallery autoplay="4000" label="Products">
1132
- <img src="a.jpg" alt="…">
1133
- <img src="b.jpg" alt="…">
1134
- <img src="c.jpg" alt="…">
1135
- </usa-cube-gallery>
1136
- ```
1137
-
1138
- ### <usa-cursor> — Custom cursor
1139
-
1140
- A spring-lagged ring, a magnetic ring that wraps buttons and links, or a soft glow following the pointer. Mouse / pen only. (6.0: for a comet tail use the comet-trail effect.)
1141
-
1142
- - Import: `import { defineCursor } from 'motionary/components/page'; defineCursor();`
1143
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1144
- - Attributes: `mode`, `size`, `color`, `hide-native`, `targets`
1145
-
1146
- ```html
1147
- <usa-cursor mode="magnetic" hide-native></usa-cursor>
1148
- ```
1149
-
1150
- ### <usa-date-picker> — Date picker
1151
-
1152
- 6.9: months slide in from the direction of travel, the chosen day pops inside a spring circle, today has a ring. A real date grid: arrows, PageUp / PageDown, Home / End, min / max.
1153
-
1154
- - Import: `import { defineDatePicker } from 'motionary/components/widgets'; defineDatePicker();`
1155
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1156
- - Attributes: `min`, `max`, `first-day`, `locale`
1157
- - Events: `usa:change`
1158
- - Methods: `showMonth()`
1159
-
1160
- ```html
1161
- <usa-date-picker value="2026-10-08" min="2026-01-01" first-day="1"></usa-date-picker>
1162
- ```
1163
-
1164
- ### <usa-depth> — Depth parallax
1165
-
1166
- Layers with data-depth (-1…1) shift and scale by depth as the pointer moves, the phone tilts (source="orientation") or the page scrolls; optional whole-scene rotation.
1167
-
1168
- - Import: `import { defineDepth } from 'motionary/components/depth'; defineDepth();`
1169
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1170
- - Attributes: `source`, `strength`, `rotate`
1171
- - Methods: `requestPermission()`
1172
-
1173
- ```html
1174
- <usa-depth source="pointer orientation" strength="40" rotate="6">
1175
- <div class="scene">
1176
- <img data-depth="-0.6" src="sky.png" alt="">
1177
- <img data-depth="0.2" src="hills.png" alt="">
1178
- <h2 data-depth="0.8">Title</h2>
1179
- </div>
1180
- </usa-depth>
1181
- ```
1182
-
1183
- ### <usa-dialog> — Modal & drawer
1184
-
1185
- Animated modal, side drawers and bottom sheet on the native <dialog>: top layer, focus trap, Esc, backdrop click.
1186
-
1187
- - Import: `import { defineDialog } from 'motionary/components/transitions'; defineDialog();`
1188
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1189
- - Attributes: `open`, `kind`, `label`, `no-esc`, `no-backdrop-close`
1190
- - Events: `usa:open`, `usa:beforeclose`, `usa:close`
1191
- - Slots: default
1192
- - Methods: `show()`, `close()`
1193
-
1194
- ```html
1195
- <usa-dialog id="dlg" kind="modal" label="Settings">
1196
- <h2>Settings</h2>
1197
- <button data-close>Done</button>
1198
- </usa-dialog>
1199
- <button onclick="dlg.show()">Open</button>
1200
- ```
1201
-
1202
- ### <usa-disclosure> — Accordion 2.0
1203
-
1204
- 6.2: native <details> that spring open and closed (height + fade) with an overshooting chevron; one open at a time unless multiple. Find-in-page and keyboard keep working.
1205
-
1206
- - Import: `import { defineDisclosure } from 'motionary/components/widgets'; defineDisclosure();`
1207
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1208
- - Attributes: `multiple`, `spring`
1209
- - Events: `usa:toggle`
1210
- - Methods: `toggle()`, `openAll()`, `closeAll()`
1211
-
1212
- ```html
1213
- <usa-disclosure variant="cards">
1214
- <details><summary>Shipping</summary><p>…</p></details>
1215
- <details><summary>Returns</summary><p>…</p></details>
1216
- </usa-disclosure>
1217
- ```
1218
-
1219
- ### <usa-distort> — Hover distortion
1220
-
1221
- The image bulges and splits into RGB around the pointer. Without WebGL (or a cross-origin image without CORS) it falls back to a gentle CSS zoom.
1222
-
1223
- - Import: `import { defineDistort } from 'motionary/components/webgl'; defineDistort();`
1224
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1225
-
1226
- ```html
1227
- <usa-distort>
1228
- <img src="photo.jpg" alt="…">
1229
- </usa-distort>
1230
- ```
1231
-
1232
- ### <usa-dock> — macOS-style dock
1233
-
1234
- 6.6: items magnify with a smooth cosine falloff as the pointer moves along the dock, neighbours make room, labels pop above the hovered item and a click bounces it. Keyboard focus magnifies too.
1235
-
1236
- - Import: `import { defineDock } from 'motionary/components/widgets'; defineDock();`
1237
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1238
- - Attributes: `orientation`, `magnify`, `range`, `label`, `bounce`
1239
-
1240
- ```html
1241
- <usa-dock magnify="1.9" bounce label="Apps">
1242
- <button data-label="Finder" aria-label="Finder">🗂</button>
1243
- <button data-label="Music" aria-label="Music">🎵</button>
1244
- <a href="/mail" data-label="Mail" aria-label="Mail">✉️</a>
1245
- </usa-dock>
1246
- ```
1247
-
1248
- ### <usa-dot-network> — Dot network
1249
-
1250
- A dot grid that swells and links up with lines around the pointer.
1251
-
1252
- - Import: `import { defineDotNetwork } from 'motionary/components/background'; defineDotNetwork();`
1253
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1254
- - Attributes: `gap`, `radius`, `color`
1255
- - Methods: `mount()`
1256
-
1257
- ```html
1258
- <usa-dot-network gap="28">…</usa-dot-network>
1259
- ```
1260
-
1261
- ### <usa-dotlottie> — Interactive dotLottie (themes + state machine)
1262
-
1263
- 10.9: plays .lottie files with their themes (slots recoloured by a theme from the file) and state machines — playback states, event / numeric / boolean guards, pointer and completion interactions, input and theme actions (OpenUrl is refused). Tap the dot: it starts pulsing, three taps switch it to the dark theme. Requires motionary/runtime/vector + motionary/runtime/lottie-state — npm i motionary, then use(vector, lottieState). Its own entry point: motionary/components/dotlottie.
1264
-
1265
- - Import: `import { defineDotLottie } from 'motionary/components/dotlottie'; defineDotLottie();`
1266
- - CDN: https://unpkg.com/motionary@15/dist/components/dotlottie.js
1267
- - Attributes: `theme`, `state-machine`
1268
- - Events: `usa:error`, `usa:state`, `usa:custom`, `usa:runtime-missing`
1269
- - Methods: `fire()`, `setInput()`, `setTheme()`
1270
- - Requires: motionary/runtime/vector + motionary/runtime/lottie-state
1271
- - Install: `npm i motionary`
1272
- - Order: Register the core first, then the module: use(vector) also registers the core. CDN: load runtime.iife.js, then runtime/vector.iife.js (it registers itself). Register the core first, then the module: use(lottieState) also registers the core. CDN: load runtime.iife.js, then runtime/lottie-state.iife.js (it registers itself).
1273
-
1274
- ```js
1275
- import { use } from 'motionary/runtime';
1276
- import { vector } from 'motionary/runtime/vector';
1277
- import { lottieState } from 'motionary/runtime/lottie-state';
1278
- import { defineDotLottie } from 'motionary/components/dotlottie';
1279
-
1280
- use(vector, lottieState);
1281
- defineDotLottie(); // registers <usa-dotlottie> — after the prerequisites
1282
- ```
1283
-
1284
- ```html
1285
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
1286
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/vector.iife.js"></script>
1287
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/lottie-state.iife.js"></script>
1288
- <!-- then the component bundles -->
1289
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
1290
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
1291
- ```
1292
-
1293
- ```html
1294
- <usa-dotlottie src="/anim/button.lottie" state-machine="toggle" theme="dark" label="Like button"></usa-dotlottie>
1295
- ```
1296
-
1297
- ### <usa-double-tap> — Double tap
1298
-
1299
- Double tap or double click a photo to pop a heart (or any emoji) at the tap point. L for keyboard users.
1300
-
1301
- - Import: `import { defineDoubleTap } from 'motionary/components/click'; defineDoubleTap();`
1302
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1303
- - Attributes: `disabled`, `delay`, `icon`, `color`
1304
- - Events: `usa:double-tap`
1305
- - Methods: `pop()`
1306
-
1307
- ```html
1308
- <usa-double-tap>
1309
- <img src="photo.jpg" alt="…">
1310
- </usa-double-tap>
1311
- ```
1312
-
1313
- ### <usa-draggable> — Draggable
1314
-
1315
- Drag with mouse, touch, pen or arrow keys. spring-back returns home with a wobble; inertia glides after a flick; snap to a grid or points; rubber-band bounds.
1316
-
1317
- - Import: `import { defineDraggable } from 'motionary/components/physics'; defineDraggable();`
1318
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1319
- - Attributes: `axis`, `disabled`, `preset`, `bounds`, `spring-back`, `inertia`, `snap`, `step`
1320
- - Events: `usa:settle`, `usa:drag-start`, `usa:drag`, `usa:drag-end`
1321
- - Methods: `moveTo()`, `reset()`
1322
-
1323
- ```html
1324
- <usa-draggable spring-back>
1325
- <div class="card">Drag me</div>
1326
- </usa-draggable>
1327
- <usa-draggable inertia snap="80" bounds="parent">…</usa-draggable>
1328
- ```
1329
-
1330
- ### <usa-draw> — Line drawing
1331
-
1332
- Every stroke of the SVG inside draws itself — on view, hover, click or scrubbed with scroll — staggered between shapes, optional fill afterwards. No getTotalLength() needed.
1333
-
1334
- - Import: `import { defineDraw } from 'motionary/components/svg'; defineDraw();`
1335
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1336
- - Attributes: `duration`, `stagger`, `trigger`, `repeat`
1337
- - Events: `usa:complete`
1338
- - Methods: `play()`
1339
-
1340
- ```html
1341
- <usa-draw duration="1800" stagger="0.3" fill>
1342
- <svg viewBox="0 0 100 40">…</svg>
1343
- </usa-draw>
1344
- ```
1345
-
1346
- ### <usa-drawer> — Drawer
1347
-
1348
- A side panel that springs in, drags / swipes closed, traps the page behind a backdrop and returns focus on close. Left, right, top or bottom.
1349
-
1350
- - Import: `import { defineDrawer } from 'motionary/components/ui'; defineDrawer();`
1351
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1352
- - Methods: `show()`, `close()`
1353
-
1354
- ```html
1355
- <button onclick="nav.open = true">Menu</button>
1356
- <usa-drawer id="nav" side="left" label="Navigation">…</usa-drawer>
1357
- ```
1358
-
1359
- ### <usa-equalizer> — Graphic equalizer
1360
-
1361
- 7.1: one vertical slider per band with springy caps and a smooth response curve drawn through them; presets glide every band to its gain.
1362
-
1363
- - Import: `import { defineEqualizer } from 'motionary/components/widgets'; defineEqualizer();`
1364
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1365
- - Attributes: `bands`, `preset`, `label`
1366
- - Events: `usa:change`
1367
- - Methods: `applyPreset()`
1368
-
1369
- ```html
1370
- <usa-equalizer preset="rock" bands="60,150,400,1k,2.4k,6k,16k"></usa-equalizer>
1371
- <script>addEventListener('DOMContentLoaded', () => { const eq = document.querySelector('usa-equalizer'); eq.applyPreset('vocal'); });</script>
1372
- ```
1373
-
1374
- ### <usa-fab> — FAB speed dial
1375
-
1376
- A floating action button whose actions fan out with a staggered spring: up, down, left, right or radial.
1377
-
1378
- - Import: `import { defineFab } from 'motionary/components/ui'; defineFab();`
1379
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1380
- - Attributes: `direction`, `gap`
1381
- - Events: `usa:toggle`
1382
- - Methods: `toggle()`
1383
-
1384
- ```html
1385
- <usa-fab direction="up">
1386
- <button aria-label="Create">+</button>
1387
- <button aria-label="Photo">📷</button>
1388
- <button aria-label="Note">📝</button>
1389
- </usa-fab>
1390
- ```
1391
-
1392
- ### <usa-festival-banner> — Festival banner
1393
-
1394
- 8.1: an announcement banner with an ambient festive scene behind the text — lunar lanterns and sparkles, Christmas lights and snow, Halloween bats and moon, or fireworks.
1395
-
1396
- - Import: `import { defineFestivalBanner } from 'motionary/components/widgets'; defineFestivalBanner();`
1397
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1398
- - Attributes: `theme`, `label`, `dismissible`
1399
- - Events: `usa:dismiss`
1400
- - Methods: `dismiss()`
1401
-
1402
- ```html
1403
- <usa-festival-banner theme="lunar" dismissible>🧧 Happy Lunar New Year — 20% off all week</usa-festival-banner>
1404
- ```
1405
-
1406
- ### <usa-field> — Animated field
1407
-
1408
- 7.7: a text input whose label floats up on focus, with a growing underline; validates on blur — invalid shakes and slides the message in, valid draws a check. strength adds a 4-step password meter.
1409
-
1410
- - Import: `import { defineField } from 'motionary/components/widgets'; defineField();`
1411
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1412
- - Attributes: `label`, `hint`, `error`, `strength`
1413
- - Events: `usa:invalid`, `usa:valid`
1414
- - Methods: `validate()`
1415
-
1416
- ```html
1417
- <usa-field label="Email" type="email" name="email" required></usa-field>
1418
- <usa-field label="Password" type="password" name="pw" minlength="8" strength></usa-field>
1419
- ```
1420
-
1421
- ### <usa-file-drop> — File drop zone
1422
-
1423
- 6.9: dragging files over it lights marching-ants borders and lifts the icon; dropped (or browsed) files fly into a list with progress bars that end in a drawn check.
1424
-
1425
- - Import: `import { defineFileDrop } from 'motionary/components/widgets'; defineFileDrop();`
1426
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1427
- - Attributes: `label`, `accept`, `multiple`, `simulate`
1428
- - Events: `usa:files`
1429
- - Methods: `setProgress()`, `addFiles()`, `clear()`
1430
-
1431
- ```html
1432
- <usa-file-drop multiple accept="image/*" label="Drop images or browse"></usa-file-drop>
1433
- <script>
1434
- const drop = document.querySelector('usa-file-drop');
1435
- drop.addEventListener('usa:files', (e) => upload(e.detail.files, (i, p) => drop.setProgress(i, p)));
1436
- </script>
1437
- ```
1438
-
1439
- ### <usa-fullpage> — Full-page sections
1440
-
1441
- Full-screen sections that snap one at a time, with keyboard paging, dot navigation and a usa:section event.
1442
-
1443
- - Import: `import { defineFullpage } from 'motionary/components/page'; defineFullpage();`
1444
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1445
- - Attributes: `dots`, `axis`
1446
- - Events: `usa:section`
1447
- - Methods: `go()`, `next()`, `prev()`
1448
-
1449
- ```html
1450
- <usa-fullpage dots>
1451
- <section>One</section>
1452
- <section>Two</section>
1453
- </usa-fullpage>
1454
- ```
1455
-
1456
- ### <usa-fx> — Attention seekers
1457
-
1458
- <usa-fx> plays any registered effect on its child: pulse, pop, jelly, wiggle, heartbeat, bounce, flash (≤ 2 per second), tada, shake. Click the button.
1459
-
1460
- - Import: `import { defineFx } from 'motionary/components/fx'; defineFx();`
1461
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1462
- - Attributes: `effect`, `trigger`, `options`, `self`, `once`
1463
- - Methods: `play()`
1464
-
1465
- ```html
1466
- <usa-fx effect="jelly" trigger="click">
1467
- <button>Press me</button>
1468
- </usa-fx>
1469
- ```
1470
-
1471
- ### <usa-gauge> — Spring gauge
1472
-
1473
- 7.2: a semicircular gauge — the needle swings to the value on a damped spring (overshoot, settle), the arc fills in the colour of its zone and the number counts. role="meter".
1474
-
1475
- - Import: `import { defineGauge } from 'motionary/components/widgets'; defineGauge();`
1476
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1477
- - Attributes: `min`, `max`, `zones`, `unit`, `label`, `value`
1478
-
1479
- ```html
1480
- <usa-gauge value="72" unit="%" label="CPU" zones="60:#22c55e,85:#f59e0b,100:#ef4444"></usa-gauge>
1481
- ```
1482
-
1483
- ### <usa-gen-art> — Generative artwork
1484
-
1485
- 9.3: seeded generative art on a canvas — flow fields, circle packing, Truchet tiles or layered waves in curated palettes; it draws itself in on screen and a tap re-seeds it.
1486
-
1487
- - Import: `import { defineGenArt } from 'motionary/components/widgets'; defineGenArt();`
1488
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1489
- - Attributes: `art`, `seed`, `palette`, `label`
1490
- - Events: `usa:generate`
1491
- - Methods: `generate()`, `toDataURL()`
1492
-
1493
- ```html
1494
- <usa-gen-art art="flow" seed="7" palette="ocean" style="height:240px"></usa-gen-art>
1495
- ```
1496
-
1497
- ### <usa-gesture-fx> — Gesture triggers
1498
-
1499
- 5.7: <usa-gesture-fx> plays any registered effect on a fling (fast release), a two-finger twist or a long press that charges --usa-charge 0 → 1. JS: bindGesture(el, "fling", "tada").
1500
-
1501
- - Import: `import { defineGestureFx } from 'motionary/components/effects'; defineGestureFx();`
1502
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1503
- - Attributes: `gesture`, `effect`, `options`, `self`, `velocity`, `angle`, `duration`
1504
-
1505
- ```html
1506
- <usa-gesture-fx gesture="long-press" effect="tada">
1507
- <button>Hold me</button>
1508
- </usa-gesture-fx>
1509
- ```
1510
-
1511
- ### <usa-gesture-sticker> — Multi-touch sticker
1512
-
1513
- 8.7: a multi-touch sticker — drag with one finger, pinch with two to scale and twist to rotate, all at once, with a lifted shadow while held (wheel / Shift + wheel and keyboard on desktop).
1514
-
1515
- - Import: `import { defineGestureSticker } from 'motionary/components/widgets'; defineGestureSticker();`
1516
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1517
- - Attributes: `min`, `max`, `label`
1518
- - Events: `usa:transform`
1519
- - Methods: `transformTo()`, `reset()`
1520
-
1521
- ```html
1522
- <usa-gesture-sticker label="Star sticker" max="3">
1523
- <img src="star.png" alt="Star" width="120">
1524
- </usa-gesture-sticker>
1525
- ```
1526
-
1527
- ### <usa-gl-model> — Compressed 3D model (Draco / KTX2)
1528
-
1529
- 10.9: <usa-gl-scene> for compressed glTF — Draco meshes and KTX2 (Basis Universal) textures decoded by the official decoders (Google draco3d, Binomial’s Basis Universal transcoder), lazy-loaded optional peers: only the decoder a file needs is fetched. Requires motionary/runtime/gl + format-gltf + gltf-decoders and draco3d (+ the Basis transcoder for KTX2 textures). Its own entry point: motionary/components/gl-model.
1530
-
1531
- - Import: `import { defineGlModel } from 'motionary/components/gl-model'; defineGlModel();`
1532
- - CDN: https://unpkg.com/motionary@15/dist/components/gl-model.js
1533
- - Events: `usa:runtime-missing`
1534
- - Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/gltf-decoders + draco3d + basis_transcoder.js
1535
- - Install: `npm i motionary && npm i draco3d && curl -LO https://cdn.jsdelivr.net/gh/BinomialLLC/basis_universal@1.16.4/webgl/transcoder/build/basis_transcoder.js -LO https://cdn.jsdelivr.net/gh/BinomialLLC/basis_universal@1.16.4/webgl/transcoder/build/basis_transcoder.wasm`
1536
- - Order: Register the core first, then the module: use(gl) also registers the core. CDN: load runtime.iife.js, then runtime/gl.iife.js (it registers itself). Register the core first, then the module: use(formatGltf) also registers the core. CDN: load runtime.iife.js, then runtime/format-gltf.iife.js (it registers itself). Register the core first, then the module: use(gltfDecoders) also registers the core. CDN: load runtime.iife.js, then runtime/gltf-decoders.iife.js (it registers itself). Install draco3d next to motionary, then register the lazy loader with provideGltfDecoder('draco', () => import('draco3d')) before a compressed model loads. Without a bundler: load Google’s draco_decoder.js from gstatic (window.DracoDecoderModule) and provideGltfDecoder('draco', () => window.DracoDecoderModule). Missing → a clear error naming the extension and this line. The transcoder is not published on npm by Binomial: copy basis_transcoder.js + basis_transcoder.wasm (same folder) into your static files, then provideGltfDecoder('ktx2', …) before a KTX2 model loads; or load it from the CDN (window.BASIS) and provideGltfDecoder('ktx2', () => window.BASIS). Missing → a clear error naming the extension and this line.
1537
-
1538
- ```js
1539
- import { use } from 'motionary/runtime';
1540
- import { gl } from 'motionary/runtime/gl';
1541
- import { formatGltf } from 'motionary/runtime/format-gltf';
1542
- import { gltfDecoders } from 'motionary/runtime/gltf-decoders';
1543
- import { provideGltfDecoder } from 'motionary/runtime/gltf-decoders';
1544
- import { defineGlModel } from 'motionary/components/gl-model';
1545
-
1546
- use(gl, formatGltf, gltfDecoders);
1547
- provideGltfDecoder('draco', () => import('draco3d')); // lazy: fetched when the first Draco-compressed model loads
1548
- provideGltfDecoder('ktx2', () => import('/vendor/basis_transcoder.js').then((m) => m.default || window.BASIS)); // lazy: fetched with the first KTX2 texture
1549
- defineGlModel(); // registers <usa-gl-model> — after the prerequisites
1550
- ```
1551
-
1552
- ```html
1553
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
1554
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/gl.iife.js"></script>
1555
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-gltf.iife.js"></script>
1556
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/gltf-decoders.iife.js"></script>
1557
- <script src="https://www.gstatic.com/draco/versioned/decoders/1.5.7/draco_decoder.js"></script>
1558
- <script src="https://cdn.jsdelivr.net/gh/BinomialLLC/basis_universal@1.16.4/webgl/transcoder/build/basis_transcoder.js"></script>
1559
- <!-- then the component bundles -->
1560
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
1561
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
1562
- ```
1563
-
1564
- ```html
1565
- <usa-gl-model src="/models/robot-draco.glb" controls label="Robot"></usa-gl-model>
1566
- ```
1567
-
1568
- ### <usa-gl-scene> — 3D scene (glTF / OBJ)
1569
-
1570
- 10.5: a WebGL2 3D viewer on Motionary’s own renderer — glTF 2.0 / GLB and OBJ / MTL models or built-in shapes, PBR-style materials, orbit controls (drag, wheel, pinch, arrow keys), auto-rotate and video textures. Requires motionary/runtime/gl (+ format-gltf for .gltf / .glb, format-obj for .obj, gltf-anim for glTF animation — 10.8) — npm i motionary, then use(gl, formatGltf, formatObj, gltfAnim) before it mounts.
1571
-
1572
- - Import: `import { defineGlScene } from 'motionary/components/widgets'; defineGlScene();`
1573
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1574
- - Attributes: `src`, `shape`, `color`, `metallic`, `roughness`, `background`, `exposure`, `controls`, `auto-rotate`, `video`, `video-scrub`, `label`, `animation`, `animation-speed`
1575
- - Events: `usa:error`, `usa:load`, `usa:runtime-missing`
1576
- - Methods: `reload()`
1577
- - Requires: motionary/runtime/gl + motionary/runtime/format-gltf + motionary/runtime/format-obj + motionary/runtime/gltf-anim
1578
- - Install: `npm i motionary`
1579
- - Order: Register the core first, then the module: use(gl) also registers the core. CDN: load runtime.iife.js, then runtime/gl.iife.js (it registers itself). Register the core first, then the module: use(formatGltf) also registers the core. CDN: load runtime.iife.js, then runtime/format-gltf.iife.js (it registers itself). Register the core first, then the module: use(formatObj) also registers the core. CDN: load runtime.iife.js, then runtime/format-obj.iife.js (it registers itself). Register the core first, then the module: use(gltfAnim) also registers the core. CDN: load runtime.iife.js, then runtime/gltf-anim.iife.js (it registers itself).
1580
-
1581
- ```js
1582
- import { use } from 'motionary/runtime';
1583
- import { gl } from 'motionary/runtime/gl';
1584
- import { formatGltf } from 'motionary/runtime/format-gltf';
1585
- import { formatObj } from 'motionary/runtime/format-obj';
1586
- import { gltfAnim } from 'motionary/runtime/gltf-anim';
1587
- import { defineGlScene } from 'motionary/components/widgets';
1588
-
1589
- use(gl, formatGltf, formatObj, gltfAnim);
1590
- defineGlScene(); // registers <usa-gl-scene> — after the prerequisites
1591
- ```
1592
-
1593
- ```html
1594
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
1595
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/gl.iife.js"></script>
1596
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-gltf.iife.js"></script>
1597
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-obj.iife.js"></script>
1598
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/gltf-anim.iife.js"></script>
1599
- <!-- then the component bundles -->
1600
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
1601
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
1602
- ```
1603
-
1604
- ```html
1605
- <usa-gl-scene src="/models/chair.glb" controls auto-rotate="20" label="Chair"></usa-gl-scene>
1606
- ```
1607
-
1608
- ### <usa-glitch> — Glitch text
1609
-
1610
- An RGB-split, sliced glitch — always on or on hover.
1611
-
1612
- - Import: `import { defineGlitch } from 'motionary/components/text'; defineGlitch();`
1613
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1614
- - Attributes: `text`, `intensity`
1615
- - Methods: `mount()`, `splitChars()`
1616
-
1617
- ```html
1618
- <usa-glitch trigger="hover">SYSTEM ERROR</usa-glitch>
1619
- ```
1620
-
1621
- ### <usa-globe> — Spinning globe
1622
-
1623
- 7.6: an SVG globe in orthographic projection — graticule, pulsing markers, spins while on screen, drag to turn it, flyTo(name) brings a city round to the front. No WebGL, no tiles.
1624
-
1625
- - Import: `import { defineGlobe } from 'motionary/components/widgets'; defineGlobe();`
1626
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1627
- - Attributes: `markers`, `speed`, `tilt`, `lon`
1628
- - Events: `usa:focus`
1629
- - Methods: `flyTo()`
1630
-
1631
- ```html
1632
- <usa-globe markers="Shanghai:31.2,121.5; London:51.5,-0.1; New York:40.7,-74"></usa-globe>
1633
- <script>addEventListener('DOMContentLoaded', () => { const globe = document.querySelector('usa-globe'); globe.flyTo('London'); });</script>
1634
- ```
1635
-
1636
- ### <usa-gpu-particles> — GPU particle canvas
1637
-
1638
- 10.5 (WebGPU effects 2.0): tens of thousands of particles simulated by a WebGPU compute shader and drawn as instanced quads — swirl, galaxy or fountain, pointer repulsion, trails; Canvas 2D fallback where WebGPU is missing.
1639
-
1640
- - Import: `import { defineGpuParticles } from 'motionary/components/widgets'; defineGpuParticles();`
1641
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1642
- - Attributes: `count`, `mode`, `colors`, `size`, `speed`, `trail`, `pointer`, `label`
1643
- - Events: `usa:backend`
1644
-
1645
- ```html
1646
- <usa-gpu-particles count="30000" mode="galaxy" colors="#818cf8,#f472b6" pointer></usa-gpu-particles>
1647
- ```
1648
-
1649
- ### <usa-gradient-text> — Gradient flow
1650
-
1651
- Text filled with a multi-colour gradient that keeps flowing.
1652
-
1653
- - Import: `import { defineGradientText } from 'motionary/components/text'; defineGradientText();`
1654
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1655
- - Attributes: `colors`, `speed`, `angle`
1656
- - Methods: `mount()`, `splitChars()`
1657
-
1658
- ```html
1659
- <usa-gradient-text colors="#7c5cff,#22d3ee,#f472b6">Gradient</usa-gradient-text>
1660
- ```
1661
-
1662
- ### <usa-grain> — Film grain
1663
-
1664
- An SVG-noise grain overlay — no image to ship. animated makes it jitter like film.
1665
-
1666
- - Import: `import { defineGrain } from 'motionary/components/background'; defineGrain();`
1667
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1668
- - Attributes: `opacity`, `blend`, `scale`
1669
-
1670
- ```html
1671
- <usa-grain animated opacity="0.15">
1672
- <img src="hero.jpg" alt="">
1673
- </usa-grain>
1674
- ```
1675
-
1676
- ### <usa-grid-glow> — Grid glow
1677
-
1678
- A line grid behind the content that lights up around the pointer.
1679
-
1680
- - Import: `import { defineGridGlow } from 'motionary/components/background'; defineGridGlow();`
1681
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1682
- - Attributes: `size`, `radius`, `color`
1683
- - Methods: `mount()`
1684
-
1685
- ```html
1686
- <usa-grid-glow size="32">
1687
- <h2>Hero</h2>
1688
- </usa-grid-glow>
1689
- ```
1690
-
1691
- ### <usa-gyro-card> — Gyro 3D card
1692
-
1693
- 8.7: a 3D card that tilts with the phone’s gyroscope (and with the pointer on desktop), with a moving glare and layers that float at different depths.
1694
-
1695
- - Import: `import { defineGyroCard } from 'motionary/components/widgets'; defineGyroCard();`
1696
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1697
- - Attributes: `max`, `glare`
1698
- - Events: `usa:tilt`
1699
- - Methods: `tilt()`, `wobble()`
1700
-
1701
- ```html
1702
- <usa-gyro-card max="15">
1703
- <h3 data-depth="2">Gyro</h3>
1704
- <p data-depth="1">Tilt your phone</p>
1705
- </usa-gyro-card>
1706
- ```
1707
-
1708
- ### <usa-handwriting> — Handwriting draw
1709
-
1710
- The text draws itself stroke by stroke, then fills in — signatures, hero words.
1711
-
1712
- - Import: `import { defineHandwriting } from 'motionary/components/text'; defineHandwriting();`
1713
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1714
- - Attributes: `text`, `size`, `font`, `stroke`, `duration`
1715
- - Events: `usa:complete`
1716
- - Methods: `mount()`, `splitChars()`
1717
-
1718
- ```html
1719
- <usa-handwriting text="Thank you" size="72"></usa-handwriting>
1720
- ```
1721
-
1722
- ### <usa-hero-video> — Hero video
1723
-
1724
- 9.4: a full-bleed hero with a background video — poster first, cross-fade to the video, a readable scrim, an always-there pause button and an optional scroll-scrubbed mode.
1725
-
1726
- - Import: `import { defineHeroVideo } from 'motionary/components/widgets'; defineHeroVideo();`
1727
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1728
- - Attributes: `label`, `scrub`, `poster`
1729
- - Methods: `toggle()`
1730
-
1731
- ```html
1732
- <usa-hero-video label="Welcome" poster="poster.jpg">
1733
- <video src="hero.mp4" autoplay muted loop playsinline></video>
1734
- <h1>Motion, declared.</h1>
1735
- </usa-hero-video>
1736
- ```
1737
-
1738
- ### <usa-hold> — Hold to confirm
1739
-
1740
- Press and hold (pointer, Space or Enter) while a ring fills; releasing early rewinds. For destructive actions.
1741
-
1742
- - Import: `import { defineHold } from 'motionary/components/click'; defineHold();`
1743
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1744
- - Attributes: `duration`, `disabled`, `color`, `label`
1745
- - Events: `usa:progress`, `usa:confirm`, `usa:cancel`
1746
- - Methods: `cancel()`
1747
-
1748
- ```html
1749
- <usa-hold duration="1200" label="Delete project">Hold to delete</usa-hold>
1750
- ```
1751
-
1752
- ### <usa-hud-panel> — HUD panel
1753
-
1754
- 8.4: a sci-fi HUD panel — angled corners, a glowing frame that draws itself in when the panel scrolls into view, a header with a blinking status light, and data rows that fill in as animated bar readouts.
1755
-
1756
- - Import: `import { defineHudPanel } from 'motionary/components/widgets'; defineHudPanel();`
1757
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1758
- - Attributes: `title`, `status`, `color`
1759
- - Events: `usa:boot`
1760
- - Methods: `boot()`
1761
-
1762
- ```html
1763
- <usa-hud-panel title="SHIP STATUS" status="ONLINE">
1764
- <p data-value="82">Shields</p>
1765
- <p data-value="47">Fuel</p>
1766
- </usa-hud-panel>
1767
- ```
1768
-
1769
- ### <usa-hydrate> — SSR hydration animation
1770
-
1771
- 8.0: server-rendered children animate in on hydration — hidden only while JS is on and not yet upgraded (ssrHead() in the head, 3 s CSS fallback), then staggered in on the unified clock.
1772
-
1773
- - Import: `import { defineHydrate } from 'motionary/components/widgets'; defineHydrate();`
1774
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1775
- - Attributes: `effect`, `stagger`, `duration`
1776
- - Events: `usa:hydrated`
1777
- - Methods: `replay()`
1778
-
1779
- ```html
1780
- <!-- <head> -->${ssrHead()}
1781
- <usa-hydrate effect="fade-up" stagger="80">
1782
- <h1>Server-rendered title</h1>
1783
- <p>…</p>
1784
- </usa-hydrate>
1785
- <!-- or: <section data-usa-hydrate="blur">…</section> + hydrateMotion() -->
1786
- ```
1787
-
1788
- ### <usa-icon-morph> — Icon morph
1789
-
1790
- Icons that morph point-by-point with a spring: play ↔ pause, menu ↔ close, plus ↔ minus, check, arrow. toggle makes it a button with per-icon labels.
1791
-
1792
- - Import: `import { defineIconMorph } from 'motionary/components/click'; defineIconMorph();`
1793
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1794
- - Attributes: `icons`, `size`, `toggle`, `index`, `preset`, `labels`
1795
- - Events: `usa:change`
1796
- - Methods: `next()`, `show()`
1797
-
1798
- ```html
1799
- <usa-icon-morph icons="play,pause" labels="Play,Pause" toggle></usa-icon-morph>
1800
- <usa-icon-morph icons="menu,close" labels="Open menu,Close menu" toggle></usa-icon-morph>
1801
- ```
1802
-
1803
- ### <usa-install-button> — Install button
1804
-
1805
- 10.1: one-click install snippet with npm / pnpm / yarn / bun / CDN tabs and a copy button that confirms with a check; `cdn` sets the URL of the CDN tab.
1806
-
1807
- - Import: `import { defineInstallButton } from 'motionary/components/widgets'; defineInstallButton();`
1808
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1809
- - Attributes: `package`, `managers`, `cdn`, `dev`, `manager`
1810
- - Events: `usa:copy`
1811
- - Methods: `command()`, `copy()`
1812
-
1813
- ```html
1814
- <usa-install-button package="motionary" managers="npm pnpm yarn bun cdn" cdn="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></usa-install-button>
1815
- ```
1816
-
1817
- ### <usa-kanban> — Kanban board (drag-sort)
1818
-
1819
- 6.8: drag cards between columns — the card lifts and tilts toward the drag, a placeholder opens where it will land and the other cards glide aside (FLIP). Full keyboard support: Space picks up, arrows move, Space drops.
1820
-
1821
- - Import: `import { defineKanban } from 'motionary/components/widgets'; defineKanban();`
1822
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1823
- - Attributes: `label`
1824
- - Events: `usa:move`
1825
- - Methods: `cardsOf()`, `move()`
1826
-
1827
- ```html
1828
- <usa-kanban label="Sprint">
1829
- <section data-title="To do">
1830
- <h3>To do</h3>
1831
- <div data-card>Design</div>
1832
- <div data-card>Write docs</div>
1833
- </section>
1834
- <section data-title="Done"><h3>Done</h3></section>
1835
- </usa-kanban>
1836
- ```
1837
-
1838
- ### <usa-keyframe-editor> — Animation editor 2.0
1839
-
1840
- 6.9: a compact timeline for <usa-player> JSON — drag a bar to move a track, drag its edge to resize, scrub the playhead or press play; exports format use-scroll-animate/animation v1.
1841
-
1842
- - Import: `import { defineKeyframeEditor } from 'motionary/components/widgets'; defineKeyframeEditor();`
1843
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1844
- - Attributes: `for`
1845
- - Events: `usa:change`
1846
- - Methods: `toJSON()`, `play()`, `seek()`
1847
-
1848
- ```html
1849
- <div id="hero"><h1>Title</h1><div class="card">…</div><button>Go</button></div>
1850
- <usa-keyframe-editor for="hero"></usa-keyframe-editor>
1851
- <script>
1852
- const editor = document.querySelector('usa-keyframe-editor');
1853
- editor.addEventListener('usa:change', (e) => save(e.detail.animation));
1854
- </script>
1855
- ```
1856
-
1857
- ### <usa-kpi> — KPI card
1858
-
1859
- 7.2: the value counts up keeping prefix, suffix and decimals ("$12.4k", "98.2%"), the delta chip slides in with an arrow coloured by sign, and an optional trend draws a sparkline. Setting value rolls and flashes the card.
1860
-
1861
- - Import: `import { defineKpi } from 'motionary/components/widgets'; defineKpi();`
1862
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1863
- - Attributes: `label`, `delta`, `caption`, `trend`, `invert`, `locale`
1864
-
1865
- ```html
1866
- <usa-kpi label="Revenue" value="$48.2k" delta="+12.5%" trend="4,6,5,9,8,12" caption="vs last month"></usa-kpi>
1867
- ```
1868
-
1869
- ### <usa-leaderboard> — Leaderboard
1870
-
1871
- 7.5: a ranked list — when scores change, rows glide to their new rank, climbers flash green with ▲n and fallers red with ▼n, scores roll and the top three get medals.
1872
-
1873
- - Import: `import { defineLeaderboard } from 'motionary/components/widgets'; defineLeaderboard();`
1874
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1875
- - Attributes: `label`, `limit`, `me`
1876
- - Events: `usa:rank`
1877
- - Methods: `setScore()`
1878
-
1879
- ```html
1880
- <usa-leaderboard me="Ada">
1881
- <li data-score="980">Ada</li>
1882
- <li data-score="870">Alan</li>
1883
- <li data-score="760">Grace</li>
1884
- </usa-leaderboard>
1885
- <script>addEventListener('DOMContentLoaded', () => { const board = document.querySelector('usa-leaderboard'); board.setScore('Grace', 1000); });</script>
1886
- ```
1887
-
1888
- ### <usa-like> — Like button
1889
-
1890
- A heart that pops with a spring and bursts into particles; aria-pressed, optional count.
1891
-
1892
- - Import: `import { defineLike } from 'motionary/components/click'; defineLike();`
1893
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1894
- - Attributes: `liked`, `count`, `label`, `disabled`, `size`, `color`, `haptic`
1895
- - Events: `usa:change`
1896
- - Methods: `toggle()`
1897
-
1898
- ```html
1899
- <usa-like count="128"></usa-like>
1900
- ```
1901
-
1902
- ### <usa-liquid> — Liquid image
1903
-
1904
- Click or tap to send water ripples through the image; hover adds a gentle wobble. The plain image stays when WebGL is unavailable.
1905
-
1906
- - Import: `import { defineLiquid } from 'motionary/components/webgl'; defineLiquid();`
1907
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1908
-
1909
- ```html
1910
- <usa-liquid strength="1">
1911
- <img src="photo.jpg" alt="…">
1912
- </usa-liquid>
1913
- ```
1914
-
1915
- ### <usa-liquid-nav> — Liquid nav
1916
-
1917
- 8.3: a navigation bar whose active indicator is a drop of liquid — it stretches like a droplet towards the next item and settles with a wobble (gooey SVG filter).
1918
-
1919
- - Import: `import { defineLiquidNav } from 'motionary/components/widgets'; defineLiquidNav();`
1920
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1921
- - Attributes: `label`, `value`
1922
- - Events: `usa:change`
1923
-
1924
- ```html
1925
- <usa-liquid-nav label="Main">
1926
- <a href="/" aria-current="page">Home</a><a href="/shop">Shop</a><a href="/about">About</a>
1927
- </usa-liquid-nav>
1928
- ```
1929
-
1930
- ### <usa-loading-bar> — Top loading bar
1931
-
1932
- A slim NProgress-style bar for route changes and fetches: loadingBar.start() trickles, done() completes and fades.
1933
-
1934
- - Import: `import { defineLoadingBar } from 'motionary/components/page'; defineLoadingBar();`
1935
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
1936
- - Attributes: `label`, `color`, `height`
1937
- - Methods: `start()`, `set()`, `done()`
1938
-
1939
- ```html
1940
- <script type="module">
1941
- import { loadingBar } from 'motionary/components/page';
1942
- await loadingBar.track(new Promise((done) => setTimeout(done, 400))); // any promise, e.g. fetch('/api')
1943
- </script>
1944
- ```
1945
-
1946
- ### <usa-location-card> — Location card
1947
-
1948
- 7.6: a place card with a stylised mini map — the route from the origin draws itself, the pin drops in with a bounce and a ring pulses; distance computed with haversine (km or mi).
1949
-
1950
- - Import: `import { defineLocationCard } from 'motionary/components/widgets'; defineLocationCard();`
1951
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1952
- - Attributes: `name`, `address`, `lat`, `lon`, `from-lat`, `from-lon`, `distance`, `href`, `unit`
1953
- - Events: `usa:arrive`
1954
- - Methods: `replay()`
1955
-
1956
- ```html
1957
- <usa-location-card name="Blue Bottle" address="66 Mint St, San Francisco"
1958
- lat="37.782" lon="-122.407" from-lat="37.776" from-lon="-122.394" href="https://maps.example/…"></usa-location-card>
1959
- ```
1960
-
1961
- ### <usa-lottie> — Lottie player
1962
-
1963
- 9.2: plays Lottie (After Effects / bodymovin) files without lottie-web — vector layers render as SVG and their keyframes run as native animations on Motionary’s clock.
1964
-
1965
- - Import: `import { defineLottie } from 'motionary/components/widgets'; defineLottie();`
1966
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1967
- - Attributes: `src`, `loop`, `speed`, `label`
1968
- - Events: `usa:error`, `usa:load`, `usa:complete`
1969
- - Methods: `play()`, `pause()`, `stop()`
1970
-
1971
- ```html
1972
- <usa-lottie src="confetti.json" autoplay loop label="Celebration"></usa-lottie>
1973
- ```
1974
-
1975
- ### <usa-lottie-icon> — Animated icon set
1976
-
1977
- 9.2: an animated icon set shipped as tiny Lottie files — heart beat, bell swing, check draw-in, spinner, star twinkle, bolt zap — on click, hover, enter or loop.
1978
-
1979
- - Import: `import { defineLottieIcon } from 'motionary/components/widgets'; defineLottieIcon();`
1980
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1981
- - Attributes: `name`, `size`, `color`, `label`, `trigger`
1982
- - Methods: `play()`
1983
-
1984
- ```html
1985
- <usa-lottie-icon name="heart" trigger="click" size="32" label="Like"></usa-lottie-icon>
1986
- <usa-lottie-icon name="bell" trigger="hover"></usa-lottie-icon>
1987
- ```
1988
-
1989
- ### <usa-lottie-player> — Lottie player (JSON + dotLottie)
1990
-
1991
- 10.6: plays Lottie JSON and dotLottie (.lottie) files with Motionary’s own Canvas 2D renderer — shapes, gradients, trim paths, masks, track mattes, precomps and images; autoplay, loop, bounce, segments / markers, play on hover or scrub with scroll. Requires motionary/runtime/vector — npm i motionary, then use(vector) before it mounts.
1992
-
1993
- - Import: `import { defineLottiePlayer } from 'motionary/components/widgets'; defineLottiePlayer();`
1994
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
1995
- - Attributes: `src`, `animation`, `autoplay`, `loop`, `speed`, `mode`, `segment`, `hover`, `scrub`, `fit`, `background`, `label`
1996
- - Events: `usa:complete`, `usa:load`, `usa:error`, `usa:runtime-missing`
1997
- - Methods: `play()`, `pause()`, `stop()`, `seek()`
1998
- - Requires: motionary/runtime/vector
1999
- - Install: `npm i motionary`
2000
- - Order: Register the core first, then the module: use(vector) also registers the core. CDN: load runtime.iife.js, then runtime/vector.iife.js (it registers itself).
2001
-
2002
- ```js
2003
- import { use } from 'motionary/runtime';
2004
- import { vector } from 'motionary/runtime/vector';
2005
- import { defineLottiePlayer } from 'motionary/components/widgets';
2006
-
2007
- use(vector);
2008
- defineLottiePlayer(); // registers <usa-lottie-player> — after the prerequisites
2009
- ```
2010
-
2011
- ```html
2012
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
2013
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/vector.iife.js"></script>
2014
- <!-- then the component bundles -->
2015
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
2016
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
2017
- ```
2018
-
2019
- ```html
2020
- <usa-lottie-player src="/anim/hero.lottie" autoplay loop label="Hero animation"></usa-lottie-player>
2021
- ```
2022
-
2023
- ### <usa-lyrics> — Synced karaoke lyrics
2024
-
2025
- 7.1: LRC or [data-t] lines; the active line glows, scrolls to the centre and a highlight sweeps across it while past lines dim. Follows an <audio>, <video> or <usa-music-player> via for.
2026
-
2027
- - Import: `import { defineLyrics } from 'motionary/components/widgets'; defineLyrics();`
2028
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2029
- - Attributes: `label`, `for`
2030
- - Events: `usa:seek`
2031
-
2032
- ```html
2033
- <usa-lyrics for="player">
2034
- <script type="text/plain">
2035
- [00:01.00] First line
2036
- [00:04.50] Second line
2037
- </script>
2038
- </usa-lyrics>
2039
- ```
2040
-
2041
- ### <usa-magnetic> — Magnetic button
2042
-
2043
- Content leans toward the pointer when it comes near and springs back. Fine pointers only; off under reduced motion.
2044
-
2045
- - Import: `import { defineMagnetic } from 'motionary/components/interaction'; defineMagnetic();`
2046
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2047
- - Attributes: `strength`, `radius`, `disabled`
2048
-
2049
- ```html
2050
- <usa-magnetic strength="0.4"><button>Hover near me</button></usa-magnetic>
2051
- ```
2052
-
2053
- ### <usa-marquee> — Marquee
2054
-
2055
- A seamless infinite ticker with constant speed, pause on hover, soft edges and vertical mode. Clones are hidden from AT.
2056
-
2057
- - Import: `import { defineMarquee } from 'motionary/components/background'; defineMarquee();`
2058
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2059
- - Attributes: `speed`, `direction`, `gap`, `paused`, `pause-on-hover`
2060
- - Methods: `pause()`, `resume()`
2061
-
2062
- ```html
2063
- <usa-marquee speed="50" pause-on-hover fade>
2064
- <img src="logo-a.svg" alt="A">
2065
- <img src="logo-b.svg" alt="B">
2066
- </usa-marquee>
2067
- ```
2068
-
2069
- ### <usa-mask-reveal> — Mask reveal
2070
-
2071
- Reveal images or sections through a growing mask: circle, diamond, star, iris or wipes, from any origin.
2072
-
2073
- - Import: `import { defineMaskReveal } from 'motionary/components/svg'; defineMaskReveal();`
2074
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2075
- - Attributes: `shape`, `at`, `duration`, `delay`, `trigger`, `repeat`
2076
- - Events: `usa:complete`
2077
- - Methods: `reveal()`
2078
-
2079
- ```html
2080
- <usa-mask-reveal shape="circle" at="20% 30%">
2081
- <img src="hero.jpg" alt="…">
2082
- </usa-mask-reveal>
2083
- ```
2084
-
2085
- ### <usa-masonry> — Masonry
2086
-
2087
- Pinterest-style masonry: items drop into the shortest column and glide when the width, the items or their sizes change. CSS columns before JS runs.
2088
-
2089
- - Import: `import { defineMasonry } from 'motionary/components/layout'; defineMasonry();`
2090
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2091
- - Attributes: `columns`, `min`, `gap`
2092
- - Methods: `enable()`, `disable()`
2093
-
2094
- ```html
2095
- <usa-masonry min="220" gap="16">
2096
- <img src="1.jpg" alt="…">
2097
- <img src="2.jpg" alt="…">
2098
- </usa-masonry>
2099
- ```
2100
-
2101
- ### <usa-masonry-flow> — Masonry with layout animation
2102
-
2103
- 6.5: a masonry grid whose items glide to their new places (FLIP) on resize, insert / remove, filter(), shuffle() and sort(); hidden items scale out, new ones scale in.
2104
-
2105
- - Import: `import { defineMasonryFlow } from 'motionary/components/widgets'; defineMasonryFlow();`
2106
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2107
- - Attributes: `min`, `gap`
2108
- - Events: `usa:layout`
2109
- - Methods: `layout()`, `filter()`, `shuffle()`, `sort()`
2110
-
2111
- ```html
2112
- <usa-masonry-flow min="160" gap="12">
2113
- <img src="1.jpg" alt="…">
2114
- <img src="2.jpg" alt="…">
2115
- …
2116
- </usa-masonry-flow>
2117
- <!-- grid.filter('.cats'), grid.shuffle(), grid.sort((a, b) => …) -->
2118
- ```
2119
-
2120
- ### <usa-menu> — Dropdown menu
2121
-
2122
- 6.3: the list scales (or folds / slides) out of its button and the items cascade in. Full menu keyboard support — arrows, Home / End, Esc, Tab — and outside clicks close it.
2123
-
2124
- - Import: `import { defineMenu } from 'motionary/components/widgets'; defineMenu();`
2125
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2126
- - Attributes: `placement`, `effect`
2127
- - Events: `usa:select`, `usa:open`, `usa:close`
2128
- - Methods: `open()`, `close()`, `toggle()`
2129
-
2130
- ```html
2131
- <usa-menu placement="bottom-start" effect="scale">
2132
- <button>Actions ▾</button>
2133
- <button>Edit</button>
2134
- <button>Duplicate</button>
2135
- <hr>
2136
- <button>Delete</button>
2137
- </usa-menu>
2138
- ```
2139
-
2140
- ### <usa-menu-toggle> — Hamburger → close
2141
-
2142
- 6.6: the three bars morph into a cross, a back arrow, a minus or a spinning plus-to-cross; a real toggle button with aria-expanded that can open the element it controls (for).
2143
-
2144
- - Import: `import { defineMenuToggle } from 'motionary/components/widgets'; defineMenuToggle();`
2145
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2146
- - Attributes: `variant`, `label`, `for`
2147
- - Events: `usa:toggle`
2148
- - Methods: `toggle()`
2149
-
2150
- ```html
2151
- <usa-menu-toggle for="site-menu" variant="cross" label="Menu"></usa-menu-toggle>
2152
- <nav id="site-menu" hidden>…</nav>
2153
- ```
2154
-
2155
- ### <usa-message-list> — Chat thread
2156
-
2157
- 7.4: a chat thread — new bubbles pop in from their side, consecutive messages group, the list sticks to the bottom (or shows a “↓ New messages” pill when you scrolled up) and typing(name) shows animated typing dots.
2158
-
2159
- - Import: `import { defineMessageList } from 'motionary/components/widgets'; defineMessageList();`
2160
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2161
- - Attributes: `label`
2162
- - Events: `usa:message`
2163
- - Methods: `push()`, `typing()`
2164
-
2165
- ```html
2166
- <usa-message-list>
2167
- <p data-from="Ada">Hi! 👋</p>
2168
- <p data-me>Hey Ada</p>
2169
- </usa-message-list>
2170
- <script>addEventListener('DOMContentLoaded', () => { const list = document.querySelector('usa-message-list'); list.typing('Ada'); list.push({ from: 'Ada', text: 'Ship it?' }); });</script>
2171
- ```
2172
-
2173
- ### <usa-milestones> — Scroll-drawn milestones
2174
-
2175
- 6.5: a progress line grows down the rail as you scroll; each milestone pops its dot and slides its card in when the line reaches it. Alternating sides on wide screens, one column on phones; data-date labels.
2176
-
2177
- - Import: `import { defineMilestones } from 'motionary/components/widgets'; defineMilestones();`
2178
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2179
- - Attributes: `layout`
2180
- - Events: `usa:reach`
2181
-
2182
- ```html
2183
- <usa-milestones>
2184
- <div data-date="2024"><h3>Idea</h3><p>…</p></div>
2185
- <div data-date="2025"><h3>Beta</h3><p>…</p></div>
2186
- <div data-date="2026"><h3>Launch</h3><p>…</p></div>
2187
- </usa-milestones>
2188
- ```
2189
-
2190
- ### <usa-modal> — Modal dialog
2191
-
2192
- 6.3: native <dialog> (top layer, focus trap, Esc) with animated open / close and a blurred backdrop — scale, slide-up, flip, or origin: it grows out of the button that opened it. Focus returns to the opener.
2193
-
2194
- - Import: `import { defineModal } from 'motionary/components/widgets'; defineModal();`
2195
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2196
- - Attributes: `effect`, `label`, `persistent`
2197
- - Events: `usa:open`, `usa:close`
2198
- - Methods: `show()`, `close()`, `toggle()`
2199
-
2200
- ```html
2201
- <button data-usa-open="welcome">Open</button>
2202
- <usa-modal id="welcome" effect="origin" label="Welcome">
2203
- <h2>Hello 👋</h2>
2204
- <p>…</p>
2205
- <button data-usa-close="ok">Got it</button>
2206
- </usa-modal>
2207
- ```
2208
-
2209
- ### <usa-morph> — Path morph
2210
-
2211
- Morph an SVG path through a list of shapes (paths="A | B | C") on click, hover, in view or automatically. Same-structure paths morph point by point.
2212
-
2213
- - Import: `import { defineMorph } from 'motionary/components/svg'; defineMorph();`
2214
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2215
- - Attributes: `paths`, `trigger`, `duration`, `interval`
2216
- - Events: `usa:change`
2217
- - Methods: `next()`
2218
-
2219
- ```html
2220
- <usa-morph trigger="auto" interval="1800"
2221
- paths="M50 10 C75 10 90 30 90 50 C90 75 70 90 50 90 C25 90 10 70 10 50 C10 30 25 10 50 10 Z | M50 4 C80 20 96 26 86 54 C78 84 64 96 44 86 C14 80 4 64 14 44 C20 20 30 0 50 4 Z"></usa-morph>
2222
- ```
2223
-
2224
- ### <usa-motion> — Motion DSL
2225
-
2226
- 9.0: the declarative motion DSL — describe motion as one readable string (“enter: fade-up 600ms stagger 80ms; hover: pop”) on <usa-motion> or any element’s data-motion, no JavaScript per element.
2227
-
2228
- - Import: `import { defineMotion } from 'motionary/components/widgets'; defineMotion();`
2229
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2230
- - Attributes: `rules`
2231
- - Events: `usa:motion-error`
2232
-
2233
- ```html
2234
- <usa-motion rules="enter: fade-up 600ms ease-out stagger 80ms; hover: pop">
2235
- <div class="card">One</div><div class="card">Two</div><div class="card">Three</div>
2236
- </usa-motion>
2237
-
2238
- <!-- or on any element, with applyMotion() from motionary/dsl -->
2239
- <section data-motion="enter: fade-up 500ms; click: confetti count=40">…</section>
2240
- ```
2241
-
2242
- ### <usa-motion-inspector> — Motion inspector
2243
-
2244
- 10.2: a live panel listing the running animations in a scope (CSS animations, transitions, element.animate(), components) with state and progress, plus the motionary/runtime ticker when present — pause / play all, 0.25× slow motion and per-row scrub.
2245
-
2246
- - Import: `import { defineMotionInspector } from 'motionary/components/widgets'; defineMotionInspector();`
2247
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2248
- - Attributes: `scope`, `interval`
2249
- - Events: `usa:change`
2250
- - Methods: `refresh()`, `pauseAll()`, `playAll()`, `setRate()`, `animations()`
2251
-
2252
- ```html
2253
- <usa-motion-inspector scope="#app" interval="500"></usa-motion-inspector>
2254
- ```
2255
-
2256
- ### <usa-motion-prefs> — Motion preference panel
2257
-
2258
- 9.5: a motion settings panel for your users — motion level (full, gentle, minimal, none), animation speed, pause autoplaying video, no parallax — applied instantly to every Motionary animation and remembered.
2259
-
2260
- - Import: `import { defineMotionPrefs } from 'motionary/components/widgets'; defineMotionPrefs();`
2261
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2262
- - Attributes: `label`
2263
- - Events: `usa:change`
2264
- - Methods: `reset()`
2265
-
2266
- ```html
2267
- <usa-motion-prefs></usa-motion-prefs>
2268
- ```
2269
-
2270
- ### <usa-motion-prompt> — Motion prompt (text → motion)
2271
-
2272
- 10.7 (AI-assisted motion): describe a motion in English or Chinese and get a live preview plus ready code — Web Animations, CSS (with a reduced-motion guard) or a Motionary component. A small deterministic parser (motionary/components/ai), no model and no network; the same parser powers suggest_motion in motionary-mcp 2.0.
2273
-
2274
- - Import: `import { defineMotionPrompt } from 'motionary/components/widgets'; defineMotionPrompt();`
2275
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2276
- - Attributes: `value`, `format`, `placeholder`, `label`
2277
- - Events: `usa:suggest`, `usa:copy`
2278
- - Methods: `suggest()`
2279
-
2280
- ```html
2281
- <usa-motion-prompt value="fade the cards up slowly, one after another"></usa-motion-prompt>
2282
- ```
2283
-
2284
- ### <usa-motion-spec> — Motion spec sheet
2285
-
2286
- 9.7: a motion spec sheet for design hand-off — each rule of a motion string with its trigger, a duration bar on a shared timeline and the easing curve, a Play playhead and Copy CSS; pairs with the Figma plugin and Framer export of motionary/design.
2287
-
2288
- - Import: `import { defineMotionSpec } from 'motionary/components/widgets'; defineMotionSpec();`
2289
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2290
- - Attributes: `rules`, `label`
2291
- - Events: `usa:copy`
2292
- - Methods: `play()`
2293
-
2294
- ```html
2295
- <usa-motion-spec label="Card entrance" rules="enter: fade-up 600ms ease-out stagger 80ms; hover: pop 300ms spring"></usa-motion-spec>
2296
- ```
2297
-
2298
- ### <usa-motion-switch> — Motion intensity
2299
-
2300
- Let users pick Off · Low · Normal · High for the whole app; scales every component, persists, and Off equals reduced motion.
2301
-
2302
- - Import: `import { defineMotionSwitch } from 'motionary/components/page'; defineMotionSwitch();`
2303
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2304
- - Attributes: `labels`, `label`
2305
- - Events: `usa:change`
2306
-
2307
- ```html
2308
- <usa-motion-switch></usa-motion-switch>
2309
- <!-- or: setMotionIntensity('low', true) -->
2310
- ```
2311
-
2312
- ### <usa-motion-theme> — Theme packs
2313
-
2314
- 5.8: <usa-motion-theme name> applies a theme pack — design tokens (--usa-theme-*), motion tokens and effect presets per role (enter / hover / click / attention / background). Neon, paper, glass, retro and brutalist; applyMotionTheme() for the whole page.
2315
-
2316
- - Import: `import { defineMotionTheme } from 'motionary/components/effects'; defineMotionTheme();`
2317
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2318
- - Attributes: `name`
2319
-
2320
- ```html
2321
- <usa-motion-theme name="neon">
2322
- <div class="usa-surface">
2323
- <button data-theme-fx="click">Tap</button>
2324
- </div>
2325
- </usa-motion-theme>
2326
- ```
2327
-
2328
- ### <usa-music-player> — Music player
2329
-
2330
- 7.1: the cover spins like a record while playing, play morphs to pause, mini equalizer bars dance and the progress bar is a scrubbable slider. Plays a child <audio> or simulates a track.
2331
-
2332
- - Import: `import { defineMusicPlayer } from 'motionary/components/widgets'; defineMusicPlayer();`
2333
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2334
- - Attributes: `title`, `artist`, `cover`, `src`, `duration`
2335
- - Events: `usa:play`, `usa:pause`, `usa:seek`
2336
- - Methods: `play()`, `pause()`, `toggle()`, `seek()`
2337
-
2338
- ```html
2339
- <usa-music-player title="Night Drive" artist="Motionary" cover="cover.jpg">
2340
- <audio src="track.mp3"></audio>
2341
- </usa-music-player>
2342
- ```
2343
-
2344
- ### <usa-native-preview> — Native preview
2345
-
2346
- 9.8: preview web motion as it will feel on a phone — an iOS / Android device frame replays the entrance with the rule’s curve and presses with a spring — and copy the generated React Native and Flutter code.
2347
-
2348
- - Import: `import { defineNativePreview } from 'motionary/components/widgets'; defineNativePreview();`
2349
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2350
- - Attributes: `rules`, `platform`, `name`
2351
- - Events: `usa:replay`
2352
- - Methods: `replay()`, `code()`
2353
-
2354
- ```html
2355
- <usa-native-preview platform="ios" rules="enter: fade-up 500ms smooth stagger 80ms; click: pop">
2356
- <div class="row">Inbox</div><div class="row">Starred</div>
2357
- </usa-native-preview>
2358
- ```
2359
-
2360
- ### <usa-nav-morph> — Navbar with morphing indicator
2361
-
2362
- 6.6: the indicator follows the hovered or focused link — stretching from the old one, leading edge first — and settles back on the current page. Underline, pill, blob or dot.
2363
-
2364
- - Import: `import { defineNavMorph } from 'motionary/components/widgets'; defineNavMorph();`
2365
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2366
- - Attributes: `indicator`, `label`, `active`
2367
- - Events: `usa:change`
2368
-
2369
- ```html
2370
- <usa-nav-morph indicator="underline" label="Main">
2371
- <a href="/" aria-current="page">Home</a>
2372
- <a href="/docs">Docs</a>
2373
- <a href="/blog">Blog</a>
2374
- </usa-nav-morph>
2375
- ```
2376
-
2377
- ### <usa-navbar> — Auto-hide navbar
2378
-
2379
- Hides while you scroll down, slides back on the first scroll up; shrink makes it compact once scrolled. This page’s demo scrolls an inner box.
2380
-
2381
- - Import: `import { defineNavbar } from 'motionary/components/ui'; defineNavbar();`
2382
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2383
- - Attributes: `target`, `threshold`
2384
- - Events: `usa:hide`, `usa:show`
2385
- - Methods: `show()`
2386
-
2387
- ```html
2388
- <usa-navbar shrink>
2389
- <header>…</header>
2390
- </usa-navbar>
2391
- ```
2392
-
2393
- ### <usa-notification-bell> — Notification bell
2394
-
2395
- 7.4: a bell with an unread badge and a dropdown — notify() swings the bell, bumps the badge and slides the notice in; “Mark all read” shrinks the badge away. Esc / outside click close it.
2396
-
2397
- - Import: `import { defineNotificationBell } from 'motionary/components/widgets'; defineNotificationBell();`
2398
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2399
- - Attributes: `label`
2400
- - Events: `usa:notify`, `usa:read`
2401
- - Methods: `notify()`, `markAllRead()`, `ring()`
2402
-
2403
- ```html
2404
- <usa-notification-bell>
2405
- <li data-time="2m">Ada liked your post</li>
2406
- </usa-notification-bell>
2407
- <script>addEventListener('DOMContentLoaded', () => { const bell = document.querySelector('usa-notification-bell'); bell.notify({ text: 'New follower', time: 'now' }); });</script>
2408
- ```
2409
-
2410
- ### <usa-odometer> — Odometer counter
2411
-
2412
- 6.4: rolling digit wheels — every digit spins forward to its new value, new digits slide in, locale grouping via Intl.NumberFormat, decimals, prefix / suffix. The accessible name is the formatted number.
2413
-
2414
- - Import: `import { defineOdometer } from 'motionary/components/widgets'; defineOdometer();`
2415
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2416
- - Attributes: `value`, `locale`, `decimals`, `prefix`, `suffix`, `duration`
2417
-
2418
- ```html
2419
- <usa-odometer value="1284" locale="en-US" prefix="$"></usa-odometer>
2420
- <!-- el.value = 2048 rolls every digit -->
2421
- ```
2422
-
2423
- ### <usa-organic-card> — Organic card
2424
-
2425
- 8.3: a card with a soft, living blob shape — its outline slowly breathes on screen, morphs on hover and comes in leaf, ocean, petal and sand tints.
2426
-
2427
- - Import: `import { defineOrganicCard } from 'motionary/components/widgets'; defineOrganicCard();`
2428
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2429
- - Attributes: `tint`, `seed`
2430
- - Methods: `morph()`
2431
-
2432
- ```html
2433
- <usa-organic-card tint="ocean">
2434
- <h3>Deep sea</h3><p>Content…</p>
2435
- </usa-organic-card>
2436
- ```
2437
-
2438
- ### <usa-otp> — OTP code input
2439
-
2440
- 7.7: one-time-code boxes that auto-advance, step back on Backspace and take a pasted code; digits pop in, error() shakes the row red, success() sends a green wave across it.
2441
-
2442
- - Import: `import { defineOtp } from 'motionary/components/widgets'; defineOtp();`
2443
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2444
- - Attributes: `length`, `mode`, `label`, `value`
2445
- - Events: `usa:complete`
2446
- - Methods: `fillCode()`, `clear()`, `error()`, `success()`
2447
-
2448
- ```html
2449
- <usa-otp length="6"></usa-otp>
2450
- <script>const otp = document.querySelector('usa-otp'); otp.addEventListener('usa:complete', (e) => check(e.detail.code) ? otp.success() : otp.error());</script>
2451
- ```
2452
-
2453
- ### <usa-overscroll> — Elastic overscroll
2454
-
2455
- A scroll container whose edges stretch with iOS-style rubber-band resistance and spring back — touch, trackpad and wheel.
2456
-
2457
- - Import: `import { defineOverscroll } from 'motionary/components/physics'; defineOverscroll();`
2458
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2459
- - Attributes: `axis`, `disabled`, `max`, `preset`
2460
-
2461
- ```html
2462
- <usa-overscroll style="height: 240px">
2463
- <ul>…</ul>
2464
- </usa-overscroll>
2465
- ```
2466
-
2467
- ### <usa-pack> — E-commerce pack
2468
-
2469
- Product cards reveal and lift, “Add to cart” presses and flies the product into the cart (which bumps), prices count up, badges pulse.
2470
-
2471
- - Import: `import { definePack } from 'motionary/components/packs'; definePack();`
2472
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2473
- - Attributes: `name`
2474
-
2475
- ```html
2476
- <usa-pack name="ecommerce">
2477
- <article data-role="product">
2478
- <img src="shoe.jpg" alt="Runner">
2479
- <span data-role="price">$129</span>
2480
- <button data-role="add-to-cart">Add to cart</button>
2481
- </article>
2482
- <a data-role="cart" href="/cart">Cart</a>
2483
- </usa-pack>
2484
- ```
2485
-
2486
- ### <usa-pagination> — Pagination with sliding ink
2487
-
2488
- 6.7: the highlight springs to the chosen page (squashing on the way) and page numbers slide in from the direction of travel when the window shifts. Prev / next, ellipses, aria-current.
2489
-
2490
- - Import: `import { definePagination } from 'motionary/components/widgets'; definePagination();`
2491
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2492
- - Attributes: `total`, `siblings`, `label`
2493
- - Events: `usa:change`
2494
-
2495
- ```html
2496
- <usa-pagination total="20" page="1" siblings="1"></usa-pagination>
2497
- ```
2498
-
2499
- ### <usa-panorama> — 360° panorama viewer
2500
-
2501
- 8.8: a 360° panorama — drag or swipe to look around with inertia, a slow auto-rotate, a compass for the heading and a “View in XR” badge when the browser offers WebXR.
2502
-
2503
- - Import: `import { definePanorama } from 'motionary/components/widgets'; definePanorama();`
2504
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2505
- - Attributes: `src`, `autorotate`, `label`
2506
- - Events: `usa:xr`, `usa:xr-request`, `usa:look`
2507
- - Methods: `lookAt()`
2508
-
2509
- ```html
2510
- <usa-panorama src="pano-equirect.jpg" label="Lake at dawn" autorotate="6"></usa-panorama>
2511
- ```
2512
-
2513
- ### <usa-parallax-layers> — Parallax layers
2514
-
2515
- 10.4: a parallax container — children with data-depth move at different speeds while it crosses the viewport (native view() scroll timeline first, JS fallback), optional pointer tilt; static under reduced motion.
2516
-
2517
- - Import: `import { defineParallaxLayers } from 'motionary/components/widgets'; defineParallaxLayers();`
2518
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2519
- - Attributes: `range`, `engine`, `horizontal`, `pointer`, `strength`, `preview`
2520
- - Events: `usa:progress`
2521
- - Methods: `layers()`
2522
-
2523
- ```html
2524
- <usa-parallax-layers range="120">
2525
- <img data-depth="0.6" src="mountains.webp" alt="">
2526
- <h2 data-depth="-0.3">Above the clouds</h2>
2527
- </usa-parallax-layers>
2528
- ```
2529
-
2530
- ### <usa-particles> — Particles
2531
-
2532
- A canvas constellation that drifts away from the pointer. Runs only while visible, DPR ≤ 2, a still frame under reduced motion.
2533
-
2534
- - Import: `import { defineParticles } from 'motionary/components/background'; defineParticles();`
2535
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2536
- - Attributes: `count`, `color`, `size`, `speed`, `links`, `interactive`, `paused`
2537
- - Methods: `reset()`
2538
-
2539
- ```html
2540
- <usa-particles count="80" links="120" interactive></usa-particles>
2541
- ```
2542
-
2543
- ### <usa-pause-all> — Pause all motion
2544
-
2545
- 9.5: one button that pauses all motion on the page (WCAG 2.2.2) — Motionary’s shared clock, every CSS / Web animation and autoplaying media — and resumes it again; `scope` limits it to one area.
2546
-
2547
- - Import: `import { definePauseAll } from 'motionary/components/widgets'; definePauseAll();`
2548
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2549
- - Attributes: `label`, `scope`, `resume-label`
2550
- - Events: `usa:pause-all`
2551
- - Methods: `toggle()`
2552
-
2553
- ```html
2554
- <usa-pause-all></usa-pause-all>
2555
- ```
2556
-
2557
- ### <usa-perf-monitor> — Perf monitor
2558
-
2559
- 9.6: a live performance overlay for motion work — FPS with a sparkline, active Motionary animations, frame-loop callbacks, long tasks and the shared clock — flagging jank.
2560
-
2561
- - Import: `import { definePerfMonitor } from 'motionary/components/widgets'; definePerfMonitor();`
2562
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2563
- - Attributes: `corner`, `warn`
2564
- - Events: `usa:jank`
2565
-
2566
- ```html
2567
- <usa-perf-monitor corner="bottom-right"></usa-perf-monitor>
2568
- ```
2569
-
2570
- ### <usa-physics-playground> — Physics playground
2571
-
2572
- 10.7: a 2D rigid-body sandbox on Motionary’s own physics engine — circles, boxes and polygons, friction, restitution, constraints, sleeping — loaded from a versioned motionary-scene@1 JSON (or a preset: balls, pyramid, pendulum, dominoes). Drag bodies, tap to spawn, arrow keys nudge. Requires motionary/runtime/physics + motionary/runtime/format-scene — npm i motionary, then use(physics, formatScene) before it mounts.
2573
-
2574
- - Import: `import { definePhysicsPlayground } from 'motionary/components/widgets'; definePhysicsPlayground();`
2575
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2576
- - Attributes: `preset`, `src`, `gravity`, `spawn`, `label`
2577
- - Events: `usa:collision`, `usa:load`, `usa:error`, `usa:runtime-missing`
2578
- - Methods: `reset()`, `play()`, `pause()`, `toScene()`
2579
- - Requires: motionary/runtime/physics + motionary/runtime/format-scene
2580
- - Install: `npm i motionary`
2581
- - Order: Register the core first, then the module: use(physics) also registers the core. CDN: load runtime.iife.js, then runtime/physics.iife.js (it registers itself). Register the core first, then the module: use(formatScene) also registers the core. CDN: load runtime.iife.js, then runtime/format-scene.iife.js (it registers itself).
2582
-
2583
- ```js
2584
- import { use } from 'motionary/runtime';
2585
- import { physics } from 'motionary/runtime/physics';
2586
- import { formatScene } from 'motionary/runtime/format-scene';
2587
- import { definePhysicsPlayground } from 'motionary/components/widgets';
2588
-
2589
- use(physics, formatScene);
2590
- definePhysicsPlayground(); // registers <usa-physics-playground> — after the prerequisites
2591
- ```
2592
-
2593
- ```html
2594
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
2595
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/physics.iife.js"></script>
2596
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/format-scene.iife.js"></script>
2597
- <!-- then the component bundles -->
2598
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
2599
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
2600
- ```
2601
-
2602
- ```html
2603
- <usa-physics-playground preset="pyramid" spawn label="Knock the pyramid over"></usa-physics-playground>
2604
- ```
2605
-
2606
- ### <usa-pinch-zoom> — Pinch zoom
2607
-
2608
- Pinch with two fingers or Ctrl + wheel / trackpad pinch, pan while zoomed, double-tap to toggle; scale and position spring back inside the bounds.
2609
-
2610
- - Import: `import { definePinchZoom } from 'motionary/components/gesture'; definePinchZoom();`
2611
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2612
- - Attributes: `min`, `max`, `preset`, `double-tap`
2613
- - Events: `usa:zoom`
2614
- - Methods: `zoomTo()`
2615
-
2616
- ```html
2617
- <usa-pinch-zoom max="4">
2618
- <img src="photo.jpg" alt="…">
2619
- </usa-pinch-zoom>
2620
- ```
2621
-
2622
- ### <usa-player> — JSON animation player
2623
-
2624
- 5.9: <usa-player> plays a JSON animation — timeline presets, your own keyframes and any registered effect on a shared clock; play / pause / seek / rate / loop, scroll-scrubbing (trigger="scroll"). Export one from the Playground (<usa-player> JSON tab).
2625
-
2626
- - Import: `import { definePlayer } from 'motionary/components/effects'; definePlayer();`
2627
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2628
- - Attributes: `src`, `trigger`, `loop`, `rate`, `controls`
2629
- - Events: `usa:finish`, `usa:ready`
2630
- - Methods: `load()`, `play()`, `pause()`, `seek()`
2631
-
2632
- ```html
2633
- <usa-player src="hero.json" trigger="view">
2634
- <h1>Title</h1>
2635
- <a class="cta">Start</a>
2636
- </usa-player>
2637
- ```
2638
-
2639
- ### <usa-plugin-card> — Plugin detail card
2640
-
2641
- 10.1: a plugin’s name, version and author with a Motionary compatibility badge (semver `engine` range), a signature badge (SHA-256 integrity checked with Web Crypto), an animated download counter and expandable details. Requires motionary/runtime — npm i motionary, then use() before the card mounts.
2642
-
2643
- - Import: `import { definePluginCard } from 'motionary/components/widgets'; definePluginCard();`
2644
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2645
- - Attributes: `name`, `title`, `version`, `author`, `engine`, `downloads`, `integrity`, `src`
2646
- - Events: `usa:toggle`, `usa:verified`, `usa:runtime-missing`
2647
- - Methods: `toggle()`, `verify()`, `compat()`
2648
- - Requires: motionary/runtime
2649
- - Install: `npm i motionary`
2650
- - Order: Import motionary/runtime and call use() once at start-up, before any runtime-powered component mounts. CDN: the IIFE registers itself (window.MotionaryRuntime).
2651
-
2652
- ```js
2653
- import { use } from 'motionary/runtime';
2654
- import { definePluginCard } from 'motionary/components/widgets';
2655
-
2656
- use();
2657
- definePluginCard(); // registers <usa-plugin-card> — after the prerequisites
2658
- ```
2659
-
2660
- ```html
2661
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
2662
- <!-- then the component bundles -->
2663
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
2664
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
2665
- ```
2666
-
2667
- ```html
2668
- <usa-plugin-card name="retro" title="Retro" version="1.2.0" author="Motionary" engine="^10.0.0" downloads="12400">
2669
- <p>Pixel, CRT, VHS and Y2K effects.</p>
2670
- </usa-plugin-card>
2671
- ```
2672
-
2673
- ### <usa-plugin-store> — Plugin marketplace
2674
-
2675
- 9.0: the plugin marketplace as a component — search the catalogue of effect packs, see each plugin’s effects and install it with one click (imports and registers the pack).
2676
-
2677
- - Import: `import { definePluginStore } from 'motionary/components/widgets'; definePluginStore();`
2678
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2679
- - Attributes: `query`, `label`
2680
- - Events: `usa:install`, `usa:install-error`
2681
- - Methods: `search()`, `install()`
2682
-
2683
- ```html
2684
- <usa-plugin-store query="neon"></usa-plugin-store>
2685
- <script type="module">
2686
- const store = document.querySelector('usa-plugin-store');
2687
- store.loader = (entry) => import(entry); // or map to your bundler imports
2688
- </script>
2689
- ```
2690
-
2691
- ### <usa-popover> — Popover
2692
-
2693
- Click-to-open panel that springs from its trigger; Esc / outside click closes, focus returns.
2694
-
2695
- - Import: `import { definePopover } from 'motionary/components/ui'; definePopover();`
2696
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2697
- - Attributes: `placement`
2698
- - Methods: `toggle()`
2699
-
2700
- ```html
2701
- <usa-popover>
2702
- <button>Share</button>
2703
- <div data-popover>…</div>
2704
- </usa-popover>
2705
- ```
2706
-
2707
- ### <usa-post-fx> — Post-processing
2708
-
2709
- Chainable GPU passes over an image (4.8): vignette, grain, chromatic aberration, scanlines, CRT, bloom, pixelate, duotone and glitch, with one intensity. Without WebGL the image gets an approximate CSS filter.
2710
-
2711
- - Import: `import { definePostFx } from 'motionary/components/webgl'; definePostFx();`
2712
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2713
-
2714
- ```html
2715
- <usa-post-fx effects="vignette grain" intensity="0.6">
2716
- <img src="photo.jpg" alt="…">
2717
- </usa-post-fx>
2718
- ```
2719
-
2720
- ### <usa-presence> — Presence avatar
2721
-
2722
- 7.4: an avatar with a live status dot (online, away, busy, offline) — coming online sends a ripple, speaking adds a pulsing ring and story an animated gradient ring. Initials when there is no photo.
2723
-
2724
- - Import: `import { definePresence } from 'motionary/components/widgets'; definePresence();`
2725
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2726
- - Attributes: `status`, `speaking`, `name`, `src`
2727
-
2728
- ```html
2729
- <usa-presence name="Ada Lovelace" status="online"></usa-presence>
2730
- <usa-presence name="Alan Turing" status="away" speaking></usa-presence>
2731
- <usa-presence name="Grace Hopper" status="busy" story></usa-presence>
2732
- ```
2733
-
2734
- ### <usa-press> — Press feedback
2735
-
2736
- Tactile press: dips while pressed and springs back, or bounces once with bounce. Mouse, touch, pen and keyboard.
2737
-
2738
- - Import: `import { definePress } from 'motionary/components/interaction'; definePress();`
2739
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2740
- - Attributes: `disabled`, `scale`, `bounce`
2741
-
2742
- ```html
2743
- <usa-press bounce><button>Press</button></usa-press>
2744
- ```
2745
-
2746
- ### <usa-prize-wheel> — Prize wheel
2747
-
2748
- 7.5: a lottery wheel — Spin whirls it and it eases out on the result (random or spin(index)), the pointer ticks and the wheel glows; usa:result reports the prize.
2749
-
2750
- - Import: `import { definePrizeWheel } from 'motionary/components/widgets'; definePrizeWheel();`
2751
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2752
- - Attributes: `segments`, `label`, `turns`, `duration`
2753
- - Events: `usa:result`
2754
- - Methods: `spin()`
2755
-
2756
- ```html
2757
- <usa-prize-wheel segments="10% off,Free ship,Try again,🎁 Gift,5% off,Jackpot"></usa-prize-wheel>
2758
- ```
2759
-
2760
- ### <usa-product-gallery> — Product gallery
2761
-
2762
- 7.3: product photos with a thumbnail strip — the stage cross-slides in the direction of travel, the selection ring glides between thumbnails, hover zooms under the pointer, swipe and ←/→ work.
2763
-
2764
- - Import: `import { defineProductGallery } from 'motionary/components/widgets'; defineProductGallery();`
2765
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2766
- - Attributes: `index`, `nozoom`, `zoom`
2767
- - Events: `usa:change`
2768
- - Methods: `go()`, `next()`, `prev()`
2769
-
2770
- ```html
2771
- <usa-product-gallery zoom="2">
2772
- <img src="front.jpg" alt="Front">
2773
- <img src="side.jpg" alt="Side">
2774
- <img src="back.jpg" alt="Back">
2775
- </usa-product-gallery>
2776
- ```
2777
-
2778
- ### <usa-progress> — Progress bar
2779
-
2780
- Determinate bars glide between values; without a value it shows the Fluent indeterminate animation. Paused / error states.
2781
-
2782
- - Import: `import { defineProgress } from 'motionary/components/feedback'; defineProgress();`
2783
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2784
- - Attributes: `value`, `max`, `indeterminate`, `label`
2785
- - Events: `usa:complete`
2786
-
2787
- ```html
2788
- <usa-progress value="40"></usa-progress>
2789
- <usa-progress indeterminate></usa-progress>
2790
- ```
2791
-
2792
- ### <usa-progress-ring> — Progress ring / bar / gauge
2793
-
2794
- 6.4: the arc eases to every new value with a little overshoot while the label counts up; ring, bar or semicircle gauge, gradient strokes, indeterminate spinner without a value. role="progressbar", usa:complete at 100%.
2795
-
2796
- - Import: `import { defineProgressRing } from 'motionary/components/widgets'; defineProgressRing();`
2797
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2798
- - Attributes: `variant`, `value`, `max`, `gradient`, `no-label`, `duration`
2799
- - Events: `usa:complete`
2800
-
2801
- ```html
2802
- <usa-progress-ring value="72" gradient="#7c5cff,#22d3ee"></usa-progress-ring>
2803
- <usa-progress-ring variant="bar" value="40"></usa-progress-ring>
2804
- <usa-progress-ring variant="semi" value="88"></usa-progress-ring>
2805
- <!-- el.value = 90 animates to the new value -->
2806
- ```
2807
-
2808
- ### <usa-prop-panel> — Property panel
2809
-
2810
- 8.9 low-code: a property editor for a live component — typed fields (number / range, select, color, switch, text) bound to its attributes, so the component re-renders as you edit.
2811
-
2812
- - Import: `import { definePropPanel } from 'motionary/components/widgets'; definePropPanel();`
2813
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2814
- - Attributes: `for`, `props`, `label`
2815
- - Events: `usa:prop`
2816
- - Methods: `reset()`
2817
-
2818
- ```html
2819
- <usa-star-rating id="r" value="3"></usa-star-rating>
2820
- <usa-prop-panel for="#r" props="value:number:0:5, icon:select:star|heart, readonly:boolean"></usa-prop-panel>
2821
- ```
2822
-
2823
- ### <usa-pull-cord> — Lamp pull-cord switch
2824
-
2825
- 6.8: pull the cord down and let go — past the threshold the lamp switches, and the cord swings back on a damped spring. Click, Space or Enter tug it too; role="switch".
2826
-
2827
- - Import: `import { definePullCord } from 'motionary/components/widgets'; definePullCord();`
2828
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2829
- - Attributes: `label`, `threshold`
2830
- - Events: `usa:change`
2831
- - Methods: `toggle()`
2832
-
2833
- ```html
2834
- <usa-pull-cord label="Desk lamp"></usa-pull-cord>
2835
- ```
2836
-
2837
- ### <usa-pull-refresh> — Pull to refresh
2838
-
2839
- Pull down at the top of a list: the spinner stretches in with rubber-band resistance; release past the threshold to refresh.
2840
-
2841
- - Import: `import { definePullRefresh } from 'motionary/components/ui'; definePullRefresh();`
2842
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2843
- - Attributes: `threshold`, `disabled`, `label`
2844
- - Methods: `refresh()`
2845
-
2846
- ```html
2847
- <usa-pull-refresh style="height: 300px">
2848
- <ul>…</ul>
2849
- </usa-pull-refresh>
2850
- <script>const el = document.querySelector('usa-pull-refresh'); el.addEventListener('usa:refresh', async (e) => { await load(); e.detail.done(); });</script>
2851
- ```
2852
-
2853
- ### <usa-radar> — Radar scope
2854
-
2855
- 8.4: a sci-fi radar scope — a conic beam sweeps round and each target lights up and fades as the beam passes over it.
2856
-
2857
- - Import: `import { defineRadar } from 'motionary/components/widgets'; defineRadar();`
2858
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2859
- - Attributes: `targets`, `rings`, `speed`, `label`
2860
- - Events: `usa:ping`
2861
- - Methods: `setTargets()`
2862
-
2863
- ```html
2864
- <usa-radar targets="Alpha:40,0.6; Bravo:200,0.35; Echo:300,0.8" speed="4"></usa-radar>
2865
- ```
2866
-
2867
- ### <usa-reactions> — Emoji reactions
2868
-
2869
- 7.4: a reaction bar — clicking a pill toggles your reaction: the emoji pops, the count rolls and copies float up; + springs open a picker. Each pill is a toggle button with a count label.
2870
-
2871
- - Import: `import { defineReactions } from 'motionary/components/widgets'; defineReactions();`
2872
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2873
- - Attributes: `emojis`, `counts`, `picker`
2874
- - Events: `usa:react`
2875
- - Methods: `toggle()`
2876
-
2877
- ```html
2878
- <usa-reactions emojis="👍,❤️,😂,🎉" counts="3,1,0,2"></usa-reactions>
2879
- ```
2880
-
2881
- ### <usa-red-envelope> — Red envelope (红包)
2882
-
2883
- 8.1: a Lunar New Year red envelope — tap and the flap swings open, the card slides out with the amount counting up and gold coins pop out.
2884
-
2885
- - Import: `import { defineRedEnvelope } from 'motionary/components/widgets'; defineRedEnvelope();`
2886
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2887
- - Attributes: `amount`, `currency`, `message`, `from`, `opened`
2888
- - Events: `usa:open`
2889
- - Methods: `open()`, `close()`
2890
-
2891
- ```html
2892
- <usa-red-envelope amount="88.88" from="Grandma" message="恭喜发财"></usa-red-envelope>
2893
- ```
2894
-
2895
- ### <usa-retro-button> — Retro buttons
2896
-
2897
- 8.2: buttons in four eras with matching press motion — 8-bit pixel (stepped press), CRT phosphor (flicker), Y2K chrome pill (bounce) and Windows 95 bevel (sink).
2898
-
2899
- - Import: `import { defineRetroButton } from 'motionary/components/widgets'; defineRetroButton();`
2900
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2901
- - Attributes: `variant`, `disabled`, `type`
2902
-
2903
- ```html
2904
- <usa-retro-button variant="pixel">Start</usa-retro-button>
2905
- <usa-retro-button variant="win95">OK</usa-retro-button>
2906
- ```
2907
-
2908
- ### <usa-reveal> — Reveal
2909
-
2910
- Fade, slide, zoom, blur or flip content in as it enters the viewport. 12 effects, replay on re-entry with repeat.
2911
-
2912
- - Import: `import { defineReveal } from 'motionary/components/reveal'; defineReveal();`
2913
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2914
- - Attributes: `effect`, `distance`, `repeat`, `threshold`, `root-margin`, `duration`, `delay`, `easing`
2915
- - Events: `usa:enter`, `usa:leave`, `usa:complete`
2916
- - Methods: `reveal()`, `reset()`
2917
-
2918
- ```html
2919
- <usa-reveal effect="fade-up" duration="700">
2920
- <h2>Hello</h2>
2921
- </usa-reveal>
2922
- ```
2923
-
2924
- ### <usa-ripple> — Ripple
2925
-
2926
- Ink ripple from the pointer — or from the centre for Space/Enter — on any button, list item or card.
2927
-
2928
- - Import: `import { defineRipple } from 'motionary/components/interaction'; defineRipple();`
2929
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
2930
- - Attributes: `disabled`, `centered`, `color`, `opacity`, `duration`
2931
- - Methods: `ripple()`
2932
-
2933
- ```html
2934
- <usa-ripple><button>Click me</button></usa-ripple>
2935
- ```
2936
-
2937
- ### <usa-rive> — Rive player (official runtime)
2938
-
2939
- 10.6: plays Rive (.riv) files — artboards, animations and state machines with inputs — through the official Rive runtime @rive-app/canvas, an optional peer dependency that is lazy-loaded on first use (Motionary does not reimplement the proprietary .riv format). Requires @rive-app/canvas — npm i @rive-app/canvas, or load its CDN script first; missing → a clear message in place.
2940
-
2941
- - Import: `import { defineRive } from 'motionary/components/widgets'; defineRive();`
2942
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2943
- - Attributes: `src`, `artboard`, `animation`, `state-machine`, `autoplay`, `fit`, `label`, `runtime-src`
2944
- - Events: `usa:load`, `usa:error`, `usa:runtime-missing`
2945
- - Methods: `play()`, `pause()`, `input()`
2946
- - Requires: @rive-app/canvas
2947
- - Install: `npm i @rive-app/canvas`
2948
- - Order: Install the official runtime next to motionary, then hand <usa-rive> a lazy loader with provideRiveRuntime(() => import('@rive-app/canvas')) before the element mounts — your bundler splits the runtime into its own chunk, fetched only when the first <usa-rive> appears. Without a bundler: load the official rive.js from a CDN before the component bundles (window.rive), use an import map, or set runtime-src on the element. Missing → a clear message in place + usa:runtime-missing.
2949
-
2950
- ```js
2951
- import { provideRiveRuntime } from 'motionary/components/widgets';
2952
- import { defineRive } from 'motionary/components/widgets';
2953
-
2954
- provideRiveRuntime(() => import('@rive-app/canvas')); // lazy: fetched when the first <usa-rive> mounts
2955
- defineRive(); // registers <usa-rive> — after the prerequisites
2956
- ```
2957
-
2958
- ```html
2959
- <script src="https://unpkg.com/@rive-app/canvas@2.44.1/rive.js"></script>
2960
- <!-- then the component bundles -->
2961
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
2962
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
2963
- ```
2964
-
2965
- ```html
2966
- <usa-rive src="/anim/icon.riv" state-machine="State Machine 1" autoplay label="Icon"></usa-rive>
2967
- ```
2968
-
2969
- ### <usa-route-transition> — Route transition container
2970
-
2971
- 10.3: View Transitions 2.0 — link clicks swap the container’s content with the target page (fetched) or an inline <template data-route>, animated with the View Transitions API (Web Animations fallback); data-shared elements morph between routes; cross-document enables native MPA transitions.
2972
-
2973
- - Import: `import { defineRouteTransition } from 'motionary/components/widgets'; defineRouteTransition();`
2974
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2975
- - Attributes: `effect`, `engine`, `cross-document`, `current`, `links`, `history`, `selector`
2976
- - Events: `usa:navigate`, `usa:navigated`
2977
- - Methods: `navigate()`
2978
-
2979
- ```html
2980
- <usa-route-transition id="app" effect="slide" cross-document>
2981
- <nav><a href="/">Home</a> <a href="/about">About</a></nav>
2982
- <h1 data-shared="title">Home</h1>
2983
- </usa-route-transition>
2984
- ```
2985
-
2986
- ### <usa-scene> — Cinematic scene
2987
-
2988
- 9.1: a scroll-scrubbed cinematic shot — while the scene crosses the screen its image follows a camera move (dolly, pan, tilt, zoom, orbit) and captions fade in on cue.
2989
-
2990
- - Import: `import { defineScene } from 'motionary/components/widgets'; defineScene();`
2991
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
2992
- - Attributes: `camera`, `strength`, `autoplay`
2993
- - Events: `usa:shot`
2994
- - Methods: `setProgress()`
2995
-
2996
- ```html
2997
- <usa-scene camera="dolly-in">
2998
- <img src="harbor.jpg" alt="Harbor at dawn">
2999
- <p data-caption data-at="0.4">Dawn, 1912.</p>
3000
- </usa-scene>
3001
- ```
3002
-
3003
- ### <usa-scramble> — Scramble / decode
3004
-
3005
- Decodes text out of random glyphs, left to right. Trigger on view, hover/focus or manually.
3006
-
3007
- - Import: `import { defineScramble } from 'motionary/components/text'; defineScramble();`
3008
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3009
- - Attributes: `text`, `trigger`, `duration`, `chars`
3010
- - Events: `usa:complete`
3011
- - Methods: `play()`
3012
-
3013
- ```html
3014
- <usa-scramble trigger="hover">ACCESS GRANTED</usa-scramble>
3015
- ```
3016
-
3017
- ### <usa-scroll-highlight> — Scroll highlight
3018
-
3019
- Words light up one by one as you read down the page, or a highlighter marker sweeps behind the text.
3020
-
3021
- - Import: `import { defineScrollHighlight } from 'motionary/components/text'; defineScrollHighlight();`
3022
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3023
- - Attributes: `mode`, `text`, `color`, `dim`
3024
- - Methods: `mount()`
3025
-
3026
- ```html
3027
- <usa-scroll-highlight>Every word lights up as you scroll.</usa-scroll-highlight>
3028
- <usa-scroll-highlight mode="marker">Important</usa-scroll-highlight>
3029
- ```
3030
-
3031
- ### <usa-scroll-progress> — Scroll progress bar
3032
-
3033
- Reading progress of the page or of one article. Compositor-only scaleX, role="progressbar".
3034
-
3035
- - Import: `import { defineScrollProgress } from 'motionary/components/reveal'; defineScrollProgress();`
3036
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3037
- - Attributes: `target`, `label`
3038
- - Events: `usa:progress`
3039
- - Methods: `update()`
3040
-
3041
- ```html
3042
- <usa-scroll-progress></usa-scroll-progress>
3043
- <!-- or for one article -->
3044
- <usa-scroll-progress target="#post" position="bottom"></usa-scroll-progress>
3045
- ```
3046
-
3047
- ### <usa-scroll-ring> — Scroll progress ring
3048
-
3049
- 10.4: a circular scroll-progress indicator for the page or any scroll container (for=".article"), optional percentage label and back-to-top button. Scroll-driven 3.0: native animation-timeline: scroll() first (no script per frame), a small JS loop where scroll timelines are missing.
3050
-
3051
- - Import: `import { defineScrollRing } from 'motionary/components/widgets'; defineScrollRing();`
3052
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3053
- - Attributes: `for`, `engine`, `label`, `back-to-top`, `size`, `thickness`, `horizontal`, `preview`
3054
- - Events: `usa:progress`, `usa:top`
3055
-
3056
- ```html
3057
- <usa-scroll-ring label back-to-top></usa-scroll-ring>
3058
- ```
3059
-
3060
- ### <usa-scroll-scene> — Scroll scene
3061
-
3062
- 10.2: a scroll-linked scene — children with data-scrub="opacity: 0 -> 1; x: -80 -> 0" are tweened as you scroll, scrubbed directly or smoothed (scrub="120"), with optional pin, markers and stagger. Requires motionary/runtime/scroll — npm i motionary, then use(scroll) before the scene mounts.
3063
-
3064
- - Import: `import { defineScrollScene } from 'motionary/components/widgets'; defineScrollScene();`
3065
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3066
- - Attributes: `start`, `end`, `scrub`, `pin`, `markers`, `stagger`, `toggle-class`, `preview`
3067
- - Events: `usa:enter`, `usa:leave`, `usa:progress`, `usa:runtime-missing`
3068
- - Methods: `refresh()`, `timeline()`
3069
- - Requires: motionary/runtime/scroll
3070
- - Install: `npm i motionary`
3071
- - Order: Register the core first, then the module: use(scroll) also registers the core. CDN: load runtime.iife.js, then runtime/scroll.iife.js (it registers itself).
3072
-
3073
- ```js
3074
- import { use } from 'motionary/runtime';
3075
- import { scroll } from 'motionary/runtime/scroll';
3076
- import { defineScrollScene } from 'motionary/components/widgets';
3077
-
3078
- use(scroll);
3079
- defineScrollScene(); // registers <usa-scroll-scene> — after the prerequisites
3080
- ```
3081
-
3082
- ```html
3083
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
3084
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/scroll.iife.js"></script>
3085
- <!-- then the component bundles -->
3086
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
3087
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
3088
- ```
3089
-
3090
- ```html
3091
- <usa-scroll-scene start="top 80%" end="bottom 20%" scrub="120" stagger="120">
3092
- <h2 data-scrub="x: -80 -> 0; opacity: 0 -> 1">Scroll</h2>
3093
- <p data-scrub="y: 40 -> 0; opacity: 0 -> 1">and it follows.</p>
3094
- </usa-scroll-scene>
3095
- ```
3096
-
3097
- ### <usa-scrolly> — Sticky scrollytelling
3098
-
3099
- A pinned graphic while [data-step] blocks scroll past; the active step drives the graphic via attributes, a CSS variable and events.
3100
-
3101
- - Import: `import { defineScrolly } from 'motionary/components/reveal'; defineScrolly();`
3102
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3103
- - Attributes: `offset`
3104
- - Events: `usa:step`
3105
-
3106
- ```html
3107
- <usa-scrolly>
3108
- <figure data-sticky>…</figure>
3109
- <section data-step="intro">…</section>
3110
- <section data-step="detail">…</section>
3111
- </usa-scrolly>
3112
- ```
3113
-
3114
- ### <usa-segmented> — Segmented control
3115
-
3116
- 6.7: an iOS-style thumb slides under the chosen segment with a spring and stretches while it travels. A real radio group: arrow keys, Home / End. iOS, pill or outline.
3117
-
3118
- - Import: `import { defineSegmented } from 'motionary/components/widgets'; defineSegmented();`
3119
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3120
- - Attributes: `variant`, `label`, `value`
3121
- - Events: `usa:change`
3122
-
3123
- ```html
3124
- <usa-segmented variant="ios" label="View">
3125
- <button>Day</button>
3126
- <button>Week</button>
3127
- <button>Month</button>
3128
- </usa-segmented>
3129
- ```
3130
-
3131
- ### <usa-shader> — Shader background
3132
-
3133
- A GPU shader behind your content: gradient, plasma, waves or aurora presets — or your own fragment shader in a <script type="x-shader/x-fragment">. Falls back to the CSS background.
3134
-
3135
- - Import: `import { defineShader } from 'motionary/components/webgl'; defineShader();`
3136
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3137
-
3138
- ```html
3139
- <usa-shader preset="aurora" speed="1">
3140
- <h1>Hero title</h1>
3141
- </usa-shader>
3142
-
3143
- <usa-shader>
3144
- <script type="x-shader/x-fragment">
3145
- void main() { gl_FragColor = vec4(v_uv, 0.5 + 0.5 * sin(u_time), 1.0); }
3146
- </script>
3147
- </usa-shader>
3148
- ```
3149
-
3150
- ### <usa-shader-backdrop> — Shader backdrop + post chain
3151
-
3152
- 10.5 (WebGPU effects 2.0): an animated shader background (aurora, plasma, waves, nebula or your own GLSL) run through a post-processing chain — bloom, vignette, grain, chromatic aberration, pixelate, scanlines — in any order; CSS gradient fallback.
3153
-
3154
- - Import: `import { defineShaderBackdrop } from 'motionary/components/widgets'; defineShaderBackdrop();`
3155
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3156
- - Attributes: `preset`, `post`, `colors`, `speed`, `intensity`, `label`
3157
- - Events: `usa:backend`
3158
-
3159
- ```html
3160
- <usa-shader-backdrop preset="aurora" post="bloom,vignette,grain">
3161
- <h1>Hello</h1>
3162
- </usa-shader-backdrop>
3163
- ```
3164
-
3165
- ### <usa-sheet> — Drawer / bottom sheet
3166
-
3167
- 6.3: a side sheet from the right, left, top or bottom with a blurred backdrop; the bottom sheet can be dragged down to dismiss and springs back otherwise. Native <dialog> underneath.
3168
-
3169
- - Import: `import { defineSheet } from 'motionary/components/widgets'; defineSheet();`
3170
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3171
- - Attributes: `side`, `label`, `persistent`
3172
- - Events: `usa:open`, `usa:close`
3173
- - Methods: `show()`, `close()`, `toggle()`
3174
-
3175
- ```html
3176
- <button data-usa-open="cart">Cart</button>
3177
- <usa-sheet id="cart" side="right" label="Cart">
3178
- <h2>Your cart</h2>
3179
- …
3180
- <button data-usa-close>Close</button>
3181
- </usa-sheet>
3182
- ```
3183
-
3184
- ### <usa-shimmer-text> — Shimmer text
3185
-
3186
- A light sweep across gradient-filled text. CSS only; colours and speed via attributes or custom properties.
3187
-
3188
- - Import: `import { defineShimmerText } from 'motionary/components/text'; defineShimmerText();`
3189
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3190
- - Attributes: `duration`, `color`, `shine`, `angle`
3191
-
3192
- ```html
3193
- <usa-shimmer-text shine="#fff">Premium</usa-shimmer-text>
3194
- ```
3195
-
3196
- ### <usa-shortcut> — Shortcut hint
3197
-
3198
- 7.9: keyboard-shortcut hints as keycaps (⌘ on Apple, Ctrl elsewhere); press the combination anywhere and the caps press down one after another and usa:trigger fires.
3199
-
3200
- - Import: `import { defineShortcut } from 'motionary/components/widgets'; defineShortcut();`
3201
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3202
- - Attributes: `keys`, `label`, `listen`, `for`
3203
- - Events: `usa:trigger`
3204
- - Methods: `press()`
3205
-
3206
- ```html
3207
- <usa-shortcut keys="mod+k" label="Search"></usa-shortcut>
3208
- <usa-shortcut keys="mod+shift+p" for="palette-button"></usa-shortcut>
3209
- ```
3210
-
3211
- ### <usa-skeleton> — Skeleton
3212
-
3213
- Shimmering placeholders while loading; remove loading and the real content fades in. aria-busy included.
3214
-
3215
- - Import: `import { defineSkeleton } from 'motionary/components/feedback'; defineSkeleton();`
3216
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3217
- - Attributes: `loading`, `lines`, `width`, `height`, `circle`, `avatar`, `radius`
3218
- - Events: `usa:loaded`
3219
-
3220
- ```html
3221
- <usa-skeleton loading avatar lines="3">
3222
- <article>…</article>
3223
- </usa-skeleton>
3224
- ```
3225
-
3226
- ### <usa-skeleton-reveal> — Skeleton → content reveal
3227
-
3228
- 6.4: the skeleton is generated from the real content — one bar per rendered text line, blocks for images and marked elements — with one synchronized shimmer (wave, pulse or glow). Remove loading and the bars dissolve top-to-bottom while the content fades in from a blur.
3229
-
3230
- - Import: `import { defineSkeletonReveal } from 'motionary/components/widgets'; defineSkeletonReveal();`
3231
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3232
- - Attributes: `loading`, `variant`
3233
- - Events: `usa:reveal`
3234
- - Methods: `reveal()`
3235
-
3236
- ```html
3237
- <usa-skeleton-reveal loading variant="wave">
3238
- <img src="avatar.jpg" alt="" data-skeleton="circle">
3239
- <h3>Ada Lovelace</h3>
3240
- <p>…</p>
3241
- </usa-skeleton-reveal>
3242
- <!-- el.loading = false (or el.reveal()) when the data arrived -->
3243
- ```
3244
-
3245
- ### <usa-sketch-chart> — Sketch chart
3246
-
3247
- 8.5: a hand-drawn chart — wobbly pencil axes with hatched bars or a sketchy line, sketched in stroke by stroke when it scrolls into view.
3248
-
3249
- - Import: `import { defineSketchChart } from 'motionary/components/widgets'; defineSketchChart();`
3250
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3251
- - Attributes: `values`, `labels`, `type`, `color`, `label`
3252
- - Events: `usa:drawn`
3253
- - Methods: `setValues()`, `redraw()`
3254
-
3255
- ```html
3256
- <usa-sketch-chart values="3,7,5,9" labels="Q1,Q2,Q3,Q4" label="Revenue"></usa-sketch-chart>
3257
- ```
3258
-
3259
- ### <usa-slider> — Slider
3260
-
3261
- A form-associated range slider: spring-following thumb, value bubble, full keyboard support (arrows, Page Up/Down, Home/End).
3262
-
3263
- - Import: `import { defineSlider } from 'motionary/components/ui'; defineSlider();`
3264
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3265
- - Attributes: `min`, `max`, `disabled`, `label`, `step`, `value`
3266
- - Events: `usa:input`, `usa:change`
3267
-
3268
- ```html
3269
- <usa-slider name="volume" value="40" bubble label="Volume"></usa-slider>
3270
- ```
3271
-
3272
- ### <usa-smooth-scroll> — Smooth scroll
3273
-
3274
- 10.4: smooth, inertial wheel scrolling for the page or a container (wrapper), anchor links glide (with offset for sticky headers); keyboard / scrollbar / touch stay native and it switches off under reduced motion. Requires motionary/runtime/smooth — npm i motionary, then use(smooth) before it mounts.
3275
-
3276
- - Import: `import { defineSmoothScroll } from 'motionary/components/widgets'; defineSmoothScroll();`
3277
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3278
- - Attributes: `lerp`, `duration`, `ease`, `wheel-multiplier`, `horizontal`, `touch`, `anchors`, `offset`, `wrapper`, `preview`
3279
- - Events: `usa:scroll`, `usa:ready`, `usa:runtime-missing`
3280
- - Methods: `glideTo()`, `stop()`, `resume()`
3281
- - Requires: motionary/runtime/smooth
3282
- - Install: `npm i motionary`
3283
- - Order: Register the core first, then the module: use(smooth) also registers the core. CDN: load runtime.iife.js, then runtime/smooth.iife.js (it registers itself).
3284
-
3285
- ```js
3286
- import { use } from 'motionary/runtime';
3287
- import { smooth } from 'motionary/runtime/smooth';
3288
- import { defineSmoothScroll } from 'motionary/components/widgets';
3289
-
3290
- use(smooth);
3291
- defineSmoothScroll(); // registers <usa-smooth-scroll> — after the prerequisites
3292
- ```
3293
-
3294
- ```html
3295
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
3296
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/smooth.iife.js"></script>
3297
- <!-- then the component bundles -->
3298
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
3299
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
3300
- ```
3301
-
3302
- ```html
3303
- <usa-smooth-scroll lerp="0.1" offset="64"></usa-smooth-scroll>
3304
- ```
3305
-
3306
- ### <usa-snap-carousel> — Snap carousel (drag · inertia · snap)
3307
-
3308
- 10.8: drag or swipe with real inertia — a throw keeps gliding, then springs to the nearest slide (a quick flick always moves one); rubber-band edges, arrows, dots, ←/→ / Home / End, optional autoplay that pauses on hover, focus and off screen. Slides keep their own width so the next one peeks in. Requires motionary/runtime/drag-snap — npm i motionary, then use(dragSnap) before it mounts. Its own entry point: motionary/components/snap-carousel (not in the widgets / lite bundles).
3309
-
3310
- - Import: `import { defineSnapCarousel } from 'motionary/components/snap-carousel'; defineSnapCarousel();`
3311
- - CDN: https://unpkg.com/motionary@15/dist/components/snap-carousel.js
3312
- - Attributes: `align`, `gap`, `autoplay`, `no-controls`, `no-dots`, `label`, `index`
3313
- - Events: `usa:change`, `usa:runtime-missing`
3314
- - Methods: `next()`, `prev()`, `goTo()`
3315
- - Requires: motionary/runtime/drag-snap
3316
- - Install: `npm i motionary`
3317
- - Order: Register the core first, then the module: use(dragSnap) also registers the core. CDN: load runtime.iife.js, then runtime/drag-snap.iife.js (it registers itself).
3318
-
3319
- ```js
3320
- import { use } from 'motionary/runtime';
3321
- import { dragSnap } from 'motionary/runtime/drag-snap';
3322
- import { defineSnapCarousel } from 'motionary/components/snap-carousel';
3323
-
3324
- use(dragSnap);
3325
- defineSnapCarousel(); // registers <usa-snap-carousel> — after the prerequisites
3326
- ```
3327
-
3328
- ```html
3329
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
3330
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/drag-snap.iife.js"></script>
3331
- <!-- then the component bundles -->
3332
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
3333
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
3334
- ```
3335
-
3336
- ```html
3337
- <usa-snap-carousel align="center" gap="16" label="Featured">
3338
- <article>…</article>
3339
- <article>…</article>
3340
- <article>…</article>
3341
- </usa-snap-carousel>
3342
- ```
3343
-
3344
- ### <usa-sparkline> — Sparkline
3345
-
3346
- 7.2: a tiny inline trend — draws itself on first view, a soft area fades in, the last point pulses and new data morphs the line point by point. line | area | bars; hover shows the value.
3347
-
3348
- - Import: `import { defineSparkline } from 'motionary/components/widgets'; defineSparkline();`
3349
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3350
- - Attributes: `variant`, `color`, `values`, `label`
3351
-
3352
- ```html
3353
- <usa-sparkline values="3,5,4,8,6,9,12" variant="area"></usa-sparkline>
3354
- ```
3355
-
3356
- ### <usa-spatial-card> — Spatial card
3357
-
3358
- 8.8: a spatial-computing window — frosted glass floating in depth, a soft gaze highlight that follows the pointer, layered content and an ornament bar; it eases towards you on hover and sinks on press.
3359
-
3360
- - Import: `import { defineSpatialCard } from 'motionary/components/widgets'; defineSpatialCard();`
3361
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3362
- - Events: `usa:focus-depth`
3363
-
3364
- ```html
3365
- <usa-spatial-card>
3366
- <h3 data-depth="2">Photos</h3>
3367
- <p data-depth="1">Spatial window</p>
3368
- <nav slot="ornament"><button>⟲</button><button>♡</button></nav>
3369
- </usa-spatial-card>
3370
- ```
3371
-
3372
- ### <usa-spinner> — Spinners
3373
-
3374
- Six indeterminate indicators: the WinUI progress ring, the Windows 10 orbiting dots, ring, typing dots, pulse and bars.
3375
-
3376
- - Import: `import { defineSpinner } from 'motionary/components/feedback'; defineSpinner();`
3377
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3378
- - Attributes: `kind`, `size`, `label`
3379
-
3380
- ```html
3381
- <usa-spinner kind="fluent"></usa-spinner>
3382
- <usa-spinner kind="windows" size="40"></usa-spinner>
3383
- ```
3384
-
3385
- ### <usa-splash> — Splash screen
3386
-
3387
- An app launch screen that leaves (fade, scale, slide-up, circle) once the page has loaded — never sooner than min ms.
3388
-
3389
- - Import: `import { defineSplash } from 'motionary/components/page'; defineSplash();`
3390
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3391
- - Attributes: `label`, `manual`, `min`, `exit`
3392
- - Events: `usa:done`
3393
- - Methods: `done()`
3394
-
3395
- ```html
3396
- <usa-splash exit="circle" min="800">
3397
- <img src="logo.svg" alt="">
3398
- </usa-splash>
3399
- ```
3400
-
3401
- ### <usa-split-text> — Split-text reveal
3402
-
3403
- Splits a headline into letters or words and cascades them in: rise, fade, blur, flip or pop. Words never break.
3404
-
3405
- - Import: `import { defineSplitText } from 'motionary/components/text'; defineSplitText();`
3406
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3407
- - Attributes: `by`, `text`, `from`, `stagger`, `duration`, `delay`, `trigger`, `repeat`
3408
- - Events: `usa:complete`
3409
- - Methods: `play()`, `reset()`
3410
-
3411
- ```html
3412
- <usa-split-text effect="rise">Animated headline</usa-split-text>
3413
- ```
3414
-
3415
- ### <usa-spotlight> — Reveal highlight
3416
-
3417
- The Windows Fluent “Reveal” effect: a light follows the pointer, lighting the borders of nearby items and the hovered one.
3418
-
3419
- - Import: `import { defineSpotlight } from 'motionary/components/interaction'; defineSpotlight();`
3420
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3421
- - Attributes: `size`, `color`, `border`
3422
-
3423
- ```html
3424
- <usa-spotlight>
3425
- <button>Mail</button>
3426
- <button>Calendar</button>
3427
- <button>Photos</button>
3428
- </usa-spotlight>
3429
- ```
3430
-
3431
- ### <usa-spring> — Spring effects
3432
-
3433
- bounce-in, pop and drop entrances with true spring timing (CSS linear() easing), plus jelly and rubber-band attention effects on view, hover or click.
3434
-
3435
- - Import: `import { defineSpring } from 'motionary/components/physics'; defineSpring();`
3436
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3437
- - Attributes: `effect`, `trigger`, `repeat`, `stiffness`, `damping`, `mass`, `preset`, `duration`, `delay`
3438
- - Events: `usa:complete`
3439
- - Methods: `play()`, `reset()`
3440
-
3441
- ```html
3442
- <usa-spring effect="bounce-in" preset="bouncy">
3443
- <div class="card">Hello</div>
3444
- </usa-spring>
3445
- <usa-spring effect="jelly" trigger="click">
3446
- <button>Tap me</button>
3447
- </usa-spring>
3448
- ```
3449
-
3450
- ### <usa-stagger> — Stagger list
3451
-
3452
- Reveals direct children one after another — lists, grids, feature rows.
3453
-
3454
- - Import: `import { defineStagger } from 'motionary/components/reveal'; defineStagger();`
3455
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3456
- - Attributes: `effect`, `repeat`, `threshold`, `distance`, `interval`, `delay`, `duration`, `easing`
3457
- - Events: `usa:enter`, `usa:complete`
3458
- - Methods: `reveal()`, `reset()`
3459
-
3460
- ```html
3461
- <usa-stagger effect="rise" interval="80">
3462
- <li>One</li>
3463
- <li>Two</li>
3464
- <li>Three</li>
3465
- </usa-stagger>
3466
- ```
3467
-
3468
- ### <usa-star-rating> — Star rating 2.0
3469
-
3470
- 6.4: the fill follows the pointer (half stars with step="0.5"), a click pops the chosen star with a sparkle burst while the others ripple; stars or hearts; a keyboard slider (arrows, Home / End); readonly mode.
3471
-
3472
- - Import: `import { defineStarRating } from 'motionary/components/widgets'; defineStarRating();`
3473
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3474
- - Attributes: `max`, `icon`, `readonly`, `step`, `label`, `value`
3475
- - Events: `usa:change`
3476
-
3477
- ```html
3478
- <usa-star-rating value="3.5" step="0.5" label="Your rating"></usa-star-rating>
3479
- <usa-star-rating value="4" readonly></usa-star-rating>
3480
- ```
3481
-
3482
- ### <usa-stepper> — Stepper / wizard
3483
-
3484
- 6.7: the rail fills toward the current step, finished steps pop a drawn check mark and the current step pulses. Horizontal or vertical; next() / prev() / value.
3485
-
3486
- - Import: `import { defineStepper } from 'motionary/components/widgets'; defineStepper();`
3487
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3488
- - Attributes: `orientation`, `label`, `clickable`
3489
- - Events: `usa:change`
3490
- - Methods: `next()`, `prev()`
3491
-
3492
- ```html
3493
- <usa-stepper value="1" label="Checkout">
3494
- <span>Cart</span>
3495
- <span>Shipping</span>
3496
- <span>Payment</span>
3497
- <span>Done</span>
3498
- </usa-stepper>
3499
- ```
3500
-
3501
- ### <usa-sticky-stack> — Sticky stack
3502
-
3503
- Cards stick while you scroll and the covered ones shrink and dim as the next slides over them.
3504
-
3505
- - Import: `import { defineStickyStack } from 'motionary/components/cards'; defineStickyStack();`
3506
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3507
- - Attributes: `top`, `gap`, `scale`
3508
- - Methods: `update()`
3509
-
3510
- ```html
3511
- <usa-sticky-stack top="80">
3512
- <section>One</section>
3513
- <section>Two</section>
3514
- <section>Three</section>
3515
- </usa-sticky-stack>
3516
- ```
3517
-
3518
- ### <usa-sticky-wall> — Sticky-note wall
3519
-
3520
- 8.5: a wall of sticky notes — each child becomes a pinned paper note with a slight tilt, the notes drop onto the wall one by one, and a tap lifts a note to the front.
3521
-
3522
- - Import: `import { defineStickyWall } from 'motionary/components/widgets'; defineStickyWall();`
3523
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3524
- - Attributes: `seed`, `label`
3525
- - Events: `usa:pick`
3526
- - Methods: `pick()`
3527
-
3528
- ```html
3529
- <usa-sticky-wall label="Ideas">
3530
- <p>Ship 8.5 ✏️</p>
3531
- <p data-color="pink">Call Mia</p>
3532
- <p data-color="blue">Buy paper</p>
3533
- </usa-sticky-wall>
3534
- ```
3535
-
3536
- ### <usa-stories> — Stories viewer
3537
-
3538
- 6.2: segmented progress bars, auto-advance, tap left / right to step, press and hold to pause, plus a pause button. Under reduced motion it waits for the user instead of advancing.
3539
-
3540
- - Import: `import { defineStories } from 'motionary/components/widgets'; defineStories();`
3541
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3542
- - Attributes: `duration`, `loop`
3543
- - Events: `usa:end`, `usa:change`
3544
- - Methods: `next()`, `prev()`, `goTo()`, `pause()`, `play()`
3545
-
3546
- ```html
3547
- <usa-stories duration="5000" loop>
3548
- <img src="1.jpg" alt="…">
3549
- <img src="2.jpg" alt="…">
3550
- </usa-stories>
3551
- ```
3552
-
3553
- ### <usa-story> — Story: before / after
3554
-
3555
- 5.4: <usa-story template="compare"> wipes from before to after as you scroll; the handle is draggable and a keyboard slider (←/→, Home/End). Full-page templates (pin, gallery, zoom) live on the Scroll stories page.
3556
-
3557
- - Import: `import { defineStory } from 'motionary/components/effects'; defineStory();`
3558
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3559
- - Attributes: `template`, `zoom`, `label`
3560
- - Events: `usa:step`
3561
-
3562
- ```html
3563
- <usa-story template="compare" label="2019 vs 2026">
3564
- <div data-sticky>
3565
- <img data-before src="before.jpg" alt="Before">
3566
- <img data-after src="after.jpg" alt="After">
3567
- </div>
3568
- </usa-story>
3569
- ```
3570
-
3571
- ### <usa-suggestion-chips> — Suggestion chips
3572
-
3573
- 7.8: follow-up prompt chips that slide in one after another; picking one pulses it and (with dismiss) the others fade away. Real buttons, arrow-key navigation.
3574
-
3575
- - Import: `import { defineSuggestionChips } from 'motionary/components/widgets'; defineSuggestionChips();`
3576
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3577
- - Attributes: `items`, `label`, `dismiss`
3578
- - Events: `usa:pick`
3579
- - Methods: `setItems()`
3580
-
3581
- ```html
3582
- <usa-suggestion-chips items="Summarise|Translate|Explain like I'm 5" dismiss></usa-suggestion-chips>
3583
- ```
3584
-
3585
- ### <usa-swipe-deck> — Swipe cards deck
3586
-
3587
- 6.8: drag the top card — it rotates with the pointer, LIKE / NOPE stamps fade in and past the threshold (or on a fling) it flies off; otherwise it springs back. like(), nope(), undo(), ← / →.
3588
-
3589
- - Import: `import { defineSwipeDeck } from 'motionary/components/widgets'; defineSwipeDeck();`
3590
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3591
- - Attributes: `label`, `threshold`
3592
- - Events: `usa:swipe`, `usa:empty`
3593
- - Methods: `like()`, `nope()`, `undo()`
3594
-
3595
- ```html
3596
- <usa-swipe-deck threshold="110" label="Matches">
3597
- <article>Ada</article>
3598
- <article>Linus</article>
3599
- <article>Grace</article>
3600
- </usa-swipe-deck>
3601
- ```
3602
-
3603
- ### <usa-swipeable> — Swipeable
3604
-
3605
- Swipe-to-dismiss and swipe actions: content follows the finger, flies out on a fast swipe or past the distance, otherwise springs home with your release velocity. Delete / arrow keys work too.
3606
-
3607
- - Import: `import { defineSwipeable } from 'motionary/components/gesture'; defineSwipeable();`
3608
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3609
- - Attributes: `axis`, `disabled`, `distance`, `dismiss`, `preset`
3610
- - Events: `usa:swipe`, `usa:dismiss`
3611
- - Methods: `swipe()`, `reset()`
3612
-
3613
- ```html
3614
- <usa-swipeable distance="120" dismiss>
3615
- <div class="card">Swipe me away</div>
3616
- </usa-swipeable>
3617
- ```
3618
-
3619
- ### <usa-switch> — Toggle switch variants
3620
-
3621
- 6.7: four switches — iOS (the thumb stretches while pressed), day / night (sun becomes moon, stars appear), bounce (squash at the end) and liquid (a gooey fill pours in). role="switch", forms, keyboard.
3622
-
3623
- - Import: `import { defineSwitch } from 'motionary/components/widgets'; defineSwitch();`
3624
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3625
- - Attributes: `variant`, `label`, `name`, `value`, `disabled`
3626
- - Events: `usa:change`
3627
- - Methods: `toggle()`
3628
-
3629
- ```html
3630
- <usa-switch variant="daynight" name="dark" label="Dark mode"></usa-switch>
3631
- ```
3632
-
3633
- ### <usa-tab-bar> — Tabs with animated indicator
3634
-
3635
- 6.2: the indicator stretches from the old tab to the new one (leading edge first) and the panel slides in from the side of travel. Pill, underline, glow or gooey; full tablist keyboard support.
3636
-
3637
- - Import: `import { defineTabBar } from 'motionary/components/widgets'; defineTabBar();`
3638
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3639
- - Attributes: `indicator`, `label`, `selected`
3640
- - Events: `usa:change`
3641
- - Methods: `select()`
3642
-
3643
- ```html
3644
- <usa-tab-bar indicator="pill">
3645
- <button>Overview</button>
3646
- <button>Specs</button>
3647
- <button>Reviews</button>
3648
- <div data-panel>…</div>
3649
- <div data-panel>…</div>
3650
- <div data-panel>…</div>
3651
- </usa-tab-bar>
3652
- ```
3653
-
3654
- ### <usa-tabs> — Tabs
3655
-
3656
- Accessible tabs whose indicator slides between tabs with a spring; panels slide in from the direction you moved. Line or pill indicator.
3657
-
3658
- - Import: `import { defineTabs } from 'motionary/components/ui'; defineTabs();`
3659
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3660
- - Attributes: `indicator`
3661
- - Events: `usa:change`
3662
- - Methods: `select()`
3663
-
3664
- ```html
3665
- <usa-tabs>
3666
- <nav><button data-tab>One</button><button data-tab>Two</button></nav>
3667
- <section data-panel>…</section>
3668
- <section data-panel>…</section>
3669
- </usa-tabs>
3670
- ```
3671
-
3672
- ### <usa-terminal> — Terminal window
3673
-
3674
- 8.2: a retro terminal window that types its commands after the prompt with a blinking block cursor and prints the output line by line when it scrolls into view — dark, green-phosphor or amber.
3675
-
3676
- - Import: `import { defineTerminal } from 'motionary/components/widgets'; defineTerminal();`
3677
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3678
- - Attributes: `title`, `prompt`, `theme`, `speed`, `loop`
3679
- - Events: `usa:done`
3680
- - Methods: `replay()`, `skip()`
3681
-
3682
- ```html
3683
- <usa-terminal title="zsh" theme="green">
3684
- <p data-cmd>npm i motionary</p>
3685
- <p>added 1 package in 2s</p>
3686
- </usa-terminal>
3687
- ```
3688
-
3689
- ### <usa-text-rotate> — Rotating words
3690
-
3691
- Cycles words in place — the box keeps the width of the longest word, so nothing around it reflows.
3692
-
3693
- - Import: `import { defineTextRotate } from 'motionary/components/text'; defineTextRotate();`
3694
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3695
- - Attributes: `words`, `interval`, `paused`, `effect`
3696
- - Events: `usa:change`
3697
- - Methods: `next()`
3698
-
3699
- ```html
3700
- Build <usa-text-rotate words="fast|tiny|typed"></usa-text-rotate> apps
3701
- ```
3702
-
3703
- ### <usa-text-splitter> — Text splitter
3704
-
3705
- 10.3: splits its text into characters, words or lines and animates them in with a stagger (rise, fade, blur, flip, wave) when it scrolls into view — accessible, grapheme-aware. Requires motionary/runtime/text — npm i motionary, then use(text) before it mounts.
3706
-
3707
- - Import: `import { defineTextSplitter } from 'motionary/components/widgets'; defineTextSplitter();`
3708
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3709
- - Attributes: `split`, `effect`, `stagger`, `duration`, `loop`, `trigger`
3710
- - Events: `usa:split`, `usa:done`, `usa:runtime-missing`
3711
- - Methods: `replay()`, `pieces()`
3712
- - Requires: motionary/runtime/text
3713
- - Install: `npm i motionary`
3714
- - Order: Register the core first, then the module: use(text) also registers the core. CDN: load runtime.iife.js, then runtime/text.iife.js (it registers itself).
3715
-
3716
- ```js
3717
- import { use } from 'motionary/runtime';
3718
- import { text } from 'motionary/runtime/text';
3719
- import { defineTextSplitter } from 'motionary/components/widgets';
3720
-
3721
- use(text);
3722
- defineTextSplitter(); // registers <usa-text-splitter> — after the prerequisites
3723
- ```
3724
-
3725
- ```html
3726
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime.iife.js"></script>
3727
- <script src="https://cdn.jsdelivr.net/npm/motionary@15/dist/runtime/text.iife.js"></script>
3728
- <!-- then the component bundles -->
3729
- <script src="https://unpkg.com/motionary@15/dist/components.umd.js"></script>
3730
- <script src="https://unpkg.com/motionary@15/dist/widgets.umd.js"></script>
3731
- ```
3732
-
3733
- ```html
3734
- <usa-text-splitter split="chars" effect="rise" stagger="30">Motion, made simple.</usa-text-splitter>
3735
- ```
3736
-
3737
- ### <usa-theme-surface> — Theme surface
3738
-
3739
- 8.6: a themeable card that follows the nearest theme — light, dark, neon (pulsing glow edge), glass (frosted backdrop with a sheen) or soft neumorphic relief — and cross-fades when the theme changes.
3740
-
3741
- - Import: `import { defineThemeSurface } from 'motionary/components/widgets'; defineThemeSurface();`
3742
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3743
- - Attributes: `theme`
3744
- - Events: `usa:theme`
3745
-
3746
- ```html
3747
- <usa-theme-surface theme="glass">
3748
- <h3>Frosted</h3><p>Content…</p>
3749
- </usa-theme-surface>
3750
- ```
3751
-
3752
- ### <usa-theme-switcher> — Theme switcher
3753
-
3754
- 8.6: a segmented switcher for the 8.6 theme system — light, dark, neon, glass and soft (neumorphism); a pill slides under the active option and the page change is revealed with a circular wipe from the click point.
3755
-
3756
- - Import: `import { defineThemeSwitcher } from 'motionary/components/widgets'; defineThemeSwitcher();`
3757
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3758
- - Attributes: `themes`, `target`, `label`, `persist`, `value`
3759
- - Events: `usa:change`
3760
-
3761
- ```html
3762
- <usa-theme-switcher themes="light,dark,neon,glass,neu" persist></usa-theme-switcher>
3763
- ```
3764
-
3765
- ### <usa-tilt> — 3D tilt card
3766
-
3767
- Tilts toward the pointer in 3D with an optional glare; exposes --usa-tilt-x/y for parallax layers inside.
3768
-
3769
- - Import: `import { defineTilt } from 'motionary/components/interaction'; defineTilt();`
3770
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3771
- - Attributes: `max`, `scale`, `perspective`, `glare`, `reverse`, `disabled`
3772
-
3773
- ```html
3774
- <usa-tilt glare max="12">
3775
- <div class="card">…</div>
3776
- </usa-tilt>
3777
- ```
3778
-
3779
- ### <usa-timeline> — Timeline
3780
-
3781
- Every data-tl child becomes a step in document order. data-at ('-=200', '<', 'label+=100') overlaps or aligns steps; scrub ties progress to scroll; trigger view / click / manual.
3782
-
3783
- - Import: `import { defineTimeline } from 'motionary/components/timeline'; defineTimeline();`
3784
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3785
- - Attributes: `scrub`, `trigger`, `overlap`, `duration`, `stagger`, `smooth`, `repeat`
3786
- - Events: `usa:complete`
3787
- - Methods: `play()`, `reverse()`, `seek()`
3788
-
3789
- ```html
3790
- <usa-timeline overlap="150">
3791
- <h2 data-tl="fade-up">Title</h2>
3792
- <p data-tl="blur">Subtitle</p>
3793
- <button data-tl="scale" data-at="<+=100">CTA</button>
3794
- </usa-timeline>
3795
- ```
3796
-
3797
- ### <usa-tip> — Tooltip / popover 2.0
3798
-
3799
- 6.6: springs out of its trigger with an arrow, flips to stay inside the viewport and shifts along the edge; hover + keyboard focus (Esc closes) or click popovers with rich content.
3800
-
3801
- - Import: `import { defineTip } from 'motionary/components/widgets'; defineTip();`
3802
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3803
- - Attributes: `text`, `placement`, `trigger`, `delay`
3804
- - Events: `usa:open`, `usa:close`
3805
- - Methods: `show()`, `hide()`
3806
-
3807
- ```html
3808
- <usa-tip text="Copied to clipboard" placement="top">
3809
- <button>Copy</button>
3810
- </usa-tip>
3811
- <usa-tip trigger="click" placement="bottom">
3812
- <button>Details</button>
3813
- <div slot="tip"><strong>Pro tip</strong> …</div>
3814
- </usa-tip>
3815
- ```
3816
-
3817
- ### <usa-toast-stack> — Toast stack
3818
-
3819
- 6.3: toasts pile up into a collapsed stack (newest in front, older ones peeking behind), fan out on hover or focus, auto-dismiss (paused while hovered) and swipe away. Six positions, a polite live region, stackToast() helper and data-usa-toast triggers.
3820
-
3821
- - Import: `import { defineToastStack } from 'motionary/components/widgets'; defineToastStack();`
3822
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3823
- - Attributes: `position`, `duration`, `max`
3824
- - Events: `usa:show`, `usa:dismiss`
3825
- - Methods: `show()`, `dismiss()`, `clear()`
3826
-
3827
- ```html
3828
- <button data-usa-toast="Saved to your library" data-usa-toast-type="success">Save</button>
3829
- <usa-toast-stack position="bottom-right" duration="4000" max="3"></usa-toast-stack>
3830
- <!-- or from JS: stackToast({ title: 'Done', message: 'Saved', type: 'success' }) -->
3831
- ```
3832
-
3833
- ### <usa-toaster> — Toasts
3834
-
3835
- toast("Saved") slides a notification in; it pauses on hover, stacks with FLIP and announces politely (errors assertively).
3836
-
3837
- - Import: `import { defineToaster } from 'motionary/components/feedback'; defineToaster();`
3838
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3839
- - Attributes: `label`, `position`, `max`
3840
- - Events: `usa:toast`
3841
- - Methods: `show()`, `clear()`
3842
-
3843
- ```html
3844
- <usa-toaster position="bottom-right"></usa-toaster>
3845
- <script type="module">
3846
- import { toast } from 'motionary/components/feedback';
3847
- toast('Saved', { type: 'success' });
3848
- </script>
3849
- ```
3850
-
3851
- ### <usa-token-editor> — Motion token editor (W3C DTCG)
3852
-
3853
- 10.6 (motion design tokens 2.0): edit duration and cubic-bézier easing tokens with a live preview per token, then export W3C Design Tokens (DTCG 2025.10 or the earlier draft) or import a DTCG file — aliases resolved, problems listed; apply writes the tokens to :root custom properties as you edit.
3854
-
3855
- - Import: `import { defineTokenEditor } from 'motionary/components/widgets'; defineTokenEditor();`
3856
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3857
- - Attributes: `apply`, `format`, `groups`, `label`
3858
- - Events: `usa:export`, `usa:import`, `usa:change`
3859
- - Methods: `exportJSON()`, `importJSON()`
3860
-
3861
- ```html
3862
- <usa-token-editor apply format="2025.10"></usa-token-editor>
3863
- ```
3864
-
3865
- ### <usa-typewriter> — Typewriter
3866
-
3867
- Types text, or cycles through phrases with delete and pause. Full text stays available to screen readers.
3868
-
3869
- - Import: `import { defineTypewriter } from 'motionary/components/text'; defineTypewriter();`
3870
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3871
- - Attributes: `text`, `words`, `start`, `speed`, `delete-speed`, `pause`, `loop`, `delay`
3872
- - Events: `usa:complete`
3873
- - Methods: `start()`, `stop()`, `restart()`
3874
-
3875
- ```html
3876
- <usa-typewriter words="Hello, Windows.|Hello, web." loop></usa-typewriter>
3877
- ```
3878
-
3879
- ### <usa-upload-progress> — Upload progress
3880
-
3881
- 7.7: a file row whose bar eases to value with a running shine; at 100 it turns into a check that draws itself, on error it shakes and offers Retry.
3882
-
3883
- - Import: `import { defineUploadProgress } from 'motionary/components/widgets'; defineUploadProgress();`
3884
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3885
- - Attributes: `name`, `size`, `value`, `status`, `message`
3886
- - Events: `usa:retry`, `usa:done`, `usa:error`
3887
-
3888
- ```html
3889
- <usa-upload-progress name="report.pdf" size="2400000" value="40"></usa-upload-progress>
3890
- <script>addEventListener('DOMContentLoaded', () => { const row = document.querySelector('usa-upload-progress'); row.value = 75; row.status = 'error'; });</script>
3891
- ```
3892
-
3893
- ### <usa-video-card> — Video card
3894
-
3895
- 9.4: a video thumbnail card — hover or focus plays a muted preview with a progress line, a play badge and a duration chip; without a video the poster drifts (Ken Burns).
3896
-
3897
- - Import: `import { defineVideoCard } from 'motionary/components/widgets'; defineVideoCard();`
3898
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3899
- - Attributes: `label`, `duration`
3900
- - Events: `usa:open`
3901
-
3902
- ```html
3903
- <usa-video-card duration="2:41">
3904
- <img src="poster.jpg" alt="">
3905
- <video src="preview.mp4" muted playsinline></video>
3906
- <h3>Making of Motionary</h3>
3907
- </usa-video-card>
3908
- ```
3909
-
3910
- ### <usa-view-switch> — View switch
3911
-
3912
- One view at a time with direction-aware slide, fade, scale or drill transitions — tabs, wizards, app pages.
3913
-
3914
- - Import: `import { defineViewSwitch } from 'motionary/components/transitions'; defineViewSwitch();`
3915
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3916
- - Attributes: `active`, `duration`, `effect`
3917
- - Events: `usa:change`
3918
- - Methods: `show()`
3919
-
3920
- ```html
3921
- <usa-view-switch active="home">
3922
- <section data-view="home">…</section>
3923
- <section data-view="about">…</section>
3924
- </usa-view-switch>
3925
- ```
3926
-
3927
- ### <usa-voice-button> — Voice button
3928
-
3929
- 7.8: a push-to-talk mic button — while listening a halo breathes and level bars wave; feed it live input levels with level (0–1) and they follow your voice.
3930
-
3931
- - Import: `import { defineVoiceButton } from 'motionary/components/widgets'; defineVoiceButton();`
3932
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3933
- - Attributes: `label`, `bars`, `listening`
3934
- - Methods: `toggle()`
3935
-
3936
- ```html
3937
- <usa-voice-button label="Talk to the assistant"></usa-voice-button>
3938
- <script>const vb = document.querySelector('usa-voice-button'); vb.addEventListener('usa:start', () => (vb.level = 0.6)); // feed vb.level (0–1) from your audio analyser</script>
3939
- ```
3940
-
3941
- ### <usa-volume-knob> — Volume knob
3942
-
3943
- 7.1: a rotary knob — drag up / down, scroll or use the keys; the value arc fills, a ring of LED ticks lights up and the pointer springs to the angle. role="slider".
3944
-
3945
- - Import: `import { defineVolumeKnob } from 'motionary/components/widgets'; defineVolumeKnob();`
3946
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3947
- - Attributes: `min`, `max`, `label`
3948
- - Events: `usa:change`, `usa:input`
3949
-
3950
- ```html
3951
- <usa-volume-knob value="60" label="Volume"></usa-volume-knob>
3952
- ```
3953
-
3954
- ### <usa-water-ripple> — Water ripple
3955
-
3956
- Interactive water ripples on a canvas over the content: move or tap to disturb the surface.
3957
-
3958
- - Import: `import { defineWaterRipple } from 'motionary/components/background'; defineWaterRipple();`
3959
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3960
- - Attributes: `damping`, `color`, `strength`
3961
- - Methods: `mount()`
3962
-
3963
- ```html
3964
- <usa-water-ripple>
3965
- <img src="lake.jpg" alt="">
3966
- </usa-water-ripple>
3967
- ```
3968
-
3969
- ### <usa-wave-text> — Wave text
3970
-
3971
- Letters bob in a travelling wave — playful headlines and loading labels.
3972
-
3973
- - Import: `import { defineWaveText } from 'motionary/components/text'; defineWaveText();`
3974
- - CDN: https://unpkg.com/motionary@15/dist/components.umd.js
3975
- - Attributes: `text`, `amplitude`, `speed`, `stagger`
3976
- - Methods: `mount()`, `splitChars()`
3977
-
3978
- ```html
3979
- <usa-wave-text>Loading…</usa-wave-text>
3980
- ```
3981
-
3982
- ### <usa-weather-card> — Animated weather card
3983
-
3984
- 6.8: sun rays turn, clouds drift, rain and snow fall, a flash-safe bolt glows, fog bands and stars — pick a condition and the scene cross-fades; the temperature counts up.
3985
-
3986
- - Import: `import { defineWeatherCard } from 'motionary/components/widgets'; defineWeatherCard();`
3987
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
3988
- - Attributes: `condition`, `temp`, `place`, `unit`, `label`
3989
-
3990
- ```html
3991
- <usa-weather-card condition="rain" temp="12" place="Lisbon"></usa-weather-card>
3992
- ```
3993
-
3994
- ### <usa-worker-canvas> — Worker canvas
3995
-
3996
- 9.6: a canvas animation rendered in a Web Worker on an OffscreenCanvas — the main thread stays free for input — with a main-thread fallback; particles, orbits, starfield or your own draw program.
3997
-
3998
- - Import: `import { defineWorkerCanvas } from 'motionary/components/widgets'; defineWorkerCanvas();`
3999
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
4000
- - Attributes: `scene`, `label`
4001
- - Events: `usa:backend`
4002
-
4003
- ```html
4004
- <usa-worker-canvas scene="starfield" style="height:240px"></usa-worker-canvas>
4005
- ```
4006
-
4007
- ### <usa-xp-bar> — XP bar
4008
-
4009
- 7.5: an experience bar — add(n) fills it smoothly; overflowing fills to the end, the level badge pops and the bar restarts with the remainder (several levels if needed).
4010
-
4011
- - Import: `import { defineXpBar } from 'motionary/components/widgets'; defineXpBar();`
4012
- - CDN: https://unpkg.com/motionary@15/dist/widgets.umd.js
4013
- - Attributes: `level`, `xp`, `per`
4014
- - Events: `usa:levelup`, `usa:xp`
4015
- - Methods: `add()`
4016
-
4017
- ```html
4018
- <usa-xp-bar level="3" xp="40" per="100"></usa-xp-bar>
4019
- <!-- +75 XP → level 4, 15 XP -->
4020
- <script>addEventListener('DOMContentLoaded', () => document.querySelector('usa-xp-bar').add(75));</script>
4021
- ```