skrollr实现田野视觉差异滚动效果代码
代码语言:html
所属分类:视觉差异
代码描述: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*/ } } /* 1080p+ Large screens */ @media screen and (min-width: 1750px) { #parallax-banner, .banner { height: 810px; /*1.5x resolution*/ } } /* Header –––––––––––––––––––––––––––––––––––––––––––––––––– */ .header { position: relative; } .layered-font { position: relative; margin-bottom: 0; line-height: 0.9em; font-family: 'Bungee', cursive; font-size: 36px; text-align: center; letter-spacing: 8px; color: #3f6c92; text-shadow: -2px 2px 2px rgba(0, 0, 0, 0.25); z-index: 100; } .layered-font::before, .layered-font::after { content: attr(data-content); position: absolute; top: 0; left: 0; width: 100%; } .layered-font::before { display: block; font-family: 'Bungee Outline', cursive; color: #ab8b65; } .layered-font::after { display: none; left: -9px; font-family: 'Bungee Shade', cursive; letter-spacing: 0px; /*color: #093977;*/ /*color: #2e4134;*/ /*color: #142337;*/ color: #83b8ff; z-index: -1; text-shad.........完整代码请登录后点击上方下载按钮下载查看
网友评论0