Completed basic website.
This commit is contained in:
parent
1f20da27ad
commit
0f8a060d32
BIN
src/lib/images/mcserver-offline.png
Normal file
BIN
src/lib/images/mcserver-offline.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
@ -9,6 +9,9 @@
|
||||
id="svg1"
|
||||
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
|
||||
sodipodi:docname="rse-logo.svg"
|
||||
inkscape:export-filename="rse-logo.png"
|
||||
inkscape:export-xdpi="96.31588"
|
||||
inkscape:export-ydpi="96.31588"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@ -24,13 +27,13 @@
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="true"
|
||||
inkscape:zoom="0.81023078"
|
||||
inkscape:cx="-275.23023"
|
||||
inkscape:cy="170.93895"
|
||||
inkscape:zoom="1.1458394"
|
||||
inkscape:cx="0.87272268"
|
||||
inkscape:cy="243.05327"
|
||||
inkscape:window-width="3840"
|
||||
inkscape:window-height="2054"
|
||||
inkscape:window-x="-12"
|
||||
inkscape:window-y="-12"
|
||||
inkscape:window-x="-11"
|
||||
inkscape:window-y="-11"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1">
|
||||
<inkscape:grid
|
||||
@ -112,27 +115,37 @@
|
||||
<path
|
||||
id="path7"
|
||||
style="fill:#ffffff;stroke-width:0"
|
||||
d="m 77.94229,110 12.990382,7.5 -8.660255,5 -12.990381,-7.5 z"
|
||||
d="m 69.282036,110 17.320509,10 -8.660255,5 -17.320508,-10 z"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
id="rect4"
|
||||
style="fill:#ffffff;stroke-width:0"
|
||||
d="M 30.310886,142.49999 38.971145,147.5 v 35.00001 l -8.660254,-5 z"
|
||||
d="m 30.310886,127.49999 8.660259,5.00001 0,50.00001 -8.660254,-5 z"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
id="path4"
|
||||
style="fill:#ffffff;stroke-width:0"
|
||||
d="M 38.97114,157.49999 56.291654,167.5 v 10.00001 l -17.320509,-10 z"
|
||||
d="M 38.971136,152.49998 56.29165,162.5 v 10 l -17.320509,-10 z"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
id="path5"
|
||||
style="fill:#ffffff;stroke-width:0"
|
||||
d="M 90.932674,142.49999 82.272424,147.5 v 35.00001 l 8.660245,-5 z"
|
||||
d="m 90.932674,147.5 -8.66025,5.00001 v 30 l 8.660245,-5 z"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
id="path6"
|
||||
style="fill:#ffffff;stroke-width:0"
|
||||
d="M 82.27242,157.49999 64.951908,167.5 v 10.00001 l 17.320507,-10 z"
|
||||
d="M 82.272415,152.49998 64.951903,162.5 v 10 l 17.320507,-10 z"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
id="path1"
|
||||
style="fill:#ffffff;stroke-width:0"
|
||||
d="M 73.612157,97.499999 82.272417,102.5 43.355289,125 l -8.66026,-5 z"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
id="path2"
|
||||
style="fill:#ffffff;stroke-width:0"
|
||||
d="m 69.282036,110 17.320509,10 -8.660255,5 -17.320509,-10 z"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.5 KiB |
@ -1,3 +1,23 @@
|
||||
// since there's no dynamic data here, we can prerender
|
||||
// it so that it gets served as a static asset in production
|
||||
export const prerender = true;
|
||||
export const prerender = false;
|
||||
export const ssr = false;
|
||||
|
||||
|
||||
export async function load({fetch }) {
|
||||
let mcserverRequest = await fetch("https://api.mcsrvstat.us/3/game.reslate.systems")
|
||||
let mcServer = null;
|
||||
if (mcserverRequest.ok) {
|
||||
mcServer = await mcserverRequest.json();
|
||||
}
|
||||
for (let i = 0; i < mcServer.players.list.length; i++) {
|
||||
const player = mcServer.players.list[i];
|
||||
let skinResponse = await fetch(`https://api.mineatar.io/body/full/${player.uuid}`)
|
||||
if (skinResponse.ok) {
|
||||
player.skin = URL.createObjectURL(await skinResponse.blob())
|
||||
}
|
||||
}
|
||||
return {
|
||||
mcServer: mcServer
|
||||
};
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
<script>
|
||||
import { Button, Heading, P } from 'flowbite-svelte';
|
||||
import { ArrowRightOutline } from 'flowbite-svelte-icons';
|
||||
import { Avatar, Card, Heading } from 'flowbite-svelte';
|
||||
import mcserverOffline from '$lib/images/mcserver-offline.png';
|
||||
export let data;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@ -8,7 +9,73 @@
|
||||
<meta name="description" content="Information about the Minecraft server." />
|
||||
</svelte:head>
|
||||
|
||||
<section class="flex flex-row flex-grow justify-center items-center">
|
||||
<!-- TODO implement status from api.mcsrvstat.us -->
|
||||
<section class="flex w-full flex-grow flex-col items-center justify-center">
|
||||
{#await data.mcServer}
|
||||
<div class="text-center">
|
||||
Loading server info...
|
||||
</div>
|
||||
{:then mcserver}
|
||||
{#if mcserver == null}
|
||||
<div class="text-center">
|
||||
Couldn't reach server API! Is <a href="https://www.isitdownrightnow.com/api.mcsrvstat.us.html">api.mcsrvstat.us</a> down?
|
||||
</div>
|
||||
{:else}
|
||||
<div class="mb-8 text-center">
|
||||
<Heading tag="h1">Who's in-game?</Heading>
|
||||
</div>
|
||||
<div class="flex max-w-full flex-row overflow-x-scroll scroll-smooth border-none">
|
||||
<Card padding="md" class="m-4 min-w-80">
|
||||
<div class="flex flex-col items-center pb-4">
|
||||
{#if mcserver.online}
|
||||
<Avatar size="lg" src={mcserver.icon}></Avatar>
|
||||
{:else}
|
||||
<Avatar size="lg" src={mcserverOffline}></Avatar>
|
||||
{/if}
|
||||
<Heading
|
||||
tag="h2"
|
||||
class="mb-1 text-center text-xl font-medium text-gray-900 dark:text-white"
|
||||
>Server Status</Heading
|
||||
>
|
||||
<div class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{#if mcserver.online}
|
||||
Online!
|
||||
{:else}
|
||||
Offline
|
||||
{/if}
|
||||
</div>
|
||||
<div class="mt-4 space-x-3 lg:mt-6">
|
||||
<ul class="list-disc">
|
||||
<li>IP: <code>{mcserver.hostname}</code></li>
|
||||
<li>On port {mcserver.port}</li>
|
||||
<li>{mcserver.players.online}/{mcserver.players.max} players online</li>
|
||||
<li>Running Minecraft version {mcserver.version}</li>
|
||||
</ul>
|
||||
</div>
|
||||
{#if mcserver.online}
|
||||
<div class="p-2 text-center">
|
||||
<strong>Join us!</strong>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</Card>
|
||||
{#if mcserver.online}
|
||||
{#each mcserver.players.list as player}
|
||||
<Card padding="md" class="m-4 flex min-w-80 flex-col justify-center">
|
||||
<div class="flex flex-col items-center pb-4">
|
||||
<img src={player.skin} alt={`${player.name}'s skin`} />
|
||||
<Heading
|
||||
tag="h2"
|
||||
class="mb-1 text-center text-xl font-medium text-gray-900 dark:text-white"
|
||||
>{player.name}</Heading
|
||||
>
|
||||
<div class="text-xs text-gray-500 dark:text-gray-400">
|
||||
{player.uuid}
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/await}
|
||||
</section>
|
||||
|
||||
|
@ -1,9 +1,16 @@
|
||||
<script>
|
||||
import { Heading, P } from "flowbite-svelte";
|
||||
|
||||
</script>
|
||||
<svelte:head>
|
||||
<title>Minecraft Railway</title>
|
||||
<meta name="description" content="Information about the railway on the Minecraft server." />
|
||||
</svelte:head>
|
||||
|
||||
<section class="flex flex-row flex-grow justify-center items-center">
|
||||
<!-- TODO implement display of railway system and status -->
|
||||
<section class="flex flex-row flex-grow items-center">
|
||||
<div class="mx-auto text-center">
|
||||
<Heading tag="h1" class="mb-4">Not Ready Yet!</Heading>
|
||||
<P align="center">Check back in a few days!</P>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user