cleaner styling, display start game prompt

This commit is contained in:
Alec
2021-11-16 22:42:44 -05:00
parent d9ae7db7b9
commit b6edc941fc
19 changed files with 320 additions and 52 deletions

View File

@@ -1,4 +1,5 @@
import {globals} from "../config/globals.js";
import { globals } from "../config/globals.js";
import { toast } from "./Toast.js";
export class GameStateRenderer {
constructor(gameState) {
@@ -30,9 +31,14 @@ export class GameStateRenderer {
renderLobbyHeader() {
let title = document.createElement("h1");
title.innerText = "Lobby";
document.body.prepend(title);
document.getElementById("game-title").appendChild(title);
let gameLinkContainer = document.getElementById("game-link");
gameLinkContainer.innerText = window.location;
gameLinkContainer.addEventListener('click', () => {
navigator.clipboard.writeText(gameLinkContainer.innerText).then(() => {
toast('Link copied!', 'success', true);
});
});
let copyImg = document.createElement("img");
copyImg.setAttribute("src", "../images/copy.svg");
gameLinkContainer.appendChild(copyImg);