diff --git a/TODO.md b/TODO.md index d6c2181..b418b77 100644 --- a/TODO.md +++ b/TODO.md @@ -9,7 +9,7 @@ ## Missing Features - [x] **Incomplete admin page.**: The Admin page should include links for players to re-join the game. -- [ ] **Less intrusive link copied notification.** When you copy a join link from the lobby page, it pops up an alert() to let you know the link was copied. I'd prefer something more subtle, and more importantly not modal. +- [x] **Less intrusive link copied notification.** When you copy a join link from the lobby page, it pops up an alert() to let you know the link was copied. I'd prefer something more subtle, and more importantly not modal. - [ ] **Rules endpoint** Make a nicely formatted HTML version of the rulebook. It should probably also be linked from a help menu somewhere that's always available, rather than only being surfaced on the splash page of the site (which joining players don't even see). Work from "Rats with Gats beta.pdf" rather than "RULEBOOK.md", which is a low fidelity AI summary of the former. ## Cosmetic diff --git a/frontend/src/components/LobbyPhase.svelte b/frontend/src/components/LobbyPhase.svelte index ed978cc..584523d 100644 --- a/frontend/src/components/LobbyPhase.svelte +++ b/frontend/src/components/LobbyPhase.svelte @@ -4,6 +4,15 @@ export let state; let starting = false; + let copiedLink = null; + let copiedTimer = null; + + function copyLink(which, value) { + navigator.clipboard.writeText(value); + copiedLink = which; + clearTimeout(copiedTimer); + copiedTimer = setTimeout(() => { copiedLink = null; }, 2000); + } async function startGame() { starting = true; @@ -39,7 +48,9 @@
Save this admin link! You can use it to recover character sheets if another player loses their connection or link.