LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
CSS
@import url(https://fonts.googleapis.com/css?family=Space+Mono:400,700);

body, html {
  background-color: #00D9C0; 
  background-image: linear-gradient(to right, hsla(0,0%,0%,0.05) 50%, transparent 0);
  background-size: 120px 100%;
  background-position: center center;
  font-family: "Space Mono";
  font-weight:400;
  color: #555;
  height:100%;
}

* {margin:0;padding:0;border:0;}

.container {
  position:absolute;
  top: 50%;
  left:50%;
  transform: translate(-50%, -50%);
}

.login {
  width:400px;
  transition: all 0.2s ease-out;
  position: relative;
  border-radius: 2px;
  background: hsla(0,0%,90%, 1);
  box-shadow: 0 10px 10px -10px hsla(0,0%,0%,0.2); 
}

.login__form {
  background:white;
  padding: 3em 3em 4em 3em;
  transition: all 0.2s ease-out;
}

.login:hover {
  transform: scale(1.05);
  box-shadow: 0 40px 10px -20px hsla(0,0%,0%,0.1); 
}

.login__iframe {
  display:none;
  position: relative;
  z-index: 0;
  width:100%;
  height:300px;
}

.login__title {
  margin-bottom: 2em;
  font-size: 1.2em;
  color: #FF4365;
}

.login__title--grey {
  color: #bbb;
  font-size: 0.8em;
}

input {
  outline: none;
  font-family: "Space Mono";
  font-size: 1em;
  display:block;
  padding: 1em 1.5em;
  margin-bottom: 1em;
  background:rgb(245,245,245);
}

button {font-family: "Space Mono";}

input[type=text], input[type=password] {
  border: 1px dashed transparent;
  transition: all  0.2s ease-out;
  box-sizing: border-box;
  border-radius: 6px;
  color: #bbb;
  width:100%;
}

input[type=text]:hover, input[type=password]:hover {
  border:1px dashed #FF4365;
}

input[type=text]:focus, input[type=password]:focus {
  border:1px dashed #FF4365;
  color:#FF4365;
}

.login__hi {font-size:1.2em;}

.login__button {
  cursor:pointer;
  overflow:hidden;
  text-align:left;
  transition: all  0.1s ease-out;
  box-sizing: border-box;
  position: absolute;
  background: #FF4365;
  color:white;
  margin:0;
  height: 3em;
  width: 3em;
  border-radius: 50%;
  bottom: -1.5em;
  left: 50%;
  margin-left:-1.5em;
}

.login__button--conf {
  cursor:pointer;
  transition: all  0.2s ease-in;
  font-size:0.8em;
  border-radius: 6px;
  letter-spacing: 5px;
  font-weight:bold;
  background: none;
  color:white;
  margin: 2em 0;
  border: 1px solid white;
  padding: 1em 3em;
}

.login__button--conf:hover {
  background:white;
  color:#63D471;
}

.login__small {
  font-size: 0.8em;
}


.login__abort {
  color:white;
}

.login__button:before {
  content:'';
  display: inline-block;
  height:100%;
  width:0;
  margin:0;
  padding:0;
  vertical-align:middle;
}

.login .login__button:hover {
  background: #FF638A;
}

.login[data-state=''] .login__button {
  transition: all 0.4s 0.3s cubic-bezier(.4,0,.2,1);
}

.login[data-state=''] .login__button:hover {
  transform: scale(1.2);
}

.login[data-state=loadingPrepare] .login__button {
  transition: all 0.2s cubic-bezier(.49,.09,.86,.77);
  left:0; 
}

.login[data-state=loadingStart] .login__button {
  transition: all 0.4s cubic-bezier(.76,-0.9,.2,1);
  left:0; 
  bottom: 0;
  width: 0;
  margin-left:0;
  height: 2px;
}

.login[data-state=loading] .login__button {
  transition: all 0.6s cubic-bezier(.7,.01,.26,.92);
  left:0; 
  bottom: 0;
  border-radius:0;
  margin-left:0;
  width: 100%;
  height: 2px;
}

.login[data-state=loadingPrepare] .login__form,
.login[data-state=loadingStart] .login__form,
.login[data-state=loading] .login__form,
 .login[data-state=loadingEnd] .login__form {
  opacity:0.5;
}

.login[data-state=loadingEnd] .login__button,
.login[data-state=loadingEndOk] .login__button,
.login[data-state=loadingEndKo] .login__button {
  transition: all  0.4s cubic-bezier(.7,.01,.26,.92);
  left:0%; 
  margin-left:0;
  bottom: 0;
  border-radius:0;
  width: 100%;
  height: 100%;
  border-radius:0;
}

.login[data-state=loadingEndOk] .login__button {
  background: #63D471;
}

.login__icon {
  display:inline-block;
  width:100%;
  margin: 0 auto;
  vertical-align:middle;
  text-align:center;
}



.icon--ok,
.icon--exit,
.login[data-state=loadingEnd] .login__icon,
.login[data-state=loadingStart] .login__icon,
.login[data-state=loading] .login__icon,
.login[data-state=loadingEndOk] .icon--enter,
.login[data-state=loadingEndKo] .icon--enter {display:none;}

.login[data-state=loadingEnd] .icon--ok {
  opacity:0;
  display:inline-block;
}

.login[data-state=loadingEndOk] .icon--ok {
  transition: all 0.4s ease-in;
  opacity:1;
  display:inline-block;
}

.login[data-state=loadingEndKo] .icon--ko {
  transition: all 0.4s ease-in;
  opacity:1;
  display:inline-block;
}

.login[data-state=loadingEndOk] .login__icon i {
  font-size:5em;
  vertical-align:middle;
}


.login[data-state=loadingAccess] .login__form {
  display:none;
}


.login[data-state=loadingAccess] .login__iframe {
  display:block;
}

.login[data-state=loadingAccess] {
  width:1024px;
  height:100%;
}

.login[data-state=loadingAccess] .login__button {
  transition: all 0.3s ease-out;
  bottom: 100%;
  left:100%;
  margin-left:-6em;
  transform: translateY(50%);
}

.login[data-state=loadingAccess] .icon--ok,
.login[data-state=loadingAccess] .icon--enter,
.login[data-state=loadingAccess] .icon--ko {
  display:none;
}

.login[data-state=loadingAccess]  .icon--exit {display:inline-block;}
JS
(function(){
 
  var $pane = $('.login'),
      $btn = $pane.find('.login__button'),
      $icon = $pane.find('.icon');
  
  
      
      $btn.click(function(event){
        
        if ($pane.attr('data-state') === '') {
            
            var name = $('input[type=text]').val();
            var psw = $('input[type=password]').val();  
            
            
            event.preventDefault();
            $pane.attr('data-state', 'loadingPrepare');
            setTimeout(function(){
              $pane.attr('data-state', 'loadingStart'); 
            }, 200);
            setTimeout(function(){
              $pane.attr('data-state', 'loading'); 
            }, 700);
            setTimeout(function(){
              $pane.attr('data-state', 'loadingEnd'); 
            }, 1250);
            setTimeout(function(){
              
              if(name === 'admin' && psw === 'password') {
                
                $pane.attr('data-state', 'loadingEndOk'); 
                
                $('.login__hi').text('Hello, ' + name);
                
                $('.login__button--conf.OK').click(function(event){
                  event.preventDefault();
                  event.stopPropagation();
                  $pane.attr('data-state', 'loadingAccess');
                  $('.login__hi').text('');
                });
                
              } else {
                $pane.attr('data-state', 'loadingEndKo'); 
                $('.login__button--conf.KO').click(function(event){
                  event.preventDefault();
                  event.stopPropagation();
                  $pane.attr('data-state', '');
                });
              }

            }, 1300);
          
    
          }  else  {

            event.preventDefault();
            $pane.attr('data-state', '');
            
          }  
      });
  

  
})();
Host Instantly Drag and Drop Website Builder

 

Description

Simple flat login module with fancy interactions.
Term
Wed, 11/29/2017 - 11:20

Related Codes

Pen ID
Pen ID
Pen ID