JSFiddle - React, Tailwind, and code Playground
by jaycethanks
HTML
<section>
<div class="container">
<div class="loading">
<div class="dot" id="dot_one"></div>
<div class="dot" id="dot_two"></div>
<div class="dot" id="dot_three"></div>
<div class="dot" id="dot_four"></div>
<div class="dot" id="dot_five"></div>
</div>
</div>
</section>
CSS
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
background-color: #323232;
display: flex;
justify-content: center;
align-items: center;
}
.container {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 300px;
background-color: #efefef;
}
.loading {
font-size: 0;
}
.dot {
position: absolute;
display: inline-block;
width: 10px;
height: 10px;
margin: 5px;
border-radius: 50%;
background-color: tomato;
}
#dot_one {
background-color: rgb(247, 125, 103);
animation: dot_circle 2s infinite;
animation-delay: -0.s;
}
#dot_two {
background-color: rgb(70, 219, 145);
animation: dot_circle 2s infinite;
animation-delay: -0.4s;
}
#dot_three {
background-color: rgb(209, 102, 191);
animation: dot_circle 2s infinite;
animation-delay: -0.6s;
}
#dot_four {
background-color: rgb(58, 106, 196);
animation: dot_circle 2s infinite;
animation-delay: -0.8s;
}
#dot_five {
background-color: rgb(255, 71, 71);
animation: dot_circle 2s infinite;
animation-delay: -1s;
}
@keyframes dot_circle {
/* two-points-trace */
/* 0% {
transform: translate(-30px, 0);
}
50% {
transform: translate(30px, 0);
}
100% {
transform: translate(-30px, 0);
} */
/*...