Add donation details

This commit is contained in:
sqozz 2021-04-30 02:12:50 +02:00
parent f3303cf938
commit bdd22ccbaf
5 changed files with 73 additions and 14 deletions

12
homepage/donations.txt Normal file
View File

@ -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€

View File

@ -40,10 +40,17 @@
</div>
</div>
<div class="row">
<a class="item donate" href="https://paypal.me/MCgeekify" target="_blank">
<a class="item donations" onclick="return toggleDetails(this)">
<div class="icon"></div>
<div class="text">Donate</div>
<div class="text">Donations</div>
</a>
<div class="donations details">
<textarea name="donations" rows=20 readonly>{{donations}}</textarea>
<a class="subitem donate" href="https://paypal.me/MCgeekify" target="_blank">
<div class="icon"></div>
<div class="text">Donate (PayPal)</div>
</a>
</div>
</div>
</div>
</div>

View File

@ -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)

View File

@ -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;
}

View File

@ -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 {} . \;