mince/src/HTML.php

49 lines
1.4 KiB
PHP
Raw Normal View History

2022-07-03 22:07:00 +00:00
<?php
namespace Mince;
final class HTML {
public static function getHeader(object $userInfo, string $loginUrl, string $title = 'Flashii Minecraft Server'): string {
if($userInfo->success) {
$userBar = 'Logged in as ' . $userInfo->username;
} else {
$userBar = '<a href="' . $loginUrl . '">Log in</a>';
}
return <<<HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>{$title}</title>
<link href="/mince.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<div class="wrapper">
<nav class="header">
<div class="header-inner">
<div class="header-logo">
<a href="/"><img src="/assets/weblogo.png" alt="Flashii Minecraft"/></a>
</div>
<div class="header-fat"></div>
<div class="header-user">
{$userBar}
</div>
</div>
</nav>
<div class="content">
HTML;
}
public static function getFooter(): string {
return <<<HTML
</div>
<footer class="footer">
<a href="https://flash.moe">Flashwave</a> 2022 | Site design "borrowed" from pre-Microsoft Mojang | "Minecraft" is a trademark of Mojang
</footer>
</div>
</body>
</html>
HTML;
}
}