diff --git a/images/iconeClaire copy.ico b/images/iconeClaire.ico similarity index 100% rename from images/iconeClaire copy.ico rename to images/iconeClaire.ico diff --git a/public/styles/styleSearch.css b/public/styles/styleSearch.css index a142b5d..1cd416a 100644 --- a/public/styles/styleSearch.css +++ b/public/styles/styleSearch.css @@ -148,4 +148,63 @@ body.light-mode .filtre label { color: #000000; cursor: pointer; transition: all 0.3s ease; -} \ No newline at end of file +} + +/* ====== PAGINATION STYLES ====== */ +.pagination-container { + display: flex; + justify-content: center; + align-items: center; + margin: 20px 0; +} + +.pagination-container select { + margin: 0 10px; + padding: 5px; + font-size: 16px; + border-radius: 5px; + border: 1px solid #ccc; +} + +.pagination-container button { + background: var(--main-light-gradient); + border: none; + border-radius: 5px; + padding: 5px 10px; + font-size: 16px; + cursor: pointer; + transition: background 0.3s ease; +} + +.pagination-container button:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +/* Spinner style */ +.spinner { + border: 4px solid rgba(0, 0, 0, 0.1); + border-left-color: #000; + border-radius: 50%; + width: 24px; + height: 24px; + animation: spin 1s linear infinite; + margin-left: 10px; + display: none; +} + +@keyframes spin { + to { transform: rotate(360deg); } +} + +/* Adaptation pour dark mode */ +body.dark-mode .pagination-container button { + background: var(--main-dark-gradient); + color: #fff; +} + +body.dark-mode .pagination-container select { + border: 1px solid #555; + background: #333; + color: #fff; +} diff --git a/vue/search.php b/vue/search.php index 22ba842..94f1d05 100644 --- a/vue/search.php +++ b/vue/search.php @@ -2,25 +2,76 @@ global $twig; + // Paramètres de la pagination + $perPage = 30; + $currentPage = isset($_GET['page']) ? (int)$_GET['page'] : 1; + if ($currentPage < 1) { + $currentPage = 1; + } + + // Calcul du nombre total d'éléments et de pages + $totalItems = count($tq); + $totalPages = ceil($totalItems / $perPage); + + // Découpage du tableau pour ne garder que les éléments de la page courante + $offset = ($currentPage - 1) * $perPage; + $quotesPaginated = array_slice($tq, $offset, $perPage); + echo $twig->render('head.html.twig', array( - 'title' => "Search", - 'style' => "public/styles/styleSearch.css", + 'title' => "Search", + 'style' => "public/styles/styleSearch.css", 'scripts' => array("public/script/theme-toggle.js") )); echo $twig->render('bandeau.html.twig'); - echo $twig->render('filtre.html.twig',array( - 'search'=>$search, - 'type'=>$type, + echo $twig->render('filtre.html.twig', array( + 'search' => $search, + 'type' => $type, )); - echo $twig->render('quoteLittle.html.twig', [ - 'quotes' => $tq, - 'titre' => "Résultats" + 'quotes' => $quotesPaginated, + 'titre' => "Résultats" ]); - +?> + +