cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <div class="container">
  <div class="row">
    <h2 id="title">Input...we need input...</h2>
  </div>
  <div class="row">
    <form>
      <div class="question-wrapper col-sm-6">
        <label for="fname">First Name</label>
      <input type="text" name="fname" required/>
    
      </div>
      <div class="question-wrapper col-sm-6">
        <label for="lname">Last Name</label>
      <input type="text" name="lname" required/>
   
      </div>
      <div class="question-wrapper col-sm-12">
        <label for="address">Address</label>
      <input type="text" name="address" required/>
    
      </div>
      <div class="question-wrapper col-sm-6">
        <label for="phone">Phone</label>
          <input type="text" name="phone" required/>
    
      </div>
      <div class="question-wrapper col-sm-6">
        <label for="email">Email</label>
          <input type="email" name="email" required/>
    
      </div>
      <div class="question-wrapper col-sm-4">
        <label for="twitter">Twitter <span class="label-light">(optional)</span></label>
          <input type="text" name="twitter" />
    
      </div>
      <div class="question-wrapper col-sm-4">
        <label for="facebook">Facebook <span class="label-light">(optional)</span>
        </label>
          <input type="text" name="facebook"/>

      </div>
      <div class="question-wrapper col-sm-4">
        <label for="linkedin" >LinkedIn <span class="label-light">(optional)</span></label>
          <input type="text" name="linkedin" />
    
      </div>
      <input id="submit" type="submit" />
    </form>

  </div>
  <!-- .row -->
</div>
<!-- .container -->
            
          
!
            
              .container {
  border-radius: 5px;
  max-width: 600px;
  position: relative;
  margin-top: 20px;
  background: #3F51B5;
}

#title {
  color: white;
  padding-left: 20px;
}

.question-wrapper {
  display: block;
  padding: 5px;
  border: 1px solid #BDBDBD;
  background: white;
}

form {
  padding: 20px 20px 60px;
  overflow: auto;
}

label {
  display: block;
  max-width: 100%;
  margin-bottom: 0;
  color: #757575;
  margin-right: 10px;
  margin-bottom: 5px;
  font-weight: 500;
}

.label-light {
  font-size: 0.8em;
}

input {
  width: 100%;
  padding: 0;
  font-family: 'Open Sans', serif;
  margin-bottom: 2px;
  border: none;
  font-size: 1.2em;
  color: #212121;
}

input:focus {
  outline: none;
}

input:active {
  outline: none;
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px white inset;
}

#submit {
  position: absolute;
  background: #FF5722;
  opacity: 1;
  width: 150px;
  padding: 10px;
  border-radius: 10px;
  bottom: -20px;
  right: 10px;
  color: white;
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
}
            
          
!
            
              var submit = document.getElementById('submit');
var inputs = $('.question-wrapper').find(':input[required]');

var allFilledIn = debounce(function(){
  var filled = true;

  inputs.each(function(i, val) {
      if ($(val).val().length <= 0) {
      filled = false;
    }
  })
  if (filled){
    TweenMax.to(submit, 0.5, {
      opacity: 1,
      width: '50%',
      left: '25%'
    })
  }
  },250); 

$('input').focus(function() {
  $(this).closest('.question-wrapper')
    .find('label')
    .css({
      color: '#232323'
    })
}).blur(function() {
  $(this).closest('.question-wrapper')
    .find('label')
    .css({
      color: '#797979'
    })
}).keyup(
  allFilledIn
);

$('.question-wrapper').click(function() {
  $(this).find('input').focus();
})

//https://davidwalsh.name/essential-javascript-functions
function debounce(func, wait, immediate) {
	var timeout;
	return function() {
		var context = this, args = arguments;
		var later = function() {
			timeout = null;
			if (!immediate) func.apply(context, args);
		};
		var callNow = immediate && !timeout;
		clearTimeout(timeout);
		timeout = setTimeout(later, wait);
		if (callNow) func.apply(context, args);
	};
};
            
          
!
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.
Loading ..................

Console