removed img dependancy by creating routes

This commit is contained in:
0ceanSlim 2024-02-05 10:47:21 -05:00
parent 819f321387
commit e1731347bd
3 changed files with 8 additions and 9 deletions

13
app.py
View File

@ -33,15 +33,14 @@ def show_app():
return render_template("app.html", js_files=js_files) return render_template("app.html", js_files=js_files)
#Retrieve Monster Sprites #Retrieve Monster Sprites
#@app.route('/img/monster/<selected_monster>.png') @app.route('/img/monster/<selected_monster>.png')
#def retrieve_monster_sprite(selected_monster): def retrieve_monster_sprite(selected_monster):
# return send_from_directory('static/img/monster', f'{selected_monster}.png') return send_from_directory('static/img/monster', f'{selected_monster}.png')
##NOT SURE THIS IS NEEDED
#Retrieve Favicon #Retrieve Favicon
#@app.route('/img/favicon.ico') @app.route('/img/favicon.ico')
#def retrieve_favicon(): def retrieve_favicon():
# return send_from_directory( '','static/img/favicon.ico') return send_from_directory( '','static/img/favicon.ico')
@app.route("/get_families") @app.route("/get_families")
def get_families(): def get_families():

View File

@ -1,6 +1,6 @@
function updateMonsterSprite() { function updateMonsterSprite() {
var selectedMonster = document.getElementById("monsterDropdown").value; var selectedMonster = document.getElementById("monsterDropdown").value;
var spriteUrl = `/static/img/monster/${selectedMonster}.png`; var spriteUrl = `/img/monster/${selectedMonster}.png`;
var iframe = document.getElementById("monsterSpriteIframe"); var iframe = document.getElementById("monsterSpriteIframe");
iframe.src = "about:blank"; // Clear the iframe content iframe.src = "about:blank"; // Clear the iframe content

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="../static/img/favicon.ico" /> <link rel="icon" href="/img/favicon.ico" />
<link rel="stylesheet" href="../static/style/output.css" /> <link rel="stylesheet" href="../static/style/output.css" />
{% block head %}{% endblock %} {% block head %}{% endblock %}
</head> </head>