大数跨境
0
0

骑着单车穿过森林(可复制源代码)

骑着单车穿过森林(可复制源代码) 趣聊科技圈
2024-09-26
5

效果演示

html 代码


<link rel="stylesheet" href="index.css">
<div class="hero">
    <div class="parallax-layer layer-6"></div>
    <div class="parallax-layer layer-5"></div>
    <div class="parallax-layer layer-4"></div>
    <div class="parallax-layer bike-1"></div>
    <div class="parallax-layer bike-2"></div>
    <div class="parallax-layer layer-3"></div>
    <div class="parallax-layer layer-2"></div>
    <div class="parallax-layer layer-1"></div>
  </div>

css 代码

* { box-sizing: border-box; }
body { font-family"Lato", sans-serif; }
.hero { width100%height100%min-height450pxposition: relative; top0left0background-color#5dec69transformtranslate3d(000); }
.layer-1 { animation: parallax_fg linear 20s infinite both; backgroundurl(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/1.png) 0 100% repeat-x; z-index1position: absolute; bottom0left0width100%height100%background-size: auto 136px; }
.layer-2 { animation: parallax_fg linear 30s infinite both; backgroundurl(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/2.png) 0 100% repeat-x; z-index1position: absolute; bottom0left0width100%height100%background-size: auto 145px; }
.layer-3 { animation: parallax_fg linear 55s infinite both; backgroundurl(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/3.png) 0 100% repeat-x; z-index1position: absolute; bottom0left0width100%height100%background-size: auto 158px; }
.layer-4 { animation: parallax_fg linear 75s infinite both; backgroundurl(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/4.png) 0 100% repeat-x; z-index1position: absolute; bottom0left0width100%height100%background-size: auto 468px; }
.layer-5 { animation: parallax_fg linear 95s infinite both; backgroundurl(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/5.png) 0 100% repeat-x; z-index1position: absolute; bottom0left0width100%height100%background-size: auto 311px; }
.layer-6 { animation: parallax_fg linear 120s infinite both; backgroundurl(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/6.png) 0 100% repeat-x; z-index1position: absolute; bottom0left0width100%height100%background-size: auto 222px; }
.bike-1.bike-2 { backgroundurl(https://s3-us-west-2.amazonaws.com/s.cdpn.io/24650/bike.png) 0 100% no-repeat; z-index1position: absolute; bottom100pxleft0width100%height100%background-size: auto 75pxanimation: parallax_bike linear 10s infinite both; }
.bike-2 { animation: parallax_bike linear 15s infinite both; }
@keyframes parallax_fg { 0% { background-position2765px 100%; } 100% { background-position550px 100%; } }
@keyframes parallax_bike { 0% { background-position: -300px 100%; } 100% { background-position2000px 100%; } }


【声明】内容源于网络
0
0
趣聊科技圈
🧐探索科技,发现乐趣。🤩带你玩遍科技好物!
内容 511
粉丝 0
趣聊科技圈 🧐探索科技,发现乐趣。🤩带你玩遍科技好物!
总阅读748
粉丝0
内容511