fixed bugs

This commit is contained in:
2025-03-21 12:57:10 +01:00
parent 4542f80c34
commit 101b29193c
2 changed files with 22 additions and 22 deletions

View File

@@ -50,39 +50,39 @@ class LobbyHandler {
let playerHTML = "";
this.playerList.forEach((player, index) => {
const amI = player.id === this.user.id ? " (Ich)" : "";
const amI = player.id === this.user.id ? ` <span class="message">Ich</span>` : "";
playerHTML += `
<div class="player" id="player${index + 1}">
<h1>Spieler ${index + 1}${amI}</h1>
<h1>${player.username}</h1>
</div>
`;
lobbyContainer.innerHTML = `
<div class="screen">
<nav>
<h1>Spiel-Code:</h1>
<h1 class="message" id="code">
${this.code}
</h1>
</nav>
<div id="playerList">
${playerHTML}
</div>
</div>
`;
`;
});
lobbyContainer.innerHTML = `
<div class="screen">
<nav>
<h1>Spiel-Code:</h1>
<h1 class="message" id="code">
${this.code}
</h1>
</nav>
<div id="playerList">
${playerHTML}
</div>
</div>
`;
const codeText = document.getElementById("code");
codeText.addEventListener("click", () => {
codeText.innerText = "Kopiert!"
codeText.addEventListener("click", (event) => {
event.target.innerText = "Kopiert!"
setTimeout(() => {
codeText.innerText = this.code;
}, 1500);
navigator.clipboard.writeText(this.code);
})
});
this.errorMsg.style.display = "none";
}

View File

@@ -26,7 +26,7 @@ button {
align-items: center;
height: 20%;
background-color: rgba(255, 255, 255, 0.377);
background-color: rgb(124, 124, 124);
border-radius: 10px 10px 0 0;
}
@@ -56,12 +56,12 @@ button {
}
#player1{
background-color: rgba(255, 8, 0, 0.377);
background-color: rgb(187, 6, 0, 0.6);
border-radius: 0 0 0 0;
}
#player2{
background-color: rgba(0, 89, 255, 0.377);
background-color: rgba(0, 52, 150, 0.6);
border-radius: 0 0 10px 10px;
}