mobmash.click/view/layout.php

60 lines
2.4 KiB
PHP
Raw Normal View History

2024-07-27 22:03:17 +00:00
<!DOCTYPE html>
2024-08-03 22:03:52 +00:00
<?php
2024-08-07 18:14:53 +00:00
function makeNavigationLink(string $name, string $url, bool $newTab = false): void {
2024-08-06 19:59:15 +00:00
$currentPath = rtrim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), "/");
$targetPath = rtrim(parse_url($url, PHP_URL_PATH), "/");
2024-08-03 22:03:52 +00:00
$targetHost = parse_url($_SERVER['REQUEST_URI'], PHP_URL_HOST);
$active = false;
if ($targetHost === NULL && $currentPath === $targetPath) {
$active = true;
}
2024-08-07 18:14:53 +00:00
?><li class="menu-item <?= $active ? "active" : "" ?>"><a <?= $newTab ? 'target="_blank"' : '' ?> href="<?= $url ?>"><?= $name ?></a></li><?php
2024-08-03 22:03:52 +00:00
}
?>
2024-08-02 19:47:49 +00:00
<html lang="en">
2024-07-27 22:03:17 +00:00
<head>
2024-07-27 22:27:31 +00:00
<title><?= $title ?? ""; ?></title>
2024-07-27 22:03:17 +00:00
<link rel="stylesheet" type="text/css" href="/styles/main.css" />
2024-08-03 15:19:24 +00:00
<link rel="stylesheet" type="text/css" href="/styles/fonts.css" />
<link rel="stylesheet" type="text/css" href="/styles/emoji.css" />
<link rel="stylesheet" type="text/css" href="/fonts/fontawesome/css/font-awesome.css" />
2024-08-01 19:58:41 +00:00
<script type="application/javascript" src="/js/bundle.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2024-07-27 22:03:17 +00:00
</head>
<body>
<nav data-hx-boost="true">
<div class="hamburger">
<i class="fa fa-bars"></i>
<input type="checkbox" class="checkbox" />
</div>
<ul class="left">
<?php
makeNavigationLink("MobMash", "/");
makeNavigationLink("Result", "/results");
?>
</ul>
<ul class="right">
<?php
makeNavigationLink("About", "/about");
2024-08-07 18:14:53 +00:00
makeNavigationLink("Source", "https://github.com/overflowerror/mobmash.click", true);
makeNavigationLink("Privacy", "/privacy");
?>
</ul>
2024-07-29 20:26:00 +00:00
</nav>
2024-08-04 09:55:19 +00:00
<div id="content">
<?php
if (isset($content)) {
$content();
}
?>
</div>
2024-08-04 19:07:51 +00:00
<div id="disclaimer">
<p>
This is not an official Minecraft website. We are not associated with Mojang or Microsoft.<br>
Minecraft content and materials on this site are trademarks and copyrights of <a href="https://www.minecraft.net/">Mojang Studios</a>.
</p>
</div>
2024-08-04 19:21:58 +00:00
<div id="version">v<?= VERSION ?></div>
2024-07-27 22:03:17 +00:00
</body>
</html>