Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>TrustNet Bank - Multi-Currency Banking</title> | |
| <style> | |
| /* Base Styles */ | |
| body { | |
| margin: 0; | |
| background: linear-gradient(135deg, #f5f7f8 0%, #e8ecf0 100%); | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; | |
| color: #333; | |
| min-height: 100vh; | |
| position: relative; | |
| padding-bottom: 30px; | |
| } | |
| .container { | |
| max-width: 500px; | |
| margin: 20px auto; | |
| padding: 25px; | |
| background: white; | |
| border-radius: 15px; | |
| box-shadow: 0 8px 32px rgba(0,0,0,0.12); | |
| backdrop-filter: blur(10px); | |
| border: 1px solid rgba(255,255,255,0.2); | |
| } | |
| /* Hero Section */ | |
| .hero { | |
| text-align: center; | |
| padding: 30px 20px; | |
| background: linear-gradient(135deg, #0a3e80 0%, #1e5aa8 50%, #2d6bb8 100%); | |
| color: white; | |
| border-radius: 15px; | |
| margin-bottom: 25px; | |
| position: relative; | |
| overflow: hidden; | |
| box-shadow: 0 8px 25px rgba(10, 62, 128, 0.3); | |
| } | |
| .hero:before { | |
| content: ""; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 50%); | |
| } | |
| .hero h1 { | |
| margin: 0; | |
| font-size: 32px; | |
| font-weight: 700; | |
| position: relative; | |
| text-shadow: 0 2px 4px rgba(0,0,0,0.3); | |
| } | |
| .hero p { | |
| margin: 15px 0 0; | |
| font-size: 18px; | |
| position: relative; | |
| opacity: 0.95; | |
| } | |
| /* Features Grid */ | |
| .features-grid { | |
| display: grid; | |
| grid-template-columns: repeat(2, 1fr); | |
| gap: 18px; | |
| margin: 25px 0; | |
| } | |
| .feature-card { | |
| background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); | |
| border-radius: 12px; | |
| padding: 20px; | |
| text-align: center; | |
| box-shadow: 0 4px 15px rgba(0,0,0,0.08); | |
| transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| border: 1px solid rgba(10, 62, 128, 0.1); | |
| } | |
| .feature-card:hover { | |
| transform: translateY(-8px) scale(1.02); | |
| box-shadow: 0 12px 30px rgba(10, 62, 128, 0.15); | |
| } | |
| .feature-icon { | |
| font-size: 28px; | |
| margin-bottom: 12px; | |
| color: #0a3e80; | |
| filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); | |
| } | |
| .feature-card h4 { | |
| margin: 0 0 8px 0; | |
| color: #0a3e80; | |
| font-weight: 600; | |
| } | |
| .feature-card p { | |
| margin: 0; | |
| font-size: 14px; | |
| color: #666; | |
| line-height: 1.4; | |
| } | |
| /* Balance Section */ | |
| .balance-section { | |
| background: linear-gradient(135deg, #0a3e80 0%, #1e5aa8 100%); | |
| color: white; | |
| padding: 25px; | |
| border-radius: 15px; | |
| margin: 20px 0; | |
| text-align: center; | |
| box-shadow: 0 8px 25px rgba(10, 62, 128, 0.3); | |
| } | |
| .balance-amount { | |
| font-size: 36px; | |
| font-weight: 700; | |
| margin: 10px 0; | |
| text-shadow: 0 2px 4px rgba(0,0,0,0.3); | |
| } | |
| .balance-label { | |
| font-size: 16px; | |
| opacity: 0.9; | |
| margin-bottom: 15px; | |
| } | |
| .balance-actions { | |
| display: flex; | |
| gap: 10px; | |
| margin-top: 15px; | |
| } | |
| .balance-btn { | |
| flex: 1; | |
| background: rgba(255,255,255,0.2); | |
| border: 2px solid rgba(255,255,255,0.3); | |
| color: white; | |
| padding: 10px; | |
| border-radius: 8px; | |
| cursor: pointer; | |
| font-weight: 600; | |
| transition: all 0.3s ease; | |
| } | |
| .balance-btn:hover { | |
| background: rgba(255,255,255,0.3); | |
| transform: translateY(-2px); | |
| } | |
| /* Visual Elements */ | |
| .visual-section { | |
| display: flex; | |
| justify-content: space-around; | |
| margin: 25px 0; | |
| padding: 20px; | |
| background: linear-gradient(135deg, #f8fafc 0%, #e8ecf0 100%); | |
| border-radius: 12px; | |
| } | |
| .visual-element { | |
| text-align: center; | |
| } | |
| .visual-icon { | |
| font-size: 32px; | |
| color: #0a3e80; | |
| margin-bottom: 8px; | |
| filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); | |
| } | |
| .visual-element small { | |
| font-weight: 500; | |
| color: #666; | |
| } | |
| /* Enhanced Receipt Styling */ | |
| .receipt-card { | |
| background: #ffffff; | |
| border-radius: 16px; | |
| padding: 25px 20px; | |
| box-shadow: 0 8px 32px rgba(0,0,0,0.12); | |
| margin: 20px auto; | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; | |
| max-width: 380px; | |
| border: 1px solid #f0f0f0; | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .receipt-card:before { | |
| content: ""; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| height: 4px; | |
| background: linear-gradient(90deg, #0a3e80 0%, #1e5aa8 50%, #2d6bb8 100%); | |
| } | |
| .receipt-header { | |
| text-align: center; | |
| margin-bottom: 15px; | |
| padding-bottom: 12px; | |
| border-bottom: 1px solid #f5f5f5; | |
| } | |
| .receipt-logo { | |
| font-size: 18px; | |
| font-weight: 500; | |
| color: #0a3e80; | |
| margin-bottom: 3px; | |
| } | |
| .receipt-subtitle { | |
| font-size: 12px; | |
| color: #666; | |
| margin: 0; | |
| } | |
| .receipt-amount { | |
| font-size: 42px; | |
| font-weight: 600; | |
| margin: 15px 0; | |
| color: #000000; | |
| text-align: center; | |
| letter-spacing: -1px; | |
| } | |
| .status-successful { | |
| background: linear-gradient(135deg, #28a745 0%, #20c997 100%); | |
| color: white; | |
| padding: 10px 16px; | |
| border-radius: 8px; | |
| text-align: center; | |
| font-weight: 400; | |
| font-size: 14px; | |
| margin: 0 0 15px 0; | |
| text-transform: capitalize; | |
| box-shadow: 0 3px 10px rgba(40, 167, 69, 0.25); | |
| } | |
| .status-pending { | |
| background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%); | |
| color: #000; | |
| padding: 10px 16px; | |
| border-radius: 8px; | |
| text-align: center; | |
| font-weight: 400; | |
| font-size: 14px; | |
| margin: 0 0 15px 0; | |
| text-transform: capitalize; | |
| box-shadow: 0 3px 10px rgba(255, 193, 7, 0.25); | |
| } | |
| .status-failed { | |
| background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%); | |
| color: white; | |
| padding: 10px 16px; | |
| border-radius: 8px; | |
| text-align: center; | |
| font-weight: 400; | |
| font-size: 14px; | |
| margin: 0 0 15px 0; | |
| text-transform: capitalize; | |
| box-shadow: 0 3px 10px rgba(220, 53, 69, 0.25); | |
| } | |
| .transaction-details { | |
| margin: 0; | |
| background: #f8fafc; | |
| padding: 15px; | |
| border-radius: 8px; | |
| border: 1px solid #e2e8f0; | |
| } | |
| .detail-row { | |
| margin-bottom: 10px; | |
| font-size: 14px; | |
| line-height: 1.4; | |
| color: #333; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .detail-label { | |
| font-weight: 400; | |
| color: #0a3e80; | |
| flex: 1; | |
| } | |
| .detail-value { | |
| color: #333; | |
| font-weight: 300; | |
| text-align: right; | |
| flex: 1; | |
| word-break: break-word; | |
| } | |
| .alert-caption { | |
| color: #dc3545; | |
| font-weight: bold; | |
| font-size: 14px; | |
| text-align: center; | |
| margin: 0 0 20px 0; | |
| padding: 12px 16px; | |
| background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%); | |
| border: 2px solid #dc3545; | |
| border-radius: 8px; | |
| text-transform: uppercase; | |
| letter-spacing: 0.5px; | |
| } | |
| .receipt-buttons { | |
| display: flex; | |
| justify-content: space-between; | |
| margin-top: 20px; | |
| gap: 12px; | |
| } | |
| .receipt-buttons button { | |
| width: 48%; | |
| background: linear-gradient(135deg, #1e5aa8 0%, #0a3e80 100%); | |
| color: white; | |
| border: none; | |
| padding: 12px 16px; | |
| border-radius: 8px; | |
| font-weight: 500; | |
| font-size: 14px; | |
| cursor: pointer; | |
| transition: all 0.3s ease; | |
| box-shadow: 0 3px 10px rgba(30, 90, 168, 0.25); | |
| } | |
| .receipt-buttons button:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 8px 25px rgba(30, 90, 168, 0.4); | |
| } | |
| /* Success Animation */ | |
| .success-animation { | |
| position: fixed; | |
| top: 50%; | |
| left: 50%; | |
| transform: translate(-50%, -50%); | |
| background: linear-gradient(135deg, #28a745 0%, #20c997 100%); | |
| color: white; | |
| padding: 30px; | |
| border-radius: 20px; | |
| text-align: center; | |
| font-size: 24px; | |
| font-weight: bold; | |
| z-index: 1000; | |
| box-shadow: 0 15px 35px rgba(40, 167, 69, 0.4); | |
| animation: successPulse 2s ease-in-out; | |
| } | |
| @keyframes successPulse { | |
| 0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; } | |
| 50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } | |
| 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } | |
| } | |
| /* Original Styles Enhanced */ | |
| h2, h3 { | |
| text-align: center; | |
| color: #0a3e80; | |
| font-weight: 600; | |
| } | |
| input, select, button { | |
| width: 100%; | |
| padding: 12px 16px; | |
| margin-top: 12px; | |
| border: 2px solid #e2e8f0; | |
| border-radius: 8px; | |
| font-size: 15px; | |
| transition: all 0.3s ease; | |
| box-sizing: border-box; | |
| } | |
| input:focus, select:focus { | |
| outline: none; | |
| border-color: #0a3e80; | |
| box-shadow: 0 0 0 3px rgba(10, 62, 128, 0.1); | |
| } | |
| button { | |
| background: linear-gradient(135deg, #0a3e80 0%, #1e5aa8 100%); | |
| color: white; | |
| font-weight: 600; | |
| cursor: pointer; | |
| border: none; | |
| box-shadow: 0 4px 15px rgba(10, 62, 128, 0.3); | |
| transition: all 0.3s ease; | |
| } | |
| button:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 8px 25px rgba(10, 62, 128, 0.4); | |
| } | |
| .nav { | |
| display: flex; | |
| justify-content: space-between; | |
| margin: 15px 0; | |
| gap: 10px; | |
| } | |
| .nav button { | |
| flex: 1; | |
| margin: 0; | |
| padding: 12px 8px; | |
| font-size: 14px; | |
| } | |
| .hidden { display: none; } | |
| /* Profile Section Enhancement */ | |
| #profile-pic-display, #dashboard-pic { | |
| border-radius: 50%; | |
| width: 100px; | |
| height: 100px; | |
| margin-bottom: 20px; | |
| border: 4px solid #0a3e80; | |
| box-shadow: 0 4px 15px rgba(10, 62, 128, 0.3); | |
| } | |
| .welcome-msg { | |
| text-align: center; | |
| font-size: 18px; | |
| margin-top: 20px; | |
| color: #0a3e80; | |
| font-weight: 500; | |
| } | |
| .whatsapp-link { text-align: center; margin-top: 20px; } | |
| .whatsapp-link a { | |
| color: #25D366; | |
| font-weight: bold; | |
| text-decoration: none; | |
| padding: 10px 20px; | |
| background: rgba(37, 211, 102, 0.1); | |
| border-radius: 25px; | |
| transition: all 0.3s ease; | |
| } | |
| .whatsapp-link a:hover { | |
| background: rgba(37, 211, 102, 0.2); | |
| transform: translateY(-2px); | |
| } | |
| .history-item { margin-bottom: 20px; } | |
| .loading { opacity: 0.6; pointer-events: none; } | |
| .email-status { | |
| margin-top: 12px; | |
| padding: 12px 16px; | |
| border-radius: 8px; | |
| text-align: center; | |
| font-weight: 600; | |
| } | |
| .email-success { | |
| background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%); | |
| color: #155724; | |
| border: 1px solid #c3e6cb; | |
| } | |
| .email-error { | |
| background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%); | |
| color: #721c24; | |
| border: 1px solid #f5c6cb; | |
| } | |
| .optional-field { margin-top: 18px; } | |
| .optional-field label { | |
| display: block; | |
| margin-bottom: 8px; | |
| font-weight: 600; | |
| color: #0a3e80; | |
| } | |
| /* Developer Contact Section */ | |
| .developer-contact { | |
| background: linear-gradient(135deg, #25D366 0%, #128C7E 100%); | |
| color: white; | |
| padding: 20px; | |
| border-radius: 12px; | |
| margin-top: 25px; | |
| text-align: center; | |
| box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3); | |
| } | |
| .developer-contact h4 { | |
| margin: 0 0 12px 0; | |
| font-size: 18px; | |
| } | |
| .developer-contact p { | |
| margin: 8px 0; | |
| font-size: 15px; | |
| } | |
| .whatsapp-support { | |
| background: rgba(255,255,255,0.2); | |
| color: white; | |
| padding: 12px 24px; | |
| border: 2px solid rgba(255,255,255,0.3); | |
| border-radius: 25px; | |
| font-weight: bold; | |
| cursor: pointer; | |
| margin-top: 15px; | |
| text-decoration: none; | |
| display: inline-block; | |
| transition: all 0.3s ease; | |
| } | |
| .whatsapp-support:hover { | |
| background: rgba(255,255,255,0.3); | |
| color: white; | |
| transform: translateY(-2px); | |
| } | |
| /* Modal Styles */ | |
| .modal { | |
| display: none; | |
| position: fixed; | |
| z-index: 1000; | |
| left: 0; | |
| top: 0; | |
| width: 100%; | |
| height: 100%; | |
| background-color: rgba(0,0,0,0.5); | |
| backdrop-filter: blur(5px); | |
| } | |
| .modal-content { | |
| background-color: white; | |
| margin: 10% auto; | |
| padding: 30px; | |
| border-radius: 15px; | |
| width: 90%; | |
| max-width: 400px; | |
| box-shadow: 0 15px 35px rgba(0,0,0,0.2); | |
| } | |
| .close { | |
| color: #aaa; | |
| float: right; | |
| font-size: 28px; | |
| font-weight: bold; | |
| cursor: pointer; | |
| } | |
| .close:hover { | |
| color: #000; | |
| } | |
| /* Transaction Warning */ | |
| .transaction-warning { | |
| margin-top: 15px; | |
| padding: 12px; | |
| background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%); | |
| border: 1px solid #ffc107; | |
| border-radius: 8px; | |
| color: #856404; | |
| text-align: center; | |
| font-size: 14px; | |
| font-weight: 500; | |
| } | |
| /* WhatsApp Group Section */ | |
| .whatsapp-group { | |
| background: linear-gradient(135deg, #25D366 0%, #128C7E 100%); | |
| color: white; | |
| padding: 25px 20px; | |
| border-radius: 15px; | |
| text-align: center; | |
| margin: 25px 0 0; | |
| box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3); | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .whatsapp-group:before { | |
| content: ""; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.2) 0%, transparent 40%); | |
| } | |
| .whatsapp-group h3 { | |
| margin-top: 0; | |
| font-size: 22px; | |
| position: relative; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| gap: 10px; | |
| } | |
| .whatsapp-group p { | |
| font-size: 16px; | |
| margin-bottom: 20px; | |
| position: relative; | |
| } | |
| .whatsapp-group-btn { | |
| background: white; | |
| color: #25D366; | |
| padding: 14px 30px; | |
| border-radius: 50px; | |
| font-weight: 700; | |
| text-decoration: none; | |
| display: inline-block; | |
| box-shadow: 0 4px 15px rgba(0,0,0,0.2); | |
| transition: all 0.3s ease; | |
| position: relative; | |
| border: none; | |
| font-size: 16px; | |
| cursor: pointer; | |
| } | |
| .whatsapp-group-btn:hover { | |
| transform: translateY(-3px); | |
| box-shadow: 0 8px 25px rgba(0,0,0,0.3); | |
| } | |
| /* Financial Tools Section */ | |
| .tools-section { | |
| margin: 30px 0; | |
| background: linear-gradient(135deg, #f8fafc 0%, #e8ecf0 100%); | |
| border-radius: 15px; | |
| padding: 20px; | |
| box-shadow: 0 4px 15px rgba(0,0,0,0.08); | |
| } | |
| .tools-grid { | |
| display: grid; | |
| grid-template-columns: repeat(3, 1fr); | |
| gap: 15px; | |
| margin-top: 20px; | |
| } | |
| .tool-card { | |
| background: white; | |
| border-radius: 12px; | |
| padding: 15px; | |
| text-align: center; | |
| box-shadow: 0 4px 12px rgba(0,0,0,0.08); | |
| transition: all 0.3s ease; | |
| border: 1px solid rgba(10, 62, 128, 0.1); | |
| } | |
| .tool-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 8px 20px rgba(10, 62, 128, 0.15); | |
| } | |
| .tool-icon { | |
| font-size: 24px; | |
| margin-bottom: 10px; | |
| color: #0a3e80; | |
| } | |
| .tool-card h4 { | |
| margin: 0 0 5px 0; | |
| color: #0a3e80; | |
| font-weight: 600; | |
| } | |
| .tool-card p { | |
| margin: 0; | |
| font-size: 13px; | |
| color: #666; | |
| } | |
| /* Charts Container */ | |
| .chart-container { | |
| margin: 20px 0; | |
| background: white; | |
| border-radius: 12px; | |
| padding: 20px; | |
| box-shadow: 0 4px 15px rgba(0,0,0,0.08); | |
| } | |
| .chart { | |
| height: 200px; | |
| position: relative; | |
| margin-top: 20px; | |
| display: flex; | |
| align-items: flex-end; | |
| justify-content: space-around; | |
| } | |
| .chart-bar { | |
| width: 30px; | |
| background: linear-gradient(to top, #0a3e80, #2d6bb8); | |
| border-radius: 5px 5px 0 0; | |
| position: relative; | |
| transition: all 0.5s ease; | |
| } | |
| .chart-bar-label { | |
| position: absolute; | |
| bottom: -25px; | |
| left: 0; | |
| width: 100%; | |
| text-align: center; | |
| font-size: 12px; | |
| color: #666; | |
| } | |
| .chart-title { | |
| text-align: center; | |
| font-weight: 600; | |
| color: #0a3e80; | |
| margin-bottom: 10px; | |
| } | |
| /* Loan Calculator */ | |
| .calculator-container { | |
| background: white; | |
| border-radius: 12px; | |
| padding: 20px; | |
| box-shadow: 0 4px 15px rgba(0,0,0,0.08); | |
| margin: 20px 0; | |
| } | |
| .calculator-result { | |
| margin-top: 20px; | |
| padding: 15px; | |
| background: #f8fafc; | |
| border-radius: 8px; | |
| text-align: center; | |
| font-weight: 600; | |
| color: #0a3e80; | |
| } | |
| /* Responsive */ | |
| @media(max-width:600px){ | |
| .container { margin:10px; padding: 20px; } | |
| .receipt-card { margin: 10px; padding: 25px 20px; max-width: 350px; } | |
| .receipt-amount { font-size: 42px; } | |
| .features-grid, .tools-grid { grid-template-columns: 1fr; } | |
| .hero h1 { font-size: 28px; } | |
| .hero p { font-size: 16px; } | |
| .balance-actions { flex-direction: column; } | |
| } | |
| /* Footer WhatsApp Group */ | |
| .footer-whatsapp-group { | |
| background: linear-gradient(135deg, #25D366 0%, #128C7E 100%); | |
| color: white; | |
| padding: 25px 20px; | |
| border-radius: 15px; | |
| text-align: center; | |
| margin: 30px 0 0; | |
| box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3); | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .footer-whatsapp-group:before { | |
| content: ""; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.2) 0%, transparent 40%); | |
| } | |
| .footer-whatsapp-group h3 { | |
| margin-top: 0; | |
| font-size: 22px; | |
| position: relative; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| gap: 10px; | |
| } | |
| .footer-whatsapp-group p { | |
| font-size: 16px; | |
| margin-bottom: 20px; | |
| position: relative; | |
| } | |
| .footer-whatsapp-group-btn { | |
| background: white; | |
| color: #25D366; | |
| padding: 14px 30px; | |
| border-radius: 50px; | |
| font-weight: 700; | |
| text-decoration: none; | |
| display: inline-block; | |
| box-shadow: 0 4px 15px rgba(0,0,0,0.2); | |
| transition: all 0.3s ease; | |
| position: relative; | |
| border: none; | |
| font-size: 16px; | |
| cursor: pointer; | |
| } | |
| .footer-whatsapp-group-btn:hover { | |
| transform: translateY(-3px); | |
| box-shadow: 0 8px 25px rgba(0,0,0,0.3); | |
| } | |
| /* Currency badge */ | |
| .currency-badge { | |
| position: fixed; | |
| top: 20px; | |
| right: 20px; | |
| background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%); | |
| color: white; | |
| padding: 8px 15px; | |
| border-radius: 20px; | |
| font-weight: 600; | |
| box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3); | |
| z-index: 1000; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="currency-badge">50+ Currencies Supported</div> | |
| <!-- Dashboard Section --> | |
| <div class="container" id="dashboard"> | |
| <h2>Welcome, <span id="user-name"></span> 👋</h2> | |
| <img id="dashboard-pic" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='%23e2e8f0'/%3E%3Ctext x='50' y='55' text-anchor='middle' font-size='20' fill='%23666'%3E👤%3C/text%3E%3C/svg%3E" alt="Profile Picture" style="border-radius: 50%; width: 100px; height: 100px; margin-bottom: 10px;"> | |
| <!-- Balance Section --> | |
| <div class="balance-section"> | |
| <div class="balance-label">Your Balance</div> | |
| <div class="balance-amount" id="balance-display">$0.00</div> | |
| <div class="balance-actions"> | |
| <button class="balance-btn" onclick="showAddFunds()">💰 Add Funds</button> | |
| <button class="balance-btn" onclick="showBalanceSettings()">⚙️ Settings</button> | |
| </div> | |
| </div> | |
| <!-- Financial Insights --> | |
| <div class="chart-container"> | |
| <div class="chart-title">Monthly Spending</div> | |
| <div class="chart" id="spending-chart"> | |
| <!-- Chart bars will be generated by JS --> | |
| </div> | |
| </div> | |
| <div class="nav"> | |
| <button onclick="showTransfer()">💸 Transfer</button> | |
| <button onclick="showHistory()">📊 History</button> | |
| <button onclick="showSettings()">⚙️ Settings</button> | |
| </div> | |
| <!-- Transfer Section --> | |
| <div id="transfer"> | |
| <h3>💰 Make a Transfer</h3> | |
| <input type="text" id="sender-name" placeholder="Sender Name"> | |
| <input type="text" id="acc-number" placeholder="Recipient Account Number"> | |
| <input type="text" id="acc-name" placeholder="Recipient Account Name"> | |
| <input type="text" id="bank-name" placeholder="Bank Name"> | |
| <input type="text" id="swift-code" placeholder="SWIFT Code"> | |
| <input type="text" id="remark" placeholder="Remark / Description"> | |
| <input type="number" id="amount" placeholder="Amount"> | |
| <select id="currency"> | |
| <!-- Currencies will be populated by JavaScript --> | |
| </select> | |
| <select id="transaction-status"> | |
| <option value="success">✅ Successful</option> | |
| <option value="pending">⏳ Pending</option> | |
| <option value="failed">❌ Failed</option> | |
| </select> | |
| <div class="optional-field"> | |
| <label for="alert-caption">🚨 Alert Caption (Optional):</label> | |
| <select id="alert-caption"> | |
| <option value="">None</option> | |
| <option value="⚠️ Suspicious Transaction Detected">Suspicious Transaction</option> | |
| <option value="🚨 High Risk Transfer">High Risk Transfer</option> | |
| <option value="🔒 Account Security Alert">Security Alert</option> | |
| <option value="💰 Large Transaction">Large Transaction</option> | |
| <option value="🆕 New Beneficiary">New Beneficiary</option> | |
| </select> | |
| </div> | |
| <input type="email" id="recipient-email" placeholder="📧 Recipient Email" required> | |
| <button onclick="submitTransfer()" id="submit-btn">🚀 Submit Transfer</button> | |
| <div id="email-status"></div> | |
| <!-- Transaction warning --> | |
| <div class="transaction-warning"> | |
| ⚠️ Sending over 5 transactions in a single day can trigger system alerts and may lead to your account being banned. | |
| </div> | |
| </div> | |
| <!-- History Section --> | |
| <div id="history" class="hidden"> | |
| <h3>📊 Transaction History</h3> | |
| <div id="history-list"></div> | |
| </div> | |
| <!-- Settings Section --> | |
| <div id="settings" class="hidden"> | |
| <h3>⚙️ Settings</h3> | |
| <input type="file" id="profile-pic" onchange="uploadProfilePic()"> | |
| <!-- Loan Calculator --> | |
| <div class="calculator-container"> | |
| <h4>📈 Loan Calculator</h4> | |
| <input type="number" id="loan-amount" placeholder="Loan Amount" value="1000"> | |
| <input type="number" id="interest-rate" placeholder="Interest Rate (%)" value="5"> | |
| <input type="number" id="loan-term" placeholder="Term (months)" value="12"> | |
| <button onclick="calculateLoan()">Calculate</button> | |
| <div class="calculator-result" id="loan-result">Monthly Payment: $0.00</div> | |
| </div> | |
| <button onclick="deleteAccount()">🗑️ Delete Account</button> | |
| <button onclick="borrowLoan()">💰 Borrow Loan</button> | |
| <div class="whatsapp-link"> | |
| <a href="https://wa.me/17062948306" target="_blank">📱 Contact us on WhatsApp</a> | |
| </div> | |
| <!-- Developer Contact Section --> | |
| <div class="developer-contact"> | |
| <h4>🔧 Developer Support</h4> | |
| <p><strong>CBL</strong></p> | |
| <p>Need technical assistance or custom features?</p> | |
| <a href="https://wa.me/17062481811" target="_blank" class="whatsapp-support"> | |
| 📱 WhatsApp Developer: +1 (706) 248-1811 | |
| </a> | |
| </div> | |
| </div> | |
| <!-- Receipt Section --> | |
| <div id="receipt" class="hidden"> | |
| <h3>🧾 Transaction Receipt</h3> | |
| <div class="receipt-card" id="receipt-card"> | |
| <div class="receipt-header"> | |
| <div class="receipt-logo">🏦 TrustNet Bank</div> | |
| <p class="receipt-subtitle">Transaction Receipt</p> | |
| </div> | |
| <div class="receipt-amount" id="receipt-amount">$0.00</div> | |
| <div id="receipt-status-container"></div> | |
| <div id="alert-caption-display"></div> | |
| <div class="transaction-details"> | |
| <div class="detail-row"> | |
| <span class="detail-label">Transaction ID:</span> | |
| <span class="detail-value" id="transaction-id">TN12345678</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Sender Name:</span> | |
| <span class="detail-value" id="sender-name-display">John Doe</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Sender Account:</span> | |
| <span class="detail-value" id="sender-account-display">1234567890</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Recipient Name:</span> | |
| <span class="detail-value" id="recipient-name-display">Jane Smith</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Recipient Account:</span> | |
| <span class="detail-value" id="recipient-account-display">0987654321</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Bank Name:</span> | |
| <span class="detail-value" id="bank-name-display">TrustNet Bank</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">SWIFT Code:</span> | |
| <span class="detail-value" id="swift-code-display">TRUSTNGB</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Remark:</span> | |
| <span class="detail-value" id="remark-display">Trust Net Bank Transfer</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Date & Time:</span> | |
| <span class="detail-value" id="date-time-display">May 15, 2023, 14:30</span> | |
| </div> | |
| </div> | |
| <div class="receipt-buttons"> | |
| <button onclick="downloadReceipt()">⬇️ Download</button> | |
| <button onclick="shareReceipt()">↗️ Share</button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Footer WhatsApp Group --> | |
| <div class="footer-whatsapp-group"> | |
| <h3>📱 Join Our Exclusive WhatsApp Group</h3> | |
| <p>Get access to premium tools, updates, and financial insights</p> | |
| <a href="https://chat.whatsapp.com/ER9UwcNHhFRCaUSZgvXJx9" class="footer-whatsapp-group-btn" target="_blank"> | |
| Join Group Now | |
| </a> | |
| </div> | |
| </div> | |
| <!-- Modals --> | |
| <div id="addFundsModal" class="modal"> | |
| <div class="modal-content"> | |
| <span class="close" onclick="closeAddFunds()">×</span> | |
| <h3>💰 Add Funds to Account</h3> | |
| <input type="number" id="fund-amount" placeholder="Amount" min="1"> | |
| <select id="fund-currency"> | |
| <!-- Currencies will be populated by JavaScript --> | |
| </select> | |
| <button onclick="addFunds()">💳 Add Funds</button> | |
| </div> | |
| </div> | |
| <div id="balanceSettingsModal" class="modal"> | |
| <div class="modal-content"> | |
| <span class="close" onclick="closeBalanceSettings()">×</span> | |
| <h3>⚙️ Balance Settings</h3> | |
| <label for="default-currency">Default Currency:</label> | |
| <select id="default-currency"> | |
| <!-- Currencies will be populated by JavaScript --> | |
| </select> | |
| <button onclick="saveBalanceSettings()">💾 Save Settings</button> | |
| </div> | |
| </div> | |
| <!-- Success Animation Placeholder --> | |
| <div id="success-animation-container"></div> | |
| <!-- EmailJS SDK --> | |
| <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@emailjs/browser@4/dist/email.min.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script> | |
| <script> | |
| // EmailJS Configuration | |
| const EMAILJS_CONFIG = { | |
| publicKey: '8nj7B2ZhTowvyCykD', | |
| serviceId: 'service_6io02f5', | |
| templateId: 'template_lcy2fxf' | |
| }; | |
| // Initialize EmailJS | |
| (function() { | |
| emailjs.init(EMAILJS_CONFIG.publicKey); | |
| })(); | |
| // Define 50+ popular currencies including Korean Won | |
| const currencies = [ | |
| { code: "USD", symbol: "$", name: "US Dollar" }, | |
| { code: "EUR", symbol: "€", name: "Euro" }, | |
| { code: "GBP", symbol: "£", name: "British Pound" }, | |
| { code: "JPY", symbol: "¥", name: "Japanese Yen" }, | |
| { code: "KRW", symbol: "₩", name: "Korean Won" }, | |
| { code: "AUD", symbol: "A$", name: "Australian Dollar" }, | |
| { code: "CAD", symbol: "C$", name: "Canadian Dollar" }, | |
| { code: "CHF", symbol: "Fr", name: "Swiss Franc" }, | |
| { code: "CNY", symbol: "¥", name: "Chinese Yuan" }, | |
| { code: "INR", symbol: "₹", name: "Indian Rupee" }, | |
| { code: "MXN", symbol: "$", name: "Mexican Peso" }, | |
| { code: "BRL", symbol: "R$", name: "Brazilian Real" }, | |
| { code: "RUB", symbol: "₽", name: "Russian Ruble" }, | |
| { code: "SGD", symbol: "S$", name: "Singapore Dollar" }, | |
| { code: "HKD", symbol: "HK$", name: "Hong Kong Dollar" }, | |
| { code: "NZD", symbol: "NZ$", name: "New Zealand Dollar" }, | |
| { code: "SEK", symbol: "kr", name: "Swedish Krona" }, | |
| { code: "NOK", symbol: "kr", name: "Norwegian Krone" }, | |
| { code: "TRY", symbol: "₺", name: "Turkish Lira" }, | |
| { code: "ZAR", symbol: "R", name: "South African Rand" }, | |
| { code: "AED", symbol: "د.إ", name: "UAE Dirham" }, | |
| { code: "SAR", symbol: "﷼", name: "Saudi Riyal" }, | |
| { code: "THB", symbol: "฿", name: "Thai Baht" }, | |
| { code: "PLN", symbol: "zł", name: "Polish Złoty" }, | |
| { code: "IDR", symbol: "Rp", name: "Indonesian Rupiah" }, | |
| { code: "HUF", symbol: "Ft", name: "Hungarian Forint" }, | |
| { code: "CZK", symbol: "Kč", name: "Czech Koruna" }, | |
| { code: "ILS", symbol: "₪", name: "Israeli Shekel" }, | |
| { code: "CLP", symbol: "$", name: "Chilean Peso" }, | |
| { code: "PHP", symbol: "₱", name: "Philippine Peso" }, | |
| { code: "DKK", symbol: "kr", name: "Danish Krone" }, | |
| { code: "MYR", symbol: "RM", name: "Malaysian Ringgit" }, | |
| { code: "RON", symbol: "lei", name: "Romanian Leu" }, | |
| { code: "TWD", symbol: "NT$", name: "New Taiwan Dollar" }, | |
| { code: "EGP", symbol: "E£", name: "Egyptian Pound" }, | |
| { code: "PKR", symbol: "₨", name: "Pakistani Rupee" }, | |
| { code: "COP", symbol: "$", name: "Colombian Peso" }, | |
| { code: "VND", symbol: "₫", name: "Vietnamese Dong" }, | |
| { code: "BDT", symbol: "৳", name: "Bangladeshi Taka" }, | |
| { code: "ARS", symbol: "$", name: "Argentine Peso" }, | |
| { code: "UAH", symbol: "₴", name: "Ukrainian Hryvnia" }, | |
| { code: "PEN", symbol: "S/", name: "Peruvian Sol" }, | |
| { code: "QAR", symbol: "﷼", name: "Qatari Riyal" }, | |
| { code: "KWD", symbol: "د.ك", name: "Kuwaiti Dinar" }, | |
| { code: "OMR", symbol: "﷼", name: "Omani Rial" }, | |
| { code: "BHD", symbol: ".د.ب", name: "Bahraini Dinar" }, | |
| { code: "JOD", symbol: "د.ا", name: "Jordanian Dinar" }, | |
| { code: "LKR", symbol: "₨", name: "Sri Lankan Rupee" }, | |
| { code: "NGN", symbol: "₦", name: "Nigerian Naira" } | |
| ]; | |
| // Populate currency dropdowns | |
| function populateCurrencies() { | |
| const transferCurrency = document.getElementById('currency'); | |
| const fundCurrency = document.getElementById('fund-currency'); | |
| const defaultCurrency = document.getElementById('default-currency'); | |
| currencies.forEach(currency => { | |
| const option = document.createElement('option'); | |
| option.value = currency.symbol; | |
| option.textContent = `${currency.code} (${currency.symbol}) - ${currency.name}`; | |
| transferCurrency.appendChild(option.cloneNode(true)); | |
| fundCurrency.appendChild(option.cloneNode(true)); | |
| defaultCurrency.appendChild(option.cloneNode(true)); | |
| }); | |
| } | |
| // Initialize with default user data | |
| if (!localStorage.getItem('user')) { | |
| localStorage.setItem('user', 'User'); | |
| localStorage.setItem('balance', '1000'); | |
| localStorage.setItem('defaultCurrency', '$'); | |
| } | |
| // Always show dashboard | |
| document.getElementById('user-name').innerText = localStorage.getItem('user'); | |
| updateBalanceDisplay(); | |
| generateSpendingChart(); | |
| populateCurrencies(); | |
| // Populate currencies on page load | |
| document.addEventListener('DOMContentLoaded', function() { | |
| populateCurrencies(); | |
| document.getElementById('username').focus(); | |
| }); | |
| // Generate unique sender account number | |
| function generateSenderAccount() { | |
| const user = localStorage.getItem('user'); | |
| if (!user) return '1234567890'; | |
| let senderAccount = localStorage.getItem('senderAccount'); | |
| if (!senderAccount) { | |
| // Generate unique 10-digit account number | |
| senderAccount = '2' + Math.floor(Math.random() * 900000000) + Math.floor(Math.random() * 99); | |
| localStorage.setItem('senderAccount', senderAccount); | |
| } | |
| return senderAccount; | |
| } | |
| // Balance Management | |
| function updateBalanceDisplay() { | |
| const balance = parseFloat(localStorage.getItem('balance') || '0'); | |
| const currency = localStorage.getItem('defaultCurrency') || '$'; | |
| document.getElementById('balance-display').textContent = currency + balance.toFixed(2); | |
| } | |
| function showAddFunds() { | |
| document.getElementById('addFundsModal').style.display = 'block'; | |
| } | |
| function closeAddFunds() { | |
| document.getElementById('addFundsModal').style.display = 'none'; | |
| } | |
| function addFunds() { | |
| const amount = parseFloat(document.getElementById('fund-amount').value); | |
| const currency = document.getElementById('fund-currency').value; | |
| if (amount && amount > 0) { | |
| const currentBalance = parseFloat(localStorage.getItem('balance') || '0'); | |
| const newBalance = currentBalance + amount; | |
| localStorage.setItem('balance', newBalance.toString()); | |
| localStorage.setItem('defaultCurrency', currency); | |
| updateBalanceDisplay(); | |
| closeAddFunds(); | |
| // Clear input | |
| document.getElementById('fund-amount').value = ''; | |
| // Show success message | |
| showSuccessAnimation('💰 Funds Added Successfully! 🎉🎊🎖️'); | |
| } else { | |
| alert('Please enter a valid amount'); | |
| } | |
| } | |
| function showBalanceSettings() { | |
| document.getElementById('balanceSettingsModal').style.display = 'block'; | |
| document.getElementById('default-currency').value = localStorage.getItem('defaultCurrency') || '$'; | |
| } | |
| function closeBalanceSettings() { | |
| document.getElementById('balanceSettingsModal').style.display = 'none'; | |
| } | |
| function saveBalanceSettings() { | |
| const currency = document.getElementById('default-currency').value; | |
| localStorage.setItem('defaultCurrency', currency); | |
| updateBalanceDisplay(); | |
| closeBalanceSettings(); | |
| alert('Settings saved successfully!'); | |
| } | |
| // Success Animation with Sound | |
| function showSuccessAnimation(message) { | |
| const animation = document.createElement('div'); | |
| animation.className = 'success-animation'; | |
| animation.innerHTML = message; | |
| document.getElementById('success-animation-container').appendChild(animation); | |
| // Play success sound | |
| playSuccessSound(); | |
| setTimeout(() => { | |
| if (document.getElementById('success-animation-container').contains(animation)) { | |
| document.getElementById('success-animation-container').removeChild(animation); | |
| } | |
| }, 3000); | |
| } | |
| function playSuccessSound() { | |
| try { | |
| // Create audio context for success sound | |
| const audioContext = new (window.AudioContext || window.webkitAudioContext)(); | |
| const oscillator = audioContext.createOscillator(); | |
| const gainNode = audioContext.createGain(); | |
| oscillator.connect(gainNode); | |
| gainNode.connect(audioContext.destination); | |
| oscillator.frequency.setValueAtTime(800, audioContext.currentTime); | |
| oscillator.frequency.setValueAtTime(1000, audioContext.currentTime + 0.1); | |
| oscillator.frequency.setValueAtTime(1200, audioContext.currentTime + 0.2); | |
| gainNode.gain.setValueAtTime(0.3, audioContext.currentTime); | |
| gainNode.gain.exponentialRampToValueAtTime(0.01, audioContext.currentTime + 0.5); | |
| oscillator.start(audioContext.currentTime); | |
| oscillator.stop(audioContext.currentTime + 0.5); | |
| } catch (error) { | |
| console.log('Audio not supported'); | |
| } | |
| } | |
| function register() { | |
| const username = document.getElementById('username').value.trim(); | |
| const password = document.getElementById('password').value.trim(); | |
| if (username && password) { | |
| localStorage.setItem('user', username); | |
| localStorage.setItem('password', password); | |
| localStorage.setItem('balance', '0'); | |
| localStorage.setItem('defaultCurrency', '$'); | |
| location.reload(); | |
| } else { | |
| alert('Please enter both username and password!'); | |
| } | |
| } | |
| function login() { | |
| const username = document.getElementById('username').value.trim(); | |
| const password = document.getElementById('password').value.trim(); | |
| const savedUser = localStorage.getItem('user'); | |
| const savedPassword = localStorage.getItem('password'); | |
| if (savedUser && savedPassword && savedUser === username && savedPassword === password) { | |
| document.getElementById('auth').classList.add('hidden'); | |
| document.getElementById('dashboard').classList.remove('hidden'); | |
| document.getElementById('user-name').innerText = savedUser; | |
| document.getElementById('dashboard-pic').src = localStorage.getItem('profilePic') || 'data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'100\' height=\'100\' viewBox=\'0 0 100 100\'%3E%3Ccircle cx=\'50\' cy=\'50\' r=\'40\' fill=\'%23e2e8f0\'/%3E%3Ctext x=\'50\' y=\'55\' text-anchor=\'middle\' font-size=\'20\' fill=\'%23666\'%3E👤%3C/text%3E%3C/svg%3E'; | |
| updateBalanceDisplay(); | |
| generateSpendingChart(); | |
| } else { | |
| alert('Invalid username or password. Please register if you don\'t have an account.'); | |
| } | |
| } | |
| function uploadProfilePic() { | |
| const file = document.getElementById('profile-pic').files[0]; | |
| const reader = new FileReader(); | |
| reader.onloadend = function() { | |
| localStorage.setItem('profilePic', reader.result); | |
| document.getElementById('dashboard-pic').src = reader.result; | |
| }; | |
| if (file) reader.readAsDataURL(file); | |
| } | |
| function showTransfer() { | |
| document.getElementById('transfer').classList.remove('hidden'); | |
| document.getElementById('history').classList.add('hidden'); | |
| document.getElementById('settings').classList.add('hidden'); | |
| document.getElementById('receipt').classList.add('hidden'); | |
| } | |
| function showHistory() { | |
| document.getElementById('transfer').classList.add('hidden'); | |
| document.getElementById('history').classList.remove('hidden'); | |
| document.getElementById('settings').classList.add('hidden'); | |
| document.getElementById('receipt').classList.add('hidden'); | |
| let history = JSON.parse(localStorage.getItem('history')) || []; | |
| let historyHTML = ''; | |
| if (history.length === 0) { | |
| historyHTML = '<p style="text-align: center; color: #666; padding: 40px;">No transaction history yet. 📭</p>'; | |
| } else { | |
| history.forEach((transaction, index) => { | |
| const alertCaptionHTML = transaction.alertCaption ? | |
| `<div class="alert-caption">${transaction.alertCaption}</div>` : ''; | |
| let statusClass, statusText; | |
| if (transaction.status === 'success') { | |
| statusClass = 'status-successful'; | |
| statusText = 'Successful'; | |
| } else if (transaction.status === 'pending') { | |
| statusClass = 'status-pending'; | |
| statusText = 'Pending'; | |
| } else if (transaction.status === 'failed') { | |
| statusClass = 'status-failed'; | |
| statusText = 'Failed'; | |
| } | |
| historyHTML += ` | |
| <div class="history-item receipt-card"> | |
| <div class="receipt-header"> | |
| <div class="receipt-logo">🏦 TrustNet Bank</div> | |
| <p class="receipt-subtitle">Transaction Receipt</p> | |
| </div> | |
| <div class="receipt-amount">${transaction.currency}${transaction.amount}</div> | |
| <div class="${statusClass}">${statusText}</div> | |
| ${alertCaptionHTML} | |
| <div class="transaction-details"> | |
| <div class="detail-row"> | |
| <span class="detail-label">Transaction ID:</span> | |
| <span class="detail-value">${transaction.transferId}</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Recipient:</span> | |
| <span class="detail-value">${transaction.accName}</span> | |
| </div> | |
| <div class="detail-row"> | |
| <span class="detail-label">Date:</span> | |
| <span class="detail-value">${transaction.date}</span> | |
| </div> | |
| </div> | |
| <div style="text-align: center; margin-top: 15px;"> | |
| <button onclick="viewTransactionDetails(${index})" style="width: 100%; background: linear-gradient(135deg, #0a3e80 0%, #1e5aa8 100%); padding: 10px;">👁️ View Full Receipt</button> | |
| </div> | |
| </div>`; | |
| }); | |
| } | |
| document.getElementById('history-list').innerHTML = historyHTML; | |
| } | |
| function viewTransactionDetails(index) { | |
| let history = JSON.parse(localStorage.getItem('history')) || []; | |
| if (index >= 0 && index < history.length) { | |
| const transaction = history[index]; | |
| showTransactionReceipt(transaction); | |
| } | |
| } | |
| function showTransactionReceipt(transaction) { | |
| document.getElementById('transfer').classList.add('hidden'); | |
| document.getElementById('history').classList.add('hidden'); | |
| document.getElementById('settings').classList.add('hidden'); | |
| document.getElementById('receipt').classList.remove('hidden'); | |
| // Populate receipt data | |
| document.getElementById('receipt-amount').innerText = transaction.currency + transaction.amount; | |
| // Set status with proper class | |
| const statusContainer = document.getElementById('receipt-status-container'); | |
| let statusClass, statusText; | |
| if (transaction.status === 'success') { | |
| statusClass = 'status-successful'; | |
| statusText = 'Successful'; | |
| } else if (transaction.status === 'pending') { | |
| statusClass = 'status-pending'; | |
| statusText = 'Pending'; | |
| } else if (transaction.status === 'failed') { | |
| statusClass = 'status-failed'; | |
| statusText = 'Failed'; | |
| } | |
| statusContainer.innerHTML = `<div class="${statusClass}">${statusText}</div>`; | |
| document.getElementById('transaction-id').innerText = transaction.transferId; | |
| document.getElementById('sender-name-display').innerText = transaction.senderName; | |
| document.getElementById('sender-account-display').innerText = transaction.senderAccount; | |
| document.getElementById('recipient-name-display').innerText = transaction.accName; | |
| document.getElementById('recipient-account-display').innerText = transaction.accNumber; | |
| document.getElementById('bank-name-display').innerText = transaction.bankName; | |
| document.getElementById('swift-code-display').innerText = transaction.swiftCode; | |
| document.getElementById('remark-display').innerText = transaction.remark || ''; | |
| document.getElementById('date-time-display').innerText = transaction.date; | |
| // Display alert caption if present | |
| const alertCaptionDisplay = document.getElementById('alert-caption-display'); | |
| if (transaction.alertCaption) { | |
| alertCaptionDisplay.innerHTML = `<div class="alert-caption">${transaction.alertCaption}</div>`; | |
| } else { | |
| alertCaptionDisplay.innerHTML = ''; | |
| } | |
| currentTransaction = transaction; | |
| } | |
| function showSettings() { | |
| document.getElementById('settings').classList.remove('hidden'); | |
| document.getElementById('transfer').classList.add('hidden'); | |
| document.getElementById('history').classList.add('hidden'); | |
| document.getElementById('receipt').classList.add('hidden'); | |
| } | |
| // Enhanced function to send email notification | |
| async function sendEmailNotification(transactionData) { | |
| try { | |
| const emailParams = { | |
| name: transactionData.accName, | |
| acc_number: transactionData.accNumber, | |
| bank_name: transactionData.bankName, | |
| swift: transactionData.swiftCode, | |
| currency: transactionData.currency, | |
| amount: transactionData.amount, | |
| transactionNo: transactionData.transferId, | |
| date_time: transactionData.date, | |
| to_email: transactionData.recipientEmail, | |
| sender_name: transactionData.senderName, | |
| remark: transactionData.remark || 'Trust Net Bank Transfer', | |
| alert_caption: transactionData.alertCaption || '' | |
| }; | |
| console.log('Sending email with params:', emailParams); | |
| const response = await emailjs.send( | |
| EMAILJS_CONFIG.serviceId, | |
| EMAILJS_CONFIG.templateId, | |
| emailParams | |
| ); | |
| console.log('Email sent successfully:', response); | |
| return { success: true, response }; | |
| } catch (error) { | |
| console.error('Email sending failed:', error); | |
| return { success: false, error }; | |
| } | |
| } | |
| // Enhanced submit transfer function with email integration | |
| async function submitTransfer() { | |
| // Validate required fields | |
| const requiredFields = [ | |
| 'sender-name', 'acc-number', 'acc-name', 'bank-name', | |
| 'swift-code', 'amount', 'recipient-email' | |
| ]; | |
| for (let fieldId of requiredFields) { | |
| const field = document.getElementById(fieldId); | |
| if (!field.value.trim()) { | |
| alert(`Please fill in the ${fieldId.replace('-', ' ')}`); | |
| field.focus(); | |
| return; | |
| } | |
| } | |
| // Validate email format | |
| const email = document.getElementById('recipient-email').value; | |
| const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; | |
| if (!emailRegex.test(email)) { | |
| alert('Please enter a valid email address'); | |
| document.getElementById('recipient-email').focus(); | |
| return; | |
| } | |
| // Show loading state | |
| const submitBtn = document.getElementById('submit-btn'); | |
| const emailStatus = document.getElementById('email-status'); | |
| submitBtn.classList.add('loading'); | |
| submitBtn.textContent = '⏳ Processing Transfer...'; | |
| submitBtn.disabled = true; | |
| const data = { | |
| senderName: document.getElementById('sender-name').value, | |
| senderAccount: generateSenderAccount(), | |
| accNumber: document.getElementById('acc-number').value, | |
| accName: document.getElementById('acc-name').value, | |
| bankName: document.getElementById('bank-name').value, | |
| swiftCode: document.getElementById('swift-code').value, | |
| remark: document.getElementById('remark').value || 'Trust Net Bank Transfer', | |
| amount: document.getElementById('amount').value, | |
| currency: document.getElementById('currency').value, | |
| status: document.getElementById('transaction-status').value, | |
| alertCaption: document.getElementById('alert-caption').value, | |
| date: new Date().toLocaleString(), | |
| transferId: 'TN' + Math.floor(Math.random() * 1000000000), | |
| recipientEmail: document.getElementById('recipient-email').value | |
| }; | |
| try { | |
| // Save transaction to history | |
| let history = JSON.parse(localStorage.getItem('history')) || []; | |
| history.push(data); | |
| localStorage.setItem('history', JSON.stringify(history)); | |
| // Send email notification | |
| emailStatus.innerHTML = '<div class="email-status">📧 Sending email notification...</div>'; | |
| const emailResult = await sendEmailNotification(data); | |
| if (emailResult.success) { | |
| emailStatus.innerHTML = '<div class="email-status email-success">✅ Email notification sent successfully!</div>'; | |
| } else { | |
| emailStatus.innerHTML = '<div class="email-status email-error">⚠️ Transfer completed but email notification failed. Please contact support.</div>'; | |
| console.error('Email error:', emailResult.error); | |
| } | |
| // Update balance display | |
| updateBalanceDisplay(); | |
| // Show transaction receipt | |
| showTransactionReceipt(data); | |
| // Show success animation with sound | |
| showSuccessAnimation('🎉 Transaction Successful! 🎊🎖️'); | |
| // Clear form fields | |
| document.getElementById('sender-name').value = ''; | |
| document.getElementById('acc-number').value = ''; | |
| document.getElementById('acc-name').value = ''; | |
| document.getElementById('bank-name').value = ''; | |
| document.getElementById('swift-code').value = ''; | |
| document.getElementById('remark').value = ''; | |
| document.getElementById('amount').value = ''; | |
| document.getElementById('alert-caption').value = ''; | |
| document.getElementById('recipient-email').value = ''; | |
| // Optional: Send to backend if you have one | |
| try { | |
| await fetch("/submit_transfer", { | |
| method: "POST", | |
| headers: {'Content-Type': 'application/json'}, | |
| body: JSON.stringify({...data, emailSent: emailResult.success}) | |
| }); | |
| } catch (backendError) { | |
| console.log('Backend submission failed (optional):', backendError); | |
| } | |
| } catch (error) { | |
| console.error('Transfer submission error:', error); | |
| emailStatus.innerHTML = '<div class="email-status email-error">❌ Transfer failed. Please try again.</div>'; | |
| } finally { | |
| // Reset button state | |
| submitBtn.classList.remove('loading'); | |
| submitBtn.textContent = '🚀 Submit Transfer'; | |
| submitBtn.disabled = false; | |
| // Clear status after 5 seconds | |
| setTimeout(() => { | |
| emailStatus.innerHTML = ''; | |
| }, 5000); | |
| } | |
| } | |
| function deleteAccount() { | |
| if (confirm('Are you sure you want to delete your account? This cannot be undone.')) { | |
| localStorage.clear(); | |
| alert('Account deleted.'); | |
| location.reload(); | |
| } | |
| } | |
| function borrowLoan() { | |
| alert('💰 Loan feature coming soon. Stay tuned!'); | |
| } | |
| function downloadReceipt() { | |
| if (!currentTransaction) { | |
| alert('No receipt to download'); | |
| return; | |
| } | |
| html2canvas(document.querySelector("#receipt-card")).then(canvas => { | |
| const link = document.createElement('a'); | |
| link.download = `trustnet-bank-receipt-${currentTransaction.transferId}.png`; | |
| link.href = canvas.toDataURL(); | |
| link.click(); | |
| }).catch(error => { | |
| console.error('Download failed:', error); | |
| alert('Download failed. Please try again.'); | |
| }); | |
| } | |
| function shareReceipt() { | |
| if (!currentTransaction) { | |
| alert('No receipt to share'); | |
| return; | |
| } | |
| if (navigator.share) { | |
| html2canvas(document.querySelector("#receipt-card")).then(canvas => { | |
| canvas.toBlob(blob => { | |
| const file = new File([blob], `trustnet-receipt-${currentTransaction.transferId}.png`, { type: 'image/png' }); | |
| navigator.share({ | |
| title: 'TrustNet Bank Receipt', | |
| text: `Transaction Receipt - ${currentTransaction.currency}${currentTransaction.amount}`, | |
| files: [file] | |
| }); | |
| }); | |
| }); | |
| } else { | |
| // Fallback for browsers that don't support Web Share API | |
| const receiptText = `🏦 TrustNet Bank Receipt💰 Amount: ${currentTransaction.currency}${currentTransaction.amount}👤 From: ${currentTransaction.senderName}👤 To: ${currentTransaction.accName}🏛️ Bank: ${currentTransaction.bankName}📅 Date: ${currentTransaction.date}🆔 Transaction ID: ${currentTransaction.transferId} | |
| `; | |
| if (navigator.clipboard) { | |
| navigator.clipboard.writeText(receiptText).then(() => { | |
| alert('Receipt details copied to clipboard!'); | |
| }); | |
| } else { | |
| alert('Sharing not supported on this device'); | |
| } | |
| } | |
| } | |
| // Generate spending chart | |
| function generateSpendingChart() { | |
| const chartContainer = document.getElementById('spending-chart'); | |
| chartContainer.innerHTML = ''; | |
| const categories = ['Food', 'Shopping', 'Bills', 'Entertainment', 'Transport']; | |
| const amounts = [120, 200, 150, 80, 60]; | |
| const maxAmount = Math.max(...amounts); | |
| categories.forEach((category, index) => { | |
| const barHeight = (amounts[index] / maxAmount) * 150; | |
| const bar = document.createElement('div'); | |
| bar.className = 'chart-bar'; | |
| bar.style.height = `${barHeight}px`; | |
| const label = document.createElement('div'); | |
| label.className = 'chart-bar-label'; | |
| label.textContent = category; | |
| const value = document.createElement('div'); | |
| value.className = 'chart-bar-value'; | |
| value.textContent = `$${amounts[index]}`; | |
| value.style.position = 'absolute'; | |
| value.style.top = `-25px`; | |
| value.style.left = '0'; | |
| value.style.width = '100%'; | |
| value.style.textAlign = 'center'; | |
| value.style.fontSize = '12px'; | |
| value.style.color = '#0a3e80'; | |
| value.style.fontWeight = '600'; | |
| bar.appendChild(value); | |
| bar.appendChild(label); | |
| chartContainer.appendChild(bar); | |
| // Animate the bar | |
| setTimeout(() => { | |
| bar.style.height = `${barHeight}px`; | |
| }, index * 200); | |
| }); | |
| } | |
| // Loan calculator | |
| function calculateLoan() { | |
| const amount = parseFloat(document.getElementById('loan-amount').value); | |
| const interestRate = parseFloat(document.getElementById('interest-rate').value); | |
| const term = parseFloat(document.getElementById('loan-term').value); | |
| if (!amount || !interestRate || !term) { | |
| document.getElementById('loan-result').textContent = 'Please fill all fields'; | |
| return; | |
| } | |
| const monthlyInterestRate = interestRate / 100 / 12; | |
| const monthlyPayment = (amount * monthlyInterestRate) / | |
| (1 - Math.pow(1 + monthlyInterestRate, -term)); | |
| if (isNaN(monthlyPayment)) { | |
| document.getElementById('loan-result').textContent = 'Invalid calculation'; | |
| return; | |
| } | |
| document.getElementById('loan-result').textContent = | |
| `Monthly Payment: $${monthlyPayment.toFixed(2)}`; | |
| } | |
| // Close modals when clicking outside | |
| window.onclick = function(event) { | |
| const addFundsModal = document.getElementById('addFundsModal'); | |
| const balanceSettingsModal = document.getElementById('balanceSettingsModal'); | |
| if (event.target == addFundsModal) { | |
| closeAddFunds(); | |
| } | |
| if (event.target == balanceSettingsModal) { | |
| closeBalanceSettings(); | |
| } | |
| } | |
| </script> | |
| </body> | |
| </html> |