From 883ebbf267af07b8ffadb55ff58d9f812e50a69d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 14 Jun 2021 22:27:43 -0400 Subject: [PATCH] Updating WebHost structure --- WebHostLib/__init__.py | 40 +++++++++++++++---- .../assets/{ => zelda3}/playerSettings.js | 0 .../styles/{ => zelda3}/playerSettings.css | 2 +- WebHostLib/static/styles/zelda3/zelda3.css | 0 .../games/{ => factorio}/factorio.html | 0 .../games/{ => minecraft}/minecraft.html | 0 .../{ => games/zelda3}/playerSettings.html | 4 +- .../templates/games/{ => zelda3}/zelda3.html | 3 +- 8 files changed, 38 insertions(+), 11 deletions(-) rename WebHostLib/static/assets/{ => zelda3}/playerSettings.js (100%) rename WebHostLib/static/styles/{ => zelda3}/playerSettings.css (96%) create mode 100644 WebHostLib/static/styles/zelda3/zelda3.css rename WebHostLib/templates/games/{ => factorio}/factorio.html (100%) rename WebHostLib/templates/games/{ => minecraft}/minecraft.html (100%) rename WebHostLib/templates/{ => games/zelda3}/playerSettings.html (94%) rename WebHostLib/templates/games/{ => zelda3}/zelda3.html (54%) diff --git a/WebHostLib/__init__.py b/WebHostLib/__init__.py index 07ffa630..53b87be5 100644 --- a/WebHostLib/__init__.py +++ b/WebHostLib/__init__.py @@ -102,17 +102,43 @@ games_list = { victory!""") } + +# Player settings pages +@app.route('/games//player-settings') +def player_settings(game): + return render_template(f"/games/{game}/playerSettings.html") + + +# Zelda3 pages +@app.route('/games/zelda3/') +def zelda3_pages(page): + return render_template(f"/games/zelda3/{page}.html") + + +# Factorio pages +@app.route('/games/factorio/') +def factorio_pages(page): + return render_template(f"/games/factorio/{page}.html") + + +# Minecraft pages +@app.route('/games/minecraft/') +def minecraft_pages(page): + return render_template(f"/games/factorio/{page}.html") + + +# Game landing pages +@app.route('/games/') +def game_page(game): + return render_template(f"/games/{game}/{game}.html") + + +# List of supported games @app.route('/games') def games(): return render_template("games/games.html", games_list=games_list) -@app.route('/games/') -def game_page(game): - return render_template(f"/games/{game}"+".html") - - - @app.route('/tutorial///') def tutorial(game, file, lang): return render_template("tutorial.html", game=game, file=file, lang=lang) @@ -124,7 +150,7 @@ def tutorial_landing(): @app.route('/weighted-settings') -def player_settings(): +def weighted_settings(): return render_template("weightedSettings.html") diff --git a/WebHostLib/static/assets/playerSettings.js b/WebHostLib/static/assets/zelda3/playerSettings.js similarity index 100% rename from WebHostLib/static/assets/playerSettings.js rename to WebHostLib/static/assets/zelda3/playerSettings.js diff --git a/WebHostLib/static/styles/playerSettings.css b/WebHostLib/static/styles/zelda3/playerSettings.css similarity index 96% rename from WebHostLib/static/styles/playerSettings.css rename to WebHostLib/static/styles/zelda3/playerSettings.css index ac675ebb..e92c4868 100644 --- a/WebHostLib/static/styles/playerSettings.css +++ b/WebHostLib/static/styles/zelda3/playerSettings.css @@ -1,5 +1,5 @@ html{ - background-image: url('../static/backgrounds/grass/grass-0007-large.png'); + background-image: url('../../static/backgrounds/grass/grass-0007-large.png'); background-repeat: repeat; background-size: 650px 650px; } diff --git a/WebHostLib/static/styles/zelda3/zelda3.css b/WebHostLib/static/styles/zelda3/zelda3.css new file mode 100644 index 00000000..e69de29b diff --git a/WebHostLib/templates/games/factorio.html b/WebHostLib/templates/games/factorio/factorio.html similarity index 100% rename from WebHostLib/templates/games/factorio.html rename to WebHostLib/templates/games/factorio/factorio.html diff --git a/WebHostLib/templates/games/minecraft.html b/WebHostLib/templates/games/minecraft/minecraft.html similarity index 100% rename from WebHostLib/templates/games/minecraft.html rename to WebHostLib/templates/games/minecraft/minecraft.html diff --git a/WebHostLib/templates/playerSettings.html b/WebHostLib/templates/games/zelda3/playerSettings.html similarity index 94% rename from WebHostLib/templates/playerSettings.html rename to WebHostLib/templates/games/zelda3/playerSettings.html index cbf743be..681b7140 100644 --- a/WebHostLib/templates/playerSettings.html +++ b/WebHostLib/templates/games/zelda3/playerSettings.html @@ -2,10 +2,10 @@ {% block head %} Player Settings - + - + {% endblock %} {% block body %} diff --git a/WebHostLib/templates/games/zelda3.html b/WebHostLib/templates/games/zelda3/zelda3.html similarity index 54% rename from WebHostLib/templates/games/zelda3.html rename to WebHostLib/templates/games/zelda3/zelda3.html index 0e0e24a8..4d8b6192 100644 --- a/WebHostLib/templates/games/zelda3.html +++ b/WebHostLib/templates/games/zelda3/zelda3.html @@ -4,6 +4,7 @@ Link to the Past - Link to the Past + Link to the Past
+ Player Settings