JSFiddle - React, Tailwind, and code Playground
by dirtyd77
HTML
<div id="wrapper">
<div id="logo">
<p id="contactTitle">Contact</p>
</div>
<div id="content">
<div id="seperator"></div>
<div id="contentWrapper">
<form id="contactForm">
<div class="formLine">
<label for="nameField">Name:</label>
<input id="nameField" type="text" />
</div>
<div class="formLine">
<label for="emailField">Email:</label>
<input id="emailField" type="text" />
</div>
<div class="formLine">
<label id="noteLabel" for="noteField">Note:</label>
<textarea id="noteField" rows="3"></textarea>
</div>
<div class="formLine">
<div class="right">
<p id="message"></p>
<button id="send" type="button">Send</button>
</div>
</div>
</form>
</div>
</div>
</div>
CSS
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}
html, body {
margin: 0px;
padding: 0px;
height: 100%;
width:100%;
overflow:hidden;
}
body {
background: #e4e4e4 url('http://willhousemedia.com/wp-content/uploads/2013/09/Gray-Tile.png');
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;
}
p, label, button {
font-family: Constantia;
font-variant: small-caps;
font-size:0.85em;
font-weight:bold;
}
#wrapper {
height:100%;
width:100%;
}
#logo {
position:relative;
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;
min-height:150px;
width:100%;
height:100%;
}
#content {
position: relative;
margin: 0 auto;
width: 100%;
height: 53%;
padding-bottom: 1em;
}
#contactTitle {
min-width:120px;
position:absolute;
left:50%;
bottom:5%;
margin:0 0 0 -60px;
padding:0;
text-align:center;
}
#contactTitle:hover {
cursor:pointer;
}
#contentWrapper{
height: 95%;
width: 300px;
margin: 0 auto;
padding-bottom:0.2em;
overflow-y: auto;
overflow-x:hidden;
}
#contactForm {
display:none;
padding:0.5em;
}
#seperator {
width: 0%;
height: 1px;
background: black;
border-top: 1px ridge gray;
margin: 0.4em auto;
}
.formLine {
width:100%;
display: table;
margin-bottom: 1em;
}
.formLine label, .formLine input, .formLine textarea {
display:...
JavaScript
$(function () {
var _bool = false;
$('#contactTitle').click(function () {
$('#logo').stop(true, false).animate({
height: !_bool ? '40%' : '100%'
}, 575, "swing");
$('#contactTitle').stop(true, false).animate({
bottom: !_bool ? '0%' : '5%'
}, 575, "swing");
$('#seperator').stop(true, false).animate({
width: !_bool ? '300px' : '0'
}, 575, "swing");
!_bool ? $('#contactForm').stop(true, false).fadeIn(675) : $('#contactForm').stop(true, false).fadeOut(600);
_bool = !_bool;
});
$('#send').button().click(function(){
$('#message').css({
opacity : 0,
left : $('#send').position().left + 'px'
})
.addClass('pass')
.text('Message Sent!')
.animate({
left: '0px',
opacity: 1
}, 600);
});
});