bendc / animateplus

A+ animation module for the modern web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Add duration to specific animation.

tomtev opened this issue · comments

Sometimes I want f.ex opacity animation to last a bit longer than a translate animation.
Would it be possible to use the third parameter for duration?

F.ex:
opacity: [0,1,600]

Yup, this is something I'd like to do at some point but I'm not sure yet about the ideal API as I'd also like to make the easing configurable for each property. In the meantime, you can simultaneously launch multiple animations on the same element:

const el = "div";

animate({
  el,
  translateX: 500,
  duration: 4000,
  easing: "easeOutQuad"
});

animate({
  el,
  opacity: 0.5,
  duration: 2000,
  easing: "linear"
});