@import "variables";

$loading-duration: 1s;
$loading-curve: cubic-bezier(0.45, 0, 0.15, 1);
$shimmer-border-color: $gray20;
$shimmer-height: 22vh;
$shimmer-block-spacing: 16px;

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.is-shimmer-animated {
  animation: $loading-duration shimmer $loading-curve infinite;
  background-image: linear-gradient(
    to right,
    $gray10 0%,
    $gray10 33%,
    $gray5 50%,
    $gray10 67%,
    $gray10 100%
  );
  background-repeat: no-repeat;
  background-size: 300% 100%;
}

.shimmer-loader {
  width: 100%;
  border: 1px solid $shimmer-border-color;
  height: $shimmer-height;
  display: flex;
  justify-content: space-around;
  padding: $shimmer-block-spacing;
}
.shimmer-loader-row {
  height: 100%;
  flex-basis: 33%;
  margin-right: $shimmer-block-spacing;
  display: flex;
  flex-direction: column;

  &:last-child {
    margin-right: 0;
  }
}
.shimmer-loader-cell {
  margin-bottom: $shimmer-block-spacing;

  &:last-child {
    margin-bottom: 0;
  }
  &.simple {
    height: 40%;
  }
  &.double {
    height: 60%;
  }
}
