skrollr实现田野视觉差异滚动效果代码

代码语言:html

所属分类:视觉差异

代码描述:skrollr实现田野视觉差异滚动效果代码

代码标签: skrollr 田野 视觉 差异 滚动

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/normalize.5.0.css">
  
  
<style>
body {
    background-color: #192a42;
}
#page {
}
#nav {
    height: 32px;
    width: 100%;
    background-color: #a8cdff;
}
/* Larger than tablet */
@media (min-width: 750px) {
    #nav {
    }
}
/* Parallax
–––––––––––––––––––––––––––––––––––––––––––––––––– */
#skrollr-body {
}
#parallax-banner {
    position: relative;
    overflow: hidden;
    height: 360px;
    /*forces max height of background images to 1/3 = 3x retina.*/
    background: -webkit-linear-gradient(#a8cdff 10%,#eaf0f7 40%);
    background: linear-gradient(#a8cdff 10%, #eaf0f7 40%);
    }
.banner {
    position: absolute;
    height: 360px;
    /*forces max height of background images to 1/3 = 3x retina.*/
    width: 100%;
    background-position: center bottom;
    background-size: cover;
    /*scales background images as media queries increase height of parallax-layers*/
    background-repeat: no-repeat;
}
/* parallax-layer image sizes: 3500px x 1080px! */
#parallax-layer1 {
    background-image: url(//repo.bfw.wiki/bfwrepo/images/parax/BG00-v02_zhiabz.png);
    /* Background: Hills, Train. */
}
#parallax-layer2 {
    background-image: url(//repo.bfw.wiki/bfwrepo/images/parax/MG00-v02_rjdmov.png);
    /* Mid-ground: Hills, Valley. */
}
#parallax-layer3 {
    background-image: url(//repo.bfw.wiki/bfwrepo/images/parax/MG01v02_vjjvdc.png);
    /* Foreground: cornfield, telegraph poles. */
}
#parallax-layer4 {
    background-image: url(//repo.bfw.wiki/bfwrepo/images/parax/FG00v02_rgrngg.png);
    /* Foreground: blue fence and grass. */
}

/*Media queries
––––––––––––––––––––––––– */
/* Larger than tablet */
@media (min-width: 750px) {
    #parallax-banner {
    }
    #parallax-banner, .banner {
        height: 540px;
        /*2x retina*/
    }
}
/* Horizontal devices */
@media (max-height: 540px) {
    #parallax-banner, .banner {
        height: 360px;
        /*3x retina*/
    }
}
/* 10.........完整代码请登录后点击上方下载按钮下载查看

网友评论0