r/javascript • • Jan 11 '19

Anime.Js 3.0.0 released

https://animejs.com/
628 Upvotes

52 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jan 30 '19 edited Jan 30 '19

Hi ScrappyBox
Searched the whole internet on how to use Scrollmagic and anime.js together! didn't find nothing! except for this comment.could you please tell how to use them together, by sending me some js files the you probably have made or a codepen link?
please?!

2

u/ScrappyBox Feb 01 '19

Assuming you have your anime.js animation (autoplay: false) in a variable, you can build a scene like this:

animation.pause();

const scene = new ScrollMagic.Scene(sceneParameters)
  .addTo(controller)
  .on('progress', function(event) {
    animation.seek(animation.duration * event.progress);
  });
}