@import '../../styles/common';

$size: rem(10px);
$base-position: rem(-4px);

.Indicator {
  &::before,
  &::after {
    content: '';
    position: absolute;
    background-color: color('teal');
    right: $base-position;
    top: $base-position;
    width: $size;
    height: $size;
    border-radius: 100%;
  }
}

.pulseIndicator::before {
  z-index: 1;
  animation: bounce 5s ease infinite;
}

.pulseIndicator::after {
  right: $base-position;
  top: $base-position;
  animation: pulse 5s ease infinite;
}

$pip-animation: (
  start-scaling-small: 65%,
  finish-scaling-small: 75%,
  finish-scaling-big: 82.5%,
  finish-scaling: 85%,
);

@keyframes bounce {
  from,
  #{map-get($pip-animation, start-scaling-small)},
  #{map-get($pip-animation, finish-scaling)} {
    transform: scale(1);
  }

  #{map-get($pip-animation, finish-scaling-small)} {
    transform: scale(0.85);
  }

  #{map-get($pip-animation, finish-scaling-big)} {
    transform: scale(1.05);
  }
}

@keyframes pulse {
  from,
  #{map-get($pip-animation, finish-scaling-small)} {
    transform: scale(0.85);
    opacity: 1;
  }

  to {
    transform: scale(2.5);
    opacity: 0;
  }
}
