css3实现类似地图定位循环扩散光圈效果

1.效果图,重点opacity,animation,transform:scale

2.html

html 复制代码
<div class="icon-warnCom">
        <icon class="icon-warns"><i class="dot"></i><i class="pulse"></i></icon>
    </div>
    <div class="icon-warnCom1">
        <icon class="icon-warns"><i class="dot"></i><i class="pulse"></i></icon>
    </div>
    <div class="icon-warnCom2">
        <icon class="icon-warns"><i class="dot"></i><i class="pulse"></i></icon>
    </div>

3.css

css 复制代码
 body {
            width: 100%;
            height: 100%;
            background-color: black;
        }
        
        @keyframes warn {
            0% {
                transform: scale(0);
                opacity: 0.0;
            }

            25% {
                transform: scale(0);
                opacity: 0.1;
            }

            50% {
                transform: scale(0.1);
                opacity: 0.3;
            }

            75% {
                transform: scale(0.2);
                opacity: 0.5;
            }

            100% {
                transform: scale(0.3);
                opacity: 0.0;
            }
        }
        
        .icon-warnCom {
            position: absolute;
            width: 12px;
            height: 12px;
            background-color: #ffd803;
            border-radius: 100%;
            top: 100px;
            left: 100px;
        }

        .icon-warns {
            position: relative;
            width: 100%;
            height: 100%;
            display: block;
        }
        /* 保持大小不变的小圆圈  */
        .dot {
            position: absolute;
            left: -44px;
            top: -44px;
            width: 60px;
            height: 60px;
            -webkit-border-radius: 100;
            -moz-border-radius: 100;
            border: 20px solid #f6c100;
            border-radius: 100%;
            z-index: 2;
            opacity: 0;
            -webkit-animation: warn 2.5s ease-out;
            -moz-animation: warn 2.5s ease-out;
            animation: warn 2.5s ease-out;
            -webkit-animation-iteration-count: infinite;
            -moz-animation-iteration-count: infinite;
            animation-iteration-count: infinite;
        }

        /* 产生动画(向外扩散变大)的圆圈  */
        .pulse {
            position: absolute;
            left: -44px;
            top: -44px;
            width: 60px;
            height: 60px;
            border: 20px solid #f6c100;
            -webkit-border-radius: 100%;
            -moz-border-radius: 100%;
            border-radius: 100%;
            z-index: 1;
            opacity: 1;
            -webkit-animation: warn 1.5s ease-out;
            -moz-animation: warn 1.5s ease-out;
            animation: warn 1.5s ease-out;
            -webkit-animation-iteration-count: infinite;
            -moz-animation-iteration-count: infinite;
            animation-iteration-count: infinite;
        }

       

        .icon-warnCom1 {
            position: absolute;
            width: 12px;
            height: 12px;
            background-color: #ffd803;
            border-radius: 100%;
            top: 50px;
            left: 50px;
        }

        .icon-warnCom2 {
            position: absolute;
            width: 12px;
            height: 12px;
            background-color: #ffd803;
            border-radius: 100%;
            top: 100px;
            left: 50px;
        }
相关推荐
de_wizard几秒前
Spring Boot 整合 Apollo 配置中心实战
java·spring boot·后端
JAVA学习通1 分钟前
AI Agent 工具调用机制深度解析与 Spring Boot 工程集成实战(2026版)
java·人工智能·spring boot·python·spring
ooseabiscuit2 分钟前
Spring报错解决一览
java·后端·spring
Foreer黑爷3 分钟前
Java多线程编程:Thread与Runnable的并发控制
java·开发语言
身如柳絮随风扬6 分钟前
深入理解 Sentinel:服务雪崩、熔断原理、使用实践与规则持久化
java·微服务·sentinel
dgvri6 分钟前
Spring Boot接收参数的19种方式
java·spring boot·后端
组合缺一8 分钟前
SolonCode CLI 为什么选择 Java 技术栈?
java·开发语言
rOuN STAT8 分钟前
Spring Boot 2.7.x 至 2.7.18 及更旧的版本,漏洞说明
java·spring boot·后端
ZC跨境爬虫11 分钟前
3D 地球卫星轨道可视化平台开发 Day13(卫星可视化交互优化+丝滑悬停聚焦)
前端·算法·3d·json·交互
阿巴斯甜17 分钟前
BinaryOperator的使用:
java