diff --git a/public/assets/common.css b/public/assets/common.css index 027f7a2..556a162 100644 --- a/public/assets/common.css +++ b/public/assets/common.css @@ -22,7 +22,6 @@ /* } */ body { - background-color: yellow; margin: 0; } @@ -82,7 +81,7 @@ label[type="button"] { margin-top: 2rem; font-size: 16px; border-radius: 10px; - padding: 2ch; + padding: 1rem; margin: 1rem; a { color: black; diff --git a/public/assets/main.css b/public/assets/main.css index 3852ebe..946ae2e 100644 --- a/public/assets/main.css +++ b/public/assets/main.css @@ -13,7 +13,8 @@ main { height: 60vh; } footer { - height: 20vh; + height: 10vh; + font-size: 0.8em; } body { @@ -51,6 +52,33 @@ header .title, header section, header nav { text-decoration: none; line-height: 2.5rem; } + +/* Filter info banner */ +.filter-info { + background: rgba(149, 87, 181, 0.9); + color: white; + padding: 0.5rem 1rem; + text-align: center; + font-size: 0.9rem; + display: flex; + align-items: center; + justify-content: center; + gap: 1rem; +} + +.clear-filter { + color: white; + text-decoration: none; + padding: 0.25rem 0.75rem; + background: rgba(0, 0, 0, 0.2); + border-radius: 15px; + font-size: 0.85rem; + transition: background 0.2s; +} + +.clear-filter:hover { + background: rgba(0, 0, 0, 0.4); +} main { height: 60vh; @@ -80,6 +108,57 @@ main { footer { background: #222222ff; + overflow: hidden; +} + +/* Years navigation in footer */ +.years-nav { + height: 100%; + display: flex; + align-items: center; +} + +.years-scroll { + display: flex; + gap: 1rem; + overflow-x: auto; + overflow-y: hidden; + scroll-behavior: smooth; + padding: 0.5rem 0; + width: 100%; +} + +/* Hide scrollbar but keep functionality */ +.years-scroll::-webkit-scrollbar { + height: 4px; +} + +.years-scroll::-webkit-scrollbar-track { + background: transparent; +} + +.years-scroll::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.3); + border-radius: 2px; +} + +.year-link { + color: white; + text-decoration: none; + padding: 0.5rem 1rem; + border-radius: 20px; + white-space: nowrap; + transition: background 0.2s; + font-size: 1rem; +} + +.year-link:hover { + background: rgba(255, 255, 255, 0.1); +} + +.year-link.active { + background: #9557b5ff; + font-weight: bold; } /* .card { */ diff --git a/public/index.php b/public/index.php index 179b844..1f40b03 100644 --- a/public/index.php +++ b/public/index.php @@ -5,23 +5,43 @@ require_once APP_ROOT . '/src/Database.php'; $pageTitle = "Liste des TFE"; $page = isset($_GET["page"]) ? intval($_GET["page"]) : 1; +$year = isset($_GET["year"]) ? intval($_GET["year"]) : null; $itemsPerPage = 10; try { $db = Database::getInstance(); $offset = ($page - 1) * $itemsPerPage; - $itemsToLoad = $db->getPublishedTheses($itemsPerPage, $offset); - $totalItems = $db->countPublishedTheses(); + + // Get available years for footer + $availableYears = $db->getAvailableYears(); + + // Filter by year if specified + if ($year) { + $itemsToLoad = $db->searchTheses(['year' => $year], $itemsPerPage, $offset); + $totalItems = $db->countSearchResults(['year' => $year]); + } else { + $itemsToLoad = $db->getPublishedTheses($itemsPerPage, $offset); + $totalItems = $db->countPublishedTheses(); + } + $totalPages = ceil($totalItems / $itemsPerPage); } catch (Exception $e) { error_log("Error loading theses: " . $e->getMessage()); $itemsToLoad = []; $totalPages = 0; + $availableYears = []; } include APP_ROOT . '/templates/header.php'; ?> + +