JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<div class="ball"></div>
</div>
CSS
@-moz-keyframes bouncing {
40%,70%,90% {
bottom: 0;
}
0% {
bottom: 20px;
left: 5;
}
55% {
bottom: 5px;
}
80% {
bottom: 25px;
}
95% {
bottom: 10px;
}
100% {
left: 110px;
bottom: 0;
}
}
@-webkit-keyframes bouncing {
40%,70%,90% {
bottom: 0;
}
0% {
bottom: 200px;
left: 0;
}
55% {
bottom: 50px;
}
80% {
bottom: 25px;
}
95% {
bottom: 10px;
}
100% {
left: 110px;
bottom: 0;
}
}
@-ms-keyframes bouncing {
40%,70%,90% {
bottom: 0;
}
0% {
bottom: 200px;
left: 0;
}
55% {
bottom: 50px;
}
80% {
bottom: 25px;
}
95% {
bottom: 10px;
}
100% {
left: 110px;
bottom: 0;
}
}
@keyframes bouncing {
40%,70%,90% {
bottom: 0;
}
0% {
bottom: 200px;
left: 0;
}
55% {
bottom: 50px;
}
80% {
bottom: 25px;
}
95% {
bottom: 10px;
}
100% {
left: 110px;
bottom: 0;
}
}
.container {
position: relative;
width: 200px;
height: 200px;
background-color: #eee;
border: 1px solid #444;
}
.ball {
position: absolute;
background-color: red;
height: 20px;
width: 20px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
-webkit-animation: 2s linear 0s normal none 15 bouncing;
-moz-animation: 2s linear 0s normal none 15 bouncing;
-ms-animation: 2s linear 0s normal none 15 bouncing;
animation: 2s linear 0s normal none 15 bouncing;
}
JavaScript
/*
* Inspired by : http://mos.netmagazine.com/site/files/tutorials/assets/2011/08/animation_05.html
*/