Repository navigation
Releases: Boston343/motion-on-scroll
Release list
v1.1.0
Closer AOS parity, a standalone CDN build, and a round of lifecycle fixes. Works with Motion 12.23.3 and later, including 13 and 14.
npm i motion-on-scroll@1.1.0Behaviour changes to be aware of
- Reduced motion: visitors who prefer reduced motion no longer get animations unless you pass
respectReducedMotion: false. ease,flip-leftandflip-rightlook different from 1.0.0, because they now match AOS:easeis the CSSeasecurve, and the flips rotate in AOS's direction with AOS's perspective.- Custom animations: MOS now applies
delay/data-mos-delayforregisterAnimationanimations itself, so the factory receivesopts.delayas0. Existing factories keep working; new ones should not pass a delay toanimate().
New
-
CDN build:
dist/mos.global.jsworks from a plain<script>tag. It bundles Motion and exposes a globalMOS(includingMOS.animate), the same way AOS exposesAOS.<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/motion-on-scroll@1.1.0/dist/mos.css" /> <script src="https://cdn.jsdelivr.net/npm/motion-on-scroll@1.1.0/dist/mos.global.js"></script> <script> MOS.init(); </script>
-
MOS.destroy()removes all listeners and observers and stops tracking elements. -
Events:
mos:in/mos:outondocument(plusmos:in:<id>/mos:out:<id>withdata-mos-id), matching AOS'saos:in/aos:out. -
AOS options:
initClassName,animatedClassName,useClassNames, andanchorPlacementas a global option. -
respectReducedMotionoption (defaulttrue). -
Stylesheet now applies only on screen and to
html:not(.no-js), like AOS, and shows every element when printing. Selector specificity is unchanged. It is also available asmotion-on-scroll/mos.css. -
Types (
MosOptions,PartialMosOptions,ElementOptions,AnchorPlacement,DeviceDisable,AnimationFactory,EasingDefinition) are exported from the entry point.
Fixed
- Adding or removing a
data-moselement, or callingrefresh(),refreshHard()orinit()again, no longer resets and replays every element that had already animated in (includingonceelements). mos-animateis now removed when an element animates out.- Repeated
init()calls merge options like AOS does, no longer duplicate listeners, no longer produce a 400 second duration withtimeUnits: "s", apply a changedthrottleDelay, and honourdisableevery time. - Disabling after elements were scrolled out of view no longer leaves them invisible.
data-mos-delay/delayno longer corrupts the animation when an element animates out: the delay applies on the way in only, as in AOS.- Trigger positions are recalculated once the page has fully loaded, so late-loading images no longer leave them stale (as in AOS).
- Elements waiting below the fold no longer keep a 60fps frame loop running.
- An element with an inline
data-mos-anchor-placementand no inline offset triggers where AOS triggers it. cubic-bezier()easings with negative control points (overshoot curves) are accepted.- Empty
data-mos=""anddata-mos-easing=""attributes fall back to the defaults.
Pull requests
- Modernize: dependency upgrades, AOS parity fixes, CDN build (#10)
- Fix release workflow: use
workspace:*for the docs' library dependency (#11) - Version Packages (#12)
Docs: https://motion-on-scroll.pages.dev
Full changelog: v1.0.0...v1.1.0
v1.0.0
What's Changed
- v1.0.0 prep by @Boston343 in #7
- Version Packages by @github-actions[bot] in #8
Full Changelog: v0.0.6-beta...v1.0.0
v0.0.6-beta
What's Changed
- Improvements by @Boston343 in #5
- Version Packages by @github-actions[bot] in #6
Full Changelog: v0.0.5-beta...v0.0.6-beta
v0.0.5-beta
What's Changed
- Refactor to use AOS type logic for viewport detection... by @Boston343 in #1
- Update init, refresh, and refreshHard functions... by @Boston343 in #2
- Much improvement, very wow by @Boston343 in #4
- Version Packages by @github-actions[bot] in #3
New Contributors
- @Boston343 made their first contribution in #1
- @github-actions[bot] made their first contribution in #3
Full Changelog: https://github.com/Boston343/motion-on-scroll/commits/v0.0.5-beta