cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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="outer">
	<div class="container">
		<div id="infinity"></div>
		<h1>Auto-Split Input Fields</h1>
		<form class="form"> 
			<div class="full-name form-group">
				<label for="name">Name</label>
				<input type="text" id="name" placeholder="Enter your name" class="input" required/>
			</div>
			<div class="row name-split split">
				<div class="col-lg-6 col-md-6 form-group">
					<label for="first_name">First Name</label>
					<input type="text" name="fist_name" id="first_name" placeholder="Enter your first name" class="input" required/>
				</div>
				<div class="col-lg-6 col-md-6 form-group">
					<label for="last_name">Last Name</label>
					<input type="text" name="last_name" id="last_name" placeholder="Enter your last name" class="input" required/>
				</div>
			</div>
			<div class="full-email form-group">
				<label for="full_email">Email</label>
				<input type="email" id="full_email" placeholder="Enter your email" class="input" required/>
			</div>
			<div class="row email-split split">
				<div class="col-lg-6 col-md-6 form-group">
					<label for="email">Email</label>
					<input type="email" name="email" id="email" placeholder="Enter your email" class="input" required/>
				</div>
				<div class="col-lg-6 col-md-6 form-group">
					<label for="username">Username</label>
					<input type="text" name="username" id="username" placeholder="Enter your username" class="input" required/>
				</div>
			</div>
			<div class="full-password form-group">
				<label for="full_password">Password</label>
				<input type="password" id="full_password" placeholder="Enter your password" class="input" required/>
			</div>				
			<div class="row password-split split">
				<div class="col-lg-6 col-md-6 form-group">
					<label for="password">Password</label>
					<input type="password" name="password" id="password" placeholder="Enter your password" class="input" required/>
				</div>
				<div class="col-lg-6 col-md-6 form-group">
					<label for="password_confirm">Confirm Password</label>
					<input type="password" name="password_confirm" id="password_confirm" placeholder="Enter your password again" class="input" required/>
				</div>
			</div>     
			<input type="submit" class="submit" value="Create Account"/>				
		</form>
		<p class="well-lg text-center">
			Use tab to switch fields.  
		</p>
	</div>
</div>
            
          
!
            
              //Variables
$font-family: 'Roboto', sans-serif;
$font-size: 14px;
$body-bg: #422364;
$form-bg: #fff;
$primary-color: #e7572c;
$secondary-color: lighten($body-bg, 20%);
$input-bg : darken($form-bg, 7%);
$input-padding: 10px 12px;

::-webkit-input-placeholder{
  color: $secondary-color;  
	opacity: 0.9;
}
::-moz-placeholder {
	color: $secondary-color;   
	opacity: 0.9;
}

body{
  margin:0;
  height: 100%;
  background: $body-bg;
  font-family: $font-family;
  font-size: $font-size;
  line-height: 1.4; 
	color: lighten($secondary-color, 10%);
}
a {
  color: $primary-color;
  //active, hover, focus
  &:hover, &:focus, &:active{
    color: $primary-color;  
    text-decoration: underline;
  }
}
input{
  font-family: $font-family;
  font-size: $font-size;
	outline: none;
}
.outer{
  margin-top: 5%;
}
.container{
  max-width: 420px;
  width: 100%;
  margin: auto;    
  //form
  .form{
    background: $form-bg;
    border-radius: 4px;
    padding: 20px;
		box-shadow: 0px 3px 6px rgba(0,0,0,0.1);
  }
}
h1{
  color: lighten($secondary-color, 10%);
  text-align: center;
  padding-bottom: 10px;
	font-weight: lighter;
}
.input{  
  display: block;
  width: 100%;
	background: $input-bg;
  color: $secondary-color;
  padding: $input-padding;
  border-radius: 3px;
  border: solid 1px;
	border-color: transparent;
	transition: all 0.3s ease-in;
	//:focus
	&:focus{
		color: lighten($secondary-color, 10%);
		background: #fff;
		border-color: $primary-color;
	}
}
.submit {
  background: $primary-color;
  color: #fff;
  cursor: pointer;
  padding: $input-padding;
  display: block;
  width: 100%;
  border-radius: 3px;        
  border: none;    
  font-weight: bold;
  text-transform: uppercase;    
  margin: 0;	
	text-shadow: 0px 1px 1px darken($primary-color, 10%);
	transition: all 0.3s linear; 
	//:active, :focus, :hover
	&:active, &:focus, &:hover{
		background: darken($primary-color, 10%);
	}
	//:active, :focus
	&:active, &:focus{		
		box-shadow: inset 0px 1px 2px darken($primary-color, 20%);
	}
}
.split{
  display: none;
}
label{
  color: $secondary-color;	
}
#infinity {
	position: relative;
	width: 125px;
	height: 70px;
	margin: auto;		
}

#infinity:before,
#infinity:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border: 16px solid $primary-color;
    -moz-border-radius: 50px 50px 0 50px;
         border-radius: 50px 50px 0 50px;
    -webkit-transform: rotate(-45deg);
       -moz-transform: rotate(-45deg);
        -ms-transform: rotate(-45deg);
         -o-transform: rotate(-45deg);
            transform: rotate(-45deg);	
}

#infinity:after {
    left: auto;
    right: 0;
    -moz-border-radius: 50px 50px 50px 0;
         border-radius: 50px 50px 50px 0;
    -webkit-transform: rotate(45deg);
       -moz-transform: rotate(45deg);
        -ms-transform: rotate(45deg);
         -o-transform: rotate(45deg);
            transform: rotate(45deg);
}
					
            
          
!
            
              jQuery(document).ready(function($){  
  //Name Split
  $("#name").change(function(){    
  	var nameVal = $(this).val()
    var nameLength = nameVal.length;
    var nameSplit = nameVal.split(" ");    
    var lastNameLength = nameSplit[0].length + 1;
    var lastName = nameVal.slice(lastNameLength);   
    $(".full-name").fadeOut(0);
    $('#first_name').val(nameSplit[0]);
    $('#last_name').val(lastName);
    $('.name-split').fadeIn(100);
  });  
  
  //Email Split
  $("#full_email").change(function(){    
  	var emailVal = $(this).val();    
    var emailSplit = emailVal.split("@");  
    $(".full-email").fadeOut(0);		
    $('#email').val(emailVal);
    $('#username').val(emailSplit[0]);    
		$('.email-split').fadeIn(100);
  });  

	//Password Split
 $("#full_password").change(function(){    
  	var passwordVal = $(this).val();      
    $(".full-password").fadeOut(0);
    $('#password').val(passwordVal);   
    $('.password-split').fadeIn(100);
		$('#password_confirm').focus();
  });  		
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console