JSFiddle - React, Tailwind, and code Playground
by core972
HTML
<div class="circle-outer"><div class="circle-inner"></div></div>
CSS
@-webkit-keyframes rotateAnim {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(720deg);
}
}
@keyframes rotateAnim {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(720deg);
}
}
body {
background: coral;
display: flex;
align-items: center;
justify-content: center;
}
.circle-outer {
display: flex;
align-items: center;
justify-content: center;
width: 20rem;
height: 20rem;
background-color: #af35c0;
border-radius: 50%;
-webkit-animation: rotateAnim 3s linear infinite;
animation: rotateAnim 3s linear infinite;
}
.circle-inner {
position: relative;
width: 10rem;
height: 10rem;
background: #af35c0;
border-radius: 50%;
border: 2rem solid #d0e000;
}
.circle-inner::before,
.circle-inner::after {
content: "";
position: absolute;
border: 5rem solid #af35c0;
}
.circle-inner::before {
top: -5rem;
left: -5rem;
border-top-color: transparent;
border-left-color: transparent;
}
.circle-inner::after {
bottom: -5rem;
right: -5rem;
border-bottom-color: transparent;
border-right-color: transparent;
}