diff --git a/public/css/dragon.css b/public/css/dragon.css index a6e81a8..0270451 100644 --- a/public/css/dragon.css +++ b/public/css/dragon.css @@ -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; diff --git a/public/img/logo.gif b/public/img/logos/logo.gif similarity index 100% rename from public/img/logo.gif rename to public/img/logos/logo.gif diff --git a/public/index.php b/public/index.php index 7d93d20..f09c63c 100644 --- a/public/index.php +++ b/public/index.php @@ -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); diff --git a/server/modules/GateModule.php b/server/modules/GateModule.php index 1f52518..687bafa 100644 --- a/server/modules/GateModule.php +++ b/server/modules/GateModule.php @@ -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']); + } } \ No newline at end of file diff --git a/server/templates/auth/login.php b/server/templates/auth/login.php new file mode 100644 index 0000000..e69de29 diff --git a/server/templates/layout.php b/server/templates/layout.php new file mode 100644 index 0000000..051efa0 --- /dev/null +++ b/server/templates/layout.php @@ -0,0 +1,34 @@ + + +
+ + +