JSFiddle - React, Tailwind, and code Playground
by Ajsa Ferguson
HTML
<div id="about">
<div id="aboutbtn-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
<div id="aboutbtn">About me</div>
<div class="social-icons"> <a href="#"><img src="http://placehold.it/43x43"></a>
<a href="#"><img src="http://placehold.it/43x43"></a>
</div>
</div>
CSS
#about {
background: #336699;
height: 561px;
width: 300px;
position:absolute;
top: 0%;
right:-285px;
}
#aboutbtn {
background: #336699;
background-size: contain;
background-repeat: no-repeat;
width: 85px;
height: 35px;
text-align: center;
padding: 35px 10px;
font-size: 18px;
cursor: pointer;
color: #fff;
position: absolute;
left: -85px;
margin-top: 20px;
margin-right: 15px;
display: block !important;
}
#aboutbtn-content {
float: left;
padding: 35px 30px;
}
.social-icons {
position: absolute;
left: -63px;
top: 140px;
}
.social-icons img {
display: block;
margin-bottom: 10px;
}
JavaScript
var open = false;
$("#aboutbtn").click(function () {
if(!open) $(this).parent().animate({ right: '0px'}, 500);
else $(this).parent().animate({ right: '-285px'}, 500);
open = !open ? true : false;
});