|
12 | 12 | html, body { height:100%; } |
13 | 13 | body { background:#fff; } |
14 | 14 |
|
| 15 | +/* ---------- LICENSE POPUP ---------- */ |
| 16 | +#licenseOverlay { |
| 17 | + position: fixed; |
| 18 | + inset: 0; |
| 19 | + background: rgba(0,0,0,0.45); |
| 20 | + display: none; |
| 21 | + align-items: center; |
| 22 | + justify-content: center; |
| 23 | + z-index: 20000; |
| 24 | +} |
| 25 | + |
| 26 | +#licensePopup { |
| 27 | + background: #fff; |
| 28 | + width: 360px; |
| 29 | + padding: 20px; |
| 30 | + border-radius: 8px; |
| 31 | + text-align: center; |
| 32 | + box-shadow: 0 4px 10px rgba(0,0,0,0.25); |
| 33 | +} |
| 34 | + |
| 35 | +#licensePopup a { |
| 36 | + word-break: break-all; |
| 37 | +} |
| 38 | + |
| 39 | +#licensePopup label { |
| 40 | + display: block; |
| 41 | + margin-top: 12px; |
| 42 | + font-size: 14px; |
| 43 | +} |
| 44 | + |
| 45 | +#licensePopup button { |
| 46 | + margin-top: 15px; |
| 47 | + padding: 8px 20px; |
| 48 | + font-weight: bold; |
| 49 | + cursor: pointer; |
| 50 | +} |
| 51 | + |
| 52 | + |
15 | 53 | #topPanel { |
16 | 54 | position: fixed; |
17 | 55 | top:0; left:0; |
|
29 | 67 | #topTimer { font-size:24px; font-weight:bold; } |
30 | 68 |
|
31 | 69 | .topButtons { display:flex; flex-direction: column; gap:10px; } |
32 | | -.topButtons button { padding:8px 14px; font-weight:bold; cursor:pointer;For undefined values, type in "und." |
33 | | - min-width:90px; } |
| 70 | +.topButtons button { |
| 71 | + padding:8px 14px; |
| 72 | + font-weight:bold; |
| 73 | + cursor:pointer; |
| 74 | + min-width:90px; |
| 75 | +} |
34 | 76 |
|
35 | 77 | #scrollContainer { |
36 | 78 | max-width:900px; |
|
74 | 116 | </style> |
75 | 117 | </head> |
76 | 118 | <body> |
| 119 | +<!-- LICENSE POPUP --> |
| 120 | +<div id="licenseOverlay"> |
| 121 | + <div id="licensePopup"> |
| 122 | + <p> |
| 123 | + This site is under an MIT License. It is open-source and you can view it here: |
| 124 | + <br><br> |
| 125 | + <a href="https://github.com/Vanish-Coder/unit-circle-practice" target="_blank"> |
| 126 | + GitHub Repository |
| 127 | + </a> |
| 128 | + </p> |
| 129 | + |
| 130 | + <label> |
| 131 | + <input type="checkbox" id="dontShowAgain"> |
| 132 | + Don’t show again |
| 133 | + </label> |
| 134 | + |
| 135 | + <button id="closeLicenseBtn">Close</button> |
| 136 | + </div> |
| 137 | +</div> |
77 | 138 |
|
78 | 139 | <div id="topPanel"> |
79 | 140 | <svg id="topMiniCircle" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"> |
@@ -389,6 +450,21 @@ <h2>Results</h2> |
389 | 450 | restartBtn.onclick = init; |
390 | 451 |
|
391 | 452 | init(); |
| 453 | + |
| 454 | +/* ---------- LICENSE POPUP LOGIC ---------- */ |
| 455 | +window.addEventListener("load", () => { |
| 456 | + if (!localStorage.getItem("hideLicensePopup")) { |
| 457 | + document.getElementById("licenseOverlay").style.display = "flex"; |
| 458 | + } |
| 459 | +}); |
| 460 | + |
| 461 | +document.getElementById("closeLicenseBtn").onclick = () => { |
| 462 | + if (document.getElementById("dontShowAgain").checked) { |
| 463 | + localStorage.setItem("hideLicensePopup", "true"); |
| 464 | + } |
| 465 | + document.getElementById("licenseOverlay").style.display = "none"; |
| 466 | +}; |
| 467 | + |
392 | 468 | </script> |
393 | 469 |
|
394 | 470 | </body> |
|
0 commit comments