Skip to content

Instantly share code, notes, and snippets.

@ajmeyghani
Created August 31, 2018 12:04
Show Gist options
  • Save ajmeyghani/f2a65a1827c7039ae98f9d3227301255 to your computer and use it in GitHub Desktop.
Save ajmeyghani/f2a65a1827c7039ae98f9d3227301255 to your computer and use it in GitHub Desktop.
const xMax = 16;
const shake = anime({
targets: '#js-login-form',
easing: 'easeInOutSine',
duration: 550,
translateX: [
{
value: xMax * -1,
},
{
value: xMax,
},
{
value: xMax/-2,
},
{
value: xMax/2,
},
{
value: 0,
}
],
autoplay: false,
});
const colorAnims = [
anime({
targets: '#js-login-form',
borderTopColor: '#f7733f',
easing: 'linear',
duration: 500,
autoplay: false,
}),
anime({
targets: '.form-group input',
borderColor: '#f7733f',
easing: 'linear',
duration: 500,
autoplay: false,
}),
];
const send = () => {
shake.restart();
colorAnims.forEach(a => a.restart());
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment