WEBLEB
होम
संपादक
लॉग इन करें
Pro
हिंदी
English
Français
Español
Português
Deutsch
Italiano
हिंदी
HTML
CSS
JS
Payment form html css
Payment Information
0123 4567 8910 1112
JOHN DOE
cardholder name
expiration
card number
01/23
VALID
THRU
985
security code
John Doe
Name
Card Number
generate random
Expiration (mm/yy)
Security Code
@import url('https://fonts.googleapis.com/css?family=Montserrat:400,800'); body { margin: 0; padding: 0; background-color: #f9f9f9; display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-line-pack: center; align-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; min-height: 100vh; font-family: "Montserrat"!important; -ms-flex-wrap: wrap; flex-wrap: wrap; font-family: 'Raleway'; } .payment-title { width: 100%; text-align: center; } .form-container .field-container:first-of-type { grid-area: name; } .form-container .field-container:nth-of-type(2) { grid-area: number; } .form-container .field-container:nth-of-type(3) { grid-area: expiration; } .form-container .field-container:nth-of-type(4) { grid-area: security; } .field-container input { -webkit-box-sizing: border-box; box-sizing: border-box; } .field-container { position: relative; } .form-container { display: grid; grid-column-gap: 10px; grid-template-columns: auto auto; grid-template-rows: 90px 90px 90px; grid-template-areas: "name name""number number""expiration security"; max-width: 400px; padding: 20px; color: #707070; } label { padding-bottom: 5px; font-size: 13px; } input { margin-top: 3px; padding: 15px; font-size: 16px; width: 100%; border-radius: 3px; border: 1px solid #dcdcdc; } .ccicon { height: 38px; position: absolute; right: 6px; top: calc(50% - 17px); width: 60px; } .container { width: 100%; max-width: 400px; max-height: 251px; height: 54vw; padding: 20px; } #ccsingle { position: absolute; right: 15px; top: 20px; } #ccsingle svg { width: 100px; max-height: 60px; } .creditcard svg#cardfront, .creditcard svg#cardback { width: 100%; -webkit-box-shadow: 1px 5px 6px 0px black; box-shadow: 1px 5px 6px 0px black; border-radius: 22px; } #generatecard{ cursor: pointer; float: right; font-size: 12px; color: #fff; padding: 2px 4px; background-color: #909090; border-radius: 4px; cursor: pointer; float:right; } .creditcard .lightcolor, .creditcard .darkcolor { -webkit-transition: fill .5s; transition: fill .5s; } .creditcard .lightblue { fill: #03A9F4; } .creditcard .lightbluedark { fill: #0288D1; } .creditcard .red { fill: #ef5350; } .creditcard .reddark { fill: #d32f2f; } .creditcard .purple { fill: #ab47bc; } .creditcard .purpledark { fill: #7b1fa2; } .creditcard .cyan { fill: #26c6da; } .creditcard .cyandark { fill: #0097a7; } .creditcard .green { fill: #66bb6a; } .creditcard .greendark { fill: #388e3c; } .creditcard .lime { fill: #d4e157; } .creditcard .limedark { fill: #afb42b; } .creditcard .yellow { fill: #ffeb3b; } .creditcard .yellowdark { fill: #f9a825; } .creditcard .orange { fill: #ff9800; } .creditcard .orangedark { fill: #ef6c00; } .creditcard .grey { fill: #bdbdbd; } .creditcard .greydark { fill: #616161; } /* FRONT OF CARD */ #svgname { text-transform: uppercase; } #cardfront .st2 { fill: #FFFFFF; } #cardfront .st3 { font-family: 'Source Code Pro', monospace; font-weight: 600; } #cardfront .st4 { font-size: 54.7817px; } #cardfront .st5 { font-family: 'Source Code Pro', monospace; font-weight: 400; } #cardfront .st6 { font-size: 33.1112px; } #cardfront .st7 { opacity: 0.6; fill: #FFFFFF; } #cardfront .st8 { font-size: 24px; } #cardfront .st9 { font-size: 36.5498px; } #cardfront .st10 { font-family: 'Source Code Pro', monospace; font-weight: 300; } #cardfront .st11 { font-size: 16.1716px; } #cardfront .st12 { fill: #4C4C4C; } /* BACK OF CARD */ #cardback .st0 { fill: none; stroke: #0F0F0F; stroke-miterlimit: 10; } #cardback .st2 { fill: #111111; } #cardback .st3 { fill: #F2F2F2; } #cardback .st4 { fill: #D8D2DB; } #cardback .st5 { fill: #C4C4C4; } #cardback .st6 { font-family: 'Source Code Pro', monospace; font-weight: 400; } #cardback .st7 { font-size: 27px; } #cardback .st8 { opacity: 0.6; } #cardback .st9 { fill: #FFFFFF; } #cardback .st10 { font-size: 24px; } #cardback .st11 { fill: #EAEAEA; } #cardback .st12 { font-family: 'Rock Salt', cursive; } #cardback .st13 { font-size: 37.769px; } /* FLIP ANIMATION */ .container { perspective: 1000px; } .creditcard { width: 100%; max-width: 400px; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; transition: -webkit-transform 0.6s; -webkit-transition: -webkit-transform 0.6s; transition: transform 0.6s; transition: transform 0.6s, -webkit-transform 0.6s; cursor: pointer; } .creditcard .front, .creditcard .back { position: absolute; width: 100%; max-width: 400px; -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-font-smoothing: antialiased; color: #47525d; } .creditcard .back { -webkit-transform: rotateY(180deg); transform: rotateY(180deg); } .creditcard.flipped { -webkit-transform: rotateY(180deg); transform: rotateY(180deg); }
window.onload = function () { const name = document.getElementById('name'); const cardnumber = document.getElementById('cardnumber'); const expirationdate = document.getElementById('expirationdate'); const securitycode = document.getElementById('securitycode'); const output = document.getElementById('output'); const ccicon = document.getElementById('ccicon'); const ccsingle = document.getElementById('ccsingle'); const generatecard = document.getElementById('generatecard'); let cctype = null; //Mask the Credit Card Number Input var cardnumber_mask = new IMask(cardnumber, { mask: [ { mask: '0000 000000 00000', regex: '^3[47]\\d{0,13}', cardtype: 'american express' }, { mask: '0000 0000 0000 0000', regex: '^(?:6011|65\\d{0,2}|64[4-9]\\d?)\\d{0,12}', cardtype: 'discover' }, { mask: '0000 000000 0000', regex: '^3(?:0([0-5]|9)|[689]\\d?)\\d{0,11}', cardtype: 'diners' }, { mask: '0000 0000 0000 0000', regex: '^(5[1-5]\\d{0,2}|22[2-9]\\d{0,1}|2[3-7]\\d{0,2})\\d{0,12}', cardtype: 'mastercard' }, // { // mask: '0000-0000-0000-0000', // regex: '^(5019|4175|4571)\\d{0,12}', // cardtype: 'dankort' // }, // { // mask: '0000-0000-0000-0000', // regex: '^63[7-9]\\d{0,13}', // cardtype: 'instapayment' // }, { mask: '0000 000000 00000', regex: '^(?:2131|1800)\\d{0,11}', cardtype: 'jcb15' }, { mask: '0000 0000 0000 0000', regex: '^(?:35\\d{0,2})\\d{0,12}', cardtype: 'jcb' }, { mask: '0000 0000 0000 0000', regex: '^(?:5[0678]\\d{0,2}|6304|67\\d{0,2})\\d{0,12}', cardtype: 'maestro' }, // { // mask: '0000-0000-0000-0000', // regex: '^220[0-4]\\d{0,12}', // cardtype: 'mir' // }, { mask: '0000 0000 0000 0000', regex: '^4\\d{0,15}', cardtype: 'visa' }, { mask: '0000 0000 0000 0000', regex: '^62\\d{0,14}', cardtype: 'unionpay' }, { mask: '0000 0000 0000 0000', cardtype: 'Unknown' } ], dispatch: function (appended, dynamicMasked) { var number = (dynamicMasked.value + appended).replace(/\D/g, ''); for (var i = 0; i < dynamicMasked.compiledMasks.length; i++) { let re = new RegExp(dynamicMasked.compiledMasks[i].regex); if (number.match(re) != null) { return dynamicMasked.compiledMasks[i]; } } } }); //Mask the Expiration Date var expirationdate_mask = new IMask(expirationdate, { mask: 'MM{/}YY', groups: { YY: new IMask.MaskedPattern.Group.Range([0, 99]), MM: new IMask.MaskedPattern.Group.Range([1, 12]), } }); //Mask the security code var securitycode_mask = new IMask(securitycode, { mask: '0000', }); // SVGICONS let amex = `
`; let visa = `
`; let diners = `
`; let discover = `
`; let jcb = `
`; let maestro = `
`; let mastercard = `
`; let unionpay = `
`; let amex_single = `
Slice 1
Created with Sketch.
`; let visa_single = `
Slice 1
Created with Sketch.
Validating your code, please wait...
HTML
CSS
JS
Payment form html css
Payment Information
0123 4567 8910 1112
JOHN DOE
cardholder name
expiration
card number
01/23
VALID
THRU
985
security code
John Doe
Name
Card Number
generate random
Expiration (mm/yy)
Security Code
@import url('https://fonts.googleapis.com/css?family=Montserrat:400,800'); body { margin: 0; padding: 0; background-color: #f9f9f9; display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-line-pack: center; align-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; min-height: 100vh; font-family: "Montserrat"!important; -ms-flex-wrap: wrap; flex-wrap: wrap; font-family: 'Raleway'; } .payment-title { width: 100%; text-align: center; } .form-container .field-container:first-of-type { grid-area: name; } .form-container .field-container:nth-of-type(2) { grid-area: number; } .form-container .field-container:nth-of-type(3) { grid-area: expiration; } .form-container .field-container:nth-of-type(4) { grid-area: security; } .field-container input { -webkit-box-sizing: border-box; box-sizing: border-box; } .field-container { position: relative; } .form-container { display: grid; grid-column-gap: 10px; grid-template-columns: auto auto; grid-template-rows: 90px 90px 90px; grid-template-areas: "name name""number number""expiration security"; max-width: 400px; padding: 20px; color: #707070; } label { padding-bottom: 5px; font-size: 13px; } input { margin-top: 3px; padding: 15px; font-size: 16px; width: 100%; border-radius: 3px; border: 1px solid #dcdcdc; } .ccicon { height: 38px; position: absolute; right: 6px; top: calc(50% - 17px); width: 60px; } .container { width: 100%; max-width: 400px; max-height: 251px; height: 54vw; padding: 20px; } #ccsingle { position: absolute; right: 15px; top: 20px; } #ccsingle svg { width: 100px; max-height: 60px; } .creditcard svg#cardfront, .creditcard svg#cardback { width: 100%; -webkit-box-shadow: 1px 5px 6px 0px black; box-shadow: 1px 5px 6px 0px black; border-radius: 22px; } #generatecard{ cursor: pointer; float: right; font-size: 12px; color: #fff; padding: 2px 4px; background-color: #909090; border-radius: 4px; cursor: pointer; float:right; } .creditcard .lightcolor, .creditcard .darkcolor { -webkit-transition: fill .5s; transition: fill .5s; } .creditcard .lightblue { fill: #03A9F4; } .creditcard .lightbluedark { fill: #0288D1; } .creditcard .red { fill: #ef5350; } .creditcard .reddark { fill: #d32f2f; } .creditcard .purple { fill: #ab47bc; } .creditcard .purpledark { fill: #7b1fa2; } .creditcard .cyan { fill: #26c6da; } .creditcard .cyandark { fill: #0097a7; } .creditcard .green { fill: #66bb6a; } .creditcard .greendark { fill: #388e3c; } .creditcard .lime { fill: #d4e157; } .creditcard .limedark { fill: #afb42b; } .creditcard .yellow { fill: #ffeb3b; } .creditcard .yellowdark { fill: #f9a825; } .creditcard .orange { fill: #ff9800; } .creditcard .orangedark { fill: #ef6c00; } .creditcard .grey { fill: #bdbdbd; } .creditcard .greydark { fill: #616161; } /* FRONT OF CARD */ #svgname { text-transform: uppercase; } #cardfront .st2 { fill: #FFFFFF; } #cardfront .st3 { font-family: 'Source Code Pro', monospace; font-weight: 600; } #cardfront .st4 { font-size: 54.7817px; } #cardfront .st5 { font-family: 'Source Code Pro', monospace; font-weight: 400; } #cardfront .st6 { font-size: 33.1112px; } #cardfront .st7 { opacity: 0.6; fill: #FFFFFF; } #cardfront .st8 { font-size: 24px; } #cardfront .st9 { font-size: 36.5498px; } #cardfront .st10 { font-family: 'Source Code Pro', monospace; font-weight: 300; } #cardfront .st11 { font-size: 16.1716px; } #cardfront .st12 { fill: #4C4C4C; } /* BACK OF CARD */ #cardback .st0 { fill: none; stroke: #0F0F0F; stroke-miterlimit: 10; } #cardback .st2 { fill: #111111; } #cardback .st3 { fill: #F2F2F2; } #cardback .st4 { fill: #D8D2DB; } #cardback .st5 { fill: #C4C4C4; } #cardback .st6 { font-family: 'Source Code Pro', monospace; font-weight: 400; } #cardback .st7 { font-size: 27px; } #cardback .st8 { opacity: 0.6; } #cardback .st9 { fill: #FFFFFF; } #cardback .st10 { font-size: 24px; } #cardback .st11 { fill: #EAEAEA; } #cardback .st12 { font-family: 'Rock Salt', cursive; } #cardback .st13 { font-size: 37.769px; } /* FLIP ANIMATION */ .container { perspective: 1000px; } .creditcard { width: 100%; max-width: 400px; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; transition: -webkit-transform 0.6s; -webkit-transition: -webkit-transform 0.6s; transition: transform 0.6s; transition: transform 0.6s, -webkit-transform 0.6s; cursor: pointer; } .creditcard .front, .creditcard .back { position: absolute; width: 100%; max-width: 400px; -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-font-smoothing: antialiased; color: #47525d; } .creditcard .back { -webkit-transform: rotateY(180deg); transform: rotateY(180deg); } .creditcard.flipped { -webkit-transform: rotateY(180deg); transform: rotateY(180deg); }
window.onload = function () { const name = document.getElementById('name'); const cardnumber = document.getElementById('cardnumber'); const expirationdate = document.getElementById('expirationdate'); const securitycode = document.getElementById('securitycode'); const output = document.getElementById('output'); const ccicon = document.getElementById('ccicon'); const ccsingle = document.getElementById('ccsingle'); const generatecard = document.getElementById('generatecard'); let cctype = null; //Mask the Credit Card Number Input var cardnumber_mask = new IMask(cardnumber, { mask: [ { mask: '0000 000000 00000', regex: '^3[47]\\d{0,13}', cardtype: 'american express' }, { mask: '0000 0000 0000 0000', regex: '^(?:6011|65\\d{0,2}|64[4-9]\\d?)\\d{0,12}', cardtype: 'discover' }, { mask: '0000 000000 0000', regex: '^3(?:0([0-5]|9)|[689]\\d?)\\d{0,11}', cardtype: 'diners' }, { mask: '0000 0000 0000 0000', regex: '^(5[1-5]\\d{0,2}|22[2-9]\\d{0,1}|2[3-7]\\d{0,2})\\d{0,12}', cardtype: 'mastercard' }, // { // mask: '0000-0000-0000-0000', // regex: '^(5019|4175|4571)\\d{0,12}', // cardtype: 'dankort' // }, // { // mask: '0000-0000-0000-0000', // regex: '^63[7-9]\\d{0,13}', // cardtype: 'instapayment' // }, { mask: '0000 000000 00000', regex: '^(?:2131|1800)\\d{0,11}', cardtype: 'jcb15' }, { mask: '0000 0000 0000 0000', regex: '^(?:35\\d{0,2})\\d{0,12}', cardtype: 'jcb' }, { mask: '0000 0000 0000 0000', regex: '^(?:5[0678]\\d{0,2}|6304|67\\d{0,2})\\d{0,12}', cardtype: 'maestro' }, // { // mask: '0000-0000-0000-0000', // regex: '^220[0-4]\\d{0,12}', // cardtype: 'mir' // }, { mask: '0000 0000 0000 0000', regex: '^4\\d{0,15}', cardtype: 'visa' }, { mask: '0000 0000 0000 0000', regex: '^62\\d{0,14}', cardtype: 'unionpay' }, { mask: '0000 0000 0000 0000', cardtype: 'Unknown' } ], dispatch: function (appended, dynamicMasked) { var number = (dynamicMasked.value + appended).replace(/\D/g, ''); for (var i = 0; i < dynamicMasked.compiledMasks.length; i++) { let re = new RegExp(dynamicMasked.compiledMasks[i].regex); if (number.match(re) != null) { return dynamicMasked.compiledMasks[i]; } } } }); //Mask the Expiration Date var expirationdate_mask = new IMask(expirationdate, { mask: 'MM{/}YY', groups: { YY: new IMask.MaskedPattern.Group.Range([0, 99]), MM: new IMask.MaskedPattern.Group.Range([1, 12]), } }); //Mask the security code var securitycode_mask = new IMask(securitycode, { mask: '0000', }); // SVGICONS let amex = `
`; let visa = `
`; let diners = `
`; let discover = `
`; let jcb = `
`; let maestro = `
`; let mastercard = `
`; let unionpay = `
`; let amex_single = `
Slice 1
Created with Sketch.
`; let visa_single = `
Slice 1
Created with Sketch.