.ac-loading-wrapper {
  display: inline-flex;
  vertical-align: middle;
}

// grow
@keyframes grow {
  0%,
  100% {
    transform: scaleY(1);
  }

  50% {
    transform: scaleY(2);
  }
}
.ac-loading-grow {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  width: 64rpx;
  height: 32rpx;
  &-item {
    width: 15%;
    height: 100%;
    background-color: black;
    &:nth-child(1) {
      animation: grow 1s 0.5s ease-in-out infinite;
    }
    &:nth-child(2) {
      animation: grow 1s 0.75s ease-in-out infinite;
    }
    &:nth-child(3) {
      animation: grow 1s 1s ease-in-out infinite;
    }
    &:nth-child(4) {
      animation: grow 1s 1.25s ease-in-out infinite;
    }
  }
}

// flood
@keyframes flood-spin {
  50%,
  100% {
    transform: rotate(360deg);
  }
}
@keyframes flood-fill {
  25%,
  50% {
    transform: scaleY(0);
  }
  100% {
    transform: scaleY(1);
  }
}
.ac-loading-flood {
  box-sizing: border-box;
  position: relative;
  width: 64rpx;
  height: 64rpx;
  border: 6rpx solid black;
  overflow: hidden;
  animation: flood-spin 3s ease infinite;
  &-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    background: black;
    opacity: .7;
    transform-origin: center bottom;
    transform: scaleY(1);
    animation: flood-fill 3s linear infinite;
  }
}
// ring
@keyframes ring-spin {
  to {
    transform: rotateY(540deg);
  }
}
.ac-loading-ring {
  box-sizing: border-box;
  width: 64rpx;
  height: 64rpx;
  border-radius: 50%;
  border: 8rpx solid black;
  animation: ring-spin 1.5s ease-in-out infinite;
}
// pendulum
@keyframes pendulum-left-swing {
  50%,
  100% {
    transform: translateX(95%);
  }
}

@keyframes pendulum-right-swing {
  50% {
    transform: translateX(-95%);
  }
  100% {
    transform: translateX(100%);
  }
}

.ac-loading-pendulum {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  width: 140rpx;
  height: 28rpx;
  &-item {
    width: 20%;
    height: 100%;
    border-radius: 50%;
    background-color: black;
    &:first-child {
      transform: translateX(-100%);
      animation: pendulum-left-swing 0.5s ease-in alternate infinite;
    }
    &:last-child {
      transform: translateX(-95%);
      animation: pendulum-right-swing 0.5s ease-in alternate infinite;
    }
  }
}
// boomerang
@keyframes boomerang-spin-stretch {
  50% {
    transform: rotate(360deg) scale(0.4, 0.33);
    border-width: 16rpx;
  }
  100% {
    transform: rotate(720deg) scale(1, 1);
    border-width: 6rpx;
  }
}

.ac-loading-boomerang {
  width: 72rpx;
  height: 96rpx;
  border: 6rpx solid transparent;
  border-top-color: black;
  border-bottom-color: black;
  border-radius: 50%;
  animation: boomerang-spin-stretch 2s ease infinite;
}

// dots
@keyframes dots-fade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.ac-loading-dots {
  width: 104rpx;
  height: 26rpx;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  &-item {
    width: 25%;
    height: 100%;
    border-radius: 50%;
    background-color: black;
    animation: dots-fade 0.8s ease-in-out alternate infinite;
    &:nth-child(1) {
      animation-delay: 0.5s;
    }
    &:nth-child(2) {
      animation-delay: 0.7s;
    }
    &:nth-child(3) {
      animation-delay: 0.9s;
    }
  }
}
// sudoku
@keyframes sudoku-fade {
  to {
    opacity: 0.2;
  }
}
.ac-loading-sudoku {
  width: 96rpx;
  height: 96rpx;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;
  align-items: center;
  &-item {
    width: 60%;
    height: 60%;
    background-color: black;
    border-radius: 50%;
    animation: sudoku-fade 1.5s alternate ease-in-out infinite;
    &:nth-child(2),
    &:nth-child(4) {
      animation-delay: 0.25s;
    }
    &:nth-child(3),
    &:nth-child(5),
    &:nth-child(7) {
      animation-delay: 0.5s;
    }
    &:nth-child(6),
    &:nth-child(8) {
      animation-delay: 0.75s;
    }
    &:nth-child(9) {
      animation-delay: 1s;
    }
  }
}

//snake
@keyframes snake-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.ac-loading-snake {
  position: relative;
  width: 100rpx;
  height: 100rpx;
  box-sizing: border-box;
  &-item {
    box-sizing: border-box;
    position: absolute;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border-radius: 50%;
    animation: snake-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-width: medium;
    border-style: solid;
    border-color: black transparent transparent transparent;
    &:nth-child(1) {
      animation-delay: 0.5s;
    }
    &:nth-child(2) {
      animation-delay: 0.6s;
    }
    &:nth-child(3) {
      animation-delay: 0.7s;
    }
    &:nth-child(9) {
      animation-delay: 0.75s;
    }
  }
}

// loading
@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}
.ac-loading {
  border-radius: 50%;
  width: 64rpx;
  height: 64rpx;
  position: relative;
  &-bg,
  &-border {
    box-sizing: border-box;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
  }
  &-bg {
    border: 6rpx solid black;
    opacity: 0.2;
  }
  &-border {
    border: 6rpx solid transparent;
    border-top-color: black;
    z-index: 1;
    animation: loading-spin 1s linear infinite;
  }
}

// wave
@keyframes wave {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100%);
  }
}
.ac-loading-wave {
  width: 104rpx;
  height: 26rpx;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  &-item {
    width: 25%;
    height: 100%;
    border-radius: 50%;
    background-color: black;
    transform: translateY(-100%);
    animation: wave 0.8s ease-in-out alternate infinite;
    &:nth-child(1) {
      animation-delay: 0.5s;
    }
    &:nth-child(2) {
      animation-delay: 0.7s;
    }
    &:nth-child(3) {
      animation-delay: 0.9s;
    }
  }
}
