$time: 3s;
$width: 40px;
$height: 40px;
$animWidth: 100px;
$color: #fbc531; // #4cd137, #4bcffa, #ef5777
$animaFunc: cubic-bezier(0.4, 0, 0.2, 1);

.spinner {
    
}

.wrap {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  _background: #2f3640;
  background: #000;
  display: flex;
  height: 100%;
  justify-content: center;
  align-items: center;
  
  opacity: 0.5;
  z-index: 1000;
}
.loader {
  position: relative;
  width: $width;
  height: $height;
  border: 2px solid $color;
  border-radius: 50px;
  animation: loaderAni $time $animaFunc infinite;
}
.e {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border: 1px solid $color;
  box-shadow: 0 1px 2px rgba(0,0,0, .2);
  border-radius: $height;
  animation: loaderElementAni $time $animaFunc infinite;
}
@for $i from 1 through 5 {
  $deg : $i*36;
  $delay: $i*.1;
  .loader div:nth-child(#{$i}) {
    animation-name: loaderElementAni#{$i};
    animation-delay: #{$delay}s;
  }
  @keyframes loaderElementAni#{$i} {
    0% {
      opacity: 0;
      transform: rotate(0deg);
    }
    50% {
      opacity: 1;
      transform: rotate(#{$deg}deg);
      box-shadow: 0 5px 15px rgba(0,0,0, .2);
    }
    100% {
      opacity: 0;
      transform: rotate(180deg);
    }
  }
}

@keyframes loaderAni {
  0% {
    border-color: rgba($color, 1);
  }
  50% {
    width: $animWidth;
    border-color: rgba($color, 0);
  }
  100% {
    border-color: rgba($color, 1);
  }
}

