Make HTML templates

This commit is contained in:
Michał Gdula 2023-05-06 15:25:37 +03:00
parent 0d07a3391b
commit 4088432e99
5 changed files with 15 additions and 45 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View file

@ -5,46 +5,25 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Front Rooms Highscores</title>
<style>
@import url('https://fonts.cdnfonts.com/css/cmu-serif');
* {
font-family: 'CMU Serif', serif;
}
body, html {
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
background-color: #000;
color: #fff;
}
.app {
margin: auto;
padding: 1rem;
text-align: center;
min-width: 621px;
border: 3px solid yellow;
}
</style>
{% assets "styles" %}
<link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css">
{% endassets %}
</head>
<body>
<img src="{{ url_for("static", filename="bg.png") }}" alt="The Front Rooms pause menu" class="background">
<div class="app">
<h1>Front Rooms Highscores</h1>
<p>Created by Bradley, Mia, Bartek & Michał</p>
<img src="{{ url_for("static", filename="title.png") }}" alt="The Front Rooms logo" class="title">
<!-- <p class="subtitle">Project <span>Redacted</span></p> -->
<nav>
<ul>
<li><a href="Easy">Easy</a></li>
<li><a href="Normal">Normal</a></li>
<li><a href="Hard">Hard</a></li>
</ul>
<a href="Level1">Level 1</a>
<a href="Level2">Level 2</a>
<a href="Level3">Level 3</a>
<hr>
<a href="Normal">Normal</a>
<a href="Hard">Hard</a>
</nav>
{% block content %}{% endblock %}

View file

@ -1,14 +1,5 @@
{% extends "base.html" %}
{% block content %}
{% if show_sub %}
<nav>
<ul>
<li><a href="Level1">Level 1</a></li>
<li><a href="Level2">Level 2</a></li>
<li><a href="Level3">Level 3</a></li>
</ul>
</nav>
{% endif %}
<table>
<tr>

View file

@ -23,7 +23,7 @@ class ScoreForm(FlaskForm):
@cache.cached(timeout=60)
def index():
top_scores = Scores.query.order_by(Scores.score.desc()).limit(10).all()
return render_template('scores.html', top_scores=top_scores, show_sub=True)
return render_template('scores.html', top_scores=top_scores)
@blueprint.route('/post', methods=['POST'])