Profile card example

HTML
<div class="accordion-wrap"> <div class="accordion"> <a href="#" class="active"><i class="fa fa-user"></i>Profile</a> <div class="sub-nav active"> <div class="html about-me"> <div class="photo"> <div class="photo-overlay"> <span class="plus">+</span> </div> </div> <h4>@knuckles_dmitry</h4> <p>Hi, my name is Dmitry Rodionov</p> <div class="social-link"> <a class="link link-twitter" href="https://twitter.com/knuckles_dmitry" target="_blank"><i class="fa fa-twitter"></i></a> <a class="link link-codepen" href="#" target="_blank"><i class="fa fa-codepen"></i></a> <a class="link link-facebook" href="#" target="_blank"><i class="fa fa-facebook"></i></a> <a class="link link-dribbble" href="#" target="_blank"><i class="fa fa-dribbble"></i></a> </div> </div> </div> <a href="#"><i class="fa fa-comments"></i>Chat</a> <div class="sub-nav"> <div class="html chat"> <div class="user user-khadkamhn clearfix"> <span class="text-msg pull-right">Sup, how is it going?</span> </div> <div class="user user-khadkamhn clearfix"> <span class="text-msg pull-right">Just great, man!</span> </div> <div class="user user-dribble clearfix"> <span class="photo pull-left" data-username="dribbble"><i class="fa fa-dribbble"></i></span> <span class="text-msg">Cool.</span> </div> <div class="user user-dribble clearfix"> <span class="photo pull-left" data-username="dribbble"><i class="fa fa-dribbble"></i></span> <span class="text-msg">C U Around</span> </div> </div> </div> <a href="#"><i class="fa fa-envelope"></i> Messages <span class="pull-right alert-numb">21</span></a> <div class="sub-nav"> <a href="#">Inbox<span class="pull-right alert-numb">11</span></a> <a href="#">Bookmarks <span class="pull-right alert-numb">10</span></a> <a href="#">Sent</a> <a href="#">Drafts</a> <a href="#">Deleted</a> <a href="#">All messages</a> </div> <a href="#"><i class="fa fa-dribbble"></i> Dribbble subscription</a> <div class="sub-nav"> <div class="html invite"> <p>Follow me in <span class="dribbble">dribbble</span> network</p> <p>Have you subscribed?</p> <a class="btn" href="#" target="_blank">Subscribe</a> </div> </div> </div>
CSS
body{ margin:0; padding: 0; color:#444; background:#F0C27B; font:400 16px/18px Roboto, sans-serif; } *,:after,:before{box-sizing:border-box} .pull-left{float:left} .pull-right{float:right} .clearfix:after,.clearfix:before{content:'';display:table} .clearfix:after{clear:both;display:block} .accordion-wrap{ top:50px; left:0; right:0; bottom:0; padding:15px; position:fixed; background:-webkit-linear-gradient(90deg, #F0C27B 10%, #4B1248 90%); background:-webkit-linear-gradient(0deg, #F0C27B 10%, #4B1248 90%); background:linear-gradient(90deg, #F0C27B 10%, #4B1248 90%); } .accordion{ width:80%; margin:auto; max-width:280px; overflow:hidden; border-radius:3px; background:#B7AFA3; box-shadow:0 17px 50px 0 rgba(0,0,0,.19),0 12px 15px 0 rgba(0,0,0,.24); } .accordion>a{ color:#374046; padding:15px; display:block; text-decoration:none; -webkit-transition:all .3s ease-in-out 0s; transition:all .3s ease-in-out 0s; } .accordion>a:not(:last-child){ border-bottom:1px solid rgba(0,0,0,.2); } .accordion>a:hover, .accordion>a.active{ background:#E8D0A9; } .accordion>a.active{ color:#B77F24; } .accordion>a>.alert-numb, .accordion>.sub-nav>a>.alert-numb{ color:#eee; right:10px; height:22px; min-width:40px; font-size:12px; font-weight:600; line-height:22px; border-radius:15px; text-align:center; background:#665e51; } .accordion>a.active>.alert-numb, .accordion>.sub-nav>a.active>.alert-numb{ background:#d0a051; } .accordion .sub-nav{ display:none; color:#374046; overflow:hidden; background:#ecf0f1; } .accordion .sub-nav.open{ display:block; } .accordion .sub-nav a{ display:block; color:inherit; font-weight:300; padding:10px 15px; text-decoration:none; -webkit-transition:all .2s ease-in-out 0s; transition:all .2s ease-in-out 0s; } .accordion .sub-nav a:not(:last-child){ border-bottom:1px solid rgba(0,0,0,.1); } .accordion .sub-nav a:hover{ background:#c2ced1; box-shadow:5px 0 0 #8ca3a8 inset; } .accordion .html{ padding:15px; } .accordion .about-me{ text-align:center; position:relative; } .accordion .about-me h4{ margin-bottom:0; } .accordion .about-me p{ font-size:14px; font-weight:300; margin-bottom:0; } .accordion .about-me .photo{ width:95px; height:95px; margin:auto; overflow:hidden; border-radius:50%; position:relative; border:4px solid #fff; box-shadow:0 6px 20px 0 rgba(0,0,0,.19),0 8px 17px 0 rgba(0,0,0,.2); background:url(https://pbs.twimg.com/profile_images/764041688243376128/cXFgS1TO_400x400.jpg) no-repeat center; background-size: cover; } .accordion .about-me .photo .photo-overlay{ top:0; left:0; right:0; bottom:0; opacity:0; visibility:hidden; position:absolute; background:rgba(0,0,0,.4); } .accordion .about-me .photo .photo-overlay .plus{ top:50%; left:50%; width:30px; height:30px; color:#1a1a1b; cursor:pointer; font-size:24px; font-weight:100; margin-top:-15px; margin-left:-15px; position:absolute; line-height:30px; border-radius:50%; text-align:center; background:#e8d0a9; -webkit-transform:scale(0) rotate(0); -ms-transform:scale(0) rotate(0); transform:scale(0) rotate(0); -webkit-transition:all .1s ease-in-out 0s; transition:all .1s ease-in-out 0s; } .accordion .about-me .photo:hover .photo-overlay{ opacity:1; visibility:visible; } .accordion .about-me .photo:hover .photo-overlay .plus{ -webkit-transform:scale(1) rotate(90deg); -ms-transform:scale(1) rotate(90deg); transform:scale(1) rotate(90deg); } .accordion .about-me .social-link{ top:0; left:0; right:0; bottom:0; opacity:0; padding-top:48px; visibility:hidden; position:absolute; background:rgba(0,0,0,.3); -webkit-transition:opacity .5s ease-in-out 0s; transition:opacity .5s ease-in-out 0s; } .accordion .about-me .social-link.active{ opacity:1; visibility:visible; } .accordion .about-me .social-link .link{ width:30px; padding:0; color:#eee; height:30px; margin:0 4px; line-height:28px; border-radius:50%; display:inline-block; -webkit-transform:translateY(-80px) scale(0); -ms-transform:translateY(-80px) scale(0); transform:translateY(-80px) scale(0); border:1px solid rgba(0,0,0,.2); } .accordion .about-me .social-link .link-twitter{ background:#55acce; } .accordion .about-me .social-link .link-codepen{ background:#1a1a1b; } .accordion .about-me .social-link .link-facebook{ background:#3b5998; } .accordion .about-me .social-link .link-dribbble{ background:#ea4c89; } .accordion .about-me .social-link .link:hover{ box-shadow:none; } .accordion .about-me .social-link.active .link{ -webkit-transform:translateY(0) scale(1); -ms-transform:translateY(0) scale(1); transform:translateY(0) scale(1); } .accordion .about-me .social-link.active .link:nth-child(1){ -webkit-transition-duration:.1s; transition-duration:.1s; } .accordion .about-me .social-link.active .link:nth-child(2){ -webkit-transition-duration:.2s; transition-duration:.2s; } .accordion .about-me .social-link.active .link:nth-child(3){ -webkit-transition-duration:.3s; transition-duration:.3s; } .accordion .about-me .social-link.active .link:nth-child(4){ -webkit-transition-duration:.4s; transition-duration:.4s; } .accordion .about-me .social-link.active .link:nth-child(5){ -webkit-transition-duration:5s; transition-duration:5s; } .accordion .about-me.blur p, .accordion .about-me.blur h4, .accordion .about-me.blur .photo{ -webkit-filter:blur(2px); filter:blur(2px); } .accordion .chat .user:not(:last-child){ margin-bottom:10px; } .accordion .chat .user .photo{ width:40px; height:40px; font-size:24px; line-height:36px; text-align:center; position:relative; border-radius:3px; display:inline-block; border:1px solid rgba(0,0,0,.2); } .accordion .chat .user .photo:before, .accordion .chat .user .photo:after{ content:''; opacity:0; visibility:hidden; position:absolute; -webkit-transition:opacity .4s ease-in-out 0s; transition:opacity .4s ease-in-out 0s; } .accordion .chat .user .photo:before{ left:50%; width:60px; bottom:50px; padding:4px; font-size:12px; line-height:14px; margin-left:-30px; text-align:center; background:#333333; border-radius:4px; word-break:break-all; content:attr(data-username); } .accordion .chat .user .photo:after{ left:50%; bottom:35px; margin-left:-8px; border:8px solid transparent; border-top:8px solid #333333; } .accordion .chat .user .photo:hover:before, .accordion .chat .user .photo:hover:after{ opacity:1; visibility:visible; } .accordion .chat .user.user-dribble .photo{ color:#fff; margin-right:5px; background:#f15e95; } .accordion .chat .user .text-msg{ max-width:70%; font-size:13px; padding:4px 8px; background:#fff; border-radius:4px; display:inline-block; border:1px solid #cdd6d8; } .accordion .chat .user.user-khadkamhn .text-msg{ background:#dce2e4; } .accordion .invite{ text-align:center; } .accordion .invite .dribbble{ display:block; color:#c33269; margin:10px 0; font-size:24px; font-family:Pacifico; } .accordion .invite .btn{ color:#eee; font-weight:500; background:#ccc; padding:10px 15px; border-radius:2px; background:#f15e95; display:inline-block; text-transform:uppercase; } .accordion .invite .btn:hover{ box-shadow:none; background:#cb386f; }
JAVASCRIPT
$(function(){ Profile.load(); }); Profile = { load:function(){ this.links(); this.social(); this.accordion(); }, links:function(){ $('a[href="#"]').click(function(e){ e.preventDefault(); }); }, social:function(){ $('.accordion .about-me .photo .photo-overlay .plus').click(function(){ $('.social-link').toggleClass('active'); $('.about-me').toggleClass('blur'); }); $('.social-link').click(function(){ $(this).toggleClass('active'); $('.about-me').toggleClass('blur'); }); }, accordion:function(){ var subMenus = $('.accordion .sub-nav').hide(); $('.accordion > a').each(function(){ if($(this).hasClass('active')){ $(this).next().slideDown(100); } }); $('.accordion > a').click(function(){ $this = $(this); $target = $this.next(); $this.siblings('a').removeAttr('class'); $this.addClass('active'); if(!$target.hasClass('active')){ subMenus.removeClass('active').slideUp(100); $target.addClass('active').slideDown(100); } return false; }); } }
Expand for more options Login