jmdisuanco / jm-react-anime

JM's react-animejs
https://jmdisuanco.github.io/jm-react-anime
MIT License
26 stars 5 forks source link

Timeline offsets cannot be specified #4

Open stefan-hudelmaier opened 4 years ago

stefan-hudelmaier commented 4 years ago

Hi,

Anime changed the way that timeline offsets are specified in v3. They are given as a second parameter to the add function. (see https://github.com/juliangarnier/anime/commit/8338490c08da6d05b49cc9be3a198a31277f09ef)

In jm-react-anime add is always called with a single parameter. From quickly glancing at the Anime code I thought that using the option timelineOffset in the timeline steps should work as well, but it appears not to.

Changing

mode.map(anim => tl.add(anim));

to

mode.map(anim => tl.add(anim, anim.timelineOffset)); 

would get this working, but I'm not sure if this is something that you would want to do this way.

I could provide a PR with this solution or a different one that you prefer.

jmdisuanco commented 3 years ago

Hi,

Sorry for the late reply.

Your PR will be much appreciated.

Thanks