-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment.html
More file actions
758 lines (675 loc) · 39.2 KB
/
payment.html
File metadata and controls
758 lines (675 loc) · 39.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
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Secure Payment - MD. MASUDUL HASAN</title>
<!-- Fonts -->
<link
href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&family=Great+Vibes&family=Inter:wght@400;500;600;700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Tailwind -->
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
bg: '#080808',
glass: 'rgba(255, 255, 255, 0.03)',
'glass-border': 'rgba(255, 255, 255, 0.08)',
primary: '#00f2ff', // Cyan
secondary: '#4d4dff',
surface: '#121212',
},
fontFamily: {
sans: ['Outfit', 'sans-serif'],
mono: ['Space Grotesk', 'monospace'],
signature: ['Great Vibes', 'cursive'],
report: ['Inter', 'sans-serif'],
},
boxShadow: {
'neon': '0 0 20px rgba(0, 242, 255, 0.2)',
'neon-card': '0 0 30px rgba(0, 242, 255, 0.1)',
}
}
}
}
</script>
<!-- GSAP -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<style>
body {
background-color: #080808;
color: #e0e0e0;
overflow-x: hidden;
}
/* Glassmorphism */
.glass-panel {
background: rgba(255, 255, 255, 0.03);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.08);
}
/* Glow Effect for Profile */
.profile-glow {
box-shadow: 0 0 25px rgba(0, 242, 255, 0.4);
border: 2px solid #00f2ff;
}
/* Ambient Background Glow */
.ambient-glow {
background: radial-gradient(circle at 50% 50%, rgba(0, 242, 255, 0.05), transparent 70%);
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: -1;
}
/* Scrollbar */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #080808;
}
::-webkit-scrollbar-thumb {
background: #333;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #00f2ff;
}
/* PDF Report Styles — completely hidden, clone is used for PDF */
#payment-report {
display: none;
}
/* Visible clone used during PDF capture */
#payment-report-clone {
position: fixed;
top: 0;
left: 0;
width: 210mm;
min-height: 297mm;
padding: 40px;
box-sizing: border-box;
background: white;
color: black;
font-family: 'Inter', Arial, sans-serif;
z-index: 99999;
}
@media print {
body * {
visibility: hidden;
}
#payment-report,
#payment-report * {
visibility: visible;
}
#payment-report {
display: block;
position: absolute;
left: 0;
top: 0;
opacity: 1;
}
}
</style>
</head>
<body class="min-h-screen flex items-center justify-center p-4 md:p-8">
<div class="ambient-glow"></div>
<main class="w-full max-w-6xl grid lg:grid-cols-12 gap-8 items-start relative z-10">
<!-- Left Column: Summary -->
<div class="lg:col-span-5 space-y-6" id="left-col">
<!-- Branding Header -->
<div class="text-center lg:text-left mb-4">
<h1 class="text-3xl font-bold font-mono tracking-tighter text-white">
MASUDUL <span class="text-primary">HASAN</span>
</h1>
<p class="text-xs text-gray-500 uppercase tracking-widest mt-1">Computer Science & Engineering</p>
</div>
<!-- Transaction Details Card -->
<div class="glass-panel rounded-2xl p-8 relative overflow-hidden group">
<div class="absolute top-0 right-0 w-40 h-40 bg-primary/5 rounded-full blur-3xl -mr-20 -mt-20"></div>
<!-- Recipient Profile -->
<div class="flex items-center gap-4 mb-8">
<div class="relative">
<div class="w-16 h-16 rounded-full profile-glow overflow-hidden bg-black">
<!-- Using a placeholder if image fails, or try generic person icon -->
<img src="PNG/MASUDUL-HASAN.png"
onerror="this.src='https://ui-avatars.com/api/?name=Masudul+Hasan&background=00f2ff&color=000'"
alt="Profile" class="w-full h-full object-cover">
</div>
<div
class="absolute -bottom-1 -right-1 bg-blue-500 text-white text-[10px] w-6 h-6 flex items-center justify-center rounded-full border-2 border-[#121212]">
<i class="fas fa-check"></i>
</div>
</div>
<div>
<p class="text-xs text-gray-400 uppercase tracking-widest mb-1">Payment To</p>
<h2 class="text-lg font-bold text-white leading-tight">MD. MASUDUL HASAN</h2>
<p class="text-xs text-primary mt-1 flex items-center gap-1">
<i class="fas fa-shield-alt"></i> Verified Professional
</p>
</div>
</div>
<!-- Fields -->
<div class="space-y-5">
<!-- Support Type -->
<div>
<label class="block text-xs text-gray-500 uppercase tracking-wider mb-2">Support Type</label>
<div class="relative">
<select id="payment-purpose"
class="w-full bg-black/40 border border-gray-800 rounded-lg px-4 py-3 text-white focus:border-primary focus:outline-none appearance-none transition-colors">
<option>Coffee / Project Support</option>
<option>Consultation Fee</option>
<option>Service Charge</option>
<option>Donation</option>
</select>
<i class="fas fa-chevron-down absolute right-4 top-4 text-gray-600 pointer-events-none"></i>
</div>
</div>
<!-- Amount Input -->
<div>
<label class="block text-xs text-gray-500 uppercase tracking-wider mb-2">Subtotal (BDT)</label>
<input type="number" id="amount-input" value="500" min="10"
class="w-full bg-black/40 border border-gray-800 rounded-lg px-4 py-3 text-white font-mono text-lg focus:border-primary focus:outline-none transition-colors"
oninput="updateTotal()">
</div>
<!-- Metadata -->
<div class="flex justify-between text-sm py-2 border-b border-white/5">
<span class="text-gray-400">Convenience Charge</span>
<span class="font-mono text-white">0.00 BDT</span>
</div>
<!-- Total -->
<div class="flex justify-between items-end pt-2">
<span class="font-bold text-white text-lg">Total Amount</span>
<span class="text-3xl font-bold text-primary font-mono drop-shadow-lg" id="total-text">500
BDT</span>
</div>
</div>
<!-- Signature -->
<div class="mt-8 text-right">
<p class="font-signature text-2xl text-gray-500 rotate-[-5deg] inline-block opacity-70">Masudul
Hasan</p>
</div>
</div>
<!-- Footer Badge -->
<div class="text-center opacity-60">
<p class="text-[10px] text-gray-500 uppercase tracking-widest">
Powered by <span class="font-bold text-gray-400">MASUDUL HASAN Infrastructure</span>
</p>
</div>
</div>
<!-- Right Column: Payment Methods -->
<div class="lg:col-span-7" id="right-col">
<div class="glass-panel rounded-2xl overflow-hidden min-h-[600px] flex flex-col">
<div class="p-8 border-b border-white/5">
<h2 class="text-xl font-bold text-white">Select Your Preferred Method</h2>
</div>
<!-- Tabs -->
<div class="flex border-b border-white/5">
<button
class="flex-1 py-4 text-sm font-bold uppercase tracking-wider text-primary border-b-2 border-primary bg-primary/5 transition-all"
id="tab-mobile" onclick="switchTab('mobile')">
Mobile Banking
</button>
<button
class="flex-1 py-4 text-sm font-bold uppercase tracking-wider text-gray-500 hover:text-white transition-all"
id="tab-cards" onclick="switchTab('cards')">
Cards
</button>
</div>
<!-- Content -->
<div class="p-8 flex-1 relative">
<!-- Mobile Banking Grid -->
<div id="content-mobile" class="grid grid-cols-2 sm:grid-cols-3 gap-4">
<!-- Items -->
<div class="method-card cursor-pointer group p-4 rounded-xl border border-white/10 bg-white/5 hover:border-primary/50 hover:bg-primary/5 transition-all flex flex-col items-center gap-3 relative overflow-hidden"
onclick="selectMethod(this, 'bKash')" data-qr="PNG/bKash.png" data-number="01572902196"
data-type="MASUDUL">
<div
class="w-14 h-14 bg-white rounded-lg p-1 flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform">
<img src="PNG/bkash-logo-free-vector.jpg" class="w-full h-full object-contain rounded">
</div>
<span class="text-xs font-bold text-gray-400 group-hover:text-white">bKash</span>
<div
class="absolute inset-0 border-2 border-primary opacity-0 group-[.selected]:opacity-100 rounded-xl transition-opacity pointer-events-none">
</div>
</div>
<!-- bKash Payment Link (Separate Card) -->
<div class="method-card cursor-pointer group p-4 rounded-xl border border-white/10 bg-white/5 hover:border-primary/50 hover:bg-primary/5 transition-all flex flex-col items-center gap-3 relative overflow-hidden"
onclick="selectMethod(this, 'bKash Link')" data-number="01572902196" data-type="Merchant">
<div
class="w-14 h-14 bg-white rounded-lg p-1 flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform">
<img src="PNG/Bkash-logo.png" class="w-full h-full object-contain rounded">
</div>
<span class="text-xs font-bold text-gray-400 group-hover:text-white">Payment Link</span>
<div
class="absolute inset-0 border-2 border-primary opacity-0 group-[.selected]:opacity-100 rounded-xl transition-opacity pointer-events-none">
</div>
</div>
<div class="method-card cursor-pointer group p-4 rounded-xl border border-white/10 bg-white/5 hover:border-primary/50 hover:bg-primary/5 transition-all flex flex-col items-center gap-3 relative overflow-hidden"
onclick="selectMethod(this, 'Nagad')" data-qr="PNG/Nagad-qr.png" data-number="01572902196"
data-type="Merchant">
<div
class="w-14 h-14 bg-white rounded-lg p-1 flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform">
<img src="PNG/Nagad.png" class="w-full h-full object-contain">
</div>
<span class="text-xs font-bold text-gray-400 group-hover:text-white">Nagad</span>
<div
class="absolute inset-0 border-2 border-primary opacity-0 group-[.selected]:opacity-100 rounded-xl transition-opacity pointer-events-none">
</div>
</div>
<div class="method-card cursor-pointer group p-4 rounded-xl border border-white/10 bg-white/5 hover:border-primary/50 hover:bg-primary/5 transition-all flex flex-col items-center gap-3 relative overflow-hidden"
onclick="selectMethod(this, 'Rocket')" data-qr="PNG/Rocket-QR.jpg" data-number="01572902196"
data-type="Merchant">
<div
class="w-14 h-14 bg-white rounded-lg p-1 flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform">
<img src="PNG/rocket.png" class="w-full h-full object-contain rounded">
</div>
<span class="text-xs font-bold text-gray-400 group-hover:text-white">Rocket</span>
<div
class="absolute inset-0 border-2 border-primary opacity-0 group-[.selected]:opacity-100 rounded-xl transition-opacity pointer-events-none">
</div>
</div>
<div class="method-card cursor-pointer group p-4 rounded-xl border border-white/10 bg-white/5 hover:border-primary/50 hover:bg-primary/5 transition-all flex flex-col items-center gap-3 relative overflow-hidden"
onclick="selectMethod(this, 'Upay')" data-qr="PNG/Upay-qr.png" data-number="01572902196"
data-type="Merchant">
<div
class="w-14 h-14 bg-white rounded-lg p-1 flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform">
<img src="PNG/upay.jpg" class="w-full h-full object-contain rounded">
</div>
<span class="text-xs font-bold text-gray-400 group-hover:text-white">Upay</span>
<div
class="absolute inset-0 border-2 border-primary opacity-0 group-[.selected]:opacity-100 rounded-xl transition-opacity pointer-events-none">
</div>
</div>
<!-- Bangla QR (Replaces Tap) -->
<div class="method-card cursor-pointer group p-4 rounded-xl border border-white/10 bg-white/5 hover:border-primary/50 hover:bg-primary/5 transition-all flex flex-col items-center gap-3 relative overflow-hidden"
onclick="selectMethod(this, 'Bangla QR')" data-qr="PNG/bangla-scan-qr.png"
data-number="01572902196" data-type="Merchant">
<div
class="w-14 h-14 bg-white rounded-lg p-1 flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform">
<img src="PNG/bangla-logo.png" class="w-full h-full object-contain rounded">
</div>
<span class="text-xs font-bold text-gray-400 group-hover:text-white">Bangla QR</span>
<div
class="absolute inset-0 border-2 border-primary opacity-0 group-[.selected]:opacity-100 rounded-xl transition-opacity pointer-events-none">
</div>
</div>
</div>
<!-- Cards Content (Hidden) -->
<div id="content-cards" class="hidden h-full flex items-center justify-center text-center">
<div>
<div
class="w-20 h-20 bg-white/5 rounded-full flex items-center justify-center mx-auto mb-4">
<i class="far fa-credit-card text-3xl text-gray-500"></i>
</div>
<p class="text-gray-400">Card payments are coming soon.</p>
</div>
</div>
<!-- Action Area (QR Display + Button) -->
<div id="action-area"
class="absolute bottom-6 left-6 right-6 top-6 bg-black/90 backdrop-blur-xl rounded-2xl p-6 flex flex-col items-center justify-center hidden opacity-0 transition-opacity duration-300 z-20">
<!-- Close Button -->
<button onclick="closeActionArea()"
class="absolute top-4 right-4 text-gray-400 hover:text-white">
<i class="fas fa-times text-xl"></i>
</button>
<h3 class="text-lg font-bold text-white mb-4 flex items-center gap-2">
Pay via <span id="selected-method-name" class="text-primary">Method</span>
</h3>
<!-- QR Code Container -->
<div id="qr-container" class="bg-white p-3 rounded-xl mb-4 shadow-neon-card hidden">
<img id="qr-image" src="" class="w-40 h-40 object-contain">
</div>
<!-- Wallet Details -->
<div class="text-center mb-6 space-y-1">
<p class="text-gray-400 text-xs uppercase tracking-widest">Merchant Payment</p>
<div
class="flex items-center gap-2 justify-center bg-white/5 px-4 py-2 rounded-lg border border-white/10">
<i class="fas fa-mobile-alt text-gray-400"></i>
<span id="wallet-number"
class="text-xl font-mono font-bold text-white tracking-wider">01XXXXXXX</span>
<button
onclick="navigator.clipboard.writeText(document.getElementById('wallet-number').innerText)"
class="text-primary hover:text-white ml-2 text-xs">
<i class="fas fa-copy"></i>
</button>
</div>
<p id="wallet-type" class="text-xs text-gray-500">MASUDUL Account</p>
</div>
<!-- bKash Payment Link Button (Hidden by default) -->
<div id="bkash-link-container" class="hidden mb-6 w-full flex justify-center">
<a href="https://shop.bkash.com/masudul01572902196/paymentlink/default-payment"
target="_blank" class="block w-48 hover:scale-105 transition-transform">
<img src="PNG/Bkash-logo.png" alt="Pay with bKash"
class="w-full h-auto rounded shadow-lg border border-white/10">
</a>
</div>
<button onclick="processPayment()"
class="w-full max-w-sm py-3 bg-primary text-black font-bold text-lg rounded-xl hover:bg-white hover:scale-[1.02] transition-all shadow-neon flex items-center justify-center gap-2">
<span>I Have Paid</span>
<i class="fas fa-check-circle"></i>
</button>
</div>
</div>
</div>
</div>
</main>
<!-- HIDDEN PDF INVOICE TEMPLATE -->
<div id="payment-report">
<!-- Coloured header banner -->
<div
style="background: linear-gradient(135deg,#0a0a1a 0%,#0f2044 60%,#00b4cc 100%); padding:30px 40px; margin:-40px -40px 30px -40px; border-radius:0;">
<table style="width:100%; border-collapse:collapse;">
<tr>
<td style="vertical-align:middle;">
<div style="display:inline-flex; align-items:center; gap:14px;">
<img src="PNG/MH.png" alt="Logo"
style="width:52px; height:52px; object-fit:contain; border-radius:8px; background:rgba(255,255,255,0.1); padding:4px;"
onerror="this.style.display='none'">
<div>
<p
style="font-size:20px; font-weight:900; color:#fff; margin:0; letter-spacing:0.05em;">
MASUDUL HASAN</p>
<p
style="font-size:10px; color:#00f2ff; margin:4px 0 0; text-transform:uppercase; letter-spacing:0.12em;">
Computer Science & Engineering · SSTU</p>
</div>
</div>
</td>
<td style="text-align:right; vertical-align:middle;">
<p style="font-size:22px; font-weight:900; color:#fff; margin:0; letter-spacing:0.08em;">INVOICE
</p>
<p style="font-size:10px; color:#00f2ff; margin:6px 0 0; font-family:monospace;"
id="report-trx-id">TXN-XXXXXXXXX</p>
<span
style="display:inline-block; margin-top:6px; background:#00f2ff; color:#000; font-size:9px; font-weight:700; padding:3px 10px; border-radius:20px; text-transform:uppercase; letter-spacing:0.1em;">PAID</span>
</td>
</tr>
</table>
</div>
<!-- Meta row -->
<table style="width:100%; border-collapse:collapse; margin-bottom:28px;">
<tr>
<!-- Bill From -->
<td style="width:48%; vertical-align:top; padding-right:20px;">
<p
style="font-size:9px; font-weight:700; color:#9ca3af; text-transform:uppercase; letter-spacing:0.1em; margin:0 0 8px;">
Received By</p>
<p style="font-size:14px; font-weight:700; color:#111827; margin:0 0 3px;">MD. Masudul Hasan</p>
<p style="font-size:11px; color:#6b7280; margin:0 0 2px;">📱 01572-902196</p>
<p style="font-size:11px; color:#6b7280; margin:0 0 2px;">🌐 masudul2002.github.io</p>
<p style="font-size:11px; color:#6b7280; margin:0;">🎓 SSTU, Bangladesh</p>
</td>
<!-- Bill To (payer) -->
<td style="width:4%;"></td>
<td style="width:48%; vertical-align:top;">
<p
style="font-size:9px; font-weight:700; color:#9ca3af; text-transform:uppercase; letter-spacing:0.1em; margin:0 0 8px;">
Invoice Details</p>
<table style="width:100%; border-collapse:collapse;">
<tr>
<td style="font-size:11px; color:#6b7280; padding:2px 0;">Date & Time:</td>
<td style="font-size:11px; color:#111827; font-weight:600; padding:2px 0; text-align:right;"
id="report-date"></td>
</tr>
<tr>
<td style="font-size:11px; color:#6b7280; padding:2px 0;">Method:</td>
<td style="font-size:11px; color:#111827; font-weight:600; padding:2px 0; text-align:right;"
id="report-method">—</td>
</tr>
<tr>
<td style="font-size:11px; color:#6b7280; padding:2px 0;">Reference:</td>
<td style="font-size:11px; color:#111827; font-weight:600; padding:2px 0; text-align:right;"
id="report-ref"></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Divider -->
<div style="height:1px; background:#e5e7eb; margin-bottom:24px;"></div>
<!-- Transaction Table -->
<table
style="width:100%; border-collapse:collapse; margin-bottom:28px; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden;">
<thead>
<tr style="background:#f8fafc;">
<th
style="padding:11px 14px; font-size:9px; font-weight:700; color:#6b7280; text-transform:uppercase; letter-spacing:0.08em; text-align:left; border-bottom:1px solid #e5e7eb;">
Description</th>
<th
style="padding:11px 14px; font-size:9px; font-weight:700; color:#6b7280; text-transform:uppercase; letter-spacing:0.08em; text-align:left; border-bottom:1px solid #e5e7eb;">
Transaction ID</th>
<th
style="padding:11px 14px; font-size:9px; font-weight:700; color:#6b7280; text-transform:uppercase; letter-spacing:0.08em; text-align:right; border-bottom:1px solid #e5e7eb;">
Amount (BDT)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding:14px; font-size:12px; color:#1f2937; border-bottom:1px solid #f3f4f6;"
id="report-desc">Payment</td>
<td style="padding:14px; font-size:11px; color:#6b7280; font-family:'Courier New',monospace; border-bottom:1px solid #f3f4f6;"
id="report-trx-id-table">—</td>
<td style="padding:14px; font-size:13px; font-weight:700; color:#1f2937; text-align:right; border-bottom:1px solid #f3f4f6;"
id="report-amount">0.00</td>
</tr>
</tbody>
</table>
<!-- Summary -->
<table style="width:100%; margin-bottom:40px;">
<tr>
<td style="width:55%;"></td>
<td style="width:45%;">
<table
style="width:100%; border-collapse:collapse; background:#f8fafc; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden;">
<tr>
<td
style="padding:11px 14px; font-size:12px; color:#6b7280; border-bottom:1px solid #e5e7eb;">
Subtotal</td>
<td style="padding:11px 14px; font-size:12px; font-weight:600; color:#1f2937; text-align:right; border-bottom:1px solid #e5e7eb;"
id="report-subtotal">0.00</td>
</tr>
<tr>
<td
style="padding:11px 14px; font-size:12px; color:#6b7280; border-bottom:1px solid #e5e7eb;">
Convenience Charge</td>
<td
style="padding:11px 14px; font-size:12px; font-weight:600; color:#1f2937; text-align:right; border-bottom:1px solid #e5e7eb;">
0.00</td>
</tr>
<tr style="background:#0f172a;">
<td style="padding:12px 14px; font-size:13px; font-weight:700; color:#fff;">Total Paid (BDT)
</td>
<td style="padding:12px 14px; font-size:16px; font-weight:900; color:#00f2ff; text-align:right;"
id="report-total">0.00</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Signature -->
<div style="text-align:right; padding-right:20px; margin-bottom:40px;">
<p style="font-family:'Great Vibes',cursive; font-size:30px; color:#374151; margin:0;">Masudul Hasan</p>
<div style="width:160px; height:1px; background:#d1d5db; margin:4px 0 4px auto;"></div>
<p style="font-size:10px; color:#9ca3af; margin:0;">Authorized Signature</p>
</div>
<!-- Footer -->
<div style="border-top:1px solid #e5e7eb; padding-top:16px; text-align:center;">
<p style="font-size:10px; color:#9ca3af; margin:0 0 4px;">This is a software-generated invoice. No physical
signature required.</p>
<p style="font-size:9px; color:#d1d5db; margin:0;">masudul2002.github.io · 01572-902196 · SSTU, Bangladesh
</p>
</div>
</div>
<!-- Logic -->
<script>
// GSAP Animations
document.addEventListener("DOMContentLoaded", () => {
gsap.from("#left-col", { duration: 1, x: -50, opacity: 0, ease: "power3.out" });
gsap.from("#right-col", { duration: 1, x: 50, opacity: 0, delay: 0.2, ease: "power3.out" });
});
// State
let selectedMethod = null;
// Update Total
function updateTotal() {
const val = document.getElementById('amount-input').value;
const display = parseFloat(val || 0).toFixed(2);
document.getElementById('total-text').innerText = display + " BDT";
}
// Switch Tabs
function switchTab(tab) {
const mobileBtn = document.getElementById('tab-mobile');
const cardsBtn = document.getElementById('tab-cards');
const mobileContent = document.getElementById('content-mobile');
const cardsContent = document.getElementById('content-cards');
if (tab === 'mobile') {
mobileBtn.className = "flex-1 py-4 text-sm font-bold uppercase tracking-wider text-primary border-b-2 border-primary bg-primary/5 transition-all";
cardsBtn.className = "flex-1 py-4 text-sm font-bold uppercase tracking-wider text-gray-500 hover:text-white transition-all";
mobileContent.classList.remove('hidden');
cardsContent.classList.add('hidden');
} else {
cardsBtn.className = "flex-1 py-4 text-sm font-bold uppercase tracking-wider text-primary border-b-2 border-primary bg-primary/5 transition-all";
mobileBtn.className = "flex-1 py-4 text-sm font-bold uppercase tracking-wider text-gray-500 hover:text-white transition-all";
cardsContent.classList.remove('hidden');
mobileContent.classList.add('hidden');
// Hide action area if switching to unavailable tab
document.getElementById('action-area').classList.add('hidden');
}
}
// Select Method
function selectMethod(el, name) {
// Remove selection from all
document.querySelectorAll('.method-card').forEach(card => {
card.classList.remove('selected', 'border-primary', 'bg-primary/5');
card.classList.add('border-white/10', 'bg-white/5');
});
// Add selection to clicked
el.classList.add('selected', 'border-primary', 'bg-primary/5');
el.classList.remove('border-white/10', 'bg-white/5');
selectedMethod = name;
// Get Data Attributes
const qrSrc = el.getAttribute('data-qr');
const number = el.getAttribute('data-number');
const type = el.getAttribute('data-type');
// Populate Action Area
document.getElementById('selected-method-name').innerText = name;
document.getElementById('wallet-number').innerText = number || 'N/A';
document.getElementById('wallet-type').innerText = type || 'MASUDUL Account';
const qrContainer = document.getElementById('qr-container');
const qrImage = document.getElementById('qr-image');
if (qrSrc) {
qrImage.src = qrSrc;
qrContainer.classList.remove('hidden');
} else {
qrContainer.classList.add('hidden');
}
// Show/Hide bKash Link
const bkashLink = document.getElementById('bkash-link-container');
if (name === 'bKash Link') {
bkashLink.classList.remove('hidden');
// Hide QR for Payment Link method as it uses the button
if (qrContainer) qrContainer.classList.add('hidden');
} else {
bkashLink.classList.add('hidden');
}
// Show Action Area (Overlay style)
const actionArea = document.getElementById('action-area');
actionArea.classList.remove('hidden');
setTimeout(() => {
actionArea.classList.remove('opacity-0');
}, 10);
}
function closeActionArea() {
const actionArea = document.getElementById('action-area');
actionArea.classList.add('opacity-0');
setTimeout(() => {
actionArea.classList.add('hidden');
// Reset selection visual
document.querySelectorAll('.method-card').forEach(card => {
card.classList.remove('selected', 'border-primary', 'bg-primary/5');
card.classList.add('border-white/10', 'bg-white/5');
});
}, 300);
}
// Process Payment & Generate PDF
function processPayment() {
const btn = document.querySelector('#action-area button.w-full');
const originalContent = btn.innerHTML;
btn.innerHTML = '<i class="fas fa-circle-notch fa-spin"></i> Processing...';
btn.disabled = true;
setTimeout(() => {
const amount = parseFloat(document.getElementById('amount-input').value || 0).toFixed(2);
const purpose = document.getElementById('payment-purpose').value;
const now = new Date();
const randomId = 'TXN-' + Math.floor(Math.random() * 9000000000 + 1000000000);
const dateStr = now.toLocaleString('en-GB', {
day: '2-digit', month: 'short', year: 'numeric',
hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: true
});
// Populate template fields
const tmpl = document.getElementById('payment-report');
tmpl.querySelector('#report-date').innerText = dateStr;
tmpl.querySelector('#report-trx-id').innerText = randomId;
tmpl.querySelector('#report-trx-id-table').innerText = randomId;
tmpl.querySelector('#report-ref').innerText = purpose;
tmpl.querySelector('#report-desc').innerText = purpose;
tmpl.querySelector('#report-method').innerText = selectedMethod || '—';
tmpl.querySelector('#report-amount').innerText = amount;
tmpl.querySelector('#report-subtotal').innerText = amount;
tmpl.querySelector('#report-total').innerText = amount;
// Make element renderable: position it far above viewport, width = A4
tmpl.style.cssText = [
'display:block',
'position:absolute',
'top:-29700px',
'left:0',
'width:794px',
'min-height:1123px',
'padding:40px',
'box-sizing:border-box',
'background:white',
'color:black',
'font-family:Inter,Arial,sans-serif',
'z-index:-1'
].join(';');
const opt = {
margin: 0,
filename: `Invoice_${randomId}.pdf`,
image: { type: 'jpeg', quality: 0.98 },
html2canvas: {
scale: 2,
useCORS: true,
logging: false,
allowTaint: true,
scrollX: 0,
scrollY: -window.scrollY // account for page scroll
},
jsPDF: { unit: 'px', format: [794, 1123], orientation: 'portrait' }
};
html2pdf().set(opt).from(tmpl).save()
.then(() => {
tmpl.style.cssText = 'display:none';
btn.innerHTML = '<i class="fas fa-check"></i> Downloaded!';
setTimeout(() => {
btn.innerHTML = originalContent;
btn.disabled = false;
}, 1500);
})
.catch(() => {
tmpl.style.cssText = 'display:none';
btn.innerHTML = originalContent;
btn.disabled = false;
alert('PDF generation failed. Please try again.');
});
}, 1500);
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
</body>
</html>