DK2/templates/layouts/basic.php

66 lines
1.4 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dragon Knight</title>
<link rel="stylesheet" href="/assets/css/dragon.css">
</head>
<body>
<header>
<div class="left">
<h1>Dragon Knight</h1>
</div>
<div class="right">
<?php if (user()): ?>
<p>Welcome, <?= user('username') ?></p>
<?= c_logout_button() ?>
<?php else: ?>
<a class="ui button primary" href="/auth/login">Login</a>
<a class="ui button secondary" href="/auth/register">Register</a>
<?php endif; ?>
</div>
</header>
<?= c_char_bar(user('char_id')) ?>
<main>
<aside id="left">
<?php if (user()): ?>
<?= c_left_nav($activeTab ?? 0) ?>
<?php endif; ?>
</aside>
<div id="center">
<?= render($view, $data) ?>
</div>
<aside id="right">
<?php if (user()): ?>
// right nav
<?php endif; ?>
</aside>
</main>
<footer>
<p>&copy; <?= date('Y') ?> Dragon Knight</p>
<p>q<?= $GLOBALS['queries'] ?></p>
<p>qt<?= number_format($GLOBALS['query_time'], env('debug', false) === true ? 6 : 2) ?></p>
<p>t<?= number_format((microtime(true) - START_TIME), env('debug', false) === true ? 6 : 2) ?></p>
<p>v<?= env('version') ?></p>
</footer>
<?php
if (env('debug', false)) {
echo c_debug_query_log();
}
?>
<script type="module">
import Tooltip from '/assets/scripts/tooltip.js';
Tooltip.init();
</script>
</body>
</html>