当前位置:首页 > 网站应用

流星雨源码特效

cjw1232年前 (2024-10-15)网站应用5870
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>流星雨源码特效</title>
  </head>
  <style>
    body {
      background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
      height: 100vh;
      overflow: hidden;
      display: flex;
      font-family: "Anton", sans-serif;
      justify-content: center;
      align-items: center;
    }

    .night {
      position: relative;
      width: 100%;
      height: 100%;
      transform: rotateZ(45deg);
    }

    .shooting_star {
      position: absolute;
      left: 50%;
      top: 50%;
      height: 2px;
      background: linear-gradient(-45deg, #5f91ff, rgba(0, 0, 255, 0));
      border-radius: 999px;
      filter: drop-shadow(0 0 6px #699bff);
      animation: tail 3000ms ease-in-out infinite,
        shooting 3000ms ease-in-out infinite;
    }
    .shooting_star::before {
      content: "";
      position: absolute;
      top: calc(50% - 1px);
      right: 0;
      height: 2px;
      background: linear-gradient(
        -45deg,
        rgba(0, 0, 255, 0),
        #5f91ff,
        rgba(0, 0, 255, 0)
      );
      transform: translateX(50%) rotateZ(45deg);
      border-radius: 100%;
      animation: shining 3000ms ease-in-out infinite;
    }
    .shooting_star::after {
      content: "";
      position: absolute;
      top: calc(50% - 1px);
      right: 0;
      height: 2px;
      background: linear-gradient(
        -45deg,
        rgba(0, 0, 255, 0),
        #5f91ff,
        rgba(0, 0, 255, 0)
      );
      transform: translateX(50%) rotateZ(45deg);
      border-radius: 100%;
      animation: shining 3000ms ease-in-out infinite;
      transform: translateX(50%) rotateZ(-45deg);
    }
    .shooting_star:nth-child(1) {
      top: calc(50% - 81px);
      left: calc(50% - 37px);
      animation-delay: 1023ms;
    }
    .shooting_star:nth-child(1)::before,
    .shooting_star:nth-child(1)::after {
      animation-delay: 1023ms;
    }
    .shooting_star:nth-child(2) {
      top: calc(50% - 22px);
      left: calc(50% - 154px);
      animation-delay: 4673ms;
    }
    .shooting_star:nth-child(2)::before,
    .shooting_star:nth-child(2)::after {
      animation-delay: 4673ms;
    }
    .shooting_star:nth-child(3) {
      top: calc(50% - 128px);
      left: calc(50% - 1px);
      animation-delay: 5495ms;
    }
    .shooting_star:nth-child(3)::before,
    .shooting_star:nth-child(3)::after {
      animation-delay: 5495ms;
    }
    .shooting_star:nth-child(4) {
      top: calc(50% - 86px);
      left: calc(50% - 147px);
      animation-delay: 1132ms;
    }
    .shooting_star:nth-child(4)::before,
    .shooting_star:nth-child(4)::after {
      animation-delay: 1132ms;
    }
    .shooting_star:nth-child(5) {
      top: calc(50% - -1px);
      left: calc(50% - 52px);
      animation-delay: 1517ms;
    }
    .shooting_star:nth-child(5)::before,
    .shooting_star:nth-child(5)::after {
      animation-delay: 1517ms;
    }
    .shooting_star:nth-child(6) {
      top: calc(50% - 55px);
      left: calc(50% - 209px);
      animation-delay: 9108ms;
    }
    .shooting_star:nth-child(6)::before,
    .shooting_star:nth-child(6)::after {
      animation-delay: 9108ms;
    }
    .shooting_star:nth-child(7) {
      top: calc(50% - 47px);
      left: calc(50% - 154px);
      animation-delay: 2702ms;
    }
    .shooting_star:nth-child(7)::before,
    .shooting_star:nth-child(7)::after {
      animation-delay: 2702ms;
    }
    .shooting_star:nth-child(8) {
      top: calc(50% - 186px);
      left: calc(50% - 273px);
      animation-delay: 8824ms;
    }
    .shooting_star:nth-child(8)::before,
    .shooting_star:nth-child(8)::after {
      animation-delay: 8824ms;
    }
    .shooting_star:nth-child(9) {
      top: calc(50% - 53px);
      left: calc(50% - 245px);
      animation-delay: 9125ms;
    }
    .shooting_star:nth-child(9)::before,
    .shooting_star:nth-child(9)::after {
      animation-delay: 9125ms;
    }
    .shooting_star:nth-child(10) {
      top: calc(50% - 57px);
      left: calc(50% - 283px);
      animation-delay: 2233ms;
    }
    .shooting_star:nth-child(10)::before,
    .shooting_star:nth-child(10)::after {
      animation-delay: 2233ms;
    }
    .shooting_star:nth-child(11) {
      top: calc(50% - -126px);
      left: calc(50% - 144px);
      animation-delay: 6880ms;
    }
    .shooting_star:nth-child(11)::before,
    .shooting_star:nth-child(11)::after {
      animation-delay: 6880ms;
    }
    .shooting_star:nth-child(12) {
      top: calc(50% - -197px);
      left: calc(50% - 131px);
      animation-delay: 8614ms;
    }
    .shooting_star:nth-child(12)::before,
    .shooting_star:nth-child(12)::after {
      animation-delay: 8614ms;
    }
    .shooting_star:nth-child(13) {
      top: calc(50% - -57px);
      left: calc(50% - 146px);
      animation-delay: 8211ms;
    }
    .shooting_star:nth-child(13)::before,
    .shooting_star:nth-child(13)::after {
      animation-delay: 8211ms;
    }
    .shooting_star:nth-child(14) {
      top: calc(50% - 191px);
      left: calc(50% - 80px);
      animation-delay: 1686ms;
    }
    .shooting_star:nth-child(14)::before,
    .shooting_star:nth-child(14)::after {
      animation-delay: 1686ms;
    }
    .shooting_star:nth-child(15) {
      top: calc(50% - -143px);
      left: calc(50% - 279px);
      animation-delay: 6485ms;
    }
    .shooting_star:nth-child(15)::before,
    .shooting_star:nth-child(15)::after {
      animation-delay: 6485ms;
    }
    .shooting_star:nth-child(16) {
      top: calc(50% - 97px);
      left: calc(50% - 11px);
      animation-delay: 260ms;
    }
    .shooting_star:nth-child(16)::before,
    .shooting_star:nth-child(16)::after {
      animation-delay: 260ms;
    }
    .shooting_star:nth-child(17) {
      top: calc(50% - -145px);
      left: calc(50% - 43px);
      animation-delay: 9745ms;
    }
    .shooting_star:nth-child(17)::before,
    .shooting_star:nth-child(17)::after {
      animation-delay: 9745ms;
    }
    .shooting_star:nth-child(18) {
      top: calc(50% - 105px);
      left: calc(50% - 79px);
      animation-delay: 4761ms;
    }
    .shooting_star:nth-child(18)::before,
    .shooting_star:nth-child(18)::after {
      animation-delay: 4761ms;
    }
    .shooting_star:nth-child(19) {
      top: calc(50% - -71px);
      left: calc(50% - 48px);
      animation-delay: 5821ms;
    }
    .shooting_star:nth-child(19)::before,
    .shooting_star:nth-child(19)::after {
      animation-delay: 5821ms;
    }
    .shooting_star:nth-child(20) {
      top: calc(50% - -149px);
      left: calc(50% - 39px);
      animation-delay: 1116ms;
    }
    .shooting_star:nth-child(20)::before,
    .shooting_star:nth-child(20)::after {
      animation-delay: 1116ms;
    }

    @keyframes tail {
      0% {
        width: 0;
      }
      30% {
        width: 100px;
      }
      100% {
        width: 0;
      }
    }
    @keyframes shining {
      0% {
        width: 0;
      }
      50% {
        width: 30px;
      }
      100% {
        width: 0;
      }
    }
    @keyframes shooting {
      0% {
        transform: translateX(0);
      }
      100% {
        transform: translateX(300px);
      }
    }
    @keyframes sky {
      0% {
        transform: rotate(45deg);
      }
      100% {
        transform: rotate(405deg);
      }
    }
  </style>
  <body>
    <div class="night">
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
      <div class="shooting_star"></div>
    </div>
  </body>
</html>


扫描二维码推送至手机访问。

版权声明:本文由追求完美发布,如需转载请注明出处。

本文链接:https://cjw123.com/blog/?id=93

标签: htmlcss
分享给朋友:

相关文章

html meta标签屏蔽搜索引擎的用法

html页面中的 meta 标签可以用来识别搜索引擎的蜘蛛类型,可以规定meta标签所在的html页面是否被蜘蛛抓取,下面是这个meta标签的用法,大家可以借鉴一下。搜索引擎的 meta 标签的解析下面是meta标签对搜索引擎的解析<meta name='robot…

CSS中给背景图增加遮罩

CSS作为网页开发的重要组成部分,经常会用到遮罩层的效果,实现页面视觉上的突出和强调。那么,CSS怎样设置遮罩层呢?下面就来简单介绍一下。首先,要清楚遮罩层的定义。遮罩层是指在页面元素上添加一个半透明的罩子,使得页面元素之间的重叠效果。”遮”住页面上的元素。接下来,我们来看如何在CSS中实现遮罩层的…

CSS心形缠绕转动效果

CSS心形缠绕转动效果是一种有趣的动画效果,能够给网页带来浪漫而动感的氛围。这个效果将一个心形图案无限旋转,并且同时绕着一个中心点缠绕旋转。通过巧妙地运用CSS的动画属性和变换属性,你可以实现这个效果。首先,使用CSS创建一个心形图案,可以通过调整元素的宽高、边框、背景色等属性来塑造心形的形状。然后…

js+css3文字闪光滑过动画特效

<!DOCTYPE html>     <html>     <head>     <meta http-equ…

谷歌免费网站ico图标接口

分享个免费有用的ico图标的接口,可以使用谷歌提供的友链ico接口读取网址的ico图标,就可以很轻松的实现为网站友情链接增加ico图标。ico图标接口:https://t1.gstatic.cn/faviconV2?client=SOCIAL&type=FAVICON&fallbac…

Q弹果冻

<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">…

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。