<template>
  <div class="thunder-container">
    <div class="thunder thunder-1"></div>
    <div class="thunder thunder-2"></div>
  </div>
</template>

<style lang="scss" scoped>
  .thunder-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .thunder {
    position: absolute;
    width: 50px;
    height: 50px;
    background: #222;
    opacity: 0.3;
    border-radius: 50%;
    box-shadow: #222 65px -15px 0 -5px, #222 25px -25px, #222 30px 10px, #222 60px 15px 0 -10px, #222 85px 5px 0 -5px;
    animation: float 60s linear infinite;
  }

  .thunder:before {
    content: '';
    position: absolute;
    top: 60px;
    left: 60px;
    border-left: 0px solid transparent;
    border-right: 8px solid transparent;
    border-top: 38px solid yellow;
    box-shadow: yellow -7px -32px;
    transform: rotate(30deg);
    transform-origin: center -50px;
    animation: stormy_thunder 2s steps(1, end) infinite;
  }

  .thunder-1 {
    top: 0%;
    left: -100px;
    animation-duration: 45s;
  }

  .thunder-2 {
    top: 40%;
    left: -250px;
    animation-duration: 60s;
  }

  @keyframes float {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(500px);
    }
  }

  @keyframes stormy_thunder {
    0% {
      transform: rotate(30deg);
      opacity: 1;
    }
    5% {
      transform: rotate(-34deg);
      opacity: 1;
    }
    10% {
      transform: rotate(0deg);
      opacity: 1;
    }
    15% {
      transform: rotate(-34deg);
      opacity: 0;
    }
  }
</style>
