LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
CSS
@import url("https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css");
body {
  text-align: center;
  background-color: #e9e9e9;
}

.gradient, .login, .outer {
  background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHJhZGlhbEdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzdkOTU5NSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzI4MzMzNSIvPjwvcmFkaWFsR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
  background: -webkit-radial-gradient(#7d9595, #283335);
  background: radial-gradient(#7d9595, #283335);
  background-size: 360px 600px;
  background-position: center -90%;
}

.login {
  display: inline-block;
  width: 180px;
  height: 229px;
  padding: 30px 25px;
  margin: -180px -115px;
  position: absolute;
  top: 50%;
  left: 50%;
  text-align: left;
  font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
  border: 1px solid #5c5c5c;
  border-radius: 2px;
  box-shadow: rgba(0, 0, 0, 0.35) 0 2px 5px 1px;
  -webkit-transition: all 300ms;
  transition: all 300ms;
}
.login.pw-active {
  box-shadow: rgba(0, 0, 0, 0.35) 0 2px 5px 1px, inset 0 -148px 99px -64px rgba(0, 0, 0, 0.4);
}
.login:before {
  content: "";
  width: 100%;
  height: .1em;
  position: absolute;
  top: 0px;
  left: 0;
  background: -webkit-radial-gradient(center ellipse, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.16) 70%);
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.16) 70%);
  background-size: 100% 150%;
  background-position: center center;
}

.login .photo {
  width: 88px;
  height: 88px;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
  margin-top: 10%;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.7);
  box-shadow: 0 -2px 0px 2px rgba(255, 255, 255, 0.15), 0 2px 2px 2px rgba(0, 0, 0, 0.15), 0 -4px 20px 0px rgba(255, 255, 255, 0.4), 0 0px 140px 0px rgba(0, 120, 120, 0.8), 0 -45px 90px 0px rgba(255, 255, 255, 0.3), 0 4px 39px 0px rgba(0, 0, 0, 0.4);
}
.login .photo:before {
  content: '';
  width: 90px;
  height: 90px;
  position: absolute;
  border-radius: 50%;
}

.login .name {
  width: 100%;
  line-height: 1;
  cursor: pointer;
  text-align: center;
  font-size: 0.89em;
  color: white;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
  -webkit-transition: all 300ms ease;
  transition: all 300ms ease;
  position: absolute;
  left: 0;
  margin-top: 34px;
}

input {
  box-sizing: border-box;
  width: 100%;
  margin-top: 15px;
  padding: 5px 2px;
  font-size: 0.8em;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  box-shadow: rgba(0, 0, 0, 0.15) 0 1px 2px 0 inset, rgba(0, 0, 100, 0.3) 0 1px 0 0;
}
input:focus {
  outline: 0;
  border: 1px solid #77a7c0;
  box-shadow: rgba(20, 113, 184, 0.5) 0 0 3px 1px, rgba(20, 113, 184, 0.5) 0 0 2px 1px inset;
}
input::input-placeholder {
  color: rgba(20, 20, 20, 0.5);
}

.username-wrap {
  cursor: pointer;
}
.username-wrap:after {
  content: "\f18e";
  display: inline-block;
  font-smoothing: antialiased;
  font-family: "FontAwesome";
  position: absolute;
  right: 28px;
  top: 174px;
  color: rgba(40, 51, 53, 0.4);
  font-size: 1.25em;
}

.username {
  margin-bottom: 10px;
  margin-top: 30px;
  -webkit-transition: all 300ms ease;
  transition: all 300ms ease;
  display: block;
  opacity: 1;
}

.hidden {
  opacity: 0;
  -webkit-transition: all 300ms ease;
  transition: all 300ms ease;
  visibility: hidden;
}

.inner, .outer, .spine, .shadow {
  position: absolute;
  width: 100%;
  border-radius: 2px;
}

.inner:after, .outer:after {
  content: "\f023";
  top: 33%;
  left: 42%;
  font-size: 1em;
  line-height: 1.7em;
  padding: 0.125em;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  border: 1px solid white;
  position: absolute;
  font-smoothing: antialiased;
  font-family: 'FontAwesome';
  box-sizing: border-box;
}

.inner:after {
  content: "\f09c";
}

.inner {
  background-color: #283335;
  text-shadow: 0 -2px 4px rgba(0, 0, 0, 0.2);
  height: 100%;
  background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 100%);
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.spine {
  bottom: .05em;
  background: #282d2d;
  height: .05em;
  -webkit-transform: rotateX(90deg);
          transform: rotateX(90deg);
  -webkit-transform-origin: center top;
          transform-origin: center top;
}

.outer {
  height: 100%;
  background-position: center -129%;
  -webkit-transform: translateZ(0.05em);
          transform: translateZ(0.05em);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  -webkit-transition: 300ms all;
  transition: 300ms all;
}
.pw-active .outer {
  box-shadow: inset 0px -22px 1px -18px rgba(215, 255, 250, 0.3), inset 0px -99px 38px -41px rgba(195, 255, 250, 0.15);
}

.pw-box {
  height: 80px;
  width: 228px;
  background-color: rba(black, 0.9);
  position: absolute;
  left: 1px;
  padding: 10px;
  padding-top: 20px;
  -webkit-transition: all .55s ease;
  transition: all .55s ease;
  box-shadow: inset 0px 41px 7px 36px #001e1e;
  box-sizing: border-box;
  -webkit-perspective: 320px;
          perspective: 320px;
}
.pw-box:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  display: block;
  opacity: 0.5;
}
.pw-active .pw-box {
  background-color: rgba(225, 255, 250, 0.1);
  box-shadow: inset 0px 41px 7px -11px #001e1e, inset 0px 0px 3px 1px rgba(0, 30, 30, 0.35);
}
.pw-box .flap {
  position: absolute;
  color: white;
  text-align: center;
  pointer-events: none;
  z-index: 100;
  background-color: rgba(255, 0, 0, 0.3);
  width: 100%;
  height: 100%;
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  -webkit-transition: all 0.6s cubic-bezier(0.2, 0.7, 0.1, 1.1);
  transition: all 0.6s cubic-bezier(0.2, 0.7, 0.1, 1.1);
  -webkit-transform-origin: center top;
          transform-origin: center top;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
}
.pw-active .pw-box .flap {
  -webkit-transform: rotateX(70deg);
          transform: rotateX(70deg);
}

img {
  width: 88px;
  height: 88px;
}

.correct {
  -webkit-animation: correct 0.5s linear;
          animation: correct 0.5s linear;
}

@-webkit-keyframes correct {
  0% {
    background-color: #e9e9e9;
  }
  30% {
    background-color: #e9e9e9;
  }
  50% {
    background-color: lightgreen;
  }
  80% {
    background-color: lightgreen;
  }
  100% {
    background-color: #e9e9e9;
  }
}

@keyframes correct {
  0% {
    background-color: #e9e9e9;
  }
  30% {
    background-color: #e9e9e9;
  }
  50% {
    background-color: lightgreen;
  }
  80% {
    background-color: lightgreen;
  }
  100% {
    background-color: #e9e9e9;
  }
}
JS
$(document).ready(function() {
  var userInput = $('#username-input');
  var userWrap = $('.username-wrap');
  var user = $('#name');
  
  userInput.focus();
  
  function form() {
    ''.trim||(String.prototype.trim = function() {
      return userInput.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "")
    });
    
    var email = userInput.val();

    function update() {
      var url = "";

      hash = faultylabs.MD5(email.trim()s.toLowerCase());
      hash = hash.toLowerCase();
        
      url = "https://www.gravatar.com/avatar/" + hash + "?s=200";
        
      img = $('');
      img.attr("src", url);
    
      $('.photo').html(img);
    }

    update();
    
    if (userInput.val().length > 0) {
      user.text(email);
      userInput.addClass('hidden');
      userWrap.addClass('hidden');
      user.removeClass('hidden');
      user.parent().addClass('pw-active');
      $('.password').focus();
      return false;
    }
    else {
      alert("Please enter your email");
    };
  }

  userInput.keyup(function(event) {
    if (event.which == 13) {
      form()
    }
  });
  
  $('.username-wrap').click(function() {
    form();
  });
  
  user.click(function(event) {
    user.addClass('hidden');
    user.parent().removeClass('pw-active'); 
    userInput.removeClass('hidden');
    userWrap.removeClass('hidden');
  });
  
  $('.password').keyup(function(event) {
    if (event.which == 13) {
      var passwordVal = $('.password').val();
      if (passwordVal == "password") {
        $('body').addClass('correct');
      }
    };
  });
});
Host Instantly Drag and Drop Website Builder

 

Description

Learning about using Gravatar with the form that Hans Engebretsen made.
Term
Wed, 11/29/2017 - 11:26

Related Codes

Pen ID
Pen ID
Pen ID