mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Replace apropos/licence/charte sticky nav with responsive details/summary TOC
- Convert .apropos-toc <nav> to <details class="toc" open> in all three templates - Add caret-down icon to summary (visible only on mobile via media queries) - Desktop (≥768px): sticky sidebar via CSS grid, force-open via pointer-events:none, hide caret - Mobile (≤767px): single column, collapsible TOC with rotating caret, margin-top below search bar - Rename .apropos-toc-link to .toc-sidebar-link - Merge 900px and 600px breakpoints into single 600px mobile media query - Rename apropos.css → content-page.css; update 3 controller references
This commit is contained in:
@@ -3,10 +3,7 @@
|
|||||||
Root class: .page-content
|
Root class: .page-content
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
/* Keep the base flex layout (no html/body overrides) —
|
/* Override inherited padding on main-content */
|
||||||
main scrolls internally so the body gradient stays at viewport bottom. */
|
|
||||||
|
|
||||||
/* Override inherited padding on main-content (apropós, licence, charte) */
|
|
||||||
#main-content {
|
#main-content {
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
@@ -25,34 +22,69 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
/* Left — sticky table of contents */
|
/* Table of contents — details/summary block */
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
.apropos-toc {
|
.toc {
|
||||||
position: sticky;
|
border: none;
|
||||||
top: var(--space-l);
|
border-radius: 0;
|
||||||
|
background: transparent;
|
||||||
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.apropos-toc-label {
|
.toc[open] {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc > :not(summary) {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc summary {
|
||||||
font-family: var(--font-display);
|
font-family: var(--font-display);
|
||||||
font-size: var(--step-1);
|
font-size: var(--step-1);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
margin: 0 0 var(--space-2xs) 0;
|
padding: 0 0 var(--space-2xs) 0;
|
||||||
padding-bottom: var(--space-2xs);
|
|
||||||
border-bottom: 1px solid var(--text-primary);
|
border-bottom: 1px solid var(--text-primary);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--space-2xs);
|
||||||
|
background: transparent;
|
||||||
|
cursor: pointer;
|
||||||
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.apropos-toc ul {
|
.toc summary::-webkit-details-marker {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc summary:hover {
|
||||||
|
color: inherit;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Caret icon inside summary — visible only on mobile */
|
||||||
|
.toc-caret {
|
||||||
|
flex-shrink: 0;
|
||||||
|
transition: transform 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc[open] > summary .toc-caret {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0 0 var(--space-m) 0;
|
margin: var(--space-xs) 0 0 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--space-3xs);
|
gap: var(--space-3xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
.apropos-toc ul a {
|
.toc ul a {
|
||||||
font-family: var(--font-body);
|
font-family: var(--font-body);
|
||||||
font-size: var(--step-0);
|
font-size: var(--step-0);
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
@@ -63,42 +95,96 @@
|
|||||||
transition: color 0.15s;
|
transition: color 0.15s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.apropos-toc ul a:hover {
|
.toc ul a:hover {
|
||||||
color: var(--accent-primary);
|
color: var(--accent-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.apropos-toc-link:first-of-type {
|
/* Sidebar links (about page) */
|
||||||
|
.toc-sidebar-link:first-of-type {
|
||||||
padding-top: var(--space-s);
|
padding-top: var(--space-s);
|
||||||
border-top: 1px solid var(--border-primary);
|
border-top: 1px solid var(--border-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.apropos-toc-link + .apropos-toc-link {
|
.toc-sidebar-link + .toc-sidebar-link {
|
||||||
padding-top: var(--space-xs);
|
padding-top: var(--space-xs);
|
||||||
}
|
}
|
||||||
|
|
||||||
.apropos-toc-link a {
|
.toc-sidebar-link a {
|
||||||
font-size: var(--step--2);
|
font-size: var(--step--2);
|
||||||
color: var(--accent-primary);
|
color: var(--accent-primary);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: opacity 0.15s;
|
transition: opacity 0.15s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.apropos-toc-link a:hover {
|
.toc-sidebar-link a:hover {
|
||||||
color: var(--accent-primary);
|
color: var(--accent-primary);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
/* Right — main content area */
|
/* Desktop: force-open TOC, hide caret, sticky sidebar */
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
.page-content > .content,
|
@media (min-width: 768px) {
|
||||||
.page-content > .content-section {
|
.toc {
|
||||||
grid-column: 2;
|
position: sticky;
|
||||||
min-width: 0;
|
top: var(--space-l);
|
||||||
max-width: 100%;
|
grid-column: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc summary {
|
||||||
|
pointer-events: none;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc summary::-webkit-details-marker {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-caret {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content > .content,
|
||||||
|
.page-content > .content-section {
|
||||||
|
grid-column: 2;
|
||||||
|
min-width: 0;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Mobile: collapsible TOC */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.page-content {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
gap: var(--space-l);
|
||||||
|
padding: var(--space-m) var(--space-s) var(--space-xl);
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc {
|
||||||
|
margin-top: var(--space-s);
|
||||||
|
position: static;
|
||||||
|
grid-column: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content > .content,
|
||||||
|
.page-content > .content-section {
|
||||||
|
grid-column: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc summary {
|
||||||
|
cursor: pointer;
|
||||||
|
list-style: revert;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Main content area */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
/* Shared typography for about-page sections and charte/licence content */
|
/* Shared typography for about-page sections and charte/licence content */
|
||||||
.content,
|
.content,
|
||||||
.content-section {
|
.content-section {
|
||||||
@@ -337,51 +423,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
/* Responsive */
|
/* Responsive — small mobile */
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
|
||||||
.page-content {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
gap: var(--space-l);
|
|
||||||
padding: var(--space-m) var(--space-s) var(--space-xl);
|
|
||||||
}
|
|
||||||
|
|
||||||
.apropos-toc {
|
|
||||||
position: static;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
|
||||||
gap: var(--space-s);
|
|
||||||
padding-bottom: var(--space-s);
|
|
||||||
border-bottom: 1px solid var(--border-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.apropos-toc-label {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.apropos-toc ul {
|
|
||||||
flex-direction: row;
|
|
||||||
margin: 0;
|
|
||||||
gap: var(--space-xs);
|
|
||||||
}
|
|
||||||
|
|
||||||
.apropos-toc-link {
|
|
||||||
border-top: none;
|
|
||||||
padding-top: 0;
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-section {
|
|
||||||
font-size: var(--step-0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-section-title {
|
|
||||||
font-size: var(--step-2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
.page-content {
|
.page-content {
|
||||||
padding: var(--space-m) var(--space-s) var(--space-xl);
|
padding: var(--space-m) var(--space-s) var(--space-xl);
|
||||||
@@ -391,6 +435,10 @@
|
|||||||
font-size: var(--step-0);
|
font-size: var(--step-0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content-section-title {
|
||||||
|
font-size: var(--step-2);
|
||||||
|
}
|
||||||
|
|
||||||
.apropos-credit-row {
|
.apropos-credit-row {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: var(--space-3xs);
|
gap: var(--space-3xs);
|
||||||
@@ -55,7 +55,7 @@ class AboutController
|
|||||||
'sidebarLinks' => $sidebarLinks,
|
'sidebarLinks' => $sidebarLinks,
|
||||||
'pageTitle' => 'À Propos – XAMXAM',
|
'pageTitle' => 'À Propos – XAMXAM',
|
||||||
'metaDescription' => "À propos de XAMXAM, le répertoire des mémoires de fin d'études de l'erg – École de Recherches Graphiques de Bruxelles.",
|
'metaDescription' => "À propos de XAMXAM, le répertoire des mémoires de fin d'études de l'erg – École de Recherches Graphiques de Bruxelles.",
|
||||||
'extraCss' => ['/assets/css/apropos.css'],
|
'extraCss' => ['/assets/css/content-page.css'],
|
||||||
'bodyClass' => 'apropos-body',
|
'bodyClass' => 'apropos-body',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class CharteController
|
|||||||
'pageTitle' => $pageTitle . ' – XAMXAM',
|
'pageTitle' => $pageTitle . ' – XAMXAM',
|
||||||
'metaDescription' => "Charte d'utilisation de XAMXAM, le répertoire des TFE de l'erg.",
|
'metaDescription' => "Charte d'utilisation de XAMXAM, le répertoire des TFE de l'erg.",
|
||||||
'currentNav' => 'charte',
|
'currentNav' => 'charte',
|
||||||
'extraCss' => ['/assets/css/apropos.css'],
|
'extraCss' => ['/assets/css/content-page.css'],
|
||||||
'bodyClass' => 'apropos-body',
|
'bodyClass' => 'apropos-body',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class LicenceController
|
|||||||
'pageTitle' => $pageTitle . ' – XAMXAM',
|
'pageTitle' => $pageTitle . ' – XAMXAM',
|
||||||
'metaDescription' => "Informations sur les licences d'utilisation des mémoires publiés sur XAMXAM, le répertoire des TFE de l'erg.",
|
'metaDescription' => "Informations sur les licences d'utilisation des mémoires publiés sur XAMXAM, le répertoire des TFE de l'erg.",
|
||||||
'currentNav' => 'licence',
|
'currentNav' => 'licence',
|
||||||
'extraCss' => ['/assets/css/apropos.css'],
|
'extraCss' => ['/assets/css/content-page.css'],
|
||||||
'bodyClass' => 'apropos-body',
|
'bodyClass' => 'apropos-body',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ function renderEntries(array $entries): string
|
|||||||
} ?>
|
} ?>
|
||||||
<main class="page-content" id="main-content">
|
<main class="page-content" id="main-content">
|
||||||
|
|
||||||
<!-- LEFT: sticky table of contents -->
|
<!-- Table of contents: collapsible on mobile, force-open on desktop -->
|
||||||
<nav class="apropos-toc" aria-label="Sections de la page">
|
<details class="toc" open>
|
||||||
<p class="apropos-toc-label">PARTIES</p>
|
<summary><?= icon('caret-down', 0, 'toc-caret') ?> PARTIES</summary>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#apropos-intro">À propos</a></li>
|
<li><a href="#apropos-intro">À propos</a></li>
|
||||||
<?php if (!empty($contacts)): ?>
|
<?php if (!empty($contacts)): ?>
|
||||||
@@ -45,14 +45,14 @@ function renderEntries(array $entries): string
|
|||||||
</ul>
|
</ul>
|
||||||
<?php if (!empty($sidebarLinks)): ?>
|
<?php if (!empty($sidebarLinks)): ?>
|
||||||
<?php foreach ($sidebarLinks as $sl): ?>
|
<?php foreach ($sidebarLinks as $sl): ?>
|
||||||
<div class="apropos-toc-link">
|
<div class="toc-sidebar-link">
|
||||||
<a href="<?= htmlspecialchars($sl['url'] ?? '#') ?>" target="_blank" rel="noopener">
|
<a href="<?= htmlspecialchars($sl['url'] ?? '#') ?>" target="_blank" rel="noopener">
|
||||||
<?= htmlspecialchars($sl['label'] ?? 'Lien') ?> ↗
|
<?= htmlspecialchars($sl['label'] ?? 'Lien') ?> ↗
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</nav>
|
</details>
|
||||||
|
|
||||||
<!-- Intro text from DB -->
|
<!-- Intro text from DB -->
|
||||||
<section class="content-section" id="apropos-intro">
|
<section class="content-section" id="apropos-intro">
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<main class="page-content" id="main-content">
|
<main class="page-content" id="main-content">
|
||||||
|
|
||||||
<!-- LEFT: sticky table of contents -->
|
<!-- Table of contents: collapsible on mobile, force-open on desktop -->
|
||||||
<?php if (!empty($tocItems)): ?>
|
<?php if (!empty($tocItems)): ?>
|
||||||
<nav class="apropos-toc" aria-label="Sections de la page">
|
<details class="toc" open>
|
||||||
<p class="apropos-toc-label">PARTIES</p>
|
<summary><?= icon('caret-down', 0, 'toc-caret') ?> PARTIES</summary>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($tocItems as $item): ?>
|
<?php foreach ($tocItems as $item): ?>
|
||||||
<li><a href="<?= htmlspecialchars($item['href']) ?>"><?= htmlspecialchars($item['label']) ?></a></li>
|
<li><a href="<?= htmlspecialchars($item['href']) ?>"><?= htmlspecialchars($item['label']) ?></a></li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</details>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<main class="page-content" id="main-content">
|
<main class="page-content" id="main-content">
|
||||||
|
|
||||||
<!-- LEFT: sticky table of contents -->
|
<!-- Table of contents: collapsible on mobile, force-open on desktop -->
|
||||||
<?php if (!empty($tocItems)): ?>
|
<?php if (!empty($tocItems)): ?>
|
||||||
<nav class="apropos-toc" aria-label="Sections de la page">
|
<details class="toc" open>
|
||||||
<p class="apropos-toc-label">PARTIES</p>
|
<summary><?= icon('caret-down', 0, 'toc-caret') ?> PARTIES</summary>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($tocItems as $item): ?>
|
<?php foreach ($tocItems as $item): ?>
|
||||||
<li><a href="<?= htmlspecialchars($item['href']) ?>"><?= htmlspecialchars($item['label']) ?></a></li>
|
<li><a href="<?= htmlspecialchars($item['href']) ?>"><?= htmlspecialchars($item['label']) ?></a></li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</details>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|||||||
Reference in New Issue
Block a user