Skip to content

Instantly share code, notes, and snippets.

@bkmeneguello
Created September 21, 2015 14:05
Show Gist options
  • Save bkmeneguello/9c949613ab8210f53a94 to your computer and use it in GitHub Desktop.
Save bkmeneguello/9c949613ab8210f53a94 to your computer and use it in GitHub Desktop.
Teste
<div class="parallax">
<div class="parallax__layer parallax__layer--back">
<div class="title">This is the background</div>
</div>
<div class="parallax__layer parallax__layer--base">
<div class="title">This is the foreground</div>
</div>
</div>
console.log('test');
.parallax {
height: 100vh;
overflow-x: hidden;
overflow-y: auto;
-webkit-perspective: 1px;
perspective: 1px;
}
.parallax__layer {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.parallax__layer--base {
top: 30px;
-webkit-transform: translateZ(0);
transform: translateZ(0);
}
.parallax__layer--back {
-webkit-transform: translateZ(-1px);
transform: translateZ(-1px) scale(2);
}
/* add some padding to force scrollbars */
.parallax__layer {
padding: 100vh 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment