JSFiddle - React, Tailwind, and code Playground

Flat Log In/Create Account Form

by Jennifer Perrin

HTML

<link rel="stylesheet" href="http://daneden.github.io/animate.css/animate.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<div class='form aniamted bounceIn'>
    <div class='switch'>
        <i class='fa fa-pencil fa-times'></i>
    </div>
    <div class='login'>
        <h2>Login To Your Account</h2>
        <form>
            <input placeholder='Username' type='text' />
            <input placeholder='Password' type='password' />
            <button>Login</button>
        </form>
    </div>
    <div class='register'>
        <h2>Create An Account</h2>
        <form>
            <input placeholder='Username' type='text' />
            <input placeholder='Password' type='password' />
            <input placeholder='Confirm Password' type='password' />
            <input placeholder='Email Address' type='email' />
            <input placeholder='Birth Date (mm/dd/yy)' type='text' />
            <button>Login</button>
        </form>
    </div>
    <footer>
        
    </footer>
</div>

CSS

@import url(http://fonts.googleapis.com/css?family=Dosis);

body {
    background: #33b5e5 url("http://38.media.tumblr.com/d23deac40b06633b79520a8552f40b94/tumblr_nb1uhrRrge1st5lhmo1_1280.jpg") no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    font-family: "Dosis";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body:before {
    z-index: -1;
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    background: #33b5e5;
    background: rgba(51, 181, 229, 0.8);
    width: 100%;
    height: 100%;
}
.form {
    position: relative;
    background: #fff;
    width: 285px;
    margin: 40px auto 0;
    padding: 40px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
.form .switch {
    cursor: pointer;
    position: absolute;
    top: 0;
    right: 0;
    background: #33b5e5;
    width: 30px;
    height: 30px;
    color: #fff;
    font-size: 12px;
    line-height: 30px;
    text-align: center;
}
.form .switch .tooltip {
    position: absolute;
    top: 5px;
    right: -65px;
    display: block;
    width: auto;
    padding: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    text-align: left;
    text-transform: uppercase;
}
.form .switch .tooltip:before {
    content: '';
    position: absolute;
    top: 5px;
    left: -5px;
    display: block;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid rgba(0, 0, 0, 0.6);
}
.form .register {
    display: none;
}
.form h2 {
    margin: 0 0 20px;
    line-height: 1;
    color: #33b5e5;
    font-size: 18px;
    font-weight: 400;
}
.form .alert {
    position: relative;
    background: #f3f3f3;
    color: #666;
    font-size: 12px;
    margin-bottom: 20px;
    padding: 15px;
}
.form .alert .fa-times-circle {
    cursor: pointer;
   ...

JavaScript

$('.alert').delay(2000).fadeIn(300);

$('.fa-times-circle').click(function(){
    $(this).parent('.alert').fadeOut(300);
});

$('.switch').click(function(){
    $(this).children('i').toggleClass('fa-pencil');
    $('.login').animate({height: "toggle", opacity: "toggle"}, "slow");
    $('.register').animate({height: "toggle", opacity: "toggle"}, "slow");
});