|
5 | 5 | <meta charset="UTF-8"> |
6 | 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
7 | 7 | <title>Bracket Builder</title> |
| 8 | + <script src="qrcode.min.js"></script> |
8 | 9 | <style> |
9 | 10 | body { |
10 | 11 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; |
@@ -249,7 +250,7 @@ <h1>Bracket Builder</h1> |
249 | 250 | displayEl.style.position = "relative"; |
250 | 251 | displayEl.innerHTML = ` |
251 | 252 | <div style="position: absolute; left: 20px; top: 20px; display: flex; flex-direction: column; align-items: center; gap: 5px;"> |
252 | | - <img src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(shareUrl)}" style="width: 156px; height: 156px; border: 1px solid #ccc; border-radius: 4px;" alt="Share QR Code"> |
| 253 | + <div id="qrcode-container" style="width: 156px; height: 156px; border: 1px solid #ccc; border-radius: 4px; padding: 4px; background: white; box-sizing: border-box; display: flex; justify-content: center; align-items: center;"></div> |
253 | 254 | <span style="font-size: 12px; font-weight: bold; color: #555;">QR code to Share URL</span> |
254 | 255 | </div> |
255 | 256 | <div style="position: relative; margin-bottom: 20px;"> |
@@ -278,6 +279,20 @@ <h3 style="color:#004684; margin: 0; text-align: center; padding-top: 10px;">You |
278 | 279 | </p> |
279 | 280 | `; |
280 | 281 |
|
| 282 | + if (typeof QRCode !== 'undefined') { |
| 283 | + document.getElementById("qrcode-container").innerHTML = ""; |
| 284 | + new QRCode(document.getElementById("qrcode-container"), { |
| 285 | + text: shareUrl, |
| 286 | + width: 146, |
| 287 | + height: 146, |
| 288 | + colorDark: "#000000", |
| 289 | + colorLight: "#ffffff", |
| 290 | + correctLevel: QRCode.CorrectLevel.L |
| 291 | + }); |
| 292 | + } else { |
| 293 | + document.getElementById("qrcode-container").innerText = "QR library failed to load."; |
| 294 | + } |
| 295 | + |
281 | 296 | // Automatically scroll safely up to view generated codes |
282 | 297 | window.scrollTo({ top: 0, behavior: 'smooth' }); |
283 | 298 | } |
|
0 commit comments