Skip to content

Instantly share code, notes, and snippets.

@ajmeyghani
Created August 28, 2018 23:02
Show Gist options
  • Save ajmeyghani/40c8491684b23fec47e4d50443fb439d to your computer and use it in GitHub Desktop.
Save ajmeyghani/40c8491684b23fec47e4d50443fb439d to your computer and use it in GitHub Desktop.
Animejs Basics
<!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