Compare commits
@@ -56,23 +56,58 @@ Pour une chip non cliquable (affichage seul, ex. liste de résultats) : `as="spa
|
||||
3. Choisis l'ordre de repli du résumé : `buildResume([champA, champB, ...])` prend le premier champ non vide, en garde la première phrase, tronque à 110 caractères sur un mot. Vérifie quels champs de ton type contiennent du texte descriptif avant de les ordonner.
|
||||
4. `chips` = 3 étiquettes maximum (fonctions, hashtags, ou l'équivalent pour ton type). `geoloc` = `latitude != null && longitude != null` si ton type a des coordonnées, sinon `true` (pas de fiche à masquer côté carte).
|
||||
|
||||
`components/FicheMiniCard.vue` consomme uniquement `MiniFiche` — il n'a jamais besoin de connaître `Org` ou `StructureV2`. C'est ce découplage qui permet d'ajouter une source sans toucher au composant d'affichage.
|
||||
`components/FicheMiniCard.vue` consomme uniquement `MiniFiche` (depuis B11, `MiniFiche` porte aussi `etiquettes`, `chipsDimension`, `coords`, `date`, `ville`, `texte` : voir §Vue fiches) — il n'a jamais besoin de connaître `Org` ou `StructureV2`. C'est ce découplage qui permet d'ajouter une source sans toucher au composant d'affichage.
|
||||
|
||||
## FichesPanel — le panneau « toutes les fiches »
|
||||
## Vue fiches (B11 02/10/2026, détail B12 03/10/2026) — `VueFiches` + `useVueFiches`
|
||||
|
||||
`components/FichesPanel.vue` : props `fiches: MiniFiche[]` (déjà filtrée par la page appelante — le panneau ne refiltre pas, ne crée pas de second champ de recherche), `hashtags: string[]` (options de filtre), `selected: string[]`, `query: string` (sert seulement à nuancer le message d'état vide), `intention: string`. Émet `update:selected` et `open(fiche)`.
|
||||
Remplace `FichesPanel`, `NavSidebar`, `MobileSheet` et les onglets Métropolitain / Outre-mer / Toutes les fiches de `/` et `/agences` (tous retirés). Spécification : `1 PROJETS/DEV/AEP/Cadrage/SPEC-vue-fiches.md` (vault).
|
||||
|
||||
**Le panneau ne possède pas son propre état de filtre** : ses chips pilotent la variable réactive de la page appelante via `update:selected` (ex. `fonctions` sur `/`, `selectedHashtags` sur `/agences`). C'est ce qui garantit qu'une chip cochée dans le panneau et la même chip dans la sidebar (si elle est visible) affichent toujours le même état — une seule source de vérité, jamais deux.
|
||||
**Trois fichiers, trois rôles.**
|
||||
|
||||
**Hashtags repliés** (B3-M4) : au-delà de 14 chips (`COLLAPSE_THRESHOLD`), seules les premières s'affichent + un chip-bouton « voir les N autres » qui déplie. Les chips déjà actives restent visibles même repliées (union entre les 14 premières et les actives hors de ce lot). État déplié non persistant — `ref` locale, reset à chaque montage. `/` (10 fonctions) ne dépasse jamais le seuil ; `/agences` (~60 hashtags) se replie par défaut.
|
||||
| Fichier | Rôle | Testé par |
|
||||
|---|---|---|
|
||||
| `utils/vueFiches.ts` | logique pure : `lireQuery` / `ecrireQuery`, `filtrerFiches`, `compterEtiquettes`, `trierFiches`, `regrouper`, `ordreFiches` ; B12 : `lireFiche`, `queryAvecFiche`, `positionFiche`, `modeOuverture` / `modeFermeture`, `empreinteListe` | `node scripts/test-vue-fiches.mjs` |
|
||||
| `composables/useVueFiches.ts` | branche la logique sur la route ; rend un objet `reactive` (`vf`) | navigateur |
|
||||
| `components/VueFiches.vue` (+ `VueFichesFiltres.vue`) | barre d'outils, trois états, filtres, grille, poignée, feuille « Filtrer », panneau de détail (B12) | navigateur |
|
||||
|
||||
**Accès** : `?vue=fiches` dans l'URL, en plus des paramètres de filtre existants. Sur `/`, `desktopMapView`/`mobileMapView` gagnent une valeur `'fiches'` à côté de `'metropole'`/`'outremer'` ; sur `/agences`, à côté de `'metropole'`/`'outremer'`/`'graphe'`. Recharger l'URL avec `?vue=fiches` doit rouvrir directement le panneau, filtres compris.
|
||||
**L'URL est la source de vérité.** L'état se lit dans `route.query` (surveillée) et s'écrit par `router.replace`. Paramètres : `vue` (`carte` · `mixte` · `fiches`, absent = défaut par largeur), `q`, un paramètre par dimension (valeurs séparées par des virgules), `adresse=sans`, `tri`, `groupe`, et celui des sous-vues de carte (`mode` sur `/`, `carte` sur `/agences`). Un paramètre inconnu ou invalide est ignoré ; un paramètre que la vue ne gère pas (`territoire`, `random`) est recopié tel quel, `fiche=` aussi (un filtre changé garde la fiche ouverte). La recherche part dans l'URL 250 ms après la dernière touche.
|
||||
|
||||
**Mobile** : le panneau ne se monte JAMAIS dans un `MobileSheet` (le composant sheet demi-hauteur pensé pour flotter au-dessus d'une carte) — il n'y a pas de carte derrière la vue fiches, donc pas de sheet à demi-hauteur : le panneau occupe toute la zone sous la barre d'onglets, avec son propre scroll interne. Piège vécu en B3 : monter le panneau dans un `MobileSheet` par réflexe (comme les autres onglets) laisse ~45 % de l'écran vide au-dessus, puisque la sheet démarre repliée à mi-hauteur et qu'il n'y a rien à voir en dessous.
|
||||
**États.** Sans `vue=` : Mixte à partir de 1024 px, Fiches en dessous. Mixte n'existe pas sous 1024 px (il se lit Fiches). Avant le montage, la racine porte `vf--auto` et la CSS tranche seule, pour qu'un lien s'affiche sans saut. La poignée ‹ › bascule Mixte ↔ Carte ; le repli est retenu en `sessionStorage` (`aep_vue_fiches_liste_repliee`) et ne compte que si l'URL n'a pas de `vue=`. En état Fiches, la carte reste montée, invisible (Leaflet garde une taille) ; les cartes appellent `invalidateSize` par `ResizeObserver`.
|
||||
|
||||
**Filtres : OU dans une dimension, ET entre dimensions.** Compteur d'une chip = fiches qui portent l'étiquette parmi celles que laissent passer la recherche et les AUTRES dimensions ; 0 = chip grisée (`disabled`). Repli au-delà de 14 valeurs, dans l'ordre de la dimension (stable). Les filtres sont à UN endroit : panneau de gauche (Mixte), tête de grille (Fiches, ordinateur et tablette), feuille du bas (téléphone) ; en Carte, seules les pastilles actives, dans la barre. Une chip cliquée dans une carte-fiche ajoute le filtre (`MiniFiche.chipsDimension`).
|
||||
|
||||
**Tri** : `pertinence` (nombre d'étiquettes cochées, puis nom ; défaut dès qu'un filtre est actif), `nom` (défaut sinon), `recent` (date puis Id décroissant ; à n'offrir que si la source a une date). **Regroupement** : une fiche va sous sa PREMIÈRE étiquette de la dimension, jamais en double.
|
||||
|
||||
**Détail et fiche à fiche (B12).** Cliquer une carte-fiche (ou une épingle : la page appelle `vf.ouvrirFiche(id)`) écrit `fiche=<id>` par `router.push` ; passer d'une fiche à l'autre (Précédente / Suivante, ← →, balayage au téléphone) par `router.replace`. Fermer (✕, « ‹ N fiches », Échap) revient en arrière si l'entrée vient de la page et que la liste n'a pas changé depuis, sinon retire `fiche=` sur place (lien partagé, filtre changé fiche ouverte) : le retour du téléphone ferme la fiche, jamais la page. La fiche est cherchée dans TOUTES les fiches : hors du résultat, le panneau dit « Hors de vos filtres » et n'a pas de Précédente / Suivante. Panneau de 380 px en troisième colonne (ordinateur, dans les trois états ; la grille Fiches passe à 2 colonnes), 340 px sur tablette, plein écran par-dessus la vue au téléphone (barre, liste et carte en `inert`, fiche à fiche en pied). Le focus entre dans le panneau à l'ouverture et revient, à la fermeture, sur la carte-fiche de la dernière fiche lue ; la position de défilement de la liste est rendue. Actions du panneau : Ouvrir la page de la fiche (prop `lien-page`), Voir sur la carte (si la fiche a une épingle dans le résultat : Mixte sur ordinateur, Carte au téléphone ; la page lit `vf.centrage` et le passe à sa carte, prop `centrage` de `NavMap` / `NavMapV2`), Copier le lien (l'URL courante dit tout). Deux écritures d'URL dans le même tick s'enchaînent (la seconde part de la query en attente), elles ne s'écrasent plus.
|
||||
|
||||
**Contrat.**
|
||||
|
||||
```vue
|
||||
<VueFiches :vf="vf" intention="Une ligne." libelle-recherche="Rechercher…" :pending="pending"
|
||||
:lien-page="(f) => `/fiche/${f.id}`" @survol="…">
|
||||
<template #carte> <!-- carte(s) de la page, une par sous-vue, v-show sur vf.etat.sousVue --> </template>
|
||||
<template #detail="{ fiche, filtrer }"> <!-- contenu propre à la source ; filtrer(dimension, valeur) au clic d'une étiquette --> </template>
|
||||
<template #vide> <!-- optionnel --> </template>
|
||||
</VueFiches>
|
||||
```
|
||||
|
||||
Contenus de détail en place : `/` → `FicheDetail` (`compact`, `etiquettes-cliquables`) + commentaires, l'`Org` venant de la liste (même enregistrement NocoDB que `/api/fiche/:id`) ; `/agences` → `FicheReseauContenu` (corps de l'ancienne `FicheModalV2`, une structure liée s'ouvre dans le même panneau). `FicheModal` et `FicheModalV2` sont retirées ; la page `/fiche/:id` reste.
|
||||
|
||||
`const vf = useVueFiches(fiches, config)` : `fiches` = `MiniFiche[]` déjà adaptées, non filtrées (ref, computed ou getter) ; `config: ConfigVueFiches` = `{ dimensions, tris, groupes, etats, sousVues? }` (types dans `utils/vueFiches.ts`). Le composant ne charge rien et ne connaît pas la carte. La page lit `vf.idsResultat` pour ne montrer sur la carte que le résultat courant, `vf.survolId` pour allumer l'épingle (et l'écrit au survol d'une épingle), `vf.ficheId` / `vf.ficheOuverte` / `vf.position` pour la fiche ouverte (B12), `vf.largeur` et `vf.vueAffichee` pour placer ses boutons flottants.
|
||||
|
||||
**Brancher une troisième page** (Codev en B12, Outils, vue Œuvres) :
|
||||
1. Adaptateur dans `useFicheAdapter.ts` : remplir `etiquettes` avec une clé par dimension (= nom du paramètre d'URL), `chipsDimension`, `coords` si la source en a (sinon `geoloc: true`).
|
||||
2. Une `ConfigVueFiches` dans la page : dimensions (variante `fonction` pour la principale, `echelle` pour la secondaire), tris (pas de `recent` sans date), groupes, `etats` (`['carte', 'fiches']` si la page n'a pas la place pour Mixte), `sousVues` si la carte en a.
|
||||
3. Le slot `#carte`, et le slot `#detail` (contenu de la fiche ; une page sans contenu de détail affiche seulement les actions). Les épingles appellent `vf.ouvrirFiche(id)`.
|
||||
4. Ajouter des cas à `scripts/test-vue-fiches.mjs` si la page introduit une règle nouvelle.
|
||||
|
||||
**Troisième page en place : `/outils?tab=partir-de-soi` (B6-M2)** — sept fiches, une par mot de la slide 17 (`components/OutilsPartirDeSoi.vue`, adaptateur `toMiniMot`). Trois extensions optionnelles du composant, sans effet sur `/` et `/agences` : tri `ordre` (ordre du tableau d'entrée) avec `config.triDefaut` (tri sans filtre ; la pertinence reste prioritaire dès qu'un filtre est actif) et `config.libellesTri` ; prop `libelles-vue` (`{ carte: 'Graphe' }` : le bouton, et « Voir dans le graphe » au lieu de « Voir sur la carte » ; l'URL garde `vue=carte`). Le slot `#carte` y est `GrapheMots.vue`, un SVG statique (nœud central, mots en couronne, ressources en feuilles) dans le vocabulaire du motif maillage. La page vit dans un onglet : `tab=` est un paramètre que la vue ne gère pas, donc recopié à chaque écriture.
|
||||
|
||||
**`FicheMiniCard`** : racine `<article>`, toute la carte ouvre la fiche par un bouton étiré (`::after`) ; avec `etiquettes-cliquables`, les chips deviennent des boutons (impossible dans l'ancienne racine `<button>`). Props `actif` (liseré safran au survol d'épingle), `etiquettes-actives`. Résumé et « Sans localisation » en `color-mix(--text 78 %)` : `--text-muted` et `--text-subtle` échouaient au contraste.
|
||||
|
||||
## Intention d'abord
|
||||
|
||||
Principe de design validé par Jules pour B3 : un panneau (ou une carte) s'ouvre sur **une ligne d'intention** avant l'outillage (filtres, compteur, grille). La ligne d'intention dit en une phrase ce que montre l'écran et le premier geste possible (« Toutes les structures d'entraide, y compris celles sans adresse sur la carte. Cochez une fonction pour filtrer. »). Dans `FichesPanel`, l'ordre de l'en-tête est fixe : intention → compteur → chips → grille. Ne pas remonter le compteur ou les chips au-dessus de l'intention, même pour gagner de la place.
|
||||
Principe de design validé par Jules pour B3 : un panneau (ou une carte) s'ouvre sur **une ligne d'intention** avant l'outillage (filtres, compteur, grille). La ligne d'intention dit en une phrase ce que montre l'écran et le premier geste possible (« Toutes les structures d'entraide, y compris celles sans adresse sur la carte. Cochez une fonction pour filtrer. »). Dans `VueFiches`, l'intention ouvre la liste, avant les filtres et la grille. Ne pas remonter le compteur ou les chips au-dessus de l'intention, même pour gagner de la place.
|
||||
|
||||
## Motif maillage (favicon)
|
||||
|
||||
@@ -82,3 +117,29 @@ Le favicon (`public/favicon.svg`, décliné en `favicon-32.png`, `favicon-16.png
|
||||
|
||||
1. **Texte sombre sur l'accent safran, jamais blanc.** `--accent`/`--on-accent` : le blanc sur `#f5b342` échoue le contrôle AA (décision DS du 20/07/2026). `--on-accent` est toujours une couleur sombre (`#1a2238` clair, `#111520` sombre). Vérifié au pixel sur la variante `posture` de `Chip.vue`.
|
||||
2. **`--nav-text-on-primary` reste une valeur littérale**, pas un alias — voir l'explication détaillée dans la section tokens ci-dessus. Si un nouveau composant a besoin de texte de contraste sur un fond bleu nuit, vérifie d'abord si ce fond est `--nav-primary` (translucide) ou `--nav-primary-solid` (opaque) avant de choisir la variable de texte : elles n'ont pas la même réponse en mode sombre.
|
||||
|
||||
## Navigation par échelles S / M / XL (B10, 02/10/2026)
|
||||
|
||||
**Source unique : `utils/echelles.ts`.** Chaque échelle porte ses `onglets` (`libelle`, `to`, `actif(route)`) ; `ORDRE_ECHELLES` fixe l'ordre S → M → XL ; `echelleDeRoute(route)` rend le groupe et l'onglet courants, ou `null` hors groupe (Manifeste, À propos, Proposer, Signaler, fiche, `/rag`). Aucun libellé d'échelle ni d'onglet ne se recopie dans un composant : ajouter un onglet = une ligne dans ce fichier, et `scripts/test-echelles-nav.mjs` (une ligne de cas).
|
||||
|
||||
| Échelle | Accroche | Onglets |
|
||||
|---|---|---|
|
||||
| S | Partir de soi | Jobs (`/trouver-du-taf`) · Outils (`/outils`) |
|
||||
| M | La communauté | Écosystème d'entraide (`/`) · Réseaux AEP (`/agences`) · Codev (`/codev*`) |
|
||||
| XL | Contribuer | Recherche média (`/media`) · Publications (`/media?tab=projets`) |
|
||||
|
||||
**Seuils** (CSS des composants, pas de breakpoint Tailwind : 1280 et 1440 n'en sont pas) :
|
||||
|
||||
| Largeur | En-tête | Sous l'en-tête |
|
||||
|---|---|---|
|
||||
| ≥ 1440 | logo complet · trois groupes · Manifeste · À propos · Soutenir (contour safran) · + Proposer (plein safran) · sombre | — |
|
||||
| 1280-1439 | idem, logo réduit au bloc « AEP » | — |
|
||||
| 1024-1279 | logo complet · groupe courant seul · Manifeste · + Proposer · sombre · « Menu » | — |
|
||||
| 768-1023 | logo réduit · groupe courant seul · Manifeste · + Proposer · sombre · « Menu » | — |
|
||||
| < 768 | logo complet · sombre · + (icône) · ☰ | `FilEchelle` (28 px), sauf hors groupe |
|
||||
|
||||
**Composants** : `NavEchelles.vue` (barre ; chaque groupe est un `<ul>` étiqueté par son accroche via `aria-labelledby`, onglet courant en `aria-current="page"`), `NavTiroir.vue` (menu < 1280 : `role="dialog"`, voile, Échap, focus piégé et rendu à l'élément d'ouverture, fermeture au changement de route et au passage à ≥ 1280), `FilEchelle.vue` (< 768, monté dans `app.vue` entre `<header>` et le conteneur de page, **jamais dedans** : `/` y est en `overflow-hidden`). Le lien de don vit dans `utils/liens.ts` (`SOUTENIR_URL`).
|
||||
|
||||
**Texte atténué** : `color-mix(in srgb, var(--text) 78 %, transparent)`, pas `--text-muted` (3,7:1 sur blanc, sous AA à 0,8 rem) ni `opacity` (qui éteindrait aussi l'anneau de focus).
|
||||
|
||||
**Signaler** n'est plus dans la barre d'ordinateur : il reste dans le tiroir, dans chaque fiche, et en pied d'À propos.
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<div class="flex flex-col h-screen overflow-hidden" :class="{ dark: isDark }" style="background: var(--nav-bg);">
|
||||
|
||||
<!-- ═══════════════════════════════════════ TOP NAV GLOBAL -->
|
||||
<!-- ═══════════════════════════════════════ TOP NAV GLOBAL (B10 : échelles S / M / XL) ; absente sur event. (lot Y) -->
|
||||
<header
|
||||
class="flex items-center justify-between px-4 py-2.5 shrink-0 relative z-[9999] shadow-sm gap-3"
|
||||
v-if="!estEvenement"
|
||||
class="app-header flex items-center px-4 shrink-0 relative z-[9999] shadow-sm gap-3"
|
||||
style="background: var(--nav-surface); border-bottom: 1px solid var(--nav-bg-alt);"
|
||||
>
|
||||
<!-- Logo -->
|
||||
<!-- Logo : texte complet sauf 768-1023 et 1280-1439 (place des onglets) -->
|
||||
<a href="/" class="logo-link flex items-center gap-2 hover:opacity-90 transition-opacity shrink-0" title="Architecture d'Écologie Politique">
|
||||
<div
|
||||
class="h-8 px-2 rounded-lg flex items-center justify-center shrink-0"
|
||||
@@ -20,112 +21,38 @@
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- ── Onglets desktop (≥1024px) — remplace la barre de recherche ── -->
|
||||
<nav class="hidden lg:flex flex-1 justify-center items-end gap-0 mx-6" aria-label="Navigation projets">
|
||||
<NuxtLink
|
||||
to="/outils"
|
||||
class="nav-tab"
|
||||
:class="{ 'nav-tab--active': route.path === '/outils' }"
|
||||
>
|
||||
Outils
|
||||
</NuxtLink>
|
||||
<NuxtLink
|
||||
to="/"
|
||||
class="nav-tab"
|
||||
:class="{ 'nav-tab--active': route.path === '/' }"
|
||||
>
|
||||
Écosystème Entraide
|
||||
</NuxtLink>
|
||||
<NuxtLink
|
||||
to="/agences"
|
||||
class="nav-tab"
|
||||
:class="{ 'nav-tab--active': route.path === '/agences' }"
|
||||
>
|
||||
Réseaux AEP
|
||||
</NuxtLink>
|
||||
<NuxtLink
|
||||
to="/trouver-du-taf"
|
||||
class="nav-tab"
|
||||
:class="{ 'nav-tab--active': route.path === '/trouver-du-taf' }"
|
||||
>
|
||||
Jobs
|
||||
</NuxtLink>
|
||||
<NuxtLink
|
||||
to="/codev"
|
||||
class="nav-tab"
|
||||
:class="{ 'nav-tab--active': route.path.startsWith('/codev') }"
|
||||
>
|
||||
Codev
|
||||
</NuxtLink>
|
||||
<NuxtLink
|
||||
to="/media"
|
||||
class="nav-tab"
|
||||
:class="{ 'nav-tab--active': route.path.startsWith('/media') }"
|
||||
>
|
||||
recherche-média
|
||||
</NuxtLink>
|
||||
</nav>
|
||||
|
||||
<!-- ── Barre recherche mobile (640px–1024px) — masquée < 640px car accessible dans la sheet -->
|
||||
<div class="hidden sm:flex lg:hidden flex-1 mx-2">
|
||||
<label class="flex items-center gap-2 w-full px-3 py-1.5 rounded-xl border" style="background: var(--nav-bg); border-color: var(--nav-bg-alt);">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="color: var(--nav-text-muted); flex-shrink: 0;">
|
||||
<circle cx="11" cy="11" r="8"/>
|
||||
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
||||
</svg>
|
||||
<input
|
||||
v-model="headerSearch"
|
||||
type="search"
|
||||
placeholder="Rechercher…"
|
||||
class="flex-1 bg-transparent border-0 outline-none text-sm"
|
||||
style="color: var(--nav-text); font-family: var(--nav-font);"
|
||||
autocomplete="off"
|
||||
@input="onHeaderSearch"
|
||||
@keydown.enter="onHeaderSearch"
|
||||
/>
|
||||
<button
|
||||
v-if="headerSearch"
|
||||
type="button"
|
||||
@click.stop="clearHeaderSearch"
|
||||
class="flex-shrink-0"
|
||||
style="color: var(--nav-text-muted);"
|
||||
aria-label="Effacer la recherche"
|
||||
>
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</label>
|
||||
</div>
|
||||
<!-- Échelles : trois groupes ≥ 1280, groupe courant 768-1279, rien < 768 (fil d'échelle) -->
|
||||
<NavEchelles />
|
||||
<div class="flex-1 md:hidden" aria-hidden="true" />
|
||||
|
||||
<!-- Actions droite -->
|
||||
<div class="flex items-center gap-2 shrink-0">
|
||||
<NuxtLink
|
||||
to="/manifeste"
|
||||
class="px-3 py-1.5 rounded-lg text-sm font-medium transition-all hover:opacity-80 hidden md:inline-flex items-center gap-1"
|
||||
:style="route.path === '/manifeste' ? 'color: var(--nav-primary-solid); font-weight: 700;' : 'color: var(--nav-text-muted);'"
|
||||
class="header-lien hidden md:inline-flex"
|
||||
:aria-current="route.path === '/manifeste' ? 'page' : undefined"
|
||||
>
|
||||
Manifeste
|
||||
</NuxtLink>
|
||||
<NuxtLink
|
||||
to="/a-propos"
|
||||
class="px-3 py-1.5 rounded-lg text-sm font-medium transition-all hover:opacity-80 hidden md:inline-flex items-center gap-1"
|
||||
style="color: var(--nav-text-muted);"
|
||||
class="header-lien header-xl"
|
||||
:aria-current="route.path === '/a-propos' ? 'page' : undefined"
|
||||
>
|
||||
À propos
|
||||
</NuxtLink>
|
||||
<NuxtLink
|
||||
to="/signaler"
|
||||
class="px-3 py-1.5 rounded-lg text-sm font-medium transition-all hover:opacity-80 hidden lg:inline-flex items-center gap-1"
|
||||
style="color: var(--nav-text-muted);"
|
||||
<a
|
||||
:href="SOUTENIR_URL"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="header-soutenir header-xl"
|
||||
>
|
||||
Signaler
|
||||
</NuxtLink>
|
||||
<!-- Proposer une ressource (5 onglets) -->
|
||||
Soutenir
|
||||
</a>
|
||||
<!-- Proposer une ressource -->
|
||||
<NuxtLink
|
||||
to="/proposer"
|
||||
class="px-3 py-1.5 rounded-lg text-sm font-semibold transition-all hover:opacity-80 hidden sm:inline-flex items-center gap-1"
|
||||
style="background: var(--nav-accent); color: var(--nav-text);"
|
||||
class="header-proposer hidden md:inline-flex"
|
||||
>
|
||||
+ Proposer
|
||||
</NuxtLink>
|
||||
@@ -153,68 +80,55 @@
|
||||
<!-- Mobile : proposer icône -->
|
||||
<NuxtLink
|
||||
to="/proposer"
|
||||
class="sm:hidden p-2 rounded-lg"
|
||||
style="background: var(--nav-accent); color: var(--nav-text);"
|
||||
class="md:hidden p-2 rounded-lg"
|
||||
style="background: var(--accent); color: var(--on-accent);"
|
||||
title="Proposer une ressource"
|
||||
aria-label="Proposer"
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>
|
||||
</svg>
|
||||
</NuxtLink>
|
||||
|
||||
<!-- Menu déroulant — toutes largeurs (les onglets n'y apparaissent qu'en dessous de 1024px) ; porte « Soutenir » -->
|
||||
<div class="relative">
|
||||
<button
|
||||
@click="hamburgerOpen = !hamburgerOpen"
|
||||
class="p-2 rounded-lg transition-all hover:opacity-80"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted);"
|
||||
:aria-label="hamburgerOpen ? 'Fermer le menu' : 'Menu'"
|
||||
:aria-expanded="hamburgerOpen"
|
||||
>
|
||||
<svg v-if="!hamburgerOpen" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" aria-hidden="true">
|
||||
<line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/>
|
||||
</svg>
|
||||
<svg v-else width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" aria-hidden="true">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div
|
||||
v-if="hamburgerOpen"
|
||||
class="absolute right-0 top-full mt-1 rounded-lg shadow-lg min-w-[210px] py-1"
|
||||
style="background: var(--nav-surface); border: 1px solid var(--nav-bg-alt); z-index: 9999;"
|
||||
@click="hamburgerOpen = false"
|
||||
>
|
||||
<NuxtLink to="/outils" class="lg:hidden block px-4 py-2.5 text-sm font-medium transition-opacity hover:opacity-70" :style="route.path === '/outils' ? 'color: var(--nav-primary-solid); font-weight: 700;' : 'color: var(--nav-text);'">Outils</NuxtLink>
|
||||
<NuxtLink to="/" class="lg:hidden block px-4 py-2.5 text-sm font-medium transition-opacity hover:opacity-70" :style="route.path === '/' ? 'color: var(--nav-primary-solid); font-weight: 700;' : 'color: var(--nav-text);'">Écosystème Entraide</NuxtLink>
|
||||
<NuxtLink to="/agences" class="lg:hidden block px-4 py-2.5 text-sm transition-opacity hover:opacity-70" :style="route.path === '/agences' ? 'color: var(--nav-primary-solid); font-weight: 700;' : 'color: var(--nav-text);'">Réseaux AEP</NuxtLink>
|
||||
<NuxtLink to="/trouver-du-taf" class="lg:hidden block px-4 py-2.5 text-sm transition-opacity hover:opacity-70" :style="route.path === '/trouver-du-taf' ? 'color: var(--nav-primary-solid); font-weight: 700;' : 'color: var(--nav-text);'">Jobs</NuxtLink>
|
||||
<NuxtLink to="/media" class="lg:hidden block px-4 py-2.5 text-sm transition-opacity hover:opacity-70" :style="route.path.startsWith('/media') ? 'color: var(--nav-primary-solid); font-weight: 700;' : 'color: var(--nav-text);'">recherche-média</NuxtLink>
|
||||
<NuxtLink to="/codev" class="lg:hidden block px-4 py-2.5 text-sm transition-opacity hover:opacity-70" :style="route.path.startsWith('/codev') ? 'color: var(--nav-primary-solid); font-weight: 700;' : 'color: var(--nav-text);'">Codev</NuxtLink>
|
||||
<div class="lg:hidden" style="height: 1px; background: var(--nav-bg-alt); margin: 4px 0;"></div>
|
||||
<NuxtLink to="/manifeste" class="block px-4 py-2.5 text-sm transition-opacity hover:opacity-70" :style="route.path === '/manifeste' ? 'color: var(--nav-primary-solid); font-weight: 700;' : 'color: var(--nav-text-muted);'">Manifeste</NuxtLink>
|
||||
<NuxtLink to="/a-propos" class="block px-4 py-2.5 text-sm transition-opacity hover:opacity-70" style="color: var(--nav-text-muted);">À propos</NuxtLink>
|
||||
<a href="https://liberapay.com/trans-former.fr/donate" target="_blank" rel="noopener noreferrer" class="block mx-3 my-2 px-4 py-2 rounded-lg text-sm font-semibold text-center transition-opacity hover:opacity-80" style="background: var(--nav-accent); color: var(--nav-text);">Soutenir</a>
|
||||
<NuxtLink to="/signaler" class="block px-4 py-2.5 text-sm transition-opacity hover:opacity-70" style="color: var(--nav-text-muted);">Signaler</NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Menu (< 1280) : ouvre le tiroir ; le mot est écrit à partir de 768 -->
|
||||
<button
|
||||
type="button"
|
||||
class="header-menu"
|
||||
aria-label="Ouvrir le menu"
|
||||
aria-haspopup="dialog"
|
||||
:aria-expanded="menuOpen"
|
||||
@click="menuOpen = true"
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" aria-hidden="true">
|
||||
<line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/>
|
||||
</svg>
|
||||
<span class="header-menu__mot" aria-hidden="true">Menu</span>
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Contenu page (flex-1 pour remplir l'espace) -->
|
||||
<div class="flex-1" :class="route.path === '/' ? 'overflow-hidden' : 'overflow-y-auto'">
|
||||
<!-- Fil d'échelle (< 768) : dans le flux de la colonne, hors du conteneur de page -->
|
||||
<FilEchelle v-if="!estEvenement" />
|
||||
<!-- Bandeau du prochain événement (B27) : pas sur la copie AEP des pages d'événement, qui est déjà la destination -->
|
||||
<BandeauEvenement v-if="!estEvenement && !route.path.startsWith('/evenements')" />
|
||||
|
||||
<!-- Contenu page (flex-1 pour remplir l'espace) ; sur event., / est l'index des événements : il défile -->
|
||||
<div class="flex-1 min-h-0" :class="route.path === '/' && !estEvenement ? 'overflow-hidden' : 'overflow-y-auto'">
|
||||
<NuxtPage />
|
||||
</div>
|
||||
|
||||
<NavTiroir v-if="!estEvenement" :open="menuOpen" @close="menuOpen = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
import { SOUTENIR_URL } from '~/utils/liens'
|
||||
import { estHoteEvenement } from '~/utils/evenements'
|
||||
|
||||
const hamburgerOpen = ref(false)
|
||||
watch(() => route.path, () => { hamburgerOpen.value = false })
|
||||
const route = useRoute()
|
||||
const estEvenement = estHoteEvenement(useRequestURL().hostname)
|
||||
|
||||
const menuOpen = ref(false)
|
||||
|
||||
// ── Dark mode ─────────────────────────────────────────────────────────────
|
||||
const isDark = ref(false)
|
||||
@@ -237,40 +151,14 @@ function toggleDark() {
|
||||
localStorage.setItem('aep_theme', 'light')
|
||||
}
|
||||
}
|
||||
|
||||
// ── Barre de recherche header mobile ─────────────────────────────────────
|
||||
const headerSearch = ref((route.query.q as string) ?? '')
|
||||
|
||||
// Sync depuis URL quand la route change
|
||||
watch(() => route.query.q, (v) => {
|
||||
headerSearch.value = (v as string) ?? ''
|
||||
})
|
||||
|
||||
function onHeaderSearch() {
|
||||
const q = headerSearch.value.trim()
|
||||
if (route.path === '/') {
|
||||
router.replace({ query: q ? { ...route.query, q } : { ...route.query, q: undefined } })
|
||||
} else if (q) {
|
||||
router.push({ path: '/', query: { q } })
|
||||
}
|
||||
}
|
||||
|
||||
function clearHeaderSearch() {
|
||||
headerSearch.value = ''
|
||||
if (route.path === '/') {
|
||||
const q = { ...route.query }
|
||||
delete q.q
|
||||
router.replace({ query: Object.keys(q).length ? q : undefined })
|
||||
}
|
||||
}
|
||||
|
||||
// ── Fiche aléatoire ───────────────────────────────────────────────────────
|
||||
function goRandom() {
|
||||
router.push({ path: '/', query: { random: '1' } })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* ── En-tête ──────────────────────────────────────────────────────────── */
|
||||
.app-header {
|
||||
min-height: 52px;
|
||||
}
|
||||
|
||||
/* ── Logo header (texte 2 lignes) ─────────────────────────────────────── */
|
||||
.logo-text {
|
||||
line-height: 1.05;
|
||||
@@ -285,39 +173,96 @@ function goRandom() {
|
||||
@media (min-width: 1024px) {
|
||||
.logo-line-1, .logo-line-2 { font-size: 0.85rem; }
|
||||
}
|
||||
/* Le groupe courant (768-1023) et les trois groupes (1280-1439) prennent la place du texte */
|
||||
@media (min-width: 768px) and (max-width: 1023px), (min-width: 1280px) and (max-width: 1439px) {
|
||||
.logo-text { display: none; }
|
||||
}
|
||||
|
||||
/* ── Onglets header desktop ───────────────────────────────────────────── */
|
||||
.nav-tab {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
/* ── Liens et boutons de droite ───────────────────────────────────────── */
|
||||
.header-lien {
|
||||
align-items: center;
|
||||
padding: 6px 16px 8px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
color: var(--nav-text-muted);
|
||||
padding: 6px 8px;
|
||||
border-radius: var(--radius-md);
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: var(--fw-medium);
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
transition: color 0.15s;
|
||||
border-bottom: 2px solid transparent;
|
||||
gap: 2px;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
.header-lien:hover,
|
||||
.header-lien[aria-current="page"] {
|
||||
color: var(--text);
|
||||
}
|
||||
.header-lien[aria-current="page"] {
|
||||
font-weight: var(--fw-bold);
|
||||
}
|
||||
|
||||
.nav-tab:hover {
|
||||
color: var(--nav-text);
|
||||
.header-soutenir {
|
||||
align-items: center;
|
||||
padding: 5px 10px;
|
||||
border: 1.5px solid var(--accent);
|
||||
border-radius: var(--radius-md);
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: var(--fw-semibold);
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.nav-tab--active {
|
||||
color: var(--nav-text);
|
||||
border-bottom-color: var(--nav-primary-solid);
|
||||
font-weight: 600;
|
||||
.header-proposer {
|
||||
align-items: center;
|
||||
padding: 6px 11px;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: var(--fw-semibold);
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav-tab-badge {
|
||||
font-size: 0.6rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--nav-text-muted);
|
||||
opacity: 0.65;
|
||||
.header-soutenir:hover,
|
||||
.header-proposer:hover {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.header-lien:focus-visible,
|
||||
.header-soutenir:focus-visible,
|
||||
.header-proposer:focus-visible,
|
||||
.header-menu:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* À propos et Soutenir : barre complète seulement (≥ 1280), sinon dans le tiroir */
|
||||
.header-xl { display: none; }
|
||||
@media (min-width: 1280px) {
|
||||
.header-xl { display: inline-flex; }
|
||||
}
|
||||
|
||||
.header-menu {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 8px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--bg-alt);
|
||||
color: var(--text);
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: var(--fw-semibold);
|
||||
cursor: pointer;
|
||||
}
|
||||
.header-menu__mot { display: none; }
|
||||
@media (min-width: 768px) {
|
||||
.header-menu {
|
||||
padding: 5px 10px;
|
||||
border-color: var(--border);
|
||||
background: transparent;
|
||||
}
|
||||
.header-menu__mot { display: inline; }
|
||||
}
|
||||
@media (min-width: 1280px) {
|
||||
.header-menu { display: none; }
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { RouterConfig } from '@nuxt/schema'
|
||||
import { estHoteEvenement, routesPourHote } from '~/utils/evenements'
|
||||
|
||||
/**
|
||||
* Lot Y : sur event.trans-former.fr, seules les pages de pages/evenements/ existent,
|
||||
* servies sans le préfixe (/ruetz/foret). useRequestURL lit l'hôte de la requête côté
|
||||
* serveur et window.location côté client : les deux tables sont identiques.
|
||||
*/
|
||||
export default <RouterConfig>{
|
||||
routes: (routes) => routesPourHote(routes, estHoteEvenement(useRequestURL().hostname)),
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
<!--
|
||||
BandeauEvenement — B27
|
||||
Une ligne sous l'en-tête d'aep.trans-former.fr : le prochain événement (la plantation
|
||||
de Ruetz), lien vers sa page sur event.trans-former.fr. Monté dans app.vue, hôte AEP seul.
|
||||
|
||||
- Dates et lien lus dans data/evenements/ruetz-2026.ts (utils/bandeauEvenement.ts).
|
||||
- Retiré seul après le dernier jour, 23:59 heure de Paris (bandeauVisible, serveur et client).
|
||||
- Fermable ; la fermeture est gardée en localStorage (CLE_FERMETURE_BANDEAU). Rendu serveur = visible.
|
||||
Pour qu'un visiteur qui l'a fermé ne le voie pas clignoter (ni la carte sauter de sa
|
||||
hauteur) à chaque page, un script inline dans <head> pose `html.bandeau-evt-ferme` avant
|
||||
le premier rendu ; le CSS ci-dessous masque alors le bandeau, puis onMounted le retire.
|
||||
- Aucune animation.
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
v-if="affiche"
|
||||
class="bandeau-evt"
|
||||
role="region"
|
||||
aria-label="Prochain événement"
|
||||
>
|
||||
<a :href="lien" class="bandeau-evt__lien">
|
||||
<span class="bandeau-evt__annonce">{{ texte.annonce }}</span>
|
||||
{{ ' ' }}
|
||||
<span class="bandeau-evt__appel">{{ texte.appel }}</span>
|
||||
</a>
|
||||
<button
|
||||
type="button"
|
||||
class="bandeau-evt__fermer"
|
||||
aria-label="Fermer"
|
||||
title="Fermer"
|
||||
@click="fermer"
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" aria-hidden="true">
|
||||
<line x1="6" y1="6" x2="18" y2="18" /><line x1="18" y1="6" x2="6" y2="18" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { evenement } from '~/data/evenements/ruetz-2026'
|
||||
import { bandeauVisible, texteBandeauEvenement, lienBandeau, CLE_FERMETURE_BANDEAU } from '~/utils/bandeauEvenement'
|
||||
|
||||
const CLASSE_FERME = 'bandeau-evt-ferme'
|
||||
|
||||
const texte = texteBandeauEvenement(evenement)
|
||||
const lien = lienBandeau(evenement)
|
||||
|
||||
const dansLaPeriode = ref(bandeauVisible(new Date(), evenement))
|
||||
const ferme = ref(false)
|
||||
const affiche = computed(() => dansLaPeriode.value && !ferme.value)
|
||||
|
||||
// Avant le premier rendu : si le bandeau a déjà été fermé, `html.bandeau-evt-ferme` le masque (CSS).
|
||||
useHead({
|
||||
script: [{
|
||||
key: 'aep-bandeau-evt',
|
||||
tagPosition: 'head',
|
||||
innerHTML: `try{if(localStorage.getItem(${JSON.stringify(CLE_FERMETURE_BANDEAU)}))document.documentElement.classList.add(${JSON.stringify(CLASSE_FERME)})}catch(e){}`,
|
||||
}],
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// Une page servie juste avant minuit peut rester ouverte : on relit l'heure du client.
|
||||
dansLaPeriode.value = bandeauVisible(new Date(), evenement)
|
||||
try {
|
||||
ferme.value = !!localStorage.getItem(CLE_FERMETURE_BANDEAU)
|
||||
} catch {
|
||||
// localStorage indisponible (navigation privée stricte) : le bandeau reste, fermable pour la page.
|
||||
}
|
||||
})
|
||||
|
||||
function fermer() {
|
||||
ferme.value = true
|
||||
document.documentElement.classList.add(CLASSE_FERME)
|
||||
try {
|
||||
localStorage.setItem(CLE_FERMETURE_BANDEAU, '1')
|
||||
} catch {
|
||||
// rien : fermé pour cette page seulement
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* Non scopé : la règle de masquage avant montage part de <html>. */
|
||||
html.bandeau-evt-ferme .bandeau-evt {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.bandeau-evt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
gap: var(--space-xs);
|
||||
min-height: 36px;
|
||||
padding: 0 4px 0 var(--space-sm);
|
||||
background: color-mix(in srgb, var(--accent) 18%, var(--surface));
|
||||
border-bottom: 1px solid var(--border);
|
||||
color: var(--text);
|
||||
font-size: var(--fs-xs);
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.bandeau-evt__lien {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 6px 0;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.bandeau-evt__appel {
|
||||
font-weight: var(--fw-semibold);
|
||||
white-space: nowrap;
|
||||
text-decoration: underline;
|
||||
text-decoration-thickness: 1px;
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
|
||||
.bandeau-evt__lien:hover .bandeau-evt__annonce {
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
|
||||
.bandeau-evt__fermer {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 0;
|
||||
border-radius: var(--radius-sm);
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.bandeau-evt__fermer:hover {
|
||||
background: color-mix(in srgb, var(--text) 10%, transparent);
|
||||
}
|
||||
|
||||
/* Le safran du focus disparaît sur le fond safran : l'anneau passe à l'encre. */
|
||||
.bandeau-evt__lien:focus-visible,
|
||||
.bandeau-evt__fermer:focus-visible {
|
||||
outline: 2px solid var(--text);
|
||||
outline-offset: -2px;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
/* Écran tactile : cible de fermeture de 44 px. */
|
||||
@media (pointer: coarse) {
|
||||
.bandeau-evt__fermer {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
}
|
||||
|
||||
/* À partir de 768 px, la phrase tient sur une ligne : centrée, la croix au bord droit
|
||||
(marge gauche égale à la croix, pour un vrai centre). */
|
||||
@media (min-width: 48rem) {
|
||||
.bandeau-evt {
|
||||
padding-left: calc(32px + 4px + var(--space-xs));
|
||||
}
|
||||
.bandeau-evt__lien {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<span v-if="profondeur === 'approfondi'" class="chat-mode-badge">{{ CHAT_PROFONDEUR_LIBELLES.approfondi }}</span>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// Étiquette sobre sur une réponse donnée en mode approfondi (rien en mode rapide).
|
||||
defineProps<{ profondeur?: string }>()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chat-mode-badge {
|
||||
display: inline-block;
|
||||
margin-bottom: 6px;
|
||||
padding: 1px 8px;
|
||||
border-radius: 9999px;
|
||||
border: 1px solid var(--nav-bg-alt);
|
||||
font-size: 0.66rem;
|
||||
font-family: var(--nav-font);
|
||||
color: var(--nav-text-muted);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<div class="chat-mode" role="radiogroup" aria-label="Mode de réponse">
|
||||
<button
|
||||
v-for="(p, i) in CHAT_PROFONDEURS"
|
||||
:key="p"
|
||||
:ref="(el) => (boutons[i] = el as HTMLButtonElement | null)"
|
||||
type="button"
|
||||
role="radio"
|
||||
class="chat-mode-option"
|
||||
:class="{ active: modelValue === p }"
|
||||
:aria-checked="modelValue === p"
|
||||
:tabindex="modelValue === p ? 0 : -1"
|
||||
:title="CHAT_PROFONDEUR_AIDES[p]"
|
||||
:disabled="disabled"
|
||||
@click="choisir(p)"
|
||||
@keydown="onKey($event, i)"
|
||||
>{{ CHAT_PROFONDEUR_LIBELLES[p] }}</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// Toggle 2 options partagé par les 5 chatbots. Libellés : utils/chatProfondeur.ts.
|
||||
// radiogroup : flèches déplacent la sélection, Tab entre/sort du groupe (roving tabindex).
|
||||
const props = defineProps<{ modelValue: 'rapide' | 'approfondi'; disabled?: boolean }>()
|
||||
const emit = defineEmits<{ 'update:modelValue': [value: 'rapide' | 'approfondi'] }>()
|
||||
|
||||
const boutons = ref<(HTMLButtonElement | null)[]>([])
|
||||
|
||||
function choisir(p: ChatProfondeur) {
|
||||
if (!props.disabled) emit('update:modelValue', p)
|
||||
}
|
||||
|
||||
function onKey(e: KeyboardEvent, i: number) {
|
||||
const n = CHAT_PROFONDEURS.length
|
||||
let j = -1
|
||||
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') j = (i + 1) % n
|
||||
else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') j = (i - 1 + n) % n
|
||||
else if (e.key === 'Home') j = 0
|
||||
else if (e.key === 'End') j = n - 1
|
||||
if (j < 0) return
|
||||
e.preventDefault()
|
||||
choisir(CHAT_PROFONDEURS[j])
|
||||
nextTick(() => boutons.value[j]?.focus())
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chat-mode {
|
||||
display: inline-flex;
|
||||
gap: 2px;
|
||||
padding: 2px;
|
||||
border-radius: 9999px;
|
||||
background: var(--nav-bg-alt);
|
||||
align-self: flex-start;
|
||||
}
|
||||
.chat-mode-option {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: var(--nav-text-muted);
|
||||
font-family: var(--nav-font);
|
||||
font-size: 0.72rem;
|
||||
line-height: 1.2;
|
||||
padding: 4px 10px;
|
||||
border-radius: 9999px;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s, color 0.15s;
|
||||
}
|
||||
.chat-mode-option:hover:not(.active):not(:disabled) { color: var(--nav-text); }
|
||||
.chat-mode-option.active {
|
||||
background: var(--nav-primary);
|
||||
color: var(--nav-text-on-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
.chat-mode-option:focus-visible { outline: 2px solid var(--nav-primary); outline-offset: 2px; }
|
||||
.chat-mode-option:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.chat-mode-option { transition: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<button type="button" class="chat-new-conversation" @click="emit('reset')">
|
||||
Nouvelle conversation
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// Bouton sobre « Nouvelle conversation », partagé par les chatbots.
|
||||
// Le parent le rend seulement s'il y a un historique et gère la purge.
|
||||
const emit = defineEmits<{ reset: [] }>()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chat-new-conversation {
|
||||
align-self: flex-end;
|
||||
flex-shrink: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 4px 6px;
|
||||
border-radius: 6px;
|
||||
font-size: 0.72rem;
|
||||
font-family: var(--nav-font);
|
||||
color: var(--nav-text-muted);
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.chat-new-conversation:hover { color: var(--nav-text); background: var(--nav-bg-alt); }
|
||||
.chat-new-conversation:focus-visible { outline: 2px solid var(--nav-primary); outline-offset: 2px; }
|
||||
</style>
|
||||
@@ -16,16 +16,6 @@
|
||||
<span v-else class="chatbot-corpus-badge">FRACAS</span>
|
||||
</div>
|
||||
<div class="chatbot-header-right">
|
||||
<button
|
||||
v-if="messages.length > 0"
|
||||
class="chatbot-clear-btn"
|
||||
title="Effacer la conversation"
|
||||
@click="clearMessages"
|
||||
>
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" aria-hidden="true">
|
||||
<polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"/><path d="M10 11v6"/><path d="M14 11v6"/>
|
||||
</svg>
|
||||
</button>
|
||||
<select v-model="corpusMode" class="chatbot-corpus-select" title="Corpus interrogé">
|
||||
<option value="pensees">Pensées éco.</option>
|
||||
<option value="both">Pensées + Projets</option>
|
||||
@@ -52,6 +42,7 @@
|
||||
<template v-for="(msg, i) in messages" :key="i">
|
||||
<div v-if="msg.role === 'user'" class="chatbot-bubble user">{{ msg.content }}</div>
|
||||
<div v-else class="chatbot-bubble assistant">
|
||||
<ChatModeBadge :profondeur="msg.profondeur" />
|
||||
<div class="chatbot-md" v-html="renderMd(msg.content)" />
|
||||
<div v-if="msg.auteur" class="chatbot-auteur-tag">
|
||||
<span>{{ msg.auteur.nom }}</span>
|
||||
@@ -59,13 +50,26 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Chargement -->
|
||||
<div v-if="loading" class="chatbot-bubble assistant loading">
|
||||
<!-- Chargement : texte d'attente progressif. L'annonce aux lecteurs d'écran passe par la région
|
||||
live persistante ci-dessous (une région insérée à chaud n'est pas fiablement annoncée). -->
|
||||
<div v-if="loading" class="chatbot-bubble assistant loading" aria-hidden="true">
|
||||
<span class="dot" /><span class="dot" /><span class="dot" />
|
||||
<span class="attente-texte">{{ attenteTexte }}</span>
|
||||
</div>
|
||||
<div class="sr-only" role="status" aria-live="polite" aria-atomic="true">{{ loading ? attenteTexte : '' }}</div>
|
||||
|
||||
<!-- Erreur -->
|
||||
<div v-if="errorMsg" class="chatbot-error">{{ errorMsg }}</div>
|
||||
<div v-if="errorMsg" class="chatbot-error" role="alert">
|
||||
<span>{{ errorMsg }}</span>
|
||||
<button v-if="peutReessayer" type="button" class="chatbot-retry-btn" @click="reessayer">Réessayer</button>
|
||||
</div>
|
||||
|
||||
<ChatNewConversation v-if="hasHistory && !loading" @reset="clearMessages" />
|
||||
</div>
|
||||
|
||||
<!-- Mode de réponse -->
|
||||
<div class="chatbot-mode-row">
|
||||
<ChatModeToggle v-model="profondeur" :disabled="loading" />
|
||||
</div>
|
||||
|
||||
<!-- Input -->
|
||||
@@ -102,6 +106,7 @@ interface ChatMessage {
|
||||
role: 'user' | 'assistant'
|
||||
content: string
|
||||
auteur?: { slug: string; nom: string } | null
|
||||
profondeur?: string
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -109,21 +114,78 @@ const props = defineProps<{
|
||||
inline?: boolean
|
||||
}>()
|
||||
|
||||
const messages = ref<ChatMessage[]>([])
|
||||
// Une conversation par contexte (corpus général ou un auteur) : changer d'auteur
|
||||
// ne mélange pas les historiques, et un rechargement restaure le bon.
|
||||
const sessionKey = computed(() => props.auteurContext ? `pensees-${slugify(props.auteurContext)}` : 'pensees')
|
||||
const { messages, hasHistory, clear } = useChatSession<ChatMessage>(sessionKey)
|
||||
// `profondeur` (et non `mode`, réservé au mode de recherche LightRAG côté serveur)
|
||||
const profondeur = useChatProfondeur('pensees')
|
||||
const inputText = ref('')
|
||||
const loading = ref(false)
|
||||
const errorMsg = ref('')
|
||||
const corpusMode = ref<'pensees' | 'projets' | 'both'>('pensees')
|
||||
const messagesContainer = ref<HTMLElement | null>(null)
|
||||
|
||||
watch(() => props.auteurContext, () => {
|
||||
messages.value = []
|
||||
// --- Attente et erreurs : état d'interface uniquement, jamais persisté (hors useChatSession) ---
|
||||
// Mesuré le 09/10 : récupération 2-5 s, génération 10-18 s, 19-29 s bout en bout. Les seuils suivent ces
|
||||
// phases ; le texte est une minuterie (le serveur renvoie tout d'un bloc : il faut la réponse complète
|
||||
// pour vérifier les citations, donc pas de flux de texte).
|
||||
const SEUIL_REDIGE_S = 6
|
||||
const SEUIL_LONG_S = 30
|
||||
// Au-delà du timeout serveur (90 s) : le front ne lâche jamais avant la route, et ne tourne jamais sans fin.
|
||||
const TIMEOUT_FRONT_MS = 95000
|
||||
|
||||
const attenteS = ref(0)
|
||||
const attenteTexte = computed(() => {
|
||||
if (attenteS.value >= SEUIL_LONG_S) return 'Le corpus est vaste, encore un instant…'
|
||||
if (attenteS.value >= SEUIL_REDIGE_S) return 'Je rédige…'
|
||||
return 'Je fouille le corpus…'
|
||||
})
|
||||
let attenteTimer: ReturnType<typeof setInterval> | null = null
|
||||
|
||||
function demarrerAttente() {
|
||||
arreterAttente()
|
||||
attenteS.value = 0
|
||||
const t0 = Date.now()
|
||||
attenteTimer = setInterval(() => { attenteS.value = Math.floor((Date.now() - t0) / 1000) }, 1000)
|
||||
}
|
||||
function arreterAttente() {
|
||||
if (attenteTimer) { clearInterval(attenteTimer); attenteTimer = null }
|
||||
}
|
||||
onBeforeUnmount(arreterAttente)
|
||||
|
||||
interface Envoi { query: string; profondeur: string; corpus: string; auteurSlug?: string }
|
||||
const dernierEnvoi = ref<Envoi | null>(null)
|
||||
const peutReessayer = ref(false)
|
||||
|
||||
watch(sessionKey, () => {
|
||||
errorMsg.value = ''
|
||||
peutReessayer.value = false
|
||||
dernierEnvoi.value = null
|
||||
})
|
||||
|
||||
function clearMessages() {
|
||||
messages.value = []
|
||||
clear()
|
||||
errorMsg.value = ''
|
||||
peutReessayer.value = false
|
||||
dernierEnvoi.value = null
|
||||
}
|
||||
|
||||
function messageErreur(e: any): { texte: string; reessayer: boolean } {
|
||||
const status = e?.statusCode ?? e?.status ?? e?.response?.status
|
||||
const detail = String(e?.data?.message ?? e?.statusMessage ?? e?.message ?? '')
|
||||
if (status === 429) {
|
||||
// 429 de la route : quota du jour (pas de réessai utile) ou RAG saturé (réessai possible)
|
||||
if (/satur/i.test(detail)) return { texte: 'Le corpus est très sollicité en ce moment. Patiente quelques secondes, puis réessaie.', reessayer: true }
|
||||
return { texte: 'Tu as atteint la limite de 20 questions par jour. Reviens demain, ou explore les fiches auteurs en attendant.', reessayer: false }
|
||||
}
|
||||
if (status === 503) return { texte: 'La bibliothèque est indisponible pour l\'instant. Réessaie dans quelques minutes.', reessayer: true }
|
||||
if (status === 504) return { texte: 'La bibliothèque met trop de temps à répondre : la question est peut-être trop large. Réessaie, ou reformule-la plus précisément.', reessayer: true }
|
||||
if (!status && /timeout|timed out|abort/i.test(`${detail} ${e?.name ?? ''} ${e?.cause?.name ?? ''}`)) {
|
||||
return { texte: 'Désolé, la réponse met plus de temps que prévu et n\'a pas abouti. Tu peux relancer la même question.', reessayer: true }
|
||||
}
|
||||
if (!status) return { texte: 'La connexion semble coupée : la question n\'est pas partie. Vérifie ton réseau puis réessaie.', reessayer: true }
|
||||
return { texte: 'Une erreur est survenue. Réessaie dans quelques instants.', reessayer: true }
|
||||
}
|
||||
|
||||
function scrollToBottom() {
|
||||
@@ -137,9 +199,27 @@ async function sendMessage() {
|
||||
if (!query || loading.value) return
|
||||
|
||||
inputText.value = ''
|
||||
errorMsg.value = ''
|
||||
messages.value.push({ role: 'user', content: query })
|
||||
await envoyer({
|
||||
query,
|
||||
profondeur: profondeur.value,
|
||||
corpus: corpusMode.value,
|
||||
auteurSlug: props.auteurContext ? slugify(props.auteurContext) : undefined,
|
||||
})
|
||||
}
|
||||
|
||||
// Reposte la même question (même mode, même corpus) sans dupliquer le message de l'usager.
|
||||
async function reessayer() {
|
||||
if (!dernierEnvoi.value || loading.value) return
|
||||
await envoyer(dernierEnvoi.value)
|
||||
}
|
||||
|
||||
async function envoyer(envoi: Envoi) {
|
||||
errorMsg.value = ''
|
||||
peutReessayer.value = false
|
||||
dernierEnvoi.value = envoi
|
||||
loading.value = true
|
||||
demarrerAttente()
|
||||
|
||||
await nextTick()
|
||||
scrollToBottom()
|
||||
@@ -150,29 +230,27 @@ async function sendMessage() {
|
||||
auteur: { slug: string; nom: string } | null
|
||||
}>('/api/chatbot-pensees', {
|
||||
method: 'POST',
|
||||
timeout: TIMEOUT_FRONT_MS,
|
||||
body: {
|
||||
query,
|
||||
corpus: corpusMode.value,
|
||||
auteur_slug: props.auteurContext ? slugify(props.auteurContext) : undefined,
|
||||
query: envoi.query,
|
||||
corpus: envoi.corpus,
|
||||
profondeur: envoi.profondeur,
|
||||
auteur_slug: envoi.auteurSlug,
|
||||
},
|
||||
})
|
||||
messages.value.push({
|
||||
role: 'assistant',
|
||||
content: res.response,
|
||||
auteur: res.auteur ?? null,
|
||||
profondeur: envoi.profondeur,
|
||||
})
|
||||
dernierEnvoi.value = null
|
||||
} catch (e: any) {
|
||||
const status = e?.statusCode ?? e?.status
|
||||
if (status === 429) {
|
||||
errorMsg.value = 'Limite de 20 questions par jour atteinte.'
|
||||
} else if (status === 503) {
|
||||
errorMsg.value = 'Le RAG est indisponible pour l\'instant — réessaie dans quelques minutes.'
|
||||
} else if (status === 504) {
|
||||
errorMsg.value = 'Le RAG met du temps à répondre — réessaie dans quelques secondes.'
|
||||
} else {
|
||||
errorMsg.value = 'Une erreur est survenue. Réessaie dans quelques instants.'
|
||||
}
|
||||
const { texte, reessayer: ok } = messageErreur(e)
|
||||
errorMsg.value = texte
|
||||
peutReessayer.value = ok
|
||||
} finally {
|
||||
arreterAttente()
|
||||
loading.value = false
|
||||
await nextTick()
|
||||
scrollToBottom()
|
||||
@@ -361,6 +439,25 @@ function slugify(str: string): string {
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.attente-texte {
|
||||
margin-left: 6px;
|
||||
font-size: 0.775rem;
|
||||
color: var(--nav-text-muted);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
@@ -377,6 +474,11 @@ function slugify(str: string): string {
|
||||
40% { opacity: 1; }
|
||||
}
|
||||
|
||||
/* Pas d'animation si l'usager la réduit : points fixes, le texte d'attente porte l'information */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.dot { animation: none; opacity: 0.6; }
|
||||
}
|
||||
|
||||
/* Erreur */
|
||||
.chatbot-error {
|
||||
align-self: flex-start;
|
||||
@@ -386,8 +488,36 @@ function slugify(str: string): string {
|
||||
border-radius: 8px;
|
||||
padding: 7px 10px;
|
||||
max-width: 90%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.chatbot-retry-btn {
|
||||
font: inherit;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--nav-text-on-primary);
|
||||
background: var(--nav-primary);
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
padding: 4px 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.chatbot-retry-btn:hover { opacity: 0.85; }
|
||||
.chatbot-retry-btn:focus-visible { outline: 2px solid var(--nav-primary); outline-offset: 2px; }
|
||||
|
||||
/* Mode de réponse */
|
||||
.chatbot-mode-row {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
padding: 6px 10px 0;
|
||||
border-top: 1px solid rgba(180, 170, 160, 0.22);
|
||||
background: var(--nav-surface);
|
||||
}
|
||||
.chatbot-mode-row + .chatbot-input-row { border-top: none; }
|
||||
|
||||
/* Input */
|
||||
.chatbot-input-row {
|
||||
flex-shrink: 0;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
role="button"
|
||||
tabindex="0"
|
||||
:aria-expanded="isExpanded"
|
||||
aria-label="Ouvrir l'assistant chatbot"
|
||||
:aria-label="`Ouvrir l'assistant : ${titre}`"
|
||||
@keydown.enter="toggleExpand"
|
||||
@keydown.space.prevent="toggleExpand"
|
||||
>
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
|
||||
<span class="flex-1 text-sm" style="color: var(--nav-text-muted);">
|
||||
{{ isExpanded ? 'Chatbot AEP' : 'Pose une question sur le réseau…' }}
|
||||
{{ isExpanded ? titre : placeholderReplie }}
|
||||
</span>
|
||||
|
||||
<!-- Chevron -->
|
||||
@@ -52,21 +52,23 @@
|
||||
<div class="chatbot-body-inner" ref="messagesContainer">
|
||||
<!-- Onboarding -->
|
||||
<div v-if="messages.length === 0" class="onboarding-bubble">
|
||||
<p>Explore les 120 structures de la carte par la conversation. Je peux t'aider à trouver des collectifs, agences ou réseaux selon ta situation, ta pratique ou tes inspirations du moment.</p>
|
||||
<p class="example">Exemple : "Je cherche des acteurs de la rénovation de maisons individuelles en France, plutôt en milieu rural, avec des approches biosourcées ou low-tech."</p>
|
||||
<p>{{ intro }}</p>
|
||||
<p v-if="exemple" class="example">{{ exemple }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Messages -->
|
||||
<template v-for="(msg, i) in messages" :key="i">
|
||||
<div v-if="msg.role === 'user'" class="user-bubble">{{ msg.content }}</div>
|
||||
<div v-else class="assistant-bubble">
|
||||
<p>{{ msg.content }}</p>
|
||||
<ChatModeBadge :profondeur="msg.profondeur" />
|
||||
<div v-if="rendreMarkdown" v-html="renderMd(msg.content)" />
|
||||
<p v-else>{{ msg.content }}</p>
|
||||
<div v-if="msg.fiches && msg.fiches.length > 0" class="fiches-list">
|
||||
<p class="fiches-title">Fiches recommandees :</p>
|
||||
<p class="fiches-title">{{ fichesTitre }}</p>
|
||||
<a
|
||||
v-for="fiche in msg.fiches"
|
||||
:key="fiche.id"
|
||||
:href="`/fiche/${fiche.id}`"
|
||||
:href="ficheLienModele.replace('{id}', String(fiche.id))"
|
||||
class="fiche-card"
|
||||
>
|
||||
<span class="fiche-nom">{{ fiche.nom }}</span>
|
||||
@@ -98,15 +100,22 @@
|
||||
|
||||
<!-- Erreur -->
|
||||
<div v-if="errorMsg" class="error-bubble">{{ errorMsg }}</div>
|
||||
|
||||
<ChatNewConversation v-if="hasHistory && !loading" @reset="nouvelleConversation" />
|
||||
</div>
|
||||
|
||||
<!-- Mode de réponse -->
|
||||
<div class="chatbot-mode-row" style="border-top: 1px solid var(--nav-bg-alt);">
|
||||
<ChatModeToggle v-model="profondeur" :disabled="loading" />
|
||||
</div>
|
||||
|
||||
<!-- Input -->
|
||||
<div class="chatbot-input-row" style="border-top: 1px solid var(--nav-bg-alt);">
|
||||
<div class="chatbot-input-row">
|
||||
<input
|
||||
v-model="inputText"
|
||||
type="text"
|
||||
:disabled="loading"
|
||||
placeholder="Pose ta question…"
|
||||
:placeholder="placeholderSaisie"
|
||||
class="chatbot-input"
|
||||
@keydown.enter.prevent="sendMessage"
|
||||
/>
|
||||
@@ -127,6 +136,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useMarkdown } from '~/composables/useMarkdown'
|
||||
const { render: renderMd } = useMarkdown()
|
||||
|
||||
interface FicheReco {
|
||||
id: number | string
|
||||
nom: string
|
||||
@@ -138,15 +150,58 @@ interface ChatMessage {
|
||||
content: string
|
||||
fiches?: FicheReco[]
|
||||
suggestedHashtags?: string[]
|
||||
profondeur?: string
|
||||
}
|
||||
|
||||
// Composant unique pour les deux chatbots desktop. Les défauts reproduisent
|
||||
// exactement le comportement de l'accueil (/api/chatbot, backend Entraide).
|
||||
// Les deux backends renvoient { reponse_texte, fiches_recommandees } ; seul
|
||||
// le rendu diffère (texte brut vs markdown, lien de fiche).
|
||||
const props = withDefaults(defineProps<{
|
||||
/** Route serveur appelée (body { question }) */
|
||||
endpoint?: string
|
||||
/** Titre affiché dans l'en-tête déplié */
|
||||
titre?: string
|
||||
/** Texte de l'en-tête replié */
|
||||
placeholderReplie?: string
|
||||
/** Placeholder du champ de saisie */
|
||||
placeholderSaisie?: string
|
||||
/** Texte d'accueil (première bulle) */
|
||||
intro?: string
|
||||
/** Exemple de question, affiché sous l'accueil */
|
||||
exemple?: string
|
||||
/** Intitulé de la liste de fiches/structures citées */
|
||||
fichesTitre?: string
|
||||
/** Modèle de lien vers une fiche, {id} est remplacé */
|
||||
ficheLienModele?: string
|
||||
/** Rendre la réponse en markdown (backend réseaux) plutôt qu'en texte brut */
|
||||
rendreMarkdown?: boolean
|
||||
/** Message affiché quand la limite quotidienne (429) est atteinte */
|
||||
messageLimite?: string
|
||||
/** Clé de persistance (sessionStorage). Même clé = même conversation (ex. mobile + desktop) */
|
||||
chatKey?: string
|
||||
}>(), {
|
||||
chatKey: 'accueil',
|
||||
endpoint: '/api/chatbot',
|
||||
titre: 'Chatbot AEP',
|
||||
placeholderReplie: 'Pose une question sur le réseau…',
|
||||
placeholderSaisie: 'Pose ta question…',
|
||||
intro: "Explore les 120 structures de la carte par la conversation. Je peux t'aider à trouver des collectifs, agences ou réseaux selon ta situation, ta pratique ou tes inspirations du moment.",
|
||||
exemple: 'Exemple : "Je cherche des acteurs de la rénovation de maisons individuelles en France, plutôt en milieu rural, avec des approches biosourcées ou low-tech."',
|
||||
fichesTitre: 'Fiches recommandees :',
|
||||
ficheLienModele: '/fiche/{id}',
|
||||
rendreMarkdown: false,
|
||||
messageLimite: 'Limite de 10 questions par jour atteinte. Reviens demain.',
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
'highlightOrgs': [ids: (number | string)[]]
|
||||
'applyHashtag': [tag: string]
|
||||
}>()
|
||||
|
||||
const isExpanded = ref(false)
|
||||
const messages = ref<ChatMessage[]>([])
|
||||
const { messages, hasHistory, clear } = useChatSession<ChatMessage>(() => props.chatKey)
|
||||
const profondeur = useChatProfondeur(() => props.chatKey)
|
||||
const inputText = ref('')
|
||||
const loading = ref(false)
|
||||
const errorMsg = ref('')
|
||||
@@ -183,6 +238,11 @@ function detectHashtagsFromQuery(query: string): string[] {
|
||||
return detected.slice(0, 3)
|
||||
}
|
||||
|
||||
function nouvelleConversation() {
|
||||
clear()
|
||||
errorMsg.value = ''
|
||||
}
|
||||
|
||||
function toggleExpand() {
|
||||
isExpanded.value = !isExpanded.value
|
||||
}
|
||||
@@ -195,6 +255,7 @@ async function sendMessage() {
|
||||
errorMsg.value = ''
|
||||
messages.value.push({ role: 'user', content: question })
|
||||
loading.value = true
|
||||
const mode = profondeur.value
|
||||
|
||||
await nextTick()
|
||||
scrollToBottom()
|
||||
@@ -203,9 +264,9 @@ async function sendMessage() {
|
||||
const res = await $fetch<{
|
||||
reponse_texte: string
|
||||
fiches_recommandees: { id: number | string; nom: string; explication: string }[]
|
||||
}>('/api/chatbot', {
|
||||
}>(props.endpoint, {
|
||||
method: 'POST',
|
||||
body: { question },
|
||||
body: { question, profondeur: mode },
|
||||
})
|
||||
|
||||
const suggestedHashtags = detectHashtagsFromQuery(question)
|
||||
@@ -214,6 +275,7 @@ async function sendMessage() {
|
||||
content: res.reponse_texte,
|
||||
fiches: res.fiches_recommandees || [],
|
||||
suggestedHashtags: suggestedHashtags.length ? suggestedHashtags : undefined,
|
||||
profondeur: mode,
|
||||
}
|
||||
messages.value.push(assistantMsg)
|
||||
|
||||
@@ -223,7 +285,7 @@ async function sendMessage() {
|
||||
} catch (e: any) {
|
||||
const status = e?.statusCode ?? e?.status
|
||||
if (status === 429) {
|
||||
errorMsg.value = 'Limite de 10 questions par jour atteinte. Reviens demain.'
|
||||
errorMsg.value = props.messageLimite
|
||||
} else if (status === 503) {
|
||||
errorMsg.value = 'Le budget IA mensuel est épuisé. Soutiens NAV sur Liberapay pour continuer.'
|
||||
} else {
|
||||
@@ -305,6 +367,11 @@ function scrollToBottom() {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.chatbot-mode-row {
|
||||
display: flex;
|
||||
padding: 8px 12px 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.chatbot-input-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
<template v-for="(msg, i) in messages" :key="i">
|
||||
<div v-if="msg.role === 'user'" class="user-bubble">{{ msg.content }}</div>
|
||||
<div v-else class="assistant-bubble">
|
||||
<ChatModeBadge :profondeur="msg.profondeur" />
|
||||
<div v-html="renderMd(msg.content)" />
|
||||
<div v-if="msg.fiches && msg.fiches.length > 0" class="fiches-list" style="margin-top:12px;">
|
||||
<p class="fiches-title">Structures recommandées :</p>
|
||||
@@ -74,9 +75,11 @@
|
||||
<span class="dot" /><span class="dot" /><span class="dot" />
|
||||
</div>
|
||||
<div v-if="errorMsg" class="error-bubble">{{ errorMsg }}</div>
|
||||
<ChatNewConversation v-if="hasHistory && !loading" @reset="nouvelleConversation" />
|
||||
</div>
|
||||
|
||||
<div class="shrink-0 px-4 pt-3 border-t" style="border-color: var(--nav-bg-alt); padding-bottom: max(1rem, env(safe-area-inset-bottom));">
|
||||
<ChatModeToggle v-model="profondeur" :disabled="loading" class="mb-2" />
|
||||
<div class="flex items-center gap-2">
|
||||
<input
|
||||
v-model="inputText"
|
||||
@@ -112,12 +115,13 @@ import { useMarkdown } from '~/composables/useMarkdown'
|
||||
const { render: renderMd } = useMarkdown()
|
||||
|
||||
interface FicheReco { id: number | string; nom: string; explication?: string }
|
||||
interface ChatMessage { role: 'user' | 'assistant'; content: string; fiches?: FicheReco[] }
|
||||
interface ChatMessage { role: 'user' | 'assistant'; content: string; fiches?: FicheReco[]; profondeur?: string }
|
||||
|
||||
const props = defineProps<{ modelValue: boolean }>()
|
||||
const emit = defineEmits<{ 'update:modelValue': [value: boolean] }>()
|
||||
|
||||
const messages = ref<ChatMessage[]>([])
|
||||
const { messages, hasHistory, clear } = useChatSession<ChatMessage>('agences')
|
||||
const profondeur = useChatProfondeur('agences')
|
||||
const inputText = ref('')
|
||||
const loading = ref(false)
|
||||
const errorMsg = ref('')
|
||||
@@ -136,6 +140,11 @@ onUnmounted(() => {
|
||||
}
|
||||
})
|
||||
|
||||
function nouvelleConversation() {
|
||||
clear()
|
||||
errorMsg.value = ''
|
||||
}
|
||||
|
||||
async function sendMessage() {
|
||||
const question = inputText.value.trim()
|
||||
if (!question || loading.value) return
|
||||
@@ -147,11 +156,12 @@ async function sendMessage() {
|
||||
if (messagesContainer.value) messagesContainer.value.scrollTop = messagesContainer.value.scrollHeight
|
||||
|
||||
try {
|
||||
const mode = profondeur.value
|
||||
const res = await $fetch<{ reponse_texte: string; fiches_recommandees: FicheReco[] }>(
|
||||
'/api/chatbot-reseaux',
|
||||
{ method: 'POST', body: { question } }
|
||||
{ method: 'POST', body: { question, profondeur: mode } }
|
||||
)
|
||||
messages.value.push({ role: 'assistant', content: res.reponse_texte, fiches: res.fiches_recommandees || [] })
|
||||
messages.value.push({ role: 'assistant', content: res.reponse_texte, fiches: res.fiches_recommandees || [], profondeur: mode })
|
||||
} catch (e: any) {
|
||||
const s = e?.statusCode ?? e?.status
|
||||
errorMsg.value = s === 429
|
||||
@@ -196,6 +206,8 @@ async function sendMessage() {
|
||||
.dot:nth-child(2) { animation-delay: 0.2s; }
|
||||
.dot:nth-child(3) { animation-delay: 0.4s; }
|
||||
@keyframes blink { 0%,80%,100% { opacity: 0.3; } 40% { opacity: 1; } }
|
||||
/* Pas d'animation si l'usager la réduit : points fixes (B1, exigence du brief ; posé au checkpoint du 22/10) */
|
||||
@media (prefers-reduced-motion: reduce) { .dot { animation: none; opacity: 0.6; } }
|
||||
|
||||
.error-bubble { align-self: flex-start; max-width: 90%; color: #a85d3e; font-size: 0.8rem; padding: 8px 12px; border-radius: 8px; background: rgba(168,93,62,0.08); }
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
|
||||
<!-- Message assistant -->
|
||||
<div v-else class="assistant-bubble">
|
||||
<ChatModeBadge :profondeur="msg.profondeur" />
|
||||
<div class="md-content" v-html="renderMd(msg.content)" />
|
||||
|
||||
<!-- Fiches recommandées -->
|
||||
@@ -114,6 +115,8 @@
|
||||
<div v-if="errorMsg" class="error-bubble">
|
||||
{{ errorMsg }}
|
||||
</div>
|
||||
|
||||
<ChatNewConversation v-if="hasHistory && !loading" @reset="nouvelleConversation" />
|
||||
</div>
|
||||
|
||||
<!-- Input -->
|
||||
@@ -121,6 +124,7 @@
|
||||
class="shrink-0 px-4 pt-3 border-t"
|
||||
style="border-color: var(--nav-bg-alt); padding-bottom: max(1rem, env(safe-area-inset-bottom));"
|
||||
>
|
||||
<ChatModeToggle v-model="profondeur" :disabled="loading" class="mb-2" />
|
||||
<div class="flex items-center gap-2">
|
||||
<input
|
||||
v-model="inputText"
|
||||
@@ -172,6 +176,7 @@ interface ChatMessage {
|
||||
role: 'user' | 'assistant'
|
||||
content: string
|
||||
fiches?: FicheReco[]
|
||||
profondeur?: string
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -183,7 +188,8 @@ const emit = defineEmits<{
|
||||
'highlightOrgs': [ids: (number | string)[]]
|
||||
}>()
|
||||
|
||||
const messages = ref<ChatMessage[]>([])
|
||||
const { messages, hasHistory, clear } = useChatSession<ChatMessage>('accueil')
|
||||
const profondeur = useChatProfondeur('accueil')
|
||||
const inputText = ref('')
|
||||
const loading = ref(false)
|
||||
const errorMsg = ref('')
|
||||
@@ -207,6 +213,11 @@ onUnmounted(() => {
|
||||
}
|
||||
})
|
||||
|
||||
function nouvelleConversation() {
|
||||
clear()
|
||||
errorMsg.value = ''
|
||||
}
|
||||
|
||||
async function sendMessage() {
|
||||
const question = inputText.value.trim()
|
||||
if (!question || loading.value) return
|
||||
@@ -215,6 +226,7 @@ async function sendMessage() {
|
||||
errorMsg.value = ''
|
||||
messages.value.push({ role: 'user', content: question })
|
||||
loading.value = true
|
||||
const mode = profondeur.value
|
||||
|
||||
await nextTick()
|
||||
scrollToBottom()
|
||||
@@ -225,13 +237,14 @@ async function sendMessage() {
|
||||
fiches_recommandees: { id: number | string; nom: string; explication: string }[]
|
||||
}>('/api/chatbot', {
|
||||
method: 'POST',
|
||||
body: { question },
|
||||
body: { question, profondeur: mode },
|
||||
})
|
||||
|
||||
const assistantMsg: ChatMessage = {
|
||||
role: 'assistant',
|
||||
content: res.reponse_texte,
|
||||
fiches: res.fiches_recommandees || [],
|
||||
profondeur: mode,
|
||||
}
|
||||
messages.value.push(assistantMsg)
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<template>
|
||||
<div class="space-y-1.5">
|
||||
<p class="text-xs font-bold uppercase tracking-widest" style="color: var(--nav-text-muted);">Échelle</p>
|
||||
<ChipGroup aria-label="Filtrer par échelle">
|
||||
<Chip
|
||||
v-for="option in ECHELLES"
|
||||
:key="option"
|
||||
:label="option"
|
||||
variant="echelle"
|
||||
:active="isSelected(option)"
|
||||
@toggle="toggle(option)"
|
||||
/>
|
||||
</ChipGroup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const ECHELLES = ['National', 'Régional', 'Local'] as const
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: string[]
|
||||
counts: Record<string, number>
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: string[]]
|
||||
}>()
|
||||
|
||||
function isSelected(option: string): boolean {
|
||||
return props.modelValue.includes(option)
|
||||
}
|
||||
|
||||
function toggle(option: string) {
|
||||
if (isSelected(option)) {
|
||||
emit('update:modelValue', props.modelValue.filter(v => v !== option))
|
||||
} else {
|
||||
emit('update:modelValue', [...props.modelValue, option])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,9 +1,14 @@
|
||||
<template>
|
||||
<section class="echelle-tete" :class="{ 'echelle-tete--compact': compact }" :aria-label="`Échelle ${e.id} : ${e.titre}`">
|
||||
<p class="echelle-tete__kicker">
|
||||
<component
|
||||
:is="titreNiveau ?? 'p'"
|
||||
:id="titreId"
|
||||
:tabindex="titreNiveau ? -1 : undefined"
|
||||
class="echelle-tete__kicker"
|
||||
>
|
||||
<span class="echelle-tete__badge" aria-hidden="true">{{ e.id }}</span>
|
||||
<span class="echelle-tete__titre">{{ e.titre }}<span v-if="e.sousTitre" class="echelle-tete__sous-titre">{{ ' ' + e.sousTitre }}</span></span>
|
||||
</p>
|
||||
</component>
|
||||
<ul class="echelle-tete__mots">
|
||||
<li v-for="m in e.mots" :key="m">{{ m }}</li>
|
||||
</ul>
|
||||
@@ -25,7 +30,14 @@ const props = withDefaults(defineProps<{
|
||||
compact?: boolean
|
||||
/** Affiche la ligne « on pose l'infrastructure, le collectif nourrit ». */
|
||||
contribuer?: boolean
|
||||
}>(), { compact: false, contribuer: true })
|
||||
/**
|
||||
* Titre en vrai titre de section (B13 : la porte ouverte de l'entrée), focalisable
|
||||
* par programme (tabindex -1) ; sans lui, un paragraphe, comme avant.
|
||||
*/
|
||||
titreNiveau?: 'h2' | 'h3'
|
||||
/** id du titre, pour `aria-labelledby` et le focus. */
|
||||
titreId?: string
|
||||
}>(), { compact: false, contribuer: true, titreNiveau: undefined, titreId: undefined })
|
||||
|
||||
defineEmits<{ navigate: [] }>()
|
||||
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
style="background: var(--nav-surface); border: 1px solid var(--nav-bg-alt);"
|
||||
>
|
||||
<!-- Bandeau titre -->
|
||||
<div class="px-6 pt-6 pb-4" style="border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<div class="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 mb-3">
|
||||
<h1
|
||||
class="text-2xl font-bold leading-snug"
|
||||
<div :class="compact ? 'px-4 pt-4 pb-3' : 'px-6 pt-6 pb-4'" style="border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<div class="flex flex-col gap-3 mb-3" :class="compact ? '' : 'sm:flex-row sm:items-start sm:justify-between'">
|
||||
<component
|
||||
:is="compact ? 'h2' : 'h1'"
|
||||
class="font-bold leading-snug"
|
||||
:class="compact ? 'text-xl' : 'text-2xl'"
|
||||
style="color: var(--nav-text);"
|
||||
>{{ org.nom }}</h1>
|
||||
>{{ org.nom }}</component>
|
||||
|
||||
<a
|
||||
v-if="org.url"
|
||||
@@ -33,18 +35,28 @@
|
||||
</div>
|
||||
|
||||
<!-- Méta : échelle + ville -->
|
||||
<div class="flex flex-wrap items-center gap-2 text-sm mb-3" style="color: var(--nav-text-muted);">
|
||||
<div class="flex flex-wrap items-center gap-2 text-sm mb-3" style="color: color-mix(in srgb, var(--nav-text) 78%, transparent);">
|
||||
<span
|
||||
v-if="org.echelle"
|
||||
class="px-2 py-0.5 rounded-full text-xs font-medium"
|
||||
style="background: var(--nav-primary); color: var(--nav-text-on-primary);"
|
||||
style="background: var(--nav-primary-solid); color: var(--nav-text-on-primary);"
|
||||
>{{ org.echelle }}</span>
|
||||
<span v-if="org.territoire && org.territoire !== 'Métropole'" class="text-xs" style="color: var(--nav-text-muted);">{{ org.territoire }}</span>
|
||||
<span v-if="org.localisation_ville" style="color: var(--nav-text-muted);">{{ org.localisation_ville }}</span>
|
||||
<span v-if="org.territoire && org.territoire !== 'Métropole'" class="text-xs" style="color: color-mix(in srgb, var(--nav-text) 78%, transparent);">{{ org.territoire }}</span>
|
||||
<span v-if="org.localisation_ville" style="color: color-mix(in srgb, var(--nav-text) 78%, transparent);">{{ org.localisation_ville }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Tags fonction -->
|
||||
<div v-if="fonctionTags.length" class="flex flex-wrap gap-1.5">
|
||||
<ChipGroup v-if="fonctionTags.length && etiquettesCliquables" :aria-label="`Fonctions de ${org.nom}`">
|
||||
<Chip
|
||||
v-for="tag in fonctionTags"
|
||||
:key="tag"
|
||||
variant="fonction"
|
||||
:label="tag"
|
||||
:aria-label="`Filtrer par ${tag}`"
|
||||
@toggle="emit('etiquette', tag)"
|
||||
/>
|
||||
</ChipGroup>
|
||||
<div v-else-if="fonctionTags.length" class="flex flex-wrap gap-1.5">
|
||||
<span
|
||||
v-for="tag in fonctionTags"
|
||||
:key="tag"
|
||||
@@ -55,13 +67,13 @@
|
||||
</div>
|
||||
|
||||
<!-- Corps : description + mini-carte -->
|
||||
<div class="p-6 flex flex-col lg:flex-row gap-6">
|
||||
<div class="flex flex-col gap-6" :class="compact ? 'p-4' : 'p-6 lg:flex-row'">
|
||||
|
||||
<!-- Descriptions -->
|
||||
<div class="flex-1 min-w-0">
|
||||
<!-- Description soumise par le contributeur -->
|
||||
<div v-if="descriptionUser" class="mb-4">
|
||||
<p class="text-sm leading-relaxed" style="color: var(--nav-text-muted);">Description communauté</p>
|
||||
<p class="text-sm leading-relaxed" style="color: color-mix(in srgb, var(--nav-text) 78%, transparent);">Description communauté</p>
|
||||
<p class="mt-1 leading-relaxed" style="color: var(--nav-text);">{{ descriptionUser }}</p>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +82,7 @@
|
||||
|
||||
<!-- Description enrichie IA -->
|
||||
<div v-if="descriptionEnrichie" class="mb-4">
|
||||
<p class="text-sm leading-relaxed flex items-center gap-1.5" style="color: var(--nav-text-muted);">
|
||||
<p class="text-sm leading-relaxed flex items-center gap-1.5" style="color: color-mix(in srgb, var(--nav-text) 78%, transparent);">
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
|
||||
<path d="M12 2L2 7l10 5 10-5-10-5z"/>
|
||||
<path d="M2 17l10 5 10-5"/>
|
||||
@@ -88,7 +100,7 @@
|
||||
|
||||
<!-- Points clés -->
|
||||
<div v-if="pointsCles.length" class="mt-4">
|
||||
<p class="text-sm font-medium mb-2" style="color: var(--nav-text-muted);">Points clés</p>
|
||||
<p class="text-sm font-medium mb-2" style="color: color-mix(in srgb, var(--nav-text) 78%, transparent);">Points clés</p>
|
||||
<ul class="space-y-1">
|
||||
<li
|
||||
v-for="(point, i) in pointsCles"
|
||||
@@ -106,15 +118,16 @@
|
||||
<!-- Mini-carte Leaflet -->
|
||||
<div
|
||||
v-if="hasCoords"
|
||||
class="shrink-0 lg:w-56 xl:w-64 rounded-xl overflow-hidden"
|
||||
class="shrink-0 rounded-xl overflow-hidden"
|
||||
:class="compact ? '' : 'lg:w-56 xl:w-64'"
|
||||
style="height: 180px; border: 1px solid var(--nav-bg-alt);"
|
||||
>
|
||||
<ClientOnly>
|
||||
<div ref="mapContainer" class="w-full h-full"></div>
|
||||
<div ref="mapContainer" class="w-full h-full" role="img" :aria-label="`Carte : ${org.nom}${org.localisation_ville ? `, ${org.localisation_ville}` : ''}`"></div>
|
||||
<template #fallback>
|
||||
<div
|
||||
class="w-full h-full flex items-center justify-center text-xs"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted);"
|
||||
style="background: var(--nav-bg-alt); color: color-mix(in srgb, var(--nav-text) 78%, transparent);"
|
||||
>Carte…</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
@@ -140,7 +153,7 @@
|
||||
|
||||
<Transition name="report-form">
|
||||
<div v-if="reportOpen" class="report-panel">
|
||||
<p class="text-xs mb-3" style="color: var(--nav-text-muted);">
|
||||
<p class="text-xs mb-3" style="color: color-mix(in srgb, var(--nav-text) 78%, transparent);">
|
||||
Tes suggestions seront transmises à l'équipe AEP par email.
|
||||
</p>
|
||||
<div class="flex flex-col gap-3">
|
||||
@@ -171,7 +184,7 @@
|
||||
</div>
|
||||
<p v-if="reportError" class="text-xs" style="color: #e53e3e;">{{ reportError }}</p>
|
||||
<p v-if="reportSuccess" class="text-xs" style="color: #38a169;">{{ reportSuccess }}</p>
|
||||
<p class="text-xs" style="color: var(--nav-text-muted); opacity: 0.6;">
|
||||
<p class="text-xs" style="color: color-mix(in srgb, var(--nav-text) 78%, transparent); opacity: 0.6;">
|
||||
{{ reportMessage.length }}/500
|
||||
</p>
|
||||
</div>
|
||||
@@ -186,7 +199,15 @@
|
||||
const baseTiles = useBaseTiles()
|
||||
import type { Org } from '~/types/org'
|
||||
|
||||
const props = defineProps<{ org: Org }>()
|
||||
const props = defineProps<{
|
||||
org: Org
|
||||
/** Panneau de détail de la vue fiches (B12, 380 px) : tout en colonne, titre en h2. */
|
||||
compact?: boolean
|
||||
/** Fonctions en chips cliquables : la vue fiches ajoute le filtre. */
|
||||
etiquettesCliquables?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{ etiquette: [fonction: string] }>()
|
||||
|
||||
// ── Champs ──────────────────────────────────────────────────────────────
|
||||
const descriptionUser = computed(() =>
|
||||
@@ -264,15 +285,24 @@ async function submitReport() {
|
||||
// ── Mini-carte Leaflet ────────────────────────────────────────────────
|
||||
const mapContainer = ref<HTMLElement | null>(null)
|
||||
|
||||
onMounted(async () => {
|
||||
if (!hasCoords.value || !mapContainer.value) return
|
||||
// Le conteneur est dans <ClientOnly>, rendu APRÈS le onMounted de ce composant
|
||||
// quand la fiche s'ouvre côté client (panneau de la vue fiches, B12) : on
|
||||
// attend qu'il existe au lieu de le lire au montage (il valait null, la
|
||||
// mini-carte restait un cadre vide).
|
||||
let mapInit = false
|
||||
watch(mapContainer, (el) => { if (el) initMap(el) }, { flush: 'post' })
|
||||
onMounted(() => { if (mapContainer.value) initMap(mapContainer.value) })
|
||||
|
||||
async function initMap(el: HTMLElement) {
|
||||
if (mapInit || !hasCoords.value) return
|
||||
mapInit = true
|
||||
|
||||
const L = (await import('leaflet')).default
|
||||
|
||||
const lat = props.org.latitude as number
|
||||
const lng = props.org.longitude as number
|
||||
|
||||
const map = L.map(mapContainer.value, {
|
||||
const map = L.map(el, {
|
||||
center: [lat, lng],
|
||||
zoom: 10,
|
||||
zoomControl: false,
|
||||
@@ -301,8 +331,9 @@ onMounted(async () => {
|
||||
iconAnchor: [7, 7],
|
||||
})
|
||||
|
||||
L.marker([lat, lng], { icon }).addTo(map)
|
||||
})
|
||||
// Épingle décorative : ni clic ni clavier (la mini-carte est une image, nommée par son conteneur)
|
||||
L.marker([lat, lng], { icon, interactive: false, keyboard: false }).addTo(map)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -312,7 +343,7 @@ onMounted(async () => {
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 0.78rem;
|
||||
color: var(--nav-text-muted);
|
||||
color: color-mix(in srgb, var(--nav-text) 78%, transparent);
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
<!--
|
||||
FicheMiniCard — B3-M2, B11-M2
|
||||
La carte entière ouvre la fiche (bouton étiré par ::after) ; avec
|
||||
`etiquettesCliquables`, les chips deviennent des boutons qui émettent
|
||||
`etiquette` (la vue fiches ajoute le filtre). Un bouton ne pouvant pas en
|
||||
contenir d'autres, la racine est un <article>, plus un <button> : apparence
|
||||
inchangée, page /dev/fiche-mini-card comprise.
|
||||
-->
|
||||
<template>
|
||||
<button
|
||||
type="button"
|
||||
class="fiche-mini-card"
|
||||
:aria-label="fiche.nom"
|
||||
@click="emit('open')"
|
||||
>
|
||||
<span class="fiche-mini-card__nom">{{ fiche.nom }}</span>
|
||||
<span v-if="fiche.resume" class="fiche-mini-card__resume">{{ fiche.resume }}</span>
|
||||
<article class="fiche-mini-card" :class="{ 'fiche-mini-card--actif': actif }">
|
||||
<button
|
||||
type="button"
|
||||
class="fiche-mini-card__ouvrir"
|
||||
@click="emit('open')"
|
||||
>
|
||||
<span class="fiche-mini-card__nom">{{ fiche.nom }}</span>
|
||||
<span v-if="fiche.resume" class="fiche-mini-card__resume">{{ fiche.resume }}</span>
|
||||
</button>
|
||||
|
||||
<ChipGroup
|
||||
v-if="fiche.chips.length || fiche.echelle"
|
||||
@@ -14,11 +23,24 @@
|
||||
class="fiche-mini-card__chips"
|
||||
>
|
||||
<Chip v-if="fiche.echelle" as="span" variant="echelle" :label="fiche.echelle" />
|
||||
<Chip v-for="chip in fiche.chips" :key="chip" as="span" variant="fonction" :label="chip" />
|
||||
<template v-if="etiquettesCliquables">
|
||||
<Chip
|
||||
v-for="chip in fiche.chips"
|
||||
:key="chip"
|
||||
variant="fonction"
|
||||
:label="chip"
|
||||
:active="etiquettesActives?.includes(chip)"
|
||||
:aria-label="`Filtrer par ${chip}`"
|
||||
@toggle="emit('etiquette', chip)"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<Chip v-for="chip in fiche.chips" :key="chip" as="span" variant="fonction" :label="chip" />
|
||||
</template>
|
||||
</ChipGroup>
|
||||
|
||||
<span v-if="!fiche.geoloc" class="fiche-mini-card__no-geo">Sans localisation</span>
|
||||
</button>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -26,30 +48,37 @@ import type { MiniFiche } from '~/composables/useFicheAdapter'
|
||||
|
||||
defineProps<{
|
||||
fiche: MiniFiche
|
||||
etiquettesCliquables?: boolean
|
||||
/** Libellés de chips déjà filtrés (affichés pressés). */
|
||||
etiquettesActives?: string[]
|
||||
/** Fiche survolée sur la carte ou sélectionnée. */
|
||||
actif?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
open: []
|
||||
etiquette: [label: string]
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fiche-mini-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
padding: var(--space-sm);
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
font-family: inherit;
|
||||
box-sizing: border-box;
|
||||
transition: background-color var(--dur-fast) var(--ease-out),
|
||||
box-shadow var(--dur-fast) var(--ease-out);
|
||||
box-shadow var(--dur-fast) var(--ease-out),
|
||||
border-color var(--dur-fast) var(--ease-out);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
@@ -63,11 +92,42 @@ const emit = defineEmits<{
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.fiche-mini-card:focus-visible {
|
||||
/* Survol d'une épingle ou fiche sélectionnée : liseré safran */
|
||||
.fiche-mini-card--actif {
|
||||
border-color: var(--accent);
|
||||
box-shadow: inset 3px 0 0 var(--accent);
|
||||
}
|
||||
|
||||
.fiche-mini-card:has(.fiche-mini-card__ouvrir:focus-visible) {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* Bouton étiré : toute la carte ouvre la fiche, les chips cliquables passent dessus */
|
||||
.fiche-mini-card__ouvrir {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
.fiche-mini-card__ouvrir::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: inherit;
|
||||
}
|
||||
.fiche-mini-card__ouvrir:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.fiche-mini-card__nom {
|
||||
width: 100%;
|
||||
font-size: var(--fs-sm);
|
||||
@@ -84,7 +144,8 @@ const emit = defineEmits<{
|
||||
margin-top: var(--space-2xs);
|
||||
font-size: var(--fs-xs);
|
||||
line-height: var(--lh-base);
|
||||
color: var(--text-muted);
|
||||
/* --text-muted ne donne que 3,7:1 sur --surface (DESIGN-SYSTEM §Navigation) */
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
@@ -92,12 +153,18 @@ const emit = defineEmits<{
|
||||
}
|
||||
|
||||
.fiche-mini-card__chips {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-top: var(--space-xs);
|
||||
pointer-events: none;
|
||||
}
|
||||
.fiche-mini-card__chips :deep(button) {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.fiche-mini-card__no-geo {
|
||||
margin-top: var(--space-2xs);
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--text-subtle);
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<!-- Backdrop -->
|
||||
<Transition name="backdrop">
|
||||
<div
|
||||
v-if="modelValue && orgId != null"
|
||||
class="fixed inset-0 z-[1500]"
|
||||
style="background: rgba(26,34,56,0.55);"
|
||||
@click="close"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</Transition>
|
||||
|
||||
<!-- Modal centré -->
|
||||
<Transition name="modal">
|
||||
<div
|
||||
v-if="modelValue && orgId != null"
|
||||
class="fiche-modal fixed z-[1501] left-1/2 -translate-x-1/2 flex flex-col"
|
||||
style="
|
||||
width: min(768px, 92vw);
|
||||
background: var(--nav-bg);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 16px 64px rgba(26,34,56,0.28);
|
||||
overflow: hidden;
|
||||
"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
:aria-label="org?.nom ?? 'Fiche organisation'"
|
||||
@keydown.esc="close"
|
||||
>
|
||||
<!-- Header modal -->
|
||||
<div
|
||||
class="flex items-center justify-between px-5 py-3 shrink-0 border-b"
|
||||
style="background: var(--nav-surface); border-color: var(--nav-bg-alt);"
|
||||
>
|
||||
<span class="text-sm font-semibold" style="color: var(--nav-text-muted);">Fiche détaillée</span>
|
||||
<div class="flex items-center gap-2">
|
||||
<!-- Lien fiche complète -->
|
||||
<a
|
||||
v-if="orgId"
|
||||
:href="`/fiche/${orgId}`"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-opacity hover:opacity-70"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text);"
|
||||
>
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>
|
||||
<polyline points="15 3 21 3 21 9"/>
|
||||
<line x1="10" y1="14" x2="21" y2="3"/>
|
||||
</svg>
|
||||
Ouvrir
|
||||
</a>
|
||||
<!-- Fermer -->
|
||||
<button
|
||||
@click="close"
|
||||
class="w-8 h-8 rounded-lg flex items-center justify-center transition-colors"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted);"
|
||||
aria-label="Fermer"
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" aria-hidden="true">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contenu scrollable -->
|
||||
<div class="flex-1 overflow-y-auto px-5 py-5">
|
||||
<!-- Chargement -->
|
||||
<div v-if="pending" class="py-12 text-center text-sm" style="color: var(--nav-text-muted);">
|
||||
Chargement de la fiche…
|
||||
</div>
|
||||
|
||||
<!-- Erreur -->
|
||||
<div v-else-if="error" class="py-12 text-center">
|
||||
<p class="text-base font-semibold mb-2" style="color: var(--nav-text);">Fiche introuvable</p>
|
||||
<p class="text-sm" style="color: var(--nav-text-muted);">L'organisation demandée n'existe pas ou a été supprimée.</p>
|
||||
</div>
|
||||
|
||||
<!-- Contenu -->
|
||||
<template v-else-if="org">
|
||||
<FicheDetail :org="org" />
|
||||
<div class="mb-5" style="height: 1px; background: var(--nav-bg-alt);"></div>
|
||||
<CommentSection :org-id="org.Id" :refresh="commentRefreshTick" />
|
||||
<CommentForm :org-id="org.Id" @submitted="onCommentSubmitted" />
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Org } from '~/types/org'
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
orgId: number | null
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: boolean]
|
||||
}>()
|
||||
|
||||
function close() {
|
||||
emit('update:modelValue', false)
|
||||
}
|
||||
|
||||
// Fermeture Esc globale
|
||||
onMounted(() => {
|
||||
const handler = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape' && props.modelValue) close()
|
||||
}
|
||||
window.addEventListener('keydown', handler)
|
||||
onUnmounted(() => window.removeEventListener('keydown', handler))
|
||||
})
|
||||
|
||||
// Fetch fiche quand orgId change
|
||||
const org = ref<Org | null>(null)
|
||||
const pending = ref(false)
|
||||
const error = ref(false)
|
||||
|
||||
watch(() => props.orgId, async (id) => {
|
||||
if (id == null) return
|
||||
pending.value = true
|
||||
error.value = false
|
||||
org.value = null
|
||||
try {
|
||||
org.value = await $fetch<Org>(`/api/fiche/${id}`)
|
||||
} catch {
|
||||
error.value = true
|
||||
} finally {
|
||||
pending.value = false
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
const commentRefreshTick = ref(0)
|
||||
|
||||
function onCommentSubmitted() {
|
||||
commentRefreshTick.value++
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* Modal positionnement : centré desktop, descendu sous le header sur mobile */
|
||||
.fiche-modal {
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
max-height: 90vh;
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) {
|
||||
.fiche-modal {
|
||||
top: 76px;
|
||||
transform: translateX(-50%);
|
||||
max-height: calc(100dvh - 92px);
|
||||
}
|
||||
}
|
||||
|
||||
/* Backdrop */
|
||||
.backdrop-enter-active, .backdrop-leave-active { transition: opacity 0.2s ease; }
|
||||
.backdrop-enter-from, .backdrop-leave-to { opacity: 0; }
|
||||
|
||||
/* Modal */
|
||||
.modal-enter-active, .modal-leave-active {
|
||||
transition: opacity 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
.modal-enter-from, .modal-leave-to {
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -52%);
|
||||
}
|
||||
@media (max-width: 1023px) {
|
||||
.modal-enter-from, .modal-leave-to {
|
||||
transform: translate(-50%, calc(-2% + 76px));
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.backdrop-enter-active, .backdrop-leave-active { transition: none; }
|
||||
.modal-enter-active, .modal-leave-active { transition: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -1,360 +0,0 @@
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<!-- Backdrop -->
|
||||
<Transition name="backdrop">
|
||||
<div
|
||||
v-if="modelValue && structureId != null"
|
||||
class="fixed inset-0 z-[1500]"
|
||||
style="background: rgba(26,34,56,0.55);"
|
||||
@click="close"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</Transition>
|
||||
|
||||
<!-- Modal -->
|
||||
<Transition name="modal">
|
||||
<div
|
||||
v-if="modelValue && structureId != null && structure"
|
||||
class="fiche-modal-v2 fixed z-[1501] left-1/2 -translate-x-1/2 flex flex-col"
|
||||
style="
|
||||
width: min(780px, 94vw);
|
||||
background: var(--nav-bg);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 16px 64px rgba(26,34,56,0.28);
|
||||
overflow: hidden;
|
||||
"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
:aria-label="structure?.nom ?? 'Fiche structure'"
|
||||
@keydown.esc="close"
|
||||
>
|
||||
<!-- Header modal -->
|
||||
<div
|
||||
class="flex items-center justify-between px-5 py-3 shrink-0"
|
||||
:style="`border-bottom: 3px solid ${familleColor}; background: var(--nav-surface);`"
|
||||
>
|
||||
<div class="flex items-center gap-3">
|
||||
<!-- Pastille famille -->
|
||||
<div
|
||||
class="w-3 h-3 rounded-full shrink-0"
|
||||
:style="`background: ${familleColor};`"
|
||||
/>
|
||||
<span class="text-sm font-semibold" style="color: var(--nav-text-muted);">
|
||||
{{ familleLabel }}
|
||||
</span>
|
||||
<!-- Badges -->
|
||||
<div class="flex gap-1.5">
|
||||
<span
|
||||
v-if="structure.badges.centre_ressources"
|
||||
class="px-2 py-0.5 rounded-full text-xs font-medium"
|
||||
style="background: #2d8a6b22; color: #2d8a6b;"
|
||||
>Centre ressources</span>
|
||||
<span
|
||||
v-if="structure.badges.mouvement_manifeste"
|
||||
class="px-2 py-0.5 rounded-full text-xs font-medium"
|
||||
style="background: #c44a2f22; color: #c44a2f;"
|
||||
>Manifeste</span>
|
||||
<span
|
||||
v-if="structure.badges.contre_pouvoir_spatial"
|
||||
class="px-2 py-0.5 rounded-full text-xs font-medium"
|
||||
style="background: #1a3a6b22; color: #1a3a6b;"
|
||||
>Contre-pouvoir</span>
|
||||
<span
|
||||
v-if="structure.badges.f6_recherche_politique"
|
||||
class="px-2 py-0.5 rounded-full text-xs font-medium"
|
||||
style="background: #6b3fa022; color: #6b3fa0;"
|
||||
>Recherche pol.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<a
|
||||
v-if="structure.url"
|
||||
:href="structure.url"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-opacity hover:opacity-70"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text);"
|
||||
>
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>
|
||||
<polyline points="15 3 21 3 21 9"/>
|
||||
<line x1="10" y1="14" x2="21" y2="3"/>
|
||||
</svg>
|
||||
Site web
|
||||
</a>
|
||||
<button
|
||||
@click="close"
|
||||
class="w-8 h-8 rounded-lg flex items-center justify-center transition-colors"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted);"
|
||||
aria-label="Fermer"
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" aria-hidden="true">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contenu scrollable -->
|
||||
<div class="flex-1 overflow-y-auto px-5 py-5">
|
||||
<!-- Nom + meta -->
|
||||
<div class="mb-4">
|
||||
<h2 class="text-xl font-bold mb-1" style="color: var(--nav-text);">{{ structure.nom }}</h2>
|
||||
<div class="flex flex-wrap gap-2 text-sm" style="color: var(--nav-text-muted);">
|
||||
<span>{{ structure.type_principal }}</span>
|
||||
<span>·</span>
|
||||
<span>{{ structure.ville }}, {{ structure.pays }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hashtags -->
|
||||
<div v-if="structure.hashtags.length" class="flex flex-wrap gap-1.5 mb-4">
|
||||
<span
|
||||
v-for="tag in structure.hashtags"
|
||||
:key="tag"
|
||||
class="px-2 py-0.5 rounded-full text-xs"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted);"
|
||||
>{{ tag }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Description courte -->
|
||||
<p class="text-sm leading-relaxed mb-4" style="color: var(--nav-text);">{{ structure.description_courte }}</p>
|
||||
|
||||
<!-- Description longue (expandable) -->
|
||||
<div v-if="structure.description_longue" class="mb-4">
|
||||
<div
|
||||
class="text-sm leading-relaxed"
|
||||
style="color: var(--nav-text); white-space: pre-wrap;"
|
||||
:style="showFullDesc ? '' : 'max-height: 120px; overflow: hidden;'"
|
||||
>{{ structure.description_longue }}</div>
|
||||
<button
|
||||
@click="showFullDesc = !showFullDesc"
|
||||
class="mt-2 text-xs underline"
|
||||
style="color: var(--nav-text-muted);"
|
||||
>{{ showFullDesc ? 'Réduire' : 'Lire la suite…' }}</button>
|
||||
</div>
|
||||
|
||||
<!-- Pensées rattachées -->
|
||||
<div v-if="structure.pensees && structure.pensees.length" class="mb-4">
|
||||
<h3 class="text-xs font-bold uppercase tracking-wide mb-2" style="color: var(--nav-text-muted);">Pensées rattachées</h3>
|
||||
<div class="flex flex-wrap gap-1.5">
|
||||
<span
|
||||
v-for="pensee in structure.pensees"
|
||||
:key="pensee.id"
|
||||
class="px-2 py-0.5 rounded text-xs"
|
||||
:style="pensee.confiance === 'ia_suggested'
|
||||
? 'background: var(--nav-bg-alt); color: var(--nav-text-muted); border: 1px dashed var(--nav-bg-alt);'
|
||||
: 'background: var(--nav-bg-alt); color: var(--nav-text);'"
|
||||
:title="pensee.confiance === 'ia_suggested' ? 'IA suggéré' : ''"
|
||||
>
|
||||
{{ pensee.label }}<span v-if="pensee.confiance === 'ia_suggested'" class="ml-1 opacity-60">~</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Projets emblématiques -->
|
||||
<div v-if="projetsStructure.length" class="mb-4">
|
||||
<h3 class="text-xs font-bold uppercase tracking-wide mb-2" style="color: var(--nav-text-muted);">Projets emblématiques</h3>
|
||||
<div class="space-y-2">
|
||||
<div
|
||||
v-for="projet in projetsStructure.slice(0, 5)"
|
||||
:key="projet.id"
|
||||
class="rounded-lg p-3"
|
||||
style="background: var(--nav-surface); border: 1px solid var(--nav-bg-alt);"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-2">
|
||||
<span class="font-medium text-sm" style="color: var(--nav-text);">{{ projet.nom }}</span>
|
||||
<span v-if="projet.annee" class="text-xs shrink-0" style="color: var(--nav-text-muted);">{{ projet.annee }}</span>
|
||||
</div>
|
||||
<div v-if="projet.lieu" class="text-xs mt-0.5" style="color: var(--nav-text-muted);">{{ projet.lieu }}</div>
|
||||
<p class="text-xs mt-1 leading-relaxed" style="color: var(--nav-text-muted);">{{ projet.description.slice(0, 120) }}{{ projet.description.length > 120 ? '…' : '' }}</p>
|
||||
<a
|
||||
v-if="projet.url"
|
||||
:href="projet.url"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-xs mt-1 inline-block"
|
||||
style="color: var(--nav-text-muted); text-decoration: underline;"
|
||||
>En savoir plus →</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Structures voisines (graphe) -->
|
||||
<div v-if="structuresVoisines.length" class="mb-4">
|
||||
<h3 class="text-xs font-bold uppercase tracking-wide mb-2" style="color: var(--nav-text-muted);">Structures liées</h3>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<button
|
||||
v-for="voisine in structuresVoisines.slice(0, 6)"
|
||||
:key="voisine.id"
|
||||
class="px-2 py-1 rounded text-xs transition-colors hover:opacity-70"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text); border: 1px solid transparent;"
|
||||
@click="emit('update:structureId', voisine.id)"
|
||||
>{{ voisine.nom }}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sources -->
|
||||
<div v-if="structure.sources && structure.sources.length" class="mb-4">
|
||||
<h3 class="text-xs font-bold uppercase tracking-wide mb-2" style="color: var(--nav-text-muted);">Sources</h3>
|
||||
<div class="space-y-1">
|
||||
<div v-for="(source, i) in structure.sources" :key="i" class="flex items-center gap-2">
|
||||
<span
|
||||
class="px-1.5 py-0.5 rounded text-xs shrink-0"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted);"
|
||||
>{{ source.type }}</span>
|
||||
<a
|
||||
v-if="source.url"
|
||||
:href="source.url"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-xs underline truncate"
|
||||
style="color: var(--nav-text);"
|
||||
>{{ source.titre }}</a>
|
||||
<span v-else class="text-xs" style="color: var(--nav-text);">{{ source.titre }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CTAs -->
|
||||
<div class="flex gap-3 pt-2" style="border-top: 1px solid var(--nav-bg-alt);">
|
||||
<a
|
||||
href="/contribuer"
|
||||
class="text-xs underline"
|
||||
style="color: var(--nav-text-muted);"
|
||||
>Signaler une erreur</a>
|
||||
<a
|
||||
href="/contribuer"
|
||||
class="text-xs underline"
|
||||
style="color: var(--nav-text-muted);"
|
||||
>Réclamer cette fiche</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ReseauxBifurcationData, StructureV2, ProjetEmblematique } from '~/types/structure-v2'
|
||||
|
||||
const FAMILLE_COLORS: Record<number, string> = {
|
||||
1: '#a85d3e',
|
||||
2: '#c4a472',
|
||||
3: '#d4a017',
|
||||
4: '#5a7a4a',
|
||||
5: '#3d6a8c',
|
||||
}
|
||||
|
||||
const FAMILLE_LABELS: Record<number, string> = {
|
||||
1: 'Réemploi & filières',
|
||||
2: 'Frugalité & low-tech',
|
||||
3: 'Architecture sociale',
|
||||
4: 'Collectifs & AMO',
|
||||
5: 'Urbanisme de transition',
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
structureId: string | null
|
||||
data: ReseauxBifurcationData | null
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: boolean]
|
||||
'update:structureId': [id: string]
|
||||
}>()
|
||||
|
||||
const showFullDesc = ref(false)
|
||||
|
||||
function close() {
|
||||
emit('update:modelValue', false)
|
||||
showFullDesc.value = false
|
||||
}
|
||||
|
||||
// Fermeture Esc globale
|
||||
onMounted(() => {
|
||||
const handler = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape' && props.modelValue) close()
|
||||
}
|
||||
window.addEventListener('keydown', handler)
|
||||
onUnmounted(() => window.removeEventListener('keydown', handler))
|
||||
})
|
||||
|
||||
// Remettre showFullDesc a false a chaque changement de fiche
|
||||
watch(() => props.structureId, () => {
|
||||
showFullDesc.value = false
|
||||
})
|
||||
|
||||
const structure = computed<StructureV2 | null>(() => {
|
||||
if (!props.data || !props.structureId) return null
|
||||
return props.data.structures.find(s => s.id === props.structureId) ?? null
|
||||
})
|
||||
|
||||
const familleColor = computed(() =>
|
||||
FAMILLE_COLORS[structure.value?.famille_principale ?? 1] ?? '#888'
|
||||
)
|
||||
|
||||
const familleLabel = computed(() =>
|
||||
FAMILLE_LABELS[structure.value?.famille_principale ?? 1] ?? ''
|
||||
)
|
||||
|
||||
const projetsStructure = computed<ProjetEmblematique[]>(() => {
|
||||
if (!props.data || !props.structureId) return []
|
||||
return props.data.projets?.filter(p => p.structure_parent === props.structureId) ?? []
|
||||
})
|
||||
|
||||
const structuresVoisines = computed<StructureV2[]>(() => {
|
||||
if (!props.data || !props.structureId) return []
|
||||
const edges = props.data.graphe?.edges ?? []
|
||||
const voisineIds = edges
|
||||
.filter(e => e.source === props.structureId || e.target === props.structureId)
|
||||
.sort((a, b) => (b.score ?? 0) - (a.score ?? 0))
|
||||
.map(e => e.source === props.structureId ? e.target : e.source)
|
||||
.slice(0, 8)
|
||||
|
||||
return voisineIds
|
||||
.map(id => props.data!.structures.find(s => s.id === id))
|
||||
.filter(Boolean) as StructureV2[]
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* Backdrop */
|
||||
.backdrop-enter-active, .backdrop-leave-active { transition: opacity 0.2s ease; }
|
||||
.backdrop-enter-from, .backdrop-leave-to { opacity: 0; }
|
||||
|
||||
/* Modal positionnement : centré desktop, descendu sous le header sur mobile */
|
||||
.fiche-modal-v2 {
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
max-height: 90vh;
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) {
|
||||
.fiche-modal-v2 {
|
||||
top: 76px;
|
||||
transform: translateX(-50%);
|
||||
max-height: calc(100dvh - 92px);
|
||||
}
|
||||
}
|
||||
|
||||
/* Modal */
|
||||
.modal-enter-active, .modal-leave-active {
|
||||
transition: opacity 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
.modal-enter-from, .modal-leave-to {
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -52%);
|
||||
}
|
||||
@media (max-width: 1023px) {
|
||||
.modal-enter-from, .modal-leave-to {
|
||||
transform: translate(-50%, calc(-2% + 76px));
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.backdrop-enter-active, .backdrop-leave-active { transition: none; }
|
||||
.modal-enter-active, .modal-leave-active { transition: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,291 @@
|
||||
<!--
|
||||
FicheReseauContenu — B12-M4. Le corps de l'ancienne FicheModalV2 (retirée),
|
||||
devenu un contenu : la vue fiches le pose dans son panneau de détail
|
||||
(slot #detail de VueFiches). Badges, hashtags, descriptions, pensées,
|
||||
projets, structures liées, sources.
|
||||
|
||||
Hashtag cliqué → `etiquette` (la vue fiches ajoute le filtre) ; structure
|
||||
liée cliquée → `voisin` (la page l'ouvre dans le même panneau).
|
||||
-->
|
||||
<template>
|
||||
<article v-if="structure" class="frc">
|
||||
<div class="frc-famille" :style="`border-bottom-color: ${familleColor};`">
|
||||
<span class="frc-famille__pastille" :style="`background: ${familleColor};`" aria-hidden="true" />
|
||||
<span class="frc-famille__libelle">{{ familleLabel }}</span>
|
||||
<span v-if="structure.badges.centre_ressources" class="frc-badge" style="background: #2d8a6b22; color: #1f6650;">Centre ressources</span>
|
||||
<span v-if="structure.badges.mouvement_manifeste" class="frc-badge" style="background: #c44a2f22; color: #9a3520;">Manifeste</span>
|
||||
<span v-if="structure.badges.contre_pouvoir_spatial" class="frc-badge" style="background: #1a3a6b22; color: #1a3a6b;">Contre-pouvoir</span>
|
||||
<span v-if="structure.badges.f6_recherche_politique" class="frc-badge" style="background: #6b3fa022; color: #5a3388;">Recherche pol.</span>
|
||||
</div>
|
||||
|
||||
<h2 class="frc-nom">{{ structure.nom }}</h2>
|
||||
<p class="frc-meta">
|
||||
<span>{{ structure.type_principal }}</span>
|
||||
<span aria-hidden="true"> · </span>
|
||||
<span>{{ structure.ville }}, {{ structure.pays }}</span>
|
||||
</p>
|
||||
|
||||
<a
|
||||
v-if="structure.url"
|
||||
:href="structure.url"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="frc-site"
|
||||
>
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />
|
||||
<polyline points="15 3 21 3 21 9" />
|
||||
<line x1="10" y1="14" x2="21" y2="3" />
|
||||
</svg>
|
||||
Site web<span class="frc-sr"> (nouvel onglet)</span>
|
||||
</a>
|
||||
|
||||
<ChipGroup v-if="structure.hashtags.length" :aria-label="`Hashtags de ${structure.nom}`" class="frc-tags">
|
||||
<Chip
|
||||
v-for="tag in structure.hashtags"
|
||||
:key="tag"
|
||||
variant="fonction"
|
||||
:label="tag"
|
||||
:active="etiquettesActives?.includes(tag)"
|
||||
:aria-label="`Filtrer par ${tag}`"
|
||||
@toggle="emit('etiquette', tag)"
|
||||
/>
|
||||
</ChipGroup>
|
||||
|
||||
<p class="frc-texte">{{ structure.description_courte }}</p>
|
||||
|
||||
<div v-if="structure.description_longue" class="frc-bloc">
|
||||
<div class="frc-texte frc-long" :class="{ 'frc-long--replie': !showFullDesc }">{{ structure.description_longue }}</div>
|
||||
<button type="button" class="frc-lien" :aria-expanded="showFullDesc" @click="showFullDesc = !showFullDesc">
|
||||
{{ showFullDesc ? 'Réduire' : 'Lire la suite…' }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<section v-if="structure.pensees && structure.pensees.length" class="frc-bloc">
|
||||
<h3 class="frc-titre">Pensées rattachées</h3>
|
||||
<div class="frc-liste-inline">
|
||||
<span
|
||||
v-for="pensee in structure.pensees"
|
||||
:key="pensee.id"
|
||||
class="frc-pensee"
|
||||
:class="{ 'frc-pensee--ia': pensee.confiance === 'ia_suggested' }"
|
||||
:title="pensee.confiance === 'ia_suggested' ? 'IA suggéré' : ''"
|
||||
>{{ pensee.label }}<span v-if="pensee.confiance === 'ia_suggested'" aria-hidden="true"> ~</span><span v-if="pensee.confiance === 'ia_suggested'" class="frc-sr"> (suggéré par l'IA)</span></span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section v-if="projetsStructure.length" class="frc-bloc">
|
||||
<h3 class="frc-titre">Projets emblématiques</h3>
|
||||
<div class="frc-projets">
|
||||
<div v-for="projet in projetsStructure.slice(0, 5)" :key="projet.id" class="frc-projet">
|
||||
<div class="frc-projet__tete">
|
||||
<span class="frc-projet__nom">{{ projet.nom }}</span>
|
||||
<span v-if="projet.annee" class="frc-discret">{{ projet.annee }}</span>
|
||||
</div>
|
||||
<div v-if="projet.lieu" class="frc-discret">{{ projet.lieu }}</div>
|
||||
<p class="frc-projet__desc">{{ projet.description.slice(0, 120) }}{{ projet.description.length > 120 ? '…' : '' }}</p>
|
||||
<a v-if="projet.url" :href="projet.url" target="_blank" rel="noopener noreferrer" class="frc-lien">En savoir plus<span class="frc-sr"> sur {{ projet.nom }} (nouvel onglet)</span> →</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section v-if="structuresVoisines.length" class="frc-bloc">
|
||||
<h3 class="frc-titre">Structures liées</h3>
|
||||
<div class="frc-liste-inline">
|
||||
<button
|
||||
v-for="voisine in structuresVoisines.slice(0, 6)"
|
||||
:key="voisine.id"
|
||||
type="button"
|
||||
class="frc-voisin"
|
||||
@click="emit('voisin', voisine.id)"
|
||||
>{{ voisine.nom }}</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section v-if="structure.sources && structure.sources.length" class="frc-bloc">
|
||||
<h3 class="frc-titre">Sources</h3>
|
||||
<ul class="frc-sources">
|
||||
<li v-for="(source, i) in structure.sources" :key="i">
|
||||
<span class="frc-source__type">{{ source.type }}</span>
|
||||
<a v-if="source.url" :href="source.url" target="_blank" rel="noopener noreferrer" class="frc-lien">{{ source.titre }}</a>
|
||||
<span v-else>{{ source.titre }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<p class="frc-cta">
|
||||
<NuxtLink to="/contribuer" class="frc-lien">Signaler une erreur</NuxtLink>
|
||||
<NuxtLink to="/contribuer" class="frc-lien">Réclamer cette fiche</NuxtLink>
|
||||
</p>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ReseauxBifurcationData, StructureV2, ProjetEmblematique } from '~/types/structure-v2'
|
||||
|
||||
const FAMILLE_COLORS: Record<number, string> = {
|
||||
1: '#a85d3e',
|
||||
2: '#c4a472',
|
||||
3: '#d4a017',
|
||||
4: '#5a7a4a',
|
||||
5: '#3d6a8c',
|
||||
}
|
||||
|
||||
const FAMILLE_LABELS: Record<number, string> = {
|
||||
1: 'Réemploi & filières',
|
||||
2: 'Frugalité & low-tech',
|
||||
3: 'Architecture sociale',
|
||||
4: 'Collectifs & AMO',
|
||||
5: 'Urbanisme de transition',
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
structureId: string
|
||||
data: ReseauxBifurcationData | null
|
||||
/** Hashtags actifs dans les filtres (avec leur « # ») : la chip s'allume. */
|
||||
etiquettesActives?: string[]
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
etiquette: [hashtag: string]
|
||||
voisin: [id: string]
|
||||
}>()
|
||||
|
||||
const showFullDesc = ref(false)
|
||||
watch(() => props.structureId, () => { showFullDesc.value = false })
|
||||
|
||||
const structure = computed<StructureV2 | null>(() =>
|
||||
props.data?.structures.find((s) => s.id === props.structureId) ?? null,
|
||||
)
|
||||
|
||||
const familleColor = computed(() => FAMILLE_COLORS[structure.value?.famille_principale ?? 1] ?? '#888')
|
||||
const familleLabel = computed(() => FAMILLE_LABELS[structure.value?.famille_principale ?? 1] ?? '')
|
||||
|
||||
const projetsStructure = computed<ProjetEmblematique[]>(() =>
|
||||
props.data?.projets?.filter((p) => p.structure_parent === props.structureId) ?? [],
|
||||
)
|
||||
|
||||
const structuresVoisines = computed<StructureV2[]>(() => {
|
||||
if (!props.data) return []
|
||||
const edges = props.data.graphe?.edges ?? []
|
||||
return edges
|
||||
.filter((e) => e.source === props.structureId || e.target === props.structureId)
|
||||
.sort((a, b) => (b.score ?? 0) - (a.score ?? 0))
|
||||
.map((e) => (e.source === props.structureId ? e.target : e.source))
|
||||
.slice(0, 8)
|
||||
.map((id) => props.data!.structures.find((s) => s.id === id))
|
||||
.filter(Boolean) as StructureV2[]
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.frc { color: var(--text); font-size: var(--fs-sm); }
|
||||
.frc-sr {
|
||||
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
|
||||
overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
|
||||
}
|
||||
|
||||
.frc-famille {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-2xs) var(--space-xs);
|
||||
padding-bottom: var(--space-xs);
|
||||
margin-bottom: var(--space-sm);
|
||||
border-bottom: 3px solid;
|
||||
}
|
||||
.frc-famille__pastille { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
|
||||
.frc-famille__libelle { font-weight: var(--fw-semibold); color: color-mix(in srgb, var(--text) 78%, transparent); }
|
||||
.frc-badge {
|
||||
padding: 2px var(--space-xs);
|
||||
border-radius: var(--radius-full);
|
||||
font-size: var(--fs-xs, 0.75rem);
|
||||
font-weight: var(--fw-medium);
|
||||
}
|
||||
|
||||
.frc-nom { margin: 0 0 var(--space-2xs); font-size: 1.25rem; font-weight: var(--fw-bold, 700); line-height: 1.25; }
|
||||
.frc-meta { margin: 0 0 var(--space-sm); color: color-mix(in srgb, var(--text) 78%, transparent); }
|
||||
|
||||
.frc-site {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2xs);
|
||||
min-height: 32px;
|
||||
padding: 0 var(--space-sm);
|
||||
margin-bottom: var(--space-sm);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--bg-alt);
|
||||
color: var(--text);
|
||||
font-weight: var(--fw-medium);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.frc-tags { margin-bottom: var(--space-sm); }
|
||||
|
||||
.frc-texte { margin: 0 0 var(--space-sm); line-height: var(--lh-base, 1.55); }
|
||||
.frc-long { white-space: pre-wrap; margin: 0; }
|
||||
.frc-long--replie { max-height: 120px; overflow: hidden; }
|
||||
|
||||
.frc-bloc { margin-bottom: var(--space-md); }
|
||||
.frc-titre {
|
||||
margin: 0 0 var(--space-xs);
|
||||
font-size: var(--fs-xs, 0.75rem);
|
||||
font-weight: var(--fw-bold, 700);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
|
||||
.frc-liste-inline { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
|
||||
.frc-pensee {
|
||||
padding: 2px var(--space-xs);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-alt);
|
||||
font-size: var(--fs-xs, 0.75rem);
|
||||
}
|
||||
.frc-pensee--ia { color: color-mix(in srgb, var(--text) 78%, transparent); border: 1px dashed var(--border); }
|
||||
|
||||
.frc-projets { display: flex; flex-direction: column; gap: var(--space-xs); }
|
||||
.frc-projet { padding: var(--space-sm); border-radius: var(--radius-md); background: var(--bg); border: 1px solid var(--border); }
|
||||
.frc-projet__tete { display: flex; justify-content: space-between; gap: var(--space-xs); }
|
||||
.frc-projet__nom { font-weight: var(--fw-medium); }
|
||||
.frc-projet__desc { margin: var(--space-2xs) 0; font-size: var(--fs-xs, 0.75rem); line-height: 1.5; color: color-mix(in srgb, var(--text) 78%, transparent); }
|
||||
.frc-discret { font-size: var(--fs-xs, 0.75rem); color: color-mix(in srgb, var(--text) 78%, transparent); }
|
||||
|
||||
.frc-voisin {
|
||||
min-height: 32px;
|
||||
padding: 0 var(--space-xs);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-alt);
|
||||
color: var(--text);
|
||||
font: inherit;
|
||||
font-size: var(--fs-xs, 0.75rem);
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.frc-sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2xs); }
|
||||
.frc-sources li { display: flex; align-items: baseline; gap: var(--space-xs); min-width: 0; font-size: var(--fs-xs, 0.75rem); overflow-wrap: anywhere; }
|
||||
.frc-source__type { flex-shrink: 0; padding: 1px var(--space-2xs); border-radius: var(--radius-sm); background: var(--bg-alt); }
|
||||
|
||||
.frc-lien {
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--text);
|
||||
font: inherit;
|
||||
font-size: var(--fs-xs, 0.75rem);
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.frc-cta { display: flex; gap: var(--space-sm); padding-top: var(--space-xs); margin: 0; border-top: 1px solid var(--border); }
|
||||
|
||||
.frc-site:focus-visible,
|
||||
.frc-lien:focus-visible,
|
||||
.frc-voisin:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,168 +0,0 @@
|
||||
<!--
|
||||
FichesPanel — B3-M3
|
||||
Panneau « toutes les fiches » : reçoit une liste déjà filtrée (recherche +
|
||||
filtres en cours côté page), l'affiche en grille de FicheMiniCard, et
|
||||
expose ses propres chips de filtrage branchées sur le MÊME état que la
|
||||
page appelante (pas un second état — voir vérification du brief).
|
||||
Ne crée pas de second champ de recherche : `query` sert uniquement à
|
||||
nuancer le message d'état vide.
|
||||
-->
|
||||
<template>
|
||||
<div class="fiches-panel">
|
||||
<div class="fiches-panel__head">
|
||||
<p class="fiches-panel__intention">{{ intention }}</p>
|
||||
|
||||
<div class="fiches-panel__count">
|
||||
{{ fiches.length }} fiche{{ fiches.length > 1 ? 's' : '' }}
|
||||
</div>
|
||||
|
||||
<ChipGroup v-if="hashtags.length" aria-label="Filtrer les fiches" class="fiches-panel__chips">
|
||||
<Chip
|
||||
v-for="tag in visibleHashtags"
|
||||
:key="tag"
|
||||
:label="tag"
|
||||
variant="fonction"
|
||||
:active="selected.includes(tag)"
|
||||
@toggle="toggle(tag)"
|
||||
/>
|
||||
<Chip
|
||||
v-if="isCollapsible"
|
||||
:label="expanded ? 'Réduire' : `Voir les ${hiddenCount} autres`"
|
||||
variant="echelle"
|
||||
:active="expanded"
|
||||
@toggle="expanded = !expanded"
|
||||
/>
|
||||
</ChipGroup>
|
||||
</div>
|
||||
|
||||
<div class="fiches-panel__body">
|
||||
<p v-if="fiches.length === 0" class="fiches-panel__empty">
|
||||
Aucun résultat<template v-if="query"> pour « {{ query }} »</template>.
|
||||
</p>
|
||||
|
||||
<div v-else class="fiches-panel__grid">
|
||||
<FicheMiniCard
|
||||
v-for="fiche in fiches"
|
||||
:key="`${fiche.kind}-${fiche.id}`"
|
||||
:fiche="fiche"
|
||||
@open="emit('open', fiche)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { MiniFiche } from '~/composables/useFicheAdapter'
|
||||
|
||||
const props = defineProps<{
|
||||
fiches: MiniFiche[]
|
||||
hashtags: string[]
|
||||
selected: string[]
|
||||
query: string
|
||||
intention: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:selected': [value: string[]]
|
||||
open: [fiche: MiniFiche]
|
||||
}>()
|
||||
|
||||
// Hashtags repliés (B3-M4) — au-delà de COLLAPSE_THRESHOLD chips, n'affiche
|
||||
// que les premières + un Chip-bouton « voir les N autres ». Les chips déjà
|
||||
// actives restent toujours visibles même repliées. `/` (10 fonctions) ne
|
||||
// dépasse jamais le seuil ; `/agences` (~60 hashtags) se replie. État
|
||||
// déplié non persistant (ref locale, reset à chaque montage du composant).
|
||||
const COLLAPSE_THRESHOLD = 14
|
||||
const expanded = ref(false)
|
||||
|
||||
const isCollapsible = computed(() => props.hashtags.length > COLLAPSE_THRESHOLD)
|
||||
|
||||
const visibleHashtags = computed(() => {
|
||||
if (expanded.value || !isCollapsible.value) return props.hashtags
|
||||
const head = props.hashtags.slice(0, COLLAPSE_THRESHOLD)
|
||||
const headSet = new Set(head)
|
||||
const activeOutsideHead = props.hashtags.filter(
|
||||
(tag) => props.selected.includes(tag) && !headSet.has(tag)
|
||||
)
|
||||
return [...head, ...activeOutsideHead]
|
||||
})
|
||||
|
||||
const hiddenCount = computed(() => props.hashtags.length - visibleHashtags.value.length)
|
||||
|
||||
function toggle(tag: string) {
|
||||
if (props.selected.includes(tag)) {
|
||||
emit('update:selected', props.selected.filter((t) => t !== tag))
|
||||
} else {
|
||||
emit('update:selected', [...props.selected, tag])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fiches-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.fiches-panel__head {
|
||||
flex-shrink: 0;
|
||||
padding: var(--space-sm) var(--space-md);
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.fiches-panel__intention {
|
||||
margin: 0 0 var(--space-xs);
|
||||
font-size: var(--fs-sm);
|
||||
line-height: var(--lh-base);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.fiches-panel__count {
|
||||
margin: 0 0 var(--space-xs);
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: var(--fw-semibold);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.02em;
|
||||
color: var(--text-subtle);
|
||||
}
|
||||
|
||||
.fiches-panel__chips {
|
||||
margin-top: var(--space-2xs);
|
||||
}
|
||||
|
||||
.fiches-panel__body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
padding: var(--space-md);
|
||||
}
|
||||
|
||||
.fiches-panel__empty {
|
||||
margin: var(--space-xl) 0;
|
||||
text-align: center;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.fiches-panel__grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: var(--space-sm);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.fiches-panel__grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1280px) {
|
||||
.fiches-panel__grid {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,99 @@
|
||||
<!--
|
||||
FilEchelle — B10-M4
|
||||
< 768 px : une ligne de 28 px sous la barre, « S · Partir de soi · Outils · Jobs » :
|
||||
l'échelle courante, l'onglet courant, puis ses voisins du groupe (liens).
|
||||
Absente sur les pages hors groupe (Manifeste, À propos, Proposer, Signaler, fiche).
|
||||
Montée dans le flux de la colonne d'app.vue, AVANT le conteneur de page : la carte
|
||||
de / perd ces 28 px à vue, jamais en dessous de la ligne de flottaison.
|
||||
-->
|
||||
<template>
|
||||
<nav v-if="courant" class="fil-echelle" :class="{ 'fil-echelle--long': voisins.length > 1 }" aria-label="Échelle courante">
|
||||
<span class="fil-echelle__pastille">{{ courant.echelle }}</span>
|
||||
<span class="fil-echelle__titre">{{ ECHELLES[courant.echelle].titre }}</span>
|
||||
<span class="fil-echelle__sep" aria-hidden="true">·</span>
|
||||
<span class="fil-echelle__courant" aria-current="page">{{ courant.onglet.libelle }}</span>
|
||||
<template v-for="o in voisins" :key="o.to">
|
||||
<span class="fil-echelle__sep" aria-hidden="true">·</span>
|
||||
<NuxtLink :to="o.to" class="fil-echelle__lien">{{ o.libelle }}</NuxtLink>
|
||||
</template>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ECHELLES, echelleDeRoute } from '~/utils/echelles'
|
||||
|
||||
const route = useRoute()
|
||||
const courant = computed(() => echelleDeRoute(route))
|
||||
const voisins = computed(() =>
|
||||
courant.value ? ECHELLES[courant.value.echelle].onglets.filter((o) => o !== courant.value!.onglet) : [],
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fil-echelle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
height: 28px;
|
||||
padding: 0 var(--space-sm);
|
||||
gap: 5px;
|
||||
overflow-x: auto;
|
||||
scrollbar-width: none;
|
||||
white-space: nowrap;
|
||||
font-size: 0.72rem;
|
||||
line-height: 1;
|
||||
background: var(--surface);
|
||||
border-bottom: 1px solid var(--bg-alt);
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
|
||||
.fil-echelle::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fil-echelle__pastille {
|
||||
padding: 2px 5px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font-weight: var(--fw-bold);
|
||||
}
|
||||
|
||||
.fil-echelle__courant {
|
||||
font-weight: var(--fw-bold);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.fil-echelle__lien {
|
||||
color: inherit;
|
||||
text-decoration: underline;
|
||||
text-decoration-color: var(--border);
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
|
||||
.fil-echelle__lien:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
/* Groupe à trois onglets (M) sous 400 px : l'accroche se replie sur sa pastille
|
||||
(lue quand même par les lecteurs d'écran), sinon « Codev » sort de l'écran. */
|
||||
@media (max-width: 399px) {
|
||||
.fil-echelle--long .fil-echelle__titre {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0 0 0 0);
|
||||
}
|
||||
.fil-echelle--long .fil-echelle__titre + .fil-echelle__sep {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.fil-echelle {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,52 +0,0 @@
|
||||
<template>
|
||||
<div class="space-y-1.5">
|
||||
<p class="text-xs font-bold uppercase tracking-widest" style="color: var(--nav-text-muted);">Fonction</p>
|
||||
<ChipGroup aria-label="Filtrer par fonction">
|
||||
<Chip
|
||||
v-for="fn in FONCTIONS"
|
||||
:key="fn"
|
||||
:label="fn"
|
||||
variant="fonction"
|
||||
:active="modelValue.includes(fn)"
|
||||
:count="modelValue.includes(fn) ? (modelValue.indexOf(fn) + 1) : (counts[fn] ?? 0)"
|
||||
@toggle="toggle(fn)"
|
||||
/>
|
||||
</ChipGroup>
|
||||
<p v-if="modelValue.length" class="text-xs pt-0.5" style="color: var(--nav-text-muted);">
|
||||
{{ modelValue.length }} actif{{ modelValue.length > 1 ? 's' : '' }}
|
||||
<button @click="emit('update:modelValue', [])" class="ml-2 underline hover:opacity-70">Effacer</button>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const FONCTIONS = [
|
||||
'Juridique',
|
||||
'Technique',
|
||||
'Économique',
|
||||
'Administratif',
|
||||
'Chantier',
|
||||
'Comptabilité',
|
||||
'Développement',
|
||||
'Formation',
|
||||
"Gestion d'agence",
|
||||
'Santé mentale',
|
||||
] as const
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: string[]
|
||||
counts: Record<string, number>
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: string[]]
|
||||
}>()
|
||||
|
||||
function toggle(fn: string) {
|
||||
if (props.modelValue.includes(fn)) {
|
||||
emit('update:modelValue', props.modelValue.filter(f => f !== fn))
|
||||
} else {
|
||||
emit('update:modelValue', [...props.modelValue, fn])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,314 @@
|
||||
<!--
|
||||
GrapheMots — B6-M2. Le graphe des sept mots de « Partir de soi » : un nœud
|
||||
central, les mots en couronne (ordre de la slide, sens horaire depuis le
|
||||
haut), et autour de chaque mot ses ressources en petits nœuds-feuilles.
|
||||
Vocabulaire du motif maillage (DESIGN-SYSTEM) : nœuds pleins, arêtes fines,
|
||||
un nœud central mis en avant. Statique et déterministe : pas de simulation,
|
||||
rien ne bouge ; la mise en page est une fonction pure de la taille mesurée.
|
||||
|
||||
Il vit dans le slot #carte de VueFiches et ne connaît que `vf` :
|
||||
clic / Entrée sur un mot ouvre sa fiche (`vf.ouvrirFiche`), le mot ouvert
|
||||
(`vf.ficheId`) et le mot survolé dans la liste (`vf.survolId`) s'allument,
|
||||
les mots hors du résultat (`vf.idsResultat`) s'estompent sans disparaître.
|
||||
Les feuilles ne sont pas dans l'ordre de tabulation (on y accède par leur
|
||||
mot) ; leur libellé apparaît au survol.
|
||||
-->
|
||||
<template>
|
||||
<div ref="racine" class="gm">
|
||||
<svg
|
||||
class="gm__svg"
|
||||
:viewBox="`0 0 ${taille.w} ${taille.h}`"
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
role="group"
|
||||
aria-labelledby="gm-titre"
|
||||
>
|
||||
<title id="gm-titre">Graphe des sept mots de « Partir de soi » et des ressources de chacun</title>
|
||||
|
||||
<!-- Arêtes : centre → mot, mot → feuilles -->
|
||||
<g class="gm__aretes" aria-hidden="true">
|
||||
<template v-for="n in noeuds" :key="`a-${n.id}`">
|
||||
<line
|
||||
:x1="centre.x" :y1="centre.y" :x2="n.x" :y2="n.y"
|
||||
class="gm__arete" :class="{ 'gm__arete--vif': allume(n.id), 'gm__arete--hors': hors(n.id) }"
|
||||
/>
|
||||
<line
|
||||
v-for="f in n.feuilles" :key="`a-${n.id}-${f.id}`"
|
||||
:x1="n.x" :y1="n.y" :x2="f.x" :y2="f.y"
|
||||
class="gm__arete gm__arete--feuille" :class="{ 'gm__arete--vif': allume(n.id), 'gm__arete--hors': hors(n.id) }"
|
||||
/>
|
||||
</template>
|
||||
</g>
|
||||
|
||||
<!-- Nœud central -->
|
||||
<g class="gm__centre" aria-hidden="true">
|
||||
<circle :cx="centre.x" :cy="centre.y" :r="RAYON_CENTRE" class="gm__centre-rond" />
|
||||
<text :x="centre.x" :y="centre.y - 7" class="gm__centre-texte" text-anchor="middle">Partir</text>
|
||||
<text :x="centre.x" :y="centre.y + 8" class="gm__centre-texte" text-anchor="middle">de soi</text>
|
||||
</g>
|
||||
|
||||
<!-- Feuilles (ressources) -->
|
||||
<g v-for="n in noeuds" :key="`f-${n.id}`" class="gm__feuilles" :class="{ 'gm__feuilles--hors': hors(n.id) }">
|
||||
<circle
|
||||
v-for="f in n.feuilles" :key="f.id"
|
||||
:cx="f.x" :cy="f.y" r="5.5"
|
||||
class="gm__feuille" :class="{ 'gm__feuille--vive': allume(n.id) || survolFeuille === `${n.id}/${f.id}` }"
|
||||
@click="vf.ouvrirFiche(n.id)"
|
||||
@mouseenter="survolerFeuille(n.id, f.id)"
|
||||
@mouseleave="survolerFeuille(null, null)"
|
||||
>
|
||||
<title>{{ f.titre }}</title>
|
||||
</circle>
|
||||
</g>
|
||||
|
||||
<!-- Mots -->
|
||||
<g
|
||||
v-for="n in noeuds"
|
||||
:key="n.id"
|
||||
class="gm__mot"
|
||||
:class="{ 'gm__mot--actif': allume(n.id), 'gm__mot--hors': hors(n.id), 'gm__mot--vide': n.vide }"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
:aria-label="n.aria"
|
||||
:aria-pressed="actif(n.id)"
|
||||
@click="vf.ouvrirFiche(n.id)"
|
||||
@keydown.enter.prevent="vf.ouvrirFiche(n.id)"
|
||||
@keydown.space.prevent="vf.ouvrirFiche(n.id)"
|
||||
@mouseenter="vf.survolId = n.id"
|
||||
@mouseleave="vf.survolId = null"
|
||||
@focus="vf.survolId = n.id"
|
||||
@blur="vf.survolId = null"
|
||||
>
|
||||
<rect
|
||||
:x="n.x - n.l / 2" :y="n.y - n.h / 2" :width="n.l" :height="n.h" :rx="n.h / 2"
|
||||
class="gm__pilule"
|
||||
/>
|
||||
<text :x="n.x" :y="n.y" text-anchor="middle" class="gm__libelle" aria-hidden="true">
|
||||
<tspan v-for="(ligne, i) in n.lignes" :key="i" :x="n.x" :y="n.y + (i - (n.lignes.length - 1) / 2) * INTERLIGNE + 4.5">{{ ligne }}</tspan>
|
||||
</text>
|
||||
</g>
|
||||
|
||||
<!-- Libellé de la feuille survolée, au-dessus de tout -->
|
||||
<g v-if="bulle" class="gm__bulle" aria-hidden="true">
|
||||
<rect :x="bulle.x - bulle.l / 2" :y="bulle.y - 11" :width="bulle.l" height="22" rx="6" class="gm__bulle-fond" />
|
||||
<text :x="bulle.x" :y="bulle.y + 4" text-anchor="middle" class="gm__bulle-texte">{{ bulle.texte }}</text>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { VueFichesEtat } from '~/composables/useVueFiches'
|
||||
|
||||
const props = defineProps<{
|
||||
vf: VueFichesEtat
|
||||
mots: { id: string; mot: string; ressources: { id: string; titre: string }[]; vide?: boolean }[]
|
||||
}>()
|
||||
|
||||
const RAYON_CENTRE = 36
|
||||
const INTERLIGNE = 15
|
||||
const CARACTERES_LIGNE = 16
|
||||
const PORTEE_FEUILLES = 46
|
||||
const MARGE = 10
|
||||
|
||||
// ── Taille : mesurée au montage (le rendu serveur part d'une taille plausible) ──
|
||||
const racine = ref<HTMLElement | null>(null)
|
||||
const taille = reactive({ w: 720, h: 600 })
|
||||
onMounted(() => {
|
||||
const el = racine.value
|
||||
if (!el || typeof ResizeObserver === 'undefined') return
|
||||
const maj = (w: number, h: number) => {
|
||||
if (w > 40 && h > 40) { taille.w = Math.round(w); taille.h = Math.round(h) }
|
||||
}
|
||||
maj(el.clientWidth, el.clientHeight)
|
||||
const ro = new ResizeObserver((entrees) => {
|
||||
const r = entrees[0]?.contentRect
|
||||
if (r) maj(r.width, r.height)
|
||||
})
|
||||
ro.observe(el)
|
||||
onBeforeUnmount(() => ro.disconnect())
|
||||
})
|
||||
|
||||
// ── Mise en page : fonction pure de (taille, mots) ──
|
||||
/** Une ligne si ça tient, sinon deux lignes équilibrées (« naviguer / avec soi », pas « naviguer avec / soi »). */
|
||||
function couper(texte: string): string[] {
|
||||
if (texte.length <= CARACTERES_LIGNE) return [texte]
|
||||
const mots = texte.split(' ')
|
||||
let meilleur: string[] = [texte]
|
||||
let pire = Infinity
|
||||
for (let i = 1; i < mots.length; i++) {
|
||||
const l = [mots.slice(0, i).join(' '), mots.slice(i).join(' ')]
|
||||
const m = Math.max(l[0].length, l[1].length)
|
||||
if (m < pire) { pire = m; meilleur = l }
|
||||
}
|
||||
return meilleur
|
||||
}
|
||||
|
||||
function tronquer(t: string, max = 44): string {
|
||||
return t.length > max ? `${t.slice(0, max - 1).trimEnd()}…` : t
|
||||
}
|
||||
|
||||
const centre = computed(() => ({ x: taille.w / 2, y: taille.h / 2 }))
|
||||
|
||||
const noeuds = computed(() => {
|
||||
const n = props.mots.length
|
||||
const { w, h } = taille
|
||||
const base = props.mots.map((m) => {
|
||||
const lignes = couper(m.mot)
|
||||
return { m, lignes, l: Math.max(...lignes.map((x) => x.length)) * 6.9 + 24, h: lignes.length * INTERLIGNE + 11 }
|
||||
})
|
||||
const lMax = Math.max(...base.map((b) => b.l))
|
||||
const hMax = Math.max(...base.map((b) => b.h))
|
||||
const rx = Math.max(48, w / 2 - lMax / 2 - PORTEE_FEUILLES - MARGE)
|
||||
const ry = Math.max(70, h / 2 - hMax / 2 - PORTEE_FEUILLES - MARGE)
|
||||
const cx = centre.value.x
|
||||
const cy = centre.value.y
|
||||
|
||||
// Colonne étroite : la couronne ne tient plus (les mots du bas se chevaucheraient).
|
||||
// Les mots s'étagent alors en zigzag autour du centre, une rangée chacun, dans le
|
||||
// même sens de lecture (haut, puis la droite en descendant, puis la gauche en remontant),
|
||||
// et leurs ressources se rangent SOUS le mot.
|
||||
const etroit = rx < lMax * 1.3
|
||||
let place: { x: number; y: number }[]
|
||||
if (etroit) {
|
||||
const droite = Math.ceil((n - 1) / 2)
|
||||
const rangsDroite = Array.from({ length: droite }, (_, i) => 1 + 2 * i)
|
||||
const rangsGauche = Array.from({ length: n }, (_, i) => i).filter((r) => r > 0 && !rangsDroite.includes(r)).reverse()
|
||||
const rang = (i: number) => (i === 0 ? 0 : i <= droite ? rangsDroite[i - 1] : rangsGauche[i - droite - 1])
|
||||
const y0 = hMax / 2 + MARGE
|
||||
const y1 = h - hMax / 2 - MARGE - 24 // de la place sous le dernier mot pour ses feuilles
|
||||
const pas = n > 1 ? (y1 - y0) / (n - 1) : 0
|
||||
const dx = Math.max(0, w / 2 - lMax / 2 - 6)
|
||||
place = base.map((_, i) => ({ x: i === 0 ? cx : i <= droite ? cx + dx : cx - dx, y: y0 + rang(i) * pas }))
|
||||
} else {
|
||||
place = base.map((_, i) => {
|
||||
const a = -Math.PI / 2 + (i * 2 * Math.PI) / n // depuis le haut, sens horaire
|
||||
return { x: cx + rx * Math.cos(a), y: cy + ry * Math.sin(a) }
|
||||
})
|
||||
}
|
||||
|
||||
return base.map((b, i) => {
|
||||
const { x, y } = place[i]
|
||||
const k = b.m.ressources.length
|
||||
let feuilles: { id: string; titre: string; x: number; y: number }[]
|
||||
if (etroit) {
|
||||
const ecart = k > 1 ? Math.min(17, (b.l - 20) / (k - 1)) : 0
|
||||
feuilles = b.m.ressources.map((r, j) => ({
|
||||
id: r.id,
|
||||
titre: r.titre,
|
||||
x: x + (j - (k - 1) / 2) * ecart,
|
||||
y: y + b.h / 2 + 13 + (j % 2 ? 9 : 0),
|
||||
}))
|
||||
} else {
|
||||
// direction « vers l'extérieur » réelle (l'ellipse n'est pas un cercle)
|
||||
const dir = Math.atan2(y - cy, x - cx)
|
||||
const pas = Math.min(0.55, 2.3 / Math.max(k, 1))
|
||||
const dist = Math.abs(Math.cos(dir)) * (b.l / 2) + Math.abs(Math.sin(dir)) * (b.h / 2) + 20
|
||||
feuilles = b.m.ressources.map((r, j) => {
|
||||
const t = dir + (j - (k - 1) / 2) * pas
|
||||
const d = dist + (j % 2 ? 12 : 0)
|
||||
return {
|
||||
id: r.id,
|
||||
titre: r.titre,
|
||||
x: Math.min(w - 8, Math.max(8, x + d * Math.cos(t))),
|
||||
y: Math.min(h - 8, Math.max(8, y + d * Math.sin(t))),
|
||||
}
|
||||
})
|
||||
}
|
||||
return {
|
||||
id: b.m.id,
|
||||
x, y, l: b.l, h: b.h, lignes: b.lignes,
|
||||
vide: !!b.m.vide || k === 0,
|
||||
aria: `${b.m.mot}, ${k === 0 ? 'aucune ressource pour l’instant' : k === 1 ? '1 ressource' : `${k} ressources`}`,
|
||||
feuilles,
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// ── États (tout vient de vf) ──
|
||||
const actif = (id: string) => String(props.vf.ficheId ?? '') === id
|
||||
const survol = (id: string) => props.vf.survolId != null && String(props.vf.survolId) === id
|
||||
const allume = (id: string) => actif(id) || survol(id)
|
||||
const hors = (id: string) => !props.vf.idsResultat.has(id)
|
||||
|
||||
const survolFeuille = ref<string | null>(null)
|
||||
function survolerFeuille(mot: string | null, feuille: string | null) {
|
||||
survolFeuille.value = mot && feuille ? `${mot}/${feuille}` : null
|
||||
props.vf.survolId = mot
|
||||
}
|
||||
|
||||
const bulle = computed(() => {
|
||||
if (!survolFeuille.value) return null
|
||||
const [mot, feuille] = survolFeuille.value.split('/')
|
||||
const f = noeuds.value.find((n) => n.id === mot)?.feuilles.find((x) => x.id === feuille)
|
||||
if (!f) return null
|
||||
const texte = tronquer(f.titre)
|
||||
const l = texte.length * 6.3 + 16
|
||||
const x = Math.min(taille.w - l / 2 - 4, Math.max(l / 2 + 4, f.x))
|
||||
const y = f.y < 30 ? f.y + 24 : f.y - 18
|
||||
return { x, y, l, texte }
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.gm {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
background: var(--bg-alt);
|
||||
}
|
||||
.gm__svg {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
/* Arêtes fines */
|
||||
.gm__arete { stroke: var(--nav-primary-solid); stroke-width: 1; stroke-opacity: 0.35; }
|
||||
.gm__arete--feuille { stroke-opacity: 0.28; }
|
||||
.gm__arete--vif { stroke-width: 2; stroke-opacity: 0.8; }
|
||||
.gm__arete--hors { stroke-opacity: 0.12; }
|
||||
|
||||
/* Nœud central, mis en avant */
|
||||
.gm__centre-rond { fill: var(--nav-primary-solid); stroke: var(--accent); stroke-width: 3; }
|
||||
.gm__centre-texte { fill: var(--nav-text-on-primary); font-size: 12px; font-weight: 700; }
|
||||
|
||||
/* Feuilles : petits nœuds pleins */
|
||||
.gm__feuille {
|
||||
fill: var(--nav-primary-solid);
|
||||
stroke: var(--bg-alt);
|
||||
stroke-width: 1.5;
|
||||
cursor: pointer;
|
||||
transition: fill 120ms ease-out;
|
||||
}
|
||||
.gm__feuille--vive { fill: var(--accent); stroke: var(--nav-primary-solid); }
|
||||
.gm__feuilles--hors { opacity: 0.3; }
|
||||
|
||||
/* Mots : pastilles qui portent leur libellé */
|
||||
.gm__mot { cursor: pointer; outline: none; transition: opacity 120ms ease-out; }
|
||||
.gm__pilule {
|
||||
fill: var(--surface);
|
||||
stroke: var(--nav-primary-solid);
|
||||
stroke-width: 2;
|
||||
transition: fill 120ms ease-out, stroke 120ms ease-out;
|
||||
}
|
||||
.gm__libelle { fill: var(--text); font-size: 12.5px; font-weight: 600; pointer-events: none; }
|
||||
.gm__mot--vide .gm__pilule { stroke-dasharray: 5 4; }
|
||||
.gm__mot--actif .gm__pilule { fill: var(--accent); stroke: var(--nav-primary-solid); }
|
||||
.gm__mot--actif .gm__libelle { fill: var(--on-accent); }
|
||||
.gm__mot--hors { opacity: 0.4; }
|
||||
.gm__mot:focus-visible .gm__pilule { stroke: var(--focus-ring); stroke-width: 4; }
|
||||
|
||||
/* Libellé de feuille */
|
||||
.gm__bulle { pointer-events: none; }
|
||||
.gm__bulle-fond { fill: var(--surface); stroke: var(--nav-primary-solid); stroke-width: 1; }
|
||||
.gm__bulle-texte { fill: var(--text); font-size: 11.5px; font-weight: 500; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.gm__feuille, .gm__mot, .gm__pilule { transition: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -1,95 +0,0 @@
|
||||
<template>
|
||||
<div class="hashtag-filter" style="padding: 8px 12px; background: var(--nav-surface);">
|
||||
<!-- Filtres famille — couleurs propres par famille (hors grammaire dimension Chip, non touché B3-M1) -->
|
||||
<div style="margin-bottom: 6px;">
|
||||
<span class="filter-label">FAMILLES</span>
|
||||
<div class="chips-row">
|
||||
<span
|
||||
v-for="fam in FAMILLES"
|
||||
:key="fam.id"
|
||||
class="chip"
|
||||
:style="selectedFamille === fam.id
|
||||
? `background: ${fam.color}; color: white; font-weight: 600; border: 2px solid ${fam.color};`
|
||||
: `background: var(--nav-bg-alt); color: ${fam.color}; border: 2px solid ${fam.color}; font-weight: 600;`"
|
||||
@click="toggleFamille(fam.id)"
|
||||
>{{ fam.shortLabel }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filtres hashtags avec toggle -->
|
||||
<div>
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px;">
|
||||
<span class="filter-label">HASHTAGS</span>
|
||||
<button
|
||||
@click="hashtagsVisible = !hashtagsVisible"
|
||||
style="font-size: 0.7rem; color: var(--nav-text-muted); background: none; border: none; cursor: pointer; text-decoration: underline; padding: 0;"
|
||||
>{{ hashtagsVisible ? 'Replier' : 'Afficher (' + props.allHashtags.length + ')' }}</button>
|
||||
</div>
|
||||
<ChipGroup v-if="hashtagsVisible" aria-label="Filtrer par hashtag">
|
||||
<Chip
|
||||
v-for="tag in props.allHashtags"
|
||||
:key="tag"
|
||||
:label="tag"
|
||||
variant="fonction"
|
||||
:active="selectedHashtags.includes(tag)"
|
||||
@toggle="toggleHashtag(tag)"
|
||||
/>
|
||||
</ChipGroup>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const FAMILLES = [
|
||||
{ id: 1, shortLabel: 'Réemploi', color: '#a85d3e' },
|
||||
{ id: 2, shortLabel: 'Frugalité', color: '#c4a472' },
|
||||
{ id: 3, shortLabel: 'Social', color: '#d4a017' },
|
||||
{ id: 4, shortLabel: 'Collectifs', color: '#5a7a4a' },
|
||||
{ id: 5, shortLabel: 'Urbanisme', color: '#3d6a8c' },
|
||||
{ id: 6, shortLabel: 'Recherche', color: '#6b3fa0' },
|
||||
]
|
||||
|
||||
const props = defineProps<{
|
||||
allHashtags: string[]
|
||||
selectedHashtags: string[]
|
||||
selectedFamille: number | null
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:selectedHashtags': [v: string[]]
|
||||
'update:selectedFamille': [v: number | null]
|
||||
}>()
|
||||
|
||||
const hashtagsVisible = ref(false)
|
||||
|
||||
function toggleFamille(id: number) {
|
||||
emit('update:selectedFamille', props.selectedFamille === id ? null : id)
|
||||
}
|
||||
|
||||
function toggleHashtag(tag: string) {
|
||||
const current = props.selectedHashtags
|
||||
emit('update:selectedHashtags',
|
||||
current.includes(tag) ? current.filter(t => t !== tag) : [...current, tag]
|
||||
)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.filter-label {
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
color: var(--nav-text-muted);
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.chips-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
|
||||
.chip {
|
||||
cursor: pointer;
|
||||
padding: 3px 10px;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.75rem;
|
||||
transition: all 0.15s;
|
||||
user-select: none;
|
||||
}
|
||||
</style>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="media-tab-projets" style="padding: 1.5rem; overflow-y: auto;">
|
||||
<div style="max-width: 70ch; margin-bottom: 1.5rem;">
|
||||
<h2 style="font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--nav-text);">PFE engagés</h2>
|
||||
<h2 style="font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--nav-text);">Publications</h2>
|
||||
<p style="font-size: 0.9rem; line-height: 1.6; color: var(--nav-text);">
|
||||
Mutualiser le savoir. Voici les PFE engagés publiés en ligne dont nous avons connaissance.
|
||||
Partage-nous le lien de ton travail si tu veux participer à cette initiative.
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
<!--
|
||||
MobileSheet — Bottom sheet swipable 3 états (collapsed / half / full)
|
||||
Pattern Google Maps mobile
|
||||
|
||||
États :
|
||||
- collapsed : juste la poignée + compteur (~56px)
|
||||
- half : ~50dvh (état initial)
|
||||
- full : ~92dvh (plein écran)
|
||||
|
||||
Déclenché par touch/drag sur la poignée
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
class="mobile-sheet"
|
||||
:class="`mobile-sheet--${state}`"
|
||||
:style="{ transform: `translateY(${dragOffset}px)` }"
|
||||
>
|
||||
<!-- Poignée drag -->
|
||||
<div
|
||||
class="sheet-handle-area"
|
||||
@touchstart.passive="onTouchStart"
|
||||
@touchmove.passive="onTouchMove"
|
||||
@touchend="onTouchEnd"
|
||||
>
|
||||
<div class="sheet-handle-bar" />
|
||||
</div>
|
||||
|
||||
<!-- Compteur compact (toujours visible) -->
|
||||
<div class="sheet-header" @click="onHeaderClick">
|
||||
<span class="sheet-counter">
|
||||
<span v-if="pending">Chargement…</span>
|
||||
<span v-else>{{ resultCount }} fiche{{ resultCount > 1 ? 's' : '' }}</span>
|
||||
</span>
|
||||
<svg
|
||||
width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2.5" stroke-linecap="round" aria-hidden="true"
|
||||
class="sheet-chevron"
|
||||
:class="{ 'sheet-chevron--up': state !== 'collapsed' }"
|
||||
style="color: var(--nav-text-muted); flex-shrink: 0;"
|
||||
>
|
||||
<polyline points="18 15 12 9 6 15"/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<!-- Contenu scrollable (caché si collapsed) -->
|
||||
<div
|
||||
v-show="state !== 'collapsed'"
|
||||
ref="contentEl"
|
||||
class="sheet-content"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
type SheetState = 'collapsed' | 'half' | 'full'
|
||||
|
||||
const props = defineProps<{
|
||||
resultCount: number
|
||||
pending?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'state-change': [state: SheetState]
|
||||
}>()
|
||||
|
||||
const state = ref<SheetState>('half')
|
||||
const dragOffset = ref(0)
|
||||
const contentEl = ref<HTMLElement | null>(null)
|
||||
|
||||
let touchStartY = 0
|
||||
let touchCurrentY = 0
|
||||
let isDragging = false
|
||||
|
||||
// Cycle états au clic header
|
||||
function onHeaderClick() {
|
||||
if (state.value === 'collapsed') {
|
||||
setSheetState('half')
|
||||
} else if (state.value === 'half') {
|
||||
setSheetState('full')
|
||||
} else {
|
||||
setSheetState('collapsed')
|
||||
}
|
||||
}
|
||||
|
||||
function setSheetState(next: SheetState) {
|
||||
state.value = next
|
||||
dragOffset.value = 0
|
||||
emit('state-change', next)
|
||||
}
|
||||
|
||||
// Touch handlers
|
||||
function onTouchStart(e: TouchEvent) {
|
||||
touchStartY = e.touches[0].clientY
|
||||
touchCurrentY = touchStartY
|
||||
isDragging = true
|
||||
dragOffset.value = 0
|
||||
}
|
||||
|
||||
function onTouchMove(e: TouchEvent) {
|
||||
if (!isDragging) return
|
||||
touchCurrentY = e.touches[0].clientY
|
||||
const delta = touchCurrentY - touchStartY
|
||||
// Limiter le drag visuellement (résistance)
|
||||
dragOffset.value = delta * 0.6
|
||||
}
|
||||
|
||||
function onTouchEnd() {
|
||||
if (!isDragging) return
|
||||
isDragging = false
|
||||
|
||||
const delta = touchCurrentY - touchStartY
|
||||
const threshold = 60 // px minimum pour changer d'état
|
||||
|
||||
if (delta > threshold) {
|
||||
// Swipe vers le bas → état inférieur
|
||||
if (state.value === 'full') setSheetState('half')
|
||||
else if (state.value === 'half') setSheetState('collapsed')
|
||||
else setSheetState('collapsed')
|
||||
} else if (delta < -threshold) {
|
||||
// Swipe vers le haut → état supérieur
|
||||
if (state.value === 'collapsed') setSheetState('half')
|
||||
else if (state.value === 'half') setSheetState('full')
|
||||
else setSheetState('full')
|
||||
} else {
|
||||
// Snap back
|
||||
dragOffset.value = 0
|
||||
}
|
||||
|
||||
// Transition smooth au relâchement
|
||||
dragOffset.value = 0
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.mobile-sheet {
|
||||
position: fixed;
|
||||
inset-x: 0;
|
||||
bottom: 0;
|
||||
z-index: 500;
|
||||
background: var(--nav-surface);
|
||||
border-radius: 16px 16px 0 0;
|
||||
box-shadow: 0 -4px 24px rgba(26, 34, 56, 0.14);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transition: height 0.3s cubic-bezier(0.32, 0.72, 0, 1), transform 0.05s linear;
|
||||
will-change: height, transform;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ── États hauteur ───────────────────────────────────────────────────── */
|
||||
.mobile-sheet--collapsed {
|
||||
height: 56px;
|
||||
}
|
||||
|
||||
.mobile-sheet--half {
|
||||
height: 50dvh;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.mobile-sheet--full {
|
||||
height: 92dvh;
|
||||
}
|
||||
|
||||
/* ── Poignée ─────────────────────────────────────────────────────────── */
|
||||
.sheet-handle-area {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 10px 0 4px;
|
||||
cursor: grab;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.sheet-handle-area:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.sheet-handle-bar {
|
||||
width: 36px;
|
||||
height: 4px;
|
||||
border-radius: 2px;
|
||||
background: var(--nav-bg-alt);
|
||||
}
|
||||
|
||||
/* ── Header compteur ─────────────────────────────────────────────────── */
|
||||
.sheet-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 16px 8px;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.sheet-counter {
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
color: var(--nav-text-muted);
|
||||
}
|
||||
|
||||
.sheet-chevron {
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.sheet-chevron--up {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/* ── Contenu scrollable ──────────────────────────────────────────────── */
|
||||
.sheet-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,148 @@
|
||||
<!--
|
||||
NavEchelles — B10-M2
|
||||
Barre des trois échelles S / M / XL, lue depuis utils/echelles.ts (source unique).
|
||||
≥ 1280 px : les trois groupes ; 768-1279 px : le seul groupe de la page courante ;
|
||||
< 768 px : rien (FilEchelle + NavTiroir prennent le relais).
|
||||
Chaque groupe = <ul> étiqueté par son accroche (pastille + titre de l'échelle).
|
||||
-->
|
||||
<template>
|
||||
<nav class="nav-echelles" aria-label="Échelles">
|
||||
<div
|
||||
v-for="id in ORDRE_ECHELLES"
|
||||
:key="id"
|
||||
class="nav-echelles__grp"
|
||||
:class="{ 'nav-echelles__grp--courant': courant?.echelle === id }"
|
||||
>
|
||||
<span :id="`nav-echelle-${id}`" class="nav-echelles__kick">
|
||||
<span class="nav-echelles__pastille">{{ id }}</span>{{ ECHELLES[id].titre }}
|
||||
</span>
|
||||
<ul class="nav-echelles__tabs" :aria-labelledby="`nav-echelle-${id}`">
|
||||
<li v-for="o in ECHELLES[id].onglets" :key="o.to">
|
||||
<NuxtLink
|
||||
:to="o.to"
|
||||
class="nav-echelles__tab"
|
||||
:class="{ 'nav-echelles__tab--actif': o.actif(route) }"
|
||||
:aria-current="o.actif(route) ? 'page' : undefined"
|
||||
>{{ o.libelle }}</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ECHELLES, ORDRE_ECHELLES, echelleDeRoute } from '~/utils/echelles'
|
||||
|
||||
const route = useRoute()
|
||||
const courant = computed(() => echelleDeRoute(route))
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.nav-echelles {
|
||||
display: none;
|
||||
align-self: stretch;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
gap: var(--space-lg);
|
||||
}
|
||||
|
||||
.nav-echelles__grp {
|
||||
position: relative;
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.nav-echelles__kick {
|
||||
padding: 0 var(--space-xs);
|
||||
font-size: 0.66rem;
|
||||
font-weight: var(--fw-semibold);
|
||||
letter-spacing: 0.04em;
|
||||
line-height: 1.3;
|
||||
white-space: nowrap;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
|
||||
.nav-echelles__grp--courant .nav-echelles__kick {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.nav-echelles__pastille {
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
padding: 0 5px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font-weight: var(--fw-bold);
|
||||
}
|
||||
|
||||
.nav-echelles__tabs {
|
||||
display: flex;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.nav-echelles__tab {
|
||||
display: inline-block;
|
||||
padding: 4px 9px 9px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: var(--fw-medium);
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
border-bottom: 2px solid transparent;
|
||||
transition: color var(--dur-fast) var(--ease-out);
|
||||
}
|
||||
|
||||
.nav-echelles__tab:hover {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.nav-echelles__tab:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: -2px;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.nav-echelles__tab--actif {
|
||||
color: var(--text);
|
||||
font-weight: var(--fw-semibold);
|
||||
border-bottom-color: var(--nav-primary-solid);
|
||||
}
|
||||
|
||||
/* 768-1279 : le seul groupe courant, aligné à gauche après le logo */
|
||||
@media (min-width: 768px) {
|
||||
.nav-echelles {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.nav-echelles__grp--courant {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
/* ≥ 1280 : les trois groupes, centrés, séparés par un filet */
|
||||
@media (min-width: 1280px) {
|
||||
.nav-echelles {
|
||||
justify-content: center;
|
||||
}
|
||||
.nav-echelles__grp {
|
||||
display: flex;
|
||||
}
|
||||
.nav-echelles__grp + .nav-echelles__grp::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: calc(var(--space-lg) / -2);
|
||||
top: 10px;
|
||||
bottom: 10px;
|
||||
border-left: 1px solid var(--border);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.nav-echelles__tab { transition: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -24,10 +24,16 @@ interface Org {
|
||||
const props = defineProps<{
|
||||
orgs: Org[]
|
||||
selectedId?: number | null
|
||||
/** Fiche survolée dans la liste (B11) : épingle safran, sans recentrer. */
|
||||
survolId?: number | null
|
||||
/** « Voir sur la carte » (B12) : zoome jusqu'à l'épingle, sortie de son cluster ; `n` change à chaque demande. */
|
||||
centrage?: { id: number; n: number } | null
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'select-org': [id: number]
|
||||
/** Survol d'une épingle (B11) : la liste allume la carte-fiche. */
|
||||
survol: [id: number | null]
|
||||
}>()
|
||||
|
||||
const mapContainer = ref<HTMLElement | null>(null)
|
||||
@@ -35,14 +41,15 @@ let mapInstance: Map | null = null
|
||||
let clusterGroup: any = null
|
||||
const markers = new Map<number, Marker>()
|
||||
let tileLayerInstance: any = null
|
||||
let resizeObserver: ResizeObserver | null = null
|
||||
|
||||
// Créer une DivIcon pour les pins personnalisés
|
||||
function createPinIcon(isPrioritaire: boolean, isSelected = false): DivIcon {
|
||||
function createPinIcon(isPrioritaire: boolean, isSelected = false, isSurvol = false): DivIcon {
|
||||
const L = (window as any).L
|
||||
const bg = isPrioritaire ? '#f5b342' : 'rgba(26, 34, 56, 0.6)'
|
||||
const border = isPrioritaire ? '#1a2238' : '#ffffff'
|
||||
const size = isSelected ? 18 : 14
|
||||
const shadow = isSelected ? '0 0 0 4px rgba(245,179,66,0.5)' : 'none'
|
||||
const bg = isSurvol || isPrioritaire ? '#f5b342' : 'rgba(26, 34, 56, 0.6)'
|
||||
const border = isPrioritaire || isSurvol ? '#1a2238' : '#ffffff'
|
||||
const size = isSelected || isSurvol ? 18 : 14
|
||||
const shadow = isSelected || isSurvol ? '0 0 0 4px rgba(245,179,66,0.5)' : 'none'
|
||||
|
||||
return L.divIcon({
|
||||
className: '',
|
||||
@@ -76,6 +83,7 @@ async function initMap() {
|
||||
;(window as any).L = L
|
||||
// @ts-ignore — étend L.MarkerClusterGroup en side effect
|
||||
await import('leaflet.markercluster')
|
||||
if (!mapContainer.value?.isConnected) return // page quittée pendant le chargement (ex. ?random=1)
|
||||
const MarkerClusterGroup = L.MarkerClusterGroup
|
||||
|
||||
mapInstance = L.map(mapContainer.value, {
|
||||
@@ -125,6 +133,14 @@ async function initMap() {
|
||||
|
||||
mapInstance.addLayer(clusterGroup)
|
||||
updateMarkers(L)
|
||||
|
||||
// B11 : la carte change de largeur sans que la fenêtre bouge (Mixte ↔ Carte ↔ Fiches)
|
||||
resizeObserver = new ResizeObserver(() => mapInstance?.invalidateSize({ pan: false }))
|
||||
resizeObserver.observe(mapContainer.value)
|
||||
}
|
||||
|
||||
function iconeDe(org: Org): DivIcon {
|
||||
return createPinIcon(!!org.prioritaire, org.Id === props.selectedId, org.Id === props.survolId)
|
||||
}
|
||||
|
||||
function updateMarkers(L?: any) {
|
||||
@@ -141,10 +157,7 @@ function updateMarkers(L?: any) {
|
||||
)
|
||||
|
||||
orgsWithCoords.forEach((org) => {
|
||||
const isSelected = org.Id === props.selectedId
|
||||
const icon = createPinIcon(!!org.prioritaire, isSelected)
|
||||
|
||||
const marker = leaflet.marker([org.latitude!, org.longitude!], { icon })
|
||||
const marker = leaflet.marker([org.latitude!, org.longitude!], { icon: iconeDe(org), title: org.nom })
|
||||
|
||||
const fonctions = org.tags_fonction
|
||||
? org.tags_fonction.split(',').map((f: string) => f.trim()).filter(Boolean).slice(0, 2).join(', ')
|
||||
@@ -163,6 +176,8 @@ function updateMarkers(L?: any) {
|
||||
`, { maxWidth: 240 })
|
||||
|
||||
marker.on('click', () => emit('select-org', org.Id))
|
||||
marker.on('mouseover', () => emit('survol', org.Id))
|
||||
marker.on('mouseout', () => emit('survol', null))
|
||||
|
||||
markers.set(org.Id, marker)
|
||||
clusterGroup.addLayer(marker)
|
||||
@@ -189,7 +204,7 @@ watch(
|
||||
const oldMarker = markers.get(oldId)
|
||||
const oldOrg = props.orgs.find(o => o.Id === oldId)
|
||||
if (oldMarker && oldOrg) {
|
||||
oldMarker.setIcon(createPinIcon(!!oldOrg.prioritaire, false))
|
||||
oldMarker.setIcon(iconeDe(oldOrg))
|
||||
}
|
||||
}
|
||||
// Mettre en avant le nouveau marker
|
||||
@@ -197,7 +212,7 @@ watch(
|
||||
const newMarker = markers.get(newId)
|
||||
const newOrg = props.orgs.find(o => o.Id === newId)
|
||||
if (newMarker && newOrg) {
|
||||
newMarker.setIcon(createPinIcon(!!newOrg.prioritaire, true))
|
||||
newMarker.setIcon(iconeDe(newOrg))
|
||||
// Centrer si visible
|
||||
const latLng = newMarker.getLatLng()
|
||||
mapInstance.panTo(latLng, { animate: true })
|
||||
@@ -206,6 +221,27 @@ watch(
|
||||
}
|
||||
)
|
||||
|
||||
// Survol depuis la liste : épingle safran, sans recentrer la carte
|
||||
watch(
|
||||
() => props.survolId,
|
||||
(newId, oldId) => {
|
||||
for (const id of [oldId, newId]) {
|
||||
if (id == null) continue
|
||||
const m = markers.get(id)
|
||||
const o = props.orgs.find(x => x.Id === id)
|
||||
if (m && o) m.setIcon(iconeDe(o))
|
||||
allumerCluster(m, id === newId)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// Épingle regroupée dans un cluster : c'est le cluster visible qui s'allume
|
||||
function allumerCluster(m: Marker | undefined, on: boolean) {
|
||||
const parent = m && clusterGroup?.getVisibleParent(m)
|
||||
const el = parent && parent !== m ? (parent as any)._icon?.firstElementChild as HTMLElement | undefined : undefined
|
||||
if (el) el.style.boxShadow = on ? '0 0 0 4px #f5b342' : ''
|
||||
}
|
||||
|
||||
// Watcher dark mode — switch tuile CartoDB light_all ↔ dark_all
|
||||
function updateTileTheme(dark: boolean) {
|
||||
if (!mapInstance || !tileLayerInstance) return
|
||||
@@ -235,9 +271,26 @@ onMounted(() => {
|
||||
|
||||
onUnmounted(() => {
|
||||
themeObserver?.disconnect()
|
||||
resizeObserver?.disconnect()
|
||||
if (mapInstance) {
|
||||
mapInstance.remove()
|
||||
mapInstance = null
|
||||
}
|
||||
})
|
||||
|
||||
// « Voir sur la carte » (B12) : la carte vient peut-être de s'afficher (Fiches → Mixte) ;
|
||||
// on attend sa taille réelle, puis on sort l'épingle de son cluster.
|
||||
watch(
|
||||
() => props.centrage?.n,
|
||||
() => {
|
||||
const c = props.centrage
|
||||
if (!c) return
|
||||
setTimeout(() => {
|
||||
if (!mapInstance || !clusterGroup) return
|
||||
mapInstance.invalidateSize({ pan: false })
|
||||
const m = markers.get(c.id)
|
||||
if (m) clusterGroup.zoomToShowLayer(m, () => mapInstance?.panTo(m.getLatLng(), { animate: true }))
|
||||
}, 260)
|
||||
},
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -21,10 +21,16 @@ const FAMILLE_COLORS: Record<number, string> = {
|
||||
const props = defineProps<{
|
||||
structures: StructureV2[]
|
||||
selectedId?: string | null
|
||||
/** Fiche survolée dans la liste (B11) : épingle cerclée de safran, sans recentrer. */
|
||||
survolId?: string | null
|
||||
/** « Voir sur la carte » (B12) : zoome jusqu'à l'épingle, sortie de son cluster ; `n` change à chaque demande. */
|
||||
centrage?: { id: string; n: number } | null
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'select-structure': [id: string]
|
||||
/** Survol d'une épingle (B11) : la liste allume la carte-fiche. */
|
||||
survol: [id: string | null]
|
||||
}>()
|
||||
|
||||
const mapContainer = ref<HTMLElement | null>(null)
|
||||
@@ -32,17 +38,18 @@ let mapInstance: Map | null = null
|
||||
let clusterGroup: any = null
|
||||
const markers = new Map<string, Marker>()
|
||||
let tileLayerInstance: any = null
|
||||
let resizeObserver: ResizeObserver | null = null
|
||||
|
||||
function getFamilleColor(famille: number): string {
|
||||
return FAMILLE_COLORS[famille] ?? '#888888'
|
||||
}
|
||||
|
||||
function createPinIcon(famille: number, isSelected = false): DivIcon {
|
||||
function createPinIcon(famille: number, isSelected = false, isSurvol = false): DivIcon {
|
||||
const L = (window as any).L
|
||||
const bg = getFamilleColor(famille)
|
||||
const size = isSelected ? 20 : 14
|
||||
const border = isSelected ? 'white' : 'rgba(255,255,255,0.7)'
|
||||
const shadow = isSelected ? `0 0 0 4px ${bg}55` : 'none'
|
||||
const size = isSelected || isSurvol ? 20 : 14
|
||||
const border = isSurvol ? '#f5b342' : isSelected ? 'white' : 'rgba(255,255,255,0.7)'
|
||||
const shadow = isSurvol ? '0 0 0 4px rgba(245,179,66,0.6)' : isSelected ? `0 0 0 4px ${bg}55` : 'none'
|
||||
|
||||
return L.divIcon({
|
||||
className: '',
|
||||
@@ -76,6 +83,7 @@ async function initMap() {
|
||||
;(window as any).L = L
|
||||
// @ts-ignore
|
||||
await import('leaflet.markercluster')
|
||||
if (!mapContainer.value?.isConnected) return // page quittée pendant le chargement (ex. ?random=1)
|
||||
const MarkerClusterGroup = L.MarkerClusterGroup
|
||||
|
||||
mapInstance = L.map(mapContainer.value, {
|
||||
@@ -121,6 +129,14 @@ async function initMap() {
|
||||
|
||||
mapInstance.addLayer(clusterGroup)
|
||||
updateMarkers(L)
|
||||
|
||||
// B11 : la carte change de largeur sans que la fenêtre bouge (Mixte ↔ Carte ↔ Fiches)
|
||||
resizeObserver = new ResizeObserver(() => mapInstance?.invalidateSize({ pan: false }))
|
||||
resizeObserver.observe(mapContainer.value)
|
||||
}
|
||||
|
||||
function iconeDe(s: StructureV2): DivIcon {
|
||||
return createPinIcon(s.famille_principale, s.id === props.selectedId, s.id === props.survolId)
|
||||
}
|
||||
|
||||
function updateMarkers(L?: any) {
|
||||
@@ -136,10 +152,7 @@ function updateMarkers(L?: any) {
|
||||
)
|
||||
|
||||
structuresWithCoords.forEach((structure) => {
|
||||
const isSelected = structure.id === props.selectedId
|
||||
const icon = createPinIcon(structure.famille_principale, isSelected)
|
||||
|
||||
const marker = leaflet.marker([structure.latitude!, structure.longitude!], { icon })
|
||||
const marker = leaflet.marker([structure.latitude!, structure.longitude!], { icon: iconeDe(structure), title: structure.nom })
|
||||
|
||||
const hashtagsHtml = structure.hashtags.slice(0, 2)
|
||||
.map(h => `<span style="font-size:10px;color:var(--nav-text-muted);">${h}</span>`)
|
||||
@@ -165,6 +178,8 @@ function updateMarkers(L?: any) {
|
||||
`, { maxWidth: 260 })
|
||||
|
||||
marker.on('click', () => emit('select-structure', structure.id))
|
||||
marker.on('mouseover', () => emit('survol', structure.id))
|
||||
marker.on('mouseout', () => emit('survol', null))
|
||||
|
||||
markers.set(structure.id, marker)
|
||||
clusterGroup.addLayer(marker)
|
||||
@@ -193,14 +208,14 @@ watch(
|
||||
const oldMarker = markers.get(oldId)
|
||||
const oldStructure = props.structures.find(s => s.id === oldId)
|
||||
if (oldMarker && oldStructure) {
|
||||
oldMarker.setIcon(createPinIcon(oldStructure.famille_principale, false))
|
||||
oldMarker.setIcon(iconeDe(oldStructure))
|
||||
}
|
||||
}
|
||||
if (newId != null) {
|
||||
const newMarker = markers.get(newId)
|
||||
const newStructure = props.structures.find(s => s.id === newId)
|
||||
if (newMarker && newStructure) {
|
||||
newMarker.setIcon(createPinIcon(newStructure.famille_principale, true))
|
||||
newMarker.setIcon(iconeDe(newStructure))
|
||||
const latLng = newMarker.getLatLng()
|
||||
mapInstance.panTo(latLng, { animate: true })
|
||||
}
|
||||
@@ -208,6 +223,27 @@ watch(
|
||||
}
|
||||
)
|
||||
|
||||
// Survol depuis la liste : épingle cerclée de safran, sans recentrer la carte
|
||||
watch(
|
||||
() => props.survolId,
|
||||
(newId, oldId) => {
|
||||
for (const id of [oldId, newId]) {
|
||||
if (id == null) continue
|
||||
const m = markers.get(id)
|
||||
const s = props.structures.find(x => x.id === id)
|
||||
if (m && s) m.setIcon(iconeDe(s))
|
||||
allumerCluster(m, id === newId)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// Épingle regroupée dans un cluster : c'est le cluster visible qui s'allume
|
||||
function allumerCluster(m: Marker | undefined, on: boolean) {
|
||||
const parent = m && clusterGroup?.getVisibleParent(m)
|
||||
const el = parent && parent !== m ? (parent as any)._icon?.firstElementChild as HTMLElement | undefined : undefined
|
||||
if (el) el.style.boxShadow = on ? '0 0 0 4px #f5b342' : ''
|
||||
}
|
||||
|
||||
function updateTileTheme(dark: boolean) {
|
||||
if (!mapInstance || !tileLayerInstance) return
|
||||
const L = (window as any).L
|
||||
@@ -232,9 +268,26 @@ onMounted(() => {
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('nav-v2-select', onNavV2Select as EventListener)
|
||||
themeObserver?.disconnect()
|
||||
resizeObserver?.disconnect()
|
||||
if (mapInstance) {
|
||||
mapInstance.remove()
|
||||
mapInstance = null
|
||||
}
|
||||
})
|
||||
|
||||
// « Voir sur la carte » (B12) : la carte vient peut-être de s'afficher (Fiches → Mixte) ;
|
||||
// on attend sa taille réelle, puis on sort l'épingle de son cluster.
|
||||
watch(
|
||||
() => props.centrage?.n,
|
||||
() => {
|
||||
const c = props.centrage
|
||||
if (!c) return
|
||||
setTimeout(() => {
|
||||
if (!mapInstance || !clusterGroup) return
|
||||
mapInstance.invalidateSize({ pan: false })
|
||||
const m = markers.get(c.id)
|
||||
if (m) clusterGroup.zoomToShowLayer(m, () => mapInstance?.panTo(m.getLatLng(), { animate: true }))
|
||||
}, 260)
|
||||
},
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -1,257 +0,0 @@
|
||||
<template>
|
||||
<aside
|
||||
class="flex flex-col h-full overflow-hidden"
|
||||
style="background: var(--nav-surface); border-right: 1px solid var(--nav-bg-alt);"
|
||||
>
|
||||
|
||||
<!-- ═══════════════════════════════════ BARRE DE RECHERCHE (tout en haut) -->
|
||||
<div
|
||||
class="shrink-0 px-4 pt-4 pb-3 border-b"
|
||||
style="border-color: var(--nav-bg-alt);"
|
||||
>
|
||||
<label class="sidebar-search-label" aria-label="Rechercher une organisation">
|
||||
<svg
|
||||
width="15" height="15" viewBox="0 0 24 24"
|
||||
fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
aria-hidden="true"
|
||||
class="sidebar-search-icon"
|
||||
>
|
||||
<circle cx="11" cy="11" r="8"/>
|
||||
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
||||
</svg>
|
||||
<input
|
||||
ref="searchInputEl"
|
||||
:value="search"
|
||||
type="search"
|
||||
placeholder="Rechercher une organisation…"
|
||||
class="sidebar-search-input"
|
||||
autocomplete="off"
|
||||
@input="emit('update:search', ($event.target as HTMLInputElement).value)"
|
||||
/>
|
||||
<button
|
||||
v-if="search"
|
||||
type="button"
|
||||
class="sidebar-search-clear"
|
||||
aria-label="Effacer la recherche"
|
||||
@click.stop="emit('update:search', '')"
|
||||
>
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/>
|
||||
<line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════════════════════════ FILTRES (haut, compact) -->
|
||||
<div
|
||||
class="shrink-0 px-4 pt-3 pb-3 space-y-4 border-b"
|
||||
style="border-color: var(--nav-bg-alt);"
|
||||
>
|
||||
<!-- Échelle (checkbox compactes) -->
|
||||
<EchelleFilter
|
||||
:modelValue="echelle"
|
||||
:counts="echelleCount"
|
||||
@update:modelValue="emit('update:echelle', $event)"
|
||||
/>
|
||||
|
||||
<!-- Fonctions (checkbox compactes) -->
|
||||
<FonctionFilter
|
||||
:modelValue="fonctions"
|
||||
:counts="fonctionCount"
|
||||
@update:modelValue="emit('update:fonctions', $event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════════════════════════ LISTE FICHES (milieu, scrollable) -->
|
||||
<div class="flex-1 flex flex-col min-h-0">
|
||||
<!-- Header liste -->
|
||||
<div
|
||||
class="shrink-0 flex items-center justify-between px-4 py-2 border-b"
|
||||
style="border-color: var(--nav-bg-alt);"
|
||||
>
|
||||
<span class="text-xs font-bold uppercase tracking-widest" style="color: var(--nav-text-muted);">
|
||||
{{ resultCount }} résultat{{ resultCount > 1 ? 's' : '' }}
|
||||
</span>
|
||||
<button
|
||||
v-if="hasActiveFilters"
|
||||
@click="emit('reset-filters')"
|
||||
class="text-xs underline hover:opacity-70"
|
||||
style="color: var(--nav-text-muted);"
|
||||
>
|
||||
Effacer les filtres
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Liste scrollable -->
|
||||
<div class="flex-1 overflow-y-auto px-3 py-2 space-y-1.5">
|
||||
<div
|
||||
v-if="pending"
|
||||
class="flex items-center justify-center py-8"
|
||||
style="color: var(--nav-text-muted);"
|
||||
>
|
||||
Chargement…
|
||||
</div>
|
||||
|
||||
<div v-else-if="orgs.length === 0" class="text-center py-8">
|
||||
<p class="text-xs" style="color: var(--nav-text-muted);">Aucun résultat</p>
|
||||
</div>
|
||||
|
||||
<!-- Card fiche compacte -->
|
||||
<div
|
||||
v-for="org in orgs"
|
||||
:key="org.Id"
|
||||
class="rounded-lg px-3 py-2 cursor-pointer transition-all"
|
||||
:style="selectedId === org.Id
|
||||
? 'background: var(--nav-bg-alt); border-left: 3px solid var(--nav-accent); padding-left: 9px;'
|
||||
: 'background: var(--nav-bg); border-left: 3px solid transparent; padding-left: 9px;'"
|
||||
@click="emit('select-org', org.Id)"
|
||||
@mouseenter="emit('hover-org', org.Id)"
|
||||
@mouseleave="emit('hover-org', null)"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-1.5">
|
||||
<span
|
||||
class="font-semibold text-sm leading-snug"
|
||||
style="color: var(--nav-text);"
|
||||
>{{ org.nom }}</span>
|
||||
<span
|
||||
v-if="org.echelle"
|
||||
class="shrink-0 px-1.5 py-0.5 rounded-full text-xs"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted); margin-top: 1px;"
|
||||
>{{ org.echelle }}</span>
|
||||
</div>
|
||||
<div v-if="orgFonctions(org).length" class="mt-1 flex flex-wrap gap-1">
|
||||
<span
|
||||
v-for="fn in orgFonctions(org)"
|
||||
:key="fn"
|
||||
class="px-2 py-0.5 rounded-full text-xs font-medium"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted); border: 1px solid var(--nav-bg-alt); letter-spacing: 0.01em;"
|
||||
>{{ fn }}</span>
|
||||
</div>
|
||||
<div v-if="org.localisation_ville" class="mt-0.5 text-xs" style="color: var(--nav-text-muted);">
|
||||
{{ org.localisation_ville }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
interface Org {
|
||||
Id: number
|
||||
nom: string
|
||||
echelle?: string
|
||||
tags_fonction?: string
|
||||
territoire?: string
|
||||
localisation_ville?: string
|
||||
latitude?: number | null
|
||||
longitude?: number | null
|
||||
prioritaire?: boolean
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
search: string
|
||||
modeValue: string // 'metropole' | 'outremer'
|
||||
echelle: string[]
|
||||
fonctions: string[]
|
||||
territoire: string | null
|
||||
echelleCount: Record<string, number>
|
||||
fonctionCount: Record<string, number>
|
||||
territoireCount: Record<string, number>
|
||||
resultCount: number
|
||||
orgs: Org[] // fiches filtrées à afficher dans la liste
|
||||
selectedId: number | null
|
||||
hasActiveFilters: boolean
|
||||
pending?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:search': [value: string]
|
||||
'update:mode': [value: string]
|
||||
'update:echelle': [value: string[]]
|
||||
'update:fonctions': [value: string[]]
|
||||
'update:territoire': [value: string | null]
|
||||
'select-org': [id: number]
|
||||
'hover-org': [id: number | null]
|
||||
'reset-filters': []
|
||||
}>()
|
||||
|
||||
const searchInputEl = ref<HTMLInputElement | null>(null)
|
||||
|
||||
function orgFonctions(org: Org): string[] {
|
||||
return (org.tags_fonction ?? '').split(',').map(f => f.trim()).filter(Boolean).slice(0, 2)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.sidebar-search-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
border: 1.5px solid var(--nav-bg-alt);
|
||||
border-radius: 10px;
|
||||
background: var(--nav-bg);
|
||||
padding: 7px 10px;
|
||||
cursor: text;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
|
||||
.sidebar-search-label:focus-within {
|
||||
border-color: var(--nav-primary);
|
||||
background: var(--nav-surface);
|
||||
}
|
||||
|
||||
.sidebar-search-icon {
|
||||
color: var(--nav-text-muted);
|
||||
flex-shrink: 0;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.sidebar-search-label:focus-within .sidebar-search-icon {
|
||||
color: var(--nav-primary-solid);
|
||||
}
|
||||
|
||||
.sidebar-search-input {
|
||||
border: none;
|
||||
outline: none;
|
||||
background: transparent;
|
||||
color: var(--nav-text);
|
||||
font-size: 13px;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
font-family: var(--nav-font);
|
||||
}
|
||||
|
||||
.sidebar-search-input::placeholder {
|
||||
color: var(--nav-text-muted);
|
||||
}
|
||||
|
||||
.sidebar-search-input::-webkit-search-cancel-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar-search-clear {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--nav-text-muted);
|
||||
flex-shrink: 0;
|
||||
padding: 2px;
|
||||
border-radius: 50%;
|
||||
transition: color 0.15s, background 0.15s;
|
||||
background: transparent;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sidebar-search-clear:hover {
|
||||
color: var(--nav-text);
|
||||
background: var(--nav-bg-alt);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,313 @@
|
||||
<!--
|
||||
NavTiroir — B10-M3
|
||||
Menu < 1280 px : tiroir pleine hauteur à droite, voile, Échap, focus piégé,
|
||||
focus rendu à l'élément qui l'a ouvert. Les trois échelles dans l'ordre de la
|
||||
barre (utils/echelles.ts), puis Manifeste, À propos, Signaler, et Soutenir.
|
||||
Se ferme seul au changement de route et si la fenêtre passe à ≥ 1280 px.
|
||||
-->
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<Transition name="nav-tiroir">
|
||||
<div v-if="open" class="nav-tiroir" @keydown="onKeydown">
|
||||
<div class="nav-tiroir__voile" aria-hidden="true" @click="fermer" />
|
||||
<div
|
||||
ref="panneau"
|
||||
class="nav-tiroir__panneau"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="nav-tiroir-titre"
|
||||
>
|
||||
<div class="nav-tiroir__tete">
|
||||
<h2 id="nav-tiroir-titre" class="nav-tiroir__titre">Menu</h2>
|
||||
<button type="button" class="nav-tiroir__fermer" aria-label="Fermer le menu" @click="fermer">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" aria-hidden="true">
|
||||
<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<nav class="nav-tiroir__corps" aria-label="Échelles et pages">
|
||||
<p class="nav-tiroir__cadre">{{ ECHELLES_CADRE_COURT }}</p>
|
||||
|
||||
<div v-for="id in ORDRE_ECHELLES" :key="id" class="nav-tiroir__grp">
|
||||
<span :id="`nav-tiroir-echelle-${id}`" class="nav-tiroir__kick">
|
||||
<span class="nav-tiroir__pastille">{{ id }}</span>{{ ECHELLES[id].titre }}
|
||||
</span>
|
||||
<ul class="nav-tiroir__liste" :aria-labelledby="`nav-tiroir-echelle-${id}`">
|
||||
<li v-for="o in ECHELLES[id].onglets" :key="o.to">
|
||||
<NuxtLink
|
||||
:to="o.to"
|
||||
class="nav-tiroir__lien"
|
||||
:class="{ 'nav-tiroir__lien--actif': o.actif(route) }"
|
||||
:aria-current="o.actif(route) ? 'page' : undefined"
|
||||
@click="fermer"
|
||||
>{{ o.libelle }}</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<hr class="nav-tiroir__sep" />
|
||||
|
||||
<ul class="nav-tiroir__liste">
|
||||
<li v-for="p in PAGES" :key="p.to">
|
||||
<NuxtLink
|
||||
:to="p.to"
|
||||
class="nav-tiroir__second"
|
||||
:aria-current="route.path === p.to ? 'page' : undefined"
|
||||
@click="fermer"
|
||||
>{{ p.libelle }}</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<a :href="SOUTENIR_URL" target="_blank" rel="noopener noreferrer" class="nav-tiroir__soutenir">Soutenir</a>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ECHELLES, ECHELLES_CADRE_COURT, ORDRE_ECHELLES } from '~/utils/echelles'
|
||||
import { SOUTENIR_URL } from '~/utils/liens'
|
||||
|
||||
const props = defineProps<{ open: boolean }>()
|
||||
const emit = defineEmits<{ close: [] }>()
|
||||
|
||||
const PAGES = [
|
||||
{ libelle: 'Manifeste', to: '/manifeste' },
|
||||
{ libelle: 'À propos', to: '/a-propos' },
|
||||
{ libelle: 'Signaler', to: '/signaler' },
|
||||
]
|
||||
|
||||
const route = useRoute()
|
||||
const panneau = ref<HTMLElement | null>(null)
|
||||
let retourFocus: HTMLElement | null = null
|
||||
|
||||
function fermer() {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
function focusables(): HTMLElement[] {
|
||||
if (!panneau.value) return []
|
||||
return [...panneau.value.querySelectorAll<HTMLElement>('a[href], button:not([disabled])')]
|
||||
}
|
||||
|
||||
function onKeydown(e: KeyboardEvent) {
|
||||
if (e.key === 'Escape') {
|
||||
e.preventDefault()
|
||||
fermer()
|
||||
return
|
||||
}
|
||||
if (e.key !== 'Tab') return
|
||||
const els = focusables()
|
||||
if (!els.length) return
|
||||
const premier = els[0]
|
||||
const dernier = els[els.length - 1]
|
||||
if (e.shiftKey && document.activeElement === premier) {
|
||||
e.preventDefault()
|
||||
dernier.focus()
|
||||
} else if (!e.shiftKey && document.activeElement === dernier) {
|
||||
e.preventDefault()
|
||||
premier.focus()
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => props.open, async (ouvert) => {
|
||||
if (ouvert) {
|
||||
retourFocus = document.activeElement as HTMLElement | null
|
||||
await nextTick()
|
||||
focusables()[0]?.focus()
|
||||
} else if (retourFocus) {
|
||||
// Le bouton d'ouverture peut ne plus être visible (fenêtre élargie) : focus() est alors sans effet.
|
||||
retourFocus.focus()
|
||||
retourFocus = null
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => route.fullPath, () => { if (props.open) fermer() })
|
||||
|
||||
let mq: MediaQueryList | null = null
|
||||
function onLarge(e: MediaQueryListEvent) { if (e.matches && props.open) fermer() }
|
||||
onMounted(() => {
|
||||
mq = window.matchMedia('(min-width: 1280px)')
|
||||
mq.addEventListener('change', onLarge)
|
||||
})
|
||||
onBeforeUnmount(() => mq?.removeEventListener('change', onLarge))
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.nav-tiroir {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.nav-tiroir__voile {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: rgba(var(--nav-primary-raw), 0.35);
|
||||
}
|
||||
|
||||
.nav-tiroir__panneau {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: min(320px, 88vw);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
.nav-tiroir__tete {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-shrink: 0;
|
||||
padding: var(--space-xs) var(--space-sm) var(--space-xs) var(--space-md);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.nav-tiroir__titre {
|
||||
margin: 0;
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: var(--fw-semibold);
|
||||
}
|
||||
|
||||
.nav-tiroir__fermer {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border: 0;
|
||||
border-radius: var(--radius-md);
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.nav-tiroir__corps {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
padding: var(--space-sm) var(--space-md) var(--space-lg);
|
||||
}
|
||||
|
||||
.nav-tiroir__cadre {
|
||||
margin: 0 0 var(--space-xs);
|
||||
font-size: var(--fs-xs);
|
||||
line-height: var(--lh-base);
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
|
||||
.nav-tiroir__grp {
|
||||
margin-top: var(--space-sm);
|
||||
}
|
||||
|
||||
.nav-tiroir__kick {
|
||||
display: block;
|
||||
margin-bottom: var(--space-2xs);
|
||||
font-size: 0.72rem;
|
||||
font-weight: var(--fw-bold);
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
|
||||
.nav-tiroir__pastille {
|
||||
display: inline-block;
|
||||
margin-right: 6px;
|
||||
padding: 0 5px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
}
|
||||
|
||||
.nav-tiroir__liste {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.nav-tiroir__lien,
|
||||
.nav-tiroir__second {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 44px;
|
||||
padding: 0 var(--space-xs);
|
||||
border-radius: var(--radius-md);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav-tiroir__lien {
|
||||
font-size: var(--fs-base);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.nav-tiroir__lien--actif {
|
||||
background: var(--bg-alt);
|
||||
font-weight: var(--fw-semibold);
|
||||
}
|
||||
|
||||
.nav-tiroir__second {
|
||||
font-size: var(--fs-sm);
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
|
||||
.nav-tiroir__lien:focus-visible,
|
||||
.nav-tiroir__second:focus-visible,
|
||||
.nav-tiroir__soutenir:focus-visible,
|
||||
.nav-tiroir__fermer:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.nav-tiroir__sep {
|
||||
margin: var(--space-sm) 0;
|
||||
border: 0;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.nav-tiroir__soutenir {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 44px;
|
||||
margin-top: var(--space-sm);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: var(--fw-semibold);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav-tiroir-enter-active,
|
||||
.nav-tiroir-leave-active {
|
||||
transition: opacity var(--dur-base) var(--ease-out);
|
||||
}
|
||||
.nav-tiroir-enter-active .nav-tiroir__panneau,
|
||||
.nav-tiroir-leave-active .nav-tiroir__panneau {
|
||||
transition: transform var(--dur-base) var(--ease-out);
|
||||
}
|
||||
.nav-tiroir-enter-from,
|
||||
.nav-tiroir-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
.nav-tiroir-enter-from .nav-tiroir__panneau,
|
||||
.nav-tiroir-leave-to .nav-tiroir__panneau {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.nav-tiroir-enter-active,
|
||||
.nav-tiroir-leave-active,
|
||||
.nav-tiroir-enter-active .nav-tiroir__panneau,
|
||||
.nav-tiroir-leave-active .nav-tiroir__panneau {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,227 @@
|
||||
<!--
|
||||
OutilsPartirDeSoi — B6-M2. Le sous-onglet « Partir de soi » de /outils : les
|
||||
sept mots de la slide 17 de la conférence, un mot = une fiche, rendus par
|
||||
la vue fiches partagée (état Mixte : liste des mots | graphe | fiche ouverte).
|
||||
Troisième page branchée sur VueFiches (DESIGN-SYSTEM §Brancher une troisième
|
||||
page). Les données viennent de `partir_de_soi` dans public/data/outils.json.
|
||||
|
||||
Monté seulement quand `?tab=partir-de-soi` : l'état de la vue (q, filtres,
|
||||
fiche…) vit dans l'URL et disparaît avec l'onglet. `tab=` est recopié par la
|
||||
vue à chacune de ses écritures (paramètre qu'elle ne gère pas).
|
||||
-->
|
||||
<template>
|
||||
<div class="ops">
|
||||
<VueFiches
|
||||
:vf="vf"
|
||||
:intention="props.data.intention"
|
||||
libelle-recherche="Rechercher une ressource…"
|
||||
:libelles-vue="{ carte: 'Graphe' }"
|
||||
:lien-page="() => null"
|
||||
>
|
||||
<template #carte>
|
||||
<GrapheMots :vf="vf" :mots="motsGraphe" />
|
||||
</template>
|
||||
|
||||
<template #detail="{ fiche, filtrer }">
|
||||
<article v-if="parId.get(String(fiche.id))" class="mot">
|
||||
<h2 class="mot__titre">{{ parId.get(String(fiche.id))!.mot }}</h2>
|
||||
<p class="mot__resume">{{ parId.get(String(fiche.id))!.resume }}</p>
|
||||
|
||||
<template v-if="parId.get(String(fiche.id))!.vide">
|
||||
<p class="mot__vide">{{ parId.get(String(fiche.id))!.vide }}</p>
|
||||
<NuxtLink to="/proposer?categorie=outils" class="mot__proposer">Proposer une ressource</NuxtLink>
|
||||
</template>
|
||||
|
||||
<ul v-else class="ress" :aria-label="`Ressources pour ${parId.get(String(fiche.id))!.mot}`">
|
||||
<li v-for="r in ressourcesDe(String(fiche.id))" :key="r.id" class="ress__carte">
|
||||
<p class="ress__titre">
|
||||
<a v-if="r.url" :href="r.url" target="_blank" rel="noopener noreferrer">{{ r.titre }}<span class="ress__ext" aria-hidden="true"> ↗</span><span class="vf-sr-mot"> (nouvel onglet)</span></a>
|
||||
<template v-else>{{ r.titre }}</template>
|
||||
</p>
|
||||
|
||||
<ChipGroup :aria-label="`Format et accès de ${r.titre}`" class="ress__chips">
|
||||
<Chip
|
||||
:label="r.format"
|
||||
variant="fonction"
|
||||
:active="(vf.etat.filtres.format ?? []).includes(slugEtiquette(r.format))"
|
||||
:aria-label="`Filtrer par format : ${r.format}`"
|
||||
@toggle="filtrer('format', slugEtiquette(r.format))"
|
||||
/>
|
||||
<Chip
|
||||
:label="r.acces"
|
||||
variant="echelle"
|
||||
:active="(vf.etat.filtres.acces ?? []).includes(slugEtiquette(r.acces))"
|
||||
:aria-label="`Filtrer par accès : ${r.acces}`"
|
||||
@toggle="filtrer('acces', slugEtiquette(r.acces))"
|
||||
/>
|
||||
</ChipGroup>
|
||||
|
||||
<p v-if="r.pourquoi" class="ress__pourquoi">{{ r.pourquoi }}</p>
|
||||
<p v-if="r.urls?.length" class="ress__liens">
|
||||
<template v-for="(u, i) in r.urls" :key="u">
|
||||
<span v-if="i > 0" aria-hidden="true"> · </span>
|
||||
<a :href="u" target="_blank" rel="noopener noreferrer">{{ u.replace(/^https:\/\//, '') }}<span class="vf-sr-mot"> (nouvel onglet)</span></a>
|
||||
</template>
|
||||
</p>
|
||||
<p v-if="r.note" class="ress__note">{{ r.note }}</p>
|
||||
|
||||
<ul v-if="r.episodes?.length" class="eps" :aria-label="`Épisodes de ${r.titre}`">
|
||||
<li v-for="ep in r.episodes" :key="ep.ep" class="eps__item" :class="{ 'eps__item--muet': !ep.url }">
|
||||
<span class="eps__ep">EP/{{ ep.ep }}</span>
|
||||
<span class="eps__corps">
|
||||
<a v-if="ep.url" :href="ep.url" target="_blank" rel="noopener noreferrer" class="eps__titre">{{ ep.titre }}<span class="vf-sr-mot"> (nouvel onglet)</span></a>
|
||||
<span v-else class="eps__titre">{{ ep.titre }}</span>
|
||||
<span class="eps__personnes"> — {{ ep.personnes }}</span>
|
||||
<span v-if="ep.note" class="eps__note"> ({{ ep.note }})</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
||||
</template>
|
||||
</VueFiches>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ConfigVueFiches } from '~/utils/vueFiches'
|
||||
import { toMiniMot, valeursRessources, slugEtiquette, type FicheMot, type RessourceMot } from '~/composables/useFicheAdapter'
|
||||
|
||||
interface RessourceComplete extends RessourceMot {
|
||||
url?: string | null
|
||||
urls?: string[]
|
||||
note?: string
|
||||
episodes?: { ep: string; titre: string; personnes: string; url?: string | null; note?: string }[]
|
||||
}
|
||||
interface DonneesPartirDeSoi {
|
||||
/** Phrase d'intention de l'onglet, lue dans outils.json (jamais en dur : checkpoint du 22/10). */
|
||||
intention: string
|
||||
fiches: (FicheMot & { vide?: string | null })[]
|
||||
ressources: RessourceComplete[]
|
||||
}
|
||||
|
||||
const props = defineProps<{ data: DonneesPartirDeSoi }>()
|
||||
|
||||
const ressourcesDe = (motId: string) => props.data.ressources.filter((r) => r.fiches.includes(motId))
|
||||
const parId = computed(() => new Map(props.data.fiches.map((f) => [f.id, f])))
|
||||
|
||||
// Étape 1 : adaptateur (un mot → une MiniFiche). L'ordre du tableau est celui de la slide.
|
||||
const fichesMini = computed(() => props.data.fiches.map((f) => toMiniMot(f, ressourcesDe(f.id))))
|
||||
|
||||
// Étape 2 : configuration. Sept fiches, pas de groupe ; tri « ordre de la slide » par défaut.
|
||||
const config = computed<ConfigVueFiches>(() => ({
|
||||
dimensions: [
|
||||
{ cle: 'format', libelle: 'Format', variante: 'fonction', valeurs: valeursRessources(props.data.ressources, 'format') },
|
||||
{ cle: 'acces', libelle: 'Accès', variante: 'echelle', valeurs: valeursRessources(props.data.ressources, 'acces') },
|
||||
],
|
||||
tris: ['ordre', 'pertinence', 'nom'],
|
||||
triDefaut: 'ordre',
|
||||
libellesTri: { ordre: 'Ordre de la slide' },
|
||||
groupes: [],
|
||||
etats: ['carte', 'mixte', 'fiches'],
|
||||
}))
|
||||
|
||||
const vf = useVueFiches(fichesMini, config)
|
||||
|
||||
// Étape 3 : le graphe (slot #carte) lit les mêmes données et l'état de la vue.
|
||||
const motsGraphe = computed(() =>
|
||||
props.data.fiches.map((f) => ({
|
||||
id: f.id,
|
||||
mot: f.mot,
|
||||
vide: !!f.vide,
|
||||
ressources: ressourcesDe(f.id).map((r) => ({ id: r.id, titre: r.titre })),
|
||||
})),
|
||||
)
|
||||
|
||||
// Une fiche ouverte donne son nom à l'onglet du navigateur.
|
||||
useSeoMeta({
|
||||
title: () => (vf.ficheOuverte ? `${vf.ficheOuverte.nom} — Partir de soi — AEP` : 'Outils — AEP — Partir de soi'),
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ops { height: 100%; min-height: 0; min-width: 0; }
|
||||
|
||||
/* Lecteurs d'écran seulement */
|
||||
.vf-sr-mot {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Fiche d'un mot */
|
||||
.mot__titre { margin: 0 0 var(--space-xs); font-size: 1.25rem; font-weight: var(--fw-bold); line-height: 1.25; }
|
||||
.mot__resume {
|
||||
margin: 0 0 var(--space-md);
|
||||
font-size: var(--fs-sm);
|
||||
line-height: 1.55;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
.mot__vide {
|
||||
margin: 0 0 var(--space-sm);
|
||||
padding: var(--space-sm);
|
||||
border: 1.5px dashed var(--border-strong);
|
||||
border-radius: var(--radius-md);
|
||||
font-size: var(--fs-sm);
|
||||
line-height: 1.55;
|
||||
}
|
||||
.mot__proposer {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 40px;
|
||||
padding: 0 var(--space-md);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: var(--fw-semibold);
|
||||
text-decoration: none;
|
||||
}
|
||||
.mot__proposer:hover { opacity: 0.9; }
|
||||
.mot__proposer:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
|
||||
|
||||
/* Ressources */
|
||||
.ress { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-sm); }
|
||||
.ress__carte {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-xs);
|
||||
min-width: 0;
|
||||
padding: var(--space-sm);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--bg);
|
||||
}
|
||||
.ress__carte p { margin: 0; overflow-wrap: anywhere; }
|
||||
.ress__titre { font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.35; }
|
||||
.ress__titre a,
|
||||
.ress__liens a { color: var(--nav-primary-solid); text-underline-offset: 2px; }
|
||||
.ress__titre a:focus-visible,
|
||||
.ress__liens a:focus-visible,
|
||||
.eps__titre:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }
|
||||
.ress__pourquoi { font-size: var(--fs-sm); line-height: 1.5; }
|
||||
.ress__liens { font-size: var(--fs-xs, 0.75rem); }
|
||||
.ress__note { font-size: var(--fs-xs, 0.75rem); font-style: italic; color: color-mix(in srgb, var(--text) 78%, transparent); }
|
||||
|
||||
/* Épisodes OFQA */
|
||||
.eps { list-style: none; margin: var(--space-2xs) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2xs); }
|
||||
.eps__item { display: flex; gap: var(--space-xs); align-items: baseline; font-size: var(--fs-sm); line-height: 1.4; }
|
||||
.eps__ep {
|
||||
flex: 0 0 3.6rem;
|
||||
font-family: var(--font-mono, 'JetBrains Mono', 'Courier New', monospace);
|
||||
font-size: var(--fs-xs, 0.75rem);
|
||||
font-weight: var(--fw-semibold);
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
.eps__corps { min-width: 0; overflow-wrap: anywhere; }
|
||||
.eps__titre { font-weight: var(--fw-medium); color: var(--text); }
|
||||
a.eps__titre { color: var(--nav-primary-solid); }
|
||||
.eps__personnes,
|
||||
.eps__note { color: color-mix(in srgb, var(--text) 78%, transparent); font-size: var(--fs-xs, 0.75rem); }
|
||||
.eps__note { font-style: italic; }
|
||||
.eps__item--muet .eps__titre { color: color-mix(in srgb, var(--text) 78%, transparent); }
|
||||
</style>
|
||||
@@ -14,6 +14,7 @@
|
||||
<span v-if="tag" :class="['simu-feature__badge', `simu-feature__badge--${tag}`]">{{ tagLabel }}</span>
|
||||
</div>
|
||||
<p class="simu-feature__desc">{{ description }}</p>
|
||||
<p v-if="mention" class="simu-feature__mention">{{ mention }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<span v-if="cta && url" class="simu-feature__cta">{{ cta }}</span>
|
||||
@@ -29,6 +30,8 @@ const props = defineProps<{
|
||||
description?: string
|
||||
cta?: string
|
||||
tag?: string
|
||||
/** Ligne de réserve datée sous la description (ex. « Ordre de grandeur — version du … »). */
|
||||
mention?: string | null
|
||||
}>()
|
||||
|
||||
const tagLabels: Record<string, string> = {
|
||||
@@ -127,6 +130,13 @@ const tagLabel = computed(() => props.tag ? (tagLabels[props.tag] ?? props.tag)
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
.simu-feature__mention {
|
||||
font-size: 0.78rem;
|
||||
font-style: italic;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
margin: 0.4rem 0 0;
|
||||
}
|
||||
|
||||
.simu-feature__cta {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -145,6 +155,12 @@ const tagLabel = computed(() => props.tag ? (tagLabels[props.tag] ?? props.tag)
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.simu-feature { padding: 1.1rem 1rem; }
|
||||
.simu-feature__inner { flex-direction: column; align-items: stretch; gap: 1rem; }
|
||||
.simu-feature__cta { justify-content: center; }
|
||||
}
|
||||
|
||||
:global(.dark) .simu-feature__badge {
|
||||
background: #064e3b;
|
||||
color: #a7f3d0;
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
<!--
|
||||
VueFichesFiltres — B11-M4. Les chips de filtre d'une vue fiches, par
|
||||
dimension (Chip.vue, variante de la dimension). Monté à UN seul endroit selon
|
||||
l'état (SPEC §3) : panneau de gauche en Mixte, tête de grille en Fiches,
|
||||
feuille du bas sur téléphone. Compteur dans le résultat courant ; chip à 0
|
||||
grisée et inactive ; au-delà de 14 valeurs, repli « + N » (actives toujours
|
||||
visibles) ; « Tout effacer » dès qu'un filtre est actif.
|
||||
-->
|
||||
<template>
|
||||
<div class="vff">
|
||||
<ChipGroup v-if="vf.etat.sansAdresse" aria-label="Filtre de localisation">
|
||||
<Chip as="span" removable active variant="echelle" label="Sans adresse" @remove="vf.setSansAdresse(false)" />
|
||||
</ChipGroup>
|
||||
<div v-for="d in vf.cfg.dimensions" :key="d.cle" class="vff__dim">
|
||||
<p :id="`${idBase}-${d.cle}`" class="vff__titre">{{ d.libelle }}</p>
|
||||
<ChipGroup :aria-label="`Filtrer par ${d.libelle.toLowerCase()}`" :aria-describedby="`${idBase}-${d.cle}`">
|
||||
<Chip
|
||||
v-for="v in visibles(d)"
|
||||
:key="v.valeur"
|
||||
:label="v.libelle"
|
||||
:variant="d.variante"
|
||||
:active="actif(d.cle, v.valeur)"
|
||||
:count="vf.compteurs[d.cle]?.[v.valeur] ?? 0"
|
||||
:disabled="!actif(d.cle, v.valeur) && !(vf.compteurs[d.cle]?.[v.valeur])"
|
||||
class="vff__chip"
|
||||
@toggle="vf.toggle(d.cle, v.valeur)"
|
||||
/>
|
||||
<button
|
||||
v-if="d.valeurs.length > SEUIL"
|
||||
type="button"
|
||||
class="vff__plus"
|
||||
:aria-expanded="!!deplies[d.cle]"
|
||||
@click="deplies[d.cle] = !deplies[d.cle]"
|
||||
>{{ deplies[d.cle] ? 'Réduire' : `+ ${d.valeurs.length - visibles(d).length}` }}</button>
|
||||
</ChipGroup>
|
||||
</div>
|
||||
|
||||
<button
|
||||
v-if="vf.nbActifs || vf.q"
|
||||
type="button"
|
||||
class="vff__effacer"
|
||||
@click="vf.effacerTout()"
|
||||
>Tout effacer</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { VueFichesEtat } from '~/composables/useVueFiches'
|
||||
import type { DimensionFiltre } from '~/utils/vueFiches'
|
||||
|
||||
const props = defineProps<{ vf: VueFichesEtat; idBase: string }>()
|
||||
|
||||
const SEUIL = 14
|
||||
const deplies = reactive<Record<string, boolean>>({})
|
||||
|
||||
function actif(dim: string, valeur: string) {
|
||||
return (props.vf.etat.filtres[dim] ?? []).includes(valeur)
|
||||
}
|
||||
|
||||
/** Les 14 premières dans l'ordre de la dimension (stable : les chips ne bougent pas au clic) + les actives hors de ce lot. */
|
||||
function visibles(d: DimensionFiltre) {
|
||||
if (d.valeurs.length <= SEUIL || deplies[d.cle]) return d.valeurs
|
||||
return d.valeurs.filter((v, i) => i < SEUIL || actif(d.cle, v.valeur))
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.vff {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-sm);
|
||||
}
|
||||
|
||||
.vff__titre {
|
||||
margin: 0 0 var(--space-2xs);
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: var(--fw-semibold);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
|
||||
.vff__chip:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: not-allowed;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.vff__plus {
|
||||
min-height: 32px;
|
||||
padding: var(--space-2xs) var(--space-sm);
|
||||
border: 1.5px dashed color-mix(in srgb, var(--text) 40%, transparent);
|
||||
border-radius: var(--radius-full);
|
||||
background: none;
|
||||
color: var(--text);
|
||||
font: inherit;
|
||||
font-size: var(--fs-xs);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vff__effacer {
|
||||
align-self: flex-start;
|
||||
padding: var(--space-2xs) 0;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--text);
|
||||
font: inherit;
|
||||
font-size: var(--fs-xs);
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vff__plus:focus-visible,
|
||||
.vff__effacer:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<figure class="barre">
|
||||
<svg viewBox="0 0 600 244" role="img" aria-labelledby="barre-titre barre-desc">
|
||||
<title id="barre-titre">Deux heures, découpées</title>
|
||||
<desc id="barre-desc">
|
||||
Coucou, 10 minutes. Temps collectif, 20 à 30 minutes. Entraide, 1 heure 20 : un quart d'heure par personne,
|
||||
cinq minutes pour poser le sujet, cinq pour les questions, cinq pour les conseils. Clôture, 5 minutes.
|
||||
</desc>
|
||||
<!-- noms au-dessus : les deux longs segments -->
|
||||
<text x="52" y="26" class="b-nom">Temps collectif</text>
|
||||
<text x="375" y="26" class="b-nom" text-anchor="middle">Entraide</text>
|
||||
<!-- la barre : 10 + 25 + 80 + 5 = 120 minutes, 5 unités par minute -->
|
||||
<rect x="0" y="40" width="48" height="52" rx="6" class="b-seg b-seg--clair" />
|
||||
<rect x="51" y="40" width="122" height="52" rx="6" class="b-seg b-seg--moyen" />
|
||||
<rect x="176" y="40" width="397" height="52" rx="6" class="b-seg b-seg--fort" />
|
||||
<rect x="576" y="40" width="24" height="52" rx="6" class="b-seg b-seg--clair" />
|
||||
<text x="24" y="74" class="b-duree" text-anchor="middle">10′</text>
|
||||
<text x="112" y="74" class="b-duree" text-anchor="middle">20-30′</text>
|
||||
<text x="375" y="74" class="b-duree b-duree--inverse" text-anchor="middle">1 h 20</text>
|
||||
<!-- noms en dessous : les deux courts -->
|
||||
<text x="0" y="122" class="b-nom">Coucou · 10′</text>
|
||||
<text x="600" y="122" class="b-nom" text-anchor="end">Clôture · 5′</text>
|
||||
<!-- zoom : un quart d'heure par personne -->
|
||||
<path d="M176 96 L176 146 M573 96 L573 146" class="b-zoom" />
|
||||
<g v-for="(s, i) in ['sujet', 'questions', 'conseils']" :key="s" :transform="`translate(${176 + i * 133.5} 146)`">
|
||||
<rect width="130" height="60" rx="5" class="b-sous" />
|
||||
<text x="65" y="26" class="b-sous-txt" text-anchor="middle">{{ s }}</text>
|
||||
<text x="65" y="49" class="b-sous-txt b-sous-txt--duree" text-anchor="middle">5′</text>
|
||||
</g>
|
||||
<text x="374.5" y="236" class="b-legende" text-anchor="middle">un quart d'heure par personne</text>
|
||||
</svg>
|
||||
</figure>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.barre { margin: var(--space-lg) 0; }
|
||||
.barre svg { display: block; width: 100%; height: auto; overflow: visible; }
|
||||
.b-nom { font-size: 23px; font-weight: 700; fill: var(--text); }
|
||||
.b-seg--clair { fill: var(--bg-alt); stroke: var(--border-strong); }
|
||||
.b-seg--moyen { fill: color-mix(in srgb, var(--nav-primary-solid) 28%, var(--surface)); }
|
||||
.b-seg--fort { fill: var(--nav-primary-solid); }
|
||||
.b-duree { font-size: 23px; font-weight: 700; fill: var(--text); }
|
||||
.b-duree--inverse { fill: var(--nav-text-on-primary); }
|
||||
.b-zoom { stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
|
||||
.b-sous { fill: var(--surface); stroke: var(--nav-primary-solid); stroke-width: 1.5; }
|
||||
.b-sous-txt { font-size: 21px; font-weight: 600; fill: var(--text); }
|
||||
.b-sous-txt--duree { font-weight: 400; }
|
||||
.b-legende { font-size: 20px; fill: color-mix(in srgb, var(--text) 78%, transparent); }
|
||||
</style>
|
||||
@@ -0,0 +1,123 @@
|
||||
<!--
|
||||
BandeauEchelles — B13b-M3
|
||||
Les trois échelles en trois ronds reliés par un trait, comme un « 1 2 3 » (retour de Jules
|
||||
du 13/10) : S — M — XL, centrés ; l'active en safran plein (`--accent` / `--on-accent`),
|
||||
les autres en contour ; le nom de l'active en petit dessous (un seul texte, jamais trois).
|
||||
Le rond est le lien (≥ 44 px, lettre à 15 px) : plus de pastille dans un bouton.
|
||||
Ordre et textes : utils/echelles.ts (ORDRE_ECHELLES, ECHELLES[id].titre), rien de recopié.
|
||||
|
||||
Le composant ne connaît ni l'entrée ni la route : `lien(id)` dit où mène chaque rond,
|
||||
`replace` comment, `actif` lequel est allumé. Sur l'entrée : `?porte=` en `replace`.
|
||||
Pour B14 (remplacer la barre NavEchelles sur toutes les pages) : `lien` vise la porte
|
||||
de l'entrée, `actif` lit `echelleDeRoute(route)?.echelle`, `courant="page"`, `:nom="false"`
|
||||
si la barre n'a pas la hauteur du nom ; aucune réécriture du composant. Ce qu'il ne porte
|
||||
pas : les onglets de chaque groupe (NavEchelles en affiche sept) ; sur l'entrée, ils sont
|
||||
dans la rangée de boutons de la porte.
|
||||
-->
|
||||
<template>
|
||||
<nav class="pas" :aria-label="libelle">
|
||||
<ol class="pas__liste">
|
||||
<li v-for="id in ORDRE_ECHELLES" :key="id" class="pas__item">
|
||||
<NuxtLink
|
||||
:to="lien(id)"
|
||||
:replace="replace"
|
||||
class="pas__rond"
|
||||
:class="{ 'pas__rond--actif': actif === id }"
|
||||
:aria-current="actif === id ? courant : undefined"
|
||||
:data-porte="id"
|
||||
><span aria-hidden="true">{{ id }}</span><span class="sr-only">{{ id }} · {{ ECHELLES[id].titre }}</span></NuxtLink>
|
||||
</li>
|
||||
</ol>
|
||||
<p v-if="actif && nom" class="pas__nom" aria-hidden="true">{{ ECHELLES[actif].titre }}</p>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { RouteLocationRaw } from 'vue-router'
|
||||
import { ECHELLES, ORDRE_ECHELLES, type EchelleId } from '~/utils/echelles'
|
||||
|
||||
withDefaults(defineProps<{
|
||||
/** Échelle allumée (safran plein), ou aucune. */
|
||||
actif?: EchelleId | null
|
||||
/** Où mène chaque rond. */
|
||||
lien: (id: EchelleId) => RouteLocationRaw
|
||||
/** Navigation en `replace` (passage latéral de l'entrée). */
|
||||
replace?: boolean
|
||||
/** Valeur d'`aria-current` sur l'actif : `true` sur l'entrée, `page` dans une barre de site. */
|
||||
courant?: 'true' | 'page' | 'location'
|
||||
/** Nom de la navigation pour les lecteurs d'écran. */
|
||||
libelle?: string
|
||||
/** Le nom de l'échelle active, en petit sous les ronds. */
|
||||
nom?: boolean
|
||||
}>(), { actif: null, replace: false, courant: 'true', libelle: 'Échelles S, M, XL', nom: true })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.pas {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.pas__liste {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.pas__item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
/* Le trait qui relie deux ronds */
|
||||
.pas__item + .pas__item::before {
|
||||
content: "";
|
||||
width: 16px;
|
||||
height: 2px;
|
||||
background: var(--border-strong);
|
||||
}
|
||||
|
||||
.pas__rond {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border: 2px solid var(--border-strong);
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
font-size: 15px;
|
||||
font-weight: var(--fw-bold);
|
||||
letter-spacing: 0.02em;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out), color 200ms var(--ease-out);
|
||||
}
|
||||
.pas__rond:hover { border-color: var(--accent); }
|
||||
.pas__rond:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.pas__rond--actif {
|
||||
border-color: var(--accent);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
}
|
||||
|
||||
.pas__nom {
|
||||
margin: 0;
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: var(--fw-semibold);
|
||||
line-height: 1.3;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.pas__rond { transition: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,856 @@
|
||||
<!--
|
||||
SchemaEchelles — B13-M2
|
||||
Le schéma des trois échelles (deck v3.3, slide 16, `drawEchelles`), porté en SVG
|
||||
déclaratif : rendu côté serveur, présent au premier affichage (CONCEPTION §7).
|
||||
Géométrie : utils/figures.ts ; textes : utils/echelles.ts (source unique).
|
||||
|
||||
taille="grand" (état 0 de l'entrée) : la figure + les trois portes en liens HTML
|
||||
(lettre, titre, accroche de la slide 16). Arcs « ce qui sort / ce qui revient »
|
||||
gardés dans le SVG à partir de 1 024 px seulement (16 px environ) ; en dessous ils
|
||||
seraient à 9 px. Ouvrir une porte = `push`.
|
||||
B13b-M1 : chaque anneau porte sa lettre et son nom à toutes les tailles (nom à 26 unités,
|
||||
11,4 px rendus à 390 px), et les sept mots de son échelle (ECHELLES[id].mots) :
|
||||
M et XL en bandeau le long du bord extérieur, qui tourne (M horaire, XL antihoraire,
|
||||
un tour en 75 s) ; S, un mot à la fois au centre, en fondu (2,5 s par mot). Les bandeaux
|
||||
et les mots de S sont des calques HTML posés sur la figure (un <svg> par bandeau, un
|
||||
<span> par mot) : `transform` et `opacity` y tournent sur le compositeur, sans repeindre
|
||||
le SVG ni réveiller le fil principal. CSS seul ; arrêt sous `prefers-reduced-motion`
|
||||
(bandeaux immobiles, premier mot de S) et par le bouton pause (WCAG 2.2.2).
|
||||
B13b-M2 : le grand schéma reste à l'écran quand une porte s'ouvre (`reduit`), la page
|
||||
ne le remplace plus. Téléphone : la figure passe à 40 % de sa largeur (280 ms), le titre,
|
||||
les portes et la phrase se replient (hauteur 1fr → 0fr) ; bureau : la figure se réduit
|
||||
à 15rem en tête de colonne, sous « ← Revenir au schéma » (la page la fait glisser, FLIP).
|
||||
Réduite, la figure est décorative : ni noms ni mots (illisibles à cette taille), bandeaux
|
||||
arrêtés ; ses anneaux restent des cibles (passage latéral, `replace`).
|
||||
taille="mini" (porte ouverte, B13b-M3) : le bandeau, trois ronds S — M — XL reliés
|
||||
(BandeauEchelles), centrés, l'actif en safran ; au téléphone, « ← Schéma » à gauche
|
||||
(au bureau, le retour est en tête de colonne, porté par le grand schéma réduit).
|
||||
Collant au téléphone, sous la figure réduite au bureau. Passer d'une porte à l'autre
|
||||
= `replace` (une seule entrée d'historique par visite).
|
||||
|
||||
Survol ou focus d'un anneau allume sa porte, et l'inverse. Les anneaux sont des
|
||||
cibles de pointeur ; au clavier, ce sont les liens qui portent l'action (le SVG est
|
||||
une image décrite en `grand`, décoratif en `mini`).
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
class="schema"
|
||||
:class="[`schema--${taille}`, { 'schema--apparition': joueApparition, 'schema--reduit': taille === 'grand' && reduit }]"
|
||||
@mouseleave="survol = null"
|
||||
>
|
||||
<!-- Repliables (B13b-M2) : une grille d'une ligne qui passe de 1fr à 0fr. -->
|
||||
<div v-if="$slots.avant" class="schema__plie schema__avant"><div class="schema__plie-dedans"><slot name="avant" /></div></div>
|
||||
|
||||
<!-- Mini : le bandeau. Au téléphone, le retour au schéma à gauche, les trois ronds au centre. -->
|
||||
<template v-if="taille === 'mini'">
|
||||
<a
|
||||
:href="hrefSchema"
|
||||
class="schema__fermer"
|
||||
@click.prevent="emit('fermer')"
|
||||
><span aria-hidden="true">←</span><span class="sr-only">Revenir au </span>Schéma</a>
|
||||
<BandeauEchelles :actif="actif" :lien="lienPorte" replace class="schema__pas" />
|
||||
</template>
|
||||
|
||||
<!-- Bureau, porte ouverte : le retour en tête de colonne, au-dessus de la figure réduite. -->
|
||||
<a
|
||||
v-if="taille === 'grand' && reduit"
|
||||
:href="hrefSchema"
|
||||
class="schema__retour"
|
||||
@click.prevent="emit('fermer')"
|
||||
><span aria-hidden="true">←</span>Revenir au schéma</a>
|
||||
|
||||
<div v-if="taille === 'grand'" class="schema__plie schema__fig"><div class="schema__plie-dedans">
|
||||
<div class="schema__figure" :class="{ 'schema__figure--fige': fige }">
|
||||
<svg
|
||||
class="schema__dessin"
|
||||
:viewBox="`0 0 ${SCHEMA_L} ${SCHEMA_H}`"
|
||||
:role="reduit ? undefined : 'img'"
|
||||
:aria-label="reduit ? undefined : description"
|
||||
:aria-hidden="reduit ? 'true' : undefined"
|
||||
focusable="false"
|
||||
>
|
||||
<g
|
||||
v-for="a in anneaux"
|
||||
:key="a.id"
|
||||
class="schema__anneau"
|
||||
:class="[
|
||||
`schema__anneau--${a.id}`,
|
||||
{ 'schema__anneau--survol': survol === a.id, 'schema__anneau--actif': actif === a.id },
|
||||
]"
|
||||
:style="styleAnneau(a.rang)"
|
||||
@mouseenter="survol = a.id"
|
||||
@click="choisir(a.id)"
|
||||
>
|
||||
<path class="schema__zone" :d="a.zone" fill-rule="evenodd" />
|
||||
<circle class="schema__trait" :cx="a.cx" :cy="a.cy" :r="a.r" />
|
||||
</g>
|
||||
|
||||
<text
|
||||
v-for="a in anneaux"
|
||||
:key="`lettre-${a.id}`"
|
||||
class="schema__lettre"
|
||||
:class="`schema__lettre--${a.id}`"
|
||||
:x="a.cx"
|
||||
:y="a.yLettre"
|
||||
:font-size="a.tailleLettre"
|
||||
text-anchor="middle"
|
||||
:style="styleLettre(a.rang)"
|
||||
>{{ a.id }}</text>
|
||||
|
||||
<template v-if="taille === 'grand'">
|
||||
<text
|
||||
v-for="a in anneaux"
|
||||
:key="`nom-${a.id}`"
|
||||
class="schema__nom"
|
||||
:x="a.cx"
|
||||
:y="a.yNom"
|
||||
:font-size="CORPS.nom"
|
||||
text-anchor="middle"
|
||||
:style="styleLettre(a.rang)"
|
||||
>{{ nomAnneau(a.id) }}</text>
|
||||
|
||||
<defs>
|
||||
<path v-for="arc in arcs" :id="idArc(arc)" :key="idArc(arc)" :d="arc.d" />
|
||||
</defs>
|
||||
<text
|
||||
v-for="arc in arcs"
|
||||
:key="`flux-${idArc(arc)}`"
|
||||
class="schema__flux"
|
||||
font-size="22"
|
||||
><textPath :href="`#${idArc(arc)}`" startOffset="50%" text-anchor="middle">{{ FLECHE[arc.sens] }} {{ ECHELLES_FLUX[arc.frontiere][arc.sens] }}</textPath></text>
|
||||
|
||||
<text class="schema__legende" :x="legende.x" :y="legende.ySort" :font-size="legende.taille" text-anchor="end">{{ FLECHE.sort }} {{ ECHELLES_FLUX_LEGENDE.sort }}</text>
|
||||
<text class="schema__legende" :x="legende.x" :y="legende.yRevient" :font-size="legende.taille" text-anchor="end">{{ FLECHE.revient }} {{ ECHELLES_FLUX_LEGENDE.revient }}</text>
|
||||
</template>
|
||||
</svg>
|
||||
|
||||
<template v-if="taille === 'grand'">
|
||||
<!-- Bandeaux M et XL : un calque par anneau, qui tourne autour du centre de la figure. -->
|
||||
<div
|
||||
v-for="b in bandeaux"
|
||||
:key="`bandeau-${b.id}`"
|
||||
class="schema__bandeau"
|
||||
:class="[`schema__bandeau--${b.id}`, { 'schema__bandeau--masque': MASQUE_BANDEAU[b.id] }]"
|
||||
:style="styleBandeau(b)"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<svg
|
||||
class="schema__tour"
|
||||
:class="`schema__tour--${b.sens}`"
|
||||
:viewBox="`0 0 ${SCHEMA_L} ${SCHEMA_H}`"
|
||||
:style="styleTour"
|
||||
focusable="false"
|
||||
>
|
||||
<defs><path :id="idBandeau(b.id)" :d="b.d" /></defs>
|
||||
<text class="schema__mots" :font-size="CORPS.mot" :textLength="b.longueur" lengthAdjust="spacing"><textPath :href="`#${idBandeau(b.id)}`">{{ textesBandeaux[b.id] }}</textPath></text>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<!-- S : un mot à la fois, au centre du disque, sous le nom. -->
|
||||
<div class="schema__mots-s" :style="styleMotsS" aria-hidden="true">
|
||||
<span
|
||||
v-for="(m, i) in ECHELLES.S.mots"
|
||||
:key="m"
|
||||
class="schema__mot-s"
|
||||
:class="{ 'schema__mot-s--premier': i === 0 }"
|
||||
:style="styleMotS(i)"
|
||||
><span v-for="ligne in lignesMotS(m)" :key="ligne" class="schema__mot-ligne">{{ ligne }}</span></span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="schema__pause"
|
||||
:aria-pressed="fige ? 'true' : 'false'"
|
||||
@click="fige = !fige"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<path v-if="fige" d="M8 5.5v13l10.5-6.5z" />
|
||||
<path v-else d="M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" />
|
||||
</svg>
|
||||
<span class="sr-only">Mettre les mots en pause</span>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</div></div>
|
||||
|
||||
<!-- Grand : les trois portes, qui se replient dans le bandeau quand une porte s'ouvre. -->
|
||||
<Transition name="schema-plier">
|
||||
<div v-if="taille === 'grand' && !reduit" class="schema__plie schema__portes-plie"><div class="schema__plie-dedans">
|
||||
<ul class="schema__portes">
|
||||
<li v-for="id in ORDRE_ECHELLES" :key="id">
|
||||
<NuxtLink
|
||||
:to="lienPorte(id)"
|
||||
class="schema__porte"
|
||||
:class="{ 'schema__porte--survol': survol === id }"
|
||||
:data-porte="id"
|
||||
@mouseenter="survol = id"
|
||||
@focus="survol = id"
|
||||
@blur="survol = null"
|
||||
>
|
||||
<span class="schema__porte-lettre">{{ id }}</span>
|
||||
<span class="schema__porte-texte">
|
||||
<span class="schema__porte-titre">{{ ECHELLES[id].titre }}</span>
|
||||
<span class="schema__porte-accroche">{{ ECHELLES[id].accroche }}</span>
|
||||
</span>
|
||||
<span class="schema__porte-fleche" aria-hidden="true">›</span>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
</div></div>
|
||||
</Transition>
|
||||
|
||||
<div v-if="$slots.apres" class="schema__plie schema__apres"><div class="schema__plie-dedans"><slot name="apres" /></div></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useId } from 'vue'
|
||||
import BandeauEchelles from '~/components/entree/BandeauEchelles.vue'
|
||||
import {
|
||||
ECHELLES, ORDRE_ECHELLES, ECHELLES_FLUX, ECHELLES_FLUX_LEGENDE, PARAM_PORTE,
|
||||
type EchelleId,
|
||||
} from '~/utils/echelles'
|
||||
import {
|
||||
SCHEMA_L, SCHEMA_H, anneauxEchelles, arcsFlux, legendeFlux, delaisApparition, finApparition,
|
||||
CORPS, MOUVEMENT_MOTS, MASQUE_BANDEAU, bandeauxAnneaux, motsBandeau, texteBandeau,
|
||||
cadreMotS, lignesMotS, masqueSecteurBas,
|
||||
type ArcFlux, type SensFlux, type BandeauAnneau,
|
||||
} from '~/utils/figures'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
taille: 'grand' | 'mini'
|
||||
/** Porte ouverte (mini) : son anneau et son lien en safran. */
|
||||
actif?: EchelleId | null
|
||||
/**
|
||||
* Première vue du schéma (grand) : les anneaux apparaissent du dehors vers le dedans
|
||||
* (XL, M, S), puis les lettres, en 900 ms au plus, une fois (B13-M6). CSS seul ;
|
||||
* sans effet sous `prefers-reduced-motion` ou si `html.entree-vue` est posé.
|
||||
*/
|
||||
apparition?: boolean
|
||||
/**
|
||||
* Grand, porte ouverte (B13b-M2) : la figure reste, réduite, et ses anneaux passent
|
||||
* d'une porte à l'autre en `replace` ; le titre, les portes et la phrase se replient.
|
||||
*/
|
||||
reduit?: boolean
|
||||
}>(), { actif: null, apparition: false, reduit: false })
|
||||
|
||||
const emit = defineEmits<{ fermer: [] }>()
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const uid = useId()
|
||||
|
||||
const anneaux = anneauxEchelles()
|
||||
const arcs = arcsFlux()
|
||||
const legende = legendeFlux()
|
||||
const bandeaux = bandeauxAnneaux()
|
||||
/** Texte de chaque bandeau : les sept mots d'echelles.ts, repris pour remplir le tour. */
|
||||
const textesBandeaux = Object.fromEntries(
|
||||
bandeaux.map((b) => [b.id, texteBandeau(motsBandeau(ECHELLES[b.id].mots, b.longueur))]),
|
||||
) as Record<BandeauAnneau['id'], string>
|
||||
const rangDe = (id: EchelleId) => anneaux.find((a) => a.id === id)?.rang ?? 0
|
||||
/** Mots arrêtés par le visiteur (bouton pause) : bandeaux immobiles, mot de S figé. */
|
||||
const fige = ref(false)
|
||||
const FLECHE: Record<SensFlux, string> = { sort: '↓', revient: '↑' }
|
||||
/** Icône du retour au schéma (téléphone) : trois cercles, rayons dans l'ordre XL, M, S. */
|
||||
|
||||
const survol = ref<EchelleId | null>(null)
|
||||
|
||||
/** Le nom écrit dans l'anneau, comme sur la slide 16 : le titre de l'échelle, initiale en minuscule. */
|
||||
const nomAnneau = (id: EchelleId) => {
|
||||
const t = ECHELLES[id].titre
|
||||
return t.charAt(0).toLowerCase() + t.slice(1)
|
||||
}
|
||||
|
||||
const idArc = (arc: ArcFlux) => `${uid}-arc-${arc.frontiere}-${arc.sens}`
|
||||
|
||||
/**
|
||||
* Description de la figure, sur le modèle de l'aria-label du deck ; B13b : une phrase par
|
||||
* anneau avec ses sept mots (séparés par des points-virgules, certains portent une virgule).
|
||||
*/
|
||||
const description = (() => {
|
||||
const anneauxTxt = ORDRE_ECHELLES.map((id) => `${id}, ${nomAnneau(id)}`).join(' ; ')
|
||||
const mots = ORDRE_ECHELLES.map((id) => `${id}, ${nomAnneau(id)} : ${ECHELLES[id].mots.join(' ; ')}.`).join(' ')
|
||||
const flux = (f: 'S' | 'M', entre: string) =>
|
||||
`Entre ${entre}, ${ECHELLES_FLUX_LEGENDE.sort} : ${ECHELLES_FLUX[f].sort} ; ${ECHELLES_FLUX_LEGENDE.revient} : ${ECHELLES_FLUX[f].revient}.`
|
||||
return `Trois anneaux imbriqués, S au centre : ${anneauxTxt}. ${mots} ${flux('S', 'S et M')} ${flux('M', 'M et XL')}`
|
||||
})()
|
||||
|
||||
const idBandeau = (id: EchelleId) => `${uid}-bandeau-${id}`
|
||||
|
||||
// Mouvement des mots (B13b-M1) : durées et délais tirés d'utils/figures.ts.
|
||||
// Les bandeaux démarrent après l'apparition du schéma (finApparition, 900 ms).
|
||||
const styleTour = { animationDuration: `${MOUVEMENT_MOTS.tour}ms`, animationDelay: `${finApparition()}ms` }
|
||||
const styleBandeau = (b: BandeauAnneau) => {
|
||||
const masque = MASQUE_BANDEAU[b.id]
|
||||
return {
|
||||
...(masque ? { '--masque': masqueSecteurBas(masque) } : {}),
|
||||
...(joueApparition.value ? { animationDelay: `${delaisApparition(rangDe(b.id)).lettre}ms` } : {}),
|
||||
}
|
||||
}
|
||||
const cadreS = cadreMotS()
|
||||
const styleMotsS = computed(() => ({
|
||||
left: `${(cadreS.x / SCHEMA_L) * 100}%`,
|
||||
top: `${(cadreS.y / SCHEMA_H) * 100}%`,
|
||||
width: `${(cadreS.l / SCHEMA_L) * 100}%`,
|
||||
height: `${(cadreS.h / SCHEMA_H) * 100}%`,
|
||||
...(joueApparition.value ? { animationDelay: `${delaisApparition(rangDe('S')).lettre}ms` } : {}),
|
||||
}))
|
||||
/**
|
||||
* Mot i de S : une boucle de 7 × 2,5 s par mot, décalée de i × 2,5 s. Le premier mot part
|
||||
* à 0 (visible dès l'arrivée, il s'efface à 2,1 s) ; les suivants, à rebours d'un tour,
|
||||
* restent éteints jusqu'à leur tour : le premier changement vient après l'apparition.
|
||||
*/
|
||||
const styleMotS = (i: number) => {
|
||||
const tour = ECHELLES.S.mots.length * MOUVEMENT_MOTS.cadence
|
||||
return {
|
||||
animationDuration: `${tour}ms`,
|
||||
animationDelay: `${i === 0 ? 0 : i * MOUVEMENT_MOTS.cadence - tour}ms`,
|
||||
}
|
||||
}
|
||||
|
||||
function queryPorte(id: EchelleId | null) {
|
||||
const q: Record<string, unknown> = { ...route.query }
|
||||
if (id) q[PARAM_PORTE] = id
|
||||
else delete q[PARAM_PORTE]
|
||||
return q as Record<string, string>
|
||||
}
|
||||
const lienPorte = (id: EchelleId) => ({ path: route.path, query: queryPorte(id) })
|
||||
|
||||
/** Adresse du schéma : le retour reste un vrai lien (nouvel onglet, sans JavaScript). */
|
||||
const hrefSchema = computed(() => router.resolve({ path: route.path, query: queryPorte(null) }).href)
|
||||
|
||||
function choisir(id: EchelleId) {
|
||||
// Porte déjà ouverte (mini, ou grand réduit) : un anneau fait passer à la voisine, en `replace`.
|
||||
const lateral = props.taille === 'mini' || props.reduit
|
||||
if (lateral && props.actif === id) return
|
||||
navigateTo(lienPorte(id), { replace: lateral })
|
||||
}
|
||||
|
||||
// Apparition (B13-M6) : délais par rang, du dehors vers le dedans (utils/figures.ts).
|
||||
const joueApparition = computed(() => props.apparition && props.taille === 'grand')
|
||||
const styleAnneau = (rang: number) =>
|
||||
joueApparition.value ? { animationDelay: `${delaisApparition(rang).anneau}ms` } : undefined
|
||||
const styleLettre = (rang: number) =>
|
||||
joueApparition.value ? { animationDelay: `${delaisApparition(rang).lettre}ms` } : undefined
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* ── Commun ────────────────────────────────────────────────────────────── */
|
||||
.schema__figure {
|
||||
position: relative;
|
||||
/* les calques (bandeaux, mots de S) se règlent en unités de la figure */
|
||||
container-type: inline-size;
|
||||
}
|
||||
.schema__dessin {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/* Repliables (B13b-M2) : la hauteur passe de 1fr à 0fr, CSS seul. */
|
||||
.schema__plie {
|
||||
display: grid;
|
||||
grid-template-rows: 1fr;
|
||||
min-width: 0;
|
||||
}
|
||||
.schema__plie-dedans { min-height: 0; min-width: 0; }
|
||||
.schema__avant > .schema__plie-dedans,
|
||||
.schema__apres > .schema__plie-dedans { overflow: hidden; }
|
||||
.schema-plier-enter-active > .schema__plie-dedans,
|
||||
.schema-plier-leave-active > .schema__plie-dedans { overflow: hidden; }
|
||||
|
||||
/* Retour au schéma, en tête de colonne (bureau seulement ; au téléphone, il est dans le bandeau). */
|
||||
.schema__retour { display: none; }
|
||||
|
||||
.schema__zone {
|
||||
fill: color-mix(in srgb, var(--nav-primary-solid) 5%, transparent);
|
||||
cursor: pointer;
|
||||
transition: fill 200ms var(--ease-out);
|
||||
}
|
||||
.schema__anneau--M .schema__zone { fill: color-mix(in srgb, var(--nav-primary-solid) 8%, transparent); }
|
||||
.schema__anneau--S .schema__zone { fill: color-mix(in srgb, var(--nav-primary-solid) 12%, transparent); }
|
||||
|
||||
.schema__trait {
|
||||
fill: none;
|
||||
stroke: color-mix(in srgb, var(--nav-primary-solid) 60%, transparent);
|
||||
stroke-width: 2px;
|
||||
vector-effect: non-scaling-stroke;
|
||||
pointer-events: none;
|
||||
transition: stroke 200ms var(--ease-out);
|
||||
}
|
||||
|
||||
.schema__anneau--survol .schema__zone { fill: color-mix(in srgb, var(--accent) 20%, transparent); }
|
||||
.schema__anneau--actif .schema__zone { fill: color-mix(in srgb, var(--accent) 32%, transparent); }
|
||||
.schema__anneau--survol .schema__trait,
|
||||
.schema__anneau--actif .schema__trait {
|
||||
stroke: var(--accent);
|
||||
stroke-width: 3px;
|
||||
}
|
||||
|
||||
.schema__lettre,
|
||||
.schema__nom,
|
||||
.schema__flux,
|
||||
.schema__legende {
|
||||
pointer-events: none;
|
||||
font-family: var(--font-body);
|
||||
}
|
||||
.schema__lettre {
|
||||
fill: var(--text);
|
||||
font-weight: var(--fw-bold);
|
||||
}
|
||||
.schema__nom,
|
||||
.schema__flux,
|
||||
.schema__legende {
|
||||
fill: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
.schema__nom { font-weight: var(--fw-semibold); }
|
||||
.schema__flux,
|
||||
.schema__legende { display: none; }
|
||||
|
||||
/* ── Les mots (B13b-M1) ── */
|
||||
.schema__bandeau {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
/* le calque tourne : ses coins ne doivent pas élargir la page */
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
.schema__tour {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: visible;
|
||||
}
|
||||
.schema__mots {
|
||||
font-family: var(--font-body);
|
||||
font-size: 26px;
|
||||
fill: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
.schema__mots-s {
|
||||
position: absolute;
|
||||
display: grid;
|
||||
pointer-events: none;
|
||||
}
|
||||
.schema__mot-s {
|
||||
grid-area: 1 / 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
/* 26 unités du viewBox (820 de large) : 11,4 px rendus à 390 px */
|
||||
font-size: calc(100cqw * 26 / 820);
|
||||
line-height: 1.2;
|
||||
color: var(--text);
|
||||
opacity: 0;
|
||||
}
|
||||
.schema__mot-s--premier { opacity: 1; }
|
||||
/* Coupure écrite par lignesMotS (utils/figures.ts) : une ligne ne se recoupe pas. */
|
||||
.schema__mot-ligne { white-space: nowrap; }
|
||||
.schema__pause {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--surface);
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
cursor: pointer;
|
||||
}
|
||||
.schema__pause svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
fill: currentColor;
|
||||
}
|
||||
.schema__pause:hover { color: var(--text); border-color: var(--accent); }
|
||||
.schema__pause:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.schema__flux { font-style: italic; }
|
||||
.schema__legende { font-family: var(--font-mono); }
|
||||
|
||||
.schema__portes {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-xs);
|
||||
}
|
||||
|
||||
.schema__porte {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-sm);
|
||||
min-height: 44px;
|
||||
padding: var(--space-xs) var(--space-sm);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out);
|
||||
}
|
||||
.schema__porte:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.schema__porte-lettre {
|
||||
flex: 0 0 auto;
|
||||
min-width: 2.25rem;
|
||||
padding: 0.15rem 0.4rem;
|
||||
border-radius: var(--radius-sm);
|
||||
background: color-mix(in srgb, var(--nav-primary-solid) 10%, transparent);
|
||||
color: var(--text);
|
||||
font-weight: var(--fw-bold);
|
||||
font-size: var(--fs-sm);
|
||||
text-align: center;
|
||||
letter-spacing: 0.04em;
|
||||
transition: background-color 200ms var(--ease-out);
|
||||
}
|
||||
.schema__porte-texte {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
}
|
||||
.schema__porte-titre {
|
||||
font-weight: var(--fw-semibold);
|
||||
font-size: var(--fs-base);
|
||||
line-height: var(--lh-tight);
|
||||
}
|
||||
.schema__porte-accroche {
|
||||
margin-top: 0.15rem;
|
||||
font-size: var(--fs-sm);
|
||||
line-height: 1.35;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
.schema__porte-fleche {
|
||||
margin-left: auto;
|
||||
font-size: var(--fs-xl);
|
||||
line-height: 1;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
|
||||
.schema__porte:hover,
|
||||
.schema__porte--survol {
|
||||
border-color: var(--accent);
|
||||
background: color-mix(in srgb, var(--accent) 14%, var(--surface));
|
||||
}
|
||||
.schema__porte:hover .schema__porte-lettre,
|
||||
.schema__porte--survol .schema__porte-lettre {
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
}
|
||||
|
||||
/* ── Grand : l'état 0 ──────────────────────────────────────────────────── */
|
||||
.schema--grand {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-areas: "avant" "figure" "portes" "apres";
|
||||
gap: var(--space-sm);
|
||||
width: 100%;
|
||||
max-width: 30rem;
|
||||
margin-inline: auto;
|
||||
}
|
||||
.schema--grand .schema__avant { grid-area: avant; }
|
||||
.schema--grand .schema__fig {
|
||||
grid-area: figure;
|
||||
justify-self: center;
|
||||
width: 100%;
|
||||
max-width: 27.5rem;
|
||||
}
|
||||
.schema--grand .schema__portes-plie { grid-area: portes; }
|
||||
.schema--grand .schema__apres { grid-area: apres; }
|
||||
|
||||
/* ── Grand réduit : la porte est ouverte, le schéma reste (B13b-M2) ───── */
|
||||
.schema--reduit .schema__avant,
|
||||
.schema--reduit .schema__apres {
|
||||
grid-template-rows: 0fr;
|
||||
opacity: 0;
|
||||
}
|
||||
/* Le titre reste lu (h1 de la page) ; la phrase sort de l'arbre une fois repliée. */
|
||||
.schema--reduit .schema__apres { visibility: hidden; }
|
||||
/* Réduite, la figure n'a plus que ses anneaux et ses lettres, plus grandes pour rester lisibles. */
|
||||
.schema--reduit .schema__nom,
|
||||
.schema--reduit .schema__flux,
|
||||
.schema--reduit .schema__legende,
|
||||
.schema--reduit .schema__bandeau,
|
||||
.schema--reduit .schema__mots-s,
|
||||
.schema--reduit .schema__pause {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
.schema--reduit .schema__lettre { font-size: 60px; }
|
||||
.schema--reduit .schema__lettre--S {
|
||||
transform: translateY(22px);
|
||||
}
|
||||
|
||||
@media (max-width: 1023.98px) {
|
||||
.schema--reduit .schema__fig { width: 40%; }
|
||||
.schema--grand.schema--reduit { row-gap: 0; }
|
||||
.schema--grand { transition: row-gap 280ms var(--ease-out); }
|
||||
.schema--grand .schema__fig { transition: width 280ms var(--ease-out); }
|
||||
.schema__lettre { transition: font-size 280ms var(--ease-out), transform 280ms var(--ease-out); }
|
||||
.schema__avant,
|
||||
.schema__apres {
|
||||
transition: grid-template-rows 280ms var(--ease-out), opacity 200ms var(--ease-out), visibility 0s linear 0s;
|
||||
}
|
||||
.schema--reduit .schema__apres { transition-delay: 0s, 0s, 280ms; }
|
||||
.schema__nom,
|
||||
.schema__bandeau,
|
||||
.schema__mots-s,
|
||||
.schema__pause {
|
||||
transition: opacity 150ms var(--ease-out), visibility 0s linear 0s;
|
||||
}
|
||||
.schema--reduit .schema__nom,
|
||||
.schema--reduit .schema__bandeau,
|
||||
.schema--reduit .schema__mots-s,
|
||||
.schema--reduit .schema__pause { transition-delay: 0s, 150ms; }
|
||||
.schema-plier-enter-active,
|
||||
.schema-plier-leave-active {
|
||||
transition: grid-template-rows 280ms var(--ease-out), opacity 200ms var(--ease-out);
|
||||
}
|
||||
.schema-plier-enter-from,
|
||||
.schema-plier-leave-to {
|
||||
grid-template-rows: 0fr;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.schema--grand {
|
||||
max-width: 68rem;
|
||||
grid-template-columns: minmax(0, 604px) minmax(0, 26rem);
|
||||
grid-template-rows: 1fr auto 1fr;
|
||||
grid-template-areas: "figure avant" "figure portes" "figure apres";
|
||||
column-gap: var(--space-2xl);
|
||||
row-gap: var(--space-md);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.schema--grand .schema__avant { align-self: end; }
|
||||
.schema--grand .schema__apres { align-self: start; }
|
||||
.schema--grand .schema__fig { max-width: 604px; }
|
||||
|
||||
/* Porte ouverte : une colonne, le retour, la figure réduite (la page la fait glisser). */
|
||||
.schema--grand.schema--reduit {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: var(--space-md);
|
||||
max-width: none;
|
||||
}
|
||||
.schema--reduit .schema__fig {
|
||||
max-width: 15rem;
|
||||
align-self: center;
|
||||
}
|
||||
.schema--reduit .schema__avant {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0 0 0 0);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.schema--reduit .schema__apres { display: none; }
|
||||
.schema__retour {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4em;
|
||||
align-self: flex-start;
|
||||
min-height: 44px;
|
||||
padding: 0 var(--space-xs);
|
||||
border-radius: var(--radius-md);
|
||||
color: var(--text);
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: var(--fw-semibold);
|
||||
text-decoration: none;
|
||||
}
|
||||
.schema__retour:hover { background: var(--bg-alt); }
|
||||
.schema__retour:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
/* Retour au schéma : les portes reviennent en fondu, la figure glisse. */
|
||||
.schema-plier-enter-active { transition: opacity 200ms var(--ease-out); }
|
||||
.schema-plier-enter-from { opacity: 0; }
|
||||
.schema--grand .schema__flux,
|
||||
.schema--grand .schema__legende { display: inline; }
|
||||
/* Corps du deck pour les noms (16 px environ à 1 440), mots un peu plus petits qu'au téléphone */
|
||||
.schema--grand .schema__nom { font-size: 22px; }
|
||||
.schema__mots { font-size: 23px; }
|
||||
.schema__mot-s { font-size: calc(100cqw * 23 / 820); }
|
||||
/* Les arcs sont à l'écran : le bandeau M passe derrière le secteur de « ce qui revient » */
|
||||
.schema__bandeau--masque {
|
||||
-webkit-mask-image: var(--masque);
|
||||
mask-image: var(--masque);
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Mini : le bandeau de la porte ouverte (B13b-M3) ───────────────────── */
|
||||
/* Téléphone : « ← Schéma » | trois ronds au centre exact | une colonne vide de même largeur. */
|
||||
.schema--mini {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
||||
align-items: center;
|
||||
column-gap: var(--space-xs);
|
||||
padding: 4px 0;
|
||||
}
|
||||
.schema--mini .schema__pas { grid-column: 2; }
|
||||
|
||||
.schema__fermer {
|
||||
grid-column: 1;
|
||||
justify-self: start;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.3em;
|
||||
min-height: 44px;
|
||||
padding: 0 var(--space-xs) 0 0;
|
||||
border-radius: var(--radius-md);
|
||||
color: var(--text);
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: var(--fw-semibold);
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
}
|
||||
.schema__fermer:hover { text-decoration: underline; text-underline-offset: 3px; }
|
||||
.schema__fermer:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
/* Bureau : les ronds centrés dans la colonne ; le retour est en tête de colonne (grand réduit). */
|
||||
.schema--mini {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
}
|
||||
.schema--mini .schema__fermer { display: none; }
|
||||
}
|
||||
|
||||
/*
|
||||
Mouvement réduit : état final, échange immédiat. `!important` : ces règles doivent l'emporter
|
||||
sur les transitions posées plus haut avec un sélecteur plus fort (téléphone, figure réduite) ;
|
||||
sans transition, la <Transition> de Vue retire aussi les portes sans attendre.
|
||||
*/
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.schema__zone,
|
||||
.schema__trait,
|
||||
.schema__porte,
|
||||
.schema__porte-lettre,
|
||||
.schema--grand,
|
||||
.schema__lettre,
|
||||
.schema__fig,
|
||||
.schema__avant,
|
||||
.schema__apres,
|
||||
.schema__nom,
|
||||
.schema__flux,
|
||||
.schema__legende,
|
||||
.schema__bandeau,
|
||||
.schema__mots-s,
|
||||
.schema__pause,
|
||||
.schema-plier-enter-active,
|
||||
.schema-plier-leave-active { transition: none !important; }
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--
|
||||
Apparition (B13-M6), hors du bloc scoped : les @keyframes gardent leur nom et
|
||||
`html.entree-vue` (posé avant le premier rendu par la page si l'apparition a
|
||||
déjà été vue) doit pouvoir l'éteindre. Délais en style en ligne (rang).
|
||||
Reduced motion = état final au premier rendu : `animation: none`, pas une durée
|
||||
raccourcie (le deck gardait les délais et cachait des éléments près d'une seconde).
|
||||
-->
|
||||
<style>
|
||||
.schema--apparition .schema__anneau {
|
||||
animation: aep-schema-anneau 450ms var(--ease-out) backwards;
|
||||
transform-box: fill-box;
|
||||
transform-origin: center;
|
||||
}
|
||||
.schema--apparition .schema__lettre,
|
||||
.schema--apparition .schema__nom {
|
||||
animation: aep-schema-texte 250ms var(--ease-out) backwards;
|
||||
}
|
||||
.schema--apparition .schema__flux,
|
||||
.schema--apparition .schema__legende {
|
||||
animation: aep-schema-texte 250ms var(--ease-out) 650ms backwards;
|
||||
}
|
||||
.schema--apparition .schema__bandeau,
|
||||
.schema--apparition .schema__mots-s {
|
||||
animation: aep-schema-texte 250ms var(--ease-out) backwards;
|
||||
}
|
||||
@keyframes aep-schema-anneau {
|
||||
from { opacity: 0; transform: scale(0.9); }
|
||||
to { opacity: 1; transform: none; }
|
||||
}
|
||||
|
||||
/*
|
||||
Les mots en mouvement (B13b-M1). Durées et délais en style en ligne (utils/figures.ts,
|
||||
MOUVEMENT_MOTS) : un tour de bandeau en 75 s après l'apparition ; un mot de S toutes
|
||||
les 2,5 s. Les pourcentages de `aep-mot-s` valent pour 7 mots : 2,1 s visible
|
||||
(12 %), fondu de 400 ms jusqu'à 2,5 s (14,286 %), éteint, fondu d'entrée à 17,1 s (97,714 %).
|
||||
*/
|
||||
.schema__tour {
|
||||
animation: aep-schema-tour-horaire 75s linear 900ms infinite;
|
||||
}
|
||||
.schema__tour--antihoraire { animation-name: aep-schema-tour-antihoraire; }
|
||||
.schema__mot-s {
|
||||
animation: aep-mot-s 17.5s linear infinite;
|
||||
}
|
||||
.schema__figure--fige .schema__tour,
|
||||
.schema__figure--fige .schema__mot-s,
|
||||
.schema--reduit .schema__tour,
|
||||
.schema--reduit .schema__mot-s {
|
||||
animation-play-state: paused;
|
||||
}
|
||||
@keyframes aep-schema-tour-horaire {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
@keyframes aep-schema-tour-antihoraire {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(-360deg); }
|
||||
}
|
||||
@keyframes aep-mot-s {
|
||||
0%, 12% { opacity: 1; }
|
||||
14.286%, 97.714% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
@keyframes aep-schema-texte {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
html.entree-vue .schema--apparition .schema__anneau,
|
||||
html.entree-vue .schema--apparition .schema__lettre,
|
||||
html.entree-vue .schema--apparition .schema__nom,
|
||||
html.entree-vue .schema--apparition .schema__flux,
|
||||
html.entree-vue .schema--apparition .schema__legende,
|
||||
html.entree-vue .schema--apparition .schema__bandeau,
|
||||
html.entree-vue .schema--apparition .schema__mots-s {
|
||||
animation: none;
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.schema--apparition .schema__anneau,
|
||||
.schema--apparition .schema__lettre,
|
||||
.schema--apparition .schema__nom,
|
||||
.schema--apparition .schema__flux,
|
||||
.schema--apparition .schema__legende,
|
||||
.schema--apparition .schema__bandeau,
|
||||
.schema--apparition .schema__mots-s,
|
||||
.schema__tour,
|
||||
.schema__mot-s {
|
||||
animation: none;
|
||||
}
|
||||
/* rien ne bouge : le bouton pause n'a plus d'objet */
|
||||
.schema__pause { display: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,234 @@
|
||||
<!--
|
||||
SectionEchelle — B13-M4
|
||||
La porte ouverte d'une échelle, sous le mini-schéma de l'entrée (CONCEPTION §1, état 1).
|
||||
Dans l'ordre de lecture à l'écran (parti 1 : une intention, puis un geste) :
|
||||
titre (h2, cible du focus après ouverture ou passage latéral)
|
||||
intention = la phrase de l'échelle
|
||||
une seule rangée de boutons de même style (B13b-M5, `PORTES_ECHELLES[id]`) : le geste,
|
||||
puis les onglets d'une autre cible ; sur M, un bouton « Écosystème d'entraide et
|
||||
réseaux AEP » (la barre B10 garde ses deux onglets jusqu'à B4)
|
||||
anneau (AnneauEchelle, en safran) + les sept mots
|
||||
<slot /> : la matière de l'échelle (B15 pour XL, B16 pour M et S) ; tant qu'il est vide,
|
||||
« Cette échelle est en construction. » et « Proposer une ressource » (B13b-M6) :
|
||||
la condition porte sur le slot, la ligne disparaîtra d'elle-même
|
||||
puis les voisines (passage latéral, en `replace`)
|
||||
Liens sortants sans préchargement : l'entrée ne tire ni la carte (Leaflet), ni le chatbot,
|
||||
ni d3 tant que le visiteur n'a pas choisi (la barre B10 d'app.vue, elle, précharge dès 768 px).
|
||||
B13b-M4 : un clic simple sur un lien sortant émet `partir` (la page replie la section vers
|
||||
le haut, puis navigue) ; un clic modifié (Ctrl, Cmd, Maj, molette) garde la navigation
|
||||
du navigateur. Les `href` rendus ne changent pas : le lien marche sans JavaScript.
|
||||
Titre, phrase et mots viennent d'EchelleTete (contrat B10) ; la section ne fait que
|
||||
les replacer en grille et y glisser le geste et l'anneau. Aucun texte recopié :
|
||||
utils/echelles.ts fait foi.
|
||||
-->
|
||||
<template>
|
||||
<section class="porte" :class="`porte--${echelle}`" :aria-labelledby="titreId">
|
||||
<EchelleTete
|
||||
:echelle="echelle"
|
||||
:contribuer="false"
|
||||
titre-niveau="h2"
|
||||
:titre-id="titreId"
|
||||
class="porte__tete"
|
||||
>
|
||||
<nav class="porte__rangee" :aria-label="`Pages de l'échelle ${e.id}`">
|
||||
<ul class="porte__boutons">
|
||||
<li v-for="b in boutons" :key="b.to">
|
||||
<NuxtLink v-slot="{ href }" :to="b.to" custom no-prefetch>
|
||||
<a :href="href" class="porte__bouton" @click="partir($event, b.to)">{{ b.libelle }}<span aria-hidden="true">→</span></a>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<AnneauEchelle :echelle="echelle" actif class="porte__anneau" />
|
||||
</EchelleTete>
|
||||
|
||||
<div v-if="$slots.default" class="porte__matiere"><slot /></div>
|
||||
<p v-else class="porte__construction">
|
||||
<span>{{ PORTE_EN_CONSTRUCTION.texte }}</span>
|
||||
<NuxtLink v-slot="{ href }" :to="lienProposer(echelle)" custom no-prefetch>
|
||||
<a :href="href" class="porte__proposer" @click="partir($event, lienProposer(echelle))">{{ PORTE_EN_CONSTRUCTION.proposer }}<span aria-hidden="true">→</span></a>
|
||||
</NuxtLink>
|
||||
</p>
|
||||
|
||||
<nav v-if="v.precedente || v.suivante" class="porte__voisines" aria-label="Échelles voisines">
|
||||
<NuxtLink
|
||||
v-if="v.precedente"
|
||||
:to="lienPorte(v.precedente)"
|
||||
replace
|
||||
class="porte__voisine porte__voisine--precedente"
|
||||
><span aria-hidden="true">←</span>{{ v.precedente }} · {{ ECHELLES[v.precedente].titre }}</NuxtLink>
|
||||
<NuxtLink
|
||||
v-if="v.suivante"
|
||||
:to="lienPorte(v.suivante)"
|
||||
replace
|
||||
class="porte__voisine porte__voisine--suivante"
|
||||
>{{ v.suivante }} · {{ ECHELLES[v.suivante].titre }}<span aria-hidden="true">→</span></NuxtLink>
|
||||
</nav>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
ECHELLES, PARAM_PORTE, PORTES_ECHELLES, PORTE_EN_CONSTRUCTION, lienProposer, voisines,
|
||||
type EchelleId,
|
||||
} from '~/utils/echelles'
|
||||
import AnneauEchelle from '~/components/figures/AnneauEchelle.vue'
|
||||
|
||||
const props = defineProps<{ echelle: EchelleId }>()
|
||||
const emit = defineEmits<{ partir: [to: string] }>()
|
||||
|
||||
/**
|
||||
* Lien sortant (B13b-M4) : clic simple → la page replie l'entrée puis navigue ;
|
||||
* clic modifié ou autre bouton → rien n'est intercepté, le navigateur fait son travail.
|
||||
*/
|
||||
function partir(ev: MouseEvent, to: string) {
|
||||
if (ev.defaultPrevented || ev.button !== 0 || ev.metaKey || ev.ctrlKey || ev.shiftKey || ev.altKey) return
|
||||
ev.preventDefault()
|
||||
emit('partir', to)
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
const e = computed(() => ECHELLES[props.echelle])
|
||||
/** La rangée de boutons de la porte (geste et onglets réunis, sans doublon). */
|
||||
const boutons = computed(() => PORTES_ECHELLES[props.echelle])
|
||||
const v = computed(() => voisines(props.echelle))
|
||||
/** id stable par échelle : la page y pose le focus après une ouverture ou un passage latéral. */
|
||||
const titreId = computed(() => `porte-titre-${props.echelle}`)
|
||||
|
||||
const lienPorte = (id: EchelleId) => ({ path: route.path, query: { ...route.query, [PARAM_PORTE]: id } })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.porte {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-lg);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* EchelleTete replacée en grille : titre, intention, rangée de boutons, puis l'anneau à côté des mots. */
|
||||
.porte .porte__tete {
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
grid-template-areas:
|
||||
"titre titre"
|
||||
"phrase phrase"
|
||||
"geste geste"
|
||||
"anneau mots";
|
||||
column-gap: var(--space-md);
|
||||
row-gap: var(--space-sm);
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
}
|
||||
.porte__tete :deep(.echelle-tete__kicker) {
|
||||
grid-area: titre;
|
||||
scroll-margin-top: 4.5rem;
|
||||
}
|
||||
.porte__tete :deep(.echelle-tete__kicker:focus) { outline: none; }
|
||||
.porte__tete :deep(.echelle-tete__kicker:focus-visible) {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 4px;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
.porte__tete :deep(.echelle-tete__titre) { font-size: var(--fs-xl); }
|
||||
/* Texte atténué lisible (DESIGN-SYSTEM §Navigation : 78 %, pas --text-muted), ici seulement. */
|
||||
.porte__tete :deep(.echelle-tete__sous-titre) {
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
.porte__tete :deep(.echelle-tete__phrase) {
|
||||
grid-area: phrase;
|
||||
font-size: var(--fs-base);
|
||||
font-style: normal;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
.porte__tete :deep(.echelle-tete__mots) { grid-area: mots; }
|
||||
|
||||
/* Une seule rangée, tous les boutons du style du geste (B13b-M5) ; retour à la ligne permis. */
|
||||
.porte__rangee { grid-area: geste; }
|
||||
.porte__boutons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-xs);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.porte__bouton {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4em;
|
||||
min-height: 44px;
|
||||
padding: var(--space-xs) var(--space-md);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font-weight: var(--fw-semibold);
|
||||
line-height: var(--lh-tight);
|
||||
text-decoration: none;
|
||||
}
|
||||
.porte__bouton:hover { opacity: 0.88; }
|
||||
.porte__bouton:focus-visible,
|
||||
.porte__proposer:focus-visible,
|
||||
.porte__voisine:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* En construction (B13b-M6) : une ligne, puis un bouton secondaire (contour, pas safran). */
|
||||
.porte__construction {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-xs) var(--space-sm);
|
||||
margin: 0;
|
||||
font-size: var(--fs-sm);
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
.porte__proposer {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4em;
|
||||
min-height: 44px;
|
||||
padding: var(--space-xs) var(--space-md);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-md);
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
font-weight: var(--fw-semibold);
|
||||
text-decoration: none;
|
||||
}
|
||||
.porte__proposer:hover { border-color: var(--accent); }
|
||||
|
||||
.porte__anneau {
|
||||
grid-area: anneau;
|
||||
width: 4.5rem;
|
||||
}
|
||||
|
||||
.porte__voisines {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-xs);
|
||||
padding-top: var(--space-md);
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
.porte__voisine {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4em;
|
||||
min-height: 44px;
|
||||
padding: 0 var(--space-sm);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: var(--fw-semibold);
|
||||
text-decoration: none;
|
||||
}
|
||||
.porte__voisine:hover { border-color: var(--accent); }
|
||||
.porte__voisine--suivante { margin-left: auto; }
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.porte__anneau { width: 6rem; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<!-- Le cercle des trois échelles d'aep.trans-former.fr/entree (B13b, components/entree/SchemaEchelles.vue),
|
||||
demandé par Jules pour la page codev (B26) : la figure seule. Même géométrie (utils/figures.ts),
|
||||
mêmes textes (utils/echelles.ts) ; ni portes, ni arcs « ce qui sort / ce qui revient ».
|
||||
Cadre resserré sur l'anneau XL (le schéma d'AEP garde de la place pour la légende des arcs) :
|
||||
les mots y gagnent 12 %, 11 px rendus à 360 px. M et XL : un bandeau de mots qui tourne
|
||||
(calque HTML, `transform` sur le compositeur) ; S : un mot à la fois, en fondu. CSS seul,
|
||||
arrêté par le bouton pause (WCAG 2.2.2) et sous `prefers-reduced-motion`. -->
|
||||
<div class="cercle" :class="{ 'cercle--fige': fige }">
|
||||
<svg class="cercle__dessin" :viewBox="VB" role="img" :aria-label="description" focusable="false">
|
||||
<g v-for="a in anneaux" :key="a.id" :class="`cercle__anneau cercle__anneau--${a.id}`">
|
||||
<path class="cercle__zone" :d="a.zone" fill-rule="evenodd" />
|
||||
<circle class="cercle__trait" :cx="a.cx" :cy="a.cy" :r="a.r" />
|
||||
</g>
|
||||
<text
|
||||
v-for="a in anneaux"
|
||||
:key="`lettre-${a.id}`"
|
||||
class="cercle__lettre"
|
||||
:x="a.cx"
|
||||
:y="a.yLettre"
|
||||
:font-size="a.tailleLettre"
|
||||
text-anchor="middle"
|
||||
>{{ a.id }}</text>
|
||||
<text
|
||||
v-for="a in anneaux"
|
||||
:key="`nom-${a.id}`"
|
||||
class="cercle__nom"
|
||||
:x="a.cx"
|
||||
:y="a.yNom"
|
||||
:font-size="CORPS.nom"
|
||||
text-anchor="middle"
|
||||
>{{ nomAnneau(a.id) }}</text>
|
||||
</svg>
|
||||
|
||||
<div v-for="b in bandeaux" :key="`bandeau-${b.id}`" class="cercle__bandeau" aria-hidden="true">
|
||||
<svg class="cercle__tour" :class="`cercle__tour--${b.sens}`" :viewBox="VB" focusable="false">
|
||||
<defs><path :id="idBandeau(b.id)" :d="b.d" /></defs>
|
||||
<text class="cercle__mots" :font-size="CORPS.mot" :textLength="b.longueur" lengthAdjust="spacing"><textPath :href="`#${idBandeau(b.id)}`">{{ textesBandeaux[b.id] }}</textPath></text>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="cercle__mots-s" :style="styleMotsS" aria-hidden="true">
|
||||
<span
|
||||
v-for="(m, i) in ECHELLES.S.mots"
|
||||
:key="m"
|
||||
class="cercle__mot-s"
|
||||
:class="{ 'cercle__mot-s--premier': i === 0 }"
|
||||
:style="styleMotS(i)"
|
||||
><span v-for="ligne in lignesMotS(m)" :key="ligne" class="cercle__mot-ligne">{{ ligne }}</span></span>
|
||||
</div>
|
||||
|
||||
<button type="button" class="cercle__pause" :aria-pressed="fige ? 'true' : 'false'" @click="fige = !fige">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<path v-if="fige" d="M8 5.5v13l10.5-6.5z" />
|
||||
<path v-else d="M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" />
|
||||
</svg>
|
||||
<span class="evt-sr">Mettre les mots en pause</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useId } from 'vue'
|
||||
import { ECHELLES, ORDRE_ECHELLES, type EchelleId } from '~/utils/echelles'
|
||||
import {
|
||||
anneauxEchelles, bandeauxAnneaux, motsBandeau, texteBandeau, cadreMotS, lignesMotS,
|
||||
CORPS, MOUVEMENT_MOTS, type BandeauAnneau,
|
||||
} from '~/utils/figures'
|
||||
|
||||
const uid = useId()
|
||||
const anneaux = anneauxEchelles()
|
||||
const bandeaux = bandeauxAnneaux()
|
||||
|
||||
/** Cadre carré autour de l'anneau XL, trait compris : les calques (bandeaux, mots de S) le partagent. */
|
||||
const xl = anneaux[0]
|
||||
const COTE = 2 * (xl.r + 4)
|
||||
const X0 = xl.cx - COTE / 2
|
||||
const Y0 = xl.cy - COTE / 2
|
||||
const VB = `${X0} ${Y0} ${COTE} ${COTE}`
|
||||
|
||||
const textesBandeaux = Object.fromEntries(
|
||||
bandeaux.map((b) => [b.id, texteBandeau(motsBandeau(ECHELLES[b.id].mots, b.longueur))]),
|
||||
) as Record<BandeauAnneau['id'], string>
|
||||
const idBandeau = (id: EchelleId) => `${uid}-bandeau-${id}`
|
||||
|
||||
/** Le nom écrit dans l'anneau, comme sur aep : le titre de l'échelle, initiale en minuscule. */
|
||||
const nomAnneau = (id: EchelleId) => {
|
||||
const t = ECHELLES[id].titre
|
||||
return t.charAt(0).toLowerCase() + t.slice(1)
|
||||
}
|
||||
|
||||
/** Sur le modèle de SchemaEchelles : les anneaux, puis les sept mots de chacun. */
|
||||
const description = (() => {
|
||||
const anneauxTxt = ORDRE_ECHELLES.map((id) => `${id}, ${nomAnneau(id)}`).join(' ; ')
|
||||
const mots = ORDRE_ECHELLES.map((id) => `${id}, ${nomAnneau(id)} : ${ECHELLES[id].mots.join(' ; ')}.`).join(' ')
|
||||
return `Trois anneaux imbriqués, S au centre : ${anneauxTxt}. ${mots}`
|
||||
})()
|
||||
|
||||
/** Pause du visiteur : bandeaux immobiles, mot de S figé. */
|
||||
const fige = ref(false)
|
||||
|
||||
const cadreS = cadreMotS()
|
||||
const styleMotsS = {
|
||||
left: `${((cadreS.x - X0) / COTE) * 100}%`,
|
||||
top: `${((cadreS.y - Y0) / COTE) * 100}%`,
|
||||
width: `${(cadreS.l / COTE) * 100}%`,
|
||||
height: `${(cadreS.h / COTE) * 100}%`,
|
||||
fontSize: `calc(100cqw * ${CORPS.mot} / ${COTE})`,
|
||||
}
|
||||
/** Mot i de S : une boucle de 7 × 2,5 s, décalée de i × 2,5 s ; le premier est visible dès l'arrivée. */
|
||||
const styleMotS = (i: number) => {
|
||||
const tour = ECHELLES.S.mots.length * MOUVEMENT_MOTS.cadence
|
||||
return { animationDuration: `${tour}ms`, animationDelay: `${i === 0 ? 0 : i * MOUVEMENT_MOTS.cadence - tour}ms` }
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.cercle {
|
||||
position: relative;
|
||||
/* les calques (bandeaux, mots de S) se règlent en unités de la figure */
|
||||
container-type: inline-size;
|
||||
}
|
||||
.cercle__dessin { display: block; width: 100%; height: auto; }
|
||||
|
||||
/* Les teintes du schéma d'aep : bleu nuit en voile, de plus en plus dense vers le centre */
|
||||
.cercle__zone { fill: color-mix(in srgb, var(--nav-primary-solid) 5%, transparent); }
|
||||
.cercle__anneau--M .cercle__zone { fill: color-mix(in srgb, var(--nav-primary-solid) 8%, transparent); }
|
||||
.cercle__anneau--S .cercle__zone { fill: color-mix(in srgb, var(--nav-primary-solid) 12%, transparent); }
|
||||
.cercle__trait {
|
||||
fill: none;
|
||||
stroke: color-mix(in srgb, var(--nav-primary-solid) 60%, transparent);
|
||||
stroke-width: 2px;
|
||||
vector-effect: non-scaling-stroke;
|
||||
}
|
||||
.cercle__lettre, .cercle__nom, .cercle__mots { font-family: var(--font-body); }
|
||||
.cercle__lettre { fill: var(--text); font-weight: var(--fw-bold); }
|
||||
.cercle__nom { fill: var(--evt-attenue); font-weight: var(--fw-semibold); }
|
||||
.cercle__mots { fill: var(--evt-attenue); }
|
||||
|
||||
.cercle__bandeau {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
/* le calque tourne : ses coins ne doivent pas élargir la page */
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
.cercle__tour {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: visible;
|
||||
animation: tour-horaire 75s linear infinite;
|
||||
}
|
||||
.cercle__tour--antihoraire { animation-name: tour-antihoraire; }
|
||||
|
||||
.cercle__mots-s { position: absolute; display: grid; pointer-events: none; }
|
||||
.cercle__mot-s {
|
||||
grid-area: 1 / 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
line-height: 1.2;
|
||||
color: var(--text);
|
||||
opacity: 0;
|
||||
animation: mot-s 17.5s linear infinite;
|
||||
}
|
||||
.cercle__mot-s--premier { opacity: 1; }
|
||||
.cercle__mot-ligne { white-space: nowrap; }
|
||||
|
||||
.cercle--fige .cercle__tour,
|
||||
.cercle--fige .cercle__mot-s { animation-play-state: paused; }
|
||||
|
||||
.cercle__pause {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--surface);
|
||||
color: var(--evt-attenue);
|
||||
cursor: pointer;
|
||||
}
|
||||
.cercle__pause svg { width: 18px; height: 18px; fill: currentColor; }
|
||||
.cercle__pause:hover { color: var(--text); border-color: var(--accent); }
|
||||
|
||||
@keyframes tour-horaire { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
|
||||
@keyframes tour-antihoraire { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
|
||||
/* Pour 7 mots : 2,1 s visible (12 %), fondu de 400 ms jusqu'à 2,5 s (14,286 %), éteint, fondu d'entrée à 17,1 s */
|
||||
@keyframes mot-s {
|
||||
0%, 12% { opacity: 1; }
|
||||
14.286%, 97.714% { opacity: 0; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.cercle__tour, .cercle__mot-s { animation: none; }
|
||||
/* rien ne bouge : le bouton pause n'a plus d'objet */
|
||||
.cercle__pause { display: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<!-- Seize pastilles qui se remplissent : on voit les places, pas un pourcentage.
|
||||
Le texte se lit seul ; les pastilles sont décoratives. -->
|
||||
<p class="cpt" :class="{ 'cpt--complet': complet }">
|
||||
<span class="cpt__pastilles" aria-hidden="true">
|
||||
<span v-for="i in capacite" :key="i" class="cpt__pastille" :class="{ 'cpt__pastille--prise': i <= pris }" />
|
||||
</span>
|
||||
<span class="cpt__texte">{{ texte }}</span>
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { texteCompteur } from '~/utils/inscriptionEvenement'
|
||||
|
||||
const props = defineProps<{ inscrits: number; capacite: number; complet: boolean }>()
|
||||
|
||||
const pris = computed(() => (props.complet ? props.capacite : Math.min(props.inscrits, props.capacite)))
|
||||
const texte = computed(() => texteCompteur(props.inscrits, props.capacite, props.complet))
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.cpt { display: flex; flex-direction: column; gap: var(--space-2xs); margin: 0; }
|
||||
.cpt__pastilles { display: flex; flex-wrap: wrap; gap: 5px; max-width: 100%; }
|
||||
.cpt__pastille {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: var(--radius-full);
|
||||
border: 1.5px solid var(--border-strong);
|
||||
background: transparent;
|
||||
}
|
||||
.cpt__pastille--prise { background: var(--evt-nuit); border-color: var(--evt-nuit); }
|
||||
.cpt__texte { font-weight: var(--fw-semibold); }
|
||||
|
||||
/* Le seul mouvement de la page, parce qu'il dit vrai : les places prises arrivent, une à une.
|
||||
Rendu serveur déjà rempli ; l'animation ne fait que l'ajouter, et se coupe en mouvement réduit. */
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.cpt__pastille--prise { animation: cpt-arrive 0.45s var(--ease-out) backwards; }
|
||||
.cpt__pastille--prise:nth-child(2) { animation-delay: 60ms; }
|
||||
.cpt__pastille--prise:nth-child(3) { animation-delay: 120ms; }
|
||||
.cpt__pastille--prise:nth-child(n + 4) { animation-delay: 180ms; }
|
||||
}
|
||||
@keyframes cpt-arrive { from { transform: scale(0.3); opacity: 0; } }
|
||||
</style>
|
||||
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<div class="fi">
|
||||
<!-- Confirmation -->
|
||||
<div v-if="etat === 'ok'" ref="confirmation" class="fi-message fi-message--ok" tabindex="-1" role="status">
|
||||
<template v-if="attente">
|
||||
<p class="fi-message__titre">Merci, vous êtes sur la liste d'attente.</p>
|
||||
<p>Jules vous écrit si une place se libère.</p>
|
||||
</template>
|
||||
<template v-else>
|
||||
<p class="fi-message__titre">Merci, c'est noté.</p>
|
||||
<p>Jules vous écrit avec les détails<template v-if="page === 'codev'"> et les coordonnées pour le virement</template>.</p>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- Complet (forêt) ; le codev complet garde son formulaire : liste d'attente (Jules, 23/10) -->
|
||||
<div v-else-if="(complet && page !== 'codev') || etat === 'complet'" class="fi-message" role="status">
|
||||
<p class="fi-message__titre">C'est complet.</p>
|
||||
<p>Écrivez-nous : <a :href="`mailto:${contact}`">{{ contact }}</a></p>
|
||||
</div>
|
||||
|
||||
<!-- Table non configurée -->
|
||||
<div v-else-if="!disponible || etat === 'indisponible'" class="fi-message" role="status">
|
||||
<p>Pour vous inscrire, écrivez à <a :href="`mailto:${contact}`">{{ contact }}</a></p>
|
||||
</div>
|
||||
|
||||
<form v-else novalidate :aria-describedby="`fi-${page}-donnees`" @submit.prevent="envoyer">
|
||||
<div class="fi-duo">
|
||||
<div class="fi-champ">
|
||||
<label :for="id('prenom')">Prénom</label>
|
||||
<input :id="id('prenom')" v-model="f.prenom" v-bind="aria('prenom')" autocomplete="given-name" maxlength="60" required>
|
||||
<p v-if="err.prenom" :id="id('prenom-err')" class="fi-err">{{ err.prenom }}</p>
|
||||
</div>
|
||||
<div class="fi-champ">
|
||||
<label :for="id('nom')">Nom</label>
|
||||
<input :id="id('nom')" v-model="f.nom" v-bind="aria('nom')" autocomplete="family-name" maxlength="80" required>
|
||||
<p v-if="err.nom" :id="id('nom-err')" class="fi-err">{{ err.nom }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fi-champ">
|
||||
<label :for="id('email')">Email</label>
|
||||
<input :id="id('email')" v-model="f.email" v-bind="aria('email')" type="email" autocomplete="email" inputmode="email" maxlength="200" required>
|
||||
<p v-if="err.email" :id="id('email-err')" class="fi-err">{{ err.email }}</p>
|
||||
</div>
|
||||
|
||||
<div class="fi-champ">
|
||||
<label :for="id('telephone')">Téléphone <span class="fi-facultatif">facultatif, pour le covoiturage</span></label>
|
||||
<input :id="id('telephone')" v-model="f.telephone" v-bind="aria('telephone')" type="tel" autocomplete="tel" inputmode="tel" maxlength="30">
|
||||
<p v-if="err.telephone" :id="id('telephone-err')" class="fi-err">{{ err.telephone }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Codev : dates. Un seul jour d'arrivée (le 21) : pas de question, il part d'office -->
|
||||
<template v-if="page === 'codev'">
|
||||
<fieldset v-if="ARRIVEES_CODEV.length > 1" class="fi-champ" v-bind="ariaGroupe('arrivee')">
|
||||
<legend>J'arrive le</legend>
|
||||
<div class="fi-choix">
|
||||
<label v-for="d in ARRIVEES_CODEV" :key="d" class="fi-option">
|
||||
<input v-model="f.arrivee" type="radio" :name="id('arrivee')" :value="d">
|
||||
<span>{{ jourLong(d) }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<p v-if="err.arrivee" :id="id('arrivee-err')" class="fi-err">{{ err.arrivee }}</p>
|
||||
</fieldset>
|
||||
<fieldset class="fi-champ" v-bind="ariaGroupe('depart')">
|
||||
<legend>Je repars le</legend>
|
||||
<div class="fi-choix">
|
||||
<label v-for="d in DEPARTS_CODEV" :key="d" class="fi-option">
|
||||
<input v-model="f.depart" type="radio" :name="id('depart')" :value="d">
|
||||
<span>{{ jourLong(d) }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<p v-if="err.depart" :id="id('depart-err')" class="fi-err">{{ err.depart }}</p>
|
||||
</fieldset>
|
||||
<div class="fi-champ">
|
||||
<label class="fi-option fi-option--case">
|
||||
<input v-model="f.reste_plantation" type="checkbox">
|
||||
<span>Je reste pour la plantation du 28-29 novembre</span>
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Forêt : qui, quand, où dormir -->
|
||||
<template v-else>
|
||||
<div class="fi-duo">
|
||||
<div class="fi-champ">
|
||||
<label :for="id('nb_personnes')">Nombre de personnes</label>
|
||||
<select :id="id('nb_personnes')" v-model.number="f.nb_personnes" v-bind="aria('nb_personnes')">
|
||||
<option v-for="n in 8" :key="n" :value="n">{{ n }}</option>
|
||||
</select>
|
||||
<p v-if="err.nb_personnes" :id="id('nb_personnes-err')" class="fi-err">{{ err.nb_personnes }}</p>
|
||||
</div>
|
||||
<div class="fi-champ">
|
||||
<label :for="id('nb_enfants')">dont enfants</label>
|
||||
<select :id="id('nb_enfants')" v-model.number="f.nb_enfants" v-bind="aria('nb_enfants')">
|
||||
<option v-for="n in 8" :key="n - 1" :value="n - 1">{{ n - 1 }}</option>
|
||||
</select>
|
||||
<p v-if="err.nb_enfants" :id="id('nb_enfants-err')" class="fi-err">{{ err.nb_enfants }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset class="fi-champ" v-bind="ariaGroupe('arrivee')">
|
||||
<legend>J'arrive</legend>
|
||||
<div class="fi-choix">
|
||||
<label v-for="a in ARRIVEES_FORET" :key="a" class="fi-option">
|
||||
<input v-model="f.arrivee" type="radio" :name="id('arrivee')" :value="a">
|
||||
<span>{{ ARRIVEES_FORET_LABELS[a] }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<p v-if="err.arrivee" :id="id('arrivee-err')" class="fi-err">{{ err.arrivee }}</p>
|
||||
</fieldset>
|
||||
<fieldset class="fi-champ" v-bind="ariaGroupe('dort_sur_place')">
|
||||
<legend>Je dors sur place</legend>
|
||||
<div class="fi-choix fi-choix--ligne">
|
||||
<label class="fi-option"><input v-model="f.dort_sur_place" type="radio" :name="id('dort')" :value="true"><span>Oui</span></label>
|
||||
<label class="fi-option"><input v-model="f.dort_sur_place" type="radio" :name="id('dort')" :value="false"><span>Non</span></label>
|
||||
</div>
|
||||
<p v-if="err.dort_sur_place" :id="id('dort_sur_place-err')" class="fi-err">{{ err.dort_sur_place }}</p>
|
||||
</fieldset>
|
||||
</template>
|
||||
|
||||
<div class="fi-champ">
|
||||
<label :for="id('besoin')">Les repas sont végétariens. Un besoin particulier ? <span class="fi-facultatif">facultatif</span></label>
|
||||
<input :id="id('besoin')" v-model="f.besoin_alimentaire" v-bind="aria('besoin_alimentaire')" maxlength="300">
|
||||
<p v-if="err.besoin_alimentaire" :id="id('besoin_alimentaire-err')" class="fi-err">{{ err.besoin_alimentaire }}</p>
|
||||
</div>
|
||||
|
||||
<fieldset class="fi-champ" v-bind="ariaGroupe('voiture')">
|
||||
<legend>Covoiturage</legend>
|
||||
<div class="fi-choix">
|
||||
<label v-for="v in VOITURES" :key="v" class="fi-option">
|
||||
<input v-model="f.voiture" type="radio" :name="id('voiture')" :value="v">
|
||||
<span>{{ VOITURES_LABELS[v] }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<p v-if="err.voiture" :id="id('voiture-err')" class="fi-err">{{ err.voiture }}</p>
|
||||
</fieldset>
|
||||
|
||||
<!-- Décision de Jules du 22/10 : par quelle échelle on entre en ce moment (facultatif, codev seulement) -->
|
||||
<fieldset v-if="page === 'codev'" class="fi-champ">
|
||||
<legend>En ce moment, vous entrez plutôt par <span class="fi-facultatif">facultatif</span></legend>
|
||||
<div class="fi-choix">
|
||||
<label v-for="v in ENTREES" :key="v" class="fi-option">
|
||||
<input v-model="f.entree" type="radio" :name="id('entree')" :value="v">
|
||||
<span>{{ ENTREES_LABELS[v] }}</span>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="fi-champ">
|
||||
<label :for="id('mot')">Un mot <span class="fi-facultatif">facultatif</span></label>
|
||||
<textarea :id="id('mot')" v-model="f.mot" v-bind="aria('mot')" rows="3" maxlength="1000" />
|
||||
<p v-if="err.mot" :id="id('mot-err')" class="fi-err">{{ err.mot }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Honeypot : invisible pour un humain, rempli par un robot -->
|
||||
<div class="fi-pot" aria-hidden="true">
|
||||
<label :for="id('site_web')">Site web</label>
|
||||
<input :id="id('site_web')" v-model="f.site_web" tabindex="-1" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<p v-if="page === 'codev' && complet" class="fi-avant">
|
||||
Les {{ evenement.codev.capacite }} places sont prises : votre inscription va sur la liste d'attente.
|
||||
</p>
|
||||
<p v-else-if="page === 'codev'" class="fi-avant">{{ evenement.codev.prixJour }} € par jour, par virement ; les coordonnées vous arrivent par email.</p>
|
||||
<p v-else class="fi-avant">Rien à régler.</p>
|
||||
|
||||
<p v-if="erreurEnvoi" class="fi-err fi-err--envoi" role="alert">{{ erreurEnvoi }}</p>
|
||||
|
||||
<button type="submit" class="evt-btn fi-envoyer" :disabled="etat === 'envoi'">
|
||||
{{ etat === 'envoi' ? 'Envoi…' : page === 'foret' ? 'Je viens planter' : complet ? 'M\'inscrire sur la liste d\'attente' : 'Je m\'inscris' }}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<p :id="`fi-${page}-donnees`" class="fi-donnees">
|
||||
Ces informations servent seulement à organiser le séjour (repas, couchage, covoiturage).
|
||||
Elles sont effacées le 31 décembre 2026 et ne sont transmises à personne.
|
||||
Pour les modifier ou les effacer avant : <a :href="`mailto:${contact}`">{{ contact }}</a>.
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
ARRIVEES_CODEV, DEPARTS_CODEV, ARRIVEES_FORET, ARRIVEES_FORET_LABELS, VOITURES, VOITURES_LABELS, ENTREES, ENTREES_LABELS,
|
||||
InscriptionSchema, erreursParChamp, type PageInscription,
|
||||
} from '~/utils/inscriptionEvenement'
|
||||
import { evenement } from '~/data/evenements/ruetz-2026'
|
||||
|
||||
const props = defineProps<{
|
||||
page: PageInscription
|
||||
contact: string
|
||||
/** false : table non configurée, la page renvoie vers l'email. */
|
||||
disponible: boolean
|
||||
complet: boolean
|
||||
}>()
|
||||
const emit = defineEmits<{ inscrit: [] }>()
|
||||
|
||||
const f = reactive({
|
||||
prenom: '', nom: '', email: '', telephone: '',
|
||||
arrivee: (props.page === 'codev' && ARRIVEES_CODEV.length === 1 ? ARRIVEES_CODEV[0] : '') as string,
|
||||
depart: '' as string, reste_plantation: false,
|
||||
nb_personnes: 1, nb_enfants: 0, dort_sur_place: undefined as boolean | undefined,
|
||||
besoin_alimentaire: '', voiture: '' as string, mot: '', site_web: '', entree: '' as string,
|
||||
})
|
||||
const err = ref<Record<string, string>>({})
|
||||
const etat = ref<'saisie' | 'envoi' | 'ok' | 'complet' | 'indisponible'>('saisie')
|
||||
const erreurEnvoi = ref('')
|
||||
/** Le serveur a mis l'inscription en liste d'attente (codev complet). */
|
||||
const attente = ref(false)
|
||||
const confirmation = ref<HTMLElement | null>(null)
|
||||
|
||||
const id = (k: string) => `fi-${props.page}-${k}`
|
||||
const aria = (k: string) => ({
|
||||
'aria-invalid': err.value[k] ? 'true' : undefined,
|
||||
'aria-describedby': err.value[k] ? id(`${k}-err`) : undefined,
|
||||
})
|
||||
const ariaGroupe = (k: string) => ({ 'aria-describedby': err.value[k] ? id(`${k}-err`) : undefined })
|
||||
|
||||
const JOURS: Record<string, string> = {
|
||||
'2026-11-21': 'Samedi 21', '2026-11-22': 'Dimanche 22', '2026-11-23': 'Lundi 23',
|
||||
'2026-11-25': 'Mercredi 25', '2026-11-26': 'Jeudi 26', '2026-11-27': 'Vendredi 27',
|
||||
}
|
||||
const jourLong = (d: string) => JOURS[d] ?? d
|
||||
|
||||
function corps() {
|
||||
const commun = {
|
||||
page: props.page, prenom: f.prenom, nom: f.nom, email: f.email, telephone: f.telephone,
|
||||
besoin_alimentaire: f.besoin_alimentaire, voiture: f.voiture, mot: f.mot, site_web: f.site_web,
|
||||
}
|
||||
return props.page === 'codev'
|
||||
? { ...commun, arrivee: f.arrivee, depart: f.depart, reste_plantation: f.reste_plantation, entree: f.entree }
|
||||
: { ...commun, nb_personnes: f.nb_personnes, nb_enfants: f.nb_enfants, arrivee: f.arrivee, dort_sur_place: f.dort_sur_place }
|
||||
}
|
||||
|
||||
function focusPremiereErreur() {
|
||||
nextTick(() => {
|
||||
const el = document.querySelector<HTMLElement>('.fi [aria-invalid="true"], .fi fieldset[aria-describedby] input')
|
||||
el?.focus()
|
||||
})
|
||||
}
|
||||
|
||||
async function envoyer() {
|
||||
erreurEnvoi.value = ''
|
||||
const body = corps()
|
||||
const parsed = InscriptionSchema.safeParse(body)
|
||||
if (!parsed.success) {
|
||||
err.value = erreursParChamp(parsed.error)
|
||||
focusPremiereErreur()
|
||||
return
|
||||
}
|
||||
err.value = {}
|
||||
etat.value = 'envoi'
|
||||
try {
|
||||
const r = await $fetch<{ ok: boolean; attente?: boolean }>('/api/evenements/inscription', { method: 'POST', body })
|
||||
attente.value = !!r?.attente
|
||||
etat.value = 'ok'
|
||||
emit('inscrit')
|
||||
nextTick(() => confirmation.value?.focus())
|
||||
} catch (e: any) {
|
||||
const code = e?.statusCode ?? e?.response?.status
|
||||
etat.value = 'saisie'
|
||||
if (code === 422 && e?.data?.data) {
|
||||
err.value = e.data.data
|
||||
focusPremiereErreur()
|
||||
} else if (code === 409) {
|
||||
etat.value = 'complet'
|
||||
} else if (code === 503) {
|
||||
etat.value = 'indisponible'
|
||||
} else if (code === 429) {
|
||||
erreurEnvoi.value = `Trop d'inscriptions depuis cette connexion aujourd'hui. Écrivez à ${props.contact}.`
|
||||
} else {
|
||||
erreurEnvoi.value = `L'inscription n'est pas passée. Réessayez dans un instant, ou écrivez à ${props.contact}.`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fi { margin-top: var(--space-lg); }
|
||||
form { display: flex; flex-direction: column; gap: var(--space-md); }
|
||||
.fi-duo { display: grid; gap: var(--space-md); grid-template-columns: 1fr; }
|
||||
@media (min-width: 480px) { .fi-duo { grid-template-columns: 1fr 1fr; } }
|
||||
|
||||
.fi-champ { display: flex; flex-direction: column; gap: var(--space-2xs); margin: 0; padding: 0; border: 0; min-width: 0; }
|
||||
.fi-champ > label, legend { font-weight: var(--fw-semibold); padding: 0; margin-bottom: var(--space-2xs); }
|
||||
.fi-facultatif { font-weight: var(--fw-regular); font-size: var(--fs-sm); color: var(--evt-attenue); }
|
||||
.fi-facultatif::before { content: '· '; }
|
||||
|
||||
input:not([type="radio"]):not([type="checkbox"]), select, textarea {
|
||||
width: 100%;
|
||||
min-height: 48px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
font: inherit;
|
||||
font-size: 1rem; /* 16 px : iOS ne zoome pas */
|
||||
}
|
||||
textarea { min-height: 96px; resize: vertical; }
|
||||
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: var(--text); }
|
||||
[aria-invalid="true"] { border-color: var(--danger) !important; }
|
||||
|
||||
.fi-choix { display: grid; gap: var(--space-xs); }
|
||||
.fi-choix--ligne { grid-template-columns: 1fr 1fr; }
|
||||
.fi-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-sm);
|
||||
min-height: 48px;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--surface);
|
||||
font-weight: var(--fw-regular);
|
||||
cursor: pointer;
|
||||
}
|
||||
.fi-option:has(input:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
|
||||
.fi-option:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
|
||||
.fi-option input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--nav-primary-solid); }
|
||||
/* La case plantation : centrée dans sa carte, toute la carte se clique */
|
||||
.fi-option--case { min-height: 56px; padding: 12px 16px; }
|
||||
|
||||
.fi-err { margin: 0; font-size: var(--fs-sm); color: var(--danger); font-weight: var(--fw-semibold); }
|
||||
.fi-err--envoi { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
|
||||
|
||||
.fi-pot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
|
||||
|
||||
.fi-avant { margin: 0; font-weight: var(--fw-semibold); }
|
||||
.fi-envoyer { align-self: flex-start; min-width: 200px; }
|
||||
@media (max-width: 479px) { .fi-envoyer { align-self: stretch; } }
|
||||
|
||||
.fi-message {
|
||||
padding: var(--space-lg);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.fi-message--ok { border: 2px solid var(--accent); }
|
||||
.fi-message:focus { outline: none; }
|
||||
.fi-message p { margin: 0; }
|
||||
.fi-message__titre { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: var(--space-xs) !important; }
|
||||
|
||||
.fi-donnees { margin-top: var(--space-md); font-size: var(--fs-sm); color: var(--evt-attenue); }
|
||||
</style>
|
||||
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<figure class="evt-figure frise">
|
||||
<div class="frise__toile">
|
||||
<svg viewBox="0 0 540 132" role="img" aria-labelledby="frise-titre frise-desc">
|
||||
<title id="frise-titre">La semaine, jour par jour</title>
|
||||
<desc id="frise-desc">
|
||||
Samedi 21 et dimanche 22 : on atterrit ensemble. Du lundi 23 au vendredi 27 : la semaine d'entraide.
|
||||
Samedi 28 et dimanche 29 : la plantation de la forêt.
|
||||
</desc>
|
||||
<g v-for="(j, i) in jours" :key="j.iso" :transform="`translate(${i * COL} 0)`">
|
||||
<text :x="COL / 2" y="20" class="frise__jour">{{ j.jour }}</text>
|
||||
<text :x="COL / 2" y="46" class="frise__num">{{ j.num }}</text>
|
||||
</g>
|
||||
<!-- 21-22 : tout le monde arrive, on atterrit ensemble -->
|
||||
<rect x="3" y="60" :width="2 * COL - 6" height="64" rx="8" class="frise__arrivee" />
|
||||
<text :x="COL" y="88" class="frise__label frise__label--ligne">on atterrit</text>
|
||||
<text :x="COL" y="110" class="frise__label frise__label--ligne">ensemble</text>
|
||||
<!-- 23-27 : codev -->
|
||||
<rect :x="2 * COL + 3" y="60" :width="5 * COL - 6" height="64" rx="8" class="frise__codev" />
|
||||
<text :x="4.5 * COL" y="99" class="frise__label frise__label--codev">la semaine d'entraide</text>
|
||||
<!-- 28-29 : plantation, cliquable (le lien est posé dessus, en HTML) -->
|
||||
<g class="frise__foret-g">
|
||||
<rect :x="7 * COL + 3" y="60" :width="2 * COL - 6" height="64" rx="8" class="frise__foret" />
|
||||
<text :x="8 * COL" y="96" class="frise__label frise__label--foret">plantation</text>
|
||||
<line :x1="8 * COL - 44" :x2="8 * COL + 44" y1="104" y2="104" class="frise__souligne" />
|
||||
</g>
|
||||
</svg>
|
||||
<NuxtLink :to="lienForet" class="frise__clic" aria-label="La page forêt" />
|
||||
</div>
|
||||
<figcaption class="frise__legende">
|
||||
<span>Arrivée le samedi 21 : on atterrit ensemble. Les 28 et 29, on plante une forêt.</span>
|
||||
<NuxtLink :to="lienForet" class="evt-lien-foret"><EvenementsIcone nom="arbre" />La page forêt</NuxtLink>
|
||||
</figcaption>
|
||||
</figure>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { jourCourt } from '~/utils/evenements'
|
||||
|
||||
defineProps<{ lienForet: string }>()
|
||||
|
||||
const COL = 60
|
||||
const jours = Array.from({ length: 9 }, (_, i) => {
|
||||
const iso = `2026-11-${21 + i}`
|
||||
return { iso, ...jourCourt(iso) }
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.frise svg { border-radius: 0; overflow: visible; }
|
||||
.frise__toile { position: relative; }
|
||||
.frise__jour { font-size: 19px; text-anchor: middle; fill: var(--evt-attenue); }
|
||||
.frise__num { font-family: var(--evt-titre); font-size: 26px; font-weight: 600; text-anchor: middle; fill: var(--text); }
|
||||
.frise__arrivee { fill: color-mix(in srgb, var(--evt-nuit) 16%, var(--surface)); }
|
||||
.frise__codev { fill: var(--evt-nuit); }
|
||||
.frise__foret { fill: var(--accent); }
|
||||
.frise__label { font-size: 21px; font-weight: 700; text-anchor: middle; }
|
||||
.frise__label--ligne { font-size: 18px; font-weight: 600; fill: var(--text); }
|
||||
.frise__label--codev { fill: var(--evt-sur-nuit); }
|
||||
.frise__label--foret { font-size: 19px; fill: var(--on-accent); }
|
||||
.frise__souligne { stroke: var(--on-accent); stroke-width: 1.5; }
|
||||
|
||||
/* Le bloc plantation se lit comme un bouton : ombre au repos, levé au survol, anneau au focus.
|
||||
Le lien HTML couvre exactement le bloc (positions en % du viewBox 540 × 132). */
|
||||
.frise__foret-g {
|
||||
filter: drop-shadow(0 1px 1.5px rgb(26 34 56 / 0.25));
|
||||
transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
|
||||
}
|
||||
.frise__clic {
|
||||
position: absolute;
|
||||
left: calc(423 / 540 * 100%);
|
||||
top: calc(60 / 132 * 100%);
|
||||
width: calc(114 / 540 * 100%);
|
||||
height: calc(64 / 132 * 100%);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.frise__toile:has(.frise__clic:hover) .frise__foret-g,
|
||||
.frise__toile:has(.frise__clic:focus-visible) .frise__foret-g {
|
||||
transform: translateY(-3px);
|
||||
filter: drop-shadow(0 4px 6px rgb(26 34 56 / 0.28)) brightness(1.04);
|
||||
}
|
||||
.frise__clic:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
|
||||
|
||||
.frise__legende {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-xs) var(--space-md);
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.frise__foret-g { transition: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<ol class="gestes" role="list">
|
||||
<li class="geste">
|
||||
<svg viewBox="0 0 200 150" aria-hidden="true">
|
||||
<path class="g-sol" d="M0 96 H64 Q100 132 136 96 H200 V150 H0 Z" />
|
||||
<path class="g-trou" d="M64 96 Q100 132 136 96" />
|
||||
<line class="g-tronc" x1="100" y1="112" x2="100" y2="34" />
|
||||
<ellipse class="g-houppe" cx="100" cy="30" rx="30" ry="20" />
|
||||
<path class="g-motte" d="M86 112 q14 14 28 0 q-14 -8 -28 0 Z" />
|
||||
<path class="g-fleche" d="M150 30 V78 M142 70 L150 80 L158 70" />
|
||||
</svg>
|
||||
<p><span class="geste__num">1</span>Les trous sont déjà faits : on met l'arbre principal en terre.</p>
|
||||
</li>
|
||||
<li class="geste">
|
||||
<svg viewBox="0 0 200 150" aria-hidden="true">
|
||||
<path class="g-sol" d="M0 92 H200 V150 H0 Z" />
|
||||
<line class="g-repere" x1="0" y1="92" x2="200" y2="92" />
|
||||
<line class="g-bouture" x1="78" y1="132" x2="82" y2="22" />
|
||||
<circle class="g-oeil" cx="81" cy="44" r="3.5" />
|
||||
<circle class="g-oeil" cx="79.6" cy="108" r="3.5" /><circle class="g-oeil" cx="79" cy="124" r="3.5" />
|
||||
<path class="g-cote" d="M122 92 V132 M116 92 H128 M116 132 H128" />
|
||||
<text x="134" y="117" class="g-texte">20 cm</text>
|
||||
</svg>
|
||||
<p><span class="geste__num">2</span>Les boutures autour : au moins deux yeux sous terre, 20 cm.</p>
|
||||
</li>
|
||||
<li class="geste">
|
||||
<svg viewBox="0 0 200 150" aria-hidden="true">
|
||||
<path class="g-sol" d="M0 112 H200 V150 H0 Z" />
|
||||
<path class="g-paille" d="M30 112 Q100 82 170 112 Z" />
|
||||
<path class="g-brins" d="M50 104 l14 -4 M78 96 l16 -2 M110 95 l14 3 M136 100 l14 5" />
|
||||
<line class="g-tronc" x1="100" y1="100" x2="100" y2="34" />
|
||||
<ellipse class="g-houppe" cx="100" cy="30" rx="26" ry="17" />
|
||||
<path class="g-grillage" d="M82 104 V44 M118 104 V44 M82 44 H118 M82 64 H118 M82 84 H118 M91 44 V104 M100 44 V58 M109 44 V104" />
|
||||
</svg>
|
||||
<p><span class="geste__num">3</span>La paille, et la protection contre les chevreuils.</p>
|
||||
</li>
|
||||
</ol>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.gestes { list-style: none; margin: var(--space-md) 0 0; padding: 0; display: grid; gap: var(--space-md); grid-template-columns: 1fr; }
|
||||
@media (min-width: 560px) { .gestes { grid-template-columns: repeat(3, 1fr); } }
|
||||
.geste svg { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto var(--space-xs); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
|
||||
.geste p { margin: 0; font-size: var(--fs-sm); }
|
||||
.geste__num {
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-right: var(--space-xs);
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font-weight: var(--fw-bold);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
.g-sol { fill: var(--bg-alt); }
|
||||
.g-trou { fill: none; stroke: var(--text); stroke-width: 2; stroke-dasharray: 4 4; }
|
||||
.g-tronc { stroke: var(--text); stroke-width: 4; stroke-linecap: round; }
|
||||
.g-houppe { fill: color-mix(in srgb, var(--nav-primary-solid) 20%, var(--surface)); stroke: var(--text); stroke-width: 2; }
|
||||
.g-motte { fill: color-mix(in srgb, var(--text) 45%, var(--bg-alt)); }
|
||||
.g-fleche { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
|
||||
.g-repere { stroke: var(--text); stroke-width: 2; }
|
||||
.g-bouture { stroke: var(--text); stroke-width: 5; stroke-linecap: round; }
|
||||
.g-oeil { fill: var(--accent); stroke: var(--text); stroke-width: 1.2; }
|
||||
.g-cote { fill: none; stroke: var(--text); stroke-width: 1.5; }
|
||||
.g-texte { font-size: 15px; font-weight: 700; fill: var(--text); }
|
||||
.g-paille { fill: var(--accent); opacity: 0.85; }
|
||||
.g-brins { stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; opacity: 0.6; }
|
||||
.g-grillage { fill: none; stroke: var(--text); stroke-width: 1.3; opacity: 0.75; }
|
||||
</style>
|
||||
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<!-- Pictogrammes des pages d'événement : grille 24, trait 1,75, currentColor, décoratifs -->
|
||||
<svg class="evt-icone" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"
|
||||
fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round">
|
||||
<template v-if="nom === 'places'">
|
||||
<circle cx="9" cy="8" r="3" />
|
||||
<path d="M3.5 19.5c.6-3.3 2.8-5.2 5.5-5.2s4.9 1.9 5.5 5.2" />
|
||||
<circle cx="16.5" cy="9" r="2.4" />
|
||||
<path d="M16 14.3c2.5 0 4 1.7 4.5 4.6" />
|
||||
</template>
|
||||
<template v-else-if="nom === 'argent'">
|
||||
<circle cx="12" cy="12" r="8.5" />
|
||||
<path d="M15 8.9a3.9 3.9 0 1 0 0 6.2" />
|
||||
<path d="M7.6 11h5M7.6 13.2h5" />
|
||||
</template>
|
||||
<template v-else-if="nom === 'maison'">
|
||||
<path d="M3.5 11.5 12 4.5l8.5 7" />
|
||||
<path d="M6 9.8v9.7h12V9.8" />
|
||||
<path d="M10 19.5v-5h4v5" />
|
||||
</template>
|
||||
<template v-else-if="nom === 'train'">
|
||||
<rect x="6" y="3.5" width="12" height="13" rx="3" />
|
||||
<path d="M6 10h12" />
|
||||
<path d="M8.5 16.5 6.5 20.5M15.5 16.5l2 4M7.6 18.5h8.8" />
|
||||
<circle cx="9" cy="13.3" r=".6" fill="currentColor" />
|
||||
<circle cx="15" cy="13.3" r=".6" fill="currentColor" />
|
||||
</template>
|
||||
<template v-else-if="nom === 'lit'">
|
||||
<path d="M3 5.5v14M3 14.5h18v5" />
|
||||
<path d="M21 14.5v-2a2.5 2.5 0 0 0-2.5-2.5H10.5v4.5" />
|
||||
<circle cx="6.8" cy="11.3" r="1.8" />
|
||||
</template>
|
||||
<template v-else-if="nom === 'sac'">
|
||||
<rect x="5.5" y="7" width="13" height="13.5" rx="3" />
|
||||
<path d="M9.5 7V5.5a2.5 2.5 0 0 1 5 0V7" />
|
||||
<path d="M9 14h6v3.5H9z" />
|
||||
</template>
|
||||
<template v-else-if="nom === 'bol'">
|
||||
<path d="M4 11h16c0 4.4-3.6 8-8 8s-8-3.6-8-8z" />
|
||||
<path d="M9.5 3.8c-.9 1-.9 2.2 0 3.2M14.5 3.8c-.9 1-.9 2.2 0 3.2" />
|
||||
</template>
|
||||
<template v-else-if="nom === 'calendrier'">
|
||||
<rect x="4" y="5.5" width="16" height="14.5" rx="2.5" />
|
||||
<path d="M4 10h16M8.5 3.5v4M15.5 3.5v4" />
|
||||
</template>
|
||||
<template v-else-if="nom === 'lieu'">
|
||||
<path d="M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0c0 5.4-6.5 11-6.5 11z" />
|
||||
<circle cx="12" cy="10" r="2.4" />
|
||||
</template>
|
||||
<template v-else-if="nom === 'voiture'">
|
||||
<path d="M5.5 11 7.2 6.8A1.8 1.8 0 0 1 8.9 5.6h6.2a1.8 1.8 0 0 1 1.7 1.2l1.7 4.2" />
|
||||
<path d="M3.5 13a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2v4h-17z" />
|
||||
<path d="M6.5 17v2M17.5 17v2" />
|
||||
<circle cx="7.4" cy="14" r=".9" fill="currentColor" />
|
||||
<circle cx="16.6" cy="14" r=".9" fill="currentColor" />
|
||||
</template>
|
||||
<template v-else-if="nom === 'arbre'">
|
||||
<path d="M12 3.5a5 5 0 0 0-4.7 6.6A3.9 3.9 0 0 0 9 17.5h6a3.9 3.9 0 0 0 1.7-7.4A5 5 0 0 0 12 3.5z" />
|
||||
<path d="M12 11.5v9M12 15l2.4-2" />
|
||||
</template>
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineProps<{ nom: 'places' | 'argent' | 'maison' | 'train' | 'lit' | 'sac' | 'bol' | 'calendrier' | 'lieu' | 'arbre' | 'voiture' }>()
|
||||
</script>
|
||||
@@ -0,0 +1,10 @@
|
||||
<template>
|
||||
<!-- Le lieu-dit, cliquable vers Google Maps (au téléphone, l'URL maps/search ouvre l'application) -->
|
||||
<a :href="evenement.mapsUrl" target="_blank" rel="noopener" class="evt-lieu-lien">
|
||||
<slot>{{ evenement.lieu }}</slot><span class="evt-sr"> (Google Maps, nouvel onglet)</span>
|
||||
</a>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { evenement } from '~/data/evenements/ruetz-2026'
|
||||
</script>
|
||||
@@ -0,0 +1,371 @@
|
||||
<template>
|
||||
<div class="evt" :class="ton ? `evt--${ton}` : null">
|
||||
<!-- Le fond : des courbes de niveau, en écho aux lignes du plan de Sacha qui suivent le relief.
|
||||
Seulement derrière l'en-tête, estompées avant le texte courant. -->
|
||||
<div class="evt-fond" aria-hidden="true" />
|
||||
<!-- Un bandeau pleine largeur au-dessus de la colonne (le tableau de Ruetz sur la page codev, B26) -->
|
||||
<slot name="bandeau" />
|
||||
<div class="evt__col">
|
||||
<nav v-if="retour" class="evt-retour" aria-label="Retour">
|
||||
<NuxtLink :to="retour.to">← {{ retour.label }}</NuxtLink>
|
||||
</nav>
|
||||
<main id="contenu">
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineProps<{
|
||||
retour?: { to: string; label: string }
|
||||
/** 'foret' : la sauge remplace l'ocre (pictos, récap, courbes). */
|
||||
ton?: 'foret'
|
||||
}>()
|
||||
|
||||
// Une seule police ajoutée, pour les titres : précharger évite le saut de l'en-tête (font-display: swap).
|
||||
useHead({
|
||||
link: [{ rel: 'preload', href: '/medias/evenements/polices/fraunces-600-latin.woff2', as: 'font', type: 'font/woff2', crossorigin: '' }],
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--
|
||||
Gabarit des pages d'événement (lot Y, passe design B25) : colonne de lecture de 640 px.
|
||||
Styles non scopés, préfixe evt- : partagés par les pages et les composants evenements/.
|
||||
Tokens du DS (tokens.css + theme/aep.css) ; safran (--accent) réservé à la plantation et au
|
||||
bouton principal ; bleu nuit plein = --nav-primary-solid. Du deck e-codev (frontend-slides) :
|
||||
Fraunces pour les titres, l'ocre et la sauge.
|
||||
-->
|
||||
<style>
|
||||
/* Fraunces (Undercase Type, SIL OFL 1.1), graisse 600, axe optique 9-144, sous-ensemble latin : 35 Ko */
|
||||
@font-face {
|
||||
font-family: 'Fraunces';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-display: swap;
|
||||
src: url('/medias/evenements/polices/fraunces-600-latin.woff2') format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
.evt {
|
||||
--evt-attenue: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
--evt-nuit: var(--nav-primary-solid);
|
||||
--evt-sur-nuit: var(--nav-text-on-primary);
|
||||
/* Deux teintes du deck e-codev : ocre = ce qui sort, les petits libellés ; sauge = ce qui revient, le vivant */
|
||||
--evt-ocre: #9a5f12;
|
||||
--evt-sauge: #3f6b4e;
|
||||
--evt-teinte: var(--evt-ocre);
|
||||
--evt-papier: color-mix(in srgb, var(--surface) 60%, var(--bg));
|
||||
--evt-courbes: color-mix(in srgb, var(--text) 9%, transparent);
|
||||
--evt-titre: 'Fraunces', Georgia, 'Times New Roman', serif;
|
||||
/* Un dessin sur papier blanc se fond dans la crème ; en sombre, il reste une feuille (B26) */
|
||||
--evt-fusion-dessin: multiply;
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
min-height: 100%;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: var(--font-body);
|
||||
line-height: 1.6;
|
||||
}
|
||||
.evt--foret { --evt-teinte: var(--evt-sauge); --evt-courbes: color-mix(in srgb, var(--evt-sauge) 15%, transparent); }
|
||||
.dark .evt { --evt-ocre: #e3a95c; --evt-sauge: #8fc09e; --evt-fusion-dessin: normal; }
|
||||
|
||||
.evt-fond {
|
||||
position: absolute;
|
||||
inset: 0 0 auto;
|
||||
height: 480px;
|
||||
z-index: -1;
|
||||
pointer-events: none;
|
||||
background: var(--evt-courbes);
|
||||
-webkit-mask: url('/medias/evenements/courbes-niveau.svg') top center / 1600px 480px repeat-x;
|
||||
mask: url('/medias/evenements/courbes-niveau.svg') top center / 1600px 480px repeat-x;
|
||||
}
|
||||
/* Peint le fond par-dessus les courbes, de plus en plus : elles s'estompent avant le texte courant */
|
||||
.evt-fond::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(to bottom, transparent 30%, var(--bg) 92%);
|
||||
}
|
||||
|
||||
.evt__col {
|
||||
max-width: 640px;
|
||||
margin: 0 auto;
|
||||
padding: var(--space-md) var(--space-md) var(--space-3xl);
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.evt__col { padding: var(--space-xl) var(--space-lg) var(--space-3xl); }
|
||||
}
|
||||
/* Grand écran : une colonne un peu plus large (titres sur deux lignes, moins de retours), B26 */
|
||||
@media (min-width: 1024px) {
|
||||
.evt__col { max-width: 760px; }
|
||||
}
|
||||
/* Blocs qui sortent de la colonne au bureau (deux colonnes, bandes de photos) : jusqu'à 1 200 px, 4 vw de marge */
|
||||
@media (min-width: 900px) {
|
||||
.evt-large { margin-inline: calc(50% - min(46vw, 600px)); }
|
||||
}
|
||||
|
||||
/* Le mot d'accueil, sous le titre, à la première personne */
|
||||
.evt p.evt-accueil { font-size: var(--fs-lg); line-height: 1.5; margin: 0 0 var(--space-md); text-wrap: pretty; }
|
||||
|
||||
/* Le preflight Tailwind retire le soulignement : un lien des pages d'événement se voit lien */
|
||||
.evt a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
|
||||
.evt a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
|
||||
/* Anneau d'encre : le safran du DS ne fait que 1,7:1 sur la crème */
|
||||
.evt :focus-visible { outline: 2.5px solid var(--text); outline-offset: 3px; border-radius: 3px; }
|
||||
|
||||
.evt-retour { margin-bottom: var(--space-sm); }
|
||||
.evt-retour a {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 44px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: var(--fw-bold);
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
color: var(--evt-ocre);
|
||||
text-decoration: none;
|
||||
}
|
||||
.evt-retour a:hover { color: var(--text); text-decoration: underline; }
|
||||
|
||||
/* ── Titres : Fraunces, le reste en police système ── */
|
||||
.evt-h1, .evt-h2, .evt-h3 { font-family: var(--evt-titre); font-weight: 600; font-optical-sizing: auto; }
|
||||
.evt-tete { margin: var(--space-md) 0 var(--space-xl); }
|
||||
.evt-h1 {
|
||||
font-size: clamp(2rem, 7.4vw, 3.1rem);
|
||||
line-height: 1.06;
|
||||
letter-spacing: -0.02em;
|
||||
margin: 0 0 var(--space-md);
|
||||
text-wrap: balance;
|
||||
}
|
||||
.evt-sous {
|
||||
font-size: var(--fs-lg);
|
||||
font-weight: var(--fw-semibold);
|
||||
margin: 0 0 var(--space-2xs);
|
||||
}
|
||||
.evt-lieu { color: var(--evt-attenue); margin: 0; }
|
||||
.evt-sr {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
clip-path: inset(50%);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ── Récap pratique en tête : dates, lieu, trajet, repas ── */
|
||||
.evt-recap { list-style: none; margin: var(--space-md) 0 0; padding: 0; display: grid; gap: var(--space-xs); }
|
||||
.evt-recap li { display: flex; align-items: flex-start; gap: var(--space-sm); line-height: 1.45; }
|
||||
.evt-recap .evt-icone { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--evt-teinte); }
|
||||
.evt-recap .evt-lieu-lien { padding: 2px 0; margin: -2px 0; }
|
||||
.evt-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-md) var(--space-lg);
|
||||
margin-top: var(--space-lg);
|
||||
}
|
||||
|
||||
/* ── Sections ── */
|
||||
.evt-section { margin-top: clamp(3rem, 10vw, 4.5rem); }
|
||||
.evt-h2 {
|
||||
font-size: clamp(1.55rem, 5.4vw, 2rem);
|
||||
line-height: 1.15;
|
||||
letter-spacing: -0.012em;
|
||||
margin: 0 0 var(--space-md);
|
||||
text-wrap: balance;
|
||||
}
|
||||
.evt-h3 { font-size: 1.15rem; line-height: 1.25; margin: 0 0 var(--space-xs); }
|
||||
.evt p { margin: 0 0 var(--space-md); }
|
||||
.evt-note { font-size: var(--fs-sm); color: var(--evt-attenue); }
|
||||
.evt-citation-source { font-size: var(--fs-sm); color: var(--evt-attenue); margin-top: calc(-1 * var(--space-xs)); }
|
||||
|
||||
/* ── Boutons ── */
|
||||
.evt-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--space-xs);
|
||||
min-height: 48px;
|
||||
padding: 0 var(--space-lg);
|
||||
border: 0;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font: inherit;
|
||||
font-weight: var(--fw-bold);
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 1px 0 rgb(26 34 56 / 0.18), 0 2px 6px rgb(26 34 56 / 0.08);
|
||||
transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
|
||||
}
|
||||
.evt a.evt-btn { color: var(--on-accent); text-decoration: none; }
|
||||
.evt-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 0 rgb(26 34 56 / 0.18), 0 6px 14px rgb(26 34 56 / 0.12); }
|
||||
.evt-btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
|
||||
/* Second bouton (le tableau de covoiturage, B26) : bleu nuit plein ; le safran reste à l'inscription */
|
||||
.evt a.evt-btn--nuit { background: var(--evt-nuit); color: var(--evt-sur-nuit); }
|
||||
.evt a.evt-btn--nuit:hover { color: var(--evt-sur-nuit); }
|
||||
.evt-btn .evt-icone { width: 22px; height: 22px; flex: none; }
|
||||
|
||||
/* Lien vers la forêt : safran (réservé à la plantation), en teinte pour ne pas doubler le bouton principal */
|
||||
.evt a.evt-lien-foret {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--space-xs);
|
||||
min-height: 44px;
|
||||
padding: 0 var(--space-md) 0 var(--space-sm);
|
||||
border: 1.5px solid var(--accent);
|
||||
border-radius: var(--radius-full);
|
||||
background: color-mix(in srgb, var(--accent) 28%, var(--surface));
|
||||
color: var(--text);
|
||||
font-weight: var(--fw-bold);
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.evt a.evt-lien-foret:hover { background: var(--accent); color: var(--on-accent); }
|
||||
.evt-lien-foret .evt-icone { width: 20px; height: 20px; }
|
||||
|
||||
/* ── Cartes (pratique, venir) : papier chaud, picto dans un cadre teinté ── */
|
||||
.evt-cartes { display: grid; gap: var(--space-sm); grid-template-columns: 1fr; }
|
||||
@media (min-width: 560px) {
|
||||
.evt-cartes--2 { grid-template-columns: 1fr 1fr; }
|
||||
.evt-carte--large { grid-column: 1 / -1; }
|
||||
}
|
||||
.evt-carte {
|
||||
padding: var(--space-md);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--evt-papier);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.evt-carte p:last-child { margin-bottom: 0; }
|
||||
.evt-carte__tete { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
|
||||
.evt-carte__tete .evt-h3 { margin: 0; }
|
||||
.evt-picto {
|
||||
flex: none;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 12px;
|
||||
background: color-mix(in srgb, var(--evt-teinte) 13%, var(--surface));
|
||||
color: var(--evt-teinte);
|
||||
}
|
||||
|
||||
/* ── Figures et photos (cadrées, légendées, comme dans le deck) ── */
|
||||
.evt-figure { margin: var(--space-lg) 0; }
|
||||
.evt-figure img, .evt-figure svg { display: block; width: 100%; height: auto; border-radius: var(--radius-md); }
|
||||
.evt-figure figcaption { margin-top: var(--space-xs); font-size: var(--fs-sm); color: var(--evt-attenue); }
|
||||
.evt-photo img { border: 1px solid var(--border); }
|
||||
.evt-photo figcaption { font-style: italic; }
|
||||
.evt-pleine { margin-left: calc(-1 * var(--space-md)); margin-right: calc(-1 * var(--space-md)); }
|
||||
.evt-pleine img { border-radius: 0; border-left: 0; border-right: 0; }
|
||||
.evt-pleine figcaption { padding: 0 var(--space-md); }
|
||||
@media (min-width: 672px) {
|
||||
.evt-pleine { margin-left: 0; margin-right: 0; }
|
||||
.evt-pleine img { border-radius: var(--radius-md); border: 1px solid var(--border); }
|
||||
.evt-pleine figcaption { padding: 0; }
|
||||
}
|
||||
/* Les photos regroupées en une bande, 4:3, une légende pour toutes (Jules, B26) : au téléphone deux par ligne,
|
||||
la première en grand si elles sont en nombre impair ; au bureau, toutes sur une ligne, plus large que la colonne */
|
||||
.evt-bande { margin-top: clamp(3rem, 10vw, 4.5rem); }
|
||||
.evt-bande__photos { display: grid; gap: var(--space-sm); grid-template-columns: 1fr 1fr; }
|
||||
.evt-bande__photos > :first-child:nth-last-child(odd) { grid-column: 1 / -1; }
|
||||
.evt-bande .evt-figure { margin: 0; }
|
||||
.evt-bande img { aspect-ratio: 4 / 3; object-fit: cover; }
|
||||
.evt-bande .evt-note { margin: var(--space-xs) 0 0; }
|
||||
@media (min-width: 900px) {
|
||||
.evt-bande__photos { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
|
||||
.evt-bande__photos > :first-child:nth-last-child(odd) { grid-column: auto; }
|
||||
}
|
||||
|
||||
/* ── Dépliables ── */
|
||||
.evt-details {
|
||||
margin-top: var(--space-md);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--evt-papier);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.evt-details > summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-sm);
|
||||
min-height: 56px;
|
||||
padding: var(--space-sm) var(--space-md);
|
||||
font-family: var(--evt-titre);
|
||||
font-weight: 600;
|
||||
font-size: 1.12rem;
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
}
|
||||
.evt-details > summary::-webkit-details-marker { display: none; }
|
||||
.evt-details > summary::after {
|
||||
content: '+';
|
||||
flex: none;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: var(--radius-full);
|
||||
background: color-mix(in srgb, var(--evt-teinte) 13%, var(--surface));
|
||||
color: var(--evt-teinte);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
font-family: var(--font-body);
|
||||
font-size: 1.15rem;
|
||||
line-height: 1;
|
||||
}
|
||||
.evt-details[open] > summary::after { content: '−'; }
|
||||
.evt-details > summary:hover::after { background: color-mix(in srgb, var(--evt-teinte) 24%, var(--surface)); }
|
||||
.evt-details__corps { padding: 0 var(--space-md) var(--space-md); }
|
||||
|
||||
/* ── Listes ── */
|
||||
.evt-liste { margin: 0 0 var(--space-md); padding-left: 1.2em; }
|
||||
.evt-liste li { margin-bottom: var(--space-xs); }
|
||||
/* Le déroulé : des points safran reliés par un fil (plus de bordure épaisse) */
|
||||
.evt-deroule { margin: 0; padding: 0; list-style: none; }
|
||||
.evt-deroule li { position: relative; padding: 0 0 var(--space-lg) var(--space-xl); }
|
||||
.evt-deroule li::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 3px;
|
||||
top: 0.4em;
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--accent);
|
||||
box-shadow: 0 0 0 3px var(--bg);
|
||||
}
|
||||
.evt-deroule li::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 9px;
|
||||
top: 1.5em;
|
||||
bottom: 0.1em;
|
||||
width: 1px;
|
||||
background: var(--border-strong);
|
||||
}
|
||||
.evt-deroule li:last-child { padding-bottom: 0; }
|
||||
.evt-deroule li:last-child::after { display: none; }
|
||||
.evt-deroule strong { display: block; font-family: var(--evt-titre); font-weight: 600; font-size: 1.1rem; margin-bottom: 2px; }
|
||||
|
||||
/* ── Encadré ── */
|
||||
.evt-encadre {
|
||||
padding: var(--space-md);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--bg-alt);
|
||||
}
|
||||
.evt-encadre p:last-child { margin-bottom: 0; }
|
||||
|
||||
/* ── Pied ── */
|
||||
.evt-pied {
|
||||
margin-top: var(--space-3xl);
|
||||
padding-top: var(--space-lg);
|
||||
border-top: 1px solid var(--border);
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
.evt-pied p { margin-bottom: var(--space-xs); }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.evt-btn, .evt-btn:hover { transition: none; transform: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,10 @@
|
||||
<template>
|
||||
<footer class="evt-pied">
|
||||
<slot />
|
||||
<p>Contact : <a :href="`mailto:${contact}`">{{ contact }}</a></p>
|
||||
</footer>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineProps<{ contact: string }>()
|
||||
</script>
|
||||
@@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<!-- « Le sens de la semaine » : ouvert par défaut, le « − » le replie (Jules, B26). Le cercle
|
||||
animé d'aep (EvenementsCercle) remplace le schéma « ce qui sort / ce qui revient » de B25 ;
|
||||
la légende et les noms se lisent dans utils/echelles.ts, comme sur aep. Les zooms S et M
|
||||
gardent le texte du deck e-codev (slides 08-09) ; leurs nuages de mots, que le cercle fait
|
||||
déjà tourner, sont retirés. -->
|
||||
<details class="evt-details sens" open>
|
||||
<summary>Le sens de la semaine</summary>
|
||||
<div class="evt-details__corps">
|
||||
<EvenementsCercle class="sens__cercle" />
|
||||
|
||||
<dl class="sens__echelles">
|
||||
<div v-for="id in ORDRE_ECHELLES" :key="id">
|
||||
<dt><span class="sens__badge">{{ id }}</span>{{ ECHELLES[id].titre }}</dt>
|
||||
<dd>{{ ACCROCHES[id] ?? ECHELLES[id].accroche }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p class="sens__boucle">Pas un escalier, une boucle : ça circule dans les deux sens, et on y repasse toute sa vie.</p>
|
||||
|
||||
<div class="sens__zoom">
|
||||
<h3 class="evt-h3"><span class="sens__badge">S</span>Partir de soi : sortir la tête de l'eau</h3>
|
||||
<p>
|
||||
C'est le gros du travail, et c'est celui qu'on fait seul par défaut : avoir assez d'air dans la semaine
|
||||
pour se poser la question du sens. Matériel et mutualisé : des ressources, des méthodes, des pairs qui
|
||||
vivent la même chose.
|
||||
</p>
|
||||
</div>
|
||||
<div class="sens__zoom">
|
||||
<h3 class="evt-h3"><span class="sens__badge">M</span>La communauté</h3>
|
||||
<p>
|
||||
Le chemin a des hauts et des bas. Trop gros pour y arriver seul : c'est le groupe qui remet un individu
|
||||
debout. L'affinité fait tenir, la confrontation fait avancer.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ECHELLES, ORDRE_ECHELLES, type EchelleId } from '~/utils/echelles'
|
||||
|
||||
/**
|
||||
* Accroches propres à la page codev, celles du deck e-codev du 23/10 (v2, slide 07) ; les autres viennent
|
||||
* d'utils/echelles.ts, comme sur aep. Pas dans echelles.ts : aep garde son texte (conférence du 23/09).
|
||||
*/
|
||||
const ACCROCHES: Partial<Record<EchelleId, string>> = {
|
||||
XL: 'le sens et l\'utilité de ce qu\'on fait : un métier et des pratiques alignés, au service de la société et de son évolution',
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* Le cercle déborde un peu du padding de la carte : 11 px de texte à 360 px d'écran */
|
||||
.sens__cercle { max-width: 440px; margin: 0 calc(-1 * var(--space-sm)) var(--space-lg); }
|
||||
@media (min-width: 480px) { .sens__cercle { margin: var(--space-xs) auto var(--space-lg); } }
|
||||
|
||||
.sens__badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 2rem;
|
||||
margin-right: var(--space-sm);
|
||||
padding: 0.1rem 0.5rem;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--accent);
|
||||
color: var(--on-accent);
|
||||
font-weight: var(--fw-bold);
|
||||
font-size: var(--fs-sm);
|
||||
letter-spacing: 0.04em;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.sens__echelles { margin: 0 0 var(--space-md); display: grid; gap: var(--space-sm); }
|
||||
.sens__echelles dt { font-weight: var(--fw-bold); }
|
||||
.sens__echelles dd { margin: 2px 0 0; color: var(--evt-attenue); }
|
||||
.sens__boucle { font-family: var(--evt-titre); font-weight: 600; font-size: 1.3rem; line-height: 1.3; text-wrap: balance; }
|
||||
.sens__zoom { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--border); }
|
||||
.sens__zoom .evt-h3 { display: flex; align-items: baseline; font-size: var(--fs-lg); line-height: 1.3; }
|
||||
</style>
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<figure class="evt-figure strates">
|
||||
<svg viewBox="0 0 560 300" role="img" aria-labelledby="strates-titre strates-desc">
|
||||
<title id="strates-titre">Les étages de la forêt</title>
|
||||
<desc id="strates-desc">
|
||||
De haut en bas : la strate haute, les grands arbres ; la strate moyenne, les fruitiers ;
|
||||
la strate basse, les petits fruits et les boutures ; au sol, la consoude.
|
||||
</desc>
|
||||
<!-- repères d'étage -->
|
||||
<g class="strates__repere">
|
||||
<line x1="0" x2="560" y1="58" y2="58" />
|
||||
<line x1="0" x2="560" y1="138" y2="138" />
|
||||
<line x1="0" x2="560" y1="208" y2="208" />
|
||||
</g>
|
||||
<g class="strates__etiquette">
|
||||
<text x="4" y="50">haute</text>
|
||||
<text x="4" y="130">moyenne</text>
|
||||
<text x="4" y="200">basse</text>
|
||||
<text x="4" y="262">herbacée</text>
|
||||
</g>
|
||||
|
||||
<!-- sol -->
|
||||
<path class="strates__sol" d="M0 268 Q140 262 280 268 T560 266 V300 H0 Z" />
|
||||
|
||||
<!-- haute : grand arbre -->
|
||||
<g class="strates__arbre strates__arbre--haut">
|
||||
<line x1="440" y1="268" x2="440" y2="96" />
|
||||
<line x1="440" y1="150" x2="410" y2="118" /><line x1="440" y1="132" x2="472" y2="104" />
|
||||
<ellipse cx="440" cy="62" rx="76" ry="48" />
|
||||
</g>
|
||||
<!-- moyenne : fruitier -->
|
||||
<g class="strates__arbre strates__arbre--moyen">
|
||||
<line x1="300" y1="268" x2="300" y2="166" />
|
||||
<ellipse cx="300" cy="142" rx="54" ry="34" />
|
||||
<circle class="strates__fruit" cx="282" cy="150" r="5" /><circle class="strates__fruit" cx="318" cy="138" r="5" /><circle class="strates__fruit" cx="304" cy="158" r="5" />
|
||||
</g>
|
||||
<!-- basse : arbuste + bouture -->
|
||||
<g class="strates__arbre strates__arbre--bas">
|
||||
<line x1="190" y1="268" x2="190" y2="226" />
|
||||
<ellipse cx="190" cy="214" rx="36" ry="22" />
|
||||
<circle class="strates__fruit" cx="178" cy="220" r="4" /><circle class="strates__fruit" cx="198" cy="210" r="4" />
|
||||
<line class="strates__bouture" x1="244" y1="268" x2="248" y2="216" />
|
||||
<path class="strates__feuille" d="M248 222 q10 -6 14 -16 q-12 2 -14 16 Z M247 234 q-10 -4 -14 -14 q12 1 14 14 Z" />
|
||||
</g>
|
||||
<!-- herbacée : consoude -->
|
||||
<g class="strates__herbe" transform="translate(40 0)">
|
||||
<path d="M110 268 q-14 -18 -20 -34 q14 8 20 34 Z" />
|
||||
<path d="M112 268 q2 -24 10 -40 q4 18 -10 40 Z" />
|
||||
<path d="M116 268 q14 -14 28 -22 q-6 16 -28 22 Z" />
|
||||
</g>
|
||||
<!-- paille au sol -->
|
||||
<path class="strates__paille" d="M60 268 l18 -4 M150 267 l22 -3 M340 268 l20 -4 M500 267 l24 -3" />
|
||||
</svg>
|
||||
</figure>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.strates svg { background: var(--surface); border: 1px solid var(--border); }
|
||||
.strates__repere line { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 4 6; }
|
||||
.strates__etiquette text { font-size: 20px; font-weight: 700; fill: var(--evt-attenue); }
|
||||
.strates__sol { fill: var(--bg-alt); }
|
||||
.strates__arbre line, .strates__bouture { stroke: var(--text); stroke-width: 4; stroke-linecap: round; }
|
||||
.strates__arbre ellipse { stroke: var(--text); stroke-width: 2; }
|
||||
.strates__arbre--haut ellipse { fill: color-mix(in srgb, var(--nav-primary-solid) 30%, var(--surface)); }
|
||||
.strates__arbre--moyen ellipse { fill: color-mix(in srgb, var(--nav-primary-solid) 18%, var(--surface)); }
|
||||
.strates__arbre--bas ellipse { fill: color-mix(in srgb, var(--nav-primary-solid) 10%, var(--surface)); }
|
||||
.strates__fruit { fill: var(--accent); stroke: var(--text); stroke-width: 1; }
|
||||
.strates__feuille, .strates__herbe path { fill: color-mix(in srgb, var(--nav-primary-solid) 22%, var(--surface)); stroke: var(--text); stroke-width: 1.5; }
|
||||
.strates__bouture { stroke-width: 3; }
|
||||
.strates__paille { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
|
||||
</style>
|
||||
@@ -0,0 +1,89 @@
|
||||
<!--
|
||||
AnneauEchelle — B13-M3
|
||||
L'anneau seul d'une échelle (deck v3.3, slides 17-19, `drawRing`) : un cercle plein,
|
||||
un cercle intérieur en pointillés, la lettre. Le nom que le deck écrivait au bas de
|
||||
l'anneau tombe : à la taille d'une vignette il serait illisible, et le titre de
|
||||
l'échelle est juste à côté.
|
||||
Décoratif (aria-hidden) : le titre et les sept mots portent le sens.
|
||||
Bleu nuit à 60 % (parti 2), safran quand `actif`. Géométrie : utils/figures.ts.
|
||||
La taille se règle de l'extérieur (largeur CSS) ; le trait garde son épaisseur à toute taille.
|
||||
-->
|
||||
<template>
|
||||
<svg
|
||||
class="anneau-echelle"
|
||||
:class="{ 'anneau-echelle--actif': actif }"
|
||||
:viewBox="`0 0 ${ANNEAU_L} ${ANNEAU_L}`"
|
||||
aria-hidden="true"
|
||||
focusable="false"
|
||||
>
|
||||
<circle class="anneau-echelle__plein" :cx="g.cx" :cy="g.cy" :r="g.r" />
|
||||
<circle class="anneau-echelle__pointilles" :cx="g.cx" :cy="g.cy" :r="g.rPointilles" />
|
||||
<text
|
||||
class="anneau-echelle__lettre"
|
||||
:x="g.cx"
|
||||
:y="g.yLettre"
|
||||
text-anchor="middle"
|
||||
:font-size="g.tailleLettre"
|
||||
>{{ echelle }}</text>
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { EchelleId } from '~/utils/echelles'
|
||||
import { ANNEAU_L, anneauSeul } from '~/utils/figures'
|
||||
|
||||
withDefaults(defineProps<{
|
||||
echelle: EchelleId
|
||||
/** Échelle courante : anneau en safran. */
|
||||
actif?: boolean
|
||||
}>(), { actif: false })
|
||||
|
||||
const g = anneauSeul()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.anneau-echelle {
|
||||
display: block;
|
||||
width: 4.5rem;
|
||||
height: auto;
|
||||
aspect-ratio: 1;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.anneau-echelle__plein {
|
||||
fill: color-mix(in srgb, var(--nav-primary-solid) 8%, transparent);
|
||||
stroke: color-mix(in srgb, var(--nav-primary-solid) 60%, transparent);
|
||||
stroke-width: 2px;
|
||||
vector-effect: non-scaling-stroke;
|
||||
transition: fill 200ms var(--ease-out), stroke 200ms var(--ease-out);
|
||||
}
|
||||
|
||||
.anneau-echelle__pointilles {
|
||||
fill: none;
|
||||
stroke: color-mix(in srgb, var(--nav-primary-solid) 60%, transparent);
|
||||
stroke-width: 1.5px;
|
||||
stroke-dasharray: 3 4;
|
||||
vector-effect: non-scaling-stroke;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.anneau-echelle__lettre {
|
||||
fill: var(--text);
|
||||
font-family: var(--font-body);
|
||||
font-weight: var(--fw-bold);
|
||||
}
|
||||
|
||||
.anneau-echelle--actif .anneau-echelle__plein {
|
||||
fill: color-mix(in srgb, var(--accent) 22%, transparent);
|
||||
stroke: var(--accent);
|
||||
stroke-width: 3px;
|
||||
}
|
||||
|
||||
.anneau-echelle--actif .anneau-echelle__pointilles {
|
||||
stroke: var(--accent);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.anneau-echelle__plein { transition: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Mode de profondeur courant d'un chatbot (M3). État partagé par clé via useState :
|
||||
* desktop et mobile d'un même chatbot (clés 'accueil', 'agences'…) restent synchronisés.
|
||||
* Volontairement non persisté : le mode est un choix par question, 'rapide' à chaque visite.
|
||||
*/
|
||||
export function useChatProfondeur(key: string | (() => string) = 'defaut') {
|
||||
const k = typeof key === 'function' ? key : () => key
|
||||
const store = useState<Record<string, ChatProfondeur>>('aep-chat-profondeur', () => ({}))
|
||||
return computed<ChatProfondeur>({
|
||||
get: () => store.value[k()] ?? CHAT_PROFONDEUR_DEFAUT,
|
||||
set: (v) => { store.value = { ...store.value, [k()]: normaliserProfondeur(v) } },
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
import type { MaybeRefOrGetter } from 'vue'
|
||||
|
||||
/**
|
||||
* Persistance de l'historique d'un chatbot dans sessionStorage.
|
||||
*
|
||||
* - Clé de stockage : `aep-chat-<pageKey>`, valeur `{ v: 1, messages: [...] }`
|
||||
* (une valeur d'une autre version est ignorée).
|
||||
* - SSR-safe : aucun accès au stockage hors de onMounted. Côté serveur et à
|
||||
* l'hydratation l'historique est vide, il est restauré juste après le mount.
|
||||
* - Partagé : deux composants (desktop + mobile) qui déclarent la même clé
|
||||
* lisent et écrivent le même tableau (useState), donc un redimensionnement
|
||||
* ne perd rien et un composant n'écrase pas l'autre.
|
||||
* - Tolérant : toute lecture/écriture est dans un try/catch (navigation
|
||||
* privée, stockage bloqué, quota). En cas d'échec le chatbot fonctionne
|
||||
* comme avant, sans persistance.
|
||||
* - Les messages marqués `transient: true` (erreurs) restent affichés mais ne
|
||||
* sont jamais écrits. Chargement et erreurs vivent hors de l'historique.
|
||||
* - La forme des messages est libre (fiches, auteur, mode...) : tout champ
|
||||
* sérialisable est conservé.
|
||||
*/
|
||||
export interface ChatSessionMessage {
|
||||
role: string
|
||||
content: string
|
||||
transient?: boolean
|
||||
}
|
||||
|
||||
const STORAGE_PREFIX = 'aep-chat-'
|
||||
const SCHEMA_VERSION = 1
|
||||
const DEFAULT_MAX = 40
|
||||
|
||||
export function useChatSession<T extends ChatSessionMessage>(
|
||||
pageKey: MaybeRefOrGetter<string>,
|
||||
options: { max?: number } = {},
|
||||
) {
|
||||
const max = options.max ?? DEFAULT_MAX
|
||||
const store = useState<Record<string, T[]>>('aep-chat-store', () => ({}))
|
||||
const restored = useState<Record<string, boolean>>('aep-chat-restored', () => ({}))
|
||||
const key = computed(() => toValue(pageKey))
|
||||
const mounted = ref(false)
|
||||
|
||||
function ensure(k: string) {
|
||||
if (!store.value[k]) store.value[k] = []
|
||||
}
|
||||
|
||||
const messages = computed<T[]>({
|
||||
get: () => store.value[key.value] ?? [],
|
||||
set: (list) => { store.value[key.value] = list },
|
||||
})
|
||||
const hasHistory = computed(() => messages.value.length > 0)
|
||||
|
||||
function isValid(m: any): m is T {
|
||||
return !!m && typeof m === 'object' && typeof m.role === 'string' && typeof m.content === 'string'
|
||||
}
|
||||
|
||||
function restore() {
|
||||
const k = key.value
|
||||
if (restored.value[k]) return
|
||||
restored.value[k] = true
|
||||
ensure(k)
|
||||
try {
|
||||
const raw = sessionStorage.getItem(STORAGE_PREFIX + k)
|
||||
if (!raw) return
|
||||
const data = JSON.parse(raw)
|
||||
if (!data || data.v !== SCHEMA_VERSION || !Array.isArray(data.messages)) return
|
||||
const valid = (data.messages as unknown[]).filter(isValid).slice(-max)
|
||||
if (valid.length && store.value[k].length === 0) store.value[k] = valid
|
||||
} catch {
|
||||
/* stockage indisponible ou valeur corrompue : on repart de zéro */
|
||||
}
|
||||
}
|
||||
|
||||
function save() {
|
||||
if (!mounted.value) return
|
||||
try {
|
||||
const list = messages.value.filter(m => !m.transient).slice(-max)
|
||||
const sk = STORAGE_PREFIX + key.value
|
||||
if (list.length === 0) sessionStorage.removeItem(sk)
|
||||
else sessionStorage.setItem(sk, JSON.stringify({ v: SCHEMA_VERSION, messages: list }))
|
||||
} catch {
|
||||
/* quota, navigation privée : pas de persistance, pas d'erreur */
|
||||
}
|
||||
}
|
||||
|
||||
/** Efface l'historique affiché et la clé de stockage. */
|
||||
function clear() {
|
||||
store.value[key.value] = []
|
||||
try { sessionStorage.removeItem(STORAGE_PREFIX + key.value) } catch { /* ignoré */ }
|
||||
}
|
||||
|
||||
watch(key, (k) => {
|
||||
ensure(k)
|
||||
if (mounted.value) restore()
|
||||
}, { immediate: true })
|
||||
|
||||
watch(messages, save, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
restore()
|
||||
mounted.value = true
|
||||
})
|
||||
|
||||
return { messages, hasHistory, clear }
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
/**
|
||||
* useEntree — B13-M5. L'état de l'entrée par le schéma S / M / XL, branché sur l'URL.
|
||||
*
|
||||
* L'URL fait foi (`?porte=S|M|XL`, CONCEPTION §4), comme `vue=` et `fiche=` (B11-B12) :
|
||||
* - `ouvrir` = `push` : le retour du navigateur ramène au schéma ;
|
||||
* - `voisine` = `replace` : passer d'une porte à l'autre n'empile rien
|
||||
* (une entrée d'historique par visite) ;
|
||||
* - `fermer` = `back()` si l'entrée d'avant est le schéma de cette page, sinon
|
||||
* `replace` (lien partagé, arrivée d'une autre page) : jamais de sortie du site.
|
||||
* Le Précédent du navigateur n'est jamais détourné (CONSTAT Holosapiens §4 : `push`, pas `replace`).
|
||||
*
|
||||
* Logique pure et tests : `utils/echelles.ts` (`lirePorte`, `voisines`, `fermeturePorte`),
|
||||
* `scripts/test-echelles-nav.mjs`.
|
||||
*
|
||||
* Mouvement (B13-M6) : `premiere` = l'apparition du schéma reste à jouer (clé
|
||||
* `localStorage.aep_entree_vue` absente, lue dans un `try`) ; `mouvementReduit`
|
||||
* suit `prefers-reduced-motion`. Le stockage ne sert qu'à « apparition jouée » ;
|
||||
* B14 s'en servira pour ne plus ouvrir de popup d'office.
|
||||
*/
|
||||
import { ORDRE_ECHELLES, PARAM_PORTE, lirePorte, voisines, fermeturePorte, type EchelleId } from '~/utils/echelles'
|
||||
import { finApparition } from '~/utils/figures'
|
||||
|
||||
/** Clé posée quand le schéma a été vu une fois (apparition jouée). */
|
||||
export const CLE_ENTREE_VUE = 'aep_entree_vue'
|
||||
|
||||
/** Script de tête : pose `html.entree-vue` avant le premier rendu si la clé existe (pas d'apparition rejouée). */
|
||||
export const SCRIPT_ENTREE_VUE =
|
||||
`try{if(localStorage.getItem('${CLE_ENTREE_VUE}')!==null)document.documentElement.classList.add('entree-vue')}catch(e){}`
|
||||
|
||||
function lireVue(): boolean {
|
||||
try {
|
||||
return localStorage.getItem(CLE_ENTREE_VUE) !== null
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
function marquerVue() {
|
||||
try {
|
||||
localStorage.setItem(CLE_ENTREE_VUE, '1')
|
||||
} catch {
|
||||
// stockage refusé (navigation privée, réglages) : l'apparition se rejouera, rien d'autre
|
||||
}
|
||||
}
|
||||
|
||||
/** Sens du dernier changement de porte : choisit la transition et la cible du focus. */
|
||||
export type SensPassage = 'ouvrir' | 'fermer' | 'avant' | 'arriere'
|
||||
|
||||
export function useEntree() {
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
const porte = computed<EchelleId | null>(() => lirePorte(route.query))
|
||||
|
||||
const sens = ref<SensPassage>('ouvrir')
|
||||
// `sync` : le sens est connu avant le rendu qui change de porte.
|
||||
watch(porte, (n, o) => {
|
||||
if (n && !o) sens.value = 'ouvrir'
|
||||
else if (!n) sens.value = 'fermer'
|
||||
else sens.value = ORDRE_ECHELLES.indexOf(n) > ORDRE_ECHELLES.indexOf(o as EchelleId) ? 'avant' : 'arriere'
|
||||
}, { flush: 'sync' })
|
||||
|
||||
function query(id: EchelleId | null) {
|
||||
const q: Record<string, unknown> = { ...route.query }
|
||||
if (id) q[PARAM_PORTE] = id
|
||||
else delete q[PARAM_PORTE]
|
||||
return q as Record<string, string>
|
||||
}
|
||||
|
||||
function ouvrir(id: EchelleId) {
|
||||
if (porte.value === id) return
|
||||
return router.push({ path: route.path, query: query(id) })
|
||||
}
|
||||
|
||||
function voisine(id: EchelleId) {
|
||||
if (porte.value === id) return
|
||||
return router.replace({ path: route.path, query: query(id) })
|
||||
}
|
||||
|
||||
/** ← / → au clavier, ou les liens « voisines ». */
|
||||
function lateral(pas: -1 | 1) {
|
||||
if (!porte.value) return
|
||||
const v = voisines(porte.value)
|
||||
const cible = pas < 0 ? v.precedente : v.suivante
|
||||
if (cible) return voisine(cible)
|
||||
}
|
||||
|
||||
function fermer() {
|
||||
if (!porte.value) return
|
||||
// Vue Router range l'adresse de l'entrée précédente dans history.state.back.
|
||||
const precedente = import.meta.client ? (window.history.state as { back?: unknown } | null)?.back : null
|
||||
if (fermeturePorte(precedente, route.path) === 'back') return router.back()
|
||||
return router.replace({ path: route.path, query: query(null) })
|
||||
}
|
||||
|
||||
// ── Mouvement ──
|
||||
// Rendu serveur : true (la tête de page éteint l'apparition si la clé existe).
|
||||
// Navigation interne vers l'entrée : lu tout de suite, avant le premier rendu.
|
||||
const premiere = useState('aep-entree-premiere', () => (import.meta.client ? !lireVue() : true))
|
||||
const dejaVue = ref(false)
|
||||
const mouvementReduit = ref(false)
|
||||
|
||||
let minuteur: ReturnType<typeof setTimeout> | null = null
|
||||
/** À appeler quand le grand schéma est à l'écran : la clé est posée, l'apparition ne se rejouera plus. */
|
||||
function schemaAffiche() {
|
||||
if (!import.meta.client) return
|
||||
dejaVue.value = lireVue()
|
||||
if (dejaVue.value || mouvementReduit.value) {
|
||||
marquerVue()
|
||||
premiere.value = false
|
||||
return
|
||||
}
|
||||
marquerVue()
|
||||
// On laisse finir l'animation avant de retirer la classe (la retirer en cours la couperait net).
|
||||
if (minuteur) clearTimeout(minuteur)
|
||||
minuteur = setTimeout(() => { premiere.value = false }, finApparition() + 100)
|
||||
}
|
||||
|
||||
let mq: MediaQueryList | null = null
|
||||
const suivreMq = () => { mouvementReduit.value = !!mq?.matches }
|
||||
onMounted(() => {
|
||||
mq = window.matchMedia('(prefers-reduced-motion: reduce)')
|
||||
suivreMq()
|
||||
mq.addEventListener('change', suivreMq)
|
||||
dejaVue.value = lireVue()
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
mq?.removeEventListener('change', suivreMq)
|
||||
// Partie avant la fin : l'apparition est jouée, elle ne recommencera pas au retour.
|
||||
if (minuteur) { clearTimeout(minuteur); premiere.value = false }
|
||||
})
|
||||
|
||||
return { porte, sens, ouvrir, voisine, lateral, fermer, premiere, dejaVue, mouvementReduit, schemaAffiche }
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { canoniqueEvenement, estHoteEvenement, lienEvenement } from '~/utils/evenements'
|
||||
import { SITE_EVENT } from '~/utils/seo'
|
||||
|
||||
/**
|
||||
* Pages d'événement : sur quel hôte on est, comment écrire un lien, et la tête de partage
|
||||
* (titre, description, Open Graph, Twitter), que le plugin B23 ne pose pas.
|
||||
* La canonique et le robots ne sont plus posés ici (B29, 24/10) : plugins/seo.ts les pose
|
||||
* sur chaque page depuis utils/seo.ts, mêmes valeurs. `ogUrl` reprend la même canonique.
|
||||
*/
|
||||
export function useEvenement() {
|
||||
const surEvent = estHoteEvenement(useRequestURL().hostname)
|
||||
const lien = (chemin: string) => lienEvenement(chemin, surEvent)
|
||||
|
||||
function seo(o: { chemin: string; titre: string; description: string; image: string; alt: string }) {
|
||||
const canon = canoniqueEvenement(o.chemin)
|
||||
const image = SITE_EVENT + o.image
|
||||
useSeoMeta({
|
||||
title: o.titre,
|
||||
description: o.description,
|
||||
ogTitle: o.titre,
|
||||
ogDescription: o.description,
|
||||
ogImage: image,
|
||||
ogImageAlt: o.alt,
|
||||
ogUrl: canon,
|
||||
ogType: 'website',
|
||||
ogLocale: 'fr_FR',
|
||||
twitterCard: 'summary_large_image',
|
||||
})
|
||||
}
|
||||
|
||||
return { surEvent, lien, seo }
|
||||
}
|
||||
@@ -1,12 +1,18 @@
|
||||
/**
|
||||
* useFicheAdapter — B3-M2
|
||||
* useFicheAdapter — B3-M2, étendu en B11-M2
|
||||
* Adaptateur léger Org | StructureV2 → MiniFiche, format commun consommé par
|
||||
* FicheMiniCard / FichesPanel. Aucune mutation des types sources.
|
||||
* FicheMiniCard / VueFiches. Aucune mutation des types sources.
|
||||
*
|
||||
* Repli résumé (brief B3, le champ `resume_court` du batch B2b n'existe pas
|
||||
* encore) : première phrase du premier champ non vide parmi une liste de
|
||||
* candidats ordonnée par type, tronquée proprement à ~110 caractères sur un
|
||||
* mot (jamais au milieu).
|
||||
*
|
||||
* B11 : chaque fiche porte ses `etiquettes` par dimension (clé = paramètre
|
||||
* d'URL de la dimension : `fonctions`, `echelle`, `territoire` pour l'Entraide ;
|
||||
* `tags`, `famille`, `pays` pour Réseaux AEP). C'est ce que filtre, trie et
|
||||
* regroupe `utils/vueFiches.ts` ; `chips` et `echelle` restent l'affichage
|
||||
* de la carte-fiche, inchangé.
|
||||
*/
|
||||
import type { Org } from '~/types/org'
|
||||
import type { StructureV2 } from '~/types/structure-v2'
|
||||
@@ -15,12 +21,25 @@ export interface MiniFiche {
|
||||
id: string | number
|
||||
nom: string
|
||||
resume: string
|
||||
/** Étiquettes affichées sur la carte-fiche (3 au plus). */
|
||||
chips: string[]
|
||||
/** Dimension d'où viennent `chips` : les rend cliquables dans la vue fiches. */
|
||||
chipsDimension?: string
|
||||
echelle?: string
|
||||
geoloc: boolean
|
||||
kind: 'org' | 'structure'
|
||||
kind: 'org' | 'structure' | 'mot'
|
||||
/** Étiquettes complètes par dimension (valeurs telles qu'écrites dans l'URL). */
|
||||
etiquettes?: Record<string, string[]>
|
||||
coords?: [number, number]
|
||||
/** Date ISO si la source en a une (tri « récent »). */
|
||||
date?: string
|
||||
ville?: string
|
||||
/** Texte cherchable en plus du nom, de la ville et du résumé. */
|
||||
texte?: string
|
||||
}
|
||||
|
||||
export const DOM_TOM = ['Guadeloupe', 'Martinique', 'Guyane', 'La Réunion', 'Mayotte']
|
||||
|
||||
const RESUME_MAX = 110
|
||||
|
||||
/** Première phrase d'un texte (coupe sur ". "/"! "/"? " ou fin de chaîne). */
|
||||
@@ -53,32 +72,127 @@ function orgFonctions(org: Org): string[] {
|
||||
.split(',')
|
||||
.map((f) => f.trim())
|
||||
.filter(Boolean)
|
||||
.slice(0, 3)
|
||||
}
|
||||
|
||||
export function useFicheAdapter() {
|
||||
function toMini(source: Org | StructureV2): MiniFiche {
|
||||
if (isStructure(source)) {
|
||||
return {
|
||||
id: source.id,
|
||||
nom: source.nom,
|
||||
resume: buildResume([source.description_courte, source.description_longue]),
|
||||
chips: (source.hashtags ?? []).slice(0, 3),
|
||||
geoloc: source.latitude != null && source.longitude != null,
|
||||
kind: 'structure',
|
||||
}
|
||||
}
|
||||
function coordsDe(lat?: number | null, lon?: number | null): [number, number] | undefined {
|
||||
return lat != null && lon != null ? [lat, lon] : undefined
|
||||
}
|
||||
|
||||
/** Hashtag sans son « # » : c'est la forme de l'URL (`tags=reemploi-structurel`). */
|
||||
export function sansDiese(tag: string): string {
|
||||
return tag.replace(/^#/, '')
|
||||
}
|
||||
|
||||
/** Familles d'une structure : principale, secondaires, et 6 pour le badge recherche politique. */
|
||||
function famillesDe(s: StructureV2): string[] {
|
||||
const ids = [s.famille_principale, ...(s.familles_secondaires ?? [])]
|
||||
if (s.badges?.f6_recherche_politique) ids.push(6 as any)
|
||||
return [...new Set(ids.map(String))]
|
||||
}
|
||||
|
||||
export function toMini(source: Org | StructureV2): MiniFiche {
|
||||
if (isStructure(source)) {
|
||||
const hashtags = source.hashtags ?? []
|
||||
return {
|
||||
id: source.Id,
|
||||
id: source.id,
|
||||
nom: source.nom,
|
||||
resume: buildResume([source.description_enrichie, source.description]),
|
||||
chips: orgFonctions(source),
|
||||
echelle: source.echelle,
|
||||
resume: buildResume([source.description_courte, source.description_longue]),
|
||||
chips: hashtags.slice(0, 3),
|
||||
chipsDimension: 'tags',
|
||||
geoloc: source.latitude != null && source.longitude != null,
|
||||
kind: 'org',
|
||||
kind: 'structure',
|
||||
etiquettes: {
|
||||
tags: hashtags.map(sansDiese),
|
||||
famille: famillesDe(source),
|
||||
pays: source.pays ? [source.pays] : [],
|
||||
},
|
||||
coords: coordsDe(source.latitude, source.longitude),
|
||||
ville: source.ville,
|
||||
// Portée de la recherche d'avant B11 sur /agences : description courte et hashtags.
|
||||
texte: [source.description_courte, ...hashtags].filter(Boolean).join(' '),
|
||||
}
|
||||
}
|
||||
|
||||
return { toMini }
|
||||
const fonctions = orgFonctions(source)
|
||||
return {
|
||||
id: source.Id,
|
||||
nom: source.nom,
|
||||
resume: buildResume([source.description_enrichie, source.description]),
|
||||
chips: fonctions.slice(0, 3),
|
||||
chipsDimension: 'fonctions',
|
||||
echelle: source.echelle,
|
||||
geoloc: source.latitude != null && source.longitude != null,
|
||||
kind: 'org',
|
||||
etiquettes: {
|
||||
fonctions,
|
||||
echelle: source.echelle ? [source.echelle] : [],
|
||||
territoire: [source.territoire && DOM_TOM.includes(source.territoire) ? source.territoire : 'Métropole'],
|
||||
},
|
||||
coords: coordsDe(source.latitude, source.longitude),
|
||||
date: source.submitted_at,
|
||||
ville: source.localisation_ville,
|
||||
}
|
||||
}
|
||||
|
||||
// ── Partir de soi (B6-M2) : un mot de la slide 17 = une fiche ─────────────
|
||||
|
||||
/** Une fiche de `public/data/outils.json` → `partir_de_soi.fiches[]`. */
|
||||
export interface FicheMot {
|
||||
id: string
|
||||
mot: string
|
||||
resume: string
|
||||
vide?: string | null
|
||||
}
|
||||
|
||||
/** Une ressource de `partir_de_soi.ressources[]`, reliée à ses mots par `fiches`. */
|
||||
export interface RessourceMot {
|
||||
id: string
|
||||
titre: string
|
||||
format: string
|
||||
acces: string
|
||||
pourquoi?: string
|
||||
fiches: string[]
|
||||
}
|
||||
|
||||
/** « don libre » → `don-libre` : la forme d'une valeur de filtre dans l'URL (`acces=don-libre`). */
|
||||
export function slugEtiquette(s: string): string {
|
||||
return s.normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '')
|
||||
}
|
||||
|
||||
/** Valeurs distinctes d'un champ des ressources, dans l'ordre de première apparition (ordre stable des chips). */
|
||||
export function valeursRessources(ressources: RessourceMot[], champ: 'format' | 'acces'): { valeur: string; libelle: string }[] {
|
||||
const vus = new Map<string, string>()
|
||||
for (const r of ressources) {
|
||||
const l = r[champ]
|
||||
if (l && !vus.has(slugEtiquette(l))) vus.set(slugEtiquette(l), l)
|
||||
}
|
||||
return [...vus].map(([valeur, libelle]) => ({ valeur, libelle }))
|
||||
}
|
||||
|
||||
/**
|
||||
* Un mot de la conférence → `MiniFiche`. `ressources` = celles qui portent ce mot.
|
||||
* Pas de carte géographique : `geoloc: true` (aucune fiche « sans adresse »).
|
||||
* La recherche couvre aussi les titres et les « pourquoi » des ressources.
|
||||
*/
|
||||
export function toMiniMot(fiche: FicheMot, ressources: RessourceMot[]): MiniFiche {
|
||||
const formats = [...new Set(ressources.map((r) => r.format).filter(Boolean))]
|
||||
const acces = [...new Set(ressources.map((r) => r.acces).filter(Boolean))]
|
||||
return {
|
||||
id: fiche.id,
|
||||
nom: fiche.mot,
|
||||
resume: buildResume([fiche.resume, fiche.vide]),
|
||||
chips: formats.slice(0, 3),
|
||||
chipsDimension: 'format',
|
||||
geoloc: true,
|
||||
kind: 'mot',
|
||||
etiquettes: {
|
||||
format: formats.map(slugEtiquette),
|
||||
acces: acces.map(slugEtiquette),
|
||||
},
|
||||
texte: [fiche.resume, ...ressources.flatMap((r) => [r.titre, r.pourquoi])].filter(Boolean).join(' '),
|
||||
}
|
||||
}
|
||||
|
||||
export function useFicheAdapter() {
|
||||
return { toMini, toMiniMot }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
/**
|
||||
* useVueFiches — B11-M1. L'état de la vue fiches, branché sur l'URL.
|
||||
*
|
||||
* L'URL est la source de vérité (SPEC-vue-fiches §5) : l'état se LIT dans
|
||||
* `route.query` (surveillée : un lien interne vers `?vue=fiches` depuis la même
|
||||
* page change l'écran) et s'ÉCRIT par `router.replace` (pas d'entrée
|
||||
* d'historique par clic de filtre). Seule la recherche a un tampon local, pour
|
||||
* ne pas perdre de lettres pendant la frappe : elle part dans l'URL 250 ms
|
||||
* après la dernière touche.
|
||||
*
|
||||
* La page crée l'état (elle en a besoin pour sa carte) et le passe tel quel à
|
||||
* `<VueFiches :vf="vf">`. Logique pure et tests : `utils/vueFiches.ts`,
|
||||
* `scripts/test-vue-fiches.mjs`.
|
||||
*/
|
||||
import type { MaybeRefOrGetter } from 'vue'
|
||||
import type { MiniFiche } from '~/composables/useFicheAdapter'
|
||||
import {
|
||||
lireQuery, ecrireQuery, filtresValides, filtrerFiches, compterEtiquettes,
|
||||
triEffectif, trierFiches, regrouper, ordreFiches, nbFiltresActifs,
|
||||
lireFiche, queryAvecFiche, positionFiche, modeOuverture, modeFermeture, empreinteListe,
|
||||
type ConfigVueFiches, type EtatFiches, type EtatVue, type TriFiches,
|
||||
} from '~/utils/vueFiches'
|
||||
|
||||
/** Largeur d'écran ; null avant le montage (SSR) : la CSS tranche alors seule. */
|
||||
export type Largeur = 'telephone' | 'tablette' | 'ordinateur' | null
|
||||
|
||||
const CLE_REPLI = 'aep_vue_fiches_liste_repliee'
|
||||
|
||||
export function useVueFiches(
|
||||
fiches: MaybeRefOrGetter<MiniFiche[]>,
|
||||
config: MaybeRefOrGetter<ConfigVueFiches>,
|
||||
) {
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const cfg = computed(() => toValue(config))
|
||||
|
||||
// ── Lecture ──
|
||||
const brut = computed(() => lireQuery(route.query, cfg.value))
|
||||
|
||||
const q = ref(brut.value.q)
|
||||
let qEcrit = q.value
|
||||
let minuteurQ: ReturnType<typeof setTimeout> | null = null
|
||||
watch(() => brut.value.q, (v) => {
|
||||
if (v !== qEcrit) { q.value = v; qEcrit = v }
|
||||
})
|
||||
|
||||
const etat = computed<EtatFiches>(() => ({
|
||||
...brut.value,
|
||||
q: q.value,
|
||||
filtres: filtresValides(brut.value.filtres, cfg.value),
|
||||
}))
|
||||
|
||||
// ── Écriture ──
|
||||
// La navigation est asynchrone : une query écrite n'est dans `route.query`
|
||||
// qu'au tick suivant. Deux écritures du même tick (« Voir sur la carte » :
|
||||
// Mixte, puis la sous-vue de la page) partent donc de la dernière query
|
||||
// écrite, sinon la seconde efface la première.
|
||||
let enAttente: Record<string, string> | null = null
|
||||
watch(() => route.query, () => { enAttente = null })
|
||||
const queryBase = () => enAttente ?? route.query
|
||||
function naviguer(query: Record<string, string>, mode: 'push' | 'replace' = 'replace') {
|
||||
enAttente = query
|
||||
if (mode === 'push') router.push({ query })
|
||||
else router.replace({ query })
|
||||
}
|
||||
function etatDepuis(base: Record<string, unknown>): EtatFiches {
|
||||
const b = lireQuery(base, cfg.value)
|
||||
return { ...b, q: q.value, filtres: filtresValides(b.filtres, cfg.value) }
|
||||
}
|
||||
|
||||
function ecrire(partiel: Partial<EtatFiches>) {
|
||||
const base = queryBase()
|
||||
const nouvel = { ...etatDepuis(base), ...partiel }
|
||||
qEcrit = nouvel.q
|
||||
if (minuteurQ && partiel.q === undefined) { clearTimeout(minuteurQ); minuteurQ = null }
|
||||
naviguer(ecrireQuery(nouvel, cfg.value, base))
|
||||
}
|
||||
|
||||
function setQ(v: string) {
|
||||
q.value = v
|
||||
if (minuteurQ) clearTimeout(minuteurQ)
|
||||
minuteurQ = setTimeout(() => { minuteurQ = null; ecrire({ q: v }) }, 250)
|
||||
}
|
||||
|
||||
function avecFiltre(dim: string, valeurs: string[]) {
|
||||
return { ...etat.value.filtres, [dim]: valeurs }
|
||||
}
|
||||
function toggle(dim: string, valeur: string) {
|
||||
const vals = etat.value.filtres[dim] ?? []
|
||||
ecrire({ filtres: avecFiltre(dim, vals.includes(valeur) ? vals.filter((v) => v !== valeur) : [...vals, valeur]) })
|
||||
}
|
||||
function ajouterFiltre(dim: string, valeur: string) {
|
||||
const vals = etat.value.filtres[dim] ?? []
|
||||
if (!vals.includes(valeur)) ecrire({ filtres: avecFiltre(dim, [...vals, valeur]) })
|
||||
}
|
||||
function effacerTout() {
|
||||
q.value = ''
|
||||
const vides: Record<string, string[]> = {}
|
||||
for (const d of cfg.value.dimensions) vides[d.cle] = []
|
||||
ecrire({ q: '', filtres: vides, sansAdresse: false })
|
||||
}
|
||||
const setTri = (tri: TriFiches) => ecrire({ tri })
|
||||
const setGroupe = (groupe: string | null) => ecrire({ groupe })
|
||||
const setSousVue = (sousVue: string) => ecrire({ sousVue })
|
||||
const setSansAdresse = (sansAdresse: boolean) => ecrire({ sansAdresse })
|
||||
|
||||
// ── Largeur et état affiché ──
|
||||
const largeur = ref<Largeur>(null)
|
||||
const listeRepliee = ref(false)
|
||||
|
||||
onMounted(() => {
|
||||
const mq768 = window.matchMedia('(min-width: 768px)')
|
||||
const mq1024 = window.matchMedia('(min-width: 1024px)')
|
||||
const maj = () => {
|
||||
largeur.value = mq1024.matches ? 'ordinateur' : mq768.matches ? 'tablette' : 'telephone'
|
||||
}
|
||||
maj()
|
||||
mq768.addEventListener('change', maj)
|
||||
mq1024.addEventListener('change', maj)
|
||||
onBeforeUnmount(() => {
|
||||
mq768.removeEventListener('change', maj)
|
||||
mq1024.removeEventListener('change', maj)
|
||||
})
|
||||
try { listeRepliee.value = sessionStorage.getItem(CLE_REPLI) === '1' } catch {}
|
||||
})
|
||||
|
||||
/**
|
||||
* État rendu. `auto` avant le montage quand l'URL ne tranche pas (ou dit
|
||||
* `mixte`) : la CSS rend Mixte à partir de 1024 px et Fiches en dessous, sans
|
||||
* saut à l'hydratation. Mixte n'existe pas sous 1024 px : il se lit Fiches.
|
||||
*/
|
||||
const vueAffichee = computed<EtatVue | 'auto'>(() => {
|
||||
const etats = cfg.value.etats
|
||||
const v = etat.value.vue
|
||||
// `auto` rend Mixte à partir de 1024 px : seulement pour une page qui a cet état
|
||||
if (largeur.value === null) return v && v !== 'mixte' ? v : etats.includes('mixte') ? 'auto' : 'fiches'
|
||||
const ordinateur = largeur.value === 'ordinateur'
|
||||
if (v === 'mixte' || v === null) {
|
||||
if (!ordinateur || !etats.includes('mixte')) return 'fiches'
|
||||
if (v === null && listeRepliee.value) return 'carte'
|
||||
return 'mixte'
|
||||
}
|
||||
return v
|
||||
})
|
||||
|
||||
function setVue(v: EtatVue) {
|
||||
if (largeur.value === 'ordinateur' && (v === 'mixte' || v === 'carte')) {
|
||||
listeRepliee.value = v === 'carte'
|
||||
try { sessionStorage.setItem(CLE_REPLI, listeRepliee.value ? '1' : '0') } catch {}
|
||||
}
|
||||
ecrire({ vue: v })
|
||||
}
|
||||
|
||||
// ── Résultat ──
|
||||
const sansAdresseIgnore = computed(() => ({ ...etat.value, sansAdresse: false }))
|
||||
const filtrees = computed(() => filtrerFiches(toValue(fiches), etat.value, cfg.value))
|
||||
const tri = computed(() => triEffectif(etat.value, cfg.value))
|
||||
const resultat = computed(() => trierFiches(filtrees.value, tri.value, etat.value))
|
||||
const groupeDef = computed(() => cfg.value.groupes.find((g) => g.cle === etat.value.groupe) ?? null)
|
||||
const groupes = computed(() => regrouper(resultat.value, groupeDef.value, cfg.value))
|
||||
const ordre = computed(() => ordreFiches(groupes.value))
|
||||
const compteurs = computed(() => compterEtiquettes(toValue(fiches), etat.value, cfg.value))
|
||||
const idsResultat = computed(() => new Set(resultat.value.map((f) => String(f.id))))
|
||||
const nbSansAdresse = computed(() =>
|
||||
filtrerFiches(toValue(fiches), sansAdresseIgnore.value, cfg.value).filter((f) => !f.geoloc).length,
|
||||
)
|
||||
const total = computed(() => toValue(fiches).length)
|
||||
const nbActifs = computed(() => nbFiltresActifs(etat.value))
|
||||
|
||||
function voirSansAdresse() {
|
||||
ecrire({ sansAdresse: true, vue: 'fiches' })
|
||||
}
|
||||
|
||||
/** Fiche survolée (liste ↔ épingle) ; la carte de la page s'en sert, et peut l'écrire. */
|
||||
const survolId = ref<string | number | null>(null)
|
||||
|
||||
// ── Fiche ouverte (B12) : `fiche=` dans l'URL, lu aussi au rendu serveur ──
|
||||
const ficheId = computed(() => lireFiche(route.query))
|
||||
/** La fiche ouverte, cherchée dans TOUTES les fiches (elle peut être hors filtres). null = pas encore chargée ou inconnue. */
|
||||
const ficheOuverte = computed<MiniFiche | null>(() => {
|
||||
const id = ficheId.value
|
||||
return id == null ? null : toValue(fiches).find((f) => String(f.id) === id) ?? null
|
||||
})
|
||||
/** Rang dans l'ordre courant ; null = hors de vos filtres (ou pas de fiche). */
|
||||
const position = computed(() => positionFiche(ordre.value, ficheId.value))
|
||||
/**
|
||||
* Empreinte de la liste au moment où CETTE page a ajouté l'entrée
|
||||
* d'historique de la fiche ; null = fiche venue d'un lien partagé.
|
||||
*/
|
||||
let listeALOuverture: string | null = null
|
||||
|
||||
function ouvrirFiche(id: string | number) {
|
||||
if (String(id) === lireFiche(queryBase())) return
|
||||
const base = queryBase()
|
||||
const mode = modeOuverture(lireFiche(base))
|
||||
if (mode === 'push') listeALOuverture = empreinteListe(base)
|
||||
naviguer(queryAvecFiche(base, id), mode)
|
||||
}
|
||||
|
||||
function fermerFiche() {
|
||||
if (lireFiche(queryBase()) == null) return
|
||||
const mode = modeFermeture(listeALOuverture != null, listeALOuverture === empreinteListe(queryBase()))
|
||||
listeALOuverture = null
|
||||
if (mode === 'back') { enAttente = null; router.back() }
|
||||
else naviguer(queryAvecFiche(queryBase(), null))
|
||||
}
|
||||
|
||||
/** Étiquette cliquée dans le détail : ajoute le filtre ; `fermer` (téléphone) referme la fiche dans le même geste. */
|
||||
function filtrerDepuisFiche(dim: string, valeur: string, fermer: boolean) {
|
||||
const base = queryBase()
|
||||
const e = etatDepuis(base)
|
||||
const vals = e.filtres[dim] ?? []
|
||||
const filtres = vals.includes(valeur) ? e.filtres : { ...e.filtres, [dim]: [...vals, valeur] }
|
||||
const query = ecrireQuery({ ...e, filtres }, cfg.value, base)
|
||||
if (fermer) listeALOuverture = null
|
||||
naviguer(fermer ? queryAvecFiche(query, null) : query)
|
||||
}
|
||||
|
||||
// Retour arrière du navigateur (ou lien interne) : l'URL a perdu `fiche=`.
|
||||
watch(ficheId, (id) => { if (id == null) listeALOuverture = null })
|
||||
|
||||
const fichePrecedente = () => { if (position.value?.precedente) ouvrirFiche(position.value.precedente.id) }
|
||||
const ficheSuivante = () => { if (position.value?.suivante) ouvrirFiche(position.value.suivante.id) }
|
||||
|
||||
/**
|
||||
* « Voir sur la carte » : ordinateur → Mixte, la fiche reste ouverte ;
|
||||
* téléphone et tablette (pas de Mixte) → Carte, la fiche se ferme (elle
|
||||
* couvrirait la carte). La page lit `centrage` et centre son épingle.
|
||||
*/
|
||||
const centrage = ref<{ id: string; n: number } | null>(null)
|
||||
function voirSurCarte(id: string | number) {
|
||||
centrage.value = { id: String(id), n: (centrage.value?.n ?? 0) + 1 }
|
||||
if (largeur.value === 'ordinateur' && cfg.value.etats.includes('mixte')) {
|
||||
setVue('mixte')
|
||||
return
|
||||
}
|
||||
listeALOuverture = null
|
||||
const base = queryBase()
|
||||
naviguer(queryAvecFiche(ecrireQuery({ ...etatDepuis(base), vue: 'carte' }, cfg.value, base), null))
|
||||
}
|
||||
|
||||
return reactive({
|
||||
cfg, etat, q, largeur, vueAffichee, tri, resultat, groupes, ordre, compteurs,
|
||||
idsResultat, nbSansAdresse, total, nbActifs, survolId,
|
||||
ficheId, ficheOuverte, position, centrage,
|
||||
setVue, setQ, toggle, ajouterFiltre, effacerTout, setTri, setGroupe, setSousVue,
|
||||
setSansAdresse, voirSansAdresse,
|
||||
ouvrirFiche, fermerFiche, fichePrecedente, ficheSuivante, voirSurCarte, filtrerDepuisFiche,
|
||||
})
|
||||
}
|
||||
|
||||
export type VueFichesEtat = ReturnType<typeof useVueFiches>
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Fin novembre 2026 à Ruetz : la semaine d'entraide (codev) puis la plantation.
|
||||
* Un fichier par événement : l'index event.trans-former.fr/ les lit tous.
|
||||
* Les textes longs vivent dans les pages ; ici, ce qui change d'une édition à l'autre.
|
||||
*/
|
||||
|
||||
export const evenement = {
|
||||
slug: 'ruetz',
|
||||
chemin: '/ruetz',
|
||||
titre: 'Fin novembre à Ruetz',
|
||||
lieu: 'Ruetz, Bayard-sur-Marne (Haute-Marne)',
|
||||
/** Le lieu dans une phrase (bandeau du site AEP, B27 : « …ensemble à Ruetz (Haute-Marne). », Jules 23/10). */
|
||||
lieuCourt: 'Ruetz (Haute-Marne)',
|
||||
resume: 'Une semaine d\'entraide, puis un week-end pour planter une forêt nourricière.',
|
||||
du: '2026-11-21',
|
||||
au: '2026-11-29',
|
||||
contact: 'contact@trans-former.fr',
|
||||
reponsesAvant: 'vendredi 6 novembre',
|
||||
/** Le lieu-dit sur Google Maps (jamais l'adresse de la maison) ; ouvre l'application au téléphone. */
|
||||
mapsUrl: 'https://www.google.com/maps/search/?api=1&query=Ruetz%2C%20Bayard-sur-Marne',
|
||||
codev: {
|
||||
chemin: '/ruetz/codev',
|
||||
titre: 'La semaine d\'entraide',
|
||||
/** Tableau de covoiturage (Google Sheet, Drive de Jules) ; null tant qu'il n'existe pas.
|
||||
* Un tableau par événement : celui de la semaine nomme le codev, la forêt ne doit pas le voir. */
|
||||
covoiturageUrl: 'https://docs.google.com/spreadsheets/d/12YHom74GQyjpdMPGU4qzB0kk1EKkM97jb0YoKzNucYA/edit' as string | null,
|
||||
du: '2026-11-21',
|
||||
au: '2026-11-27',
|
||||
/** Lundi → vendredi : la semaine de codev proprement dite ; le week-end d'avant, on atterrit ensemble. */
|
||||
debutCodev: '2026-11-23',
|
||||
capacite: 16,
|
||||
/** Déjà compté·es hors formulaire (Jules et Estelle, B26) : 14 places restent à prendre. */
|
||||
dejaInscrits: 2,
|
||||
/** € par jour de présence, pour la nourriture (15 depuis le 22/10, Jules, B26 ; 10 avant). */
|
||||
prixJour: 15,
|
||||
/** Tout le monde arrive le 21 : un seul jour, le formulaire l'envoie d'office. Les jours payés partent de là. */
|
||||
arrivees: ['2026-11-21'],
|
||||
departs: ['2026-11-25', '2026-11-26', '2026-11-27'],
|
||||
},
|
||||
|
||||
foret: {
|
||||
chemin: '/ruetz/foret',
|
||||
titre: 'On plante une forêt',
|
||||
du: '2026-11-28',
|
||||
au: '2026-11-29',
|
||||
covoiturageUrl: 'https://docs.google.com/spreadsheets/d/1sAs7RwGGUGiCcrV3N5w72m9omRhsCu7SIDTQENqiN_Q/edit' as string | null,
|
||||
/** Personnes au chantier, enfants compris ; non affiché, ferme le formulaire. */
|
||||
capacite: 40,
|
||||
},
|
||||
}
|
||||
|
||||
export type Evenement = typeof evenement
|
||||
@@ -0,0 +1,59 @@
|
||||
# Inscriptions Ruetz (lot Y) — mise en service
|
||||
|
||||
Pages : `event.trans-former.fr/ruetz`, `/ruetz/codev`, `/ruetz/foret` (copie sous `aep.trans-former.fr/evenements/...`, en noindex).
|
||||
Route d'écriture : `POST /api/evenements/inscription` ; compteurs : `GET /api/evenements/places?page=codev|foret`.
|
||||
Sans la table, les pages restent en ligne et renvoient vers `contact@trans-former.fr` (jamais de fausse confirmation).
|
||||
|
||||
## 1. Créer la table NocoDB `inscriptions_ruetz`
|
||||
|
||||
Dans la base AEP (celle de `NOCODB_BASE`), sur `sheets.trans-former.fr` :
|
||||
|
||||
| Colonne | Type NocoDB | Note |
|
||||
|---|---|---|
|
||||
| `Id` | (auto) | clé |
|
||||
| `page` | SingleLineText | `codev` ou `foret` |
|
||||
| `prenom` | SingleLineText | |
|
||||
| `nom` | SingleLineText | |
|
||||
| `email` | Email ou SingleLineText | |
|
||||
| `telephone` | SingleLineText | facultatif |
|
||||
| `arrivee` | SingleLineText | codev : `2026-11-21` (seul jour d'arrivée, envoyé d'office) ; forêt : `vendredi` / `samedi` |
|
||||
| `depart` | SingleLineText | codev : `2026-11-25` à `2026-11-27` ; forêt : vide |
|
||||
| `reste_plantation` | Checkbox | codev : reste pour le 28-29 (compte dans les 40 de la forêt) |
|
||||
| `nb_personnes` | Number, défaut 1 | forêt : 1 à 8 ; codev : 1 |
|
||||
| `nb_enfants` | Number, défaut 0 | |
|
||||
| `dort_sur_place` | Checkbox | |
|
||||
| `besoin_alimentaire` | LongText | facultatif |
|
||||
| `voiture` | SingleLineText | `places` / `cherche` / `non` |
|
||||
| `mot` | LongText | facultatif, 1 000 caractères |
|
||||
| `annule` | Checkbox | cocher pour libérer une place (la ligne ne compte plus) |
|
||||
| `created_at` | SingleLineText ou DateTime | ISO, posé par la route |
|
||||
|
||||
Les noms de colonnes doivent être exactement ceux-ci (la route écrit par nom).
|
||||
|
||||
## 2. La variable
|
||||
|
||||
Récupérer l'identifiant de la table (`m...`, dans l'URL NocoDB ou « Copy table id »), puis dans `/opt/aep/.env` :
|
||||
|
||||
```
|
||||
NUXT_INSCRIPTIONS_RUETZ_TABLE_ID=m...
|
||||
```
|
||||
|
||||
`NOCODB_URL`, `NOCODB_TOKEN`, `NOCODB_BASE` et `NTFY_TOPIC` y sont déjà. Redémarrer le service Nuxt.
|
||||
Ne jamais poser `AEP_INSCRIPTIONS_FIXTURE` en prod : elle bascule l'écriture vers un fichier local (captures seulement).
|
||||
|
||||
## 3. Test bout en bout (une inscription réelle, puis l'effacer)
|
||||
|
||||
1. `curl -s https://event.trans-former.fr/api/evenements/places?page=codev` → `"disponible": true`, `"inscrits": 2` (table vide : le compte part de `codev.dejaInscrits`, Jules et Estelle ; le complet tombe à 14 lignes). **Liste d'attente (B26, 23/10)** : complet, le codev accepte encore les inscriptions (201, `attente: true`, notification « [Ruetz] Liste d'attente ») ; dans la table, les lignes codev au-delà de la 14e, triées par `created_at`, **sont** la liste d'attente. La forêt complète refuse (409). **Colonne `entree`** (SingleLineText, ajoutée à la table le 23/10 par l'API meta, avant le code qui l'écrit) : la réponse facultative du codev à « En ce moment, vous entrez plutôt par : S, M, XL ? », vide si non répondue.
|
||||
2. S'inscrire sur `event.trans-former.fr/ruetz/foret` avec ses propres coordonnées.
|
||||
3. La ligne apparaît dans NocoDB ; la notification ntfy dit « Ruetz forêt : 1 pers. » (ni prénom, ni email, ni téléphone, ni mot).
|
||||
4. Supprimer la ligne dans NocoDB. Le compteur du codev se met à jour en 60 s au plus (cache).
|
||||
|
||||
## 4. Export pour Jules et Estelle
|
||||
|
||||
NocoDB → table `inscriptions_ruetz` → vue grille → « Download » CSV ; ou une vue partagée **protégée par mot de passe**, en lecture seule, masquant `email` et `telephone` si le lien circule au-delà de Jules et Estelle.
|
||||
Données effacées le 31 décembre 2026 (engagement écrit sous les formulaires) : supprimer la table ou ses lignes à cette date.
|
||||
|
||||
## Ce qui n'est pas dans ce lot
|
||||
|
||||
- Pas de fermeture automatique au 6 novembre (« Inscriptions jusqu'au vendredi 6 novembre » affiché sur la page codev, pas appliqué) : fermer à la main si besoin en retirant la variable (les pages renvoient alors vers l'email).
|
||||
- Deux inscriptions simultanées à la 16e place peuvent passer toutes les deux (accepté).
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Expose au serveur la liste des chemins de pages (B23) : `#seo-routes`, lu par
|
||||
* server/routes/sitemap.xml.get.ts. Le sitemap suit ainsi les pages qui s'ajoutent
|
||||
* (/entree, la bascule B14, pages/evenements/) sans liste tenue à la main.
|
||||
* Module local : Nuxt enregistre seul les fichiers de modules/, rien à déclarer dans nuxt.config.ts.
|
||||
*/
|
||||
import { defineNuxtModule } from '@nuxt/kit'
|
||||
import type { NuxtPage } from '@nuxt/schema'
|
||||
|
||||
function aplatir(pages: NuxtPage[], parent = ''): string[] {
|
||||
const out: string[] = []
|
||||
for (const p of pages) {
|
||||
const chemin = p.path.startsWith('/') ? p.path : `${parent.replace(/\/$/, '')}/${p.path}`
|
||||
if (p.path !== '') out.push(chemin || '/')
|
||||
if (p.children?.length) out.push(...aplatir(p.children, chemin))
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
export default defineNuxtModule({
|
||||
meta: { name: 'seo-routes' },
|
||||
setup(_options, nuxt) {
|
||||
let chemins: string[] = []
|
||||
nuxt.hook('pages:extend', (pages) => {
|
||||
chemins = aplatir(pages)
|
||||
})
|
||||
nuxt.hook('nitro:config', (config) => {
|
||||
config.virtual = config.virtual || {}
|
||||
config.virtual['#seo-routes'] = () => `export default ${JSON.stringify(chemins)}`
|
||||
})
|
||||
},
|
||||
})
|
||||
@@ -3,6 +3,7 @@ export default defineNuxtConfig({
|
||||
|
||||
app: {
|
||||
head: {
|
||||
htmlAttrs: { lang: 'fr' },
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' },
|
||||
{ rel: 'icon', type: 'image/png', sizes: '32x32', href: '/favicon-32.png' },
|
||||
@@ -41,6 +42,7 @@ export default defineNuxtConfig({
|
||||
codevAdminPassword: 'admin2026', // NUXT_CODEV_ADMIN_PASSWORD
|
||||
ragPeUrl: process.env.RAG_PE_URL || 'http://localhost:9621',
|
||||
referencesTableId: process.env.REFERENCES_TABLE_ID || process.env.NUXT_REFERENCES_TABLE_ID || '',
|
||||
inscriptionsRuetzTableId: '', // NUXT_INSCRIPTIONS_RUETZ_TABLE_ID — table NocoDB inscriptions_ruetz (lot Y)
|
||||
public: {
|
||||
cartoKey: '', // NUXT_PUBLIC_CARTO_KEY — clé CARTO Basemaps (gratuite), lue au runtime
|
||||
},
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"test": "node scripts/test-echelles-nav.mjs && node scripts/test-figures.mjs && node scripts/test-vue-fiches.mjs && node scripts/test-submit-libre.mjs && node scripts/test-circuit-breaker.mjs && node scripts/test-bandeau.mjs && node scripts/test-outils-data.mjs && node scripts/test-citations.mjs && node scripts/test-seo.mjs && node scripts/test-y.mjs && node --test \"worker/test/*.test.js\"",
|
||||
"postinstall": "nuxt prepare"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -185,6 +185,12 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- B10-M5 : Signaler a quitté la barre d'ordinateur ; il reste ici, dans le menu et dans chaque fiche -->
|
||||
<p class="section-text apropos-pied">
|
||||
Une fiche fausse, un lien mort, un contenu à retirer ?
|
||||
<NuxtLink to="/signaler">Signaler un problème</NuxtLink>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -270,6 +276,18 @@ function copyApiUrl() {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
.apropos-pied {
|
||||
padding-top: var(--space-md);
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.apropos-pied a {
|
||||
color: var(--text);
|
||||
font-weight: var(--fw-semibold);
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
|
||||
.section-intro {
|
||||
color: var(--nav-text-muted);
|
||||
margin-bottom: 1.25rem;
|
||||
|
||||
@@ -1,453 +1,105 @@
|
||||
<template>
|
||||
<div class="flex h-full overflow-hidden" style="background: var(--nav-bg);">
|
||||
<div class="relative h-full overflow-hidden" style="background: var(--nav-bg);">
|
||||
|
||||
<!-- ═══════════════════════════════════════ SIDEBAR DESKTOP (>= 1024px) -->
|
||||
<!-- Masquée en vue « Toutes les fiches » (B3-M3, décision Jules axe 2) :
|
||||
le panneau EST la liste (+ ses propres chips hashtags), la sidebar
|
||||
ferait doublon. IntentionBanner reste monté (Teleport, insensible au
|
||||
v-show de son conteneur). -->
|
||||
<div
|
||||
v-show="desktopMapView !== 'fiches'"
|
||||
class="hidden lg:block overflow-y-auto"
|
||||
style="width: 320px; min-width: 320px; flex-shrink: 0; border-right: 1px solid var(--nav-bg-alt); height: 100%;"
|
||||
<!-- IntentionBanner s'auto-affiche via Teleport (overlay plein écran) -->
|
||||
<IntentionBanner />
|
||||
|
||||
<!-- ═══════════════════════════════════════ VUE FICHES (B11) : Carte · Mixte · Fiches -->
|
||||
<VueFiches
|
||||
:vf="vf"
|
||||
intention="120 réseaux, collectifs et agences où des pensées écologiques deviennent des pratiques d'architecture."
|
||||
libelle-recherche="Rechercher une structure…"
|
||||
:pending="pending"
|
||||
:selected-id="selectedId"
|
||||
>
|
||||
|
||||
<!-- IntentionBanner s'auto-affiche via Teleport (overlay plein ecran) -->
|
||||
<IntentionBanner />
|
||||
|
||||
<!-- Filtres familles + hashtags -->
|
||||
<HashtagFilter
|
||||
:allHashtags="allHashtags"
|
||||
:selectedHashtags="selectedHashtags"
|
||||
:selectedFamille="selectedFamille"
|
||||
@update:selectedHashtags="selectedHashtags = $event"
|
||||
@update:selectedFamille="selectedFamille = $event"
|
||||
/>
|
||||
|
||||
<!-- Separateur -->
|
||||
<div style="height: 1px; background: var(--nav-bg-alt);"></div>
|
||||
|
||||
<!-- Barre de recherche -->
|
||||
<div class="px-3 py-2" style="border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<label class="sidebar-search-label" aria-label="Rechercher une structure">
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="sidebar-search-icon">
|
||||
<circle cx="11" cy="11" r="8"/>
|
||||
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
||||
</svg>
|
||||
<input
|
||||
v-model="search"
|
||||
type="search"
|
||||
placeholder="Rechercher une structure..."
|
||||
class="sidebar-search-input"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<button
|
||||
v-if="search"
|
||||
type="button"
|
||||
class="sidebar-search-clear"
|
||||
aria-label="Effacer"
|
||||
@click.stop="search = ''"
|
||||
>
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Header compteur + reset -->
|
||||
<div class="flex items-center justify-between px-4 py-2" style="border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<span class="text-xs font-bold uppercase tracking-widest" style="color: var(--nav-text-muted);">
|
||||
{{ filtered.length }} structure{{ filtered.length > 1 ? 's' : '' }}
|
||||
</span>
|
||||
<button
|
||||
v-if="hasActiveFilters"
|
||||
@click="resetFilters"
|
||||
class="text-xs underline hover:opacity-70"
|
||||
style="color: var(--nav-text-muted);"
|
||||
>Effacer les filtres</button>
|
||||
</div>
|
||||
|
||||
<!-- Liste fiches (sidebar entiere scroll - pas de scroll interne) -->
|
||||
<div class="px-3 py-2 space-y-1.5">
|
||||
<div v-if="pending" class="flex items-center justify-center py-8" style="color: var(--nav-text-muted);">
|
||||
Chargement...
|
||||
</div>
|
||||
<div v-else-if="filtered.length === 0" class="text-center py-8">
|
||||
<p class="text-xs" style="color: var(--nav-text-muted);">Aucun résultat</p>
|
||||
</div>
|
||||
<div
|
||||
v-for="structure in filtered"
|
||||
:key="structure.id"
|
||||
class="rounded-lg px-3 py-2 cursor-pointer transition-all"
|
||||
:style="selectedId === structure.id
|
||||
? `background: var(--nav-bg-alt); border-left: 3px solid ${familleColor(structure.famille_principale)}; padding-left: 9px;`
|
||||
: 'background: var(--nav-bg); border-left: 3px solid transparent; padding-left: 9px;'"
|
||||
@click="onSelectStructure(structure.id)"
|
||||
@mouseenter="hoveredId = structure.id"
|
||||
@mouseleave="hoveredId = null"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-1.5">
|
||||
<span class="font-semibold text-sm leading-snug" style="color: var(--nav-text);">{{ structure.nom }}</span>
|
||||
<span
|
||||
class="shrink-0 w-2.5 h-2.5 rounded-full mt-1"
|
||||
:style="`background: ${familleColor(structure.famille_principale)};`"
|
||||
/>
|
||||
</div>
|
||||
<div class="mt-0.5 text-xs" style="color: var(--nav-text-muted);">{{ structure.type_principal }} - {{ structure.ville }}</div>
|
||||
<ChipGroup v-if="structure.hashtags.length" class="mt-1" :aria-label="`Hashtags de ${structure.nom}`">
|
||||
<Chip
|
||||
v-for="tag in structure.hashtags.slice(0, 2)"
|
||||
:key="tag"
|
||||
as="span"
|
||||
variant="fonction"
|
||||
:label="tag"
|
||||
/>
|
||||
</ChipGroup>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════════════════════════════ ZONE CENTRALE (carte) -->
|
||||
<main class="flex-1 flex flex-col overflow-hidden relative">
|
||||
|
||||
<!-- ── VUE DESKTOP : Onglets Métro/Outre-mer ── -->
|
||||
<div class="hidden lg:flex lg:flex-1 lg:flex-col lg:overflow-hidden">
|
||||
<!-- Onglets desktop -->
|
||||
<div class="shrink-0 flex" style="background: var(--nav-surface); border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<button
|
||||
class="px-5 py-2 text-sm font-medium transition-colors"
|
||||
:style="desktopMapView === 'metropole'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setDesktopView('metropole')"
|
||||
>Métropolitain</button>
|
||||
<button
|
||||
class="px-5 py-2 text-sm font-medium transition-colors"
|
||||
:style="desktopMapView === 'outremer'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setDesktopView('outremer')"
|
||||
>Outre-mer</button>
|
||||
<button
|
||||
class="px-5 py-2 text-sm font-medium transition-colors"
|
||||
:style="desktopMapView === 'graphe'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setDesktopView('graphe')"
|
||||
>Vue graphique</button>
|
||||
<button
|
||||
class="px-5 py-2 text-sm font-medium transition-colors"
|
||||
:style="desktopMapView === 'fiches'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setDesktopView('fiches')"
|
||||
>Toutes les fiches</button>
|
||||
</div>
|
||||
|
||||
<!-- Carte Métropole desktop -->
|
||||
<div v-show="desktopMapView === 'metropole'" class="flex-1 flex flex-col overflow-hidden">
|
||||
<div class="relative flex-1" style="min-height: 200px;">
|
||||
<ClientOnly>
|
||||
<NavMapV2
|
||||
ref="navMapRef"
|
||||
:structures="metropoleStructures"
|
||||
:selectedId="selectedId"
|
||||
@select-structure="onSelectStructure"
|
||||
/>
|
||||
<template #fallback>
|
||||
<div
|
||||
class="w-full h-full flex items-center justify-center"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted);"
|
||||
>
|
||||
Chargement de la carte…
|
||||
</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
<ChatbotPlaceholder
|
||||
@highlightOrgs="() => {}"
|
||||
@applyHashtag="(tag) => { if (!selectedHashtags.includes(tag)) selectedHashtags = [...selectedHashtags, tag] }"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Carte Outre-mer desktop -->
|
||||
<div v-show="desktopMapView === 'outremer'" class="flex-1 overflow-y-auto" style="background: var(--nav-bg);">
|
||||
<ClientOnly>
|
||||
<OutremerMap
|
||||
:orgs="outremerOrgsLegacy"
|
||||
:selectedId="selectedIdLegacyNum"
|
||||
@select-org="() => {}"
|
||||
/>
|
||||
<template #fallback>
|
||||
<div class="flex items-center justify-center h-full text-sm" style="color: var(--nav-text-muted);">
|
||||
Chargement…
|
||||
</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
|
||||
<!-- Vue graphique desktop -->
|
||||
<div v-show="desktopMapView === 'graphe'" class="flex-1 overflow-hidden flex flex-col">
|
||||
<div class="flex-1 overflow-hidden relative">
|
||||
<ClientOnly>
|
||||
<GraphView
|
||||
:data="bifurcationData"
|
||||
:allHashtags="allHashtags"
|
||||
:active="desktopMapView === 'graphe'"
|
||||
@select-structure="onSelectStructure"
|
||||
/>
|
||||
<template #fallback>
|
||||
<div class="flex items-center justify-center h-full" style="color: var(--nav-text-muted);">
|
||||
Chargement du graphe...
|
||||
</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
<ChatbotPlaceholder
|
||||
@highlightOrgs="() => {}"
|
||||
@applyHashtag="(tag) => { if (!selectedHashtags.includes(tag)) selectedHashtags = [...selectedHashtags, tag] }"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Panneau « Toutes les fiches » desktop (B3-M3) — la sidebar est
|
||||
masquée dans cette vue (décision Jules axe 2), le panneau EST
|
||||
la liste, avec ses propres chips hashtags sur le même état. -->
|
||||
<div v-show="desktopMapView === 'fiches'" class="flex-1 flex flex-col overflow-hidden">
|
||||
<FichesPanel
|
||||
:fiches="allStructuresMini"
|
||||
:hashtags="allHashtags"
|
||||
:selected="selectedHashtags"
|
||||
:query="search"
|
||||
intention="Toutes les agences et réseaux du répertoire, filtrables par hashtag."
|
||||
@update:selected="selectedHashtags = $event"
|
||||
@open="(fiche) => onSelectStructure(String(fiche.id))"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ── VUE MOBILE : Onglets Métro/Outre-mer/Graphique/Fiches + sheet swipable ── -->
|
||||
<div class="lg:hidden shrink-0 flex" style="background: var(--nav-surface); border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<button
|
||||
class="flex-1 py-2 text-sm font-medium transition-colors"
|
||||
:style="mobileMapView === 'metropole'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setMobileView('metropole')"
|
||||
>Métropolitain</button>
|
||||
<button
|
||||
class="flex-1 py-2 text-sm font-medium transition-colors"
|
||||
:style="mobileMapView === 'outremer'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setMobileView('outremer')"
|
||||
>Outre-mer</button>
|
||||
<button
|
||||
class="flex-1 py-2 text-sm font-medium transition-colors"
|
||||
:style="mobileMapView === 'graphe'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setMobileView('graphe')"
|
||||
>Graphe</button>
|
||||
<button
|
||||
class="flex-1 py-2 text-sm font-medium transition-colors"
|
||||
:style="mobileMapView === 'fiches'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setMobileView('fiches')"
|
||||
>Fiches</button>
|
||||
</div>
|
||||
|
||||
<div class="lg:hidden flex-1 relative overflow-hidden">
|
||||
<!-- Carte mobile Métropole -->
|
||||
<div v-show="mobileMapView === 'metropole'" class="absolute inset-0">
|
||||
<template #carte>
|
||||
<!-- Métropole -->
|
||||
<div v-show="vf.etat.sousVue === 'metropole'" class="relative flex-1 min-h-0">
|
||||
<ClientOnly>
|
||||
<NavMapV2
|
||||
ref="navMapMobileRef"
|
||||
:structures="metropoleStructures"
|
||||
:selectedId="selectedId"
|
||||
@select-structure="onSelectStructureMobile"
|
||||
:survolId="vf.survolId == null ? null : String(vf.survolId)"
|
||||
:centrage="centrageCarte"
|
||||
@select-structure="onSelectStructure"
|
||||
@survol="(id) => (vf.survolId = id)"
|
||||
/>
|
||||
<template #fallback>
|
||||
<div class="w-full h-full flex items-center justify-center" style="background: var(--nav-bg-alt); color: var(--nav-text-muted);">
|
||||
Chargement de la carte…
|
||||
</div>
|
||||
<div class="w-full h-full flex items-center justify-center" style="background: var(--nav-bg-alt); color: var(--nav-text-muted);">Chargement de la carte…</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
|
||||
<!-- Carte mobile Outre-mer -->
|
||||
<div v-show="mobileMapView === 'outremer'" class="absolute inset-0 overflow-y-auto" style="background: var(--nav-bg);">
|
||||
<!-- Outre-mer : pas de structure V2 en DOM-TOM pour l'instant (composant gardé vide) -->
|
||||
<div v-show="vf.etat.sousVue === 'outremer'" class="flex-1 min-h-0 overflow-y-auto" style="background: var(--nav-bg);">
|
||||
<ClientOnly>
|
||||
<OutremerMap
|
||||
:orgs="outremerOrgsLegacy"
|
||||
:selectedId="selectedIdLegacyNum"
|
||||
@select-org="() => {}"
|
||||
/>
|
||||
<OutremerMap :orgs="[]" :selectedId="null" @select-org="() => {}" />
|
||||
<template #fallback>
|
||||
<div class="flex items-center justify-center h-48" style="color: var(--nav-text-muted);">
|
||||
Chargement…
|
||||
</div>
|
||||
<div class="flex items-center justify-center h-48 text-sm" style="color: var(--nav-text-muted);">Chargement…</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
|
||||
<!-- Vue graphique mobile -->
|
||||
<div v-show="mobileMapView === 'graphe'" class="absolute inset-0 overflow-hidden" style="background: var(--nav-bg);">
|
||||
<!-- Vue graphique -->
|
||||
<div v-show="vf.etat.sousVue === 'graphe'" class="relative flex-1 min-h-0 overflow-hidden">
|
||||
<ClientOnly>
|
||||
<GraphView
|
||||
:data="bifurcationData"
|
||||
:allHashtags="allHashtags"
|
||||
:active="mobileMapView === 'graphe'"
|
||||
@select-structure="onSelectStructureMobile"
|
||||
:active="vf.etat.sousVue === 'graphe' && vf.vueAffichee !== 'fiches'"
|
||||
@select-structure="onSelectStructure"
|
||||
/>
|
||||
<template #fallback>
|
||||
<div class="flex items-center justify-center h-48" style="color: var(--nav-text-muted);">
|
||||
Chargement du graphe…
|
||||
</div>
|
||||
<div class="flex items-center justify-center h-full" style="color: var(--nav-text-muted);">Chargement du graphe…</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
|
||||
<!-- Zone « Fiches » mobile (B3-M3) — pleine hauteur sous la barre d'onglets,
|
||||
pas de carte dessous donc pas de sheet demi-hauteur (même logique que
|
||||
la vue graphe qui masque déjà le MobileSheet). Fix 2026-09-25 : la
|
||||
version précédente empilait un second MobileSheet (état half par
|
||||
défaut) au-dessus d'un fond neutre plein écran, laissant ~45% de
|
||||
hauteur vide au-dessus du panneau. -->
|
||||
<div
|
||||
v-show="mobileMapView === 'fiches'"
|
||||
class="absolute inset-0 flex flex-col overflow-hidden"
|
||||
style="background: var(--nav-bg-alt);"
|
||||
>
|
||||
<FichesPanel
|
||||
:fiches="allStructuresMini"
|
||||
:hashtags="allHashtags"
|
||||
:selected="selectedHashtags"
|
||||
:query="search"
|
||||
intention="Toutes les agences et réseaux du répertoire, filtrables par hashtag."
|
||||
@update:selected="selectedHashtags = $event"
|
||||
@open="(fiche) => onSelectStructureMobile(String(fiche.id))"
|
||||
<!-- Chatbot sous la carte (ordinateur) -->
|
||||
<div v-if="vf.etat.sousVue !== 'outremer'" class="hidden lg:block shrink-0">
|
||||
<ChatbotPlaceholder
|
||||
endpoint="/api/chatbot-reseaux"
|
||||
chat-key="agences"
|
||||
titre="Assistant Réseaux AEP"
|
||||
placeholder-replie="Pose une question sur les structures et agences du réseau…"
|
||||
placeholder-saisie="Décris ta situation…"
|
||||
intro="Je connais les 120 réseaux, collectifs et agences cartographiés dans AEP — ceux qui portent une vision écologique et politique de l'architecture. Décris ta situation : tu cherches un collectif, une agence inspirante, un partenaire sur un projet ?"
|
||||
exemple="Exemple : « Quelles agences travaillent sur le réemploi ? »"
|
||||
fiches-titre="Structures recommandées :"
|
||||
fiche-lien-modele="/agences#{id}"
|
||||
rendre-markdown
|
||||
message-limite="Limite de 20 questions par jour atteinte."
|
||||
@highlightOrgs="() => {}"
|
||||
@applyHashtag="(tag) => vf.ajouterFiltre('tags', sansDiese(tag))"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Bottom sheet swipable (masqué en vue graphique et en vue fiches) -->
|
||||
<ClientOnly v-if="mobileMapView !== 'graphe' && mobileMapView !== 'fiches'">
|
||||
<MobileSheet :resultCount="filtered.length" :pending="pending">
|
||||
<!-- Bandeau intention mobile -->
|
||||
<div class="px-3 py-2" style="background: var(--bifurc-banner-bg, #faf8f5); border-bottom: 1px solid var(--bifurc-banner-border, #e0d8cc);">
|
||||
<p class="text-xs leading-relaxed" style="color: var(--bifurc-banner-text, #2c2416); margin: 0;">
|
||||
120 réseaux, collectifs et agences où des pensées écologiques deviennent des pratiques d'architecture.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Filtres hashtags mobile -->
|
||||
<div class="px-3 py-2" style="border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<HashtagFilter
|
||||
:allHashtags="allHashtags"
|
||||
:selectedHashtags="selectedHashtags"
|
||||
:selectedFamille="selectedFamille"
|
||||
@update:selectedHashtags="selectedHashtags = $event"
|
||||
@update:selectedFamille="selectedFamille = $event"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Barre recherche mobile -->
|
||||
<div class="px-3 pt-2 pb-2" style="border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<label class="mobile-search-label" aria-label="Rechercher une structure">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="color: var(--nav-text-muted); flex-shrink: 0;">
|
||||
<circle cx="11" cy="11" r="8"/>
|
||||
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
||||
</svg>
|
||||
<input
|
||||
v-model="search"
|
||||
type="search"
|
||||
placeholder="Rechercher…"
|
||||
class="mobile-search-input"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<button
|
||||
v-if="search"
|
||||
type="button"
|
||||
class="mobile-search-clear"
|
||||
aria-label="Effacer"
|
||||
@click.stop="search = ''"
|
||||
>
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</label>
|
||||
<button
|
||||
v-if="hasActiveFilters"
|
||||
@click="resetFilters"
|
||||
class="mt-1 text-xs"
|
||||
style="color: var(--nav-text-muted); text-decoration: underline;"
|
||||
>Effacer les filtres</button>
|
||||
</div>
|
||||
|
||||
<!-- Liste fiches mobile -->
|
||||
<div class="px-3 py-2">
|
||||
<div class="text-xs font-bold uppercase tracking-wide mb-2" style="color: var(--nav-text-muted);">
|
||||
{{ filtered.length }} structure{{ filtered.length > 1 ? 's' : '' }}
|
||||
</div>
|
||||
<div v-if="pending" class="flex items-center justify-center py-8" style="color: var(--nav-text-muted);">
|
||||
Chargement des fiches…
|
||||
</div>
|
||||
<div v-else-if="filtered.length === 0" class="text-center py-8">
|
||||
<p class="text-sm mb-2" style="color: var(--nav-text-muted);">Aucun résultat pour ces filtres.</p>
|
||||
<button @click="resetFilters" class="text-sm underline" style="color: var(--nav-primary-solid);">
|
||||
Effacer les filtres
|
||||
</button>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<div
|
||||
v-for="structure in filtered"
|
||||
:key="structure.id"
|
||||
class="block rounded-lg p-3 transition-all cursor-pointer"
|
||||
:style="selectedId === structure.id
|
||||
? `background: var(--nav-bg-alt); border-left: 3px solid ${familleColor(structure.famille_principale)};`
|
||||
: 'background: var(--nav-surface); border-left: 3px solid transparent;'"
|
||||
@click="onSelectStructureMobile(structure.id)"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-2">
|
||||
<span class="font-semibold text-sm leading-snug" style="color: var(--nav-text);">{{ structure.nom }}</span>
|
||||
<span
|
||||
class="shrink-0 w-2.5 h-2.5 rounded-full mt-1"
|
||||
:style="`background: ${familleColor(structure.famille_principale)};`"
|
||||
/>
|
||||
</div>
|
||||
<div class="mt-0.5 text-xs" style="color: var(--nav-text-muted);">{{ structure.type_principal }} · {{ structure.ville }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</MobileSheet>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- ═══════════════════════════════════════ MODAL FICHE V2 (desktop) -->
|
||||
<FicheModalV2
|
||||
v-model="ficheModalOpen"
|
||||
:structureId="ficheModalId"
|
||||
:data="bifurcationData"
|
||||
@update:structureId="ficheModalId = $event"
|
||||
/>
|
||||
<!-- Détail (B12) : le corps de l'ancienne FicheModalV2 ; une structure liée s'ouvre dans le même panneau -->
|
||||
<template #detail="{ fiche, filtrer }">
|
||||
<FicheReseauContenu
|
||||
:structure-id="String(fiche.id)"
|
||||
:data="bifurcationData"
|
||||
:etiquettes-actives="(vf.etat.filtres.tags ?? []).map((t) => `#${t}`)"
|
||||
@etiquette="(tag) => filtrer('tags', sansDiese(tag))"
|
||||
@voisin="(id) => vf.ouvrirFiche(id)"
|
||||
/>
|
||||
</template>
|
||||
</VueFiches>
|
||||
|
||||
<!-- ═══════════════════════════════════════ BOUTON CHATBOT FLOTTANT (mobile) -->
|
||||
<button
|
||||
class="lg:hidden fixed bottom-6 right-4 z-[1000] flex items-center gap-2 px-4 rounded-full shadow-lg"
|
||||
style="
|
||||
class="lg:hidden fixed right-4 z-[1000] flex items-center gap-2 px-4 rounded-full shadow-lg"
|
||||
:style="`
|
||||
bottom: ${basFlottants}px;
|
||||
height: 48px;
|
||||
background: var(--nav-primary);
|
||||
opacity: 0.92;
|
||||
background: var(--nav-primary-solid);
|
||||
color: var(--nav-text-on-primary);
|
||||
box-shadow: 0 4px 16px rgba(26,34,56,0.25);
|
||||
font-family: var(--nav-font);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
"
|
||||
`"
|
||||
aria-label="Ouvrir l'assistant Chatbot"
|
||||
@click="chatbotOpen = true"
|
||||
>
|
||||
@@ -467,6 +119,7 @@
|
||||
<button
|
||||
class="reseaux-info-btn"
|
||||
type="button"
|
||||
:style="vf.largeur === 'telephone' ? `bottom: ${basFlottants}px;` : undefined"
|
||||
@click="missionOpen = true"
|
||||
aria-label="À propos des réseaux AEP cartographiés"
|
||||
title="À propos de cette carte"
|
||||
@@ -490,7 +143,7 @@
|
||||
Cette carte rassemble <strong>120 réseaux, collectifs et agences</strong> qui pratiquent une architecture engagée — écologique, politique, biorégionale. Ce ne sont pas seulement des agences « vertes » : ce sont celles et ceux qui assument des positions, refusent des projets, expérimentent des modèles de gouvernance, mettent leurs ressources et leurs savoirs en commun.
|
||||
</p>
|
||||
<p class="mission-text">
|
||||
Six familles structurent la cartographie : militants, agences engagées, collectifs de production, ressources communes, recherche, formations alternatives. Filtre par hashtag, ouvre la fiche d'une structure, navigue le graphe (3<sup>e</sup> onglet) pour voir les affinités. Si tu animes ou connais un réseau qui devrait y être : <NuxtLink to="/contribuer" @click.stop>propose-le</NuxtLink>.
|
||||
Six familles structurent la cartographie : militants, agences engagées, collectifs de production, ressources communes, recherche, formations alternatives. Filtre par hashtag, ouvre la fiche d'une structure, navigue le graphe (« Vue graphique » dans le sélecteur de carte) pour voir les affinités. Si tu animes ou connais un réseau qui devrait y être : <NuxtLink to="/contribuer" @click.stop>propose-le</NuxtLink>.
|
||||
</p>
|
||||
</MissionPopup>
|
||||
|
||||
@@ -499,73 +152,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ReseauxBifurcationData, StructureV2 } from '~/types/structure-v2'
|
||||
|
||||
// ── Couleurs familles ──────────────────────────────────────────────────────
|
||||
const FAMILLE_COLORS: Record<number, string> = {
|
||||
1: '#a85d3e',
|
||||
2: '#c4a472',
|
||||
3: '#d4a017',
|
||||
4: '#5a7a4a',
|
||||
5: '#3d6a8c',
|
||||
6: '#6b3fa0',
|
||||
}
|
||||
|
||||
function familleColor(f: number): string {
|
||||
return FAMILLE_COLORS[f] ?? '#888'
|
||||
}
|
||||
|
||||
// ── État UI ────────────────────────────────────────────────────────────────
|
||||
type MapView = 'metropole' | 'outremer' | 'graphe' | 'fiches'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
const selectedId = ref<string | null>(null)
|
||||
const hoveredId = ref<string | null>(null)
|
||||
const ficheModalOpen = ref(false)
|
||||
const ficheModalId = ref<string | null>(null)
|
||||
const chatbotOpen = ref(false)
|
||||
const mobileMapView = ref<MapView>((route.query.vue as string) === 'fiches' ? 'fiches' : 'metropole')
|
||||
const desktopMapView = ref<MapView>((route.query.vue as string) === 'fiches' ? 'fiches' : 'metropole')
|
||||
const missionOpen = ref(false)
|
||||
|
||||
// Sync URL — B3-M3 : pose/retire ?vue=fiches uniquement (agences.vue n'avait
|
||||
// aucune synchronisation URL avant B3 pour search/famille/hashtags/vue ; hors
|
||||
// périmètre de cette mission de l'étendre, seul ?vue=fiches est ajouté ici).
|
||||
function setDesktopView(v: MapView) {
|
||||
desktopMapView.value = v
|
||||
syncViewUrl()
|
||||
}
|
||||
function setMobileView(v: MapView) {
|
||||
mobileMapView.value = v
|
||||
syncViewUrl()
|
||||
}
|
||||
function syncViewUrl() {
|
||||
const q: Record<string, string> = { ...(route.query as Record<string, string>) }
|
||||
if (desktopMapView.value === 'fiches' || mobileMapView.value === 'fiches') {
|
||||
q.vue = 'fiches'
|
||||
} else {
|
||||
delete q.vue
|
||||
}
|
||||
router.replace({ query: Object.keys(q).length ? q : undefined })
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
try {
|
||||
if (!localStorage.getItem('aep_reseaux_seen')) {
|
||||
missionOpen.value = true
|
||||
}
|
||||
} catch {}
|
||||
})
|
||||
|
||||
// Filtres
|
||||
const search = ref('')
|
||||
const selectedFamille = ref<number | null>(null)
|
||||
const selectedHashtags = ref<string[]>([])
|
||||
|
||||
// Refs cartes
|
||||
const navMapRef = ref<any>(null)
|
||||
const navMapMobileRef = ref<any>(null)
|
||||
import type { ConfigVueFiches, ValeurFiltre } from '~/utils/vueFiches'
|
||||
import { sansDiese } from '~/composables/useFicheAdapter'
|
||||
|
||||
// ── Données V2 - JSON statique ─────────────────────────────────────────────
|
||||
const bifurcationData = ref<ReseauxBifurcationData | null>(null)
|
||||
@@ -583,91 +171,98 @@ onMounted(async () => {
|
||||
|
||||
const structures = computed<StructureV2[]>(() => bifurcationData.value?.structures ?? [])
|
||||
|
||||
// Tous les hashtags uniques triés
|
||||
// Tous les hashtags uniques triés (le graphe les attend avec leur « # »)
|
||||
const allHashtags = computed<string[]>(() => {
|
||||
const set = new Set<string>()
|
||||
structures.value.forEach(s => s.hashtags.forEach(h => set.add(h)))
|
||||
return Array.from(set).sort()
|
||||
})
|
||||
|
||||
// ── Filtrage ───────────────────────────────────────────────────────────────
|
||||
const filtered = computed<StructureV2[]>(() => {
|
||||
let result = structures.value
|
||||
// ── Vue fiches (B11) : l'état vit dans l'URL (tags=, famille=, carte=…) ────
|
||||
// Familles : 1-5 = famille principale ou secondaire, 6 = badge « recherche politique »
|
||||
const FAMILLES: ValeurFiltre[] = [
|
||||
{ valeur: '1', libelle: 'Réemploi' },
|
||||
{ valeur: '2', libelle: 'Frugalité' },
|
||||
{ valeur: '3', libelle: 'Social' },
|
||||
{ valeur: '4', libelle: 'Collectifs' },
|
||||
{ valeur: '5', libelle: 'Urbanisme' },
|
||||
{ valeur: '6', libelle: 'Recherche' },
|
||||
]
|
||||
const PAYS: Record<string, string> = {
|
||||
FR: 'France', BE: 'Belgique', DE: 'Allemagne', UK: 'Royaume-Uni', ES: 'Espagne', IT: 'Italie',
|
||||
PT: 'Portugal', CH: 'Suisse', AT: 'Autriche', DK: 'Danemark', PL: 'Pologne', NL: 'Pays-Bas',
|
||||
SE: 'Suède', USA: 'États-Unis', INT: 'International',
|
||||
}
|
||||
|
||||
// Filtre texte
|
||||
if (search.value.trim()) {
|
||||
const q = search.value.toLowerCase()
|
||||
result = result.filter(
|
||||
s =>
|
||||
s.nom.toLowerCase().includes(q) ||
|
||||
s.ville.toLowerCase().includes(q) ||
|
||||
s.description_courte.toLowerCase().includes(q) ||
|
||||
s.hashtags.some(h => h.toLowerCase().includes(q))
|
||||
)
|
||||
}
|
||||
/** Valeurs d'une étiquette, de la plus fréquente à la plus rare (ordre stable des chips et des groupes). */
|
||||
function parFrequence(cle: (s: StructureV2) => string[], libelle: (v: string) => string): ValeurFiltre[] {
|
||||
const n = new Map<string, number>()
|
||||
structures.value.forEach(s => cle(s).forEach(v => n.set(v, (n.get(v) ?? 0) + 1)))
|
||||
return [...n.entries()]
|
||||
.sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0], 'fr'))
|
||||
.map(([v]) => ({ valeur: v, libelle: libelle(v) }))
|
||||
}
|
||||
|
||||
// Filtre famille - F6 = badge_f6_recherche_politique, pas famille_principale
|
||||
if (selectedFamille.value !== null) {
|
||||
if (selectedFamille.value === 6) {
|
||||
result = result.filter(s => (s.badges as any)?.f6_recherche_politique === true)
|
||||
} else {
|
||||
result = result.filter(
|
||||
s => s.famille_principale === selectedFamille.value ||
|
||||
(s.familles_secondaires ?? []).includes(selectedFamille.value!)
|
||||
)
|
||||
}
|
||||
}
|
||||
const config = computed<ConfigVueFiches>(() => ({
|
||||
dimensions: [
|
||||
{
|
||||
cle: 'tags', libelle: 'Hashtag', variante: 'fonction',
|
||||
valeurs: parFrequence(s => s.hashtags.map(sansDiese), v => `#${v}`),
|
||||
},
|
||||
{ cle: 'famille', libelle: 'Famille', variante: 'echelle', valeurs: FAMILLES },
|
||||
],
|
||||
tris: ['pertinence', 'nom'],
|
||||
groupes: [
|
||||
{ cle: 'famille', libelle: 'Famille', dimension: 'famille', sans: 'Sans famille' },
|
||||
{ cle: 'pays', libelle: 'Pays', dimension: 'pays', sans: 'Pays inconnu', valeurs: parFrequence(s => [s.pays], v => PAYS[v] ?? v) },
|
||||
],
|
||||
etats: ['carte', 'mixte', 'fiches'],
|
||||
sousVues: {
|
||||
parametre: 'carte',
|
||||
defaut: 'metropole',
|
||||
valeurs: [
|
||||
{ valeur: 'metropole', libelle: 'Métropole' },
|
||||
{ valeur: 'outremer', libelle: 'Outre-mer' },
|
||||
{ valeur: 'graphe', libelle: 'Vue graphique' },
|
||||
],
|
||||
},
|
||||
}))
|
||||
|
||||
// Filtre hashtags (AND logique si plusieurs)
|
||||
if (selectedHashtags.value.length) {
|
||||
result = result.filter(
|
||||
s => selectedHashtags.value.every(h => s.hashtags.includes(h))
|
||||
)
|
||||
}
|
||||
const { toMini } = useFicheAdapter()
|
||||
const fichesMini = computed(() => structures.value.map((s) => toMini(s)))
|
||||
const vf = useVueFiches(fichesMini, config)
|
||||
|
||||
return result
|
||||
// La carte ne montre que le résultat courant (recherche + filtres)
|
||||
const metropoleStructures = computed<StructureV2[]>(() => structures.value.filter((s) => vf.idsResultat.has(s.id)))
|
||||
|
||||
// ── Sélection (B12) : la fiche ouverte vit dans l'URL (`fiche=`), détail en panneau ──
|
||||
const selectedId = computed<string | null>(() => vf.ficheId)
|
||||
|
||||
function onSelectStructure(id: string) {
|
||||
vf.ouvrirFiche(id)
|
||||
}
|
||||
|
||||
// « Voir sur la carte » : l'épingle est sur la carte Métropole (pas dans le graphe)
|
||||
const centrageCarte = ref<{ id: string; n: number } | null>(null)
|
||||
watch(() => vf.centrage, (c) => {
|
||||
if (!c) return
|
||||
if (vf.etat.sousVue !== 'metropole') vf.setSousVue('metropole')
|
||||
centrageCarte.value = { id: c.id, n: c.n }
|
||||
})
|
||||
|
||||
const hasActiveFilters = computed(
|
||||
() => !!search.value || selectedFamille.value !== null || selectedHashtags.value.length > 0
|
||||
)
|
||||
// ── Boutons flottants (téléphone) : au-dessus du pied « Voir les N fiches » en état Carte ──
|
||||
const chatbotOpen = ref(false)
|
||||
const missionOpen = ref(false)
|
||||
const basFlottants = computed(() => (vf.largeur === 'telephone' && vf.vueAffichee === 'carte' ? 76 : 24))
|
||||
|
||||
function resetFilters() {
|
||||
search.value = ''
|
||||
selectedFamille.value = null
|
||||
selectedHashtags.value = []
|
||||
}
|
||||
onMounted(() => {
|
||||
try {
|
||||
if (!localStorage.getItem('aep_reseaux_seen')) missionOpen.value = true
|
||||
} catch {}
|
||||
})
|
||||
|
||||
// Structures métropole (pays != DOM-TOM, et avec coordonnées)
|
||||
// Pour simplifier : toutes les structures (la carte gère les sans-coords)
|
||||
const metropoleStructures = computed<StructureV2[]>(() => filtered.value)
|
||||
|
||||
// Panneau « Toutes les fiches » (B3-M3) — mêmes structures que `filtered`,
|
||||
// sans filtrer par géolocalisation (adaptateur mutualisé avec `/`).
|
||||
const { toMini } = useFicheAdapter()
|
||||
const allStructuresMini = computed(() => filtered.value.map((s) => toMini(s)))
|
||||
|
||||
// Outre-mer : pas de structures V2 DOM-TOM pour l'instant - garder le composant existant vide
|
||||
// OutremerMap attend le format Org legacy - on passe un tableau vide
|
||||
const outremerOrgsLegacy = computed(() => [])
|
||||
const selectedIdLegacyNum = computed(() => null)
|
||||
|
||||
// ── Sélection ─────────────────────────────────────────────────────────────
|
||||
function onSelectStructure(id: string) {
|
||||
selectedId.value = selectedId.value === id ? null : id
|
||||
if (typeof window !== 'undefined' && window.innerWidth >= 1024) {
|
||||
ficheModalId.value = id
|
||||
ficheModalOpen.value = true
|
||||
}
|
||||
}
|
||||
|
||||
function onSelectStructureMobile(id: string) {
|
||||
selectedId.value = id
|
||||
ficheModalId.value = id
|
||||
ficheModalOpen.value = true
|
||||
}
|
||||
|
||||
useHead({ title: "AEP - Réseaux de bifurcation architecturale" })
|
||||
// Une fiche ouverte donne son nom à l'onglet (les données arrivent après le rendu serveur ici)
|
||||
useHead({ title: computed(() => (vf.ficheOuverte ? `${vf.ficheOuverte.nom} — AEP` : 'AEP - Réseaux de bifurcation architecturale')) })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -692,6 +287,6 @@ useHead({ title: "AEP - Réseaux de bifurcation architecturale" })
|
||||
.reseaux-info-btn:hover { opacity: 0.85; transform: translateY(-1px); color: var(--nav-text); }
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.reseaux-info-btn { bottom: 16px; left: 340px; }
|
||||
.reseaux-info-btn { bottom: 10px; left: auto; right: 52px; }
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,382 @@
|
||||
<!--
|
||||
/entree — B13-M5, B13b-M2. L'entrée du site par le schéma S / M / XL (CONCEPTION du 11/10).
|
||||
Une page, trois états, l'URL fait foi (`?porte=`) :
|
||||
0 · schéma : les trois anneaux, la phrase de la slide 16, trois portes ;
|
||||
1 · porte ouverte : le schéma reste, réduit, le bandeau S M XL, la section de l'échelle ;
|
||||
1' · latéral : d'une porte à l'autre, en `replace`.
|
||||
Au clavier, porte ouverte : ← et → passent aux voisines, Échap revient au schéma.
|
||||
Mouvement (B13-M6, B13b-M2), CSS seul : apparition du schéma à la première visite (≤ 900 ms).
|
||||
Ouvrir une porte ne remplace plus le schéma (retour de Jules du 13/10), on reste dans la
|
||||
continuité : au téléphone, la figure rétrécit à 40 % (280 ms) et la section se déplie dessous
|
||||
(hauteur 0fr → 1fr) ; au bureau, la figure glisse en se réduisant vers la colonne de gauche
|
||||
(FLIP : la position de départ est mesurée, puis `transform` seul, 350 ms) et la section se
|
||||
déplie à droite. Fermer inverse le geste. Latéral 280 ms (±24 %).
|
||||
Partir (B13b-M4) : un bouton de la porte qui mène hors de l'entrée replie d'abord la section
|
||||
vers le haut (220 ms, hauteur → 0 et fondu ; au téléphone la figure réduite aussi), le bandeau
|
||||
reste ; la navigation part à la fin de la transition, 300 ms au plus.
|
||||
Sous `prefers-reduced-motion` : état final, échange immédiat.
|
||||
Sur /entree tant que Jules n'a pas dit oui à la bascule de / (B14) : / reste la carte.
|
||||
Rien de lourd ici : ni Leaflet, ni données, ni chatbot, ni d3.
|
||||
-->
|
||||
<template>
|
||||
<div ref="racine" class="entree" :class="{ 'entree--ouverte': porte, 'entree--repli': repli }">
|
||||
<!-- Bureau : la colonne de gauche (figure réduite + bandeau), collante ; au téléphone elle s'efface (display: contents). -->
|
||||
<div class="entree__gauche">
|
||||
<SchemaEchelles
|
||||
taille="grand"
|
||||
:reduit="Boolean(porte)"
|
||||
:actif="porte"
|
||||
:apparition="premiere && !porte"
|
||||
class="entree__schema"
|
||||
@fermer="fermer"
|
||||
>
|
||||
<template #avant>
|
||||
<h1 class="entree__titre">{{ CADRE.titre }}</h1>
|
||||
</template>
|
||||
<template #apres>
|
||||
<p class="entree__cadre">{{ CADRE.suite }}</p>
|
||||
</template>
|
||||
</SchemaEchelles>
|
||||
|
||||
<Transition name="entree-bandeau" :css="!mouvementReduit">
|
||||
<div v-if="porte" class="entree__mini">
|
||||
<div class="entree__mini-dedans">
|
||||
<SchemaEchelles taille="mini" :actif="porte" @fermer="fermer" />
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
|
||||
<Transition name="entree-deplier" :css="!mouvementReduit">
|
||||
<div v-if="porte" class="entree__deplie">
|
||||
<div class="entree__scene">
|
||||
<Transition :name="`entree-lateral-${sens === 'arriere' ? 'arriere' : 'avant'}`" :css="!mouvementReduit">
|
||||
<SectionEchelle :key="porte" :echelle="porte" @partir="partir" />
|
||||
</Transition>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ECHELLES, ECHELLES_CADRE } from '~/utils/echelles'
|
||||
import SchemaEchelles from '~/components/entree/SchemaEchelles.vue'
|
||||
import SectionEchelle from '~/components/entree/SectionEchelle.vue'
|
||||
import { SCRIPT_ENTREE_VUE } from '~/composables/useEntree'
|
||||
|
||||
/** La phrase de la slide 16 en deux temps : le titre, puis la suite sous les portes. */
|
||||
const CADRE = (() => {
|
||||
const [titre, ...suite] = ECHELLES_CADRE.match(/[^.]+\./g) ?? [ECHELLES_CADRE]
|
||||
return { titre: titre.trim(), suite: suite.map((p) => p.trim()).join(' ') }
|
||||
})()
|
||||
|
||||
const { porte, sens, lateral, fermer, premiere, mouvementReduit, schemaAffiche } = useEntree()
|
||||
const route = useRoute()
|
||||
|
||||
useHead(() => ({
|
||||
title: porte.value ? `${porte.value} · ${ECHELLES[porte.value].titre} — AEP` : `${CADRE.titre.replace(/\.$/, '')} — AEP`,
|
||||
meta: [{ name: 'description', content: porte.value ? ECHELLES[porte.value].phrase : ECHELLES_CADRE }],
|
||||
}))
|
||||
// Avant le premier rendu : si l'apparition a déjà été vue, `html.entree-vue` l'éteint (CSS).
|
||||
useHead({ script: [{ key: 'aep-entree-vue', innerHTML: SCRIPT_ENTREE_VUE, tagPosition: 'head' }] })
|
||||
|
||||
const racine = ref<HTMLElement | null>(null)
|
||||
|
||||
/** Remet le haut de l'entrée à l'écran : la page défile dans le conteneur d'app.vue, pas dans la fenêtre. */
|
||||
function remonter() {
|
||||
let el = racine.value?.parentElement ?? null
|
||||
while (el) {
|
||||
const oy = getComputedStyle(el).overflowY
|
||||
if ((oy === 'auto' || oy === 'scroll') && el.scrollTop > 0) el.scrollTop = 0
|
||||
el = el.parentElement
|
||||
}
|
||||
if (window.scrollY > 0) window.scrollTo(0, 0)
|
||||
}
|
||||
|
||||
// ── Glissement de la figure au bureau (B13b-M2) ──
|
||||
const BUREAU = '(min-width: 1024px)'
|
||||
/** Durée du glissement (FLIP), dans la limite de 400 ms du brief. */
|
||||
const DUREE_GLISSE = 350
|
||||
|
||||
/**
|
||||
* FLIP : la figure a déjà sa nouvelle place (après le rendu) ; on la remet visuellement là
|
||||
* où elle était (`avant`) par un `transform`, puis on laisse la transition CSS la ramener.
|
||||
* Rien ne bouge dans la mise en page pendant le mouvement : seul `transform` est animé.
|
||||
*/
|
||||
function glisser(el: HTMLElement, avant: DOMRect) {
|
||||
const apres = el.getBoundingClientRect()
|
||||
if (!apres.width || !avant.width) return
|
||||
const dx = avant.left - apres.left
|
||||
const dy = avant.top - apres.top
|
||||
const s = avant.width / apres.width
|
||||
if (Math.abs(dx) < 1 && Math.abs(dy) < 1 && Math.abs(s - 1) < 0.01) return
|
||||
el.style.transformOrigin = '0 0'
|
||||
el.style.transition = 'none'
|
||||
el.style.transform = `translate(${dx}px, ${dy}px) scale(${s})`
|
||||
void el.offsetWidth
|
||||
el.style.transition = `transform ${DUREE_GLISSE}ms var(--ease-out)`
|
||||
el.style.transform = ''
|
||||
let fini = false
|
||||
const finir = (ev?: TransitionEvent) => {
|
||||
if (ev && (ev.target !== el || ev.propertyName !== 'transform')) return
|
||||
if (fini) return
|
||||
fini = true
|
||||
el.removeEventListener('transitionend', finir)
|
||||
el.style.transition = ''
|
||||
el.style.transformOrigin = ''
|
||||
}
|
||||
el.addEventListener('transitionend', finir)
|
||||
setTimeout(finir, DUREE_GLISSE + 50)
|
||||
}
|
||||
|
||||
// Ouvrir / fermer : la figure glisse (bureau) ; focus sur le titre de la porte qui s'ouvre,
|
||||
// au retour sur la porte d'où l'on vient. Le watcher passe avant le rendu : la position
|
||||
// de départ de la figure est mesurée avant que la page ne change de mise en page.
|
||||
watch(porte, async (n, o) => {
|
||||
if (!import.meta.client) return
|
||||
const bascule = Boolean(n) !== Boolean(o)
|
||||
const figure = bascule && !mouvementReduit.value && window.matchMedia(BUREAU).matches
|
||||
? racine.value?.querySelector<HTMLElement>('.entree__schema .schema__figure') ?? null
|
||||
: null
|
||||
const avant = figure?.getBoundingClientRect() ?? null
|
||||
if (!n) schemaAffiche()
|
||||
await nextTick()
|
||||
remonter()
|
||||
if (figure && avant) glisser(figure, avant)
|
||||
if (n) document.getElementById(`porte-titre-${n}`)?.focus({ preventScroll: true })
|
||||
else if (o) racine.value?.querySelector<HTMLElement>(`.entree__schema [data-porte="${o}"]`)?.focus({ preventScroll: true })
|
||||
})
|
||||
|
||||
// ── Repli avant de partir (B13b-M4) ──
|
||||
/** Plafond d'attente : la navigation part même si la fin de transition ne vient pas. */
|
||||
const PLAFOND_REPLI = 300
|
||||
const repli = ref(false)
|
||||
|
||||
/** Un bouton de la porte mène hors de l'entrée : replier, puis naviguer. */
|
||||
async function partir(to: string) {
|
||||
if (repli.value) return
|
||||
if (mouvementReduit.value) return navigateTo(to)
|
||||
const depart = route.fullPath
|
||||
repli.value = true
|
||||
await new Promise<void>((resolve) => {
|
||||
const el = racine.value?.querySelector<HTMLElement>('.entree__deplie') ?? null
|
||||
let fini = false
|
||||
const finir = (ev?: Event) => {
|
||||
if (ev && ev.target !== el) return
|
||||
if (fini) return
|
||||
fini = true
|
||||
el?.removeEventListener('transitionend', finir)
|
||||
resolve()
|
||||
}
|
||||
el?.addEventListener('transitionend', finir)
|
||||
setTimeout(finir, PLAFOND_REPLI)
|
||||
})
|
||||
await navigateTo(to)
|
||||
// Navigation refusée ou annulée : on est toujours sur l'entrée, la section se redéplie.
|
||||
if (route.fullPath === depart) repli.value = false
|
||||
}
|
||||
|
||||
function onKeydown(ev: KeyboardEvent) {
|
||||
if (!porte.value || ev.defaultPrevented || ev.altKey || ev.ctrlKey || ev.metaKey || ev.shiftKey) return
|
||||
const cible = ev.target as HTMLElement | null
|
||||
if (cible && (cible.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(cible.tagName))) return
|
||||
// Un dialogue ouvert (menu, popup) garde ses touches.
|
||||
if (document.querySelector('[aria-modal="true"]')) return
|
||||
if (ev.key === 'ArrowLeft') { ev.preventDefault(); lateral(-1) }
|
||||
else if (ev.key === 'ArrowRight') { ev.preventDefault(); lateral(1) }
|
||||
else if (ev.key === 'Escape') { ev.preventDefault(); fermer() }
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener('keydown', onKeydown)
|
||||
if (!porte.value) schemaAffiche()
|
||||
})
|
||||
onBeforeUnmount(() => document.removeEventListener('keydown', onKeydown))
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.entree {
|
||||
min-height: 100%;
|
||||
/* le latéral déborde de ±24 % pendant 280 ms : rogné ici, sans créer de conteneur de défilement (le bandeau reste collant) */
|
||||
overflow-x: clip;
|
||||
padding: var(--space-md) var(--space-md) var(--space-2xl);
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.entree__titre {
|
||||
margin: 0;
|
||||
font-size: var(--fs-2xl);
|
||||
font-weight: var(--fw-bold);
|
||||
line-height: var(--lh-tight);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.entree__cadre {
|
||||
margin: 0;
|
||||
font-size: var(--fs-base);
|
||||
line-height: var(--lh-base);
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
|
||||
/* Téléphone : figure, bandeau, section, l'un sous l'autre. La colonne n'existe qu'au bureau. */
|
||||
.entree__gauche { display: contents; }
|
||||
|
||||
/* Le bandeau, collant, d'un bord à l'autre */
|
||||
.entree__mini {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 5;
|
||||
display: grid;
|
||||
grid-template-rows: 1fr;
|
||||
margin: var(--space-sm) calc(-1 * var(--space-md)) var(--space-lg);
|
||||
padding: 2px var(--space-md);
|
||||
background: var(--bg);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.entree__mini-dedans { min-height: 0; min-width: 0; }
|
||||
|
||||
.entree__deplie {
|
||||
display: grid;
|
||||
grid-template-rows: 1fr;
|
||||
min-width: 0;
|
||||
}
|
||||
.entree__scene {
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* ── Mouvement ── */
|
||||
/* Téléphone : le bandeau et la section se déplient sous la figure, qui rétrécit (SchemaEchelles) ; fermer replie. */
|
||||
.entree-bandeau-enter-active,
|
||||
.entree-bandeau-leave-active,
|
||||
.entree-deplier-enter-active,
|
||||
.entree-deplier-leave-active {
|
||||
transition: grid-template-rows 280ms var(--ease-out), opacity 220ms var(--ease-out);
|
||||
}
|
||||
.entree-bandeau-enter-active > .entree__mini-dedans,
|
||||
.entree-bandeau-leave-active > .entree__mini-dedans,
|
||||
.entree-deplier-enter-active > .entree__scene,
|
||||
.entree-deplier-leave-active > .entree__scene { overflow: hidden; }
|
||||
.entree-bandeau-enter-from,
|
||||
.entree-bandeau-leave-to,
|
||||
.entree-deplier-enter-from,
|
||||
.entree-deplier-leave-to {
|
||||
grid-template-rows: 0fr;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/* Repli avant de partir (B13b-M4) : la section remonte et s'efface, le bandeau reste. */
|
||||
.entree--repli .entree__deplie {
|
||||
grid-template-rows: 0fr;
|
||||
opacity: 0;
|
||||
transition: grid-template-rows 220ms var(--ease-out), opacity 180ms var(--ease-out);
|
||||
}
|
||||
.entree--repli .entree__scene { overflow: hidden; }
|
||||
|
||||
/* Latéral : la sortante file de 24 %, l'entrante arrive de l'autre côté. */
|
||||
.entree-lateral-avant-enter-active,
|
||||
.entree-lateral-avant-leave-active,
|
||||
.entree-lateral-arriere-enter-active,
|
||||
.entree-lateral-arriere-leave-active {
|
||||
transition: transform 280ms var(--ease-out), opacity 280ms var(--ease-out);
|
||||
}
|
||||
.entree-lateral-avant-leave-active,
|
||||
.entree-lateral-arriere-leave-active {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.entree-lateral-avant-enter-from,
|
||||
.entree-lateral-arriere-leave-to { transform: translateX(24%); opacity: 0; }
|
||||
.entree-lateral-avant-leave-to,
|
||||
.entree-lateral-arriere-enter-from { transform: translateX(-24%); opacity: 0; }
|
||||
|
||||
/* Téléphone : la figure réduite se replie aussi, le bandeau remonte en haut de l'écran. */
|
||||
@media (max-width: 1023.98px) {
|
||||
.entree--repli :deep(.schema__fig) {
|
||||
grid-template-rows: 0fr;
|
||||
opacity: 0;
|
||||
transition: grid-template-rows 220ms var(--ease-out), opacity 180ms var(--ease-out);
|
||||
}
|
||||
.entree--repli :deep(.schema__fig > .schema__plie-dedans) { overflow: hidden; }
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.entree {
|
||||
padding: var(--space-xl) var(--space-xl) var(--space-2xl);
|
||||
}
|
||||
.entree:not(.entree--ouverte) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.entree__gauche {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
/* Porte ouverte : la colonne de gauche (collante) et la section à droite. */
|
||||
.entree--ouverte {
|
||||
display: grid;
|
||||
grid-template-columns: 20rem minmax(0, 46rem);
|
||||
justify-content: center;
|
||||
column-gap: var(--space-2xl);
|
||||
align-items: start;
|
||||
}
|
||||
.entree--ouverte .entree__gauche {
|
||||
position: sticky;
|
||||
top: var(--space-xl);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-md);
|
||||
}
|
||||
.entree__mini {
|
||||
position: static;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: none;
|
||||
border-bottom: 0;
|
||||
}
|
||||
/* Ouverture : la figure glisse (FLIP, script), le bandeau arrive en fondu, la section se déplie à droite. */
|
||||
.entree-bandeau-enter-active { transition: opacity 200ms var(--ease-out); }
|
||||
.entree-bandeau-enter-from { grid-template-rows: 1fr; }
|
||||
.entree-deplier-enter-active {
|
||||
transition: grid-template-rows 350ms var(--ease-out), opacity 350ms var(--ease-out), transform 350ms var(--ease-out);
|
||||
}
|
||||
.entree-deplier-enter-from { transform: translateX(24px); }
|
||||
/*
|
||||
Fermeture : la mise en page repasse au schéma et la figure regagne sa place (FLIP).
|
||||
La section s'efface sur place (sortie du flux, à la position de sa colonne) en filant
|
||||
vers la droite : le dépliage s'inverse. Le bandeau, lui, s'efface d'un coup.
|
||||
*/
|
||||
.entree { position: relative; }
|
||||
.entree-bandeau-leave-active {
|
||||
display: none;
|
||||
transition: none;
|
||||
}
|
||||
.entree-deplier-leave-active {
|
||||
position: absolute;
|
||||
top: var(--space-xl);
|
||||
right: max(var(--space-xl), calc((100% - 20rem - var(--space-2xl) - 46rem) / 2));
|
||||
width: min(46rem, calc(100% - 2 * var(--space-xl) - 20rem - var(--space-2xl)));
|
||||
transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
|
||||
}
|
||||
.entree-deplier-leave-to {
|
||||
grid-template-rows: 1fr;
|
||||
transform: translateX(24px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.entree-bandeau-enter-active,
|
||||
.entree-bandeau-leave-active,
|
||||
.entree-deplier-enter-active,
|
||||
.entree-deplier-leave-active,
|
||||
.entree-lateral-avant-enter-active,
|
||||
.entree-lateral-avant-leave-active,
|
||||
.entree-lateral-arriere-enter-active,
|
||||
.entree-lateral-arriere-leave-active { transition: none; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<EvenementsPage>
|
||||
<header class="evt-tete">
|
||||
<h1 class="evt-h1">Les événements</h1>
|
||||
</header>
|
||||
|
||||
<ul class="evt-index" role="list">
|
||||
<li v-for="e in evenements" :key="e.slug">
|
||||
<NuxtLink :to="lien(e.chemin)" class="evt-index__carte">
|
||||
<span class="evt-index__quand">{{ periode(e.du, e.au) }} {{ annee(e.au) }}</span>
|
||||
<span class="evt-index__titre">{{ e.titre }}</span>
|
||||
<span class="evt-index__resume">{{ e.resume }}</span>
|
||||
<span class="evt-index__lieu">{{ e.lieu }}</span>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<EvenementsPied contact="contact@trans-former.fr" />
|
||||
</EvenementsPage>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { periode } from '~/utils/evenements'
|
||||
import type { Evenement } from '~/data/evenements/ruetz-2026'
|
||||
|
||||
// Un fichier par événement dans data/evenements/ ; le plus récent en tête.
|
||||
const modules = import.meta.glob<{ evenement: Evenement }>('../../data/evenements/*.ts', { eager: true })
|
||||
const evenements = Object.values(modules).map(m => m.evenement).sort((a, b) => b.du.localeCompare(a.du))
|
||||
|
||||
const annee = (iso: string) => iso.slice(0, 4)
|
||||
const { lien, seo } = useEvenement()
|
||||
|
||||
seo({
|
||||
chemin: '/',
|
||||
titre: 'Les événements',
|
||||
description: 'Les événements organisés à Ruetz et ailleurs : semaines d\'entraide, chantiers, plantations.',
|
||||
image: '/medias/evenements/ruetz/plan-foret-ruetz.jpg',
|
||||
alt: 'Le plan de la forêt nourricière de Ruetz.',
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.evt-index { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-md); }
|
||||
.evt-index__carte {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2xs);
|
||||
padding: var(--space-lg);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--evt-papier);
|
||||
border: 1px solid var(--border);
|
||||
text-decoration: none;
|
||||
color: var(--text);
|
||||
}
|
||||
.evt-index__carte:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
|
||||
.evt .evt-index__carte { color: var(--text); }
|
||||
.evt-index__quand { font-size: 0.8rem; font-weight: var(--fw-bold); letter-spacing: 0.08em; text-transform: uppercase; color: var(--evt-ocre); }
|
||||
.evt-index__titre {
|
||||
font-family: var(--evt-titre);
|
||||
font-size: clamp(1.5rem, 5.4vw, 1.9rem);
|
||||
font-weight: 600;
|
||||
line-height: 1.15;
|
||||
text-decoration: underline;
|
||||
text-decoration-thickness: 1px;
|
||||
text-underline-offset: 4px;
|
||||
}
|
||||
.evt-index__carte:hover .evt-index__titre { text-decoration-thickness: 2px; }
|
||||
.evt-index__resume { margin-top: var(--space-2xs); }
|
||||
.evt-index__lieu { font-size: var(--fs-sm); color: var(--evt-attenue); }
|
||||
</style>
|
||||
@@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<EvenementsPage :retour="{ to: lien(e.chemin), label: e.titre }">
|
||||
<!-- Le tableau de Ruetz en bandeau, tout en haut (Jules, B26) : au bureau, le panorama entier sur toute la
|
||||
largeur ; au téléphone, recadré sur la maison (le panorama fait 6,5 pour 1), avec le lien vers le tableau entier. -->
|
||||
<template #bandeau>
|
||||
<figure class="tableau">
|
||||
<picture>
|
||||
<source media="(min-width: 700px)" width="2400" height="370" sizes="100vw"
|
||||
:srcset="`${MEDIAS}/tableau-ruetz-1600.jpg 1600w, ${MEDIAS}/tableau-ruetz-2400.jpg 2400w, ${MEDIAS}/tableau-ruetz-4000.jpg 4000w`">
|
||||
<img :src="`${MEDIAS}/tableau-ruetz-maison-1200.jpg`" width="1200" height="900" fetchpriority="high"
|
||||
:srcset="`${MEDIAS}/tableau-ruetz-maison-800.jpg 800w, ${MEDIAS}/tableau-ruetz-maison-1200.jpg 1200w`"
|
||||
sizes="100vw" :alt="ALT_TABLEAU">
|
||||
</picture>
|
||||
<figcaption class="tableau__legende">
|
||||
Ruetz, peint par Rémi Moustard et Jules Nény en 2023.
|
||||
<a :href="`${MEDIAS}/tableau-ruetz-4000.jpg`" class="tableau__entier" target="_blank" rel="noopener">Voir le tableau en entier</a>
|
||||
</figcaption>
|
||||
</figure>
|
||||
</template>
|
||||
|
||||
<header class="evt-tete">
|
||||
<h1 class="evt-h1">Une semaine pour s'entraider. Et planter une forêt.</h1>
|
||||
<ul class="evt-recap" role="list">
|
||||
<li><EvenementsIcone nom="calendrier" /><span>{{ dates }}</span></li>
|
||||
<li><EvenementsIcone nom="lieu" /><EvenementsLieu /></li>
|
||||
<li><EvenementsIcone nom="argent" /><span>{{ c.prixJour }} € par jour pour la nourriture</span></li>
|
||||
<li><EvenementsIcone nom="train" /><span>Le trajet est à votre charge : <a href="#venir">covoiturage plus bas ↓</a></span></li>
|
||||
</ul>
|
||||
<div class="evt-actions">
|
||||
<EvenementsCompteur v-if="compteur" v-bind="compteur" />
|
||||
<!-- Complet : la liste d'attente prend le relais (Jules, 23/10) -->
|
||||
<a href="#inscription" class="evt-btn">{{ places?.complet ? 'Liste d\'attente ↓' : 'Je m\'inscris ↓' }}</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="evt-section evt-section--premiere" aria-labelledby="intention">
|
||||
<h2 id="intention" class="evt-h2">L'intention</h2>
|
||||
<p>
|
||||
Un séjour autogéré, dans une maison familiale. On pose le cadre : les horaires, les repas à tour de rôle.
|
||||
Et trois fils rouges, d'après Pablo Servigne : la convivialité, l'authenticité, l'entraide face à l'adversité.
|
||||
Le programme, on le co-crée sur place : chacun·e arrive avec ce dont il a besoin cette semaine-là, et ce
|
||||
qu'il a envie de proposer.
|
||||
</p>
|
||||
<p class="evt-note">cf. Pablo Servigne, <cite>Le Réseau des tempêtes. Manifeste pour une entraide populaire</cite>, 2025.</p>
|
||||
<EvenementsSens />
|
||||
</section>
|
||||
|
||||
<section class="evt-section" aria-labelledby="semaine">
|
||||
<h2 id="semaine" class="evt-h2">La semaine</h2>
|
||||
<EvenementsFrise :lien-foret="lien(e.foret.chemin)" />
|
||||
</section>
|
||||
|
||||
<!-- Toutes les photos ensemble, plus bas (Jules, B26) -->
|
||||
<div class="evt-bande evt-large">
|
||||
<div class="evt-bande__photos">
|
||||
<figure class="evt-figure evt-photo">
|
||||
<img :src="`${MEDIAS}/fertival-atelier.jpg`" width="883" height="662" loading="lazy" decoding="async"
|
||||
alt="Dans une grange, une personne debout présente des feuilles affichées au mur ; les autres l'écoutent, assises par terre.">
|
||||
</figure>
|
||||
<figure class="evt-figure evt-photo">
|
||||
<img :src="`${MEDIAS}/fertival-table.jpg`" width="881" height="661" loading="lazy" decoding="async"
|
||||
alt="Une longue table dehors, contre un mur de pierre : on écrit, on sourit.">
|
||||
</figure>
|
||||
<figure class="evt-figure evt-photo">
|
||||
<img :src="`${MEDIAS}/fertival-repas.jpg`" width="876" height="657" loading="lazy" decoding="async"
|
||||
alt="Des mains servent des assiettes autour de plats posés sur une table.">
|
||||
</figure>
|
||||
<figure class="evt-figure evt-photo">
|
||||
<img :src="`${MEDIAS}/fertival-danse.jpg`" width="865" height="649" loading="lazy" decoding="async"
|
||||
alt="Une danse à plusieurs dans une grange aux murs de pierre.">
|
||||
</figure>
|
||||
</div>
|
||||
<p class="evt-note">À Ruetz, en 2024.</p>
|
||||
</div>
|
||||
|
||||
<section class="evt-section" aria-labelledby="pratique">
|
||||
<h2 id="pratique" class="evt-h2">Le pratique</h2>
|
||||
<div class="evt-cartes evt-cartes--2">
|
||||
<div class="evt-carte">
|
||||
<div class="evt-carte__tete"><span class="evt-picto"><EvenementsIcone nom="places" /></span><h3 class="evt-h3">Les places</h3></div>
|
||||
<p>16, sans ordre de priorité : viennent celles et ceux qui sont motivé·es. Au-delà, une liste d'attente.</p>
|
||||
<p>Les enfants sont les bienvenus : dites-le dans « Un mot », en bas du formulaire.</p>
|
||||
</div>
|
||||
<div class="evt-carte">
|
||||
<div class="evt-carte__tete"><span class="evt-picto"><EvenementsIcone nom="maison" /></span><h3 class="evt-h3">Dormir, manger</h3></div>
|
||||
<p>
|
||||
La grande maison et son dortoir, chauffés pour l'occasion. Les repas et le rangement à tour de rôle,
|
||||
par petits groupes, fiches recettes fournies.
|
||||
</p>
|
||||
<p>À apporter : des draps.</p>
|
||||
</div>
|
||||
<div class="evt-carte evt-carte--large">
|
||||
<div class="evt-carte__tete"><span class="evt-picto"><EvenementsIcone nom="argent" /></span><h3 class="evt-h3">L'argent</h3></div>
|
||||
<p>
|
||||
À l'inscription, {{ c.prixJour }} € par jour de présence, par virement : c'est la nourriture, végétarienne, qu'on achète pour tout le monde.
|
||||
À la fin, un prix libre, dit comme un don conseillé.
|
||||
</p>
|
||||
<p>Le week-end de plantation, les 28 et 29, tout le monde est invité à manger : rien à régler pour ces deux jours.</p>
|
||||
</div>
|
||||
<div id="venir" class="evt-carte evt-carte--large evt-ancre">
|
||||
<div class="evt-carte__tete"><span class="evt-picto"><EvenementsIcone nom="train" /></span><h3 class="evt-h3">Venir</h3></div>
|
||||
<p>Arrivée le samedi 21 : on atterrit ensemble et on met en place l'autogestion. Départ au plus tôt le mercredi 25.</p>
|
||||
<p>
|
||||
Paris Est → Saint-Dizier, environ 2 h 30, souvent direct. Puis 15 km, sans bus : on organise une navette
|
||||
depuis la gare, et le covoiturage avec les inscrit·es.
|
||||
</p>
|
||||
<p v-if="e.codev.covoiturageUrl">
|
||||
<a :href="e.codev.covoiturageUrl" class="evt-btn evt-btn--nuit" rel="noopener" target="_blank">
|
||||
<EvenementsIcone nom="voiture" />Le tableau de covoiturage<span class="evt-sr"> (nouvel onglet)</span>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="inscription" class="evt-section evt-ancre" aria-labelledby="inscription-titre">
|
||||
<h2 id="inscription-titre" class="evt-h2">L'inscription</h2>
|
||||
<EvenementsCompteur v-if="compteur" v-bind="compteur" />
|
||||
<EvenementsFormulaire page="codev" :contact="e.contact"
|
||||
:disponible="places?.disponible !== false" :complet="!!places?.complet"
|
||||
@inscrit="refresh()" />
|
||||
</section>
|
||||
|
||||
<EvenementsPied :contact="e.contact">
|
||||
<p class="reponses">Inscriptions jusqu'au {{ e.reponsesAvant }}</p>
|
||||
<p class="pied-foret">
|
||||
<span>Les 28 et 29 novembre, on plante une forêt.</span>
|
||||
<NuxtLink :to="lien(e.foret.chemin)" class="evt-lien-foret"><EvenementsIcone nom="arbre" />La page forêt</NuxtLink>
|
||||
</p>
|
||||
</EvenementsPied>
|
||||
</EvenementsPage>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { evenement as e } from '~/data/evenements/ruetz-2026'
|
||||
import { periode } from '~/utils/evenements'
|
||||
|
||||
const c = e.codev
|
||||
const MEDIAS = '/medias/evenements/ruetz'
|
||||
/** Vrai pour les deux cadrages (la maison au téléphone, le panorama au bureau). */
|
||||
const ALT_TABLEAU = 'Peinture de Ruetz en fin de journée : la maison aux murs roses parmi de grands arbres dorés par le soleil, des prés et des champs tout autour.'
|
||||
const p0 = periode(c.du, c.au)
|
||||
const dates = p0.charAt(0).toUpperCase() + p0.slice(1)
|
||||
const { lien, seo } = useEvenement()
|
||||
|
||||
const { data: places, refresh } = await useFetch('/api/evenements/places', { query: { page: 'codev' } })
|
||||
|
||||
/** Le compte des places ; rien si le compte est inconnu (table absente ou illisible). */
|
||||
const compteur = computed(() => {
|
||||
const p = places.value as { inscrits?: number; capacite?: number; complet?: boolean } | null
|
||||
if (!p || typeof p.inscrits !== 'number' || !p.capacite) return null
|
||||
return { inscrits: p.inscrits, capacite: p.capacite, complet: !!p.complet }
|
||||
})
|
||||
|
||||
seo({
|
||||
chemin: '/ruetz/codev',
|
||||
titre: 'Une semaine pour s\'entraider, du 21 au 27 novembre à Ruetz',
|
||||
description: `Un séjour autogéré dans une maison familiale à Bayard-sur-Marne (Haute-Marne), du samedi 21 au vendredi 27 novembre. ${c.capacite} places, ${c.prixJour} € par jour pour la nourriture.`,
|
||||
image: `${MEDIAS}/tableau-ruetz-og.jpg`,
|
||||
alt: ALT_TABLEAU,
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#inscription .cpt { margin-bottom: var(--space-sm); }
|
||||
.evt-section--premiere { margin-top: var(--space-xl); }
|
||||
|
||||
/* Le bandeau : toute la largeur de la page. Téléphone : la maison, en 3:2. À partir de 700 px : le panorama,
|
||||
150 px de haut au moins (recadré sur la maison en dessous de 970 px), et plus besoin du lien vers le tableau entier. */
|
||||
.tableau { margin: 0; }
|
||||
.tableau img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 45%; }
|
||||
.tableau__legende {
|
||||
max-width: 640px;
|
||||
margin: var(--space-xs) auto 0;
|
||||
padding: 0 var(--space-md);
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--evt-attenue);
|
||||
}
|
||||
@media (min-width: 700px) {
|
||||
.tableau img { aspect-ratio: auto; height: max(150px, calc(100vw / 6.48)); object-position: 34% 50%; }
|
||||
.tableau__entier { display: none; }
|
||||
}
|
||||
@media (min-width: 768px) { .tableau__legende { padding: 0 var(--space-lg); } }
|
||||
@media (min-width: 1024px) { .tableau__legende { max-width: 760px; } }
|
||||
.reponses { font-weight: var(--fw-bold); font-size: var(--fs-base); }
|
||||
.pied-foret { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); }
|
||||
.evt-ancre { scroll-margin-top: var(--space-lg); }
|
||||
</style>
|
||||
@@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<!-- Pas de lien de retour ni de pied vers la semaine : on arrive ici par le lien donné pour la plantation -->
|
||||
<EvenementsPage ton="foret">
|
||||
<header class="evt-tete">
|
||||
<h1 class="evt-h1">À la Sainte-Catherine, tout bois prend racine.</h1>
|
||||
<p class="evt-sous">On plante une forêt nourricière</p>
|
||||
<!-- Mot d'accueil validé par Jules (batch MOA du 23/10), texte de B25-messages-invitation-ruetz §3 -->
|
||||
<p class="evt-accueil">
|
||||
Je suis Jules. Cette forêt, on la plante à Ruetz depuis l'automne dernier, ligne après ligne, et il reste
|
||||
une soixantaine d'arbres à mettre en terre. J'aimerais qu'elle pousse à beaucoup de mains : la famille,
|
||||
les ami·es, les voisin·es, et vous.
|
||||
</p>
|
||||
<ul class="evt-recap" role="list">
|
||||
<li><EvenementsIcone nom="calendrier" /><span>Samedi 28 et dimanche 29 novembre</span></li>
|
||||
<li><EvenementsIcone nom="lieu" /><EvenementsLieu /></li>
|
||||
<li><EvenementsIcone nom="train" /><span>Gare la plus proche : Saint-Dizier, environ 2 h 30 depuis Paris Est, puis 15 km</span></li>
|
||||
<li><EvenementsIcone nom="bol" /><span>Repas offerts, rien à régler. Le trajet est à votre charge : <a href="#venir">covoiturage plus bas ↓</a></span></li>
|
||||
</ul>
|
||||
<div v-if="!places?.complet" class="evt-actions">
|
||||
<a href="#inscription" class="evt-btn">Je viens planter ↓</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Le projet (Jules, B26, retour du 23/10) : dans la largeur de la page, comme le reste ; au bureau, le texte
|
||||
en colonne plus étroite et le pastel de Jules à côté ; au téléphone, le texte puis le pastel en grand.
|
||||
Le papier du pastel, ramené au blanc, se fond dans la crème (multiply) ; en sombre, il reste une feuille. -->
|
||||
<section class="evt-section projet" aria-labelledby="projet">
|
||||
<div class="projet__texte">
|
||||
<h2 id="projet" class="evt-h2">Le projet</h2>
|
||||
<p>
|
||||
Planter une forêt nourricière à Ruetz, pour continuer à en faire un lieu de partage et d'abondance fruitière,
|
||||
où il fera encore meilleur vivre dans les années qui viennent. Chaque génération a apporté sa touche au lieu,
|
||||
et cette forêt pourrait être la nôtre.
|
||||
</p>
|
||||
<p>
|
||||
La forêt comptera quatre-vingt-trois arbres : des pommiers, des poiriers, des cerisiers, des châtaigniers,
|
||||
des noyers, des néfliers, des jujubiers, et même un araucaria qui peut vivre mille ans.
|
||||
</p>
|
||||
<p>Les deux premières lignes sont en terre depuis l'automne dernier ; il reste une soixantaine d'arbres à planter.</p>
|
||||
<p class="accroche">Planter une forêt seul, ça prend une vie. À quarante, ça prend un samedi.</p>
|
||||
</div>
|
||||
<figure class="projet__arbre">
|
||||
<img :src="`${MEDIAS}/arbre-pastel-900.jpg`" width="900" height="1927" decoding="async"
|
||||
:srcset="`${MEDIAS}/arbre-pastel-600.jpg 600w, ${MEDIAS}/arbre-pastel-900.jpg 900w, ${MEDIAS}/arbre-pastel-1200.jpg 1200w`"
|
||||
sizes="(min-width: 700px) 300px, min(80vw, 340px)"
|
||||
alt="Un arbre dessiné au pastel par Jules Nény : un tronc clair qui se divise en branches fines, un feuillage vert et bleu, une pente rouge à son pied.">
|
||||
</figure>
|
||||
</section>
|
||||
|
||||
<section class="evt-section" aria-labelledby="syntropie">
|
||||
<h2 id="syntropie" class="evt-h2">Une forêt en syntropie</h2>
|
||||
<!-- Le plan de Sacha, en tête de la syntropie (Jules, 23/10). Au téléphone, la légende du plan est illisible :
|
||||
l'image s'ouvre en grand au toucher ; pour le clavier et les lecteurs d'écran, le lien est celui de la légende -->
|
||||
<figure class="evt-figure evt-pleine">
|
||||
<a :href="`${MEDIAS}/plan-foret-ruetz.jpg`" target="_blank" rel="noopener" tabindex="-1" aria-hidden="true">
|
||||
<img :src="`${MEDIAS}/plan-foret-ruetz.jpg`" width="1100" height="778" loading="lazy" decoding="async" alt="">
|
||||
</a>
|
||||
<figcaption>
|
||||
Le plan dessiné par Sacha : quatorze lignes qui épousent le relief du coteau pour garder l'eau de pluie dans le sol.
|
||||
<a :href="`${MEDIAS}/plan-foret-ruetz.jpg`" target="_blank" rel="noopener">Voir le plan en grand</a>
|
||||
</figcaption>
|
||||
</figure>
|
||||
<p>
|
||||
Au lieu de planter un verger en rangs, on imite la forêt qui se fait toute seule. Les arbres sont mêlés par
|
||||
étages ; des pionniers qui poussent vite, le saule et le peuplier, préparent le sol et l'ombre pour ceux qui
|
||||
vivront des siècles, et le sol reste toujours couvert. Les lignes suivent les courbes du terrain : l'eau
|
||||
ralentit et s'infiltre au lieu de ruisseler. C'est l'agroforesterie syntropique, d'après Ernst Götsch, qui a
|
||||
fait revivre une terre épuisée au Brésil.
|
||||
</p>
|
||||
|
||||
<details class="evt-details">
|
||||
<summary>Les étages de la forêt</summary>
|
||||
<div class="evt-details__corps">
|
||||
<p>Une forêt n'est pas plate : elle a des étages, et chacun attrape un peu de lumière.</p>
|
||||
<EvenementsStrates />
|
||||
<dl class="strates-liste">
|
||||
<div><dt>Strate haute</dt><dd>chêne vert, noyer, tilleul, châtaignier, cormier</dd></div>
|
||||
<div><dt>Strate moyenne</dt><dd>pommier, poirier, cerisier, néflier, jujubier</dd></div>
|
||||
<div><dt>Strate basse</dt><dd>cassis, groseille, framboise ; boutures de saule et de peuplier</dd></div>
|
||||
<div>
|
||||
<dt>Strate herbacée</dt>
|
||||
<dd>la consoude : ses racines profondes remontent les minéraux du sous-sol, ses feuilles couvrent et nourrissent le sol</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p class="evt-note">Et dans le temps : d'abord ce qui pousse vite, puis ce qui vit des siècles.</p>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="evt-details">
|
||||
<summary>Ce qu'on fera ensemble</summary>
|
||||
<div class="evt-details__corps">
|
||||
<EvenementsGestes />
|
||||
<p class="evt-note gestes-source">D'après le dessin de Sacha.</p>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
|
||||
<section class="evt-section" aria-labelledby="weekend">
|
||||
<h2 id="weekend" class="evt-h2">Le week-end</h2>
|
||||
<ol class="evt-deroule" role="list">
|
||||
<li><strong>Vendredi 27 au soir</strong>On arrive, on accueille, on dîne ensemble.</li>
|
||||
<li>
|
||||
<strong>Samedi 28</strong>
|
||||
Le chantier, quatre heures au plus. Les trous, la paille et les boutures sont prêts : on met les arbres en terre.
|
||||
Sacha explique les principes de la syntropie, comment refaire une forêt nourricière chez soi, et l'intention du projet.
|
||||
Le soir, un bon repas ensemble.
|
||||
</li>
|
||||
<li><strong>Dimanche 29</strong>Après le déjeuner, chacun repart.</li>
|
||||
</ol>
|
||||
<p>Sacha anime le chantier avec Jules. Les enfants sont les bienvenus.</p>
|
||||
</section>
|
||||
|
||||
<!-- Toutes les photos ensemble, juste avant « Venir » (Jules, B26) -->
|
||||
<div class="evt-bande evt-large">
|
||||
<div class="evt-bande__photos">
|
||||
<figure class="evt-figure evt-photo">
|
||||
<img :src="`${MEDIAS}/champ.jpg`" width="1200" height="639" loading="lazy" decoding="async"
|
||||
alt="Deux personnes au travail dans le champ de Ruetz, entre des rouleaux de paille, au pied du bois.">
|
||||
</figure>
|
||||
<figure class="evt-figure evt-photo">
|
||||
<img :src="`${MEDIAS}/botte.jpg`" width="1200" height="658" loading="lazy" decoding="async"
|
||||
alt="Trois personnes poussent ensemble une grosse botte de paille dans le champ.">
|
||||
</figure>
|
||||
<figure class="evt-figure evt-photo">
|
||||
<img :src="`${MEDIAS}/repas.jpg`" width="1200" height="657" loading="lazy" decoding="async"
|
||||
alt="Une longue table dressée dehors pour un repas partagé.">
|
||||
</figure>
|
||||
</div>
|
||||
<p class="evt-note">À Ruetz, en 2024.</p>
|
||||
</div>
|
||||
|
||||
<section class="evt-section" aria-labelledby="venir">
|
||||
<h2 id="venir" class="evt-h2">Venir</h2>
|
||||
<div class="evt-cartes evt-cartes--2">
|
||||
<div class="evt-carte">
|
||||
<div class="evt-carte__tete"><span class="evt-picto"><EvenementsIcone nom="train" /></span><h3 class="evt-h3">Y aller</h3></div>
|
||||
<p>
|
||||
En train jusqu'à la gare de Saint-Dizier : Paris Est → Saint-Dizier, environ 2 h 30, billets sur
|
||||
<a href="https://www.sncf-connect.com/" rel="noopener" target="_blank">SNCF Connect</a>. Puis 15 km :
|
||||
il n'y a pas de bus, on organise une navette depuis la gare.
|
||||
</p>
|
||||
<p v-if="e.foret.covoiturageUrl">
|
||||
<a :href="e.foret.covoiturageUrl" class="evt-btn evt-btn--nuit" rel="noopener" target="_blank">
|
||||
<EvenementsIcone nom="voiture" />Le tableau de covoiturage<span class="evt-sr"> (nouvel onglet)</span>
|
||||
</a>
|
||||
</p>
|
||||
<p v-else>Un tableau de covoiturage partagé arrive avec la confirmation.</p>
|
||||
</div>
|
||||
<div class="evt-carte">
|
||||
<div class="evt-carte__tete"><span class="evt-picto"><EvenementsIcone nom="lit" /></span><h3 class="evt-h3">Dormir</h3></div>
|
||||
<p>Dans la grande maison et son dortoir, chauffés.</p>
|
||||
<p>Couple, enfant, besoin particulier : dites-le dans le message (« Un mot », en bas du formulaire).</p>
|
||||
<p>Vous ne dormez pas sur place ? Rien à prévoir : on vous nourrit, on s'occupe du reste.</p>
|
||||
</div>
|
||||
<div class="evt-carte">
|
||||
<div class="evt-carte__tete"><span class="evt-picto"><EvenementsIcone nom="sac" /></span><h3 class="evt-h3">À apporter</h3></div>
|
||||
<p>Bottes, gants, duvet ou draps.</p>
|
||||
</div>
|
||||
<div class="evt-carte">
|
||||
<div class="evt-carte__tete"><span class="evt-picto"><EvenementsIcone nom="bol" /></span><h3 class="evt-h3">Manger</h3></div>
|
||||
<p>Tout le monde est invité à manger : les repas sont offerts, végétariens. Dites-nous si vous avez un besoin particulier.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="inscription" class="evt-section evt-ancre" aria-labelledby="inscription-titre">
|
||||
<h2 id="inscription-titre" class="evt-h2">Je viens planter</h2>
|
||||
<EvenementsFormulaire page="foret" :contact="e.contact"
|
||||
:disponible="places?.disponible !== false" :complet="!!places?.complet"
|
||||
@inscrit="refresh()" />
|
||||
</section>
|
||||
|
||||
<section class="evt-section" aria-labelledby="sans-venir">
|
||||
<h2 id="sans-venir" class="evt-h2">En être sans venir</h2>
|
||||
<div class="evt-encadre">
|
||||
<p>
|
||||
Vous ne pouvez pas venir et vous voulez soutenir le projet ? Un virement reste possible :
|
||||
<a :href="`mailto:${e.contact}`">écrivez-nous</a>. Un simple message pour dire merci fait aussi plaisir.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<EvenementsPied :contact="e.contact" />
|
||||
</EvenementsPage>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { evenement as e } from '~/data/evenements/ruetz-2026'
|
||||
|
||||
const MEDIAS = '/medias/evenements/ruetz'
|
||||
const { seo } = useEvenement()
|
||||
|
||||
const { data: places, refresh } = await useFetch('/api/evenements/places', { query: { page: 'foret' } })
|
||||
|
||||
seo({
|
||||
chemin: '/ruetz/foret',
|
||||
titre: 'On plante une forêt nourricière à Ruetz, les 28 et 29 novembre',
|
||||
description: 'À la Sainte-Catherine, tout bois prend racine. Venez planter une forêt nourricière à Ruetz, Bayard-sur-Marne (Haute-Marne), le samedi 28 et le dimanche 29 novembre. Repas offerts, enfants bienvenus.',
|
||||
image: `${MEDIAS}/plan-foret-ruetz.jpg`,
|
||||
alt: 'Le plan de la forêt nourricière de Ruetz, dessiné par Sacha.',
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* Le projet, dans la largeur de la page : téléphone, le texte puis le pastel en grand au centre ;
|
||||
dès 700 px, le texte en colonne plus étroite et le pastel à côté, à sa hauteur */
|
||||
.projet__arbre { margin: var(--space-xl) auto 0; width: min(80%, 340px); }
|
||||
.projet__arbre img { display: block; width: 100%; height: auto; mix-blend-mode: var(--evt-fusion-dessin); border-radius: var(--radius-sm); }
|
||||
@media (min-width: 700px) {
|
||||
.projet {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
|
||||
column-gap: var(--space-xl);
|
||||
align-items: start;
|
||||
}
|
||||
.projet__arbre { width: 100%; margin: var(--space-2xs) 0 0; }
|
||||
}
|
||||
/* La phrase qui porte la page : Fraunces en sauge, sans bordure d'accent */
|
||||
.accroche {
|
||||
margin: var(--space-xl) 0 0;
|
||||
font-family: var(--evt-titre);
|
||||
font-weight: 600;
|
||||
font-size: clamp(1.4rem, 5vw, 1.75rem);
|
||||
line-height: 1.25;
|
||||
letter-spacing: -0.01em;
|
||||
color: var(--evt-sauge);
|
||||
text-wrap: balance;
|
||||
}
|
||||
.strates-liste { margin: var(--space-md) 0; display: grid; gap: var(--space-sm); }
|
||||
.strates-liste div { display: grid; gap: 2px; }
|
||||
.strates-liste dt { font-weight: var(--fw-bold); }
|
||||
.strates-liste dd { margin: 0; }
|
||||
.gestes-source { margin: var(--space-sm) 0 0; }
|
||||
.evt-ancre { scroll-margin-top: var(--space-lg); }
|
||||
</style>
|
||||
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<EvenementsPage :retour="{ to: lien('/'), label: 'Les événements' }">
|
||||
<header class="evt-tete">
|
||||
<h1 class="evt-h1">{{ e.titre }}</h1>
|
||||
<p class="evt-lieu">Ruetz, une maison familiale à <EvenementsLieu>Bayard-sur-Marne (Haute-Marne)</EvenementsLieu>.</p>
|
||||
</header>
|
||||
|
||||
<ul class="carrefour" role="list">
|
||||
<li>
|
||||
<NuxtLink :to="lien(e.codev.chemin)" class="porte porte--codev">
|
||||
<span class="porte__picto"><EvenementsIcone nom="places" /></span>
|
||||
<span class="porte__titre">{{ e.codev.titre }}</span>
|
||||
<span class="porte__quand">{{ periode(e.codev.du, e.codev.au) }}</span>
|
||||
<span class="porte__plus">{{ e.codev.capacite }} places</span>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
<li>
|
||||
<NuxtLink :to="lien(e.foret.chemin)" class="porte porte--foret">
|
||||
<span class="porte__picto"><EvenementsIcone nom="arbre" /></span>
|
||||
<span class="porte__titre">{{ e.foret.titre }}</span>
|
||||
<span class="porte__quand">samedi 28 et dimanche 29 novembre</span>
|
||||
</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<figure class="evt-figure evt-photo carrefour__photo">
|
||||
<img src="/medias/evenements/ruetz/champ.jpg" width="1200" height="639" loading="lazy" decoding="async"
|
||||
alt="Deux personnes au travail dans le champ de Ruetz, entre des rouleaux de paille, au pied du bois.">
|
||||
<figcaption>À Ruetz, en 2024.</figcaption>
|
||||
</figure>
|
||||
|
||||
<EvenementsPied :contact="e.contact" />
|
||||
</EvenementsPage>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { evenement as e } from '~/data/evenements/ruetz-2026'
|
||||
import { periode } from '~/utils/evenements'
|
||||
|
||||
const { lien, seo } = useEvenement()
|
||||
|
||||
seo({
|
||||
chemin: '/ruetz',
|
||||
titre: 'Fin novembre à Ruetz',
|
||||
description: 'Une semaine d\'entraide du 21 au 27 novembre, puis on plante une forêt nourricière les 28 et 29 novembre, à Bayard-sur-Marne (Haute-Marne).',
|
||||
image: '/medias/evenements/ruetz/plan-foret-ruetz.jpg',
|
||||
alt: 'Le plan de la forêt nourricière de Ruetz, dessiné par Sacha.',
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* Deux portes à la mesure de leur texte, côte à côte dès qu'il y a la place */
|
||||
.carrefour { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
|
||||
@media (min-width: 600px) { .carrefour { grid-template-columns: 1fr 1fr; } }
|
||||
.carrefour li { display: flex; }
|
||||
.porte {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: var(--space-2xs);
|
||||
padding: var(--space-md) var(--space-md) var(--space-lg);
|
||||
border-radius: var(--radius-lg);
|
||||
text-decoration: none;
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
|
||||
}
|
||||
.porte:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
|
||||
.evt .porte--codev { background: var(--evt-nuit); color: var(--evt-sur-nuit); }
|
||||
.evt .porte--foret { background: var(--accent); color: var(--on-accent); }
|
||||
.porte__picto {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
margin-bottom: var(--space-sm);
|
||||
border-radius: var(--radius-full);
|
||||
background: color-mix(in srgb, currentColor 14%, transparent);
|
||||
}
|
||||
.porte__titre {
|
||||
font-family: var(--evt-titre);
|
||||
font-weight: 600;
|
||||
font-size: clamp(1.45rem, 5vw, 1.65rem);
|
||||
line-height: 1.15;
|
||||
letter-spacing: -0.01em;
|
||||
text-decoration: underline;
|
||||
text-decoration-thickness: 1px;
|
||||
text-underline-offset: 4px;
|
||||
}
|
||||
.porte:hover .porte__titre { text-decoration-thickness: 2px; }
|
||||
.porte__quand { font-size: var(--fs-base); }
|
||||
.porte__plus { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
|
||||
.carrefour__photo { margin-top: var(--space-xl); }
|
||||
@media (prefers-reduced-motion: reduce) { .porte, .porte:hover { transition: none; transform: none; } }
|
||||
</style>
|
||||
@@ -1,362 +1,91 @@
|
||||
<template>
|
||||
<div class="flex h-full overflow-hidden" style="background: var(--nav-bg);">
|
||||
<div class="relative h-full overflow-hidden" style="background: var(--nav-bg);">
|
||||
|
||||
<!-- ═══════════════════════════════════════ SIDEBAR DESKTOP (≥ 1024px) -->
|
||||
<div class="hidden lg:flex w-80 shrink-0 flex-col overflow-hidden">
|
||||
<NavSidebar
|
||||
:search="search"
|
||||
:modeValue="territoireMode"
|
||||
:echelle="echelle"
|
||||
:fonctions="fonctions"
|
||||
:territoire="territoire"
|
||||
:echelleCount="echelleCount"
|
||||
:fonctionCount="fonctionCount"
|
||||
:territoireCount="territoireCount"
|
||||
:resultCount="filtered.length"
|
||||
:orgs="filtered"
|
||||
:selectedId="selectedId"
|
||||
:hasActiveFilters="hasActiveFilters"
|
||||
:pending="pending"
|
||||
@update:search="onSearch"
|
||||
@update:mode="onMode"
|
||||
@update:echelle="onEchelle"
|
||||
@update:fonctions="onFonctions"
|
||||
@update:territoire="onTerritoire"
|
||||
@select-org="onSelectOrg"
|
||||
@hover-org="onHoverOrg"
|
||||
@reset-filters="resetFilters"
|
||||
/>
|
||||
<!-- Indicateur source dev -->
|
||||
<div
|
||||
v-if="dataSource === 'seed'"
|
||||
class="absolute bottom-2 left-1/2 -translate-x-1/2 z-[1002] px-2 py-1 rounded text-xs pointer-events-none"
|
||||
style="background: var(--nav-accent); color: var(--nav-text);"
|
||||
>
|
||||
Mode dev — données seed
|
||||
</div>
|
||||
|
||||
<!-- ═══════════════════════════════════════ ZONE CENTRALE (carte) -->
|
||||
<main class="flex-1 flex flex-col overflow-hidden relative">
|
||||
|
||||
<!-- Indicateur source dev -->
|
||||
<div
|
||||
v-if="dataSource === 'seed'"
|
||||
class="absolute top-2 left-2 z-[500] px-2 py-1 rounded text-xs"
|
||||
style="background: var(--nav-accent); color: var(--nav-text);"
|
||||
>
|
||||
Mode dev — données seed
|
||||
</div>
|
||||
|
||||
<!-- ── VUE DESKTOP : Onglets Métropole / Outre-mer / Toutes les fiches ── -->
|
||||
<div class="hidden lg:flex lg:flex-1 lg:flex-col lg:overflow-hidden">
|
||||
<!-- Barre onglets desktop -->
|
||||
<div class="shrink-0 flex" style="background: var(--nav-surface); border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<button
|
||||
class="px-5 py-2 text-sm font-medium transition-colors"
|
||||
:style="desktopMapView === 'metropole'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setDesktopView('metropole')"
|
||||
>Métropolitain</button>
|
||||
<button
|
||||
class="px-5 py-2 text-sm font-medium transition-colors"
|
||||
:style="desktopMapView === 'outremer'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setDesktopView('outremer')"
|
||||
>Outre-mer</button>
|
||||
<button
|
||||
class="px-5 py-2 text-sm font-medium transition-colors"
|
||||
:style="desktopMapView === 'fiches'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setDesktopView('fiches')"
|
||||
>Toutes les fiches</button>
|
||||
</div>
|
||||
|
||||
<!-- Carte Métropole desktop -->
|
||||
<div v-show="desktopMapView === 'metropole'" class="flex-1 flex flex-col overflow-hidden">
|
||||
<div class="relative flex-1" style="min-height: 200px;">
|
||||
<ClientOnly>
|
||||
<NavMap
|
||||
ref="navMapRef"
|
||||
:orgs="metropoleOrgs"
|
||||
:selectedId="selectedId"
|
||||
@select-org="onSelectOrg"
|
||||
/>
|
||||
<template #fallback>
|
||||
<div class="w-full h-full flex items-center justify-center" style="background: var(--nav-bg-alt); color: var(--nav-text-muted);">Chargement de la carte…</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
<ChatbotPlaceholder @highlightOrgs="onHighlightOrgs" />
|
||||
</div>
|
||||
|
||||
<!-- Carte Outre-mer desktop -->
|
||||
<div v-show="desktopMapView === 'outremer'" class="flex-1 flex flex-col overflow-hidden">
|
||||
<div class="flex-1 overflow-y-auto">
|
||||
<ClientOnly>
|
||||
<OutremerMap
|
||||
:orgs="outremerOrgs"
|
||||
:selectedId="selectedId"
|
||||
@select-org="onSelectOrg"
|
||||
/>
|
||||
<template #fallback>
|
||||
<div class="flex items-center justify-center h-full text-sm" style="color: var(--nav-text-muted);">Chargement…</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
<ChatbotPlaceholder @highlightOrgs="onHighlightOrgs" />
|
||||
</div>
|
||||
|
||||
<!-- Panneau « Toutes les fiches » desktop (B3-M3) — remplace la carte,
|
||||
fiches sans géoloc incluses (gain principal de cette mission) -->
|
||||
<div v-show="desktopMapView === 'fiches'" class="flex-1 flex flex-col overflow-hidden">
|
||||
<div
|
||||
class="shrink-0 px-4 py-2"
|
||||
style="border-bottom: 1px solid var(--nav-bg-alt); background: var(--nav-surface);"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs font-medium underline"
|
||||
style="color: var(--nav-text-muted);"
|
||||
@click="setDesktopView('metropole')"
|
||||
>← Carte</button>
|
||||
</div>
|
||||
<FichesPanel
|
||||
:fiches="allFichesMini"
|
||||
:hashtags="[...FONCTIONS]"
|
||||
:selected="fonctions"
|
||||
:query="search"
|
||||
intention="Toutes les structures d'entraide, y compris celles sans adresse sur la carte. Cochez une fonction pour filtrer."
|
||||
@update:selected="onFonctions"
|
||||
@open="(fiche) => onSelectOrg(Number(fiche.id))"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ── VUE MOBILE : Onglets Métro/Outre-mer + carte pleine hauteur + sheet swipable ── -->
|
||||
|
||||
<!-- Onglets Métropolitain / Outre-mer / Toutes les fiches -->
|
||||
<div class="lg:hidden shrink-0 flex" style="background: var(--nav-surface); border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<button
|
||||
class="flex-1 py-2 text-sm font-medium transition-colors"
|
||||
:style="mobileMapView === 'metropole'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setMobileView('metropole')"
|
||||
>Métropolitain</button>
|
||||
<button
|
||||
class="flex-1 py-2 text-sm font-medium transition-colors"
|
||||
:style="mobileMapView === 'outremer'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setMobileView('outremer')"
|
||||
>Outre-mer</button>
|
||||
<button
|
||||
class="flex-1 py-2 text-sm font-medium transition-colors"
|
||||
:style="mobileMapView === 'fiches'
|
||||
? 'color: var(--nav-text); border-bottom: 2px solid var(--nav-primary-solid);'
|
||||
: 'color: var(--nav-text-muted); border-bottom: 2px solid transparent;'"
|
||||
@click="setMobileView('fiches')"
|
||||
>Fiches</button>
|
||||
</div>
|
||||
|
||||
<div class="lg:hidden flex-1 relative overflow-hidden">
|
||||
|
||||
<!-- Carte Métropole -->
|
||||
<div v-show="mobileMapView === 'metropole'" class="absolute inset-0">
|
||||
<!-- ═══════════════════════════════════════ VUE FICHES (B11) : Carte · Mixte · Fiches -->
|
||||
<VueFiches
|
||||
:vf="vf"
|
||||
intention="Les structures d'entraide du métier, y compris celles sans adresse sur la carte."
|
||||
libelle-recherche="Rechercher une structure…"
|
||||
:pending="pending"
|
||||
:selected-id="selectedId"
|
||||
:lien-page="(f) => `/fiche/${f.id}`"
|
||||
>
|
||||
<template #carte>
|
||||
<!-- Métropole -->
|
||||
<div v-show="vf.etat.sousVue === 'metropole'" class="relative flex-1 min-h-0">
|
||||
<ClientOnly>
|
||||
<NavMap
|
||||
ref="navMapMobileRef"
|
||||
:orgs="metropoleOrgs"
|
||||
:selectedId="selectedId"
|
||||
@select-org="onSelectOrgMobile"
|
||||
:survolId="survolNum"
|
||||
:centrage="centrageMetropole"
|
||||
@select-org="onSelectOrg"
|
||||
@survol="(id) => (vf.survolId = id)"
|
||||
/>
|
||||
<template #fallback>
|
||||
<div
|
||||
class="w-full h-full flex items-center justify-center"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted);"
|
||||
>
|
||||
Chargement de la carte…
|
||||
</div>
|
||||
<div class="w-full h-full flex items-center justify-center" style="background: var(--nav-bg-alt); color: var(--nav-text-muted);">Chargement de la carte…</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
|
||||
<!-- Carte Outre-mer (scroll vertical, pleine largeur) -->
|
||||
<div v-show="mobileMapView === 'outremer'" class="absolute inset-0 overflow-y-auto" style="background: var(--nav-bg);">
|
||||
<!-- Outre-mer -->
|
||||
<div v-show="vf.etat.sousVue === 'outremer'" class="flex-1 min-h-0 overflow-y-auto" style="background: var(--nav-bg);">
|
||||
<ClientOnly>
|
||||
<OutremerMap
|
||||
:orgs="outremerOrgs"
|
||||
:selectedId="selectedId"
|
||||
@select-org="onSelectOrgMobile"
|
||||
@select-org="onSelectOrg"
|
||||
/>
|
||||
<template #fallback>
|
||||
<div class="flex items-center justify-center h-48" style="color: var(--nav-text-muted);">
|
||||
Chargement…
|
||||
</div>
|
||||
<div class="flex items-center justify-center h-48 text-sm" style="color: var(--nav-text-muted);">Chargement…</div>
|
||||
</template>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
|
||||
<!-- Zone « Fiches » mobile (B3-M3) — pleine hauteur sous la barre d'onglets,
|
||||
pas de carte dessous donc pas de sheet demi-hauteur (même logique que
|
||||
la vue graphe qui masque aussi le MobileSheet). Fix 2026-09-25 : la
|
||||
version précédente empilait un second MobileSheet (état half par
|
||||
défaut) au-dessus d'un fond neutre plein écran, laissant ~45% de
|
||||
hauteur vide au-dessus du panneau. -->
|
||||
<div
|
||||
v-show="mobileMapView === 'fiches'"
|
||||
class="absolute inset-0 flex flex-col overflow-hidden"
|
||||
style="background: var(--nav-bg-alt);"
|
||||
>
|
||||
<FichesPanel
|
||||
:fiches="allFichesMini"
|
||||
:hashtags="[...FONCTIONS]"
|
||||
:selected="fonctions"
|
||||
:query="search"
|
||||
intention="Toutes les structures d'entraide, y compris celles sans adresse sur la carte. Cochez une fonction pour filtrer."
|
||||
@update:selected="onFonctions"
|
||||
@open="(fiche) => onSelectOrgMobile(Number(fiche.id))"
|
||||
/>
|
||||
<!-- Chatbot sous la carte (ordinateur) -->
|
||||
<div class="hidden lg:block shrink-0">
|
||||
<ChatbotPlaceholder @highlightOrgs="onHighlightOrgs" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Bottom sheet swipable (Métropole et Outre-mer uniquement) -->
|
||||
<ClientOnly v-if="mobileMapView !== 'fiches'">
|
||||
<MobileSheet :resultCount="filtered.length" :pending="pending">
|
||||
<!-- Barre recherche -->
|
||||
<div class="px-3 pt-2 pb-2" style="border-bottom: 1px solid var(--nav-bg-alt);">
|
||||
<label class="mobile-search-label" aria-label="Rechercher une organisation">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="color: var(--nav-text-muted); flex-shrink: 0;">
|
||||
<circle cx="11" cy="11" r="8"/>
|
||||
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
||||
</svg>
|
||||
<input
|
||||
v-model="mobileSearch"
|
||||
type="search"
|
||||
placeholder="Rechercher…"
|
||||
class="mobile-search-input"
|
||||
autocomplete="off"
|
||||
@input="onSearch(mobileSearch)"
|
||||
/>
|
||||
<button
|
||||
v-if="mobileSearch"
|
||||
type="button"
|
||||
class="mobile-search-clear"
|
||||
aria-label="Effacer"
|
||||
@click.stop="mobileSearch = ''; onSearch('')"
|
||||
>
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
||||
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
|
||||
</svg>
|
||||
</button>
|
||||
</label>
|
||||
|
||||
<!-- Filtres ÉCHELLE — Chip variant echelle (B3-M1 : alignées sur EchelleFilter.vue,
|
||||
dupliquées ici car la sheet mobile ne passe pas par NavSidebar) -->
|
||||
<div class="mt-2">
|
||||
<span class="text-xs font-bold uppercase tracking-wide block mb-1" style="color: var(--nav-text-muted);">ÉCHELLE</span>
|
||||
<ChipGroup aria-label="Filtrer par échelle">
|
||||
<Chip
|
||||
v-for="opt in ECHELLES"
|
||||
:key="opt"
|
||||
:label="opt"
|
||||
variant="echelle"
|
||||
:active="echelle.includes(opt)"
|
||||
@toggle="toggleEchelle(opt)"
|
||||
/>
|
||||
</ChipGroup>
|
||||
</div>
|
||||
|
||||
<!-- Filtres FONCTION — Chip variant fonction (B3-M1, idem) -->
|
||||
<div class="mt-2">
|
||||
<span class="text-xs font-bold uppercase tracking-wide block mb-1" style="color: var(--nav-text-muted);">FONCTION</span>
|
||||
<ChipGroup aria-label="Filtrer par fonction">
|
||||
<Chip
|
||||
v-for="fn in FONCTIONS"
|
||||
:key="fn"
|
||||
:label="fn"
|
||||
variant="fonction"
|
||||
:active="fonctions.includes(fn)"
|
||||
:count="fonctions.includes(fn) ? (fonctions.indexOf(fn) + 1) : (fonctionCount[fn] ?? 0)"
|
||||
@toggle="toggleFonction(fn)"
|
||||
/>
|
||||
</ChipGroup>
|
||||
</div>
|
||||
|
||||
<button
|
||||
v-if="hasActiveFilters"
|
||||
@click="resetFilters"
|
||||
class="mt-2 text-xs"
|
||||
style="color: var(--nav-text-muted); text-decoration: underline;"
|
||||
>✕ Effacer les filtres</button>
|
||||
</div>
|
||||
|
||||
<!-- Compteur + Liste fiches -->
|
||||
<div class="px-3 py-2">
|
||||
<div class="text-xs font-bold uppercase tracking-wide mb-2" style="color: var(--nav-text-muted);">
|
||||
{{ filtered.length }} résultat{{ filtered.length > 1 ? 's' : '' }}
|
||||
</div>
|
||||
<div v-if="pending" class="flex items-center justify-center py-8" style="color: var(--nav-text-muted);">
|
||||
Chargement des fiches…
|
||||
</div>
|
||||
<div v-else-if="filtered.length === 0" class="text-center py-8">
|
||||
<p class="text-sm mb-2" style="color: var(--nav-text-muted);">Aucun résultat pour ces filtres.</p>
|
||||
<button @click="resetFilters" class="text-sm underline" style="color: var(--nav-primary-solid);">
|
||||
Effacer les filtres
|
||||
</button>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<div
|
||||
v-for="org in filtered"
|
||||
:key="org.Id"
|
||||
class="block rounded-lg p-3 transition-all cursor-pointer"
|
||||
:style="selectedId === org.Id
|
||||
? 'background: var(--nav-bg-alt); border-left: 3px solid var(--nav-accent);'
|
||||
: 'background: var(--nav-surface); border-left: 3px solid transparent;'"
|
||||
@click="onSelectOrgMobile(org.Id)"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-2">
|
||||
<span class="font-semibold text-sm leading-snug" style="color: var(--nav-text);">{{ org.nom }}</span>
|
||||
<span
|
||||
v-if="org.echelle"
|
||||
class="shrink-0 px-2 py-0.5 rounded-full text-xs font-medium"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted);"
|
||||
>{{ org.echelle }}</span>
|
||||
</div>
|
||||
<div v-if="fonctionsList(org).length" class="mt-1 flex flex-wrap gap-1">
|
||||
<span
|
||||
v-for="fn in fonctionsList(org)"
|
||||
:key="fn"
|
||||
class="px-1.5 py-0.5 rounded text-xs"
|
||||
style="background: var(--nav-bg-alt); color: var(--nav-text-muted);"
|
||||
>{{ fn }}</span>
|
||||
</div>
|
||||
<div v-if="org.localisation_ville" class="mt-1 text-xs" style="color: var(--nav-text-muted);">
|
||||
{{ org.localisation_ville }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</MobileSheet>
|
||||
</ClientOnly>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<!-- ═══════════════════════════════════════ MODAL FICHE (desktop) -->
|
||||
<FicheModal
|
||||
v-model="ficheModalOpen"
|
||||
:orgId="ficheModalId"
|
||||
/>
|
||||
<!-- Détail (B12) : la fiche complète vient de la liste (même enregistrement NocoDB que /api/fiche/:id) -->
|
||||
<template #detail="{ fiche, filtrer }">
|
||||
<template v-if="orgParId.get(String(fiche.id))">
|
||||
<FicheDetail
|
||||
:key="fiche.id"
|
||||
:org="orgParId.get(String(fiche.id))!"
|
||||
compact
|
||||
etiquettes-cliquables
|
||||
@etiquette="(t) => filtrer('fonctions', t)"
|
||||
/>
|
||||
<CommentSection :key="`c-${fiche.id}`" :org-id="Number(fiche.id)" :refresh="commentaires" />
|
||||
<CommentForm :key="`f-${fiche.id}`" :org-id="Number(fiche.id)" @submitted="commentaires++" />
|
||||
</template>
|
||||
</template>
|
||||
</VueFiches>
|
||||
|
||||
<!-- ═══════════════════════════════════════ BOUTON CHATBOT FLOTTANT (mobile) -->
|
||||
<button
|
||||
class="lg:hidden fixed bottom-6 right-4 z-[1000] flex items-center gap-2 px-4 rounded-full shadow-lg"
|
||||
style="
|
||||
class="lg:hidden fixed right-4 z-[1000] flex items-center gap-2 px-4 rounded-full shadow-lg"
|
||||
:style="`
|
||||
bottom: ${basFlottants}px;
|
||||
height: 48px;
|
||||
background: var(--nav-primary);
|
||||
opacity: 0.92;
|
||||
background: var(--nav-primary-solid);
|
||||
color: var(--nav-text-on-primary);
|
||||
box-shadow: 0 4px 16px rgba(26,34,56,0.25);
|
||||
font-family: var(--nav-font);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
"
|
||||
`"
|
||||
aria-label="Ouvrir l'assistant Chatbot"
|
||||
@click="chatbotOpen = true"
|
||||
>
|
||||
@@ -377,6 +106,7 @@
|
||||
<button
|
||||
class="mission-info-btn"
|
||||
type="button"
|
||||
:style="vf.largeur === 'telephone' ? `bottom: ${basFlottants}px;` : undefined"
|
||||
@click="missionOpen = true"
|
||||
aria-label="À propos de cette carte d'entraide"
|
||||
title="À propos de cette carte"
|
||||
@@ -399,291 +129,128 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Org } from '~/types/org'
|
||||
import type { ConfigVueFiches } from '~/utils/vueFiches'
|
||||
import { DOM_TOM } from '~/composables/useFicheAdapter'
|
||||
|
||||
// ── URL query params sync ─────────────────────────────────────────────────
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
const search = ref<string>((route.query.q as string) ?? '')
|
||||
const echelle = ref<string[]>(
|
||||
route.query.echelle
|
||||
? (route.query.echelle as string).split(',').filter(Boolean)
|
||||
: []
|
||||
)
|
||||
const fonctions = ref<string[]>(
|
||||
route.query.fonctions
|
||||
? (route.query.fonctions as string).split(',').filter(Boolean)
|
||||
: []
|
||||
)
|
||||
const territoire = ref<string | null>((route.query.territoire as string) ?? null)
|
||||
const territoireMode = ref<string>(
|
||||
(route.query.mode as string) === 'outremer' ? 'outremer' : 'metropole'
|
||||
)
|
||||
// ── Données ───────────────────────────────────────────────────────────────
|
||||
const { data, pending } = await useFetch<{ list: Org[]; source: string }>('/api/organisations')
|
||||
|
||||
type MapView = 'metropole' | 'outremer' | 'fiches'
|
||||
const orgs = computed<Org[]>(() => data.value?.list ?? [])
|
||||
const dataSource = computed(() => data.value?.source ?? 'nocodb')
|
||||
|
||||
const desktopMapView = ref<MapView>((route.query.vue as string) === 'fiches' ? 'fiches' : 'metropole')
|
||||
const selectedId = ref<number | null>(null)
|
||||
const chatbotOpen = ref(false)
|
||||
const ficheModalOpen = ref(false)
|
||||
const ficheModalId = ref<number | null>(null)
|
||||
const mobileMapView = ref<MapView>((route.query.vue as string) === 'fiches' ? 'fiches' : 'metropole')
|
||||
const missionOpen = ref(false)
|
||||
|
||||
onMounted(() => {
|
||||
try {
|
||||
if (!localStorage.getItem('aep_mission_seen')) {
|
||||
missionOpen.value = true
|
||||
}
|
||||
} catch {}
|
||||
// `territoire=` (lien existant) : pré-filtre de page, hors de la vue fiches
|
||||
const orgsTerritoire = computed<Org[]>(() => {
|
||||
const t = route.query.territoire
|
||||
return typeof t === 'string' && t ? orgs.value.filter((o) => o.territoire === t) : orgs.value
|
||||
})
|
||||
// Surlignage temporaire (5 sec) suite à une réponse chatbot
|
||||
// → sélectionne le premier ID recommandé sur la carte, puis remet à null
|
||||
|
||||
// ── Vue fiches (B11) : l'état vit dans l'URL ──────────────────────────────
|
||||
const FONCTIONS = ['Juridique', 'Technique', 'Économique', 'Administratif', 'Chantier', 'Comptabilité', 'Développement', 'Formation', "Gestion d'agence", 'Santé mentale']
|
||||
const ECHELLES = ['National', 'Régional', 'Local']
|
||||
const enValeurs = (l: string[]) => l.map((v) => ({ valeur: v, libelle: v }))
|
||||
|
||||
const config: ConfigVueFiches = {
|
||||
dimensions: [
|
||||
{ cle: 'fonctions', libelle: 'Fonction', variante: 'fonction', valeurs: enValeurs(FONCTIONS) },
|
||||
{ cle: 'echelle', libelle: 'Échelle', variante: 'echelle', valeurs: enValeurs(ECHELLES) },
|
||||
],
|
||||
tris: ['pertinence', 'nom', 'recent'],
|
||||
groupes: [
|
||||
{ cle: 'fonction', libelle: 'Fonction', dimension: 'fonctions', sans: 'Sans fonction' },
|
||||
{ cle: 'echelle', libelle: 'Échelle', dimension: 'echelle', sans: 'Sans échelle' },
|
||||
{ cle: 'territoire', libelle: 'Territoire', dimension: 'territoire', sans: 'Sans territoire', valeurs: enValeurs(['Métropole', ...DOM_TOM]) },
|
||||
],
|
||||
etats: ['carte', 'mixte', 'fiches'],
|
||||
sousVues: {
|
||||
parametre: 'mode',
|
||||
defaut: 'metropole',
|
||||
valeurs: [{ valeur: 'metropole', libelle: 'Métropole' }, { valeur: 'outremer', libelle: 'Outre-mer' }],
|
||||
},
|
||||
}
|
||||
|
||||
const { toMini } = useFicheAdapter()
|
||||
const fichesMini = computed(() => orgsTerritoire.value.map((o) => toMini(o)))
|
||||
const vf = useVueFiches(fichesMini, config)
|
||||
|
||||
// La carte ne montre que le résultat courant (recherche + filtres)
|
||||
const orgsFiltres = computed<Org[]>(() => orgsTerritoire.value.filter((o) => vf.idsResultat.has(String(o.Id))))
|
||||
const metropoleOrgs = computed<Org[]>(() => orgsFiltres.value.filter((o) => !o.territoire || !DOM_TOM.includes(o.territoire)))
|
||||
const outremerOrgs = computed<Org[]>(() => orgsFiltres.value.filter((o) => o.territoire && DOM_TOM.includes(o.territoire)))
|
||||
const survolNum = computed(() => (vf.survolId == null ? null : Number(vf.survolId)))
|
||||
|
||||
// ── Sélection (B12) : la fiche ouverte vit dans l'URL (`fiche=`), détail en panneau ──
|
||||
const orgParId = computed(() => new Map(orgs.value.map((o) => [String(o.Id), o])))
|
||||
|
||||
// Épingle et carte-fiche allumées : la fiche ouverte, ou 5 s celle que le chatbot désigne
|
||||
const surligneId = ref<number | null>(null)
|
||||
const selectedId = computed<number | null>(() => surligneId.value ?? (vf.ficheId != null ? Number(vf.ficheId) : null))
|
||||
|
||||
const commentaires = ref(0)
|
||||
|
||||
function onSelectOrg(id: number) {
|
||||
vf.ouvrirFiche(id)
|
||||
}
|
||||
|
||||
// « Voir sur la carte » : la bonne sous-vue (Métropole ou Outre-mer), puis l'épingle
|
||||
const centrageMetropole = ref<{ id: number; n: number } | null>(null)
|
||||
watch(() => vf.centrage, (c) => {
|
||||
if (!c) return
|
||||
const o = orgParId.value.get(c.id)
|
||||
const dom = !!o?.territoire && DOM_TOM.includes(o.territoire)
|
||||
if (vf.etat.sousVue !== (dom ? 'outremer' : 'metropole')) vf.setSousVue(dom ? 'outremer' : 'metropole')
|
||||
if (!dom) centrageMetropole.value = { id: Number(c.id), n: c.n }
|
||||
})
|
||||
|
||||
// Le bouton retour de /fiche/:id (« Ouvrir la page de la fiche ») revient à la même vue
|
||||
if (import.meta.client) {
|
||||
watch(() => route.fullPath, () => {
|
||||
try {
|
||||
sessionStorage.setItem('nav_back_filters', new URLSearchParams(route.query as Record<string, string>).toString())
|
||||
} catch {}
|
||||
}, { immediate: true })
|
||||
}
|
||||
|
||||
// Surlignage temporaire (5 s) suite à une réponse chatbot
|
||||
let highlightTimer: ReturnType<typeof setTimeout> | null = null
|
||||
const prevSelectedId = ref<number | null>(null)
|
||||
|
||||
function onHighlightOrgs(ids: (number | string)[]) {
|
||||
if (!ids.length) return
|
||||
const firstId = typeof ids[0] === 'string' ? parseInt(ids[0], 10) : ids[0]
|
||||
if (isNaN(firstId)) return
|
||||
|
||||
// Sauvegarde la sélection courante
|
||||
prevSelectedId.value = selectedId.value
|
||||
selectedId.value = firstId
|
||||
|
||||
surligneId.value = firstId
|
||||
if (highlightTimer) clearTimeout(highlightTimer)
|
||||
highlightTimer = setTimeout(() => {
|
||||
// Restaure la sélection précédente (ou null)
|
||||
selectedId.value = prevSelectedId.value
|
||||
prevSelectedId.value = null
|
||||
surligneId.value = null
|
||||
highlightTimer = null
|
||||
}, 5000)
|
||||
}
|
||||
|
||||
// Ref locale barre de recherche mobile (synchronisée avec search via onSearch)
|
||||
const mobileSearch = ref<string>((route.query.q as string) ?? '')
|
||||
|
||||
// Refs vers les instances NavMap (desktop + mobile séparées via deux <ClientOnly>)
|
||||
const navMapRef = ref<any>(null)
|
||||
const navMapMobileRef = ref<any>(null)
|
||||
|
||||
// Sync URL <-> état filtres
|
||||
function syncUrl() {
|
||||
const q: Record<string, string> = {}
|
||||
if (search.value) q.q = search.value
|
||||
if (echelle.value.length) q.echelle = echelle.value.join(',')
|
||||
if (fonctions.value.length) q.fonctions = fonctions.value.join(',')
|
||||
if (territoire.value) q.territoire = territoire.value
|
||||
if (territoireMode.value === 'outremer') q.mode = 'outremer'
|
||||
if (desktopMapView.value === 'fiches' || mobileMapView.value === 'fiches') q.vue = 'fiches'
|
||||
router.replace({ query: Object.keys(q).length ? q : undefined })
|
||||
}
|
||||
|
||||
// Changement de vue (carte/fiches) — passe par syncUrl pour poser/retirer ?vue=fiches
|
||||
function setDesktopView(v: MapView) {
|
||||
desktopMapView.value = v
|
||||
syncUrl()
|
||||
}
|
||||
function setMobileView(v: MapView) {
|
||||
mobileMapView.value = v
|
||||
syncUrl()
|
||||
}
|
||||
|
||||
// Sauvegarde les filtres courants dans sessionStorage pour le bouton retour des fiches
|
||||
function storeFiltersForBack() {
|
||||
if (typeof window === 'undefined') return
|
||||
const q: Record<string, string> = {}
|
||||
if (search.value) q.q = search.value
|
||||
if (echelle.value.length) q.echelle = echelle.value.join(',')
|
||||
if (fonctions.value.length) q.fonctions = fonctions.value.join(',')
|
||||
if (territoire.value) q.territoire = territoire.value
|
||||
if (territoireMode.value === 'outremer') q.mode = 'outremer'
|
||||
const qs = new URLSearchParams(q).toString()
|
||||
sessionStorage.setItem('nav_back_filters', qs)
|
||||
}
|
||||
|
||||
function onSearch(v: string) { search.value = v; syncUrl(); storeFiltersForBack() }
|
||||
function onMode(v: string) { territoireMode.value = v; syncUrl(); storeFiltersForBack() }
|
||||
function onEchelle(v: string[]) { echelle.value = v; syncUrl(); storeFiltersForBack() }
|
||||
function onFonctions(v: string[]) { fonctions.value = v; syncUrl(); storeFiltersForBack() }
|
||||
function onTerritoire(v: string | null) { territoire.value = v; syncUrl(); storeFiltersForBack() }
|
||||
|
||||
function onSelectOrg(id: number) {
|
||||
selectedId.value = selectedId.value === id ? null : id
|
||||
// Desktop : ouvrir le modal fiche
|
||||
if (typeof window !== 'undefined' && window.innerWidth >= 1024) {
|
||||
ficheModalId.value = id
|
||||
ficheModalOpen.value = true
|
||||
}
|
||||
}
|
||||
|
||||
// Tap card mobile → ouvre la fiche détaillée
|
||||
function onSelectOrgMobile(id: number) {
|
||||
selectedId.value = id
|
||||
storeFiltersForBack()
|
||||
router.push(`/fiche/${id}`)
|
||||
}
|
||||
|
||||
function onHoverOrg(id: number | null) {
|
||||
if (id !== null) selectedId.value = id
|
||||
}
|
||||
|
||||
const hasActiveFilters = computed(() =>
|
||||
!!search.value || echelle.value.length > 0 || fonctions.value.length > 0 || !!territoire.value
|
||||
)
|
||||
|
||||
function resetFilters() {
|
||||
search.value = ''
|
||||
echelle.value = []
|
||||
fonctions.value = []
|
||||
territoire.value = null
|
||||
router.replace({ query: undefined })
|
||||
}
|
||||
|
||||
// Tagging compact mobile — toggle direct
|
||||
function toggleEchelle(opt: string) {
|
||||
if (echelle.value.includes(opt)) {
|
||||
onEchelle(echelle.value.filter(v => v !== opt))
|
||||
} else {
|
||||
onEchelle([...echelle.value, opt])
|
||||
}
|
||||
}
|
||||
|
||||
function toggleFonction(fn: string) {
|
||||
if (fonctions.value.includes(fn)) {
|
||||
onFonctions(fonctions.value.filter(f => f !== fn))
|
||||
} else {
|
||||
onFonctions([...fonctions.value, fn])
|
||||
}
|
||||
}
|
||||
|
||||
// Sync recherche depuis app.vue top nav (via URL ?q=)
|
||||
watch(() => route.query.q, (v) => {
|
||||
search.value = (v as string) ?? ''
|
||||
})
|
||||
|
||||
// ── Données ───────────────────────────────────────────────────────────────
|
||||
const { data, pending, error } = await useFetch<{ list: Org[]; source: string }>('/api/organisations')
|
||||
|
||||
const orgs = computed<Org[]>(() => data.value?.list ?? [])
|
||||
const dataSource = computed(() => data.value?.source ?? 'nocodb')
|
||||
|
||||
// Fiche aléatoire — réagit au ?random=1
|
||||
watch(() => route.query.random, (v) => {
|
||||
if (v === '1' && orgs.value.length > 0) {
|
||||
const randomOrg = orgs.value[Math.floor(Math.random() * orgs.value.length)]
|
||||
router.replace({ path: `/fiche/${randomOrg.Id}` })
|
||||
}
|
||||
})
|
||||
|
||||
// ── Filtrage côté client ──────────────────────────────────────────────────
|
||||
const filtered = computed<Org[]>(() => {
|
||||
let result = orgs.value
|
||||
|
||||
if (search.value.trim()) {
|
||||
const q = search.value.toLowerCase()
|
||||
result = result.filter(
|
||||
(o) =>
|
||||
o.nom?.toLowerCase().includes(q) ||
|
||||
o.localisation_ville?.toLowerCase().includes(q)
|
||||
)
|
||||
}
|
||||
|
||||
if (echelle.value.length) {
|
||||
result = result.filter((o) => o.echelle && echelle.value.includes(o.echelle))
|
||||
}
|
||||
|
||||
if (fonctions.value.length) {
|
||||
// Garde les orgs qui matchent au moins 1 fonction sélectionnée
|
||||
result = result.filter((o) => {
|
||||
const orgFns = (o.tags_fonction ?? '').split(',').map((f) => f.trim()).filter(Boolean)
|
||||
return fonctions.value.some((fn) => orgFns.includes(fn))
|
||||
})
|
||||
// Tri par score pondéré : priorité 1 (1er cliqué) = poids le plus fort
|
||||
const n = fonctions.value.length
|
||||
const score = (o: Org) =>
|
||||
fonctions.value.reduce((s, fn, i) => {
|
||||
const fns = (o.tags_fonction ?? '').split(',').map((f) => f.trim()).filter(Boolean)
|
||||
return s + (fns.includes(fn) ? (n - i) : 0)
|
||||
}, 0)
|
||||
result = [...result].sort((a, b) => score(b) - score(a))
|
||||
}
|
||||
|
||||
if (territoire.value) {
|
||||
result = result.filter((o) => o.territoire === territoire.value)
|
||||
}
|
||||
|
||||
return result
|
||||
})
|
||||
|
||||
// Panneau « Toutes les fiches » (B3-M3) — mêmes fiches que `filtered`, sans
|
||||
// filtrer par géolocalisation : c'est le gain principal de cette mission,
|
||||
// les fiches sans latitude/longitude (invisibles sur la carte) y apparaissent.
|
||||
const { toMini } = useFicheAdapter()
|
||||
const allFichesMini = computed(() => filtered.value.map((org) => toMini(org)))
|
||||
|
||||
const DOM_TOM = ['Guadeloupe', 'Martinique', 'Guyane', 'La Réunion', 'Mayotte']
|
||||
const DOM_TOM_LIST = DOM_TOM
|
||||
|
||||
const metropoleOrgs = computed<Org[]>(() =>
|
||||
filtered.value.filter(o => !o.territoire || !DOM_TOM.includes(o.territoire))
|
||||
)
|
||||
|
||||
const outremerOrgs = computed<Org[]>(() => {
|
||||
if (territoire.value && DOM_TOM.includes(territoire.value)) {
|
||||
return filtered.value.filter(o => o.territoire === territoire.value)
|
||||
}
|
||||
return filtered.value.filter(o => o.territoire && DOM_TOM.includes(o.territoire))
|
||||
})
|
||||
|
||||
const outremerCountByDom = computed<Record<string, number>>(() => {
|
||||
const counts: Record<string, number> = {}
|
||||
DOM_TOM.forEach(d => { counts[d] = 0 })
|
||||
filtered.value.forEach(o => {
|
||||
if (o.territoire && DOM_TOM.includes(o.territoire)) {
|
||||
counts[o.territoire] = (counts[o.territoire] ?? 0) + 1
|
||||
// Fiche aléatoire — ?random=1, au chargement comme en navigation interne
|
||||
if (import.meta.client) {
|
||||
watch([() => route.query.random, () => orgs.value.length], ([v, n]) => {
|
||||
if (v === '1' && n > 0) {
|
||||
const randomOrg = orgs.value[Math.floor(Math.random() * n)]
|
||||
router.replace({ path: `/fiche/${randomOrg.Id}` })
|
||||
}
|
||||
})
|
||||
return counts
|
||||
})
|
||||
|
||||
// ── Compteurs ─────────────────────────────────────────────────────────────
|
||||
const ECHELLES = ['National', 'Régional', 'Local'] as const
|
||||
const ECHELLE_LABELS: Record<string, string> = { National: 'Nat', Régional: 'Rég', Local: 'Loc' }
|
||||
const FONCTIONS = ['Juridique', 'Technique', 'Économique', 'Administratif', 'Chantier', 'Comptabilité', 'Développement', 'Formation', "Gestion d'agence", 'Santé mentale'] as const
|
||||
const TERRITOIRES = ['Métropole', 'Guadeloupe', 'Martinique', 'Guyane', 'La Réunion', 'Mayotte']
|
||||
|
||||
const echelleCount = computed<Record<string, number>>(() => {
|
||||
const counts: Record<string, number> = {}
|
||||
ECHELLES.forEach((e) => { counts[e] = 0 })
|
||||
orgs.value.forEach((o) => { if (o.echelle) counts[o.echelle] = (counts[o.echelle] ?? 0) + 1 })
|
||||
return counts
|
||||
})
|
||||
|
||||
const fonctionCount = computed<Record<string, number>>(() => {
|
||||
const counts: Record<string, number> = {}
|
||||
FONCTIONS.forEach((f) => { counts[f] = 0 })
|
||||
orgs.value.forEach((o) => {
|
||||
const fns = (o.tags_fonction ?? '').split(',').map((f) => f.trim()).filter(Boolean)
|
||||
fns.forEach((fn) => { counts[fn] = (counts[fn] ?? 0) + 1 })
|
||||
})
|
||||
return counts
|
||||
})
|
||||
|
||||
const territoireCount = computed<Record<string, number>>(() => {
|
||||
const counts: Record<string, number> = {}
|
||||
TERRITOIRES.forEach((t) => { counts[t] = 0 })
|
||||
orgs.value.forEach((o) => { if (o.territoire) counts[o.territoire] = (counts[o.territoire] ?? 0) + 1 })
|
||||
counts['Métropole'] = orgs.value.filter(o => !o.territoire || !DOM_TOM.includes(o.territoire)).length
|
||||
return counts
|
||||
})
|
||||
|
||||
// ── Helpers ───────────────────────────────────────────────────────────────
|
||||
function fonctionsList(org: Org): string[] {
|
||||
return (org.tags_fonction ?? '').split(',').map((f) => f.trim()).filter(Boolean).slice(0, 3)
|
||||
}, { immediate: true })
|
||||
}
|
||||
|
||||
useHead({ title: 'AEP — Cartographie de l\'écologie politique architecturale' })
|
||||
// ── Boutons flottants (téléphone) : au-dessus du pied « Voir les N fiches » en état Carte ──
|
||||
const chatbotOpen = ref(false)
|
||||
const missionOpen = ref(false)
|
||||
const basFlottants = computed(() => (vf.largeur === 'telephone' && vf.vueAffichee === 'carte' ? 76 : 24))
|
||||
|
||||
onMounted(() => {
|
||||
try {
|
||||
if (!localStorage.getItem('aep_mission_seen')) missionOpen.value = true
|
||||
} catch {}
|
||||
})
|
||||
|
||||
// Un lien partagé avec fiche= porte le nom de la fiche (onglet, aperçu de lien), dès le rendu serveur
|
||||
useHead({ title: computed(() => (vf.ficheOuverte ? `${vf.ficheOuverte.nom} — AEP` : 'AEP — Cartographie de l\'écologie politique architecturale')) })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -708,6 +275,6 @@ useHead({ title: 'AEP — Cartographie de l\'écologie politique architecturale'
|
||||
.mission-info-btn:hover { opacity: 0.85; transform: translateY(-1px); color: var(--nav-text); }
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.mission-info-btn { bottom: 16px; left: 340px; }
|
||||
.mission-info-btn { bottom: 10px; left: auto; right: 52px; }
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,56 +1,23 @@
|
||||
<template>
|
||||
<!-- B10-M5 : plus de sous-onglets ici, la nav XL porte « Recherche média » et « Publications » (?tab=projets) -->
|
||||
<div class="media-page" style="background: var(--nav-bg);">
|
||||
<nav class="subtabs" style="display:flex; gap:0; border-bottom: 1px solid var(--nav-bg-alt); background: var(--nav-surface); padding: 0 1rem;">
|
||||
<button
|
||||
:class="['subtab-btn', { active: tab === 'visuel' }]"
|
||||
@click="tab = 'visuel'"
|
||||
>
|
||||
📚 bibliothèque des pensées écologiques
|
||||
</button>
|
||||
<button
|
||||
:class="['subtab-btn', { active: tab === 'projets' }]"
|
||||
@click="tab = 'projets'"
|
||||
>
|
||||
📐 Projets
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<MediaTabVisuel v-if="tab === 'visuel'" />
|
||||
<MediaTabProjets v-else-if="tab === 'projets'" />
|
||||
<MediaTabProjets v-else />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
const tab = ref<'visuel' | 'projets'>(
|
||||
(['visuel', 'projets'].includes(route.query.tab as string)
|
||||
? route.query.tab as 'visuel' | 'projets'
|
||||
: 'visuel')
|
||||
)
|
||||
|
||||
watch(tab, (newTab) => {
|
||||
router.replace({ query: { ...route.query, tab: newTab } })
|
||||
// Lu à chaque changement de ?tab= (un lien /media → /media?tab=projets ne remonte pas la page).
|
||||
const tab = ref<'visuel' | 'projets'>(route.query.tab === 'projets' ? 'projets' : 'visuel')
|
||||
watch(() => route.query.tab, (t) => {
|
||||
tab.value = t === 'projets' ? 'projets' : 'visuel'
|
||||
})
|
||||
|
||||
useHead({ title: 'AEP - Media' })
|
||||
useHead(() => ({ title: tab.value === 'projets' ? 'AEP - Publications' : 'AEP - Recherche média' }))
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.media-page { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
|
||||
.subtabs { display: flex; gap: 0; flex-shrink: 0; }
|
||||
.subtab-btn {
|
||||
padding: 10px 18px;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
background: none;
|
||||
border: none;
|
||||
border-bottom: 2px solid transparent;
|
||||
cursor: pointer;
|
||||
color: var(--nav-text-muted);
|
||||
transition: color 0.15s, border-color 0.15s;
|
||||
}
|
||||
.subtab-btn:hover { color: var(--nav-text); }
|
||||
.subtab-btn.active { color: var(--nav-primary-solid); border-bottom-color: var(--nav-primary-solid); font-weight: 600; }
|
||||
</style>
|
||||
|
||||
@@ -254,8 +254,11 @@
|
||||
<!-- Messages de la conversation -->
|
||||
<template v-for="(msg, i) in chatMessages" :key="i">
|
||||
<div :class="['taff-msg', msg.role === 'user' ? 'taff-msg--user' : 'taff-msg--bot']">
|
||||
<div v-if="msg.role === 'bot'" class="md-content" v-html="renderMd(msg.content)" />
|
||||
<span v-else>{{ msg.content }}</span>
|
||||
<template v-if="msg.role === 'bot'">
|
||||
<ChatModeBadge :profondeur="msg.profondeur" />
|
||||
<div class="md-content" v-html="renderMd(msg.content)" />
|
||||
</template>
|
||||
<span v-if="msg.role !== 'bot'">{{ msg.content }}</span>
|
||||
</div>
|
||||
<!-- Plateformes recommandées -->
|
||||
<div v-if="msg.role === 'bot' && msg.recommandations?.length" class="taff-chat-recos">
|
||||
@@ -275,6 +278,13 @@
|
||||
<div v-if="chatLoading" class="taff-msg taff-msg--bot">
|
||||
<span class="taff-typing"><span/><span/><span/></span>
|
||||
</div>
|
||||
|
||||
<ChatNewConversation v-if="chatHasHistory && !chatLoading" @reset="clearChat" />
|
||||
</div>
|
||||
|
||||
<!-- Mode de réponse -->
|
||||
<div class="taff-chat-mode">
|
||||
<ChatModeToggle v-model="chatProfondeur" :disabled="chatLoading" />
|
||||
</div>
|
||||
|
||||
<!-- Input -->
|
||||
@@ -581,6 +591,9 @@ interface ChatMessage {
|
||||
role: 'user' | 'bot'
|
||||
content: string
|
||||
recommandations?: { id: string; nom: string; raison: string }[]
|
||||
profondeur?: string
|
||||
/** Message d'erreur : affiché mais jamais persisté */
|
||||
transient?: boolean
|
||||
}
|
||||
|
||||
const { render: renderMd } = useMarkdown()
|
||||
@@ -588,7 +601,8 @@ const { render: renderMd } = useMarkdown()
|
||||
const chatOpen = ref(false)
|
||||
const chatInput = ref('')
|
||||
const chatLoading = ref(false)
|
||||
const chatMessages = ref<ChatMessage[]>([])
|
||||
const { messages: chatMessages, hasHistory: chatHasHistory, clear: clearChat } = useChatSession<ChatMessage>('taff')
|
||||
const chatProfondeur = useChatProfondeur('taff')
|
||||
const chatMessagesEl = ref<HTMLElement | null>(null)
|
||||
|
||||
async function sendChat() {
|
||||
@@ -597,20 +611,22 @@ async function sendChat() {
|
||||
chatMessages.value.push({ role: 'user', content: q })
|
||||
chatInput.value = ''
|
||||
chatLoading.value = true
|
||||
const mode = chatProfondeur.value
|
||||
await nextTick()
|
||||
chatMessagesEl.value?.scrollTo({ top: chatMessagesEl.value.scrollHeight, behavior: 'smooth' })
|
||||
try {
|
||||
const res = await $fetch<{ reponse_texte: string; plateformes_recommandees: { id: string; nom: string; raison: string }[] }>(
|
||||
'/api/chatbot-taff',
|
||||
{ method: 'POST', body: { question: q } }
|
||||
{ method: 'POST', body: { question: q, profondeur: mode } }
|
||||
)
|
||||
chatMessages.value.push({
|
||||
role: 'bot',
|
||||
content: res.reponse_texte,
|
||||
recommandations: res.plateformes_recommandees ?? [],
|
||||
profondeur: mode,
|
||||
})
|
||||
} catch (e: any) {
|
||||
chatMessages.value.push({ role: 'bot', content: e?.data?.statusMessage ?? 'Erreur — réessaie dans un instant.' })
|
||||
chatMessages.value.push({ role: 'bot', content: e?.data?.statusMessage ?? 'Erreur — réessaie dans un instant.', transient: true })
|
||||
} finally {
|
||||
chatLoading.value = false
|
||||
await nextTick()
|
||||
@@ -967,6 +983,12 @@ const parsedDescription = computed(() => {
|
||||
0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
|
||||
40% { transform: translateY(-5px); opacity: 1; }
|
||||
}
|
||||
/* Pas d'animation si l'usager la réduit : points fixes (B1, exigence du brief ; posé au checkpoint du 22/10) */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.taff-typing span { animation: none; opacity: 0.6; }
|
||||
}
|
||||
|
||||
.taff-chat-mode { padding: 0.5rem 1rem 0; }
|
||||
|
||||
.taff-chat-input-wrap {
|
||||
display: flex;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Canonique et robots sur chaque page (B23), rendus côté serveur.
|
||||
* Plugin plutôt que app.vue ou pages : aucune page touchée. Une page qui pose sa propre
|
||||
* canonique ou son robots (useHead / useSeoMeta) l'emporte : même clé, déclarée après.
|
||||
*/
|
||||
import { canonique, robots } from '~/utils/seo'
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
const route = useRoute()
|
||||
// hostname (sans le port) : même lecture que app.vue, app/router.options.ts et useEvenement (B29).
|
||||
const host = useRequestURL().hostname
|
||||
|
||||
useHead({
|
||||
link: computed(() => [{ rel: 'canonical', href: canonique(host, route.path, route.query) }]),
|
||||
meta: computed(() => {
|
||||
const r = robots(host, route.path)
|
||||
return r ? [{ name: 'robots', content: r }] : []
|
||||
}),
|
||||
})
|
||||
})
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "FMHY — Sélection Architecte",
|
||||
"description": "~50 ressources curées depuis FMHY (Free Media Heck Yeah) — pertinentes pour un architecte, un praticien de la transition, un créateur solo.",
|
||||
"description": "Une quarantaine de ressources légales curées depuis FMHY (Free Media Heck Yeah) — pertinentes pour un architecte, un praticien de la transition, un créateur solo.",
|
||||
"children": [
|
||||
{
|
||||
"name": "IA & Outils cognitifs",
|
||||
@@ -16,10 +16,6 @@
|
||||
{
|
||||
"name": "Lecture & Documentation",
|
||||
"children": [
|
||||
{ "name": "Anna's Archive", "url": "https://annas-archive.org/", "desc": "Bibliothèque shadow la plus complète du web. Livres, articles, thèses." },
|
||||
{ "name": "Sci-Hub", "url": "https://sci-hub.se/", "desc": "Accès libre aux articles scientifiques payants." },
|
||||
{ "name": "Library Genesis", "url": "https://libgen.is/", "desc": "Livres techniques et académiques en PDF." },
|
||||
{ "name": "Z-Library", "url": "https://z-lib.id/", "desc": "Bibliothèque numérique massive, interface soignée." },
|
||||
{ "name": "OpenLibrary (Internet Archive)", "url": "https://openlibrary.org/", "desc": "Prêt numérique gratuit, millions de livres." },
|
||||
{ "name": "Calibre", "url": "https://calibre-ebook.com/", "desc": "Gestion de bibliothèque numérique, convertisseur de formats." }
|
||||
]
|
||||
@@ -27,12 +23,7 @@
|
||||
{
|
||||
"name": "Dessin & Modélisation",
|
||||
"children": [
|
||||
{ "name": "FreeCAD", "url": "https://www.freecad.org/", "desc": "Modélisation 3D open source, paramétrique. Alternative à Rhino pour usage simple." },
|
||||
{ "name": "Blender", "url": "https://www.blender.org/", "desc": "3D, rendu, animation. La référence open source." },
|
||||
{ "name": "Inkscape", "url": "https://inkscape.org/", "desc": "Dessin vectoriel. Alternative à Illustrator." },
|
||||
{ "name": "GIMP", "url": "https://www.gimp.org/", "desc": "Retouche photo. Alternative à Photoshop." },
|
||||
{ "name": "Krita", "url": "https://krita.org/", "desc": "Dessin digital et croquis. Excellent pour les concepts." },
|
||||
{ "name": "LibreOffice Draw", "url": "https://www.libreoffice.org/", "desc": "Diagrammes, plans rapides, sans suite Adobe." }
|
||||
{ "name": "Krita", "url": "https://krita.org/", "desc": "Dessin digital et croquis. Excellent pour les concepts." }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -92,7 +83,6 @@
|
||||
"name": "Divers Utiles",
|
||||
"children": [
|
||||
{ "name": "Nextcloud", "url": "https://nextcloud.com/", "desc": "Cloud personnel self-hosted. Alternative à Google Drive/Dropbox." },
|
||||
{ "name": "Joplin", "url": "https://joplinapp.org/", "desc": "Notes chiffrées, sync Nextcloud, open source." },
|
||||
{ "name": "draw.io / diagrams.net", "url": "https://app.diagrams.net/", "desc": "Diagrammes et schémas, gratuit, pas de compte requis." },
|
||||
{ "name": "Excalidraw", "url": "https://excalidraw.com/", "desc": "Tableau blanc collaboratif, style hand-drawn, open source." },
|
||||
{ "name": "Fmhy.net (complet)", "url": "https://fmhy.net/", "desc": "L'arbre complet. Des milliers de ressources organisées par thème." }
|
||||
|
||||
|
After Width: | Height: | Size: 9.4 KiB |
@@ -0,0 +1,8 @@
|
||||
Fraunces SemiBold (fraunces-600-latin.woff2)
|
||||
Copyright 2020 The Fraunces Project Authors (github.com/undercasetype/Fraunces)
|
||||
|
||||
Police distribuée sous la SIL Open Font License, version 1.1 : https://scripts.sil.org/OFL
|
||||
(texte intégral : https://openfontlicense.org/open-font-license-official-text/)
|
||||
|
||||
Fichier tiré de Google Fonts le 22/10/2026 (sous-ensemble latin, axe optique 9-144, graisse 600),
|
||||
servi sans modification par les pages d'événement (event.trans-former.fr).
|
||||
|
After Width: | Height: | Size: 214 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 143 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 160 KiB |
|
After Width: | Height: | Size: 340 KiB |
|
After Width: | Height: | Size: 148 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 122 KiB |
@@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Contrôle des liens de /outils (B6-M4) — outil de revue, PAS un test : ne fait jamais échouer le build.
|
||||
* Lit public/data/outils.json (toutes les URL, y compris `urls[]` et `episodes[].url`) et
|
||||
* public/data/fmhy-curated.json, fait un GET (redirections suivies, délai 15 s, 4 requêtes en parallèle)
|
||||
* et liste les réponses hors 2xx/3xx.
|
||||
*
|
||||
* Un 403/429 d'un site qui bloque les robots n'est pas un lien mort : lire la liste avant de retirer quoi que ce soit.
|
||||
* Usage : node scripts/check-liens-outils.mjs
|
||||
*/
|
||||
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { dirname, join } from 'node:path'
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
const lire = (nom) => JSON.parse(readFileSync(join(__dirname, '..', 'public', 'data', nom), 'utf8'))
|
||||
|
||||
const DELAI_MS = 15000
|
||||
const PARALLELE = 4
|
||||
const UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36'
|
||||
|
||||
/** url -> Set des entrées qui la portent. Toute chaîne https:// est prise, quel que soit son champ. */
|
||||
const urls = new Map()
|
||||
function ajoute(url, qui) {
|
||||
if (!urls.has(url)) urls.set(url, new Set())
|
||||
urls.get(url).add(qui)
|
||||
}
|
||||
|
||||
/** Titre lisible de l'entrée courante : nom / titre / mot, sinon l'id. */
|
||||
const titreDe = (o) => o.nom ?? o.titre ?? o.name ?? o.mot ?? o.id
|
||||
|
||||
function parcourt(valeur, fichier, contexte) {
|
||||
if (typeof valeur === 'string') {
|
||||
if (/^https:\/\//i.test(valeur) || /^http:\/\//i.test(valeur)) ajoute(valeur, `${fichier} › ${contexte}`)
|
||||
} else if (Array.isArray(valeur)) {
|
||||
for (const v of valeur) parcourt(v, fichier, contexte)
|
||||
} else if (valeur && typeof valeur === 'object') {
|
||||
// `lien_texte`-like chaînes ne commencent pas par https:// : seules les vraies URL sont retenues.
|
||||
const ctx = titreDe(valeur) ? `${contexte ? contexte + ' › ' : ''}${titreDe(valeur)}` : contexte
|
||||
for (const [, v] of Object.entries(valeur)) parcourt(v, fichier, ctx)
|
||||
}
|
||||
}
|
||||
|
||||
parcourt(lire('outils.json'), 'outils.json', '')
|
||||
parcourt(lire('fmhy-curated.json'), 'fmhy-curated.json', '')
|
||||
|
||||
async function verifie(url) {
|
||||
const ctrl = new AbortController()
|
||||
const minuteur = setTimeout(() => ctrl.abort(), DELAI_MS)
|
||||
try {
|
||||
const r = await fetch(url, {
|
||||
method: 'GET',
|
||||
redirect: 'follow',
|
||||
signal: ctrl.signal,
|
||||
headers: { 'user-agent': UA, accept: 'text/html,application/xhtml+xml,*/*;q=0.8', 'accept-language': 'fr-FR,fr;q=0.9,en;q=0.7' },
|
||||
})
|
||||
r.body?.cancel().catch(() => {})
|
||||
return r.status
|
||||
} catch (e) {
|
||||
return e?.name === 'AbortError' ? 'délai' : `erreur (${e?.cause?.code ?? e?.message ?? 'réseau'})`
|
||||
} finally {
|
||||
clearTimeout(minuteur)
|
||||
}
|
||||
}
|
||||
|
||||
const liste = [...urls.keys()]
|
||||
const resultats = new Map()
|
||||
let curseur = 0
|
||||
async function travailleur() {
|
||||
while (curseur < liste.length) {
|
||||
const url = liste[curseur++]
|
||||
resultats.set(url, await verifie(url))
|
||||
}
|
||||
}
|
||||
await Promise.all(Array.from({ length: PARALLELE }, travailleur))
|
||||
|
||||
const ko = liste.filter((u) => {
|
||||
const c = resultats.get(u)
|
||||
return !(typeof c === 'number' && c >= 200 && c < 400)
|
||||
})
|
||||
|
||||
console.log(`Contrôle de ${liste.length} URL (GET, délai ${DELAI_MS / 1000} s, ${PARALLELE} en parallèle)\n`)
|
||||
if (ko.length) {
|
||||
console.log('code'.padEnd(18) + 'URL · entrée')
|
||||
for (const u of ko) {
|
||||
console.log(String(resultats.get(u)).padEnd(18) + `${u} · ${[...urls.get(u)].join(' | ')}`)
|
||||
}
|
||||
}
|
||||
console.log(`\n${ko.length} réponse(s) hors 2xx/3xx sur ${liste.length} URL.`)
|
||||
// Outil de revue : toujours code de sortie 0.
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Tests du bandeau d'événement d'aep.trans-former.fr (B27) : retrait automatique après
|
||||
* le dernier jour de la plantation (23:59 heure de Paris) et texte fabriqué depuis le
|
||||
* fichier de l'événement. Charge les VRAIS fichiers TS via jiti (même patron que test-y.mjs).
|
||||
* Usage : node scripts/test-bandeau.mjs
|
||||
*/
|
||||
|
||||
import { createJiti } from 'jiti'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { dirname, join } from 'node:path'
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
const jiti = createJiti(import.meta.url)
|
||||
const racine = join(__dirname, '..')
|
||||
|
||||
const b = await jiti.import(join(racine, 'utils', 'bandeauEvenement.ts'))
|
||||
const { evenement: ruetz } = await jiti.import(join(racine, 'data', 'evenements', 'ruetz-2026.ts'))
|
||||
|
||||
let echecs = 0
|
||||
let total = 0
|
||||
function egal(nom, obtenu, attendu) {
|
||||
total++
|
||||
const ok = JSON.stringify(obtenu) === JSON.stringify(attendu)
|
||||
if (!ok) echecs++
|
||||
console.log(`${ok ? 'ok ' : 'ÉCHEC'} ${nom}${ok ? '' : `\n obtenu ${JSON.stringify(obtenu)}\n attendu ${JSON.stringify(attendu)}`}`)
|
||||
}
|
||||
|
||||
// ── Les données lues sont bien celles de la plantation ─────────────────────────
|
||||
egal('plantation du 28 au 29 novembre 2026 (fichier de données)', [ruetz.foret.du, ruetz.foret.au], ['2026-11-28', '2026-11-29'])
|
||||
|
||||
// ── Retrait automatique (heures de Paris : UTC+1 en novembre) ─────────────────
|
||||
const vu = (iso) => b.bandeauVisible(new Date(iso), ruetz)
|
||||
egal('avant : le 22 octobre à midi', vu('2026-10-22T12:00:00+02:00'), true)
|
||||
egal('avant : le 27 novembre à 23:59', vu('2026-11-27T23:59:00+01:00'), true)
|
||||
egal('pendant : le 28 novembre à 10:00', vu('2026-11-28T10:00:00+01:00'), true)
|
||||
egal('le 29 novembre à 23:00, heure de Paris', vu('2026-11-29T23:00:00+01:00'), true)
|
||||
egal('le 29 novembre à 23:59:59, heure de Paris', vu('2026-11-29T23:59:59+01:00'), true)
|
||||
egal('le 30 novembre à 00:00, heure de Paris', vu('2026-11-30T00:00:00+01:00'), false)
|
||||
// Le cas qui piège un calcul en UTC : il est encore le 29 à Greenwich.
|
||||
egal('le 30 novembre à 00:30, heure de Paris (29/11 23:30 UTC)', vu('2026-11-30T00:30:00+01:00'), false)
|
||||
egal('après : le 15 décembre', vu('2026-12-15T12:00:00+01:00'), false)
|
||||
egal('date invalide : rien d\'affiché', b.bandeauVisible(new Date('pas une date'), ruetz), false)
|
||||
egal('date civile à Paris, pas en UTC', b.dateParis(new Date('2026-11-29T23:30:00Z')), '2026-11-30')
|
||||
egal('date civile : zéros de tête, format AAAA-MM-JJ', b.dateParis(new Date('2026-01-05T08:00:00Z')), '2026-01-05')
|
||||
// Heure d'été : le même calcul vaut en été (UTC+2).
|
||||
egal('heure d\'été : 31 juillet 23:30 Paris = encore le 31', b.dateParis(new Date('2026-07-31T21:30:00Z')), '2026-07-31')
|
||||
|
||||
// ── Texte ──────────────────────────────────────────────────────────────────────
|
||||
const t = b.texteBandeauEvenement(ruetz)
|
||||
egal('texte complet (défaut ① avec le lieu, Jules 23/10)', t.complet, 'Les 28 et 29 novembre, on plante une forêt nourricière ensemble à Ruetz (Haute-Marne). Venez nous rencontrer.')
|
||||
egal('annonce', t.annonce, 'Les 28 et 29 novembre, on plante une forêt nourricière ensemble à Ruetz (Haute-Marne).')
|
||||
egal('le lieu vient des données : lieuCourt lu dans ruetz-2026.ts', ruetz.lieuCourt, 'Ruetz (Haute-Marne)')
|
||||
egal('appel', t.appel, 'Venez nous rencontrer.')
|
||||
egal('les dates viennent des données : décalées d\'un jour, le texte suit ; sans lieuCourt, pas de lieu',
|
||||
b.texteBandeauEvenement({ foret: { ...ruetz.foret, du: '2026-11-29', au: '2026-11-30' } }).annonce,
|
||||
'Les 29 et 30 novembre, on plante une forêt nourricière ensemble.')
|
||||
egal('dates : un seul jour', b.datesBandeau('2026-11-28', '2026-11-28'), 'Le 28 novembre')
|
||||
egal('dates : plusieurs jours du même mois', b.datesBandeau('2026-11-21', '2026-11-27'), 'Du 21 au 27 novembre')
|
||||
egal('dates : à cheval sur deux mois, 1er', b.datesBandeau('2026-10-31', '2026-11-01'), 'Du 31 octobre au 1er novembre')
|
||||
egal('mois en minuscule, accentué', b.datesBandeau('2026-02-07', '2026-02-08'), 'Les 7 et 8 février')
|
||||
|
||||
// ── Lien et clé ────────────────────────────────────────────────────────────────
|
||||
egal('lien vers la page forêt, sur event.', b.lienBandeau(ruetz), 'https://event.trans-former.fr/ruetz/foret')
|
||||
egal('clé de fermeture', b.CLE_FERMETURE_BANDEAU, 'aep-bandeau-ruetz-2026')
|
||||
|
||||
console.log(`\n${total - echecs}/${total} cas ${echecs ? `— ${echecs} ÉCHEC(S)` : 'verts'}`)
|
||||
process.exit(echecs ? 1 : 0)
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env node
|
||||
// Test du garde-fou des citations (server/utils/citations.ts). Usage : node scripts/test-citations.mjs
|
||||
import assert from 'node:assert/strict'
|
||||
import { verifierCitations, contenusChunks } from '../server/utils/citations.ts'
|
||||
|
||||
const ctx = ["La technique est devenue autonome, et forme un monde dévorant.\r\nIl n’y a plus de liberté de choix. Plus on parle d’une valeur, plus c'est le signe de son absence."]
|
||||
const t = (rep, c = ctx) => verifierCitations(rep, c)
|
||||
|
||||
// retrouvée (apostrophes, casse, ponctuation de bord, retours chariot) : gardée
|
||||
let r = t('Ellul écrit : « Il n\'y a plus de liberté de choix ! » donc.')
|
||||
assert.equal(r.gardees, 1); assert.equal(r.retirees, 0); assert.ok(r.texte.includes('«'))
|
||||
// introuvable : guillemets retirés, texte conservé
|
||||
r = t('Il dit : « La technique est une machine à fabriquer du pouvoir social inévitable ». Fin.')
|
||||
assert.equal(r.retirees, 1); assert.equal(r.texte, 'Il dit : La technique est une machine à fabriquer du pouvoir social inévitable. Fin.')
|
||||
// guillemets droits et anglais
|
||||
r = t('"Une phrase inventée qui ne figure nulle part dans le texte" et “Une autre phrase inventée qui ne figure nulle part ici”')
|
||||
assert.equal(r.retirees, 2); assert.ok(!/["“”]/.test(r.texte))
|
||||
// court (< 6 mots) : intact, non compté
|
||||
r = t('Le « rift métabolique » et la « ville intelligente ».')
|
||||
assert.equal(r.gardees + r.retirees, 0); assert.ok(r.texte.includes('« rift métabolique »'))
|
||||
// élision [...] : chaque morceau doit exister
|
||||
r = t('« Plus on parle d\'une valeur [...] le signe de son absence »')
|
||||
assert.equal(r.gardees, 1)
|
||||
r = t('« Plus on parle d\'une valeur [...] le signe de sa présence éclatante »')
|
||||
assert.equal(r.retirees, 1)
|
||||
// pas de correspondance en milieu de mot
|
||||
r = t('« ormation autonome, et forme un monde dévorant »')
|
||||
assert.equal(r.retirees, 1)
|
||||
// aucun contexte : rien de long n'est gardé
|
||||
r = t('« Il n\'y a plus de liberté de choix »', [])
|
||||
assert.equal(r.retirees, 1)
|
||||
// contenusChunks : tableau de chaînes ou chaîne
|
||||
assert.deepEqual(contenusChunks([{ content: ['a', 'b'] }, { content: 'c' }, {}, null]), ['a', 'b', 'c'])
|
||||
assert.deepEqual(contenusChunks(undefined), [])
|
||||
console.log('citations : tous les cas passent')
|
||||
@@ -0,0 +1,163 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Test des données de nav S / M / XL (B10-M1).
|
||||
* Charge le VRAI fichier utils/echelles.ts via jiti (même patron que test-submit-libre.mjs) :
|
||||
* chaque route → bon groupe et bon onglet actif, un seul onglet actif par route.
|
||||
* B13-M7 : accroches de la slide 16 mot pour mot, gestes, porte lue dans l'URL,
|
||||
* voisines, mode de fermeture d'une porte ; l'entrée est hors groupe.
|
||||
* B13b-M5 : une seule rangée de boutons par porte, sans doublon de cible, rien d'inventé,
|
||||
* M n'a qu'un bouton vers la carte ; les onglets de la barre B10 ne changent pas.
|
||||
* Usage : node scripts/test-echelles-nav.mjs
|
||||
*/
|
||||
|
||||
import { createJiti } from 'jiti'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { dirname, join } from 'node:path'
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
const jiti = createJiti(import.meta.url)
|
||||
|
||||
const {
|
||||
ECHELLES, ORDRE_ECHELLES, ECHELLES_CADRE_COURT, echelleDeRoute,
|
||||
ECHELLES_FLUX, lirePorte, voisines, fermeturePorte,
|
||||
PORTES_ECHELLES, FUSION_PORTE, PORTE_EN_CONSTRUCTION, lienProposer,
|
||||
} = await jiti.import(
|
||||
join(__dirname, '..', 'utils', 'echelles.ts'),
|
||||
)
|
||||
const { TYPES_SUGGERES } = await jiti.import(join(__dirname, '..', 'utils', 'submitLibre.ts'))
|
||||
|
||||
const cases = [
|
||||
// [path, query, groupe attendu, onglet attendu]
|
||||
['/trouver-du-taf', {}, 'S', 'Jobs'],
|
||||
['/outils', {}, 'S', 'Outils'],
|
||||
['/', {}, 'M', "Écosystème d'entraide"],
|
||||
['/', { vue: 'fiches' }, 'M', "Écosystème d'entraide"],
|
||||
['/agences', {}, 'M', 'Réseaux AEP'],
|
||||
['/agences', { vue: 'fiches' }, 'M', 'Réseaux AEP'],
|
||||
['/codev', {}, 'M', 'Codev'],
|
||||
['/codev/demo', {}, 'M', 'Codev'],
|
||||
['/codev/carto', {}, 'M', 'Codev'],
|
||||
['/media', {}, 'XL', 'Recherche média'],
|
||||
['/media', { tab: 'visuel' }, 'XL', 'Recherche média'],
|
||||
['/media', { tab: 'projets' }, 'XL', 'Publications'],
|
||||
['/manifeste', {}, null, null],
|
||||
['/a-propos', {}, null, null],
|
||||
['/proposer', {}, null, null],
|
||||
['/signaler', {}, null, null],
|
||||
['/fiche/42', {}, null, null],
|
||||
['/outilsXYZ', {}, null, null],
|
||||
['/codevelopper', {}, null, null],
|
||||
// L'entrée (B13) est hors groupe : pas de fil d'échelle, aucun onglet actif.
|
||||
['/entree', {}, null, null],
|
||||
['/entree', { porte: 'M' }, null, null],
|
||||
]
|
||||
|
||||
let fail = 0
|
||||
for (const [path, query, groupe, onglet] of cases) {
|
||||
const route = { path, query }
|
||||
const r = echelleDeRoute(route)
|
||||
const gotG = r?.echelle ?? null
|
||||
const gotO = r?.onglet.libelle ?? null
|
||||
// Un seul onglet actif sur tout le site pour une route donnée.
|
||||
const actifs = ORDRE_ECHELLES.flatMap((id) => ECHELLES[id].onglets.filter((o) => o.actif(route)))
|
||||
const ok = gotG === groupe && gotO === onglet && actifs.length === (groupe ? 1 : 0)
|
||||
if (!ok) fail++
|
||||
console.log(`${ok ? 'OK ' : 'FAIL'} ${path}${Object.keys(query).length ? '?' + new URLSearchParams(query) : ''} → ${gotG ?? '∅'} / ${gotO ?? '∅'} (actifs : ${actifs.length})`)
|
||||
}
|
||||
|
||||
// Ordre et contenu des groupes (directive Jules du 29/09 + arbitrage 1A).
|
||||
const attendu = {
|
||||
S: ['Jobs', 'Outils'],
|
||||
M: ["Écosystème d'entraide", 'Réseaux AEP', 'Codev'],
|
||||
XL: ['Recherche média', 'Publications'],
|
||||
}
|
||||
for (const id of ORDRE_ECHELLES) {
|
||||
const got = ECHELLES[id].onglets.map((o) => o.libelle)
|
||||
const ok = JSON.stringify(got) === JSON.stringify(attendu[id])
|
||||
if (!ok) fail++
|
||||
console.log(`${ok ? 'OK ' : 'FAIL'} groupe ${id} = ${got.join(' · ')}`)
|
||||
}
|
||||
|
||||
const cadreOk = ECHELLES_CADRE_COURT === 'Trois échelles, imbriquées. Entrez par celle qui presse.'
|
||||
if (!cadreOk) fail++
|
||||
console.log(`${cadreOk ? 'OK ' : 'FAIL'} cadre court = « ${ECHELLES_CADRE_COURT} »`)
|
||||
|
||||
// ── Entrée par le schéma (B13-M7) ──
|
||||
let extra = 0
|
||||
function verif(cond, libelle) {
|
||||
extra++
|
||||
if (!cond) fail++
|
||||
console.log(`${cond ? 'OK ' : 'FAIL'} ${libelle}`)
|
||||
}
|
||||
|
||||
// Accroches : sous-titres de la slide 16 du deck v3.3, mot pour mot.
|
||||
const accroches = {
|
||||
S: "s'émanciper des conditionnements qu'on nous a appris",
|
||||
M: 'celle qui manque pour se sentir épaulé, appartenir',
|
||||
XL: 'un mode de vie soutenable pour le vivant dans son ensemble',
|
||||
}
|
||||
for (const id of ORDRE_ECHELLES) verif(ECHELLES[id].accroche === accroches[id], `accroche ${id} = « ${ECHELLES[id].accroche} »`)
|
||||
|
||||
// Gestes : un libellé, une cible ; celui de M suit l'onglet « Écosystème d'entraide » (B14 les déplace ensemble).
|
||||
for (const id of ORDRE_ECHELLES) {
|
||||
const g = ECHELLES[id].geste
|
||||
verif(Boolean(g?.libelle) && typeof g?.to === 'string' && g.to.startsWith('/'), `geste ${id} = « ${g?.libelle} » → ${g?.to}`)
|
||||
}
|
||||
verif(ECHELLES.M.geste.to === ECHELLES.M.onglets[0].to, "geste M = cible de l'onglet Écosystème d'entraide")
|
||||
|
||||
// Arcs de la slide 16 : quatre textes.
|
||||
verif(['S', 'M'].every((f) => ECHELLES_FLUX[f].sort && ECHELLES_FLUX[f].revient), 'flux : deux frontières, deux sens chacune')
|
||||
|
||||
// Porte lue dans l'URL.
|
||||
const portes = [
|
||||
[{}, null], [{ porte: 'S' }, 'S'], [{ porte: 'm' }, 'M'], [{ porte: ' xl ' }, 'XL'],
|
||||
[{ porte: 'Z' }, null], [{ porte: '' }, null], [{ porte: ['M', 'S'] }, 'M'], [{ echelle: 'M' }, null], [undefined, null],
|
||||
]
|
||||
for (const [q, attendu] of portes) verif(lirePorte(q) === attendu, `lirePorte(${JSON.stringify(q)}) = ${lirePorte(q)}`)
|
||||
|
||||
// Voisines, dans l'ordre de la barre.
|
||||
const v = Object.fromEntries(ORDRE_ECHELLES.map((id) => [id, voisines(id)]))
|
||||
verif(v.S.precedente === null && v.S.suivante === 'M' && v.M.precedente === 'S' && v.M.suivante === 'XL' && v.XL.precedente === 'M' && v.XL.suivante === null, 'voisines : ∅ ← S → M ← … → XL → ∅')
|
||||
|
||||
// Fermeture : back si l'entrée d'avant est le schéma de la même page, sinon replace.
|
||||
const fermetures = [
|
||||
['/entree', 'back'], ['/entree?utm_source=x', 'back'], ['/entree?porte=Z', 'back'], ['/entree#haut', 'back'],
|
||||
['/entree?porte=S', 'replace'], ['/outils', 'replace'], ['/', 'replace'], [null, 'replace'], [undefined, 'replace'],
|
||||
]
|
||||
for (const [prec, attendu] of fermetures) verif(fermeturePorte(prec, '/entree') === attendu, `fermer depuis ${prec ?? '∅'} → ${fermeturePorte(prec, '/entree')}`)
|
||||
verif(fermeturePorte('/', '/') === 'back' && fermeturePorte('/?fiche=108', '/') === 'back', 'après B14 (entrée sur /) : / → back')
|
||||
|
||||
// ── Rangée de boutons de la porte ouverte (B13b-M5) ──
|
||||
for (const id of ORDRE_ECHELLES) {
|
||||
const r = PORTES_ECHELLES[id]
|
||||
const cibles = r.map((b) => b.to)
|
||||
verif(new Set(cibles).size === cibles.length, `rangée ${id} : aucune cible en double (${cibles.join(' · ')})`)
|
||||
const connues = new Set([ECHELLES[id].geste.to, ...ECHELLES[id].onglets.map((o) => o.to)])
|
||||
verif(cibles.every((c) => connues.has(c)), `rangée ${id} : chaque cible existe dans le geste ou les onglets de l'échelle`)
|
||||
verif(r.every((b) => typeof b.libelle === 'string' && b.libelle.length > 0), `rangée ${id} : chaque bouton a un libellé`)
|
||||
}
|
||||
const carte = ECHELLES.M.onglets[0].to
|
||||
verif(PORTES_ECHELLES.M.filter((b) => b.to === carte).length === 1 && !PORTES_ECHELLES.M.some((b) => b.to === '/agences'), `rangée M : un seul bouton vers la carte (${carte}), aucun vers /agences`)
|
||||
verif(FUSION_PORTE.M.to === ECHELLES.M.geste.to, 'rangée M : le bouton fusionné suit le geste M (B14 déplace les deux ensemble)')
|
||||
verif(PORTES_ECHELLES.M[0].libelle === "Écosystème d'entraide et réseaux AEP" && FUSION_PORTE.M.absorbe.includes('/agences'), "rangée M : « Écosystème d'entraide et réseaux AEP » réunit carte et réseaux")
|
||||
const rangees = {
|
||||
S: ['Partir de soi : sept fiches → /outils?tab=partir-de-soi', 'Jobs → /trouver-du-taf', 'Outils → /outils'],
|
||||
M: ["Écosystème d'entraide et réseaux AEP → /", 'Codev → /codev'],
|
||||
XL: ['Interroger la bibliothèque → /media', 'Publications → /media?tab=projets'],
|
||||
}
|
||||
for (const id of ORDRE_ECHELLES) {
|
||||
const got = PORTES_ECHELLES[id].map((b) => `${b.libelle} → ${b.to}`)
|
||||
verif(JSON.stringify(got) === JSON.stringify(rangees[id]), `rangée ${id} = ${got.join(' · ')}`)
|
||||
}
|
||||
|
||||
// ── Porte en construction (B13b-M6) : textes dans echelles.ts, lien vers /proposer reconnu ──
|
||||
verif(PORTE_EN_CONSTRUCTION.texte === 'Cette échelle est en construction.' && PORTE_EN_CONSTRUCTION.proposer === 'Proposer une ressource', 'en construction : les deux textes')
|
||||
for (const id of ORDRE_ECHELLES) {
|
||||
const lien = lienProposer(id)
|
||||
const categorie = new URLSearchParams(lien.split('?')[1]).get('categorie')
|
||||
verif(lien.startsWith('/proposer?') && TYPES_SUGGERES.includes(categorie), `proposer ${id} → ${lien} (catégorie reconnue par /proposer)`)
|
||||
}
|
||||
|
||||
const total = cases.length + ORDRE_ECHELLES.length + 1 + extra
|
||||
console.log(`\n${total - fail}/${total}`)
|
||||
process.exit(fail ? 1 : 0)
|
||||
@@ -0,0 +1,201 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Test de la géométrie de l'entrée (B13-M1).
|
||||
* Charge le VRAI fichier utils/figures.ts via jiti (même patron que test-echelles-nav.mjs) :
|
||||
* les nombres du deck v3.3 (drawEchelles, drawRing) sont repris tels quels, les anneaux
|
||||
* tiennent dans leur cadre, les cibles tactiles restent assez épaisses à 328 px,
|
||||
* l'apparition tient sous 900 ms.
|
||||
* B13b-M1 : les trois bandeaux de mots (M et XL en anneau, S au centre) existent, leurs mots
|
||||
* viennent d'utils/echelles.ts, aucune piste ne croise une lettre, un nom ou un arc,
|
||||
* les textes restent lisibles (≥ 11 px rendus à 390 px).
|
||||
* Usage : node scripts/test-figures.mjs
|
||||
*/
|
||||
|
||||
import { createJiti } from 'jiti'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { dirname, join } from 'node:path'
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
const jiti = createJiti(import.meta.url)
|
||||
|
||||
const {
|
||||
SCHEMA_L, SCHEMA_H, ANNEAU_L, anneauxEchelles, arcsFlux, legendeFlux, anneauSeul, cheminCouronne,
|
||||
delaisApparition, finApparition,
|
||||
CORPS, METRIQUE, MARGE, SENS_BANDEAU, MOUVEMENT_MOTS, SEPARATEUR_MOTS, MASQUE_BANDEAU, FONDU_MASQUE,
|
||||
bandeauxAnneaux, motsBandeau, texteBandeau, cadreMotS, demiAngleTexte, masqueSecteurBas,
|
||||
lignesMotS, caracteresParLigneS,
|
||||
} = await jiti.import(join(__dirname, '..', 'utils', 'figures.ts'))
|
||||
const { ECHELLES, ECHELLES_FLUX } = await jiti.import(join(__dirname, '..', 'utils', 'echelles.ts'))
|
||||
|
||||
let total = 0
|
||||
let fail = 0
|
||||
function ok(cond, libelle, detail = '') {
|
||||
total++
|
||||
if (!cond) fail++
|
||||
console.log(`${cond ? 'OK ' : 'FAIL'} ${libelle}${detail ? ` (${detail})` : ''}`)
|
||||
}
|
||||
|
||||
// ── Les trois anneaux de la slide 16 ──
|
||||
const A = anneauxEchelles()
|
||||
const parId = Object.fromEntries(A.map((a) => [a.id, a]))
|
||||
ok(A.map((a) => a.id).join(',') === 'XL,M,S', 'ordre du dehors vers le dedans : XL, M, S', A.map((a) => a.id).join(','))
|
||||
ok(A.every((a, i) => a.rang === i), 'rang 0 = XL, 2 = S')
|
||||
ok(SCHEMA_L === 820 && SCHEMA_H === 760, 'cadre du deck 820 × 760')
|
||||
ok(A.every((a) => a.cx === 410 && a.cy === 380), 'centre (410, 380)')
|
||||
ok(parId.XL.r === 360.8 && parId.M.r === 246 && parId.S.r === 127.1, 'rayons du deck : 0,44 / 0,30 / 0,155 × 820', `${parId.XL.r} / ${parId.M.r} / ${parId.S.r}`)
|
||||
ok(parId.XL.rInterieur === parId.M.r && parId.M.rInterieur === parId.S.r && parId.S.rInterieur === 0, 'chaque couronne s\'arrête au cercle suivant ; S est un disque')
|
||||
|
||||
const demiTrait = 1.2 // trait de 2,4 dans le deck
|
||||
ok(A.every((a) => a.cx - a.r - demiTrait >= 0 && a.cx + a.r + demiTrait <= SCHEMA_L && a.cy - a.r - demiTrait >= 0 && a.cy + a.r + demiTrait <= SCHEMA_H), 'les trois cercles tiennent dans le cadre, trait compris')
|
||||
|
||||
// Cibles tactiles : épaisseur de chaque couronne (diamètre pour S) rendue à 328 px de large (écran de 360 moins deux gouttières de 16).
|
||||
const echelle328 = 328 / SCHEMA_L
|
||||
const epaisseurs = A.map((a) => ((a.rInterieur ? a.r - a.rInterieur : 2 * a.r) * echelle328))
|
||||
ok(epaisseurs.every((e) => e >= 44), 'chaque couronne fait au moins 44 px d\'épaisseur à 328 px', epaisseurs.map((e) => e.toFixed(1)).join(' / '))
|
||||
|
||||
// Lettre et nom dans leur propre couronne (bande verticale au-dessus du centre).
|
||||
for (const a of A) {
|
||||
const haut = a.cy - a.r
|
||||
const bas = a.rInterieur ? a.cy - a.rInterieur : a.cy + a.r
|
||||
const capLettre = a.yLettre - a.tailleLettre * 0.72 // hauteur de capitale approchée
|
||||
ok(capLettre > haut && a.yLettre < bas && a.yNom > a.yLettre && a.yNom < bas, `lettre et nom de ${a.id} dans leur couronne`, `${haut.toFixed(1)} < ${capLettre.toFixed(1)} … ${a.yNom} < ${bas.toFixed(1)}`)
|
||||
}
|
||||
// B13b : la lettre quitte la position du deck (cy − r + 50) pour laisser le bord au bandeau.
|
||||
ok(parId.XL.yLettre > 69.2 && parId.M.yLettre > 184 && parId.S.yLettre < 302.9, 'lettres sous le bandeau (M, XL), plus haut dans le disque (S)', `${parId.XL.yLettre} / ${parId.M.yLettre} / ${parId.S.yLettre}`)
|
||||
ok(parId.S.tailleLettre === 44 && parId.M.tailleLettre === 40 && parId.XL.tailleLettre === 40, 'corps des lettres : 44 pour S, 40 pour M et XL')
|
||||
|
||||
// Chemins : un sous-chemin pour le disque S, deux pour les couronnes (evenodd).
|
||||
const sousChemins = (d) => (d.match(/M /g) || []).length
|
||||
ok(sousChemins(parId.S.zone) === 1 && sousChemins(parId.M.zone) === 2 && sousChemins(parId.XL.zone) === 2, 'zones : disque S, couronnes M et XL')
|
||||
ok(cheminCouronne(10, 10, 5) === 'M 5 10 A 5 5 0 1 0 15 10 A 5 5 0 1 0 5 10 Z', 'cercle complet en deux demi-arcs', cheminCouronne(10, 10, 5))
|
||||
|
||||
// Proportionnalité : la moitié du cadre donne la moitié des rayons.
|
||||
const demi = anneauxEchelles(SCHEMA_L / 2, SCHEMA_H / 2)
|
||||
ok(demi.every((a, i) => Math.abs(a.r - A[i].r / 2) <= 0.1 && Math.abs(a.yLettre - A[i].yLettre / 2) <= 0.1), 'géométrie proportionnelle au cadre')
|
||||
|
||||
// ── Les arcs « ce qui sort / ce qui revient » ──
|
||||
const arcs = arcsFlux()
|
||||
ok(arcs.length === 4, 'quatre arcs : deux frontières × deux sens')
|
||||
for (const arc of arcs) {
|
||||
const front = parId[arc.frontiere]
|
||||
const exterieur = arc.frontiere === 'S' ? parId.M : parId.XL
|
||||
// ce qui sort est dans la couronne du dessus ; ce qui revient, dans l'échelle de la frontière
|
||||
const dedans = arc.sens === 'sort'
|
||||
? arc.r > front.r && arc.r < exterieur.r
|
||||
: arc.r < front.r && arc.r > front.rInterieur
|
||||
ok(dedans, `arc ${arc.frontiere} « ${arc.sens} » dans la bonne couronne`, `r = ${arc.r}`)
|
||||
ok(arc.d.startsWith(`M ${Math.round((410 - arc.r) * 10) / 10} 380 A`) && arc.d.includes(' 0 0 0 '), `arc ${arc.frontiere} « ${arc.sens} » : demi-cercle bas, de gauche à droite`)
|
||||
}
|
||||
|
||||
// ── Légende du coin : au-dessus du cercle XL, dans le cadre ──
|
||||
const lg = legendeFlux()
|
||||
const largeurLegende = 16 * 0.62 * '↑ ce qui revient'.length // monospace approché
|
||||
const coin = { x: lg.x - largeurLegende, y: lg.yRevient + 4 }
|
||||
const distance = Math.hypot(coin.x - 410, coin.y - 380)
|
||||
ok(lg.x <= SCHEMA_L && lg.ySort > 0 && distance > parId.XL.r, 'légende dans le cadre, hors du cercle XL', `coin à ${distance.toFixed(1)} du centre, r = ${parId.XL.r}`)
|
||||
|
||||
// ── L'anneau seul des slides 17-19 ──
|
||||
const an = anneauSeul()
|
||||
ok(ANNEAU_L === 560 && an.cx === 280 && an.r === 224 && an.rPointilles === 138.9, 'drawRing : r = 0,4 × 560, pointillés à 0,62 × r', `${an.r} / ${an.rPointilles}`)
|
||||
ok(an.yLettre === 330.4 && an.tailleLettre === 156.8, 'lettre : cy + 0,09 × w, corps 0,28 × w', `${an.yLettre} / ${an.tailleLettre}`)
|
||||
ok(an.cx + an.r <= ANNEAU_L && an.cy - an.r >= 0, 'anneau seul dans son cadre')
|
||||
|
||||
// ── B13b-M1 : les mots dans les anneaux ──
|
||||
const B = bandeauxAnneaux()
|
||||
const parB = Object.fromEntries(B.map((b) => [b.id, b]))
|
||||
const S = cadreMotS()
|
||||
ok(B.map((b) => b.id).join(',') === 'XL,M' && S.l > 0 && S.h > 0, 'trois bandeaux : XL et M en anneau, S au centre', `${B.map((b) => b.id).join(',')} + S ${S.l} × ${S.h}`)
|
||||
|
||||
// Lisibilité : ≥ 11 px rendus à 390 px (figure de 358 px).
|
||||
const echelle390 = 358 / SCHEMA_L
|
||||
ok(CORPS.nom * echelle390 >= 11 && CORPS.mot * echelle390 >= 11, 'noms et mots ≥ 11 px rendus à 390 px', `${(CORPS.nom * echelle390).toFixed(1)} / ${(CORPS.mot * echelle390).toFixed(1)} px`)
|
||||
|
||||
// Les mots viennent d'echelles.ts, les sept, sans voisin identique (jointure de la boucle comprise).
|
||||
for (const b of B) {
|
||||
const mots = ECHELLES[b.id].mots
|
||||
const ecrits = motsBandeau(mots, b.longueur)
|
||||
const relus = texteBandeau(ecrits).split(SEPARATEUR_MOTS).filter(Boolean)
|
||||
const voisinsDistincts = ecrits.every((m, i) => m !== ecrits[(i + 1) % ecrits.length])
|
||||
ok(
|
||||
mots.length === 7 && mots.every((m) => ecrits.includes(m)) && ecrits.every((m) => mots.includes(m)) && JSON.stringify(relus) === JSON.stringify(ecrits) && voisinsDistincts,
|
||||
`bandeau ${b.id} : les sept mots d'echelles.ts, rien d'autre, aucun mot à côté de lui-même`,
|
||||
`${ecrits.length} mots`,
|
||||
)
|
||||
// Remplissage : la longueur approchée du texte est proche du tour (textLength ajuste quelques %).
|
||||
const naturelle = texteBandeau(ecrits).length * METRIQUE.chasse * CORPS.mot
|
||||
const ratio = b.longueur / naturelle
|
||||
ok(ratio > 0.85 && ratio < 1.15, `bandeau ${b.id} : le texte remplit le tour à ±15 %`, `× ${ratio.toFixed(3)}`)
|
||||
}
|
||||
ok(ECHELLES.S.mots.length === 7, 'S : sept mots, un à la fois au centre')
|
||||
|
||||
// Aucune piste ne croise une autre : bandeau, lettre, nom, du bord vers le centre, dans la couronne.
|
||||
const pisteBandeau = (b) => [b.r - METRIQUE.jambage * CORPS.mot, b.r + METRIQUE.haut * CORPS.mot]
|
||||
for (const b of B) {
|
||||
const a = parId[b.id]
|
||||
const [bas, haut] = pisteBandeau(b)
|
||||
const rCapLettre = a.cy - a.yLettre + METRIQUE.capitale * a.tailleLettre
|
||||
const rNom = a.cy - a.yNom
|
||||
ok(haut <= a.r - 2 && bas > rCapLettre && rCapLettre > a.cy - a.yLettre && a.cy - a.yLettre > rNom + METRIQUE.haut * CORPS.nom && rNom - METRIQUE.jambage * CORPS.nom > a.rInterieur,
|
||||
`${b.id} : bandeau [${bas.toFixed(1)} ; ${haut.toFixed(1)}] au-dessus de la lettre (${rCapLettre.toFixed(1)}), du nom (${rNom.toFixed(1)}), dans la couronne [${a.rInterieur} ; ${a.r}]`)
|
||||
// Le nom, centré en haut de l'anneau, ne touche pas le bandeau par ses coins.
|
||||
const demiNom = (b.id === 'M' ? 'la communauté' : 'contribuer').length * METRIQUE.chasse * CORPS.nom / 2
|
||||
const coin = Math.hypot(demiNom, rNom + METRIQUE.haut * CORPS.nom)
|
||||
ok(coin < bas, `${b.id} : les coins du nom restent sous le bandeau`, `${coin.toFixed(1)} < ${bas.toFixed(1)}`)
|
||||
}
|
||||
// S : le nom tient dans la corde du disque ; le cadre du mot est sous le nom, dans le disque.
|
||||
{
|
||||
const s = parId.S
|
||||
const nom = ECHELLES.S.titre.toLowerCase()
|
||||
const hautNom = s.yNom - METRIQUE.haut * CORPS.nom
|
||||
const demiCorde = Math.sqrt(s.r ** 2 - (s.cy - hautNom) ** 2)
|
||||
const demiNom = nom.length * METRIQUE.chasse * CORPS.nom / 2
|
||||
ok(demiNom + MARGE < demiCorde, `S : « ${nom} » tient dans le disque sous la lettre`, `${demiNom.toFixed(1)} < ${demiCorde.toFixed(1)}`)
|
||||
const coins = [[S.x, S.y], [S.x + S.l, S.y], [S.x, S.y + S.h], [S.x + S.l, S.y + S.h]]
|
||||
ok(S.y > s.yNom && coins.every(([x, y]) => Math.hypot(x - s.cx, y - s.cy) < s.r), 'S : le cadre du mot est sous le nom, dans le disque', `${S.x}, ${S.y}, ${S.l} × ${S.h}`)
|
||||
// Le plus long mot de S tient en deux lignes dans le cadre (coupure à une espace).
|
||||
const plusLong = Math.max(...ECHELLES.S.mots.map((m) => {
|
||||
const parts = m.split(' ')
|
||||
let mieux = Infinity
|
||||
for (let i = 1; i < parts.length; i++) mieux = Math.min(mieux, Math.max(parts.slice(0, i).join(' ').length, parts.slice(i).join(' ').length))
|
||||
return Math.min(m.length, mieux)
|
||||
}))
|
||||
ok(plusLong * METRIQUE.chasse * CORPS.mot < S.l, 'S : chaque mot tient sur deux lignes au plus', `${plusLong} car. × ${(METRIQUE.chasse * CORPS.mot).toFixed(1)} < ${S.l}`)
|
||||
// La coupure écrite : au plus deux lignes, chacune dans le cadre, le mot rendu tel quel.
|
||||
const max = caracteresParLigneS()
|
||||
const coupes = ECHELLES.S.mots.map((m) => lignesMotS(m))
|
||||
ok(coupes.every((l, i) => l.length <= 2 && l.join(' ') === ECHELLES.S.mots[i] && l.every((x) => x.length * METRIQUE.chasse * CORPS.mot < S.l)), `S : coupure en deux lignes au plus, ${max} caractères par ligne`, coupes.map((l) => l.join(' / ')).join(' ; '))
|
||||
ok(JSON.stringify(lignesMotS('où habiter, avec qui')) === JSON.stringify(['où habiter,', 'avec qui']), 'S : « où habiter, / avec qui »')
|
||||
}
|
||||
|
||||
// Les arcs « ce qui sort / ce qui revient » (≥ 1 024 px) : un bandeau qui croise un arc a un secteur masqué qui le couvre.
|
||||
for (const b of B) {
|
||||
const [bas, haut] = pisteBandeau(b)
|
||||
for (const arc of arcs) {
|
||||
const arcBas = arc.r - METRIQUE.haut * CORPS.flux
|
||||
const arcHaut = arc.r + METRIQUE.jambage * CORPS.flux
|
||||
if (arcHaut < bas || arcBas > haut) continue
|
||||
const texte = `↑ ${ECHELLES_FLUX[arc.frontiere][arc.sens]}`
|
||||
const demi = demiAngleTexte(texte.length * METRIQUE.chasse * CORPS.flux, arc.r)
|
||||
const masque = MASQUE_BANDEAU[b.id] ?? 0
|
||||
ok(masque - FONDU_MASQUE >= demi, `bandeau ${b.id} × arc ${arc.frontiere} « ${arc.sens} » : secteur masqué ±${masque}° (net ±${masque - FONDU_MASQUE}°) ≥ ±${demi.toFixed(1)}°`)
|
||||
}
|
||||
}
|
||||
ok(masqueSecteurBas(55).includes('transparent 137deg 223deg'), 'masque : secteur bas transparent, fondu de 12°', masqueSecteurBas(55))
|
||||
|
||||
// Mouvement : sens opposés, un tour en 60 à 90 s, un mot de S toutes les 2,5 s, après l'apparition.
|
||||
ok(SENS_BANDEAU.M === 'horaire' && SENS_BANDEAU.XL === 'antihoraire' && B.every((b) => b.sens === SENS_BANDEAU[b.id]), 'M horaire, XL antihoraire')
|
||||
ok(MOUVEMENT_MOTS.tour >= 60_000 && MOUVEMENT_MOTS.tour <= 90_000, 'un tour de bandeau en 60 à 90 s', `${MOUVEMENT_MOTS.tour / 1000} s`)
|
||||
ok(MOUVEMENT_MOTS.cadence === 2_500 && MOUVEMENT_MOTS.fondu < MOUVEMENT_MOTS.cadence, 'S : un mot toutes les 2,5 s, fondu plus court', `${MOUVEMENT_MOTS.fondu} ms`)
|
||||
ok(MOUVEMENT_MOTS.cadence - MOUVEMENT_MOTS.fondu > finApparition(), 'S : le premier changement de mot vient après l\'apparition', `${MOUVEMENT_MOTS.cadence - MOUVEMENT_MOTS.fondu} ms > ${finApparition()} ms`)
|
||||
// Les pourcentages de @keyframes aep-mot-s (SchemaEchelles.vue) valent pour 7 mots, 2,5 s et 400 ms.
|
||||
const tourS = 7 * MOUVEMENT_MOTS.cadence
|
||||
ok(Math.abs(((MOUVEMENT_MOTS.cadence - MOUVEMENT_MOTS.fondu) / tourS) * 100 - 12) < 0.01 && Math.abs((MOUVEMENT_MOTS.cadence / tourS) * 100 - 14.286) < 0.01 && Math.abs(((tourS - MOUVEMENT_MOTS.fondu) / tourS) * 100 - 97.714) < 0.01, 'keyframes de S : 12 % / 14,286 % / 97,714 %')
|
||||
|
||||
// ── Apparition : du dehors vers le dedans, sous 900 ms ──
|
||||
const d = A.map((a) => delaisApparition(a.rang))
|
||||
ok(d[0].anneau < d[1].anneau && d[1].anneau < d[2].anneau, 'XL apparaît d\'abord, S en dernier', d.map((x) => x.anneau).join(' < '))
|
||||
ok(d.every((x) => x.lettre >= d[2].anneau), 'les lettres après les anneaux')
|
||||
ok(finApparition() <= 900, 'apparition complète en 900 ms au plus', `${finApparition()} ms`)
|
||||
|
||||
console.log(`\n${total - fail}/${total}`)
|
||||
process.exit(fail ? 1 : 0)
|
||||