motionary 0.0.0-stage → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +803 -0
- package/LICENSE +21 -0
- package/README.md +218 -2
- package/README_ja.md +219 -0
- package/README_zh.md +219 -0
- package/bin/usa-codemod-5.mjs +79 -0
- package/bin/usa-codemod-6.mjs +146 -0
- package/dist/chunks/base-BaQV-2ha.cjs +436 -0
- package/dist/chunks/base-BaQV-2ha.cjs.map +1 -0
- package/dist/chunks/base-C_3cAoRz.js +404 -0
- package/dist/chunks/base-C_3cAoRz.js.map +1 -0
- package/dist/chunks/bind-B_CTL6Qn.js +22 -0
- package/dist/chunks/bind-B_CTL6Qn.js.map +1 -0
- package/dist/chunks/bind-Ui43-n2d.cjs +25 -0
- package/dist/chunks/bind-Ui43-n2d.cjs.map +1 -0
- package/dist/chunks/core-B5T0dhFH.cjs +920 -0
- package/dist/chunks/core-B5T0dhFH.cjs.map +1 -0
- package/dist/chunks/core-BGAyaY6L.cjs +265 -0
- package/dist/chunks/core-BGAyaY6L.cjs.map +1 -0
- package/dist/chunks/core-D7cVumUu.js +909 -0
- package/dist/chunks/core-D7cVumUu.js.map +1 -0
- package/dist/chunks/core-VEBw36QK.js +260 -0
- package/dist/chunks/core-VEBw36QK.js.map +1 -0
- package/dist/chunks/core-ps8uvYuN.js +181 -0
- package/dist/chunks/core-ps8uvYuN.js.map +1 -0
- package/dist/chunks/core-zq17EeCI.cjs +185 -0
- package/dist/chunks/core-zq17EeCI.cjs.map +1 -0
- package/dist/chunks/fx-Bs6IrV4Q.js +109 -0
- package/dist/chunks/fx-Bs6IrV4Q.js.map +1 -0
- package/dist/chunks/fx-lBGVtQO1.cjs +114 -0
- package/dist/chunks/fx-lBGVtQO1.cjs.map +1 -0
- package/dist/chunks/generative-D2YyhaeO.js +336 -0
- package/dist/chunks/generative-D2YyhaeO.js.map +1 -0
- package/dist/chunks/generative-DzIZq-_g.cjs +348 -0
- package/dist/chunks/generative-DzIZq-_g.cjs.map +1 -0
- package/dist/chunks/gpu-Bu7qwugO.js +380 -0
- package/dist/chunks/gpu-Bu7qwugO.js.map +1 -0
- package/dist/chunks/gpu-CenK2l6b.cjs +387 -0
- package/dist/chunks/gpu-CenK2l6b.cjs.map +1 -0
- package/dist/chunks/index-tags-DucKMQr_.js +26 -0
- package/dist/chunks/index-tags-DucKMQr_.js.map +1 -0
- package/dist/chunks/index-tags-wv0R_vkO.cjs +28 -0
- package/dist/chunks/index-tags-wv0R_vkO.cjs.map +1 -0
- package/dist/chunks/presets-BYBVJVeP.js +226 -0
- package/dist/chunks/presets-BYBVJVeP.js.map +1 -0
- package/dist/chunks/presets-CUHys3sK.cjs +233 -0
- package/dist/chunks/presets-CUHys3sK.cjs.map +1 -0
- package/dist/chunks/registry-CKNLQpwd.js +121 -0
- package/dist/chunks/registry-CKNLQpwd.js.map +1 -0
- package/dist/chunks/registry-DehBVRDV.cjs +131 -0
- package/dist/chunks/registry-DehBVRDV.cjs.map +1 -0
- package/dist/chunks/spring-CbvHfVtP.js +219 -0
- package/dist/chunks/spring-CbvHfVtP.js.map +1 -0
- package/dist/chunks/spring-Dgx187Vh.cjs +232 -0
- package/dist/chunks/spring-Dgx187Vh.cjs.map +1 -0
- package/dist/chunks/stagger-CCFyhzSw.cjs +86 -0
- package/dist/chunks/stagger-CCFyhzSw.cjs.map +1 -0
- package/dist/chunks/stagger-DtMKo2SK.js +84 -0
- package/dist/chunks/stagger-DtMKo2SK.js.map +1 -0
- package/dist/chunks/variants-BhjyddG8.cjs +39 -0
- package/dist/chunks/variants-BhjyddG8.cjs.map +1 -0
- package/dist/chunks/variants-DRlKVHvu.js +35 -0
- package/dist/chunks/variants-DRlKVHvu.js.map +1 -0
- package/dist/components/a11y.cjs +276 -0
- package/dist/components/a11y.cjs.map +1 -0
- package/dist/components/a11y.d.cts +131 -0
- package/dist/components/a11y.d.ts +131 -0
- package/dist/components/a11y.js +259 -0
- package/dist/components/a11y.js.map +1 -0
- package/dist/components/angular.cjs +76 -0
- package/dist/components/angular.cjs.map +1 -0
- package/dist/components/angular.d.cts +1734 -0
- package/dist/components/angular.d.ts +1734 -0
- package/dist/components/angular.js +70 -0
- package/dist/components/angular.js.map +1 -0
- package/dist/components/background.cjs +659 -0
- package/dist/components/background.cjs.map +1 -0
- package/dist/components/background.css +9 -0
- package/dist/components/background.d.cts +166 -0
- package/dist/components/background.d.ts +166 -0
- package/dist/components/background.js +647 -0
- package/dist/components/background.js.map +1 -0
- package/dist/components/bridge.cjs +154 -0
- package/dist/components/bridge.cjs.map +1 -0
- package/dist/components/bridge.d.cts +63 -0
- package/dist/components/bridge.d.ts +63 -0
- package/dist/components/bridge.js +147 -0
- package/dist/components/bridge.js.map +1 -0
- package/dist/components/cards.cjs +561 -0
- package/dist/components/cards.cjs.map +1 -0
- package/dist/components/cards.css +6 -0
- package/dist/components/cards.d.cts +115 -0
- package/dist/components/cards.d.ts +115 -0
- package/dist/components/cards.js +554 -0
- package/dist/components/cards.js.map +1 -0
- package/dist/components/click.cjs +877 -0
- package/dist/components/click.cjs.map +1 -0
- package/dist/components/click.css +9 -0
- package/dist/components/click.d.cts +218 -0
- package/dist/components/click.d.ts +218 -0
- package/dist/components/click.js +863 -0
- package/dist/components/click.js.map +1 -0
- package/dist/components/depth.cjs +250 -0
- package/dist/components/depth.cjs.map +1 -0
- package/dist/components/depth.css +3 -0
- package/dist/components/depth.d.cts +86 -0
- package/dist/components/depth.d.ts +86 -0
- package/dist/components/depth.js +242 -0
- package/dist/components/depth.js.map +1 -0
- package/dist/components/effects.cjs +2258 -0
- package/dist/components/effects.cjs.map +1 -0
- package/dist/components/effects.d.cts +545 -0
- package/dist/components/effects.d.ts +545 -0
- package/dist/components/effects.js +2200 -0
- package/dist/components/effects.js.map +1 -0
- package/dist/components/feedback.cjs +442 -0
- package/dist/components/feedback.cjs.map +1 -0
- package/dist/components/feedback.css +7 -0
- package/dist/components/feedback.d.cts +144 -0
- package/dist/components/feedback.d.ts +144 -0
- package/dist/components/feedback.js +433 -0
- package/dist/components/feedback.js.map +1 -0
- package/dist/components/fx-gpu.cjs +12 -0
- package/dist/components/fx-gpu.cjs.map +1 -0
- package/dist/components/fx-gpu.d.cts +63 -0
- package/dist/components/fx-gpu.d.ts +63 -0
- package/dist/components/fx-gpu.js +5 -0
- package/dist/components/fx-gpu.js.map +1 -0
- package/dist/components/fx.cjs +169 -0
- package/dist/components/fx.cjs.map +1 -0
- package/dist/components/fx.css +3 -0
- package/dist/components/fx.d.cts +114 -0
- package/dist/components/fx.d.ts +114 -0
- package/dist/components/fx.js +156 -0
- package/dist/components/fx.js.map +1 -0
- package/dist/components/fx2.cjs +25 -0
- package/dist/components/fx2.cjs.map +1 -0
- package/dist/components/fx2.d.cts +136 -0
- package/dist/components/fx2.d.ts +136 -0
- package/dist/components/fx2.js +17 -0
- package/dist/components/fx2.js.map +1 -0
- package/dist/components/gesture.cjs +209 -0
- package/dist/components/gesture.cjs.map +1 -0
- package/dist/components/gesture.css +3 -0
- package/dist/components/gesture.d.cts +134 -0
- package/dist/components/gesture.d.ts +134 -0
- package/dist/components/gesture.js +203 -0
- package/dist/components/gesture.js.map +1 -0
- package/dist/components/interaction.cjs +424 -0
- package/dist/components/interaction.cjs.map +1 -0
- package/dist/components/interaction.css +8 -0
- package/dist/components/interaction.d.cts +115 -0
- package/dist/components/interaction.d.ts +115 -0
- package/dist/components/interaction.js +416 -0
- package/dist/components/interaction.js.map +1 -0
- package/dist/components/jsx.cjs +3 -0
- package/dist/components/jsx.cjs.map +1 -0
- package/dist/components/jsx.d.cts +53 -0
- package/dist/components/jsx.d.ts +53 -0
- package/dist/components/jsx.js +2 -0
- package/dist/components/jsx.js.map +1 -0
- package/dist/components/layout.cjs +257 -0
- package/dist/components/layout.cjs.map +1 -0
- package/dist/components/layout.css +3 -0
- package/dist/components/layout.d.cts +99 -0
- package/dist/components/layout.d.ts +99 -0
- package/dist/components/layout.js +249 -0
- package/dist/components/layout.js.map +1 -0
- package/dist/components/lazy.cjs +92 -0
- package/dist/components/lazy.cjs.map +1 -0
- package/dist/components/lazy.d.cts +48 -0
- package/dist/components/lazy.d.ts +48 -0
- package/dist/components/lazy.js +87 -0
- package/dist/components/lazy.js.map +1 -0
- package/dist/components/lite.cjs +11095 -0
- package/dist/components/lite.cjs.map +1 -0
- package/dist/components/lite.d.cts +4 -0
- package/dist/components/lite.d.ts +4 -0
- package/dist/components/lite.js +10827 -0
- package/dist/components/lite.js.map +1 -0
- package/dist/components/packs.cjs +192 -0
- package/dist/components/packs.cjs.map +1 -0
- package/dist/components/packs.css +3 -0
- package/dist/components/packs.d.cts +72 -0
- package/dist/components/packs.d.ts +72 -0
- package/dist/components/packs.js +184 -0
- package/dist/components/packs.js.map +1 -0
- package/dist/components/page.cjs +824 -0
- package/dist/components/page.cjs.map +1 -0
- package/dist/components/page.css +11 -0
- package/dist/components/page.d.cts +249 -0
- package/dist/components/page.d.ts +249 -0
- package/dist/components/page.js +799 -0
- package/dist/components/page.js.map +1 -0
- package/dist/components/perf.cjs +120 -0
- package/dist/components/perf.cjs.map +1 -0
- package/dist/components/perf.d.cts +98 -0
- package/dist/components/perf.d.ts +98 -0
- package/dist/components/perf.js +110 -0
- package/dist/components/perf.js.map +1 -0
- package/dist/components/physics.cjs +448 -0
- package/dist/components/physics.cjs.map +1 -0
- package/dist/components/physics.css +5 -0
- package/dist/components/physics.d.cts +189 -0
- package/dist/components/physics.d.ts +189 -0
- package/dist/components/physics.js +430 -0
- package/dist/components/physics.js.map +1 -0
- package/dist/components/react.cjs +96 -0
- package/dist/components/react.cjs.map +1 -0
- package/dist/components/react.d.cts +18 -0
- package/dist/components/react.d.ts +18 -0
- package/dist/components/react.js +91 -0
- package/dist/components/react.js.map +1 -0
- package/dist/components/reveal.cjs +362 -0
- package/dist/components/reveal.cjs.map +1 -0
- package/dist/components/reveal.css +5 -0
- package/dist/components/reveal.d.cts +105 -0
- package/dist/components/reveal.d.ts +105 -0
- package/dist/components/reveal.js +353 -0
- package/dist/components/reveal.js.map +1 -0
- package/dist/components/solid.cjs +86 -0
- package/dist/components/solid.cjs.map +1 -0
- package/dist/components/solid.d.cts +1751 -0
- package/dist/components/solid.d.ts +1751 -0
- package/dist/components/solid.js +82 -0
- package/dist/components/solid.js.map +1 -0
- package/dist/components/svelte.cjs +68 -0
- package/dist/components/svelte.cjs.map +1 -0
- package/dist/components/svelte.d.cts +1733 -0
- package/dist/components/svelte.d.ts +1733 -0
- package/dist/components/svelte.js +64 -0
- package/dist/components/svelte.js.map +1 -0
- package/dist/components/svg.cjs +359 -0
- package/dist/components/svg.cjs.map +1 -0
- package/dist/components/svg.css +3 -0
- package/dist/components/svg.d.cts +113 -0
- package/dist/components/svg.d.ts +113 -0
- package/dist/components/svg.js +347 -0
- package/dist/components/svg.js.map +1 -0
- package/dist/components/text.cjs +968 -0
- package/dist/components/text.cjs.map +1 -0
- package/dist/components/text.css +8 -0
- package/dist/components/text.d.cts +342 -0
- package/dist/components/text.d.ts +342 -0
- package/dist/components/text.js +947 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/timeline.cjs +109 -0
- package/dist/components/timeline.cjs.map +1 -0
- package/dist/components/timeline.css +3 -0
- package/dist/components/timeline.d.cts +155 -0
- package/dist/components/timeline.d.ts +155 -0
- package/dist/components/timeline.js +103 -0
- package/dist/components/timeline.js.map +1 -0
- package/dist/components/tokens.cjs +226 -0
- package/dist/components/tokens.cjs.map +1 -0
- package/dist/components/tokens.d.cts +74 -0
- package/dist/components/tokens.d.ts +74 -0
- package/dist/components/tokens.js +211 -0
- package/dist/components/tokens.js.map +1 -0
- package/dist/components/transitions.cjs +430 -0
- package/dist/components/transitions.cjs.map +1 -0
- package/dist/components/transitions.css +5 -0
- package/dist/components/transitions.d.cts +126 -0
- package/dist/components/transitions.d.ts +126 -0
- package/dist/components/transitions.js +423 -0
- package/dist/components/transitions.js.map +1 -0
- package/dist/components/ui.cjs +1050 -0
- package/dist/components/ui.cjs.map +1 -0
- package/dist/components/ui.css +14 -0
- package/dist/components/ui.d.cts +224 -0
- package/dist/components/ui.d.ts +224 -0
- package/dist/components/ui.js +1034 -0
- package/dist/components/ui.js.map +1 -0
- package/dist/components/vue.cjs +67 -0
- package/dist/components/vue.cjs.map +1 -0
- package/dist/components/vue.d.cts +1722 -0
- package/dist/components/vue.d.ts +1722 -0
- package/dist/components/vue.js +64 -0
- package/dist/components/vue.js.map +1 -0
- package/dist/components/webgl.cjs +459 -0
- package/dist/components/webgl.cjs.map +1 -0
- package/dist/components/webgl.css +3 -0
- package/dist/components/webgl.d.cts +133 -0
- package/dist/components/webgl.d.ts +133 -0
- package/dist/components/webgl.js +442 -0
- package/dist/components/webgl.js.map +1 -0
- package/dist/components/widgets.cjs +591 -0
- package/dist/components/widgets.cjs.map +1 -0
- package/dist/components/widgets.d.cts +110 -0
- package/dist/components/widgets.d.ts +110 -0
- package/dist/components/widgets.js +581 -0
- package/dist/components/widgets.js.map +1 -0
- package/dist/components.cjs +351 -0
- package/dist/components.cjs.map +1 -0
- package/dist/components.css +75 -0
- package/dist/components.d.cts +2997 -0
- package/dist/components.d.ts +2997 -0
- package/dist/components.js +106 -0
- package/dist/components.js.map +1 -0
- package/dist/components.umd.js +23 -0
- package/dist/components.umd.js.map +1 -0
- package/dist/element.cjs +97 -0
- package/dist/element.cjs.map +1 -0
- package/dist/element.d.cts +215 -0
- package/dist/element.d.ts +215 -0
- package/dist/element.js +95 -0
- package/dist/element.js.map +1 -0
- package/dist/element.umd.js +2 -0
- package/dist/element.umd.js.map +1 -0
- package/dist/index.cjs +149 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +425 -0
- package/dist/index.d.ts +425 -0
- package/dist/index.js +131 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +15 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/presets/extended.cjs +243 -0
- package/dist/presets/extended.cjs.map +1 -0
- package/dist/presets/extended.d.cts +37 -0
- package/dist/presets/extended.d.ts +37 -0
- package/dist/presets/extended.js +239 -0
- package/dist/presets/extended.js.map +1 -0
- package/dist/presets-extended.umd.js +2 -0
- package/dist/presets-extended.umd.js.map +1 -0
- package/dist/react.cjs +68 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +158 -0
- package/dist/react.d.ts +158 -0
- package/dist/react.js +65 -0
- package/dist/react.js.map +1 -0
- package/dist/solid.cjs +93 -0
- package/dist/solid.cjs.map +1 -0
- package/dist/solid.d.cts +249 -0
- package/dist/solid.d.ts +249 -0
- package/dist/solid.js +89 -0
- package/dist/solid.js.map +1 -0
- package/dist/svelte.cjs +66 -0
- package/dist/svelte.cjs.map +1 -0
- package/dist/svelte.d.cts +243 -0
- package/dist/svelte.d.ts +243 -0
- package/dist/svelte.js +63 -0
- package/dist/svelte.js.map +1 -0
- package/dist/vue.cjs +62 -0
- package/dist/vue.cjs.map +1 -0
- package/dist/vue.d.cts +158 -0
- package/dist/vue.d.ts +158 -0
- package/dist/vue.js +60 -0
- package/dist/vue.js.map +1 -0
- package/dist/widgets.umd.js +2 -0
- package/dist/widgets.umd.js.map +1 -0
- package/docs/API.md +147 -0
- package/docs/ROADMAP.md +14 -0
- package/docs/accessibility.md +60 -0
- package/docs/components.md +564 -0
- package/docs/deprecations.md +30 -0
- package/docs/frameworks-ssr.md +100 -0
- package/docs/hybrid-apps.md +145 -0
- package/docs/images/showcase-detail.png +0 -0
- package/docs/images/showcase-grid.png +0 -0
- package/docs/images/showcase-mobile.png +0 -0
- package/docs/migration-from-aos.md +67 -0
- package/docs/migration-from-gsap-scrolltrigger.md +80 -0
- package/docs/motion-tokens.css +31 -0
- package/docs/motion-tokens.md +46 -0
- package/docs/motion.tokens.json +132 -0
- package/docs/performance.md +24 -0
- package/docs/presets.md +310 -0
- package/docs/upgrading-3.md +21 -0
- package/docs/upgrading-4.md +65 -0
- package/docs/upgrading-5.md +31 -0
- package/docs/upgrading-6.md +32 -0
- package/docs/windows-apps.md +119 -0
- package/package.json +562 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,219 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# Motionary
|
|
4
|
+
|
|
5
|
+
**Scroll animations and animated Web Components for the modern web — 214 scroll presets, 90 effects, zero dependencies.**
|
|
6
|
+
|
|
7
|
+
_Formerly **use-scroll-animate** — same API, same `<usa-*>` tags; the old npm package keeps working as an alias._
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/motionary) [](https://github.com/HarrisonCN/motionary/actions/workflows/ci.yml) [](./LICENSE)
|
|
10
|
+
|
|
11
|
+
[English](./README.md) | [简体中文](./README_zh.md) | [日本語](./README_ja.md)
|
|
12
|
+
|
|
13
|
+
**[🛍 Animation Store](https://harrisoncn.github.io/motionary/showcase/)** · **[🧩 Components](https://harrisoncn.github.io/motionary/showcase/components.html)** · **[🎛 Playground](https://harrisoncn.github.io/motionary/showcase/playground.html)** · **[📜 Story](https://harrisoncn.github.io/motionary/showcase/story.html)**
|
|
14
|
+
|
|
15
|
+
<sub>The Store lets you preview, tweak and copy all <b>227</b> animations — 214 scroll presets plus card, click, physics and page effects — at desktop and phone sizes.</sub>
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
Motionary reveals content as it scrolls into view (IntersectionObserver + Web Animations, or the browser's native scroll timeline) and ships 94 animated custom elements — cards, buttons, physics, page transitions, backgrounds, WebGL and more — that work in any framework, in plain HTML and in desktop web-view apps (Electron, Tauri, WebView2). Everything respects `prefers-reduced-motion`.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm i motionary
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<!-- CDN (no build) -->
|
|
29
|
+
<script src="https://unpkg.com/motionary@6/dist/index.umd.js"></script> <!-- window.ScrollAnimate -->
|
|
30
|
+
<script src="https://unpkg.com/motionary@6/dist/presets-extended.umd.js"></script> <!-- +181 presets -->
|
|
31
|
+
<script src="https://unpkg.com/motionary@6/dist/components.umd.js"></script> <!-- every <usa-*>, window.UsaComponents -->
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
jsDelivr works too: `https://cdn.jsdelivr.net/npm/motionary@6/dist/…`. Existing `use-scroll-animate` installs and `unpkg.com/use-scroll-animate@6` URLs keep working.
|
|
35
|
+
|
|
36
|
+
## 30-second quickstart
|
|
37
|
+
|
|
38
|
+
Mark elements with `data-sa` and pick a preset with `data-sa-animation` (every option has a `data-sa-*` attribute), or use the JS API:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<!-- 1. HTML only: data attributes + one init() call -->
|
|
42
|
+
<h2 data-sa data-sa-animation="fade-in-up">Hello</h2>
|
|
43
|
+
<div data-sa data-sa-animation="bounce-in-up" data-sa-delay="150">Card</div>
|
|
44
|
+
<script type="module">
|
|
45
|
+
import ScrollAnimate from 'motionary';
|
|
46
|
+
import 'motionary/presets/extended'; // optional: +181 presets (bounce-in-up, clip-diamond, …)
|
|
47
|
+
ScrollAnimate.init(); // picks up every [data-sa]
|
|
48
|
+
</script>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
// 2. JS API
|
|
53
|
+
import ScrollAnimate, { staggerChildren, parallax, timeline } from 'motionary';
|
|
54
|
+
|
|
55
|
+
ScrollAnimate.observe('.card', { animation: 'zoom-in-up', duration: 800, easing: 'spring' });
|
|
56
|
+
staggerChildren(document.querySelector('.grid'), { animation: 'stagger-pop', stagger: 60 });
|
|
57
|
+
parallax('.hero-bg', { speed: 0.3 });
|
|
58
|
+
ScrollAnimate.observe('.logo', { animation: 'scrub-spin', engine: 'css', viewRange: ['cover 0%', 'cover 100%'] });
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Frameworks — each adapter is its own entry point and cleans up on unmount:
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
// React
|
|
65
|
+
import React from 'react';
|
|
66
|
+
import { createReactHooks } from 'motionary/react';
|
|
67
|
+
const { useScrollAnimate } = createReactHooks(React);
|
|
68
|
+
|
|
69
|
+
export function Card() {
|
|
70
|
+
const ref = useScrollAnimate({ animation: 'fade-in-up' });
|
|
71
|
+
return <div ref={ref}>Hello</div>;
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<!-- Vue 3 -->
|
|
77
|
+
<script setup>
|
|
78
|
+
import { ref, onMounted, onUnmounted } from 'vue';
|
|
79
|
+
import { createVueComposables } from 'motionary/vue';
|
|
80
|
+
const { useScrollAnimate } = createVueComposables({ ref, onMounted, onUnmounted });
|
|
81
|
+
const { animateRef } = useScrollAnimate({ animation: 'zoom-in' });
|
|
82
|
+
</script>
|
|
83
|
+
<template><div ref="animateRef">Hello</div></template>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```svelte
|
|
87
|
+
<!-- Svelte 3–5 -->
|
|
88
|
+
<script>
|
|
89
|
+
import { scrollAnimate } from 'motionary/svelte';
|
|
90
|
+
</script>
|
|
91
|
+
<div use:scrollAnimate={{ animation: 'flip-up' }}>Hello</div>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```jsx
|
|
95
|
+
// Solid
|
|
96
|
+
import { scrollAnimate } from 'motionary/solid';
|
|
97
|
+
scrollAnimate; // keep the directive import (TypeScript)
|
|
98
|
+
export const Card = () => <div use:scrollAnimate={{ animation: 'blur-in-up' }}>Hello</div>;
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
// Angular (standalone) — the animated Web Components
|
|
103
|
+
import { APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
|
|
104
|
+
import { usaInitializer } from 'motionary/components/angular';
|
|
105
|
+
import 'motionary/presets/extended'; // lets <usa-reveal effect> use every preset name
|
|
106
|
+
// app.config.ts: providers: [{ provide: APP_INITIALIZER, multi: true, useFactory: usaInitializer() }]
|
|
107
|
+
@Component({ standalone: true, schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
108
|
+
template: `<usa-reveal effect="bounce-in-up"><h2>Hello</h2></usa-reveal>` })
|
|
109
|
+
export class Hero {}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Animated components need no framework at all:
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<script type="module">
|
|
116
|
+
import { defineComponents } from 'motionary/components';
|
|
117
|
+
defineComponents(); // or lazyDefine() from 'motionary/components/lazy'
|
|
118
|
+
</script>
|
|
119
|
+
<usa-card effect="holo">…</usa-card>
|
|
120
|
+
<usa-button deform="gooey">Buy</usa-button>
|
|
121
|
+
<usa-fx effect="confetti" trigger="click"><button>Celebrate</button></usa-fx>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## What's inside
|
|
125
|
+
|
|
126
|
+
| Area | What you get |
|
|
127
|
+
|---|---|
|
|
128
|
+
| **Scroll presets** | **214** reveal presets (33 core + 181 in `motionary/presets/extended`) in 14 families — fades, zooms, 3D flips & doors, overshoot slides, clip-path shapes, blur & mask, bounce & elastic, colour & light, depth, glitch / typewriter, stagger-ready and scroll-linked `scrub-*`; plus `timeline()` with 10 timeline presets |
|
|
129
|
+
| **Cards, clicks & button morphs** | `<usa-card>` with 10 effects (flip, holo, glass, border glow, …), stacks & 3D carousel; 7 click components with 4 button deforms (squash · wobble · gooey · dent) and icon morphs; 12 registered card / click effects (holo, book-open, shockwave, ink-splash, emoji-rain, …) |
|
|
130
|
+
| **Physics & bounce** | `<usa-spring>`, `<usa-draggable>` (spring-back · inertia · snap), `<usa-overscroll>`; `spring()` / `solveSpring()` with 7 spring presets; 7 physics effects (bounce-in, rubber-band, gravity-text, bell-swing, …) |
|
|
131
|
+
| **Page transitions** | `pageTransition()`, `viewTransition()`, `sharedTransition()`, `flip()`, MPA transitions; 7 page effects (curtain, iris, pixel-dissolve, blinds, velocity-skew, …); `<usa-dialog>`, `<usa-view-switch>` |
|
|
132
|
+
| **Generative backgrounds** | 6 canvas backgrounds (flow-field, voronoi, mesh-gradient, starfield, metaballs, contours) + 9 background elements (aurora, particles, grain, blobs, water ripple, Acrylic / Mica, …) |
|
|
133
|
+
| **Sound-reactive** | `<usa-audio>` + Web Audio beat detection (`createBeatDetector()`, `onBeat()`); 3 audio visualisers (spectrum-bars, pulse-ring, wave-ring); any effect can fire on the beat |
|
|
134
|
+
| **Cursor & gestures** | 5 cursor effects (comet / ribbon / sparkle trails, magnetic dots, spotlight) + `<usa-cursor>`; fling · twist · long-press → effects with `<usa-gesture-fx>`; `<usa-swipeable>`, `<usa-pinch-zoom>` |
|
|
135
|
+
| **Themes** | 5 theme packs (neon · paper · glass · retro · brutalist) via `<usa-theme>` / `applyTheme()`, each with a signature effect; motion tokens (`/components/tokens`) |
|
|
136
|
+
| **Micro-interactions** | 23 ready-made UI moments: copy-success, like-heart, add-to-cart, send-plane, upvote, trash-shake, input-shake, success-check, notify-badge, … |
|
|
137
|
+
| **`<usa-player>` & stories** | `<usa-player>` plays JSON animations (keyframe tracks, presets, effects; load / view / scroll / click triggers) exported from the Playground; `<usa-story>` with 6 scroll-story templates |
|
|
138
|
+
| **WebGL** | `<usa-shader>`, `<usa-distort>`, `<usa-liquid>`, `<usa-post-fx>` — 5 particle presets, 9 post effects (bloom, CRT, chromatic, glitch, …) with CSS fallbacks and a power-saving governor |
|
|
139
|
+
|
|
140
|
+
90 effects share one registry (`registerEffect()` / `playEffect()` / `bindEffect()` / `<usa-fx>`, `motionary/components/fx`); the 5.x packs live in `motionary/components/effects`.
|
|
141
|
+
|
|
142
|
+
### All 94 animated components
|
|
143
|
+
|
|
144
|
+
Import one category (`motionary/components/cards`), everything (`motionary/components`), the CSS-on-demand build (`/components/lite`), or let `lazyDefine()` load only the tags on the page. Wrappers: `/components/react`, `/vue`, `/svelte`, `/solid`, `/angular`.
|
|
145
|
+
|
|
146
|
+
| Entry | Elements |
|
|
147
|
+
|---|---|
|
|
148
|
+
| **Scroll reveal** (`/components/reveal`) | `<usa-reveal>` · `<usa-stagger>` · `<usa-scroll-progress>` · `<usa-scrolly>` |
|
|
149
|
+
| **Text** (`/components/text`) | `<usa-typewriter>` · `<usa-split-text>` · `<usa-scramble>` · `<usa-counter>` · `<usa-shimmer-text>` · `<usa-text-rotate>` · `<usa-wave-text>` · `<usa-glitch>` · `<usa-gradient-text>` · `<usa-handwriting>` · `<usa-scroll-highlight>` |
|
|
150
|
+
| **Interaction** (`/components/interaction`) | `<usa-ripple>` · `<usa-magnetic>` · `<usa-tilt>` · `<usa-spotlight>` · `<usa-press>` · `<usa-toggle>` |
|
|
151
|
+
| **Feedback** (`/components/feedback`) | `<usa-spinner>` · `<usa-skeleton>` · `<usa-progress>` · `<usa-toaster>` · `<usa-check>` |
|
|
152
|
+
| **Backgrounds** (`/components/background`) | `<usa-aurora>` · `<usa-particles>` · `<usa-grain>` · `<usa-marquee>` · `<usa-acrylic>` · `<usa-grid-glow>` · `<usa-blobs>` · `<usa-water-ripple>` · `<usa-dot-network>` |
|
|
153
|
+
| **Transitions** (`/components/transitions`) | `<usa-dialog>` · `<usa-accordion>` · `<usa-view-switch>` |
|
|
154
|
+
| **Spring & physics** (`/components/physics`) | `<usa-spring>` · `<usa-draggable>` · `<usa-overscroll>` |
|
|
155
|
+
| **Cards** (`/components/cards`) | `<usa-card>` · `<usa-card-stack>` · `<usa-sticky-stack>` · `<usa-carousel-3d>` |
|
|
156
|
+
| **Click & buttons** (`/components/click`) | `<usa-click>` · `<usa-button>` · `<usa-icon-morph>` · `<usa-like>` · `<usa-hold>` · `<usa-double-tap>` · `<usa-checkbox>` |
|
|
157
|
+
| **UI kit** (`/components/ui`) | `<usa-tabs>` · `<usa-drawer>` · `<usa-bottom-sheet>` · `<usa-pull-refresh>` · `<usa-fab>` · `<usa-navbar>` · `<usa-slider>` · `<usa-rating>` · `<usa-tooltip>` · `<usa-popover>` · `<usa-badge>` · `<usa-avatar-stack>` |
|
|
158
|
+
| **Page-wide** (`/components/page`) | `<usa-cursor>` · `<usa-fullpage>` · `<usa-loading-bar>` · `<usa-back-to-top>` · `<usa-ambient>` · `<usa-splash>` · `<usa-auto-skeleton>` · `<usa-motion-switch>` |
|
|
159
|
+
| **Timeline** (`/components/timeline`) | `<usa-timeline>` |
|
|
160
|
+
| **Gestures** (`/components/gesture`) | `<usa-swipeable>` · `<usa-pinch-zoom>` |
|
|
161
|
+
| **SVG** (`/components/svg`) | `<usa-draw>` · `<usa-morph>` · `<usa-mask-reveal>` · `<usa-anim-icon>` |
|
|
162
|
+
| **WebGL** (`/components/webgl`) | `<usa-shader>` · `<usa-distort>` · `<usa-liquid>` · `<usa-post-fx>` |
|
|
163
|
+
| **3D depth** (`/components/depth`) | `<usa-cube>` · `<usa-depth>` |
|
|
164
|
+
| **Layout** (`/components/layout`) | `<usa-auto-animate>` · `<usa-masonry>` |
|
|
165
|
+
| **Packs** (`/components/packs`) | `<usa-pack>` |
|
|
166
|
+
| **Effect registry** (`/components/fx`) | `<usa-fx>` |
|
|
167
|
+
| **Effect packs** (`/components/effects`) | `<usa-player>` · `<usa-story>` · `<usa-audio>` · `<usa-theme>` · `<usa-gesture-fx>` |
|
|
168
|
+
|
|
169
|
+
## Accessibility & reduced motion
|
|
170
|
+
|
|
171
|
+
- With `prefers-reduced-motion: reduce`, scroll reveals show content immediately (no entrance, parallax or scrub motion), and components fall back to calm states (`staticAlternative()` / `adaptKeyframes()`).
|
|
172
|
+
- `motionary/components/a11y`: `setMotionSensitivity()` levels let users drop flashes, loops or parallax; `announce()` live regions; `auditMotionA11y()`; `baselineReport()`. `<usa-motion-switch>` is a ready-made user-facing motion toggle.
|
|
173
|
+
- Details: [docs/accessibility.md](./docs/accessibility.md).
|
|
174
|
+
|
|
175
|
+
## Performance & size
|
|
176
|
+
|
|
177
|
+
No scroll listeners by default (IntersectionObserver), animations on the compositor (`transform`, `opacity`, `filter`, `clip-path`), optional off-main-thread native scroll timelines (`engine: 'css'`). Every entry is tree-shakeable and has a gzip budget enforced in CI (`size-budget.json`). Measured for 6.1 (minified + gzip):
|
|
178
|
+
|
|
179
|
+
| What you import | gzip |
|
|
180
|
+
|---|---:|
|
|
181
|
+
| `import ScrollAnimate from 'motionary'` (default instance) | 5.72 kB |
|
|
182
|
+
| Everything from the main entry | 8.69 kB |
|
|
183
|
+
| `dist/index.umd.js` (CDN) | 8.81 kB |
|
|
184
|
+
| `parallax()` alone | 1.22 kB |
|
|
185
|
+
| `motionary/presets/extended` (181 presets) | 4.69 kB |
|
|
186
|
+
| `motionary/components/reveal` | 4.10 kB |
|
|
187
|
+
| `motionary/components/effects` (8 effect packs) | 26.40 kB |
|
|
188
|
+
| `motionary/components/lite` (every component, CSS on demand) | 68.48 kB |
|
|
189
|
+
| `motionary/components` (every component + CSS) | 85.15 kB |
|
|
190
|
+
| `dist/components.umd.js` (CDN, everything) | 106.75 kB |
|
|
191
|
+
|
|
192
|
+
More: [docs/performance.md](./docs/performance.md).
|
|
193
|
+
|
|
194
|
+
## Browser support
|
|
195
|
+
|
|
196
|
+
Evergreen browsers since 2023: Chrome / Edge ≥ 111, Safari ≥ 16.4, Firefox ≥ 115, WebView2, Electron ≥ 24 (Custom Elements, Web Animations, IntersectionObserver, ResizeObserver, constructable stylesheets). View Transitions and scroll-driven animations are progressive — used when present, JS fallback otherwise. Importing on the server (SSR) is a no-op. Check a browser with `baselineReport()`.
|
|
197
|
+
|
|
198
|
+
## Documentation
|
|
199
|
+
|
|
200
|
+
- [API reference](./docs/API.md) — every export, option and `data-sa-*` attribute
|
|
201
|
+
- [Presets](./docs/presets.md) — all 214 by category
|
|
202
|
+
- [Components](./docs/components.md) — every `<usa-*>` element, attribute and event
|
|
203
|
+
- [Frameworks & SSR](./docs/frameworks-ssr.md) · [Windows apps](./docs/windows-apps.md) · [Hybrid apps (MAUI, Flutter, Electron, Tauri)](./docs/hybrid-apps.md)
|
|
204
|
+
- [Motion tokens](./docs/motion-tokens.md) · [Migrating from AOS](./docs/migration-from-aos.md) · [from GSAP ScrollTrigger](./docs/migration-from-gsap-scrolltrigger.md)
|
|
205
|
+
- [Demo page](./demo/index.html) — every preset clickable, no build step
|
|
206
|
+
|
|
207
|
+
## Upgrading
|
|
208
|
+
|
|
209
|
+
- From `use-scroll-animate`: `npm i motionary` and replace `use-scroll-animate` with `motionary` in imports and CDN URLs — nothing else changes (the old package name keeps receiving the same releases).
|
|
210
|
+
- [Upgrading to 6.0](./docs/upgrading-6.md) (`npx usa-codemod-6`) · [Upgrading to 5.0](./docs/upgrading-5.md) (`npx usa-codemod-5`) · [4.0](./docs/upgrading-4.md) · [3.0](./docs/upgrading-3.md) · [2.0](./docs/deprecations.md)
|
|
211
|
+
- [Changelog](./CHANGELOG.md)
|
|
212
|
+
|
|
213
|
+
## Roadmap
|
|
214
|
+
|
|
215
|
+
One version per PR towards 7.0 — particles & fluids, text effects, light & materials, 3D scenes, morphing, transitions, weather, interactive physics: [docs/ROADMAP.md](./docs/ROADMAP.md).
|
|
216
|
+
|
|
217
|
+
## Contributing & license
|
|
218
|
+
|
|
219
|
+
Issues and PRs welcome — see [CONTRIBUTING.md](./CONTRIBUTING.md). MIT © HarrisonCN — see [LICENSE](./LICENSE).
|
package/README_ja.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# Motionary
|
|
4
|
+
|
|
5
|
+
**モダン Web のためのスクロールアニメーションとアニメーション Web Components — 214 のスクロールプリセット、90 のエフェクト、依存ゼロ。**
|
|
6
|
+
|
|
7
|
+
_旧名 **use-scroll-animate** — API と `<usa-*>` タグはそのまま。旧 npm パッケージもエイリアスとして公開を継続します。_
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/motionary) [](https://github.com/HarrisonCN/motionary/actions/workflows/ci.yml) [](./LICENSE)
|
|
10
|
+
|
|
11
|
+
[English](./README.md) | [简体中文](./README_zh.md) | [日本語](./README_ja.md)
|
|
12
|
+
|
|
13
|
+
**[🛍 アニメーションストア](https://harrisoncn.github.io/motionary/showcase/)** · **[🧩 コンポーネント](https://harrisoncn.github.io/motionary/showcase/components.html)** · **[🎛 Playground](https://harrisoncn.github.io/motionary/showcase/playground.html)** · **[📜 ストーリー](https://harrisoncn.github.io/motionary/showcase/story.html)**
|
|
14
|
+
|
|
15
|
+
<sub>ストアでは全 <b>227</b> 件のアニメーション(214 のスクロールプリセットとカード・クリック・物理・ページ効果)をデスクトップ/スマホ幅でプレビュー・調整・コピーできます。</sub>
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
Motionary はスクロールで表示される要素をアニメーションさせ(IntersectionObserver + Web Animations、またはブラウザ標準のスクロールタイムライン)、カード・ボタン・物理・ページトランジション・背景・WebGL など 94 個のアニメーション付きカスタム要素を提供します。どのフレームワークでも、素の HTML でも、デスクトップの Web ビューアプリ(Electron・Tauri・WebView2)でも動き、すべて `prefers-reduced-motion` を尊重します。
|
|
20
|
+
|
|
21
|
+
## インストール
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm i motionary
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<!-- CDN (no build) -->
|
|
29
|
+
<script src="https://unpkg.com/motionary@6/dist/index.umd.js"></script> <!-- window.ScrollAnimate -->
|
|
30
|
+
<script src="https://unpkg.com/motionary@6/dist/presets-extended.umd.js"></script> <!-- +181 presets -->
|
|
31
|
+
<script src="https://unpkg.com/motionary@6/dist/components.umd.js"></script> <!-- every <usa-*>, window.UsaComponents -->
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
jsDelivr も利用できます:`https://cdn.jsdelivr.net/npm/motionary@6/dist/…`。既存の `use-scroll-animate` と `unpkg.com/use-scroll-animate@6` の URL もそのまま動きます。
|
|
35
|
+
|
|
36
|
+
## 30 秒クイックスタート
|
|
37
|
+
|
|
38
|
+
要素に `data-sa` を付け、`data-sa-animation` でプリセットを選びます(すべてのオプションに `data-sa-*` 属性あり)。JS API も使えます:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<!-- 1. HTML only: data attributes + one init() call -->
|
|
42
|
+
<h2 data-sa data-sa-animation="fade-in-up">Hello</h2>
|
|
43
|
+
<div data-sa data-sa-animation="bounce-in-up" data-sa-delay="150">Card</div>
|
|
44
|
+
<script type="module">
|
|
45
|
+
import ScrollAnimate from 'motionary';
|
|
46
|
+
import 'motionary/presets/extended'; // optional: +181 presets (bounce-in-up, clip-diamond, …)
|
|
47
|
+
ScrollAnimate.init(); // picks up every [data-sa]
|
|
48
|
+
</script>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
// 2. JS API
|
|
53
|
+
import ScrollAnimate, { staggerChildren, parallax, timeline } from 'motionary';
|
|
54
|
+
|
|
55
|
+
ScrollAnimate.observe('.card', { animation: 'zoom-in-up', duration: 800, easing: 'spring' });
|
|
56
|
+
staggerChildren(document.querySelector('.grid'), { animation: 'stagger-pop', stagger: 60 });
|
|
57
|
+
parallax('.hero-bg', { speed: 0.3 });
|
|
58
|
+
ScrollAnimate.observe('.logo', { animation: 'scrub-spin', engine: 'css', viewRange: ['cover 0%', 'cover 100%'] });
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
フレームワーク — 各アダプターは独立したエントリで、アンマウント時に自動で後片付けします:
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
// React
|
|
65
|
+
import React from 'react';
|
|
66
|
+
import { createReactHooks } from 'motionary/react';
|
|
67
|
+
const { useScrollAnimate } = createReactHooks(React);
|
|
68
|
+
|
|
69
|
+
export function Card() {
|
|
70
|
+
const ref = useScrollAnimate({ animation: 'fade-in-up' });
|
|
71
|
+
return <div ref={ref}>Hello</div>;
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<!-- Vue 3 -->
|
|
77
|
+
<script setup>
|
|
78
|
+
import { ref, onMounted, onUnmounted } from 'vue';
|
|
79
|
+
import { createVueComposables } from 'motionary/vue';
|
|
80
|
+
const { useScrollAnimate } = createVueComposables({ ref, onMounted, onUnmounted });
|
|
81
|
+
const { animateRef } = useScrollAnimate({ animation: 'zoom-in' });
|
|
82
|
+
</script>
|
|
83
|
+
<template><div ref="animateRef">Hello</div></template>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```svelte
|
|
87
|
+
<!-- Svelte 3–5 -->
|
|
88
|
+
<script>
|
|
89
|
+
import { scrollAnimate } from 'motionary/svelte';
|
|
90
|
+
</script>
|
|
91
|
+
<div use:scrollAnimate={{ animation: 'flip-up' }}>Hello</div>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```jsx
|
|
95
|
+
// Solid
|
|
96
|
+
import { scrollAnimate } from 'motionary/solid';
|
|
97
|
+
scrollAnimate; // keep the directive import (TypeScript)
|
|
98
|
+
export const Card = () => <div use:scrollAnimate={{ animation: 'blur-in-up' }}>Hello</div>;
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
// Angular (standalone) — the animated Web Components
|
|
103
|
+
import { APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
|
|
104
|
+
import { usaInitializer } from 'motionary/components/angular';
|
|
105
|
+
import 'motionary/presets/extended'; // lets <usa-reveal effect> use every preset name
|
|
106
|
+
// app.config.ts: providers: [{ provide: APP_INITIALIZER, multi: true, useFactory: usaInitializer() }]
|
|
107
|
+
@Component({ standalone: true, schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
108
|
+
template: `<usa-reveal effect="bounce-in-up"><h2>Hello</h2></usa-reveal>` })
|
|
109
|
+
export class Hero {}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
アニメーションコンポーネントはフレームワーク不要:
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<script type="module">
|
|
116
|
+
import { defineComponents } from 'motionary/components';
|
|
117
|
+
defineComponents(); // or lazyDefine() from 'motionary/components/lazy'
|
|
118
|
+
</script>
|
|
119
|
+
<usa-card effect="holo">…</usa-card>
|
|
120
|
+
<usa-button deform="gooey">Buy</usa-button>
|
|
121
|
+
<usa-fx effect="confetti" trigger="click"><button>Celebrate</button></usa-fx>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 機能一覧
|
|
125
|
+
|
|
126
|
+
| 分野 | 内容 |
|
|
127
|
+
|---|---|
|
|
128
|
+
| **スクロールプリセット** | **214** 種の入場プリセット(コア 33 + `motionary/presets/extended` の 181)、14 系統:フェード、ズーム、3D フリップ・ドア、オーバーシュートスライド、clip-path 図形、ブラー・マスク、バウンス・弾性、色・光、奥行き、グリッチ / タイプライター、スタッガー向け、スクロール連動 `scrub-*`。`timeline()` と 10 種のタイムラインプリセットも |
|
|
129
|
+
| **カード・クリック・ボタン変形** | `<usa-card>` の 10 エフェクト(flip・holo・glass・border glow など)、スタックと 3D カルーセル。クリック系 7 コンポーネント、4 種のボタン変形(squash · wobble · gooey · dent)とアイコンモーフ。登録済みカード / クリックエフェクト 12 種 |
|
|
130
|
+
| **物理・バウンス** | `<usa-spring>`、`<usa-draggable>`(スプリングバック・慣性・スナップ)、`<usa-overscroll>`。`spring()` / `solveSpring()` と 7 種のバネプリセット、物理エフェクト 7 種 |
|
|
131
|
+
| **ページトランジション** | `pageTransition()`・`viewTransition()`・`sharedTransition()`・`flip()`・MPA トランジション、ページエフェクト 7 種(curtain・iris・pixel-dissolve など)、`<usa-dialog>`・`<usa-view-switch>` |
|
|
132
|
+
| **ジェネラティブ背景** | キャンバス背景 6 種(flow-field・voronoi・mesh-gradient・starfield・metaballs・contours)+ 背景要素 9 種(オーロラ・パーティクル・グレイン・Acrylic / Mica など) |
|
|
133
|
+
| **サウンド連動** | `<usa-audio>` と Web Audio のビート検出(`createBeatDetector()`・`onBeat()`)、オーディオビジュアライザー 3 種、任意のエフェクトをビートで発火 |
|
|
134
|
+
| **カーソル・ジェスチャー** | カーソルエフェクト 5 種 + `<usa-cursor>`、fling · twist · long-press でエフェクト(`<usa-gesture-fx>`)、`<usa-swipeable>`・`<usa-pinch-zoom>` |
|
|
135
|
+
| **テーマ** | テーマ 5 種(neon · paper · glass · retro · brutalist)を `<usa-theme>` / `applyTheme()` で、各テーマに専用エフェクト。モーショントークン(`/components/tokens`) |
|
|
136
|
+
| **マイクロインタラクション** | 既製の UI 演出 23 種:copy-success・like-heart・add-to-cart・send-plane・upvote・trash-shake など |
|
|
137
|
+
| **`<usa-player>` とストーリー** | `<usa-player>` は Playground から書き出した JSON アニメーションを再生(キーフレーム・プリセット・エフェクト、load / view / scroll / click トリガー)。`<usa-story>` のストーリーテンプレート 6 種 |
|
|
138
|
+
| **WebGL** | `<usa-shader>`・`<usa-distort>`・`<usa-liquid>`・`<usa-post-fx>` — パーティクル 5 種、ポストエフェクト 9 種(CSS フォールバックと省電力制御付き) |
|
|
139
|
+
|
|
140
|
+
90 のエフェクトは 1 つのレジストリ(`registerEffect()` / `playEffect()` / `bindEffect()` / `<usa-fx>`、`motionary/components/fx`)を共有し、5.x のパックは `motionary/components/effects` にあります。
|
|
141
|
+
|
|
142
|
+
### 全 94 コンポーネント
|
|
143
|
+
|
|
144
|
+
カテゴリ単位(`motionary/components/cards`)、全部(`motionary/components`)、CSS 遅延読み込みの `/components/lite`、またはページ上のタグだけを読む `lazyDefine()` から選べます。ラッパー:`/components/react`・`/vue`・`/svelte`・`/solid`・`/angular`。
|
|
145
|
+
|
|
146
|
+
| エントリ | 要素 |
|
|
147
|
+
|---|---|
|
|
148
|
+
| **スクロール表示** (`/components/reveal`) | `<usa-reveal>` · `<usa-stagger>` · `<usa-scroll-progress>` · `<usa-scrolly>` |
|
|
149
|
+
| **テキスト** (`/components/text`) | `<usa-typewriter>` · `<usa-split-text>` · `<usa-scramble>` · `<usa-counter>` · `<usa-shimmer-text>` · `<usa-text-rotate>` · `<usa-wave-text>` · `<usa-glitch>` · `<usa-gradient-text>` · `<usa-handwriting>` · `<usa-scroll-highlight>` |
|
|
150
|
+
| **インタラクション** (`/components/interaction`) | `<usa-ripple>` · `<usa-magnetic>` · `<usa-tilt>` · `<usa-spotlight>` · `<usa-press>` · `<usa-toggle>` |
|
|
151
|
+
| **フィードバック** (`/components/feedback`) | `<usa-spinner>` · `<usa-skeleton>` · `<usa-progress>` · `<usa-toaster>` · `<usa-check>` |
|
|
152
|
+
| **背景** (`/components/background`) | `<usa-aurora>` · `<usa-particles>` · `<usa-grain>` · `<usa-marquee>` · `<usa-acrylic>` · `<usa-grid-glow>` · `<usa-blobs>` · `<usa-water-ripple>` · `<usa-dot-network>` |
|
|
153
|
+
| **トランジション** (`/components/transitions`) | `<usa-dialog>` · `<usa-accordion>` · `<usa-view-switch>` |
|
|
154
|
+
| **バネ・物理** (`/components/physics`) | `<usa-spring>` · `<usa-draggable>` · `<usa-overscroll>` |
|
|
155
|
+
| **カード** (`/components/cards`) | `<usa-card>` · `<usa-card-stack>` · `<usa-sticky-stack>` · `<usa-carousel-3d>` |
|
|
156
|
+
| **クリック・ボタン** (`/components/click`) | `<usa-click>` · `<usa-button>` · `<usa-icon-morph>` · `<usa-like>` · `<usa-hold>` · `<usa-double-tap>` · `<usa-checkbox>` |
|
|
157
|
+
| **UI キット** (`/components/ui`) | `<usa-tabs>` · `<usa-drawer>` · `<usa-bottom-sheet>` · `<usa-pull-refresh>` · `<usa-fab>` · `<usa-navbar>` · `<usa-slider>` · `<usa-rating>` · `<usa-tooltip>` · `<usa-popover>` · `<usa-badge>` · `<usa-avatar-stack>` |
|
|
158
|
+
| **ページ全体** (`/components/page`) | `<usa-cursor>` · `<usa-fullpage>` · `<usa-loading-bar>` · `<usa-back-to-top>` · `<usa-ambient>` · `<usa-splash>` · `<usa-auto-skeleton>` · `<usa-motion-switch>` |
|
|
159
|
+
| **タイムライン** (`/components/timeline`) | `<usa-timeline>` |
|
|
160
|
+
| **ジェスチャー** (`/components/gesture`) | `<usa-swipeable>` · `<usa-pinch-zoom>` |
|
|
161
|
+
| **SVG** (`/components/svg`) | `<usa-draw>` · `<usa-morph>` · `<usa-mask-reveal>` · `<usa-anim-icon>` |
|
|
162
|
+
| **WebGL** (`/components/webgl`) | `<usa-shader>` · `<usa-distort>` · `<usa-liquid>` · `<usa-post-fx>` |
|
|
163
|
+
| **3D 奥行き** (`/components/depth`) | `<usa-cube>` · `<usa-depth>` |
|
|
164
|
+
| **レイアウト** (`/components/layout`) | `<usa-auto-animate>` · `<usa-masonry>` |
|
|
165
|
+
| **パック** (`/components/packs`) | `<usa-pack>` |
|
|
166
|
+
| **エフェクト登録** (`/components/fx`) | `<usa-fx>` |
|
|
167
|
+
| **エフェクトパック** (`/components/effects`) | `<usa-player>` · `<usa-story>` · `<usa-audio>` · `<usa-theme>` · `<usa-gesture-fx>` |
|
|
168
|
+
|
|
169
|
+
## アクセシビリティと reduced motion
|
|
170
|
+
|
|
171
|
+
- `prefers-reduced-motion: reduce` ではスクロール表示はすぐに表示され(入場・パララックス・スクラブなし)、コンポーネントは落ち着いた状態になります(`staticAlternative()` / `adaptKeyframes()`)。
|
|
172
|
+
- `motionary/components/a11y`:`setMotionSensitivity()` のレベルで点滅・ループ・パララックスを抑制、`announce()` ライブリージョン、`auditMotionA11y()`、`baselineReport()`。`<usa-motion-switch>` はユーザー向けのモーション切替です。
|
|
173
|
+
- 詳細:[docs/accessibility.md](./docs/accessibility.md)。
|
|
174
|
+
|
|
175
|
+
## パフォーマンスとサイズ
|
|
176
|
+
|
|
177
|
+
デフォルトで scroll リスナーなし(IntersectionObserver)、アニメーションはコンポジター上(`transform`・`opacity`・`filter`・`clip-path`)、メインスレッド外のネイティブスクロールタイムライン(`engine: 'css'`)も選べます。全エントリはツリーシェイク可能で、gzip 予算を CI で強制(`size-budget.json`)。6.1 の実測(minify + gzip):
|
|
178
|
+
|
|
179
|
+
| インポート | gzip |
|
|
180
|
+
|---|---:|
|
|
181
|
+
| `import ScrollAnimate from 'motionary'` (default instance) | 5.72 kB |
|
|
182
|
+
| Everything from the main entry | 8.69 kB |
|
|
183
|
+
| `dist/index.umd.js` (CDN) | 8.81 kB |
|
|
184
|
+
| `parallax()` alone | 1.22 kB |
|
|
185
|
+
| `motionary/presets/extended` (181 presets) | 4.69 kB |
|
|
186
|
+
| `motionary/components/reveal` | 4.10 kB |
|
|
187
|
+
| `motionary/components/effects` (8 effect packs) | 26.40 kB |
|
|
188
|
+
| `motionary/components/lite` (every component, CSS on demand) | 68.48 kB |
|
|
189
|
+
| `motionary/components` (every component + CSS) | 85.15 kB |
|
|
190
|
+
| `dist/components.umd.js` (CDN, everything) | 106.75 kB |
|
|
191
|
+
|
|
192
|
+
詳細:[docs/performance.md](./docs/performance.md)。
|
|
193
|
+
|
|
194
|
+
## 対応ブラウザ
|
|
195
|
+
|
|
196
|
+
2023 年以降のエバーグリーンブラウザ:Chrome / Edge ≥ 111、Safari ≥ 16.4、Firefox ≥ 115、WebView2、Electron ≥ 24(Custom Elements・Web Animations・IntersectionObserver・ResizeObserver・constructable stylesheets)。View Transitions とスクロール駆動アニメーションはプログレッシブ(対応時に使用、それ以外は JS)。サーバー(SSR)での import は何もしません。`baselineReport()` で確認できます。
|
|
197
|
+
|
|
198
|
+
## ドキュメント
|
|
199
|
+
|
|
200
|
+
- [API リファレンス](./docs/API.md)(英語)— 全エクスポート・オプション・`data-sa-*` 属性
|
|
201
|
+
- [プリセット一覧](./docs/presets.md)(全 214 種)
|
|
202
|
+
- [コンポーネント](./docs/components.md)(全 `<usa-*>` 要素・属性・イベント)
|
|
203
|
+
- [フレームワークと SSR](./docs/frameworks-ssr.md) · [Windows アプリ](./docs/windows-apps.md) · [ハイブリッドアプリ](./docs/hybrid-apps.md)
|
|
204
|
+
- [モーショントークン](./docs/motion-tokens.md) · [AOS からの移行](./docs/migration-from-aos.md) · [GSAP ScrollTrigger からの移行](./docs/migration-from-gsap-scrolltrigger.md)
|
|
205
|
+
- [デモ](./demo/index.html)(全プリセットをクリックで再生)
|
|
206
|
+
|
|
207
|
+
## アップグレード
|
|
208
|
+
|
|
209
|
+
- `use-scroll-animate` から:`npm i motionary` を実行し、import と CDN URL の `use-scroll-animate` を `motionary` に置き換えるだけです(旧パッケージ名も同じリリースを継続)。
|
|
210
|
+
- [6.0 へのアップグレード](./docs/upgrading-6.md)(`npx usa-codemod-6`)· [5.0](./docs/upgrading-5.md)(`npx usa-codemod-5`)· [4.0](./docs/upgrading-4.md) · [3.0](./docs/upgrading-3.md) · [2.0](./docs/deprecations.md)
|
|
211
|
+
- [変更履歴](./CHANGELOG.md)
|
|
212
|
+
|
|
213
|
+
## ロードマップ
|
|
214
|
+
|
|
215
|
+
7.0 まで 1 バージョン 1 PR — パーティクルと流体、テキスト効果、光と質感、3D シーン、モーフィング、トランジション、天気、インタラクティブ物理:[docs/ROADMAP.md](./docs/ROADMAP.md)。
|
|
216
|
+
|
|
217
|
+
## コントリビュートとライセンス
|
|
218
|
+
|
|
219
|
+
Issue と PR を歓迎します — [CONTRIBUTING.md](./CONTRIBUTING.md) を参照。MIT © HarrisonCN — [LICENSE](./LICENSE)。
|