Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container" >
  <h1>Urpinion</h1>
  <h2>Create a new account</h2>
  <form class="form" action="#">
    
    <fieldset class="form-fieldset ui-input __first">
      <input type="text" id="username" tabindex="0" />
      <label for="username">
        <span data-text="Username">Username</span>
      </label>
    </fieldset>
    
    <fieldset class="form-fieldset ui-input __second">
      <input type="email" id="email" tabindex="0" />
      <label for="email">
        <span data-text="E-mail Address">E-mail Address</span>
      </label>
    </fieldset>
    
    <fieldset class="form-fieldset ui-input __third">
      <input type="password" id="new-password" />
      <label for="new-password">
        <span data-text="New Password">New Password</span>
      </label>
    </fieldset>
    
    <fieldset class="form-fieldset ui-input __fourth">
      <input type="password" id="repeat-new-password" />
      <label for="repeat-new-password">
        <span data-text="Repeat New Password">Repeat New Password</span>
      </label>
    </fieldset>
    
    <div class="form-footer">
      <button class="btn">Create Account</button>
    </div>
  </form>
</div>
              
            
!

CSS

              
                @import "bourbon";

$bezier: cubic-bezier(0.215, 0.610, 0.355, 1.000);
$time: 300ms;

$base-font-family: "Avenir Next", "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif;

@mixin animated(
  $time: 300ms,
  $fillmode: both,
  $count: 1) {
  animation-duration: $time;
  animation-fill-mode: $fillmode;
  animation-iteration-count: $count;
}

body {
  background-color: #363E4A;
  font-family: $base-font-family;
  font-size: 16px;
  color: #ffffff;
  line-height: 1.5;
}

h1 {
  font-family: "Texta", $base-font-family;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
}

h2 {
  font-weight: 400;
  font-size: 24px;
  color: rgba(255, 255, 255, .4);
}

.container {
  max-width: 320px;
  margin: 0 auto;
  padding: 20px 16px 40px 16px;
  transform: translateZ(0);
  text-align: center;
}

.form-footer {
  margin-top: 2em;
}

.ui-input {
  position: relative;
  padding: 0;
  border: 0;
}

.ui-input input {
  font-family: $base-font-family;
  border: 0;
  background: none;
  padding: 16px 0 16px 0;
  font-size: 24px;
  outline: 0;
  width: 100%;
  tap-highlight-color: rgba(0,0,0,0);
  touch-callout: none;
}

.ui-input input + label {
  position: relative;
  display: block;
  padding: 8px 0 8px 0;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: .0875em;
  font-weight: 500;
  text-align: left;
  
  &::before, &::after {
    position: absolute;
    top: 0;
    left: 0;
    content: "";
    width: 100%;
    height: 1px;
  }
  
  &::before {
    background-color: rgba(255, 255, 255, .2);
  }
  
  &::after {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform $time $bezier;
    background-color: #6EB1FF;
    height: 2px;
  }
  
  span {
    position: relative;
    color: rgba(255, 255, 255, .2);
    transition: color $time $bezier;
   
    &::after {
      content: attr(data-text);
      position: absolute;
      overflow: hidden;
      left: 0;
      transform: scaleX(1);
      white-space: nowrap;
      color: #fff;
      
      background-image: linear-gradient(to right,
          #4A90E2 50%,
          rgba(255,255,255,0) 0%);
      background-position: 100% 50%;
      background-size: 200%;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      
      backface-visibility: hidden;
      perspective: 1000;
      transform: translateZ(0);
      
      transition: background-position $time $bezier;
    }
  }
}

.ui-input input:focus,
.ui-input input.error,
.ui-input input:invalid,
.ui-input input.filled {
  
  & + label {
    
    &::after {
      transform: scaleX(1);
      transform-origin: left;
    }
    
    span::after {
      //color: #4A90E2;
      background-image: linear-gradient(to right,
      rgba(255,255,255,1) 50%,
      rgba(255,255,255,0) 0%);
      background-position: 0% 50%;
    }
  }
}

.ui-input input.filled {
  color: #ffffff;
  
  & + label {
    
    &::after {
      background-color: #ffffff;
    }
    
    span::after {
      background-image: linear-gradient(to right,
        #ffffff 50%,
        rgba(255,255,255,0) 0%);
      background-position: 0% 50%;
    }
  }
}

.ui-input input:focus {
  color: #6EB1FF;
  
  & + label {
    
    &::after {
      background-color: #6EB1FF;
    }
    
    span::after {
      background-image: linear-gradient(to right,
        #6EB1FF 50%,
        rgba(255,255,255,0) 0%);
      background-position: 0% 50%;
    }
  }
}

.ui-input input.error,
.ui-input input:invalid {
  color: #E66161;
  
  & + label {
    
    &::after {
      background-color: #E66161;
    }
    
    span::after {
      background-image: linear-gradient(to right,
        #E66161 50%,
        rgba(255,255,255,0) 0%);
      background-position: 0% 50%;
    }
  }
}

.btn {
  border: 0;
  background-color: #50617A;
  padding: 18px 30px;
  font-size: 14px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: .0875em;
  font-weight: 500;
  color: #ffffff;
  font-family: $base-font-family;
  border-radius: 100px;
  outline: 0;
  transition: background-color $time $bezier,
              color $time $bezier;
}

.btn:focus,.btn:active,
.btn:hover {
  background-color: #6EB1FF;
  color: white;
}

.__first, .__second, .__third, .__fourth {
  animation-name: fadeIn;
  animation-duration: 180ms;
  animation-fill-mode: both;
  animation-iteration-count: 1;
}

.__first { animation-delay: 0; }
.__second { animation-delay: 80ms; }
.__third { animation-delay: 180ms; }
.__fourth { animation-delay: 360ms; }

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate3d(0, -25%, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
              
            
!

JS

              
                var $input = $('.form-fieldset > input');

$input.blur(function (e) {
  $(this).toggleClass('filled', !!$(this).val());
});
              
            
!
999px

Console