Dragon-Knight/templates/layouts/primary.php

67 lines
1.7 KiB
PHP
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= $title ?></title>
<link rel="stylesheet" href="/css/dk.css">
<script src="/js/htmx.js"></script>
<script>
function opencharpopup(id = 0)
{
const url = id == 0 ? '/character' : '/character/' + id
window.open(url, "", "width=210,height=500,scrollbars")
}
function openmappopup()
{
window.open("/showmap", "", "width=520,height=520,scrollbars")
}
</script>
</head>
<body class="skin-<?= $game_skin ?>">
2024-12-13 12:04:19 -06:00
<div id="game-container">
<header>
<img id="logo" src="/img/logo.gif" alt="<?= $dkgamename ?>" title="<?= $dkgamename ?>">
<nav><?= $topnav ?></nav>
2024-12-13 12:04:19 -06:00
</header>
<main>
<section id="left"><?= $leftnav ?></section>
<section id="middle"><?= $content ?></section>
<section id="right"><?= Render\right_nav() ?></section>
2024-12-13 12:04:19 -06:00
</main>
<footer>
<div>Powered by <a href="/" target="_new">Dragon Knight</a></div>
2024-12-13 12:04:19 -06:00
<div>&copy; 2024 Sharkk</div>
<?= Render\debug_db_info(); ?>
<div>Version <?= VERSION ?> <?= BUILD ?></div>
2024-12-13 12:04:19 -06:00
</footer>
2024-12-14 14:12:14 -06:00
<?php
if (env('debug', false)) {
2024-12-14 14:12:14 -06:00
echo '<pre>';
foreach (db()->log as $record) {
$query_string = str_replace(["\r\n", "\n", "\r"], ' ', $record[0]);
$error_string = !empty($record[2]) ? '// '.$record[2] : '';
echo '<div>['.round($record[1], 2)."s] {$query_string}{$error_string}</div>";
}
2024-12-14 14:12:14 -06:00
echo '</pre>';
}
?>
2024-12-13 12:04:19 -06:00
</div>
<script>
document.addEventListener("updateTitle", (event) => {
const title = event.detail?.title;
if (title) {
console.log('New title:', title);
document.title = title;
}
});
</script>
</body>
</html>