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.

            
              <!-- multistep form -->
<form class="msform" method="post">
	<!-- progressbar -->
	<ul class="progressbar">
		<li class="active">Über Dich</li>
		<li>Fragen</li>
		<li>Spamschutz</li>
	</ul>
	<!-- fieldsets -->
	<fieldset data-check-id="1">
		<h2 class="fs-title">Zu Deiner Person</h2>
		<h3 class="fs-subtitle">This is step 1</h3>
		<input name="name" placeholder="Name">
		<input type="email" name="email" placeholder="Email">
		<input type="button" name="next" class="next action-button" value="Weiter">
	</fieldset>
	<fieldset data-check-id="2">
		<h2 class="fs-title">Fragen zum Thema</h2>
		<h3 class="fs-subtitle">Bitte antworte spontan</h3>
		<input name="q1" placeholder="Was denkst Du zu Twitter">
		<input name="q2" placeholder="Was denkst Du zu Facebook">
		<input name="q3" placeholder="Was denkst Du zu Google Plus">
		<input type="button" name="previous" class="previous action-button" value="Zurück">
		<input type="button" name="next" class="next action-button" value="Weiter">
	</fieldset>
	<fieldset data-check-id="3">
		<h2 class="fs-title">Spamschutz</h2>
		<h3 class="fs-subtitle">Gleich geschafft! (:</h3>
		<input class="vtcha-spamschutz">
		<input type="button" name="previous" class="previous action-button" value="Zurück" />
		<input type="submit" name="submit" class="submit action-button" value="Absenden" />
	</fieldset>
</form>

<!-- jQuery -->
<script src="http://thecodeplayer.com/uploads/js/jquery-1.9.1.min.js" type="text/javascript"></script><!-- -->
<!-- jQuery easing plugin -->
<script src="http://thecodeplayer.com/uploads/js/jquery.easing.min.js" type="text/javascript"></script>
            
          
!
            
              /*custom font*/
@import url(https://fonts.googleapis.com/css?family=Montserrat);

/*basic reset*/
* {margin: 0; padding: 0;}

html {
	height: 100%;
	background-color: rgb(64,64,64);
}

body {
	font-family: montserrat, arial, verdana;
}
/*form styles*/
.msform {
	width: 400px;
	margin: 50px auto;
	text-align: center;
	position: relative;
}
.msform fieldset {
	background: white;
	border: 0 none;
	border-radius: 3px;
	box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4);
	padding: 20px 30px;
	
	box-sizing: border-box;
	width: 80%;
	margin: 0 10%;
	
	/*stacking fieldsets above each other*/
	position: absolute;
}
/*Hide all except first fieldset*/
.msform fieldset:not(:first-of-type) {
	display: none;
}
/*inputs*/
.msform input, .msform textarea {
	padding: 15px;
	border: 1px solid rgba(0,0,0, .05);
	border-radius: 3px;
	margin-bottom: 10px;
	width: 100%;
	box-sizing: border-box;
	font-family: montserrat;
	color: #2C3E50;
	font-size: 13px;
}
.msform input.error, .msform textarea.error{
	border-color: rgb(255,99,71);
}
/*buttons*/
.msform .action-button {
	width: 100px;
	background: rgb(64,64,64);
	font-weight: bold;
	color: white;
	border: 0 none;
	border-radius: 2px;
	cursor: pointer;
	padding: 10px 5px;
	margin: 10px 5px;
	transition: all .4s;
}
.msform .action-button:hover, .msform .action-button:focus {
	box-shadow: 0 0 0 2px white, 0 0 0 3px rgb(255,99,71);
	background-color: rgb(255,99,71);
}
/*headings*/
.fs-title {
	font-size: 15px;
	text-transform: uppercase;
	color: #2C3E50;
	margin-bottom: 10px;
}
.fs-subtitle {
	font-weight: normal;
	font-size: 13px;
	color: #666;
	margin-bottom: 20px;
}
/*progressbar*/
.progressbar {
	overflow: hidden;
	/*CSS counters to number the steps*/
	counter-reset: step;
	width: 60%;
	margin: 0 auto 30px;
}
.progressbar li {
	list-style-type: none;
	color: white;
	text-transform: uppercase;
	font-size: 9px;
	width: 33.33%;
	float: left;
	position: relative;
}
.progressbar li:before {
	content: counter(step);
	counter-increment: step;
	width: 20px;
	line-height: 20px;
	display: block;
	font-size: 10px;
	color: #333;
	background: white;
	border-radius: 50%;
	margin: 0 auto 5px auto;
}
/*progressbar connectors*/
.progressbar li:after {
	content: '';
	width: 100%;
	height: 2px;
	background: white;
	position: absolute;
	left: -50%;
	top: 9px;
	z-index: -1; /*put it behind the numbers*/
}
.progressbar li:first-child:after {
	/*connector not needed before the first step*/
	content: none; 
}
/*marking active/completed steps green*/
/*The number of the step and the connector before it = green*/
.progressbar li.active:before,  .progressbar li.active:after{
	background: rgb(255,99,71);
	color: white;
}
.vtcha{
	max-width: 100%;
}
.vtcha .item-box,.vtcha .target-box{
	width: 170px;
	margin: 10px auto 0;
}
            
          
!
            
              $(document).ready(function(){
	spamschutz_init();//Spamschutz erzeugen
  msform_init();//Multiform erzeugen
  
  $('form').submit(function(event){
    if(
    	form_completeCheck() &&
    	true // some rules here
    ){
    	//Send it
    }
    else{
    	event.preventDefault();//nicht senden
    }
  })
})// $(document).ready()  */

/**
 * check($fs)
 * Validates the actualy fieldset
 *
 */
function check($fs){
	var ok = true;
	switch($fs.attr('data-check-id')){
		// Fieldset mit 'data-check-id' == '1'
		case '1':
			$i_name = $('input[name="name"]',$fs);
			$i_email = $('input[name="email"]',$fs);

		//NAME
			if ($i_name.val().length < 3) {
				ok=false;
				$i_name.addClass('error');
			}
			else{$i_name.removeClass('error');}

		//EMAIL
			if ($i_email.val().length < 6) {//diese validierung ist primitiv! (noch via RegEx auf echtheit überprüfen!) <http://www.html-seminar.de/html-css-php-forum/board40-themenbereiche/board18-php/4708-php-mailing/#post32959>
				ok=false;
				$i_email.addClass('error');
			}
			else{$i_email.removeClass('error');}
			break;

		// Fieldset mit 'data-check-id' == '2'
		case '2':
			$i_q1 = $('input[name="q1"]',$fs);
			$i_q2 = $('input[name="q2"]',$fs);
			$i_q3 = $('input[name="q3"]',$fs);

		//Question 1
			if ($i_q1.val().length < 3) {
				ok=false;
				$i_q1.addClass('error');
			}
			else{$i_q1.removeClass('error');}

		//Querstion 2
			if ($i_q2.val().length < 3) {
				ok=false;
				$i_q2.addClass('error');
			}
			else{$i_q2.removeClass('error');}

		//Querstion 3
			if ($i_q3.val().length < 3) {
				ok=false;
				$i_q3.addClass('error');
			}
			else{$i_q3.removeClass('error');}
			break;

		// Fieldset mit 'data-check-id' == '3'
		case '3':
			if (spamschutz_check() === false) {
				ok=false;
			}
			break;
	}
	
	if(ok === true){
		$fs.attr('data-complete', true);
		return true;
	}
	else{
		$fs.attr('data-complete', false);
		return false;
	}
}// check()  */

/**
 * unCheck($fieldset)
 * DeValidates the actualy fieldset
 *
 */
function unCheck($fieldset){
	$fieldset.attr('data-complete', false);
}// unCheck()  */

/**
 * form_completeCheck()
 *
 */
function form_completeCheck(){
  var ok = true;
  $('fieldset').each(function(index,elem){
    $this = $(this);
    if ($this.attr('data-complete') != 'true') {
      ok = false;
    };
  })
  
  if (ok === true) {
    //go go go..
    return true;
  }
  else{
    swal('Irgendwo hast Du Daten vergessen :/','Überprüfe nochmal deine Eingaben!','error');// Fucking: f@$%
    return false;
  }

}// form_completeCheck()  */

/**
 * msform_init()
 * init's the Next and Previus Buttons
 * 
 * author & copyright by <http://thecodeplayer.com/walkthrough/jquery-multi-step-form-with-progress-bar>
 *
 * modifyed by Wolf Wortmann:
 *  Added Validation caal.
 *  Added Disvalidation call.
 */
function msform_init(){
	//jQuery time
	var current_fs, next_fs, previous_fs; //fieldsets
	var left, opacity, scale; //fieldset properties which we will animate
	var animating; //flag to prevent quick multi-click glitches
	$('.submit').click(function(){
		check($(this).parent());
	})
	$(".next").click(function(){
		if(animating) return false;
		animating = true;
		
		current_fs = $(this).parent();
		next_fs = $(this).parent().next();
		
		if( check(current_fs) === false ) {
			animating = false;
			return false;
		} //Validieren & Abbrechen wenn fail

		//activate next step on progressbar using the index of next_fs
		$(".progressbar li").eq($("fieldset").index(next_fs)).addClass("active");
		
		//show the next fieldset
		next_fs.show(); 
		//hide the current fieldset with style
		current_fs.animate({opacity: 0}, {
			step: function(now, mx) {
				//as the opacity of current_fs reduces to 0 - stored in "now"
				//1. scale current_fs down to 80%
				scale = 1 - (1 - now) * 0.2;
				//2. bring next_fs from the right(50%)
				left = (now * 50)+"%";
				//3. increase opacity of next_fs to 1 as it moves in
				opacity = 1 - now;
				current_fs.css({'transform': 'scale('+scale+')'});
				next_fs.css({'left': left, 'opacity': opacity});
			}, 
			duration: 800, 
			complete: function(){
				current_fs.hide();
				animating = false;
			}, 
			//this comes from the custom easing plugin
			easing: 'easeInOutBack'
		});
	});// $(".next").click()  */

	$(".previous").click(function(){
		if(animating) return false;
		animating = true;
		
		current_fs = $(this).parent();
		previous_fs = $(this).parent().prev();
		
		unCheck(previous_fs)//DeValidieren

		//de-activate current step on progressbar
		$(".progressbar li").eq($("fieldset").index(current_fs)).removeClass("active");
		
		//show the previous fieldset
		previous_fs.show(); 
		//hide the current fieldset with style
		current_fs.animate({opacity: 0}, {
			step: function(now, mx) {
				//as the opacity of current_fs reduces to 0 - stored in "now"
				//1. scale previous_fs from 80% to 100%
				scale = 0.8 + (1 - now) * 0.2;
				//2. take current_fs to the right(50%) - from 0%
				left = ((1-now) * 50)+"%";
				//3. increase opacity of previous_fs to 1 as it moves in
				opacity = 1 - now;
				current_fs.css({'left': left});
				previous_fs.css({'transform': 'scale('+scale+')', 'opacity': opacity});
			}, 
			duration: 800, 
			complete: function(){
				current_fs.hide();
				animating = false;
			}, 
			//this comes from the custom easing plugin
			easing: 'easeInOutBack'
		});
	});// $(".previous").click()  */
};// msform_init()  */

function spamschutz_init(){
	$('.vtcha-spamschutz').vtcha({
    //hide: '.hide-this-pls',
    ok: 'multi_human_detected',
  })
}// spamschutz_init()  */

function spamschutz_check(){
	$this = $('.vtcha-spamschutz');
	if($this.val() == 'multi_human_detected'){
		return true;
  }
  else{
    return false;
  }
}// spamschutz_check()  */
            
          
!
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