@import '../variables';
@import '../starability-base';
@import '../starability-result';

@keyframes heart {

  0% {
    transform: translateY(0.5 * $star-size);
    opacity: 1;
  }

  30% {
    transform: translateY(0);
    opacity: 0.7;
  }

  45% {
    transform: translateY(0);
    transform: scale(1.1, 1.1);
  }

  50% {
    transform: scale(0.9, 0.9);
  }

  80% {
    opacity: 0.9;
  }

  100% {
    transform: scale(0.1, 0.1);
    opacity: 0;
  }
}

.starability-heart {
  @include starability-base;
  will-change: contents;

  > label::after {
    @include starability-animation-base($img-heart, $img-heart-2x);
    bottom: $star-size;
    left: 0;
    z-index: 2;
  }

  > input:checked + label::after {
    opacity: 1;
    animation-name: heart;
    animation-duration: 1s;
    animation-fill-mode: forwards;
  }
}