Created
June 26, 2012 01:17
-
-
Save timrwood/2992459 to your computer and use it in GitHub Desktop.
Scrolling shadows by @kizmarh and @LeaVerou
This file contains hidden or 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
/** | |
* Scrolling shadows by @kizmarh and @leaverou | |
* Only works in browsers supporting background-attachment: local; & CSS gradients | |
* Degrades gracefully | |
*/ | |
html { | |
background: white; | |
font: 120% sans-serif; | |
} | |
body { | |
position:absolute; | |
width: 100%; | |
height: 100%; | |
-webkit-perspective: 1000px; | |
overflow:hidden; | |
} | |
div { | |
position:absolute; | |
top:10%; | |
left:50%; | |
width:15%; | |
height:80%; | |
background:#000; | |
} | |
.a { | |
-webkit-transform:translateX(0%); | |
} | |
.b { | |
background:#333; | |
-webkit-transform-origin:0 50%; | |
-webkit-transform:translateX(99%) rotateY(-20deg); | |
} | |
.c { | |
background:#666; | |
-webkit-transform-origin:0 50%; | |
-webkit-transform:translateX(99%) rotateY(-20deg) translateX(99%) rotateY(-40deg); | |
} | |
This file contains hidden or 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="a"></div> | |
<div class="b"></div> | |
<div class="c"></div> | |
This file contains hidden or 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
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment