Make pages prettier
This commit is contained in:
parent
d19c990039
commit
040ec1a139
5 changed files with 121 additions and 7 deletions
2
main.py
2
main.py
|
@ -5,10 +5,12 @@ import qrcode
|
||||||
import qrcode.image.svg
|
import qrcode.image.svg
|
||||||
from fastapi import FastAPI, Form, HTTPException, Request
|
from fastapi import FastAPI, Form, HTTPException, Request
|
||||||
from fastapi.responses import HTMLResponse, RedirectResponse
|
from fastapi.responses import HTMLResponse, RedirectResponse
|
||||||
|
from fastapi.staticfiles import StaticFiles
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
from mollie.api.client import Client
|
from mollie.api.client import Client
|
||||||
|
|
||||||
app = FastAPI(docs_url=None, redoc_url=None)
|
app = FastAPI(docs_url=None, redoc_url=None)
|
||||||
|
app.mount("/static", StaticFiles(directory="resources/static"), name="static")
|
||||||
templates = Jinja2Templates(directory="resources")
|
templates = Jinja2Templates(directory="resources")
|
||||||
|
|
||||||
public_url = os.environ.get("PUBLIC_URL", "http://localhost:8000").rstrip("/")
|
public_url = os.environ.get("PUBLIC_URL", "http://localhost:8000").rstrip("/")
|
||||||
|
|
|
@ -1,11 +1,21 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="stylesheet" href="/static/style.css" />
|
||||||
<title>Revbank Deposit</title>
|
<title>Revbank Deposit</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>Scan this code:</p>
|
<h1>Bitlair Bartegoed Scannen</h1>
|
||||||
|
|
||||||
|
<p>Scan nu deze code in Revbank:</p>
|
||||||
{{ qr_svg | safe }}
|
{{ 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>
|
</body>
|
||||||
<html>
|
</html>
|
||||||
|
|
BIN
resources/static/fonts/Bitter-Regular.ttf
Normal file
BIN
resources/static/fonts/Bitter-Regular.ttf
Normal file
Binary file not shown.
80
resources/static/style.css
Normal file
80
resources/static/style.css
Normal 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;
|
||||||
|
}
|
|
@ -1,13 +1,35 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="stylesheet" href="/static/style.css" />
|
||||||
<title>Revbank Deposit</title>
|
<title>Revbank Deposit</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<h1>Bitlair Bartegoed Kopen</h1>
|
||||||
|
|
||||||
<form method="post" action="/">
|
<form method="post" action="/">
|
||||||
{% for amount in [10, 20, 40, 80] -%}
|
<p>Met hoeveel wil je opwaarderen?</p>
|
||||||
€ <input type="submit" name="amount" value="{{ amount }}" />
|
{% for amount in [16, 32, 64, 128] -%}
|
||||||
{% endfor -%}
|
<label class="pay-option pay-preset">
|
||||||
|
€ {{ amount }},-
|
||||||
|
<input type="submit" name="amount" value="{{ amount }}" />
|
||||||
|
</label>
|
||||||
|
{%- endfor %}
|
||||||
</form>
|
</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>
|
</body>
|
||||||
<html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue