From 2fb81a6b36f7cc2a48f8fea2f85678469ef457ce Mon Sep 17 00:00:00 2001 From: sqozz Date: Wed, 24 Mar 2021 01:50:28 +0100 Subject: [PATCH] Add news section --- homepage/html/index.html | 33 +++++++++++++++++++++------------ homepage/main.py | 11 ++++++++++- homepage/static/css/styles.css | 31 +++++++++++++++++++++++++------ 3 files changed, 56 insertions(+), 19 deletions(-) diff --git a/homepage/html/index.html b/homepage/html/index.html index f044738..fc1d798 100644 --- a/homepage/html/index.html +++ b/homepage/html/index.html @@ -10,18 +10,27 @@
Players Online: {{player_count}}/{{max_players}}
diff --git a/homepage/main.py b/homepage/main.py index 5578318..814131e 100644 --- a/homepage/main.py +++ b/homepage/main.py @@ -7,9 +7,18 @@ from random import random, choice # echo -n "["; ls | xargs -I{} echo -n \"{}\",; echo "]" BG_IMAGES = listdir("./static/img/background") +news = """ +=== 2021-03-24 === +* TestABC +* FooBar + +=== 2020-xx-xx === +* Map now available +""" + @route("/") def index(): - return template("html/index.html", **{"player_count": int(random()*20), "max_players": 20}) + return template("html/index.html", **{"player_count": int(random()*20), "max_players": 20, "news": news}) @route("/request") def request_whitelist(): diff --git a/homepage/static/css/styles.css b/homepage/static/css/styles.css index ca8fa54..aedfe00 100644 --- a/homepage/static/css/styles.css +++ b/homepage/static/css/styles.css @@ -47,10 +47,9 @@ body { content:url('/img/writable_book.png'); } -.row { +.item { display: flex; background-color: gray; - margin-bottom: 10pt; padding: 2pt; color: #d7d7d7; border: 5px solid black; @@ -61,7 +60,7 @@ body { box-shadow: 5px 5px 15px black; } -.row:hover { +.item:hover { background-color: red; cursor: pointer; background-image: url("/img/redstone_lamp_on.png"); @@ -70,24 +69,44 @@ body { text-decoration: underline; } -.items :last-child { +.row { + margin-bottom: 10pt; +} + +.row :last-child { margin-bottom: 0pt; } -.row .icon { +.item .icon { width: 50pt; height: auto; image-rendering: crisp-edges; padding: 10pt; } -.row .text { +.item .text { display: flex; align-items: center; font-size: 25pt; font-weight: bold; } +.details { + display: flex; + justify-content: center; +} + +.row .details.news textarea { + resize: none; + width: 90%; + background: url("/img/stripped_birch_log.png"); + background-size: 80px; + border: none; + padding: 10pt; + margin-top: 5pt; + box-shadow: 5px 5px 15px black; +} + @font-face { font-family: 'minecraft'; src: URL('/fonts/Minecraft.ttf') format('truetype');