From bdd22ccbafcd9f07161d21fdd52d03534ce750af Mon Sep 17 00:00:00 2001 From: sqozz Date: Fri, 30 Apr 2021 02:12:50 +0200 Subject: [PATCH] Add donation details --- homepage/donations.txt | 12 ++++++ homepage/html/index.html | 11 ++++- homepage/main.py | 8 +++- homepage/static/css/styles.css | 54 +++++++++++++++++++----- homepage/static/img/extract_resources.sh | 2 +- 5 files changed, 73 insertions(+), 14 deletions(-) create mode 100644 homepage/donations.txt diff --git a/homepage/donations.txt b/homepage/donations.txt new file mode 100644 index 0000000..e303df1 --- /dev/null +++ b/homepage/donations.txt @@ -0,0 +1,12 @@ +The server costs 29.00€ per month. +It was rented at 28.03.2021. +The following list transparently shows how much donations I received: + +March 2021: +0€ + +April 2021: +50€ + +Balance as per 30.04.2021: +-8.00€ diff --git a/homepage/html/index.html b/homepage/html/index.html index fc3e5ca..4a094a0 100644 --- a/homepage/html/index.html +++ b/homepage/html/index.html @@ -40,10 +40,17 @@
-
-
Donate
+
Donations
+
+ + +
diff --git a/homepage/main.py b/homepage/main.py index 4cff1a6..f122040 100644 --- a/homepage/main.py +++ b/homepage/main.py @@ -26,7 +26,7 @@ news = """ @route("/") def index(): players = currentPlayerData() - return template("html/index.html", **{"player_count": players["count"]["current"] , "max_players": players["count"]["max"], "news": news}) + return template("html/index.html", **{"player_count": players["count"]["current"] , "max_players": players["count"]["max"], "news": news, "donations": donations()}) @route("/getPlayerSkins") def getPlayerSkins(): @@ -97,5 +97,11 @@ def parseConfig(): config.read("config.ini") return config +def donations(): + with open("donations.txt", "r") as donation_file: + donations = donation_file.read() + return donations + + CONFIG = parseConfig() run(host="localhost", port=8080) diff --git a/homepage/static/css/styles.css b/homepage/static/css/styles.css index 5673325..9c548ff 100644 --- a/homepage/static/css/styles.css +++ b/homepage/static/css/styles.css @@ -44,10 +44,14 @@ body { content:url('/img/writable_book.png'); } -.donate .icon { +.donations.item > .icon { content:url('/img/diamond.png'); } +.donations.details .donate.subitem > .icon { + content:url('/img/gold_ingot.png'); +} + .item { display: flex; background-color: gray; @@ -70,14 +74,6 @@ body { text-decoration: underline; } -.row { - margin-bottom: 10pt; -} - -.row :last-child { - margin-bottom: 0pt; -} - .item .icon { width: 50pt; height: auto; @@ -92,14 +88,52 @@ body { font-weight: bold; } +.details .subitem { + display: flex; + color: #d7d7d7; + text-decoration: none; + text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black; + box-shadow: 5px 5px 15px black; + justify-content: center; +} + +.details .subitem:hover { + cursor: pointer; + color: #FFFFFF; + text-decoration: underline; +} + +.details .subitem .icon { + width: 30pt; + height: auto; + image-rendering: crisp-edges; + padding-right: 10pt; +} + +.details .subitem .text { + display: flex; + align-items: center; + font-size: 20pt; + font-weight: bold; +} + +.row { + margin-bottom: 10pt; +} + +.row :last-child { + margin-bottom: 0pt; +} + .details { /* Hidden by default */ /*display: flex;*/ display: none; justify-content: center; + flex-wrap: wrap; } -.row .details.news textarea { +.row .details textarea { resize: none; border: none; } diff --git a/homepage/static/img/extract_resources.sh b/homepage/static/img/extract_resources.sh index d71f586..a9c7bfa 100755 --- a/homepage/static/img/extract_resources.sh +++ b/homepage/static/img/extract_resources.sh @@ -11,7 +11,7 @@ echo "done!" echo "Unzipped resources at $TMP_PATH" popd -FILES="birch_sign.png map.png redstone_lamp_on.png redstone_lamp.png writable_book.png diamond.png" +FILES="birch_sign.png map.png redstone_lamp_on.png redstone_lamp.png writable_book.png diamond.png gold_ingot.png" for FILE in $FILES; do echo -n "Grabbing asset from: " find $TMP_PATH -name $FILE -print -exec cp {} . \;