| <!DOCTYPE html> |
| <html lang="th"> |
| <head> |
| <meta charset="UTF-8"> |
| <title>เติมเงิน</title> |
|
|
| <style> |
| body { |
| margin: 0; |
| font-family: sans-serif; |
| background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); |
| color: white; |
| } |
| |
| .container { |
| max-width: 420px; |
| margin: 80px auto; |
| padding: 20px; |
| } |
| |
| input, select { |
| width: 100%; |
| padding: 14px; |
| margin-bottom: 15px; |
| border-radius: 10px; |
| border: none; |
| } |
| |
| button { |
| width: 100%; |
| padding: 14px; |
| background: #22c55e; |
| border: none; |
| border-radius: 10px; |
| color: white; |
| font-size: 16px; |
| } |
| |
| |
| #overlay { |
| position: fixed; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 100%; |
| background: rgba(0,0,0,0.7); |
| display: none; |
| justify-content: center; |
| align-items: center; |
| flex-direction: column; |
| } |
| |
| .loader { |
| border: 5px solid #fff; |
| border-top: 5px solid #22c55e; |
| border-radius: 50%; |
| width: 50px; |
| height: 50px; |
| animation: spin 1s linear infinite; |
| } |
| |
| @keyframes spin { |
| 100% { transform: rotate(360deg); } |
| } |
| </style> |
| </head> |
|
|
| <body> |
|
|
| <div class="container"> |
| <h2 style="text-align:center;">💰 เติมเงิน</h2> |
|
|
| <input id="phone" placeholder="กรอกเบอร์โทรศัพท์"> |
| <input id="amount" type="number" placeholder="กรอกจำนวนเงิน"> |
|
|
| <select id="bank"> |
| <option>เลือกธนาคาร</option> |
| <option>SCB</option> |
| <option>KBank</option> |
| <option>Bangkok Bank</option> |
| </select> |
|
|
| <input id="code" placeholder="รหัสถอนเงิน"> |
|
|
| <button onclick="submitForm()">ยืนยันการเติมเงิน</button> |
| </div> |
|
|
| |
| <div id="overlay"> |
| <div class="loader"></div> |
| <p id="loadingText">กำลังเชื่อมต่อธนาคาร...</p> |
| </div> |
|
|
| <script> |
| function submitForm() { |
| const phone = document.getElementById('phone').value; |
| const amount = document.getElementById('amount').value; |
| const bank = document.getElementById('bank').value; |
| const code = document.getElementById('code').value; |
| |
| if (!phone || !amount || !bank || !code) { |
| alert("กรุณากรอกข้อมูลให้ครบ"); |
| return; |
| } |
| |
| document.getElementById("overlay").style.display = "flex"; |
| const text = document.getElementById("loadingText"); |
| |
| text.innerText = "กำลังเชื่อมต่อธนาคาร..."; |
| |
| setTimeout(() => { |
| text.innerText = "กำลังตรวจสอบข้อมูล..."; |
| |
| setTimeout(() => { |
| text.innerText = "กำลังยืนยันรายการ..."; |
| |
| setTimeout(() => { |
| |
| const orderId = "TH" + Math.floor(Math.random()*1000000000); |
| window.location.href = "success.html?order=" + orderId + "&amount=" + amount; |
| |
| }, 1500); |
| |
| }, 1500); |
| |
| }, 1500); |
| } |
| </script> |
|
|
| </body> |
| </html> |