diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/static/main.css | 38 | ||||
| -rw-r--r-- | src/templates/base.html | 24 | ||||
| -rw-r--r-- | src/templates/index.html | 17 | ||||
| -rw-r--r-- | src/text_tv.py | 5 |
4 files changed, 36 insertions, 48 deletions
diff --git a/src/static/main.css b/src/static/main.css index 71dc482..55fa151 100644 --- a/src/static/main.css +++ b/src/static/main.css @@ -2,11 +2,10 @@ body { color: white; background: black; image-rendering: pixelated; - zoom: 2; } #root-container { - margin: auto; + margin: auto; text-align: center; width: min-content; } @@ -15,43 +14,16 @@ body { margin-top: 0.75em; } -#top { - font-size: 10px; -} - -#program { - font-size: 12.85px; -} - -#news { - font-size: 1.36em; - text-align: left; -} - .grey { color: #ddd !important; } img { - width: 400px; -} - -input { - width: 80%; - height: 200%; - font-size: 1em; -} - -#news_input_label { - font-size: 0.7em; -} - -input[type=submit] { - width: fit-content; + width: 50ch; } hr { - border: none; - height: 1px; - background-color: #333; + border: none; + height: 1px; + background-color: #333; } diff --git a/src/templates/base.html b/src/templates/base.html index c600ebf..ead738b 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -1,23 +1,23 @@ <!DOCTYPE html> <html lang="en"> <head> - {% block head %} - <link rel="stylesheet" href="/main.css"/> - <title>Text TV - Bornhack 25</title> - <link rel="icon" type="image/x-icon" href="favicon.ico"> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <script src="main.js" defer></script> - {% endblock %} + {% block head %} + <link rel="stylesheet" href="/main.css"/> + <title>Text TV - Bornhack 25</title> + <link rel="icon" type="image/x-icon" href="favicon.ico"> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <script src="main.js" defer></script> + {% endblock %} </head> <body> - <div id="root-container"> + <div id="root-container"> - {% block content %} - {% endblock %} + {% block content %} + {% endblock %} - <div> + <div> </body> </html> diff --git a/src/templates/index.html b/src/templates/index.html index f076d32..882dbf1 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -6,7 +6,7 @@ <img src="title_headline.png"> - {% include 'program.html' %} + {% include 'program.html' %} {# <img src="news_headline.png"> @@ -31,4 +31,19 @@ </div> </div> +<style> + {% if scale == "fit" %} + body { + font-size: 3vw; + } + {% else %} + body { + zoom: {{ scale }}; + } + .content { + font-size: 1.6ch; + } + {% endif %} +</style> + {% endblock %} diff --git a/src/text_tv.py b/src/text_tv.py index 30b885a..0aeb684 100644 --- a/src/text_tv.py +++ b/src/text_tv.py @@ -16,7 +16,7 @@ debug = 'PROD' not in os.environ @app.route('/top') def top(): now = datetime.datetime.now() if not program_parser.override_date else program_parser.override_date - return f'BornHack S105 {now.strftime("%a %d %b %R:%S")} ' + return ' '.join(['BornHack', 'S105', now.strftime("%a %d %b"), now.strftime("%R:%S")]) @app.route('/update') def update(): @@ -38,7 +38,8 @@ def text() -> dict[str, str]: @app.route('/') def index(): - return flask.render_template('index.html', parts=text()) + scale = flask.request.args.get("scale", "2") + return flask.render_template('index.html', parts=text(), scale=scale) def main(): |
