feat: show welcome modal on every load
Browse filesDrop the localStorage first-visit gate: the modal now opens on each
startup and stays reopenable from the top-left brand.
Co-authored-by: Cursor <cursoragent@cursor.com>
- index.html +2 -6
index.html
CHANGED
|
@@ -430,23 +430,19 @@
|
|
| 430 |
</div>
|
| 431 |
|
| 432 |
<script>
|
| 433 |
-
// Welcome modal: shown on
|
| 434 |
// or clicking the blurred backdrop. The top-left brand reopens it.
|
| 435 |
(() => {
|
| 436 |
-
const SEEN_KEY = "md-welcome-seen";
|
| 437 |
const modal = document.getElementById("welcome");
|
| 438 |
const open = () => {
|
| 439 |
modal.hidden = false;
|
| 440 |
modal.classList.remove("closing");
|
| 441 |
};
|
| 442 |
const close = () => {
|
| 443 |
-
try { localStorage.setItem(SEEN_KEY, "1"); } catch {}
|
| 444 |
modal.classList.add("closing");
|
| 445 |
setTimeout(() => { modal.hidden = true; }, 380);
|
| 446 |
};
|
| 447 |
-
|
| 448 |
-
try { seen = localStorage.getItem(SEEN_KEY) === "1"; } catch {}
|
| 449 |
-
if (!seen) open();
|
| 450 |
document.getElementById("welcome-go").addEventListener("click", close);
|
| 451 |
modal.addEventListener("click", (e) => { if (e.target === modal) close(); });
|
| 452 |
window.addEventListener("keydown", (e) => {
|
|
|
|
| 430 |
</div>
|
| 431 |
|
| 432 |
<script>
|
| 433 |
+
// Welcome modal: shown on every load, dismissible by button, Escape
|
| 434 |
// or clicking the blurred backdrop. The top-left brand reopens it.
|
| 435 |
(() => {
|
|
|
|
| 436 |
const modal = document.getElementById("welcome");
|
| 437 |
const open = () => {
|
| 438 |
modal.hidden = false;
|
| 439 |
modal.classList.remove("closing");
|
| 440 |
};
|
| 441 |
const close = () => {
|
|
|
|
| 442 |
modal.classList.add("closing");
|
| 443 |
setTimeout(() => { modal.hidden = true; }, 380);
|
| 444 |
};
|
| 445 |
+
open();
|
|
|
|
|
|
|
| 446 |
document.getElementById("welcome-go").addEventListener("click", close);
|
| 447 |
modal.addEventListener("click", (e) => { if (e.target === modal) close(); });
|
| 448 |
window.addEventListener("keydown", (e) => {
|