Gamote / lottie-react

A lightweight React library for rendering complex After Effects animations in real time using Lottie.
https://lottiereact.com
Other
794 stars 58 forks source link

Feat: add scroll direction option to useLottieInteractivity hook #113

Open creativoma opened 4 months ago

creativoma commented 4 months ago

Description

This Pull Request introduces an enhancement to the useLottieInteractivity hook by adding an option to specify the scroll direction. This improvement allows users to set the scroll direction to horizontal, making it compatible with smooth scroll libraries such as Lenis.

Background

While integrating lottie-react with Lenis for smooth horizontal scrolling, I encountered the need to adapt the useLottieInteractivity hook to function correctly with horizontal scroll behavior. By adding a scroll direction option, the hook now supports both vertical and horizontal scrolling, providing greater flexibility and functionality for various scrolling use cases.

Changes