css 流星雨動畫

https://wow.techbrood.com/fiddle/25302html

https://blog.csdn.net/iefreer/article/details/51193262?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecasespa

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      html,
      body {
        width: 100%;
        height: 100%;
        background-color: black;
      }
      .star {
        display: block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #fff;
        top: 100px;
        left: 400px;
        position: relative;
        box-shadow: 0 0 5px 5px rgba(255, 255, 255, 0.3);
        animation: star-ani 9s infinite;
      }
      .star:after {
        content: '';
        display: block;
        top: 0px;
        left: 4px;
        border: 0px solid #fff;
        border-width: 2px 90px 2px 90px;
        border-color: transparent transparent transparent
          rgba(255, 255, 255, 0.3);
        transform: rotate(-45deg) translate3d(1px, 4px, 0);
        transform-origin: 0% 0%;
      }
      @keyframes star-ani {
        0% {
          opacity: 0;
          transform: translate3d(0, 0, 0);
        }
        50% {
          opacity: 1;
          transform: translate3d(-200px, 200px, 0);
        }
        100% {
          opacity: 0;
          transform: translate3d(-300px, 300px, 0);
        }
      }
    </style>
  </head>
  <body>
    <div class="star"></div>
  </body>
</html>
相關文章
相關標籤/搜索