Format
This commit is contained in:
parent
2aa8ee78a9
commit
7cbeef6482
6 changed files with 114 additions and 78 deletions
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue