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:
co-authored by
Claude Opus 5.5
parent
0bdff2c5f8
commit
f5db8fb5c4
@@ -1,39 +1,37 @@
|
|||||||
---
|
---
|
||||||
// MobileTabBar - indicateur de colonne active sur mobile (V1.1-D.1)
|
// MobileTabBar - indicateur de colonne active sur mobile (V1.1-D.1)
|
||||||
// Ecoute l'event "swipe-position-change" emis par SwipeContainer.vue
|
// 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
|
<nav
|
||||||
id="mobile-tab-bar"
|
id="mobile-tab-bar"
|
||||||
aria-label="Navigation colonnes"
|
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"
|
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
|
{onglets.map((o, i) => (
|
||||||
type="button"
|
<button
|
||||||
data-tab-index="0"
|
type="button"
|
||||||
class="mobile-tab flex-1 text-sm px-2 border-b-2 transition-colors"
|
data-tab-index={String(i)}
|
||||||
aria-label="Aller au journal"
|
class="mobile-tab flex-1 text-sm px-2 border-b-2 transition-colors"
|
||||||
>
|
aria-label={o.aria}
|
||||||
Journal
|
>
|
||||||
</button>
|
{o.libelle}
|
||||||
<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>
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const tabs = document.querySelectorAll<HTMLButtonElement>('.mobile-tab');
|
const tabs = document.querySelectorAll<HTMLButtonElement>('.mobile-tab');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user