JSFiddle - React, Tailwind, and code Playground
by levchenko_d
HTML
<div class="circle-loading">
<div class="circle outer-circle">
<div class="circle-piece cp-1 bg-red-g"></div>
<div class="circle-piece cp-2 bg-green-g"></div>
<div class="circle-piece cp-3 bg-orange-g"></div>
<div class="circle-piece cp-4 bg-blue-g"></div>
</div>
<div class="circle inner-circle"></div>
</div>
CSS
@keyframes spin-circle {
100% {transform: rotate(360deg);}
}
@keyframes circle-odd-q{
0% { transform: rotate(0deg); }
50% { transform: rotate(90deg) scale(2); }
0% { transform: rotate(0deg); }
}
@keyframes circle-even-q{
0% { transform: rotate(0deg) scale(1); }
50% { transform: rotate(-90deg) scale(2);}
0% { transform: rotate(0deg) scale(1);}
}
.cp-1,
.cp-3{
animation: circle-odd-q 1.3s linear infinite;
}
.cp-2,
.cp-4{
animation: circle-even-q 1.3s linear infinite;
}
.cp-1{
transform-origin: bottom right;
}
.cp-2{
transform-origin: bottom left;
}
.cp-3{
transform-origin: top right;
}
.cp-4{
transform-origin: top left;
}
.circle-loading{
position: relative;
width: 128px;
height: 128px;
border-radius: 50%;
overflow: hidde;
background: silver;
transform: rotate(0);
animation: spin-circle 1.1s linear infinite;
}
.circle-loading .circle{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: 50%;
overflow: hidden;
margin: auto;
transform: scale(1);
}
.circle-loading .inner-circle{
width: 90%;
height: 90%;
background: #f3f5f6;
}
.circle-piece{
position: relative;
height: 50%;
width: 50%;
float: left;
}
.bg-blue-g{
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#2490d2+0,226ac1+100 */
background: rgb(36,144,210); /* Old browsers */
background: -moz-linear-gradient(top, rgba(36,144,210,1) 0%, rgba(34,106,193,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(36,144,210,1) 0%,rgba(34,106,193,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(36,144,210,1) 0%,rgba(34,106,193,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2490d2', endColorstr='#226ac1',GradientType=0 ); /* IE6-9 */
}
.bg-green-g{
/* Permalink - use to edit and share this gradient:...