LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

Login form fadeIn/fadeOut

Forgot your password?
CSS
@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,700);

*, *:before, *:after{
  margin:0;
  padding:0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

body{
  background:#202020;
  font-family: "Roboto";
}

.container {
  width: 350px;
  margin: auto;
  margin-top: 3em;
  text-align: center;
}

.container h2{
  color: #eee;
  display: inline-block;
  position: relative;
  padding: 0.2em;
  margin: auto;
  margin-bottom: 1.5em;
}

.container h2:before{
  content: '';
  background: #eee;
  position: absolute;
  margin: auto;
  width: 70%;
  height: 1px;
  bottom: 0;
  left: 0;
  right: 0;
}

input[type="email"],input[type="password"]{
  color: #555;
  background: #bdc3c7;
  width: 100%;
  padding: 0.8em;
  margin-bottom: 1em;
  font-size: 1em;
  border: 1px solid #777;
  -webkit-border-radius: 2px;
  -moz-border-radius: 2px;
  border-radius: 2px;
}

#forgot-password{
  color: #a1a1a1;
  font-size: 0.85em;
  text-decoration: none;
  -webkit-transition: color .3s ease;
  transition: color .3s ease;
}

#forgot-password:hover{
  color: #d1d1d1;
}

button[type="submit"]{
  color:#fff;
  background: #f39c12;
  width: 100%;
  padding: 0.5em;
  margin-top: 1em;
  font-size: 1.5em;
  cursor: pointer;
  border: 0;
  -webkit-transition: background .4s ease;
  -moz-transition: background .4s ease;
  transition: background .4s ease;
}

button[type="submit"]:hover{
  background: #27ae60;
}
JS
// hide password input, forgot password and button submit
$('#password').hide();
$('#btn-submit').hide();
$('#forgot-password').hide();

$('#email').keyup(function () {
  // if email input is not empty fadeIn password input
  if($(this).val() !== ''){
    $('#password').fadeIn(500);
    $('#forgot-password').fadeIn(500);
  }
  else if ($('#btn-submit').is(":visible")){
    $('#btn-submit').fadeOut(500);
    $('#password').delay(500).fadeOut(500);
    $('#forgot-password').delay(500).fadeOut(500);
  }
  else{
    $('#password').fadeOut(500);
    $('#forgot-password').fadeOut(500);
  }
});

$('#password').keyup(function () {
  // if password input is not empty fadeIn submit button
  if($(this).val() !== ''){
    $('#btn-submit').fadeIn(500);
  }
  else{
    $('#btn-submit').fadeOut(500);
  }
});
Host Instantly Drag and Drop Website Builder

 

Term
Wed, 11/29/2017 - 11:26

Related Codes

Pen ID
Pen ID
Pen ID