/*
  Storeblocks Loading Indicator Dots component
  Loosely grabbed from
  https://github.com/storeblocks/storeblocks-ng/blob/main/packages/loading-indicator-dots/src/lib/loading-indicator-dots.component.scss
  2023-04-04
*/

/*
Usage:

div.stb-loading-indicator-dots support the following classes:
* enable - indicate loading
* red/white - show loader in specified color (default is red)
* small/medium/large - specify size of loader (default is large)

HTML:

<div class="stb-loading-indicator-dots enable">
  <div class="loading-indicator" aria-label="loading">
    <div class="bounce bounce1"></div>
    <div class="bounce bounce2"></div>
    <div class="bounce bounce3"></div>
  </div>
</div>
*/

.stb-loading-indicator-dots {
  display: none;
}
.stb-loading-indicator-dots.enable {
  display: block;
}

.stb-loading-indicator-dots .loading-indicator {
  text-align: center;
  display: flex;
  justify-content: space-between;
  width: 110px;
  height: 1rem;
}

.stb-loading-indicator-dots .loading-indicator > div {
    margin-left: 2px;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: inline-block;
    background-color: var(--color-primary);
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.stb-loading-indicator-dots.red .loading-indicator .bounce {
  background-color: var(--color-primary);
}
.stb-loading-indicator-dots.white .loading-indicator .bounce {
  background-color: var(--color-background);
}

.stb-loading-indicator-dots.small .loading-indicator {
  width: 60px;
}
.stb-loading-indicator-dots.small .loading-indicator .bounce {
  width: 1rem;
  height: 1rem;
}

.stb-loading-indicator-dots.medium .loading-indicator {
  width: 80px;
}
.stb-loading-indicator-dots.medium .loading-indicator .bounce {
  width: 1.5rem;
  height: 1.5rem;
}

.stb-loading-indicator-dots.large .loading-indicator {
  width: 110px;
}
.stb-loading-indicator-dots.large .loading-indicator .bounce {
  width: 2rem;
  height: 2rem;
}

.stb-loading-indicator-dots .loading-indicator .bounce1 {
  animation-delay: 0s;
}

.stb-loading-indicator-dots .loading-indicator .bounce2 {
  animation-delay: 0.2s;
}

.stb-loading-indicator-dots .loading-indicator .bounce3 {
  animation-delay: 0.4s;
}

@keyframes sk-bouncedelay {
  0%,
  50%,
  100% {
    -webkit-transform: scale(0);
    transform: scale(0);
  }

  50% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}
