@import '../../scss/variables';

.loading {
  animation: fadein 2s ease;

  &.full-screen {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }

  .loading-animation-wrapper {
    position: relative;
    width: 119px;
    height: 169px;
  }
}

svg {
  position: absolute;
}

.lightning {
  filter: drop-shadow(0 0 10px rgba($primary, 0.5));

  path {
    animation: grow 3.5s ease-in-out -6s infinite;
  }
}

.node {
  animation: node 3.5s ease-in-out infinite;

  &:nth-child(1) {
    animation-delay: -2.05s;
  }

  &:nth-child(3) {
    animation-delay: -3s;
    animation-direction: reverse;
  }

  &:nth-child(4) {
    animation-delay: -1.8s;
  }
}

.message {
  margin-top: 2.5rem;
  font-size: 1.2rem;
}

@keyframes fadein {
  0%, 50% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes grow {
  0% {
    stroke-dashoffset: 460;
  }

  45%, 55% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: -460;
  }
}

@keyframes node {
  0% {
    fill: $secondary;
  }

  1% {
    fill: $primary;
  }

  58% {
    fill: $primary;
  }

  59% {
    fill: $secondary;
  }
}