Skip to content

Instantly share code, notes, and snippets.

Created April 20, 2013 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5427569 to your computer and use it in GitHub Desktop.
Save anonymous/5427569 to your computer and use it in GitHub Desktop.
{
"libraries": [
"Rickshaw"
],
"mode": "javascript",
"layout": "fullscreen mode (vertical)",
"resolution": "reset"
}
.card {
-webkit-transform-style: preserve-3d;
width: 90px;
height: 90px;
padding: 10px;
position: absolute;
-webkit-transform: rotateY( 50deg );
left: calc(50% - 45px);
top: calc(50% - 45px);
}
.front {
position: absolute;
width: 90px;
height: 90px;
background: #aaa;
padding: 10px;
-webkit-backface-visibility: hidden;
}
.back {
position: absolute;
width: 90px;
height: 90px;
background: #aaa;
padding: 10px;
-webkit-backface-visibility: hidden;
-webkit-transform: rotateY( 180deg );
}
.scene {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
-webkit-perspective: 800px;
-webkit-perspective-origin: 50% 50%;
}
<div class="scene">
<div class="card" id="c">
<div class="front">I'm a fancy 3d card</div>
<div class="back">Other side</div>
</div>
</div>
var i = i || 0;
c.style.webkitTransform = "rotateY(" + ++i + "deg)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment