Created
August 31, 2012 02:13
-
-
Save vennsoh/3547939 to your computer and use it in GitHub Desktop.
sphere 4
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
/**sphere 4*/ | |
body{ | |
height: 100%; | |
} | |
.container { | |
top:50%; | |
margin:auto; | |
margin-top: -100px; | |
width: 200px; | |
height: 200px; | |
position: relative; | |
perspective: 800; | |
} | |
.bg{ | |
width:inherit; | |
height: inherit; | |
box-shadow: 0 0 0 30px black; | |
position: absolute; | |
border-radius: 50%; | |
} | |
#card { | |
width: inherit; | |
height: inherit; | |
position: absolute; | |
transform-style: preserve-3d; | |
transition: transform 1s; | |
} | |
#card div{ | |
position: absolute; | |
width: inherit; | |
height: inherit; | |
backface-visibility: hidden; | |
border-radius: 50%; | |
} | |
#card .front { | |
background: red; | |
} | |
#card .back { | |
background: blue; | |
transform: rotateY(180deg); | |
} | |
.container:hover #card { | |
transform: rotateY(180deg); | |
} |
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
<section class="container"> | |
<div class="bg"></div> | |
<div id="card"> | |
<div class="front"></div> | |
<div class="back"></div> | |
</div> | |
</section> |
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
{"view":"separate","fontsize":"80","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment