@import '../style/index';

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

@color: #00A9F0;
@backgroundColor: rgba(244, 244, 244, .6);
@spin-dot-size: 20px;
@spin-dot-size-lg:32px;
@spin-dot-size-sm:14px;

@keyframes rotate {
	100% {
		transform: rotate(360deg);
	}
}
@keyframes dash {
	0% {
		stroke-dasharray: 1, 200;
		stroke-dashoffset: 0;
	}
	50% {
		stroke-dasharray: 89, 200;
		stroke-dashoffset: -35px;
	}
	100% {
		stroke-dasharray: 89, 200;
		stroke-dashoffset: -124px;
	}
}

@keyframes ldRotate {
	to {
	  transform: rotate(405deg);
	}
  }

  @keyframes ldSpinMove {
	to {
	  opacity: 1;
	}
  }

.@{loading-prefix-cls} {
	position: relative;
	min-height: 70px;
	height: 100%;
	width: 100%;
	&-container {
		height: 100%;
		width: 100%;
		overflow: hidden;
		display: flex;
		justify-content: center;
		align-items: center;
		position: absolute;
		top: 0;
	}
	&-layer{
		background: @backgroundColor;
	}
	&-animation {
		&:before {
			content: '';
			display: block;
		}
		.circular {
			animation: rotate 2.9s linear infinite;
			transform-origin: center center;
			.path {
				stroke-width: 3px;
				stroke-miterlimit: 10;
				stroke: @color;
				stroke-dasharray: 1, 200;
				stroke-dashoffset: 0;
				animation: dash 1.2s linear infinite;
				stroke-linecap: round;
				fill: none
			}
		}
	}
	&-tip-animation{
		margin-top: -20px;
	}
	&-text {
		color: @color;
		line-height: 30px;
		position: absolute;
		top: calc(50% + 5px);
	}

  // dots
  // ------------------------------
	&-dot {
		position: relative;
		display: inline-block;
		font-size: @spin-dot-size;

		.square(1em);
		
		&-item {
		  position: absolute;
		  display: block;
		  width: 9px;
		  height: 9px;
		  background-color: @color;
		  border-radius: 100%;
		  transform: scale(0.75);
		  transform-origin: 50% 50%;
		  opacity: 0.3;
		  animation: ldSpinMove 1s infinite linear alternate;
	
		  &:nth-child(1) {
			top: 0;
			left: 0;
		  }
		  &:nth-child(2) {
			top: 0;
			right: 0;
			animation-delay: 0.4s;
		  }
		  &:nth-child(3) {
			right: 0;
			bottom: 0;
			animation-delay: 0.8s;
		  }
		  &:nth-child(4) {
			bottom: 0;
			left: 0;
			animation-delay: 1.2s;
		  }
		}
	
		&-spin {
		  transform: rotate(45deg);
		  animation: ldRotate 1.2s infinite linear;
		}
	  }

   // Sizes
  // ------------------------------

  // small
  &-sm &-dot {
    font-size: @spin-dot-size-sm;

    i {
      width: 6px;
      height: 6px;
    }
  }

  // large
  &-lg &-dot {
    font-size: @spin-dot-size-lg;

    i {
      width: 14px;
      height: 14px;
    }
  }
}



