<template>
  <div class="dot-spinner dot-spinner--white"></div>
</template>

<script>
export default {
  name: 'DotsLoader'
}
</script>

<style lang="scss" scoped>

$color_loader: #fff;

$color-grayer: #b2b2b6;

.dot-spinner {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background-color: $color-grayer;
  color: $color-grayer;
  animation: dot-flashing .5s linear infinite alternate;
  animation-delay: .25s;

  &.dot-spinner--white {
    animation: dot-flashing-white .5s linear infinite alternate;
    animation-delay: .25s;
    margin: 0 auto;

    &::before,
    &::after {
      animation: dot-flashing-white .5s linear infinite alternate;
    }

    &::before {
      animation-delay: 0s;
    }
    &::after {
      animation-delay: .5s;
    }
  }

  &::before,
  &::after {
    content: "";
    display: inline-block;
    position: absolute;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background-color: $color-pink;
    color: $color-pink;
  }

  &::before,
  &::after {
    animation: dot-flashing-white .5s linear infinite alternate;
  }

  &::before {
    left: -12px;
    animation-delay: 0s;
  }
  &::after {
    left: 12px;
    animation-delay: .5s;
  }
}

@keyframes dot-flashing {
  0% {
      background-color: #b2b2b6;
  }
  50%, 100% {
      background-color: #e6e6e8;
  }
}

@keyframes dot-flashing-white {
  0% {
      background-color: rgba($color_loader, 1);
  }
  50%, 100% {
      background-color: rgba($color_loader, 0.6);
  }
}
</style>
