I'm currently working on achieving a flipboard effect for some divs, where one side is white and the other is black. Here's what I have so far:
setInterval(function () {
document.getElementById('test').classList.toggle('flipped')
}, 1000)
#test {
width: 100px;
height: 100px;
border: 1px solid black;
transition: 1s;
-webkit-transition: 1s;
-moz-transition: 1s;
-ms-transition: 1s;
}
.flipped {
transform: rotateX(180deg);
-webkit-transform: rotateX(180deg);
-ms-transform: rotateX(180deg);
-moz-transform: rotateX(180deg);
background: yellow;
}
<div id="test"></div>
However, my challenge now is figuring out how to keep the background white until the rotation becomes "flat" and only then change color. Any suggestions?