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

              
                	<section id="hire">
    <h1>Contact Me</h1>
    
    <form>
	      <div class="field name-box">
		        <input type="text" id="name" placeholder="Who Are You?"/>
        		<label for="name">Name</label>
		        <span class="ss-icon">check</span>
	      </div>

	      <div class="field email-box">
		        <input type="text" id="email" placeholder="name@email.com"/>
		        <label for="email">Email</label>
		        <span class="ss-icon">check</span>
	      </div>

	      <div class="field msg-box">
		        <textarea id="msg" rows="4" placeholder="Your message goes here..."/></textarea>
		        <label for="msg">Msg</label>
		        <span class="ss-icon">check</span>
	      </div>

	      <input class="button" type="submit" value="Send" />
  </form>
</section>
              
            
!

CSS

              
                // Grid
@mixin grid($column) {
	  width:(100% / 12) * $column;
	  margin:0 auto;
}

// Transition Ease
@mixin ease($time:333ms, $attr:all, $curve:ease-in-out) {
	  -webkit-transition: $attr $time $curve;
	  -moz-transition: $attr $time $curve;
	  -o-transition: $attr $time $curve;
	  -ms-transition: $attr $time $curve;
	  transition: $attr $time $curve;
}

//-- Lato --//
@mixin lato-1 {font-family: 'Lato', sans-serif; font-weight:100;}
@mixin lato-1-i {@include lato-1; font-style:italic;}

@mixin lato-3 {font-family: 'Lato', sans-serif; font-weight:300;}
@mixin lato-3-i {@include lato-3; font-style:italic;}

@mixin lato-4 {font-family: 'Lato', sans-serif; font-weight:400;}
@mixin lato-4-i {@include lato-4; font-style:italic;}

@mixin lato-7 {font-family: 'Lato', sans-serif; font-weight:700;}
@mixin lato-7-i {@include lato-7; font-style:italic;}

@mixin lato-9 {font-family: 'Lato', sans-serif; font-weight:900;}
@mixin lato-9-i {@include lato-9; font-style:italic;}


// Colors
$blue:#313A3D;
$orange:#FD9638;
$dark-orange:darken($orange, 20%);
$grey:#B6B6B6;
$light-grey:lighten($grey, 15%);

$background:#efefef;
$field-color:#E8E9EA;





body {
	  background:$background;
	  font-size:62.5%;
	  @include lato-3;
	  color:$grey;

  section {
	    background:white;
    margin:60px auto 120px;
    border-top:15px solid $blue;
    text-align:center;
  	  padding:50px 0 110px;
    width:80%;
    max-width:1100px;
    
    h1 {
      margin-bottom:40px;
      font-size:4em;
      text-transform:uppercase;
      @include lato-1;
    }
  }
}

// Form
form {
		  @include grid(7);

		  .field {
			    width:100%;
			    position:relative;
			    margin-bottom:15px;

    			$hover-label-width:18%;
			    $placeholder-bumper:1.5%;
			    $label-padding:18px;

    			// Label
			    label {
				      text-transform: uppercase;
				      position:absolute;
				      top:0;
				      left:0;
				      background:$blue;
				      width:100%;
				      padding:($label-padding + 0px) 0;
				      font-size: 1.45em;
				      letter-spacing: 0.075em;

				      @include ease(333ms);

				      // Checkmark
				      + span {
					        font-family: 'SSStandard';
					        opacity: 0;
					        color:white;
				        	display: block;
					        position:absolute;
					        top: 12px;
					        left: 7%;
					        font-size: 2.5em;
					        text-shadow:1px 2px 0 $dark-orange;

					        @include ease(333ms);
			      	}
			    }

    			// Fields
		    	input[type="text"],
			    textarea {
				      border:none;
				      background:$field-color;
				      width:100% - $hover-label-width - $placeholder-bumper;
				      margin:0;
				      padding:$label-padding 0;
				      padding-left:$hover-label-width + $placeholder-bumper;
				      color:$blue;
				      font-size: 1.4em;
				      letter-spacing: 0.05em;
				      text-transform: uppercase;

				      &#msg {
					        height: 18px;
					        resize: none;
					        @include ease(333ms);
				      }

      				// Focus and JS Toggle Class
				      &:focus,
				      &.focused {
					        outline:none;

        					&#msg {
						          padding-bottom:150px;
					        }

        					+ label {
						          width:$hover-label-width;
						          background:$orange;
						          color:$blue;
					        }
				      }

      				// JS Toggle Class
				      &.focused {
					        + label {
						          color: $orange;
					        }
				      }
			    }

    			// Field Hover
			    &:hover {
				      label {
					        width:$hover-label-width;
					        background:$blue;
					        color:white;
				      }
			    }
		  }

		  // Submit Button
		  input[type="submit"] {
			    background:$orange;
			    color:white;
			    -webkit-appearance: none;
			    border: none;
			    text-transform: uppercase;
    position:relative;
		    padding: 13px 50px;
		    font-size: 1.4em;
		    letter-spacing: 0.1em;
		    @include lato-3;
		    @include ease;
        
    			&:hover {
				      background:$blue;
				      color:$orange;
			    }

    			&:focus {
				      outline:none;
				      background:$dark-orange;
			    }
		  }
	}
              
            
!

JS

              
                // Input Lock
$('textarea').blur(function () {
    $('#hire textarea').each(function () {
        $this = $(this);
        if ( this.value != '' ) {
          $this.addClass('focused');
          $('textarea + label + span').css({'opacity': 1});
        }
        else {
          $this.removeClass('focused');
          $('textarea + label + span').css({'opacity': 0});
        }
    });
});

$('#hire .field:first-child input').blur(function () {
    $('#hire .field:first-child input').each(function () {
        $this = $(this);
        if ( this.value != '' ) {
          $this.addClass('focused');
          $('.field:first-child input + label + span').css({'opacity': 1});
        }
        else {
          $this.removeClass('focused');
          $('.field:first-child input + label + span').css({'opacity': 0});
        }
    });
});

$('#hire .field:nth-child(2) input').blur(function () {
    $('#hire .field:nth-child(2) input').each(function () {
        $this = $(this);
        if ( this.value != '' ) {
          $this.addClass('focused');
          $('.field:nth-child(2) input + label + span').css({'opacity': 1});
        }
        else {
          $this.removeClass('focused');
          $('.field:nth-child(2) input + label + span').css({'opacity': 0});
        }
    });
});
              
            
!
999px

Console