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>
2023-02-25 20:17:06 +00:00
<meta charset="utf-8">
2022-07-03 22:07:00 +00:00
<title>{$title}</title>
2023-02-25 20:17:06 +00:00
<link href="/mince.css" type="text/css" rel="stylesheet">
2022-07-03 22:07:00 +00:00
</head>
<body>
<div class="wrapper">
<nav class="header">
<div class="header-inner">
<div class="header-logo">
2023-02-25 20:17:06 +00:00
<a href="/"><img src="/assets/weblogo.png" alt="Flashii Minecraft"></a>
2022-07-03 22:07:00 +00:00
</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">
2023-02-25 20:17:06 +00:00
<a href="https://flash.moe">Flashwave</a> 2022-2023 | Site design "borrowed" from pre-Microsoft Mojang | "Minecraft" is a trademark of Mojang
2022-07-03 22:07:00 +00:00
</footer>
</div>
</body>
</html>
HTML;
}
}