/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

.ouiLoadingElastic {
  position: relative;
  display: inline-block;
}

.ouiLoadingElastic--medium {
  width: $ouiSize;
}

.ouiLoadingElastic--large {
  width: $ouiSizeL;
}

.ouiLoadingElastic--xLarge {
  width: $ouiSizeXL;
}

.ouiLoadingElastic--xxLarge {
  width: $ouiSizeXXL;
}


.ouiLoadingElastic path {
  @include ouiCanAnimate {
    animation-name: ouiLoadingElastic;
  }
  animation-fill-mode: forwards;
  animation-direction: alternate;
  transform-style: preserve-3d;
  animation-duration: 1s;
  animation-timing-function: cubic-bezier(0, .63, .49, 1);
  animation-iteration-count: infinite;
  transform-origin: 50% 50%;
}

.ouiLoadingElastic path:nth-of-type(1) {
  animation-delay: 0s;
}

.ouiLoadingElastic path:nth-of-type(2) {
  animation-delay: .035s;
}

.ouiLoadingElastic path:nth-of-type(3) {
  animation-delay: .125s;
}

.ouiLoadingElastic path:nth-of-type(4) {
  animation-delay: .155s;
}

.ouiLoadingElastic path:nth-of-type(5) {
  animation-delay: .075s;
}

.ouiLoadingElastic path:nth-of-type(6) {
  animation-delay: .06s;
};


@keyframes ouiLoadingElastic {
  0% {
    transform: scale3d(0, 0, -.7);
    opacity: 0;
  }

  40% {
    transform: scale3d(1, 1, 2);
    opacity: 1;
  }

  50% {
    transform: scale3d(.99, .99, 2);
  }

  70% {
    transform: scale3d(.96, .96, -2.5);
  }

  100% {
    transform: scale3d(.98, .98, 2);
  }

}

