Skip to content

Instantly share code, notes, and snippets.

@Kvaibhav01

Kvaibhav01/anime.js

Last active Sep 20, 2019
Embed
What would you like to do?
JS code for AnimeJS demo
var btn = document.getElementById('cta');
var btn2 = document.getElementById('cta2');
btn.onclick = function () {
var morphing = anime({
targets: '.polymorph',
points: [
{ value: '215, 110 0, 110 0, 0 47.7, 0 67, 76' },
{ value: '215, 110 0, 110 0, 0 0, 0 67, 76' }
],
easing: 'easeOutQuad',
duration: 1200,
loop: false
});
anime({
targets: '#blip',
opacity: 1,
duration: 500,
translateY: 150
});
var promise = morphing.finished.then(() => {
btn2.onclick = function () {
var morphing = anime({
targets: '.polymorph',
points: [
{ value: '215, 110 0, 110 0, 0 47.7, 0 67, 76' },
{ value: '215,110 0,110 0,0 49.3,0 215,0' }
],
easing: 'easeOutQuad',
duration: 1200,
loop: false
});
anime({
targets: '#blip',
opacity: 0,
duration: 500,
translateY: -800
});
};
});
}
@AndrewRMillar

This comment has been minimized.

Copy link

@AndrewRMillar AndrewRMillar commented Sep 18, 2019

Is it bad that the indentation in this file is so bad/confusing, I forked it, just to fix the indentation, even though I had no intention on using the file just right now...

@Kvaibhav01

This comment has been minimized.

Copy link
Owner Author

@Kvaibhav01 Kvaibhav01 commented Sep 19, 2019

@Sl4rtyb4rtf4st, thanks for pointing it out. I've updated the Gist.

@AndrewRMillar

This comment has been minimized.

Copy link

@AndrewRMillar AndrewRMillar commented Sep 19, 2019

@Kvaibhav01, good on you. Where is the upvote-button?

@Kvaibhav01

This comment has been minimized.

Copy link
Owner Author

@Kvaibhav01 Kvaibhav01 commented Sep 20, 2019

@Sl4rtyb4rtf4st, there is no such button available for Gist comments I guess. 😿

Thank you! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment