Make pages prettier

This commit is contained in:
polyfloyd 2025-04-13 15:13:31 +02:00
parent d19c990039
commit 040ec1a139
5 changed files with 121 additions and 7 deletions

View file

@ -5,10 +5,12 @@ import qrcode
import qrcode.image.svg
from fastapi import FastAPI, Form, HTTPException, Request
from fastapi.responses import HTMLResponse, RedirectResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from mollie.api.client import Client
app = FastAPI(docs_url=None, redoc_url=None)
app.mount("/static", StaticFiles(directory="resources/static"), name="static")
templates = Jinja2Templates(directory="resources")
public_url = os.environ.get("PUBLIC_URL", "http://localhost:8000").rstrip("/")

View file

@ -1,11 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/style.css" />
<title>Revbank Deposit</title>
</head>
<body>
<p>Scan this code:</p>
<h1>Bitlair Bartegoed Scannen</h1>
<p>Scan nu deze code in Revbank:</p>
{{ qr_svg | safe }}
<pre>{{ code }}</pre>
<p>Of typ over: <code>{{ code }}</code></p>
<p>Rond af door je accountnaam te typen.</p>
<footer>
<a href="https://bitlair.nl">bitlair.nl</a>
</footer>
</body>
<html>
</html>

Binary file not shown.

View file

@ -0,0 +1,80 @@
@font-face {
font-family: 'Bitter';
font-style: normal;
font-weight: 900;
font-display: swap;
src: url(/static/fonts/Bitter-Regular.ttf) format('truetype');
}
:root {
--accent-color: #f60;
}
body {
background-color: #333;
color: var(--accent-color);
font-family: Bitter;
font-size: 1.4rem;
}
a:visited {
color: inherit;
}
footer {
font-size: 1rem;
margin-top: 3em;
}
.pay-option {
margin: 8px;
font-size: 24px;
text-align: center;
vertical-align: middle;
border: 4px solid var(--accent-color);
background: transparent;
color: inherit;
cursor: pointer;
}
.pay-option.pay-preset {
display: inline-block;
width: 100px;
height: 100px;
line-height: 100px;
}
.pay-option.pay-preset > input {
display: none;
}
.pay-option.pay-custom {
display: inline-block;
padding: 4px 0 4px 8px;
}
.pay-option.pay-custom > input {
width: 4em;
font-size: inherit;
border: none;
color: inherit;
background-color: transparent;
}
.pay-custom + input[type="submit"] {
display: inline-block;
font-size: 24px;
border: none;
background: transparent;
color: inherit;
}
svg {
background-color: #fff;
}

View file

@ -1,13 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/style.css" />
<title>Revbank Deposit</title>
</head>
<body>
<h1>Bitlair Bartegoed Kopen</h1>
<form method="post" action="/">
{% for amount in [10, 20, 40, 80] -%}
€ <input type="submit" name="amount" value="{{ amount }}" />
{% endfor -%}
<p>Met hoeveel wil je opwaarderen?</p>
{% for amount in [16, 32, 64, 128] -%}
<label class="pay-option pay-preset">
€ {{ amount }},-
<input type="submit" name="amount" value="{{ amount }}" />
</label>
{%- endfor %}
</form>
<form method="post" action="/">
<p>Iets anders?</p>
<label class="pay-option pay-custom">
<input name="amount" required maxlength="6" pattern="[0-9]+(?:[,.][0-9]{2})?" title="42 of 42.00 of 42,00" type="text" placeholder="13,37" />
</label><!--
--><input type="submit" value="Verder" />
</form>
<footer>
<a href="https://bitlair.nl">bitlair.nl</a>
</footer>
</body>
<html>
</html>