First Commit
This commit is contained in:
commit
923d6ca242
35 changed files with 4933 additions and 0 deletions
66
src/templates/layout/main.php
Normal file
66
src/templates/layout/main.php
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use GamesShop\Templates\ResourceIndex;
|
||||
use League\Plates\Template\Template;
|
||||
|
||||
assert($this instanceof Template);
|
||||
/** @var ResourceIndex $resources */
|
||||
assert($resources instanceof ResourceIndex);
|
||||
|
||||
if (!isset($resourceEntry)) {
|
||||
throw new Exception("Resource entry not set");
|
||||
}
|
||||
|
||||
/**
|
||||
* @var string $resourceEntry
|
||||
*/
|
||||
|
||||
$resource = $resources->getResource($resourceEntry);
|
||||
?>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Game Shop</title>
|
||||
|
||||
<?php foreach ($resource->js as $js): ?>
|
||||
<script src="/<?= $js ?>"></script>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($resource->css as $css): ?>
|
||||
<link rel="stylesheet" href="/<?= $css ?>">
|
||||
<?php endforeach; ?>
|
||||
</head>
|
||||
<body class="vh-100 d-flex flex-column">
|
||||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">Game Shop</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-content" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbar-content">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0"></ul>
|
||||
|
||||
<div class="d-flex mode-switch">
|
||||
<button title="Use dark mode" id="dark" class="btn btn-sm btn-default text-secondary">
|
||||
<i class="fa-regular fa-moon"></i>
|
||||
</button>
|
||||
<button title="Use light mode" id="light" class="btn btn-sm btn-default text-secondary">
|
||||
<i class="fa-regular fa-sun"></i>
|
||||
</button>
|
||||
<button title="Use system preferred mode" id="system" class="btn btn-sm btn-default text-secondary">
|
||||
<i class="fa-solid fa-display"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="mt-2 position-relative flex-grow-1">
|
||||
<?= $this->section('content'); ?>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue