Compare commits

..
Author SHA1 Message Date
Jules NenyandClaude Opus 5.5 8418219ce5 texte(evenements): Servigne (convivialité, authenticité, adversité), XL du deck du 23/10, question « vous entrez plutôt par S, M, XL ? » au formulaire codev (B26, commit R)
Servigne vérifié contre BIBLIO §Vérifié le 23/10 (relevé, recensions). XL propre à la
page codev (Sens.vue), echelles.ts inchangé. Colonne entree ajoutée à la table NocoDB
avant ce code ; écriture réelle testée puis supprimée.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfxSWhRoYNsTevCYLkCTJp
2026-10-23 11:09:16 +02:00
Jules NenyandClaude Opus 5.5 cb892374be docs(evenements): la liste d'attente du codev dans le README d'exploitation (B26, commit Q)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfxSWhRoYNsTevCYLkCTJp
2026-10-23 00:30:52 +02:00
Jules NenyandClaude Opus 5.5 583edd8b8b texte(codev): recette W, entre deux et cinq personnes, « Pour en parler : écrivez-nous », mot de passe retiré du QR (B26, commit O, batch MOA du 23/10)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfxSWhRoYNsTevCYLkCTJp
2026-10-23 00:26:44 +02:00
Jules NenyandClaude Opus 5.5 2265b7ac80 feat(evenements): retours de Jules et réponses du batch MOA du 23/10 (B26, commit N)
Mise en page (Jules) : codev, le tableau en bandeau pleine largeur tout en haut
(la maison au téléphone, le panorama dès 700 px, « voir en entier » au téléphone
seulement) ; les photos regroupées en une bande, entre la semaine et le pratique.
Forêt : « Le projet » en deux moitiés au bureau (texte et plan de Sacha à gauche,
le pastel en grand à droite, sans légende, crédit dans l'alt), empilés au
téléphone (texte, pastel, plan) ; les trois photos en une bande avant « Venir ».
Colonne à 760 px dès 1 024 px ; .evt-large et .evt-bande partagés.
Batch MOA : la recette d'une session (slide 10 du deck, « entre deux et cinq »)
dans l'intention du codev, sur la barre de RecetteBarre (commit B) ; mot
d'accueil de la forêt ; navette organisée, pas de bus ; maison chauffée ;
enfants au codev ; draps ; rien à prévoir sans dormir sur place.
Liste d'attente du codev dès la 17e place : issueInscription (testée), l'API
écrit la ligne et répond attente: true, le formulaire reste ouvert ; la forêt
complète refuse toujours (409). Pastel en 600 / 900 / 1200.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfxSWhRoYNsTevCYLkCTJp
2026-10-23 00:26:44 +02:00
Jules NenyandClaude Opus 5.5 b61baacc75 test(evenements): le compteur se lit après l'apostrophe échappée par le rendu serveur (B26, commit M)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfxSWhRoYNsTevCYLkCTJp
2026-10-23 00:05:14 +02:00
Jules NenyandClaude Opus 5.5 37b739367a texte(evenements): crédit du tableau en entier, repas offerts le week-end de plantation (B26, commit L)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfxSWhRoYNsTevCYLkCTJp
2026-10-23 00:03:25 +02:00
Jules NenyandClaude Opus 5.5 186754b0f2 chore(scripts): la roue des échelles S / M / XL en HTML autonome, générée depuis figures.ts et echelles.ts (B26, commit K)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfxSWhRoYNsTevCYLkCTJp
2026-10-22 23:44:51 +02:00
Jules NenyandClaude Opus 5.5 70df383a34 fix(evenements): le pastel reste visible en sombre, fusion par variable du gabarit (B26, commit J)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfxSWhRoYNsTevCYLkCTJp
2026-10-22 23:41:39 +02:00
Jules NenyandClaude Opus 5.5 af0796f5b6 feat(evenements): retours de Jules du 22/10 au soir, le tableau, les photos, le pastel (B26, commit I)
Codev : le tableau de Ruetz (Rémi et Jules, 2023) en tête, panorama entier
au-delà de la colonne à partir de 900 px, recadré 4:3 sur la maison au
téléphone, aperçu de partage 1200 × 630 ; quatre photos FERTI 2024 par paires
(atelier et table après l'intention, repas et danse après la frise) ;
« Le sens de la semaine » ouvert par défaut, le cercle animé d'aep
(EvenementsCercle) à la place du schéma « ce qui sort / ce qui revient » ;
deux déjà-inscrit·es (Jules, Estelle) ; 15 € par jour, lu dans les données.
Forêt : le pastel d'arbre de Jules (photo du catalogue, redressée, papier
ramené au blanc, multiply sur la crème) à côté de la phrase-accroche.
Les deux : le tableau de covoiturage en bouton bleu nuit, picto voiture.
Photos par paires : classe partagée .evt-photos (reprise de la forêt).
Tests : 86 cas, les compteurs suivent dejaInscrits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfxSWhRoYNsTevCYLkCTJp
2026-10-22 23:39:43 +02:00
Jules NenyandClaude Opus 5.5 6875f820ad chore(echelles): utils/figures.ts et utils/echelles.ts repris de ckpt/aep-2410 (B26, commit H)
Copie à l'octet (blobs f641db3b, 475c1d27) de la géométrie et des textes du
schéma S / M / XL (B13b) : le cercle de la page codev les lit. Diff purement
additif sur echelles.ts (accroche, geste, flux, portes) : rien ne change sur
aep en prod. Au merge du checkpoint, ces deux fichiers sont identiques des
deux côtés ; s'ils ont bougé sur le checkpoint, sa version fait foi.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfxSWhRoYNsTevCYLkCTJp
2026-10-22 23:39:43 +02:00
Jules NenyandClaude Opus 5.5 c3d691acfb fix(evenements): un tableau de covoiturage par événement (B25, commit G, D8)
Le tableau commun nommait la semaine aux invités de la plantation. La page
forêt pointe désormais vers son propre tableau (28-29 novembre), la page
codev garde le tableau de la semaine. Test HTTP ajouté dans test-y.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwRV4Gjq47A633kqxvCint
2026-10-22 23:07:12 +02:00
Jules NenyandClaude Opus 5.5 91e6680584 style(evenements): passe design, sobre mais moins sèche (B25, commit F)
Audit Impeccable mesuré (une seule famille de polices, h2 à 1,26 fois le texte,
deux bordures d'accent de 3 px, cartes identiques, aucune texture), puis la
grammaire du deck e-codev (frontend-slides) prise sans le copier :

- Fraunces pour les titres seulement (un woff2 auto-hébergé, latin, graisse 600,
  axe optique : 35 Ko, préchargé, font-display swap, repli Georgia) ; le texte
  reste en police système.
- Le fond : des courbes de niveau (14 lignes, en écho au plan de Sacha) derrière
  l'en-tête, estompées avant le texte (svg de 9,6 Ko, 3,9 Ko gzip) ; sauge sur
  la forêt, encre ailleurs.
- Ocre et sauge du deck (contrastes AA lus dans les jetons, clair et sombre) ;
  safran gardé pour la plantation et le bouton principal.
- Cartes sur papier chaud, pictos dans un cadre teinté, grilles sans trou ;
  retour en étiquette ocre, cible 44 px ; anneau de focus d'encre (le safran ne
  fait que 1,7:1 sur la crème).
- Lois tenues : la phrase-accroche et le déroulé perdent leur bordure de 3 px
  (Fraunces en sauge ; points safran reliés par un fil) ; les portes du carrefour
  perdent la flèche, gagnent un picto, se mettent côte à côte, plus une photo.
- Un seul mouvement : les pastilles du compteur arrivent, coupé en mouvement réduit.
- alt de champ.jpg corrigé (il décrivait une autre image).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwRV4Gjq47A633kqxvCint
2026-10-22 09:11:23 +02:00
Jules NenyandClaude Opus 5.5 baf003075d feat(evenements): retours de Jules du 22/10 sur les pages Ruetz (B25, commit E)
- Forêt : plus aucun lien vers la semaine ni vers le carrefour (retour et pied retirés).
- Frise : le bloc plantation est un lien vers la page forêt (ombre au repos, levé au
  survol, anneau au focus) ; légende et pied portent un lien safran « La page forêt ».
- Arrivée le samedi 21 pour tout le monde : un seul jour dans les données, la question
  disparaît du formulaire (valeur envoyée d'office) ; frise, légende, desc, carte Venir.
- Compteur : « 1 inscrit·e sur 16, pour l'instant », seize pastilles ; Jules compté
  d'office (codev.dejaInscrits = 1), le complet tombe à 15 inscriptions.
- Lieu cliquable vers Google Maps (lieu-dit seulement) sur forêt, codev, carrefour ;
  récap pratique à icônes en tête de la forêt et du codev.
- Icônes SVG inline (grille 24, trait 1,75) sur les cartes du pratique et de Venir.
- Servigne : l'encadré rejoint l'intention, avec un « cf. » en note.
- « Le sens de la semaine » (repliable) : les trois échelles du deck du 23/10
  (slides 07 à 09) redessinées, badges du site.
- Une photo cadrée et légendée sur la page codev ; case plantation centrée ;
  cartes du carrefour à la hauteur du texte ; les liens sont soulignés.
- Tableau de covoiturage (Google Sheet, non partagé) dans covoiturageUrl.
- Tests : 72 cas (dejaInscrits, compteur, arrivée unique, liens forêt, Maps).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwRV4Gjq47A633kqxvCint
2026-10-22 08:59:29 +02:00
Jules NenyandClaude Opus 5.5 f261453ec4 fix(codev): le QR vise /codev/acces, la recette tient /codev (Y, commit D, à déployer avec B)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E8JHH1V4CrhStceciTF9ms
2026-10-21 23:52:11 +02:00
Jules NenyandClaude Opus 5.5 d75c723f41 texte(evenements): défauts D1-D6 du RECAP B24 — notification sans prénom, virement, 28-29, arrivée/départ, inscriptions jusqu'au 6/11, forêt (Y, commit C)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E8JHH1V4CrhStceciTF9ms
2026-10-21 23:51:50 +02:00
Jules NenyandClaude Opus 5.5 54494f350c feat(codev): /codev devient la recette publique ; le mot de passe déménage en /codev/acces (Y, commit B)
- pages/codev/index.vue : tête d'échelle M, barre de 2 h en SVG (quart d'heure
  par personne détaillé), textes de W §2 et §4 (sans la parenthèse R-2),
  bouton « Partager la vôtre » → /proposer?categorie=recette, lien « J'ai un code ».
- pages/codev/acces.vue : l'ancien écran du mot de passe, inchangé.
- server/middleware/codev-auth.ts : /codev/acces public, redirection des pages
  protégées vers /codev/acces.
- utils/submitLibre.ts : type suggéré « Recette d'entraide » (en base :
  ecosysteme, pending, ligne de tête « Type suggéré : Recette d'entraide ») ;
  worker/ intouché. FormLibre : l'indice de la puce.
- scripts/test-y.mjs : cas recette et redirections.

À déployer seulement après la relecture de W §2 et §4 par Jules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011CM63J14oj62y6mz4sB43n
2026-10-21 08:35:06 +02:00
Jules NenyandClaude Opus 5.5 f0fe8eede3 feat(evenements): event.trans-former.fr — index, carrefour Ruetz, semaine codev, plantation, inscriptions (Y, commit A)
- Routage par hôte (app/router.options.ts) : sur event., seules les pages de
  pages/evenements/ existent, servies sans le préfixe ; copie sous
  aep.…/evenements/ avec la barre AEP, canonique event. et noindex.
- app.vue : en-tête, FilEchelle et NavTiroir masqués sur event. ; le conteneur
  y garde le défilement.
- /ruetz (carrefour), /ruetz/codev (frise SVG, compteur de places),
  /ruetz/foret (plan, syntropie en trois niveaux dépliables, gestes en SVG).
- POST /api/evenements/inscription (Zod partagé, honeypot, 3/IP/jour, 409
  complet, 503 sans table) et GET /api/evenements/places (cache 60 s) ;
  NocoDB inscriptions_ruetz, fixture hors dépôt en dev ; ntfy sans donnée
  personnelle hors prénom.
- nuxt.config.ts : une clé, inscriptionsRuetzTableId.
- Photos sans visage reconnaissable (n8 floutée dans le fichier), EXIF retirés ;
  le plan s'ouvre en grand ; boutons « Je m'inscris ↓ » masqués quand c'est complet.
- deploy/ruetz/README.md pour le checkpoint ; node scripts/test-y.mjs (42 cas).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011CM63J14oj62y6mz4sB43n
2026-10-21 08:35:06 +02:00
Jules NenyandClaude Opus 5.5 1054172ec9 docs(design-system): §Vue fiches — détail, fiche à fiche, historique, contrat #detail (B12)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGNSEFZdoKvbdsGyfSnu5S
2026-10-03 09:20:16 +02:00
Jules NenyandClaude Opus 5.5 a9befb25ab fix(vue-fiches): passe /autofeedback — Échap dans un champ garde le brouillon, titre d'onglet = fiche ouverte, contrastes et mini-carte décorative de FicheDetail
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGNSEFZdoKvbdsGyfSnu5S
2026-10-03 09:20:16 +02:00
Jules NenyandClaude Opus 5.5 a6dcf48c71 fix(fiche-detail): mini-carte dessinée quand la fiche s'ouvre côté client (conteneur ClientOnly attendu)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGNSEFZdoKvbdsGyfSnu5S
2026-10-03 09:09:37 +02:00
Jules NenyandClaude Opus 5.5 5e0027b861 feat(fiches): / et /agences ouvrent la fiche dans le panneau ; FicheReseauContenu extrait, FicheModal et FicheModalV2 retirées ; Voir sur la carte (B12-M4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGNSEFZdoKvbdsGyfSnu5S
2026-10-03 08:57:16 +02:00
Jules NenyandClaude Opus 5.5 1bb55538a4 feat(vue-fiches): panneau de détail à droite, plein écran au téléphone ; clavier, balayage, copier le lien (B12-M1/M2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGNSEFZdoKvbdsGyfSnu5S
2026-10-03 08:57:16 +02:00
Jules NenyandClaude Opus 5.5 fe1043e321 feat(vue-fiches): fiche= dans l'URL, fiche à fiche, historique push/replace/back (B12-M2/M3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AGNSEFZdoKvbdsGyfSnu5S
2026-10-03 08:57:16 +02:00
Jules NenyandClaude Fable 5.1 55027ba482 fix(chatbot-pensees): défaut serveur = corpus Pensées seules (AEP-PREFACE, ok Jules 03/10)
Le mode croisé Pensées × Projets reste un choix explicite du visiteur (sélecteur du chatbot).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PHyAMzRnXo8zPQYkUNopU
2026-10-03 00:28:00 +02:00
Jules NenyandClaude Opus 5.5 7c968c2054 fix(vue-fiches): avant le montage, une page sans état Mixte s'affiche en Fiches (passe /autofeedback, angle B12)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCt6e8wWiYqRXLJAuKqP5i
2026-10-02 18:12:05 +02:00
Jules NenyandClaude Opus 5.5 0166d66fc8 docs(design-system): §Vue fiches (contrat, états, URL, brancher une troisième page)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCt6e8wWiYqRXLJAuKqP5i
2026-10-02 18:10:35 +02:00
Jules NenyandClaude Opus 5.5 d4e72942fc fix(vue-fiches): accessibilité et contrôles M8 (Lighthouse 24/24 ≥ 95)
Nom accessible de la carte-fiche = son contenu ; résumé et « Sans localisation »
en color-mix(--text 78 %) ; libellé du tri gardé pour les lecteurs d'écran sous
768 px ; lien « sans adresse » hors du parcours clavier quand le compteur est
masqué ; bouton Chatbot flottant en fond plein ; option sélectionnée explicite
des <select> (rendu serveur) ; pastille « Sans adresse » ; cluster allumé au
survol ; pas d'init Leaflet sur un conteneur détaché.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCt6e8wWiYqRXLJAuKqP5i
2026-10-02 18:10:35 +02:00
Jules NenyandClaude Opus 5.5 a98342c5f1 feat(reseaux): /agences branché sur VueFiches ; recherche, tags, famille et carte= dans l'URL (B11-M6)
Hashtags désormais en OU dans leur dimension (ET avant), ET avec la famille.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCt6e8wWiYqRXLJAuKqP5i
2026-10-02 17:57:27 +02:00
Jules NenyandClaude Opus 5.5 2e82d412ed feat(entraide): / branché sur VueFiches ; NavSidebar, FichesPanel, MobileSheet et onglets remplacés (B11-M5)
Survol fiche ↔ épingle (cluster compris), invalidateSize au redimensionnement,
titre accessible des épingles, ?random=1 fiable au chargement direct.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCt6e8wWiYqRXLJAuKqP5i
2026-10-02 17:57:27 +02:00
Jules NenyandClaude Opus 5.5 5a4c7af79c feat(vue-fiches): composant VueFiches (Carte · Mixte · Fiches, poignée, barre d'outils) et filtres par dimension (B11-M3, M4)
Filtres à un seul endroit par état, chips à 0 grisées, repli au-delà de 14,
feuille « Filtrer » sous 768 px, pastilles actives en état Carte.
FicheMiniCard : racine <article> + bouton étiré pour rendre les chips cliquables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCt6e8wWiYqRXLJAuKqP5i
2026-10-02 17:57:27 +02:00
Jules NenyandClaude Opus 5.5 38df1d5eb5 feat(vue-fiches): état unique lu et écrit dans l'URL, filtres OU/ET, compteurs, tri, regroupement (B11-M1, M2 adaptateurs)
utils/vueFiches.ts porte la logique pure, composables/useVueFiches.ts la branche
sur la route ; MiniFiche gagne etiquettes, coords, date, ville, texte.
Test : node scripts/test-vue-fiches.mjs (42/42).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SCt6e8wWiYqRXLJAuKqP5i
2026-10-02 17:43:43 +02:00
Jules NenyandClaude Opus 5.5 5ce431d055 fix(nav): fil d'échelle du groupe M replié sur sa pastille sous 400 px
Mesuré : 387 px dans 360 (Codev hors écran, sans indice de défilement).
Accroche gardée pour les lecteurs d'écran. Passe /autofeedback de B10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBu7CSLy7PJgL4HJaV5oHP
2026-10-02 17:05:40 +02:00
Jules NenyandClaude Opus 5.5 8d05873082 docs(design-system): §Navigation par échelles (groupes, seuils, source echelles.ts)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBu7CSLy7PJgL4HJaV5oHP
2026-10-02 17:02:35 +02:00
Jules NenyandClaude Opus 5.5 358c2954c3 feat(media): ?tab= suivi par watch, sous-onglets retirés, Publications ; Signaler en pied d'À propos
La nav XL porte Recherche média / Publications ; /media relit route.query.tab à
chaque changement (un lien /media → /media?tab=projets changeait l'URL sans
changer la page). B10 M5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBu7CSLy7PJgL4HJaV5oHP
2026-10-02 17:02:10 +02:00
Jules NenyandClaude Opus 5.5 79424d29cf feat(nav): barre par échelles S / M / XL, tiroir < 1280, fil d'échelle mobile
- NavEchelles : trois groupes (accroche pastille + titre, <ul> étiqueté,
  aria-current) ≥ 1280 ; groupe courant seul 768-1279 ; lu depuis utils/echelles.ts
- NavTiroir remplace le menu déroulant : tiroir à droite, voile, Échap, focus
  piégé et rendu, cibles 44 px ; bouton « Menu » masqué ≥ 1280
- FilEchelle < 768, dans le flux avant le conteneur de page
- Soutenir et À propos dans la barre ≥ 1280 ; Signaler quitte la barre
- barre de recherche d'en-tête retirée (/ garde sa recherche dans MobileSheet
  à 768 et 1000, vérifié au DOM)
- html lang="fr" (Lighthouse html-has-lang)
B10 M2-M4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBu7CSLy7PJgL4HJaV5oHP
2026-10-02 17:02:10 +02:00
Jules NenyandClaude Opus 5.5 7762b31f1d feat(nav): onglets S / M / XL et echelleDeRoute dans utils/echelles.ts
Chaque échelle porte ses onglets (libellé, cible, actif(route)) ; echelleDeRoute
rend le groupe courant ou null. Source unique de la nav B10. Test node :
scripts/test-echelles-nav.mjs (23/23). B10 M1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBu7CSLy7PJgL4HJaV5oHP
2026-10-02 16:48:28 +02:00
Jules NenyandClaude Opus 5.5 3f5ebe1c36 fix(fiches): la grille ?vue=fiches ne déborde plus (minmax(0, 1fr))
repeat(n, 1fr) prend pour minimum le contenu le plus large ; avec le nom de
fiche en nowrap, les colonnes dépassaient le conteneur (prod 29/09 : 1658 px
dans 1088 à 1440, 534 dans 328 à 360). B10 M0, SPEC-vue-fiches §1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBu7CSLy7PJgL4HJaV5oHP
2026-10-02 16:47:33 +02:00
Jules NenyandClaude Opus 5.5 a2b89489a6 fix(budget): une table sans aucune ligne datée n'est jamais « 0 € vérifié »
Passe /autofeedback (angle checkpoint) : si NocoDB renvoie des lignes
sans timestamp, CreatedAt ni created_at, checkBudget rendait
verified=true à 0 €, soit le fail-open silencieux d'avant sous une autre
forme. Désormais verified=false et avertissement au journal. 17/17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174RrDEQFQTtySXkTcsUKuv
2026-09-29 00:27:01 +02:00
Jules NenyandClaude Opus 5.5 74337c0bcb fix(a11y): chip actif en fond plein sur tout le site, survol réservé aux pointeurs
Chip.vue : l'actif (échelle, fonction) passe de --primary, translucide
dans le thème AEP (3,96:1 composé, sous AA), à --nav-primary-solid /
--nav-text-on-primary (14,62:1 ; ≈12:1 en sombre), comme le formulaire
libre depuis AF4. Le survol d'un actif ne change plus de fond ; tous les
:hover passent sous @media (hover: hover) (plus de chip collé au tap).
Mesuré sur /, /agences, /proposer, mobile et desktop.

FormLibre.vue : surcharges locales de AF4 devenues inutiles retirées
(principal plein, bloc hover: none) ; le survol du secondaire passe
sous (hover: hover). Secondaire en contour vérifié au toucher.

Décision MOE du 29/09, veto Jules possible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174RrDEQFQTtySXkTcsUKuv
2026-09-29 00:26:05 +02:00
Jules NenyandClaude Opus 5.5 6ac5a2bdf7 fix(budget): le circuit breaker des chatbots lit enfin stats_usage
checkBudget filtrait stats_usage sur `timestamp` (where + fields) et
recevait un 422 à chaque appel : fail-open silencieux, budget jamais
vérifié côté chatbot. Aligné sur le worker : aucune colonne nommée dans
la requête, lecture paginée, mois filtré en JS (timestamp, puis
CreatedAt, puis created_at). Chaque lecture journalise le budget lu ;
un échec journalise « budget NON vérifié » et renvoie verified=false.

Test : scripts/test-circuit-breaker.mjs, faux NocoDB qui rejette en 422
toute colonne absente (15/15 ; 11 échecs si le filtre revient).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174RrDEQFQTtySXkTcsUKuv
2026-09-29 00:19:06 +02:00
Jules NenyandClaude Opus 5.5 ebfc744574 feat(proposer): chip secondaire en contour, chip actif plein et contrasté
Le second choix du double type se lit en contour (texte --nav-text), le
principal passe en fond plein --nav-primary-solid : 4,16:1 → 14,6:1 mesuré
(le fond actif translucide de Chip.vue était sous AA). Survol collant
neutralisé sur tactile, annonce sr-only « Principal · second choix ».
Scopé à FormLibre ; Chip.vue non modifié (défaut global signalé).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AzGo8bxhHp6M9RxuAFbyLU
2026-09-28 16:48:24 +02:00
Jules NenyandClaude Opus 5.5 8f94a1acda fix(bifrost): tiers sur gpt-oss (Groq a retiré les llama) + marge de raisonnement
RAPIDE groq/llama-3.1-8b-instant → groq/openai/gpt-oss-20b ; APPROFONDI
groq/llama-3.3-70b-versatile → groq/openai/gpt-oss-120b ; replis inchangés.
Les chatbots vivaient sur le repli Gemini depuis le retrait.

gpt-oss raisonne : ses tokens de raisonnement sont décomptés de max_tokens.
REASONING_MARGIN_TOKENS (800) ajouté au budget des trois routes, et
bifrostContent() signale au journal une réponse tronquée (finish_reason
length). Le champ message.reasoning est ignoré. Défaut WORKER_MODEL aligné
sur la prod. En-têtes « Mistral Small » corrigés, PIPE-IA-DOC §11.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AzGo8bxhHp6M9RxuAFbyLU
2026-09-28 16:48:24 +02:00
Jules NenyandClaude Opus 5.5 288a9c9126 fix(data): A Brief History of Neoliberalism relève de David Harvey, pas de Hal Harvey
Doublon hérité du mapping heuristique v4.1 : retiré chez hal-harvey
(ingere: false, poster Bon Pote non ingéré), conservé chez david-harvey
avec bio et thèses réelles. Écoles inchangées. auteurs_ingeres_count
recompté sur les flags (91, la valeur 80 était obsolète).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UvxdoEGWjCTSEJDmraYW96
2026-09-28 12:14:54 +02:00
Jules NenyandClaude Opus 5.5 a1edcf3093 feat(b5): M2b — légende des cinq types et double type pour les indécis
Deux chips maximum : le premier alimente submission_type, le second
s'écrit en tête de description_user (« Type suggéré : X ou Y »), sans
ALTER NocoDB. Le marqueur « Type : non précisé » n'est posé que sans
aucun type (contrat worker/enrich.js inchangé). ?categorie= présélectionne
un seul chip. Tests : 16/16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UvxdoEGWjCTSEJDmraYW96
2026-09-28 12:14:54 +02:00
JulesandClaude Fable 5.1 043e2e2348 fix(b5): la notification ntfy ne porte jamais d'extrait du texte libre ; lien de modération public ; trackingUrl mort retiré
Checkpoint Fable 27/09 : sans lien, nomSuggere() reprenait 60 caractères du texte du contributeur et les envoyait sur un topic ntfy (public par URL). Le nom n'est transmis que s'il vient d'un hostname. Click → sheets.trans-former.fr (localhost inutilisable depuis un téléphone). trackingUrl pointait nav.trans-former.fr/suivi/, page inexistante.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-27 20:20:22 +02:00
JulesandClaude Opus 5.5 695cc8bbc2 feat(aep): M2 — worker adapté (Bifrost + scrape léger + ntfy)
Reprend worker/enrich.js (fusion, pas réécriture) pour le nouveau format de
soumission libre et l'infra en prod (décisions MOE du 27/09) :
- LLM Mistral direct → Bifrost (${BIFROST_URL}/v1/chat/completions,
  x-bf-vk), modèle WORKER_MODEL (défaut groq/llama-3.1-8b-instant).
- Scrape crawl4ai/Python → fetch natif Node 22 : timeout 8s, corps
  plafonné 500 Ko, titre + meta description + og:* + texte tronqué 4000c.
- Email Resend → notification ntfy, jamais l'email ni le texte du
  contributeur (id NocoDB, nom suggéré, type, confiance uniquement).
- Sortie LLM {nom, description, type_suggere, ville, tags, confiance} ;
  le worker ne réécrit `nom`/`submission_type` que si le formulaire assoupli
  a laissé un placeholder ("[à qualifier]" / "Type : non précisé").
- Seuil « 5 fiches pending » retiré (décision volume faible, notée si le
  volume remonte).
- --dry-run : fixture locale, mock Bifrost/scrape par défaut, aucune
  écriture NocoDB, DRY_RUN_LIVE=1 pour forcer de vrais appels réseau.
- worker/daily-digest.js supprimé (non référencé, cron purgé le 15/07).

deploy/aep-worker/ : service + timer (15 min) + README avec les étapes
exactes de déploiement pour la session qui déploiera (backup NocoDB,
copie, systemctl, test bout-en-bout M3) — rien exécuté ni copié ici.

PIPE-IA-DOC.md §11 : documente tous les écarts vs la version NAV V2 d'origine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 16:01:53 +02:00
JulesandClaude Opus 5.5 09d1dc9d5f feat(aep): M1 — formulaire /proposer assoupli (liens + texte libre + chip)
Le contributeur colle un lien (ou plusieurs) et explique en texte libre
pourquoi c'est pertinent, sans template ni minimum de caractères. Le type
devient une suggestion optionnelle (chips). Les 5 formulaires typés restent
disponibles derrière « Mode détaillé » (replié par défaut).

- utils/submitLibre.ts : schéma Zod partagé client/serveur + mapping vers les
  colonnes NocoDB existantes (aucun changement de schéma) — table orgas par
  défaut, table ressources_references si le chip « Références » est choisi.
- components/FormLibre.vue : liens dynamiques (1-10), texte libre, chips,
  email optionnel, honeypot.
- server/api/submit/index.post.ts : branche mode=libre en amont du schéma
  typé existant ; email Jules remplacé par ntfy (server/utils/notify.ts) —
  jamais l'email ni le texte du contributeur dans la notif.
- scripts/test-submit-libre.mjs : 6 cas contre le vrai schéma Zod (via jiti).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 15:57:11 +02:00
JulesandClaude Opus 5.5 58937a04a3 feat(aep): Soutenir dans le menu déroulant, bandeau bas retiré, cartes Mistral et « souverain » retirés
Décisions Jules du 27/09 : ① À propos sans les cartes Mistral Nemo / Small
(modèles qui ne sont plus en service), Le Chat sans « souverain » (outils.vue
et fmhy-curated.json) ; ② le bandeau bas (transparence IA + don) est retiré,
le menu déroulant devient visible à toutes les largeurs et porte un bouton
Soutenir → liberapay.com/trans-former.fr/donate (onglets masqués dedans ≥1024px).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 15:49:26 +02:00
JulesandClaude Opus 5.5 38818f77ae feat(aep): têtes Jobs (S) et Réseaux AEP (M) + retrait des mentions Mistral
Arbitrages de Jules du 26/09 (table R §6) : 2A Jobs en S (tête ← slide 16),
1A Réseaux AEP en M (tête ← slide 17), 6 retrait de « Propulsé par Mistral »
et du badge « IA souveraine : Mistral AI », sans rien affirmer à la place.

- pages/trouver-du-taf.vue : EchelleTete S sous le titre, centrée comme l'en-tête ;
  note du chatbot réduite à « 20 questions/jour ».
- pages/agences.vue : popup Réseaux avec echelle="M".
- ChatbotPlaceholder, ChatbotSheet : phrase « serveur européen souverain
  (Mistral FR, zéro rétention) » retirée.
- a-propos : badge « IA souveraine » retiré.
Non touchés : cartes ia-card « Mistral Nemo / Small » d'À propos, « Mistral Le Chat »
d'Outils (hors consigne).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 18:42:19 +02:00
JulesandClaude Opus 5.5 d9f934a8b2 feat(aep): têtes d'onglet S / M / XL (slides 16-18 du deck du 23/09) + lien mobile recherche-média
- utils/echelles.ts : texte des slides 15 à 18, mot pour mot, source unique
  (la future nav S / M / XL lira ce fichier).
- EchelleTete.vue : badge d'échelle, titre, sept mots, phrase, ligne
  « Chaque section est ouverte aux contributions » vers /proposer.
- Placée en tête du texte existant, sans le remplacer : Outils (S),
  popup Écosystème Entraide (M), page Codev (M), popup média (XL).
  Réseaux AEP et Jobs attendent les arbitrages n° 1 et 2 (table R §6).
- /proposer?categorie=<id> présélectionne l'onglet.
- Menu mobile : « recherche-média » pointait sur /rag (301), pointe sur /media,
  état actif comme les autres liens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 17:58:31 +02:00
JulesandClaude Sonnet 5 baa602e5f8 fix(b3): M5 — textes alignés sur le deck du 23/09 (popup média, nav mobile, À propos, Proposer, familles)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 14:26:13 +02:00
JulesandClaude Sonnet 5 6087b8dd31 feat(b3): M4 — favicon maillage, Manifeste dans le header, hashtags repliés, DESIGN-SYSTEM.md
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 14:17:53 +02:00
JulesandClaude Sonnet 5 13af3fa1c5 fix(b3): M3 — vue Fiches mobile pleine hauteur, intention avant le compteur
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 12:23:52 +02:00
JulesandClaude Sonnet 5 1838f4b02d feat(b3): M3 — panneau « toutes les fiches » sur / et /agences (desktop + mobile), fiches sans géoloc visibles, ?vue=fiches
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 12:17:52 +02:00
JulesandClaude Sonnet 5 5b504b3e04 fix(config): retire vite.cacheDir Windows en dur (dossier C:/ parasite sur Linux)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 12:14:05 +02:00
JulesandClaude Sonnet 5 b2b8c13fee feat(b3): M2 — FicheMiniCard + adaptateur Org/Structure, story de test
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 12:10:54 +02:00
JulesandClaude Sonnet 5 4b1340f160 feat(b3): M1 — Chip.vue par dimension (échelle outline, fonction pleine, posture safran) + filtres / et /agences
- components/Chip.vue (nouveau) : label/variant(echelle|fonction|posture)/
  active/count/as(button|span)/removable, emits toggle+remove, aria-pressed
  natif sur as=button, croix "Retirer {label}" accessible. Styles 100% tokens
  DS (--primary/--on-primary/--bg-alt/--accent/--on-accent/--focus-ring/
  --dur-fast), hover translateY, focus-visible outline var(--focus-ring),
  transition coupée sous prefers-reduced-motion. Taille compacte 32px de haut
  mesurée (tap ok).
- components/ChipGroup.vue (nouveau) : role="group" + aria-label + flex-wrap
  gap — garantit le wrap propre exigé (jamais une ligne à virgules).
- EchelleFilter.vue, FonctionFilter.vue : rendu remplacé par Chip/ChipGroup,
  props modelValue/counts et événement update:modelValue strictement
  inchangés (NavSidebar.vue n'a rien à changer côté logique). FonctionFilter
  passe le rang de sélection (comme avant) via le prop count de Chip.
- HashtagFilter.vue : seule la liste HASHTAGS (togglable, grammaire fonction)
  passe en Chip/ChipGroup. Les chips FAMILLES gardent leur rendu et leurs
  couleurs propres par famille (hors grammaire échelle/fonction/posture,
  hors périmètre B3 — les changer aurait été une refonte, pas un branchement).
- pages/agences.vue : hashtags par structure (liste sidebar) en
  Chip as="span" variant="fonction" (non cliquables avant, le restent).
- pages/index.vue : la sheet mobile ne passe PAS par NavSidebar/EchelleFilter/
  FonctionFilter — elle a son propre bloc de chips dupliqué (découvert en
  testant le mobile, absent du périmètre écrit du brief). Direction du parti
  design ("chips codées par dimension", mobile-first explicite) : convertie
  en Chip/ChipGroup elle aussi, mêmes handlers toggleEchelle/toggleFonction
  inchangés. Effet de bord positif : le nombre par fonction (déjà calculé,
  jamais affiché sur mobile) apparaît désormais aussi en mobile, à parité
  avec le desktop.
- components/TagBadge.vue supprimé : son seul consommateur, OrgCard.vue,
  n'est importé nulle part dans l'app (grep vérifié) — code mort. OrgCard.vue
  supprimé avec lui plutôt que laissé avec une référence à un composant
  disparu.
- components/TypeBadge.vue : conservé tel quel — ce n'est pas un filtre, et
  sa grammaire couleur par type (7 couleurs Tailwind fixes) est orthogonale
  à échelle/fonction/posture ; le convertir en Chip aurait perdu l'info de
  type ou inventé une 4e variante non validée.

Vérifié : npm run build OK. Chips wrap avec gap en clair/sombre/mobile
(390px, hauteur mesurée 32px). Dark mode : contraste texte/fond conforme
(safran = texte sombre, jamais blanc).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 12:03:22 +02:00
JulesandClaude Sonnet 5 0903b8989b feat(b3): M0 — tokens @transformer/ui + thème aep, --nav-* en alias des rôles DS
- package.json : dépendance @transformer/ui (git+https design-system.git)
- nuxt.config.ts : css tokens.css + theme/aep.css chargés avant main.css
- assets/css/main.css : --nav-bg/-bg-alt/-surface/-primary/-accent/-text/
  -text-muted/-font deviennent des alias var(--role) DS ; focus ring sur
  var(--focus-ring). --nav-primary-raw, --nav-primary-solid, --nav-accent-soft
  et --nav-text-on-primary restent des valeurs propres à nav-carte (pas
  d'équivalent DS fiable en sombre — --nav-text-on-primary sert de contraste
  à la fois sur --nav-primary translucide et --nav-primary-solid opaque, deux
  fonds dont la légèreté s'inverse en sombre ; aliaser sur --on-primary DS
  cassait le contraste du logo AEP et de ~10 boutons en sombre, testé au
  pixel et reverti)
- tailwind.config.js : couleurs nav.* pointent vers les variables --nav-*
  (pas de darkMode:'class' ajouté — aucune classe dark: Tailwind en usage)

Vérifié : npm run build OK, diff pixel avant/après < 0.5% sur home + agences
en clair/sombre (bruit = badge Nuxt Devtools, pas les tokens).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 11:51:58 +02:00
JulesandClaude Opus 5.5 b5aca80bbc fix(carte): fond de carte avec clé CARTO, repli Plan IGN sans clé
CARTO Basemaps exige une clé depuis le 23/09/2026 : sans elle, chaque tuile
porte le filigrane « API KEY REQUIRED ». Clé lue au runtime
(NUXT_PUBLIC_CARTO_KEY) ; sans clé, repli sur le Plan IGN (Géoplateforme).
FicheDetail quitte aussi les tuiles OSM (418, politique d'usage).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 12:00:49 +02:00
Jules Neny 946ed53aba feat(outils): note détaillée annuaire fmhy — cartographie traduite par usage, avertissement légal, snapshot 2026-08-25 2026-08-25 19:03:16 +02:00
Jules Neny d06c09a476 fix(bifrost): retire cerebras/gemma-4-31b du fallback tier RAPIDE (JSON invalide ~75% du temps) 2026-07-15 22:53:54 +02:00
Jules NenyandClaude Sonnet 5 4291fe7529 feat(chatbot): branche Entraide/Réseaux/Jobs sur Bifrost au lieu de Mistral direct
Les 3 routes chatbot (chatbot.post.ts, chatbot-reseaux.post.ts, chatbot-taff.post.ts)
appellent désormais ${bifrostUrl}/v1/chat/completions (header x-bf-vk) au lieu de
api.mistral.ai direct. Tier RAPIDE par défaut (groq/llama-3.1-8b-instant + fallbacks
cerebras/gemini-flash-lite/cohere), tier APPROFONDI si body.mode === 'approfondi'
(prêt pour un futur toggle UI, hors-scope ici).

- server/utils/bifrost.ts (nouveau) : mutualise les 2 tiers pour les 3 routes.
- nuxt.config.ts : ajoute bifrostUrl/bifrostVk au runtimeConfig (mistralApiKey
  conservé, juste plus utilisé par ces 3 routes).
- chatbot.post.ts : garde son circuit breaker + logging stats_usage tels quels,
  mais logUsage reflète maintenant le provider/modèle réel ayant répondu
  (extra_fields de Bifrost) et ne calcule un coût que si ce provider est Mistral
  (les autres tiers Bifrost sont free-tier — cout_eur=0 sinon, pour ne pas fausser
  le circuit breaker budget).
- chatbot-reseaux.post.ts / chatbot-taff.post.ts : aucun circuit breaker/logging
  avant, aucun ajouté (asymétrie pré-existante préservée telle quelle).
- chatbot-v2.post.ts (orphelin) et chatbot-pensees.post.ts (proxy LightRAG,
  config runtime séparée) non touchés.

Testé en dev local contre Bifrost (IP Tailscale) : 1 appel réel par route,
réponses conformes, provider réel confirmé dans les logs de test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 22:39:16 +02:00
Jules Neny e5d57e0053 Merge branch 'feat/proposer-4-onglets'
# Conflicts:
#	public/data/auteurs-pensees.json
2026-06-23 13:03:29 +02:00
Jules NenyandClaude Opus 4.8 3cf9f721a7 fix(chatbot): versionne auteurs-pensees.json (UTF-8) — catalogue RAG
Catalogue lu au runtime par le chatbot par-auteur (171 auteurs, 10 ecoles,
corpus 277). Jamais versionne -> droppe des builds -> feature cassee en prod.
Desormais tracke + converti UTF-16->UTF-8 (le serveur lit en utf-8).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M4VP2GCZfGY2zWs9NAC84X
2026-06-23 13:02:10 +02:00
Jules Neny 04b023518a fix(chatbot): restore auteurs-pensees.json (runtime dependance chatbot, etait perdue dans un worktree) 2026-06-23 12:58:16 +02:00
Jules Neny e61114d6ec fix(chatbot): restore auteurs-pensees.json (runtime dependance chatbot, etait perdue dans un worktree) 2026-06-23 12:58:04 +02:00
Jules Neny c860dabdc0 feat(proposer): interface 5 onglets + soumission Références vers NocoDB
- Page /proposer avec 5 onglets (Écosystème/Réseau/Jobs/Outils/Références RAG)
- 5 form components + form-styles.css partagé
- Submit multi-type avec submission_type vers NocoDB
- Server route references.post.ts réécrite pour NocoDB (table ressources_references)
- redirect 301 /contribuer → /proposer
- Suppression references-pending.json
2026-06-23 12:13:33 +02:00
Jules Neny f3ab28bd69 fix(aep): chatbot RAG pensées + config ragPeUrl + layout media + a-propos
Composant + route chatbot non committés, runtimeConfig.ragPeUrl,
ajustements layout MediaTabVisuel, contenu a-propos.
2026-06-23 11:15:54 +02:00
Jules NenyandClaude Sonnet 4.6 cd8fe9e258 fix(media): toolbar remise entre carte et chatbot + nav renommée
- fix: layout-toggle-bar à l'intérieur du layout-container (entre carte D3 et chatbot)
- fix: chatbot de nouveau visible en mode split
- feat: nav "Écosystème Entraide Architecture" → "Écosystème Entraide"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 15:50:22 +02:00
Jules NenyandClaude Sonnet 4.6 ea7c8cc91e fix(server): useEvent() → event param dans la server route auteurs-pensees
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 15:26:27 +02:00
Jules NenyandClaude Sonnet 4.6 538c490e76 fix(media): carte D3 + chatbot restaurés + refonte toolbar + nav
- fix: server route /data/auteurs-pensees.json (contournement bug manifest Nitro)
- fix: contentView indépendant du layoutMode — boutons CARTE PRINCIPALE / bonpote / RAG backend ne modifient pas l'état carte-full/chatbot-full
- feat: bouton CARTE PRINCIPALE → restaure la vue D3 + chatbot split
- fix: /rag redirige vers /media (301)
- feat: nav "RAG en construction" → "recherche-média" lien /media

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 15:24:29 +02:00
Jules NenyandClaude Sonnet 4.6 d584d04e3d merge(feat/outils-v1): page Outils V1 + bibliothèque pensées écologiques refonte
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 14:52:42 +02:00
Jules NenyandClaude Sonnet 4.6 bd95c0f00d fix(media): RAG visible + refonte interface bibliothèque pensées écologiques
- fix: penseesData chargé en interne dans MediaTabVisuel (bug prop jamais passée)
- feat: onglet renommé '📚 bibliothèque des pensées écologiques', suppression tab LightRAG backend
- feat: 'RAG backend' devient bouton inline dans toolbar → layout mode 'rag-backend'
- feat: fusion boutons 'Bonpote V2' + 'Carte FRACAS PDF' → contrôle unique avec tickbox intégré
- feat: iframe lightrag.trans-former.fr décommentée (DNS propagé)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 14:52:20 +02:00
Jules Neny db8f614928 fix(CartePensees): reformatage syntaxe - fichier condensé sur 1 ligne cassait le build Vite/Vue 2026-05-22 11:07:10 +02:00
Jules Neny 59cb81a055 Merge P3 media modif 2026-05-22 11:02:05 +02:00
Jules Neny 91e3466ec6 Merge P2 outils build 2026-05-22 11:01:30 +02:00
Jules Neny cb75889231 feat(media): 3 sous-onglets RAG/LightRAG/Projets + titres cercles D3 + layer PDF FRACAS + onglet PFE 2026-05-22 11:00:00 +02:00
Jules Neny 422f45116f feat(outils): page Outils V1 + composants TreeASCII/OutilCard/SimulateurFeature + nav premier onglet 2026-05-22 10:58:39 +02:00
Jules NenyandClaude Opus 4.7 f5732bf336 feat(mobile+UX): refonte hamburger, pop-ups Mission, Manifeste, fixes mobile
Hamburger:
- Ajout Jobs, Manifeste, Soutenir
- Ré-ordonnancement (cartes/RAG/Codev en haut, ressources en bas)

Pop-ups Mission:
- MissionPopup générique (slot, props title/ctaLabel/storageKey)
- Auto-show 1ère visite Carte 1 (Entraide) et Carte 2 (Réseaux AEP)
- Bouton (i) flottant pour rouvrir

Pages:
- /manifeste : nouvelle page (texte version page-carto-V1)
- /a-propos : section 1 retirée (devient pop-up Carte 1) + scroll latéral fixé
- /agences : 3e onglet "Graphe" sur mobile + labels structures sur GraphView
- /trouver-du-taf : intro pédagogique repliable (onglets / tags / 5 axes),
  filtres mobile repliables, "Plateformes B2C" → "Pour archi indépendants"

Mobile UX:
- FAB coeur jaune Soutenir retiré (BandeauBas) — accessible via hamburger
- FicheModal/V2 : décalage top:76px sur mobile pour ne plus mordre header
- Logo header : "Architecture d'Écologie / Politique" en clair (2 lignes)

Cause racine résolue:
- /api/chatbot-reseaux n'avait jamais été déployé → 404 en prod avant ce build

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 18:58:42 +02:00
Jules NenyandClaude Sonnet 4.6 5967a5af57 fix(chatbot): séparation définitive Carte1/Carte2 + markdown inline styles
- ChatbotReseaux.vue : composant standalone, endpoint hardcodé /api/chatbot-reseaux,
  onboarding 120 réseaux AEP, aucun prop partagé avec ChatbotSheet
- ChatbotSheet.vue : restauré état simple, /api/chatbot hardcodé, onboarding Carte 1
- agences.vue : ChatbotReseaux au lieu de ChatbotSheet
- useMarkdown.ts : inline styles (font-weight:700 etc) — zéro dépendance CSS,
  fonctionne dans tout contexte Vue scoped/v-html sans exception

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 02:38:47 +02:00
Jules NenyandClaude Sonnet 4.6 419071b4c5 fix(chatbot): double-sécurité endpoint — prop + useRoute fallback
Route /agences → /api/chatbot-reseaux garanti, même si prop non reçu.
Titre du chatbot affiche la carte active pour confirmation visuelle.
activeEndpoint computed depuis props.endpoint ?? route-based detection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 02:26:54 +02:00
Jules NenyandClaude Sonnet 4.6 f7b01c33e6 fix(chatbot): markdown :deep() + onboarding v-if/v-else propre
- CSS: :deep(.md-content) perce le scoped — résout l'écrasement par .assistant-bubble p
- Template: <template v-if> / <template v-else> au lieu de <p v-if /> + v-else
  (tag void + v-else = pairing HTML instable)
- Carte 1 retrouve son onboarding d'origine (v-else sur props.onboarding absent)
- Carte 2 garde son onboarding 120 structures via prop

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 02:07:28 +02:00
Jules NenyandClaude Sonnet 4.6 a72928343f fix(chatbot): import explicite useMarkdown + titre/onboarding par carte
- ChatbotSheet: import explicite useMarkdown (plus d'auto-import incertain)
- Props: title, onboarding, endpoint
- agences.vue: titre 'Réseaux AEP' + message d'accueil distinct + endpoint correct
- Header chatbot affiche le nom de la carte active

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 01:54:38 +02:00
Jules NenyandClaude Sonnet 4.6 f9a0875727 fix(chatbot): Réseaux AEP → /api/chatbot-reseaux + prop endpoint ChatbotSheet
- server/api/chatbot-reseaux.post.ts : keyword search sur reseaux-bifurcation.json
  (120 structures, même pattern que chatbot-taff)
- ChatbotSheet.vue : prop endpoint? (défaut /api/chatbot) + renderMd déjà actif
- agences.vue : endpoint='/api/chatbot-reseaux'

Markdown s'active au prochain restart du bat (cache .nuxt à nettoyer).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 01:43:02 +02:00
Jules NenyandClaude Sonnet 4.6 ec9178be08 feat(ux): markdown chatbots + header Jobs centré + cible archi indépendants
- composables/useMarkdown.ts : renderer MD léger (bold/italic/listes/titres)
- ChatbotSheet.vue + trouver-du-taf.vue : v-html renderMd() sur messages bot
- assets/css/main.css : styles .md-content globaux pour tous les chatbots
- taff-header centré + phrase cible 'architectes indépendants, 70% de la profession'

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 01:26:46 +02:00
Jules NenyandClaude Sonnet 4.6 6525afd5f5 fix(chatbot-taff): import JSON statique — fonctionne dev + prod
Import direct du JSON au moment du build (bundlé par Rollup).
Supprime serverAssets et useStorage qui ne marchaient pas en dev Nitro.
Ajoute GET /api/plateformes-taff comme endpoint réutilisable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 01:17:07 +02:00
Jules NenyandClaude Sonnet 4.6 4d7e8bede9 fix(chatbot-taff): useStorage('assets:taff') — lecture JSON native Nitro
- nuxt.config.ts: nitro.serverAssets pointe sur public/data/
- chatbot-taff: useStorage remplace readFileSync et $fetch
  (fonctionne dev + prod sans dépendance filesystem ni réseau)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 01:13:21 +02:00
Jules NenyandClaude Sonnet 4.6 70b9b1aa3c fix(chatbot-taff): lecture JSON via $fetch(origin) — fonctionne dev + prod
Remplace readFileSync (chemin instable Nitro) par $fetch sur le serveur
lui-même qui sert déjà plateformes-taff.json en statique.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 01:10:29 +02:00
Jules NenyandClaude Sonnet 4.6 cc93571d94 fix(chatbot-taff): Windows path — process.cwd() → fileURLToPath(import.meta.url)
Crash ESM loader sur Windows (protocole c:) corrigé.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 01:05:06 +02:00
Jules Neny 2b34d05585 fix(codev): demo - CSS tabs + annuaire manquants 2026-05-07 00:58:14 +02:00
Jules NenyandClaude Sonnet 4.6 19ff17e236 feat(taff): layout colonne + modal positionné + chatbot flottant
- Grille : 3 colonnes → 1 colonne centrée 720px (respire, 16 fiches)
- Modal : top fixe 72px au lieu de top-1/2 (ne mord plus le header)
- Chatbot FAB : bouton fixe bas-droite + panel slide-in avec Mistral
- /api/chatbot-taff : endpoint dédié lisant plateformes-taff.json
- Cartes : layout restructuré tag/nom/axes/desc-3-lignes/footer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:57:58 +02:00
Jules NenyandClaude Sonnet 4.6 eb1bcf6080 feat(aep-v2): restore composants V2 manquants sur main (NavMapV2 + HashtagFilter + GraphView + FicheFamilleModal + types + css + server)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:56:08 +02:00
Jules Neny 9eb66ac10c fix(data): restore reseaux-bifurcation.json manquant sur main (21072L, 120 structures) 2026-05-07 00:51:28 +02:00
Jules NenyandClaude Sonnet 4.6 0378f2bd72 fix(taff): 3 corrections UI — modal z-index, axes flex, cards layout
- Modal z-index 1501→10001 (au-dessus du header 9999)
- Axes modal: grid→flex avec flex-basis 130px (plus de wrap PRATIQUES PRO)
- Cartes: layout restructuré — tag / nom / axes / desc 3 lignes / footer séparé

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:48:56 +02:00
Jules NenyandClaude Sonnet 4.6 f0696a8fb3 feat(taff): page /trouver-du-taf + types + JSON + PlatformeTaffCard sur main
Cherry-pick depuis feat/aep-taff-v1 — 24 plateformes scorées, page Jobs complète.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:40:41 +02:00
Jules NenyandClaude Sonnet 4.6 03127b1648 feat(nav): Réseaux AEP V2 + onglets Métropole/Outremer Carte1 + reorder nav
- pages/agences.vue : carte V2 complète restaurée (517L, 120 structures)
- pages/index.vue : onglets Métropole/Outre-mer + desktopMapView + chatbot outremer
- app.vue : ordre nav → Entraide / Réseaux AEP / Jobs / Codev / RAG (en construction)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:40:22 +02:00
Jules Neny 0099627da4 feat(codev): merge feat/codev-mvp - app entraide co-developpement 2026-05-07 00:33:47 +02:00
Jules NenyandClaude Sonnet 4.6 f9960bf8ea feat(taff): onglet 'Jobs' dans la nav → /trouver-du-taf
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:33:16 +02:00
Jules NenyandClaude Sonnet 4.6 05bbcc2a02 fix(nav): Réseaux AEP + Leaflet CSS global + double rAF NavMap + chips V2
- app.vue : "Agences Inspirantes" → "Réseaux AEP" (desktop + mobile)
- nuxt.config.ts : Leaflet/MarkerCluster CSS global + Vite cacheDir AppData
- NavMap.vue : double requestAnimationFrame avant initMap (même fix NavMapV2)
- NavSidebar.vue : tags → style chip rounded-full comme V2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:32:50 +02:00
Jules Neny f518318d60 feat(codev): demo - tabs Carto/Annuaire + Solution+Alliance sans Surprise 2026-05-07 00:29:51 +02:00
Jules Neny 0598536244 fix(codev): réajouter bouton Solution dans carto (Solution + Alliance) 2026-05-07 00:29:03 +02:00
Jules Neny b951fe0b8d fix(codev): sticky col-nom fond opaque + ombre separation mobile 2026-05-07 00:23:39 +02:00
Jules NenyandClaude Sonnet 4.6 c8311ce1fb feat(codev): retire Surprise + QR public + mode admin suppr fiches
- carto.vue : retire bouton Surprise (Alliance seul reste), ajoute isAdmin + deleteFiche + colonne supprimer annuaire
- middleware : /codev/qr exempté d'authentification
- auth.post.ts : détecte mdp admin → pose cookie codev_admin
- DELETE /api/codev/fiches/[id] : vérifie cookie admin avant suppression NocoDB
- GET /api/codev/me : retourne { admin, session }
- nuxt.config.ts : codevAdminPassword ajouté

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 00:22:44 +02:00
Jules Neny 142e5cf787 feat(codev): skip fiche + annuaire table sticky + page QR code 2026-05-07 00:04:42 +02:00
Jules Neny 606b9f0a47 feat(codev): tabs Besoins/Competences + retour fiche + panel mobile bottom sheet 2026-05-06 21:29:07 +02:00
Jules Neny 6f7d2450de fix(codev): algo Solution tokenize direct + seuils releves + fiches demo enrichies 2026-05-06 21:28:27 +02:00
Jules Neny e7c7d302ea fix(codev): boundaries D3 + matching rebuildLinks + couleurs + bulles toggle + FAB + 2026-05-06 17:49:56 +02:00
Jules Neny 4ed0a87106 feat(codev): onglet Codev dans nav desktop + menu mobile 2026-05-06 17:49:27 +02:00
172 changed files with 61159 additions and 4498 deletions
+1
View File
@@ -7,3 +7,4 @@ dist
*.log
*.tmp.*
.firecrawl/
+143
View File
@@ -0,0 +1,143 @@
# Design system nav-carte (AEP)
Ce fichier existe pour que B6 à B9 n'aient pas à relire les récaps de B3 (`1 PROJETS/DEV/AEP/Cascade-Refonte/recaps/B3-*.md` dans le vault Dropbox) pour comprendre ce qui a été posé. Si tu es sur B6+ et que tu touches au visuel de nav-carte, lis ceci d'abord.
## D'où viennent les tokens
Les couleurs, espacements, rayons, ombres, etc. ne sont **jamais** des valeurs en dur dans les composants nav-carte. Ils viennent de deux fichiers, chargés dans cet ordre dans `nuxt.config.ts` :
1. `@transformer/ui/tokens.css` — package npm partagé (`git+https://git.trans-former.fr/jules/design-system.git`), le schéma canonique de tokens par **rôle** (`--bg`, `--text`, `--primary`, `--focus-ring`, `--space-*`, `--radius-*`, `--fs-*`, etc.). Jamais cloné en local, jamais modifié depuis ce repo.
2. `@transformer/ui/theme/aep.css` — la palette AEP spécifique (« Sobre institutionnel », validée par Jules), qui surcharge les rôles du point 1 avec les vraies couleurs : bleu nuit `#1a2238`, accent safran `#f5b342`, fond crème `#f8f6f1`. C'est ce fichier qui rend `--primary`, `--accent`, `--bg` etc. concrets pour AEP.
`assets/css/main.css` définit ensuite des variables `--nav-*` (héritées de l'ancienne palette V1, avant l'arrivée du DS). Elles sont **alias** des rôles ci-dessus : `--nav-bg: var(--bg)`, `--nav-text: var(--text)`, etc. Elles existent uniquement parce que tout le code existant (avant B3) les consomme — ne pas les supprimer sans grep préalable, ne pas en créer de nouvelles : pour du code neuf, consommer directement les tokens `--bg`/`--text`/`--primary`/... du DS.
**Trois variables restent volontairement non-aliasées**, propres à nav-carte :
- `--nav-primary-raw` — triplet RGB (`26, 34, 56`) utilisé dans des `rgba(var(--nav-primary-raw), x)`. Le DS n'expose pas de triplet RGB séparé, seulement des couleurs finales.
- `--nav-primary-solid` — bleu nuit plein (`#1a2238` clair, `#c8d2f0` sombre). Différent de `--primary` du DS, qui est le bleu nuit à 60 % d'opacité (utilisé pour les surfaces translucides). `--nav-primary-solid` sert au texte et aux éléments qui doivent rester lisibles en plein (logo, soulignement d'onglet actif).
- `--nav-text-on-primary` — texte de contraste, gardé en valeur littérale (`#f8f6f1` clair / `#111520` sombre) plutôt qu'aliasé sur `--on-primary` du DS. **Raison** : cette variable sert de texte de contraste sur DEUX fonds différents dans le code existant — `--nav-primary` (translucide) ET `--nav-primary-solid` (opaque) — qui ont une légèreté **inversée** en mode sombre (le translucide rend sombre une fois mélangé au fond, le solid `#c8d2f0` est un lavande clair). Le rôle `--on-primary` du DS ne colle qu'au premier cas ; l'aliaser cassait le contraste à une dizaine d'endroits (logo « AEP », boutons, bandeaux) en sombre. Si tu ajoutes un nouvel usage de cette variable, vérifie d'abord sur QUEL fond (translucide ou solid) le texte doit être lisible.
Dark mode : classe `.dark` posée sur `<html>` (`document.documentElement.classList.add('dark')`, persisté dans `localStorage.aep_theme`). `theme/aep.css` définit ses valeurs sombres sous le sélecteur `:root.dark, :root[data-theme="dark"]` — les deux formes sont acceptées, mais nav-carte n'utilise que `.dark`. Pas de bascule automatique par `prefers-color-scheme` (décision explicite : le site n'en a jamais eu, ça changerait ce que voient les visiteurs par défaut).
## Grammaire des chips par dimension
Trois dimensions, trois traitements visuels — posés en B3-M1, pensés pour rester stables jusqu'à B4+ (nouvelles dimensions à ajouter, pas à réinventer) :
| Dimension | Variant | Rendu inactif | Rendu actif |
|---|---|---|---|
| Échelle (national/régional/local) | `echelle` | outline, fond transparent | fond `--primary` plein, texte `--on-primary` |
| Fonction / hashtag | `fonction` (défaut) | fond `--bg-alt` | fond `--primary` plein, texte `--on-primary` |
| Posture (préparée pour B4, pas encore consommée) | `posture` | outline safran (`--accent`) | fond `--accent` plein, texte `--on-accent` **sombre** — jamais blanc sur safran (voir règle de contraste plus bas) |
Composants : `components/Chip.vue` (une chip, `<button>` ou `<span>` selon `as`) et `components/ChipGroup.vue` (conteneur `role="group"`, `flex-wrap`, gap). Toujours les deux ensemble — jamais une chip nue hors groupe (accessibilité : le groupe porte l'`aria-label` qui dit ce qu'on filtre).
```vue
<ChipGroup aria-label="Filtrer par fonction">
<Chip
v-for="fn in fonctions"
:key="fn"
:label="fn"
variant="fonction"
:active="selected.includes(fn)"
@toggle="toggleFonction(fn)"
/>
</ChipGroup>
```
Pour une chip non cliquable (affichage seul, ex. liste de résultats) : `as="span"` — pas de `type="button"`, pas d'`aria-pressed`, pas de handler `@toggle` nécessaire.
## FicheMiniCard + useFicheAdapter — brancher une nouvelle source
`composables/useFicheAdapter.ts` expose `toMini(source): MiniFiche`, où `MiniFiche = { id, nom, resume, chips, echelle?, geoloc, kind }`. Aujourd'hui il distingue `Org` (NocoDB, page `/`) et `StructureV2` (JSON statique `reseaux-bifurcation.json`, page `/agences`) via `'famille_principale' in source` (seul champ propre à `StructureV2`).
**Pour brancher une 3e source** (B6+, ex. un nouveau type de fiche) :
1. Ajoute son type à l'union `Org | StructureV2 | TonNouveauType` dans la signature de `toMini`.
2. Ajoute une garde de type (comme `isStructure`) basée sur un champ qui n'existe QUE dans ton nouveau type — ne réutilise pas `famille_principale` ou un champ ambigu.
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` (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.
## Vue fiches (B11 02/10/2026, détail B12 03/10/2026) — `VueFiches` + `useVueFiches`
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).
**Trois fichiers, trois rôles.**
| 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 |
**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.
**É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.
**`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 `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)
Le favicon (`public/favicon.svg`, décliné en `favicon-32.png`, `favicon-16.png`, `apple-touch-icon.png`) dessine un petit graphe : un nœud central relié à cinq nœuds périphériques par des arêtes, sur fond bleu nuit avec des nœuds/arêtes safran. C'est un **motif à décliner**, pas une icône isolée — il préfigure les liens de graphe et les connexions entre fiches attendus en B4 (postures), B8 et B9 (structures liées, graphe de réseau déjà présent dans `FicheModalV2` via `structuresVoisines`). Si tu dessines un composant de graphe ou de connexions entre fiches dans ces batchs, reprends ce vocabulaire visuel (nœuds pleins, arêtes fines, un nœud central mis en avant) plutôt que d'en inventer un nouveau.
## Deux règles de contraste
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.
+90
View File
@@ -204,6 +204,8 @@ cout_eur = ((tokens_in × 0.02 + tokens_out × 0.04) / 1_000_000) × 0.93
Le filtre NocoDB par date (`gte,YYYY-MM-DD`) n'est pas supporté en v0.301.5. Contournement : récupération de tous les records stats_usage (limit=1000) et filtre JavaScript par mois/année.
**Côté chatbot (AF5, 29/09)** : `server/utils/circuitBreaker.ts` n'appliquait pas ce contournement. Il envoyait `where=(timestamp,gte,…)&fields=cout_eur,timestamp` et recevait un 422 à chaque appel : fail-open silencieux, budget jamais vérifié depuis la V2. Il suit désormais le worker : **aucune colonne nommée dans la requête** (ni `where`, ni `fields`, ni `sort`), lecture paginée (`limit`/`offset` 1000), mois filtré en JS sur `timestamp`, sinon `CreatedAt`, sinon `created_at`. Chaque lecture écrit au journal `[circuitBreaker] budget lu : X € / 20 € (n lignes AAAA-MM sur N lues)` ; un échec écrit `budget NON vérifié`. Test : `node scripts/test-circuit-breaker.mjs` (faux NocoDB qui rejette en 422 toute colonne absente). Seule `/api/chatbot` vérifie le budget ; `-reseaux` et `-taff` ne le lisent ni ne l'écrivent (asymétrie pré-existante), et les appels servis par un tier gratuit s'inscrivent à 0 €.
---
## 7. Infrastructure
@@ -330,3 +332,91 @@ Pattern à généraliser :
4. Normalize(tags) → taxonomie contrôlée
5. Log(usage) → stats_usage
```
---
## 11. B5 (2026-09-27) — Formulaire assoupli + pipe adapté (fusion, pas réécriture)
Ce qui suit documente les écarts posés par le batch B5 (décisions de la
maîtrise d'œuvre du 27/09). Les sections 1 à 10 ci-dessus restent la
référence de fond (taxonomie, système prompt d'origine, circuit breaker) ;
cette section documente ce qui a changé dans `worker/enrich.js` et le pipe
de soumission (`server/api/submit/`).
### 11.1 Mapping soumission libre → colonnes NocoDB existantes (M1)
Le formulaire `/proposer` assoupli (`components/FormLibre.vue`,
`utils/submitLibre.ts`) écrit dans la table orgas existante, **aucune colonne
nouvelle** :
| Champ formulaire | Colonne NocoDB | Règle |
|---|---|---|
| 1er lien de la liste | `url` | `null` si aucun lien |
| texte « pourquoi » + tous les liens | `description_user` | `{texte}\n\nLiens :\n{lien1}\n{lien2}...` — et si aucun type suggéré, la ligne `Type : non précisé` est préfixée en tête |
| — | `nom` | hostname du 1er lien, ou 60 premiers caractères du texte si aucun lien, préfixé `[à qualifier] ` |
| chip type suggéré | `submission_type` | valeur choisie (`ecosysteme`/`reseau`/`job`/`outil`) ; si aucune chip → `ecosysteme` par défaut (voir ligne `Type : non précisé` ci-dessus) |
| chip « Références » | *(table `ressources_references`, pas orgas)* | `titre`/`auteur` placeholders, `description` = texte + liens, comme les autres |
| email (optionnel) | `submitted_by_email` | — |
**À faire au déploiement** : ajouter l'option `libre` à la liste de valeurs
acceptées par `submission_type` si l'on veut un jour distinguer une
soumission libre d'une soumission via un des 5 formulaires détaillés — non
fait ici pour ne pas tester un ALTER contre la prod sans l'avoir vérifié.
### 11.2 Worker — écarts (M2)
| Sujet | NAV V2 (§1-10 ci-dessus) | AEP B5 |
|---|---|---|
| LLM | Mistral Nemo, appel direct | **Bifrost** (`${BIFROST_URL}/v1/chat/completions`, header `x-bf-vk`), modèle `WORKER_MODEL` (défaut `groq/openai/gpt-oss-20b` depuis le 28/09, voir §11.3) |
| Scrape | crawl4ai (Python, `AsyncHTTPCrawlerStrategy`) | **fetch natif Node 22** — timeout 8 s, corps plafonné 500 Ko, extraction titre + meta description + `og:*` + texte visible tronqué à 4000 caractères, `User-Agent: AEP/2.0 contact@trans-former.fr` |
| Notification | Resend (email Jules) | **ntfy** (`POST https://ntfy.sh/$NTFY_TOPIC`) — le message ne contient JAMAIS l'email ni le texte libre du contributeur, seulement id NocoDB / nom suggéré / type / confiance |
| Seuil « 5 fiches pending » | Email si ≥ 5 en attente | **Retiré** (décision MOE : volume faible, une notif par fiche traitée suffit — à réactiver si le volume monte) |
| Sortie JSON du LLM | `description_enrichie, points_cles, tags_fonction, echelle, territoire, localisation_ville, confiance` | `{nom, description, type_suggere, ville, tags[], confiance}` — le worker écrit ensuite dans les colonnes existantes (`description_enrichie`, `tags_fonction`, `localisation_ville`) |
| Écriture de `nom` | jamais réécrit | réécrit **seulement** si le nom actuel commence par `[à qualifier]` (placeholder posé par le formulaire assoupli) |
| Écriture de `submission_type` | jamais réécrit | réécrit **seulement** si `description_user` commence par `Type : non précisé` (l'utilisateur n'a pas choisi de chip) et que le type suggéré par le LLM est valide |
| Prix des tokens | fixe (prix Mistral Nemo) | variables `WORKER_PRICE_IN_USD_PER_M` / `WORKER_PRICE_OUT_USD_PER_M`, défaut **0** (tier Groq du tier RAPIDE Bifrost, gratuit) |
| Lock | `/tmp/nav-worker.lock` | `/tmp/aep-worker.lock` (configurable `WORKER_LOCK_FILE`) |
| Chemin VPS | `/opt/nav-carte/worker/` | `/opt/aep-worker/` (voir `deploy/aep-worker/README.md`) |
| Timer | 5 min | 15 min (`deploy/aep-worker/aep-worker.timer`) |
Le mode `--dry-run` (`node enrich.js --dry-run`) lit
`worker/fixtures/dry-run-rows.json` au lieu de NocoDB, n'écrit rien, et par
défaut mock aussi le scrape et l'appel Bifrost (`DRY_RUN_LIVE=1` pour
forcer de vrais appels réseau sans jamais toucher NocoDB).
### 11.3 Modèles Groq retirés — bascule sur gpt-oss (2026-09-28)
Groq ne sert plus `llama-3.1-8b-instant` ni `llama-3.3-70b-versatile`
(404 `model_not_found` via Bifrost, constaté au test M3 du 28/09).
| Consommateur | Avant | Après | Où |
|---|---|---|---|
| Worker (`worker/enrich.js`) | `groq/llama-3.1-8b-instant` | `groq/openai/gpt-oss-20b` | prod : `WORKER_MODEL` dans `/opt/aep/.env` depuis le 28/09 ; défaut du code aligné |
| Chatbots, tier RAPIDE | `groq/llama-3.1-8b-instant` | `groq/openai/gpt-oss-20b` | `server/utils/bifrost.ts`, replis inchangés |
| Chatbots, tier APPROFONDI | `groq/llama-3.3-70b-versatile` | `groq/openai/gpt-oss-120b` | `server/utils/bifrost.ts`, replis inchangés |
| RAG Pensées (LightRAG) | `gemini-oai/models/gemini-2.5-flash-lite` | inchangé | `/opt/lightrag/.env`, hors de ce routage |
Entre le retrait et ce correctif, chaque appel chatbot partait sur le
premier repli Gemini (`stats_usage` depuis le 23/09 environ) : service
rendu, modèle primaire jamais servi.
**gpt-oss est un modèle à raisonnement.** Deux conséquences :
- la réponse porte `choices[0].message.reasoning` à côté de `content`. Les
trois routes (`chatbot`, `chatbot-reseaux`, `chatbot-taff`) et le worker ne
lisent que `content` (JSON), `usage` et `extra_fields` : le champ est
ignoré, rien n'en dépend. `chatbot-pensees` lit la réponse de LightRAG
(`response`, `references`), pas celle de Bifrost ;
- les tokens de raisonnement sont décomptés de `max_tokens`. Si le
fournisseur rend un JSON tronqué en HTTP 200, Bifrost ne bascule pas et
l'usager lit « Je n'ai pas pu analyser ta demande » (s'il le rejette en
400, le repli Gemini prend le relais : dégradé, pas cassé). Les routes chatbot ajoutent donc
`REASONING_MARGIN_TOKENS` (800) à leur budget de contenu (600 ou 700), et
`bifrostContent()` écrit un avertissement au journal quand
`finish_reason` vaut `length`. Le worker garde `max_tokens: 800` (sortie
courte, M3 passé en 1,6 s) ; à relever si `tokens_out` approche 800 dans
`stats_usage`.
**Non testé depuis Windows** (Bifrost écoute sur le loopback du VPS). Test
réel au checkpoint : un appel par route, relever `extra_fields` (modèle
réellement servi), `usage.completion_tokens`, `finish_reason`, et le
modèle inscrit dans `stats_usage` pour `/api/chatbot`.
+165 -184
View File
@@ -1,110 +1,58 @@
<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 -->
<a href="/" class="flex items-center gap-2 hover:opacity-90 transition-opacity shrink-0 group relative" title="Architecture d'Écologie Politique">
<!-- 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-7 px-2 rounded-lg flex items-center justify-center shrink-0"
class="h-8 px-2 rounded-lg flex items-center justify-center shrink-0"
style="background: var(--nav-primary-solid);"
>
<span class="font-bold text-xs tracking-tight" style="color: var(--nav-text-on-primary);">AEP</span>
</div>
<div class="flex flex-col">
<span class="font-bold text-base tracking-tight leading-tight" style="color: var(--nav-text);">AEP</span>
<span class="text-xs leading-tight hidden lg:inline" style="color: var(--nav-text-muted);">Architecture d'Écologie Politique</span>
</div>
<!-- Tooltip sm (quand le sous-titre lg est caché) -->
<div class="absolute left-0 top-full mt-2 px-2 py-1 rounded text-xs whitespace-nowrap pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity lg:hidden z-50"
style="background: var(--nav-primary-solid); color: var(--nav-text-on-primary);">
Architecture d'Écologie Politique
<div class="logo-text flex flex-col leading-tight">
<span class="logo-line-1 font-bold tracking-tight" style="color: var(--nav-text);">Architecture</span>
<span class="logo-line-2 font-bold tracking-tight" style="color: var(--nav-text);">d'Écologie Politique</span>
</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="/"
class="nav-tab"
:class="{ 'nav-tab--active': route.path === '/' }"
>
Écosystème Entraide Architecture
</NuxtLink>
<NuxtLink
to="/agences"
class="nav-tab"
:class="{ 'nav-tab--active': route.path === '/agences' }"
>
Agences Inspirantes
<span class="nav-tab-badge">en construction</span>
</NuxtLink>
<NuxtLink
to="/rag"
class="nav-tab"
:class="{ 'nav-tab--active': route.path === '/rag' }"
>
RAG
<span class="nav-tab-badge">en construction</span>
</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="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>
Soutenir
</a>
<!-- Proposer une ressource -->
<NuxtLink
to="/contribuer"
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);"
to="/proposer"
class="header-proposer hidden md:inline-flex"
>
+ Proposer
</NuxtLink>
@@ -129,69 +77,56 @@
</svg>
</button>
<!-- Mobile : contribuer icône -->
<!-- Mobile : proposer icône -->
<NuxtLink
to="/contribuer"
class="sm:hidden p-2 rounded-lg"
style="background: var(--nav-accent); color: var(--nav-text);"
title="Contribuer une fiche"
aria-label="Contribuer"
to="/proposer"
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>
<!-- Hamburger mobile (lg:hidden) — toujours en dernier à droite -->
<div class="lg:hidden 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="/" class="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 Architecture</NuxtLink>
<NuxtLink to="/agences" class="block px-4 py-2.5 text-sm transition-opacity hover:opacity-70" style="color: var(--nav-text);">Agences Inspirantes</NuxtLink>
<NuxtLink to="/rag" class="block px-4 py-2.5 text-sm transition-opacity hover:opacity-70" style="color: var(--nav-text);">RAG</NuxtLink>
<div style="height: 1px; background: var(--nav-bg-alt); margin: 4px 0;"></div>
<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>
<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" />
<!-- 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>
<!-- Bandeau bas — transparence IA + soutien + compteurs semaine -->
<BandeauBas />
<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)
@@ -214,72 +149,118 @@ 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>
/* ── Onglets header desktop ───────────────────────────────────────────── */
.nav-tab {
position: relative;
display: inline-flex;
flex-direction: column;
/* ── En-tête ──────────────────────────────────────────────────────────── */
.app-header {
min-height: 52px;
}
/* ── Logo header (texte 2 lignes) ─────────────────────────────────────── */
.logo-text {
line-height: 1.05;
}
.logo-line-1, .logo-line-2 {
font-size: 0.7rem;
letter-spacing: -0.01em;
}
@media (min-width: 640px) {
.logo-line-1, .logo-line-2 { font-size: 0.78rem; }
}
@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; }
}
/* ── 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>
+11
View File
@@ -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)),
}
+45 -16
View File
@@ -3,28 +3,44 @@
@tailwind utilities;
/* ── Palette NAV V2 — Sobre institutionnel ─────────────────────────────── */
/* --nav-* sont désormais des ALIAS vers les rôles @transformer/ui (tokens.css
+ theme/aep.css, chargés avant ce fichier dans nuxt.config.ts).
--nav-primary-raw, --nav-primary-solid et --nav-text-on-primary restent des
valeurs PROPRES à nav-carte (non aliasées) :
- le DS n'a pas de triplet RGB (--nav-primary-raw) ;
- le --text du DS en sombre (#e8ecf5) ne correspond pas à la teinte bleu
nuit voulue ici pour --nav-primary-solid (#c8d2f0) ;
- --nav-text-on-primary sert de texte de contraste à la fois sur
--nav-primary (translucide, alias DS) ET sur --nav-primary-solid (opaque,
propre à nav-carte) — deux fonds dont la légèreté s'inverse en sombre
(translucide ≈ fond sombre, solid = lavande claire). Le rôle --on-primary
du DS ne colle qu'au premier cas ; l'aliaser cassait le contraste du AEP
logo, des boutons trouver-du-taf, BandeauBas, SimulateurFeature,
FicheDetail (texte clair sur --primary-solid clair en sombre — testé au
pixel le 25/09, illisible). Gardé littéral = identique à la prod avant B3.
Idem --nav-accent-soft, sans équivalent DS. (B3-M0, 2026-09-25) */
:root {
/* Fonds */
--nav-bg: #f8f6f1;
--nav-bg-alt: #eee9df;
--nav-surface: #ffffff;
--nav-bg: var(--bg);
--nav-bg-alt: var(--bg-alt);
--nav-surface: var(--surface);
/* Bleu nuit — 60% d'opacité sur les surfaces */
--nav-primary-raw: 26, 34, 56;
--nav-primary: rgba(26, 34, 56, 0.6);
--nav-primary: var(--primary);
--nav-primary-solid: #1a2238;
/* Accent safran */
--nav-accent: #f5b342;
--nav-accent: var(--accent);
--nav-accent-soft: rgba(245, 179, 66, 0.85);
/* Texte */
--nav-text: #1a2238;
--nav-text-muted: rgba(26, 34, 56, 0.55);
--nav-text: var(--text);
--nav-text-muted: var(--text-muted);
--nav-text-on-primary: #f8f6f1;
/* Typographie */
--nav-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
--nav-font: var(--font-body);
}
@layer base {
@@ -58,25 +74,25 @@
/* Focus ring accessibilité */
*:focus-visible {
outline: 2px solid var(--nav-accent);
outline: 2px solid var(--focus-ring);
outline-offset: 2px;
}
/* ── Dark mode ──────────────────────────────────────────────────────────── */
.dark {
--nav-bg: #111520;
--nav-bg-alt: #1e2538;
--nav-surface: #1a2238;
--nav-bg: var(--bg);
--nav-bg-alt: var(--bg-alt);
--nav-surface: var(--surface);
--nav-primary-raw: 200, 210, 240;
--nav-primary: rgba(200, 210, 240, 0.15);
--nav-primary: var(--primary);
--nav-primary-solid: #c8d2f0;
--nav-accent: #f5b342;
--nav-accent: var(--accent);
--nav-accent-soft: rgba(245, 179, 66, 0.85);
--nav-text: #e8ecf5;
--nav-text-muted: rgba(200, 210, 240, 0.55);
--nav-text: var(--text);
--nav-text-muted: var(--text-muted);
--nav-text-on-primary: #111520;
}
@@ -108,3 +124,16 @@
.dark .leaflet-popup-tip {
background: var(--nav-surface);
}
/* ── Rendu Markdown chatbot (useMarkdown composable) ────────────────────── */
.md-content { font-size: inherit; line-height: 1.6; }
.md-content p { margin: 0 0 0.5em; }
.md-content p:last-child { margin-bottom: 0; }
.md-content strong, .md-h1, .md-h2, .md-h3 { font-weight: 700; }
.md-h2 { font-size: 0.9375em; display: block; margin-bottom: 0.25em; }
.md-h3 { font-size: 0.875em; display: block; }
.md-content em { font-style: italic; }
.md-list { margin: 0.375em 0 0.375em 1em; padding: 0; list-style: disc; }
.md-list li { margin-bottom: 0.2em; }
.md-link { text-decoration: underline; opacity: 0.85; }
.md-link:hover { opacity: 1; }
-587
View File
@@ -1,587 +0,0 @@
<template>
<!-- ═══════════════════════════════════════ BANDEAU BAS ═══════════════════ -->
<!-- DESKTOP uniquement (≥1024px) — mobile a le FAB séparé -->
<footer
v-if="!isMobile"
ref="bandeauEl"
class="bandeau-bas shrink-0"
:class="{ 'bandeau-collapsed': isCollapsed }"
aria-label="Informations projet AEP"
@mouseenter="onMouseEnter"
@mouseleave="onMouseLeave"
>
<!-- Contenu plein -->
<div class="bandeau-inner" :class="{ 'bandeau-inner--hidden': isCollapsed }">
<!-- ── GAUCHE : Transparence IA ──────────────────────────────────────── -->
<div class="bandeau-col">
<p class="bandeau-label">Transparence IA</p>
<template v-if="stats">
<p class="bandeau-value">
Coût IA ce mois : <strong>{{ stats.cout_mois_eur.toFixed(2) }} €</strong>
&nbsp;·&nbsp;
Tokens : <strong>{{ stats.tokens_mois.toLocaleString('fr-FR') }}</strong>
</p>
<!-- Jauge -->
<div class="jauge-track" aria-label="Budget IA consommé" role="progressbar" :aria-valuenow="jaugePct" aria-valuemin="0" aria-valuemax="100">
<div class="jauge-fill" :style="{ width: jaugePct + '%' }" />
</div>
<p class="bandeau-sub">
{{ stats.requetes_mois }} requête{{ stats.requetes_mois !== 1 ? 's' : '' }} ce mois
</p>
</template>
<template v-else-if="loading">
<p class="bandeau-sub">Chargement…</p>
</template>
<template v-else>
<p class="bandeau-sub">Données indisponibles</p>
</template>
</div>
<!-- ── MILIEU : CTA Soutien ──────────────────────────────────────────── -->
<div class="bandeau-col bandeau-col--center">
<div class="soutenir-wrap">
<button
class="btn-soutenir"
type="button"
@click="modalOpen = true"
@mouseenter="tooltipVisible = true"
@mouseleave="tooltipVisible = false"
@focus="tooltipVisible = true"
@blur="tooltipVisible = false"
aria-label="Soutenir le projet AEP sur Liberapay"
>
Soutenir le projet
</button>
<!-- Tooltip au hover -->
<div v-if="tooltipVisible" class="soutenir-tooltip" role="tooltip">
1 € = 30 fiches mises en ligne
</div>
</div>
</div>
<!-- ── DROITE : Compteurs semaine ────────────────────────────────────── -->
<div class="bandeau-col bandeau-col--right">
<p class="bandeau-label">Cette semaine</p>
<template v-if="stats">
<p class="bandeau-value">
{{ stats.fiches_semaine }} fiche{{ stats.fiches_semaine !== 1 ? 's' : '' }} ajoutée{{ stats.fiches_semaine !== 1 ? 's' : '' }}
</p>
<p class="bandeau-sub">
{{ stats.requetes_chatbot_semaine }} requête{{ stats.requetes_chatbot_semaine !== 1 ? 's' : '' }} chatbot
</p>
</template>
<template v-else>
<p class="bandeau-sub">—</p>
</template>
</div>
</div>
<!-- Barre fine (état collapsed) -->
<div class="bandeau-thin" :class="{ 'bandeau-thin--visible': isCollapsed }">
<span class="bandeau-thin-label">AEP · Transparence IA</span>
</div>
<!-- ── MODAL Liberapay ───────────────────────────────────────────────── -->
<Teleport to="body">
<Transition name="backdrop">
<div
v-if="modalOpen"
class="modal-backdrop"
@click="modalOpen = false"
aria-hidden="true"
/>
</Transition>
<Transition name="modal">
<div
v-if="modalOpen"
class="modal-box"
role="dialog"
aria-modal="true"
aria-label="Soutenir AEP sur Liberapay"
>
<button
class="modal-close"
type="button"
@click="modalOpen = false"
aria-label="Fermer"
>
<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="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
</svg>
</button>
<h2 class="modal-title">Soutenir AEP</h2>
<p class="modal-desc">
AEP est un outil libre, sans publicité, financé par les dons.
1 € finance environ 30 fiches mises en ligne.
</p>
<div class="modal-widget">
<iframe
src="https://liberapay.com/trans-former.fr/widgets/button.html"
width="95"
height="22"
style="border: 0;"
title="Faire un don sur Liberapay"
/>
</div>
<a
href="https://liberapay.com/trans-former.fr/donate"
target="_blank"
rel="noopener noreferrer"
class="modal-link"
>
Faire un don sur Liberapay →
</a>
</div>
</Transition>
</Teleport>
</footer>
<!-- ═══════════════════════════════════════ FAB MOBILE (< 1024px) ════════ -->
<div v-else>
<!-- FAB soutenir (à gauche du chatbot) -->
<button
class="fab-soutenir"
type="button"
@click="fabSheetOpen = true"
aria-label="Soutenir le projet AEP"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
</svg>
</button>
<!-- Bottom sheet FAB -->
<Teleport to="body">
<Transition name="backdrop">
<div
v-if="fabSheetOpen"
class="fixed inset-0 z-[1020]"
style="background: rgba(26,34,56,0.5);"
@click="fabSheetOpen = false"
aria-hidden="true"
/>
</Transition>
<Transition name="sheet">
<div
v-if="fabSheetOpen"
class="fab-sheet"
role="dialog"
aria-modal="true"
aria-label="Soutenir AEP"
>
<!-- Poignée -->
<div class="flex justify-center pt-3 pb-1">
<div class="rounded-full" style="width: 36px; height: 4px; background: var(--nav-bg-alt);" />
</div>
<div class="px-5 pb-6">
<h2 class="text-base font-bold mb-2" style="color: var(--nav-text);">Soutenir AEP</h2>
<template v-if="stats">
<p class="text-sm mb-1" style="color: var(--nav-text-muted);">
Coût IA ce mois : <strong>{{ stats.cout_mois_eur.toFixed(2) }} €</strong>
· Tokens : {{ stats.tokens_mois.toLocaleString('fr-FR') }}
</p>
<p class="text-sm mb-3" style="color: var(--nav-text-muted);">
{{ stats.fiches_semaine }} fiche{{ stats.fiches_semaine !== 1 ? 's' : '' }} ajoutée{{ stats.fiches_semaine !== 1 ? 's' : '' }} cette semaine
</p>
</template>
<p class="text-sm mb-4" style="color: var(--nav-text-muted); line-height: 1.5;">
1 € = 30 fiches mises en ligne. AEP est libre, sans pub, financé par les dons.
</p>
<a
href="https://liberapay.com/trans-former.fr/donate"
target="_blank"
rel="noopener noreferrer"
class="block w-full text-center py-3 rounded-xl font-semibold text-sm"
style="background: var(--nav-primary); color: var(--nav-text-on-primary); text-decoration: none;"
@click="fabSheetOpen = false"
>
Soutenir sur Liberapay →
</a>
</div>
</div>
</Transition>
</Teleport>
</div>
</template>
<script setup lang="ts">
interface Stats {
cout_mois_eur: number
budget_mois: number
tokens_mois: number
co2_kg: number
requetes_mois: number
fiches_semaine: number
requetes_chatbot_semaine: number
}
const stats = ref<Stats | null>(null)
const loading = ref(true)
const modalOpen = ref(false)
const fabSheetOpen = ref(false)
const tooltipVisible = ref(false)
// Desktop — replié par défaut, déploie au hover, replie immédiatement à la sortie
const bandeauEl = ref<HTMLElement | null>(null)
const isCollapsed = ref(true) // replié par défaut
const REFRESH_MS = 5 * 60 * 1000 // 5 minutes
// Détection mobile côté client
const isMobile = ref(false)
onMounted(() => {
isMobile.value = window.innerWidth < 1024
const handleResize = () => {
isMobile.value = window.innerWidth < 1024
}
window.addEventListener('resize', handleResize)
onUnmounted(() => window.removeEventListener('resize', handleResize))
fetchStats()
const interval = setInterval(fetchStats, REFRESH_MS)
onUnmounted(() => clearInterval(interval))
})
function onMouseEnter() {
isCollapsed.value = false
}
function onMouseLeave() {
// Repli immédiat — pas de timer
isCollapsed.value = true
}
async function fetchStats() {
try {
const res = await $fetch<Stats>('/api/stats')
stats.value = res
} catch {
stats.value = null
} finally {
loading.value = false
}
}
const jaugePct = computed(() => {
if (!stats.value) return 0
return Math.min(100, Math.round((stats.value.cout_mois_eur / stats.value.budget_mois) * 100))
})
</script>
<style scoped>
/* ── Bandeau bas ─────────────────────────────────────────────────────────── */
.bandeau-bas {
background: rgba(26, 34, 56, 0.7); /* opacité 70% */
color: var(--nav-text-on-primary);
font-family: var(--nav-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
border-top: 1px solid rgba(255, 255, 255, 0.08);
transition: min-height 0.25s ease;
position: relative;
overflow: hidden;
}
.bandeau-collapsed {
min-height: 32px !important;
cursor: pointer;
}
.bandeau-inner {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16px;
padding: 10px 20px;
max-width: 1400px;
margin: 0 auto;
min-height: 64px;
transition: opacity 0.2s ease, max-height 0.3s ease;
max-height: 200px;
opacity: 1;
}
.bandeau-inner--hidden {
opacity: 0;
max-height: 0;
overflow: hidden;
padding-top: 0;
padding-bottom: 0;
min-height: 0;
}
/* Barre fine (collapsed) */
.bandeau-thin {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease;
}
.bandeau-thin--visible {
opacity: 1;
}
.bandeau-thin-label {
font-size: 0.65rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.08em;
opacity: 0.7;
}
/* ── Colonnes ────────────────────────────────────────────────────────────── */
.bandeau-col {
flex: 1;
display: flex;
flex-direction: column;
gap: 3px;
min-width: 0;
}
.bandeau-col--center {
align-items: center;
justify-content: center;
flex: 0 0 auto;
padding-top: 8px; /* décaler légèrement vers le bas pour mieux centrer dans la hauteur */
}
.bandeau-col--right {
align-items: flex-end;
}
/* ── Typo ────────────────────────────────────────────────────────────────── */
.bandeau-label {
font-size: 0.65rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.07em;
opacity: 0.65;
margin: 0;
line-height: 1.3;
}
.bandeau-value {
font-size: 0.775rem;
font-weight: 500;
color: var(--nav-text-on-primary);
margin: 0;
line-height: 1.4;
}
.bandeau-value strong {
font-weight: 700;
}
.bandeau-sub {
font-size: 0.68rem;
opacity: 0.7;
margin: 0;
line-height: 1.4;
}
/* ── Jauge budget ────────────────────────────────────────────────────────── */
.jauge-track {
width: 100%;
max-width: 180px;
height: 4px;
border-radius: 2px;
background: rgba(255, 255, 255, 0.18);
overflow: hidden;
margin: 3px 0;
}
.jauge-fill {
height: 100%;
border-radius: 2px;
background: var(--nav-accent);
transition: width 0.6s ease;
}
/* ── Bouton soutenir + tooltip ───────────────────────────────────────────── */
.soutenir-wrap {
position: relative;
display: inline-flex;
flex-direction: column;
align-items: center;
}
.btn-soutenir {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 7px 16px;
border-radius: 8px;
border: none;
background: var(--nav-accent);
color: var(--nav-text);
font-size: 0.8rem;
font-weight: 700;
font-family: inherit;
cursor: pointer;
white-space: nowrap;
transition: opacity 0.15s, transform 0.1s;
flex-shrink: 0;
}
.btn-soutenir:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-soutenir:active { opacity: 1; transform: translateY(0); }
.soutenir-tooltip {
position: absolute;
bottom: calc(100% + 8px);
left: 50%;
transform: translateX(-50%);
background: var(--nav-primary-solid, #1a2238);
color: var(--nav-text-on-primary);
font-size: 0.72rem;
font-weight: 600;
padding: 5px 10px;
border-radius: 6px;
white-space: nowrap;
pointer-events: none;
z-index: 10;
}
.soutenir-tooltip::after {
content: '';
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border: 5px solid transparent;
border-top-color: var(--nav-primary-solid, #1a2238);
}
/* ── FAB mobile soutenir ─────────────────────────────────────────────────── */
.fab-soutenir {
position: fixed;
bottom: 68px; /* au-dessus du FAB chatbot à 24px du bas + 48px de hauteur */
left: 16px;
z-index: 1000;
width: 44px;
height: 44px;
border-radius: 50%;
border: none;
background: var(--nav-accent);
color: var(--nav-text);
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 16px rgba(26,34,56,0.25);
cursor: pointer;
transition: opacity 0.15s, transform 0.1s;
}
.fab-soutenir:hover { opacity: 0.88; transform: translateY(-1px); }
/* ── Bottom sheet FAB ────────────────────────────────────────────────────── */
.fab-sheet {
position: fixed;
inset-x: 0;
bottom: 0;
z-index: 1021;
background: var(--nav-surface);
border-radius: 16px 16px 0 0;
box-shadow: 0 -4px 32px rgba(26,34,56,0.18);
}
/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
position: fixed;
inset: 0;
z-index: 2000;
background: rgba(26, 34, 56, 0.55);
}
.modal-box {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2001;
background: var(--nav-surface, #ffffff);
border-radius: 16px;
padding: 28px 24px 24px;
width: min(380px, 90vw);
box-shadow: 0 8px 40px rgba(26, 34, 56, 0.22);
display: flex;
flex-direction: column;
gap: 12px;
}
.modal-close {
position: absolute;
top: 14px;
right: 14px;
width: 30px;
height: 30px;
border-radius: 8px;
border: none;
background: var(--nav-bg-alt, #eee9df);
color: var(--nav-text-muted, rgba(26,34,56,0.55));
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s;
}
.modal-close:hover { background: var(--nav-bg, #f8f6f1); }
.modal-title {
font-size: 1.05rem;
font-weight: 700;
color: var(--nav-text, #1a2238);
margin: 0;
}
.modal-desc {
font-size: 0.85rem;
color: var(--nav-text-muted, rgba(26,34,56,0.55));
line-height: 1.6;
margin: 0;
}
.modal-widget {
display: flex;
justify-content: center;
padding: 12px 0;
}
.modal-link {
display: block;
text-align: center;
font-size: 0.8rem;
color: var(--nav-primary-solid, #1a2238);
text-decoration: underline;
transition: opacity 0.15s;
}
.modal-link:hover { opacity: 0.7; }
/* ── Transitions ─────────────────────────────────────────────────────────── */
.backdrop-enter-active, .backdrop-leave-active { transition: opacity 0.2s ease; }
.backdrop-enter-from, .backdrop-leave-to { opacity: 0; }
.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%, -48%); }
.sheet-enter-active, .sheet-leave-active { transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.sheet-enter-from, .sheet-leave-to { transform: translateY(100%); }
@media (prefers-reduced-motion: reduce) {
.btn-soutenir { transition: none; }
.jauge-fill { transition: none; }
.modal-enter-active, .modal-leave-active { transition: none; }
.backdrop-enter-active, .backdrop-leave-active { transition: none; }
.sheet-enter-active, .sheet-leave-active { transition: none; }
.bandeau-bas { transition: none; }
.bandeau-inner { transition: none; }
}
</style>
+372
View File
@@ -0,0 +1,372 @@
<template>
<div style="width: 100%; height: 100%; position: relative; background: #f5f3f0;">
<svg ref="svgRef" style="width: 100%; height: 100%;"></svg>
<div ref="tooltipRef" style="
position: absolute; pointer-events: none;
background: var(--nav-surface); border: 1px solid var(--nav-bg-alt);
border-radius: 6px; padding: 8px 12px; font-size: 0.78rem;
color: var(--nav-text); max-width: 240px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
opacity: 0; transition: opacity 0.15s; z-index: 100;
"></div>
</div>
</template>
<script setup lang="ts">
interface EcoleData { id: string; label: string; description: string; color: string; x_hint: number; y_hint: number }
interface LivreRag { slug: string; titre: string; annee: number; couches: string[] }
interface AuteurData { id: string; nom: string; dates: string; ecoles: string[]; ecole_principale: string; ingere: boolean; livres_rag: LivreRag[]; theses_cles: string[]; bio_courte: string; bio_courte_provisoire?: string }
interface PenseesData { ecoles: EcoleData[]; auteurs: AuteurData[] }
// Liens d'influence inter-ecoles (Phase 7 - matrice de filiation)
const LINKS_INFLUENCE = [
// filiations directes
{ source: 'eco-anarchisme', target: 'technocritique', auteurs_passerelle: ['Bookchin', 'Illich'], type: 'filiation' },
{ source: 'eco-anarchisme', target: 'decroissance', auteurs_passerelle: ['Latouche', 'Kropotkine'], type: 'filiation' },
{ source: 'ecosocialisme', target: 'decroissance', auteurs_passerelle: ['Saito', 'Gorz'], type: 'filiation' },
{ source: 'ecosocialisme', target: 'ecologies-decoloniales', auteurs_passerelle: ['Klein', 'Ferdinand'], type: 'filiation' },
{ source: 'ecofeminismes', target: 'ecologies-decoloniales', auteurs_passerelle: ['Shiva', 'Ouassak'], type: 'filiation' },
{ source: 'ecofeminismes', target: 'pensees-vivant', auteurs_passerelle: ['Haraway', 'Despret'], type: 'filiation' },
{ source: 'technocritique', target: 'decroissance', auteurs_passerelle: ['Ellul', 'Latouche'], type: 'filiation' },
{ source: 'decroissance', target: 'pensees-vivant', auteurs_passerelle: ['Servigne', 'Despret'], type: 'filiation' },
{ source: 'pensees-vivant', target: 'ethiques-environnementales', auteurs_passerelle: ['Naess', 'Latour'], type: 'filiation' },
{ source: 'ecosocialisme', target: 'eco-anarchisme', auteurs_passerelle: ['Gorz', 'Graeber'], type: 'filiation' },
// liens de critique
{ source: 'ecosocialisme', target: 'capitalisme-vert', auteurs_passerelle: ['Klein', 'Malm'], type: 'critique' },
{ source: 'decroissance', target: 'capitalisme-vert', auteurs_passerelle: ['Latouche', 'Meadows'], type: 'critique' },
{ source: 'eco-anarchisme', target: 'capitalisme-vert', auteurs_passerelle: ['Bookchin'], type: 'critique' },
{ source: 'ethiques-environnementales', target: 'ecofascismes', auteurs_passerelle: ['Naess'], type: 'critique' },
{ source: 'capitalisme-vert', target: 'ecofascismes', auteurs_passerelle: [], type: 'critique' },
]
const props = defineProps<{ data: PenseesData | null; active?: boolean }>()
const emit = defineEmits<{ 'select-auteur': [id: string]; 'select-ecole': [id: string] }>()
const svgRef = ref<SVGElement | null>(null)
const tooltipRef = ref<HTMLElement | null>(null)
let simulation: any = null
let d3LinkSel: any = null
let d3InfluenceSel: any = null
let d3NodeSel: any = null
let d3EdgeLabelSel: any = null
async function initGraph() {
if (!svgRef.value || !props.data) return
const d3 = await import('d3')
const svgEl = svgRef.value
const W = svgEl.clientWidth || 900
const H = svgEl.clientHeight || 600
d3.select(svgEl).selectAll('*').remove()
const svg = d3.select(svgEl).attr('viewBox', `0 0 ${W} ${H}`)
const g = svg.append('g')
svg.call(d3.zoom<SVGElement, unknown>().scaleExtent([0.3, 4]).on('zoom', (e) => g.attr('transform', e.transform)) as any)
const ecoleMap = new Map<string, EcoleData>(props.data.ecoles.map(e => [e.id, e]))
// Positions fixes des ecoles (base pour forces D3)
const ecolePositions = new Map<string, { tx: number; ty: number }>()
props.data.ecoles.forEach(e => {
ecolePositions.set(e.id, { tx: W * e.x_hint, ty: H * e.y_hint })
})
// ---- LIENS D'INFLUENCE INTER-ECOLES (couche 3) ----
const gInfluence = g.append('g').attr('class', 'links-influence')
LINKS_INFLUENCE.forEach(link => {
const src = ecolePositions.get(link.source)
const tgt = ecolePositions.get(link.target)
if (!src || !tgt) return
const isCritique = link.type === 'critique'
const lineEl = gInfluence.append('line')
.attr('class', 'influence-link')
.attr('x1', src.tx).attr('y1', src.ty)
.attr('x2', tgt.tx).attr('y2', tgt.ty)
.attr('stroke', isCritique ? '#d99' : '#9aa')
.attr('stroke-width', 1)
.attr('stroke-dasharray', isCritique ? '4,3' : '6,4')
.attr('stroke-opacity', isCritique ? 0.2 : 0.22)
if (link.auteurs_passerelle && link.auteurs_passerelle.length > 0) {
lineEl
.on('mouseenter', (e: any) => {
if (!tooltipRef.value) return
tooltipRef.value.innerHTML = `<strong>Influence</strong><br><span style="opacity:0.8;font-size:0.72rem;">Passerelles : ${link.auteurs_passerelle.join(', ')}</span>`
tooltipRef.value.style.opacity = '1'
})
.on('mousemove', (e: any) => {
if (!tooltipRef.value || !svgEl) return
const rect = (svgEl as HTMLElement).getBoundingClientRect()
tooltipRef.value.style.left = (e.clientX - rect.left + 14) + 'px'
tooltipRef.value.style.top = (e.clientY - rect.top - 10) + 'px'
})
.on('mouseleave', () => { if (tooltipRef.value) tooltipRef.value.style.opacity = '0' })
}
})
// ---- SIMULATION D3 (auteurs) ----
const auteurNodes: any[] = props.data.auteurs.map(a => {
const ecole = ecoleMap.get(a.ecole_principale)
const jitter = () => (Math.random() - 0.5) * 80
return {
id: a.id, type: 'auteur', nom: a.nom, dates: a.dates,
bio_courte: a.bio_courte,
bio_provisoire: a.bio_courte_provisoire ?? '',
ingere: a.ingere,
ecole_principale: a.ecole_principale,
color: ecole?.color ?? '#888', r: 11,
x: W * (ecole?.x_hint ?? 0.5) + jitter(),
y: H * (ecole?.y_hint ?? 0.5) + jitter(),
}
})
// Liens appartenance auteur -> ecole (vers centroid fixe)
const links: any[] = []
props.data.auteurs.forEach(a => {
links.push({ source: a.id, target: a.ecole_principale, strength: 0.65, isSubcourant: false })
a.ecoles.filter(e => e !== a.ecole_principale).forEach(e => {
links.push({ source: a.id, target: e, strength: 0.25, isSubcourant: true })
})
})
// Nodes fictifs fixes pour les ecoles (cibles des liens appartenance)
const ecoleFixedNodes: any[] = props.data.ecoles.map(e => ({
id: e.id, type: 'ecole-fixed', ecoleId: e.id,
x: W * e.x_hint, y: H * e.y_hint,
fx: W * e.x_hint, fy: H * e.y_hint,
}))
// Rayon proportionnel au nombre d'auteurs de l'ecole
const ecoleAuteurCounts = new Map<string, number>()
props.data.ecoles.forEach(e => ecoleAuteurCounts.set(e.id, 0))
props.data.auteurs.forEach(a => ecoleAuteurCounts.set(a.ecole_principale, (ecoleAuteurCounts.get(a.ecole_principale) ?? 0) + 1))
const ecoleRadius = (count: number) => Math.max(16, Math.min(36, 13 + count * 1.5))
const allNodes = [...ecoleFixedNodes, ...auteurNodes]
if (simulation) simulation.stop()
simulation = d3.forceSimulation(allNodes)
.force('link', d3.forceLink(links).id((d: any) => d.id).distance(120).strength((d: any) => d.strength ?? 0.5))
.force('charge', d3.forceManyBody().strength(-70))
.force('center', d3.forceCenter(W / 2, H / 2).strength(0.02))
.force('collision', d3.forceCollide().radius((d: any) => d.type === 'ecole-fixed' ? ecoleRadius(ecoleAuteurCounts.get(d.ecoleId) ?? 0) + 4 : 12))
.force('forceX', d3.forceX<any>((d: any) => {
if (d.type === 'auteur') {
const pos = ecolePositions.get(d.ecole_principale)
return pos ? pos.tx : W / 2
}
return W / 2
}).strength(0.15))
.force('forceY', d3.forceY<any>((d: any) => {
if (d.type === 'auteur') {
const pos = ecolePositions.get(d.ecole_principale)
return pos ? pos.ty : H / 2
}
return H / 2
}).strength(0.15))
// ---- NOEUDS ECOLES visibles (couche 3.5) ----
const gEcoles = g.append('g').attr('class', 'ecoles-nodes')
ecoleFixedNodes.forEach(eNode => {
const ecole = ecoleMap.get(eNode.ecoleId)
if (!ecole) return
const count = ecoleAuteurCounts.get(eNode.ecoleId) ?? 0
const r = ecoleRadius(count)
gEcoles.append('circle')
.attr('cx', eNode.fx).attr('cy', eNode.fy).attr('r', r)
.attr('fill', ecole.color).attr('fill-opacity', 0.82).attr('stroke', ecole.color).attr('stroke-width', 2)
.attr('class', 'ecole-node').style('cursor', 'pointer')
.on('mouseenter', (e: any) => {
if (!tooltipRef.value) return
tooltipRef.value.innerHTML = `<strong>${ecole.label}</strong> <span style="opacity:0.6;font-size:0.7rem;">${count} auteur${count > 1 ? 's' : ''}</span><br><span style="opacity:0.75;font-size:0.72rem;">${ecole.description}</span>`
tooltipRef.value.style.opacity = '1'
})
.on('mousemove', (e: any) => {
if (!tooltipRef.value || !svgEl) return
const rect = (svgEl as HTMLElement).getBoundingClientRect()
tooltipRef.value.style.left = (e.clientX - rect.left + 14) + 'px'
tooltipRef.value.style.top = (e.clientY - rect.top - 10) + 'px'
})
.on('mouseleave', () => { if (tooltipRef.value) tooltipRef.value.style.opacity = '0' })
.on('click', (e: any) => { e.stopPropagation(); emit('select-ecole', eNode.ecoleId) })
// ---- TITRES ECOLES visibles en permanence ----
const labelText = ecole.label
const words = labelText.split(' ')
const fontSize = Math.max(12, r * 0.45)
if (words.length > 2 || labelText.length > 12) {
const mid = Math.ceil(words.length / 2)
const line1 = words.slice(0, mid).join(' ')
const line2 = words.slice(mid).join(' ')
const textEl = gEcoles.append('text')
.attr('x', eNode.fx)
.attr('y', eNode.fy)
.attr('text-anchor', 'middle')
.attr('dominant-baseline', 'middle')
.style('pointer-events', 'none')
.style('font-weight', '700')
.style('font-size', `${fontSize}px`)
.style('fill', '#ffffff')
.style('text-shadow', '0 1px 3px rgba(0,0,0,0.5)')
.style('user-select', 'none')
textEl.append('tspan')
.attr('x', eNode.fx)
.attr('dy', `-${fontSize * 0.6}px`)
.text(line1)
textEl.append('tspan')
.attr('x', eNode.fx)
.attr('dy', `${fontSize * 1.2}px`)
.text(line2)
} else {
gEcoles.append('text')
.attr('x', eNode.fx)
.attr('y', eNode.fy)
.attr('text-anchor', 'middle')
.attr('dominant-baseline', 'middle')
.style('pointer-events', 'none')
.style('font-weight', '700')
.style('font-size', `${fontSize}px`)
.style('fill', '#ffffff')
.style('user-select', 'none')
.text(labelText)
}
})
// ---- LIENS APPARTENANCE (couche 4) ----
const gLinks = g.append('g').attr('class', 'links-appartenance')
d3LinkSel = gLinks.selectAll('line').data(links).join('line')
.attr('stroke', 'rgba(150,150,150,0.28)').attr('stroke-width', 1.2)
// ---- EDGE LABELS - sous-courants (couche 4b) ----
const subcourantLinks = links.filter((l: any) => l.isSubcourant)
d3EdgeLabelSel = gLinks.selectAll('text.pensees-edge-label')
.data(subcourantLinks)
.join('text')
.attr('class', 'pensees-edge-label')
// ---- NODES AUTEURS (couche 5) ----
const gAuteurs = g.append('g').attr('class', 'auteurs')
d3NodeSel = gAuteurs.selectAll('g').data(auteurNodes).join('g')
.style('cursor', (d: any) => d.ingere ? 'pointer' : 'default')
.call(d3.drag<any, any>()
.on('start', (e: any, d: any) => { if (!e.active) simulation.alphaTarget(0.3).restart(); d.fx = d.x; d.fy = d.y })
.on('drag', (e: any, d: any) => { d.fx = e.x; d.fy = e.y })
.on('end', (e: any, d: any) => { if (!e.active) simulation.alphaTarget(0); d.fx = null; d.fy = null }))
.on('click', (e: any, d: any) => {
if (!d.ingere) return
e.stopPropagation()
emit('select-auteur', d.id)
})
// Phase 8.D : grisage conditionnel auteurs non-ingeres
d3NodeSel.append('circle')
.attr('r', (d: any) => d.r)
.attr('fill', (d: any) => d.ingere ? (d.color + 'cc') : '#bbbbbb')
.attr('stroke', (d: any) => d.ingere ? d.color : '#999999')
.attr('stroke-width', 1.5)
.attr('opacity', (d: any) => d.ingere ? 1 : 0.35)
// ---- LABELS AUTEURS (couche 6 - drop-shadow blanc) ----
d3NodeSel.append('text')
.attr('class', 'pensees-auteur-label')
.text((d: any) => d.nom.split(' ').pop() ?? d.nom)
.attr('text-anchor', 'middle')
.attr('dy', (d: any) => -(d.r + 4))
.style('pointer-events', 'none')
.style('opacity', (d: any) => d.ingere ? 1 : 0.3)
.style('fill', (d: any) => d.ingere ? '#1a1a1a' : '#777777')
d3NodeSel
.on('mouseenter', (e: any, d: any) => {
if (!tooltipRef.value) return
let tooltipHtml = ''
if (d.ingere) {
const rawBio = d.bio_courte || ''
const bio = rawBio.length > 90 ? rawBio.slice(0, 87) + '...' : rawBio
tooltipHtml = `<strong>${d.nom}</strong> <span style="opacity:0.6;font-size:0.7rem;">${d.dates}</span><br><span style="opacity:0.75;font-size:0.72rem;">${bio || 'Dans le RAG ATIS.'}</span>`
} else {
tooltipHtml = `<strong>${d.nom}</strong> <span style="opacity:0.6;font-size:0.7rem;">${d.dates}</span><br><span style="opacity:0.65;font-size:0.72rem;font-style:italic;">Présent dans Bonpote, pas encore ingéré dans le RAG ATIS.</span>`
}
tooltipRef.value.innerHTML = tooltipHtml
tooltipRef.value.style.opacity = '1'
})
.on('mousemove', (e: any) => {
if (!tooltipRef.value || !svgEl) return
const rect = (svgEl as HTMLElement).getBoundingClientRect()
tooltipRef.value.style.left = (e.clientX - rect.left + 14) + 'px'
tooltipRef.value.style.top = (e.clientY - rect.top - 10) + 'px'
})
.on('mouseleave', () => { if (tooltipRef.value) tooltipRef.value.style.opacity = '0' })
simulation.on('tick', () => {
d3LinkSel
.attr('x1', (d: any) => d.source.x).attr('y1', (d: any) => d.source.y)
.attr('x2', (d: any) => d.target.x).attr('y2', (d: any) => d.target.y)
d3EdgeLabelSel
.attr('x', (d: any) => (d.source.x + d.target.x) / 2)
.attr('y', (d: any) => (d.source.y + d.target.y) / 2)
.text((d: any) => {
const targetId = typeof d.target === 'object' ? d.target.id : d.target
return targetId
})
d3NodeSel.attr('transform', (d: any) => `translate(${d.x},${d.y})`)
})
}
watch(() => props.active, (val) => {
if (val && import.meta.client && props.data)
requestAnimationFrame(() => requestAnimationFrame(() => initGraph()))
})
watch(() => props.data, (val) => {
if (val && props.active && import.meta.client)
requestAnimationFrame(() => requestAnimationFrame(() => initGraph()))
})
onMounted(async () => {
if (import.meta.client && props.data && props.active) {
await nextTick()
initGraph()
}
})
onUnmounted(() => { if (simulation) simulation.stop() })
function triggerResize() {
if (simulation) {
simulation.alpha(0.3).restart()
} else if (import.meta.client && props.data && props.active) {
initGraph()
}
}
defineExpose({ triggerResize })
</script>
<style>
.pensees-auteur-label {
fill: #1a1a1a;
font-weight: 600;
font-size: 10px;
filter: drop-shadow(0 0 2.5px rgba(255,255,255,0.95));
user-select: none;
}
.pensees-edge-label {
fill: #555;
font-size: 8.5px;
font-style: italic;
opacity: 0.7;
text-anchor: middle;
dominant-baseline: middle;
user-select: none;
pointer-events: none;
}
.ecole-node {
transition: opacity 0.15s, r 0.15s;
}
.ecole-node:hover {
opacity: 0.75;
}
</style>
+448
View File
@@ -0,0 +1,448 @@
<template>
<div class="chatbot-pensees" :class="{ inline: inline }">
<!-- Header compact -->
<div class="chatbot-header">
<div class="chatbot-header-left">
<div class="chatbot-icon">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
</svg>
</div>
<span class="chatbot-title">
<template v-if="auteurContext">{{ auteurContext }}</template>
<template v-else>Bibliothèque des pensées</template>
</span>
<span v-if="auteurContext" class="chatbot-corpus-badge">auteur</span>
<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>
<option value="projets">Projets</option>
</select>
</div>
</div>
<!-- Zone messages -->
<div ref="messagesContainer" class="chatbot-messages">
<!-- Onboarding -->
<div v-if="messages.length === 0" class="chatbot-onboarding">
<template v-if="auteurContext">
<p>Interroge le corpus de <strong>{{ auteurContext }}</strong> — ses livres, ses thèses, ses arguments.</p>
<p class="chatbot-onboarding-hint">Ex : "Quelle est sa critique du capitalisme vert ?"</p>
</template>
<template v-else>
<p>Bibliothèque des pensées écologiques — <strong>~140 auteurs FRACAS</strong>, de l'écosocialisme à l'éthique environnementale.</p>
<p class="chatbot-onboarding-hint">Ex : "Quelles différences entre décroissance et doughnut économics ?"</p>
</template>
</div>
<!-- Messages -->
<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">
<div class="chatbot-md" v-html="renderMd(msg.content)" />
<div v-if="msg.auteur" class="chatbot-auteur-tag">
<span>{{ msg.auteur.nom }}</span>
</div>
</div>
</template>
<!-- Chargement -->
<div v-if="loading" class="chatbot-bubble assistant loading">
<span class="dot" /><span class="dot" /><span class="dot" />
</div>
<!-- Erreur -->
<div v-if="errorMsg" class="chatbot-error">{{ errorMsg }}</div>
</div>
<!-- Input -->
<div class="chatbot-input-row">
<input
v-model="inputText"
type="text"
:disabled="loading"
:placeholder="auteurContext ? `Interroger ${auteurContext}…` : 'Pose ta question sur les pensées éco…'"
class="chatbot-input"
@keydown.enter.prevent="sendMessage"
/>
<button
:disabled="loading || !inputText.trim()"
class="chatbot-send-btn"
aria-label="Envoyer"
@click="sendMessage"
>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<line x1="22" y1="2" x2="11" y2="13"/>
<polygon points="22 2 15 22 11 13 2 9 22 2"/>
</svg>
</button>
</div>
</div>
</template>
<script setup lang="ts">
import { useMarkdown } from '~/composables/useMarkdown'
const { render: renderMd } = useMarkdown()
interface ChatMessage {
role: 'user' | 'assistant'
content: string
auteur?: { slug: string; nom: string } | null
}
const props = defineProps<{
auteurContext: string | null
inline?: boolean
}>()
const messages = ref<ChatMessage[]>([])
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 = []
errorMsg.value = ''
})
function clearMessages() {
messages.value = []
errorMsg.value = ''
}
function scrollToBottom() {
if (messagesContainer.value) {
messagesContainer.value.scrollTop = messagesContainer.value.scrollHeight
}
}
async function sendMessage() {
const query = inputText.value.trim()
if (!query || loading.value) return
inputText.value = ''
errorMsg.value = ''
messages.value.push({ role: 'user', content: query })
loading.value = true
await nextTick()
scrollToBottom()
try {
const res = await $fetch<{
response: string
auteur: { slug: string; nom: string } | null
}>('/api/chatbot-pensees', {
method: 'POST',
body: {
query,
corpus: corpusMode.value,
auteur_slug: props.auteurContext ? slugify(props.auteurContext) : undefined,
},
})
messages.value.push({
role: 'assistant',
content: res.response,
auteur: res.auteur ?? 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.'
}
} finally {
loading.value = false
await nextTick()
scrollToBottom()
}
}
function slugify(str: string): string {
return str.toLowerCase()
.normalize('NFD').replace(/[̀-ͯ]/g, '')
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-|-$/g, '')
}
</script>
<style scoped>
.chatbot-pensees {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
background: var(--nav-bg);
}
/* Header */
.chatbot-header {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 6px 12px;
background: var(--nav-surface);
border-bottom: 1px solid rgba(180, 170, 160, 0.22);
min-height: 36px;
}
.chatbot-header-left {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
overflow: hidden;
}
.chatbot-icon {
flex-shrink: 0;
width: 22px;
height: 22px;
border-radius: 50%;
background: var(--nav-primary);
display: flex;
align-items: center;
justify-content: center;
color: var(--nav-text-on-primary);
}
.chatbot-title {
font-size: 0.75rem;
font-weight: 600;
color: var(--nav-text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 180px;
}
.chatbot-corpus-badge {
flex-shrink: 0;
font-size: 0.65rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--nav-text-muted);
background: var(--nav-bg-alt);
border-radius: 4px;
padding: 1px 5px;
}
.chatbot-header-right {
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
}
.chatbot-clear-btn {
display: flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
border-radius: 4px;
background: transparent;
color: var(--nav-text-muted);
border: none;
cursor: pointer;
transition: background 0.15s, color 0.15s;
}
.chatbot-clear-btn:hover {
background: var(--nav-bg-alt);
color: var(--nav-text);
}
.chatbot-corpus-select {
font-size: 0.7rem;
padding: 2px 4px;
border-radius: 4px;
border: 1px solid rgba(180, 170, 160, 0.3);
background: var(--nav-bg-alt);
color: var(--nav-text-muted);
cursor: pointer;
max-width: 110px;
}
/* Messages */
.chatbot-messages {
flex: 1;
overflow-y: auto;
padding: 10px 12px;
display: flex;
flex-direction: column;
gap: 8px;
min-height: 0;
}
.chatbot-onboarding {
font-size: 0.8rem;
line-height: 1.55;
color: var(--nav-text-muted);
background: var(--nav-bg-alt);
border-radius: 8px;
padding: 10px 12px;
}
.chatbot-onboarding p { margin: 0 0 6px; }
.chatbot-onboarding p:last-child { margin-bottom: 0; }
.chatbot-onboarding strong { color: var(--nav-text); font-weight: 600; }
.chatbot-onboarding-hint { font-style: italic; font-size: 0.75rem; opacity: 0.75; }
/* Bulles */
.chatbot-bubble {
max-width: 88%;
font-size: 0.825rem;
line-height: 1.55;
border-radius: 10px;
padding: 8px 11px;
}
.chatbot-bubble.user {
align-self: flex-end;
background: var(--nav-primary);
color: var(--nav-text-on-primary);
border-radius: 10px 10px 3px 10px;
}
.chatbot-bubble.assistant {
align-self: flex-start;
background: var(--nav-surface);
border: 1px solid rgba(180, 170, 160, 0.22);
color: var(--nav-text);
border-radius: 10px 10px 10px 3px;
}
/* Markdown dans les bulles */
:deep(.chatbot-md) { font-size: inherit; line-height: 1.55; }
:deep(.chatbot-md p) { margin: 0 0 0.35em; }
:deep(.chatbot-md p:last-child) { margin-bottom: 0; }
:deep(.chatbot-md strong) { font-weight: 700; }
:deep(.chatbot-md em) { font-style: italic; }
:deep(.chatbot-md ul) { margin: 0.25em 0 0.25em 1em; list-style: disc; padding: 0; }
:deep(.chatbot-md li) { margin-bottom: 0.1em; }
.chatbot-auteur-tag {
margin-top: 6px;
font-size: 0.7rem;
color: var(--nav-text-muted);
font-style: italic;
}
/* Loading */
.chatbot-bubble.loading {
display: flex;
gap: 4px;
align-items: center;
padding: 10px 12px;
}
.dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--nav-text-muted);
animation: blink 1.2s infinite ease-in-out;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
0%, 80%, 100% { opacity: 0.25; }
40% { opacity: 1; }
}
/* Erreur */
.chatbot-error {
align-self: flex-start;
font-size: 0.775rem;
color: #a85d3e;
background: rgba(168, 93, 62, 0.08);
border-radius: 8px;
padding: 7px 10px;
max-width: 90%;
}
/* Input */
.chatbot-input-row {
flex-shrink: 0;
display: flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
border-top: 1px solid rgba(180, 170, 160, 0.22);
background: var(--nav-surface);
}
.chatbot-input {
flex: 1;
padding: 6px 10px;
border-radius: 8px;
border: 1px solid rgba(180, 170, 160, 0.3);
background: var(--nav-bg);
color: var(--nav-text);
font-family: var(--nav-font);
font-size: 0.8rem;
min-width: 0;
transition: border-color 0.15s;
}
.chatbot-input:focus {
outline: none;
border-color: var(--nav-primary);
}
.chatbot-input:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.chatbot-send-btn {
flex-shrink: 0;
width: 30px;
height: 30px;
border-radius: 7px;
border: none;
background: var(--nav-primary);
color: var(--nav-text-on-primary);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: opacity 0.15s;
}
.chatbot-send-btn:disabled {
opacity: 0.35;
cursor: not-allowed;
}
.chatbot-send-btn:not(:disabled):hover {
opacity: 0.85;
}
</style>
-1
View File
@@ -54,7 +54,6 @@
<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 style="margin-top: 8px; font-size: 0.72rem; opacity: 0.6;">Propulsé par Mistral FR - serveur européen souverain, zéro rétention.</p>
</div>
<!-- Messages -->
+208
View File
@@ -0,0 +1,208 @@
<template>
<Teleport to="body">
<transition name="backdrop">
<div
v-if="modelValue"
class="fixed inset-0 z-[1010]"
style="background: rgba(26,34,56,0.5);"
@click="emit('update:modelValue', false)"
aria-hidden="true"
/>
</transition>
<transition name="sheet">
<div
v-if="modelValue"
class="fixed inset-x-0 bottom-0 z-[1011] flex flex-col"
style="background: var(--nav-surface); height: 100dvh; max-height: 100dvh; box-shadow: 0 -4px 32px rgba(26,34,56,0.18);"
role="dialog"
aria-modal="true"
aria-label="Assistant Réseaux AEP"
>
<div class="flex justify-center pt-3 pb-1 shrink-0">
<div class="rounded-full" style="width: 36px; height: 4px; background: var(--nav-bg-alt);" />
</div>
<div class="flex items-center justify-between px-4 py-3 shrink-0 border-b" style="border-color: var(--nav-bg-alt);">
<button
@click="emit('update:modelValue', false)"
class="flex items-center gap-2 text-sm font-medium transition-opacity hover:opacity-70"
style="color: var(--nav-text-muted);"
aria-label="Retour"
>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<polyline points="15 18 9 12 15 6"/>
</svg>
Retour
</button>
<div class="flex items-center gap-2">
<div class="w-7 h-7 rounded-full flex items-center justify-center shrink-0" style="background: var(--nav-primary);">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--nav-text-on-primary);">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
</svg>
</div>
<span class="font-bold text-sm" style="color: var(--nav-text);">Réseaux AEP</span>
</div>
</div>
<div ref="messagesContainer" class="flex-1 overflow-y-auto px-4 py-4 flex flex-col gap-3">
<div v-if="messages.length === 0" class="onboarding-bubble">
<p>Je connais les <strong>120 réseaux, collectifs et agences</strong> cartographiés dans AEP — ceux qui portent une vision écologique et politique de l'architecture.</p>
<p>Décris ta situation : tu cherches un collectif, une agence inspirante, un partenaire sur un projet en Occitanie, en transition énergétique ?</p>
</div>
<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">
<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>
<a
v-for="fiche in msg.fiches"
:key="fiche.id"
:href="`/agences#${fiche.id}`"
class="fiche-card"
>
<span class="fiche-nom">{{ fiche.nom }}</span>
<span v-if="fiche.explication" class="fiche-expl">{{ fiche.explication }}</span>
</a>
</div>
</div>
</template>
<div v-if="loading" class="assistant-bubble loading-bubble">
<span class="dot" /><span class="dot" /><span class="dot" />
</div>
<div v-if="errorMsg" class="error-bubble">{{ errorMsg }}</div>
</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));">
<div class="flex items-center gap-2">
<input
v-model="inputText"
type="text"
:disabled="loading"
placeholder="Décris ta situation…"
class="flex-1 px-4 py-3 rounded-xl text-sm border"
style="border-color: var(--nav-bg-alt); background: var(--nav-bg); color: var(--nav-text); font-family: var(--nav-font); font-size: 16px;"
@keydown.enter.prevent="sendMessage"
/>
<button
:disabled="loading || !inputText.trim()"
class="w-11 h-11 rounded-xl flex items-center justify-center shrink-0 transition-opacity"
style="background: var(--nav-primary);"
:style="{ opacity: (loading || !inputText.trim()) ? 0.4 : 1 }"
aria-label="Envoyer"
@click="sendMessage"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="color: var(--nav-text-on-primary);">
<line x1="22" y1="2" x2="11" y2="13"/>
<polygon points="22 2 15 22 11 13 2 9 22 2"/>
</svg>
</button>
</div>
</div>
</div>
</transition>
</Teleport>
</template>
<script setup lang="ts">
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[] }
const props = defineProps<{ modelValue: boolean }>()
const emit = defineEmits<{ 'update:modelValue': [value: boolean] }>()
const messages = ref<ChatMessage[]>([])
const inputText = ref('')
const loading = ref(false)
const errorMsg = ref('')
const messagesContainer = ref<HTMLElement | null>(null)
watch(() => props.modelValue, (open) => {
if (typeof document === 'undefined') return
document.body.style.overflow = open ? 'hidden' : ''
document.documentElement.style.overflow = open ? 'hidden' : ''
})
onUnmounted(() => {
if (typeof document !== 'undefined') {
document.body.style.overflow = ''
document.documentElement.style.overflow = ''
}
})
async function sendMessage() {
const question = inputText.value.trim()
if (!question || loading.value) return
inputText.value = ''
errorMsg.value = ''
messages.value.push({ role: 'user', content: question })
loading.value = true
await nextTick()
if (messagesContainer.value) messagesContainer.value.scrollTop = messagesContainer.value.scrollHeight
try {
const res = await $fetch<{ reponse_texte: string; fiches_recommandees: FicheReco[] }>(
'/api/chatbot-reseaux',
{ method: 'POST', body: { question } }
)
messages.value.push({ role: 'assistant', content: res.reponse_texte, fiches: res.fiches_recommandees || [] })
} catch (e: any) {
const s = e?.statusCode ?? e?.status
errorMsg.value = s === 429
? 'Limite de 20 questions par jour atteinte.'
: 'Une erreur est survenue. Réessaie dans quelques instants.'
} finally {
loading.value = false
await nextTick()
if (messagesContainer.value) messagesContainer.value.scrollTop = messagesContainer.value.scrollHeight
}
}
</script>
<style scoped>
.backdrop-enter-active, .backdrop-leave-active { transition: opacity 0.2s ease; }
.backdrop-enter-from, .backdrop-leave-to { opacity: 0; }
.sheet-enter-active, .sheet-leave-active { transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.sheet-enter-from, .sheet-leave-to { transform: translateY(100%); }
.onboarding-bubble {
background: var(--nav-bg); border: 1px solid var(--nav-bg-alt);
border-radius: 12px; padding: 16px;
font-size: 0.85rem; line-height: 1.65; color: var(--nav-text-muted);
}
.onboarding-bubble p { margin-bottom: 10px; }
.onboarding-bubble strong { font-weight: 700; color: var(--nav-text); }
.user-bubble {
align-self: flex-end; max-width: 80%;
background: var(--nav-primary); color: var(--nav-text-on-primary);
border-radius: 16px 16px 4px 16px; padding: 10px 14px;
font-size: 0.875rem; line-height: 1.5;
}
.assistant-bubble {
align-self: flex-start; max-width: 90%;
background: var(--nav-surface); border: 1px solid var(--nav-bg-alt);
border-radius: 16px 16px 16px 4px; padding: 12px 14px;
font-size: 0.875rem; line-height: 1.6; color: var(--nav-text);
}
.loading-bubble { display: flex; gap: 5px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nav-text-muted); animation: blink 1.2s infinite; }
.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; } }
.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); }
.fiches-list { display: flex; flex-direction: column; gap: 6px; }
.fiches-title { font-size: 0.75rem; font-weight: 600; color: var(--nav-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.fiche-card { display: block; background: var(--nav-bg); border: 1px solid var(--nav-bg-alt); border-radius: 8px; padding: 8px 12px; text-decoration: none; transition: background 0.15s; }
.fiche-card:hover { background: var(--nav-bg-alt); }
.fiche-nom { display: block; font-size: 0.875rem; font-weight: 600; color: var(--nav-text); }
.fiche-expl { display: block; font-size: 0.8rem; color: var(--nav-text-muted); margin-top: 2px; }
</style>
+17 -9
View File
@@ -69,18 +69,13 @@
<div ref="messagesContainer" class="flex-1 overflow-y-auto px-4 py-4 flex flex-col gap-3">
<!-- Message onboarding (avant la première question) -->
<div v-if="messages.length === 0" class="onboarding-bubble">
<p>Ce chatbot fonctionne sur un serveur européen souverain
(Mistral FR, zéro rétention), conçu sobre en énergie.</p>
<p>Pour m'aider à te répondre efficacement,
formule ta requête ainsi :</p>
<p>Pour m'aider à te répondre efficacement, formule ta requête ainsi :</p>
<ul>
<li>• Besoin : [ce que tu cherches]</li>
<li>• Thématique : [juridique / technique / économique / ...]</li>
<li>• Lieu : [région ou ville]</li>
</ul>
<p class="example">Exemple : "Je suis salarié d'agence, litige avec mon
employeur, besoin conseil juridique droit du travail,
Île-de-France."</p>
<p class="example">Exemple : "Je suis salarié d'agence, litige avec mon employeur, besoin conseil juridique droit du travail, Île-de-France."</p>
</div>
<!-- Messages -->
@@ -92,7 +87,7 @@ employeur, besoin conseil juridique droit du travail,
<!-- Message assistant -->
<div v-else class="assistant-bubble">
<p>{{ msg.content }}</p>
<div class="md-content" v-html="renderMd(msg.content)" />
<!-- Fiches recommandées -->
<div v-if="msg.fiches && msg.fiches.length > 0" class="fiches-list">
@@ -164,6 +159,9 @@ employeur, besoin conseil juridique droit du travail,
</template>
<script setup lang="ts">
import { useMarkdown } from '~/composables/useMarkdown'
const { render: renderMd } = useMarkdown()
interface FicheReco {
id: number | string
nom: string
@@ -320,7 +318,17 @@ function scrollToBottom() {
line-height: 1.6;
color: var(--nav-text);
}
.assistant-bubble p { margin: 0; }
.assistant-bubble > p { margin: 0; }
/* Markdown rendu via v-html — :deep() perce le scoped */
:deep(.md-content) { font-size: inherit; line-height: 1.6; }
:deep(.md-content p) { margin: 0 0 0.4em; }
:deep(.md-content p:last-child) { margin-bottom: 0; }
:deep(.md-content strong) { font-weight: 700; }
:deep(.md-content em) { font-style: italic; }
:deep(.md-content ul) { margin: 0.3em 0 0.3em 1.1em; list-style: disc; padding: 0; }
:deep(.md-content li) { margin-bottom: 0.15em; }
:deep(.md-content a) { text-decoration: underline; opacity: 0.8; }
/* Fiches recommandées */
.fiches-list {
+177
View File
@@ -0,0 +1,177 @@
<template>
<component
:is="as"
:type="as === 'button' ? 'button' : undefined"
class="chip"
:class="[`chip--${variant}`, { 'chip--active': active }]"
:aria-pressed="as === 'button' ? active : undefined"
@click="as === 'button' && emit('toggle')"
>
<span class="chip__label">{{ label }}</span>
<span v-if="count !== undefined" class="chip__count">{{ count }}</span>
<button
v-if="removable"
type="button"
class="chip__remove"
:aria-label="`Retirer ${label}`"
@click.stop="emit('remove')"
>
<svg width="10" height="10" 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>
</component>
</template>
<script setup lang="ts">
withDefaults(
defineProps<{
label: string
variant?: 'echelle' | 'fonction' | 'posture'
active?: boolean
count?: number
as?: 'button' | 'span'
removable?: boolean
}>(),
{
variant: 'fonction',
active: false,
count: undefined,
as: 'button',
removable: false,
}
)
const emit = defineEmits<{
toggle: []
remove: []
}>()
</script>
<style scoped>
.chip {
display: inline-flex;
align-items: center;
gap: var(--space-2xs);
padding: var(--space-2xs) var(--space-sm);
border-radius: var(--radius-full);
font-size: var(--fs-xs);
line-height: var(--lh-tight);
font-weight: var(--fw-medium);
border: 1.5px solid transparent;
cursor: pointer;
user-select: none;
min-height: 32px;
box-sizing: border-box;
background: none;
transition: background-color var(--dur-fast) var(--ease-out),
color var(--dur-fast) var(--ease-out),
border-color var(--dur-fast) var(--ease-out),
transform var(--dur-fast) var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
.chip {
transition: none;
}
}
/* Survol : uniquement sur pointeur capable de survol. Sur tactile, :hover
reste collé après un tap (chip « allumé » sans être actif). */
@media (hover: hover) {
.chip:hover {
transform: translateY(-1px);
}
}
.chip:focus-visible {
outline: 2px solid var(--focus-ring);
outline-offset: 2px;
}
/* ── Échelle : outline bleu, fond transparent, actif = plein ────────────── */
.chip--echelle {
border-color: var(--primary);
color: var(--text);
background: transparent;
}
@media (hover: hover) {
.chip--echelle:hover {
background: var(--primary-hover);
border-color: var(--primary-hover);
color: var(--on-primary);
}
}
/* Actif = fond PLEIN. --primary est translucide dans le thème AEP
(rgba(26,34,56,.6) : 4,16:1 sur le fond de page, sous AA) ; le couple
--nav-primary-solid / --nav-text-on-primary (≈14,6:1) reste lisible aussi
en sombre. Le survol d'un chip actif ne change pas de fond. */
.chip--echelle.chip--active {
background: var(--nav-primary-solid);
border-color: var(--nav-primary-solid);
color: var(--nav-text-on-primary);
}
/* ── Fonction/hashtag : pleine bleu, inactif = bg-alt ────────────────────── */
.chip--fonction {
border-color: transparent;
background: var(--bg-alt);
color: var(--text);
}
@media (hover: hover) {
.chip--fonction:hover {
background: var(--primary-hover);
color: var(--on-primary);
}
}
.chip--fonction.chip--active {
background: var(--nav-primary-solid);
color: var(--nav-text-on-primary);
}
/* ── Posture (préparée pour plus tard) : outline safran ──────────────────── */
.chip--posture {
border-color: var(--accent);
color: var(--text);
background: transparent;
}
@media (hover: hover) {
.chip--posture:hover {
background: var(--accent);
color: var(--on-accent);
}
}
.chip--posture.chip--active {
background: var(--accent);
border-color: var(--accent);
color: var(--on-accent);
}
.chip__count {
font-size: 0.85em;
opacity: 0.75;
}
.chip__remove {
display: inline-flex;
align-items: center;
justify-content: center;
width: 14px;
height: 14px;
padding: 0;
border: none;
background: transparent;
color: inherit;
opacity: 0.7;
cursor: pointer;
border-radius: var(--radius-full);
}
.chip__remove:hover {
opacity: 1;
}
.chip__remove:focus-visible {
outline: 2px solid var(--focus-ring);
outline-offset: 1px;
}
</style>
+19
View File
@@ -0,0 +1,19 @@
<template>
<div class="chip-group" role="group" :aria-label="ariaLabel">
<slot />
</div>
</template>
<script setup lang="ts">
defineProps<{
ariaLabel: string
}>()
</script>
<style scoped>
.chip-group {
display: flex;
flex-wrap: wrap;
gap: var(--space-2xs) var(--space-xs);
}
</style>
-63
View File
@@ -1,63 +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>
<!-- Inline sur 1 ligne — même pattern que FonctionFilter -->
<div class="flex flex-wrap gap-x-4 gap-y-1.5">
<label
v-for="option in ECHELLES"
:key="option"
class="flex items-center gap-1.5 cursor-pointer select-none transition-opacity"
>
<!-- Case carrée -->
<span
class="flex items-center justify-center shrink-0 transition-all"
style="width: 18px; height: 18px; border: 1.5px solid; border-radius: 3px;"
:style="isSelected(option)
? 'background: var(--nav-primary); border-color: var(--nav-primary); color: #ffffff;'
: 'background: var(--nav-bg-alt); border-color: rgba(26,34,56,0.25); color: transparent;'"
>
<svg v-if="isSelected(option)" width="11" height="11" viewBox="0 0 12 12" fill="none">
<polyline points="2,6 5,9 10,3" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</span>
<!-- Label -->
<span
class="text-sm leading-tight"
:style="isSelected(option) ? 'color: var(--nav-text); font-weight: 600;' : 'color: var(--nav-text);'"
>{{ option }}</span>
<!-- Input réel (masqué) -->
<input
type="checkbox"
class="sr-only"
:checked="isSelected(option)"
@change="toggle(option)"
/>
</label>
</div>
</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>
+121
View File
@@ -0,0 +1,121 @@
<template>
<section class="echelle-tete" :class="{ 'echelle-tete--compact': compact }" :aria-label="`Échelle ${e.id} : ${e.titre}`">
<p 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>
<ul class="echelle-tete__mots">
<li v-for="m in e.mots" :key="m">{{ m }}</li>
</ul>
<p class="echelle-tete__phrase">{{ e.phrase }}</p>
<slot />
<p v-if="contribuer" class="echelle-tete__contribuer">
<span>{{ ECHELLES_CADRE_COURT }}</span>
<NuxtLink :to="`/proposer?categorie=${e.categorieProposer}`" @click="$emit('navigate')">Proposer une ressource →</NuxtLink>
</p>
</section>
</template>
<script setup lang="ts">
import { ECHELLES, type EchelleId } from '~/utils/echelles'
const props = withDefaults(defineProps<{
echelle: EchelleId
/** Variante resserrée, pour une popup ou un en-tête centré. */
compact?: boolean
/** Affiche la ligne « on pose l'infrastructure, le collectif nourrit ». */
contribuer?: boolean
}>(), { compact: false, contribuer: true })
defineEmits<{ navigate: [] }>()
const e = computed(() => ECHELLES[props.echelle])
const ECHELLES_CADRE_COURT = 'Chaque section est ouverte aux contributions.'
</script>
<style scoped>
.echelle-tete {
display: flex;
flex-direction: column;
gap: var(--space-sm);
margin: 0 0 var(--space-md);
}
.echelle-tete__kicker {
display: flex;
align-items: baseline;
gap: var(--space-sm);
margin: 0;
}
.echelle-tete__badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 2rem;
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;
}
.echelle-tete__titre {
font-size: var(--fs-lg);
font-weight: var(--fw-bold);
color: var(--text);
line-height: var(--lh-tight);
}
.echelle-tete__sous-titre {
font-weight: var(--fw-regular);
color: var(--text-muted);
}
.echelle-tete__mots {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
gap: 0.15rem 0;
font-size: var(--fs-sm);
color: var(--text);
line-height: var(--lh-base);
}
.echelle-tete__mots li:not(:last-child)::after {
content: '·';
margin: 0 0.5rem;
color: var(--accent);
font-weight: var(--fw-bold);
}
.echelle-tete__phrase {
margin: 0;
font-size: var(--fs-sm);
font-style: italic;
color: var(--text-muted);
line-height: var(--lh-base);
}
.echelle-tete__contribuer {
margin: 0;
display: flex;
flex-wrap: wrap;
gap: 0.25rem 0.75rem;
font-size: var(--fs-xs);
color: var(--text-muted);
}
.echelle-tete__contribuer a {
color: var(--link);
text-decoration: underline;
text-underline-offset: 2px;
}
.echelle-tete__contribuer a:hover { color: var(--link-hover); }
.echelle-tete--compact { text-align: left; }
.echelle-tete--compact .echelle-tete__titre { font-size: var(--fs-base); }
</style>
+59 -27
View File
@@ -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>
@@ -183,9 +196,18 @@
</template>
<script setup lang="ts">
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(() =>
@@ -263,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,
@@ -283,7 +314,7 @@ onMounted(async () => {
attributionControl: false,
})
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
L.tileLayer(baseTiles.url(document.documentElement.classList.contains('dark')), {
maxZoom: 18,
}).addTo(map)
@@ -300,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>
@@ -311,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;
+170
View File
@@ -0,0 +1,170 @@
<!--
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>
<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"
:aria-label="`Étiquettes de ${fiche.nom}`"
class="fiche-mini-card__chips"
>
<Chip v-if="fiche.echelle" as="span" variant="echelle" :label="fiche.echelle" />
<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>
</article>
</template>
<script setup lang="ts">
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;
box-sizing: border-box;
transition: background-color 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) {
.fiche-mini-card {
transition: none;
}
}
.fiche-mini-card:hover {
background: var(--surface-2);
box-shadow: var(--shadow-sm);
}
/* 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);
font-weight: var(--fw-semibold);
line-height: var(--lh-tight);
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.fiche-mini-card__resume {
width: 100%;
margin-top: var(--space-2xs);
font-size: var(--fs-xs);
line-height: var(--lh-base);
/* --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;
overflow: hidden;
}
.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: color-mix(in srgb, var(--text) 78%, transparent);
}
</style>
-164
View File
@@ -1,164 +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="fixed z-[1501] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col"
style="
width: min(768px, 92vw);
max-height: 90vh;
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>
/* 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 (prefers-reduced-motion: reduce) {
.backdrop-enter-active, .backdrop-leave-active { transition: none; }
.modal-enter-active, .modal-leave-active { transition: none; }
}
</style>
-341
View File
@@ -1,341 +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="fixed z-[1501] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col"
style="
width: min(780px, 94vw);
max-height: 90vh;
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 */
.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 (prefers-reduced-motion: reduce) {
.backdrop-enter-active, .backdrop-leave-active { transition: none; }
.modal-enter-active, .modal-leave-active { transition: none; }
}
</style>
+291
View File
@@ -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>
+99
View File
@@ -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>
-67
View File
@@ -1,67 +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>
<div class="space-y-1">
<button
v-for="fn in FONCTIONS"
:key="fn"
@click="toggle(fn)"
:aria-pressed="modelValue.includes(fn)"
class="flex items-center gap-2.5 w-full rounded px-1 py-0.5 transition-all text-left hover:opacity-80"
:style="modelValue.includes(fn) ? 'background: rgba(26,34,56,0.06);' : ''"
>
<!-- Case : affiche le rang de priorité si actif, sinon le nombre d'orgs -->
<span
class="flex items-center justify-center shrink-0 text-xs font-bold transition-all"
style="width: 24px; height: 24px; border: 1.5px solid; border-radius: 4px;"
:style="modelValue.includes(fn)
? 'background: var(--nav-primary); border-color: var(--nav-primary); color: var(--nav-text-on-primary);'
: 'background: var(--nav-bg-alt); border-color: var(--nav-bg-alt); color: var(--nav-text-muted);'"
>
{{ modelValue.includes(fn) ? (modelValue.indexOf(fn) + 1) : (counts[fn] ?? 0) }}
</span>
<!-- Label -->
<span
class="text-sm leading-tight"
:style="modelValue.includes(fn) ? 'color: var(--nav-text); font-weight: 600;' : 'color: var(--nav-text);'"
>{{ fn }}</span>
</button>
</div>
<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>
+184
View File
@@ -0,0 +1,184 @@
<template>
<form @submit.prevent="submit" class="proposer-form" novalidate>
<div class="field-group" :class="{ 'field-error': errors.nom }">
<label for="eco-nom">Nom de l'organisation <span class="required">*</span></label>
<input id="eco-nom" v-model="form.nom" type="text" placeholder="Ex : UNSFA, Maison de l'Architecture..." autocomplete="organization" @blur="validateField('nom')" />
<span v-if="errors.nom" class="error-msg" role="alert">{{ errors.nom }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.url }">
<label for="eco-url">Site web <span class="label-hint">(optionnel — recommandé pour l'enrichissement IA)</span></label>
<input id="eco-url" v-model="form.url" type="url" placeholder="https://..." @blur="validateField('url')" />
<span v-if="errors.url" class="error-msg" role="alert">{{ errors.url }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.description_user }">
<label for="eco-desc">Description courte <span class="required">*</span> <span class="label-hint">(50 à 500 caractères)</span></label>
<textarea id="eco-desc" v-model="form.description_user" rows="4" placeholder="Présente l'organisation en quelques mots : ses missions, son public, ce qu'elle apporte..." @blur="validateField('description_user')" />
<div class="field-meta">
<span v-if="errors.description_user" class="error-msg" role="alert">{{ errors.description_user }}</span>
<span v-else class="char-count" :class="{ 'char-warn': form.description_user.length > 450 }">{{ form.description_user.length }}/500</span>
</div>
</div>
<div class="field-group" :class="{ 'field-error': errors.echelle }">
<fieldset>
<legend>Échelle <span class="required">*</span> <span class="label-hint">(une seule)</span></legend>
<div class="radio-group">
<label v-for="opt in ECHELLES" :key="opt" class="radio-label" :class="{ active: form.echelle === opt }">
<input type="radio" :value="opt" v-model="form.echelle" name="eco-echelle" @change="validateField('echelle')" />{{ opt }}
</label>
</div>
</fieldset>
<span v-if="errors.echelle" class="error-msg" role="alert">{{ errors.echelle }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.fonctions }">
<fieldset>
<legend>Fonctions <span class="required">*</span> <span class="label-hint">(1 à 5 — l'ordre de clic = priorité)</span></legend>
<div class="checkbox-grid">
<label v-for="fn in FONCTIONS" :key="fn" class="checkbox-label" :class="{ active: form.fonctions.includes(fn), disabled: !form.fonctions.includes(fn) && form.fonctions.length >= 5 }">
<input type="checkbox" :value="fn" :checked="form.fonctions.includes(fn)" :disabled="!form.fonctions.includes(fn) && form.fonctions.length >= 5" @change="toggleFonction(fn)" />
<span class="fn-order" v-if="form.fonctions.includes(fn)">{{ form.fonctions.indexOf(fn) + 1 }}</span>{{ fn }}
</label>
</div>
</fieldset>
<span v-if="errors.fonctions" class="error-msg" role="alert">{{ errors.fonctions }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.territoire }">
<fieldset>
<legend>Territoire <span class="required">*</span></legend>
<div class="radio-group">
<label v-for="t in TERRITOIRES" :key="t" class="radio-label" :class="{ active: form.territoire === t }">
<input type="radio" :value="t" v-model="form.territoire" name="eco-territoire" @change="validateField('territoire')" />{{ t }}
</label>
</div>
</fieldset>
<span v-if="errors.territoire" class="error-msg" role="alert">{{ errors.territoire }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.localisation_ville }">
<label for="eco-ville">Ville principale <span class="label-hint">(optionnel — pour la géolocalisation sur la carte)</span></label>
<input id="eco-ville" v-model="form.localisation_ville" type="text" placeholder="Ex : Paris, Lyon, Bordeaux..." />
<span v-if="errors.localisation_ville" class="error-msg" role="alert">{{ errors.localisation_ville }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.submitted_by_email }">
<label for="eco-email">Ton email <span class="label-hint">(optionnel — pour le suivi de modération)</span></label>
<input id="eco-email" v-model="form.submitted_by_email" type="email" placeholder="ton@email.fr" autocomplete="email" @blur="validateField('submitted_by_email')" />
<span v-if="errors.submitted_by_email" class="error-msg" role="alert">{{ errors.submitted_by_email }}</span>
</div>
<div v-if="serverError" class="server-error" role="alert"><strong>Erreur :</strong> {{ serverError }}</div>
<div class="form-actions">
<button type="submit" class="btn-primary" :disabled="submitting">{{ submitting ? 'Envoi en cours...' : 'Proposer la fiche →' }}</button>
</div>
<p class="form-note">Ta fiche sera examinée par l'équipe avant publication.</p>
</form>
</template>
<script setup lang="ts">
import { z } from 'zod'
const ECHELLES = ['National', 'Régional', 'Local'] as const
const TERRITOIRES = ['Métropole', 'Guadeloupe', 'Martinique', 'Guyane', 'La Réunion', 'Mayotte'] as const
const FONCTIONS = ['Juridique', 'Technique', 'Économique', 'Administratif', 'Chantier', 'Comptabilité', 'Développement', 'Formation', 'Gestion d\'agence', 'Santé mentale'] as const
const Schema = z.object({
nom: z.string().min(3, 'Minimum 3 caractères').max(150, 'Maximum 150 caractères').trim(),
url: z.string().url('URL invalide (commencer par https://)').optional().or(z.literal('')),
description_user: z.string().min(50, 'Minimum 50 caractères').max(500, 'Maximum 500 caractères').trim(),
echelle: z.enum(ECHELLES, { errorMap: () => ({ message: 'Sélectionne une échelle' }) }),
fonctions: z.array(z.string()).min(1, 'Sélectionne au moins une fonction').max(5, 'Maximum 5 fonctions'),
territoire: z.enum(TERRITOIRES, { errorMap: () => ({ message: 'Sélectionne un territoire' }) }),
localisation_ville: z.string().max(100).optional(),
submitted_by_email: z.string().email('Email invalide').optional().or(z.literal('')),
})
const emit = defineEmits<{ success: [] }>()
const form = reactive({
nom: '', url: '', description_user: '', echelle: '' as string,
fonctions: [] as string[], territoire: '' as string,
localisation_ville: '', submitted_by_email: '',
})
const errors = reactive<Record<string, string>>({})
const submitting = ref(false)
const serverError = ref('')
function validateField(field: string) {
const partial = Schema.partial()
const result = partial.safeParse({ [field]: (form as any)[field] })
if (!result.success) {
const fieldErrors = result.error.flatten().fieldErrors
errors[field] = fieldErrors[field]?.[0] ?? ''
} else {
delete errors[field]
}
}
function validateAll(): boolean {
const result = Schema.safeParse(form)
if (!result.success) {
const flat = result.error.flatten().fieldErrors
Object.assign(errors, Object.fromEntries(Object.entries(flat).map(([k, v]) => [k, v?.[0] ?? ''])))
return false
}
Object.keys(errors).forEach(k => delete errors[k])
return true
}
function toggleFonction(fn: string) {
const idx = form.fonctions.indexOf(fn)
if (idx >= 0) form.fonctions.splice(idx, 1)
else if (form.fonctions.length < 5) form.fonctions.push(fn)
validateField('fonctions')
}
async function submit() {
serverError.value = ''
if (!validateAll()) {
await nextTick()
const firstError = document.querySelector('.field-error')
firstError?.scrollIntoView({ behavior: 'smooth', block: 'center' })
return
}
submitting.value = true
try {
await $fetch('/api/submit', {
method: 'POST',
body: {
submission_type: 'ecosysteme',
nom: form.nom,
url: form.url || undefined,
description_user: form.description_user,
echelle: form.echelle,
fonctions: form.fonctions,
territoire: form.territoire,
localisation_ville: form.localisation_ville || undefined,
submitted_by_email: form.submitted_by_email || undefined,
},
})
emit('success')
} catch (e: any) {
const status = e?.status ?? e?.statusCode
if (status === 429) {
serverError.value = 'Tu as déjà soumis 3 fiches aujourd\'hui. Réessaie demain.'
} else if (status === 422 && e?.data) {
const fieldErrors = e.data
Object.entries(fieldErrors).forEach(([k, v]) => { errors[k] = Array.isArray(v) ? v[0] : String(v) })
serverError.value = 'Certains champs sont invalides — vérifie les erreurs ci-dessus.'
} else {
serverError.value = 'Une erreur s\'est produite. Réessaie dans quelques instants.'
}
} finally {
submitting.value = false
}
}
</script>
<style scoped>
@import './form-styles.css';
</style>
+134
View File
@@ -0,0 +1,134 @@
<template>
<form @submit.prevent="submit" class="proposer-form" novalidate>
<div class="field-group" :class="{ 'field-error': errors.nom }">
<label for="job-nom">Nom de la plateforme / job board <span class="required">*</span></label>
<input id="job-nom" v-model="form.nom" type="text" placeholder="Ex : Houzz, Architoo, BOAMP..." @blur="validateField('nom')" />
<span v-if="errors.nom" class="error-msg" role="alert">{{ errors.nom }}</span>
</div>
<div class="field-group">
<label for="job-type">Type de plateforme <span class="label-hint">(optionnel)</span></label>
<div class="radio-group">
<label v-for="t in TYPES" :key="t" class="radio-label" :class="{ active: form.type_plateforme === t }">
<input type="radio" :value="t" v-model="form.type_plateforme" name="job-type" />{{ LABELS[t] }}
</label>
</div>
</div>
<div class="field-group" :class="{ 'field-error': errors.url }">
<label for="job-url">Site web <span class="required">*</span></label>
<input id="job-url" v-model="form.url" type="url" placeholder="https://..." @blur="validateField('url')" />
<span v-if="errors.url" class="error-msg" role="alert">{{ errors.url }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.description_user }">
<label for="job-desc">Description courte <span class="required">*</span> <span class="label-hint">(50 à 500 caractères)</span></label>
<textarea id="job-desc" v-model="form.description_user" rows="4" placeholder="Décris la plateforme : qui la gère, quel type de missions, quel modèle économique..." @blur="validateField('description_user')" />
<div class="field-meta">
<span v-if="errors.description_user" class="error-msg" role="alert">{{ errors.description_user }}</span>
<span v-else class="char-count" :class="{ 'char-warn': form.description_user.length > 450 }">{{ form.description_user.length }}/500</span>
</div>
</div>
<div class="field-group" :class="{ 'field-error': errors.submitted_by_email }">
<label for="job-email">Ton email <span class="label-hint">(optionnel — pour le suivi)</span></label>
<input id="job-email" v-model="form.submitted_by_email" type="email" placeholder="ton@email.fr" autocomplete="email" @blur="validateField('submitted_by_email')" />
<span v-if="errors.submitted_by_email" class="error-msg" role="alert">{{ errors.submitted_by_email }}</span>
</div>
<div v-if="serverError" class="server-error" role="alert"><strong>Erreur :</strong> {{ serverError }}</div>
<div class="form-actions">
<button type="submit" class="btn-primary" :disabled="submitting">{{ submitting ? 'Envoi en cours...' : 'Proposer →' }}</button>
</div>
<p class="form-note">Ta proposition sera examinée par l'équipe avant publication.</p>
</form>
</template>
<script setup lang="ts">
import { z } from 'zod'
const TYPES = ['mise-en-relation', 'appel-offre-public', 'communaute-pro'] as const
const LABELS: Record<string, string> = { 'mise-en-relation': 'Mise en relation (B2C)', 'appel-offre-public': 'Appels d\'offres publics', 'communaute-pro': 'Communauté pro' }
const Schema = z.object({
nom: z.string().min(3, 'Minimum 3 caractères').max(150, 'Maximum 150 caractères').trim(),
url: z.string().url('URL invalide (commencer par https://)'),
description_user: z.string().min(50, 'Minimum 50 caractères').max(500, 'Maximum 500 caractères').trim(),
type_plateforme: z.string().optional(),
submitted_by_email: z.string().email('Email invalide').optional().or(z.literal('')),
})
const emit = defineEmits<{ success: [] }>()
const form = reactive({
nom: '', url: '', description_user: '', type_plateforme: '', submitted_by_email: '',
})
const errors = reactive<Record<string, string>>({})
const submitting = ref(false)
const serverError = ref('')
function validateField(field: string) {
const partial = Schema.partial()
const result = partial.safeParse({ [field]: (form as any)[field] })
if (!result.success) {
const fieldErrors = result.error.flatten().fieldErrors
errors[field] = fieldErrors[field]?.[0] ?? ''
} else {
delete errors[field]
}
}
function validateAll(): boolean {
const result = Schema.safeParse(form)
if (!result.success) {
const flat = result.error.flatten().fieldErrors
Object.assign(errors, Object.fromEntries(Object.entries(flat).map(([k, v]) => [k, v?.[0] ?? ''])))
return false
}
Object.keys(errors).forEach(k => delete errors[k])
return true
}
async function submit() {
serverError.value = ''
if (!validateAll()) {
await nextTick()
const firstError = document.querySelector('.field-error')
firstError?.scrollIntoView({ behavior: 'smooth', block: 'center' })
return
}
submitting.value = true
try {
await $fetch('/api/submit', {
method: 'POST',
body: {
submission_type: 'job',
nom: form.nom,
url: form.url,
description_user: form.description_user,
type_plateforme: form.type_plateforme || undefined,
submitted_by_email: form.submitted_by_email || undefined,
},
})
emit('success')
} catch (e: any) {
const status = e?.status ?? e?.statusCode
if (status === 429) {
serverError.value = 'Tu as déjà soumis 3 fiches aujourd\'hui. Réessaie demain.'
} else if (status === 422 && e?.data) {
const fieldErrors = e.data
Object.entries(fieldErrors).forEach(([k, v]) => { errors[k] = Array.isArray(v) ? v[0] : String(v) })
serverError.value = 'Certains champs sont invalides — vérifie les erreurs ci-dessus.'
} else {
serverError.value = 'Une erreur s\'est produite. Réessaie dans quelques instants.'
}
} finally {
submitting.value = false
}
}
</script>
<style scoped>
@import './form-styles.css';
</style>
+310
View File
@@ -0,0 +1,310 @@
<template>
<form @submit.prevent="submit" class="proposer-form proposer-form--libre" novalidate>
<div class="field-group" :class="{ 'field-error': errors.texte }">
<label id="libre-liens-label">Tes liens <span class="label-hint">(1 ou plusieurs — sites, PDF, articles...)</span></label>
<div class="liens-list" role="group" aria-labelledby="libre-liens-label">
<div v-for="(lien, i) in liens" :key="i" class="lien-row">
<input
:id="`libre-lien-${i}`"
v-model="liens[i]"
type="url"
inputmode="url"
placeholder="https://..."
autocomplete="off"
@blur="validateAll(false)"
/>
<button
v-if="liens.length > 1"
type="button"
class="lien-remove"
:aria-label="`Retirer ce lien`"
@click="removeLien(i)"
>×</button>
</div>
</div>
<button v-if="liens.length < 10" type="button" class="btn-add-lien" @click="addLien">+ un autre lien</button>
<span v-if="errors.texte" id="libre-texte-error" class="error-msg" role="alert">{{ errors.texte }}</span>
</div>
<div class="field-group">
<label for="libre-texte">Pourquoi c'est utile, pour toi ? <span class="label-hint">(pas de format imposé)</span></label>
<textarea
id="libre-texte"
v-model="texte"
rows="4"
placeholder="Dis-le avec tes mots : ce que ça t'a apporté, pourquoi tu le partages..."
:aria-describedby="errors.texte ? 'libre-texte-error' : undefined"
/>
</div>
<div class="field-group">
<label id="libre-type-label">Type suggéré <span class="label-hint">(optionnel — un ou deux si tu hésites)</span></label>
<ChipGroup aria-label="Type suggéré" aria-describedby="libre-type-hint">
<Chip
v-for="t in TYPES_SUGGERES"
:key="t"
:label="TYPES_SUGGERES_LABELS[t]"
variant="fonction"
:active="typeSuggere === t || typeSecondaire === t"
:class="{ 'chip--secondaire': typeSecondaire === t }"
@toggle="toggleType(t)"
/>
</ChipGroup>
<span id="libre-type-hint" class="label-hint">
Écosystème : {{ TYPES_SUGGERES_HINTS.ecosysteme }} · Réseau : {{ TYPES_SUGGERES_HINTS.reseau }} · Jobs : {{ TYPES_SUGGERES_HINTS.jobs }} · Outils : {{ TYPES_SUGGERES_HINTS.outils }} · Références : {{ TYPES_SUGGERES_HINTS.references }} · Recette : {{ TYPES_SUGGERES_HINTS.recette }}
</span>
<!-- Distinction non visuelle premier choix / second choix pour lecteurs d'écran :
les deux chips actifs partagent le même aria-pressed, sans quoi rien ne dit
lequel est principal. -->
<span class="sr-only" aria-live="polite">
<template v-if="typeSuggere && typeSecondaire">
Principal : {{ TYPES_SUGGERES_LABELS[typeSuggere] }} · second choix : {{ TYPES_SUGGERES_LABELS[typeSecondaire] }}
</template>
</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.submitted_by_email }">
<label for="libre-email">Ton email <span class="label-hint">(optionnel — pour qu'on te tienne au courant)</span></label>
<input
id="libre-email"
v-model="email"
type="email"
placeholder="ton@email.fr"
autocomplete="email"
@blur="validateAll(false)"
/>
<span v-if="errors.submitted_by_email" class="error-msg" role="alert">{{ errors.submitted_by_email }}</span>
</div>
<!-- Honeypot anti-spam : caché visuellement et aux lecteurs d'écran, un bot le remplit. -->
<div class="hp-field" aria-hidden="true">
<label for="libre-site-web">Site web</label>
<input id="libre-site-web" v-model="siteWeb" type="text" tabindex="-1" autocomplete="off" />
</div>
<div v-if="serverError" class="server-error" role="alert" aria-live="assertive">
<strong>Erreur :</strong> {{ serverError }}
</div>
<div class="form-actions">
<button type="submit" class="btn-primary" :disabled="submitting">
{{ submitting ? 'Envoi en cours...' : 'Proposer →' }}
</button>
</div>
<p class="form-note">Ta proposition sera examinée par l'équipe avant publication.</p>
</form>
</template>
<script setup lang="ts">
import { LibreSubmitSchema, TYPES_SUGGERES, TYPES_SUGGERES_LABELS, TYPES_SUGGERES_HINTS, type TypeSuggere } from '~/utils/submitLibre'
const props = defineProps<{ presetType?: TypeSuggere }>()
const emit = defineEmits<{ success: [] }>()
const liens = reactive<string[]>([''])
const texte = ref('')
const email = ref('')
const typeSuggere = ref<TypeSuggere | undefined>(props.presetType)
// Deuxième chip optionnelle (B5-M2b) — pour les indécis entre deux types.
const typeSecondaire = ref<TypeSuggere | undefined>()
const siteWeb = ref('') // honeypot
const errors = reactive<Record<string, string>>({})
const submitting = ref(false)
const serverError = ref('')
function addLien() {
if (liens.length < 10) liens.push('')
}
function removeLien(i: number) {
liens.splice(i, 1)
if (liens.length === 0) liens.push('')
}
/**
* Deux chips maximum. Premier clic = principal, deuxième = secondaire.
* Décocher le principal alors qu'un secondaire existe promeut ce dernier.
* Troisième clic sur un chip inactif quand deux sont déjà actifs : remplace
* le secondaire par le nouveau chip (choix le plus simple — pas de file d'attente).
*/
function toggleType(t: TypeSuggere) {
if (typeSuggere.value === t) {
typeSuggere.value = typeSecondaire.value
typeSecondaire.value = undefined
return
}
if (typeSecondaire.value === t) {
typeSecondaire.value = undefined
return
}
if (typeSuggere.value === undefined) {
typeSuggere.value = t
} else if (typeSecondaire.value === undefined) {
typeSecondaire.value = t
} else {
typeSecondaire.value = t
}
}
function currentPayload() {
return {
liens: liens.map((l) => l.trim()).filter(Boolean),
texte: texte.value,
submitted_by_email: email.value || undefined,
type_suggere: typeSuggere.value,
type_secondaire: typeSecondaire.value,
site_web: siteWeb.value,
}
}
function validateAll(scrollToError = true): boolean {
const result = LibreSubmitSchema.safeParse(currentPayload())
if (!result.success) {
const flat = result.error.flatten().fieldErrors
Object.keys(errors).forEach((k) => delete errors[k])
Object.assign(errors, Object.fromEntries(Object.entries(flat).map(([k, v]) => [k, v?.[0] ?? ''])))
if (scrollToError) {
nextTick(() => {
document.querySelector('.field-error')?.scrollIntoView({ behavior: 'smooth', block: 'center' })
})
}
return false
}
Object.keys(errors).forEach((k) => delete errors[k])
return true
}
async function submit() {
serverError.value = ''
if (!validateAll(true)) return
submitting.value = true
try {
await $fetch('/api/submit', {
method: 'POST',
body: { mode: 'libre', ...currentPayload() },
})
emit('success')
} catch (e: any) {
const status = e?.status ?? e?.statusCode
if (status === 429) {
serverError.value = 'Tu as déjà soumis 3 fiches aujourd\'hui. Réessaie demain.'
} else if (status === 422 && e?.data) {
Object.assign(errors, Object.fromEntries(Object.entries(e.data as Record<string, string[]>).map(([k, v]) => [k, Array.isArray(v) ? v[0] : String(v)])))
serverError.value = 'Vérifie les erreurs ci-dessus.'
} else {
serverError.value = 'Une erreur s\'est produite. Réessaie dans quelques instants.'
}
} finally {
submitting.value = false
}
}
</script>
<style scoped>
@import './form-styles.css';
.liens-list {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-top: 0.375rem;
}
.lien-row {
display: flex;
align-items: center;
gap: 0.5rem;
}
.lien-row input {
flex: 1;
padding: 0.625rem 0.875rem;
border: 1px solid rgba(26, 34, 56, 0.2);
border-radius: 8px;
font-size: 0.9rem;
color: var(--nav-text);
background: var(--nav-surface);
font-family: inherit;
box-sizing: border-box;
}
.lien-row input:focus {
outline: none;
border-color: var(--nav-primary-solid);
box-shadow: 0 0 0 2px rgba(245, 179, 66, 0.4);
}
.lien-remove {
flex-shrink: 0;
width: 32px;
height: 32px;
border: 1px solid rgba(26, 34, 56, 0.2);
background: transparent;
border-radius: 6px;
color: var(--nav-text-muted);
font-size: 1.1rem;
line-height: 1;
cursor: pointer;
}
.lien-remove:hover {
border-color: #c0392b;
color: #c0392b;
}
.btn-add-lien {
align-self: flex-start;
margin-top: 0.5rem;
padding: 0.4rem 0.75rem;
background: transparent;
border: 1px dashed rgba(26, 34, 56, 0.3);
border-radius: 6px;
font-size: 0.8rem;
color: var(--nav-text-muted);
cursor: pointer;
font-family: inherit;
}
.btn-add-lien:hover {
border-color: var(--nav-primary-solid);
color: var(--nav-text);
}
.hp-field {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
}
/* ── B5-M2c : distinction principal / second choix ──
Le principal actif (fond plein, ≈14,6:1) et le survol gardé par
@media (hover: hover) viennent de Chip.vue depuis AF5 : les surcharges
locales de AF4 (principal plein, survol collant neutralisé sur tactile)
ont été retirées. */
/* Chip secondaire (deuxième choix) : contour au lieu de plein, pour ne
jamais se confondre avec le principal — ni à l'œil ni au clic. Texte
--nav-text sur le fond de page : contraste très large (>10:1), stable
dans tous les états. */
.field-group :deep(.chip--secondaire.chip--active) {
background: transparent !important;
border-color: var(--nav-primary-solid) !important;
color: var(--nav-text) !important;
}
/* Survol du secondaire : pointeur capable de survol seulement, comme Chip.vue
(sur tactile, :hover reste collé après un tap). */
@media (hover: hover) {
.field-group :deep(.chip--secondaire.chip--active:hover) {
background: rgba(var(--nav-primary-raw), 0.08) !important;
border-color: var(--nav-primary-solid) !important;
color: var(--nav-text) !important;
}
}
</style>
+134
View File
@@ -0,0 +1,134 @@
<template>
<form @submit.prevent="submit" class="proposer-form" novalidate>
<div class="field-group" :class="{ 'field-error': errors.nom }">
<label for="out-nom">Nom de l'outil <span class="required">*</span></label>
<input id="out-nom" v-model="form.nom" type="text" placeholder="Ex : Simulateur Autonomie, FreeCAD..." @blur="validateField('nom')" />
<span v-if="errors.nom" class="error-msg" role="alert">{{ errors.nom }}</span>
</div>
<div class="field-group">
<label>Catégorie <span class="label-hint">(optionnelle)</span></label>
<div class="radio-group">
<label v-for="c in CATEGORIES" :key="c" class="radio-label" :class="{ active: form.categorie === c }">
<input type="radio" :value="c" v-model="form.categorie" name="out-categorie" />{{ LABELS[c] }}
</label>
</div>
</div>
<div class="field-group" :class="{ 'field-error': errors.url }">
<label for="out-url">Site web / lien <span class="label-hint">(optionnel — si pas de lien direct)</span></label>
<input id="out-url" v-model="form.url" type="url" placeholder="https://..." @blur="validateField('url')" />
<span v-if="errors.url" class="error-msg" role="alert">{{ errors.url }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.description_user }">
<label for="out-desc">Description courte <span class="required">*</span> <span class="label-hint">(50 à 500 caractères)</span></label>
<textarea id="out-desc" v-model="form.description_user" rows="4" placeholder="Décris l'outil : à quoi il sert, pour quel usage, ce qui le rend utile..." @blur="validateField('description_user')" />
<div class="field-meta">
<span v-if="errors.description_user" class="error-msg" role="alert">{{ errors.description_user }}</span>
<span v-else class="char-count" :class="{ 'char-warn': form.description_user.length > 450 }">{{ form.description_user.length }}/500</span>
</div>
</div>
<div class="field-group" :class="{ 'field-error': errors.submitted_by_email }">
<label for="out-email">Ton email <span class="label-hint">(optionnel — pour le suivi)</span></label>
<input id="out-email" v-model="form.submitted_by_email" type="email" placeholder="ton@email.fr" autocomplete="email" @blur="validateField('submitted_by_email')" />
<span v-if="errors.submitted_by_email" class="error-msg" role="alert">{{ errors.submitted_by_email }}</span>
</div>
<div v-if="serverError" class="server-error" role="alert"><strong>Erreur :</strong> {{ serverError }}</div>
<div class="form-actions">
<button type="submit" class="btn-primary" :disabled="submitting">{{ submitting ? 'Envoi en cours...' : 'Proposer →' }}</button>
</div>
<p class="form-note">Ta proposition sera examinée par l'équipe avant publication.</p>
</form>
</template>
<script setup lang="ts">
import { z } from 'zod'
const CATEGORIES = ['simulateur', 'logiciel', 'guide', 'autre'] as const
const LABELS: Record<string, string> = { simulateur: 'Simulateur', logiciel: 'Logiciel / app', guide: 'Guide / ressource', autre: 'Autre' }
const Schema = z.object({
nom: z.string().min(3, 'Minimum 3 caractères').max(150, 'Maximum 150 caractères').trim(),
url: z.string().url('URL invalide').optional().or(z.literal('')),
description_user: z.string().min(50, 'Minimum 50 caractères').max(500, 'Maximum 500 caractères').trim(),
categorie: z.string().optional(),
submitted_by_email: z.string().email('Email invalide').optional().or(z.literal('')),
})
const emit = defineEmits<{ success: [] }>()
const form = reactive({
nom: '', url: '', description_user: '', categorie: '', submitted_by_email: '',
})
const errors = reactive<Record<string, string>>({})
const submitting = ref(false)
const serverError = ref('')
function validateField(field: string) {
const partial = Schema.partial()
const result = partial.safeParse({ [field]: (form as any)[field] })
if (!result.success) {
const fieldErrors = result.error.flatten().fieldErrors
errors[field] = fieldErrors[field]?.[0] ?? ''
} else {
delete errors[field]
}
}
function validateAll(): boolean {
const result = Schema.safeParse(form)
if (!result.success) {
const flat = result.error.flatten().fieldErrors
Object.assign(errors, Object.fromEntries(Object.entries(flat).map(([k, v]) => [k, v?.[0] ?? ''])))
return false
}
Object.keys(errors).forEach(k => delete errors[k])
return true
}
async function submit() {
serverError.value = ''
if (!validateAll()) {
await nextTick()
const firstError = document.querySelector('.field-error')
firstError?.scrollIntoView({ behavior: 'smooth', block: 'center' })
return
}
submitting.value = true
try {
await $fetch('/api/submit', {
method: 'POST',
body: {
submission_type: 'outil',
nom: form.nom,
url: form.url || undefined,
description_user: form.description_user,
categorie: form.categorie || undefined,
submitted_by_email: form.submitted_by_email || undefined,
},
})
emit('success')
} catch (e: any) {
const status = e?.status ?? e?.statusCode
if (status === 429) {
serverError.value = 'Tu as déjà soumis 3 fiches aujourd\'hui. Réessaie demain.'
} else if (status === 422 && e?.data) {
const fieldErrors = e.data
Object.entries(fieldErrors).forEach(([k, v]) => { errors[k] = Array.isArray(v) ? v[0] : String(v) })
serverError.value = 'Certains champs sont invalides — vérifie les erreurs ci-dessus.'
} else {
serverError.value = 'Une erreur s\'est produite. Réessaie dans quelques instants.'
}
} finally {
submitting.value = false
}
}
</script>
<style scoped>
@import './form-styles.css';
</style>
+142
View File
@@ -0,0 +1,142 @@
<template>
<form @submit.prevent="submit" class="proposer-form" novalidate>
<div class="field-group" :class="{ 'field-error': errors.titre }">
<label for="ref-titre">Titre du livre / document <span class="required">*</span></label>
<input id="ref-titre" v-model="form.titre" type="text" placeholder="Ex : Repenser l'architecture..." @blur="validateField('titre')" />
<span v-if="errors.titre" class="error-msg" role="alert">{{ errors.titre }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.auteur }">
<label for="ref-auteur">Auteur·ice(s) <span class="required">*</span></label>
<input id="ref-auteur" v-model="form.auteur" type="text" placeholder="Ex : Philippe Rahm, Doina Petrescu..." @blur="validateField('auteur')" />
<span v-if="errors.auteur" class="error-msg" role="alert">{{ errors.auteur }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.url }">
<label for="ref-url">Lien <span class="label-hint">(optionnel — éditeur, статье, PDF…)</span></label>
<input id="ref-url" v-model="form.url" type="url" placeholder="https://..." @blur="validateField('url')" />
<span v-if="errors.url" class="error-msg" role="alert">{{ errors.url }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.description }">
<label for="ref-desc">Description de l'ouvrage <span class="required">*</span> <span class="label-hint">(50 à 1000 caractères)</span></label>
<textarea id="ref-desc" v-model="form.description" rows="4" placeholder="Présente l'ouvrage : thèse principale, approche, pourquoi c'est important..." @blur="validateField('description')" />
<div class="field-meta">
<span v-if="errors.description" class="error-msg" role="alert">{{ errors.description }}</span>
<span v-else class="char-count" :class="{ 'char-warn': form.description.length > 900 }">{{ form.description.length }}/1000</span>
</div>
</div>
<div class="field-group">
<label for="ref-pertinence">Pertinence pour le RAG <span class="label-hint">(optionnel — en quoi cette référence est utile ?)</span></label>
<textarea id="ref-pertinence" v-model="form.pertinence_rag" rows="2" placeholder="Ex : Excellente source sur l'architecture participative..." maxlength="500" />
</div>
<div class="field-group">
<label for="ref-hashtags">Hashtags <span class="label-hint">(optionnel — séparés par des virgules)</span></label>
<input id="ref-hashtags" v-model="form.hashtags" type="text" placeholder="Ex : écologie, participation, matériaux bio..." />
</div>
<div class="field-group" :class="{ 'field-error': errors.submitted_by_email }">
<label for="ref-email">Ton email <span class="label-hint">(optionnel — pour le suivi)</span></label>
<input id="ref-email" v-model="form.submitted_by_email" type="email" placeholder="ton@email.fr" autocomplete="email" @blur="validateField('submitted_by_email')" />
<span v-if="errors.submitted_by_email" class="error-msg" role="alert">{{ errors.submitted_by_email }}</span>
</div>
<div v-if="serverError" class="server-error" role="alert"><strong>Erreur :</strong> {{ serverError }}</div>
<div class="form-actions">
<button type="submit" class="btn-primary" :disabled="submitting">{{ submitting ? 'Envoi en cours...' : 'Proposer la référence →' }}</button>
</div>
<p class="form-note">Ta référence sera examinée avant d'être intégrée au fonds documentaire RAG.</p>
</form>
</template>
<script setup lang="ts">
import { z } from 'zod'
const Schema = z.object({
titre: z.string().min(3, 'Minimum 3 caractères').max(200, 'Maximum 200 caractères').trim(),
auteur: z.string().min(2, 'Minimum 2 caractères').max(200, 'Maximum 200 caractères').trim(),
url: z.string().url('URL invalide').optional().or(z.literal('')),
description: z.string().min(50, 'Minimum 50 caractères').max(1000, 'Maximum 1000 caractères').trim(),
pertinence_rag: z.string().max(500).optional(),
hashtags: z.string().max(300).optional(),
submitted_by_email: z.string().email('Email invalide').optional().or(z.literal('')),
})
const emit = defineEmits<{ success: [] }>()
const form = reactive({
titre: '', auteur: '', url: '', description: '',
pertinence_rag: '', hashtags: '', submitted_by_email: '',
})
const errors = reactive<Record<string, string>>({})
const submitting = ref(false)
const serverError = ref('')
function validateField(field: string) {
const partial = Schema.partial()
const result = partial.safeParse({ [field]: (form as any)[field] })
if (!result.success) {
const fieldErrors = result.error.flatten().fieldErrors
errors[field] = fieldErrors[field]?.[0] ?? ''
} else {
delete errors[field]
}
}
function validateAll(): boolean {
const result = Schema.safeParse(form)
if (!result.success) {
const flat = result.error.flatten().fieldErrors
Object.assign(errors, Object.fromEntries(Object.entries(flat).map(([k, v]) => [k, v?.[0] ?? ''])))
return false
}
Object.keys(errors).forEach(k => delete errors[k])
return true
}
async function submit() {
serverError.value = ''
if (!validateAll()) {
await nextTick()
const firstError = document.querySelector('.field-error')
firstError?.scrollIntoView({ behavior: 'smooth', block: 'center' })
return
}
submitting.value = true
try {
await $fetch('/api/submit/reference', {
method: 'POST',
body: {
titre: form.titre,
auteur: form.auteur,
url: form.url || undefined,
description: form.description,
pertinence_rag: form.pertinence_rag || undefined,
hashtags: form.hashtags || undefined,
submitted_by_email: form.submitted_by_email || undefined,
},
})
emit('success')
} catch (e: any) {
const status = e?.status ?? e?.statusCode
if (status === 429) {
serverError.value = 'Tu as déjà soumis 3 fiches aujourd\'hui. Réessaie demain.'
} else if (status === 422 && e?.data) {
const fieldErrors = e.data
Object.entries(fieldErrors).forEach(([k, v]) => { errors[k] = Array.isArray(v) ? v[0] : String(v) })
serverError.value = 'Certains champs sont invalides — vérifie les erreurs ci-dessus.'
} else {
serverError.value = 'Une erreur s\'est produite. Réessaie dans quelques instants.'
}
} finally {
submitting.value = false
}
}
</script>
<style scoped>
@import './form-styles.css';
</style>
+158
View File
@@ -0,0 +1,158 @@
<template>
<form @submit.prevent="submit" class="proposer-form" novalidate>
<div class="field-group" :class="{ 'field-error': errors.nom }">
<label for="res-nom">Nom du réseau / collectif / ressource <span class="required">*</span></label>
<input id="res-nom" v-model="form.nom" type="text" placeholder="Ex : Collectif des Arpenteurs, Archi'Résilience..." @blur="validateField('nom')" />
<span v-if="errors.nom" class="error-msg" role="alert">{{ errors.nom }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.type_principal }">
<fieldset>
<legend>Type <span class="label-hint">(optionnel)</span></legend>
<div class="radio-group">
<label v-for="t in TYPES" :key="t" class="radio-label" :class="{ active: form.type_principal === t }">
<input type="radio" :value="t" v-model="form.type_principal" name="res-type" />{{ LABELS[t] }}
</label>
</div>
</fieldset>
</div>
<div class="field-group" :class="{ 'field-error': errors.url }">
<label for="res-url">Site web <span class="label-hint">(optionnel)</span></label>
<input id="res-url" v-model="form.url" type="url" placeholder="https://..." @blur="validateField('url')" />
<span v-if="errors.url" class="error-msg" role="alert">{{ errors.url }}</span>
</div>
<div class="field-group" :class="{ 'field-error': errors.description_user }">
<label for="res-desc">Description courte <span class="required">*</span> <span class="label-hint">(50 à 500 caractères)</span></label>
<textarea id="res-desc" v-model="form.description_user" rows="4" placeholder="Présente ce réseau/collectif : son objet, son échelle, ce qui le distingue..." @blur="validateField('description_user')" />
<div class="field-meta">
<span v-if="errors.description_user" class="error-msg" role="alert">{{ errors.description_user }}</span>
<span v-else class="char-count" :class="{ 'char-warn': form.description_user.length > 450 }">{{ form.description_user.length }}/500</span>
</div>
</div>
<div class="field-group">
<label for="res-ville">Ville principale <span class="label-hint">(optionnel)</span></label>
<input id="res-ville" v-model="form.localisation_ville" type="text" placeholder="Ex : Paris, Lyon..." />
</div>
<div class="field-group">
<label for="res-projet-lien">Lien vers un projet / réalisation <span class="label-hint">(optionnel)</span></label>
<input id="res-projet-lien" v-model="form.projet_lien" type="url" placeholder="https://..." />
</div>
<div class="field-group">
<label for="res-projet-adresse">Adresse du projet <span class="label-hint">(optionnel)</span></label>
<input id="res-projet-adresse" v-model="form.projet_adresse" type="text" placeholder="Ex : 12 rue des Lilas, 75000 Paris" />
</div>
<div class="field-group" :class="{ 'field-error': errors.submitted_by_email }">
<label for="res-email">Ton email <span class="label-hint">(optionnel — pour le suivi)</span></label>
<input id="res-email" v-model="form.submitted_by_email" type="email" placeholder="ton@email.fr" autocomplete="email" @blur="validateField('submitted_by_email')" />
<span v-if="errors.submitted_by_email" class="error-msg" role="alert">{{ errors.submitted_by_email }}</span>
</div>
<div v-if="serverError" class="server-error" role="alert"><strong>Erreur :</strong> {{ serverError }}</div>
<div class="form-actions">
<button type="submit" class="btn-primary" :disabled="submitting">{{ submitting ? 'Envoi en cours...' : 'Proposer →' }}</button>
</div>
<p class="form-note">Ta proposition sera examinée par l'équipe avant publication.</p>
</form>
</template>
<script setup lang="ts">
import { z } from 'zod'
const TYPES = ['agence', 'collectif', 'reseau', 'asso', 'ressource'] as const
const LABELS: Record<string, string> = { agence: 'Agence', collectif: 'Collectif', reseau: 'Réseau', asso: 'Association', ressource: 'Ressource' }
const Schema = z.object({
nom: z.string().min(3, 'Minimum 3 caractères').max(150, 'Maximum 150 caractères').trim(),
type_principal: z.string().optional(),
url: z.string().url('URL invalide').optional().or(z.literal('')),
description_user: z.string().min(50, 'Minimum 50 caractères').max(500, 'Maximum 500 caractères').trim(),
localisation_ville: z.string().max(100).optional(),
projet_lien: z.string().url('URL invalide').optional().or(z.literal('')),
projet_adresse: z.string().max(200).optional(),
submitted_by_email: z.string().email('Email invalide').optional().or(z.literal('')),
})
const emit = defineEmits<{ success: [] }>()
const form = reactive({
nom: '', type_principal: '', url: '', description_user: '',
localisation_ville: '', projet_lien: '', projet_adresse: '', submitted_by_email: '',
})
const errors = reactive<Record<string, string>>({})
const submitting = ref(false)
const serverError = ref('')
function validateField(field: string) {
const partial = Schema.partial()
const result = partial.safeParse({ [field]: (form as any)[field] })
if (!result.success) {
const fieldErrors = result.error.flatten().fieldErrors
errors[field] = fieldErrors[field]?.[0] ?? ''
} else {
delete errors[field]
}
}
function validateAll(): boolean {
const result = Schema.safeParse(form)
if (!result.success) {
const flat = result.error.flatten().fieldErrors
Object.assign(errors, Object.fromEntries(Object.entries(flat).map(([k, v]) => [k, v?.[0] ?? ''])))
return false
}
Object.keys(errors).forEach(k => delete errors[k])
return true
}
async function submit() {
serverError.value = ''
if (!validateAll()) {
await nextTick()
const firstError = document.querySelector('.field-error')
firstError?.scrollIntoView({ behavior: 'smooth', block: 'center' })
return
}
submitting.value = true
try {
await $fetch('/api/submit', {
method: 'POST',
body: {
submission_type: 'reseau',
nom: form.nom,
type_principal: form.type_principal || undefined,
url: form.url || undefined,
description_user: form.description_user,
localisation_ville: form.localisation_ville || undefined,
projet_lien: form.projet_lien || undefined,
projet_adresse: form.projet_adresse || undefined,
submitted_by_email: form.submitted_by_email || undefined,
},
})
emit('success')
} catch (e: any) {
const status = e?.status ?? e?.statusCode
if (status === 429) {
serverError.value = 'Tu as déjà soumis 3 fiches aujourd\'hui. Réessaie demain.'
} else if (status === 422 && e?.data) {
const fieldErrors = e.data
Object.entries(fieldErrors).forEach(([k, v]) => { errors[k] = Array.isArray(v) ? v[0] : String(v) })
serverError.value = 'Certains champs sont invalides — vérifie les erreurs ci-dessus.'
} else {
serverError.value = 'Une erreur s\'est produite. Réessaie dans quelques instants.'
}
} finally {
submitting.value = false
}
}
</script>
<style scoped>
@import './form-styles.css';
</style>
+26
View File
@@ -587,6 +587,20 @@ async function initGraph() {
.attr('fill', '#2a2a2a')
.style('pointer-events', 'none')
// Labels structures : nom au-dessus du cercle, halo pour lisibilite
d3NodeSelection.filter((d: any) => d.type === 'structure')
.append('text')
.attr('class', 'graph-struct-label')
.text((d: any) => {
const raw = d.label as string
return raw.length > 22 ? raw.slice(0, 20) + '…' : raw
})
.attr('text-anchor', 'middle')
.attr('dy', (d: any) => -(d.r + 5))
.attr('font-size', '9.5px')
.attr('font-weight', '500')
.style('pointer-events', 'none')
// Tooltip hover pour structures
d3NodeSelection.filter((d: any) => d.type === 'structure')
.on('mouseenter', (_event: any, d: any) => {
@@ -858,3 +872,15 @@ onUnmounted(() => {
if (simulation) simulation.stop()
})
</script>
<style>
/* Labels des structures dans le graphe (D3 injecte les <text>, donc style global) */
.graph-view .graph-struct-label {
fill: var(--nav-text);
paint-order: stroke;
stroke: var(--nav-bg);
stroke-width: 3px;
stroke-linejoin: round;
user-select: none;
}
</style>
-97
View File
@@ -1,97 +0,0 @@
<template>
<div class="hashtag-filter" style="padding: 8px 12px; background: var(--nav-surface);">
<!-- Filtres famille -->
<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>
<div v-if="hashtagsVisible" class="chips-row">
<span
v-for="tag in props.allHashtags"
:key="tag"
class="chip chip-small"
:style="selectedHashtags.includes(tag)
? 'background: var(--nav-primary); color: var(--nav-text-on-primary); font-weight: 600;'
: 'background: var(--nav-bg-alt); color: var(--nav-text-muted);'"
@click="toggleHashtag(tag)"
>{{ tag }}</span>
</div>
</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;
}
.chip-small { font-size: 0.7rem; padding: 2px 8px; }
</style>
+1 -1
View File
@@ -31,7 +31,7 @@
<p style="font-size: 0.875rem; line-height: 1.6; opacity: 0.75; margin: 0 0 24px 0;">
Elle ne prétend pas à l'exhaustivité. Elle est un geste politique :
rendre visible ce qui se transforme, comment, par qui, où.
5 familles et des hashtags vous permettent d'explorer.
Six familles et des hashtags vous permettent d'explorer.
</p>
<button
@click="dismiss"
+19
View File
@@ -0,0 +1,19 @@
<template>
<div class="media-tab-backend" style="padding: 2rem; overflow-y: auto;">
<div style="max-width: 640px;">
<h2 style="font-weight: 700; font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--nav-text);">LightRAG backend</h2>
<p style="font-size: 0.9rem; line-height: 1.6; color: var(--nav-text); margin-bottom: 0.5rem;">
Voici l'interface brute du <strong>LightRAG</strong> qui alimente la carte des pensées écologiques.
C'est la "cuisine" du RAG : ingestion de documents, extraction d'entités, relations, requêtes.
</p>
</div>
<iframe
src="https://lightrag.trans-former.fr/"
style="width: 100%; height: 70vh; border: 1px solid var(--nav-bg-alt, #ddd); border-radius: 8px; margin-top: 1.5rem;"
title="LightRAG backend AEP — lecture seule"
sandbox="allow-same-origin allow-scripts"
loading="lazy"
/>
</div>
</template>
+67
View File
@@ -0,0 +1,67 @@
<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);">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.
</p>
</div>
<div class="projets-grid">
<article v-for="p in projets" :key="p.id" class="projet-card">
<img v-if="p.thumb" :src="p.thumb" :alt="p.titre" class="projet-thumb" loading="lazy" />
<div v-else class="projet-thumb projet-thumb--placeholder">📐</div>
<h3 style="font-weight: 600; font-size: 0.95rem; margin: 0.5rem 0 0.25rem; color: var(--nav-text);">{{ p.titre }}</h3>
<p style="font-size: 0.8rem; color: var(--nav-text-muted); margin-bottom: 0.5rem;">
{{ (p.auteurs || []).filter((a: string) => a !== 'Inconnu').join(', ') }}
<template v-if="p.ecole && p.ecole !== 'Inconnu'"> · {{ p.ecole }}</template>
<template v-if="p.annee && p.annee !== 'Inconnu'"> · {{ p.annee }}</template>
</p>
<p style="font-size: 0.875rem; line-height: 1.5; color: var(--nav-text); flex: 1; margin-bottom: 0.75rem;">{{ p.description }}</p>
<a v-if="p.url" :href="p.url" target="_blank" rel="noopener" style="color: var(--nav-primary-solid, #3b6ea5); font-weight: 600; font-size: 0.875rem; text-decoration: none;">
Découvrir →
</a>
<span v-if="p.link_status === 'broken'" style="color: #e67e22; font-size: 0.8rem; display: block; margin-top: 0.25rem;">⚠ Lien d'origine cassé</span>
</article>
</div>
<p style="margin-top: 2rem; font-size: 0.875rem; color: var(--nav-text-muted);">
Tu as un PFE engagé à partager ? <a href="mailto:contact@trans-former.fr" style="color: var(--nav-primary-solid);">Écris-moi</a>.
</p>
</div>
</template>
<script setup lang="ts">
const { data: pfeData } = await useFetch<{ projets: any[] }>('/data/pfe-engages.json')
const projets = computed(() => pfeData.value?.projets ?? [])
</script>
<style scoped>
.projets-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1.25rem;
}
.projet-card {
border: 1px solid var(--nav-bg-alt, #eee);
border-radius: 10px;
padding: 1rem;
display: flex;
flex-direction: column;
background: var(--nav-surface);
}
.projet-thumb {
width: 100%;
height: 140px;
object-fit: cover;
border-radius: 6px;
background: var(--nav-bg-alt, #f5f5f5);
display: flex;
align-items: center;
justify-content: center;
font-size: 2rem;
}
</style>
+651
View File
@@ -0,0 +1,651 @@
<template>
<div class="media-visuel">
<!-- Conteneur principal : carte → toolbar → chatbot (ou bonpote/rag-backend) -->
<div class="layout-container">
<!-- SLOT CARTE D3 (mode carte uniquement) -->
<div
v-if="contentView === 'carte'"
class="carte-slot"
:class="[
layoutMode === 'split' ? 'carte-split' : '',
layoutMode === 'carte-full' ? 'carte-full' : '',
layoutMode === 'chatbot-full' ? 'carte-hidden' : '',
]"
:style="layoutMode === 'split' ? { flexBasis: carteFlexBasis } : {}"
style="position: relative;"
>
<ClientOnly>
<CartePensees
ref="cartePenseesRef"
:data="penseesData"
:active="true"
@select-auteur="onSelectAuteur"
@select-ecole="onSelectEcole"
/>
<template #fallback>
<div class="w-full h-full flex items-center justify-center" style="color: var(--nav-text-muted);">
Chargement de la carte...
</div>
</template>
</ClientOnly>
<!-- Overlay PDF FRACAS -->
<div
v-if="showFracasPdf"
class="fracas-overlay"
:style="{ opacity: fracasOpacity / 100 }"
>
<embed
src="/cartes/carte-fracas-bonpote-v2.pdf"
type="application/pdf"
style="width: 100%; height: 100%;"
/>
</div>
</div>
<!-- BARRE DE TOGGLE (entre carte et chatbot, toujours visible) -->
<div class="layout-toggle-bar shrink-0">
<!-- Gauche : contrôles layout (seulement en mode carte) -->
<template v-if="contentView === 'carte'">
<button
@click="layoutMode = 'carte-full'"
:class="{ active: layoutMode === 'carte-full' }"
class="toggle-btn"
title="Carte en plein ecran"
>
<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">
<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/>
<line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/>
</svg>
Carte plein ecran
</button>
<button
v-if="layoutMode !== 'split'"
@click="layoutMode = 'split'"
class="toggle-btn"
title="Vue partagee"
>
<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">
<rect x="3" y="3" width="18" height="18" rx="2"/><line x1="3" y1="12" x2="21" y2="12"/>
</svg>
Vue partagee
</button>
<button
@click="layoutMode = 'chatbot-full'"
:class="{ active: layoutMode === 'chatbot-full' }"
class="toggle-btn"
title="Chatbot plein ecran"
>
<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">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
</svg>
Chatbot plein ecran
</button>
</template>
<!-- Droite : contrôles contenu (toujours, indépendants du layoutMode) -->
<div style="margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap;">
<!-- Slider opacité PDF -->
<input
v-if="showFracasPdf && contentView === 'carte'"
type="range"
min="0"
max="100"
v-model.number="fracasOpacity"
class="opacity-slider"
:title="`Opacité ${fracasOpacity}%`"
/>
<!-- CARTE PRINCIPALE -->
<button
@click="showCarte"
:class="{ active: contentView === 'carte' }"
class="toggle-btn"
title="Vue principale : carte D3 + chatbot"
>
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="2"/><path d="M12 2a10 10 0 0 0-7.07 17.07M12 2a10 10 0 0 1 7.07 17.07M3.34 7h17.32M3.34 17h17.32"/>
</svg>
CARTE PRINCIPALE
</button>
<!-- Tickbox PDF + carte des pensées -->
<div class="carte-pensees-ctrl">
<input
type="checkbox"
v-model="showFracasPdf"
class="fracas-check"
title="Superposer la carte FRACAS en PDF"
/>
<button
@click="contentView = 'bonpote'"
:class="{ active: contentView === 'bonpote' }"
class="toggle-btn carte-pensees-btn"
title="Carte des pensées écologiques — référence FRACAS Bonpote V2"
>
📗 carte des pensées écologiques
</button>
</div>
<!-- RAG backend -->
<button
@click="contentView = 'rag-backend'"
:class="{ active: contentView === 'rag-backend' }"
class="toggle-btn"
title="Interface LightRAG backend"
>
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="3"/><path d="M19.07 4.93a10 10 0 0 1 0 14.14M4.93 4.93a10 10 0 0 0 0 14.14"/>
</svg>
RAG backend
</button>
</div>
</div>
<!-- POIGNEE DRAGGABLE (split uniquement) -->
<div
v-if="contentView === 'carte' && layoutMode === 'split'"
class="split-handle"
@mousedown.prevent="onHandleMousedown"
title="Redimensionner"
>
<span class="split-handle-grip"></span>
</div>
<!-- SLOT CHATBOT (mode carte uniquement) -->
<div
v-if="contentView === 'carte'"
class="chatbot-slot"
:class="[
layoutMode === 'split' ? 'chatbot-split' : '',
layoutMode === 'chatbot-full' ? 'chatbot-full-mode' : '',
layoutMode === 'carte-full' ? 'chatbot-hidden' : '',
]"
:style="layoutMode === 'split' ? { flexBasis: chatbotFlexBasis } : {}"
>
<ClientOnly>
<ChatbotPensees :auteurContext="chatbotAuteur" :inline="true" />
</ClientOnly>
</div>
<!-- VUE BONPOTE -->
<div
v-if="contentView === 'bonpote'"
class="flex-1 overflow-y-auto px-6 py-8"
style="max-width: 680px; margin: 0 auto;"
>
<div class="mb-6">
<p class="text-xs font-bold uppercase tracking-widest mb-2" style="color: var(--nav-text-muted);">Reference editoriale</p>
<h2 class="text-xl font-bold mb-3" style="color: var(--nav-text);">Carte FRACAS des pensees ecologiques</h2>
<p class="text-sm leading-relaxed mb-4" style="color: var(--nav-text);">
FRACAS (Familles, Racines et Arpentages des Courants et Alternatives Solidaires) est une carte des ecoles de pensee ecologique publiee par Bonpote en octobre 2024. Elle reference ~140 auteurs et autrices reparti-es en 10 ecoles de pensee, depuis l'ecosocialisme jusqu'a l'ethique environnementale.
</p>
<p class="text-sm leading-relaxed mb-6" style="color: var(--nav-text);">
Le RAG ATIS est construit sur cette reference : chaque auteur ingere dans la bibliotheque correspond a une entree de la carte FRACAS. Les ecoles de pensee, les positions et les couleurs de notre carte sont transposees 1:1 depuis Bonpote V2.
</p>
<div class="flex flex-col gap-3">
<a href="https://bonpote.com/la-carte-des-pensees-ecologiques/"
target="_blank" rel="noopener"
class="flex items-center gap-3 px-4 py-3 rounded-lg hover:opacity-80 transition-opacity"
style="background: var(--nav-primary, #3b6ea5); color: white; font-size: 0.875rem; font-weight: 600; text-decoration: none;">
<svg width="16" height="16" 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>
Lire l'article Bonpote + carte interactive
</a>
<a href="https://bonpote.com/wp-content/uploads/2024/10/FRACAS_BONPOTE_CARTE_VERSO_V2-OCT2024.pdf"
target="_blank" rel="noopener"
class="flex items-center gap-3 px-4 py-3 rounded-lg hover:opacity-80 transition-opacity"
style="background: var(--nav-bg-alt); color: var(--nav-text); font-size: 0.875rem; font-weight: 500; text-decoration: none;">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
Telecharger le poster PDF (recto/verso)
</a>
<button
@click="showCarte"
class="flex items-center gap-3 px-4 py-3 rounded-lg hover:opacity-80 transition-opacity text-left"
style="background: var(--nav-bg-alt); color: var(--nav-text); font-size: 0.875rem; font-weight: 500; border: none; cursor: pointer;">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
Interroger le RAG ATIS sur ces pensees
</button>
</div>
</div>
<div>
<p class="text-xs font-bold uppercase tracking-widest mb-3" style="color: var(--nav-text-muted);">Les 10 ecoles de pensee (FRACAS V2)</p>
<div class="flex flex-col gap-2">
<div v-for="ecole in (penseesData?.ecoles ?? [])" :key="ecole.id"
class="flex items-start gap-3 px-3 py-2 rounded-lg"
style="background: var(--nav-bg-alt);">
<span class="w-3 h-3 rounded-full shrink-0 mt-1" :style="`background:${ecole.color};`"></span>
<div>
<p class="text-sm font-semibold" style="color: var(--nav-text);">{{ ecole.label }}</p>
<p class="text-xs mt-0.5 leading-relaxed" style="color: var(--nav-text-muted);">{{ ecole.description }}</p>
</div>
</div>
</div>
</div>
</div>
<!-- VUE RAG BACKEND -->
<div
v-if="contentView === 'rag-backend'"
style="flex: 1; overflow: hidden; display: flex; flex-direction: column;"
>
<MediaTabBackend />
</div>
</div>
<!-- Fiche auteur modal -->
<FicheAuteur
:open="ficheOpen"
:auteurId="ficheAuteurId"
:data="penseesData"
@close="ficheOpen = false"
@interroger-rag="onInterrogerRag"
/>
<!-- Fiche ecole modal -->
<FicheEcole
:open="ficheEcoleOpen"
:ecoleId="ficheEcoleId"
:data="penseesData"
@close="ficheEcoleOpen = false"
@select-auteur="onSelectAuteurFromEcole"
@interroger-ecole="onInterrogerEcole"
/>
<!-- Modal info RAG -->
<Teleport to="body">
<Transition name="backdrop">
<div v-if="ragInfoOpen" class="fixed inset-0 z-[2000]" style="background:rgba(26,34,56,0.55);" @click="ragInfoOpen = false" aria-hidden="true" />
</Transition>
<Transition name="modal">
<div v-if="ragInfoOpen" class="fixed z-[2001] left-1/2 flex flex-col"
style="top:50%;transform:translate(-50%,-50%);width:min(580px,94vw);max-height:85vh;background:var(--nav-bg);border-radius:14px;box-shadow:0 16px 64px rgba(26,34,56,0.28);overflow:hidden;"
role="dialog" aria-modal="true" aria-label="À propos du RAG FRACAS">
<div class="flex items-center justify-between px-5 py-4 shrink-0"
style="border-bottom:2px solid var(--nav-bg-alt);background:var(--nav-surface);">
<h2 class="font-bold text-base" style="color:var(--nav-text);">FRACAS - Bibliothèque des pensées écologiques</h2>
<button @click="ragInfoOpen = false" class="ml-3 shrink-0 flex items-center justify-center w-8 h-8 rounded-full hover:opacity-70"
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">
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
</svg>
</button>
</div>
<div class="flex-1 overflow-y-auto px-5 py-4" style="color:var(--nav-text);font-size:0.875rem;line-height:1.6;">
<EchelleTete echelle="XL" compact @navigate="ragInfoOpen = false" />
<p class="mb-3">Une bibliothèque parlante des pensées écologiques, organisée pour aider à créer une pensée complexe et nuancée, à soutenir l'écriture de nouveaux récits, des alternatives concrètes et des projets collectifs.</p>
<p class="mb-4" style="color:var(--nav-text-muted);font-size:0.8rem;">Projet open source, ouvert à toutes et à tous - <a href="https://bonpote.com/la-carte-des-pensees-ecologiques/" target="_blank" rel="noopener" style="text-decoration:underline;">article + carte FRACAS Bonpote V2</a>.</p>
<div class="flex flex-col gap-3">
<div class="p-3 rounded-lg" style="background:var(--nav-bg-alt);">
<p class="font-semibold mb-1" style="font-size:0.8rem;color:var(--nav-text-muted);text-transform:uppercase;letter-spacing:0.05em;">Ce qu'est un RAG</p>
<p>Les textes sont vectorises dans un espace de 662 dimensions - chaque livre devient un nuage de points semantiques. La proximite entre les points capture la proximite entre les idees, pas les mots.</p>
</div>
<div class="p-3 rounded-lg" style="background:var(--nav-bg-alt);">
<p class="font-semibold mb-1" style="font-size:0.8rem;color:var(--nav-text-muted);text-transform:uppercase;letter-spacing:0.05em;">Chunking intelligent</p>
<p>Lors de l'ingestion, nous selectionnons les entites cles (concepts, auteurs, relations entre idees) plutot que de decouper mecaniquement les textes.</p>
</div>
<div class="p-3 rounded-lg" style="background:var(--nav-bg-alt);">
<p class="font-semibold mb-2" style="font-size:0.8rem;color:var(--nav-text-muted);text-transform:uppercase;letter-spacing:0.05em;">Trois couches d'analyse</p>
<div class="flex flex-col gap-1.5">
<div class="flex gap-2"><span class="font-semibold" style="min-width:70px;">Fond</span><span>Les idees, les theses, les arguments - ce qu'on interroge directement.</span></div>
<div class="flex gap-2"><span class="font-semibold" style="min-width:70px;">Forme</span><span>Les modeles narratifs, la rhetorique, la construction argumentative.</span></div>
<div class="flex gap-2"><span class="font-semibold" style="min-width:70px;">Structure</span><span>L'architecture des livres - comment les auteurs construisent leur pensee.</span></div>
</div>
</div>
</div>
</div>
</div>
</Transition>
</Teleport>
</div>
</template>
<script setup lang="ts">
interface EcoleData { id: string; label: string; description: string; color: string; x_hint: number; y_hint: number }
interface LivreRag { slug: string; titre: string; annee: number; couches: string[] }
interface AuteurData { id: string; nom: string; dates: string; ecoles: string[]; ecole_principale: string; livres_rag: LivreRag[]; theses_cles: string[]; bio_courte: string }
interface PenseesData { meta: any; ecoles: EcoleData[]; auteurs: AuteurData[] }
type LayoutMode = 'split' | 'carte-full' | 'chatbot-full'
type ContentView = 'carte' | 'bonpote' | 'rag-backend'
const LAYOUT_KEY = 'media-layout-mode'
const CONTENT_KEY = 'media-content-view'
const SPLIT_RATIO_KEY = 'media-split-ratio'
const DEFAULT_SPLIT_RATIO = 0.66
const ficheOpen = ref(false)
const ficheAuteurId = ref<string | null>(null)
const ficheEcoleOpen = ref(false)
const ficheEcoleId = ref<string | null>(null)
const ragInfoOpen = ref(false)
const chatbotAuteur = ref<string | null>(null)
const layoutMode = ref<LayoutMode>('split')
const contentView = ref<ContentView>('carte')
const cartePenseesRef = ref<{ triggerResize: () => void } | null>(null)
const showFracasPdf = ref(false)
const fracasOpacity = ref(60)
const penseesData = ref<PenseesData | null>(null)
const splitRatio = ref(DEFAULT_SPLIT_RATIO)
const carteFlexBasis = computed(() => `${splitRatio.value * 100}%`)
const chatbotFlexBasis = computed(() => `${(1 - splitRatio.value) * 100}%`)
let dragStartY = 0
let dragStartRatio = DEFAULT_SPLIT_RATIO
let containerHeight = 0
function showCarte() {
contentView.value = 'carte'
layoutMode.value = 'split'
if (typeof window !== 'undefined') {
localStorage.setItem(CONTENT_KEY, 'carte')
localStorage.setItem(LAYOUT_KEY, 'split')
}
nextTick(() => cartePenseesRef.value?.triggerResize())
}
function onHandleMousedown(e: MouseEvent) {
dragStartY = e.clientY
dragStartRatio = splitRatio.value
const container = (e.target as HTMLElement)?.closest('.layout-container') as HTMLElement | null
containerHeight = container ? container.clientHeight : window.innerHeight
window.addEventListener('mousemove', onHandleMousemove)
window.addEventListener('mouseup', onHandleMouseup)
}
function onHandleMousemove(e: MouseEvent) {
const delta = e.clientY - dragStartY
const newRatio = dragStartRatio + delta / containerHeight
splitRatio.value = Math.min(0.80, Math.max(0.20, newRatio))
}
function onHandleMouseup() {
window.removeEventListener('mousemove', onHandleMousemove)
window.removeEventListener('mouseup', onHandleMouseup)
if (typeof window !== 'undefined') localStorage.setItem(SPLIT_RATIO_KEY, String(splitRatio.value))
cartePenseesRef.value?.triggerResize()
}
onMounted(async () => {
if (typeof window !== 'undefined') {
const savedLayout = localStorage.getItem(LAYOUT_KEY) as LayoutMode | null
if (savedLayout && (['split', 'carte-full', 'chatbot-full'] as string[]).includes(savedLayout)) {
layoutMode.value = savedLayout
}
const savedContent = localStorage.getItem(CONTENT_KEY) as ContentView | null
if (savedContent && (['carte', 'bonpote', 'rag-backend'] as string[]).includes(savedContent)) {
contentView.value = savedContent
}
const savedRatio = parseFloat(localStorage.getItem(SPLIT_RATIO_KEY) ?? '')
if (!isNaN(savedRatio) && savedRatio >= 0.20 && savedRatio <= 0.80) {
splitRatio.value = savedRatio
}
if (!localStorage.getItem('rag-fracas-info-seen')) {
ragInfoOpen.value = true
localStorage.setItem('rag-fracas-info-seen', '1')
}
}
try {
penseesData.value = await $fetch<PenseesData>('/data/auteurs-pensees.json')
} catch (e) {
console.error('Erreur chargement auteurs-pensees.json', e)
}
})
watch(layoutMode, (v) => {
if (typeof window !== 'undefined') localStorage.setItem(LAYOUT_KEY, v)
if (v === 'split' || v === 'carte-full') {
setTimeout(() => cartePenseesRef.value?.triggerResize(), 350)
}
})
watch(contentView, (v) => {
if (typeof window !== 'undefined') localStorage.setItem(CONTENT_KEY, v)
})
function onSelectAuteur(id: string) {
ficheAuteurId.value = id
ficheOpen.value = true
chatbotAuteur.value = null
}
function onSelectEcole(id: string) {
ficheEcoleId.value = id
ficheEcoleOpen.value = true
}
function onSelectAuteurFromEcole(auteurId: string) {
ficheEcoleOpen.value = false
onSelectAuteur(auteurId)
}
function onInterrogerEcole(ecoleId: string) {
ficheEcoleOpen.value = false
const ecole = penseesData.value?.ecoles.find(e => e.id === ecoleId)
chatbotAuteur.value = ecole?.label ?? null
if (contentView.value !== 'carte') showCarte()
else if (layoutMode.value === 'carte-full') layoutMode.value = 'split'
}
function onInterrogerRag(auteurId: string) {
ficheOpen.value = false
const auteur = penseesData.value?.auteurs.find(a => a.id === auteurId)
chatbotAuteur.value = auteur?.nom ?? null
if (contentView.value !== 'carte') showCarte()
else if (layoutMode.value === 'carte-full') layoutMode.value = 'split'
}
</script>
<style scoped>
.media-visuel {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
}
.layout-container {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
}
/* --- Slot carte --- */
.carte-slot {
overflow: hidden;
position: relative;
transition: opacity 0.2s ease;
}
.carte-split {
flex: 0 0 66%;
min-height: 0;
opacity: 1;
}
.carte-full {
flex: 1 1 100%;
min-height: 0;
opacity: 1;
}
.carte-hidden {
flex: 0 0 0;
height: 0;
opacity: 0;
overflow: hidden;
}
/* --- Overlay PDF FRACAS --- */
.fracas-overlay {
position: absolute;
inset: 0;
z-index: 50;
pointer-events: none;
}
/* --- Barre de toggle (entre carte et chatbot) --- */
.layout-toggle-bar {
flex-shrink: 0;
display: flex;
align-items: center;
gap: 6px;
padding: 4px 12px;
background: var(--nav-bg);
border-top: 1px solid rgba(180, 170, 160, 0.22);
border-bottom: 1px solid rgba(180, 170, 160, 0.22);
min-height: 38px;
flex-wrap: wrap;
}
.toggle-btn {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 4px 10px;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 500;
cursor: pointer;
background: var(--nav-bg-alt);
color: var(--nav-text-muted);
border: 1px solid transparent;
transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.toggle-btn:hover {
background: var(--nav-surface);
color: var(--nav-text);
}
.toggle-btn.active {
background: var(--nav-primary);
color: var(--nav-text-on-primary);
border-color: var(--nav-primary);
}
/* --- Contrôle fusionné carte des pensées --- */
.carte-pensees-ctrl {
display: inline-flex;
align-items: center;
gap: 0;
border-radius: 6px;
overflow: hidden;
border: 1px solid rgba(180, 170, 160, 0.3);
}
.fracas-check {
margin: 0 2px 0 7px;
cursor: pointer;
accent-color: var(--nav-primary, #3b6ea5);
}
.carte-pensees-btn {
border-radius: 0;
border: none;
}
.opacity-slider {
width: 80px;
cursor: pointer;
accent-color: var(--nav-primary, #3b6ea5);
}
/* --- Poignee draggable --- */
.split-handle {
flex-shrink: 0;
height: 8px;
display: flex;
align-items: center;
justify-content: center;
cursor: row-resize;
background: transparent;
position: relative;
z-index: 10;
user-select: none;
}
.split-handle:hover {
background: rgba(180, 170, 160, 0.18);
}
.split-handle-grip {
display: block;
width: 32px;
height: 4px;
border-radius: 2px;
background: repeating-linear-gradient(
to bottom,
rgba(160, 150, 140, 0.55) 0px,
rgba(160, 150, 140, 0.55) 1px,
transparent 1px,
transparent 3px
);
}
@media (max-width: 767px) {
.split-handle { display: none; }
}
/* --- Slot chatbot --- */
.chatbot-slot {
overflow: hidden;
position: relative;
transition: opacity 0.2s ease;
border-top: 1px solid rgba(180, 170, 160, 0.28);
}
.chatbot-split {
flex: 1 1 0;
min-height: 120px;
opacity: 1;
}
.chatbot-full-mode {
flex: 1 1 100%;
min-height: 0;
opacity: 1;
}
.chatbot-hidden {
flex: 0 0 0;
height: 0;
opacity: 0;
overflow: hidden;
}
/* --- Transitions modal RAG info --- */
.backdrop-enter-active,.backdrop-leave-active { transition: opacity 0.2s; }
.backdrop-enter-from,.backdrop-leave-to { opacity: 0; }
.modal-enter-active { transition: opacity 0.2s, transform 0.22s cubic-bezier(0.34,1.56,0.64,1); }
.modal-leave-active { transition: opacity 0.18s, transform 0.18s ease-in; }
.modal-enter-from { opacity: 0; transform: translate(-50%,-48%) scale(0.94); }
.modal-leave-to { opacity: 0; transform: translate(-50%,-48%) scale(0.96); }
/* --- Mobile --- */
@media (max-width: 767px) {
.carte-split {
flex: 0 0 60vh;
height: 60vh;
}
.chatbot-split {
flex: 1 1 0;
min-height: 120px;
}
.toggle-btn {
font-size: 0.7rem;
padding: 3px 7px;
}
}
</style>
+186
View File
@@ -0,0 +1,186 @@
<template>
<Teleport to="body">
<Transition name="backdrop">
<div
v-if="modelValue"
class="fixed inset-0 z-[1500]"
style="background: rgba(26,34,56,0.55);"
@click="close"
aria-hidden="true"
/>
</Transition>
<Transition name="modal">
<div
v-if="modelValue"
class="mission-modal"
role="dialog"
aria-modal="true"
aria-labelledby="mission-title"
@keydown.esc="close"
>
<button
class="mission-close"
type="button"
@click="close"
aria-label="Fermer"
>
<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="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
</svg>
</button>
<div class="mission-body">
<h2 id="mission-title" class="mission-title">{{ title }}</h2>
<EchelleTete v-if="echelle" :echelle="echelle" compact @navigate="close" />
<slot>
<p class="mission-text">
L'architecture est l'une des professions les plus complexes qui soit ; elle croise droit, technique, esthétique, économie, social, écologie — tout à la fois, tout simultanément, souvent sans filet. Paradoxalement, c'est aussi l'une des moins structurées sur le plan de l'entraide&nbsp;: peu de transmission horizontale, beaucoup d'isolement, une culture du chacun-pour-soi héritée d'une formation qui prépare à la compétition plus qu'à la coopération. On sort de l'école seul·e. On s'installe seul·e. On réinvente ce que d'autres ont déjà traversé.
</p>
<p class="mission-text">
Cette carte est née de cette frustration — et de cette conviction&nbsp;: les ressources existent, les gens qui ont réussi à sortir la tête de l'eau aussi. L'enjeu, c'est de les documenter, de les rendre accessibles, de les ajuster en temps réel grâce aux retours de la communauté. Pas un catalogue figé&nbsp;; un commun vivant, au service de ceux et celles qui cherchent à faire évoluer leur pratique vers quelque chose de plus épanouissant, mieux rémunéré, au service de la société — et qui prend soin de la santé, la nôtre et celle des gens pour qui nous construisons.
</p>
</slot>
<div class="mission-cta-wrap">
<button class="btn-explorer" type="button" @click="close">{{ ctaLabel }}</button>
<NuxtLink to="/manifeste" class="link-manifeste" @click="close">Lire le manifeste →</NuxtLink>
</div>
</div>
</div>
</Transition>
</Teleport>
</template>
<script setup lang="ts">
import type { EchelleId } from '~/utils/echelles'
const props = withDefaults(defineProps<{
modelValue: boolean
title?: string
ctaLabel?: string
storageKey?: string
/** Tête d'échelle du deck (S / M / XL) affichée sous le titre. Absente sur /agences tant que l'arbitrage n° 1 n'est pas rendu. */
echelle?: EchelleId
}>(), {
title: "L'écosystème d'entraide architecte",
ctaLabel: 'Explorer la carte',
storageKey: 'aep_mission_seen',
})
const emit = defineEmits<{ 'update:modelValue': [value: boolean] }>()
function close() {
emit('update:modelValue', false)
if (typeof window !== 'undefined') {
try { localStorage.setItem(props.storageKey, '1') } catch {}
}
}
</script>
<style scoped>
.mission-modal {
position: fixed;
z-index: 1501;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: min(560px, 92vw);
max-height: calc(100dvh - 80px);
background: var(--nav-bg);
border-radius: 16px;
box-shadow: 0 16px 64px rgba(26,34,56,0.28);
display: flex;
flex-direction: column;
overflow: hidden;
}
.mission-close {
position: absolute;
top: 12px;
right: 12px;
width: 32px;
height: 32px;
border-radius: 8px;
border: none;
background: var(--nav-bg-alt);
color: var(--nav-text-muted);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s;
z-index: 1;
}
.mission-close:hover { background: var(--nav-surface); }
.mission-body {
padding: 1.75rem 1.5rem 1.5rem;
overflow-y: auto;
}
.mission-title {
font-size: 1.25rem;
font-weight: 700;
color: var(--nav-text);
margin: 0 0 1rem;
line-height: 1.25;
padding-right: 2rem;
}
.mission-text,
:slotted(.mission-text) {
font-size: 0.95rem;
line-height: 1.65;
color: var(--nav-text);
margin: 0 0 1rem;
}
:slotted(.mission-text strong) { font-weight: 700; }
:slotted(.mission-text a) { color: var(--nav-primary-solid); text-decoration: underline; }
.mission-cta-wrap {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 1rem;
margin-top: 1.5rem;
}
.btn-explorer {
padding: 0.65rem 1.25rem;
background: var(--nav-primary);
color: var(--nav-text-on-primary);
border: none;
border-radius: 8px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition: opacity 0.15s;
}
.btn-explorer:hover { opacity: 0.88; }
.link-manifeste {
font-size: 0.875rem;
color: var(--nav-primary-solid);
text-decoration: underline;
text-underline-offset: 2px;
}
.link-manifeste:hover { opacity: 0.75; }
.backdrop-enter-active, .backdrop-leave-active { transition: opacity 0.2s ease; }
.backdrop-enter-from, .backdrop-leave-to { opacity: 0; }
.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%, -48%); }
@media (max-width: 480px) {
.mission-body { padding: 1.5rem 1.1rem 1.25rem; }
.mission-title { font-size: 1.1rem; }
.mission-text { font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
.modal-enter-active, .modal-leave-active { transition: none; }
.backdrop-enter-active, .backdrop-leave-active { transition: none; }
}
</style>
-218
View File
@@ -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>
+148
View File
@@ -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>
+74 -19
View File
@@ -5,6 +5,7 @@
</template>
<script setup lang="ts">
const baseTiles = useBaseTiles()
import type { Map, Marker, DivIcon } from 'leaflet'
interface Org {
@@ -23,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)
@@ -34,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: '',
@@ -75,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, {
@@ -90,12 +99,10 @@ async function initMap() {
// Fond de carte CartoDB Positron (light ou dark selon theme)
const isDark = typeof document !== 'undefined' && document.documentElement.classList.contains('dark')
const tileUrl = isDark
? 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png'
: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png'
const tileUrl = baseTiles.url(isDark)
tileLayerInstance = L.tileLayer(tileUrl, {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>',
attribution: baseTiles.attribution,
maxZoom: 19,
})
tileLayerInstance.addTo(mapInstance!)
@@ -126,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) {
@@ -142,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(', ')
@@ -164,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)
@@ -190,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
@@ -198,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 })
@@ -207,21 +221,45 @@ 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
const L = (window as any).L
if (!L) return
const url = dark
? 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png'
: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png'
const url = baseTiles.url(dark)
tileLayerInstance.setUrl(url)
}
let themeObserver: MutationObserver | null = null
onMounted(() => {
initMap()
// Double rAF : laisser le browser calculer la hauteur du conteneur avant Leaflet
requestAnimationFrame(() => {
requestAnimationFrame(() => {
initMap()
})
})
// Observer les changements de classe dark sur <html>
themeObserver = new MutationObserver(() => {
@@ -233,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>
+67 -17
View File
@@ -5,6 +5,7 @@
</template>
<script setup lang="ts">
const baseTiles = useBaseTiles()
import type { Map, Marker, DivIcon } from 'leaflet'
import type { StructureV2 } from '~/types/structure-v2'
@@ -20,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)
@@ -31,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: '',
@@ -75,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, {
@@ -87,12 +96,10 @@ async function initMap() {
})
const isDark = typeof document !== 'undefined' && document.documentElement.classList.contains('dark')
const tileUrl = isDark
? 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png'
: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png'
const tileUrl = baseTiles.url(isDark)
tileLayerInstance = L.tileLayer(tileUrl, {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>',
attribution: baseTiles.attribution,
maxZoom: 19,
})
tileLayerInstance.addTo(mapInstance!)
@@ -122,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) {
@@ -137,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>`)
@@ -166,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)
@@ -194,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 })
}
@@ -209,13 +223,32 @@ 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
if (!L) return
const url = dark
? 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png'
: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png'
const url = baseTiles.url(dark)
tileLayerInstance.setUrl(url)
}
@@ -235,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>
-257
View File
@@ -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-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-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>
+313
View File
@@ -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>
-45
View File
@@ -1,45 +0,0 @@
<template>
<NuxtLink
:to="`/fiche/${org.Id}`"
class="block bg-white rounded-xl shadow-sm border border-warm-200 hover:shadow-md hover:border-sage-300 transition-all duration-200 p-5"
>
<div class="flex items-start justify-between gap-3 mb-2">
<h2 class="font-semibold text-gray-900 text-base leading-snug">{{ org.nom }}</h2>
<TypeBadge v-if="org.type_org" :type="org.type_org" class="shrink-0 mt-0.5" />
</div>
<p class="text-gray-600 text-sm leading-relaxed mb-3 line-clamp-2">
{{ org.description }}
</p>
<div v-if="tags.length" class="flex flex-wrap gap-1.5">
<TagBadge
v-for="tag in tags"
:key="tag"
:tag="tag"
@click="$emit('filter-tag', tag)"
/>
</div>
</NuxtLink>
</template>
<script setup lang="ts">
const props = defineProps<{
org: {
Id: number
nom: string
type_org?: string
description?: string
tags?: string
lien?: string
}
}>()
defineEmits<{ 'filter-tag': [tag: string] }>()
const tags = computed(() =>
props.org.tags
? props.org.tags.split(',').map((t) => t.trim()).filter(Boolean)
: []
)
</script>
+150
View File
@@ -0,0 +1,150 @@
<template>
<component
:is="url ? 'a' : 'div'"
v-bind="url ? { href: url, target: '_blank', rel: 'noopener noreferrer' } : {}"
class="outil-card"
:class="{ 'outil-card--link': !!url, 'outil-card--disabled': !url }"
>
<div class="outil-card__header">
<span class="outil-card__icon" aria-hidden="true">{{ icon }}</span>
<span :class="['outil-card__badge', `outil-card__badge--${tag}`]">{{ tagLabel }}</span>
</div>
<h3 class="outil-card__titre">{{ titre }}</h3>
<p class="outil-card__desc">{{ description }}</p>
<span v-if="cta && url" class="outil-card__cta">{{ cta }}</span>
<span v-else-if="!url" class="outil-card__cta outil-card__cta--disabled">Bientôt disponible</span>
</component>
</template>
<script setup lang="ts">
const props = defineProps<{
icon?: string
titre: string
url?: string | null
description?: string
cta?: string
tag?: string
}>()
const tagLabels: Record<string, string> = {
'outil-aep': 'Outil AEP',
'inspiration-externe': 'Inspiration',
'disponible': 'Disponible',
'recommande': 'Recommandé',
'a-venir': 'À venir',
}
const tagLabel = computed(() => props.tag ? (tagLabels[props.tag] ?? props.tag) : '')
</script>
<style scoped>
.outil-card {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 1rem 1.25rem;
border-radius: 10px;
border: 1px solid var(--nav-bg-alt);
background: var(--nav-surface);
text-decoration: none;
color: var(--nav-text);
transition: box-shadow 0.15s, border-color 0.15s;
}
.outil-card--link:hover {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
border-color: var(--nav-primary-solid);
}
.outil-card--disabled {
opacity: 0.65;
}
.outil-card__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
}
.outil-card__icon {
font-size: 1.3rem;
line-height: 1;
}
.outil-card__badge {
font-size: 0.65rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
padding: 2px 7px;
border-radius: 999px;
}
.outil-card__badge--outil-aep {
background: #d1fae5;
color: #065f46;
}
.outil-card__badge--inspiration-externe {
background: #fef3c7;
color: #92400e;
}
.outil-card__badge--disponible {
background: #d1fae5;
color: #065f46;
}
.outil-card__badge--recommande {
background: #dbeafe;
color: #1e40af;
}
.outil-card__badge--a-venir {
background: var(--nav-bg-alt);
color: var(--nav-text-muted);
}
.outil-card__titre {
font-size: 0.9rem;
font-weight: 600;
color: var(--nav-text);
margin: 0;
line-height: 1.35;
}
.outil-card__desc {
font-size: 0.82rem;
color: var(--nav-text-muted);
margin: 0;
line-height: 1.5;
}
.outil-card__cta {
font-size: 0.78rem;
font-weight: 600;
color: var(--nav-primary-solid);
margin-top: 0.25rem;
}
.outil-card__cta--disabled {
color: var(--nav-text-muted);
font-weight: 400;
font-style: italic;
}
/* Dark mode badge overrides */
:global(.dark) .outil-card__badge--outil-aep {
background: #064e3b;
color: #a7f3d0;
}
:global(.dark) .outil-card__badge--inspiration-externe {
background: #78350f;
color: #fde68a;
}
:global(.dark) .outil-card__badge--disponible {
background: #064e3b;
color: #a7f3d0;
}
:global(.dark) .outil-card__badge--recommande {
background: #1e3a5f;
color: #93c5fd;
}
</style>
+3 -4
View File
@@ -38,6 +38,7 @@
</template>
<script setup lang="ts">
const baseTiles = useBaseTiles()
import type { Map as LeafletMap, TileLayer } from 'leaflet'
interface Org {
@@ -111,9 +112,7 @@ function createPinIcon(L: any, isPrioritaire: boolean, isSelected = false) {
}
function getTileUrl(dark: boolean) {
return dark
? 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png'
: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png'
return baseTiles.url(dark)
}
async function initSingleMap(domName: string) {
@@ -132,7 +131,7 @@ async function initSingleMap(domName: string) {
touchZoom: true, keyboard: false,
})
const tileLayer = L.tileLayer(getTileUrl(isDark), {
attribution: '© OpenStreetMap contributors © CARTO', maxZoom: 19,
attribution: baseTiles.attribution, maxZoom: 19,
})
tileLayer.addTo(map)
tileLayers[domName] = tileLayer as unknown as TileLayer
+244
View File
@@ -0,0 +1,244 @@
<template>
<button
type="button"
class="taff-card"
:style="`border-left-color: ${tagConfig.accent};`"
@click="$emit('open', plateforme)"
>
<!-- Ligne 1 : tag + badge AO + lien -->
<div class="taff-card-top">
<div class="flex items-center gap-2 flex-wrap">
<span class="taff-tag" :style="`background: ${tagConfig.bg}; color: ${tagConfig.text};`">
{{ tagConfig.emoji }} {{ tagConfig.label }}
</span>
<span
v-if="plateforme.type === 'appel-offre-public'"
class="taff-badge-ao"
>AO public</span>
</div>
<a
:href="plateforme.url"
target="_blank"
rel="noopener noreferrer"
class="taff-visit-btn"
@click.stop
title="Visiter le site"
>
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" 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>
Visiter
</a>
</div>
<!-- Ligne 2 : nom -->
<div class="taff-card-name">{{ plateforme.nom }}</div>
<!-- Ligne 3 : axes (icône + score, compacts) -->
<div class="taff-card-axes">
<template v-for="axe in AXES" :key="axe.id">
<span
v-if="plateforme.scoring[axe.id] !== null"
class="taff-axe-chip"
:style="`background: ${axeScoreBg(plateforme.scoring[axe.id])}; color: ${axeScoreText(plateforme.scoring[axe.id])};`"
:title="axe.label"
>{{ axe.icon }} {{ plateforme.scoring[axe.id] }}</span>
</template>
</div>
<!-- Ligne 4 : description (3 lignes max, lisible) -->
<p class="taff-card-desc">{{ plateforme.description_courte }}</p>
<!-- Ligne 5 : secteurs + coût -->
<div class="taff-card-footer">
<div class="flex items-center gap-1.5 flex-wrap">
<span
v-for="s in plateforme.secteurs_servis.slice(0, 3)"
:key="s"
class="taff-secteur-chip"
>{{ SECTEUR_LABELS[s] ?? s }}</span>
<span v-if="plateforme.secteurs_servis.length > 3" class="taff-more">+{{ plateforme.secteurs_servis.length - 3 }}</span>
</div>
<span class="taff-cout">{{ COUT_LABELS[plateforme.cout_entree] ?? plateforme.cout_entree }}</span>
</div>
</button>
</template>
<script setup lang="ts">
import type { PlateformeTaff } from '~/types/plateforme-taff'
const props = defineProps<{ plateforme: PlateformeTaff }>()
defineEmits<{ open: [p: PlateformeTaff] }>()
const AXES = [
{ id: 'remuneration' as const, icon: '🪙', label: 'Rémunération' },
{ id: 'transparence' as const, icon: '🔍', label: 'Transparence' },
{ id: 'pratiques' as const, icon: '⚖️', label: 'Pratiques pro' },
{ id: 'ecologie' as const, icon: '🌿', label: 'Écologie' },
{ id: 'matching' as const, icon: '🎯', label: 'Matching' },
]
const TAG_CONFIG = {
'recommande': { emoji: '✅', label: 'Recommandé AEP', accent: '#5a7a4a', bg: 'rgba(90,122,74,0.12)', text: '#3d5534' },
'sous-reserve': { emoji: '⚠️', label: 'Sous réserve', accent: '#c4a472', bg: 'rgba(196,164,114,0.15)', text: '#7a5f2a' },
'a-eviter': { emoji: '❌', label: 'À éviter', accent: '#a85d3e', bg: 'rgba(168,93,62,0.12)', text: '#7a3322' },
}
const tagConfig = computed(() => TAG_CONFIG[props.plateforme.scoring.tag_global] ?? TAG_CONFIG['sous-reserve'])
function axeScoreBg(score: string | null) {
if (score === '✅') return 'rgba(90,122,74,0.12)'
if (score === '⚠️') return 'rgba(196,164,114,0.15)'
if (score === '❌') return 'rgba(168,93,62,0.12)'
return 'var(--nav-bg-alt)'
}
function axeScoreText(score: string | null) {
if (score === '✅') return '#3d5534'
if (score === '⚠️') return '#7a5f2a'
if (score === '❌') return '#7a3322'
return 'var(--nav-text-muted)'
}
const SECTEUR_LABELS: Record<string, string> = {
'renovation': 'Rénovation', 'construction-neuve': 'Neuf', 'urbanisme': 'Urbanisme',
'architecture-interieure': 'Archi intérieure', 'paysage': 'Paysage',
'mar-conseil': 'MAR/Conseil', 'transversal': 'Transversal',
}
const COUT_LABELS: Record<string, string> = {
'gratuit': 'Gratuit', 'freemium': 'Freemium', 'abonnement': 'Abonnement',
'lead-paye': 'Lead payant', 'commission': 'Commission',
}
</script>
<style scoped>
.taff-card {
width: 100%;
text-align: left;
border-radius: 12px;
border: 1px solid var(--nav-bg-alt);
border-left: 4px solid;
background: var(--nav-surface);
display: flex;
flex-direction: column;
transition: box-shadow 0.2s;
cursor: pointer;
}
.taff-card:hover { box-shadow: 0 4px 16px rgba(26,34,56,0.1); }
.taff-card:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: 2px; }
.taff-card-top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
padding: 1rem 1rem 0.5rem;
}
.taff-tag {
display: inline-flex;
align-items: center;
gap: 0.25rem;
padding: 0.25rem 0.625rem;
border-radius: 9999px;
font-size: 0.75rem;
font-weight: 700;
}
.taff-badge-ao {
display: inline-flex;
padding: 0.25rem 0.5rem;
border-radius: 9999px;
font-size: 0.6875rem;
font-weight: 500;
background: var(--nav-bg-alt);
color: var(--nav-text-muted);
}
.taff-visit-btn {
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0.375rem 0.75rem;
border-radius: 8px;
font-size: 0.75rem;
font-weight: 500;
background: var(--nav-bg-alt);
color: var(--nav-text);
white-space: nowrap;
flex-shrink: 0;
transition: opacity 0.15s;
}
.taff-visit-btn:hover { opacity: 0.7; }
.taff-card-name {
padding: 0.25rem 1rem 0.75rem;
font-size: 1.0625rem;
font-weight: 700;
color: var(--nav-text);
line-height: 1.3;
}
.taff-card-axes {
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0 1rem 0.875rem;
flex-wrap: wrap;
}
.taff-axe-chip {
display: inline-flex;
align-items: center;
gap: 0.25rem;
padding: 0.25rem 0.625rem;
border-radius: 9999px;
font-size: 0.8125rem;
font-weight: 600;
}
.taff-card-desc {
padding: 0 1rem 1rem;
font-size: 0.875rem;
line-height: 1.65;
color: var(--nav-text-muted);
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
flex: 1;
}
.taff-card-footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
padding: 0.75rem 1rem;
border-top: 1px solid var(--nav-bg-alt);
flex-wrap: wrap;
}
.taff-secteur-chip {
display: inline-block;
padding: 0.2rem 0.5rem;
border-radius: 9999px;
font-size: 0.75rem;
background: var(--nav-bg);
color: var(--nav-text-muted);
border: 1px solid var(--nav-bg-alt);
}
.taff-more {
font-size: 0.75rem;
color: var(--nav-text-muted);
}
.taff-cout {
font-size: 0.75rem;
font-weight: 600;
color: var(--nav-text-muted);
white-space: nowrap;
}
</style>
+156
View File
@@ -0,0 +1,156 @@
<template>
<component
:is="url ? 'a' : 'div'"
v-bind="url ? { href: url, target: '_blank', rel: 'noopener noreferrer' } : {}"
class="simu-feature"
:class="{ 'simu-feature--link': !!url }"
>
<div class="simu-feature__inner">
<div class="simu-feature__left">
<span class="simu-feature__icon" aria-hidden="true">{{ icon }}</span>
<div class="simu-feature__body">
<div class="simu-feature__header">
<h3 class="simu-feature__titre">{{ titre }}</h3>
<span v-if="tag" :class="['simu-feature__badge', `simu-feature__badge--${tag}`]">{{ tagLabel }}</span>
</div>
<p class="simu-feature__desc">{{ description }}</p>
</div>
</div>
<span v-if="cta && url" class="simu-feature__cta">{{ cta }}</span>
</div>
</component>
</template>
<script setup lang="ts">
const props = defineProps<{
icon?: string
titre: string
url?: string | null
description?: string
cta?: string
tag?: string
}>()
const tagLabels: Record<string, string> = {
'outil-aep': 'Outil AEP',
'inspiration-externe': 'Inspiration externe',
'disponible': 'Disponible',
'recommande': 'Recommandé',
'a-venir': 'À venir',
}
const tagLabel = computed(() => props.tag ? (tagLabels[props.tag] ?? props.tag) : '')
</script>
<style scoped>
.simu-feature {
display: block;
padding: 1.5rem 1.75rem;
border-radius: 14px;
border: 1.5px solid var(--nav-bg-alt);
background: var(--nav-surface);
text-decoration: none;
color: var(--nav-text);
transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}
.simu-feature--link:hover {
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
border-color: var(--nav-primary-solid);
transform: translateY(-2px);
}
.simu-feature__inner {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1.5rem;
flex-wrap: wrap;
}
.simu-feature__left {
display: flex;
align-items: flex-start;
gap: 1rem;
flex: 1;
min-width: 0;
}
.simu-feature__icon {
font-size: 2rem;
line-height: 1;
flex-shrink: 0;
margin-top: 2px;
}
.simu-feature__body {
flex: 1;
min-width: 0;
}
.simu-feature__header {
display: flex;
align-items: center;
gap: 0.75rem;
flex-wrap: wrap;
margin-bottom: 0.4rem;
}
.simu-feature__titre {
font-size: 1.05rem;
font-weight: 700;
color: var(--nav-text);
margin: 0;
line-height: 1.3;
}
.simu-feature__badge {
font-size: 0.65rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
padding: 2px 8px;
border-radius: 999px;
background: #d1fae5;
color: #065f46;
}
.simu-feature__badge--inspiration-externe {
background: #fef3c7;
color: #92400e;
}
.simu-feature__desc {
font-size: 0.88rem;
color: var(--nav-text-muted);
margin: 0;
line-height: 1.55;
}
.simu-feature__cta {
display: inline-flex;
align-items: center;
padding: 0.6rem 1.25rem;
background: var(--nav-primary-solid);
color: var(--nav-text-on-primary);
border-radius: 8px;
font-size: 0.85rem;
font-weight: 600;
white-space: nowrap;
transition: opacity 0.15s;
flex-shrink: 0;
}
.simu-feature--link:hover .simu-feature__cta {
opacity: 0.88;
}
:global(.dark) .simu-feature__badge {
background: #064e3b;
color: #a7f3d0;
}
:global(.dark) .simu-feature__badge--inspiration-externe {
background: #78350f;
color: #fde68a;
}
</style>
-11
View File
@@ -1,11 +0,0 @@
<template>
<span
class="inline-block px-2 py-0.5 rounded-full text-xs font-medium bg-sage-100 text-sage-700 border border-sage-200 cursor-pointer hover:bg-sage-200 transition-colors"
@click.prevent="$emit('click', tag)"
>{{ tag }}</span>
</template>
<script setup lang="ts">
defineProps<{ tag: string }>()
defineEmits<{ click: [tag: string] }>()
</script>
+201
View File
@@ -0,0 +1,201 @@
<template>
<ul class="tree-ascii" :class="{ 'tree-ascii--root': depth === 0 }" :style="{ '--depth': depth }">
<li
v-for="(node, i) in tree.children"
:key="i"
class="tree-ascii__node"
>
<!-- Nœud avec enfants : bouton toggle -->
<template v-if="node.children && node.children.length">
<button
class="tree-ascii__branch"
:aria-expanded="!!open[i]"
@click="toggle(i)"
>
<span class="tree-ascii__chevron" aria-hidden="true">{{ open[i] ? '▼' : '▶' }}</span>
<span class="tree-ascii__label">{{ node.name }}</span>
<span class="tree-ascii__count">({{ node.children.length }})</span>
</button>
<TreeASCII
v-if="open[i]"
:tree="node"
:depth="depth + 1"
/>
</template>
<!-- Feuille avec URL : lien cliquable -->
<template v-else-if="node.url">
<a
:href="node.url"
target="_blank"
rel="noopener noreferrer"
class="tree-ascii__leaf tree-ascii__leaf--link"
>
<span class="tree-ascii__prefix" aria-hidden="true">└─</span>
<span class="tree-ascii__label">{{ node.name }}</span>
<span v-if="node.desc" class="tree-ascii__desc"> — {{ node.desc }}</span>
<svg class="tree-ascii__ext" width="10" height="10" 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>
</a>
</template>
<!-- Feuille sans URL -->
<template v-else>
<span class="tree-ascii__leaf">
<span class="tree-ascii__prefix" aria-hidden="true">└─</span>
<span class="tree-ascii__label">{{ node.name }}</span>
<span v-if="node.desc" class="tree-ascii__desc"> — {{ node.desc }}</span>
</span>
</template>
</li>
</ul>
</template>
<script setup lang="ts">
export interface TreeNode {
name: string
url?: string
desc?: string
children?: TreeNode[]
}
export interface TreeData {
name?: string
children?: TreeNode[]
}
const props = withDefaults(defineProps<{
tree: TreeData
depth?: number
}>(), {
depth: 0
})
// Toutes les branches fermées par défaut
const open = ref<Record<number, boolean>>({})
function toggle(i: number) {
open.value[i] = !open.value[i]
}
</script>
<style scoped>
.tree-ascii {
list-style: none;
padding: 0;
margin: 0;
font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
font-size: 0.82rem;
padding-left: calc(var(--depth, 0) * 1.25rem + 0.5rem);
}
.tree-ascii--root {
padding-left: 0;
}
.tree-ascii__node {
margin: 2px 0;
line-height: 1.6;
}
/* Bouton branche (nœud avec enfants) */
.tree-ascii__branch {
display: inline-flex;
align-items: center;
gap: 0.35rem;
background: none;
border: none;
cursor: pointer;
padding: 2px 6px;
border-radius: 4px;
color: var(--nav-text);
font-family: inherit;
font-size: inherit;
font-weight: 600;
transition: background 0.1s, color 0.1s;
text-align: left;
}
.tree-ascii__branch:hover {
background: var(--nav-bg-alt);
color: var(--nav-primary-solid);
}
.tree-ascii__chevron {
font-size: 0.65rem;
color: var(--nav-text-muted);
width: 12px;
text-align: center;
flex-shrink: 0;
}
.tree-ascii__count {
font-size: 0.7rem;
color: var(--nav-text-muted);
font-weight: 400;
}
/* Feuille */
.tree-ascii__leaf {
display: inline-flex;
align-items: baseline;
gap: 0.25rem;
padding: 1px 6px;
border-radius: 4px;
text-decoration: none;
color: var(--nav-text-muted);
}
.tree-ascii__leaf--link {
color: var(--nav-text);
cursor: pointer;
transition: background 0.1s, color 0.1s;
}
.tree-ascii__leaf--link:hover {
background: var(--nav-bg-alt);
color: var(--nav-primary-solid);
text-decoration: underline;
}
.tree-ascii__prefix {
color: var(--nav-text-muted);
opacity: 0.5;
font-size: 0.75rem;
flex-shrink: 0;
}
.tree-ascii__label {
font-weight: 500;
}
.tree-ascii__leaf--link .tree-ascii__label {
font-weight: 400;
}
.tree-ascii__desc {
color: var(--nav-text-muted);
font-size: 0.78rem;
font-style: italic;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 60ch;
}
.tree-ascii__ext {
opacity: 0.4;
flex-shrink: 0;
margin-left: 2px;
vertical-align: middle;
}
@media (max-width: 640px) {
.tree-ascii__desc {
display: none;
}
}
</style>
File diff suppressed because it is too large Load Diff
+118
View File
@@ -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>
+87 -22
View File
@@ -37,9 +37,11 @@ const props = withDefaults(defineProps<{
fiches: CodevFiche[]
matches?: CodevMatch[]
mode?: 'none' | 'solution' | 'alliance' | 'surprise'
showLabels?: boolean
}>(), {
matches: () => [],
mode: 'none',
showLabels: false,
})
const emit = defineEmits<{
@@ -146,18 +148,15 @@ function rebuildLinks() {
currentLinks = buildLinks(currentNodes)
if (!gLinks || !simulation) return
const linkSel = gLinks
// .join() moderne D3 pour garantir le re-rendu complet
gLinks
.selectAll<SVGLineElement, SimLink>('line')
.data(currentLinks, (d: SimLink) => {
const s = d.source as SimNode
const t = d.target as SimNode
return `${s.id}-${t.id}-${d.mode}`
})
linkSel.exit().remove()
linkSel.enter()
.append('line')
.data(currentLinks)
.join(
enter => enter.append('line'),
update => update,
exit => exit.remove()
)
.attr('stroke', d => linkColor(d.mode))
.attr('stroke-width', d => 1 + d.score * 3)
.attr('stroke-opacity', 0.7)
@@ -223,12 +222,12 @@ function render() {
.attr('stroke', '#fff')
.attr('stroke-width', 1.5)
// Pastille besoin (bas-droite, orange)
// Pastille besoin (bas-droite, bleu)
nodeGroups.append('circle')
.attr('r', 6)
.attr('cx', r * 0.65)
.attr('cy', r * 0.65)
.attr('fill', '#f97316')
.attr('fill', '#3b82f6')
.attr('stroke', '#fff')
.attr('stroke-width', 1.5)
@@ -236,6 +235,57 @@ function render() {
nodeGroups.append('title')
.text(d => `${d.nom}\nOffre : ${d.offre}\nBesoin : ${d.besoin}`)
// Groupe label bulle (affiche si showLabels)
const labelGroups = nodeGroups.append('g')
.attr('class', 'label-bubble')
.attr('visibility', props.showLabels ? 'visible' : 'hidden')
// Fond bulle besoin (dessous du noeud)
labelGroups.append('rect')
.attr('class', 'bubble-besoin-bg')
.attr('x', -(r + 50))
.attr('y', r + 4)
.attr('width', 100)
.attr('height', 28)
.attr('rx', 6)
.attr('fill', '#eff6ff')
.attr('stroke', '#3b82f6')
.attr('stroke-width', 1)
// Texte besoin
labelGroups.append('text')
.attr('class', 'bubble-besoin-txt')
.attr('x', -(r) + 50)
.attr('y', r + 22)
.attr('text-anchor', 'middle')
.attr('font-size', 9)
.attr('fill', '#1e40af')
.attr('pointer-events', 'none')
.text(d => truncate(d.besoin, 18))
// Fond bulle offre (dessus du noeud)
labelGroups.append('rect')
.attr('class', 'bubble-offre-bg')
.attr('x', -(r + 50))
.attr('y', -(r + 32))
.attr('width', 100)
.attr('height', 28)
.attr('rx', 6)
.attr('fill', '#f0fdf4')
.attr('stroke', '#22c55e')
.attr('stroke-width', 1)
// Texte offre
labelGroups.append('text')
.attr('class', 'bubble-offre-txt')
.attr('x', -(r) + 50)
.attr('y', -(r + 14))
.attr('text-anchor', 'middle')
.attr('font-size', 9)
.attr('fill', '#166534')
.attr('pointer-events', 'none')
.text(d => truncate(d.offre, 18))
// Simulation
simulation = d3.forceSimulation<SimNode, SimLink>(currentNodes)
.force('link', d3.forceLink<SimNode, SimLink>(currentLinks)
@@ -245,6 +295,8 @@ function render() {
.force('charge', d3.forceManyBody<SimNode>().strength(-400))
.force('center', d3.forceCenter(width.value / 2, height.value / 2))
.force('collide', d3.forceCollide<SimNode>().radius(r + 12))
.force('x', d3.forceX(width.value / 2).strength(0.05))
.force('y', d3.forceY(height.value / 2).strength(0.05))
.alphaDecay(0.02)
.on('tick', tick)
@@ -254,16 +306,21 @@ function render() {
}
function tick() {
const r = nodeRadius.value
if (!gLinks || !gNodes) return
gLinks.selectAll<SVGLineElement, SimLink>('line')
.attr('x1', d => (d.source as SimNode).x ?? 0)
.attr('y1', d => (d.source as SimNode).y ?? 0)
.attr('x2', d => (d.target as SimNode).x ?? 0)
.attr('y2', d => (d.target as SimNode).y ?? 0)
.attr('x1', d => Math.max(r, Math.min(width.value - r, (d.source as SimNode).x ?? 0)))
.attr('y1', d => Math.max(r, Math.min(height.value - r, (d.source as SimNode).y ?? 0)))
.attr('x2', d => Math.max(r, Math.min(width.value - r, (d.target as SimNode).x ?? 0)))
.attr('y2', d => Math.max(r, Math.min(height.value - r, (d.target as SimNode).y ?? 0)))
gNodes.selectAll<SVGGElement, SimNode>('g.node')
.attr('transform', d => `translate(${d.x ?? 0},${d.y ?? 0})`)
.attr('transform', d => {
const x = Math.max(r, Math.min(width.value - r, d.x ?? 0))
const y = Math.max(r, Math.min(height.value - r, d.y ?? 0))
return `translate(${x},${y})`
})
}
// ── Watch matches/mode (hook pour M4) ─────────────────────────────────────
@@ -271,13 +328,21 @@ function tick() {
watch(() => [props.matches, props.mode] as const, () => {
if (!simulation) return
rebuildLinks()
simulation.force('link', d3.forceLink<SimNode, SimLink>(currentLinks)
.id(d => d.id)
const newForce = d3.forceLink<SimNode, SimLink>(currentLinks)
.id(d => String(d.id))
.distance(120)
.strength(0.3))
simulation.alpha(0.5).restart()
.strength(0.5)
simulation.force('link', newForce)
simulation.alpha(0.8).restart()
}, { deep: true })
// ── Watch showLabels ──────────────────────────────────────────────────────
watch(() => props.showLabels, (val) => {
if (!svgEl.value) return
d3.select(svgEl.value).selectAll('.label-bubble').attr('visibility', val ? 'visible' : 'hidden')
})
// ── Watch fiches (re-render si nouvelles fiches) ───────────────────────────
watch(() => props.fiches, () => {
+49
View File
@@ -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>
+207
View File
@@ -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>
+43
View File
@@ -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>
+344
View File
@@ -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>
+94
View File
@@ -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>
+71
View File
@@ -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>
+66
View File
@@ -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>
+10
View File
@@ -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>
+371
View File
@@ -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>
+10
View File
@@ -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>
+40
View File
@@ -0,0 +1,40 @@
<template>
<!-- « Une session d'entraide : la recette », la slide 10 du deck e-codev du 23/10 (v5, Estelle), posée par Jules
sur la page codev à la place d'un mot d'accueil (B26). La barre est celle de la page /codev d'aep
(components/codev/RecetteBarre.vue, commit B) : une seule source pour le dessin. « Entre deux et cinq
personnes » au lieu de « deux à six » (Jules, 23/10) : six quarts d'heure ne tiennent pas dans 1 h 20.
Les trois encadrés de la slide deviennent une liste, sans petits titres en capitales. -->
<div class="recette">
<h3 class="evt-h3 recette__titre">Une session d'entraide : la recette</h3>
<p class="recette__sous">
Deux heures, entre deux et cinq personnes, en visio ou autour d'une table. À adapter, à mettre à votre sauce.
</p>
<CodevRecetteBarre />
<dl class="recette__liste">
<div>
<dt>Ce qui fait tenir</dt>
<dd>Un groupe de dix ami·es, quatre ou cinq présent·es à chaque fois : la bonne taille pour se suivre et que chacun·e ait son quart d'heure.</dd>
</div>
<div>
<dt>La première fois</dt>
<dd>Chacun·e présente son projet, 10 à 15 minutes, avant toute entraide. Et la prochaine date se fixe avant de se quitter.</dd>
</div>
<div>
<dt>Ce que ça demande</dt>
<dd>Écouter sans conseiller trop vite, tenir le temps, faire circuler la parole. Ça s'apprend ; on peut vous y accompagner.</dd>
</div>
</dl>
</div>
</template>
<style scoped>
.recette { margin: var(--space-xl) 0 var(--space-lg); }
.recette__titre { font-size: clamp(1.25rem, 4.4vw, 1.5rem); margin-bottom: var(--space-2xs); }
.recette__sous { color: var(--evt-attenue); }
.recette__liste { display: grid; gap: var(--space-md); margin: 0; }
.recette__liste dt { font-family: var(--evt-titre); font-weight: 600; font-size: 1.05rem; color: var(--evt-ocre); }
.recette__liste dd { margin: 2px 0 0; }
@media (min-width: 720px) {
.recette__liste { grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
}
</style>
+77
View File
@@ -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>
+71
View File
@@ -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>
+240
View File
@@ -0,0 +1,240 @@
.proposer-form {
display: flex;
flex-direction: column;
gap: 1.25rem;
}
.field-group {
display: flex;
flex-direction: column;
gap: 0.375rem;
}
.field-group label,
.field-group legend {
font-size: 0.875rem;
font-weight: 600;
color: var(--nav-text);
display: block;
}
.field-group fieldset {
border: none;
padding: 0;
margin: 0;
}
.required { color: #c0392b; }
.label-hint {
font-weight: 400;
color: var(--nav-text-muted);
font-size: 0.8rem;
margin-left: 0.25rem;
}
.field-group input[type="text"],
.field-group input[type="url"],
.field-group input[type="email"],
.field-group textarea {
width: 100%;
padding: 0.625rem 0.875rem;
border: 1px solid rgba(26, 34, 56, 0.2);
border-radius: 8px;
font-size: 0.9rem;
color: var(--nav-text);
background: var(--nav-surface);
font-family: inherit;
transition: border-color 0.15s, box-shadow 0.15s;
box-sizing: border-box;
}
.field-group input:focus,
.field-group textarea:focus {
outline: none;
border-color: var(--nav-primary-solid);
box-shadow: 0 0 0 2px rgba(245, 179, 66, 0.4);
}
.field-group textarea {
resize: vertical;
min-height: 100px;
}
.field-error input,
.field-error textarea {
border-color: #c0392b !important;
}
.error-msg {
font-size: 0.8rem;
color: #c0392b;
}
.field-meta {
display: flex;
justify-content: flex-end;
}
.char-count {
font-size: 0.75rem;
color: var(--nav-text-muted);
}
.char-warn {
color: #e67e22;
}
.radio-group {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-top: 0.375rem;
}
.radio-label {
display: inline-flex;
align-items: center;
gap: 0.375rem;
padding: 0.375rem 0.75rem;
border: 1px solid rgba(26, 34, 56, 0.2);
border-radius: 6px;
font-size: 0.85rem;
color: var(--nav-text);
background: var(--nav-surface);
cursor: pointer;
transition: all 0.15s;
user-select: none;
}
.radio-label input[type="radio"] {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.radio-label:hover {
border-color: var(--nav-primary-solid);
background: var(--nav-bg-alt);
}
.radio-label.active {
background: var(--nav-primary);
border-color: transparent;
color: var(--nav-text-on-primary);
}
.checkbox-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.5rem;
margin-top: 0.375rem;
}
@media (max-width: 400px) {
.checkbox-grid { grid-template-columns: 1fr; }
}
.checkbox-label {
display: inline-flex;
align-items: center;
gap: 0.375rem;
padding: 0.375rem 0.75rem;
border: 1px solid rgba(26, 34, 56, 0.2);
border-radius: 6px;
font-size: 0.85rem;
color: var(--nav-text);
background: var(--nav-surface);
cursor: pointer;
transition: all 0.15s;
user-select: none;
position: relative;
}
.checkbox-label input[type="checkbox"] {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.checkbox-label:hover:not(.disabled) {
border-color: var(--nav-primary-solid);
background: var(--nav-bg-alt);
}
.checkbox-label.active {
background: var(--nav-primary);
border-color: transparent;
color: var(--nav-text-on-primary);
}
.checkbox-label.disabled {
opacity: 0.4;
cursor: not-allowed;
}
.fn-order {
display: inline-flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
background: var(--nav-accent);
color: var(--nav-text);
border-radius: 50%;
font-size: 0.7rem;
font-weight: 700;
flex-shrink: 0;
}
.server-error {
padding: 0.875rem 1rem;
background: #fdf0ee;
border: 1px solid #e74c3c;
border-radius: 8px;
font-size: 0.875rem;
color: #c0392b;
}
.form-actions {
display: flex;
gap: 0.75rem;
justify-content: flex-end;
margin-top: 0.5rem;
}
.btn-primary {
padding: 0.75rem 1.5rem;
background: var(--nav-primary);
color: var(--nav-text-on-primary);
border: none;
border-radius: 8px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
font-family: inherit;
transition: background 0.15s, opacity 0.15s;
}
.btn-primary:hover:not(:disabled) {
background: rgba(26, 34, 56, 0.75);
}
.btn-primary:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.form-note {
font-size: 0.75rem;
color: var(--nav-text-muted);
text-align: center;
margin: 0;
}
@media (max-width: 480px) {
.form-actions { flex-direction: column-reverse; }
.btn-primary { width: 100%; justify-content: center; }
}
+22
View File
@@ -0,0 +1,22 @@
// Fond de carte commun aux cartes Leaflet.
// CARTO exige une clé depuis le 23/09/2026 (sans clé : filigrane « API KEY REQUIRED »).
// Clé fournie au runtime par NUXT_PUBLIC_CARTO_KEY ; sans clé, repli sur le Plan IGN (Géoplateforme, sans clé).
const IGN_URL = 'https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0'
+ '&LAYER=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2&STYLE=normal&TILEMATRIXSET=PM_0_19&FORMAT=image/png'
+ '&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}'
export function useBaseTiles() {
const key = useRuntimeConfig().public.cartoKey as string
function url(dark: boolean) {
if (!key) return IGN_URL
const style = dark ? 'dark_all' : 'light_all'
return `https://{s}.basemaps.cartocdn.com/${style}/{z}/{x}/{y}{r}.png?key=${encodeURIComponent(key)}`
}
const attribution = key
? '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>'
: '© <a href="https://www.ign.fr/">IGN</a> – Géoplateforme'
return { url, attribution }
}
+34
View File
@@ -0,0 +1,34 @@
import { canoniqueEvenement, estHoteEvenement, lienEvenement, SITE_EVENT } from '~/utils/evenements'
/**
* Pages d'événement : sur quel hôte on est, comment écrire un lien, et la tête SEO.
* La canonique et le robots posés ici l'emportent sur ceux du plugin B23 (mêmes clés,
* mêmes valeurs) : Y part seul en prod, avant B23.
*/
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',
})
useHead({
link: [{ rel: 'canonical', href: canon }],
meta: surEvent ? [] : [{ name: 'robots', content: 'noindex, follow' }],
})
}
return { surEvent, lien, seo }
}
+139
View File
@@ -0,0 +1,139 @@
/**
* useFicheAdapter — B3-M2, étendu en B11-M2
* Adaptateur léger Org | StructureV2 → MiniFiche, format commun consommé par
* 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'
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'
/** É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). */
function firstSentence(text: string): string {
const match = text.match(/^.*?[.!?](?=\s|$)/)
return (match ? match[0] : text).trim()
}
/** Tronque proprement sur un mot, jamais au milieu. */
function truncateOnWord(text: string, max = RESUME_MAX): string {
if (text.length <= max) return text
const slice = text.slice(0, max)
const lastSpace = slice.lastIndexOf(' ')
const cut = lastSpace > max * 0.4 ? slice.slice(0, lastSpace) : slice
return `${cut.trimEnd()}…`
}
function buildResume(candidates: Array<string | null | undefined>): string {
const source = candidates.find((c) => !!c && c.trim().length > 0)
if (!source) return ''
return truncateOnWord(firstSentence(source.trim()))
}
function isStructure(source: Org | StructureV2): source is StructureV2 {
return 'famille_principale' in source
}
function orgFonctions(org: Org): string[] {
return (org.tags_fonction ?? '')
.split(',')
.map((f) => f.trim())
.filter(Boolean)
}
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,
nom: source.nom,
resume: buildResume([source.description_courte, source.description_longue]),
chips: hashtags.slice(0, 3),
chipsDimension: 'tags',
geoloc: source.latitude != null && source.longitude != null,
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(' '),
}
}
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,
}
}
export function useFicheAdapter() {
return { toMini }
}
+36
View File
@@ -0,0 +1,36 @@
/**
* Convertit du Markdown Mistral en HTML avec inline styles.
* Inline styles = zéro dépendance CSS, fonctionne dans tout contexte Vue (scoped, v-html, etc.)
*/
export function useMarkdown() {
const S = {
p: 'style="margin:0 0 0.45em;line-height:1.6;"',
strong: 'style="font-weight:700;"',
em: 'style="font-style:italic;"',
h2: 'style="font-weight:700;display:block;margin-bottom:0.2em;"',
h3: 'style="font-weight:700;display:block;font-size:0.95em;margin-bottom:0.15em;"',
ul: 'style="margin:0.3em 0 0.3em 1.2em;padding:0;list-style:disc;"',
li: 'style="margin-bottom:0.15em;"',
a: 'style="text-decoration:underline;opacity:0.85;"',
}
function render(text: string): string {
if (!text) return ''
let html = text
.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
.replace(/^### (.+)$/gm, `<strong ${S.h3}>$1</strong>`)
.replace(/^## (.+)$/gm, `<strong ${S.h2}>$1</strong>`)
.replace(/^# (.+)$/gm, `<strong ${S.h2}>$1</strong>`)
.replace(/\*\*(.+?)\*\*/g, `<strong ${S.strong}>$1</strong>`)
.replace(/\*(.+?)\*/g, `<em ${S.em}>$1</em>`)
.replace(/^[-•]\s+(.+)$/gm, `<li ${S.li}>$1</li>`)
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, `<a href="$2" target="_blank" rel="noopener" ${S.a}>$1</a>`)
html = html.replace(/(<li[^>]*>.*<\/li>\n?)+/g, m => `<ul ${S.ul}>${m}</ul>`)
html = html.replace(/\n{2,}/g, `</p><p ${S.p}>`)
html = html.replace(/\n/g, '<br>')
return `<p ${S.p}>${html}</p>`
}
return { render }
}
+252
View File
@@ -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>
+50
View File
@@ -0,0 +1,50 @@
/**
* 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)',
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
+90
View File
@@ -0,0 +1,90 @@
# Déploiement aep-worker (B5-M2)
Ce dossier n'a **rien été exécuté ni copié sur le VPS** par la session B5 — code
seulement, comme demandé. Étapes exactes pour la session qui déploiera.
## 0. Pré-requis avant de commencer
- [ ] **Backup NocoDB < 24 h** avant le premier passage du worker (il écrit en base).
- [ ] Vérifier que `/opt/aep/.env` contient déjà : `NOCODB_URL`, `NOCODB_TOKEN`,
`NOCODB_BASE`, `NOCODB_TABLE_ORGAS`, `NOCODB_TABLE_STATS`, `BIFROST_URL`,
`BIFROST_VK`, `NTFY_TOPIC` (et optionnellement `WORKER_MODEL`,
`WORKER_LIMIT`, `BUDGET_MAX_EUR`). Ne PAS créer de nouveau fichier .env —
celui-ci existe déjà en prod (mission dit de le lire, pas de le chercher
dans ce repo).
- [ ] Confirmer que `/opt/nav-carte` (l'ancien worker) est bien absent — il l'était
au 27/09 selon B0. Sinon, l'arrêter/purger avant d'activer celui-ci pour
éviter un double traitement des mêmes fiches pending.
## 1. Copier le code
```bash
ssh vps
mkdir -p /opt/aep-worker
exit
# depuis le poste de dev, après avoir buildé/vérifié la branche :
scp -r worker/enrich.js worker/package.json worker/fixtures vps:/opt/aep-worker/
ssh vps "cd /opt/aep-worker && npm install --omit=dev"
```
(`npm install` : le worker n'a plus de dépendance à `dotenv` côté prod puisque
`EnvironmentFile=` du service systemd charge déjà `/opt/aep/.env` — le
`package.json` du worker peut être simplifié à cette occasion, ou laissé tel
quel si `dotenv` sert encore pour un lancement manuel en local.)
## 2. Poser les unités systemd
```bash
scp deploy/aep-worker/aep-worker.service deploy/aep-worker/aep-worker.timer \
vps:/tmp/
ssh vps
sudo mv /tmp/aep-worker.service /tmp/aep-worker.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now aep-worker.timer
```
## 3. Vérifier
```bash
systemctl status aep-worker.timer
systemctl list-timers | grep aep-worker
# Lancer un passage manuel (sans attendre les 15 min) :
sudo systemctl start aep-worker.service
journalctl -u aep-worker.service -n 100 --no-pager
```
Logs attendus : `=== Worker AEP enrichissement démarré ===`, un compte de
fiches pending, puis soit `Rien à traiter.` soit le détail par fiche
(scrape/Bifrost/ntfy).
## 4. Test bout-en-bout (M3, session suivante)
1. Soumettre une vraie ressource de test via `/proposer` (formulaire assoupli).
2. Vérifier le 201 + le record `pending`/`ai_processed=false` dans NocoDB.
3. Vérifier la notif ntfy de soumission (topic `NTFY_TOPIC`).
4. Lancer le worker (`systemctl start aep-worker.service` ou attendre le
timer) → vérifier `moderation_status=ai_processed`, `description_enrichie`,
`tags_fonction`, `ai_raw_output` remplis, et la notif ntfy « Fiche enrichie ».
5. Modérer dans NocoDB UI (`ai_processed` → `approved`) → vérifier l'affichage
sur le front.
6. **Supprimer les records de test** dans NocoDB (orgas + stats_usage) une
fois la preuve faite.
7. Mettre à jour `PIPE-IA-DOC.md`, `Onglets/Proposer.md`, `PILOTE - AEP.md`
dans le vault avec le résultat réel (pas seulement ce README).
## Anti-chevauchement
Lock fichier PID : `/tmp/aep-worker.lock` (configurable via `WORKER_LOCK_FILE`
dans `.env` si besoin). Nettoyé en fin de run normal, et automatiquement si le
PID contenu dans le lock n'est plus vivant (voir `acquireLock()` dans
`enrich.js`) — pas d'intervention manuelle attendue, sauf lock resté après un
crash dur du process (`kill -9` externe) : dans ce cas `rm /tmp/aep-worker.lock`
suffit.
## Écarts par rapport à la version NAV V2 (PIPE-IA-DOC.md)
Voir l'en-tête de commentaire de `worker/enrich.js` et `PIPE-IA-DOC.md` §11 —
LLM Bifrost au lieu de Mistral direct, scrape fetch natif au lieu de crawl4ai,
notification ntfy au lieu de Resend, écriture `nom`/`submission_type` par le
worker seulement quand le formulaire assoupli a laissé un placeholder.
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=AEP — Worker enrichissement IA (scrape léger + Bifrost)
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
WorkingDirectory=/opt/aep-worker
EnvironmentFile=/opt/aep/.env
ExecStart=/usr/bin/node enrich.js
TimeoutStartSec=300
+9
View File
@@ -0,0 +1,9 @@
[Unit]
Description=Timer 15 min — worker enrichissement IA AEP
[Timer]
OnCalendar=*:0/15
Persistent=true
[Install]
WantedBy=timers.target
+59
View File
@@ -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é).
+34 -6
View File
@@ -1,6 +1,26 @@
export default defineNuxtConfig({
modules: ['@nuxtjs/tailwindcss'],
css: ['~/assets/css/main.css'],
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' },
{ rel: 'icon', type: 'image/png', sizes: '16x16', href: '/favicon-16.png' },
{ rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' },
],
},
},
css: [
'@transformer/ui/tokens.css',
'@transformer/ui/theme/aep.css',
'~/assets/css/main.css',
'leaflet/dist/leaflet.css',
'leaflet.markercluster/dist/MarkerCluster.css',
'leaflet.markercluster/dist/MarkerCluster.Default.css',
],
runtimeConfig: {
nocodbUrl: process.env.NOCODB_URL,
@@ -11,12 +31,21 @@ export default defineNuxtConfig({
commentTableId: process.env.COMMENT_TABLE_ID || process.env.AVIS_TABLE_ID,
statsTableId: process.env.STATS_TABLE_ID || 'mbbq7n47ixy19mc',
mistralApiKey: process.env.MISTRAL_API_KEY,
bifrostUrl: process.env.BIFROST_URL || 'http://127.0.0.1:8080',
bifrostVk: process.env.BIFROST_VK,
redisUrl: process.env.REDIS_URL || 'redis://127.0.0.1:6379',
resendApiKey: process.env.RESEND_API_KEY,
emailJules: process.env.EMAIL_JULES || 'jules@trans-former.fr',
codevTableId: '', // NUXT_CODEV_TABLE_ID
codevPassword: 'merci', // NUXT_CODEV_PASSWORD - défaut "merci", overridable
codevBaseId: '', // NUXT_CODEV_BASE_ID - base NocoDB (ex: pipilvsi7dibo80)
codevTableId: '', // NUXT_CODEV_TABLE_ID
codevPassword: 'merci', // NUXT_CODEV_PASSWORD - défaut "merci", overridable
codevBaseId: '', // NUXT_CODEV_BASE_ID - base NocoDB (ex: pipilvsi7dibo80)
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
},
},
// Leaflet ne fonctionne pas en SSR — forcer le rendu côté client
@@ -24,9 +53,8 @@ export default defineNuxtConfig({
vite: {
optimizeDeps: {
include: ['leaflet', 'leaflet.markercluster'],
include: ['leaflet', 'leaflet.markercluster', 'd3'],
},
// Éviter l'import SSR de Leaflet qui utilise window
ssr: {
noExternal: [],
},
+6
View File
@@ -8,6 +8,7 @@
"hasInstallScript": true,
"dependencies": {
"@headlessui/vue": "^1.7.23",
"@transformer/ui": "git+https://git.trans-former.fr/jules/design-system.git",
"@types/leaflet": "^1.9.21",
"@types/leaflet.markercluster": "^1.5.6",
"d3": "^7.9.0",
@@ -3625,6 +3626,11 @@
"vue": "^2.7.0 || ^3.0.0"
}
},
"node_modules/@transformer/ui": {
"version": "0.1.0",
"resolved": "git+https://git.trans-former.fr/jules/design-system.git#057de406c804315e09d28fb26f10941d61e461b1",
"license": "UNLICENSED"
},
"node_modules/@tybys/wasm-util": {
"version": "0.10.1",
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
+1
View File
@@ -11,6 +11,7 @@
},
"dependencies": {
"@headlessui/vue": "^1.7.23",
"@transformer/ui": "git+https://git.trans-former.fr/jules/design-system.git",
"@types/leaflet": "^1.9.21",
"@types/leaflet.markercluster": "^1.5.6",
"d3": "^7.9.0",
+93 -74
View File
@@ -8,16 +8,12 @@
</NuxtLink>
<!-- ══════════════════════════════════════════════════════════
SECTION 1 - Mission AEP
SECTION INTRO - À propos d'AEP
══════════════════════════════════════════════════════════ -->
<!-- TODO Jules : Écrire le pitch (~100 mots) - qui est AEP, pour qui, pourquoi, quelle promesse -->
<section class="section-mission">
<h1>Architecture d'Écologie Politique</h1>
<h1>À propos d'AEP</h1>
<p class="mission-text">
L'architecture est l'une des professions les plus complexes qui soit ; elle croise droit, technique, esthétique, économie, social, écologie - tout à la fois, tout simultanément, souvent sans filet. Paradoxalement, c'est aussi l'une des moins structurées sur le plan de l'entraide : peu de transmission horizontale, beaucoup d'isolement, une culture du chacun-pour-soi héritée d'une formation qui prépare à la compétition plus qu'à la coopération. On sort de l'école seul.e. On s'installe seul.e. On réinvente ce que d'autres ont déjà traversé.
</p>
<p class="mission-text">
Cette carte est née de cette frustration - et de cette conviction : les ressources existent, les gens qui ont réussi à sortir la tête de l'eau aussi. L'enjeu, c'est de les documenter, de les rendre accessibles, de les ajuster en temps réel grâce aux retours de la communauté. Pas un catalogue figé ; un commun vivant, au service de ceux et celles qui cherchent à faire évoluer leur pratique vers quelque chose de plus épanouissant, mieux rémunéré, au service de la société - et qui prend soin de la santé, la nôtre et celle des gens pour qui nous construisons.
AEP — Architecture d'Écologie Politique — est un commun vivant : une infrastructure d'entraide, de ressources documentées et de cartographies au service d'une profession en mutation. Ce site rassemble les outils, l'écosystème d'entraide, les réseaux AEP, les plateformes de mise en relation, le codev, la bibliothèque des pensées écologiques et les projets, un manifeste, une transparence radicale sur l'IA et le financement, et une gouvernance partagée.
</p>
</section>
@@ -31,14 +27,6 @@
Ce site tourne sur un VPS - un serveur privé loué en Europe - construit entièrement avec des logiciels open source, quasi gratuits. Pas de services Google, pas d'Amazon, pas de Microsoft dans la chaîne. C'est un choix délibéré : contrôler son infrastructure, c'est contrôler ses données.
</p>
<div class="badges-row">
<div class="badge">
<span class="badge-icon" aria-hidden="true">
<!-- Mistral logo placeholder -->
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 8v4l3 3"/></svg>
</span>
<span class="badge-label">IA souveraine</span>
<span class="badge-detail">Mistral AI, Paris - conforme RGPD ; pas de collecte ni de profiling ; aucun transfert hors UE</span>
</div>
<div class="badge">
<span class="badge-icon" aria-hidden="true">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
@@ -107,22 +95,8 @@
L'IA est un outil. La question, c'est au service de quoi. Oui, elle est énergivore - et il faut l'assumer. Mais si c'est au service de l'émancipation, du collectif, de transformer nos infrastructures sociétales, alors on dit oui - en sachant que c'est une étape transitoire. L'infrastructure de l'IA elle-même peut évoluer : devenir plus locale, plus sobre, plus souveraine. C'est dans cette direction qu'on regarde.
</p>
<div class="ia-grid">
<div class="ia-card">
<div class="ia-card-label">Enrichissement des fiches</div>
<div class="ia-card-model">Mistral Nemo</div>
<div class="ia-card-cost">~0,00003 €/fiche</div>
</div>
<div class="ia-card">
<div class="ia-card-label">Chatbot de recherche</div>
<div class="ia-card-model">Mistral Small</div>
<div class="ia-card-cost">~0,003 €/requête</div>
</div>
</div>
<ul class="ia-details">
<li>10 € / mois investis au départ par le collectif - vos dons constituent la réserve pour faire vivre le projet et financer ses recherches</li>
<li>Coût visible en direct dans le bandeau bas de la carte</li>
</ul>
</section>
@@ -194,12 +168,44 @@
</a>
</section>
<!-- ══════════════════════════════════════════════════════════
SECTION 8 - API publique
══════════════════════════════════════════════════════════ -->
<section class="section section-opensource">
<h2>API publique</h2>
<p class="section-text">
Les données de ce site internet sont publiques, toutes consultables via API directe, pour que des agents IA, des développeurs, ou d'autres sites puissent interroger la base sans passer par l'interface graphique.
</p>
<p class="section-text">
<strong>Données accessibles :</strong> organisations d'entraide, pratiques d'architecture d'écologie politique (graphe complet + projets), plateformes d'emploi, RAG et ses auteurs, et toutes autres données à venir.
</p>
<div class="api-copy-box">
<code class="api-url">https://api.trans-former.fr</code>
<button class="btn-copy" @click="copyApiUrl">{{ copied ? 'Copié !' : 'Copier' }}</button>
</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>
<script setup lang="ts">
import { ref } from 'vue'
useHead({ title: 'À propos - AEP' })
const copied = ref(false)
function copyApiUrl() {
navigator.clipboard.writeText('https://api.trans-former.fr')
copied.value = true
setTimeout(() => { copied.value = false }, 2000)
}
</script>
<style scoped>
@@ -209,11 +215,14 @@ useHead({ title: 'À propos - AEP' })
min-height: 100vh;
background: var(--nav-bg);
padding: 1.5rem 1rem 5rem;
overflow-x: hidden;
width: 100%;
}
.apropos-inner {
max-width: 720px;
margin: 0 auto;
width: 100%;
}
/* ── Retour ──────────────────────────────────────────────────────────────────── */
@@ -267,6 +276,18 @@ useHead({ title: 'À propos - AEP' })
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;
@@ -322,13 +343,16 @@ useHead({ title: 'À propos - AEP' })
font-size: 0.875rem;
font-weight: 600;
color: var(--nav-text);
white-space: nowrap;
}
.badge-detail {
font-size: 0.775rem;
color: var(--nav-text-muted);
white-space: nowrap;
line-height: 1.4;
}
@media (min-width: 560px) {
.badge-label { white-space: nowrap; }
}
@media (max-width: 559px) {
@@ -370,49 +394,6 @@ useHead({ title: 'À propos - AEP' })
/* ── IA grid ─────────────────────────────────────────────────────────────────── */
.ia-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.75rem;
margin-bottom: 1rem;
}
@media (max-width: 480px) {
.ia-grid {
grid-template-columns: 1fr;
}
}
.ia-card {
background: var(--nav-surface);
border: 1px solid rgba(26, 34, 56, 0.1);
border-radius: 10px;
padding: 1rem 1.125rem;
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.ia-card-label {
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--nav-text-muted);
font-weight: 600;
}
.ia-card-model {
font-size: 1rem;
font-weight: 700;
color: var(--nav-text);
}
.ia-card-cost {
font-size: 0.825rem;
color: var(--nav-text-muted);
font-variant-numeric: tabular-nums;
}
.ia-details {
list-style: none;
padding: 0;
@@ -510,6 +491,44 @@ useHead({ title: 'À propos - AEP' })
background: var(--nav-bg-alt);
}
/* ── API copy box ────────────────────────────────────────────────────────────── */
.api-copy-box {
display: inline-flex;
align-items: center;
gap: 0.5rem;
margin-top: 1rem;
padding: 0.5rem 0.75rem;
background: var(--nav-surface);
border: 1px solid rgba(26, 34, 56, 0.2);
border-radius: 8px;
}
.api-url {
font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
font-size: 0.875rem;
color: var(--nav-primary-solid);
user-select: all;
}
.btn-copy {
padding: 0.375rem 0.75rem;
background: var(--nav-bg-alt);
border: 1px solid rgba(26, 34, 56, 0.15);
border-radius: 6px;
font-size: 0.75rem;
font-weight: 600;
cursor: pointer;
color: var(--nav-text);
transition: background 0.15s;
white-space: nowrap;
}
.btn-copy:hover {
background: var(--nav-primary-solid);
color: #fff;
}
/* ── Responsive général ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
+273 -31
View File
@@ -1,39 +1,281 @@
<template>
<div class="flex flex-col items-center justify-center h-full gap-6" style="background: var(--nav-bg);">
<div class="text-center max-w-md px-6">
<div
class="inline-flex items-center justify-center w-14 h-14 rounded-2xl mb-5"
style="background: var(--nav-bg-alt);"
>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="color: var(--nav-text-muted);">
<rect x="3" y="3" width="7" height="7"/>
<rect x="14" y="3" width="7" height="7"/>
<rect x="14" y="14" width="7" height="7"/>
<rect x="3" y="14" width="7" height="7"/>
</svg>
</div>
<h1 class="text-2xl font-bold mb-3" style="color: var(--nav-text);">Agences Inspirantes</h1>
<p class="text-sm leading-relaxed mb-6" style="color: var(--nav-text-muted);">
Cette section répertoriera les agences d'architecture qui incarnent une pratique engagée — écologie politique, auto-construction, architectures vernaculaires, sobriété.
<div class="relative h-full overflow-hidden" style="background: var(--nav-bg);">
<!-- 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"
>
<template #carte>
<!-- Métropole -->
<div v-show="vf.etat.sousVue === 'metropole'" class="relative flex-1 min-h-0">
<ClientOnly>
<NavMapV2
:structures="metropoleStructures"
:selectedId="selectedId"
: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>
</template>
</ClientOnly>
</div>
<!-- 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="[]" :selectedId="null" @select-org="() => {}" />
<template #fallback>
<div class="flex items-center justify-center h-48 text-sm" style="color: var(--nav-text-muted);">Chargement…</div>
</template>
</ClientOnly>
</div>
<!-- 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="vf.etat.sousVue === 'graphe' && vf.vueAffichee !== 'fiches'"
@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>
<!-- Chatbot sous la carte (ordinateur) -->
<div v-if="vf.etat.sousVue !== 'outremer'" class="hidden lg:block shrink-0">
<ChatbotPlaceholder
@highlightOrgs="() => {}"
@applyHashtag="(tag) => vf.ajouterFiltre('tags', sansDiese(tag))"
/>
</div>
</template>
<!-- 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 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-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"
>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
</svg>
<span>Chatbot</span>
</button>
<!-- ═══════════════════════════════════════ CHATBOT BOTTOM SHEET (mobile) -->
<ChatbotReseaux
:modelValue="chatbotOpen"
@update:modelValue="chatbotOpen = $event"
/>
<!-- ═══════════════════════════════════════ POP-UP MISSION RÉSEAUX AEP -->
<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"
>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="10"/>
<line x1="12" y1="16" x2="12" y2="12"/>
<line x1="12" y1="8" x2="12.01" y2="8"/>
</svg>
</button>
<MissionPopup
:modelValue="missionOpen"
@update:modelValue="missionOpen = $event"
title="Réseaux AEP — l'architecture qui s'engage"
ctaLabel="Explorer les 120 réseaux"
storageKey="aep_reseaux_seen"
echelle="M"
>
<p class="mission-text">
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 «&nbsp;vertes&nbsp;»&nbsp;: 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="text-xs font-semibold uppercase tracking-widest mb-6" style="color: var(--nav-text-muted); opacity: 0.6;">
Bientôt disponible
<p class="mission-text">
Six familles structurent la cartographie&nbsp;: militants, agences engagées, collectifs de production, ressources communes, recherche, formations alternatives. Filtre par hashtag, ouvre la fiche d'une structure, navigue le graphe («&nbsp;Vue graphique&nbsp;» dans le sélecteur de carte) pour voir les affinités. Si tu animes ou connais un réseau qui devrait y être&nbsp;: <NuxtLink to="/contribuer" @click.stop>propose-le</NuxtLink>.
</p>
<NuxtLink
to="/"
class="inline-flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-semibold transition-all hover:opacity-80"
style="background: var(--nav-primary); color: var(--nav-text-on-primary);"
>
<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="19" y1="12" x2="5" y2="12"/>
<polyline points="12 19 5 12 12 5"/>
</svg>
Retour à l'écosystème
</NuxtLink>
</div>
</MissionPopup>
</div>
</template>
<script setup lang="ts">
useHead({ title: 'Agences Inspirantes — AEP (bientôt disponible)' })
import type { ReseauxBifurcationData, StructureV2 } from '~/types/structure-v2'
import type { ConfigVueFiches, ValeurFiltre } from '~/utils/vueFiches'
import { sansDiese } from '~/composables/useFicheAdapter'
// ── Données V2 - JSON statique ─────────────────────────────────────────────
const bifurcationData = ref<ReseauxBifurcationData | null>(null)
const pending = ref(true)
onMounted(async () => {
try {
bifurcationData.value = await $fetch<ReseauxBifurcationData>('/data/reseaux-bifurcation.json')
} catch (e) {
console.error('Erreur chargement reseaux-bifurcation.json', e)
} finally {
pending.value = false
}
})
const structures = computed<StructureV2[]>(() => bifurcationData.value?.structures ?? [])
// 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()
})
// ── 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',
}
/** 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) }))
}
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' },
],
},
}))
const { toMini } = useFicheAdapter()
const fichesMini = computed(() => structures.value.map((s) => toMini(s)))
const vf = useVueFiches(fichesMini, config)
// 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 }
})
// ── 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_reseaux_seen')) missionOpen.value = true
} catch {}
})
// 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>
.reseaux-info-btn {
position: fixed;
bottom: 24px;
left: 16px;
z-index: 1000;
width: 36px;
height: 36px;
border-radius: 50%;
border: none;
background: var(--nav-surface);
color: var(--nav-text-muted);
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 12px rgba(26,34,56,0.18);
cursor: pointer;
transition: opacity 0.15s, transform 0.1s;
}
.reseaux-info-btn:hover { opacity: 0.85; transform: translateY(-1px); color: var(--nav-text); }
@media (min-width: 1024px) {
.reseaux-info-btn { bottom: 10px; left: auto; right: 52px; }
}
</style>
+225
View File
@@ -0,0 +1,225 @@
<template>
<div class="lock-page">
<div class="lock-inner">
<div class="lock-header">
<h1>Co-développement</h1>
<p class="lock-subtitle">Entraide entre pairs</p>
<EchelleTete echelle="M" compact :contribuer="false" class="lock-echelle" />
<p class="lock-intro">Cet espace est un cercle. Pour entrer, il y a un mot.</p>
</div>
<form class="lock-form" @submit.prevent="submit" novalidate>
<div class="field-group">
<input
id="password"
v-model="password"
type="password"
placeholder="Mot de passe"
autocomplete="current-password"
required
:disabled="loading"
class="lock-input"
/>
</div>
<div v-if="error" class="lock-error" role="alert">
{{ error }}
</div>
<button type="submit" class="lock-btn" :disabled="loading || !password">
{{ loading ? 'Vérification...' : 'Entrer' }}
</button>
</form>
<div class="lock-footer">
<NuxtLink to="/codev/demo" class="demo-link">Voir l'exemple &rarr;</NuxtLink>
</div>
</div>
</div>
</template>
<script setup lang="ts">
const password = ref('')
const error = ref('')
const loading = ref(false)
useHead({ title: 'Co-développement — Entraide entre pairs' })
async function submit() {
error.value = ''
loading.value = true
try {
await $fetch('/api/codev/auth', {
method: 'POST',
body: { password: password.value },
})
await navigateTo('/codev/fiche')
} catch (e: any) {
error.value = e?.statusMessage || 'Mauvais mot de passe'
} finally {
loading.value = false
}
}
</script>
<style scoped>
/* ── Layout ── */
.lock-page {
min-height: 100vh;
background: var(--nav-bg, #fafafa);
display: flex;
align-items: center;
justify-content: center;
padding: 1.5rem 1rem;
}
.lock-inner {
width: 100%;
max-width: 400px;
display: flex;
flex-direction: column;
gap: 2rem;
}
/* ── En-tête ── */
.lock-header {
text-align: center;
}
.lock-header h1 {
font-size: 1.75rem;
font-weight: 700;
color: var(--nav-text, #1a1a2e);
margin: 0 0 0.375rem;
}
.lock-subtitle {
font-size: 1rem;
color: var(--nav-text-muted, #6b7280);
margin: 0 0 1rem;
}
.lock-echelle {
text-align: left;
padding: var(--space-md);
border-radius: var(--radius-md);
background: var(--bg-alt);
}
.lock-intro {
font-size: 0.9rem;
color: var(--nav-text-muted, #6b7280);
line-height: 1.5;
margin: 0;
font-style: italic;
}
/* ── Formulaire ── */
.lock-form {
display: flex;
flex-direction: column;
gap: 0.875rem;
}
.field-group {
display: flex;
flex-direction: column;
}
.lock-input {
width: 100%;
padding: 0.875rem 1rem;
border: 1px solid var(--border-color, #d0d4dc);
border-radius: 8px;
font-size: 1rem;
color: var(--nav-text, #1a1a2e);
background: var(--nav-surface, #ffffff);
font-family: inherit;
text-align: center;
letter-spacing: 0.1em;
transition: border-color 0.15s, box-shadow 0.15s;
box-sizing: border-box;
}
.lock-input:focus {
outline: none;
border-color: var(--nav-primary-solid, #1B4436);
box-shadow: 0 0 0 2px rgba(27, 68, 54, 0.15);
}
.lock-input:disabled {
opacity: 0.6;
cursor: not-allowed;
}
/* ── Erreur ── */
.lock-error {
padding: 0.625rem 0.875rem;
background: #fdf0ee;
border: 1px solid #e74c3c;
border-radius: 8px;
font-size: 0.875rem;
color: #c0392b;
text-align: center;
}
/* ── Bouton ── */
.lock-btn {
width: 100%;
padding: 0.875rem 1rem;
background: var(--nav-primary-solid, #1B4436);
color: #ffffff;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
font-family: inherit;
transition: opacity 0.15s;
}
.lock-btn:hover:not(:disabled) {
opacity: 0.88;
}
.lock-btn:disabled {
opacity: 0.45;
cursor: not-allowed;
}
/* ── Pied de page ── */
.lock-footer {
text-align: center;
}
.demo-link {
font-size: 0.875rem;
color: var(--nav-text-muted, #6b7280);
text-decoration: none;
transition: color 0.15s;
}
.demo-link:hover {
color: var(--nav-primary-solid, #1B4436);
}
/* ── Responsive ── */
@media (max-width: 480px) {
.lock-page {
padding: 1.25rem 1rem 2.5rem;
align-items: flex-start;
padding-top: 3rem;
}
}
</style>
+338 -58
View File
@@ -9,68 +9,137 @@
{{ fiches.length }} fiche{{ fiches.length !== 1 ? 's' : '' }} - clique sur un nom pour voir le detail
</template>
</p>
<NuxtLink to="/codev/qr" class="qr-link" title="QR Code">[ QR ]</NuxtLink>
</header>
<ClientOnly>
<CodevGraph
:fiches="fiches"
:matches="matches"
:mode="mode"
@select-fiche="onSelectFiche"
/>
<template #fallback>
<div class="graph-fallback">Chargement du graphe...</div>
</template>
</ClientOnly>
<!-- Bandeau info mode actif -->
<div v-if="mode !== 'none'" class="mode-banner">
<span>
Mode {{ MODE_LABELS[mode] }} actif -
{{ matches.length }} connexion{{ matches.length !== 1 ? 's' : '' }} trouvee{{ matches.length !== 1 ? 's' : '' }}.
</span>
<button class="banner-clear" @click="setMode('none')" type="button">Effacer</button>
<div class="codev-tabs">
<button :class="{ active: tab === 'carto' }" @click="tab = 'carto'" type="button">Carto</button>
<button :class="{ active: tab === 'annuaire' }" @click="tab = 'annuaire'" type="button">Annuaire</button>
</div>
<!-- Boutons matching -->
<div class="matching-controls">
<button
:class="{ active: mode === 'solution' }"
style="--mode-color: #22c55e"
@click="setMode('solution')"
type="button"
>
Solution
<span class="hint">besoin - offre</span>
</button>
<button
:class="{ active: mode === 'alliance' }"
style="--mode-color: #f97316"
@click="setMode('alliance')"
type="button"
>
Alliance
<span class="hint">besoins partages</span>
</button>
<button
:class="{ active: mode === 'surprise' }"
style="--mode-color: #3b82f6"
@click="setMode('surprise')"
type="button"
>
Surprise
<span class="hint">offres partagees</span>
</button>
<button
v-if="mode !== 'none'"
class="reset"
@click="setMode('none')"
type="button"
>
Effacer
</button>
<div v-if="tab === 'carto'">
<div class="show-labels-bar">
<button
type="button"
:class="{ active: showLabels }"
@click="showLabels = !showLabels"
>
{{ showLabels ? 'Masquer besoins/offres' : 'Montrer besoins/offres' }}
</button>
</div>
<ClientOnly>
<CodevGraph
:fiches="fiches"
:matches="matches"
:mode="mode"
:show-labels="showLabels"
@select-fiche="onSelectFiche"
/>
<template #fallback>
<div class="graph-fallback">Chargement du graphe...</div>
</template>
</ClientOnly>
<!-- Bandeau info mode actif -->
<div v-if="mode !== 'none'" class="mode-banner">
<span>
Mode {{ MODE_LABELS[mode] }} actif -
{{ matches.length }} connexion{{ matches.length !== 1 ? 's' : '' }} trouvee{{ matches.length !== 1 ? 's' : '' }}.
</span>
<button class="banner-clear" @click="setMode('none')" type="button">Effacer</button>
</div>
<!-- Boutons matching -->
<div class="matching-controls">
<button
:class="{ active: mode === 'solution' }"
style="--mode-color: #22c55e"
@click="setMode('solution')"
type="button"
>
Solution
<span class="hint">besoin - compétence</span>
</button>
<button
:class="{ active: mode === 'alliance' }"
style="--mode-color: #f97316"
@click="setMode('alliance')"
type="button"
>
Alliance
<span class="hint">besoins partagés</span>
</button>
<button
v-if="mode !== 'none'"
class="reset"
@click="setMode('none')"
type="button"
>
Effacer
</button>
</div>
</div>
<div v-else-if="tab === 'annuaire'" class="annuaire-wrap">
<div v-if="fiches.length === 0" class="list-empty">
Aucune fiche. <NuxtLink to="/codev/fiche">Ajouter la mienne</NuxtLink>
</div>
<div v-else class="annuaire-scroll">
<table class="annuaire-table">
<thead>
<tr>
<th class="col-nom">Prénom</th>
<th class="col-besoin">Besoin</th>
<th class="col-offre">Ce que j'offre</th>
<th v-if="isAdmin" class="col-actions"></th>
</tr>
</thead>
<tbody>
<tr v-for="f in fiches" :key="f.id" @click="navigateTo(`/codev/fiche?id=${f.id}`)" class="annuaire-row">
<td class="col-nom">{{ f.nom }}</td>
<td class="col-besoin">{{ f.besoin }}</td>
<td class="col-offre">{{ f.offre }}</td>
<td v-if="isAdmin" class="col-actions">
<button @click.stop="deleteFiche(f.id)" class="delete-btn" type="button" title="Supprimer">✕</button>
</td>
</tr>
</tbody>
</table>
</div>
<p class="annuaire-hint">Clique sur une ligne pour modifier la fiche</p>
</div>
<!-- FAB ajouter une fiche -->
<NuxtLink to="/codev/fiche" class="fab-add" title="Ajouter ma fiche" aria-label="Ajouter une fiche">
+
</NuxtLink>
<Transition name="sheet">
<div v-if="selectedFiche" class="bottom-sheet" @click.self="selectedFiche = null">
<div class="sheet-content">
<div class="sheet-handle"></div>
<div class="sheet-name">{{ selectedFiche.nom }}</div>
<div class="sheet-section">
<span class="sheet-label">Besoin</span>
<p class="sheet-text">{{ selectedFiche.besoin }}</p>
</div>
<div class="sheet-section">
<span class="sheet-label">Ce que j'apporte</span>
<p class="sheet-text">{{ selectedFiche.offre }}</p>
</div>
<div class="sheet-tags" v-if="selectedFiche.hashtags.length">
<span v-for="t in selectedFiche.hashtags" :key="t" class="sheet-tag">#{{ t }}</span>
</div>
<NuxtLink :to="`/codev/fiche?id=${selectedFiche.id}`" class="sheet-edit-btn">Modifier cette fiche</NuxtLink>
<button class="sheet-close" @click="selectedFiche = null" type="button">Fermer</button>
</div>
</div>
</Transition>
</div>
</template>
@@ -80,11 +149,24 @@ import { computeMatches } from '~/utils/codev/matching'
useHead({ title: 'Carto - Co-developpement' })
const { data, pending } = await useFetch<{ list: CodevFiche[] }>('/api/codev/fiches')
const { data, pending, refresh } = await useFetch<{ list: CodevFiche[] }>('/api/codev/fiches')
const fiches = computed(() => data.value?.list ?? [])
const matches = ref<CodevMatch[]>([])
const mode = ref<'none' | 'solution' | 'alliance' | 'surprise'>('none')
const showLabels = ref(false)
const tab = ref<'carto' | 'annuaire'>('carto')
const selectedFiche = ref<CodevFiche | null>(null)
const isMobileView = typeof window !== 'undefined' ? window.innerWidth < 600 : false
const isAdmin = ref(false)
onMounted(async () => {
try {
const r = await $fetch<{ admin: boolean }>('/api/codev/me')
isAdmin.value = r.admin
} catch { isAdmin.value = false }
})
const MODE_LABELS: Record<string, string> = {
solution: 'Solution',
@@ -102,7 +184,17 @@ function setMode(newMode: 'none' | 'solution' | 'alliance' | 'surprise') {
}
function onSelectFiche(id: number) {
navigateTo(`/codev/fiche?id=${id}`)
if (isMobileView) {
selectedFiche.value = fiches.value.find(f => f.id === id) ?? null
} else {
navigateTo(`/codev/fiche?id=${id}`)
}
}
async function deleteFiche(id: number) {
if (!confirm('Supprimer la fiche ?')) return
await $fetch(`/api/codev/fiches/${id}`, { method: 'DELETE' })
await refresh()
}
</script>
@@ -256,6 +348,194 @@ function onSelectFiche(id: number) {
}
}
/* ── Toggle besoins/offres ── */
.show-labels-bar {
display: flex;
justify-content: center;
margin-bottom: 8px;
}
.show-labels-bar button {
border: 1px solid #d0d4dc;
border-radius: 8px;
padding: 8px 16px;
background: white;
font-size: 13px;
cursor: pointer;
color: #374151;
transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.show-labels-bar button.active {
background: #1B4436;
color: white;
border-color: transparent;
}
/* ── FAB ajouter ── */
.fab-add {
position: fixed;
bottom: 80px;
right: 16px;
width: 48px;
height: 48px;
border-radius: 50%;
background: #1B4436;
color: white;
font-size: 28px;
font-weight: 300;
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
z-index: 100;
transition: transform 0.15s, opacity 0.15s;
line-height: 1;
}
.fab-add:hover {
transform: scale(1.08);
opacity: 0.92;
}
/* ── Tabs ── */
.codev-tabs { display: flex; gap: 4px; background: #f3f4f6; border-radius: 10px; padding: 4px; }
.codev-tabs button { flex: 1; padding: 8px 4px; border: none; border-radius: 7px; background: transparent; font-size: 0.875rem; font-weight: 500; cursor: pointer; color: #6b7280; transition: all 0.15s; }
.codev-tabs button.active { background: white; color: #1a1a2e; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
/* ── List view ── */
.list-view { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.list-card { background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.list-card-name { font-weight: 700; font-size: 0.95rem; color: #1a1a2e; }
.list-card-text { font-size: 0.875rem; color: #4b5563; margin: 0; line-height: 1.5; }
.list-card-link { font-size: 0.8rem; color: #1B4436; text-decoration: none; align-self: flex-end; }
.list-empty { text-align: center; color: #6b7280; font-size: 0.9rem; }
/* ── Bottom sheet ── */
.bottom-sheet { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; display: flex; align-items: flex-end; }
.sheet-content { background: white; border-radius: 16px 16px 0 0; padding: 16px 20px 32px; width: 100%; display: flex; flex-direction: column; gap: 12px; max-height: 80vh; overflow-y: auto; }
.sheet-handle { width: 36px; height: 4px; background: #d1d5db; border-radius: 2px; align-self: center; margin-bottom: 4px; }
.sheet-name { font-size: 1.1rem; font-weight: 700; color: #1a1a2e; }
.sheet-section { display: flex; flex-direction: column; gap: 4px; }
.sheet-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; }
.sheet-text { font-size: 0.9rem; color: #374151; margin: 0; line-height: 1.5; }
.sheet-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-tag { font-size: 0.75rem; background: #f3f4f6; color: #374151; padding: 2px 8px; border-radius: 12px; }
.sheet-edit-btn { display: block; text-align: center; background: #1B4436; color: white; border-radius: 8px; padding: 12px; text-decoration: none; font-weight: 600; }
.sheet-close { background: transparent; border: 1px solid #d1d5db; border-radius: 8px; padding: 10px; color: #6b7280; cursor: pointer; font-size: 0.875rem; }
.sheet-enter-active, .sheet-leave-active { transition: opacity 0.2s; }
.sheet-enter-from, .sheet-leave-to { opacity: 0; }
/* ── QR link ── */
.qr-link {
font-size: 0.75rem;
color: #9ca3af;
text-decoration: none;
align-self: flex-end;
}
.qr-link:hover { color: #6b7280; }
/* ── Annuaire ── */
.annuaire-wrap {
display: flex;
flex-direction: column;
gap: 8px;
flex: 1;
}
.annuaire-scroll {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
border: 1px solid #e5e7eb;
border-radius: 10px;
}
.annuaire-table {
width: 100%;
border-collapse: collapse;
min-width: 480px;
}
.annuaire-table thead tr {
background: #f9fafb;
border-bottom: 2px solid #e5e7eb;
}
.annuaire-table th {
padding: 10px 14px;
text-align: left;
font-size: 0.75rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #6b7280;
white-space: nowrap;
}
.annuaire-table td {
padding: 12px 14px;
font-size: 0.875rem;
color: #374151;
vertical-align: top;
border-bottom: 1px solid #f3f4f6;
line-height: 1.5;
}
.annuaire-row {
cursor: pointer;
transition: background 0.12s;
}
.annuaire-row:hover { background: #f9fafb; }
.annuaire-row:last-child td { border-bottom: none; }
.col-nom {
position: sticky;
left: 0;
z-index: 2;
background: #ffffff;
font-weight: 600;
color: #1a1a2e !important;
white-space: nowrap;
min-width: 80px;
border-right: 2px solid #e5e7eb;
box-shadow: 2px 0 6px rgba(0,0,0,0.06);
}
.annuaire-row:hover .col-nom { background: #f9fafb; }
thead tr .col-nom { background: #f9fafb; z-index: 3; }
.col-besoin { min-width: 200px; max-width: 260px; }
.col-offre { min-width: 200px; max-width: 260px; }
.annuaire-hint {
font-size: 0.75rem;
color: #9ca3af;
text-align: center;
margin: 0;
}
.col-actions { width: 40px; text-align: center; }
.delete-btn {
background: transparent;
border: none;
cursor: pointer;
color: #ef4444;
font-size: 1rem;
padding: 4px 8px;
border-radius: 4px;
transition: background 0.1s;
}
.delete-btn:hover { background: #fef2f2; }
/* ── Mobile ── */
@media (max-width: 600px) {
+154 -115
View File
@@ -7,63 +7,82 @@
<p class="subtitle">10 personnes fictives. Clique sur un mode pour voir les matchs.</p>
</header>
<ClientOnly>
<CodevGraph
:fiches="fiches"
:matches="matches"
:mode="mode"
/>
<template #fallback>
<div class="graph-fallback">Chargement du graphe...</div>
</template>
</ClientOnly>
<!-- Bandeau info mode actif -->
<div v-if="mode !== 'none'" class="mode-banner">
<span>
Mode {{ MODE_LABELS[mode] }} actif -
{{ matches.length }} connexion{{ matches.length !== 1 ? 's' : '' }} trouvee{{ matches.length !== 1 ? 's' : '' }}.
</span>
<button class="banner-clear" @click="setMode('none')" type="button">Effacer</button>
<div class="codev-tabs">
<button :class="{ active: tab === 'carto' }" @click="tab = 'carto'" type="button">Carto</button>
<button :class="{ active: tab === 'annuaire' }" @click="tab = 'annuaire'" type="button">Annuaire</button>
</div>
<!-- 3 boutons matching identiques a carto.vue -->
<div class="matching-controls">
<button
:class="{ active: mode === 'solution' }"
style="--mode-color: #22c55e"
@click="setMode('solution')"
type="button"
>
Solution
<span class="hint">besoin - offre</span>
</button>
<button
:class="{ active: mode === 'alliance' }"
style="--mode-color: #f97316"
@click="setMode('alliance')"
type="button"
>
Alliance
<span class="hint">besoins partages</span>
</button>
<button
:class="{ active: mode === 'surprise' }"
style="--mode-color: #3b82f6"
@click="setMode('surprise')"
type="button"
>
Surprise
<span class="hint">offres partagees</span>
</button>
<button
v-if="mode !== 'none'"
class="reset"
@click="setMode('none')"
type="button"
>
Effacer
</button>
<div v-if="tab === 'carto'">
<ClientOnly>
<CodevGraph
:fiches="fiches"
:matches="matches"
:mode="mode"
/>
<template #fallback>
<div class="graph-fallback">Chargement du graphe...</div>
</template>
</ClientOnly>
<!-- Bandeau info mode actif -->
<div v-if="mode !== 'none'" class="mode-banner">
<span>
Mode {{ MODE_LABELS[mode] }} actif -
{{ matches.length }} connexion{{ matches.length !== 1 ? 's' : '' }} trouvee{{ matches.length !== 1 ? 's' : '' }}.
</span>
<button class="banner-clear" @click="setMode('none')" type="button">Effacer</button>
</div>
<!-- Boutons matching -->
<div class="matching-controls">
<button
:class="{ active: mode === 'solution' }"
style="--mode-color: #22c55e"
@click="setMode('solution')"
type="button"
>
Solution
<span class="hint">besoin - offre</span>
</button>
<button
:class="{ active: mode === 'alliance' }"
style="--mode-color: #f97316"
@click="setMode('alliance')"
type="button"
>
Alliance
<span class="hint">besoins partages</span>
</button>
<button
v-if="mode !== 'none'"
class="reset"
@click="setMode('none')"
type="button"
>
Effacer
</button>
</div>
</div>
<div v-else-if="tab === 'annuaire'" class="annuaire-wrap">
<div class="annuaire-scroll">
<table class="annuaire-table">
<thead>
<tr>
<th class="col-nom">Prénom</th>
<th class="col-besoin">Besoin</th>
<th class="col-offre">Ce que j'offre</th>
</tr>
</thead>
<tbody>
<tr v-for="f in fiches" :key="f.id" class="annuaire-row">
<td class="col-nom">{{ f.nom }}</td>
<td class="col-besoin">{{ f.besoin }}</td>
<td class="col-offre">{{ f.offre }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@@ -73,98 +92,95 @@
import type { CodevFiche, CodevMatch } from '~/types/codev'
import { computeMatches } from '~/utils/codev/matching'
// 10 fiches factices - hashtags alignes pour demontrer les 3 modes :
const tab = ref<'carto' | 'annuaire'>('carto')
// 10 fiches sans hashtags — textes enrichis pour que scoreDirect discrimine bien les 3 modes :
//
// Solution : Lea(besoin coaching) -> Maya(offre coaching)
// Sami(besoin formation+vente) -> Ines(offre vente+formation)
// Tom(besoin tiers-lieu) -> Zoe(offre facilitation+tiers-lieu)
// Solution (scoreDirect besoinA vs offreB) :
// Sami(besoin vendre formation) -> Ines(offre vente formations) ✓
// Nael(besoin site web formation) -> Sami(offre developpement web) ✓
// Eva(besoin coaching vente) -> Ines(offre vente formations) ✓
// Tom(besoin tiers-lieu) -> Zoe(offre facilitation tiers-lieux) ✓
//
// Alliance : Lea + Maya (hashtag coaching commun dans besoins)
// Sami + Kenji (hashtag formation+vente dans besoins)
// Tom + Zoe (hashtag tiers-lieu dans besoins)
// Alliance (besoins similaires) :
// Lea + Maya (coaching, lancer, offre) ✓
// Tom + Zoe (tiers-lieu, co-creer) ✓
// Sami + Kenji (vendre, formations) ✓
//
// Surprise : Lea + Zoe (hashtag facilitation dans offres)
// Tom + Roman (hashtag archi dans offres)
// Surprise (offres similaires) :
// Lea + Zoe (facilitation, groupes) ✓
// Tom + Roman (architecture) ✓
// Ines + Nael (marketing, formations) ✓
const FICHES_DEMO: CodevFiche[] = [
{
id: 1,
nom: 'Lea',
besoin: 'Structurer mon offre de coaching pour la lancer en septembre',
offre: 'Animation de groupes, facilitation de cercles de parole',
hashtags: ['coaching', 'facilitation'],
id: 1, nom: 'Lea',
besoin: 'Structurer et lancer mon offre de coaching professionnel cet automne',
offre: 'Facilitation de groupes et animation de cercles de parole',
hashtags: [],
created_at: '2026-05-08T10:00:00Z',
},
{
id: 2,
nom: 'Sami',
besoin: 'Comprendre comment vendre une formation en ligne',
offre: 'Developpement web, sites Astro et Nuxt',
hashtags: ['formation', 'vente'],
id: 2, nom: 'Sami',
besoin: 'Vendre ma formation en ligne et attirer mes premiers clients',
offre: 'Developpement web sur mesure, creation de sites et applications',
hashtags: [],
created_at: '2026-05-08T10:01:00Z',
},
{
id: 3,
nom: 'Ines',
besoin: 'Aide pour la facilitation de mes ateliers ecriture',
offre: 'Vente de formations en ligne, marketing direct',
hashtags: ['vente', 'formation'],
id: 3, nom: 'Ines',
besoin: 'Ameliorer la facilitation de mes ateliers collaboratifs',
offre: 'Vente de formations en ligne et marketing pour formateurs',
hashtags: [],
created_at: '2026-05-08T10:02:00Z',
},
{
id: 4,
nom: 'Tom',
besoin: 'Trouver un associe pour un projet de tiers-lieu',
offre: 'Architecture eco-responsable, conception bioclimatique',
hashtags: ['tiers-lieu', 'archi'],
id: 4, nom: 'Tom',
besoin: 'Trouver des associes pour co-creer un tiers-lieu rural',
offre: 'Architecture bioclimatique et eco-construction pour tiers-lieux',
hashtags: [],
created_at: '2026-05-08T10:03:00Z',
},
{
id: 5,
nom: 'Maya',
besoin: 'Structurer mon offre de coaching freelance',
offre: 'Coaching de carriere, accompagnement transition pro',
hashtags: ['coaching', 'carriere'],
id: 5, nom: 'Maya',
besoin: 'Creer et lancer mon offre de coaching en transition professionnelle',
offre: 'Accompagnement coaching de carriere et transitions professionnelles',
hashtags: [],
created_at: '2026-05-08T10:04:00Z',
},
{
id: 6,
nom: 'Kenji',
besoin: 'Apprendre a vendre mes formations sans me sentir vendeur',
offre: 'Photographie, direction artistique de projets editoriaux',
hashtags: ['formation', 'vente'],
id: 6, nom: 'Kenji',
besoin: 'Apprendre a vendre mes formations sans pression commerciale',
offre: 'Photographie professionnelle et direction artistique editoriale',
hashtags: [],
created_at: '2026-05-08T10:05:00Z',
},
{
id: 7,
nom: 'Zoe',
besoin: 'Trouver des associes pour mon projet de tiers-lieu rural',
offre: 'Animation et facilitation de collectifs, intelligence collective',
hashtags: ['tiers-lieu', 'facilitation'],
id: 7, nom: 'Zoe',
besoin: 'Co-creer un tiers-lieu avec des porteurs de projet alignes',
offre: 'Facilitation de collectifs et animation en intelligence collective',
hashtags: [],
created_at: '2026-05-08T10:06:00Z',
},
{
id: 8,
nom: 'Nael',
besoin: 'Construire un site web pour ma formation',
offre: 'Strategie marketing, lancement de produits digitaux',
hashtags: ['web', 'strategie'],
id: 8, nom: 'Nael',
besoin: 'Creer un site web pour presenter et vendre ma formation',
offre: 'Strategie marketing digital et lancement de produits en ligne',
hashtags: [],
created_at: '2026-05-08T10:07:00Z',
},
{
id: 9,
nom: 'Eva',
besoin: 'Lancer mon offre de coaching avec une page de vente',
offre: 'Ecriture longue forme, articles essais et tribunes',
hashtags: ['coaching', 'ecriture'],
id: 9, nom: 'Eva',
besoin: 'Lancer mon coaching avec une page de vente qui convertit',
offre: 'Ecriture longue forme, articles de fond et tribunes editoriales',
hashtags: [],
created_at: '2026-05-08T10:08:00Z',
},
{
id: 10,
nom: 'Roman',
besoin: 'Ameliorer mes articles de blog sur la renovation',
offre: 'Architecture, plans techniques pour renovation energetique',
hashtags: ['archi', 'reno'],
id: 10, nom: 'Roman',
besoin: 'Ecrire de meilleurs articles pour mon blog et ma newsletter',
offre: 'Architecture technique et plans pour renovation energetique',
hashtags: [],
created_at: '2026-05-08T10:09:00Z',
},
]
@@ -186,7 +202,7 @@ function setMode(newMode: typeof mode.value) {
if (newMode === 'none') {
matches.value = []
} else {
matches.value = computeMatches(fiches.value, newMode)
matches.value = computeMatches(fiches.value, newMode, 0.12)
}
}
</script>
@@ -250,6 +266,29 @@ function setMode(newMode: typeof mode.value) {
border-radius: 12px;
}
/* ── Tabs ── */
.codev-tabs { display: flex; gap: 4px; background: #f3f4f6; border-radius: 10px; padding: 4px; }
.codev-tabs button { flex: 1; padding: 8px 4px; border: none; border-radius: 7px; background: transparent; font-size: 0.875rem; font-weight: 500; cursor: pointer; color: #6b7280; transition: all 0.15s; }
.codev-tabs button.active { background: white; color: #1a1a2e; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
/* ── Annuaire ── */
.annuaire-wrap { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.annuaire-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #e5e7eb; border-radius: 10px; }
.annuaire-table { width: 100%; border-collapse: collapse; min-width: 480px; }
.annuaire-table thead tr { background: #f9fafb; border-bottom: 2px solid #e5e7eb; }
.annuaire-table th { padding: 10px 14px; text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; white-space: nowrap; }
.annuaire-table td { padding: 12px 14px; font-size: 0.875rem; color: #374151; vertical-align: top; border-bottom: 1px solid #f3f4f6; line-height: 1.5; }
.annuaire-row { transition: background 0.12s; }
.annuaire-row:hover { background: #f9fafb; }
.annuaire-row:last-child td { border-bottom: none; }
.col-nom { position: sticky; left: 0; z-index: 2; background: #ffffff; font-weight: 600; color: #1a1a2e !important; white-space: nowrap; min-width: 80px; border-right: 2px solid #e5e7eb; box-shadow: 2px 0 6px rgba(0,0,0,0.06); }
.annuaire-row:hover .col-nom { background: #f9fafb; }
thead tr .col-nom { background: #f9fafb; z-index: 3; }
.col-besoin { min-width: 200px; max-width: 260px; }
.col-offre { min-width: 200px; max-width: 260px; }
/* ── Bandeau mode actif ── */
.mode-banner {
+60 -12
View File
@@ -4,7 +4,8 @@
<!-- En-tête -->
<div class="fiche-header">
<h1>Ma fiche</h1>
<NuxtLink to="/codev/carto" class="back-link">← Retour à la carte</NuxtLink>
<h1>{{ isEdit ? 'Modifier ma fiche' : 'Ma fiche' }}</h1>
<p class="fiche-lead">3 lignes pour te présenter. Le reste se passe entre nous.</p>
</div>
@@ -105,9 +106,13 @@
<!-- Bouton -->
<button type="submit" class="submit-btn" :disabled="loading">
{{ loading ? 'Envoi en cours...' : 'Ajouter ma fiche' }}
{{ isEdit ? (loading ? 'Modification...' : 'Enregistrer les modifications') : (loading ? 'Envoi en cours...' : 'Ajouter ma fiche') }}
</button>
<NuxtLink to="/codev/carto" class="skip-link">
Voir la carte sans créer de fiche →
</NuxtLink>
</form>
</div>
@@ -115,12 +120,29 @@
</template>
<script setup lang="ts">
const route = useRoute()
const editId = computed(() => route.query.id ? Number(route.query.id) : null)
const isEdit = computed(() => editId.value !== null)
const form = ref({ nom: '', besoin: '', offre: '', hashtagsRaw: '' })
const error = ref('')
const loading = ref(false)
const activeTip = ref<'besoin' | 'offre' | null>(null)
useHead({ title: 'Ma fiche — Co-développement' })
useHead({ title: computed(() => isEdit.value ? 'Modifier ma fiche — Co-développement' : 'Ma fiche — Co-développement') })
onMounted(async () => {
if (!isEdit.value) return
try {
const fiche = await $fetch<any>(`/api/codev/fiches/${editId.value}`)
form.value.nom = fiche.nom
form.value.besoin = fiche.besoin
form.value.offre = fiche.offre
form.value.hashtagsRaw = fiche.hashtags.join(', ')
} catch {
error.value = 'Impossible de charger la fiche, elle a peut-etre ete supprimee.'
}
})
function toggleTip(field: 'besoin' | 'offre') {
activeTip.value = activeTip.value === field ? null : field
@@ -136,15 +158,18 @@ async function submit() {
.filter(Boolean)
.slice(0, 3)
await $fetch('/api/codev/fiches', {
method: 'POST',
body: {
nom: form.value.nom,
besoin: form.value.besoin,
offre: form.value.offre,
hashtags,
},
})
const payload = {
nom: form.value.nom,
besoin: form.value.besoin,
offre: form.value.offre,
hashtags,
}
if (isEdit.value) {
await $fetch(`/api/codev/fiches/${editId.value}`, { method: 'PATCH', body: payload })
} else {
await $fetch('/api/codev/fiches', { method: 'POST', body: payload })
}
await navigateTo('/codev/carto')
} catch (e: any) {
error.value = e?.data?.message || e?.statusMessage || 'Erreur, reessaie'
@@ -173,6 +198,18 @@ async function submit() {
/* ── En-tête ── */
.back-link {
display: inline-block;
font-size: 0.875rem;
color: var(--nav-text-muted, #6b7280);
text-decoration: none;
margin-bottom: 0.75rem;
}
.back-link:hover {
color: var(--nav-primary-solid, #1B4436);
}
.fiche-header h1 {
font-size: 1.5rem;
font-weight: 700;
@@ -357,6 +394,17 @@ async function submit() {
cursor: not-allowed;
}
.skip-link {
display: block;
text-align: center;
font-size: 0.825rem;
color: var(--nav-text-muted, #9ca3af);
text-decoration: none;
margin-top: 0.5rem;
padding: 0.5rem;
}
.skip-link:hover { color: var(--nav-text, #1a1a2e); }
/* ── Responsive ── */
@media (max-width: 480px) {
+115 -195
View File
@@ -1,217 +1,137 @@
<template>
<div class="lock-page">
<div class="lock-inner">
<div class="recette">
<div class="recette__col">
<EchelleTete echelle="M" compact :contribuer="false" class="recette__echelle" />
<div class="lock-header">
<h1>Co-développement</h1>
<p class="lock-subtitle">Entraide entre pairs</p>
<p class="lock-intro">Cet espace est un cercle. Pour entrer, il y a un mot.</p>
</div>
<header class="recette__tete">
<h1>Une session d'entraide, la recette qu'on pratique, à mettre à votre sauce</h1>
<p class="recette__surtitre">codev</p>
<p class="recette__lead">
Deux heures, entre deux et cinq personnes, en visio ou autour d'une table. Un rendez-vous régulier, déjà calé,
vaut mieux qu'une date à trouver à chaque fois.
</p>
</header>
<form class="lock-form" @submit.prevent="submit" novalidate>
<CodevRecetteBarre />
<div class="field-group">
<input
id="password"
v-model="password"
type="password"
placeholder="Mot de passe"
autocomplete="current-password"
required
:disabled="loading"
class="lock-input"
/>
</div>
<ol class="etapes" role="list">
<li>
<p class="etapes__nom">Coucou <span>10 min</span></p>
<p>La météo de chacun·e : on prend le temps de se retrouver avant de travailler.</p>
</li>
<li>
<p class="etapes__nom">Temps collectif <span>20 à 30 min</span></p>
<p>
Ce qui relie le groupe cette fois-ci : une question de gouvernance (une fois par mois), une méditation guidée
sur un thème vivant pour quelqu'un·e, un tour de parole libre, un sujet qu'un membre a envie de partager
(une formation, une lecture). La règle : voir ce qui est vivant.
</p>
</li>
<li>
<p class="etapes__nom">Entraide <span>1 h 20</span></p>
<p>
Le cœur : 15 à 20 minutes par personne. Cinq minutes pour poser le sujet, cinq pour les questions, cinq pour
les conseils. La première fois, chacun·e présente son projet, 10 à 15 minutes par personne, avant toute entraide.
</p>
</li>
<li>
<p class="etapes__nom">Clôture <span>5 min</span></p>
<p>Un mot de fin, un retour sur la séance, et la prochaine date fixée avant de se quitter.</p>
</li>
</ol>
<div v-if="error" class="lock-error" role="alert">
{{ error }}
</div>
<section class="recette__section" aria-labelledby="tenir">
<h2 id="tenir">Ce qui fait tenir</h2>
<p>
Un groupe de dix ami·es, quatre ou cinq présent·es chaque semaine. C'est la bonne taille pour se suivre d'une
semaine à l'autre et que chacun·e ait son quart d'heure.
</p>
</section>
<button type="submit" class="lock-btn" :disabled="loading || !password">
{{ loading ? 'Vérification...' : 'Entrer' }}
</button>
<section class="recette__section recette__partage" aria-labelledby="partager">
<h2 id="partager">Partagez la vôtre</h2>
<p>Chaque groupe a sa recette ; celle-ci en est une.</p>
<NuxtLink to="/proposer?categorie=recette" class="recette__btn">Partager la vôtre</NuxtLink>
</section>
</form>
<div class="lock-footer">
<NuxtLink to="/codev/demo" class="demo-link">Voir l'exemple &rarr;</NuxtLink>
</div>
<section class="recette__section" aria-labelledby="demande">
<h2 id="demande">Ce que ça demande</h2>
<p>
Tenir un groupe d'entraide demande des compétences qui ne vont pas de soi : écouter sans conseiller trop vite,
tenir le temps, faire circuler la parole, nommer ce dont le groupe a besoin.
</p>
<p><strong>On peut vous accompagner</strong> pour :</p>
<ul>
<li>définir les besoins du groupe (à quoi sert ce cercle, pour qui, à quel rythme) ;</li>
<li>soutenir la facilitation (une première séance accompagnée, une trame, un retour après coup) ;</li>
<li>relier le groupe aux ressources (fiches, lectures, autres groupes).</li>
</ul>
<!-- Sans conditions : le modèle économique n'est pas tranché (Jules, batch MOA du 23/10) -->
<p>Pour en parler : <a href="mailto:contact@trans-former.fr">écrivez-nous</a>.</p>
</section>
<p class="recette__acces"><NuxtLink to="/codev/acces">J'ai un code</NuxtLink></p>
</div>
</div>
</template>
<script setup lang="ts">
const password = ref('')
const error = ref('')
const loading = ref(false)
useHead({ title: 'Co-développement — Entraide entre pairs' })
async function submit() {
error.value = ''
loading.value = true
try {
await $fetch('/api/codev/auth', {
method: 'POST',
body: { password: password.value },
})
await navigateTo('/codev/fiche')
} catch (e: any) {
error.value = e?.statusMessage || 'Mauvais mot de passe'
} finally {
loading.value = false
}
}
// Lot Y : /codev est la recette publique ; l'écran du mot de passe vit en /codev/acces.
// Textes : W-recette-session-entraide-cercles-concentriques §2 et §4 (vault), mis en page sans réécriture.
useSeoMeta({
title: 'Une session d\'entraide, la recette qu\'on pratique | AEP',
description: 'Deux heures, entre deux et cinq personnes : coucou, temps collectif, entraide, clôture. La recette de codev qu\'on pratique, à mettre à votre sauce.',
ogTitle: 'Une session d\'entraide, la recette qu\'on pratique',
ogDescription: 'Deux heures, entre deux et cinq personnes : coucou, temps collectif, entraide, clôture.',
})
</script>
<style scoped>
/* ── Layout ── */
.recette { background: var(--bg); color: var(--text); min-height: 100%; }
.recette__col { max-width: 640px; margin: 0 auto; padding: var(--space-lg) var(--space-md) var(--space-3xl); line-height: 1.6; }
@media (min-width: 768px) { .recette__col { padding-top: var(--space-2xl); } }
.lock-page {
min-height: 100vh;
background: var(--nav-bg, #fafafa);
display: flex;
.recette__echelle { padding: var(--space-md); border-radius: var(--radius-md); background: var(--bg-alt); }
.recette__tete { margin-top: var(--space-xl); }
.recette__surtitre {
margin: calc(-1 * var(--space-xs)) 0 var(--space-md);
font-size: var(--fs-sm);
font-weight: var(--fw-bold);
letter-spacing: 0.08em;
text-transform: uppercase;
color: color-mix(in srgb, var(--text) 78%, transparent);
}
h1 { font-size: clamp(1.6rem, 5.5vw, 2.2rem); line-height: 1.2; font-weight: var(--fw-bold); margin: 0 0 var(--space-md); text-wrap: balance; }
.recette__lead { font-size: var(--fs-lg); margin: 0; }
.etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-md); }
.etapes li { padding-left: var(--space-md); border-left: 3px solid var(--nav-primary-solid); }
.etapes p { margin: 0; }
.etapes__nom { font-weight: var(--fw-bold); font-size: var(--fs-lg); }
.etapes__nom span { font-weight: var(--fw-regular); font-size: var(--fs-base); color: color-mix(in srgb, var(--text) 78%, transparent); }
.etapes__nom span::before { content: '· '; }
.recette__section { margin-top: var(--space-2xl); }
.recette__section h2 { font-size: var(--fs-xl); font-weight: var(--fw-bold); margin: 0 0 var(--space-sm); }
.recette__section p { margin: 0 0 var(--space-sm); }
.recette__section ul { margin: 0; padding-left: 1.2em; }
.recette__section li { margin-bottom: var(--space-xs); }
.recette__partage { padding: var(--space-lg); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.recette__btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 1.5rem 1rem;
}
.lock-inner {
width: 100%;
max-width: 400px;
display: flex;
flex-direction: column;
gap: 2rem;
}
/* ── En-tête ── */
.lock-header {
text-align: center;
}
.lock-header h1 {
font-size: 1.75rem;
font-weight: 700;
color: var(--nav-text, #1a1a2e);
margin: 0 0 0.375rem;
}
.lock-subtitle {
font-size: 1rem;
color: var(--nav-text-muted, #6b7280);
margin: 0 0 1rem;
}
.lock-intro {
font-size: 0.9rem;
color: var(--nav-text-muted, #6b7280);
line-height: 1.5;
margin: 0;
font-style: italic;
}
/* ── Formulaire ── */
.lock-form {
display: flex;
flex-direction: column;
gap: 0.875rem;
}
.field-group {
display: flex;
flex-direction: column;
}
.lock-input {
width: 100%;
padding: 0.875rem 1rem;
border: 1px solid var(--border-color, #d0d4dc);
border-radius: 8px;
font-size: 1rem;
color: var(--nav-text, #1a1a2e);
background: var(--nav-surface, #ffffff);
font-family: inherit;
text-align: center;
letter-spacing: 0.1em;
transition: border-color 0.15s, box-shadow 0.15s;
box-sizing: border-box;
}
.lock-input:focus {
outline: none;
border-color: var(--nav-primary-solid, #1B4436);
box-shadow: 0 0 0 2px rgba(27, 68, 54, 0.15);
}
.lock-input:disabled {
opacity: 0.6;
cursor: not-allowed;
}
/* ── Erreur ── */
.lock-error {
padding: 0.625rem 0.875rem;
background: #fdf0ee;
border: 1px solid #e74c3c;
border-radius: 8px;
font-size: 0.875rem;
color: #c0392b;
text-align: center;
}
/* ── Bouton ── */
.lock-btn {
width: 100%;
padding: 0.875rem 1rem;
background: var(--nav-primary-solid, #1B4436);
color: #ffffff;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
font-family: inherit;
transition: opacity 0.15s;
}
.lock-btn:hover:not(:disabled) {
opacity: 0.88;
}
.lock-btn:disabled {
opacity: 0.45;
cursor: not-allowed;
}
/* ── Pied de page ── */
.lock-footer {
text-align: center;
}
.demo-link {
font-size: 0.875rem;
color: var(--nav-text-muted, #6b7280);
min-height: 48px;
padding: 0 var(--space-lg);
border-radius: var(--radius-md);
background: var(--accent);
color: var(--on-accent);
font-weight: var(--fw-bold);
text-decoration: none;
transition: color 0.15s;
}
.recette__btn:hover { filter: brightness(0.96); }
.recette a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.demo-link:hover {
color: var(--nav-primary-solid, #1B4436);
}
/* ── Responsive ── */
@media (max-width: 480px) {
.lock-page {
padding: 1.25rem 1rem 2.5rem;
align-items: flex-start;
padding-top: 3rem;
}
}
.recette__acces { margin-top: var(--space-2xl); font-size: var(--fs-sm); }
.recette__acces a { color: color-mix(in srgb, var(--text) 78%, transparent); }
</style>
+89
View File
@@ -0,0 +1,89 @@
<template>
<div class="qr-page">
<div class="qr-card">
<h1>Co-développement</h1>
<p class="qr-subtitle">Scanne pour rejoindre la session</p>
<img
:src="`https://api.qrserver.com/v1/create-qr-code/?size=280x280&data=${encodeURIComponent(APP_URL)}&bgcolor=ffffff&color=1B4436&margin=2`"
alt="QR code aep.trans-former.fr/codev/acces"
class="qr-img"
width="280"
height="280"
/>
<p class="qr-url">{{ APP_URL }}</p>
<!-- Le mot de passe se donne à l'oral, plus sur la page (Jules, batch MOA du 23/10) -->
<a :href="`https://api.qrserver.com/v1/create-qr-code/?size=600x600&data=${encodeURIComponent(APP_URL)}&bgcolor=ffffff&color=1B4436&margin=2`"
download="codev-qr.png"
class="qr-download"
target="_blank"
>
Télécharger le QR code
</a>
</div>
</div>
</template>
<script setup lang="ts">
const APP_URL = 'https://aep.trans-former.fr/codev/acces'
useHead({ title: 'QR Code — Co-développement' })
</script>
<style scoped>
.qr-page {
min-height: 100vh;
background: var(--nav-bg, #fafafa);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem 1rem;
}
.qr-card {
background: white;
border-radius: 16px;
padding: 2rem;
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
max-width: 360px;
width: 100%;
box-shadow: 0 4px 24px rgba(0,0,0,0.08);
text-align: center;
}
.qr-card h1 {
font-size: 1.25rem;
font-weight: 700;
color: #1a1a2e;
margin: 0;
}
.qr-subtitle {
font-size: 0.9rem;
color: #6b7280;
margin: 0;
}
.qr-img {
border-radius: 8px;
border: 2px solid #e5e7eb;
}
.qr-url {
font-size: 0.8rem;
color: #9ca3af;
margin: 0;
font-family: monospace;
}
.qr-download {
display: inline-block;
padding: 10px 20px;
background: #1B4436;
color: white;
border-radius: 8px;
text-decoration: none;
font-size: 0.875rem;
font-weight: 600;
transition: opacity 0.15s;
}
.qr-download:hover { opacity: 0.88; }
</style>
+2 -790
View File
@@ -1,795 +1,7 @@
<template>
<div class="contribuer-page">
<div class="contribuer-inner">
<!-- Retour -->
<NuxtLink to="/" class="back-link">
← Retour à la carte
</NuxtLink>
<!-- En-tête -->
<div class="contribuer-header">
<h1>Proposer une ressource</h1>
<p class="contribuer-subtitle">
Tu connais une organisation utile aux architectes qui n'est pas encore référencée ?
Soumets-la ici — une IA enrichira la fiche et on validera sous 7 jours.
</p>
<p class="contribuer-hint">
Si tu n'as pas le temps de tout remplir, laisse-nous juste le lien — on extraira les infos du site.
Mais une description de toi, c'est toujours plus vivant et plus précis.
</p>
</div>
<!-- Message succès -->
<div v-if="success" class="success-block" role="status" aria-live="polite">
<div class="success-icon">✓</div>
<h2>Merci !</h2>
<p>Ta fiche est en cours de traitement.</p>
<p class="success-detail">
Une IA va scraper le site et enrichir la description.
Jules (et bientôt une équipe de modération) valide sous 7 jours.
</p>
<button type="button" class="btn-secondary" @click="reset">
Proposer une autre fiche
</button>
</div>
<!-- Formulaire -->
<form v-else @submit.prevent="submit" class="contribuer-form" novalidate>
<!-- Nom -->
<div class="field-group" :class="{ 'field-error': errors.nom }">
<label for="nom">Nom de l'organisation <span class="required">*</span></label>
<input
id="nom"
v-model="form.nom"
type="text"
placeholder="Ex : UNSFA, Maison de l'Architecture..."
autocomplete="organization"
@blur="validateField('nom')"
/>
<span v-if="errors.nom" class="error-msg" role="alert">{{ errors.nom }}</span>
</div>
<!-- URL -->
<div class="field-group" :class="{ 'field-error': errors.url }">
<label for="url">
Site web
<span class="label-hint">(optionnel — recommandé pour l'enrichissement IA)</span>
</label>
<input
id="url"
v-model="form.url"
type="url"
placeholder="https://..."
@blur="validateField('url')"
/>
<span v-if="errors.url" class="error-msg" role="alert">{{ errors.url }}</span>
</div>
<!-- Description -->
<div class="field-group" :class="{ 'field-error': errors.description_user }">
<label for="description_user">
Description courte <span class="required">*</span>
<span class="label-hint">(50 à 500 caractères)</span>
</label>
<textarea
id="description_user"
v-model="form.description_user"
rows="4"
placeholder="Présente l'organisation en quelques mots : ses missions, son public, ce qu'elle apporte..."
@blur="validateField('description_user')"
/>
<div class="field-meta">
<span v-if="errors.description_user" class="error-msg" role="alert">
{{ errors.description_user }}
</span>
<span v-else class="char-count" :class="{ 'char-warn': form.description_user.length > 450 }">
{{ form.description_user.length }}/500
</span>
</div>
</div>
<!-- Échelle -->
<div class="field-group" :class="{ 'field-error': errors.echelle }">
<fieldset>
<legend>
Échelle <span class="required">*</span>
<span class="label-hint">(une seule)</span>
</legend>
<div class="radio-group">
<label
v-for="opt in ECHELLES"
:key="opt"
class="radio-label"
:class="{ active: form.echelle === opt }"
>
<input
type="radio"
:value="opt"
v-model="form.echelle"
name="echelle"
@change="validateField('echelle')"
/>
{{ opt }}
</label>
</div>
</fieldset>
<span v-if="errors.echelle" class="error-msg" role="alert">{{ errors.echelle }}</span>
</div>
<!-- Fonctions -->
<div class="field-group" :class="{ 'field-error': errors.fonctions }">
<fieldset>
<legend>
Fonctions <span class="required">*</span>
<span class="label-hint">(1 à 5 — l'ordre de clic = priorité)</span>
</legend>
<div class="checkbox-grid">
<label
v-for="fn in FONCTIONS"
:key="fn"
class="checkbox-label"
:class="{
active: form.fonctions.includes(fn),
disabled: !form.fonctions.includes(fn) && form.fonctions.length >= 5,
}"
>
<input
type="checkbox"
:value="fn"
:checked="form.fonctions.includes(fn)"
:disabled="!form.fonctions.includes(fn) && form.fonctions.length >= 5"
@change="toggleFonction(fn)"
/>
<span class="fn-order" v-if="form.fonctions.includes(fn)">
{{ form.fonctions.indexOf(fn) + 1 }}
</span>
{{ fn }}
</label>
</div>
</fieldset>
<span v-if="errors.fonctions" class="error-msg" role="alert">{{ errors.fonctions }}</span>
</div>
<!-- Territoire -->
<div class="field-group" :class="{ 'field-error': errors.territoire }">
<fieldset>
<legend>
Territoire <span class="required">*</span>
</legend>
<div class="radio-group">
<label
v-for="t in TERRITOIRES"
:key="t"
class="radio-label"
:class="{ active: form.territoire === t }"
>
<input
type="radio"
:value="t"
v-model="form.territoire"
name="territoire"
@change="validateField('territoire')"
/>
{{ t }}
</label>
</div>
</fieldset>
<span v-if="errors.territoire" class="error-msg" role="alert">{{ errors.territoire }}</span>
</div>
<!-- Ville -->
<div class="field-group" :class="{ 'field-error': errors.localisation_ville }">
<label for="localisation_ville">
Ville principale
<span class="label-hint">(optionnel — pour la géolocalisation sur la carte)</span>
</label>
<input
id="localisation_ville"
v-model="form.localisation_ville"
type="text"
placeholder="Ex : Paris, Lyon, Bordeaux..."
/>
<span v-if="errors.localisation_ville" class="error-msg" role="alert">
{{ errors.localisation_ville }}
</span>
</div>
<!-- Email -->
<div class="field-group" :class="{ 'field-error': errors.submitted_by_email }">
<label for="submitted_by_email">
Ton email
<span class="label-hint">(optionnel — pour le suivi de modération)</span>
</label>
<input
id="submitted_by_email"
v-model="form.submitted_by_email"
type="email"
placeholder="ton@email.fr"
autocomplete="email"
@blur="validateField('submitted_by_email')"
/>
<span v-if="errors.submitted_by_email" class="error-msg" role="alert">
{{ errors.submitted_by_email }}
</span>
</div>
<!-- Erreur globale -->
<div v-if="serverError" class="server-error" role="alert">
<strong>Erreur :</strong> {{ serverError }}
</div>
<!-- Actions -->
<div class="form-actions">
<NuxtLink to="/" class="btn-secondary">Annuler</NuxtLink>
<button
type="submit"
class="btn-primary"
:disabled="submitting"
>
{{ submitting ? 'Envoi en cours...' : 'Proposer la fiche →' }}
</button>
</div>
<p class="form-note">
Ta fiche sera examinée par l'équipe avant publication.
</p>
</form>
</div>
</div>
<div />
</template>
<script setup lang="ts">
import { z } from 'zod'
// ── Constantes ────────────────────────────────────────────────────────────────
const ECHELLES = ['National', 'Régional', 'Local'] as const
const TERRITOIRES = ['Métropole', 'Guadeloupe', 'Martinique', 'Guyane', 'La Réunion', 'Mayotte'] as const
const FONCTIONS = [
'Juridique', 'Technique', 'Économique', 'Administratif', 'Chantier',
'Comptabilité', 'Développement', 'Formation', 'Gestion d\'agence', 'Santé mentale',
] as const
// ── Schéma Zod (côté client — miroir du serveur) ──────────────────────────────
const SubmitSchema = z.object({
nom: z.string().min(3, 'Minimum 3 caractères').max(150, 'Maximum 150 caractères').trim(),
url: z.string().url('URL invalide (commencer par https://)').optional().or(z.literal('')),
description_user: z.string().min(50, 'Minimum 50 caractères').max(500, 'Maximum 500 caractères').trim(),
echelle: z.enum(ECHELLES, { errorMap: () => ({ message: 'Sélectionne une échelle' }) }),
fonctions: z.array(z.string()).min(1, 'Sélectionne au moins une fonction').max(5, 'Maximum 5 fonctions'),
territoire: z.enum(TERRITOIRES, { errorMap: () => ({ message: 'Sélectionne un territoire' }) }),
localisation_ville: z.string().max(100).optional(),
submitted_by_email: z.string().email('Email invalide').optional().or(z.literal('')),
})
// ── État du formulaire ────────────────────────────────────────────────────────
const form = reactive({
nom: '',
url: '',
description_user: '',
echelle: '' as typeof ECHELLES[number] | '',
fonctions: [] as string[],
territoire: '' as typeof TERRITOIRES[number] | '',
localisation_ville: '',
submitted_by_email: '',
})
const errors = reactive<Record<string, string>>({})
const submitting = ref(false)
const success = ref(false)
const serverError = ref('')
const trackingUrl = ref<string | null>(null)
// ── Validation champ par champ ────────────────────────────────────────────────
function validateField(field: string) {
const partial = SubmitSchema.partial()
const result = partial.safeParse({ [field]: (form as any)[field] })
if (!result.success) {
const fieldErrors = result.error.flatten().fieldErrors
errors[field] = fieldErrors[field]?.[0] ?? ''
} else {
delete errors[field]
}
}
function validateAll(): boolean {
const result = SubmitSchema.safeParse(form)
if (!result.success) {
const flat = result.error.flatten().fieldErrors
Object.assign(errors, Object.fromEntries(
Object.entries(flat).map(([k, v]) => [k, v?.[0] ?? ''])
))
return false
}
Object.keys(errors).forEach(k => delete errors[k])
return true
}
// ── Gestion fonctions (ordre de clic = priorité) ──────────────────────────────
function toggleFonction(fn: string) {
const idx = form.fonctions.indexOf(fn)
if (idx >= 0) {
form.fonctions.splice(idx, 1)
} else if (form.fonctions.length < 5) {
form.fonctions.push(fn)
}
validateField('fonctions')
}
// ── Soumission ────────────────────────────────────────────────────────────────
async function submit() {
serverError.value = ''
if (!validateAll()) {
// Scroll vers la première erreur
await nextTick()
const firstError = document.querySelector('.field-error')
firstError?.scrollIntoView({ behavior: 'smooth', block: 'center' })
return
}
submitting.value = true
try {
const result: any = await $fetch('/api/submit', {
method: 'POST',
body: {
nom: form.nom,
url: form.url || undefined,
description_user: form.description_user,
echelle: form.echelle,
fonctions: form.fonctions,
territoire: form.territoire,
localisation_ville: form.localisation_ville || undefined,
submitted_by_email: form.submitted_by_email || undefined,
},
})
trackingUrl.value = result.trackingUrl ?? null
success.value = true
} catch (e: any) {
const status = e?.status ?? e?.statusCode
if (status === 429) {
serverError.value = 'Tu as déjà soumis 3 fiches aujourd\'hui. Réessaie demain.'
} else if (status === 422 && e?.data) {
// Erreurs Zod serveur → mapper sur le formulaire
const fieldErrors = e.data
Object.entries(fieldErrors).forEach(([k, v]) => {
errors[k] = Array.isArray(v) ? v[0] : String(v)
})
serverError.value = 'Certains champs sont invalides — vérifie les erreurs ci-dessus.'
} else {
serverError.value = 'Une erreur s\'est produite. Réessaie dans quelques instants.'
}
} finally {
submitting.value = false
}
}
function reset() {
Object.assign(form, {
nom: '', url: '', description_user: '', echelle: '',
fonctions: [], territoire: '', localisation_ville: '', submitted_by_email: '',
})
Object.keys(errors).forEach(k => delete errors[k])
success.value = false
serverError.value = ''
trackingUrl.value = null
}
// ── Meta ──────────────────────────────────────────────────────────────────────
useHead({ title: 'Proposer une ressource — AEP' })
navigateTo('/proposer', { redirectCode: 301 })
</script>
<style scoped>
/* ── Layout ─────────────────────────────────────────────────────────────────── */
.contribuer-page {
min-height: 100vh;
background: var(--nav-bg);
padding: 1.5rem 1rem 4rem;
}
.contribuer-inner {
max-width: 640px;
margin: 0 auto;
}
/* ── Retour ──────────────────────────────────────────────────────────────────── */
.back-link {
display: inline-flex;
align-items: center;
gap: 0.25rem;
font-size: 0.875rem;
color: var(--nav-primary-solid);
opacity: 0.7;
text-decoration: none;
margin-bottom: 1.5rem;
transition: opacity 0.15s;
}
.back-link:hover {
opacity: 1;
}
/* ── En-tête ─────────────────────────────────────────────────────────────────── */
.contribuer-header {
margin-bottom: 2rem;
}
.contribuer-header h1 {
font-size: 1.5rem;
font-weight: 700;
color: var(--nav-text);
margin: 0 0 0.5rem;
}
.contribuer-subtitle {
font-size: 0.9rem;
color: var(--nav-text-muted);
line-height: 1.5;
margin: 0 0 0.5rem;
}
.contribuer-hint {
font-size: 0.82rem;
color: var(--nav-text-muted);
opacity: 0.75;
line-height: 1.5;
margin: 0;
}
/* ── Succès ──────────────────────────────────────────────────────────────────── */
.success-block {
background: var(--nav-surface);
border: 1px solid rgba(26, 34, 56, 0.15);
border-radius: 12px;
padding: 2rem 1.5rem;
text-align: center;
}
.success-icon {
width: 48px;
height: 48px;
background: rgba(26, 34, 56, 0.1);
color: var(--nav-text);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.25rem;
font-weight: 700;
margin: 0 auto 1rem;
}
.success-block h2 {
font-size: 1.25rem;
font-weight: 700;
color: var(--nav-text);
margin: 0 0 0.5rem;
}
.success-block p {
font-size: 0.9rem;
color: var(--nav-text-muted);
margin: 0 0 0.5rem;
line-height: 1.5;
}
.success-detail {
font-size: 0.85rem !important;
}
.success-tracking {
font-size: 0.85rem !important;
margin-top: 1rem !important;
}
.tracking-link {
color: var(--nav-primary-solid);
font-size: 0.8rem;
word-break: break-all;
}
/* ── Formulaire ──────────────────────────────────────────────────────────────── */
.contribuer-form {
display: flex;
flex-direction: column;
gap: 1.25rem;
}
/* ── Champ générique ─────────────────────────────────────────────────────────── */
.field-group {
display: flex;
flex-direction: column;
gap: 0.375rem;
}
.field-group label,
.field-group legend {
font-size: 0.875rem;
font-weight: 600;
color: var(--nav-text);
display: block;
}
.field-group fieldset {
border: none;
padding: 0;
margin: 0;
}
.required {
color: #c0392b;
}
.label-hint {
font-weight: 400;
color: var(--nav-text-muted);
font-size: 0.8rem;
margin-left: 0.25rem;
}
.field-group input[type="text"],
.field-group input[type="url"],
.field-group input[type="email"],
.field-group textarea {
width: 100%;
padding: 0.625rem 0.875rem;
border: 1px solid rgba(26, 34, 56, 0.2);
border-radius: 8px;
font-size: 0.9rem;
color: var(--nav-text);
background: var(--nav-surface);
font-family: inherit;
transition: border-color 0.15s, box-shadow 0.15s;
box-sizing: border-box;
}
.field-group input:focus,
.field-group textarea:focus {
outline: none;
border-color: var(--nav-primary-solid);
box-shadow: 0 0 0 2px rgba(245, 179, 66, 0.4);
}
.field-group textarea {
resize: vertical;
min-height: 100px;
}
/* Erreur champ */
.field-error input,
.field-error textarea {
border-color: #c0392b !important;
}
.error-msg {
font-size: 0.8rem;
color: #c0392b;
}
.field-meta {
display: flex;
justify-content: flex-end;
}
.char-count {
font-size: 0.75rem;
color: var(--nav-text-muted);
}
.char-warn {
color: #e67e22;
}
/* ── Radio (Échelle + Territoire) ────────────────────────────────────────────── */
.radio-group {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-top: 0.375rem;
}
.radio-label {
display: inline-flex;
align-items: center;
gap: 0.375rem;
padding: 0.375rem 0.75rem;
border: 1px solid rgba(26, 34, 56, 0.2);
border-radius: 6px;
font-size: 0.85rem;
color: var(--nav-text);
background: var(--nav-surface);
cursor: pointer;
transition: all 0.15s;
user-select: none;
}
.radio-label input[type="radio"] {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.radio-label:hover {
border-color: var(--nav-primary-solid);
background: var(--nav-bg-alt);
}
.radio-label.active {
background: var(--nav-primary);
border-color: transparent;
color: var(--nav-text-on-primary);
}
/* ── Checkboxes (Fonctions) ──────────────────────────────────────────────────── */
.checkbox-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.5rem;
margin-top: 0.375rem;
}
@media (max-width: 400px) {
.checkbox-grid {
grid-template-columns: 1fr;
}
}
.checkbox-label {
display: inline-flex;
align-items: center;
gap: 0.375rem;
padding: 0.375rem 0.75rem;
border: 1px solid rgba(26, 34, 56, 0.2);
border-radius: 6px;
font-size: 0.85rem;
color: var(--nav-text);
background: var(--nav-surface);
cursor: pointer;
transition: all 0.15s;
user-select: none;
position: relative;
}
.checkbox-label input[type="checkbox"] {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.checkbox-label:hover:not(.disabled) {
border-color: var(--nav-primary-solid);
background: var(--nav-bg-alt);
}
.checkbox-label.active {
background: var(--nav-primary);
border-color: transparent;
color: var(--nav-text-on-primary);
}
.checkbox-label.disabled {
opacity: 0.4;
cursor: not-allowed;
}
.fn-order {
display: inline-flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
background: var(--nav-accent);
color: var(--nav-text);
border-radius: 50%;
font-size: 0.7rem;
font-weight: 700;
flex-shrink: 0;
}
/* ── Erreur serveur ──────────────────────────────────────────────────────────── */
.server-error {
padding: 0.875rem 1rem;
background: #fdf0ee;
border: 1px solid #e74c3c;
border-radius: 8px;
font-size: 0.875rem;
color: #c0392b;
}
/* ── Actions ──────────────────────────────────────────────────────────────────── */
.form-actions {
display: flex;
gap: 0.75rem;
justify-content: flex-end;
margin-top: 0.5rem;
}
.btn-primary {
padding: 0.75rem 1.5rem;
background: var(--nav-primary);
color: var(--nav-text-on-primary);
border: none;
border-radius: 8px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
font-family: inherit;
transition: background 0.15s, opacity 0.15s;
}
.btn-primary:hover:not(:disabled) {
background: rgba(26, 34, 56, 0.75);
}
.btn-primary:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-secondary {
padding: 0.75rem 1.25rem;
background: transparent;
color: var(--nav-text-muted);
border: 1px solid rgba(26, 34, 56, 0.2);
border-radius: 8px;
font-size: 0.9rem;
cursor: pointer;
font-family: inherit;
text-decoration: none;
display: inline-flex;
align-items: center;
transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover {
border-color: var(--nav-primary-solid);
color: var(--nav-text);
}
.form-note {
font-size: 0.75rem;
color: var(--nav-text-muted);
text-align: center;
margin: 0;
}
/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
.contribuer-page {
padding: 1rem 0.75rem 3rem;
}
.form-actions {
flex-direction: column-reverse;
}
.btn-primary,
.btn-secondary {
width: 100%;
justify-content: center;
}
}
</style>
+150
View File
@@ -0,0 +1,150 @@
<!--
Page de dev — story de test FicheMiniCard (B3-M2)
Sert uniquement à la vérification visuelle. Aucun lien vers cette page
nulle part dans l'app (pas dans app.vue, pas dans les pages) : navigation
directe par URL uniquement (/dev/fiche-mini-card).
-->
<template>
<div class="story">
<h1 class="story__title">FicheMiniCard — story de test (B3-M2)</h1>
<section class="story__section">
<h2 class="story__heading">Org — cas nominal</h2>
<div class="story__grid">
<FicheMiniCard :fiche="orgNominal" @open="log('org-nominal')" />
</div>
</section>
<section class="story__section">
<h2 class="story__heading">Structure — cas nominal</h2>
<div class="story__grid">
<FicheMiniCard :fiche="structureNominal" @open="log('structure-nominal')" />
</div>
</section>
<section class="story__section">
<h2 class="story__heading">Cas limites</h2>
<div class="story__grid">
<FicheMiniCard :fiche="nomLong" @open="log('nom-long')" />
<FicheMiniCard :fiche="sansDescription" @open="log('sans-description')" />
<FicheMiniCard :fiche="sansChips" @open="log('sans-chips')" />
<FicheMiniCard :fiche="sansGeoloc" @open="log('sans-geoloc')" />
</div>
</section>
<section class="story__section">
<h2 class="story__heading">Dernier événement « open »</h2>
<p class="story__log">{{ lastOpen ?? '(aucun clic pour le moment)' }}</p>
</section>
</div>
</template>
<script setup lang="ts">
import type { MiniFiche } from '~/composables/useFicheAdapter'
definePageMeta({ layout: false })
const lastOpen = ref<string | null>(null)
function log(label: string) {
lastOpen.value = label
}
const orgNominal: MiniFiche = {
id: 1,
nom: 'Réseau Bâti Vivant',
resume: 'Un réseau national d\'accompagnement juridique et technique pour les collectifs d\'auto-construction.',
chips: ['Juridique', 'Technique'],
echelle: 'National',
geoloc: true,
kind: 'org',
}
const structureNominal: MiniFiche = {
id: 'f1-rotor',
nom: 'Rotor',
resume: 'Rotor invente en Belgique le protocole de la déconstruction sélective comme geste politique contre la culture du tout-neuf.',
chips: ['#reemploi-structurel', '#plateforme-materiaux'],
geoloc: true,
kind: 'structure',
}
const nomLong: MiniFiche = {
id: 2,
nom: 'Collectif Régional de Réemploi et d\'Accompagnement des Chantiers Participatifs du Grand Ouest',
resume: 'Nom volontairement long pour vérifier l\'ellipse sur une ligne.',
chips: ['Chantier'],
echelle: 'Régional',
geoloc: true,
kind: 'org',
}
const sansDescription: MiniFiche = {
id: 3,
nom: 'Structure sans description',
resume: '',
chips: ['Formation'],
echelle: 'Local',
geoloc: true,
kind: 'org',
}
const sansChips: MiniFiche = {
id: 4,
nom: 'Structure sans chips',
resume: 'Une organisation dont aucune fonction ni hashtag n\'est renseigné dans la source.',
chips: [],
geoloc: true,
kind: 'org',
}
const sansGeoloc: MiniFiche = {
id: 5,
nom: 'Structure sans localisation',
resume: 'Une fiche nationale sans latitude ni longitude — invisible sur la carte, visible ici.',
chips: ['Administratif', 'Comptabilité'],
echelle: 'National',
geoloc: false,
kind: 'org',
}
</script>
<style scoped>
.story {
max-width: 1100px;
margin: 0 auto;
padding: var(--space-lg);
background: var(--bg);
color: var(--text);
font-family: var(--font-body);
}
.story__title {
font-size: var(--fs-xl);
font-weight: var(--fw-bold);
margin-bottom: var(--space-lg);
}
.story__section {
margin-bottom: var(--space-xl);
}
.story__heading {
font-size: var(--fs-sm);
font-weight: var(--fw-semibold);
text-transform: uppercase;
letter-spacing: 0.02em;
color: var(--text-muted);
margin-bottom: var(--space-sm);
}
.story__grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: var(--space-sm);
}
.story__log {
font-size: var(--fs-sm);
color: var(--text-muted);
}
</style>
+70
View File
@@ -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>
+189
View File
@@ -0,0 +1,189 @@
<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 }}&nbsp;€ 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>
<EvenementsRecette />
<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>
+240
View File
@@ -0,0 +1,240 @@
<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&nbsp;h&nbsp;30 depuis Paris Est, puis 15&nbsp;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) : au bureau, la page en deux moitiés, une longue colonne de texte et le plan de
Sacha à gauche, le pastel de Jules en grand à droite ; au téléphone, le texte, le pastel, puis le plan.
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 evt-large" 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: 900px) min(44vw, 570px), 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>
<figure class="evt-figure evt-pleine projet__plan">
<!-- 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 (pas de doublon) -->
<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>
</section>
<section class="evt-section" aria-labelledby="syntropie">
<h2 id="syntropie" class="evt-h2">Une forêt en syntropie</h2>
<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 : téléphone, le texte, le pastel en grand au centre, puis le plan ; bureau, deux moitiés,
le texte et le plan à gauche, le pastel à droite sur toute la hauteur */
.projet__arbre { margin: var(--space-xl) auto; 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); }
.projet__plan { margin-bottom: 0; }
@media (min-width: 900px) {
.projet {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
grid-template-areas: "texte arbre" "plan arbre";
grid-template-rows: auto 1fr;
column-gap: var(--space-2xl);
align-items: start;
}
.projet__texte { grid-area: texte; }
.projet__arbre { grid-area: arbre; width: 100%; margin: 0; }
.projet__plan { grid-area: plan; }
}
/* 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>
+95
View File
@@ -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>
+214 -451
View File
@@ -1,369 +1,91 @@
<template>
<div class="flex h-full overflow-hidden" style="background: var(--nav-bg);">
<!-- ═══════════════════════════════════════ SIDEBAR DESKTOP (>= 1024px) -->
<div 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 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>
<div v-if="structure.hashtags.length" class="mt-1 flex flex-wrap gap-1">
<span
v-for="tag in structure.hashtags.slice(0, 2)"
:key="tag"
class="text-xs"
style="color: var(--nav-text-muted);"
>{{ tag }}</span>
</div>
</div>
</div>
<div class="relative h-full overflow-hidden" style="background: var(--nav-bg);">
<!-- 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">
<!-- ── 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="desktopMapView = '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="desktopMapView = '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="desktopMapView = 'graphe'"
>Vue graphique</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);">
<!-- ═══════════════════════════════════════ 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>
<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>
</div>
<!-- ── VUE MOBILE : Onglets Métro/Outre-mer + 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="mobileMapView = '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="mobileMapView = 'outremer'"
>Outre-mer</button>
</div>
<div class="lg:hidden flex-1 relative overflow-hidden">
<!-- Carte mobile Métropole -->
<div v-show="mobileMapView === 'metropole'" class="absolute inset-0">
<ClientOnly>
<NavMapV2
ref="navMapMobileRef"
:structures="metropoleStructures"
<NavMap
:orgs="metropoleOrgs"
:selectedId="selectedId"
@select-structure="onSelectStructureMobile"
: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 mobile Outre-mer -->
<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="outremerOrgsLegacy"
:selectedId="selectedIdLegacyNum"
@select-org="() => {}"
:orgs="outremerOrgs"
:selectedId="selectedId"
@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>
<!-- Bottom sheet swipable -->
<ClientOnly>
<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>
<!-- Chatbot sous la carte (ordinateur) -->
<div class="hidden lg:block shrink-0">
<ChatbotPlaceholder @highlightOrgs="onHighlightOrgs" />
</div>
</template>
<!-- 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) : 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,141 +99,182 @@
<ChatbotSheet
:modelValue="chatbotOpen"
@update:modelValue="chatbotOpen = $event"
@highlightOrgs="() => {}"
@highlightOrgs="onHighlightOrgs"
/>
<!-- ═══════════════════════════════════════ POP-UP MISSION ENTRAIDE -->
<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"
>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="10"/>
<line x1="12" y1="16" x2="12" y2="12"/>
<line x1="12" y1="8" x2="12.01" y2="8"/>
</svg>
</button>
<MissionPopup
:modelValue="missionOpen"
@update:modelValue="missionOpen = $event"
echelle="M"
/>
</div>
</template>
<script setup lang="ts">
import type { ReseauxBifurcationData, StructureV2 } from '~/types/structure-v2'
import type { Org } from '~/types/org'
import type { ConfigVueFiches } from '~/utils/vueFiches'
import { DOM_TOM } from '~/composables/useFicheAdapter'
// ── Couleurs familles ──────────────────────────────────────────────────────
const FAMILLE_COLORS: Record<number, string> = {
1: '#a85d3e',
2: '#c4a472',
3: '#d4a017',
4: '#5a7a4a',
5: '#3d6a8c',
6: '#6b3fa0',
}
const route = useRoute()
const router = useRouter()
function familleColor(f: number): string {
return FAMILLE_COLORS[f] ?? '#888'
}
// ── Données ───────────────────────────────────────────────────────────────
const { data, pending } = await useFetch<{ list: Org[]; source: string }>('/api/organisations')
// ── État UI ────────────────────────────────────────────────────────────────
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<'metropole' | 'outremer'>('metropole')
const desktopMapView = ref<'metropole' | 'outremer' | 'graphe'>('metropole')
const orgs = computed<Org[]>(() => data.value?.list ?? [])
const dataSource = computed(() => data.value?.source ?? 'nocodb')
// 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)
// ── Données V2 - JSON statique ─────────────────────────────────────────────
const bifurcationData = ref<ReseauxBifurcationData | null>(null)
const pending = ref(true)
onMounted(async () => {
try {
bifurcationData.value = await $fetch<ReseauxBifurcationData>('/data/reseaux-bifurcation.json')
} catch (e) {
console.error('Erreur chargement reseaux-bifurcation.json', e)
} finally {
pending.value = false
}
// `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
})
const structures = computed<StructureV2[]>(() => bifurcationData.value?.structures ?? [])
// ── 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 }))
// Tous les hashtags uniques triés
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()
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 }
})
// ── Filtrage ───────────────────────────────────────────────────────────────
const filtered = computed<StructureV2[]>(() => {
let result = structures.value
// 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 })
}
// 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))
)
}
// Surlignage temporaire (5 s) suite à une réponse chatbot
let highlightTimer: ReturnType<typeof setTimeout> | null = null
// 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!)
)
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
surligneId.value = firstId
if (highlightTimer) clearTimeout(highlightTimer)
highlightTimer = setTimeout(() => {
surligneId.value = null
highlightTimer = null
}, 5000)
}
// 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}` })
}
}
}, { immediate: true })
}
// Filtre hashtags (AND logique si plusieurs)
if (selectedHashtags.value.length) {
result = result.filter(
s => selectedHashtags.value.every(h => s.hashtags.includes(h))
)
}
// ── 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))
return result
onMounted(() => {
try {
if (!localStorage.getItem('aep_mission_seen')) missionOpen.value = true
} catch {}
})
const hasActiveFilters = computed(
() => !!search.value || selectedFamille.value !== null || selectedHashtags.value.length > 0
)
function resetFilters() {
search.value = ''
selectedFamille.value = null
selectedHashtags.value = []
}
// 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)
// 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" })
// 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>
.mission-info-btn {
position: fixed;
bottom: 24px;
left: 16px;
z-index: 1000;
width: 36px;
height: 36px;
border-radius: 50%;
border: none;
background: var(--nav-surface);
color: var(--nav-text-muted);
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 12px rgba(26,34,56,0.18);
cursor: pointer;
transition: opacity 0.15s, transform 0.1s;
}
.mission-info-btn:hover { opacity: 0.85; transform: translateY(-1px); color: var(--nav-text); }
@media (min-width: 1024px) {
.mission-info-btn { bottom: 10px; left: auto; right: 52px; }
}
</style>
+239
View File
@@ -0,0 +1,239 @@
<template>
<div class="manifeste-page">
<div class="manifeste-inner">
<NuxtLink to="/" class="back-link">← Retour à la carte</NuxtLink>
<h1 class="manifeste-title">Manifeste — Architecture d'Écologie Politique</h1>
<p class="lede">
<em>Un quart des architectes vivent sous le seuil de pauvreté. La moitié de nos heures, non facturées. Nos cotisations, parmi les plus lourdes des professions réglementées. Et le secteur du bâtiment, à lui seul, pèse 34&nbsp;% des émissions mondiales de gaz à effet de serre.</em>
</p>
<p>
Quelque chose s'est rompu — pas dans nos vies, dans les cadres qui les contiennent.
</p>
<p>
Notre profession ne traverse pas une simple crise. Elle reflète l'effondrement d'un monde qui confond performance et destruction, signature et silence, expertise et soumission.
</p>
<hr />
<h2>Ce que nous voyons.</h2>
<p>
À l'échelle du métier, une profession structurellement sous l'eau, qui absorbe les tensions d'un système extractiviste — et porte la responsabilité quand d'autres captent la valeur.
</p>
<p>
À l'échelle des corps, une culture qui rend l'exploitation désirable&nbsp;: métier-passion, modèle starchitecte, isolement libéral, moteur critique délégitimant. Nous tenons. Nous payons.
</p>
<p>
À l'échelle du monde, l'effondrement écologique et social qui avance, pendant que notre voix s'efface du débat public. Notre silence le sert.
</p>
<hr />
<h2>Ce que nous refusons.</h2>
<p class="refus">
Nous ne signerons plus pour des projets qui détruisent.<br />
Nous n'isolerons plus celles et ceux qui doutent.<br />
Nous ne porterons plus seul·es ce qui doit se penser, se faire — et se soigner — ensemble.
</p>
<hr />
<p class="pivot">
<strong>Et pourtant, quelque chose tient.</strong>
</p>
<p class="pivot-suite">
Pas l'espoir naïf, ni la promesse héroïque. Quelque chose de plus humble&nbsp;: la fatigue commune reconnue, et l'envie qui revient de ne plus économiser sa vie.
</p>
<hr />
<h2>Ce que nous tentons.</h2>
<p>
<em>Partager.</em> Nos parcours, nos doutes, nos bifurcations. Se former les un·es les autres. Se tendre la main. Documenter ce qui marche, ce qui rate. Le personnel devient politique quand il se met en commun.
</p>
<p>
<em>Construire.</em> L'infrastructure collective qui nous a manqué. Cartes d'entraide, communs documentés, gouvernance horizontale, financement transparent, infra souveraine. <strong>Architecture d'Écologie Politique</strong>&nbsp;: un commun vivant, ouvert, biorégional, ancré.
</p>
<p>
<em>Pratiquer une médecine du corps social.</em> Diagnostiquer les infrastructures qui défaillent — l'éducation, la justice, la sécurité, l'énergie, la santé, le logement, l'agriculture. Proposer des reconfigurations situées, territoire par territoire. Reprendre le pouvoir par la base. Écrire, lentement, un nouveau contrat social.
</p>
<p>
<em>Commencer par les marges.</em> Là où le corps social souffre le plus, là où il est le plus prêt à changer. Ne pas décider à la place — faire émerger. Transparence totale, sur le process et sur l'argent. Tendresse militante&nbsp;: la lucidité sans le mépris, l'engagement sans la dureté.
</p>
<hr />
<h2>Architectes, allié·es, habitant·es.</h2>
<p>
Nous avons un travail à faire ensemble. Lentement, patiemment, par accumulation de petits gestes situés. Pas pour fuir — pour bifurquer.
</p>
<p class="chute">
<em>Nos métiers sont des médecines. Reprenons-en le pouls — à mains nues, ensemble.</em>
</p>
<hr />
<p class="cta-wrap">
<a
href="https://www.trans-former.fr/"
target="_blank"
rel="noopener noreferrer"
class="btn-blog"
>
En lire plus — blog AEP →
</a>
</p>
</div>
</div>
</template>
<script setup lang="ts">
useHead({
title: 'Manifeste — AEP',
meta: [
{ name: 'description', content: 'Manifeste d\'Architecture d\'Écologie Politique — un commun vivant pour bifurquer ensemble.' },
],
})
</script>
<style scoped>
.manifeste-page {
min-height: 100vh;
background: var(--nav-bg);
padding: 1.5rem 1rem 5rem;
overflow-x: hidden;
width: 100%;
}
.manifeste-inner {
max-width: 680px;
margin: 0 auto;
width: 100%;
}
.back-link {
display: inline-flex;
align-items: center;
gap: 0.25rem;
font-size: 0.875rem;
color: var(--nav-primary-solid);
opacity: 0.7;
text-decoration: none;
margin-bottom: 2rem;
transition: opacity 0.15s;
}
.back-link:hover { opacity: 1; }
.manifeste-title {
font-size: 1.65rem;
font-weight: 700;
color: var(--nav-text);
margin: 0 0 1.5rem;
line-height: 1.25;
}
.lede {
font-size: 1rem;
line-height: 1.7;
color: var(--nav-text);
margin: 0 0 1.25rem;
border-left: 3px solid var(--nav-primary-solid);
padding-left: 1rem;
opacity: 0.85;
}
p {
font-size: 0.975rem;
line-height: 1.75;
color: var(--nav-text);
margin: 0 0 1.1rem;
}
h2 {
font-size: 1.05rem;
font-weight: 700;
color: var(--nav-text);
margin: 2rem 0 1rem;
letter-spacing: 0.01em;
}
hr {
border: none;
border-top: 1px solid var(--nav-bg-alt);
margin: 2rem 0;
}
.refus {
font-style: normal;
}
.pivot {
font-size: 1.15rem;
text-align: center;
margin: 2rem 0 1rem;
font-style: italic;
}
.pivot strong {
font-weight: 700;
font-style: normal;
}
.pivot-suite {
text-align: center;
font-style: italic;
opacity: 0.85;
}
.chute {
font-size: 1.05rem;
text-align: center;
margin-top: 1.5rem;
color: var(--nav-text);
}
.cta-wrap {
text-align: center;
margin: 2rem 0 0;
}
.btn-blog {
display: inline-flex;
align-items: center;
padding: 0.75rem 1.5rem;
background: var(--nav-primary);
color: var(--nav-text-on-primary);
border-radius: 8px;
font-size: 0.9rem;
font-weight: 600;
text-decoration: none;
transition: opacity 0.15s;
}
.btn-blog:hover { opacity: 0.85; }
@media (max-width: 480px) {
.manifeste-page { padding: 1rem 0.85rem 4rem; }
.manifeste-title { font-size: 1.4rem; }
.lede { font-size: 0.95rem; padding-left: 0.85rem; }
p { font-size: 0.95rem; }
.pivot { font-size: 1.05rem; }
}
</style>
+23
View File
@@ -0,0 +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);">
<MediaTabVisuel v-if="tab === 'visuel'" />
<MediaTabProjets v-else />
</div>
</template>
<script setup lang="ts">
const route = useRoute()
// 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: tab.value === 'projets' ? 'AEP - Publications' : 'AEP - Recherche média' }))
</script>
<style scoped>
.media-page { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
</style>
+797
View File
@@ -0,0 +1,797 @@
<template>
<div class="outils-page">
<!-- ══════════════════════ EN-TÊTE PAGE ══════════════════════ -->
<header class="outils-header">
<div class="outils-header__inner">
<div class="outils-header__icon-wrap" aria-hidden="true">
<img src="/icons/outils-wrench.svg" alt="" class="outils-header__icon" />
</div>
<div>
<h1 class="outils-header__title">Outils</h1>
<EchelleTete echelle="S" :contribuer="false" />
<p class="outils-header__intro">
En tant qu'architecte, on jongle avec une multitude d'outils — simulation, dessin,
calcul, recherche, partage. Les mutualiser, se conseiller dessus, savoir lequel
utiliser quand : c'est une forme d'entraide concrète. Voici ceux que je propose
dans un premier temps. Chacun peut contribuer pour enrichir cette boîte à outils
commune.
</p>
</div>
</div>
</header>
<main class="outils-main">
<!-- ══════════════ SECTION 1 — Simulateurs métier ══════════════ -->
<section class="outils-section outils-section--simulateurs" aria-labelledby="sec-simulateurs">
<h2 id="sec-simulateurs" class="outils-section__title">
<span aria-hidden="true">🧮</span> Simulateurs métier
</h2>
<p class="outils-section__subtitle">Créés par AEP — outils de calcul situés.</p>
<div class="simu-grid">
<SimulateurFeature
v-for="s in outils?.simulateurs"
:key="s.id"
:icon="s.icon"
:titre="s.titre"
:url="s.url"
:description="s.description"
:cta="s.cta"
:tag="s.tag"
/>
</div>
<!-- Inspirations -->
<div v-if="outils?.simulateurs_inspirations?.length" class="simu-inspirations">
<p class="simu-inspirations__label">Inspiration externe</p>
<div class="outil-cards-grid">
<OutilCard
v-for="s in outils.simulateurs_inspirations"
:key="s.id"
:icon="s.icon"
:titre="s.titre"
:url="s.url"
:description="s.description"
:tag="s.tag"
/>
</div>
</div>
</section>
<!-- ══════════════ SECTION 2 — Open source recommandés ══════════════ -->
<section class="outils-section outils-section--opensource" aria-labelledby="sec-opensource">
<h2 id="sec-opensource" class="outils-section__title">
<span aria-hidden="true">🔧</span> Outils tech open source
</h2>
<p class="outils-section__subtitle">Quelques recommandations directes. Le cœur de l'onglet, c'est la section FMHY plus bas.</p>
<div class="outil-cards-grid">
<OutilCard
v-for="outil in outils?.opensource"
:key="outil.id"
:icon="outil.icon"
:titre="outil.titre"
:url="outil.url"
:description="outil.description"
:tag="outil.tag"
/>
</div>
</section>
<!-- ══════════════ SECTION 3 — Bifurcation ══════════════ -->
<section class="outils-section" aria-labelledby="sec-bifurcation">
<h2 id="sec-bifurcation" class="outils-section__title">
<span aria-hidden="true">🌿</span> Bifurcation post-études d'archi
</h2>
<p class="outils-section__desc">
{{ outils?.bifurcation?.intro }}
</p>
<!-- 3.1 Vidéos OFQA -->
<div class="bifurcation-block">
<h3 class="bifurcation-block__title">Série vidéo OFQA / ENSA-PB</h3>
<ul class="ofqa-list">
<li
v-for="ep in outils?.bifurcation?.videos_ofqa"
:key="ep.ep"
class="ofqa-list__item"
>
<component
:is="ep.url ? 'a' : 'span'"
v-bind="ep.url ? { href: ep.url, target: '_blank', rel: 'noopener noreferrer' } : {}"
class="ofqa-list__link"
:class="{ 'ofqa-list__link--disabled': !ep.url }"
>
<span class="ofqa-list__ep">EP/{{ ep.ep }}</span>
<span class="ofqa-list__titre">{{ ep.titre }}</span>
<span class="ofqa-list__personnes">— {{ ep.personnes }}</span>
<span v-if="ep.note" class="ofqa-list__note">({{ ep.note }})</span>
</component>
</li>
</ul>
</div>
<!-- 3.2 Coalition -->
<div v-if="outils?.bifurcation?.coalition_ensa_pb" class="bifurcation-block bifurcation-block--coalition">
<h3 class="bifurcation-block__title">{{ outils.bifurcation.coalition_ensa_pb.titre }}</h3>
<p class="bifurcation-block__desc">{{ outils.bifurcation.coalition_ensa_pb.description }}</p>
</div>
<!-- 3.3 Ressources externes -->
<div v-if="outils?.bifurcation?.ressources_externes?.length" class="bifurcation-block">
<h3 class="bifurcation-block__title">Ressources externes</h3>
<div class="outil-cards-grid">
<OutilCard
v-for="r in outils.bifurcation.ressources_externes"
:key="r.id"
:icon="r.icon"
:titre="r.titre"
:url="r.url"
:description="r.description"
/>
</div>
</div>
</section>
<!-- ══════════════ SECTION 4 — FMHY (cœur de la page) ══════════════ -->
<section class="outils-section outils-section--fmhy" aria-labelledby="sec-fmhy">
<h2 id="sec-fmhy" class="outils-section__title">
<span aria-hidden="true">🌳</span> Annuaire du web libre — la cartographie FMHY
</h2>
<p class="outils-section__desc">
FMHY (FreeMediaHeckYeah) est le plus grand index communautaire de ressources
gratuites du web : des milliers de liens classés et vérifiés par des centaines
de contributeurs bénévoles, mis à jour en continu. C'est une forme de
résistance numérique — accéder librement au savoir, à la culture et aux
outils, hors des catalogues marchands. J'en ai traduit et organisé les
entrées phares <strong>par usage</strong>, pour aller droit au but.
</p>
<!-- Note détaillée par usage -->
<div v-for="g in fmhyGuide" :key="g.id" class="fmhy-usage">
<h3 class="fmhy-usage__title">{{ g.titre }}</h3>
<p v-if="g.note" class="fmhy-usage__note">{{ g.note }}</p>
<ul class="fmhy-usage__list">
<li v-for="l in g.liens" :key="l.url" class="fmhy-usage__item">
<a
:href="l.url"
target="_blank"
rel="noopener noreferrer"
class="fmhy-usage__link"
>{{ l.nom }}</a>
<span class="fmhy-usage__desc">— {{ l.desc }}</span>
</li>
</ul>
</div>
<!-- Avertissement légal -->
<div class="fmhy-warning">
<h3 class="fmhy-warning__title">Avertissement</h3>
<p class="fmhy-warning__text">
Une partie des ressources indexées par FMHY relève du partage de contenus
protégés : la légalité dépend de ton pays et de l'usage que tu en fais.
Renseigne-toi avant d'utiliser ces liens. FMHY maintient une
<a href="https://fmhy.net/unsafe" target="_blank" rel="noopener noreferrer">liste des sites dangereux</a>
(malwares, arnaques) : consulte-la. En cas de doute, privilégie les sources
libres de droits (Project Gutenberg, Gallica, domaine public).
</p>
</div>
<p class="fmhy-snapshot">
Cartographie établie d'après un snapshot du 25 août 2026 — l'index fmhy
évolue en continu, voir
<a href="https://fmhy.net/" target="_blank" rel="noopener noreferrer">fmhy.net</a>.
</p>
<!-- Arbre curé interactif (sélection AEP) -->
<p class="fmhy-tree-label">Sélection interactive — clique sur les branches pour déplier</p>
<div class="fmhy-tree-wrap">
<div v-if="fmhyPending" class="fmhy-loading" aria-label="Chargement…">
<span>Chargement…</span>
</div>
<div v-else-if="fmhyError" class="fmhy-error">
Impossible de charger les ressources. <a href="https://fmhy.net/" target="_blank" rel="noopener noreferrer">Explorer fmhy.net →</a>
</div>
<TreeASCII v-else-if="fmhyData" :tree="fmhyData" :depth="0" />
</div>
<div class="fmhy-footer">
<a href="https://fmhy.net/" target="_blank" rel="noopener noreferrer" class="fmhy-footer__link">
Explorer tout l'arbre → fmhy.net
</a>
</div>
</section>
<!-- ══════════════ SECTION 5 — Placeholder login ══════════════ -->
<section class="outils-section outils-section--placeholder" aria-labelledby="sec-logiciels">
<div class="placeholder-block">
<span class="placeholder-block__badge">Bientôt — nécessite un compte</span>
<h2 id="sec-logiciels" class="placeholder-block__title">{{ outils?.section_5_placeholder?.titre }}</h2>
<p class="placeholder-block__desc">{{ outils?.section_5_placeholder?.description }}</p>
</div>
</section>
<!-- ══════════════ FOOTER CONTRIBUTION ══════════════ -->
<footer class="outils-footer">
<p class="outils-footer__text">
{{ outils?.footer_contribution }}
</p>
</footer>
</main>
</div>
</template>
<script setup lang="ts">
// Chargement des données
const { data: outils } = await useFetch('/data/outils.json')
const { data: fmhyData, pending: fmhyPending, error: fmhyError } = await useFetch('/data/fmhy-curated.json')
// Note détaillée FMHY — cartographie traduite et organisée par usage
// (entrées ★ « starred » de fmhy.net, snapshot du 25 août 2026)
const fmhyGuide = [
{
id: 'vie-privee',
titre: 'Vie privée & adblocking — les bases',
note: 'Le premier réflexe du guide débutant fmhy : un bon bloqueur de pubs rend la moitié du web à nouveau respirable.',
liens: [
{ nom: 'uBlock Origin', url: 'https://github.com/gorhill/uBlock', desc: 'bloqueur de pubs de référence, léger et open source' },
{ nom: 'SponsorBlock', url: 'https://sponsor.ajay.app/', desc: 'saute automatiquement les segments sponsorisés de YouTube' },
{ nom: 'LibreWolf', url: 'https://librewolf.net/', desc: 'Firefox durci vie privée, pré-configuré' },
{ nom: 'Proton VPN', url: 'https://protonvpn.com', desc: 'VPN suisse, offre gratuite illimitée' },
{ nom: 'Bitwarden', url: 'https://bitwarden.com/', desc: 'gestionnaire de mots de passe open source' },
{ nom: 'Cryptomator', url: 'https://cryptomator.org/', desc: 'chiffrement de tes fichiers avant envoi dans le cloud' },
{ nom: 'Tor Browser', url: 'https://www.torproject.org/', desc: 'navigation anonyme via le réseau Tor' },
{ nom: 'KeePassXC', url: 'https://keepassxc.org/', desc: 'coffre de mots de passe 100% local' }
]
},
{
id: 'livres',
titre: 'Trouver un livre / ebook',
liens: [
{ nom: "Anna's Archive", url: 'https://annas-archive.gl/', desc: 'la plus grosse bibliothèque du web : livres, BD, articles, thèses' },
{ nom: 'Z-Library', url: 'https://z-lib.gd/', desc: 'catalogue immense, interface soignée' },
{ nom: 'Library Genesis', url: 'https://libgen.li/', desc: 'référence pour les livres techniques et académiques' },
{ nom: 'Mobilism', url: 'https://forum.mobilism.org', desc: 'ebooks, audiobooks, magazines (forum)' },
{ nom: 'Project Gutenberg', url: 'https://www.gutenberg.org/', desc: '70 000+ classiques du domaine public, 100% légal' },
{ nom: 'Sci-Hub', url: 'https://sci-hub.se/', desc: 'accès libre aux articles scientifiques derrière paywall' },
{ nom: 'Calibre', url: 'https://calibre-ebook.com/', desc: 'gestion et conversion de bibliothèque numérique' },
{ nom: 'KOReader', url: 'https://koreader.rocks/', desc: 'lecteur ebook open source pour liseuses' }
]
},
{
id: 'films',
titre: 'Films, séries & anime',
liens: [
{ nom: 'Rive', url: 'https://www.rivestream.app/', desc: 'streaming films / séries / anime, auto-next' },
{ nom: 'Cineby', url: 'https://cineby.at/', desc: 'streaming films / séries / anime' },
{ nom: 'Flixer', url: 'https://flixer.gd', desc: 'streaming films / séries / anime' },
{ nom: 'Tubi', url: 'https://tubitv.com', desc: 'streaming légal et gratuit (financé par la pub)' },
{ nom: 'Stremio', url: 'https://www.stremio.com/', desc: 'centre multimédia extensible par extensions' },
{ nom: 'Miruro', url: 'https://www.miruro.com/', desc: 'anime en streaming' },
{ nom: 'Simkl', url: 'https://simkl.com/', desc: 'suivi de films, séries et anime déjà vus' }
]
},
{
id: 'musique',
titre: 'Musique & podcasts',
liens: [
{ nom: 'Monochrome', url: 'https://monochrome.tf/', desc: 'streaming musique dans le navigateur' },
{ nom: 'lucida', url: 'https://lucida.to/', desc: 'téléchargement de musiques' },
{ nom: 'SpotX', url: 'https://github.com/SpotX-Official/SpotX', desc: 'Spotify desktop sans pub (patch client)' },
{ nom: 'NTS Radio', url: 'https://www.nts.live/', desc: 'shows de DJ indépendants, archives immenses' },
{ nom: 'SomaFM', url: 'https://somafm.com/', desc: '30+ radios internet indépendantes' },
{ nom: 'Radio Garden', url: 'https://radio.garden/', desc: 'explorer les radios du monde entier sur un globe' },
{ nom: 'Pocket Casts', url: 'https://play.pocketcasts.com/', desc: 'lecteur de podcasts libre et complet, aussi dans le navigateur' }
]
},
{
id: 'logiciels',
titre: 'Logiciels & jeux vidéo',
liens: [
{ nom: 'qBittorrent', url: 'https://www.qbittorrent.org/', desc: 'client torrent libre, sans pub — la référence' },
{ nom: 'FitGirl Repacks', url: 'https://fitgirl-repacks.site/', desc: 'repacks de jeux ultra-compressés' },
{ nom: 'SteamRIP', url: 'https://steamrip.com/', desc: 'jeux pré-installés' },
{ nom: '1337x', url: 'https://1337x.to/', desc: 'annuaire torrents généraliste' }
]
},
{
id: 'mobile',
titre: 'Android / iOS',
liens: [
{ nom: 'Aurora Store', url: 'https://auroraoss.com/', desc: 'Google Play alternatif, sans compte Google' },
{ nom: 'Droid-ify', url: 'https://droidify.app/', desc: 'client F-Droid moderne — applications libres' },
{ nom: 'APKMirror', url: 'https://www.apkmirror.com/', desc: 'archives APK vérifiées' },
{ nom: 'Fossify', url: 'https://github.com/FossifyOrg', desc: 'suite d’apps Android simples et libres (galerie, agenda, fichiers…)' },
{ nom: 'Obtainium', url: 'https://obtainium.imranr.dev/', desc: 'installe et met à jour tes APKs depuis les sources officielles' }
]
},
{
id: 'education',
titre: 'Éducation, cours & recherche',
liens: [
{ nom: 'MIT OpenCourseWare', url: 'https://ocw.mit.edu/', desc: 'les cours du MIT en accès libre complet' },
{ nom: 'edX', url: 'https://www.edx.org/', desc: 'MOOCs de grandes universités' },
{ nom: 'Khan Academy', url: 'https://www.khanacademy.org/', desc: 'maths, sciences, économie — gratuit, du collège au supérieur' },
{ nom: 'Class Central', url: 'https://www.classcentral.com/', desc: 'moteur de recherche de cours en ligne' },
{ nom: 'WolframAlpha', url: 'https://www.wolframalpha.com/', desc: 'moteur de calcul et base de connaissances' },
{ nom: 'PhET', url: 'https://phet.colorado.edu/', desc: 'simulations interactives physique / chimie / maths' }
]
},
{
id: 'ia',
titre: 'Intelligence artificielle gratuite',
liens: [
{ nom: 'DeepSeek', url: 'https://chat.deepseek.com/', desc: 'modèle de pointe, usage illimité gratuit' },
{ nom: 'Qwen Studio', url: 'https://chat.qwen.ai/', desc: 'chat IA (Qwen) illimité gratuit' },
{ nom: 'Google AI Studio', url: 'https://aistudio.google.com/', desc: 'Gemini en accès généreux gratuit' },
{ nom: 'Mistral Le Chat', url: 'https://chat.mistral.ai/', desc: 'LLM français, gratuit' },
{ nom: 'LM Studio', url: 'https://lmstudio.ai/', desc: 'faire tourner des modèles en local, sans cloud' },
{ nom: 'Jan', url: 'https://jan.ai/', desc: 'application desktop libre pour IA locale' },
{ nom: 'Open WebUI', url: 'https://openwebui.com/', desc: 'interface web auto-hébergeable pour modèles locaux' }
]
},
{
id: 'francophone',
titre: 'Contenus francophones',
liens: [
{ nom: 'Gallica', url: 'https://gallica.bnf.fr/', desc: 'millions de documents numérisés de la BnF, domaine public' },
{ nom: 'Nos Livres', url: 'https://noslivres.net/', desc: 'classiques français du domaine public, formats propres' },
{ nom: 'Audiocite', url: 'https://www.audiocite.net/', desc: 'livres audio francophones du domaine public' },
{ nom: 'Littérature audio', url: 'https://www.litteratureaudio.com/', desc: 'autre grande bibliothèque audio francophone libre' },
{ nom: 'zone-ebook', url: 'https://zone-ebook.com/', desc: 'ebooks, magazines et journaux en français' },
{ nom: 'Dealabs', url: 'https://www.dealabs.com/', desc: 'bons plans et gratuités débusqués par la communauté' }
]
}
]
useSeoMeta({
title: 'Outils — AEP',
description: 'Outils partagés entre architectes : simulateurs, open source, ressources libres FMHY, bifurcation post-études.'
})
</script>
<style scoped>
/* ── Layout global ──────────────────────────────────────────── */
.outils-page {
max-width: 860px;
margin: 0 auto;
padding: 2rem 1.5rem 4rem;
color: var(--nav-text);
}
/* ── Header ─────────────────────────────────────────────────── */
.outils-header {
margin-bottom: 2.5rem;
}
.outils-header__inner {
display: flex;
align-items: flex-start;
gap: 1.25rem;
}
.outils-header__icon-wrap {
width: 3rem;
height: 3rem;
border-radius: 10px;
background: var(--nav-bg-alt);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
padding: 0.6rem;
}
.outils-header__icon {
width: 100%;
height: 100%;
object-fit: contain;
opacity: 0.75;
}
.outils-header__title {
font-size: 1.75rem;
font-weight: 700;
margin: 0 0 0.5rem;
color: var(--nav-text);
}
.outils-header__intro {
font-size: 0.9rem;
color: var(--nav-text-muted);
line-height: 1.65;
margin: 0;
max-width: 70ch;
}
/* ── Sections ───────────────────────────────────────────────── */
.outils-main {
display: flex;
flex-direction: column;
gap: 3rem;
}
.outils-section {
display: flex;
flex-direction: column;
gap: 1rem;
}
.outils-section__title {
font-size: 1.15rem;
font-weight: 700;
margin: 0;
color: var(--nav-text);
display: flex;
align-items: center;
gap: 0.5rem;
padding-bottom: 0.5rem;
border-bottom: 1.5px solid var(--nav-bg-alt);
}
.outils-section__subtitle {
font-size: 0.82rem;
color: var(--nav-text-muted);
margin: -0.5rem 0 0;
font-style: italic;
}
.outils-section__desc {
font-size: 0.88rem;
color: var(--nav-text-muted);
line-height: 1.65;
margin: 0;
max-width: 72ch;
}
/* ── Simulateurs ────────────────────────────────────────────── */
.outils-section--simulateurs {
gap: 1.25rem;
}
.simu-grid {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.simu-inspirations {
margin-top: 0.5rem;
}
.simu-inspirations__label {
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--nav-text-muted);
margin-bottom: 0.5rem;
}
/* ── Cards grid ─────────────────────────────────────────────── */
.outil-cards-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 0.75rem;
}
/* ── Section FMHY ───────────────────────────────────────────── */
.outils-section--fmhy {
background: var(--nav-bg-alt);
border-radius: 14px;
padding: 1.75rem;
gap: 1.25rem;
margin: 0 -0.25rem;
}
.fmhy-tree-wrap {
background: var(--nav-surface);
border: 1px solid var(--nav-bg-alt);
border-radius: 10px;
padding: 1.25rem 1.5rem;
overflow-x: auto;
}
.fmhy-loading,
.fmhy-error {
font-size: 0.85rem;
color: var(--nav-text-muted);
padding: 0.5rem 0;
}
.fmhy-error a {
color: var(--nav-primary-solid);
}
.fmhy-footer {
text-align: right;
}
.fmhy-footer__link {
font-size: 0.82rem;
font-weight: 600;
color: var(--nav-primary-solid);
text-decoration: none;
transition: opacity 0.15s;
}
.fmhy-footer__link:hover {
opacity: 0.75;
text-decoration: underline;
}
/* ── Bifurcation ────────────────────────────────────────────── */
.bifurcation-block {
display: flex;
flex-direction: column;
gap: 0.6rem;
}
.bifurcation-block__title {
font-size: 0.92rem;
font-weight: 600;
color: var(--nav-text);
margin: 0;
}
.bifurcation-block__desc {
font-size: 0.84rem;
color: var(--nav-text-muted);
margin: 0;
line-height: 1.55;
}
.bifurcation-block--coalition {
background: var(--nav-bg-alt);
border-radius: 8px;
padding: 0.875rem 1rem;
}
/* ── Liste OFQA ─────────────────────────────────────────────── */
.ofqa-list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 3px;
}
.ofqa-list__item {
display: flex;
}
.ofqa-list__link {
display: inline-flex;
align-items: baseline;
gap: 0.4rem;
flex-wrap: wrap;
padding: 3px 6px;
border-radius: 5px;
font-size: 0.84rem;
text-decoration: none;
color: var(--nav-text);
transition: background 0.1s;
}
.ofqa-list__link:not(.ofqa-list__link--disabled):hover {
background: var(--nav-bg-alt);
color: var(--nav-primary-solid);
text-decoration: underline;
}
.ofqa-list__link--disabled {
color: var(--nav-text-muted);
cursor: default;
}
.ofqa-list__ep {
font-family: 'JetBrains Mono', 'Courier New', monospace;
font-size: 0.75rem;
font-weight: 600;
color: var(--nav-text-muted);
flex-shrink: 0;
min-width: 4.5rem;
}
.ofqa-list__titre {
font-weight: 500;
}
.ofqa-list__personnes {
color: var(--nav-text-muted);
font-size: 0.82rem;
}
.ofqa-list__note {
color: var(--nav-text-muted);
font-size: 0.78rem;
font-style: italic;
}
/* ── Section 5 placeholder ──────────────────────────────────── */
.outils-section--placeholder {
opacity: 0.6;
}
.placeholder-block {
border: 1.5px dashed var(--nav-bg-alt);
border-radius: 12px;
padding: 1.25rem 1.5rem;
display: flex;
flex-direction: column;
gap: 0.4rem;
}
.placeholder-block__badge {
font-size: 0.68rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--nav-text-muted);
}
.placeholder-block__title {
font-size: 0.95rem;
font-weight: 600;
color: var(--nav-text);
margin: 0;
}
.placeholder-block__desc {
font-size: 0.84rem;
color: var(--nav-text-muted);
margin: 0;
line-height: 1.5;
}
/* ── Footer ─────────────────────────────────────────────────── */
.outils-footer {
padding-top: 1rem;
border-top: 1px solid var(--nav-bg-alt);
text-align: center;
}
.outils-footer__text {
font-size: 0.84rem;
color: var(--nav-text-muted);
margin: 0;
}
/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
.outils-page {
padding: 1.25rem 1rem 4rem;
}
.outils-header__inner {
flex-direction: column;
gap: 0.75rem;
}
.outils-header__title {
font-size: 1.4rem;
}
.outil-cards-grid {
grid-template-columns: 1fr;
}
.outils-section--fmhy {
padding: 1.25rem 1rem;
margin: 0 -0.5rem;
}
/* ── Note FMHY détaillée (par usage) ────────────────────────── */
.fmhy-usage {
display: flex;
flex-direction: column;
gap: 0.35rem;
}
.fmhy-usage__title {
font-size: 0.92rem;
font-weight: 650;
color: var(--nav-text);
margin: 0;
}
.fmhy-usage__note {
font-size: 0.8rem;
color: var(--nav-text-muted);
font-style: italic;
margin: 0;
line-height: 1.5;
}
.fmhy-usage__list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.fmhy-usage__item {
font-size: 0.84rem;
line-height: 1.5;
padding: 2px 6px;
border-radius: 5px;
}
.fmhy-usage__item:hover {
background: var(--nav-surface);
}
.fmhy-usage__link {
color: var(--nav-primary-solid);
font-weight: 500;
text-decoration: none;
}
.fmhy-usage__link:hover {
text-decoration: underline;
}
.fmhy-usage__desc {
color: var(--nav-text-muted);
}
.fmhy-warning {
background: var(--nav-surface);
border: 1px solid var(--nav-bg-alt);
border-left: 3px solid var(--nav-primary-solid);
border-radius: 8px;
padding: 0.875rem 1rem;
display: flex;
flex-direction: column;
gap: 0.35rem;
}
.fmhy-warning__title {
font-size: 0.85rem;
font-weight: 650;
color: var(--nav-text);
margin: 0;
}
.fmhy-warning__text {
font-size: 0.82rem;
color: var(--nav-text-muted);
line-height: 1.6;
margin: 0;
}
.fmhy-warning__text a {
color: var(--nav-primary-solid);
}
.fmhy-snapshot {
font-size: 0.78rem;
color: var(--nav-text-muted);
font-style: italic;
margin: 0;
}
.fmhy-snapshot a {
color: var(--nav-primary-solid);
}
.fmhy-tree-label {
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--nav-text-muted);
margin: 0.5rem 0 -0.5rem;
}
.fmhy-tree-wrap {
padding: 0.875rem 0.75rem;
}
}
</style>
+248
View File
@@ -0,0 +1,248 @@
<template>
<div class="proposer-page">
<div class="proposer-inner">
<NuxtLink to="/" class="back-link">← Retour à la carte</NuxtLink>
<div class="proposer-header">
<h1>Proposer une ressource</h1>
<p class="proposer-subtitle">
Colle un lien (ou plusieurs), dis en quelques mots pourquoi c'est utile — on s'occupe du reste.
On valide manuellement avant publication.
</p>
</div>
<div v-if="success" class="success-block" role="status" aria-live="polite">
<div class="success-icon">✓</div>
<h2>Merci !</h2>
<p>Ta proposition est en attente de modération.</p>
<p class="success-detail">Jules valide manuellement chaque entrée avant publication.</p>
<button type="button" class="btn-secondary" @click="reset">Proposer autre chose</button>
</div>
<template v-else>
<FormLibre :preset-type="presetType" @success="onSuccess" />
<div class="mode-detaille">
<button
type="button"
class="mode-detaille-toggle"
:aria-expanded="detailleOuvert"
aria-controls="mode-detaille-panel"
@click="detailleOuvert = !detailleOuvert"
>
{{ detailleOuvert ? '− Fermer le mode détaillé' : '+ Mode détaillé (formulaires par catégorie)' }}
</button>
<div v-if="detailleOuvert" id="mode-detaille-panel" class="mode-detaille-panel">
<p class="mode-detaille-hint">
Pour aller plus loin qu'un lien + quelques mots : échelle, fonctions, ville... un formulaire par catégorie.
</p>
<div class="tabs-bar">
<button
v-for="tab in TABS"
:key="tab.id"
type="button"
class="tab-btn"
:class="{ 'tab-btn--active': activeTab === tab.id }"
@click="activeTab = tab.id"
>{{ tab.label }}</button>
</div>
<div class="tab-content">
<FormEcosysteme v-if="activeTab === 'ecosysteme'" @success="onSuccess" />
<FormReseau v-else-if="activeTab === 'reseau'" @success="onSuccess" />
<FormJobs v-else-if="activeTab === 'jobs'" @success="onSuccess" />
<FormOutils v-else-if="activeTab === 'outils'" @success="onSuccess" />
<FormReferences v-else-if="activeTab === 'references'" @success="onSuccess" />
</div>
</div>
</div>
</template>
</div>
</div>
</template>
<script setup lang="ts">
import { TYPES_SUGGERES, type TypeSuggere } from '~/utils/submitLibre'
const TABS = [
{ id: 'ecosysteme', label: 'Écosystème / Entraide' },
{ id: 'reseau', label: 'Réseau AEP' },
{ id: 'jobs', label: 'Jobs' },
{ id: 'outils', label: 'Outils' },
{ id: 'references', label: 'Références (bibliothèque)' },
] as const
// ?categorie=outils (lien « Proposer une ressource » des têtes d'échelle) présélectionne
// le chip du formulaire assoupli ET l'onglet du mode détaillé si l'un ou l'autre est ouvert.
const route = useRoute()
const categorie = String(route.query.categorie ?? '')
const presetType = computed<TypeSuggere | undefined>(() =>
(TYPES_SUGGERES as readonly string[]).includes(categorie) ? (categorie as TypeSuggere) : undefined,
)
const activeTab = ref<string>(TABS.some(t => t.id === categorie) ? categorie : 'ecosysteme')
const detailleOuvert = ref(false)
const success = ref(false)
function onSuccess() {
success.value = true
}
function reset() {
success.value = false
activeTab.value = 'ecosysteme'
detailleOuvert.value = false
}
useHead({ title: 'Proposer une ressource — AEP' })
</script>
<style scoped>
.proposer-page {
min-height: 100vh;
background: var(--nav-bg);
padding: 1.5rem 1rem 4rem;
}
.proposer-inner {
max-width: 680px;
margin: 0 auto;
}
.back-link {
display: inline-flex;
align-items: center;
gap: 0.25rem;
font-size: 0.875rem;
color: var(--nav-primary-solid);
opacity: 0.7;
text-decoration: none;
margin-bottom: 1.5rem;
transition: opacity 0.15s;
}
.back-link:hover { opacity: 1; }
.proposer-header { margin-bottom: 1.5rem; }
.proposer-header h1 {
font-size: 1.5rem;
font-weight: 700;
color: var(--nav-text);
margin: 0 0 0.5rem;
}
.proposer-subtitle {
font-size: 0.9rem;
color: var(--nav-text-muted);
line-height: 1.5;
margin: 0;
}
.mode-detaille {
margin-top: 2rem;
border-top: 1px solid var(--nav-bg-alt);
padding-top: 1.25rem;
}
.mode-detaille-toggle {
background: transparent;
border: none;
color: var(--nav-text-muted);
font-size: 0.85rem;
cursor: pointer;
font-family: inherit;
padding: 0.25rem 0;
text-decoration: underline;
text-underline-offset: 2px;
}
.mode-detaille-toggle:hover { color: var(--nav-text); }
.mode-detaille-panel { margin-top: 1rem; }
.mode-detaille-hint {
font-size: 0.8rem;
color: var(--nav-text-muted);
margin: 0 0 1rem;
}
.tabs-bar {
display: flex;
flex-wrap: wrap;
gap: 0.25rem;
margin-bottom: 1.5rem;
border-bottom: 1px solid var(--nav-bg-alt);
padding-bottom: 0;
}
.tab-btn {
padding: 0.5rem 0.9rem;
font-size: 0.8rem;
font-weight: 500;
color: var(--nav-text-muted);
background: transparent;
border: none;
border-bottom: 2px solid transparent;
cursor: pointer;
font-family: inherit;
transition: color 0.15s, border-color 0.15s;
white-space: nowrap;
}
.tab-btn:hover { color: var(--nav-text); }
.tab-btn--active {
color: var(--nav-text);
border-bottom-color: var(--nav-primary-solid);
font-weight: 600;
}
.tab-content {
min-height: 300px;
}
.success-block {
background: var(--nav-surface);
border: 1px solid rgba(26, 34, 56, 0.15);
border-radius: 12px;
padding: 2rem 1.5rem;
text-align: center;
}
.success-icon {
width: 48px; height: 48px;
background: rgba(26, 34, 56, 0.1);
color: var(--nav-text);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.25rem;
font-weight: 700;
margin: 0 auto 1rem;
}
.success-block h2 {
font-size: 1.25rem;
font-weight: 700;
color: var(--nav-text);
margin: 0 0 0.5rem;
}
.success-block p {
font-size: 0.9rem;
color: var(--nav-text-muted);
margin: 0 0 0.5rem;
line-height: 1.5;
}
.success-detail { font-size: 0.85rem !important; }
.btn-secondary {
padding: 0.75rem 1.25rem;
background: transparent;
color: var(--nav-text-muted);
border: 1px solid rgba(26, 34, 56, 0.2);
border-radius: 8px;
font-size: 0.9rem;
cursor: pointer;
font-family: inherit;
text-decoration: none;
display: inline-flex;
align-items: center;
margin-top: 0.5rem;
transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover {
border-color: var(--nav-primary-solid);
color: var(--nav-text);
}
@media (max-width: 480px) {
.proposer-page { padding: 1rem 0.75rem 3rem; }
.tabs-bar { overflow-x: auto; flex-wrap: nowrap; }
}
</style>
+1 -36
View File
@@ -1,38 +1,3 @@
<template>
<div class="flex flex-col items-center justify-center h-full gap-6" style="background: var(--nav-bg);">
<div class="text-center max-w-md px-6">
<div
class="inline-flex items-center justify-center w-14 h-14 rounded-2xl mb-5"
style="background: var(--nav-bg-alt);"
>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="color: var(--nav-text-muted);">
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/>
<polyline points="3.27 6.96 12 12.01 20.73 6.96"/>
<line x1="12" y1="22.08" x2="12" y2="12"/>
</svg>
</div>
<h1 class="text-2xl font-bold mb-3" style="color: var(--nav-text);">RAG — Retrieval Augmented Generation</h1>
<p class="text-sm leading-relaxed mb-6" style="color: var(--nav-text-muted);">
Une base de connaissances interrogeable par IA — textes, rapports, manifestes et ressources documentaires sur l'architecture d'écologie politique.
</p>
<p class="text-xs font-semibold uppercase tracking-widest mb-6" style="color: var(--nav-text-muted); opacity: 0.6;">
Bientôt disponible
</p>
<NuxtLink
to="/"
class="inline-flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-semibold transition-all hover:opacity-80"
style="background: var(--nav-primary); color: var(--nav-text-on-primary);"
>
<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="19" y1="12" x2="5" y2="12"/>
<polyline points="12 19 5 12 12 5"/>
</svg>
Retour à l'écosystème
</NuxtLink>
</div>
</div>
</template>
<script setup lang="ts">
useHead({ title: 'RAG — AEP (bientôt disponible)' })
navigateTo('/media', { redirectCode: 301 })
</script>
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More