div+css实现下雪天冬季冰上钓鱼垂钓动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现下雪天冬季冰上钓鱼垂钓动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
.main-container,
.main-container * {
box-sizing: border-box;
}
.main-container {
width: 1098px;
height: 852px;
overflow: hidden;
margin: auto;
position: relative;
z-index: 1;
}
/*
* sky
*/
.sky {
background-color: #D0E6F4;
height: 210px;
position: relative;
z-index: 1;
}
.clouds {}
.clouds__item {
position: absolute;
z-index: 1;
}
.clouds__item-self {}
.clouds__item-alone {
width: 94px;
height: 27px;
border-radius: 33px;
background-color: #F4FCFF;
}
.clouds__item-group {
position: relative;
width: 110px;
height: 38px;
background-color: #F4FCFF;
border-radius: 33px;
}
.clouds__item-group:before,
.clouds__item-group:after {
content: "";
position: absolute;
background-color: inherit;
border-radius: inherit;
}
.clouds__item-group:before {
top: -12px;
left: 0;
width: 72px;
height: 27px;
}
.clouds__item-group:after {
top: 0;
left: -47px;
width: 72px;
height: 29px;
}
.clouds__item--small {
transform: scale(.65);
}
/*
* ground
*/
.ground {
position: relative;
z-index: 2;
height: 390px;
background-color: #BDDDF6;
}
.snowing {
position: absolute;
top: -50px;
left: 0;
right: 0;
bottom: 0;
z-index: 9;
overflow: hidden;
}
.snowing__box {
height: 100%;
position: absolute;
height: 100%;
left: 0;
right: 0;
bottom: 100%;
animation: 10s snow_moving linear forwards infinite;
transform: translateY(-100%);
}
.snowing__box:nth-of-type(2n) {
animation-delay: 5s;
}
@keyframes snow_moving {
0% {
transform: translateY(0%);
}
100% {
transform: translateY(200%);
}
}
.snowing__item--smaller .flake {
width: 5px;
height: 5px;
}
.snowing__item--smallest .flake {
width: 2px;
height: 2px;
}
.flake {
position: absolute;
top: 0%;
left: 0%;
width: 7px;
height: 7px;
background-color: #fff;
border-radius: 50%;
animation: 5s flake_moving linear forwards infinite;
}
.flake:nth-of-type(2n) {
animation-delay: 2.5s;
}
@keyframes flake_moving {
0% {
transform: translateX(0%);
}
50% {
transform: translateX(-500%);
}
100% {
transform: translateX(0%);
}
}
.mountains {
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: -3;
}
.mountains:after {
content: "";
position: absolute;
z-index: -2;
left: 0;
right: 0;
bottom: 0;
height: 184px;
background: #A3CEF1;
}
.mountains__item {
z-index: 1;
position: absolute;
bottom: 0;
}
.mountains__item:nth-of-type(1) {
border: 170px solid #95B4B9;
border-left-width: 118px;
border-right-width: 118px;
border-right-color: transparent;
border-top-color: transparent;
left: 0;
}
.mountains__item:nth-of-type(2) {
border: 220px solid #B1D6DE;
border-top: none;
border-left: 250px solid transparent;
border-right: 250px solid transparent;
left: -112px;
z-index: -1;
}
.mountains__item:nth-of-type(3) {
border: 235px solid #A3C6CC;
border-top: none;
border-left: 185px solid transparent;
border-right: 410px solid transparent;
left: 15px;
}
.mountains__item:nth-of-type(4) {
border: 140px solid #A3C6CC;
border-top: none;
border-left: 305px solid transparent;
border-right: 484px solid transparent;
left: 234px;
}
.mountains__item:nth-of-type(5) {
border: 289px solid #95B4B9;
border-top: none;
border-left: 420px solid transparent;
border-right: none;
right: 0;
z-index: -1;
}
.fir-trees {
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
}
.fir-trees__item {
position: absolute;
bottom: 0;
transform-origin: center bottom;
}
.fir-trees__item:nth-of-type(1) {
left: 66px;
transform: scale(.7);
}
.fir-trees__item:nth-of-type(2) {
left: 163px;
bottom: 23px;
transform: scale(.81);
}
.fir-trees__item:nth-of-type(3) {
left: 223px;
bottom: 23px;
transform: scale(.55);
}
.fir-trees__item:nth-of-type(4) {
left: 383px;
transform: scale(.58);
}
.fir-trees__item:nth-of-type(5) {
left: 416px;
transform: scale(.58);
}
.fir-trees__item:nth-of-type(6) {
left: 470px;
}
.fir-trees__item:nth-of-type(7) {
left: 945px;
bottom: 25px;
transform: scale(.79);
}
.fir-trees__item:nth-of-type(8) {
left: 1000px;
bottom: 25px;
transform: scale(.58);
}
.fir-trees__steps {
}
.fir-trees__steps-item {
display: block;
width: 0;
margin: auto;
border: 67px solid #DFF1F5;
border-top: none;
margin-bottom: -20px;
border-left: 30px solid transparent;
border-right: 30px solid transparent;
}
.fir-trees__steps-item:nth-of-type(2) {
border-left-width: 35px;
border-right-width: 35px;
}
.fir-trees__steps-item:nth-of-type(3) {
border-left-width: 40px;
border-right-width: 40px;
}
.fir-trees__steps-item:last-child {
margin-bottom: 0;
}
.snow {
position: absolute;
left: 0;
right: 0;
bottom: -1px;
z-index: 0;
}
.snow__item {
position: absolute;
bottom: 0;
border-top-left-radius: 33px;
border-top-right-radius: 33px;
background-color: #F1FBFC;
height: 10px;
}
.houses {
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: -2;
}
.houses__item {
position: absolute;
left: 294px;
bottom: 0;
width: 100px;
border-bottom: 4px solid #D38535;
display: flex;
align-items: flex-end;
}
.houses__item--small {
transform-origin: center bottom;
transform: scale(.8);
}
.houses__home {
background: linear-gradient(to bottom, #FBC42D, #FBBA2D);
background-size: 100% 5px;
width: 64px;
height: 50px;
position: relative;
}
.houses__home-roof {
border: 32px solid transparent;
border-bottom: 28px solid #EE6439;
position: absolute;
left: 0;
right: 0;
margin: auto;
width: 0;
bottom: 100%;
}
.houses__home-chimney {
position: absolute;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0