123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              	<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>
            
          
!
            
              // 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;
			    }
		  }
	}
            
          
!
            
              // 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
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console