
@import './variables.scss';
@import '~@alifd/next/lib/core/index-noreset'; // next core style
@import '~@alifd/next/lib/loading/scss/variable';
@import '~@alifd/next/lib/loading/scss/mixin';

// .#{$css-prefix}loading {
// 隐藏之前的动画效果
.#{$css-prefix}loading-dot {
  display: none;
}

// 1. 圆形加载效果
.#{$css-prefix}loading-default {
  .#{$css-prefix}loading-circle {
    margin: 0 auto;
  }

  // 设置不同尺寸的加载图形
  &.#{$css-prefix}loading-xl {

    .#{$css-prefix}loading-circle,
    svg {
      width: $b-design-loading-circle-xl-size;
      height: $b-design-loading-circle-xl-size;
    }
  }

  &.#{$css-prefix}loading-large {

    .#{$css-prefix}loading-circle,
    svg {
      width: $b-design-loading-circle-large-size;
      height: $b-design-loading-circle-large-size;
    }
  }

  &.#{$css-prefix}loading-medium {

    .#{$css-prefix}loading-circle,
    svg {
      width: $b-design-loading-circle-medium-size;
      height: $b-design-loading-circle-medium-size;
    }
  }

  &.#{$css-prefix}loading-small {

    .#{$css-prefix}loading-circle,
    svg {
      width: $b-design-loading-circle-small-size;
      height: $b-design-loading-circle-small-size;
    }
  }

  &.#{$css-prefix}loading-tip-fullscreen,
  .#{$css-prefix}loading-tip {
    svg {
      width: 100%;
      height: 100%;

      @keyframes loading-360 {
        0% {
          transform: rotate(0deg);
          transform-origin: center;
        }

        100% {
          transform: rotate(360deg);
          transform-origin: center;
        }
      }

      overflow: visible !important;
      animation: loading-360 0.8s infinite linear;
      /*给圆环添加旋转360度的动画，并且是无限次*/
    }

    .loading-svg-style1 {
      stop-opacity: 0.1;
      stop-color: $color-brand1-4;
    }

    .loading-svg-style2 {
      stop-color: $color-brand1-6;
    }
  }
}

// 2. 线性加载效果
.#{$css-prefix}loading-linear {
  background-image: $b-design-loading-background-image;
  position: relative;
  border-radius: $b-design-loading-border-radius;
  transform: rotate(180deg);
  animation: loading-180 0.5s infinite linear;

  @keyframes loading-180 {
    0% {
      -webkit-transform: translateX(-100%);
      transform: translateX(-100%);
    }

    100% {
      -webkit-transform: translateX(100%);
      transform: translateX(100%);
    }
  }

  &.#{$css-prefix}loading-large {
    width: $b-design-loading-linear-large-width;
    height: $b-design-loading-linear-large-height;
  }

  &.#{$css-prefix}loading-medium {
    width: $b-disign-loading-linear-medium-width;
    height: $b-disign-loading-linear-medium-height;
  }
}

//3. 全局线性加载
@keyframes spinner {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading_bar_parent {
  background: $b-design-loading-background-image;
  height: $b-disign-loading-linear-medium-height;
  border-radius: $b-design-loading-border-radius;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1031;
}

.loading_bar_children {
  box-shadow: 0 0 10px #29d, 0 0 5px #29d;
  display: block;
  height: 100%;
  opacity: 1;
  position: absolute;
  right: 0;
  transform: rotate(3deg) translate(0px, -4px);
  width: 100;
}

.#{$css-prefix}loading-global-circle {
  // animation: 400ms linear infinite spinner;
  display: block;
  position: fixed;
  right: $b-design-loading-global-circle-right;
  top: $b-disign-loading-global-circle-top;
  z-index: 1031;
}