cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <!-- Main content -->
<main role="main">
  <div class="mediahawkz-login">
    <div class="div-left"></div>
    <div class="div-right">
      <div class="rkmd-form login">
        <h2 class="form-title">Login</h2>
        <form id="login" action="" method="POST" onsubmit="return false;">
          <div class="form-field">
            <label class="field-label" for="emailid">Email ID</label>
            <input id="emailid" type="text" name="emailid" class="field-input">
            <i class="material-icons md-18">error_outline</i>
          </div>
          <div class="form-field">
            <label class="field-label" for="pass">Password</label>
            <input id="pass" type="password" name="pass" class="field-input">
            <i class="material-icons md-18">error_outline</i>
          </div>
          <div class="form-row">
            <div class="msg">
              <!-- <span class="error">We can't find that email address. Have you registered?.</span> -->
            </div>
          </div>
          <div class="form-row clearfix">
            <div class="remember float-left">
              <input type="checkbox" name="rem" id="rem">
              <label for="rem">Stay Signed in</label>
            </div>
            <button id="submit" class="rkmd-btn btn-lightBlue ripple-effect float-right">LOGIN</button>
          </div>
          <div class="form-row clearfix">
            <a href="#" data-tab="reset" class="link float-right toggle" onclick="return false;">Forgot your password?</a>
          </div>
        </form>
      </div>

      <div class="rkmd-form reset" style="display: none;">
        <h2 class="form-title">Reset password</h2>
        <form id="reset" action="" method="POST" onsubmit="return false;">
          <div class="form-row">
            <span class="default">You will receive a link to create a new password via email.</span>
          </div>
          <div class="form-field">
            <label class="field-label" for="emailid">Email ID</label>
            <input id="emailid" type="text" name="emailid" class="field-input">
            <i class="material-icons md-18">error_outline</i>
          </div>
          <div class="form-row">
            <div class="msg">
              <!-- <span class="error"></span> -->
            </div>
          </div>
          <div class="form-row clearfix">
            <button id="reset" class="rkmd-btn btn-lightBlue ripple-effect float-right">RESET PASSWORD</button>
          </div>
          <div class="form-row clearfix">
            <a href="#" data-tab="login" class="link float-right toggle" onclick="return false;">Login</a>
          </div>
        </form>
      </div>
      <div class="copyright">
        <p>&copy; 2016 <a href="http://www.mediahawkz.com" class="link">MediahawkZ.com</a> Made in India, Designed by <a href="https://twitter.com/rkchauhan01" target="_blank">Ravikumar Chauhan</a></p>
      </div>
    </div>
  </div>
</main>
            
          
!
            
              /* -----------------------------------------------------
  Material Design - Mediahawkz.com Login Form
  Form URL: http://www.mediahawkz.com/admin/login.php
  By: Ravikumar Chauhan
  Find me on -
  Twitter: https://twitter.com/rkchauhan01
  Facebook: https://www.facebook.com/ravi032chauhan
  GitHub: https://github.com/rkchauhan
  CodePen: https://codepen.io/rkchauhan
-------------------------------------------------------- */
// Colors
$color-white: #FFFFFF;
$color-lightBlue-500: #03a9f4;
$color-grey-1: #575757;
$color-grey-2: #f9f9f9;
$color-grey-3: #cdcdcd;
$color-grey-4: #6e6e6e;
$color-black-1: #2d2b2c;
$color-red-1: #f44336;

// KEYFRAMES
@mixin keyframes($animation-name) {
  @-webkit-keyframes #{$animation-name} {
    @content;
  }
  @-moz-keyframes #{$animation-name} {
    @content;
  }
  @-ms-keyframes #{$animation-name} {
    @content;
  }
  @-o-keyframes #{$animation-name} {
    @content;
  }
  @keyframes #{$animation-name} {
    @content;
  }
}

/* -----------------------------------------------------
  Body
-------------------------------------------------------- */
body {
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-family: 'Roboto', sans-serif;
}

*, *::after, *::before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -ms-box-sizing: border-box;
  -o-box-sizing: border-box;
  box-sizing: border-box;
}

a {
  color: $color-lightBlue-500;
  outline: none;
  text-decoration: none;

  &:hover { text-decoration: underline; }
}
.link {
  color: $color-grey-1;
  font-size: 14px;
}

.mediahawkz-login {
  position: fixed;
  top: 0px;
  left: 0px;
  right: 0px;
  bottom: 0px;
  width: auto;
  height: auto;
  background-color: $color-grey-2;

  .div-left {
    position: absolute;
    top: 0px;
    left: 0px;
    bottom: 0px;
    width: 50%;
    height: 100%;
    background-color: $color-black-1;
    background-image: url('http://mediahawkz.com/admin/assets/imgs/mediahawkz-black.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 50% 25%;
  }

  .div-right {
    overflow: auto;
    position: absolute;
    top: 0px;
    right: 0px;
    bottom: 0px;
    width: 50%;
    height: 100%;
  }

  .copyright {
    margin-top: 10%;
    text-align: center;
    p {
      color: $color-grey-1;
      font-size: 13px;
    }
  }
}

.float-left { float: left; }
.float-right { float: right; }

.clearfix { *zoom: 1; }
.clearfix::after {
  content: '';
  display: table;
  line-height: 0;
  clear: both
}

/* -----------------------------------------------------
   Material Design Buttons - by Ravikumar Chauhan
-------------------------------------------------------- */
.rkmd-btn {
  display: inline-block;
  position: relative;
  cursor: pointer;
  height: 35px;
  line-height: 35px;
  padding: 0 1.5rem;
  color: #424242;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Roboto', sans-serif;
  letter-spacing: .8px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
  outline: none;
  border: none;
  user-select: none;
  border-radius: 2px;
  transition: all .3s ease-out;

  &:hover { text-decoration: none; }

  &.btn-lightBlue {
    color: #FFF;
    background-color: #03a9f4;
    box-shadow: 0 2px 5px 0 rgba(0,0,0,0.225);

    &:hover {
      box-shadow: 0 2px 10px 0px rgba(0,0,0,0.275);
      background-color: lighten(#03a9f4, 8%);
    }
  }
}

.ripple-effect {
  display: inline-block;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  vertical-align: middle;
  user-select: none;
  z-index: 1;

  .ripple {
    display: block;
    position: absolute;
    border-radius: 100%;
    background: rgba(255,255,255,0.5);
    transform: scale(0);
    pointer-events: none;
  }

  .animated {
    animation: ripple 0.6s linear;
  }

  @include keyframes('ripple') {
    100% {
      opacity: 0;
      transform: scale(2.5);
    }
  }
}

/* -----------------------------------------------------
   Material Design Form - by Ravikumar Chauhan
-------------------------------------------------------- */
.rkmd-form {
  max-width: 355px;
  margin: 16% auto 0;

  .form-title {
    margin: 0;
    padding: 0;
    color: $color-lightBlue-500;
    font-size: 30px;
    font-weight: 300;
  }

  .form-row {
    display: block;
    margin-top: 0.925em;
  }

  .remember { margin-top: 6px; }

  .form-field {
    position: relative;
    height: 72px;
    margin-top: 1em;
    padding: 16px 0 8px 0px;

    i {
      display: none;
      margin-top: 5px;
      float: right;
    }

    &::after, &::before {
      content: '';
      position: absolute;
      left: 0px;
      bottom: 8px;
      width: 100%;
      height: 1px;
      background-color: $color-grey-3;
    }

    &::after {
      background-color: $color-lightBlue-500;
      transition: all 0.3s;
      transform: scaleX(0);
    }

    &.focused::after { transform: scaleX(1); }
  }

  .field-label {
    position: relative;
    display: block;
    color: $color-grey-1;
    font-size: 15px;
    line-height: 16px;
    transform: translateY(24px);
    transition: all 0.3s;
    transform-origin: 0 50%;
  }

  .field-input {
    position: relative;
    display: block;
    color: $color-grey-1;
    width: 100%;
    height: 32px;
    font-size: 15px;
    line-height: 16px;
    margin: 0;
    padding: 4px 0;
    border: none;
    outline: none;
    background-color: transparent;
  }

  .has-label .field-label {
    transform: translateY(0) scale(0.85);
  }
  .focused .field-label {
    color: $color-lightBlue-500;
  }

  input[type="checkbox"] + label:before {
    display: inline-block;
    width: 1em;
    color: $color-grey-4;
    margin: 0 10px 0 0;
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    vertical-align: -6px;
    transition: transform 0.1s ease;

    /* Support for all WebKit browsers. */
    -webkit-font-smoothing: antialiased;
    /* Support for Safari and Chrome. */
    text-rendering: optimizeLegibility;

    /* Support for Firefox. */
    -moz-osx-font-smoothing: grayscale;

    /* Support for IE. */
    font-feature-settings: 'liga';
  }

  input[type="checkbox"] {
    position: absolute;
    visibility: hidden;

    & + label {
      cursor: pointer;
      color: $color-grey-1;

      &:before { content: "\e835"; }
    }

    &:checked + label:before { content: "\e834"; color: $color-lightBlue-500; }

    &:active:not(:disabled) + label:before { transform: scale3d(0.88, 0.88, 1); }

    &:disabled + label:before {
      content: "\e909";
      cursor: not-allowed;
      color: rgba(0,0,0,0.157);
    }
  }

  .form-field[error] {
    &::after, &::before {
      background-color: $color-red-1 !important;
    }
    .field-label { color: $color-red-1 !important; }
    i {
      display: block;
      color: $color-red-1 !important;
    }
  }

  .msg { min-height: 20px; }
  .error {
    display: block;
    margin: 0;
    padding: 0;
    color: $color-red-1 !important;
    font-size: 14px;
  }

  .default {
    color: $color-grey-1 !important;
    font-size: 14px;
  }
}
            
          
!
            
              $(document).ready(function() {
  $('.rkmd-form').rkmd_form();
  $('.ripple-effect').rkmd_rippleEffect();
});

(function($) {
  $.fn.rkmd_form = function() {
    var self, formField, formInput;

    self = $(this);
    formField = self.find('.form-field');
    formInput = self.find('.field-input');

    formInput.on('focus', function() {
      $(this).parent().addClass('focused has-label');
    });
    formInput.on('blur', function() {
      if($(this).val() == '') {
        $(this).parent().removeClass('has-label');
      }
      $(this).parent().removeClass('focused');
    });
    formInput.each(function() {
      self = $(this);
      if(self.val().length > 0) {
        self.parent().addClass('has-label');
      }
    });
  };

  $.fn.rkmd_rippleEffect = function() {
    var btn, self, ripple, size, rippleX, rippleY, eWidth, eHeight;

    btn = $(this).not('[disabled], .disabled');

    btn.on('mousedown', function(e) {
      self = $(this);
      if(e.button === 2) {
        return false;
      }
      if(self.find('.ripple').length === 0) {
        self.prepend('<span class="ripple"></span>');
      }
      ripple = self.find('.ripple');
      ripple.removeClass('animated');

      eWidth = self.outerWidth();
      eHeight = self.outerHeight();
      size = Math.max(eWidth, eHeight);
      ripple.css({'width': size, 'height': size});

      rippleX = e.clientX - self.offset().left - size / 2;
      rippleY = e.clientY - self.offset().top - size / 2;

      ripple.css({ 'top': rippleY +'px', 'left': rippleX +'px' });
      ripple.addClass('animated');
    });
  };
}(jQuery));

$('#submit').on('click', function() {
  var form = $('#login');
  var emailid = form.find('#emailid');
  var pass = form.find('#pass');

  if(emailid.val() == '') {
    emailid.parent().attr('error', '');
  } else {
    emailid.parent().removeAttr('error');
  }
  if(pass.val() == '') {
    pass.parent().attr('error', '');
  } else {
    pass.parent().removeAttr('error');
  }
});

$('#reset').on('click', function() {
  var form = $('#reset');
  var emailid = form.find('#emailid');

  if(emailid.val() == '') {
    emailid.parent().attr('error', '');
  } else {
    emailid.parent().removeAttr('error');
  }
});

$('.toggle').on('click', function() {
  var tab = $(this).data('tab');
  var parents = $(this).parents('.rkmd-form').hide();
  $('.' + tab).show();
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console