Double-sided flip box using css transformations.
$ component install component/flipbox
<div id="card">
<div>
<div>front</div>
<div>back</div>
</div>
</div>
<script>
var card = document.querySelector('#card');
var Flipbox = require('flipbox');
var box = new Flipbox(card);
box.el.onclick = function(){
box.flip();
};
</script>
Initialize a Flipbox
with the given container el
. Inside
this should be a wrapper div
, within that should be the two
faces. View ./example.html for a full example.
Toggle the visibile face.
Show the front face.
Show the back face.
MIT