test image dependancy

This commit is contained in:
0ceanSlim 2024-02-05 10:42:31 -05:00
parent a9b9693795
commit 819f321387
6 changed files with 16 additions and 18 deletions

12
app.py
View File

@ -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 import sqlite3, os
app = Flask(__name__) app = Flask(__name__)
@ -32,6 +32,16 @@ def show_app():
js_files = get_js_files() js_files = get_js_files()
return render_template("app.html", js_files=js_files) return render_template("app.html", js_files=js_files)
#Retrieve Monster Sprites
#@app.route('/img/monster/<selected_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") @app.route("/get_families")
def get_families(): def get_families():

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -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

View File

@ -1,6 +1,6 @@
function updateMonsterSprite() { function updateMonsterSprite() {
var selectedMonster = document.getElementById("monsterDropdown").value; 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"); var iframe = document.getElementById("monsterSpriteIframe");
iframe.src = "about:blank"; // Clear the iframe content iframe.src = "about:blank"; // Clear the iframe content

View File

@ -3,11 +3,11 @@
<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="https://happytavern.co/.pictures/dwm/favicon.ico" /> <link rel="icon" href="../static/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>
<body class="content-center p-2 m-2 font-mono text-white bg-slate-800"> <body class="content-center justify-center p-2 m-2 font-mono text-white bg-slate-800">
{% block body %} {% endblock %} {% block body %} {% endblock %}
</body> </body>
</html> </html>

View File

@ -2,7 +2,7 @@
<h1 class="text-2xl font-black text-white"> <h1 class="text-2xl font-black text-white">
Welcome to the Dragon Warrior Monsters 2 App Welcome to the Dragon Warrior Monsters 2 App
</h1> </h1>
<div>
<label for="familyDropdown">Select Family:</label> <label for="familyDropdown">Select Family:</label>
<select id="familyDropdown" class="p-2 rounded-md bg-slate-900"> <select id="familyDropdown" class="p-2 rounded-md bg-slate-900">
<option value="">All Families</option> <option value="">All Families</option>
@ -46,7 +46,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="footer mx-auto"> <div class="mx-auto footer">
<h2 class="m-2 text-2xl font-bold">About The App</h2> <h2 class="m-2 text-2xl font-bold">About The App</h2>
<p class="leading-7"> <p class="leading-7">
Dragon Warrior Monsters 2 App, an open-source project where you can explore Dragon Warrior Monsters 2 App, an open-source project where you can explore