From eb361f1f9f66174c53c81fc1f6c33e8091977977 Mon Sep 17 00:00:00 2001 From: Foxpolar Date: Mon, 30 Dec 2024 15:45:41 +0300 Subject: [PATCH] Baulder's Gate test --- .gitignore | 1 + site/app.py | 24 ++++++++++++++++++++++++ site/static/css/style.css | 29 +++++++++++++++++++++++++++++ site/templates/index.html | 23 +++++++++++++++++++++++ site/templates/result.html | 13 +++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 .gitignore create mode 100644 site/app.py create mode 100644 site/static/css/style.css create mode 100644 site/templates/index.html create mode 100644 site/templates/result.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eba74f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv/ \ No newline at end of file diff --git a/site/app.py b/site/app.py new file mode 100644 index 0000000..f0f5131 --- /dev/null +++ b/site/app.py @@ -0,0 +1,24 @@ +from flask import Flask, render_template, request + +app = Flask(__name__) + +@app.route('/') +def index(): + return render_template("index.html") + +@app.route("/result", mathods=["POST"]) +def result(): + answers = request.form + character = determine_character(answers) + return render_template("result.html", character=character) + +def datermine_character(answers): + if answers.get("question1") == "brave": + return "Minsc" + elif answers.get("question1") == "wise": + return "Jeheira" + else: + return "Imoem" + +if __name__=="__main__": + app.run(debug=True) \ No newline at end of file diff --git a/site/static/css/style.css b/site/static/css/style.css new file mode 100644 index 0000000..b7994eb --- /dev/null +++ b/site/static/css/style.css @@ -0,0 +1,29 @@ +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + text-align: center; + margin: 0; + padding: 0; +} + +h1 { + color: #333; +} + +form { + margin: 20px auto; + padding: 20px; + background: #fff; + border-radius: 8px; + width: 300px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); +} + +button { + padding: 10px 20px; + background: #007bff; + color: #fff; + border: none; + border-radius: 4px; + cursor: pointer; +} diff --git a/site/templates/index.html b/site/templates/index.html new file mode 100644 index 0000000..e6afe21 --- /dev/null +++ b/site/templates/index.html @@ -0,0 +1,23 @@ + + + + + + Baldur's Gate Quiz + + + +

Who Are you in Baldur's Gate?

+
+

1. What trait best describes you?

+ +
+ +
+ +

+ + +
+ + \ No newline at end of file diff --git a/site/templates/result.html b/site/templates/result.html new file mode 100644 index 0000000..7f91925 --- /dev/null +++ b/site/templates/result.html @@ -0,0 +1,13 @@ + + + + + + Your Baldur's Gate Character + + + +

You are {{ character }}!

+ Try Again + + \ No newline at end of file