initial commit
This commit is contained in:
parent
618c73c122
commit
5c2eb47f45
5 changed files with 133 additions and 0 deletions
32
index.html
Normal file
32
index.html
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset='utf-8'>
|
||||||
|
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
||||||
|
<title>Games - lila.network</title>
|
||||||
|
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||||
|
<link rel='stylesheet' type='text/css' media='screen' href='/static/style.css'>
|
||||||
|
<link rel="preload" href="/static/open-sans-v35-latin-regular.woff2" as="font" type="font/woff2" crossorigin>
|
||||||
|
<script src='/static/main.js' defer></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body onload="javascript:populatePage()">
|
||||||
|
<h1>LiLa Games</h1>
|
||||||
|
|
||||||
|
<div id="gamelist">
|
||||||
|
</div>
|
||||||
|
<template id="game-template">
|
||||||
|
<h2><i id="game-name"></i> <img id="game-badge" class="status-image" src=""></img></h2>
|
||||||
|
|
||||||
|
<div class="game-card">
|
||||||
|
<p>URL: <i class="info" id="game-url"></i></p>
|
||||||
|
<p>Passwort nötig? <i class="info" id="game-password"></i></p>
|
||||||
|
<p>Whitelist? <i class="info" id="game-whitelist"></i></p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
23
servers.json
Normal file
23
servers.json
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 15,
|
||||||
|
"displayname": "Minecraft AllTheMods 8",
|
||||||
|
"serverurl": "allthemods.lila.network",
|
||||||
|
"whitelist": true,
|
||||||
|
"password": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"displayname": "Minecraft Vanilla",
|
||||||
|
"serverurl": "minecraft.lauka.net",
|
||||||
|
"whitelist": true,
|
||||||
|
"password": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"displayname": "Teamspeak 3",
|
||||||
|
"serverurl": "ts.lauka.net",
|
||||||
|
"whitelist": false,
|
||||||
|
"password": true
|
||||||
|
}
|
||||||
|
]
|
23
static/main.js
Normal file
23
static/main.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
const badgeurl = "https://uptime-kuma.lauka.net/api/badge/##/status?style=for-the-badge"
|
||||||
|
const template = document.getElementById("game-template")
|
||||||
|
const serverdata = "/servers.json"
|
||||||
|
var gamecontainer = document.getElementById("gamelist")
|
||||||
|
|
||||||
|
|
||||||
|
async function populatePage() {
|
||||||
|
var request = await fetch(serverdata)
|
||||||
|
var data = await request.json()
|
||||||
|
console.log(data)
|
||||||
|
|
||||||
|
data.forEach(server => {
|
||||||
|
let clone = template.cloneNode(true);
|
||||||
|
|
||||||
|
let url = badgeurl.replace("##", server.id)
|
||||||
|
clone.querySelector("#game-name").innerHTML = server.displayname
|
||||||
|
clone.querySelector("#game-badge").src = url
|
||||||
|
clone.querySelector("#game-password").innerHTML = server.password ? "ja" : "nein"
|
||||||
|
clone.querySelector("#game-whitelist").innerHTML = server.whitelist ? "ja" : "nein"
|
||||||
|
|
||||||
|
gamecontainer.appendChild(clone)
|
||||||
|
});
|
||||||
|
}
|
BIN
static/open-sans-v35-latin-regular.woff2
Normal file
BIN
static/open-sans-v35-latin-regular.woff2
Normal file
Binary file not shown.
55
static/style.css
Normal file
55
static/style.css
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
html {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
font: inherit;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 1em auto;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
font: inherit;
|
||||||
|
vertical-align: baseline;
|
||||||
|
font-size: 1.4em;
|
||||||
|
line-height: 1.4;
|
||||||
|
max-width: 40em;
|
||||||
|
background: #303030;
|
||||||
|
color: #c1c1c1;
|
||||||
|
font-family: 'Open Sans', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-display: swap;
|
||||||
|
font-family: 'Open Sans';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: url('/static/open-sans-v35-latin-regular.woff2') format('woff2');
|
||||||
|
}
|
||||||
|
|
||||||
|
h1,h2,h3 {
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-image {
|
||||||
|
position: relative;
|
||||||
|
bottom: -3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body i {
|
||||||
|
text-decoration: none;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
color: aqua;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-card p {
|
||||||
|
margin: 2px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-card {
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
Loading…
Reference in a new issue