diff --git a/js_client/index.html b/js_client/index.html index ae51bfa..1c2c807 100644 --- a/js_client/index.html +++ b/js_client/index.html @@ -42,8 +42,8 @@ box-shadow: none; outline: none; position: absolute; - width: 15em; - height: 10em; + width: 30em; + height: 20em; top: 0; right: 0; bottom: 0; @@ -54,17 +54,41 @@ font-size: 1em; } + .bigbox { + background-color: black; + border-color: white; + border-width: 0.2em; + border-style: solid; + max-width: 30em; + max-height: 6em; + box-shadow: none; + outline: none; + position: relative; + margin: 1em; + padding: 1em; + color: white; + font-size: 1em; + } + + .flex { + display: flex; + width: 100%; + } + .box { background-color: black; border-color: white; border-width: 0.2em; border-style: solid; - max-width: 15em; + flex: auto; + width: 33%; + text-decoration: none; + max-width: 30em; max-height: 3em; box-shadow: none; outline: none; position: relative; - margin: 1em; + margin: 0.5em; padding: 1em; color: white; font-size: 1em; @@ -76,13 +100,25 @@
-

Select the language:

- -
German
-
- -
English
-
+

choose language and difficulty:

+ +
German
+ +
+ +
English
+ +
diff --git a/js_client/infoBox.js b/js_client/infoBox.js index 3e117af..1f40f30 100644 --- a/js_client/infoBox.js +++ b/js_client/infoBox.js @@ -81,7 +81,8 @@ export class InfoBox extends LitElement { onNew() { setCookie("session", ""); - window.location.href = location.protocol + '//' + location.host + location.pathname; + var crosswordRoot = location.pathname.substr(0, location.pathname.lastIndexOf("/")); + window.location.href = location.protocol + '//' + location.host + crosswordRoot; } diff --git a/js_client/serverConnection.js b/js_client/serverConnection.js index 21ee6af..0bc2dba 100644 --- a/js_client/serverConnection.js +++ b/js_client/serverConnection.js @@ -20,6 +20,7 @@ export class ServerConnection extends WebsocketConnection { this.sessionId = null; this.isRegistered = false; this.crossword_grid = null; + this.difficulty = 0; } @@ -40,6 +41,9 @@ export class ServerConnection extends WebsocketConnection { this.sessionId = params.get('session'); return; } + if (params.has('difficulty')) { + this.difficulty = parseInt(params.get('difficulty')); + } const cookie_session = getCookie('session'); if (cookie_session != "") { this.sessionId = cookie_session; @@ -54,6 +58,7 @@ export class ServerConnection extends WebsocketConnection { this.sendMessage({ 'type': 'register', 'sessionId': this.sessionId, + 'difficulty': this.difficulty, 'lang': this.lang }); }