"Login Form with CSS 3D Transforms"
Bootstrap 3.1.0 Snippet by DonSinDRom

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.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 ---------->
<!--Inspired by http://tutorialzine.com/2012/02/apple-like-login-form/ - Apple-like Login Form with CSS 3D Transforms -->
<div class="container">
<div class="row">
<div class="container" id="formContainer">
<form class="form-signin" id="login" role="form">
<h3 class="form-signin-heading">Please sign in</h3>
<a href="#" id="flipToRecover" class="flipLink">
<div id="triangle-topright"></div>
</a>
<input type="email" class="form-control" name="loginEmail" id="loginEmail" placeholder="Email address" required autofocus>
<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 in</button>
</form>
<form class="form-signin" id="recover" role="form">
<h3 class="form-signin-heading">Enter email address</h3>
<a href="#" id="flipToLogin" class="flipLink">
<div id="triangle-topleft"></div>
</a>
<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>
</form>
</div> <!-- /container -->
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #ddd;
}
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
background-color: #f3f3f3;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
position: relative;
font: 15px 'Segoe UI',Arial,sans-serif;
background-color: #EAEBE5;
height: auto;
padding: 10px;
color:#7e8c8d;
outline:none;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$(function(){
// Checking for CSS 3D transformation support
$.support.css3d = supportsCSS3D();
var formContainer = $('#formContainer');
// Listening for clicks on the ribbon links
$('.flipLink').click(function(e){
// Flipping the forms
formContainer.toggleClass('flipped');
// If there is no CSS3 3D support, simply
// hide the login form (exposing the recover one)
if(!$.support.css3d){
$('#login').toggle();
}
e.preventDefault();
});
formContainer.find('form').submit(function(e){
// Preventing form submissions. If you implement
// a backend, you might want to remove this code
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){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

How can I change the out of Box text "Forgot Password?" and "Sign in"?

Lunexcode () - 8 years ago - Reply 0


can u help me convert my .php file to responsive, like yr snippet.

Siddharth Raja () - 10 years ago - Reply 0


Out of the box this doesn't work for me...it never hits the method that would cause the transition between the Login form and Recover Password form......

Brian Flynn () - 10 years ago - Reply 0


I suggest you to add a tooltip on hover of the triangle. Good job !

benjaminb10 () - 11 years ago - Reply 0