Add news section

This commit is contained in:
sqozz 2021-03-24 01:50:28 +01:00
parent dd556115aa
commit 2fb81a6b36
3 changed files with 56 additions and 19 deletions

View file

@ -10,18 +10,27 @@
<div class="content"> <div class="content">
<div class="player_count">Players Online: {{player_count}}/{{max_players}}</div> <div class="player_count">Players Online: {{player_count}}/{{max_players}}</div>
<div class="items"> <div class="items">
<a class="row news" href="/news"> <div class="row">
<div class="icon"></div> <a class="item news" href="/news">
<div class="text">News</div> <div class="icon"></div>
</a> <div class="text">News</div>
<a class="row map" href="https://play.geekify.de"> </a>
<div class="icon"></div> <div class="news details">
<div class="text">Map</div> <textarea name="news" rows=20 readonly>{{news}}</textarea>
</a> </div>
<a class="row whitelist" href="/request"> </div>
<div class="icon"></div> <div class="row">
<div class="text">Request Invite</div> <a class="item map" href="https://play.geekify.de">
</a> <div class="icon"></div>
<div class="text">Map</div>
</a>
</div>
<div class="row">
<a class="item whitelist" href="/request">
<div class="icon"></div>
<div class="text">Request Invite</div>
</a>
</div>
</div> </div>
</div> </div>
</body> </body>

View file

@ -7,9 +7,18 @@ from random import random, choice
# echo -n "["; ls | xargs -I{} echo -n \"{}\",; echo "]" # echo -n "["; ls | xargs -I{} echo -n \"{}\",; echo "]"
BG_IMAGES = listdir("./static/img/background") BG_IMAGES = listdir("./static/img/background")
news = """
=== 2021-03-24 ===
* TestABC
* FooBar
=== 2020-xx-xx ===
* Map now available
"""
@route("/") @route("/")
def index(): 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") @route("/request")
def request_whitelist(): def request_whitelist():

View file

@ -47,10 +47,9 @@ body {
content:url('/img/writable_book.png'); content:url('/img/writable_book.png');
} }
.row { .item {
display: flex; display: flex;
background-color: gray; background-color: gray;
margin-bottom: 10pt;
padding: 2pt; padding: 2pt;
color: #d7d7d7; color: #d7d7d7;
border: 5px solid black; border: 5px solid black;
@ -61,7 +60,7 @@ body {
box-shadow: 5px 5px 15px black; box-shadow: 5px 5px 15px black;
} }
.row:hover { .item:hover {
background-color: red; background-color: red;
cursor: pointer; cursor: pointer;
background-image: url("/img/redstone_lamp_on.png"); background-image: url("/img/redstone_lamp_on.png");
@ -70,24 +69,44 @@ body {
text-decoration: underline; text-decoration: underline;
} }
.items :last-child { .row {
margin-bottom: 10pt;
}
.row :last-child {
margin-bottom: 0pt; margin-bottom: 0pt;
} }
.row .icon { .item .icon {
width: 50pt; width: 50pt;
height: auto; height: auto;
image-rendering: crisp-edges; image-rendering: crisp-edges;
padding: 10pt; padding: 10pt;
} }
.row .text { .item .text {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 25pt; font-size: 25pt;
font-weight: bold; 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-face {
font-family: 'minecraft'; font-family: 'minecraft';
src: URL('/fonts/Minecraft.ttf') format('truetype'); src: URL('/fonts/Minecraft.ttf') format('truetype');