/* 1.页面初始化 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

section {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 3.设置枫叶盒子的基本样式 */

section .set {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}
.set img{width: 30px;height: auto;}

/* 6.对枫叶图片外侧盒子做样式 */

section .set div {
  position: absolute;
  display: block;
}

/* 7.对每一个单独的枫叶盒子做动画和样式修改 */
section .set div:nth-child(1) {
  left: 20%;
  animation: animate 15s linear infinite;
  animation-delay: -7s;
}

section .set div:nth-child(2) {
  left: 50%;
  animation: animate 20s linear infinite;
  animation-delay: -5s;
}

section .set div:nth-child(3) {
  left: 70%;
  animation: animate 20s linear infinite;
  animation-delay: 0s;
}

section .set div:nth-child(4) {
  left: 0%;
  animation: animate 15s linear infinite;
  animation-delay: -5s;
}

section .set div:nth-child(5) {
  left: 85%;
  animation: animate 18s linear infinite;
  animation-delay: -10s;
}

section .set div:nth-child(6) {
  left: 0%;
  animation: animate 12s linear infinite;
  animation-delay: 0s;
}

section .set div:nth-child(7) {
  left: 15%;
  animation: animate 14s linear infinite;
  animation-delay: 0s;
}

section .set div:nth-child(8) {
  left: 90%;
  animation: animate 18s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(9) {
  left: 50%;
  animation: animate 16s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(10) {
  left: 70%;
  animation: animate 13s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(11) {
  left: 20%;
  animation: animate 17s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(12) {
  left: 10%;
  animation: animate 19s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(13) {
  left: 100%;
  animation: animate 18s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(14) {
  left: 25%;
  animation: animate 17s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(15) {
  left: 95%;
  top: 50%;
  animation: animate 13s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(16) {
  left: 45%;
  top: 15%;
  animation: animate 15s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(17) {
  left: 55%;
  top: 5%;
  animation: animate 10s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(18) {
  left: 65%;
  top: 10%;
  animation: animate 12s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(19) {
  left: 75%;
  top: 3%;
  animation: animate 18s linear infinite;
  animation-delay: -1s;
}
section .set div:nth-child(20) {
  left: 85%;
  top: 5%;
  animation: animate 10s linear infinite;
  animation-delay: -1s;
}
/* 这里面修改的数值不用纠结，只是为了达到效果，其实不用严格按照我这个数来 */

/* 8.定义动画 */

@keyframes animate {
  0% {
    opacity: 0;
    top: -10%;
    transform: translateX(20px) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  20% {
    transform: translateX(-20px) rotate(45deg);
  }
  40% {
    transform: translateX(-20px) rotate(90deg);
  }
  60% {
    transform: translateX(20px) rotate(180deg);
  }
  80% {
    transform: translateX(-20px) rotate(180deg);
  }
  100% {
    top: 110%;
    transform: translateX(-20px) rotate(226deg);
  }
}
