@import url("https://fonts.googleapis.com/css?family=Lora:400,400i,700");

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #222;
}

.staggered-bar-cross {
  position: relative;
  color: white;

  .text {
    opacity: 0;
    animation: fade-in 0.2s 0.6s ease-out forwards;
  }

  .bars {
    $bars-dalay: 0.3s, 0.2s, 0.5s, 0.3s, 0.4s;

    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    .bar {
      width: 100%;
      flex: 1;
      background: currentColor;
      border-radius: 50px;
      animation: 0.6s cubic-bezier(0.4, 0.2, 0.175, 1) forwards; // ease-in-out-quartic

      &:nth-child(odd) {
        transform: translateX(100%);
        animation-name: slide-left;
      }

      &:nth-child(even) {
        transform: translateX(-100%);
        animation-name: slide-right;
      }

      @for $i from 1 through 5 {
        &:nth-child(#{$i}) {
          animation-delay: nth($bars-dalay, $i);
        }
      }
    }
  }
}

@keyframes slide-left {
  to {
    transform: translateX(-100%);
  }
}

@keyframes slide-right {
  to {
    transform: translateX(100%);
  }
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

.title {
  font-family: Lora, serif;
  font-size: 32px;
}
