"Login form with flip transitions"
Bootstrap 3.3.0 Snippet by webdogz

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div id="flip-container"> <div id="flip-card"> <div id="signin" class="face"> <form class="form-signin" role="form"> <h3 class="form-signin-heading">Please sign in or <a href="#" id="toSignup">Sign up</a></h3> <div class="entry-group"> <input type="email" class="form-control" placeholder="Email address" required autofocus> <input type="password" class="form-control" placeholder="Password" required> <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button> </div> <a href="#" id="toRecover">Lost Password?</a> </form> </div> <div class="back face"> <div id="signup" class="hide"> <form class="form-signin" role="form"> <h3 class="form-signin-heading">Please sign up</h3> <div class="entry-group"> <input type="text" class="form-control" name="loginUsername" id="loginUsername" placeholder="Username" required autofocus> <input type="email" class="form-control" name="loginEmail" id="loginEmail" placeholder="Email address" required> <input type="password" class="form-control" name="loginPass" id="loginPass" placeholder="Password" required> <button class="btn btn-lg btn-primary btn-block" type="submit">Sign up</button> </div> </form> <a href="#" class="backToSignin">Back to login.</a> </div> <div id="recover" class="hide"> <form class="form-signin" role="form"> <h3 class="form-signin-heading">Enter email address or <a href="#" id="flipToLogin">Back to Sign in</a></h3> <div class="entry-group"> <input type="email" class="form-control" name="loginEmail" id="loginEmail" placeholder="Email address" required autofocus> <button class="btn btn-lg btn-primary btn-block" type="submit">Recover password</button> </div> </form> <a href="#" class="backToSignin">Back to login.</a> </div> </div> </div> </div> <!-- /container --> </div> </div>
#flip-container { position: relative; margin: 80px auto; width: 450px; height: 281px; z-index: 1; perspective: 800px; } #flip-card { width: 100%; height: 100%; transform-style: preserve-3d; transition: all 0.5s linear; box-shadow: 5px 5px 5px #aaa; } #flip-container.flipped #flip-card { transform: rotateY(180deg); box-shadow: -5px 5px 5px #aaa; } .face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; padding:10px; background-color: #ccc; } .back{ padding:10px; background-color: #ccc; } .face.back { display: block; transform: rotateY(180deg); box-sizing: border-box; } .entry-group > .form-control:not(:first-child):not(:last-child), .entry-group > .btn:not(:first-child):not(:last-child){ border-radius: 0; margin: 3px 0; } .entry-group > .form-control:first-child:not(:last-child), .entry-group > .btn:first-child:not(:last-child) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 3px; } .entry-group > .form-control:last-child:not(:first-child), .entry-group > .btn:not(:first-child) { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 3px; }
$(function(){ // Checking for CSS 3D transformation support $.support.css3d = supportsCSS3D(); var container = $('#flip-container'); $('#toRecover').on('click', function(e){ flipit($('#recover'), e); }); $('#toSignup').on('click', function(e){ flipit($('#signup'), e); }); $('.backToSignin').on('click', function(e){ flipit($(this).parent(), e); }); formContainer.find('form').submit(function(e){ // Preventing form submissions. If you implement // a backend, you might want to remove this code e.preventDefault(); }); function ctoggle(){ return container.toggleClass('flipped').delay(200); } function flipit(el, e){ $.when(ctoggle()).done(function(){ el.toggleClass('hide'); if(!$.support.css3d) $('#signin').toggle(); }); e.preventDefault(); } // A helper function that checks for the // support of the 3D CSS3 transformations. function supportsCSS3D() { var props = [ 'perspectiveProperty', 'WebkitPerspective', 'MozPerspective' ], testDom = document.createElement('a'); for(var i=0; i<props.length; i++){ if(props[i] in testDom.style){ return true; } } return false; } });

Related: See More


Questions / Comments: