• 在这个基础上再点缀一下让他焕然一新,该怎么点缀,比如让流星有闪烁的光芒


    关注 码龄 粉丝数 原力等级 -- 被采纳 被点赞 采纳率 竹莅 2024-07-26 19:52 采纳率: 0% 浏览 2 首页/ 前端 / 在这个基础上再点缀一下让他焕然一新,该怎么点缀,比如让流星有闪烁的光芒 前端框架 *{ margin: 0; padding: 0; box-sizing: border-box;}body{ height: 100vh; overflow: hidden;}section{ position: absolute; top: 0; left: 0; width: 100%; height: 100vh; background-image: url("images/fp.png"); background-position: center; background-size: cover; animation: animatebg 3s linear infinite;}@keyframes animateBg{ 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.1); }} span{ position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; background: #fff; border-radius: 50%; box-shadow: 0 0 05px rgba(255,255,255,0.1),0 0 20px rgba(255, 255, 255, 0.1),0 0 10px rgba(255, 255, 255, 0.1); animation: animate 5s linear infinite; } span:nth-child(1){ top: 0; right: 0; left: initial; animation-delay: 0s; animation-duration: 5s; } span:nth-child(2){ top: 0; right: 120px; left: initial; animation-delay: 0.5s; animation-duration: 6s; } span:nth-child(3){ top: 0; right: 280px; left: initial; animation-delay: 1.2s; animation-duration: 5s; } span:nth-child(4){ top: 0; right: 20px; left: initial; animation-delay: 1.3s; animation-duration: 6s; } span:nth-child(5){ top: 0; left: 1300px; animation-delay: 0.3s; animation-duration: 3s; } span:nth-child(6){ top: 0; left: 900px; animation-delay: 1s; animation-duration: 6s; } span:nth-child(7){ top: 0; left: 900px; animation-delay: 0.3s; animation-duration: 2s; } span:nth-child(8){ top: 0; left: 500px; animation-delay: 1.3s; animation-duration: 5s; } span:nth-child(9){ top: 0; left: 1200px; animation-delay: 1.6; animation-duration: 3s; } @keyframes animate{ 0%{ transform: rotate(320deg) translateX(1000px); } 100%{ transform: rotate(320deg) translateX(-2000px); } } span::before{ content: ''; position: absolute; top: 50%; transform: translateY(-50%); width: 300px; height: 1px; background: linear-gradient(90deg #ffffff, transparent); } 收起 写回答 好问题 0 提建议 追加酬金 关注问题 微信扫一扫 点击复制链接 分享 邀请回答 编辑 收藏 删除 结题 收藏 举报 追加酬金 (90%的用户在追加酬金后获得了解决方案) 当前问题酬金 ¥ 0 (可追加 ¥500) ¥ 15¥ 20¥ 50¥ 100¥ 200 支付方式 扫码支付 二维码出错 点击刷新 支付金额 15 元 提供问题酬金的用户不参与问题酬金结算和分配 支付即为同意 《付费问题酬金结算规则》 结题 再想想 删除 再等等

    1条回答 默认 最新

    • 专家-司宇[在线] 2024-07-26 19:52
      关注

      引自免费微信小程序:皆我百晓生

      为了让你的设计焕然一新并添加流星闪烁的效果,我们可以采用以下方法:

      1. 为流星添加闪烁动画。
      2. 调整现有的动画和样式以增强视觉效果。

      以下是基于你提供的代码的建议修改:

      前端框架部分(CSS):

      *{ margin: 0; padding: 0; box-sizing: border-box;}
      body{ height: 100vh; overflow: hidden;}
      section{ 
          position: absolute; 
          top: 0; 
          left: 0; 
          width: 100%; 
          height: 100vh; 
          background-image: url("images/fp.png"); 
          background-position: center; 
          background-size: cover; 
          animation: animateBg 3s linear infinite;
      }
      @keyframes animateBg{ 
          0%,100%{ transform: scale(1); } 
          50%{ transform: scale(1.1); }
      }
      

      流星闪烁动画(CSS):

      为流星定义一个基础的样式,并添加闪烁效果。你可以为不同的流星设置不同的延迟和动画时长来达到不同的闪烁效果。这里只是一个基础的示例。

      .meteor {
          position: absolute;
          top: 50%; /* 根据需要调整流星的位置 */
          left: calc(50% + /* 根据需要调整流星的位置偏移 */); /* 可以使用calc进行更精细的位置控制 */
          width: 5px; /* 根据需要调整流星的大小 */
          height: 5px; /* 同上 */
          background: #fff; /* 定义流星的颜色 */
          border-radius: 50%; /* 使元素变为圆形 */
          animation: blink 1s infinite alternate; /* 定义闪烁动画 */
      }
      @keyframes blink { /* 定义闪烁的关键帧动画 */
          from { opacity: 1; } /* 完全可见 */
          to { opacity: 0.5; } /* 半透明 */ /* 根据需要调整透明度值 */ }
      

      你可以根据需要为不同的流星设置不同的动画延迟和持续时间,以达到不同的闪烁效果。例如,你可以为每个流星添加不同的animation-delay值来实现它们以不同的时间开始闪烁。此外,你可以调整animation属性的其他参数,如animation-durationanimation-timing-function等,来控制闪烁的速度和其他效果。将这些代码集成到你的现有样式中即可实现所需的流星闪烁效果。

      展开全部

      评论 编辑记录
      编辑
      预览

      报告相同问题?

    • 相关阅读:
      在ubuntu20下使用花生壳映射vscode SSH
      【mysql】—— 函数的基本介绍
      vite快速构建vue3项目
      Spring @Component注解详解
      java计算机毕业设计固定资产管理系统源码+mysql数据库+系统+LW文档+部署
      12.netty中tcp粘包拆包问题及解决方法
      华为云开发者官网首页焕新升级,赋能开发者云上成长
      【100天精通Python】Day57:Python 数据分析_Pandas数据描述性统计,分组聚合,数据透视表和相关性分析
      J2EE--通用分页
      Selenium自动化中处理鼠标悬停并操作的方法
    • 原文地址:https://ask.csdn.net/questions/8133202