feat(cerveau): onglets du haut au téléphone, écriture · architecture · art

Libellé de gauche dans une constante unique (veto possible : « communication »).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWGVmzmm9vJ8E3dhGaJhFT
This commit is contained in:
Jules Neny
2026-11-10 12:28:06 +01:00
co-authored by Claude Opus 5.5
parent 0bdff2c5f8
commit f5db8fb5c4
+24 -26
View File
@@ -1,39 +1,37 @@
---
// MobileTabBar - indicateur de colonne active sur mobile (V1.1-D.1)
// Ecoute l'event "swipe-position-change" emis par SwipeContainer.vue
// Affiche : Journal | Carte | Insta - colonne active surlignee
// Affiche : écriture | architecture | art (retouches du 09/11) - colonne active surlignee
// Libellé du panneau gauche : défaut « écriture » (Jules hésitait avec « communication »).
// Pour changer, éditer cette seule ligne (libellé et aria-label suivent).
const LIBELLE_GAUCHE = 'écriture';
// Article élidé devant voyelle (« l'écriture »), sinon « la » (« la communication »).
const avecArticle = (mot: string) => (/^[aeéèêiouh]/i.test(mot) ? `l'${mot}` : `la ${mot}`);
const onglets = [
{ libelle: LIBELLE_GAUCHE, aria: `Aller à ${avecArticle(LIBELLE_GAUCHE)}` },
{ libelle: 'architecture', aria: "Aller à l'architecture" },
{ libelle: 'art', aria: "Aller à l'art" },
];
---
<nav
id="mobile-tab-bar"
aria-label="Navigation colonnes"
class="fixed top-12 left-0 right-0 z-30 h-11 bg-white border-b border-neutral-200 flex items-stretch justify-around md:hidden"
>
<button
type="button"
data-tab-index="0"
class="mobile-tab flex-1 text-sm px-2 border-b-2 transition-colors"
aria-label="Aller au journal"
>
Journal
</button>
<button
type="button"
data-tab-index="1"
class="mobile-tab flex-1 text-sm px-2 border-b-2 transition-colors"
aria-label="Aller à la carte"
>
Carte
</button>
<button
type="button"
data-tab-index="2"
class="mobile-tab flex-1 text-sm px-2 border-b-2 transition-colors"
aria-label="Aller à Instagram"
>
Insta
</button>
{onglets.map((o, i) => (
<button
type="button"
data-tab-index={String(i)}
class="mobile-tab flex-1 text-sm px-2 border-b-2 transition-colors"
aria-label={o.aria}
>
{o.libelle}
</button>
))}
</nav>
<script>
const tabs = document.querySelectorAll<HTMLButtonElement>('.mobile-tab');