Skip to content

8.0.0 - New animation engine

Choose a tag to compare

@geosigno geosigno released this 24 Nov 19:57
· 10 commits to master since this release

This release replaces the CSS transition with a JavaScript animation engine: the library now moves the image itself on every frame. The motion is smooth with a mouse wheel and on touch devices, iOS Safari included, where the previous versions stuttered.

💥 Breaking changes

  • the transition option is removed, use delay and the new easing option instead (efa708e)
  • the library sets transition: none on the image, a CSS transition of your own on its transform is overridden (1a2caae)

To migrate from 7.x:

  • remove the transition option, and any CSS transition of your own on the image
  • keep your delay, it still sets how long the image takes to catch up
  • pick an easing if needed: ease and ease-out become smooth (default), ease-in-out becomes spring

✨ Features

  • new JavaScript animation engine: the image is animated on every frame instead of with a CSS transition (1a2caae)
  • add the easing option: smooth, spring, bounce (1a2caae)

⚡️ Improvements

  • images finish their motion when they leave the screen (1a2caae)
  • vanilla: no more IntersectionObserver, and no work at all when the page is idle (1a2caae)
  • react: DOM reads are batched before writes in the shared frame loop (1a2caae)

🐛 Fixes

  • vanilla: the position could stay stale after a resize when maxTransition was reached (1a2caae)
  • vanilla: the resize listener was not removed on destroy (1a2caae)