motionary 0.0.0-stage → 6.1.1
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 +784 -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-Yno7N2eC.js +404 -0
- package/dist/chunks/base-Yno7N2eC.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-BIOaYdgN.js +181 -0
- package/dist/chunks/core-BIOaYdgN.js.map +1 -0
- package/dist/chunks/core-CUGCsMsJ.js +260 -0
- package/dist/chunks/core-CUGCsMsJ.js.map +1 -0
- package/dist/chunks/core-D7cVumUu.js +909 -0
- package/dist/chunks/core-D7cVumUu.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-BqDeFywO.js +109 -0
- package/dist/chunks/fx-BqDeFywO.js.map +1 -0
- package/dist/chunks/fx-lBGVtQO1.cjs +114 -0
- package/dist/chunks/fx-lBGVtQO1.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/spring-DfQO5USi.js +219 -0
- package/dist/chunks/spring-DfQO5USi.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-VNscPeTD.js +35 -0
- package/dist/chunks/variants-VNscPeTD.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 +75 -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 +69 -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 +2590 -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 +2531 -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.cjs +289 -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 +275 -0
- package/dist/components/fx.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 +11099 -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 +10831 -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 +85 -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 +81 -0
- package/dist/components/solid.js.map +1 -0
- package/dist/components/svelte.cjs +67 -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 +63 -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 +66 -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 +63 -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.cjs +350 -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 +105 -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/docs/API.md +147 -0
- package/docs/ROADMAP.md +15 -0
- package/docs/accessibility.md +60 -0
- package/docs/components.md +535 -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 +532 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,784 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [6.1.1] - 2026-10-08
|
|
11
|
+
|
|
12
|
+
### Changed — the project is now **Motionary**
|
|
13
|
+
- **Renamed to Motionary** (formerly `use-scroll-animate`): npm package **`motionary`**, repository `HarrisonCN/motionary`, showcase at `https://harrisoncn.github.io/motionary/showcase/`, CDN `https://unpkg.com/motionary@6/dist/…` (jsDelivr: `cdn.jsdelivr.net/npm/motionary@6`). **No breaking change**: every API name, the `<usa-*>` tags, `usa-` CSS classes, the `ScrollAnimate` / `UsaComponents` globals, the `usa-codemod-*` bins and the `use-scroll-animate/animation` player format id stay the same.
|
|
14
|
+
- `use-scroll-animate` keeps being published at the same versions as a compatibility alias (same build); switching is `npm i motionary` + replacing `use-scroll-animate` with `motionary` in imports and CDN URLs.
|
|
15
|
+
- New package description and keywords; `homepage` is the showcase.
|
|
16
|
+
|
|
17
|
+
### Docs
|
|
18
|
+
- README (EN / 中文 / 日本語) rewritten for 6.1: tagline, showcase links (Store · Components · Playground · Story), install (npm + CDN @6), 30-second quickstart (data attributes, JS API, React / Vue / Svelte / Solid / Angular), feature overview with real counts, all 94 animated elements, accessibility, measured gzip sizes, browser baseline, upgrading, roadmap, license. Stale per-version sections removed (details live in `docs/`).
|
|
19
|
+
- Docs, examples, showcase code snippets and issue templates use the new name; showcase pages get Motionary titles and Open Graph / Twitter meta.
|
|
20
|
+
|
|
21
|
+
## [6.1.0] - 2026-10-08
|
|
22
|
+
|
|
23
|
+
### Added — Scroll presets 2.0
|
|
24
|
+
- **181 new scroll-reveal presets** (214 in total) in a separate, tree-shakeable entry: `import 'use-scroll-animate/presets/extended'` registers them on import (exports `EXTENDED_PRESETS`, `EXTENDED_PRESET_CATEGORIES`, `registerExtendedPresets()`); `<script>` pages load `dist/presets-extended.umd.js` after (or before) `dist/index.umd.js`. ≈ 4.7 kB gzip; the core bundle stays within its budget (UMD 8.81 kB / 9 kB).
|
|
25
|
+
- Fade (+14: small/large distances, diagonals, settle, half) · Zoom & scale (+18: zoom-in/out up/down/left/right, from zero / 2×, zoom-bounce, origin-aware scale-x/y, stretch) · Flip 3D (+18: reverse, half turn, diagonal, edge flips, door-open, unfold, fold, bounce flips, swing-in) · Slide (+16: overshoot slides, back-in ×4, light-speed ×2, rise / sink, float) · Rotate & skew (+16: roll, spiral, spin, corner pivots, skew / shear, twist, tilt) · Blur & mask (+12: directional blur, zoom blur, motion blur, mask-up/down/left/right) · Clip reveal (+17: circles from edges/corner, ellipse, diamond, curtains, box, pill, blinds, diagonal & slanted wipes) · **Bounce & elastic** (+17: bounce-in ×5, elastic, rubber band, jello, wobble, tada, heartbeat, drop, pop, squash & stretch, shake, swing) · **Color & light** (+14: brightness, darken, colour / saturate / hue / sepia / invert / contrast / exposure / vintage, bloom, shadow lift, neon glow, glow) · **Depth & perspective** (+10) · **Glitch & special** (+9: glitch, colour glitch, typewriter, typewriter lines, hinge, flicker, scan, materialize, teleport) · **Stagger-ready** (+8 `stagger-*`) · **Scroll-linked** (+12 `scrub-*`: parallax drift, rotate / spin / scale / shrink / tilt on scroll, horizontal pan, sticky fade, focus through, wipe — for `engine: 'css'` with `viewRange: ['cover 0%', 'cover 100%']`).
|
|
26
|
+
- Only `transform`, `opacity`, `filter` and `clip-path` are animated (plus a constant `transform-origin`); reduced motion shows the element without moving it.
|
|
27
|
+
- Presets may carry **intermediate keyframes** (`frames: [{ offset, …props }]`, optional per-keyframe `easing`), played between `from` and `to` by the JS and native engines and reversed for `exit`. Custom `{ from, to, frames }` animations work too.
|
|
28
|
+
- `registerPresets(map)` and `reversePreset(p)` in the main entry. `PRESETS` is now one table per page shared through `Symbol.for('use-scroll-animate.presets')`, so the ESM entries, the UMD bundle and the extended set see each other's presets.
|
|
29
|
+
- `<usa-reveal effect>` / `<usa-stagger effect>` accept any registered preset name (their own effects keep priority).
|
|
30
|
+
- Types: `CorePreset`, `ExtendedPreset` (`AnimationPreset` = both), `PresetKeyframes`, `AnimationFrame`.
|
|
31
|
+
|
|
32
|
+
### Showcase
|
|
33
|
+
- The Animation Store lists all 214 presets (**227 items**, up from 46) in 14 preset categories with filter chips, live demos and copy-paste code; extended presets add the `presets/extended` import (or the CDN script) to every code tab. Scroll-linked presets demo on the native view timeline; stagger-ready presets demo on a row of items; the keyframes panel shows intermediate keyframe counts. The demo page loads the extended set too.
|
|
34
|
+
|
|
35
|
+
### Docs
|
|
36
|
+
- New `docs/presets.md` (every preset by category), README (EN / 中文 / 日本語) "Scroll presets 2.0" section, API reference, `<usa-reveal>` docs. `docs/ROADMAP.md`: 6.1 is Scroll presets 2.0; the previous 6.1–6.9 plans move to 6.2–6.10.
|
|
37
|
+
|
|
38
|
+
### Tests
|
|
39
|
+
- New `test/presets-extended.test.ts`: every preset (core + extended) has interpolable keyframes (same properties and function lists from → frames → to, GPU-friendly properties, ordered offsets), type union / categories in sync, shared registry (ESM + UMD source), frames through `observe()`, reduced motion, `<usa-reveal>` lookup, store count ≥ 160, recipes and generated code.
|
|
40
|
+
|
|
41
|
+
## [6.0.1] - 2026-10-08
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
- **Showcase — components gallery overflowed phones horizontally (~48 px at 390 px wide).** The header's six nav items (Store · Playground · Story · language · theme · GitHub) could not shrink, so the whole page scrolled sideways and the scroll-progress bar ran past the edge. On screens ≤ 480 px the bar now shrinks and tightens to one row (the sticky filter bar keeps its offset): the duplicate “Animation Store” link is hidden (the logo already links to the store) along with the “Components” badge, and below 375 px the GitHub icon moves to the footer link only. Checked in headless Chromium at 320 / 360 / 390 / 414 / 480 px in English and Chinese: `scrollWidth` equals the viewport width and every remaining header control is on screen.
|
|
45
|
+
- Crawl of all showcase pages (`/showcase/`, `components.html`, `playground.html`, `story.html`, desktop 1280 px + mobile 390 px): no other console errors, failed requests or overflow found.
|
|
46
|
+
|
|
47
|
+
### Tests
|
|
48
|
+
- New `test/fixes-6-0-1.test.ts` regression suite.
|
|
49
|
+
|
|
50
|
+
## [6.0.0] - 2026-10-08
|
|
51
|
+
|
|
52
|
+
### ⚠ BREAKING CHANGES
|
|
53
|
+
- **Removed `burst()`, `confetti()`, `shake()`** from `use-scroll-animate/components`, `/components/click` and the UMD global (deprecated in 5.9). Play the registered effects instead: `playEffect(document.body, 'burst', { x, y, …options })`, `playEffect(el, 'confetti', options)`, `playEffect(el, 'shake', { intensity, duration })` (`use-scroll-animate/components/fx`). `haptic()` stays.
|
|
54
|
+
- **Removed `<usa-cursor mode="trail">`** (deprecated in 5.9): `CURSOR_MODES` is now `dot` · `magnetic` · `glow`, and an unknown mode renders as `dot`. Use the 5.7 `comet-trail` effect: `<usa-fx effect="comet-trail" trigger="load" self>…</usa-fx>`.
|
|
55
|
+
- Every effect now goes through the 5.0 registry (`registerEffect()` / `playEffect()` / `bindEffect()` / `<usa-fx>`); the 5.1–5.9 packs live in `use-scroll-animate/components/effects`.
|
|
56
|
+
|
|
57
|
+
### Migration
|
|
58
|
+
- `npx usa-codemod-6 --write src` rewrites the helper calls and imports (aliases and the `UsaComponents` global included) and lists `<usa-cursor mode="trail">` for a manual edit. Guide: `docs/upgrading-6.md`.
|
|
59
|
+
- CDN URLs move to the `@6` range: `https://unpkg.com/use-scroll-animate@6/dist/components.umd.js`.
|
|
60
|
+
|
|
61
|
+
### Docs
|
|
62
|
+
- README (EN / 中文 / 日本語): new **Effect packs** (`/components/effects`) row.
|
|
63
|
+
- `docs/ROADMAP.md`: post-6.0 roadmap (v6.1 → v7.0).
|
|
64
|
+
|
|
65
|
+
## [5.9.0] - 2026-10-08
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
- **`<usa-player>`** (`use-scroll-animate/components/effects`, `definePlayer()`) — plays JSON animations (`format: "use-scroll-animate/animation"`, `version: 1`): tracks with a `target` selector, `start` / `duration`, and a timeline `preset`, your own `keyframes` + `easing`, or any registered `effect` fired at `start`. Source: `src="…json"` or an inline `<script type="application/json">`. `trigger="load | view | scroll | click | manual"` (`scroll` scrubs with the page), `loop`, `rate`, `controls`; methods `play()`, `pause()`, `seek(ms)`, `load(json)`; events `usa-player-ready`, `usa-player-finish`; `data-error` on bad input.
|
|
69
|
+
- `createPlayer(root, animation, { autoplay, loop, rate })` → `{ play, pause, seek, rate, duration, currentTime, playing, finished, destroy }` — keyframe tracks are WAAPI animations driven by one clock; `normalizeAnimation()` validates (and reads Playground presets too).
|
|
70
|
+
- Playground: new **`<usa-player> JSON`** export tab (`tracksToAnimation()`).
|
|
71
|
+
- The registered `burst` effect accepts `x` / `y`.
|
|
72
|
+
- `docs/upgrading-6.md` and **`npx usa-codemod-6 [--write] [paths]`**.
|
|
73
|
+
|
|
74
|
+
### Deprecated (removed in 6.0 — warned once in the console)
|
|
75
|
+
- `burst()`, `confetti()`, `shake()` (components / components/click entries, UMD global) → `playEffect(el, 'burst' | 'confetti' | 'shake', …)` — the codemod rewrites calls and imports.
|
|
76
|
+
- `<usa-cursor mode="trail">` → the 5.7 `comet-trail` effect (`<usa-fx effect="comet-trail" trigger="load" self>`) — reported by the codemod for a manual edit.
|
|
77
|
+
|
|
78
|
+
### Accessibility
|
|
79
|
+
- Under reduced motion `<usa-player>` jumps to the final state and fires no effects.
|
|
80
|
+
|
|
81
|
+
## [5.8.0] - 2026-10-08
|
|
82
|
+
|
|
83
|
+
### Added
|
|
84
|
+
- **Theme packs** (`use-scroll-animate/components/effects`): `neon`, `paper`, `glass`, `retro`, `brutalist` — each = design tokens (`--usa-theme-bg|fg|accent|accent-2|surface|border|radius|shadow|font`), motion tokens merged over the motion scale, and effect presets per role (`enter`, `hover`, `click`, `attention`, `background`). API: `THEMES`, `applyTheme(name, root?)` (on `<html>` also activates the motion tokens; on an element scopes them; returns an undo), `themeVars()`, `themeCss(name, selector?)` for static / SSR CSS, `themePreset(name, role)`, `playThemeEffect(el, role)`. Helper classes `.usa-surface`, `.usa-accent`.
|
|
85
|
+
- `<usa-theme name="…">` — a themed subtree; children with `data-theme-fx="click | hover | enter | attention"` get that role's preset.
|
|
86
|
+
- Theme effects: `neon-flicker` (dims, never blacks out; < 3 flashes / s), `paper-fold`, `glass-shine`, `retro-scanlines` (static under reduced motion), `brutal-shift`.
|
|
87
|
+
- **23 micro-interactions** (`MICRO_FX`, `registerMicroEffects()`), each doing the UI work as well as the motion: `copy-success` (clipboard + "Copied ✓"), `toggle-morph`, `password-reveal`, `favorite-star`, `like-heart`, `bookmark-flip` (all `aria-pressed`), `download-progress` / `submit-loading` (`aria-busy`, `usa-done`), `send-plane`, `add-to-cart`, `counter-bump`, `upvote`, `clap`, `emoji-react`, `refresh-spin`, `trash-shake` (`remove: true`), `check-toggle` (`aria-checked` on `role=checkbox`), `input-shake` (`aria-invalid`), `error-flash`, `success-check`, `nudge-hint`, `focus-pulse`, `notify-badge`. Helpers `togglePressed()`, `swapLabel()`, `bumpCount()`.
|
|
88
|
+
- Showcase: **Micro-interactions** and **Theme packs** cards.
|
|
89
|
+
|
|
90
|
+
### Accessibility
|
|
91
|
+
- State changes (pressed, busy, invalid, counts, labels via a polite live region) happen with or without motion; under reduced motion only the animation is dropped.
|
|
92
|
+
|
|
93
|
+
## [5.7.0] - 2026-10-08
|
|
94
|
+
|
|
95
|
+
### Added
|
|
96
|
+
- **Cursor pack** (`use-scroll-animate/components/effects`, `registerCursorEffects()`, `CURSOR_FX`, kind `cursor`, persistent, scoped to the bound element): `comet-trail` (`color`, `width`, `life`), `ribbon-trail` (rainbow, `width`, `life`), `sparkle-trail` (`colors`, `spacing`, `size`), `magnetic-dots` (dot grid behind the content leaning toward the pointer; `gap`, `radius`, `color`), `spotlight-cursor` (eased soft light; `color`, `size`, `ease`). Trails draw on one fixed, pointer-transparent overlay canvas that only animates while a tail is fading. Mouse / pen only by default — `touch: true` opts touch in.
|
|
97
|
+
- **Gestures → effects**: `bindGesture(el, 'fling' | 'twist' | 'long-press', effectNameOrCallback, { velocity, angle, duration, tolerance, effectOptions })` — fling = fast release (px/ms, with direction), twist = two-finger rotation past `angle`° (`cw` / `ccw`), long press charges `--usa-charge` 0 → 1 (`data-charging` while charging) and fires when full; moving cancels. Every fire dispatches `usa-gesture`. Pure helpers `flingVelocity()`, `angleDelta()`.
|
|
98
|
+
- `<usa-gesture-fx gesture effect options velocity angle duration [self]>` — plays the effect on its first child.
|
|
99
|
+
- Showcase: **Cursor trails** and **Gesture triggers** cards.
|
|
100
|
+
|
|
101
|
+
### Accessibility
|
|
102
|
+
- Cursor effects are skipped under reduced motion; gesture-fired effects go through `playEffect()`, which applies reduced motion. Gestures only add effects — they never replace a click / keyboard action.
|
|
103
|
+
|
|
104
|
+
## [5.6.0] - 2026-10-08
|
|
105
|
+
|
|
106
|
+
### Added
|
|
107
|
+
- **Sound-reactive pack** (`use-scroll-animate/components/effects`, `registerAudioEffects()`, `AUDIO_FX`, kind `background`): `spectrum-bars` (`bars`, `gap`, `mirror`), `pulse-ring` (`rings`, `color`), `wave-ring` (`color`, `amplitude`) — Canvas 2D on the 5.5 `canvasBackground()` runner (visible-only, adaptive quality); they idle gently until audio is enabled.
|
|
108
|
+
- `enableAudio(input)` — analyse the microphone (`'mic'`), an `<audio>` / `<video>` element or selector, or a `MediaStream` through one shared Web Audio analyser. Must be called from a user gesture (the context is resumed there). The microphone is never routed to the speakers and is released on `stop()`; media stays audible after `stop()`. Also `disableAudio()`, `getAudio()`, `sample()` → `{ level, bass, freq, wave }`.
|
|
109
|
+
- Beat detection: `createBeatDetector({ threshold, cooldown, history, floor })` (pure), `onBeat(cb)`, and `bindBeat(el, effect, options)` — plays **any registered effect** on every beat.
|
|
110
|
+
- `<usa-audio source="#track | mic" label="…">` — renders (or uses your `[data-audio-toggle]`) an `aria-pressed` toggle button; children with `data-usa-beat="effect"` (`data-usa-beat-options` JSON) play that effect on beats; events `usa-beat`, `usa-audio-error` (`data-audio-error` on the host).
|
|
111
|
+
- While audio runs, `--usa-audio-level` / `--usa-audio-bass` (0–1) are set on `<html>` for CSS-driven reactions.
|
|
112
|
+
- Showcase: **Sound-reactive backgrounds** and **Beat-triggered effects** cards.
|
|
113
|
+
|
|
114
|
+
### Accessibility
|
|
115
|
+
- Audio only starts from a user gesture. Under reduced motion the visual effects are skipped, beats trigger no effects and the CSS variables stay at 0 (sound keeps playing).
|
|
116
|
+
|
|
117
|
+
## [5.5.0] - 2026-10-08
|
|
118
|
+
|
|
119
|
+
### Added
|
|
120
|
+
- **Generative backgrounds pack** (`use-scroll-animate/components/effects`, `registerGenerativeEffects()`, `GENERATIVE_FX`, kind `background`): `flow-field`, `voronoi`, `mesh-gradient`, `starfield`, `metaballs`, `contours` — Canvas 2D, options `colors`, `background`, `speed`, `quality` plus per-effect knobs (`count`, `seeds`, `blobs`, `stars`, `balls`, `levels`, `cell`…).
|
|
121
|
+
- `canvasBackground(el, ctx, { init, draw }, options)` — the shared runner, exported for custom generative effects: an `aria-hidden`, pointer-transparent canvas behind the content (`isolation: isolate`), renders only while visible (IntersectionObserver) and the tab is shown, resizes with the element, and adapts quality (render scale 0.35–1 drops on sustained slow frames, recovers on fast ones). Helpers `noise2()`, `hexRgb()`.
|
|
122
|
+
- Showcase: **Generative backgrounds** card (switch between all six).
|
|
123
|
+
|
|
124
|
+
### Accessibility
|
|
125
|
+
- Under reduced motion each background draws one static frame and never loops; canvases are `aria-hidden` and never take pointer events.
|
|
126
|
+
|
|
127
|
+
## [5.4.0] - 2026-10-08
|
|
128
|
+
|
|
129
|
+
### Added
|
|
130
|
+
- **`<usa-story template="…">`** (`defineStory()` from `use-scroll-animate/components/effects`; `defineEffectElements()` defines every element of the entry) — six scroll-storytelling templates:
|
|
131
|
+
- `pin` — a sticky `[data-stage]` while `[data-step]` sections scroll past; the active step gets `data-active`, the stage `data-active-step="<i>"`.
|
|
132
|
+
- `gallery` — a horizontal `[data-track]` slides sideways as you scroll down.
|
|
133
|
+
- `zoom` — zoom-through: the stage scales up to `zoom="6"` and fades.
|
|
134
|
+
- `compare` — before / after wipe driven by scroll, with a draggable, keyboard-accessible handle (`role="slider"`, ←/→, Shift for ×5, Home/End).
|
|
135
|
+
- `counter` — `[data-count="12,480"]` numbers count up on entering view (separators, decimals, prefix / suffix kept).
|
|
136
|
+
- `highlight` — the paragraph (or `[data-step]`) crossing the viewport center is highlighted.
|
|
137
|
+
- Every template sets `--usa-story-progress` (0–1), exposes `progress` / `step` / `update()` and fires `usa-story-step`. Helpers: `storyProgress(el)`, `formatCount(target, t)`, `STORY_TEMPLATES`.
|
|
138
|
+
- Showcase: new **[Scroll stories](./showcase/story.html)** page with all six templates full-page; gallery cards **Story: before / after**, **Story: data counters**, **Story: step highlight**. Gallery code tabs import from the card’s own entry.
|
|
139
|
+
|
|
140
|
+
### Accessibility
|
|
141
|
+
- Under reduced motion nothing slides or zooms (the gallery stacks vertically), counters show their final values immediately; counted numbers carry the final value as `aria-label`.
|
|
142
|
+
|
|
143
|
+
## [5.3.0] - 2026-10-08
|
|
144
|
+
|
|
145
|
+
### Added
|
|
146
|
+
- **Page-wide pack** (`use-scroll-animate/components/effects`, `registerPageEffects()`, `PAGE_FX`):
|
|
147
|
+
- Transitions — `curtain`, `iris` (closes on the click point), `pixel-dissolve` (`cols` × `rows`), `blinds` (`slats`). Each covers the viewport, awaits `onCovered()` (swap your route / content there), optionally `hold`s, then reveals; `playEffect()` resolves when the page is visible again.
|
|
148
|
+
- Persistent — `velocity-skew` (skews with scroll speed, eases back), `spotlight` (dims everything but a circle at the pointer), `edge-glow` (lights the viewport edge you scroll toward).
|
|
149
|
+
- Showcase: **Page transitions** and **Velocity skew & edge glow** cards.
|
|
150
|
+
|
|
151
|
+
### Accessibility
|
|
152
|
+
- Transition layers are `aria-hidden`; under reduced motion every transition becomes a 150 ms cross-fade that still calls `onCovered()`. `velocity-skew`, `spotlight` and `edge-glow` don’t run under reduced motion.
|
|
153
|
+
|
|
154
|
+
## [5.2.0] - 2026-10-08
|
|
155
|
+
|
|
156
|
+
### Added
|
|
157
|
+
- **Bounce & physics pack** (`use-scroll-animate/components/effects`, `registerPhysicsEffects()`, `PHYSICS_FX`): `bounce-in` (spring overshoot), `rubber-band`, `elastic-hover` (springy lift, persistent), `drop-bounce` (gravity + restitution), `gravity-text` (per-character drop, keeps `aria-label`), `spring-follow` (element springs toward the pointer), `bell-swing` (damped swing from the top).
|
|
158
|
+
- Physics helpers: `solveSpring({ stiffness, damping, mass, steps })` → progress samples + settle time, `springKeyframes(map, spring)`, `bounceKeyframes(restitution, steps)` — physical motion that still runs on the Web Animations API.
|
|
159
|
+
- Showcase: **Bounce & physics**, **Gravity text** and **Elastic hover & spring follow** cards.
|
|
160
|
+
|
|
161
|
+
### Accessibility
|
|
162
|
+
- Under reduced motion `bounce-in` / `drop-bounce` become a short fade; `rubber-band`, `bell-swing`, `gravity-text`, `elastic-hover` and `spring-follow` don’t move.
|
|
163
|
+
|
|
164
|
+
## [5.1.0] - 2026-10-08
|
|
165
|
+
|
|
166
|
+
### Added
|
|
167
|
+
- **New entry `use-scroll-animate/components/effects`** — the 5.x effect packs, all registered through `registerEffect()` and playable with `playEffect()`, `bindEffect()` or `<usa-fx>`: `registerAllEffects()`, `registerCardClickEffects()`, `EFFECT_PACKS`, `CARD_FX`, `CLICK_FX`, `fxLayer()`. Kept out of `components` / `components/lite` (lite stays under its 70 KB budget); the UMD bundle registers every pack.
|
|
168
|
+
- **Card effects 2.0**: `holo` (holographic foil + 3D tilt following the pointer), `glare-sweep`, `book-open`, `card-fan`, `topple`, `float-tilt`.
|
|
169
|
+
- **Click effects 2.0**: `shockwave`, `ink-splash`, `star-burst`, `jelly-press`, `ring-ripple`, `emoji-rain` — particles spawn from the click point in a fixed, `aria-hidden`, pointer-transparent layer.
|
|
170
|
+
- Showcase: **Holographic card**, **Card moves** and **Click effects 2.0** cards in the Effects category (code tabs import `components/effects`).
|
|
171
|
+
|
|
172
|
+
### Changed
|
|
173
|
+
- `bindEffect()` — a persistent effect (one that returns a cleanup) now *replaces* its previous run on re-trigger instead of stacking; every effect kind honours `reduced`.
|
|
174
|
+
|
|
175
|
+
### Accessibility
|
|
176
|
+
- Under reduced motion particles are skipped, presses fade instead of squashing, loops don’t start, `holo` keeps a static sheen.
|
|
177
|
+
|
|
178
|
+
## [5.0.0] - 2026-10-08
|
|
179
|
+
|
|
180
|
+
### ⚠ BREAKING CHANGES (see [docs/upgrading-5.md](./docs/upgrading-5.md); `npx usa-codemod-5 --write src`)
|
|
181
|
+
- **Modern-browser baseline**: Custom Elements, Web Animations, IntersectionObserver, ResizeObserver and constructable stylesheets are required (Chrome / Edge ≥ 111, Safari ≥ 16.4, Firefox ≥ 115, WebView2, Electron ≥ 24). The `experimental-webgl` context is no longer requested. View Transitions and scroll-driven animations remain progressive.
|
|
182
|
+
- `motionIntensity: 'off'` / `setMotionIntensity('off')` removed (ignored at runtime) → `motionSensitivity: 'minimal'`. `MotionIntensity` is `'low' | 'normal' | 'high'`; `MOTION_SCALE` has no `off`.
|
|
183
|
+
- `reducedMotion: 'no-preference'` removed (treated as `'user'`) — the OS setting is always honoured.
|
|
184
|
+
- `<usa-timeline scrub="js">` removed — `scrub` picks the JS engine automatically; `smooth="…"` opts into smoothing.
|
|
185
|
+
- Category entries (`use-scroll-animate/components/<category>`) no longer re-export `configureComponents`, `prefersReducedMotion`, `ComponentsConfig`, `UsaElement` — import them from `use-scroll-animate/components`.
|
|
186
|
+
|
|
187
|
+
### Added
|
|
188
|
+
- **Unified plugin-style effect registration** — new category `use-scroll-animate/components/fx`: `registerEffect({ name, kind, defaults, reduced, run })`, `registerEffects()`, `playEffect(el, name, options)`, `bindEffect(el, name, { trigger: 'click' | 'hover' | 'enter' | 'load' | 'loop' | 'manual' })`, `listEffects(kind?)`, `getEffect()`, `hasEffect()`, `EFFECT_KINDS`, `EFFECT_TRIGGERS`. Effects receive a context whose `animate()` applies reduced motion, motion sensitivity, intensity and the animation budget.
|
|
189
|
+
- **`<usa-fx effect="…" trigger="…">`** plays any registered effect on its child.
|
|
190
|
+
- **Built-in effects** (`BUILTIN_EFFECTS`): every timeline preset as an `enter` effect; attention seekers `pulse` · `pop` · `jelly` · `wiggle` · `heartbeat` · `bounce` · `flash` · `tada` · `shake`; click effects `burst` · `confetti` · `ripple`.
|
|
191
|
+
- `animateWithMotion(el, frames, options)` — the shared motion-aware `animate()` used by elements and effects.
|
|
192
|
+
- `<usa-motion-switch>` keeps its Off button (now motion sensitivity `minimal`); `setMotionLevel()`, `getMotionLevel()`, `MotionSwitchLevel`.
|
|
193
|
+
- Showcase: new **Effects (plugin API)** category — attention seekers, click effects, scroll entrances, `registerEffect()` live demo.
|
|
194
|
+
- **[docs/ROADMAP.md](./docs/ROADMAP.md)**: the 5.1 → 6.0 plan (card & click 2.0, bounce physics, page-wide, scroll storytelling, generative backgrounds, sound-reactive, cursor & gesture packs, theme packs & micro-interactions, JSON animation player, 6.0 cleanup).
|
|
195
|
+
- CDN examples now use `use-scroll-animate@5`.
|
|
196
|
+
|
|
197
|
+
## [4.9.0] - 2026-10-08
|
|
198
|
+
|
|
199
|
+
### Deprecated (removed in 5.0 — each warns once in the console)
|
|
200
|
+
- `configureComponents({ motionIntensity: 'off' })` and `setMotionIntensity('off')` → `motionSensitivity: 'minimal'` / `setMotionSensitivity('minimal')`. (`<usa-motion-switch>`'s Off button and restoring a saved level stay silent.)
|
|
201
|
+
- `configureComponents({ reducedMotion: 'no-preference' })` → removed; the OS setting is always honoured (`'user'` / `'reduce'`).
|
|
202
|
+
- `<usa-timeline scrub="js">` → `scrub` (automatic JS fallback) + `smooth="…"`.
|
|
203
|
+
- `configureComponents` / `prefersReducedMotion` / `ComponentsConfig` / `UsaElement` imported from category entries → import from `use-scroll-animate/components`.
|
|
204
|
+
|
|
205
|
+
### Added
|
|
206
|
+
- **Codemod** `npx usa-codemod-5 [--write] [paths…]` (new `bin`): rewrites all of the above in `.js/.ts/.jsx/.tsx/.vue/.svelte/.html/.astro` files; dry run by default.
|
|
207
|
+
- **[docs/upgrading-5.md](./docs/upgrading-5.md)** — removals, the 5.0 modern-browser baseline, what's new.
|
|
208
|
+
- `baselineReport()` / `warnBaseline()` (`components/a11y`): which 5.0-required (Custom Elements, WAAPI, IntersectionObserver, ResizeObserver, adoptedStyleSheets) and progressive (View Transitions, scroll-driven animations, WebGL) features this browser has.
|
|
209
|
+
- `withoutDeprecations(fn)` for library-internal calls.
|
|
210
|
+
|
|
211
|
+
## [4.8.0] - 2026-10-08
|
|
212
|
+
|
|
213
|
+
### Added
|
|
214
|
+
- **GPU particle presets** on `glQuad()` for `<usa-shader preset="…">`: `snow`, `fireflies`, `stars` (warp starfield), `bokeh`, `rain` — procedural in one fragment shader (no buffers, no per-particle JS). `PARTICLE_PRESETS`.
|
|
215
|
+
- **`<usa-post-fx effects="…" intensity="0.6">`** — chainable GPU post-processing over an `<img>`: `vignette` · `grain` · `chromatic` · `scanlines` · `crt` · `bloom` · `pixelate` · `duotone` · `glitch`. `POST_EFFECTS`, `postFxShader(list)` for your own `glQuad()`.
|
|
216
|
+
- **Unified WebGL fallback** — every preset has a still CSS rendering (`GL_FALLBACKS`, `glFallbackCss()`; `--usa-gl-fallback` on `<usa-shader>`), post-fx images get an approximate CSS filter (`--usa-gl-filter`).
|
|
217
|
+
- **Battery / fps adaptive quality** for all GL elements: resolution steps 100 % → 50 % → 35 % after two slow seconds (< 40 fps) and back after five good ones; battery saver (≤ 20 % and discharging, or Save-Data) caps at 30 fps and ≤ 60 % resolution. `quality="high"` opts out; `data-quality` reflects the scale. `glGovernor()`, `watchPowerSaver()`.
|
|
218
|
+
- `glQuad().render({ extra })` sets any float uniform; `resize(scale)` scales the drawing buffer.
|
|
219
|
+
- Showcase: **GPU particles** and **Post-processing** cards (Canvas & WebGL). All new shaders verified to compile in Chromium (SwiftShader).
|
|
220
|
+
|
|
221
|
+
## [4.7.0] - 2026-10-08
|
|
222
|
+
|
|
223
|
+
### Added
|
|
224
|
+
- **Native shell bridges** — new entry `use-scroll-animate/components/bridge` (also on `UsaComponents` in the UMD build): `connectNativeShell()` syncs the host app's **reduce motion**, **light / dark / high-contrast theme** and **accent color** (and optional motion-sensitivity level) into every `<usa-*>` component. JSON protocol `usa:ready` / `usa:request-settings` / `usa:settings` over WebView2 web messages, `window.postMessage` or `window.usaNative.apply()`; incoming values validated. Helpers `detectNativeHost()`, `postToNative()`, `parseNativeSettings()`, `applyNativeSettings()`; event `usa:native-settings`.
|
|
225
|
+
- **Official samples** in [examples/native](./examples/native/): **WinUI 3** (`UISettings.AnimationsEnabled`, accent, high contrast → `PostWebMessageAsJson`), **.NET MAUI** (Android animator scale, iOS Reduce Motion, Windows `UISettings`, `RequestedThemeChanged` → `EvaluateJavaScriptAsync`), **Flutter** (`MediaQuery.disableAnimations`, brightness, high contrast via a `UsaBridge` JavaScriptChannel), sharing one web page.
|
|
226
|
+
- Showcase: **connectNativeShell()** card (Page & app-wide) — simulate host messages on a demo tile.
|
|
227
|
+
- Docs: "Native shell bridge" in [docs/hybrid-apps.md](./docs/hybrid-apps.md).
|
|
228
|
+
|
|
229
|
+
## [4.6.0] - 2026-10-08
|
|
230
|
+
|
|
231
|
+
### Added
|
|
232
|
+
- **Playground 2.0** ([showcase/playground.html](https://harrisoncn.github.io/use-scroll-animate/showcase/playground.html)):
|
|
233
|
+
- **Keyframe track editor** — one lane per timeline step on a ms ruler; drag a bar to move it, drag its right edge to change duration (50 ms snapping), arrow keys (Shift = resize) for keyboard users; preset, label, start and duration fields; **Play timeline** previews it with a real `<usa-timeline>`.
|
|
234
|
+
- **Save / share presets** — named presets in localStorage, share links now carry the tracks (old links still open), portable preset JSON (`Copy preset JSON` / `Import JSON…`).
|
|
235
|
+
- **Export as `<usa-timeline>`** — new code tab with declarative markup (`data-tl`, absolute `data-at`, `data-duration`) plus the `defineTimeline()` import.
|
|
236
|
+
- `showcase/playground-core.js`: `newTrack`, `normalizeTracks`, `tracksDuration`, `trackBar`, `dragTrack`, `timelineMarkup`, `listPresets` / `savePreset` / `loadPreset` / `deletePreset`, `presetToJSON` / `presetFromJSON` (pure, unit-tested).
|
|
237
|
+
|
|
238
|
+
## [4.5.0] - 2026-10-08
|
|
239
|
+
|
|
240
|
+
### Added
|
|
241
|
+
- **Shared rAF scheduler** — every component loop now runs on one `requestAnimationFrame` per frame (batched, ordered; a throwing callback no longer starves the others). New entry `use-scroll-animate/components/perf`: `onFrame(fn)`, `schedulerStats()`.
|
|
242
|
+
- **Animation budget & auto-degrade** — `setAnimationBudget(n)` / `animationBudget()` / `activeAnimations()`; `autoDegrade({ minFps, maxActive, sample, patience, recovery, onChange })` steps motion to `low` and halves the budget while fps drops or too many animations run, restores when frames recover, dispatches `usa:degrade`.
|
|
243
|
+
- **On-demand CSS** — new entry **`use-scroll-animate/components/lite`**: the whole library without inlined CSS; each category's `dist/components/<cat>.css` is linked the first time one of its elements connects. **≈ 62 KB gzip** for everything (vs ≈ 79 KB), CI budget **≤ 70 KB**. `onDemandStyles(base)`, `loadCategoryStyles(cat, base)`, `categoryOf(tag)`, `loadedStyles()`.
|
|
244
|
+
- Showcase: **autoDegrade()** card (Page & app-wide) — stress 120 animations, toggle a budget, watch scheduler stats.
|
|
245
|
+
- Docs: [docs/performance.md](./docs/performance.md).
|
|
246
|
+
|
|
247
|
+
## [4.4.0] - 2026-10-08
|
|
248
|
+
|
|
249
|
+
### Added
|
|
250
|
+
- **Accessibility toolkit** — new entry `use-scroll-animate/components/a11y` (also re-exported from `use-scroll-animate/components`):
|
|
251
|
+
- **Motion-sensitivity levels** `setMotionSensitivity('full' | 'gentle' | 'minimal' | 'static', persist?)`, `restoreMotionSensitivity()`, `getMotionSensitivity()`, `motionAllowed(kind)`, `MOTION_SENSITIVITY`. `gentle` strips spins, zooms, skews and 3D from every component animation (vestibular-safe); `minimal` = fades only; `static` = no animation at all (also stops page CSS animations). `configureComponents({ motionSensitivity })` and `adaptKeyframes(frames, level)` for your own WAAPI code.
|
|
252
|
+
- **Static alternatives** — `STATIC_ALTERNATIVES` documents the static rendering of every category; `staticAlternative(root)` freezes a subtree at its final state.
|
|
253
|
+
- **aria-live conventions** — one shared polite (`role="status"`) and one assertive (`role="alert"`) region; `announce(message, { politeness, dedupe })`, `liveRegion()`.
|
|
254
|
+
- **`auditMotionA11y(root)`** — focusable-in-`aria-hidden`, unnamed widget roles, sliders without `aria-valuenow`, `<img>` without `alt`, assertive regions outside alerts, endless animations without a motion control (WCAG 2.2.2).
|
|
255
|
+
- **Automated a11y regression tests**: every `<usa-*>` element is mounted at all four sensitivity levels and audited (`test/a11y-regression.test.ts`).
|
|
256
|
+
- Showcase: **setMotionSensitivity()** card (Page & app-wide) — replay a spin-zoom entrance at each level, announce, audit the page.
|
|
257
|
+
- Docs: levels, static alternatives, live-region conventions and the audit in [docs/accessibility.md](./docs/accessibility.md).
|
|
258
|
+
|
|
259
|
+
### Fixed
|
|
260
|
+
- `<usa-cursor>` under reduced motion / on touch no longer keeps author content inside its `aria-hidden` host (found by the new audit).
|
|
261
|
+
|
|
262
|
+
## [4.3.0] - 2026-10-08
|
|
263
|
+
|
|
264
|
+
### Added
|
|
265
|
+
- **`splitText(el, { by: 'char' | 'word' | 'line' })`** in `use-scroll-animate/components/text` — `Intl.Segmenter`-aware splitting (emoji / grapheme clusters, Chinese & Japanese word boundaries), Arabic-script words kept whole so shaping survives, RTL aware, inline markup preserved; returns `{ units, chars, words, lines, revert() }`. Lines are re-measured on resize.
|
|
266
|
+
- **`splitTimeline(el, options)`** — turns the split units into a `timeline()` (preset, stagger, duration, easing tokens) with `from: 'start' | 'end' | 'center' | 'edges' | 'random'`; `.play()` or `.scrub(section)`.
|
|
267
|
+
- Helpers `splitOrder()`, `graphemes()`, `splitWords()`, `JOINING_SCRIPT`.
|
|
268
|
+
- `<usa-split-text>` upgraded: `by="lines"` and `from="center|edges|end|random"` attributes, now built on `splitText()`.
|
|
269
|
+
- Showcase: **splitText()** card (Text) — Latin + emoji, Chinese and Arabic RTL lines, replay from start / center / edges / random.
|
|
270
|
+
|
|
271
|
+
## [4.2.0] - 2026-10-08
|
|
272
|
+
|
|
273
|
+
### Added
|
|
274
|
+
- **Motion design tokens** — new entry `use-scroll-animate/components/tokens` (also re-exported from `use-scroll-animate/components`): one duration / easing / spring scale as CSS custom properties (`--usa-duration-fast`, `--usa-easing-emphasized`, `--usa-spring-bouncy-stiffness`…), W3C Design Tokens (DTCG) JSON and JS values.
|
|
275
|
+
- `MOTION_TOKENS` (durations `instant`→`slowest`, easings `standard` · `emphasized` · `decelerate` · `accelerate` · `spring` · `bounce`, springs `gentle` · `snappy` · `bouncy` · `wobbly` · `stiff`).
|
|
276
|
+
- `applyMotionTokens(partial?, root?)` (writes the vars, sets the active scale, returns undo), `motionToken()`, `motionVar()`, `getMotionTokens()`.
|
|
277
|
+
- `importMotionTokens(json)` reads **Figma Tokens / Tokens Studio** (`value` / `type`), **Style Dictionary** (nested `value`) and **DTCG** (`$value` / `$type`, incl. `transition` composites) exports; `motionTokensToCss()`, `motionTokensToVars()`, `motionTokensToJSON()`.
|
|
278
|
+
- Prebuilt `docs/motion-tokens.css` and `docs/motion.tokens.json`; guide in [docs/motion-tokens.md](./docs/motion-tokens.md).
|
|
279
|
+
- `timeline()` steps and defaults accept token names: `{ duration: 'slow', easing: 'spring' }`.
|
|
280
|
+
- Showcase: **applyMotionTokens()** card (Page & app-wide) — play a stagger at `fast` / `normal` / `slow` with any easing token.
|
|
281
|
+
|
|
282
|
+
## [4.1.0] - 2026-10-08
|
|
283
|
+
|
|
284
|
+
### Added
|
|
285
|
+
- **Native scroll-driven scrub** — `timeline().scrub(el)` now runs on the browser's `ViewTimeline` (default; `el` moving through the viewport, range `cover`) or `ScrollTimeline` (`{ source: 'scroll' }`; `el` is the scroll container) when available. Each step becomes one scroll-driven animation over its slice of the range, so the playhead is driven off the main thread with no per-frame JS.
|
|
286
|
+
- `scrub()` options: `source` (`'view'` · `'scroll'`), `engine` (`'auto'` · `'native'` · `'js'`), `axis` (`block` · `inline` · `x` · `y`). The returned stop function carries `.native`.
|
|
287
|
+
- `supportsNativeScrub(source?)` (main entry and `components/timeline`); `ScrubHandle` type.
|
|
288
|
+
- `<usa-timeline scrub>` uses the native engine (sets `data-native`); `scrub="scroll"`, `scrub="js"` and `smooth="0.2"` tune it.
|
|
289
|
+
- JS fallback (rAF-throttled scroll listener) for browsers without scroll-driven animations and whenever JS is needed: `smooth`, `offset`, `call()` cues, `onUpdate`, `engine: 'js'`. The fallback now also supports `{ source: 'scroll' }` and horizontal axes.
|
|
290
|
+
- Showcase: **supportsNativeScrub()** card — a scroll box scrubbing a three-step timeline, showing which engine runs it (verified in Chromium: native ScrollTimeline).
|
|
291
|
+
|
|
292
|
+
### Changed
|
|
293
|
+
- `<usa-timeline scrub>` no longer smooths by default (`smooth` was 0.2) so it can run natively; add `smooth="0.2"` for the previous feel.
|
|
294
|
+
|
|
295
|
+
## [4.0.1] - 2026-10-08
|
|
296
|
+
|
|
297
|
+
### Fixed
|
|
298
|
+
- **`<usa-mask-reveal>` never revealed in Chromium** (trigger `view`): Chromium's IntersectionObserver honours the target's own `clip-path`, so a fully clipped element never reported as intersecting. It now waits hidden with `opacity: 0`, and the clip-path animation uses `fill: 'both'` so the closed mask also covers the `delay`.
|
|
299
|
+
- **`<usa-timeline trigger="click">` was invisible until first clicked** — it now shows the finished composition and replays from the start on click, `Enter` or `Space` (focusable by default).
|
|
300
|
+
- **WebGL elements (`<usa-shader>`, `<usa-distort>`, `<usa-liquid>`)** only resized their canvas on window resize; they now follow their own size with a `ResizeObserver` (grid reflow, card expand, sidebars).
|
|
301
|
+
- **`<usa-handwriting>`** keeps its intrinsic size when a page has a global `svg { width: … }` icon rule.
|
|
302
|
+
- **Solid:** the `use:usa` directive (`components/solid`) and the `use:scrollAnimate` directive (`/solid`) now track their accessor with `createRenderEffect` — signals update props / options / handlers without calling `refresh()`; listeners are removed on cleanup.
|
|
303
|
+
- **Showcase (checked in headless Chromium at 1280 px and 390 px):** demo SVGs (line drawing, handwriting, `morphTo()`) were squashed to 20 px by the showcase's global icon rule; the pinch-zoom and mask-reveal demos used undefined CSS classes (text overflowed the tile); the header hid the Playground / Store links on phones; deep links to `#c-carousel-3d` (ids with digits) did not resolve; the playground's copy / share buttons threw an unhandled rejection when clipboard access was denied and gave no feedback; stale “v2” / “v3.0” kickers and a Chinese phrase in the English category text.
|
|
304
|
+
|
|
305
|
+
### Tests
|
|
306
|
+
- New `test/fixes-4-0-1.test.ts` regression suite; `<usa-mask-reveal>` and Solid adapter tests updated.
|
|
307
|
+
|
|
308
|
+
## [4.0.0] - 2026-10-07
|
|
309
|
+
|
|
310
|
+
4.0 completes the 3.x release train by consolidating overlapping APIs. Every removal has a drop-in replacement that shipped during 3.x — see **[Upgrading to 4.0](./docs/upgrading-4.md)** (run your app on 3.9 first: it warns once wherever removed APIs are used).
|
|
311
|
+
|
|
312
|
+
### ⚠ Breaking changes
|
|
313
|
+
- **`sequence()` removed** from `use-scroll-animate` → use **`timeline()`**, now also exported from the root entry (`import { timeline } from 'use-scroll-animate'`, `ScrollAnimate.timeline` in the UMD build) alongside `resolvePosition` and `TIMELINE_PRESETS`. `SequenceStep` / `SequenceOptions` / `SequenceController` types removed (use `Timeline`, `TimelineOptions`, `TimelineStepOptions`).
|
|
314
|
+
- **`connectedAnimation()` removed** from `components/transitions` → use **`sharedTransition(update)`** with `data-shared="id"` (`components/layout`; View Transitions API + FLIP fallback). `ConnectedOptions` type removed.
|
|
315
|
+
- **`<usa-flip-list>` / `defineFlipList()` removed** from `components/transitions` → use **`<usa-auto-animate>` / `autoAnimate()`** (`components/layout`), which also animates additions, removals and size changes. `flip()` stays.
|
|
316
|
+
- CDN snippets in docs and the showcase now point at `use-scroll-animate@4`.
|
|
317
|
+
|
|
318
|
+
### Changed
|
|
319
|
+
- The Animation Store's timeline recipe, the vanilla example, README (EN / 中文 / 日本語), API docs and the AOS / GSAP migration guides use `timeline()`.
|
|
320
|
+
- The component gallery's transitions category shows a `flip()` demo instead of the removed helpers.
|
|
321
|
+
|
|
322
|
+
### Docs
|
|
323
|
+
- New **[docs/upgrading-4.md](./docs/upgrading-4.md)** (step-by-step migration with before / after code).
|
|
324
|
+
- New **[docs/ROADMAP.md](./docs/ROADMAP.md)** — the post-4.0 plan (v4.1 → v5.0).
|
|
325
|
+
|
|
326
|
+
### Migration
|
|
327
|
+
| 3.x | 4.0 |
|
|
328
|
+
|---|---|
|
|
329
|
+
| `sequence([{ target: '.a' }, { target: '.b', gap: -200 }], { trigger: '.hero' })` | `timeline().to('.a', 'fade-up').to('.b', 'fade-up', { at: '-=200' })` + play on view / `scrub()` |
|
|
330
|
+
| `connectedAnimation(thumb, detail)` | `sharedTransition(() => { … })` with `data-shared="id"` on both |
|
|
331
|
+
| `<usa-flip-list>` | `<usa-auto-animate>` |
|
|
332
|
+
|
|
333
|
+
npm: **4.0.0 is published as `latest`**; 3.x remains installable as `use-scroll-animate@3`.
|
|
334
|
+
|
|
335
|
+
## [3.9.0] - 2026-10-07
|
|
336
|
+
|
|
337
|
+
### Added
|
|
338
|
+
- **Effect packs** — new category `use-scroll-animate/components/packs`: ready-made motion for whole page types. Mark elements with `data-role` and apply a pack with `<usa-pack name="…">` or `applyPack(name, root)` (returns undo):
|
|
339
|
+
- `ecommerce` — `product` (reveal + lift), `add-to-cart` (press + fly to cart), `cart` (bump), `price` (count up), `badge` (pulse)
|
|
340
|
+
- `portfolio` — `project`, `heading`, `stat`, `contact`
|
|
341
|
+
- `dashboard` — `card`, `stat`, `alert`, `action`
|
|
342
|
+
- `game` — `button`, `score`, `item` (float), `hit` (shake), `reward`
|
|
343
|
+
- `landing` — `hero`, `feature`, `cta`, `logo`, `stat`
|
|
344
|
+
- Helpers: `flyToCart(from, to)` (arc flight + cart bump), `countUp(el)` (keeps currency / separators / decimals, accessible label), `PACKS`, `PACK_PRIMITIVES`.
|
|
345
|
+
- Reduced motion: packs leave content static (numbers show their final value, no flights / pulses / floats).
|
|
346
|
+
- Showcase: new **Effect packs** gallery category with a live demo per pack and a `flyToCart()` demo.
|
|
347
|
+
|
|
348
|
+
### Deprecated (removed in 4.0)
|
|
349
|
+
- `sequence()` → `timeline()` (since 3.1).
|
|
350
|
+
- `connectedAnimation()` → `sharedTransition()` (since 3.6).
|
|
351
|
+
- `<usa-flip-list>` / `defineFlipList()` → `<usa-auto-animate>` / `autoAnimate()` (since 3.6).
|
|
352
|
+
|
|
353
|
+
Each logs a one-time console warning linking to the new **[Upgrading to 4.0](./docs/upgrading-4.md)** guide.
|
|
354
|
+
|
|
355
|
+
## [3.8.0] - 2026-10-07
|
|
356
|
+
|
|
357
|
+
### Added
|
|
358
|
+
- **Svelte** — `use-scroll-animate/components/svelte`: `use:usa={{ props, on }}` action (sets DOM properties, binds `usa:*` events with update / destroy; works in Svelte 3, 4 and 5) and `defineUsa(categories?)` (client-only, SvelteKit-safe).
|
|
359
|
+
- **Solid** — `use-scroll-animate/components/solid`: `use:usa` directive (`refresh()` / `destroy()`), `defineUsa()`, `SolidUsaIntrinsicElements` JSX types; native `prop:` / `on:usa:change` documented.
|
|
360
|
+
- **Angular** — `use-scroll-animate/components/angular`: `usaInitializer(categories?)` for `APP_INITIALIZER`, `defineUsa()`, `usaDetail($event)`; `CUSTOM_ELEMENTS_SCHEMA` + `[prop]` / `(usa:event)` binding documented. No `@angular/*` import.
|
|
361
|
+
- Shared framework-neutral `bindUsa(el, { props, on })` / `usaEventName()` (exported from all three entries).
|
|
362
|
+
- **Docs**: new [docs/hybrid-apps.md](./docs/hybrid-apps.md) — .NET MAUI (`HybridWebView`, `BlazorWebView`), Flutter (`webview_flutter` / `flutter_inappwebview`, `JavaScriptChannel`), Electron (context isolation, preload bridge), Tauri v2 (strict CSP, `invoke`), with native ↔ web event bridges and OS reduced-motion mirroring; `docs/frameworks-ssr.md` gains Svelte, Solid and Angular sections.
|
|
363
|
+
|
|
364
|
+
## [3.7.0] - 2026-10-07
|
|
365
|
+
|
|
366
|
+
### Added
|
|
367
|
+
- **Visual playground** — [`showcase/playground.html`](./showcase/playground.html) (no build, dogfoods `dist/components.js` with a CDN fallback):
|
|
368
|
+
- **Compose**: stack effect layers around a card, button, heading or image — scroll reveal, 3D tilt, magnetic, spring, mask reveal, depth, swipeable, click ripple, shader background, glitch and gradient text — and reorder or remove them.
|
|
369
|
+
- **Tweak**: every attribute has a live control (selects, sliders, toggles); the preview re-renders instantly, with a Replay button.
|
|
370
|
+
- **Export**: HTML (CDN, no build), ES module (per-category imports with the right `define*Components()`), React (JSX via `components/jsx` types) and Vue (`isCustomElement` hint) code, copy to clipboard.
|
|
371
|
+
- **Share**: the composition is encoded in the URL hash (`encodeState()` / `decodeState()`), so a link reproduces it.
|
|
372
|
+
- English / 中文, keyboard accessible controls, honours `prefers-reduced-motion` (shows a notice; effects render their final state).
|
|
373
|
+
- Pure, tested playground core in `showcase/playground-core.js` (`PLAYGROUND_EFFECTS`, `composeMarkup()`, `playgroundSnippets()`); the component gallery links to the playground.
|
|
374
|
+
|
|
375
|
+
## [3.6.0] - 2026-10-07
|
|
376
|
+
|
|
377
|
+
### Added
|
|
378
|
+
- **Layout animation** — new category `use-scroll-animate/components/layout`:
|
|
379
|
+
- `autoAnimate(parent, { duration, easing, scale })` and `<usa-auto-animate>` — zero-config list / grid reflow: added children fade-scale in, removed children fade out in place (as positioned ghosts), moved or resized ones glide with FLIP (sort, filter, insert, container resize); `enable()` / `disable()` / `stop()`.
|
|
380
|
+
- `<usa-masonry>` — masonry grid (`columns` or `min` column width, `gap`): shortest-column placement, items glide when the width, the set of items or their sizes change (ResizeObserver); CSS multi-column before JS runs.
|
|
381
|
+
- `sharedTransition(update, root?, opts)` — shared-element transitions: elements with the same `data-shared="id"` before and after `update()` morph into each other via the View Transitions API (`view-transition-name` assigned per id) with a FLIP fallback.
|
|
382
|
+
- Pure helpers `flipFrames()`, `masonryLayout()`.
|
|
383
|
+
- Reduced motion: layout changes apply instantly, masonry does not glide, shared transitions just run `update()`.
|
|
384
|
+
- Showcase: new **Layout animation** gallery category (interactive add / shuffle / remove, masonry, shared-element thumbnails → detail).
|
|
385
|
+
|
|
386
|
+
## [3.5.0] - 2026-10-07
|
|
387
|
+
|
|
388
|
+
### Added
|
|
389
|
+
- **3D & depth** — new category `use-scroll-animate/components/depth`:
|
|
390
|
+
- `<usa-cube>` — CSS 3D cube from up to six children (front, right, back, left, top, bottom): drag / swipe (via `gesture()`), arrow keys, `autoplay` (pauses on hover / focus), `show(face | index)`, `next()`, `prev()`; spring-driven, shortest-path rotation; only the front face is exposed to assistive tech; `usa:change`.
|
|
391
|
+
- `<usa-depth>` — layered depth parallax: `data-depth` (-1…1) layers shift and scale from `source="pointer | orientation | scroll"` (combinable), `strength`, optional scene `rotate`; `requestPermission()` for iOS motion sensors.
|
|
392
|
+
- `deviceTilt(cb, { range, smooth })`, `orientationToTilt()`, `requestOrientationPermission()`, `supportsOrientation()` — device-orientation tilt helpers.
|
|
393
|
+
- The 3D ring carousel stays `<usa-carousel-3d>` (in `components/cards`) and is cross-linked from the new category.
|
|
394
|
+
- Reduced motion: the cube switches faces instantly with no drag-rotate or autoplay; depth layers stay flat.
|
|
395
|
+
- Showcase: new **3D & depth** gallery category (cube, depth scene, gyroscope demo).
|
|
396
|
+
|
|
397
|
+
## [3.4.0] - 2026-10-07
|
|
398
|
+
|
|
399
|
+
### Added
|
|
400
|
+
- **Canvas & WebGL** — new category `use-scroll-animate/components/webgl` (no three.js; one tiny single-quad runner):
|
|
401
|
+
- `<usa-shader>` — GPU shader backgrounds behind content: presets `gradient`, `plasma`, `waves`, `aurora`, or your own GLSL in `<script type="x-shader/x-fragment">` (uniforms `u_time`, `u_resolution`, `u_mouse`, `v_uv`); `speed`.
|
|
402
|
+
- `<usa-distort>` — hover image distortion with RGB split around the pointer.
|
|
403
|
+
- `<usa-liquid>` — liquid / ripple images: clicks send up to four water ripples through the image, hover wobbles; `strength`.
|
|
404
|
+
- `glQuad(canvas, fragment)` (returns `{ render, resize, texture, dispose }` or `null`), `supportsWebGL()`, `fragmentSource()`, `SHADERS`.
|
|
405
|
+
- **Graceful fallback**: without WebGL, when a shader fails to compile, or for a cross-origin image without CORS, the canvas is removed and `data-fallback="webgl | image | no-image"` is set — `<usa-shader>` keeps its CSS gradient, images stay visible (`<usa-distort>` falls back to a CSS hover zoom).
|
|
406
|
+
- Performance: renders only while in view and the tab is visible, DPR capped at 2, contexts released on disconnect.
|
|
407
|
+
- Reduced motion: a single static frame, no animation loop.
|
|
408
|
+
- Showcase: new **Canvas & WebGL** gallery category (shader presets, distortion, liquid image, live `glQuad()` demo) with a generated demo photo in `showcase/assets/`.
|
|
409
|
+
|
|
410
|
+
## [3.3.0] - 2026-10-07
|
|
411
|
+
|
|
412
|
+
### Added
|
|
413
|
+
- **SVG** — new category `use-scroll-animate/components/svg`:
|
|
414
|
+
- `<usa-draw>` — line drawing for every stroke of the SVG inside (normalised `pathLength`, no `getTotalLength()`): `trigger` (`view` · `hover` · `click` · `scrub`), `duration`, `stagger`, `fill`, `repeat`; `progress`, `play()`, `usa:complete`.
|
|
415
|
+
- `<usa-morph>` — path morph through `paths="A | B | C"` on `click` (keyboard accessible) · `hover` · `view` · `auto`; same-structure paths morph point by point, others switch at the midpoint.
|
|
416
|
+
- `<usa-mask-reveal>` — clip-path mask reveals: `circle`, `diamond`, `star`, `iris`, `wipe`, `wipe-up`, origin `at`, `trigger`, `repeat`.
|
|
417
|
+
- `<usa-anim-icon>` — animated stroke icons (`bell`, `heart`, `check`, `arrow`, `star`, `gear`, `search`, `download`) on hover / focus, click, view or loop; decorative unless `label` is set.
|
|
418
|
+
- Helpers: `morphTo()`, `interpolatePath()`, `pathsCompatible()`, `drawLines()`, `MASK_SHAPES`, `ANIM_ICONS`.
|
|
419
|
+
- Reduced motion: drawings appear complete, morphs switch instantly (`auto` does not cycle), masks are not applied, icons stay still.
|
|
420
|
+
- Showcase: new **SVG** gallery category (draw, morph, mask, icons, `morphTo()` demo).
|
|
421
|
+
|
|
422
|
+
## [3.2.0] - 2026-10-07
|
|
423
|
+
|
|
424
|
+
### Added
|
|
425
|
+
- **Gestures** — new category `use-scroll-animate/components/gesture`:
|
|
426
|
+
- `gesture(el, handlers, options)` — one Pointer Events recognizer for **pan** (`dx`, `dy`, `vx`, `vy`, `first`, `last`), **swipe** (direction + velocity), **pinch** (two pointers, or Ctrl/⌘ + wheel / trackpad pinch), **long-press**, **tap** and **double-tap**; `axis` lock keeps native scrolling on the other axis. Release velocities go straight into springs: `spring.set(0, vx)`. Pure helpers `swipeDirection()` and `pinchScale()` are exported.
|
|
427
|
+
- `<usa-swipeable>` — swipe-to-dismiss / swipe actions: follows the finger (rubber-banded past `distance`), flies out on a swipe, springs home otherwise; `axis`, `distance`, `preset`, `dismiss`; Delete / arrow keys; cancelable `usa:swipe`, `usa:dismiss`.
|
|
428
|
+
- `<usa-pinch-zoom>` — pinch / Ctrl + wheel zoom, pan while zoomed, double-tap toggle, springs back inside bounds; `min`, `max`, `double-tap`; `+` / `-` / `0` keys; `usa:zoom`.
|
|
429
|
+
- Reduced motion: no follow or fly-out animation (events still fire), zoom changes instantly.
|
|
430
|
+
- Showcase: new **Gestures** gallery category with a live `gesture()` + spring demo.
|
|
431
|
+
|
|
432
|
+
## [3.1.0] - 2026-10-07
|
|
433
|
+
|
|
434
|
+
### Added
|
|
435
|
+
- **Timeline & choreography** — new category `use-scroll-animate/components/timeline`:
|
|
436
|
+
- `timeline()` — one playhead for many WAAPI animations: `.to(target, keyframes | preset, { at, duration, easing, stagger })`, `.label()`, `.call()`, `play()`, `reverse()`, `pause()`, `seek(ms | label)`, `progress(p)`, `scrub(section, { smooth })` and `cancel()`. Positions: `'>'` (chain, default), `'<'` (with previous), `'-=200'` (overlap), `'+=100'` (gap), `'<+=50'`, `'label+=100'` or absolute ms (`resolvePosition()` is exported).
|
|
437
|
+
- `TIMELINE_PRESETS`: `fade`, `fade-up/down/left/right`, `scale`, `blur`, `rotate`, `clip-up`, `clip-right`.
|
|
438
|
+
- `<usa-timeline>` — declarative: `data-tl` children become steps (`data-at`, `data-duration`, `data-label`); `trigger` (`view` · `click` · `manual`), `scrub`, `overlap`, `stagger`, `repeat`; `usa:complete`.
|
|
439
|
+
- Reduced motion: timelines jump to their end state, scrub is disabled; without WAAPI the final frames are applied.
|
|
440
|
+
- Showcase: new **Timeline & choreography** gallery category (declarative demo + interactive play / reverse / scrub slider).
|
|
441
|
+
|
|
442
|
+
## [3.0.0] - 2026-10-07
|
|
443
|
+
|
|
444
|
+
3.0 removes what 2.9 deprecated. Every change has a drop-in replacement — see **[Upgrading to 3.0](./docs/upgrading-3.md)** (run your app on 2.9 first: it warns once wherever old usage is found).
|
|
445
|
+
|
|
446
|
+
### ⚠ Breaking changes
|
|
447
|
+
- **`variant` no longer selects a component's kind.** `<usa-spinner>`, `<usa-check>`, `<usa-dialog>` and `<usa-acrylic>` use **`kind`** (`<usa-spinner kind="windows">`, `<usa-dialog kind="drawer-end">`, `<usa-acrylic kind="mica">`); `variant` on every element now only selects a style variant (`minimal`, `neon`, `glass`, `brutalist`, `fluent`, `material`). The `spinner.variant` property is removed (use `.kind`); internal state attributes are now `data-kind`.
|
|
448
|
+
- **Removed the legacy transform-based parallax** of the scroll engine: the `parallax` option of `observe()` / `animate()`, the `data-sa-parallax-x|y|rotate|scale|speed` attributes (also on `<scroll-animate>`) and the `ParallaxOptions` type. Use `parallax(el, { speed })` (writes `translate` + `--sa-parallax`, composes with entrance animations) or `progressVar`.
|
|
449
|
+
- **Node ≥ 20** for SSR imports (`engines`); Node 18 is end-of-life.
|
|
450
|
+
- CDN snippets in docs and the showcase now point at `use-scroll-animate@3`.
|
|
451
|
+
|
|
452
|
+
### Changed
|
|
453
|
+
- The scroll core is smaller without the legacy parallax path (`progress` tracking now only runs for `onProgress` / `progressVar`).
|
|
454
|
+
- `examples/vanilla` uses `parallax()`.
|
|
455
|
+
|
|
456
|
+
### Migration
|
|
457
|
+
| 2.x | 3.0 |
|
|
458
|
+
|---|---|
|
|
459
|
+
| `<usa-spinner variant="dots">` | `<usa-spinner kind="dots">` |
|
|
460
|
+
| `<usa-check variant="error">` | `<usa-check kind="error">` |
|
|
461
|
+
| `<usa-dialog variant="sheet">` | `<usa-dialog kind="sheet">` |
|
|
462
|
+
| `<usa-acrylic variant="mica">` | `<usa-acrylic kind="mica">` |
|
|
463
|
+
| `spinner.variant = 'ring'` | `spinner.kind = 'ring'` |
|
|
464
|
+
| `observe(el, { parallax: { y: 80 } })` / `data-sa-parallax-y="80"` | `parallax(el, { speed: 0.2 })` or `progressVar: '--p'` + CSS |
|
|
465
|
+
|
|
466
|
+
## [2.9.0] - 2026-10-07
|
|
467
|
+
|
|
468
|
+
### Added
|
|
469
|
+
- **React wrappers** `use-scroll-animate/components/react`: `createUsaComponents(React)` returns a typed wrapper for every `<usa-*>` element (`UsaButton`, `UsaCard`, `UsaToggle`, …) that sets properties (`checked`, `value`, `state`, `open`, …), forwards `ref` and maps `onUsaChange` / `onUsaDragEnd`-style props to `usa:*` events (works on React 18 and 19). `USA_TAGS`, `eventName()`, `pascal()`.
|
|
470
|
+
- **Vue integration** `use-scroll-animate/components/vue`: `isUsaElement` (`compilerOptions.isCustomElement`) and `UsaPlugin` (`app.use(UsaPlugin, { categories })`).
|
|
471
|
+
- **JSX types** `use-scroll-animate/components/jsx`: `UsaIntrinsicElements` / `UsaTag` / `UsaAttributes` to type raw `<usa-*>` tags in React, Preact or Solid JSX.
|
|
472
|
+
- **Lazy per-component registration** `use-scroll-animate/components/lazy`: `lazyDefine()` watches the DOM and dynamically imports only the categories whose tags are used (one chunk per category); `defineUsed(root)`, `loadCategory(cat)`, `categoryOfTag(tag)`.
|
|
473
|
+
- **Accessibility audit**: automated sweep that mounts every `<usa-*>` element in normal, reduced-motion and motion-`off` modes and checks roles / focusability of interactive elements and `aria-hidden` on decorative layers; [`docs/accessibility.md`](./docs/accessibility.md) (motion, keyboard map, roles & states, transparency).
|
|
474
|
+
- **Guides**: [`docs/frameworks-ssr.md`](./docs/frameworks-ssr.md) — Next.js (App Router), Astro (incl. MPA view transitions), Vue / Nuxt, Svelte, Solid, Angular, lazy loading.
|
|
475
|
+
- **Theme tokens** documented: `--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`, `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font`, `--usa-motion`.
|
|
476
|
+
- **Perf benchmark** `npm run bench` (`scripts/bench.mjs`, jsdom: define + mount/unmount N of every element) and size budgets for the new entries.
|
|
477
|
+
- **Showcase**: every card's parameter controls now flow into the generated code (HTML / ESM / React / Vue / desktop tabs) so what you tweak is what you copy; category navigation covers all 11 categories.
|
|
478
|
+
|
|
479
|
+
### Changed
|
|
480
|
+
- `COMPONENT_CATEGORIES` lives in a dependency-free module (re-exported unchanged) so the lazy loader and framework helpers do not pull in every component.
|
|
481
|
+
|
|
482
|
+
### Deprecated (removed in 3.0)
|
|
483
|
+
- `variant` as the **kind** selector of `<usa-spinner>`, `<usa-check>`, `<usa-dialog>` and `<usa-acrylic>` → use the new `kind` attribute / `.kind` property (`<usa-spinner kind="windows">`). `variant` is reserved for style variants. Old usage keeps working in 2.x with a one-time console warning.
|
|
484
|
+
- The transform-writing `parallax` option of `observe()` / `data-sa-parallax-*` attributes → use `parallax(el, { speed })` (CSS-variable based, composes with entrance transforms) or `progressVar`. One-time console warning.
|
|
485
|
+
- See [docs/upgrading-3.md](./docs/upgrading-3.md).
|
|
486
|
+
|
|
487
|
+
### Deferred
|
|
488
|
+
- Pixel-based visual regression tests need real browsers (Playwright) in CI; deferred to a later release (the jsdom suite covers behaviour, ARIA and reduced motion).
|
|
489
|
+
|
|
490
|
+
## [2.8.0] - 2026-10-07
|
|
491
|
+
|
|
492
|
+
### Added
|
|
493
|
+
- **Text effects** (in `components/text`): `<usa-wave-text>` (travelling letter wave), `<usa-glitch>` (RGB-split slice glitch, always / hover), `<usa-gradient-text>` (flowing multi-colour gradient fill), `<usa-handwriting>` (text draws itself stroke by stroke, then fills; `usa:complete`), `<usa-scroll-highlight>` (words light up as you read down the page, or `mode="marker"` highlighter sweep). Animated copies are `aria-hidden` with a plain screen-reader copy.
|
|
494
|
+
- **Backgrounds** (in `components/background`): `<usa-grid-glow>` (line grid lit around the pointer), `<usa-blobs>` (fluid morphing colour blobs), `<usa-water-ripple>` (interactive canvas water ripples, `drop(x, y)`), `<usa-dot-network>` (dot grid that swells and links to the pointer). Canvas effects run only while visible and the tab is shown, DPR ≤ 2.
|
|
495
|
+
- **Windows Fluent preset** `fluentPreset({ reveal, mica, selector })` (in `components/background`): `fluent` variant page-wide (Segoe UI Variable, Windows 11 accent, radii), Mica-style window tint, Acrylic on `.usa-acrylic` / `[data-acrylic]`, and **Reveal highlight** on buttons / `[data-fluent-reveal]`; returns an undo function.
|
|
496
|
+
- **WinUI 3 + WebView2 sample app** in [`examples/webview2-winui/`](./examples/webview2-winui/) (Windows App SDK, native Mica backdrop, `SetVirtualHostNameToFolderMapping`, `components.umd.js` + `fluentPreset()`), documented in `docs/windows-apps.md`.
|
|
497
|
+
- Reduced motion: wave / glitch / gradient flow stop, handwriting and highlights appear complete, backgrounds are static, no Reveal tracking; reduced transparency keeps materials solid.
|
|
498
|
+
- Showcase: the new text and background demos in their categories, plus a `fluentPreset()` card.
|
|
499
|
+
|
|
500
|
+
## [2.7.0] - 2026-10-07
|
|
501
|
+
|
|
502
|
+
### Added
|
|
503
|
+
- **Page & app-wide effects** — new category `use-scroll-animate/components/page` (+ `components/page.css`):
|
|
504
|
+
- **Page transitions** on the View Transitions API: `pageTransition(update, { effect })` for SPA route changes — `fade`, `slide` / `slide-left` / `slide-right` / `slide-up`, `circle` (reveal from the click point), `blinds`, `pixel` (stepped dissolve), `zoom`; `enableMpaTransitions(effect)` for multi-page sites (`@view-transition { navigation: auto }`); `themeTransition(apply)` circle-reveal theme switch. Falls back to an instant update (optional cross-fade) without View Transitions.
|
|
505
|
+
- `<usa-cursor mode="dot | trail | magnetic | glow">` custom cursors (fine pointers only, `hide-native`).
|
|
506
|
+
- `smoothScroll()` (inertial wheel smoothing, touch/keyboard stay native) and `scrollToTarget()` (spring timing).
|
|
507
|
+
- `<usa-fullpage>` full-screen snapping sections with keyboard paging and dot navigation.
|
|
508
|
+
- `<usa-loading-bar>` + `loadingBar.start() / set() / done() / track(promise)` top loading bar (the scroll progress bar remains `<usa-scroll-progress>`).
|
|
509
|
+
- `<usa-back-to-top>` with a reading-progress ring, spring scroll and focus return.
|
|
510
|
+
- `<usa-ambient effect="particles | snow | stars | noise | gradient">` page-wide ambient layer (scroll-driven gradient, canvas paused in hidden tabs).
|
|
511
|
+
- `<usa-splash>` launch / splash screen (`fade`, `scale`, `slide-up`, `circle` exit; `min` duration; `manual` + `done()`).
|
|
512
|
+
- `<usa-auto-skeleton loading>` automatic skeletons from the existing markup.
|
|
513
|
+
- **Global motion intensity**: `setMotionIntensity('off' | 'low' | 'normal' | 'high', persist?)`, `restoreMotionIntensity()`, `getMotionIntensity()`, `configureComponents({ motionIntensity })` and the `<usa-motion-switch>` control. It scales every component animation (and `spring()`), sets `--usa-motion` / `data-usa-motion` on `<html>`, and `off` behaves like `prefers-reduced-motion`.
|
|
514
|
+
- Reduced motion: transitions update instantly, no cursor / smooth scrolling / ambient animation, instant jumps.
|
|
515
|
+
- Showcase: **Page & app-wide** category with live page-transition, theme reveal, cursor, ambient, splash, loading-bar, auto-skeleton, fullpage and motion-intensity demos.
|
|
516
|
+
|
|
517
|
+
## [2.6.0] - 2026-10-07
|
|
518
|
+
|
|
519
|
+
### Added
|
|
520
|
+
- **Style variants** for every component: `variant="minimal | neon | glass | brutalist | fluent | material"` on any `<usa-*>` element, `data-usa-variant` on any ancestor, or `setVariant()` for the whole app. Variants set shared design tokens (`--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`, `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font`) that the components read (existing `<usa-toggle>`, `<usa-progress>`, cards, checkbox… now use `--usa-accent`). `fluent` follows the Windows 11 palette (light/dark), `material` Material 3. `defineComponents()` injects the token sheet; it is also in `components.css`.
|
|
521
|
+
- **UI components** — new category `use-scroll-animate/components/ui` (+ `components/ui.css`):
|
|
522
|
+
- `<usa-tabs>` (sliding spring indicator, `line` / `pill`, roving tabindex, panels slide in from the direction of travel),
|
|
523
|
+
- `<usa-drawer>` (left / right / top / bottom, spring in, drag / swipe to close, backdrop, Esc, focus return),
|
|
524
|
+
- `<usa-bottom-sheet>` (snap points, inertia, drag-down-to-dismiss, grabber),
|
|
525
|
+
- `<usa-pull-refresh>` (rubber-band pull, `usa:refresh` with `detail.done()`, `aria-busy` + status),
|
|
526
|
+
- `<usa-fab>` (speed dial: up / down / left / right / radial, staggered spring, `aria-expanded`, inert while closed),
|
|
527
|
+
- `<usa-navbar>` (auto-hide on scroll down, show on scroll up, `shrink`, page or `target` scroller),
|
|
528
|
+
- `<usa-slider>` (form-associated `role="slider"`, spring thumb, value bubble, full keyboard),
|
|
529
|
+
- `<usa-rating>` (hover preview, spring pop, number keys, `readonly`, form value),
|
|
530
|
+
- `<usa-tooltip>` (spring-in, flips to stay on screen, `aria-describedby`),
|
|
531
|
+
- `<usa-popover>` (click-to-open, spring from the trigger, Esc / outside click, focus return),
|
|
532
|
+
- `<usa-badge>` (spring bump on change, `99+`, `dot`, `pulse`),
|
|
533
|
+
- `<usa-avatar-stack>` (overlap that spreads on hover, `+N`).
|
|
534
|
+
- All respect `prefers-reduced-motion` (instant open/close, no bumps, pulses or spreading).
|
|
535
|
+
- Showcase: **UI components & variants** category with live demos and per-card variant pickers, plus a `setVariant()` card.
|
|
536
|
+
|
|
537
|
+
## [2.5.0] - 2026-10-07
|
|
538
|
+
|
|
539
|
+
### Added
|
|
540
|
+
- **Click & tap** — new category `use-scroll-animate/components/click` (+ `components/click.css`):
|
|
541
|
+
- **Button click deformation (按钮点击形变)** — `<usa-button>` around a native `<button>` / `<a>` (or acting as a button itself), spring-driven:
|
|
542
|
+
- `deform="squash"` (squash on press, stretch-and-settle on release), `"wobble"` (elastic border-radius wobble), `"gooey"` (liquid droplets squeeze out from the press point and merge back, SVG goo filter), `"dent"` (the surface dents toward the pressed point: 3D tilt + inner shade). Combinable: `deform="squash wobble"`.
|
|
543
|
+
- **Shape morph** `shape="pill | circle | icon"` / `morphTo(shape)`: the outline springs between pill, circle and icon-only, label (`[data-label]`) and icon (`[data-icon]`) cross-fade.
|
|
544
|
+
- **Submit morph** `morph="submit"`: click → `loading` (shrinks to a spinner, `aria-busy`, live "Loading…" status) → `success` (drawn check) or `error` (shake + cross) → back to `idle` after `reset` ms. Drive with `state` or `event.detail.done(ok)` from `usa:submit`.
|
|
545
|
+
- `<usa-icon-morph>`: point-interpolated, spring-driven icon morphs — `play ↔ pause`, `menu ↔ close`, `plus ↔ minus`, `check`, `arrow-right` (any pair); `toggle` + `labels` make it an accessible button. `MORPH_ICONS`, `morphPath()`.
|
|
546
|
+
- `<usa-click effect="…">` (combinable): enhanced `ripple`, `burst` particles (`shape`: circle, square, star, heart, emoji), `confetti`, `squish`, `press-spring`, `shake` (also on `invalid` form fields).
|
|
547
|
+
- `<usa-like>` (heart pop + burst, `aria-pressed`, count), `<usa-hold>` (hold-to-confirm progress ring; pointer, Space, Enter), `<usa-double-tap>` (heart at the tap point; `L` key), `<usa-checkbox>` (form-associated, spring box, self-drawing check, `indeterminate`).
|
|
548
|
+
- Functions: `burst(x, y, opts)`, `confetti(opts)`, `shake(el)`, `haptic(pattern)` (`navigator.vibrate` where supported); `haptic` attribute on the elements.
|
|
549
|
+
- Reduced motion: no deformation, particles or shaking (an outline flash instead); shape, icon and state changes are instant; statuses are still announced.
|
|
550
|
+
- Showcase: **Click & tap** category with button-deformation, shape-morph, submit, icon-morph, like, hold, double-tap, checkbox and confetti demos.
|
|
551
|
+
|
|
552
|
+
## [2.4.0] - 2026-10-07
|
|
553
|
+
|
|
554
|
+
### Added
|
|
555
|
+
- **Card effects** — new category `use-scroll-animate/components/cards` (+ `components/cards.css`):
|
|
556
|
+
- `<usa-card effect="…">` with ten **combinable** effects (`effect="lift sheen"`): `flip` (hover or `trigger="click"`, `axis="y|x"`, `[data-front]` / `[data-back]`, `aria-pressed`), `holo` (holographic foil following the pointer), `glass` (frosted backdrop blur; solid under `prefers-reduced-transparency` / forced colours), `border-glow`, `conic-border` (rotating gradient border), `lift` (spring rise + slight tilt), `spotlight`, `sheen` (light sweep), `parallax-layers` (`[data-depth]` children) and `expand` (card → detail view with FLIP + spring; Esc / backdrop / `[data-close]` collapse). Pointer position is exposed as `--usa-card-x/-y` and `--usa-card-nx/-ny`.
|
|
557
|
+
- `<usa-card-stack>`: swipeable deck (pointer, touch, arrow keys) with a spring fan-out, `loop`, `usa:swipe` / `usa:empty`.
|
|
558
|
+
- `<usa-sticky-stack>`: cards stick while scrolling and covered cards shrink and dim.
|
|
559
|
+
- `<usa-carousel-3d>`: items on a 3D ring rotated by drag, keys, clicks or `autoplay`, spring-driven, `aria-current` on the front item.
|
|
560
|
+
- Reduced motion: no pointer tracking, tilt, parallax or sweeps; flips and expansions cross-fade; the carousel switches flat and instantly.
|
|
561
|
+
- Showcase: **Card effects** category (effect picker, flip, expand, swipe deck, 3D carousel) and a live sticky-stack section. The gallery now allows several demo cards per element.
|
|
562
|
+
|
|
563
|
+
## [2.3.0] - 2026-10-07
|
|
564
|
+
|
|
565
|
+
### Added
|
|
566
|
+
- **Spring & physics** — new category `use-scroll-animate/components/physics` (+ `components/physics.css`):
|
|
567
|
+
- **Spring core**: a damped-spring solver (`stiffness`, `damping`, `mass`, initial `velocity`) with presets `gentle`, `wobbly`, `stiff`, `bouncy` (plus `default`, `slow`, `molasses`). `springEasing()` converts a spring into a CSS `linear()` easing + duration for WAAPI/CSS (cubic-bezier fallback where `linear()` is unsupported); `spring(el, keyframes, preset)` animates with it; `createSpring()` is an interruptible, velocity-preserving spring value for gestures. Helpers `projectInertia()` (flick projection), `snapTo()` (grid / points) and `rubberBand()` (iOS-style resistance).
|
|
568
|
+
- `<usa-spring>`: `bounce-in`, `pop`, `drop` entrances with true spring timing, `jelly` and `rubber-band` attention effects; `trigger="view|hover|click|manual"`, `preset` or `stiffness`/`damping`/`mass`, `repeat`.
|
|
569
|
+
- `<usa-draggable>`: drag with mouse, touch, pen or arrow keys; `spring-back`, `inertia`, `snap` (grid or points), `bounds="parent"` with rubber-banding, `axis`; events `usa:drag-start` / `usa:drag-end` / `usa:settle`.
|
|
570
|
+
- `<usa-overscroll>`: elastic scroll container — pulling past an edge (touch, trackpad, wheel) stretches with rubber-band resistance and springs back.
|
|
571
|
+
- Reduced motion: entrances fade, attention effects and overscroll stretch are skipped, springs jump to their target.
|
|
572
|
+
- Showcase: new **Spring & physics** category in the component gallery with live demos (effect / preset pickers, drag areas, elastic list, `spring()` playground).
|
|
573
|
+
- `npm run sync:exports` regenerates the per-category `exports` from `scripts/categories.mjs` (single list used by Rollup, the CSS bundle and a sync test).
|
|
574
|
+
|
|
575
|
+
## [2.2.0] - 2026-10-07
|
|
576
|
+
|
|
577
|
+
### Added
|
|
578
|
+
- **Animated components** — `use-scroll-animate/components`: 30 framework-agnostic, dependency-free `<usa-*>` custom elements (Custom Elements + CSS + Web Animations API) that run in browsers and in Windows desktop apps rendering with a web view (Electron, Tauri, WebView2 in WinUI 3 / WPF / WinForms, PWAs). Organised in six categories, each its own subpath export:
|
|
579
|
+
- **Entrance & scroll** (`/components/reveal`): `<usa-reveal>` (12 effects, `repeat`), `<usa-stagger>`, `<usa-scroll-progress>` (page or `target`, `role="progressbar"`), `<usa-scrolly>` (sticky scrollytelling with `usa:step`).
|
|
580
|
+
- **Text** (`/components/text`): `<usa-typewriter>`, `<usa-split-text>`, `<usa-scramble>`, `<usa-counter>` (`Intl.NumberFormat`, animated `.value`), `<usa-shimmer-text>`, `<usa-text-rotate>`. Animated text keeps a visually hidden plain copy for screen readers.
|
|
581
|
+
- **Interaction** (`/components/interaction`): `<usa-ripple>`, `<usa-magnetic>`, `<usa-tilt>` (glare, `--usa-tilt-x/y`), `<usa-spotlight>` (Fluent Reveal highlight), `<usa-press>`, `<usa-toggle>` (`role="switch"`, form-associated).
|
|
582
|
+
- **Loading & feedback** (`/components/feedback`): `<usa-spinner>` (`fluent` WinUI ring, `windows` orbiting dots, `ring`, `dots`, `pulse`, `bars`), `<usa-skeleton>`, `<usa-progress>` (Fluent indeterminate, paused / error states), `<usa-toaster>` + `toast()`, `<usa-check>`.
|
|
583
|
+
- **Background & decoration** (`/components/background`): `<usa-aurora>`, `<usa-particles>` (canvas, runs only while visible), `<usa-grain>`, `<usa-marquee>`, `<usa-acrylic>` (Acrylic / Mica, solid under `prefers-reduced-transparency` / forced colours).
|
|
584
|
+
- **Transitions** (`/components/transitions`): `<usa-dialog>` (native `<dialog>`; modal, drawers, sheet), `<usa-accordion>` (native `<details>`), `<usa-flip-list>`, `<usa-view-switch>`, and the helpers `viewTransition()` (View Transitions API with fallback), `flip()` and `connectedAnimation()` (WinUI-style shared-element animation).
|
|
585
|
+
- `defineComponents(categories?)`, `define<Category>Components()`, one `define*()` per element (custom tag names supported), `COMPONENT_CATEGORIES`, `configureComponents({ injectStyles, reducedMotion })`. Typed via `HTMLElementTagNameMap`.
|
|
586
|
+
- Every component honours `prefers-reduced-motion`, animates `transform` / `opacity` (and `filter` for blurs), batches layout reads/writes per frame, pauses loops off-screen / in hidden tabs, and is SSR-safe (no DOM access at import; `define*()` is a no-op on the server).
|
|
587
|
+
- Styles are injected per component as constructable stylesheets (CSP `style-src 'self'` friendly) or loaded as files: `use-scroll-animate/components.css` and `use-scroll-animate/components/<category>.css`.
|
|
588
|
+
- **No-build bundle** `dist/components.umd.js` (IIFE/UMD, global `UsaComponents`) registers every element on load.
|
|
589
|
+
- Docs: [`docs/components.md`](./docs/components.md) (every element, attribute, method and event, by category) and [`docs/windows-apps.md`](./docs/windows-apps.md) (Electron, Tauri, WinUI 3 / WPF / WinForms with WebView2, PWA, CSP, native Mica). README sections in English, 中文 and 日本語.
|
|
590
|
+
- **Showcase**: new component gallery `showcase/components.html` with category navigation, search, live demos of every element, per-card code tabs (HTML / ES module / React / Vue / Electron·Tauri·WebView2), English / 中文, dark / light; linked from the Animation Store and deployed by the existing Pages workflow.
|
|
591
|
+
- Size budgets for the bundle, the CSS file, each category and single-component imports (`size-budget.json`); `check:exports` covers the new entries and stylesheets.
|
|
592
|
+
|
|
593
|
+
### Changed
|
|
594
|
+
- `package.json` `sideEffects` is now `["*.css"]` (was `false`) so bundlers keep the optional stylesheet imports; all JS stays side-effect free.
|
|
595
|
+
|
|
596
|
+
## [2.1.0] - 2026-10-07
|
|
597
|
+
|
|
598
|
+
### Added
|
|
599
|
+
- **Showcase site** (`showcase/`): an "Animation Store" where every preset, feature (stagger, exit, parallax, progressVar, native engine, sequence, combined presets, spring easings) and framework adapter (React, Vue, Svelte, Solid, `<scroll-animate>`) is a product card with a live preview. Opening a card expands it (View Transitions API, FLIP fallback) into a detail view with a tweakable live demo (duration, easing, delay, distance, once/repeat, exit), a scroll test, and generated code for Vanilla / React / Vue / Svelte / Solid / HTML element / CDN with copy buttons. Search, category filters, favorites (localStorage), deep links (`#preset-name`), dark/light theme, English/中文, `prefers-reduced-motion` respected. No build step: it imports the library from `dist/` (dogfooding), falling back to the CDN build.
|
|
600
|
+
- **GitHub Pages workflow** (`.github/workflows/pages.yml`): builds `dist/` and deploys `showcase/` + `demo/` on every push to `main`.
|
|
601
|
+
|
|
602
|
+
## [2.0.1] - 2026-10-07
|
|
603
|
+
|
|
604
|
+
Bug-fix release; no API changes.
|
|
605
|
+
|
|
606
|
+
### Fixed
|
|
607
|
+
- Native engine (`engine: 'css'` / `'auto'`): elements that left the DOM (pruned by `watch()` / `init()`) stayed referenced by the instance until `destroy()`, which then cancelled their animations and rewrote their styles. They are now released when pruned.
|
|
608
|
+
|
|
609
|
+
### Changed (maintenance)
|
|
610
|
+
- Test for function easings no longer depends on the test DOM lacking `CSS.supports`.
|
|
611
|
+
- Dependabot ignores semver-major npm updates (TypeScript 7 breaks the Rollup build, jsdom 30 drops Node 20); majors are adopted deliberately.
|
|
612
|
+
|
|
613
|
+
## [2.0.0] - 2026-10-07
|
|
614
|
+
|
|
615
|
+
2.0 collects the 1.6–1.9 roadmap (native scroll timeline, Svelte/Solid/Web Component entries, exit animations and `parallax()`, docs and demo) and removes what 1.9 deprecated. See **MIGRATION from 1.x** below.
|
|
616
|
+
|
|
617
|
+
### ⚠ Breaking changes
|
|
618
|
+
- **`engine` defaults to `'auto'`**: presets run on the native scroll-driven timeline (`animation-timeline: view()`) where supported — scroll-linked instead of time-based. `'auto'` still picks the JS engine when an element sets `duration`, `delay`, `offset` or `stagger` itself. Set `defaultEngine: 'js'` for 1.x behaviour.
|
|
619
|
+
- **Removed** the `createReactHooks` / `createVueComposables` re-exports from the main entry: import them from `use-scroll-animate/react` / `use-scroll-animate/vue`.
|
|
620
|
+
- **ESM-first package** (`"type": "module"`): `import` → `dist/*.js` + `dist/*.d.ts`, `require` → `dist/*.cjs` + `dist/*.d.cts` for every entry; `main` is `dist/index.cjs`.
|
|
621
|
+
- **Removed legacy build artefacts**: the `module` field, `dist/index.esm.js`, `dist/index.mjs`, `dist/*.d.mts`, the per-file `dist/types/*` declarations, and `use-scroll-animate/dist/*` deep imports (only the documented entry points resolve). `dist/index.umd.js` and `dist/element.umd.js` keep their CDN URLs.
|
|
622
|
+
- **ES2020 output** (was ES2018): optional chaining / nullish coalescing are no longer down-levelled. Every browser that has `Animation.commitStyles()` (Chrome 84, Firefox 75, Safari 13.1), which the library already relied on, supports ES2020. Together with the removed re-exports: UMD 7.55 → 6.99 kB gz, core-only import 5.63 → 5.40 kB gz.
|
|
623
|
+
- `engines.node >= 18` declared (only relevant for SSR imports).
|
|
624
|
+
|
|
625
|
+
### Added
|
|
626
|
+
- **Native scroll-driven engine** (1.6): new `engine: 'auto' | 'js' | 'css'` option (`defaultEngine` config, `data-sa-engine` attribute). With `'auto'`/`'css'`, browsers that support `animation-timeline: view()` run the preset on a native `ViewTimeline` (scroll-linked, off the main thread); others fall back to the JS engine (default `'auto'`, see Breaking changes). New `viewRange` option (`data-sa-view-range`) and `supportsScrollTimeline()` helper.
|
|
627
|
+
- **Svelte actions** (1.7): `use-scroll-animate/svelte` exports `scrollAnimate` and `scrollStagger` (`use:` actions with `update`/`destroy`; no `svelte` import).
|
|
628
|
+
- **Solid primitives** (1.7): `use-scroll-animate/solid` exports the `scrollAnimate` / `scrollStagger` directives (typed via `JSX.Directives`) and `useScrollAnimate()` ref primitive. `solid-js` is an optional peer dependency.
|
|
629
|
+
- **`<scroll-animate>` Web Component** (1.7): `use-scroll-animate/element` exports `defineScrollAnimate(tagName?, instance?)`; attributes mirror `data-sa-*`, and it dispatches `sa:enter`/`sa:leave`/`sa:start`/`sa:complete`/`sa:progress` events. `dist/element.umd.js` registers it on load for CDN use.
|
|
630
|
+
- **Subpath exports** (1.7): `./react`, `./vue`, `./svelte`, `./solid`, `./element` (ESM + CJS, each with types). Entries share code through `dist/chunks/`, so importing several never duplicates the core. Optional peer dependencies: `solid-js`, `svelte`.
|
|
631
|
+
- **Exit animations** (1.8): `exit: true | preset | presets | { from, to }` (`data-sa-exit`, `exit` attribute on `<scroll-animate>`) plays the entrance (or the given animation) in reverse when the element leaves the viewport and replays the entrance on re-entry; implies `repeat` unless set. Scroll-linked over the `exit` range with the native engine; class swap in class-name mode; skipped under reduced motion.
|
|
632
|
+
- **`parallax(target, { speed, axis, progressVar, root, respectReducedMotion })`** (1.8): standalone parallax helper on the scroll-progress scale used by `progressVar`. Writes the progress to `--sa-parallax` and the offset to the individual `translate` property (composes with `transform`/entrance animations); no offset under reduced motion; listens only while targets are visible; returns a stop function. < 1 kB gzipped when tree-shaken.
|
|
633
|
+
- **Size budgets** (1.6): `size-budget.json` defines a gzip budget per entry (UMD bundle and tree-shaken imports); `npm run size:check` fails when one is exceeded and runs in CI.
|
|
634
|
+
- **Docs** (1.9): `docs/API.md` (full API reference), `docs/migration-from-aos.md`, `docs/migration-from-gsap-scrolltrigger.md`, `docs/deprecations.md` (now "Upgrading to 2.0"), and `demo/index.html` — a no-build preset playground (every preset clickable, scroll-triggered cards, parallax) that loads the UMD bundle.
|
|
635
|
+
|
|
636
|
+
### Changed
|
|
637
|
+
- The default instance export is annotated `/* @__PURE__ */`, so bundlers drop the core when only standalone helpers such as `parallax` are imported (1.8).
|
|
638
|
+
- Size budgets for the UMD bundle and "import everything" raised from 7.5 to 8 kB gzip for exit + parallax (1.8).
|
|
639
|
+
- Build (1.7): ESM/CJS entries are small files that import shared chunks from `dist/chunks/`; the UMD bundles stay single files.
|
|
640
|
+
- Build uses Rollup's ESM config (`rollup.config.mjs`); `@rollup/plugin-commonjs` dropped (no CommonJS inputs). `npm run build` cleans `dist/` first.
|
|
641
|
+
|
|
642
|
+
### Fixed
|
|
643
|
+
- Class-name mode: `destroy()` now clears pending completion timers, so `onComplete` no longer fires after the instance was destroyed. Other instances' timers are unaffected.
|
|
644
|
+
|
|
645
|
+
### Repository
|
|
646
|
+
- Dependabot (npm + GitHub Actions, weekly, grouped), issue templates (bug report, feature request) and a pull-request template.
|
|
647
|
+
|
|
648
|
+
### MIGRATION from 1.x
|
|
649
|
+
|
|
650
|
+
1. **React / Vue imports**
|
|
651
|
+
```diff
|
|
652
|
+
- import { createReactHooks } from 'use-scroll-animate';
|
|
653
|
+
+ import { createReactHooks } from 'use-scroll-animate/react';
|
|
654
|
+
- import { createVueComposables } from 'use-scroll-animate';
|
|
655
|
+
+ import { createVueComposables } from 'use-scroll-animate/vue';
|
|
656
|
+
```
|
|
657
|
+
(1.9 already logged a dev-only warning for these.)
|
|
658
|
+
2. **Engine**: if you rely on time-based entrances (`duration`/`delay` set globally via `defaultDuration`/`defaultDelay`, `onComplete` timing, `threshold`-based triggering), keep 1.x behaviour with
|
|
659
|
+
```js
|
|
660
|
+
ScrollAnimate.configure({ defaultEngine: 'js' }); // default instance
|
|
661
|
+
createScrollAnimate({ defaultEngine: 'js' }); // own instances
|
|
662
|
+
```
|
|
663
|
+
or per element `engine: 'js'` / `data-sa-engine="js"`. Elements that set `duration`, `delay`, `offset` or `stagger` themselves already stay on JS.
|
|
664
|
+
3. **Deep imports**: replace `use-scroll-animate/dist/index.js`, `dist/index.mjs`, `dist/index.esm.js` or `dist/types/...` with `use-scroll-animate` (or a subpath entry). Type-only imports come from the package name: `import type { AnimateOptions } from 'use-scroll-animate'`.
|
|
665
|
+
4. **CommonJS** consumers: `require('use-scroll-animate')` keeps working (now `dist/index.cjs`). If you referenced `dist/index.js` as CommonJS by path, it is ESM now.
|
|
666
|
+
5. **`<script>` / CDN**: no change — `https://unpkg.com/use-scroll-animate/dist/index.umd.js` (global `ScrollAnimate`) and `dist/element.umd.js`.
|
|
667
|
+
6. **Old browsers**: if you must support browsers without ES2020 (pre-2020 Safari/Chrome), transpile `use-scroll-animate` in your bundler, or stay on 1.x.
|
|
668
|
+
|
|
669
|
+
## [1.5.0] - 2026-10-07
|
|
670
|
+
|
|
671
|
+
### Added
|
|
672
|
+
- `watch(root?)` instance method: automatically observes `[data-sa]` elements added to the DOM later; returns a stop function, and `destroy()` stops all watchers.
|
|
673
|
+
- `progressVar` option and `data-sa-progress-var` attribute: expose scroll progress (0–1) as a CSS custom property.
|
|
674
|
+
|
|
675
|
+
### Fixed
|
|
676
|
+
- Stopping `staggerChildren` or cancelling a triggered `sequence()` before the content entered the viewport left it at `opacity: 0`; it is now restored (also affects React/Vue `useScrollStagger` unmounting off-screen).
|
|
677
|
+
|
|
678
|
+
### Tests / CI
|
|
679
|
+
- 47 new tests covering reduced motion, SSR, unmount cleanup and lifecycle; CI job timeout and `npm pack --dry-run`.
|
|
680
|
+
|
|
681
|
+
## [1.4.0] - 2026-10-06
|
|
682
|
+
|
|
683
|
+
### Added
|
|
684
|
+
|
|
685
|
+
- **True scroll progress** (`progressMode: 'scroll'`, `data-sa-progress="scroll"`, opt-in): `onProgress` and parallax receive 0→1 as the element travels through the viewport (top enters at the bottom → bottom leaves at the top), including elements taller than the screen. Uses one shared, passive, rAF-throttled scroll listener that is only attached while tracked elements are on screen. New helper `getScrollProgress(el, root?)`.
|
|
686
|
+
- **`staggerChildren(container, options, instance?)`** for vanilla JS, and **`observeChildren: true`** for it and `useScrollStagger`: a `MutationObserver` animates children added later. Children added before the reveal join the stagger; children added after it animate when they enter the viewport, staggered per batch.
|
|
687
|
+
- **Vue `useScrollStagger`** composable (`{ staggerRef }`).
|
|
688
|
+
- **`sequence(steps, options)`** timeline helper: chain animations across targets with `gap` (negative = overlap), `at` (absolute start), per-step `stagger`, optional `trigger` element to auto-play once; `play()` returns a Promise, plus `cancel()` and `duration()`.
|
|
689
|
+
- **New presets**: `scale-up`, `blur-in-up`, `flip-up`, `flip-down`, `rotate-left`, `rotate-right`, `clip-up`, `clip-down`, `clip-left`, `clip-right`, `clip-circle`.
|
|
690
|
+
- **`autoUnregister`** config (default `true`): finished `once` elements that don't need parallax/`onProgress` are removed from the registry right after they animate, freeing memory. They are tracked in a `WeakSet`, so `init()`/`observe()`/`refresh()` never re-hide or replay them; `unobserve()` forgets them.
|
|
691
|
+
- **`exports` map**: `import` → `dist/index.mjs` + `dist/index.d.mts`, `require` → `dist/index.js` + `dist/index.d.ts` (bundled declarations). `main`, `module`, `unpkg`, `types` (old `dist/types/*` still shipped) and `dist/*` deep imports are kept for backward compatibility. Added `"type": "commonjs"`.
|
|
692
|
+
- **GitHub Actions CI** (Node 20/22/24): typecheck, test, build, exports smoke test, publint + are-the-types-wrong, bundle size summary.
|
|
693
|
+
- Scripts: `check:exports`, `lint:package`, `size`.
|
|
694
|
+
|
|
695
|
+
### Fixed
|
|
696
|
+
|
|
697
|
+
- Presets that don't animate `opacity` (`slide-*`, `scale-x`, `scale-y`, `pulse`, `swing`, and custom `{ from, to }` without opacity) stayed invisible after `observe()`, because the `opacity: 0` applied while waiting to enter was never cleared.
|
|
698
|
+
|
|
699
|
+
### Changed
|
|
700
|
+
|
|
701
|
+
- `getObservedElements()` no longer lists finished `once` elements (see `autoUnregister`; set it to `false` for the previous behaviour).
|
|
702
|
+
- `useScrollStagger` (React) now delegates to `staggerChildren`; behaviour without `observeChildren` is unchanged.
|
|
703
|
+
|
|
704
|
+
### Fixed (audit, #1)
|
|
705
|
+
|
|
706
|
+
- **Parallax never worked after the entrance animation**: the `fill: 'both'` animation kept overriding the inline `transform`, and with the default `once: true` the progress observer was disconnected on first entry. Finished animations now commit their end state and are cancelled; the progress observer stays active.
|
|
707
|
+
- **`repeat` did not re-hide elements** (the old filling animation kept them visible) and stacked a new `Animation` on every entry. Running animations are now tracked, cancelled and replaced.
|
|
708
|
+
- **SSR**: `init()` / `observe()` threw `ReferenceError: document is not defined` on the server. All entry points are now no-ops without a DOM.
|
|
709
|
+
- **No IntersectionObserver**: elements were hidden and then `observe()` threw, leaving content invisible. Content is now shown immediately.
|
|
710
|
+
- **Reduced motion** was ignored by the React/Vue integrations and by parallax. Elements are no longer hidden and no motion is applied when `prefers-reduced-motion: reduce` is set (callbacks still fire).
|
|
711
|
+
- **`offset`** discarded the right/left sides of `rootMargin` and produced an invalid margin (`--20px`, which throws) for negative offsets.
|
|
712
|
+
- **`threshold` arrays** (including `data-sa-threshold="0,0.5"`) were truncated to the first value.
|
|
713
|
+
- **Custom easing functions** only interpolated `translateY`; every other transform (scale, rotate, translateX, combined presets) jumped at 50%. Uses CSS `linear()` where supported, and generic value interpolation otherwise.
|
|
714
|
+
- **`stagger`** delays grew with every registered sibling, so items scrolled into view later waited seconds. Stagger is now relative to the batch of siblings revealed together.
|
|
715
|
+
- **`refresh()`** re-hid and replayed elements that had already animated.
|
|
716
|
+
- **`unobserve()` / `destroy()`** left never-animated elements permanently invisible.
|
|
717
|
+
- **Detached elements** were kept in the registry forever (memory leak in SPAs); they are now pruned.
|
|
718
|
+
- **`useClassNames`** never applied `hiddenClass` on observe (only after a `repeat` leave).
|
|
719
|
+
- **React hooks** used stale callbacks from the first render and ignored `once`, `offset` and easing functions; Vue composable likewise. Both now delegate to the core engine.
|
|
720
|
+
- Malformed `data-sa-easing` JSON or invalid easing strings no longer throw; numeric `data-sa-parallax-x/y` values are treated as px; NaN numeric attributes are ignored.
|
|
721
|
+
- Vanilla example used TypeScript syntax and a non-existent `ScrollAnimate.createScrollAnimate`.
|
|
722
|
+
|
|
723
|
+
### Changed (audit, #1)
|
|
724
|
+
|
|
725
|
+
- **Performance**: IntersectionObservers are shared between elements with the same root/threshold/rootMargin instead of one (or two, with a 101-step threshold list) per element.
|
|
726
|
+
- Removed the `browser` field from `package.json` (it made webpack resolve the minified UMD build instead of the ESM build); added `unpkg`, `jsdelivr`, `files`, `sideEffects`, repository metadata, and real `test`/`typecheck` scripts.
|
|
727
|
+
- `ParallaxOptions` is now exported from the package entry.
|
|
728
|
+
- Preset end keyframes use explicit units (`translateY(0px)`, `rotateX(0deg)`); visually identical.
|
|
729
|
+
- `tsconfig` uses `moduleResolution: "bundler"` (TypeScript 6 rejects `node`/`node10`).
|
|
730
|
+
- Added a Vitest + jsdom test suite (25 tests).
|
|
731
|
+
- README: accurate size, full option/attribute table, instance API, UMD, React & Vue usage.
|
|
732
|
+
|
|
733
|
+
## [1.3.0] - 2025-03-25
|
|
734
|
+
|
|
735
|
+
### Added
|
|
736
|
+
|
|
737
|
+
- **Custom Easing Curves**: Support for passing a `cubic-bezier` array (e.g., `[0.34, 1.56, 0.64, 1]`) to the `easing` option.
|
|
738
|
+
- **Easing Functions**: Support for passing a custom JavaScript function `(t: number) => number` to the `easing` option for complete control over animation timing.
|
|
739
|
+
- **New Physics Presets**: Added `soft-spring` and `heavy-bounce` easing presets.
|
|
740
|
+
- **HTML Data Attribute Support**: Added support for parsing JSON-style arrays in `data-sa-easing` (e.g., `data-sa-easing="[0.1, 0.7, 1.0, 0.1]"`).
|
|
741
|
+
|
|
742
|
+
### Changed
|
|
743
|
+
|
|
744
|
+
- Updated `EasingType` to include `number[]` and `(t: number) => number`.
|
|
745
|
+
- Refactored `runAnimation` to handle custom easing functions by generating intermediate keyframes.
|
|
746
|
+
- Enhanced `resolveEasing` to handle array-based cubic-bezier definitions.
|
|
747
|
+
|
|
748
|
+
## [1.2.0] - 2025-03-25
|
|
749
|
+
|
|
750
|
+
### Added
|
|
751
|
+
|
|
752
|
+
- **Once Control**: New `once` option to automatically stop observing an element after its animation has triggered, saving system resources.
|
|
753
|
+
- **Viewport Offset**: New `offset` option to specify how many pixels an element must enter the viewport before the animation starts.
|
|
754
|
+
- **New Animation Presets**: Added `shimmer`, `pulse`, and `swing`.
|
|
755
|
+
- **Multi-language Documentation**: Added Chinese (`README_zh.md`) and Japanese (`README_ja.md`) documentation.
|
|
756
|
+
- **Fallback Support**: Added a fallback mechanism for browsers that do not support the Web Animations API.
|
|
757
|
+
|
|
758
|
+
### Fixed
|
|
759
|
+
|
|
760
|
+
- **Memory Leak**: Improved `IntersectionObserver` cleanup by using `disconnect()` instead of `unobserve()` in key areas.
|
|
761
|
+
- **Stagger Bug**: Fixed an issue where `stagger` animation indices were incorrectly calculated when DOM elements were added dynamically.
|
|
762
|
+
- **Type Safety**: Improved TypeScript definitions for better developer experience.
|
|
763
|
+
|
|
764
|
+
## [1.1.0] - 2025-03-25
|
|
765
|
+
|
|
766
|
+
### Added
|
|
767
|
+
|
|
768
|
+
- **Multiple Animations**: Support for applying multiple animation presets simultaneously (e.g., `["fade-in-up", "zoom-in"]`).
|
|
769
|
+
- **Parallax Effect**: New `parallax` option for creating scroll-driven parallax effects (`x`, `y`, `rotate`, `scale`, `speed`).
|
|
770
|
+
- **Scroll Progress Listener**: New `onProgress` callback that provides real-time scroll progress (0 to 1) for an element.
|
|
771
|
+
- **New Animation Presets**: Added `skew-in`, `scale-x`, `scale-y`.
|
|
772
|
+
- **Threshold Array Support**: `threshold` option now accepts an array of numbers for more granular progress tracking.
|
|
773
|
+
|
|
774
|
+
## [1.0.0] - 2025-03-25
|
|
775
|
+
|
|
776
|
+
### Added
|
|
777
|
+
|
|
778
|
+
- Initial release of `use-scroll-animate`.
|
|
779
|
+
- 16 built-in animation presets.
|
|
780
|
+
- Core `ScrollAnimate` singleton.
|
|
781
|
+
- HTML `data-sa` attribute API.
|
|
782
|
+
- React and Vue 3 integrations.
|
|
783
|
+
- Zero dependencies.
|
|
784
|
+
- ~2.9KB gzipped UMD bundle.
|