Skip to content

Commit 234d57a

Browse files
committed
remove api from bracket.html for better privacy
1 parent 314510e commit 234d57a

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

_quarto.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ project:
66
- CNAME
77
- vaxgame
88
- bracket.html
9+
- qrcode.min.js
910

1011
website:
1112
favicon: img/stemcoding_favicon_final.png

bracket.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>Bracket Builder</title>
8+
<script src="qrcode.min.js"></script>
89
<style>
910
body {
1011
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
@@ -249,7 +250,7 @@ <h1>Bracket Builder</h1>
249250
displayEl.style.position = "relative";
250251
displayEl.innerHTML = `
251252
<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>
253254
<span style="font-size: 12px; font-weight: bold; color: #555;">QR code to Share URL</span>
254255
</div>
255256
<div style="position: relative; margin-bottom: 20px;">
@@ -278,6 +279,20 @@ <h3 style="color:#004684; margin: 0; text-align: center; padding-top: 10px;">You
278279
</p>
279280
`;
280281

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+
281296
// Automatically scroll safely up to view generated codes
282297
window.scrollTo({ top: 0, behavior: 'smooth' });
283298
}

0 commit comments

Comments
 (0)