网页滚动视觉差异效果代码

代码语言:html

所属分类:视觉差异

代码描述:网页滚动视觉差异效果代码

代码标签: 差异 效果

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


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

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
@import url("https://fonts.googleapis.com/css?family=Open+Sans|Oswald:200");
.parallax {
  position: relative;
  width: 100vw;
  height: 50vw;
  transform-origin: bottom center;
  will-change: transform;
  transform: translate3d(0, calc(var(--pct) * 35%), 0) scale3d(calc(var(--pct)/2 + 1), calc(var(--pct)/2 + 1), 1);
}
.parallax div {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
  transform-origin: bottom center;
  transform: translate3d(0, 0, 0);
}
.parallax div.p1 {
  transform: translate3d(0, calc(var(--pct) * -20.0%), 0);
}
.parallax div.p2 {
  transform: translate3d(0, calc(var(--pct) * -17.5%), 0);
}
.parallax div.p3 {
  transform: translate3d(0, calc(var(--pct) * -15.0%), 0);
}
.parallax div.p4 {
  transform: translate3d(0, calc(var(--pct) * -12.5%), 0);
}
.parallax div.p5 {
  transform: translate3d(0, calc(var(--pct) * -10.0%), 0);
}
.parallax div.p6 {
  transform: translate3d(0, calc(var(--pct) * -7.5%), 0);
}
.parallax div.p7 {
  transform: translate3d(0, calc(var(--pct) * -5.0%), 0);
}
.parallax div.p8 {
  transform: translate3d(0, calc(var(--pct) * -2.5%), 0);
}

html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

html, body {
  margin: 0;
  background-color: #2b110e;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  overflow: hidden;
  box-shadow: inset 0 -4em 4em -4em #2b110e;
}

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  border-top: 1px solid #3e1914;
  padding: 2em 1em 4em;
  max-width: 580px;
  margin: 0 auto;
}

.logo {
  fill: rgba(255, 255, 255, 0.3);
  width: 0.72em;
  vertical-align: top;
  margin: 0.15em 0.15em 0.15em 0;
}

.separator {
  fill: rgba(255, 255, 255, 0.1);
  height: 2em;
  vertical-align: top;
  margin: 1em 0 0;
  width: 100%;
}

h1 {
  margin: 0;
  font-family: Oswald;
  font-size: 2em;
  line-height: 1;
  font-weight: 200;
  color: rgba(255, 255, 255, 0.7);
}

h2 {
  margin: 2em 0 0;
  font-family: Oswald;
  font-size: 1.6em;
  line-height: 1;
  font-weight: 200;
  color: rgba(255, 255, 255, 0.7);
}

p, a {
  font-family: Open Sans.........完整代码请登录后点击上方下载按钮下载查看

网友评论0