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 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.

            
              <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<link href='https://fonts.googleapis.com/css?family=Abel' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Herr+Von+Muellerhoff' rel='stylesheet' type='text/css'>
<div class="credit-card is-front">
	<div class="card-front">
		<img src="http://admin.parlor-interactive.com/dribbble/credit-card-chip.png?v=1" class="chip">
		<div class="card-number">
			<span>XXXX</span><!--
			--><span>XXXX</span><!--
			--><span>XXXX</span><!--
			--><span>XXXX</span>
		</div>
		<div class="exp">
			<span class="label">Good Thru</span>
			<span class="date">MM/YY</span>
		</div>
		<div class="name-on-card">
			CARDHOLDER
		</div>
		<img src="http://admin.parlor-interactive.com/dribbble/visa-logo.png" class="visa">
	</div>
	<div class="card-back">
		<div class="magstrip"></div>
		<div class="signature"><span class="sig-name">Cardholder</span><div class="cvv">XXX</div></div>
		<div class="card-number">
			<span>XXXX</span><!--
			--><span>XXXX</span><!--
			--><span>XXXX</span><!--
			--><span>XXXX</span>
		</div>
		<div class="exp">
			<span class="label">Good Thru</span>
			<span class="date">MM/YY</span>
		</div>
		<div class="name-on-card">
			CARDHOLDER
		</div>
	</div>
	
</div>
<form>
	<label>Name on Card</label>
	<input type="text" class="name" placeholder="John Smith"/>
	<label>Card Number</label>
	<input type="text" class="number" maxlength="16" placeholder="XXXXXXXXXXXXXXXX"/>
	<div class="column">
		<label>CVV</label>
		<input type="text" class="cvv" maxlength="3" placeholder="XXX"/>
	</div>
	<div class="column">
		<label>Expiration Date</label>
		<input type="text" id="datepicker" placeholder="mm/yy">
	</div>
	<button>Submit</submit>
</form>
            
          
!
            
              *
{
	box-sizing:border-box;
}
body
{
	background-image:url('http://admin.parlor-interactive.com/dribbble/bg-cc-blur.png');
	background-position:center center;
	background-size:cover;
	background-attachment:fixed;
}

.card-front, .card-back
{
	position:absolute;
	top:50%;
	right:50%;
	width:565px;
	height:358px;
	-webkit-transition: all 300ms ease;
	-moz-transition: all 300ms ease;
	-o-transition: all 300ms ease;
	transition: all 300ms ease;
	margin-top:-179px;
	margin-right:-130px;
	-webkit-border-radius: 15px;
	-moz-border-radius: 15px;
	border-radius: 15px;
	-webkit-backface-visibility: hidden;
  backface-visibility: hidden;
	-webkit-box-shadow: 0px 0px 15px rgba(0, 0, 0, .5);
-moz-box-shadow: 0px 0px 15px rgba(0, 0, 0, .5);
box-shadow: 0px 0px 15px rgba(0, 0, 0, .5);
	z-index:1;
	/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#0082e5+0,004799+100 */
background: rgb(0,130,229); /* Old browsers */
background: -moz-linear-gradient(top,  rgba(0,130,229,1) 0%, rgba(0,71,153,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top,  rgba(0,130,229,1) 0%,rgba(0,71,153,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom,  rgba(0,130,229,1) 0%,rgba(0,71,153,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0082e5', endColorstr='#004799',GradientType=0 ); /* IE6-9 */
}

.card-front
{
	
.chip
			{
				display:inline-block;
				width:75px;
				height:auto;
				position:absolute;
				top:85px;
				left:30px;
			}
			.visa
			{
				position:absolute;
				width:125px;
				height:auto;
				right:25px;
				bottom:38px;
			}
			.card-number
			{
				font-family: 'Abel', sans-serif;
				width:100%;
				font-size:40px;
				span
				{
					width:25%;
					display:inline-block;
					text-align:center;
					padding-top:170px;
					color:#FFF;
					text-shadow: 1px 1px 5px rgba(0, 0, 0, 1);
					letter-spacing:.1em;
				}
			}
			.exp
			{
				padding-top:25px;
				margin-bottom:25px;
				position:relative;
				left:50%;
				margin-left:-118px;
				display:inline-block;
				.label
				{
					font-family: 'lato', sans-serif;
					text-transform:uppercase;
					width:50px;
					display:inline-block;
					text-transform:uppercase;
					position:relative;
					top:2px;
					margin-right:15px;
					text-align:center;
					color:rgba(0,0,0,.5);
				}
				.date
				{
					font-family: 'Abel', sans-serif;
					font-size:30px;
					color:#FFF;
					text-shadow: 1px 1px 5px rgba(0, 0, 0, 1);
					letter-spacing:.1em;
				}
			}
			.name-on-card
			{
				font-family: 'Abel', sans-serif;
					font-size:30px;
					color:#FFF;
					text-shadow: 1px 1px 5px rgba(0, 0, 0, 1);
					letter-spacing:.1em;
				text-transform:uppercase;
				padding-left:25px;
			}
}
.card-back
{
	.magstrip
	{
		width:100%;
		height:50px;
		background:#ddd;
		margin-top:35px;
	}
	.signature
	{
		position:relative;
		margin-left:25px;
		padding:10px 50px 10px 25px;
		background:#f5f2d6;
		width:75%;
		height:50px;
		margin-top:25px;
		font-family: 'Herr Von Muellerhoff', cursive;
		font-size:46px;
		.cvv
		{
			position:absolute;
			top:0;
			right:0;
			height:50px;
			width:75px;
			font-family:'Abel', sans-serif;
			font-style:italic;
			font-size:24px;
			background:#e0f5f9;
			text-align:center;
			padding-top:15px;
		}
	}
	.card-number, .exp, .name-on-card
	{
		/*max-height:1000px;*/
		-webkit-transition: all 300ms ease;
		-moz-transition: all 300ms ease;
		-o-transition: all 300ms ease;
		transition: all 300ms ease;
		opacity:1;
	}
	.card-number
			{
				font-family: 'Abel', sans-serif;
				width:100%;
				font-size:40px;
				-webkit-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
-moz-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
-o-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
				span
				{
					width:25%;
					display:inline-block;
					text-align:center;
					padding-top:10px;
					color:rgba(0,0,0,.25);
					text-shadow: -1px -1px 5px rgba(255, 255, 255, .2);
					letter-spacing:.1em;
				}
			}
			.exp
			{
				padding-top:25px;
				margin-bottom:25px;
				position:relative;
				left:50%;
				margin-left:-40px;
				display:inline-block;
				-webkit-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
-moz-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
-o-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
				.label
				{
					font-family: 'lato', sans-serif;
					text-transform:uppercase;
					width:50px;
					display:inline-block;
					text-transform:uppercase;
					position:relative;
					top:2px;
					margin-right:15px;
					text-align:center;
					color:rgba(0,0,0,.25);
					text-shadow: -1px -1px 5px rgba(255, 255, 255, .2);
				}
				.date
				{
					font-family: 'Abel', sans-serif;
					font-size:30px;
					color:rgba(0,0,0,.25);
					text-shadow: -1px -1px 5px rgba(255, 255, 255, .2);
					letter-spacing:.1em;
				}
			}
			.name-on-card
			{
				font-family: 'Abel', sans-serif;
					font-size:30px;
					color:rgba(0,0,0,.25);
					text-shadow: -1px -1px 5px rgba(255, 255, 255, .2);
					letter-spacing:.1em;
				text-transform:uppercase;
				padding-left:25px;
				-webkit-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
-moz-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
-o-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
			}
}

.credit-card
{
	&.is-front
	{
		.card-front
		{
			-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
	-moz-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
	-o-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
	-ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
	transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
		}
		.card-back
		{
			-webkit-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
	-moz-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
	-o-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
	-ms-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
	transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
			.card-number, .exp, .name-on-card{opacity:0;}
		}
	}
	&.is-back
	{
		.card-back
		{
			-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
	-moz-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
	-o-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
	-ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
	transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
		}
		.card-front
		{
			-webkit-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
	-moz-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
	-o-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
	-ms-transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
	transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg);
		}
	}
}

form
{
	position:absolute;
	width:300px;
	height:auto;
	padding:15px;
	background:rgba(255, 255, 255, .8);
	left:50%;
	top:50%;
	margin-left:130px;
	-webkit-transform: translate(0%, -50%);
	-moz-transform: translate(0%, -50%);
	-o-transform: translate(0%, -50%);
	-ms-transform: translate(0%, -50%);
	transform: translate(0%, -50%);
	-webkit-border-radius: 0px 15px 15px 0px;
	-moz-border-radius: 0px 15px 15px 0px;
	border-radius: 0px 15px 15px 0px;
	input
	{
		height:35px;
		border:0;
		margin:2px 0;
		font-family: 'lato', sans-serif;
		padding-left:10px;
		&.name, &.number
		{
			width:100%;
			margin-bottom:5px
		}
		&.cvv
		{
			width:50%;
		}
	}
	.column
	{
		float:left;
		width:50%;
		&:nth-of-type(1){padding-right:5px;}
		&:nth-of-type(2){padding-left:5px;}
		input
		{
			width:100%;
		}
	}
	label
	{
		display:block;
		font-family: 'lato', sans-serif;
		font-weight:bolder;
		font-size:12px;
		padding-bottom:2px;
		margin-top:5px;
		font-weight:900;
		text-transform:uppercase;
	}
	button
	{
		float:right;
		width:100%;
		height:35px;
		border:none;
		margin-top:10px;
		font-family: 'lato', sans-serif;
		background:#004799;
		text-transform:uppercase;
		color:#FFF;
		font-weight:700;
		-webkit-transition: all 300ms ease;
		-moz-transition: all 300ms ease;
		-o-transition: all 300ms ease;
		transition: all 300ms ease;
		&:hover
		{
			background:#0a2646;
		}
	}
}
            
          
!
            
              $(document).on('ready', function(){
	formCheck();
});

function formCheck()
{
	//UPDATE NAME
	$('input.name').each(function() {
   var elem = $(this);

   // Save current value of element
   elem.data('oldVal', elem.val());

   // Look for changes in the value
   elem.bind("propertychange change click keyup input paste", function(event){
      // If value has changed...
      if (elem.data('oldVal') != elem.val()) {
       // Updated stored value
       elem.data('oldVal', elem.val());

       // Do action
       $('.name-on-card, .sig-name').html($('input.name').val());
     }
   });
 });
	//UPDATE CARD NUMBER
	$('input.number').each(function() {
   var elem = $(this);

   // Save current value of element
   elem.data('oldVal', elem.val());

   // Look for changes in the value
   elem.bind("propertychange change click keyup input paste", function(event){
      // If value has changed...
      if (elem.data('oldVal') != elem.val()) {
       // Updated stored value
       elem.data('oldVal', elem.val());

       // Do action
			 $splitNumber = $('input.number').val().match(/.{1,4}/g);
       $('.card-front .card-number span').each(function(index){
				 $(this).html($splitNumber[index]);
			 });
				$('.card-back .card-number span').each(function(index){
				 $(this).html($splitNumber[index]);
			 });
     }
   });
 });
	//FLIP CARD WHEN CVV IS FOCUED
	$('input.cvv').on('focus', function(){
		$('.credit-card').removeClass('is-front').addClass('is-back');
	});
	$('input.cvv').on('focusout', function(){
		$('.credit-card').addClass('is-front').removeClass('is-back');
	});
	
	//UPDATE CVV
	$('input.cvv').each(function() {
   var elem = $(this);

   // Save current value of element
   elem.data('oldVal', elem.val());

   // Look for changes in the value
   elem.bind("propertychange change click keyup input paste", function(event){
      // If value has changed...
      if (elem.data('oldVal') != elem.val()) {
       // Updated stored value
       elem.data('oldVal', elem.val());

       // Do action
       $('div.cvv').html($('input.cvv').val());
     }
   });
 });
	
	//UPDATE DATE
	$('input#datepicker').each(function() {
   var elem = $(this);

   // Save current value of element
   elem.data('oldVal', elem.val());

   // Look for changes in the value
   elem.bind("propertychange change click keyup input paste", function(event){
      // If value has changed...
      if (elem.data('oldVal') != elem.val()) {
       // Updated stored value
       elem.data('oldVal', elem.val());

       // Do action
       $('.card-front .date').html($('input#datepicker').val());
     }
   });
 });
}
            
          
!
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