$animation-main-delay: 0.5s;
$animation-b1-duration: 0.2s;
$animation-b2-duration: 0.2s;
$earthquake-duration: 0.2s;

$time-between-animations-b1-b2: 0.1s;

// .bank_8,
// .bank,
// .bank_27,
// .stock_exchange

.animated {
  #bank-b1 {
    opacity: 0;
    transform: scale(6);
    transform-origin: 4750px 2300px;

    animation-name: bank_b1;
    animation-duration: $animation-b1-duration;
    animation-delay: $animation-main-delay;
    animation-timing-function: linear;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
  }

  #bank-b2 {
    opacity: 0;
    transform: scale(6);
    transform-origin: 4750px 2300px;

    animation-name: bank_b2;
    animation-duration: $animation-b2-duration;
    animation-delay: $animation-main-delay + $animation-b1-duration + $time-between-animations-b1-b2 +
      $earthquake-duration;
    animation-timing-function: linear;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
  }

  #layer_x5F_1_x5F_wrapper {
    transform-origin: 4750px 2300px;

    animation-name: main_earthquake;
    animation-duration: $earthquake-duration;
    animation-delay: $animation-main-delay + $animation-b1-duration;
    animation-timing-function: linear;
    animation-iteration-count: 1;
  }

  #Layer_x5F_1 {
    transform-origin: 4750px 2300px;

    animation-name: main_earthquake;
    animation-duration: $earthquake-duration;
    animation-delay: $animation-main-delay + $animation-b1-duration + $time-between-animations-b1-b2 +
      $earthquake-duration + $animation-b2-duration;
    animation-timing-function: linear;
    animation-iteration-count: 1;
  }
}

// 40 + 25 + 15 + 10 + 6 + 3 + 1 = 100;
@keyframes main_earthquake {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.1);
  }
  65% {
    transform: scale(0.95);
  }
  80% {
    transform: scale(1.05);
  }
  90% {
    transform: scale(0.98);
  }
  96% {
    transform: scale(1.02);
  }
  99% {
    transform: scale(0.99);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bank_b1 {
  0% {
    transform: scale(6);
    opacity: 0;
  }
  10% {
    transform: scale(5);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bank_b2 {
  0% {
    transform: scale(6);
    opacity: 0;
  }
  10% {
    transform: scale(5);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
