adding in a home page with a slide show

This commit is contained in:
Zachary Watts
2026-04-30 02:40:07 -04:00
parent f089cf0d2c
commit 972e094466
4 changed files with 57 additions and 8 deletions

15
app.py
View File

@@ -15,7 +15,8 @@ Session(app)
@app.route('/')
def index():
return render_template("index.html")
tab = request.args.get("tab", default="what", type=str)
return render_template("index.html", tab=tab)
@app.route('/party', methods = ["GET","POST"])
def party():
@@ -71,14 +72,18 @@ def party():
return response
@app.route('/character', methods = ["GET","POST"])
def characters():
def character():
if request.method == "GET":
c_id = str(request.args.get("id", default=0, type=str))
if request.cookies and c_id:
print('in get')
c_id = str(request.args.get("id", default="adv-1", type=str))
if request.cookies:
cookie_encoded = request.cookies[c_id]
cookie_compressed = base64.urlsafe_b64decode(cookie_encoded)
character_dict = json.loads(zlib.decompress(cookie_compressed).decode())
new_char = createCharacterWithDict(character_dict)
else:
new_char = Adventurer(1,1)
print('in else')
new_player = Adventurer(c_id, 1)
selected_class = ClassSelector(new_player).selection()
new_char = selected_class(new_player.identifier, new_player.level, new_player.get_attributes())
return render_template("character.html", character=new_char)