diff --git a/src/main/resources/public/js/lobby.js b/src/main/resources/public/js/lobby.js index 99df629..a4c44ab 100644 --- a/src/main/resources/public/js/lobby.js +++ b/src/main/resources/public/js/lobby.js @@ -12,8 +12,13 @@ document.getElementById("createGame").addEventListener("click", () => { window.location.href = `/create-game.html?username=${encodeURIComponent(username)}`; }); -document.getElementById("joinGame").addEventListener("click", () => { - window.location.href = username - ? `/join-game.html?username=${encodeURIComponent(username)}` - : "/join-game.html"; +//document.getElementById("joinGame").addEventListener("click", () => { + // window.location.href = username + // ? `/join-game.html?username=${encodeURIComponent(username)}` + // : "/join-game.html"; +//}); +// NEU: statt Redirect -> Fokus auf Eingabe +document.getElementById("joinGame")?.addEventListener("click", () => { + const input = document.getElementById("gameId"); + if (input) { input.focus(); input.select(); } }); diff --git a/src/main/resources/public/lobby.html b/src/main/resources/public/lobby.html index 4aa961e..42dbe38 100644 --- a/src/main/resources/public/lobby.html +++ b/src/main/resources/public/lobby.html @@ -52,6 +52,15 @@ .tile .txt{display:flex; flex-direction:column} .tile .txt b{font-size:16px} .tile .txt span{font-size:13px; color:var(--muted)} + + /* Join form */ + .row{display:flex; gap:10px; align-items:center; flex-wrap:wrap} + label{color:var(--muted)} + input[type="text"]{ + background:#0f0f0f; color:var(--text); border:1px solid var(--border); + padding:12px 14px; border-radius:12px; outline:none; min-width:180px; + } + input:focus{border-color:var(--accent); box-shadow:0 0 0 3px var(--glow)} @@ -85,22 +94,44 @@ -
Bestehendem Spiel beitretenDu hast schon einen Code? Klicke hier.
+
Bestehendem Spiel beitretenDu hast schon einen Code? Gib ihn unten ein.
- + + +
+ + + + + +
+ +

Tipp: Code ist vierstellig (z.B. 3759).

- + + + + + - + \ No newline at end of file