Skip to content

Instantly share code, notes, and snippets.

@thomascrenshaw
Created May 30, 2014 04:09
Show Gist options
  • Save thomascrenshaw/9d0ee6806f1881058b11 to your computer and use it in GitHub Desktop.
Save thomascrenshaw/9d0ee6806f1881058b11 to your computer and use it in GitHub Desktop.
CSS/JS Animations
/* -------- Start Rotating Cards ---------*/
/* REF: http://css3-magic.brunoscopelliti.com/css3-transition-demos.html
/* HTML */
<div class="ext" ontouchstart="this.classList.toggle('hover');">
<div class="int">
<div class="front">
<!-- your custom content -->
</div>
<div class="back">
<!-- your custom content -->
</div>
</div>
</div>
/* CSS */
.ext {
perspective: 1000;
}
.ext,
.front,
.back { height: 260px; width: 190px; }
.ext:hover .int,
.ext.hover .int {
transform: rotateY(180deg);
}
.int {
transition: .75s;
transform-style: preserve-3d;
}
.front,
.back {
backface-visibility: hidden;
background: #FFF;
border: 1px solid #666;
position: absolute; top: 0; left: 0;
}
.front {
z-index: 2;
}
.back {
transform: rotateY(180deg);
}
/* -------- Start Rotating Cards ---------*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment