How we can create a personal contact vCard using HTML CSS and JavaScript? Solution: See this CSS Contact vCard Design With Clip Path Animation, Contact Me Card Design.
Previously I have shared some contact forms, this is a personal profile vCard with social ID and contact form. Basically, vCard is also known as VCF (Virtual Contact File), is a file format standard for electronic business cards. And this program also a kind of personal card, because you can put your social network profiles and a contact form for people can reach you.
Today you will learn to create contact me or personal social card using HTML CSS JS. Basically, there is a card which has a heading and some dummy text, bottom of the card you will see some social network icons. When you will click on any icon then a new section will appear about that network and the whole progress has clip-path animation. And also you can see a contact me button, after clicking that a contact me form will appear.
So, Today I am sharing CSS Contact vCard Design With Clip Path Animation. This program is based on HTML and CSS, but there I have used jQuery for the toggle feature for opening social tabs and the contact form. jQuery makes our work easy and fast and it is a JS library. And there are dummy text and images, you have to replace these contents with our own.
If you are thinking now how this contact me vCard actually is, then see the preview given below.
Preview Of Personal Contact Me and Social Card
See this video preview to getting an idea of how this vCard looks like.
Now you can see it visually, you also can see it live by pressing the button given above. If you like this, then get the source code of its.
You May Also Like:
- JavaScript Dual Sliding Panel
- Sticky Navigation Bar On Scroll
- One Page Portfolio Website
- Animated Login Page In HTML
CSS Contact vCard Design With Clip Path Animation Source Code
Before sharing source code, let’s talk about it. First using HTML I have created the contact me form and after that, I have created multiple cards for different networks and one for starting. Inside the card, I have created two panels left and right, placed an image in the right column in every card. For the icons like facebook, twitter, arrow, etc used the font-awesome library and linked in the HTML file.
Now using CSS, I have placed all the elements on the right place as you can see in the preview. I have placed the elements one above one using z-index command. Here also I have used a background image in the body section and used CSS clip-path animation when changing cards( info). And many more basic things I have done using CSS.
jQuery handling here toggles feature when we changing the cards by clicking on different icons. Here jQuery removes and adds the active class and playing with z-index value. Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files for that. First for HTML, second for CSS, and the third for JavaScript. Follow the steps to creating this without any error.
index.html
Create an HTML file named ‘index.html‘ and put these codes given below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
<!DOCTYPE html> <!--Code By Webdevtrick ( https://webdevtrick.com )--> <html lang="en" > <head> <meta charset="UTF-8"> <title>Personal vCard | Webdevtrick.com</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css'> <link rel="stylesheet" href="style.css"> </head> <body> <div class="cards"> <div class="contact">Contact Me</div> <div class="contact-form"> <a href="#" class="close"><i class="fa fa-times"></i></a> <form> <div class="control"><input type="text" id="name"/><label for="name">Your Name</label></div> <div class="control"><input type="text" id="email"/><label for="email">Email Address</label></div> <div class="control"><input type="text" id="url"/><label for="url">Website</label></div> <div class="control"><textarea name="" id="message"></textarea><label for="message">Message</label></div> <div class="control submit"><input type="submit" /></div> </form> </div> <div class="card active" id="overview"> <a class="card-toggle"><i class="fa fa-arrow-circle-left"></i></a> <div class="card-content"> <div class="row"> <div class="left col"> <h2>Personal <strong>Social Card</strong></h2> <p>Click one of the social icons below to switch between card or click Contact Me link to show the contact form card.</p> </div> <div class="right col"> </div> </div> </div> </div> <div class="card" id="facebook"> <a class="card-toggle"><i><span class="fa fa-facebook-official"></span></i></a> <div class="card-content"> <div class="row"> <div class="left col"> <h2>On <strong>facebook</strong></h2> <p>In ipsa reiciendis, eligendi labore dolores delectus facere perferendis ex architecto reprehenderit maxime exercitationem, libero itaque, at voluptatibus! Sit obcaecati.</p> </div> <div class="right col"><img src="https://webdevtrick.com/wp-content/uploads/profile.jpg" alt="" /></div> </div> </div> </div> <div class="card" id="instagram"> <a class="card-toggle"><i><span class="fa fa-instagram"></span></i></a> <div class="card-content"> <div class="row"> <div class="left col"> <h2>On <strong>instagram</strong></h2> <p>Quia fugit animi, iure error veritatis? Ipsa quis, deserunt illum culpa ab id mollitia nesciunt commodi aut dolores vero ipsam ut minima neque nam excepturi corporis obcaecati consequuntur accusantium laborum!</p> </div> <div class="right col"><img src="https://webdevtrick.com/wp-content/uploads/profile.jpg" alt="" /></div> </div> </div> </div> <div class="card" id="linkedin"> <a class="card-toggle"><i><span class="fa fa-linkedin"></span></i></a> <div class="card-content"> <div class="row"> <div class="left col"> <h2>On <strong>LinkedIn</strong></h2> <p>Voluptas aliquam, perferendis laboriosam, cumque, autem vero pariatur dolorum tempora sint hic laborum distinctio suscipit magnam, porro provident maxime labore. Porro vel error quaerat consequatur sapiente?</p> </div> <div class="right col"><img src="https://webdevtrick.com/wp-content/uploads/profile.jpg" alt="" /></div> </div> </div> </div> <div class="card" id="twitter"> <a class="card-toggle"><i><span class="fa fa-twitter"></span></i></a> <div class="card-content"> <div class="row"> <div class="left col"> <h2>On <strong>Twitter</strong></h2> <p>Fugit veniam, animi architecto doloribus veritatis vitae sint doloremque possimus quae. Pariatur libero, veniam voluptatibus alias distinctio qui nostrum debitis voluptate amet hic repellat officiis.</p> </div> <div class="right col"><img src="https://webdevtrick.com/wp-content/uploads/profile.jpg" alt="" /></div> </div> </div> </div> </div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="function.js"></script> </body> </html> |
style.css
Now create a CSS file named ‘style.css‘ and put these codes given here.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
/* Code By Webdevtrick ( https://webdevtrick.com ) */ @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300,700); * { box-sizing: border-box; } body { min-height: 100vh; display: flex; background-color: #eaeaea; font-family: Open Sans; font-weight: 300; line-height: 1.8; background-image: url(https://webdevtrick.com/wp-content/uploads/background.jpg); background-size: cover; background-repeat: no-repeat; } .contact { position: absolute; top: 30px; left: 50px; z-index: 6; color: rgba(0, 0, 0, 0.5); text-transform: uppercase; letter-spacing: 3px; font-size: 12px; font-weight: 700; padding: 5px 15px; border-radius: 20px; background: rgba(0, 0, 0, 0.1); line-height: 1; cursor: pointer; text-shadow: 0 1px 0px rgba(255, 255, 255, 0.1); } .contact-form { position: absolute; width: 100%; height: 100%; left: 0; top: 0; background: white; z-index: 5; padding: 80px 50px; -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); transition: .3s ease; border-radius: 5px; } .contact-form.active { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .contact-form .close { color: rgba(0, 0, 0, 0.7); position: absolute; right: 30px; top: 30px; } .cards { margin: auto; background: #fefefe; border-radius: 5px; overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), 3px 5px 20px rgba(0, 0, 0, 0.2); width: 768px; height: 550px; position: relative; display: flex; align-items: flex-end; padding: 30px; } .cards .card { display: inline-block; margin-right: 20px; } .cards .card-toggle { z-index: 4; position: relative; width: 48px; height: 48px; border-radius: 50%; display: block; text-align: center; line-height: 1.8; font-size: 24px; cursor: pointer; border: 2px solid transparent; transition: .3s ease; } .cards .card-toggle.active { color: white; border-color: white; } .cards .card-content { position: absolute; width: 100%; height: 100%; left: 0; top: 0; transition: -webkit-clip-path 1s ease; padding: 100px 0 0; overflow: hidden; border-radius: 5px; } .cards .card-content .row { display: table; width: 100%; height: 100%; } .cards .card-content .col { width: 50%; height: 100%; display: table-cell; transition: .3s ease .3s; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); vertical-align: top; } .cards .card-content .col h2 { font-weight: 300; font-size: 3em; line-height: 1; margin: 0 0 30px; } .cards .card-content .col h2 strong { font-weight: 700; display: block; } .cards .card-content .col img { max-width: 90%; width: 100%; } .cards .card-content .col.left { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); opacity: 0; padding-left: 50px; } .cards .card-content .col.right { -webkit-transform: translate3d(100px, 0, 0); transform: translate3d(100px, 0, 0); opacity: 0; padding-left: 30px; } .cards .card.active .col { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); opacity: 1; } .cards #overview .card-toggle { position: absolute; top: 30px; right: 30px; opacity: 1; color: white; } .cards #overview .card-content { background-color: #efefef; -webkit-clip-path: circle(0% at 91.5% 75px); } .cards #overview.active .card-toggle { opacity: 0; } .cards #overview.active .card-content { -webkit-clip-path: circle(270% at 91.5% 75px); } .cards #overview .right { background: url(https://webdevtrick.com/wp-content/uploads/profile.jpg) no-repeat bottom right; background-size: contain; } .cards #facebook .card-content, .cards #instagram .card-content, .cards #linkedin .card-content, .cards #twitter .card-content { color: white; } .cards #facebook .card-content p, .cards #instagram .card-content p, .cards #linkedin .card-content p, .cards #twitter .card-content p { color: rgba(255, 255, 255, 0.8); } .cards #facebook .card-content { background-color: #4267b2; -webkit-clip-path: circle(0% at 76px 88%); clip-path: circle(0% at 50px 88%); } .cards #facebook.active .card-content { -webkit-clip-path: circle(270% at 76px 88%); clip-path: circle(270% at 50px 88%); } .cards #instagram .card-content { background-color: #ef4d5d; -webkit-clip-path: circle(0% at 150px 88%); clip-path: circle(0% at 150px 88%); } .cards #instagram.active .card-content { -webkit-clip-path: circle(270% at 150px 88%); clip-path: circle(270% at 150px 88%); } .cards #linkedin .card-content { background-color: #03679B; -webkit-clip-path: circle(0% at 220px 88%); clip-path: circle(0% at 220px 88%); } .cards #linkedin.active .card-content { -webkit-clip-path: circle(270% at 220px 88%); clip-path: circle(270% at 220px 88%); } .cards #twitter .card-content { background-color: #1da1f2; -webkit-clip-path: circle(0% at 292px 88%); clip-path: circle(0% at 292px 88%); } .cards #twitter.active .card-content { -webkit-clip-path: circle(270% at 292px 88%); clip-path: circle(270% at 292px 88%); } form .control { position: relative; margin-bottom: 10px; padding-top: 20px; } form .control label { position: absolute; top: 30px; left: 0; transition: .3s ease; text-transform: uppercase; font-weight: 600; letter-spacing: 2px; font-size: 14px; } form .control.submit { text-align: right; } form input, form textarea { width: 100%; border: none; border-bottom: 1px solid #e3e3e3; outline: none; padding: 10px 0; } form .filled label, form input:focus + label, form textarea:focus + label { top: 0; font-size: 12px; } form textarea { height: 100px; } form input[type="submit"] { width: auto; background-color: #ff3c3c; padding: 10px 40px; color: white; border-radius: 40px; } @media (max-width: 765px) { .cards #overview .right { background: none; } } |
function.js
The final step, create a JavaScript file named ‘function.js‘ and put the codes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
// Code By Webdevtrick ( https://webdevtrick.com ) $(".card-toggle").on("click", function(){ // Card toggle state $(".card-toggle").removeClass("active"); $(this).addClass("active"); var isAnimating = false; if( !isAnimating ){ isAnimating = true; $(".card").find(".card-content").css("z-index",0); $(".card").removeClass("active"); var that = $(this); $(this).siblings().css("z-index",1); setTimeout(function(){ that.parent().toggleClass("active").find(".card-content").on("transitionend", function(){ isAnimating = false; }); ; },10); } else { return; } }); $("input,textarea").blur(function(){ if( $(this).val() ){ $(this).parent().addClass("filled"); } else { $(this).parent().removeClass("filled"); } }); $(".contact").on("click",function(){ $(".contact-form").toggleClass("active"); }); $(".contact-form input[type=submit], .contact-form .close").on("click",function(e){ e.preventDefault(); $(".contact-form").toggleClass("active") }); |
That’s It. Now you have successfully created CSS Contact vCard Design With Clip Path Animation, Contact Me Card With social profiles. If you have any doubt or question comment down below.
Thanks For Visiting, Keep Visiting.