@loading-cls: ~"@{prefix}loading";

@keyframes loading-rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes loading-path-rotate {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}

.@{loading-cls} {
  .absolute();
  background-color: fade(@white-color, 60%);
  z-index: -1;
  visibility: hidden;
  text-align: center;
  opacity: 0;
  transition: all 0.5s;
  &-loading{
    visibility: visible;
    z-index: @zindex-loading;
    opacity: 1;
    &.@{loading-cls}-full-screen{
      z-index: @zindex-loading-fullscreen;
      position: fixed;
    }
  }
  &-circular {
    .middle-center();
    >svg {
      width: 42px;
      height: 42px;
      animation: loading-rotate 2s linear infinite;
      transform-origin: center center;
      .circle {
        animation: loading-path-rotate 1.5s ease-in-out infinite;
        stroke-dasharray: 90, 150;
        stroke-dashoffset: 0;
        stroke-width: 2;
        stroke: @primary-color;
        stroke-linecap: round;
      }
    }
  }
}