Card flip
How do I make an card flip?
A simple css based card flip animation. Just click on one of the cards!. What is a card flip? How do you make a card flip? This script and codes were developed by Sander on 18 December 2022, Sunday.
Card flip - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Card flip</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="wrapper"> <h1 class="pageTitle">Card flip</h1> <p>A simple css based card flip animation. Just click on one of the cards!</p>
</div>
<div class="wrapper cards"> <div class="container"> <div class="card"> <div class="front"><h2>About me</h2></div> <div class="back"> <div class="content"> <h3 class="cardTitle">Who am I?</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sodales, mi ac vulputate blandit, libero nulla bibendum quam.</p> </div> </div> </div> </div> <div class="container"> <div class="card"> <div class="front"><h2>Contact me!</h2></div> <div class="back"> <div class="content"> <h3 class="cardTitle">Send a mail!</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sodales, mi ac vulputate.</p> <form> <div class="formItem"> <label>Naam</label> <input type="text" name="Naam" value="Naam" /> </div> <div class="formItem"> <label>Email</label> <input type="password" name="Password" value="Password" /> </div> <button class="btnSend">Send</button> </form> </div> </div> </div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Card flip - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700);
body { font-family: 'Roboto Slab', serif; font-weight: 300; font-size: 16px; line-height: 1.4em; color: #333; background: #eee;
}
input,
button { font-family: 'Roboto Slab', serif; font-weight: 300; font-size: 16px; border: 0; padding: 3px 5px; border-radius: 3px;
}
h1 { margin: 0.5em 0 1em 0; font-size: 1.8em; font-weight: 700; color: #096AA3;
}
h2, h3 { font-weight: bold;
}
p { margin-bottom: 1em;
}
.animation { -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;
}
.wrapper { width: 80%; padding: 4%; margin: 20px auto; background: #fff;
}
.wrapper.cards { background: 0; width: 88%; padding: 20px 0 0 0;
}
.container { position: relative; float: left; width: 48%; height: 260px; margin: 10px 0 10px 4%; background: #fff; /* Set the depth of the elements */ -webkit-perspective: 800px; -moz-perspective: 800px; -o-perspective: 800px; perspective: 800px;
}
.container:first-child { margin-left: 0;
}
.card { width: 100%; height: 100%; position: absolute; cursor: pointer; /* Set the transition effects */ -webkit-transition: -webkit-transform 0.4s; -moz-transition: -moz-transform 0.4s; -o-transition: -o-transform 0.4s; transition: transform 0.4s; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -o-transform-style: preserve-3d; transform-style: preserve-3d;
}
.card.flipped { -webkit-transform: rotateY( 180deg ); -moz-transform: rotateY( 180deg ); -o-transform: rotateY( 180deg ); transform: rotateY( 180deg );
}
.card .front,
.card .back { display: block; height: 100%; width: 100%; line-height: 260px; color: white; text-align: center; font-size: 4em; position: absolute; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; -o-backface-visibility: hidden; backface-visibility: hidden; box-shadow: 3px 5px 20px 2px rgba(0, 0, 0, 0.25);
}
.card .back { width: 94%; padding-left: 3%; padding-right: 3%; font-size: 16px; text-align: left; line-height: 25px;
}
.formItem:first-child { margin-top: 20px;
}
.card .back label { display: inline-block; width: 70px; text-align: left;
}
.card .front { background: #096AA3;
}
.card .back { background: #03446A; -webkit-transform: rotateY( 180deg ); -moz-transform: rotateY( 180deg ); -o-transform: rotateY( 180deg ); transform: rotateY( 180deg );
}
.container:first-child .card .front { background: #228653;
}
.container:first-child .card .back { background: #007539;
}
.cardTitle { font-size: 1.4em; line-height: 1.2em; margin: 0;
}
.content { padding: 4%; font-weight: 100; text-align: left;
}
button.btnSend { display: inline-block; min-width: 100px; padding: 3px 5px; margin-top: 10px; font-weight: bold; text-transform: uppercase; text-align: center; color: #03446A; background: #fff; border: 0; border-radius: 0;
}
Card flip - Script Codes JS Codes
$('.card').click(function(){ $(this).toggleClass('flipped');
});
Developer | Sander |
Username | skeurentjes |
Uploaded | December 18, 2022 |
Rating | 4.5 |
Size | 2,976 Kb |
Views | 10,120 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Animates search input with only css | 4,335 Kb |
Search field | 2,280 Kb |
Horizontal navigation | 2,183 Kb |
Accordion | 4,280 Kb |
Flexbox layout | 3,615 Kb |
Button hover effects | 3,642 Kb |
Automatic scroll | 4,042 Kb |
Side navigation | 3,043 Kb |
Simple gallery | 3,050 Kb |
Custom input radio buttons | 2,158 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Virtual vinyl | Davidpanik | 3,474 Kb |
Fullscreen audio play button | 72 | 2,148 Kb |
A Pen by Jonas Bjork | Jonasbjork | 3,115 Kb |
Coming Soon | MariamMassadeh | 1,680 Kb |
Nested table email layout | Massimo-cassandro | 2,355 Kb |
Nav Test -- cats 1 | Payls | 4,735 Kb |
Simple search using AngularJS | Haykou | 1,802 Kb |
Tab Menus | Zephyr | 3,180 Kb |
The Fantastic Mr Fox | MalZiiirA | 10,435 Kb |
Basic jQuery Filter list | Mtedwards | 2,464 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!