diff --git a/app.py b/app.py index 9e5f8a3..292b3cf 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,4 @@ -from flask import Flask, render_template, g, abort, request, jsonify +from flask import Flask, render_template, g, abort, request, jsonify, send_from_directory import sqlite3, os app = Flask(__name__) @@ -32,6 +32,16 @@ def show_app(): js_files = get_js_files() return render_template("app.html", js_files=js_files) +#Retrieve Monster Sprites +#@app.route('/img/monster/.png') +#def retrieve_monster_sprite(selected_monster): +# return send_from_directory('static/img/monster', f'{selected_monster}.png') + +##NOT SURE THIS IS NEEDED +#Retrieve Favicon +#@app.route('/img/favicon.ico') +#def retrieve_favicon(): +# return send_from_directory( '','static/img/favicon.ico') @app.route("/get_families") def get_families(): diff --git a/favicon.ico b/static/img/favicon.ico similarity index 100% rename from favicon.ico rename to static/img/favicon.ico diff --git a/static/js/updateMonsterDropdownBySelected.js b/static/js/updateMonsterDropdownBySelected.js deleted file mode 100644 index ad70e04..0000000 --- a/static/js/updateMonsterDropdownBySelected.js +++ /dev/null @@ -1,12 +0,0 @@ -//function updateMonstersDropdownBySelected() { -// const selectedMonster = parent.value; -// -// // Fetch monsters data from the server based on the selected monster -// fetch(`/monster_info_json/${selectedMonster}`) -// .then(response => response.json()) -// .then(data => populateDropdown(monsterDropdown, data)) -// .catch(error => console.error("Error fetching monsters:", error)); -//} - -// I was using this to try to update the page when a monster -// in the breeding page is clicked \ No newline at end of file diff --git a/static/js/updateMonsterSprite.js b/static/js/updateMonsterSprite.js index fbbb9d6..90a75b7 100644 --- a/static/js/updateMonsterSprite.js +++ b/static/js/updateMonsterSprite.js @@ -1,6 +1,6 @@ function updateMonsterSprite() { var selectedMonster = document.getElementById("monsterDropdown").value; - var spriteUrl = `https://happytavern.co/.pictures/dwm/monster/${selectedMonster}.png`; + var spriteUrl = `/static/img/monster/${selectedMonster}.png`; var iframe = document.getElementById("monsterSpriteIframe"); iframe.src = "about:blank"; // Clear the iframe content diff --git a/templates/.layout.html b/templates/.layout.html index 4548c68..fe07da7 100644 --- a/templates/.layout.html +++ b/templates/.layout.html @@ -3,11 +3,11 @@ - + {% block head %}{% endblock %} - + {% block body %} {% endblock %} diff --git a/templates/app.html b/templates/app.html index 1b50b94..e127af3 100644 --- a/templates/app.html +++ b/templates/app.html @@ -2,7 +2,7 @@

Welcome to the Dragon Warrior Monsters 2 App

-
+