JSFiddle - React, Tailwind, and code Playground
by dirtyd77
HTML
<div class="wrapper">
<div id="logo"></div>
<div id="contactDiv">
<p id="contact">Contact</p>
<form id="contactForm">
<label>Name:</label>
<input type="text"/>
</form>
</div>
</div>
CSS
html, body {
margin: 0px;
padding: 0px;
min-height: 100%;
height: 100%;
}
body {
background: #e4e4e4 url('http://willhousemedia.com/wp-content/uploads/2013/09/Gray-Tile.png') repeat;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: top center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.wrapper {
position:absolute;
top:0;
right:0;
left:0;
bottom:0;
overflow:hidden;
}
#logo {
position:absolute;
min-width:290px;
background-image:url('http://willhousemedia.com/wp-content/uploads/2013/09/WHM-Logo_Shadow1.png');
background-size: 290px 93px;
background-position: center center;
background-repeat: no-repeat;
top:0;
bottom:0;
left:0;
right:0;
z-index:0;
}
#contactDiv{
position:absolute;
margin: 0 0 0 -16.5%;
width: 33%;
left: 50%;
top:85%;
overflow:hidden;
}
#contactDiv p,
#contactDiv label{
font-variant: small-caps;
font-size:0.85em;
font-weight:bold;
}
#contact {
text-align:center;
margin-bottom:0.2em;
}
#contact:hover {
text-decoration: underline;
cursor:pointer;
}
#contactForm{
display:none;
border-top:1px solid black;
padding-top:0.4em;
}
JavaScript
$(function(){
var _bool = false;
$('#contact').click(function(){
$('#logo').stop(true, false).animate({
bottom: !_bool ? '60%' : '10%'
}, 575, "swing");
$('#contactDiv').stop(true, false).animate({
top: !_bool ? '40%' : '85%'
}, 575, "swing");
!_bool ?
$('#contactForm').stop(true, false).fadeIn(600) :
$('#contactForm').stop(true, false).fadeOut(600);
_bool = !_bool;
});
});