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

css3实现类似地图定位循环扩散光圈效果(最新推荐) 第1张

2.html

<p class="e230-e796-3b53-127f icon-warnCom">
        <icon class="e796-3b53-127f-f34f icon-warns"><i class="3b53-127f-f34f-9733 dot"></i><i class="127f-f34f-9733-9663 pulse"></i></icon>
    </p>
    <p class="f34f-9733-9663-ef5d icon-warnCom1">
        <icon class="9733-9663-ef5d-b7a4 icon-warns"><i class="9663-ef5d-b7a4-2105 dot"></i><i class="ef5d-b7a4-2105-b11f pulse"></i></icon>
    </p>
    <p class="b7a4-2105-b11f-f060 icon-warnCom2">
        <icon class="2105-b11f-f060-a3ca icon-warns"><i class="b11f-f060-a3ca-1c9d dot"></i><i class="4970-c454-3840-5600 pulse"></i></icon>
    </p>

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

到此这篇关于css3实现类似地图定位循环扩散光圈效果的文章就介绍到这了,更多相关css3地图定位循环扩散光圈内容请搜索酷瑞百科以前的文章或继续浏览下面的相关文章,希望大家以后多多支持酷瑞百科!

收藏(0)