Created
September 21, 2015 14:05
-
-
Save bkmeneguello/9c949613ab8210f53a94 to your computer and use it in GitHub Desktop.
Teste
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('test'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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