This commit is contained in:
sepia 2025-07-20 17:44:21 -05:00
parent 2aa8ee78a9
commit 7cbeef6482
6 changed files with 114 additions and 78 deletions

View file

@ -1,8 +1,9 @@
function copyGameLink() {
const gameId = document.querySelector('meta[name="gameId"]').content;
const gameLink = `${window.location.origin}${window.location.pathname}?gameId=${gameId}`;
navigator.clipboard.writeText(gameLink)
navigator.clipboard
.writeText(gameLink)
.then(() => {
const copyLinkButton = document.getElementById('copy-link-button');
const copyLinkText = document.getElementById('copy-link-text');
@ -24,7 +25,7 @@ function copyGameLink() {
window.copyButtonTimeoutId = null;
}, 3000);
})
.catch(err => {
.catch((err) => {
console.error('Failed to copy link: ', err);
});
}

View file

@ -19,7 +19,6 @@ gameContainer.setAttribute('ws-connect', wsUrl);
// Tell HTMX to connect the WebSocket
htmx.trigger(gameContainer, ' and connect');
// Update the WebSocket status indicator
const wsStatusDiv = document.getElementById('ws-status');