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

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

2.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

 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;
        }

相关推荐

  1. css实现文字左右循环滚动播放效果

    2023-12-20 06:34:05       29 阅读
  2. HTML/CSS实现3D翻转页面效果

    2023-12-20 06:34:05       39 阅读
  3. css动画旋转效果实现

    2023-12-20 06:34:05       38 阅读

最近更新

  1. TCP协议是安全的吗?

    2023-12-20 06:34:05       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-20 06:34:05       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-20 06:34:05       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-20 06:34:05       20 阅读

热门阅读

  1. Tenda账号密码泄露漏洞复现 [附POC]

    2023-12-20 06:34:05       39 阅读
  2. git打标签,tag常见命令及说明

    2023-12-20 06:34:05       30 阅读
  3. Halcon深度学习相关术语介绍

    2023-12-20 06:34:05       28 阅读
  4. Js Array的相关总结

    2023-12-20 06:34:05       49 阅读
  5. APP开发者如何做好变现数据分析

    2023-12-20 06:34:05       41 阅读
  6. forward

    2023-12-20 06:34:05       44 阅读
  7. C++入门【11-C++ 数字】

    2023-12-20 06:34:05       33 阅读