视觉差异滚动特效页面
代码语言:html
所属分类:视觉差异
代码描述:视觉差异滚动特效页面
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Inknut+Antiqua:600|Roboto|Roboto+Condensed:700'> <style> *, *:before, *:after { margin: 0; padding: 0; box-sizing: border-box; } html, body { width: 100%; height: 100%; overflow: hidden; } .content { height: 100%; overflow-x: hidden; overflow-y: auto; -webkit-clip-path: border-box; clip-path: border-box; -webkit-transform: translateZ(0); transform: translateZ(0); } .block { position: relative; height: 100vh; } [class*='item-parallax'] { position: absolute; width: 100%; height: 100%; -webkit-transition: -webkit-transform 0.3s ease-out; transition: -webkit-transform 0.3s ease-out; transition: transform 0.3s ease-out; transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out; will-change: transform; } .item-parallax-media { z-index: 1; } .item-parallax-media img { will-change: transform; } .item-parallax-content { z-index: 2; } .block:nth-child(1) .item-parallax-content { -webkit-transform: translateY(calc( var(--yBlock-1) * 0.5px )); transform: translateY(calc( var(--yBlock-1) * 0.5px )); } .block:nth-child(1) .item-parallax-media img { -webkit-transform: translateY(calc( var(--yBlock-1) * 0.1px )); transform: translateY(calc( var(--yBlock-1) * 0.1px )); } .block:nth-child(2) .item-parallax-content { -webkit-transform: translateY(calc( var(--yBlock-2) * 0.5px )); transform: translateY(calc( var(--yBlock-2) * 0.5px )); } .block:nth-child(2) .item-parallax-media img { -webkit-transform: translateY(calc( var(--yBlock-2) * 0.1px )); transform: translateY(calc( var(--yBlock-2) * 0.1px )); } .block:nth-child(3) .item-parallax-content { -webkit-transform: translateY(calc( var(--yBlock-3) * 0.5px )); transform: translateY(calc( var(--yBlock-3) * 0.5px )); } .block:nth-child(3) .item-parallax-media img { -webkit-transform: translateY(calc( var(--yBlock-3) * 0.1px )); transform: translateY(calc( var(--yBlock-3) * 0.1px )); } .block:nth-child(4) .item-parallax-content { -webkit-transform: translateY(calc( var(--yBlock-4) * 0.5px )); transform: translateY(calc( var(--yBlock-4) * 0.5px )); } .block:nth-child(4) .item-parallax-media img { -webkit-transform: translateY(calc( var(--yBlock-4) * 0.1px )); transform: translateY(calc( var(--yBlock-4) * 0.1px )); } .block:nth-child(5) .item-parallax-content { -webkit-transform: translateY(calc( var(--yBlock-5) * 0.5px )); transform: translateY(calc( var(--yBlock-5) * 0.5px )); } .block:nth-child(5) .item-parallax-media img { -webkit-transform: translateY(calc( var(--yBlock-5) * 0.1px )); transform: translateY(calc( var(--yBlock-5) * 0.1px )); } html { background-color: #00171f; } .flex-container { display: -webkit-box; display: flex; } .centered-content { margin: auto; } .head-large { margin-bottom: 5vw; font-size: 10vw; line-height: 1.2em; font-family: 'Inknut Antiqua', serif; color: white; } .head-small { margin-bottom: 1.5rem; font-size: 1.2rem; line-height: 1.2em; font-family: 'Roboto Condensed', sans-serif; color: white; text-transform: uppercase; letter-spacing: 0.5em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .head-centered { text-align: center; } .copy { display: block; max-width: 500px; margin-right: auto; margin-bottom: 1.5rem; margin-left: auto; padding-right: 1.5rem; padding-left: 1.5rem; font-family: 'Roboto',.........完整代码请登录后点击上方下载按钮下载查看
网友评论0