CSS雷达光波效果(前端雷达光波效果)

前言

CSS雷达光波效果是一种视觉动画效果,常用于模仿雷达扫描或检测的视觉反馈。这种效果通常涉及到动态的圆形或弧形图案,它们从一个中心点向外扩散,类似于水面上的涟漪或雷达扫描线。以下是创建CSS雷达光波效果的一些关键技术和步骤,这里提供两种效果 ,简单记录一下


一. First

1. HTML 结构

html 复制代码
<div class="radar_container">
      <div class="radar_wave"></div>
      <div class="radar_wave"></div>
      <div class="radar_wave"></div>
</div>

2. CSS 内容

css 复制代码
  .radar_container {
    margin: auto;
    position: relative;
    width: 200px;
    height: 200px;
    // background-color: #000;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .radar_wave {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 1px solid #00ff00;
    border-radius: 50%;
    transform: scale(0); // 初始状态改为从中间开始
    box-shadow: inset 0 0 5px 1px #00ff00; // 添加阴影
    animation: radar_wave-animation 3s infinite;
  }

  .radar_wave:nth-child(1) {
    animation-delay: 0s;
  }
  .radar_wave:nth-child(2) {
    animation-delay: 1s;
  }
  .radar_wave:nth-child(3) {
    animation-delay: 2s;
  }

  @keyframes radar_wave-animation {
    0% {
      transform: scale(0); // 从中间开始
      opacity: 1;
    }
    100% {
      transform: scale(10); // 扩散到原来的10倍大小
      opacity: 0;
    }
  }

二. Second

1. HTML 结构同上,CSS 内容请看以下

css 复制代码
  .radar_container {
    margin: auto;
    position: relative;
    width: 200px;
    height: 200px;
    // background-color: #000;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
  }
  .radar_wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background-color: #8080ff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    animation: radar_wave-animation 3s infinite;
  }

  .radar_wave:nth-child(1) {
    animation-delay: 0s;
  }

  .radar_wave:nth-child(2) {
    animation-delay: 1s;
  }

  .radar_wave:nth-child(3) {
    animation-delay: 2s;
  }

  @keyframes radar_wave-animation {
    0% {
      transform: scale(0); // 从中间开始
      opacity: 1;
    }
    100% {
      transform: scale(10); // 扩散到原来的10倍大小
      opacity: 0;
    }
  }

感觉有用,就一键三连,感谢(●'◡'●)

相关推荐
0思必得02 分钟前
[Web自动化] 开发者工具性能(Performance)面板
运维·前端·自动化·web自动化·开发者工具
心灵的制造商7 分钟前
el-tree左侧新增类别和删除类别实例代码
前端·javascript·vue.js
爱吃无爪鱼9 分钟前
01-前端开发快速入门路线图
javascript·css·vue.js·typescript·前端框架·npm·node.js
冴羽10 分钟前
不知道怎么写 Nano Banana Pro 提示词?分享你一个结构化示例,复刻任意图片
前端·人工智能·aigc
IT_陈寒10 分钟前
JavaScript 性能优化:7个 V8 引擎隐藏技巧让你的代码提速200%
前端·人工智能·后端
脾气有点小暴17 分钟前
uniapp通用单张图片上传组件
前端·javascript·vue.js·uni-app·uniapp
小菜今天没吃饱22 分钟前
DVWA-XSS(stored)
前端·网络安全·xss·dvwa
云飞云共享云桌面22 分钟前
研发部门使用SolidWorks,三维设计云桌面应该怎么选?
运维·服务器·前端·网络·自动化·电脑
老华带你飞31 分钟前
茶叶商城|基于SprinBoot+vue的茶叶商城系统(源码+数据库+文档)
java·前端·javascript·数据库·vue.js·spring boot
烛阴33 分钟前
不只是Public与Private:C#访问修饰符全方位解读
前端·c#