From 34c74c9d2a7b8a946cc1952ef64cc649b63f4c36 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 23 Feb 2021 19:34:35 -0500 Subject: [PATCH] Set up basic template for player tracker --- WebHostLib/static/assets/playerTracker.js | 3 + WebHostLib/static/styles/playerTracker.css | 60 ++++++++++ WebHostLib/templates/playerTracker.html | 127 ++++++++++++++++++++- WebHostLib/templates/tracker.html | 8 +- WebHostLib/tracker.py | 16 ++- 5 files changed, 205 insertions(+), 9 deletions(-) create mode 100644 WebHostLib/static/assets/playerTracker.js create mode 100644 WebHostLib/static/styles/playerTracker.css diff --git a/WebHostLib/static/assets/playerTracker.js b/WebHostLib/static/assets/playerTracker.js new file mode 100644 index 00000000..212df549 --- /dev/null +++ b/WebHostLib/static/assets/playerTracker.js @@ -0,0 +1,3 @@ +window.addEventListener('load', () => { + // setTimeout(() => window.location.reload(), 15000); +}); diff --git a/WebHostLib/static/styles/playerTracker.css b/WebHostLib/static/styles/playerTracker.css new file mode 100644 index 00000000..9f18f0fd --- /dev/null +++ b/WebHostLib/static/styles/playerTracker.css @@ -0,0 +1,60 @@ +#player-tracker-wrapper{ + +} + +#inventory-table{ + border: 2px solid black; + border-radius: 4px; + margin-bottom: 5px; + width: 250px; +} + +#inventory-table td{ + width: 40px; + height: 40px; + text-align: center; + vertical-align: middle; +} + +#inventory-table img{ + height: 100%; + max-width: 40px; + max-height: 40px; + filter: grayscale(100%); +} + +#inventory-table img.acquired{ + filter: none; +} + +#inventory-table img.powder-fix{ + width: 35px; + height: 35px; +} + +#location-table{ + width: 250px; + border: 2px solid black; + border-radius: 4px; +} + +#location-table th{ + vertical-align: middle; + text-align: center; +} + +#location-table td{ + padding-top: 2px; + padding-bottom: 2px; +} + +#location-table th.counter, #location-table td.counter{ + padding-right: 10px; + text-align: center; +} + +#location-table img{ + height: 100%; + max-width: 30px; + max-height: 30px; +} diff --git a/WebHostLib/templates/playerTracker.html b/WebHostLib/templates/playerTracker.html index 73273215..ec77046a 100644 --- a/WebHostLib/templates/playerTracker.html +++ b/WebHostLib/templates/playerTracker.html @@ -2,13 +2,134 @@ {{ player_name }}'s Tracker - - + +
- This will eventually be the player tracker for {{ player_name }}. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hyrule Castle0 / 00 / 0
Eastern Palace0 / 00 / 0
Desert Palace0 / 00 / 0
Tower of Hera0 / 00 / 0
Agahnim's Tower0 / 00 / 0
Palace of Darkness0 / 00 / 0
Swamp Palace0 / 00 / 0
Skull Woods0 / 00 / 0
Thieves' Town0 / 00 / 0
Ice Palace0 / 00 / 0
Misery Mire0 / 00 / 0
Turtle Rock0 / 00 / 0
Ganon's Tower0 / 00 / 0
diff --git a/WebHostLib/templates/tracker.html b/WebHostLib/templates/tracker.html index 1ba56337..ea5b6b67 100644 --- a/WebHostLib/templates/tracker.html +++ b/WebHostLib/templates/tracker.html @@ -35,10 +35,10 @@ {{ name|e }} - {%- else -%} - {{ name|e }} - {%- endif -%} - {%- endfor -%} + {%- else -%} + {{ name|e }} + {%- endif -%} + {%- endfor -%} diff --git a/WebHostLib/tracker.py b/WebHostLib/tracker.py index 603b91d0..1ad837ba 100644 --- a/WebHostLib/tracker.py +++ b/WebHostLib/tracker.py @@ -20,14 +20,26 @@ app.jinja_env.filters["location_name"] = lambda location: Regions.lookup_id_to_n app.jinja_env.filters['item_name'] = lambda id: Items.lookup_id_to_name.get(id, id) icons = { + "Fighter Sword": r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/4/40/SFighterSword.png?width=1920", + "Master Sword": r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/6/65/SMasterSword.png?width=1920", + "Tempered Sword": r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/9/92/STemperedSword.png?width=1920", + "Golden Sword": r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/2/28/SGoldenSword.png?width=1920", + "Bow": r"https://gamepedia.cursecdn.com/zelda_gamepedia_en/b/bc/ALttP_Bow_%26_Arrows_Sprite.png?version=cfb7648b3714cccc80e2b17b2adf00ed", + "Bow and Arrows": r"https://gamepedia.cursecdn.com/zelda_gamepedia_en/b/bc/ALttP_Bow_%26_Arrows_Sprite.png?version=5f85a70e6366bf473544ef93b274f74c", + "Bow and Silver Arrows": r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/6/65/Bow.png?width=1920", + "Green Mail": r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/c/c9/SGreenTunic.png?width=1920", + "Blue Mail": r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/9/98/SBlueTunic.png?width=1920", + "Red Mail": r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/7/74/SRedTunic.png?width=1920", + "Power Glove": r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/f/f5/SPowerGlove.png?width=1920", + "Titan Mitts": r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/c/c1/STitanMitt.png?width=1920", "Progressive Sword": r"https://gamepedia.cursecdn.com/zelda_gamepedia_en/c/cc/ALttP_Master_Sword_Sprite.png?version=55869db2a20e157cd3b5c8f556097725", "Pegasus Boots": r"https://gamepedia.cursecdn.com/zelda_gamepedia_en/e/ed/ALttP_Pegasus_Shoes_Sprite.png?version=405f42f97240c9dcd2b71ffc4bebc7f9", "Progressive Glove": - r"https://gamepedia.cursecdn.com/zelda_gamepedia_en/5/53/ALttP_Titan's_Mitt_Sprite.png?version=6ac54c3016a23b94413784881fcd3c75", + r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/c/c1/STitanMitt.png?width=1920", "Flippers": - r"https://gamepedia.cursecdn.com/zelda_gamepedia_en/8/88/ALttP_Zora's_Flippers_Sprite.png?version=b9d7521bb3a5a4d986879f70a70bc3da", + r"https://oyster.ignimgs.com/mediawiki/apis.ign.com/the-legend-of-zelda-a-link-to-the-past/4/4c/ZoraFlippers.png?width=1920", "Moon Pearl": r"https://gamepedia.cursecdn.com/zelda_gamepedia_en/6/63/ALttP_Moon_Pearl_Sprite.png?version=d601542d5abcc3e006ee163254bea77e", "Progressive Bow":