jonkwheeler / ScrollScene

ScrollScene is an extra layer on top of ScrollMagic as well as using IntersectionObserver to achieve similar effects.
https://scrollscene.jonkwheeler.now.sh/
MIT License
136 stars 9 forks source link

Possible anime.js support? #37

Closed disjointed closed 4 years ago

disjointed commented 4 years ago

Hello! Is there a possibility of adding anime.js support to this plugin in some future? It has very similar approach to animation as gsap does, like single animation via anime() and timelines via anime.timeline(). I'm asking because I already use anime.js in my current project and adding scroll animation via gsap on top would be overkill. Thank you.

jonkwheeler commented 4 years ago

You shouldn't need to add gsap if you just want to use anime.js.

Both ScrollObserver and ScrollScene have the power to handle any callback you want it to fire.

With ScrollScene you want to use the ScrollMagic method's. See the readme about this https://github.com/jonkwheeler/ScrollScene.

And with ScrollObserver you want to use the callback option. It'd end up looking like

callback: { 
  active: () => anime.timeline().play(), 
  notActive: () => anime.timeline().pause() 
}

Or something like that ^^.

disjointed commented 4 years ago

Well then, thank you!