|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | + <title>Bitkit Lightning Link Test</title> |
| 7 | + <style> |
| 8 | + :root { |
| 9 | + color-scheme: light dark; |
| 10 | + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; |
| 11 | + line-height: 1.4; |
| 12 | + } |
| 13 | + |
| 14 | + body { |
| 15 | + box-sizing: border-box; |
| 16 | + margin: 0 auto; |
| 17 | + max-width: 720px; |
| 18 | + padding: 24px; |
| 19 | + } |
| 20 | + |
| 21 | + textarea { |
| 22 | + box-sizing: border-box; |
| 23 | + width: 100%; |
| 24 | + min-height: 160px; |
| 25 | + padding: 12px; |
| 26 | + border-radius: 10px; |
| 27 | + font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; |
| 28 | + } |
| 29 | + |
| 30 | + a { |
| 31 | + display: inline-block; |
| 32 | + margin-top: 16px; |
| 33 | + padding: 12px 16px; |
| 34 | + border-radius: 999px; |
| 35 | + background: #0a84ff; |
| 36 | + color: #fff; |
| 37 | + font: inherit; |
| 38 | + font-weight: 600; |
| 39 | + text-decoration: none; |
| 40 | + } |
| 41 | + |
| 42 | + code { |
| 43 | + word-break: break-all; |
| 44 | + } |
| 45 | + |
| 46 | + .muted { |
| 47 | + color: #666; |
| 48 | + } |
| 49 | + </style> |
| 50 | +</head> |
| 51 | +<body> |
| 52 | + <h1>Bitkit Lightning Link Test</h1> |
| 53 | + <p>Paste a BOLT11 invoice below, then open the generated link in Safari.</p> |
| 54 | + |
| 55 | + <label for="invoice">Invoice</label> |
| 56 | + <textarea id="invoice" spellcheck="false" placeholder="lnbcrt..., lntb..., or lnbc..."></textarea> |
| 57 | + |
| 58 | + <p> |
| 59 | + <a id="pay-link" href="#">Open lightning link</a> |
| 60 | + </p> |
| 61 | + |
| 62 | + <p class="muted">Generated URL:</p> |
| 63 | + <code id="generated">Paste an invoice first.</code> |
| 64 | + |
| 65 | + <script> |
| 66 | + const invoiceInput = document.getElementById("invoice"); |
| 67 | + const payLink = document.getElementById("pay-link"); |
| 68 | + const generated = document.getElementById("generated"); |
| 69 | + |
| 70 | + function normalizeInvoice(value) { |
| 71 | + return value.trim().replace(/^lightning:/i, ""); |
| 72 | + } |
| 73 | + |
| 74 | + function updateLink() { |
| 75 | + const invoice = normalizeInvoice(invoiceInput.value); |
| 76 | + |
| 77 | + if (!invoice) { |
| 78 | + payLink.href = "#"; |
| 79 | + generated.textContent = "Paste an invoice first."; |
| 80 | + return; |
| 81 | + } |
| 82 | + |
| 83 | + const url = `lightning:${invoice}`; |
| 84 | + payLink.href = url; |
| 85 | + generated.textContent = url; |
| 86 | + } |
| 87 | + |
| 88 | + invoiceInput.addEventListener("input", updateLink); |
| 89 | + updateLink(); |
| 90 | + </script> |
| 91 | +</body> |
| 92 | +</html> |
0 commit comments