<div class="box"></div>
body {
font-family: system-ui;
background: #252323;
color: white;
align-items: center;
}
.box {
position: relative;
top: 25vh;
width: 50px;
height: 50px;
background-color: orange;
}
import anime from "https://cdn.skypack.dev/animejs";
anime({
targets: '.box',
translateX: {
value: 250,
duration: 800
},
rotate: {
value: 360,
duration: 1800,
easing: 'easeInOutSine'
},
scale: {
value: 2,
duration: 1600,
delay: 800,
easing: 'easeInOutQuart'
},
delay: 250 // All properties except 'scale' inherit 250ms delay
});
This Pen doesn't use any external CSS resources.