Created
August 28, 2018 23:02
-
-
Save ajmeyghani/40c8491684b23fec47e4d50443fb439d to your computer and use it in GitHub Desktop.
Animejs Basics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Anime Basics</title> | |
<script src="/anime.js"></script> | |
<style> | |
.box { | |
width: 100px; | |
height: 100px; | |
background: #000; | |
margin-bottom: 5px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="box js-box"></div> | |
<script> | |
anime({ | |
targets: '.js-box', | |
duration: 1500, | |
translateX: [ | |
{ | |
value: 100 | |
}, | |
{ | |
value: '+=0', | |
} | |
], | |
translateY: [ | |
{ | |
value: 0, | |
}, | |
{ | |
value: 100, | |
} | |
], | |
easing: 'easeInOutSine', | |
delay: (elm, i) => i * 100, | |
loop: true, | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment