JSFiddle - React, Tailwind, and code Playground
by navinleon
HTML
<div class="container">
<div class="inner"></div>
</div>
CSS
.container {
width: 100%;
height: 500px;
border: solid 1px blue;
position: relative;
background-color:#ccc;
}
.inner {
width: 25px;
height: 25px;
background-color: green;
border-radius: 100%;
animation-name: arctop, arcleft;
animation-duration: 1.6s, 1.6s;
animation-timing-function: linear, linear;
animation-iteration-count: 5, 5;
position: absolute;
opacity:0;
}
@keyframes arctop {
0% {top: 100%;opacity:1; animation-timing-function: ease-out;}
50% {top: 80%;opacity:1; animation-timing-function: ease-in;}
98% {top: 100%;opacity:1;}
100% {top: 100%;opacity:0;}
}
@keyframes arcleft {
0% {left: 0px;}
100% {left: calc(100% - 25px)}
}