<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS3添加动态圆点</title>
<style>
@-webkit-keyframes mars3d-mapAni {
0% {
width: 0;
height: 0;
opacity: 1;
filter: alpha(opacity=1)
}
25% {
width: 12px;
height: 12px;
opacity: .7;
filter: alpha(opacity=70)
}
50% {
width: 20px;
height: 20px;
opacity: .5;
filter: alpha(opacity=50)
}
75% {
width: 30px;
height: 30px;
opacity: .2;
filter: alpha(opacity=20)
}
to {
width: 40px;
height: 40px;
opacity: 0;
filter: alpha(opacity=0)
}
}
@-moz-keyframes mars3d-mapAni {
0% {
width: 0;
height: 0;
opacity: 1;
filter: alpha(opacity=1)
}
25% {
width: 12px;
height: 12px;
opacity: .7;
filter: alpha(opacity=70)
}
50% {
width: 20px;
height: 20px;
opacity: .5;
filter: alpha(opacity=50)
}
75% {
width: 30px;
height: 30px;
opacity: .2;
filter: alpha(opacity=20)
}
to {
width: 40px;
height: 40px;
opacity: 0;
filter: alpha(opacity=0)
}
}
@-o-keyframes mars3d-mapAni {
0% {
width: 0;
height: 0;
opacity: 1;
filter: alpha(opacity=1)
}
25% {
width: 12px;
height: 12px;
opacity: .7;
filter: alpha(opacity=70)
}
50% {
width: 20px;
height: 20px;
opacity: .5;
filter: alpha(opacity=50)
}
75% {
width: 30px;
height: 30px;
opacity: .2;
filter: alpha(opacity=20)
}
to {
width: 40px;
height: 40px;
opacity: 0;
filter: alpha(opacity=0)
}
}
@-ms-keyframes mars3d-mapAni {
0% {
width: 0;
height: 0;
opacity: 1;
filter: alpha(opacity=1)
}
25% {
width: 12px;
height: 12px;
opacity: .7;
filter: alpha(opacity=70)
}
50% {
width: 20px;
height: 20px;
opacity: .5;
filter: alpha(opacity=50)
}
75% {
width: 30px;
height: 30px;
opacity: .2;
filter: alpha(opacity=20)
}
to {
width: 40px;
height: 40px;
opacity: 0;
filter: alpha(opacity=0)
}
}
@keyframes mars3d-mapAni {
0% {
width: 0;
height: 0;
opacity: 1;
filter: alpha(opacity=1)
}
25% {
width: 12px;
height: 12px;
opacity: .7;
filter: alpha(opacity=70)
}
50% {
width: 20px;
height: 20px;
opacity: .5;
filter: alpha(opacity=50)
}
75% {
width: 30px;
height: 30px;
opacity: .2;
filter: alpha(opacity=20)
}
to {
width: 40px;
height: 40px;
opacity: 0;
filter: alpha(opacity=0)
}
}
.mars3d-animation-point {
width: 20px;
height: 20px;
border-radius: 50%;
border: 2px solid hsla(0,0%,100%,.5);
cursor: pointer;
color: #0ff;
background: currentColor;
z-index: 3;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%,-50%);
-moz-transform: translate(-50%,-50%);
-o-transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
transform: translate(-50%,-50%);
box-shadow: 0 0 2em currentColor,0 0 .5em currentColor;
position: absolute;
/* font-size: 20px; */
}
.mars3d-animation-point:after, .mars3d-animation-point:before {
border: 2px solid;
-webkit-animation: mars3d-mapAni 1s ease infinite;
-moz-animation: mars3d-mapAni 1s ease infinite;
-o-animation: mars3d-mapAni 1s ease infinite;
-ms-animation: mars3d-mapAni 1s ease infinite;
animation: mars3d-mapAni 1s ease infinite;
}
.mars3d-animation-point:after, .mars3d-animation-point:before, .mars3d-animation-point p:after, .mars3d-animation-point p:before {
content: "";
position: absolute;
width: 100%;
height: 100%;
left: 50%;
top: 50%;
border-radius: 50%;
-webkit-transform: translate(-50%,-50%);
-moz-transform: translate(-50%,-50%);
-o-transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
transform: translate(-50%,-50%);
/* font-size: 20px; */
}
.mars3d-animation-point p {
position: absolute;
left: 50%;
top: 50%;
width: 0;
height: 0;
border-radius: 50%;
-webkit-transform: translate(-50%,-50%);
-moz-transform: translate(-50%,-50%);
-o-transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
transform: translate(-50%,-50%);
-webkit-animation: mars3d-mapAni 2s ease infinite;
-moz-animation: mars3d-mapAni 2s ease infinite;
-o-animation: mars3d-mapAni 2s ease infinite;
-ms-animation: mars3d-mapAni 2s ease infinite;
animation: mars3d-mapAni 2s ease infinite;
}
</style>
</head>
<body>
<div style="position: absolute; left: 0px; top: 0px; pointer-events: all; transform: matrix(1, 0, 0, 1, 391.351, 581.323); transform-origin: left bottom 0px;">
<div class="mars3d-animation-point" style="color:#f33349;">
<p></p>
</div>
</div>
</body>
</html>