div+css实现云端雨水滴下下雨动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现云端雨水滴下下雨动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
#rain-wrap {
position: relative;
margin: 0px auto;
padding: 0;
width: 100%;
max-width: 1200px;
height: 100vh;
max-height: 500px;
overflow: hidden;
background: radial-gradient(circle at center center, #d9e7ee, #91a8b3);
/* background: #b7c1c6;*/
border: 2vw solid white;
}
/* ocean*/
.ocean {
width: 100%;
height: 120px;
bottom: -50px;
left: 0;
position: absolute;
z-index: 1;
background-color: white;
border-radius: 0 100% 0 0;
list-style: none;
}
.ocean::after,
.ocean::before {
content: "";
position: absolute;
bottom: 0px;
left: -10%;
width: 120%;
height: 150px;
border-radius: 20% 100% 0 0;
background-color: white;
animation: waves 10s ease infinite;
opacity: 0.5;
}
.ocean::before {
bottom: 0px;
height: 200px;
animation-delay: 5s;
opacity: 0.33;
left: -15%;
}
@keyframes waves {
0%,
100% {
transform: rotate(-3deg);
}
50% {
transform: rotate(3deg);
}
}
/* drops*/
.dripdrop {
position: relative;
z-index: 1;
margin: 0 auto;
padding: 0;
top: 15px;
list-style: none;
width: 300px;
height: 300px;
}
.dripdrop::after {
content: "";
position: absolute;
width: 100px;
height: 70px;
background: white;
border-radius: 0% 0% 100% 100%;
top: -70px;
left: -50px;
/* box-shadow: -10px 0px 0 15px rgba(250,250,250,0.5), -15px 0px 0 25px rgba(250,250,250,0.25);*/
box-shadow: -10px 0px 0 15px rgba(250, 250, 250, 0.75);
animation: bg-pulp 7.5s cubic-bezier(0.4, 0, 1, 1) infinite alternate;
}
.dripdrop::before {
content: "";
position: absolute;
wi.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0