-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpayment.html
369 lines (308 loc) · 11.8 KB
/
payment.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payment</title>
<link rel="icon" href="image\lumen5 icon.jpg" type="image/x-icon">
<!-- custom css file link -->
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap');
* {
font-family: 'Poppins', sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
outline: none;
border: none;
text-decoration: none;
text-transform: uppercase;
}
.container {
min-height: 100vh;
background: #eee;
display: flex;
align-items: center;
justify-content: center;
flex-flow: column;
padding-bottom: 60px;
}
.container form {
background: #fff;
border-radius: 5px;
box-shadow: 0 10px 15px rgba(0, 0, 0, .1);
padding: 20px;
width: 600px;
padding-top: 160px;
}
.container form .inputBox {
margin-top: 20px;
}
.container form .inputBox span {
display: block;
color: #999;
padding-bottom: 5px;
}
.container form .inputBox input,
.container form .inputBox select {
width: 100%;
padding: 10px;
border-radius: 10px;
border: 1px solid rgba(0, 0, 0, .3);
color: #444;
}
.container form .flexbox {
display: flex;
gap: 15px;
}
.container form .flexbox .inputBox {
flex: 1 1 150px;
}
.container form .submit-btn {
width: 100%;
background: linear-gradient(45deg, blueviolet, rgb(58, 188, 199));
margin-top: 20px;
padding: 10px;
font-size: 20px;
color: #fff;
border-radius: 10px;
cursor: pointer;
transition: .2s linear;
}
.container form .submit-btn:hover {
letter-spacing: 2px;
opacity: .8;
}
.container .card-container {
margin-bottom: -150px;
position: relative;
height: 250px;
width: 400px;
}
.container .card-container .front {
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
background: linear-gradient(45deg, blueviolet, rgb(58, 188, 199));
border-radius: 5px;
backface-visibility: hidden;
box-shadow: 0 15px 25px rgba(0, 0, 0, .2);
padding: 20px;
transform: perspective(1000px) rotateY(0deg);
transition: transform .4s ease-out;
}
.container .card-container .front .image {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 10px;
}
.container .card-container .front .image img {
height: 50px;
}
.container .card-container .front .card-number-box {
padding: 30px 0;
font-size: 22px;
color: #fff;
}
.container .card-container .front .flexbox {
display: flex;
}
.container .card-container .front .flexbox .box:nth-child(1) {
margin-right: auto;
}
.container .card-container .front .flexbox .box {
font-size: 15px;
color: #fff;
}
.container .card-container .back {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: linear-gradient(45deg, blueviolet, rgb(58, 188, 199));
border-radius: 5px;
padding: 20px 0;
text-align: right;
backface-visibility: hidden;
box-shadow: 0 15px 25px rgba(0, 0, 0, .2);
transform: perspective(1000px) rotateY(180deg);
transition: transform .4s ease-out;
}
.container .card-container .back .stripe {
background: #000;
width: 100%;
margin: 10px 0;
height: 50px;
}
.container .card-container .back .box {
padding: 0 20px;
}
.container .card-container .back .box span {
color: #fff;
font-size: 15px;
}
.container .card-container .back .box .cvv-box {
height: 50px;
padding: 10px;
margin-top: 5px;
color: #333;
background: #fff;
border-radius: 5px;
width: 100%;
}
.container .card-container .back .box img {
margin-top: 30px;
height: 30px;
}
</style>
</head>
<body>
<div class="container">
<div class="card-container">
<div class="front">
<div class="image">
<img src="image\chip.png" alt="">
<img src="image\visa.png" alt="">
</div>
<div class="card-number-box">################</div>
<div class="flexbox">
<div class="box">
<span>card holder</span>
<div class="card-holder-name">full name</div>
</div>
<div class="box">
<span>expires</span>
<div class="expiration">
<span class="exp-month">mm</span>
<span class="exp-year">yy</span>
</div>
</div>
</div>
</div>
<div class="back">
<div class="stripe"></div>
<div class="box">
<span>cvv</span>
<div class="cvv-box"></div>
<img src="image/visa.png" alt="">
</div>
</div>
</div>
<form action="">
<div class="inputBox">
<span>card number</span>
<input type="text" maxlength="16" class="card-number-input">
</div>
<div class="inputBox">
<span>card holder</span>
<input type="text" class="card-holder-input">
</div>
<div class="flexbox">
<div class="inputBox">
<span>expiration mm</span>
<select name="" id="" class="month-input">
<option value="month" selected disabled>month</option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
</div>
<div class="inputBox">
<span>expiration yy</span>
<select name="" id="" class="year-input">
<option value="year" selected disabled>year</option>
<option value="2021">2021</option>
<option value="2022">2022</option>
<option value="2023">2023</option>
<option value="2024">2024</option>
<option value="2025">2025</option>
<option value="2026">2026</option>
<option value="2027">2027</option>
<option value="2028">2028</option>
<option value="2029">2029</option>
<option value="2030">2030</option>
</select>
</div>
<div class="inputBox">
<span>cvv</span>
<input type="text" maxlength="4" class="cvv-input">
</div>
</div>
<input type="submit" value="submit" class="submit-btn">
</form>
</div>
<script>
document.querySelector('.card-number-input').oninput = () => {
let cardInput = document.querySelector('.card-number-input').value;
document.querySelector('.card-number-box').innerText = cardInput
}
document.querySelector('.card-holder-input').oninput = () => {
let cardHolder = document.querySelector('.card-holder-input').value;
document.querySelector('.card-holder-name').innerText = cardHolder
}
document.querySelector('.month-input').oninput = () => {
let monthInput = document.querySelector('.month-input').value;
document.querySelector('.exp-month').innerText = monthInput
}
document.querySelector('.year-input').oninput = () => {
document.querySelector('.exp-year').innerText = document.querySelector('.year-input').value;
}
document.querySelector('.cvv-input').onmouseenter = () => {
document.querySelector('.front').style.transform = 'perspective(1000px) rotateY(-180deg)';
document.querySelector('.back').style.transform = 'perspective(1000px) rotateY(0deg)';
}
document.querySelector('.cvv-input').onmouseleave = () => {
document.querySelector('.front').style.transform = 'perspective(1000px) rotateY(0deg)';
document.querySelector('.back').style.transform = 'perspective(1000px) rotateY(180deg)';
}
document.querySelector('.cvv-input').oninput = () => {
document.querySelector('.cvv-box').innerText = document.querySelector('.cvv-input').value;
}
document.querySelector('.submit-btn').addEventListener('click', function () {
event.preventDefault();
let cardInput = document.querySelector('.card-number-input').value;
let cardHolder = document.querySelector('.card-holder-input').value;
let monthInput = document.querySelector('.month-input').value;
let yearInput= document.querySelector('.year-input').value;
let cvvInput=document.querySelector('.cvv-input').value;
if (cardInput.length < 16 ) {
alert('Card Number must be of 16 digits. Please check card number & Try again');
window.location.href = "payment.html"
}
else if(monthInput=="month" ){
alert(" Please enter Expiry Month of card");
window.location.href = "payment.html"
}
else if(yearInput=="year" ){
alert(" Please enter Expiry year of card");
window.location.href = "payment.html"
}
else if (cvvInput.length<3) {
alert("Please enter correct CVV ");
window.location.href = "payment.html"
}
else if(cardHolder.length<=0 ){
alert(" Please enter Cardholder Name");
window.location.href = "payment.html"
}
else{
window.location.href = "successfull.html"
}
})
</script>
</body>
</html>