Skip to content

Instantly share code, notes, and snippets.

@ajmeyghani
Created August 22, 2018 18:34
Show Gist options
  • Save ajmeyghani/d317ca5841f6fb3d64d5653f1486f435 to your computer and use it in GitHub Desktop.
Save ajmeyghani/d317ca5841f6fb3d64d5653f1486f435 to your computer and use it in GitHub Desktop.
const boxesAnimation = window.anime({
targets: '.js-box',
translateY: [150, 50],
backgroundColor: {
value: (el, i, t) => {
const r = 58 + (i * 12);
const g = 35 + (i * 12);
const b = 220;
const color = `rgb(${r}, ${g}, ${b})`;
return color;
},
easing: 'linear',
duration: 200,
},
duration: 900,
easing: 'easeOutElastic',
elasticity: 500,
delay: (el, i, t) => i * 20,
loop: true,
direction: 'alternate',
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment