Start work on gate module and login/layout

This commit is contained in:
Sky Johnson 2024-07-16 21:51:20 -05:00
parent 506f1a44d1
commit 56524da0c6
8 changed files with 63 additions and 1 deletions

View File

@ -13,6 +13,17 @@ body {
margin: 0 auto;
}
#container {
padding: 1rem;
header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1rem;
}
}
.form-group {
margin-bottom: 0.5rem;

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -11,8 +11,10 @@ $route = App::$req->uri(0);
// redirect depending on installation status
installRedirect($route);
// route to the relevant module
if ($route == '/') return HomeModule::home();
if ($route == 'install') return InstallModule::handle();
if ($route == 'gate') return GateModule::handle();
// 404
http_response_code(404);

View File

@ -2,5 +2,18 @@
class GateModule
{
private const GUEST = ['login', 'register'];
public static function handle()
{
$s = App::$req->uri(1) ?? ''; // second segment
$m = App::$req->method; // request method
if ($s == '' || $s == 'login') return self::login();
}
public static function login()
{
echo render('layout', ['title' => 'Login']);
}
}

View File

View File

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= $title ?> | <?= App::$s['game_name'] ?></title>
<link rel="stylesheet" href="/css/dragon.css">
</head>
<body>
<div id="container">
<header>
<?= render('partials/header', $data) ?>
</header>
<div id="content">
<aside id="left">
left
</aside>
<main>
</main>
<aside id="right">
right
</aside>
</div>
<footer>
<?= render('partials/footer', $data) ?>
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1 @@
footer

View File

@ -0,0 +1 @@
<img src="/img/logos/logo.gif" alt="<?= App::$s['game_name'] ?>" class="logo" />