Download
User Rating: 0/5 ( 0 votes)
Card is A better credit card form in one line of code
Card will take any credit card form and make it the best part of the checkout process (without you changing anything). Everything is created with pure CSS, HTML, and Javascript — no images required.
Features
-
Animations for 4 different card types
-
An intuitive experience for your users
-
Pure CSS, HTML, and Javascript (no images)
-
100% free and open source
Source: github.com
1. INCLUDE CSS AND JS FILES
<link rel="stylesheet" href="/path/to/card.css">
<script src="/path/to/jquery.js"></script>
<script src="/path/to/card.js"></script>
2. HTML
<div class="card-wrapper"></div>
<div class="form-container active">
<form action="">
<input placeholder="Card number" type="text" name="number">
<input placeholder="Full name" type="text" name="name">
<input placeholder="MM/YY" type="text" name="expiry">
<input placeholder="CVC" type="text" name="cvc">
</form>
</div>
3. JAVASCRIPT
$('.active form').card({ container: $('.card-wrapper')})
4. OPTIONS
$('form').card({
// a selector or jQuery object for the container
// where you want the card to appear
container: '.card-wrapper', // *required*
numberInput: 'input#number', // optional — default input[name="number"]
expiryInput: 'input#expiry', // optional — default input[name="expiry"]
cvcInput: 'input#cvc', // optional — default input[name="cvc"]
nameInput: 'input#name', // optional - defaults input[name="name"]
width: 200, // optional — default 350px
formatting: true // optional - default true
});