diff --git a/main.py b/main.py index 230072a..f9c392e 100644 --- a/main.py +++ b/main.py @@ -22,6 +22,12 @@ def home(): def background(): #return the background image return app.send_static_file('azul.webp') + +@app.route('/socket.io.js') +def socketio_js(): + #return the background image + return app.send_static_file('socket.io.js') + @app.route('/azul-flake.png') def logo(): #return the background image diff --git a/templates/create.html b/templates/create.html index 646a69f..4f3fb6d 100644 --- a/templates/create.html +++ b/templates/create.html @@ -10,40 +10,49 @@ flex-direction: column; justify-content: center; align-items: center; - margin-left: 20vw; - width: 60vw; - /* removed due to low visibility */ - /* background: url({{ url_for('static', filename='azul.webp') }}) no-repeat center center fixed; - -webkit-background-size: cover; - -moz-background-size: cover; - -o-background-size: cover; - background-size: cover; */ + margin-left: 10vw; + width: 80vw; + background-color: #000; + color: #fff; + color-scheme: dark; + } + + div { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex-wrap: wrap; /* Allow the flex items to wrap onto the next line */ + width: 100%; } form { - margin-top: 20px; - width: 300px; + margin-top: 20vh; + max-width: 40em; + min-width: 300px; margin: 0 auto; } input[type="text"] { - padding: 10px; - margin-top: 10px; + padding: 1em; + margin-top: 1em; width: 100%; box-sizing: border-box; - border: 2px solid #000; - border-radius: 4px; + border: 0.5em solid #000; + border-radius: 1em; } input[type="submit"] { - padding: 10px; - margin-top: 10px; + padding: 1em; + margin-top: 3em; width: 100%; background-color: #0000FF; color: #fff; border: none; - border-radius: 4px; + border-radius: 1em; cursor: pointer; + box-shadow: 0px 0.1em 0.5em rgba(255, 255, 255, 0.333); /* Add some shadow for depth */ + transition: background-color 0.3s ease; } input[type="submit"]:hover { @@ -51,12 +60,12 @@ } button { - padding: 10px; - margin-top: 10px; + padding: 1em; + margin-top: 1em; background-color: #0000FF; color: #fff; border: none; - border-radius: 4px; + border-radius: 0.5em; cursor: pointer; } @@ -67,13 +76,16 @@ {% if not game_id %} +
+

Create Game

+

Fill in playernames for wanted players

+

Leave empty for no player ...

+
-
Fill inn playernames for wanted players ...
-
Leave empty for no player ...
- - + +
diff --git a/templates/game.html b/templates/game.html index 949979b..0856401 100644 --- a/templates/game.html +++ b/templates/game.html @@ -5,30 +5,74 @@ Ozai:game

Number of Players: {{ gamestate.n_players }}

Current Player: {{ gamestate.current_player }}

+

Playing as: {{ player_name }}

Game Status: {% if gamestate.game_end %}Ended{% else %}Active{% endif %}

Rounds: {{ gamestate.rounds }}

Days: {{ gamestate.days }}

@@ -210,19 +277,20 @@
{% endfor %} -
{% for name, player_data in gamestate.players.items() %} -
+
- {% if player_name == name %} -

{{ player_name }} (You)

- {% else %} -

{{ name }}

- {% endif %} {% if gamestate.current_player == name %} -

(current)

+

+ {% else %} +

+ {% endif %} + {% if player_name == name %} +
{{ name }}
+ {% else %} +
{{ name }}
{% endif %} {% if player_data.ready %}

Ready

@@ -261,32 +329,75 @@
-
-
1
-
1
-
2
-
2
-
2
-
3
-
3
-
-
+
{% set floor_count = 0 %} + {% set floor_negative_values = [1,1,2,2,2,3,3] %} {% for color, number in player_data.floor.items() %} {% if number > 0 %} {% set floor_count = floor_count + number %} {% for i in range(0, number) %} -
{{ color[:1] }}
+ +
+
-{{ floor_negative_values[i] }}
+
{{ color[:1] }}
+
{% endfor %} {% endif %} {% endfor %} {% if floor_count < 7 %} {% set floor_blank_tiles = 7 - floor_count %} {% for i in range(0, floor_blank_tiles) %} -
_
+
+
-{{ floor_negative_values[i] }}
+
_
+
{% endfor %} {% endif %}
+ + {% if player_name == name %} +
> +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ {% endif %} +
{% endfor %}
@@ -296,39 +407,8 @@ {% if player_name %} -

Play area

-

Playing as: {{ player_name }}

-
> - - - - - - - - - - -
+ {% set current_index = gamestate.player_names.index(player_name) %} {% set next_index = current_index + 1 if current_index + 1 < gamestate.player_names|length else 0 %} @@ -339,7 +419,7 @@ - + - {% endif %} - - - - \ No newline at end of file diff --git a/templates/join_game.html b/templates/join_game.html index acd1135..015c71f 100644 --- a/templates/join_game.html +++ b/templates/join_game.html @@ -4,10 +4,6 @@ Ozai webui:Join Game +
+ {% if game_id %}

Selected game to join is: {{ game_id }}

{% endif %} @@ -67,25 +88,26 @@ + {% else %}

No players found in game, please recreate the game.

{% endif %} + {% if player_name %} -

Selected player to join as: {{ player_name }}

+ - {% endif %} - - +
\ No newline at end of file