<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="flip-container" ontouchstart="this.classList.toggle('hover');">
<div class="flipper">
<div class="front">
<!-- front content -->
</div>
<div class="back">
<!-- back content -->
</div>
</div>
</div>
/* entire container, keeps perspective */
.flip-container {
perspective: 1000;
}
/* flip the pane when hovered */
.flip-container:hover .flipper, .flip-container.hover .flipper {
transform: rotateY(180deg);
}
.flip-container, .front, .back {
width: 200px;
height: 230px;
}
/* flip speed goes here */
.flipper {
transition: 0.6s;
transform-style: preserve-3d;
position: relative;
}
/* hide back of pane during swap */
.front, .back {
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
/* front pane, placed above back */
.front {
background:
linear-gradient(150deg, transparent 50px, #b4b4b4 0) top left,
linear-gradient(210deg, transparent 50px, #b4b4b4 0) top right,
linear-gradient(330deg, transparent 50px, #b4b4b4 0) bottom right,
linear-gradient(30deg, transparent 50px, #b4b4b4 0) bottom left;
background-size: 50% 50%;
background-repeat: no-repeat;
transition: transform 1s;
z-index: 2;
/* for firefox 31 */
transform: rotateY(0deg);
}
/* back, initially hidden pane */
.back {
background:
linear-gradient(150deg, transparent 50px, #c00 0) top left,
linear-gradient(210deg, transparent 50px, #c00 0) top right,
linear-gradient(330deg, transparent 50px, #c00 0) bottom right,
linear-gradient(30deg, transparent 50px, #c00 0) bottom left;
background-size: 50% 50%;
background-repeat: no-repeat;
transition: transform 1s;
transform: rotateY(180deg);
}
.hex {
height: 230px;
width: 200px;
margin: auto;
background:
linear-gradient(150deg, transparent 50px, #c00 0) top left,
linear-gradient(210deg, transparent 50px, #c00 0) top right,
linear-gradient(330deg, transparent 50px, #c00 0) bottom right,
linear-gradient(30deg, transparent 50px, #c00 0) bottom left;
background-size: 50% 50%;
background-repeat: no-repeat;
transition: transform 1s;
}
.hex:hover {
transform: rotateY(180deg);
}