纯CSS坐标点缩放闪烁,从中心向四周扩散的效果

原文地址:原文连接

<template>
 <div class="box">
      <div class="dot dot1"></div>
      <div class="dot dot2"></div>
      <div class="dot dot3"></div>
      <div class="dot dot4"></div>
  </div>
</template>

<style lang="scss">
.box {
    position: relative;
    background-image: url(../../assets/map.jpeg);
    width: 1000px;
    height: 800px;
    background-size: 1000px 700px;
    background-repeat: no-repeat;
}

.dot {
    position: absolute;
    &::before,
    &::after {
        content: "";
        position: absolute;
        width: 12px;
        height: 12px;
        border-radius: 50%;
    }
    &::before {
        animation: amplify1 2s infinite;
    }
    &::after {
        animation: amplify2 2s infinite;
    }
}

.dot1 {
    top: 26%;
    left: 74%;
    background-color: darkred;
    &::before,
    &::after {
        background-color: darkred;
    }
}

.dot2 {
    top: 71%; 
    left: 73%; 
    background-color: green;
    &::before,
    &::after {
        background-color: green;
    }
}
.dot3 {
    top: 62%; 
    left:56%;
    background-color: blue;
    &::before,
    &::after {
        background-color: blue;
    }
}
.dot4 {
    top: 40%; 
    left: 36%;
    background-color: rebeccapurple;
    &::before,
    &::after {
        background-color: rebeccapurple;
    }
}

@keyframes amplify1 {
    0% {
        transform: scale(1);
        opacity: .9
    }

    100% {
        transform: scale(6);
        opacity: 0;
    }
}

@keyframes amplify2 {
    0% {
        transform: scale(1);
        opacity: .9;
    }

    100% {
        transform: scale(12);
        opacity: 0;
    }
}
</style>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值