Refactor button box code a bit, and fix color of copy game link icon
This commit is contained in:
parent
e8bfdaaa30
commit
74bb200f8f
5 changed files with 64 additions and 59 deletions
|
|
@ -14,12 +14,12 @@ function copyGameLink() {
|
|||
clearTimeout(window.copyButtonTimeoutId);
|
||||
}
|
||||
|
||||
copyLinkButton.querySelector('img').src = '/icons/copy-success.svg';
|
||||
copyLinkButton.querySelector('use').href = '/icons/copy-success.svg';
|
||||
copyLinkText.textContent = 'Game link copied!';
|
||||
copyLinkButton.classList.add('copied-state');
|
||||
|
||||
window.copyButtonTimeoutId = setTimeout(() => {
|
||||
copyLinkButton.querySelector('img').src = originalIconSrc;
|
||||
copyLinkButton.querySelector('use').href = originalIconSrc;
|
||||
copyLinkText.textContent = originalTextContent;
|
||||
copyLinkButton.classList.remove('copied-state');
|
||||
window.copyButtonTimeoutId = null;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
document.addEventListener('htmx:wsAfterMessage', function (e) {
|
||||
console.log(e.detail.message);
|
||||
const message = JSON.parse(e.detail.message);
|
||||
if (message.type === 'redirect_to_game') {
|
||||
window.location.href = '/?gameId=' + message.gameId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue