Login / Join
Flip Cards (codicode.com)
submitted on 30/07/2014 by
Codicode
+ infos
Config
Embed
Share
Flip Cards (codicode.com)
by
Codicode
Flip Cards (codicode.com)
Framework 1 :
-- None --
jQuery 2.0.3
jQuery 1.9.1
jQuery 1.9.0
jQuery 1.8.0
jQuery 1.7.1
jQuery 1.6.3
jQuery UI 1.10.3
MooTools 1.4.5
AngularJS 1.0.4
Prototype 1.7.1.0
Dojo 1.8.3
Chrome Frame 1.0.3
Ext Core 3.1.0
SWFObject 2.2
WebFont Loader 1.1.2
Framework 2 :
-- None --
jQuery 2.0.3
jQuery 1.9.1
jQuery 1.9.0
jQuery 1.8.0
jQuery 1.7.1
jQuery 1.6.3
jQuery UI 1.10.3
MooTools 1.4.5
AngularJS 1.0.4
Prototype 1.7.1.0
Dojo 1.8.3
Chrome Frame 1.0.3
Ext Core 3.1.0
SWFObject 2.2
WebFont Loader 1.1.2
+ Js file(s) :
http://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js
+ Css file(s) :
Apply
Link :
Direct http link :
Fork button :
Html code :
Embed preview :
Copy the following html code to your page to embed the preview,
To include many previews on a single page, just repeat the first line.
You can change the width, height and border color (bcolor).
<div class="refork-widget" code="b02" style="width:100%;height:200px;" bcolor="#ccc"></div>
<script type="text/javascript" src="//snippet.run/d/z.js"></script>
HTML
<div class="flipcard v"> <div class="front"> <img src="http://www.slapix.com/img/i2/love_me_or_hate_me.jpg"/> </div> <div class="back"> Love me<br>or hate me ..<br><br>I'm still<br>gonna Shine! </div> </div> <div id="secondcard" class="flipcard h"> <div class="front"> <img src="http://www.slapix.com/img/i2/don_t_judge_me.jpg"/> </div> <div class="back"> Don't Judge Me<br><br> I was born<br> to be<br> Awsome<br> not Perfect. </div> </div> <div class="flipcard v"> <div class="front"> <img src="http://www.slapix.com/img/i2/stupidity_has_limits.jpg"> </div> <div class="back"> Everytime<br> I thought that<br> stupidity has limits,<br><br> You proved<br> me wrong </div> </div> <div style="clear:both;padding:5px;padding-left:250px;"> <button onclick="flipcard();">Flip the second cards</button> </div>
CSS
body{ background-color:#fff; } .flipcard { position: relative; width: 230px; height: 160px; margin:10px 5px; perspective: 500px; float:left; } .flipcard.v:hover .front, .flipcard.v.flip .front{ transform: rotateY(180deg); } .flipcard.v:hover .back, .flipcard.v.flip .back{ transform: rotateY(0deg); } .flipcard.v .back{ transform: rotateY(-180deg); } .flipcard.h:hover .front, .flipcard.h.flip .front{ transform: rotateX(180deg); } .flipcard.h:hover .back, .flipcard.h.flip .back{ transform: rotateX(0deg); } .flipcard.h .back{ transform: rotateX(-180deg); } .front, .back { position:absolute; width: 100%; height: 100%; box-sizing: border-box; transition: all 0.5s ease-in; box-shadow: 5px 5px 5px #aaa; backface-visibility: hidden; } .back{ text-align: center; color: white; background-color: #000; padding: 10px; font-family:verdana; font-size:18px; font-weight:bold; background: linear-gradient(45deg, #111 25%,transparent 26%,transparent 75%,#111 76%), linear-gradient(-45deg, #111 25%,transparent 26%,transparent 75%,#111 76%); background-color: #000; background-size: 25px 25px; } .flipcard img { width:100%; height:100%; }
Javascript
function flipcard(){ document.querySelector('#secondcard').classList.toggle('flip'); }
©2013 Copyright snippet.run
Privacy
-
Terms of use
-
About
-
Contact