JSFiddle - React, Tailwind, and code Playground

by kachibito

HTML

<div id="wrap">
        <h1>Send a message</h1>
        <div id='form_wrap'>
            <form>
                <p>Hello Joe,</p>
                <label for="email">Your Message : </label>
                <textarea  name="message" value="Your Message" id="message" ></textarea>
                <p>Best,</p>    
                <label for="name">Name: </label>
                <input type="text" name="name" value="" id="name" />
                <label for="email">Email: </label>
                <input type="text" name="email" value="" id="email" />
                <input type="submit" name ="submit" value="Now, I send, thanks!" />
            </form>
        </div>
    </div>

CSS

body, div, h1,h2, form, fieldset, input, textarea, footer,p {
    margin: 0; padding: 0; border: 0; outline: none;
}


@font-face {
    font-family: 'YanoneKaffeesatzRegular';
    src: url('yanonekaffeesatz-regular-webfont.eot');
    src: url('yanonekaffeesatz-regular-webfont.eot?#iefix') format('embedded-opentype'),
    url('yanonekaffeesatz-regular-webfont.woff') format('woff'),
    url('yanonekaffeesatz-regular-webfont.ttf') format('truetype'),
    url('yanonekaffeesatz-regular-webfont.svg#YanoneKaffeesatzRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}

body {background: #ccc url('images/bg_out.png'); color: #7c7873; font-family: 'YanoneKaffeesatzRegular';}
p {text-shadow:0 1px 0 #fff; font-size:24px;}
#wrap {width:530px; margin:20px auto 0; height:1000px;}
h1 {margin-bottom:20px; text-align:center;font-size:48px; text-shadow:0 1px 0 #ede8d9; }


    #form_wrap { overflow:hidden; height:446px; position:relative; top:0px;
        -webkit-transition: all 1s ease-in-out .3s;
        -moz-transition: all 1s ease-in-out .3s;
        -o-transition: all 1s ease-in-out .3s;
        transition: all 1s ease-in-out .3s;}
    
    #form_wrap:before {content:"";
        position:absolute;
        bottom:128px;left:0px;
        background:url('images/before.png');
        width:530px;height: 316px;}
    
    #form_wrap:after {content:"";position:absolute;
        bottom:0px;left:0;
        background:url('images/after.png');
        width:530px;height: 260px; }

    #form_wrap.hide:after, #form_wrap.hide:before {display:none; }
    #form_wrap:hover {height:776px;top:-200px;}


    form {background:#f7f2ec url('images/letter_bg.png'); 
        position:relative;top:200px;overflow:hidden;
        height:200px;width:400px;margin:0px auto;padding:20px; 
        border: 1px solid #fff;
        border-radius: 3px; 
        -moz-border-radius: 3px; -webkit-border-radius: 3px;
        box-shadow: 0px 0px 3px #9d9d9d, inset 0px 0px 27px #fff;
       ...

JavaScript

$(document).ready(function() {
            $("#form_wrap").addClass('hide');
            $("#form_wrap").prepend( '<div id="before"></div>').append( '<div id="after"</div>');
            $("#form_wrap").hover(function(){
           $(this).stop(true, false).animate({
                height : '836px',
                top : '-200px'
           }, 2000);
            $('form').stop(true, false).animate({
    height : '580px'
    }, 2000, function(){
                         $('#form_wrap input[type=submit]').css({'z-index' : '1', 'opacity' : '1'})} ) }, function() {
    $('#form_wrap input[type=submit]').stop(true, true).css({ 'opacity' : '0'})
          $(this).stop(true, false).animate({
      height : '446px',
      top : '0px'

    }, 2000);
    $('form').stop(true, false).animate({
        height : '200px'}, 2000)
    })
})