console
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>涟漪效果</title>
<style>
.example {
position: relative;
margin: 150px auto;
width: 50px;
height: 50px;
}
.dot:before {
content: " ";
position: absolute;
z-index: 2;
left: 50%;
top: 50%;
width: 20px;
height: 20px;
background-color: #0093E9;
border-radius: 50%;
transform: translate(-50%, -50%);
}
.dot:after {
content: " ";
position: absolute;
z-index: 1;
left: 50%;
top: 50%;
width: 30px;
height: 30px;
background-color: transparent;
border: 1px solid #0093E9;
border-radius: 50%;
animation-name: ripple;
animation-duration: 1s;
animation-timing-function: ease;
animation-delay: 0s;
animation-iteration-count: infinite;
animation-direction: normal;
transform: translate(-50%, -50%);
}
@keyframes ripple {
0% {
opacity: 1;
width: 20px;
height: 20px;
}
100% {
opacity: 0;
width: 30px;
height: 30px;
}
}
</style>
</head>
<body>
<div class="example">
<div class="dot"></div>
</div>
</body>
</html>