diff --git a/Public/elements.js b/Public/elements.js index 0455703..62a1259 100644 --- a/Public/elements.js +++ b/Public/elements.js @@ -10,6 +10,16 @@ function showLoginWindow() { document.getElementById("signup-window").style.display = "table" } +function hideTableListElements() { + document.getElementById("table-list-bar").style.display = "none" + document.getElementById("table-list").style.display = "none" +} + +function showTableListElements() { + document.getElementById("table-list-bar").style.display = "grid" + document.getElementById("table-list").style.display = "inherit" +} + function setPlayerName(name) { document.getElementById("player-name").innerHTML = name } diff --git a/Public/game.js b/Public/game.js index 7bc02d7..1f1d76a 100644 --- a/Public/game.js +++ b/Public/game.js @@ -28,11 +28,17 @@ function showBlankLoginScreen(text) { setLoginError(text) } +function showTableList() { + showTableListElements() + hideLoginWindow() +} + function showGame(tableId) { setTableId(tableId) const token = getSessionToken() if (token) { openSocket(token) + hideTableListElements() // TODO: Show interface console.log("Show table " + tableId) } else { @@ -55,7 +61,7 @@ function registerUser() { .then(function(token) { setSessionToken(token) setPlayerName(username) - hideLoginWindow() + showTableList() loadCurrentTable(token) }).catch(function(error) { setLoginError(error.message) @@ -94,7 +100,7 @@ function loginUser() { .then(function(token) { setSessionToken(token) setPlayerName(username) - hideLoginWindow() + showTableList() loadCurrentTable(token) }).catch(function(error) { setLoginError(error.message) @@ -122,7 +128,7 @@ function loadExistingSession() { resumeSessionRequest(token) .then(function(name) { setPlayerName(name) - hideLoginWindow() + showTableList() loadCurrentTable(token) }).catch(function(error) { showBlankLoginScreen(error.message) diff --git a/Public/schafkopf.html b/Public/schafkopf.html index 7cf9fb8..38be909 100644 --- a/Public/schafkopf.html +++ b/Public/schafkopf.html @@ -15,7 +15,7 @@
-
+
Public @@ -26,11 +26,7 @@
- -
- -
- +