当看到你的时候,哇哦,这感觉来了!好神奇的css吖
效果(是动态的水滴,这里只是一帧图片)
水滴样式网址
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Water</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
background-color: #00a8ff;
}
#water{
margin-top: 200px;
width: 300px;
height: 300px;
border-radius: 47% 53% 56% 44% / 30% 28% 72% 70% ;
box-shadow: inset 10px 20px 30px rgba(0, 0, 0, 0.5),
10px 10px 20px rgba(0, 0, 0, 0.3),
15px 15px 30px rgba(0, 0, 0, 0.05),
inset -10px -10px 15px rgba(255, 255, 255, 0.8);
animation: action 3s linear infinite alternate;
}
#water::after{
content: '';
width: 20px;
height: 20px;
position: absolute;
top: 240px;
left: 48%;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 43% 57% 53% 47% / 40% 42% 58% 60% ;
}
#water::before{
content: '';
width: 10px;
height: 10px;
position: absolute;
top: 260px;
left: 45%;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 43% 57% 53% 47% / 40% 42% 58% 60% ;
}
@keyframes action{
25%{
border-radius: 46% 54% 48% 52% / 41% 31% 69% 59% ;
}
50%{
border-radius: 43% 57% 53% 47% / 40% 42% 58% 60% ;
}
75%{
border-radius: 43% 57% 56% 44% / 40% 47% 53% 60% ;
}
100%{
border-radius: 43% 57% 42% 58% / 40% 57% 43% 60% ;
}
}
</style>
</head>
<body>
<div id="water"></div>
</body>
</html>