Skip to content

Instantly share code, notes, and snippets.

@vennsoh
Created August 31, 2012 02:13
Show Gist options
  • Save vennsoh/3547939 to your computer and use it in GitHub Desktop.
Save vennsoh/3547939 to your computer and use it in GitHub Desktop.
sphere 4
/**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);
}
<section class="container">
<div class="bg"></div>
<div id="card">
<div class="front"></div>
<div class="back"></div>
</div>
</section>
{"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