Created
December 26, 2014 12:47
-
-
Save meritt/8f164c21642c26a60755 to your computer and use it in GitHub Desktop.
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 { | |
perspective: 1px; | |
height: 100vh; | |
overflow-x: hidden; | |
overflow-y: auto; | |
} | |
.parallax__layer { | |
position: absolute; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
} | |
.parallax__layer--base { | |
transform: translateZ(0); | |
} | |
.parallax__layer--back { | |
transform: translateZ(-1px); | |
} |
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> | |
<div class="parallax__layer parallax__layer--base"> | |
... | |
</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
.parallax__layer--back { | |
transform: translateZ(-1px) scale(2); | |
} |
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__layer--deep { | |
transform: translateZ(-2px) scale(3); | |
} |
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__group { | |
position: relative; | |
height: 100vh; | |
transform-style: preserve-3d; | |
} |
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__group"> | |
<div class="parallax__layer parallax__layer--back"> | |
... | |
</div> | |
<div class="parallax__layer parallax__layer--base"> | |
... | |
</div> | |
</div> | |
<div class="parallax__group"> | |
... | |
</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
.parallax__group { | |
transform: translate3d(700px, 0, -800px) rotateY(30deg); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment