美文网首页
css3开车动画

css3开车动画

作者: 干炸里脊不如你 | 来源:发表于2019-06-19 10:28 被阅读0次
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>没时间解释了,快上车</title>
</head>
<body> 

        <style>
.nd-car-wrap{left:50%;position:absolute; z-index:999;}
/**大车出场方式开始**/
.nd-car-wrap.nd-front{
-moz-animation:frontCarMove 16s infinite;
    -webkit-animation:frontCarMove 16s infinite;
    animation:frontCarMove 16s infinite;
    margin-left:208px;
    top:464px;
}

@-moz-keyframes frontCarMove{
    0%{
        -moz-animation-timing-function:ease-out;
        -moz-transform:translate3d(800px,0,0);
    }
    15%,25%{
        -moz-animation-timing-function:ease-in;
        -moz-transform:translate3d(0,0,0);
    }
    50%,100%{-moz-transform:translate3d(-1500px,0,0);}
}
@-webkit-keyframes frontCarMove{
    0%{
        -webkit-animation-timing-function:ease-out;
        -webkit-transform:translate3d(800px,0,0);
    }
    15%,25%{
        -webkit-animation-timing-function:ease-in;
        -webkit-transform:translate3d(0,0,0);
    }
    50%,100%{-webkit-transform:translate3d(-1500px,0,0);}
}
@keyframes frontCarMove{
    0%{
        animation-timing-function:ease-out;
        transform:translate3d(800px,0,0);
    }
    15%,25%{
        animation-timing-function:ease-in;
        transform:translate3d(0,0,0);
    }
    50%,100%{transform:translate3d(-1500px,0,0);}
}
/**大车出场方式结束**/
/**小车出场方式开始**/
@-moz-keyframes backCarMove{
    0%{
        -moz-animation-timing-function:ease-out;
        -moz-transform:translate3d(0,0,0) scale(-.3,.3);
    }
    15%,25%{
        -moz-animation-timing-function:ease-in;
        -moz-transform:translate3d(600px,0,0) scale(-.3,.3);
    }
    50%,100%{-moz-transform:translate3d(2200px,0,0) scale(-.3,.3);}
}
@-webkit-keyframes backCarMove{
    0%{
        -webkit-animation-timing-function:ease-out;
        -webkit-transform:translate3d(0,0,0) scale(-.3,.3);
    }
    15%,25%{
        -webkit-animation-timing-function:ease-in;
        -webkit-transform:translate3d(600px,0,0) scale(-.3,.3);
    }
    50%,100%{-webkit-transform:translate3d(2200px,0,0) scale(-.3,.3);}
}
@keyframes backCarMove{
    0%{
        animation-timing-function:ease-out;
        transform:translate3d(0,0,0) scale(-.3,.3);
    }
    15%,25%{
        animation-timing-function:ease-in;
        transform:translate3d(600px,0,0) scale(-.3,.3);
    }
    50%,100%{transform:translate3d(2200px,0,0) scale(-.3,.3);}
}
.nd-car-wrap.nd-back{
    -moz-animation:backCarMove 16s 8s infinite both;
    -webkit-animation:backCarMove 16s 8s infinite both;
    animation:backCarMove 16s 8s infinite both;
    margin-left:-1300px;
    top:455px;
}
/**小车出场方式结束**/
/**哆嗦吧 老司机开始**/
@-moz-keyframes carShake{
    0%{-moz-transform:translate3d(0,0,0);}
    100%{-moz-transform:translate3d(0,-1px,0);}
}
@-webkit-keyframes carShake{
    0%{-webkit-transform:translate3d(0,0,0);}
    100%{-webkit-transform:translate3d(0,-1px,0);}
}
@keyframes carShake{
    0%{transform:translate3d(0,0,0);}
    100%{transform:translate3d(0,-1px,0);}
}
.nd-car{
    -moz-animation:carShake .1s infinite alternate linear;
    -webkit-animation:carShake .1s infinite alternate linear;
    animation:carShake .1s infinite alternate linear;
    background:url(http://7arnu9.com1.z0.glb.clouddn.com/carcar-body-1.png) no-repeat;
    height:160px;
    width:340px;
}
/**哆嗦吧 老司机结束**/
/**小车开始**/
.nd-car-wrap.nd-back .nd-car:before{
    background:url(http://7arnu9.com1.z0.glb.clouddn.com/carcar-body-1.png) 282px -85px;
    content:'';
    height:24px;
    left:58px;
    position:absolute;
    top:85px;
    -moz-transform:scale(-1,1);
    -webkit-transform:scale(-1,1);
    transform:scale(-1,1);
    width:34px;
}
/***车轱辘开始**/
.nd-wheel{
    -moz-animation:wheelRotate 16s infinite both;
    -webkit-animation:wheelRotate 16s infinite both;
    animation:wheelRotate 16s infinite both;
    background:url(http://7arnu9.com1.z0.glb.clouddn.com/carcar-tyre.png);
    height:42px;
    position:absolute;
    top:115px;
    width:42px;
}
.nd-wheel.nd-front{left:39px;}
.nd-wheel.nd-back{left:248px;}
.nd-car-wrap.nd-back .nd-wheel{
    -moz-animation-delay:8s;
    -webkit-animation-delay:8s;
    animation-delay:8s;
}

@-moz-keyframes wheelRotate{
    0%{
        -moz-animation-timing-function:ease-out;
        -moz-transform:rotateZ(0);
    }
    15%,25%{
        -moz-animation-timing-function:ease-in;
        -moz-transform:rotateZ(-2250deg);
    }
    50%,100%{-moz-transform:rotateZ(-6000deg);}
}
@-webkit-keyframes wheelRotate{
    0%{
        -webkit-animation-timing-function:ease-out;
        -webkit-transform:rotateZ(0);
    }
    15%,25%{
        -webkit-animation-timing-function:ease-in;
        -webkit-transform:rotateZ(-2250deg);
    }
    50%,100%{-webkit-transform:rotateZ(-6000deg);}
}
@keyframes wheelRotate{
    0%{
        animation-timing-function:ease-out;
        transform:rotateZ(0);
    }
    15%,25%{
        animation-timing-function:ease-in;
        transform:rotateZ(-2250deg);
    }
    50%,100%{transform:rotateZ(-6000deg);}
}
/**车轱辘哦结束**/
*{ overflow:hidden}
/*-end:头图-*/

</style>

    <div class="car">
    <!--小车-->
     <div class="nd-car-wrap nd-back"> 
      <p class="nd-car">
         <!--前轱辘-->
        <span class="nd-wheel nd-front"></span>
         <!--后轱辘-->
        <span class="nd-wheel nd-back"></span>
       </p> 
     </div> 
     <!--大车-->
     <div class="nd-car-wrap nd-front"> 
      <p class="nd-car">
        <!--前轱辘-->
        <span class="nd-wheel nd-front"></span>
        <!--后轱辘-->
        <span class="nd-wheel nd-back"></span>
      </p> 
     </div> 
    </div>
</body>
</html>

相关文章

  • css3开车动画

  • 网页高级知识点(三)

    CSS3 transition动画 CSS3 transform变换 CSS3 animation动画

  • 07day

    CSS3动画 CSS3 @keyframes 规则如需在 CSS3 中创建动画,您需要学习 @keyframes ...

  • 08_dayCSS动画

    CSS3新增的功能有:过渡和动画,阴影和圆角 css3过渡动画: css3都有哪些新增的东西 : 过度,动画,阴影...

  • CSS3 动画

    CSS3 动画CSS3,我们可以创建动画,它可以取代许多网页动画图像,Flash动画,和JAVAScripts。 ...

  • CSS3 动画

    动画属性 动画(animation)是CSS3新增的属性,动画属性可以为元素创建动画,CSS3以前在网页上实现动画...

  • css3动画

    css3动画 CSS3 可以创建动画,它可以取代许多网页动画图像、Flash 动画和 JavaScript 实现的...

  • 纯CSS3绘制的逼真,呆萌,超酷的CSS3动画

    纯CSS3人物行走动画 逼真炫酷CSS3动画 CSS3实在是太强大了,今天分享的CSS3动画非常神奇,它可以模拟人...

  • 关于js动画和css3动画的差异性你了解吗?请简单谈一下

    css3动画:css3之后添加了transform动画计算函数,所以实现动画更为简单方便,并且transform矩...

  • 过度动画

    css3过度动画 css3都有哪些新增的东西 : 过度,动画,阴影,圆角; transition : width ...

网友评论

      本文标题:css3开车动画

      本文链接:https://www.haomeiwen.com/subject/sxdhqctx.html