JSFiddle - React, Tailwind, and code Playground

by Vitaliy

HTML

<div class="sun">
  <div class="sun-circle"></div>
  <div class="sun-contour"></div>
  <div class="sun-rays">
    <div class="sun-rays-quater">
      <i class="sun-ray"></i>
      <i class="sun-ray"></i>
      <i class="sun-ray"></i>
    </div>
    <div class="sun-rays-quater">
      <i class="sun-ray"></i>
      <i class="sun-ray"></i>
      <i class="sun-ray"></i>
    </div>
    <div class="sun-rays-quater">
      <i class="sun-ray"></i>
      <i class="sun-ray"></i>
      <i class="sun-ray"></i>
    </div>
    <div class="sun-rays-quater">
      <i class="sun-ray"></i>
      <i class="sun-ray"></i>
      <i class="sun-ray"></i>
    </div>
      
  </div>
</div>

CSS

*{
  box-sizing:border-box;
}
html, body{
  margin:0;
  padding:0;
  background:#3F51B5;
}

.sun{
  position:relative;
  width:220px;
  height:220px;
  border-radius:50%;
  background:transparent;
  margin:30px auto;
  transform-origin:center center;
  animation: spin 5s infinite linear alternate;
}
@keyframes spin{
  from{
    transform:rotate(0);
  }
  to{
    transform:rotate(180deg);
  }
}
.sun-circle{
  position:absolute;
  width:170px;
  height:170px;
  left:50%;
  margin-left:-85px;
  top:50%;
  margin-top:-85px;
  border-radius:50%;
  background:#FFEB3B;
  z-index:100;
}
.sun-contour{
  position:absolute;
  width:170px;
  height:170px;
  left:50%;
  margin-left:-85px;
  top:50%;
  margin-top:-85px;
  border-radius:50%;
  background:#3F51B5;
  transform:scale(1);
  transform-origin:center center;
  animation:scaleContour 1.2s infinite;
  z-index:99;
  animation-timing-function:linear;
}
@keyframes scaleContour{
  0%{
    transform:scale(1);
  }
  50%{
    transform:scale(1);
  }
  100%{
    transform:scale(1.45);
  }
}

.sun-rays{
  width:200px;
  height:200px;
  position:absolute;
  left:50%;
  margin-left:-100px;
  top:50%;
  margin-top:-100px;
  transform:scale(0.7);
  transform-origin:center center;
  animation:scaleRays 1.2s infinite;
  animation-timing-function:linear;
}
@keyframes scaleRays{
  0%{
    transform:scale(0.7);
  }
  50%{
    transform:scale(1);
  }
  100%{
    transform:scale(1);
  }
}
.sun-ray{
  position:absolute;
  border-style:solid;
  border-color:transparent transparent #FFEB3B transparent;
  border-width:30px 20px 30px 20px;
  //transform:scaleY(1.6);
}
.sun-ray:nth-child(1){
  left:20px;
  top:-35px;
  transform:rotate(-30deg);
  transform-origin:center center;
}
.sun-ray:nth-child(3){
  right:20px;
  top:-35px;
  transform:rotate(30deg);
  transform-origin:center center;
}
.sun-ray:nth-child(2){
  left:50%;
  top:0;
  transform:translate3d(-50%,-50px,0);
}
.sun-rays-quater{
  position:absolute;
  left:0;
  top:0;
  width:100%;
...