forked from ShubhamThakur273/Courier-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment.html
More file actions
591 lines (511 loc) · 18.2 KB
/
payment.html
File metadata and controls
591 lines (511 loc) · 18.2 KB
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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payment Gateway - FlipZon</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body {
background-color: #f9f9f9;
color: #333;
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header {
background-color: white;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
position: fixed;
width: 100%;
z-index: 100;
}
.header-container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 0;
}
.logo {
font-size: 1.8rem;
font-weight: 700;
color: #ff6b00;
margin-left: -30px;
}
.logo span {
color: #333;
}
nav {
margin-right: -30px;
}
nav ul {
display: flex;
}
nav ul li {
margin-left: 30px;
}
nav ul li a {
font-weight: 600;
transition: color 0.3s ease;
}
nav ul li a:hover {
color: #ff6b00;
}
.btn {
display: inline-block;
padding: 12px 30px;
background-color: #ff6b00;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-weight: 600;
transition: all 0.3s ease;
box-shadow: 1px 1px 5px rgb(233, 232, 232);
}
.btn:hover {
background-color: #e05d00;
transform: translateY(-2px);
}
.payment-container {
padding: 120px 0 60px;
margin-top: -100px;
}
.payment-header {
text-align: center;
margin-bottom: 40px;
}
.payment-header h1 {
font-size: 2.5rem;
color: #333;
margin-bottom: 15px;
}
.payment-header p {
font-size: 1.1rem;
color: #666;
}
.payment-content {
display: flex;
gap: 40px;
max-width: 1100px;
margin: 0 auto;
}
.payment-summary {
flex: 1;
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.payment-summary h2 {
font-size: 1.8rem;
margin-bottom: 20px;
color: #333;
border-bottom: 2px solid #ff6b00;
padding-bottom: 10px;
}
.plan-details {
margin-bottom: 30px;
}
.plan-name {
font-size: 1.5rem;
color: #ff6b00;
margin-bottom: 10px;
}
.plan-price {
font-size: 2rem;
font-weight: 700;
margin-bottom: 20px;
}
.plan-features {
margin-bottom: 20px;
}
.plan-features li {
padding: 8px 0;
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
}
.plan-features li i {
margin-right: 10px;
color: #ff6b00;
}
.payment-form-container {
flex: 1.5;
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.payment-form-container h2 {
font-size: 1.8rem;
margin-bottom: 20px;
color: #333;
border-bottom: 2px solid #ff6b00;
padding-bottom: 10px;
}
.payment-form {
display: flex;
flex-direction: column;
gap: 20px;
}
.form-group {
display: flex;
flex-direction: column;
}
.form-group label {
margin-bottom: 8px;
font-weight: 600;
color: #555;
}
.form-group input,
.form-group select {
padding: 12px 15px;
border: 1px solid #ddd;
border-radius: 5px;
font-size: 1rem;
transition: all 0.3s ease;
}
.form-group input:focus,
.form-group select:focus {
outline: none;
border-color: #ff6b00;
box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.2);
}
.card-element {
padding: 12px 15px;
border: 1px solid #ddd;
border-radius: 5px;
background: white;
}
.card-row {
display: flex;
gap: 20px;
}
.card-row .form-group {
flex: 1;
}
.payment-actions {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20px;
}
.payment-actions a {
color: #ff6b00;
font-weight: 600;
text-decoration: none;
transition: color 0.3s ease;
}
.payment-actions a:hover {
color: #e05d00;
}
.payment-methods {
margin-top: 30px;
}
.payment-methods h3 {
font-size: 1.2rem;
margin-bottom: 15px;
color: #555;
}
.payment-options {
display: flex;
gap: 15px;
}
.payment-option {
border: 1px solid #ddd;
border-radius: 5px;
padding: 10px 15px;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 10px;
}
.payment-option i {
font-size: 1.5rem;
}
.payment-option:hover {
border-color: #ff6b00;
}
.payment-option.active {
border-color: #ff6b00;
background-color: rgba(255, 107, 0, 0.05);
}
:root {
--bg-color: #f9f9f9;
--text-color: #333;
--primary-color: #ff6b00;
--secondary-color: #e05d00;
--card-bg: #fff;
--border-color: #ddd;
--shadow-color: rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] {
--bg-color: #121212;
--text-color: #f5f5f5;
--primary-color: #ff6b00;
--secondary-color: #ff8920;
--card-bg: #1e1e1e;
--border-color: #333;
--shadow-color: rgba(255, 255, 255, 0.05);
}
body {
background-color: var(--bg-color);
color: var(--text-color);
}
.toast {
position: fixed;
bottom: 30px;
right: 30px;
background: var(--primary-color);
color: #fff;
padding: 12px 20px;
border-radius: 8px;
display: none;
z-index: 2000;
}
@media (max-width: 768px) {
.payment-content {
flex-direction: column;
}
.card-row {
flex-direction: column;
gap: 20px;
}
nav ul li {
margin-left: 15px;
}
}
@media (max-width: 480px) {
.payment-header h1 {
font-size: 2rem;
}
.payment-summary h2,
.payment-form-container h2 {
font-size: 1.5rem;
}
nav ul {
flex-wrap: wrap;
justify-content: center;
}
nav ul li {
margin: 5px 10px;
}
}
.progress-bar {
display: flex;
justify-content: space-between;
margin-bottom: 30px;
}
.step {
flex: 1;
text-align: center;
padding: 10px;
border-bottom: 3px solid #ddd;
font-weight: 600;
}
.step.active {
border-color: var(--primary-color);
}
</style>
</head>
<body>
<section class="payment-container">
<div class="container">
<div class="payment-header">
<h1>Complete Your Purchase</h1>
<p>Secure payment processed through our encrypted gateway</p>
</div>
<div class="payment-content">
<div class="payment-summary">
<h2>Order Summary</h2>
<div class="plan-details">
<h3 class="plan-name">Express Plan</h3>
<div class="plan-price">₹599</div>
<ul class="plan-features">
<li><i class="fas fa-check"></i> 24-hour delivery</li>
<li><i class="fas fa-check"></i> Domestic shipping</li>
<li><i class="fas fa-check"></i> Advanced tracking</li>
<li><i class="fas fa-check"></i> Up to 10kg</li>
</ul>
</div>
<div class="total">
<div style="display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid #eee;">
<span>Subtotal:</span>
<span>₹599</span>
</div>
<div style="display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid #eee;">
<span>Tax (18%):</span>
<span>₹107.82</span>
</div>
<div style="display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid #eee; font-weight: 700; font-size: 1.2rem;">
<span>Total:</span>
<span>₹706.82</span>
<button id="themeToggle" class="btn">Toggle Dark Mode</button>
</div>
</div>
</div>
<div class="payment-form-container">
<h2>Payment Details</h2>
<form class="payment-form" id="paymentForm">
<div class="form-group">
<label for="card-name">Name on Card</label>
<input type="text" id="card-name" placeholder="Enter name as on card" required>
</div>
<div class="form-group">
<label for="card-number">Card Number</label>
<input type="text" id="card-number" placeholder="1234 5678 9012 3456" required>
</div>
<div class="card-row">
<div class="form-group">
<label for="expiry-date">Expiry Date</label>
<input type="text" id="expiry-date" placeholder="MM/YY" required>
</div>
<div class="form-group">
<label for="cvv">CVV</label>
<input type="text" id="cvv" placeholder="123" required>
</div>
</div>
<div class="form-group">
<label for="country">Country</label>
<select id="country" required>
<option value="">Select Country</option>
<option value="IN" selected>India</option>
<option value="US">United States</option>
<option value="UK">United Kingdom</option>
<option value="CA">Canada</option>
<option value="AU">Australia</option>
</select>
</div>
<div class="form-group">
<label for="zip-code">ZIP/Postal Code</label>
<input type="text" id="zip-code" placeholder="Enter ZIP code" required>
</div>
<div class="payment-methods">
<h3>Payment Method</h3>
<div class="payment-options">
<div class="payment-option active">
<i class="fab fa-cc-visa"></i>
<span>Card</span>
</div>
<div class="payment-option">
<i class="fab fa-google-pay"></i>
<span>Google Pay</span>
</div>
<div class="payment-option">
<i class="fab fa-paypal"></i>
<span>PayPal</span>
</div>
</div>
</div>
<div class="form-group card-logo"></div>
<div class="progress-bar">
<div class="step active">Plan</div>
<div class="step">Address</div>
<div class="step">Payment</div>
<div class="step">Done</div>
</div>
<div class="payment-actions">
<a href="index.html#pricing"><i class="fas fa-arrow-left"></i> Back to Plans</a>
<button type="submit" class="btn">Pay ₹706.82</button>
</div>
</form>
</div>
</div>
</div>
</section>
<script>
document.getElementById("themeToggle").addEventListener("click", () => {
const theme = document.documentElement.getAttribute("data-theme");
document.documentElement.setAttribute("data-theme", theme === "dark" ? "light" : "dark");
});
document.getElementById('card-number').addEventListener('input', function (e) {
const value = e.target.value.replace(/\D/g, '');
const visaRegex = /^4[0-9]{0,}/;
const masterCardRegex = /^5[1-5][0-9]{0,}/;
const logoContainer = document.querySelector(".card-logo");
if (visaRegex.test(value)) {
logoContainer.innerHTML = '<i class="fab fa-cc-visa"></i>';
} else if (masterCardRegex.test(value)) {
logoContainer.innerHTML = '<i class="fab fa-cc-mastercard"></i>';
} else {
logoContainer.innerHTML = '';
}
});
function validateCardNumber(number) {
return /^[0-9]{16}$/.test(number.replace(/\s/g, ''));
}
function validateExpiryDate(date) {
return /^(0[1-9]|1[0-2])\/?([0-9]{2})$/.test(date);
}
document.getElementById('paymentForm').addEventListener('submit', function(e) {
e.preventDefault();
// Simple validation
const cardNumber = document.getElementById('card-number').value;
const expiryDate = document.getElementById('expiry-date').value;
const cvv = document.getElementById('cvv').value;
if (!cardNumber || !expiryDate || !cvv) {
alert('Please fill in all payment details');
return;
}
// In a real implementation, you would process payment here
// For demo, we'll simulate a successful payment
const submitBtn = document.querySelector('#paymentForm .btn');
submitBtn.textContent = 'Processing...';
submitBtn.disabled = true;
// Simulate payment processing
setTimeout(() => {
submitBtn.textContent = '✓ Payment Successful!';
submitBtn.style.background = 'linear-gradient(135deg, #00c853, #5efc82)';
// Redirect to confirmation page after 1.5 seconds
setTimeout(() => {
window.location.href = 'payment-success.html';
}, 1500);
}, 2000);
});
// Toggle payment methods
const paymentOptions = document.querySelectorAll('.payment-option');
paymentOptions.forEach(option => {
option.addEventListener('click', () => {
paymentOptions.forEach(opt => opt.classList.remove('active'));
option.classList.add('active');
});
});
function showToast(message) {
const toast = document.getElementById('toast');
toast.textContent = message;
toast.style.display = 'block';
setTimeout(() => {
toast.style.display = 'none';
}, 3000);
}
// Format card number input
document.getElementById('card-number').addEventListener('input', function(e) {
let value = e.target.value.replace(/\s+/g, '');
if (value.length > 0) {
value = value.match(new RegExp('.{1,4}', 'g')).join(' ');
}
e.target.value = value;
});
// Format expiry date input
document.getElementById('expiry-date').addEventListener('input', function(e) {
let value = e.target.value.replace(/\D/g, '');
if (value.length > 2) {
value = value.substring(0, 2) + '/' + value.substring(2, 4);
}
e.target.value = value;
});
</script>
</body>
</html>