JSFiddle - React, Tailwind, and code Playground
by teneff
HTML
<div class="container">
<div class="path">
<div class="circle"></div>
</div>
<div class="path">
<div class="circle"></div>
</div>
<div class="path">
<div class="circle"></div>
</div>
<div class="path">
<div class="circle"></div>
</div>
<div class="path">
<div class="circle"></div>
</div>
</div>
CSS
.container {
width: 300px;
height: 300px;
border: 1px solid #00f;
position: relative;
}
.path {
width: 300px;
height: 300px;
position: absolute;
top: 0;
animation-name: circle;
animation-duration: 2s;
animation-timing-function: cubic-bezier(.8, .2, .20, .8);
animation-iteration-count: infinite;
animation-play-state: running;
/* Safari and Chrome: */
-moz-animation-name: circle;
-moz-animation-duration: 2s;
-moz-animation-timing-function: cubic-bezier(.8, .2, .20, .8);
-moz-animation-iteration-count: infinite;
-moz-animation-play-state: running;
-webkit-animation-name: circle;
-webkit-animation-duration: 2s;
-webkit-animation-timing-function: cubic-bezier(.8, .2, .20, .8);
-webkit-animation-iteration-count: infinite;
-webkit-animation-play-state: running;
}
.path + .path {
animation-delay: 0.2s;
-moz-animation-delay: 0.2s;
-webkit-animation-delay: 0.2s;
}
.path + .path + .path {
animation-delay: 0.4s;
-moz-animation-delay: 0.4s;
-webkit-animation-delay: 0.4s;
}
.path + .path + .path + .path {
animation-delay: 0.6s;
-moz-animation-delay: 0.6s;
-webkit-animation-delay: 0.6s;
}
.path + .path + .path + .path + .path {
animation-delay: 0.8s;
-moz-animation-delay: 0.8s;
-webkit-animation-delay: 0.8s;
}
.circle {
width: 10px;
height: 10px;
border-radius: 10px;
background: blue;
position: absolute;
top: 0;
left: 50%;
}
@keyframes circle {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes circle {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
@-webkit-keyframes circle {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}