div+css实现下雪天冬季冰上钓鱼垂钓动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现下雪天冬季冰上钓鱼垂钓动画效果代码

代码标签: 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;
        bottom: 100%;
        left: 25%;
        width: 3px;
        height: 12px;
        margin-bottom: 5px;
        background-color: rgba(0,0,0,.4);
    }
    .houses__home-chimney-smoke {
        background-color: rgba(255,255,255,.9);
        border-radius: 50%;
        position: absolute;
        bottom: 130%;
        right: 0;
        margin: auto;
    
        width: 5px;
        height: 5px;
    
        opacity: 0;
    
        animation: 2s smoke_moves infinite linear;
    }
    .houses__home-chimney-smoke:nth-of-type(2) {
        width: 8px;
        height: 8px;
    
        animation-delay: .8s;
    }
    
    @keyframes smoke_moves {
        0% {
            opacity: .6;
            transform: translateY(0) scale(1);
        }
        25% {
            right: 5px;
        }
        50% {
            right: 2px;
        }
        100% {
            right: 7px;
            opacity: 0;
            transform: translateY(-30px) scale(2);
        }
    }
    
    
    .houses__home-windows {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }
    .houses__home-windows-item {
        width: 15px;
        height: 23px;
        margin: 0 4px;
        background-color: #6C8288;
        border: 2px solid #fff;
        position: relative;
    }
    .houses__home-windows-item:before,
    .houses__home-windows-item:after {
        content: "";
        position: absolute;
        opacity: .8;
    }
    .houses__home-windows-item:before {
        top: 30%;
        width: 100%;
        border-bottom: 2px solid #fff;
    }
    .houses__home-windows-item:after {
        border-right: 2px solid #fff;
        height: 100%;
        left: 40%;
    }
    .houses__comming {
        background: linear-gradient(to bottom, #FBC42D, #FBBA2D);
        width: 36px;
        height: 29px;
        position: relative;
    }
    .houses__comming-roof {
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        width: 0;
        border: 17px solid #EE6439;
        border-top: none;
        border-right: 34px solid transparent;
        border-left: none;
    }
    .houses__comming-door {
        width: 15px;
        height: 18px;
        background-color: #376793;
        margin: auto;
        position: absolute;
        bottom: 0;
        left: 7px;
        border: 2px solid #fff;
        border-bottom: none;
    }
    .houses__comming-door:after {
        content: "";
        position: absolute;
        border: 1px solid #fff;
        opacity: .7;
        left: 2px;
        top: 50%;
    }
    
    
    
    /**************/
    
    .fisher {
        width: 235px;
        height: 218px;
        position: absolute;
        right: 223px;
        bottom: 0;
    }
    .fisher__table {
        position: absolute;
        z-index: 2;
    
        right: 6px;
        bottom: 0;
    
        border: 8px solid #9F754D;
        width: 58px;
        height: 51px;
    }
    .fisher__table:after {
        content: "";
        position: absolute;
        left: -11px;
        right: -11px;
        bottom: 100%;
        border-bottom: 8px solid #9F754D;
        margin-bottom: 3px;
    }
    .fisher__human {
        position: relative;
        z-index: 1;
        height: 100%;
        width: 100%;
    }
    .fisher__human-leg {
    
    }
    .fisher__human-leg-shoe {
        position: absolute;
        right: 100px;
        bottom: 0;
        background-color: #FEC428;
        width: 18px;
        height: 50px;
        border-radius: 50px;
    
        filter: drop-shadow(0px 0px 1px #FEC428) drop-shadow(0px 0px 2px #FEC428);
    
        transform-origin: center top;
        transform: skew(-3deg);
    }
    .fisher__human-leg-shoe:before,
    .fisher__human-leg-shoe:after {
        content: "";
        position: absolute;
        bottom: 0;
        width: 28px;
        height: 10px;
        right: 6px;
        border-radius: 10px;
    
        background-color: #FEC428;
    }
    .fisher__human-leg-shoe:after {
        right: -1px;
        transform-origin: left center;
        transform: rotate(-45deg);
        margin-bottom: -1px;
    }
    .fisher__human-leg-pants {}
    .fisher__human-leg-pants-self {
        position: absolute;
        bottom: 45px;
        right: 99px;
    
        border-top-left-radius: 10px;
        transform: rotate(5deg);
    
        width: 17px;
        height: 46px;
    
        background-color: #306C96;
    }
    .fisher__human-leg-pants-item {
        position: absolute;
        background-color: #306C96;
    }
    .fisher__human-leg-pants-item:nth-of-type(1) {
        right: 0;
        top: 1px;
        width: 10px;
        height: 38px;
        transform: rotate(5deg);
        transform-origin: right bottom;
    }
    .fisher__human-leg-pants-item:nth-of-type(2) {
        left: 100%;
        top: 0;
        width: 84px;
        height: 32px;
        border-radius: 41%;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
    .fisher__human-leg-pants-lines {
    
    }
    ..........完整代码请登录后点击上方下载按钮下载查看

网友评论0