From f537166f49b36ec6ef181d1afc1acd5da6c67ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Thu, 28 Nov 2024 17:30:11 +0100 Subject: [PATCH] Layout --- assets/styles/layout.css | 81 ++++++++++++++++++++++++++++ src/Controller/DefaultController.php | 2 +- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 assets/styles/layout.css diff --git a/assets/styles/layout.css b/assets/styles/layout.css new file mode 100644 index 0000000..7bedb1f --- /dev/null +++ b/assets/styles/layout.css @@ -0,0 +1,81 @@ +/** +* Layout styles +* This file contains the layout styles for the application +* Layout has 5 main parts: +* - Header (header) +* - Left menu (nav) +* - Main content (main) +* - Right sidebar (aside) +* - Footer (footer) +**/ + + + + +/* Layout Container */ +.layout { + max-width: 100%; + width: 1200px; + margin: 0 auto; + display: flex; + flex-grow: 1; +} + +nav { + width: auto; + flex-shrink: 0; + padding: 1em; + overflow-y: auto; /* Ensure the menu is scrollable if content is too long */ +} + +nav ul { + list-style-type: none; + padding: 0; +} + +nav li { + margin: 0.5em 0; +} + +nav a { + color: var(--color-primary); + text-decoration: none; +} + +nav a:hover { + color: var(--color-text-mid); + text-decoration: none; +} + +/* Main content */ +main { + flex-grow: 1; + padding: 1em; + word-break: break-word; +} + +/* Right sidebar */ +aside { + width: 180px; /* Adjust the width based on the left menu */ + padding: 1em; +} + +/* Responsive adjustments */ +@media (max-width: 768px) { + nav, aside { + display: none; /* Hide the sidebars on small screens */ + } + main { + width: 100%; + } +} + +/* Footer */ +footer { + background-color: #333; + color: white; + text-align: center; + padding: 1em 0; + position: relative; + width: 100%; +} diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index d295473..f48021c 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -17,6 +17,6 @@ class DefaultController extends AbstractController #[\Symfony\Component\Routing\Attribute\Route('/', name: 'default')] public function index(): Response { - return $this->render('default/home.html.twig'); + return $this->render('home.html.twig'); } }