juliangarnier / anime

JavaScript animation engine
https://animejs.com
MIT License
49.7k stars 3.67k forks source link

Speed up the duration during reverse playback #867

Open oa-netigo opened 11 months ago

oa-netigo commented 11 months ago

I want to reaveal und conceal a List via animejs. This list is searchable. so as a user, I want to conceal the list so fast as possible to reveal the new list result, that I searched for and dont want to wait the regular animation (reveal) speed.

So I want to speed up the duration during the reversal playback.

Example:

var animation = anime({
  targets: '.reverse-anim-demo .el',
  translateX: 270,
  duration: 1000,
  loop: false,
  delay: function(el, i) { return i * 200; },
  easing: 'easeInOutSine'
});

animation.play;

// my approach:
animation.duration = 10;

animation.reverse;
animation.play;