
CSS 水波纹实现,使用了 border-radius 属性,构造一个接近圆的不规则图形,然后使用动画,让其绕 Z 轴不断旋转,以达到一种波浪运动的视觉效果。
<!DOCTYPE html>
<html>
<head>
<title>水波纹效果</title>
<style type="text/css">
body {
margin: 0;
padding: 0;
min-height: 100vh;
position: relative;
background-color: rgb(118, 218, 255);
overflow: hidden;
}
body::before, body::after {
content: '';
position: absolute;
bottom: 15vh;
min-width: 300vw;
min-height: 300vw;
background-color: #FFFFFF;
animation: rote 10s linear infinite;
}
body::before {
left: -95%;
border-radius: 45%;
opacity: .5;
}
body::after {
left: -95%;
border-radius: 46%;
}
@keyframes rote {
from {
transform: rotateZ(0);
}
to {
transform: rotateZ(360deg);
}
}
</style>
</head>
<body></body>
</html>
