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.

            
              
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>UI 002 - card</title>
		<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
		<link rel="stylesheet" href="css/style.css" />
	</head>
	<body>
		<div class="wrap">
			<div class="face">
				<div class="holo">
					<div class="line"></div>
					<div class="line"></div>
					<div class="line"></div>
				</div>
				<div class="logo">
		          <img src="http://dariographics.com/DUI/002/visa.svg" alt="" />
		        </div>
		        <div id="number">
		        	<input placeholder="0000" maxlength="4" type="password"></input><input placeholder="0000" maxlength="4" type="password"></input><input placeholder="0000" maxlength="4" type="password"></input><input placeholder="0000" maxlength="4" type="password"></input>
		        </div>
		        <input id="show" type="checkbox"/>
		        <label for="show"></label>
		        <div id="holder">
		        	<input placeholder="Name on card" maxlength="16"></input>
		        </div>
		        <div id="date">
		        	<input placeholder="05" maxlength="2"></input>
		        	<span>/</span>
		        	<input placeholder="16" maxlength="2"></input>
		        </div>
			</div>
			<div class="back">
				<div id="cardline"></div>
				<div id="cvv">
		        	<span>&#x275A;&#x275A;&#x275A;</span>
		        	<input placeholder="16" maxlength="3"></input>
		        </div>
			</div>
			<button class="sumbit">sumbit</button>
		</div>
	</body>
	<script src="js/jquery.min.js"></script>
	<script src="js/main.js"></script>
</html>	
            
          
!
            
              
$body: #629eff;


@mixin centerer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

body{
	font-family: 'Montserrat', sans-serif;
	background: $body;
	transition: all 0.3s;
}

.wrap{
	width:600px;
	height:600px;
	@include centerer;
	perspective: 1000px;
}

.holo{
	overflow:hidden;
	position: absolute;
	right:35px;
	width: 90px;
	height: 60px;
	border-radius:8px;
	background: linear-gradient(135deg, #e59f2d 0%,#ffea30 25%,#ff8528 71%,#ffdd89 100%); 
}

.line{
	margin:-20px;
	width:90px;
	height:50px;
	border:2px solid #ff8528;
	border-radius:4px;
	&:nth-child(2){
		margin:-40px;
	}
	&:nth-child(3){
		margin: 10px 20px;
	}
}

.face{
	position:relative;
	z-index:1;
	box-sizing: border-box;
	width: 450px;
	height: 300px;
	border-radius: 15px;
	background: white;
	padding: 35px 30px;
	transform: rotateY(-15deg);
	img{
		display: block;
		width: 100px;
	}
	&:hover{
		transform: rotateY(0deg);
	}
	transition: all 0.3s;
}


#number{
	margin: 90px 0 40px;
	position:relative;
	display:inline-block;
	&:before{
		position:absolute;
		font-size: 10px;
		top: -20px;
		content: "card number";
	}
	input{
		font-size: 30px;
		width: 90px;
		outline: none;
		border:none;
	}
}


#holder{
	position: relative;
	display:block;
	&:before{
		position:absolute;
		font-size: 10px;
		top: -20px;
		content: "cardholder";
	}
	input{
		font-size: 26px;
		width: 260px;
		outline: none;
		border:none;
		float: left;
		margin-right: 16px;
		text-transform: uppercase;
	}
}

#date{
	position: relative;
	display:block;
	span{
		float: left;
		font-size: 26px;
		opacity: 0.4;
		margin-right: 4px;
	}
	&:before{
		position:absolute;
		font-size: 10px;
		top: -20px;
		content: "valid date";
	}
	input{
		font-size: 26px;
		width: 40px;
		outline: none;
		float: left;
		border:none;
		text-transform: uppercase;
	}
}


.back{
	overflow:hidden;
	position: absolute;
	top:130px;
	left:100px;
	z-index:-1;
	box-sizing: border-box;
	width: 450px;
	height: 300px;
	border-radius: 15px;
	background: #f1e02d;
	padding: 35px 30px;
	transform: rotateY(15deg);
	&:before{
		position:absolute;
		font-size: 10px;
		right: 60px;
		top: 200px;
		content: "CVV";
	}
	input::placeholder{
		color: black;
		opacity: 0.5;
	}
	&:hover{
		transform: rotateY(0deg);
	}
	transition: all 0.3s;
}

#cvv{
	position:absolute;
	top:220px;
	right:15px;
	span{
		font-size: 26px;
	}
	input{
		font-size: 26px;
		width: 60px;
		outline: none;
		border:none;
		background:transparent;
		text-transform: uppercase;
	}
}

#cardline{
	width:160%;
	height:60px;
	opacity:0.8;
	background:black;
}

.sumbit{
	position:absolute;
	top:460px;
	left:100px;
	border:none;
	outline:none;
	background: #69ffc8;
	width:200px;
	height:80px;
	border-radius:15px;
	text-transform:uppercase;
	font-size: 18px;
	font-weight: 700;
	transform: rotateY(0deg);
	&:hover{
		background: #00f0ff;
		transform: rotateY(15deg);
	}
	transition: all 0.3s;
}



input[type=checkbox] { display:none; } /* to hide the checkbox itself */
input[type=checkbox] + label:before {
	cursor:pointer;
	opacity: 0.4;
	font-family: FontAwesome;
	display: inline-block;
	font-size: 22px;
	content: "\f070"; 
	color: black;
	transition: all 0.2s;
}


/* checked icon */
input[type=checkbox]:checked + label:before { 
	content: "\f06e"; 
	opacity:1;
	color: #ff8528;
} 
            
          
!
            
              $("#number input").keyup(function () {
  if (this.value.length == this.maxLength) {
    $(this).next('#number input').focus();
  }
});

$("#date input").keyup(function () {
  if (this.value.length == this.maxLength) {
    $(this).next('#date input').focus();
  }
});



//Place this plugin snippet into another file in your applicationb
(function ($) {
    $.toggleShowPassword = function (options) {
        var settings = $.extend({
            field: "#password",
            control: "#toggle_show_password",
        }, options);

        var control = $(settings.control);
        var field = $(settings.field)

        control.bind('click', function () {
            if (control.is(':checked')) {
                field.attr('type', 'text');
            } else {
                field.attr('type', 'password');
            }
        })
    };
}(jQuery));

//Here how to call above plugin from everywhere in your application document body
$.toggleShowPassword({
    field: '#number input',
    control: '#show'
});
            
          
!
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