Lot ⑥b étape E : mesures et porte de vitesse ; le style du territoire part avec sa vue, l'attribution d'OSM n'est plus couverte, les tuiles sans fondu

- maquette/territoire.css : les règles de la vue quittent style.css (la démo n'en paie rien).
- « Voir le système » monte sous le sélecteur, le « + » au-dessus de l'attribution : aucun bouton ne la couvre (mesuré, 0 chevauchement).
- fadeAnimation coupé : une tuile arrivée se montre tout de suite ; la démo se construit une image après les tuiles.
- tests/xl-v1.test.ts : un build complet dans un dossier temporaire (Leaflet hors de la démo, maplibre et pmtiles absents, un seul hôte de tuiles) ; 11 cas.

Mesuré (vite preview, Edge sans tête, 390 × 844 DPR 3) : territoire lisible en 4G lente émulée à 4,6 s (page) / 5,0 s (banc) ; démo et mode fond inchangés (+0,05 %, 0 px).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWGVn2UNwGqueVvbjxnWNc
This commit is contained in:
Jules Nény
2026-11-11 10:54:55 +01:00
co-authored by Claude Opus 5.5
parent 84dbbbdf5b
commit 93c279db3f
4 changed files with 104 additions and 64 deletions
-61
View File
@@ -352,67 +352,6 @@ body.etape-ouverte #fiches { display: none; }
/* « Voir le vrai territoire » / « Voir le système » : au zoom arrière maximal de chaque vue, au milieu en bas */
.vers-vue { position: fixed; z-index: 7; left: 50%; transform: translateX(-50%); bottom: calc(var(--h-fiches, 60px) + env(safe-area-inset-bottom, 0px) + 14px); min-height: 44px; padding: 0 18px;
border: 0; border-radius: 999px; background: var(--quartier-encre); color: #fff; font: 600 15px/1 Barlow, sans-serif; box-shadow: var(--ombre); white-space: nowrap; }
#territoire .vers-vue { position: absolute; bottom: calc(var(--bas-t) + 14px); z-index: 1000; }
@media (min-width: 900px) { .vers-vue { bottom: 24px; } }
/* la vue territoire : la carte couvre la page sous le sticky ; la maquette se tait dessous */
#territoire { --bas-t: calc(64px + env(safe-area-inset-bottom, 0px)); position: fixed; inset: 0; z-index: 3; background: var(--papier); }
#territoire .t-carte { position: absolute; inset: 0 0 var(--bas-t) 0; background: #e8e6dc; font: 13px/1.4 Barlow, system-ui, sans-serif; }
#territoire .t-etat { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); margin: 0; z-index: 1001; background: var(--papier-2); border: 1px solid var(--trait); border-radius: 12px; padding: 10px 14px; box-shadow: var(--ombre); }
#territoire .t-etat:empty { display: none; }
body.sur-territoire :is(#fiches, #etape-carte, #b-tourner, #b-vers-territoire) { display: none !important; }
/* les contrôles natifs de Leaflet, au trait du site : 44 px au doigt, sous le sélecteur */
#territoire .leaflet-top { top: calc(env(safe-area-inset-top, 0px) + 112px); }
#territoire .leaflet-control-zoom { border: 1px solid var(--trait); border-radius: 12px; box-shadow: var(--ombre); overflow: hidden; }
#territoire .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; font: 600 22px/44px Barlow, sans-serif; color: var(--encre); background: var(--papier-2); }
#territoire .leaflet-control-attribution { font: 12px/1.35 Barlow, sans-serif; background: rgba(255, 253, 246, .92); color: var(--encre-2); padding: 2px 7px; max-width: calc(100vw - 16px); }
#territoire .leaflet-control-attribution a { color: var(--eau-encre); }
#territoire .leaflet-container:focus-visible { outline: 3px solid var(--eau-encre); outline-offset: -3px; }
@media (min-width: 900px) { #territoire .leaflet-top { top: 120px; } }
#territoire .t-barre { position: absolute; left: 0; right: 0; bottom: 0; height: var(--bas-t); box-sizing: border-box; padding: 0 12px env(safe-area-inset-bottom, 0px); display: flex; align-items: center; gap: 10px;
background: var(--papier-2); border-top: 1px solid var(--trait); box-shadow: 0 -8px 28px rgba(16, 42, 58, .12); z-index: 1000; }
#territoire .t-titre { flex: 1; min-width: 0; font: 600 15px/1.15 "Barlow Condensed", Barlow, sans-serif; color: var(--encre-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* la légende, au bas de la carte */
#territoire .t-b-legende { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 8px; border: 1px solid var(--trait); border-radius: 999px; background: #fff; box-shadow: var(--ombre); font: 600 15px/1 Barlow, sans-serif; color: var(--encre); }
#territoire .t-b-legende[aria-expanded="true"] { background: var(--encre); color: var(--papier-2); border-color: var(--encre); }
#territoire .t-pictos { display: flex; }
#territoire .t-pictos svg { width: 26px; height: 26px; margin-right: -7px; }
#territoire .t-pictos svg:last-child { margin-right: 2px; }
/* les lieux : un pictogramme de 36 px dans une cible de 44 */
#territoire .t-ep-icone { background: none; border: 0; }
#territoire .t-ep { width: 44px; height: 44px; padding: 4px; border: 0; background: none; border-radius: 50%; cursor: pointer; transition: opacity .25s, transform .2s; }
#territoire .t-ep svg { display: block; width: 36px; height: 36px; filter: drop-shadow(0 2px 4px rgba(16, 42, 58, .35)); }
#territoire .t-ep.actif { transform: scale(1.18); }
#territoire .t-ep.estompe { opacity: .28; }
#territoire .t-ep:focus-visible { outline: 3px solid var(--eau-encre); outline-offset: 0; }
/* les panneaux du bas : la légende, un lieu */
#territoire .t-panneau { position: absolute; z-index: 1002; left: 0; right: 0; bottom: 0; max-height: min(62vh, 520px); overflow: auto; box-sizing: border-box; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
background: var(--papier-2); border-top: 1px solid var(--trait); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 28px rgba(16, 42, 58, .16); }
#territoire .t-tete { display: flex; gap: 10px; align-items: flex-start; }
#territoire .t-tete h2 { margin: 2px 0 0; font: 600 20px/1.15 "Barlow Condensed", Barlow, sans-serif; }
#territoire .t-fermer { order: 9; margin-left: auto; flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--trait); border-radius: 50%; background: #fff; }
#territoire .t-fermer svg { width: 20px; height: 20px; }
#territoire .t-icone svg { width: 48px; height: 48px; display: block; }
#territoire .t-type { font: 600 13px/1.2 Barlow, sans-serif; text-transform: uppercase; letter-spacing: .04em; }
#territoire .t-panneau p { margin: 10px 0 0; }
#territoire .t-statut, #territoire .t-position, #territoire .t-aide { font-size: 13.5px; color: var(--encre-2); }
#territoire .t-lien { display: inline-block; margin-top: 10px; color: var(--eau-encre); font-weight: 600; min-height: 44px; line-height: 44px; }
#territoire .t-types { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
#territoire .t-types button { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; min-height: 44px; padding: 2px 8px; border: 1px solid transparent; border-radius: 10px; background: none; text-align: left; }
#territoire .t-types button svg { width: 34px; height: 34px; }
#territoire .t-types button[aria-pressed="true"] { border-color: var(--encre); background: #fff; }
#territoire .t-types button:disabled { cursor: default; opacity: .5; }
#territoire .t-types .t-lib { font-weight: 600; }
#territoire .t-types .t-n { font-size: 13px; color: var(--encre-2); white-space: nowrap; }
#territoire.panneau-ouvert .vers-vue { display: none; }
@media (min-width: 900px) { #territoire .t-panneau { left: 16px; right: auto; bottom: calc(var(--bas-t) + 12px); width: 400px; border: 1px solid var(--trait); border-radius: 16px; } }
@media (prefers-reduced-motion: reduce) { #territoire .t-ep { transition: none; } }
/* le « + » : ajouter un lieu, rond, en bas à droite, au-dessus de l'attribution */
#territoire .t-plus { position: absolute; z-index: 1001; right: 12px; bottom: calc(var(--bas-t) + 34px); width: 52px; height: 52px; padding: 0; display: grid; place-items: center;
border: 0; border-radius: 50%; background: var(--quartier-encre); color: #fff; box-shadow: var(--ombre); }
#territoire .t-plus svg { width: 26px; height: 26px; }
#territoire .t-plus[aria-expanded="true"] { background: var(--encre); }
#territoire.panneau-ouvert .t-plus { display: none; }
#territoire .t-fonction { font-weight: 600; }
#territoire .t-adresse { padding: 8px 10px; border-left: 3px solid var(--quartier); background: var(--quartier-fond); border-radius: 0 8px 8px 0; }
#territoire .t-proposer { display: inline-flex; align-items: center; margin-top: 14px; min-height: 44px; padding: 0 16px; border-radius: 10px; background: var(--quartier-encre); color: #fff; font-weight: 600; text-decoration: none; }
+64
View File
@@ -0,0 +1,64 @@
/* La vue « Le territoire » (lot ⑥b, 11/11) : chargée avec elle (maquette/territoire.js), la démo n'en paie rien. */
/* « Voir le système » : en haut, sous le sélecteur (en bas, il couvrirait l'attribution d'OSM, que la politique des tuiles interdit de cacher) */
#territoire .vers-vue { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 116px); bottom: auto; z-index: 1000; }
@media (min-width: 900px) { #territoire .vers-vue { top: 120px; bottom: auto; } }
/* la vue territoire : la carte couvre la page sous le sticky ; la maquette se tait dessous */
#territoire { --bas-t: calc(64px + env(safe-area-inset-bottom, 0px)); position: fixed; inset: 0; z-index: 3; background: var(--papier); }
#territoire .t-carte { position: absolute; inset: 0 0 var(--bas-t) 0; background: #e8e6dc; font: 13px/1.4 Barlow, system-ui, sans-serif; }
#territoire .t-etat { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); margin: 0; z-index: 1001; background: var(--papier-2); border: 1px solid var(--trait); border-radius: 12px; padding: 10px 14px; box-shadow: var(--ombre); }
#territoire .t-etat:empty { display: none; }
/* les contrôles natifs de Leaflet, au trait du site : 44 px au doigt, sous le sélecteur */
#territoire .leaflet-top { top: calc(env(safe-area-inset-top, 0px) + 112px); }
#territoire .leaflet-control-zoom { border: 1px solid var(--trait); border-radius: 12px; box-shadow: var(--ombre); overflow: hidden; }
#territoire .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; font: 600 22px/44px Barlow, sans-serif; color: var(--encre); background: var(--papier-2); }
#territoire .leaflet-control-attribution { font: 12px/1.35 Barlow, sans-serif; background: rgba(255, 253, 246, .92); color: var(--encre-2); padding: 2px 7px; max-width: calc(100vw - 16px); }
#territoire .leaflet-control-attribution a { color: var(--eau-encre); }
#territoire .leaflet-container:focus-visible { outline: 3px solid var(--eau-encre); outline-offset: -3px; }
@media (min-width: 900px) { #territoire .leaflet-top { top: 120px; } }
#territoire .t-barre { position: absolute; left: 0; right: 0; bottom: 0; height: var(--bas-t); box-sizing: border-box; padding: 0 12px env(safe-area-inset-bottom, 0px); display: flex; align-items: center; gap: 10px;
background: var(--papier-2); border-top: 1px solid var(--trait); box-shadow: 0 -8px 28px rgba(16, 42, 58, .12); z-index: 1000; }
#territoire .t-titre { flex: 1; min-width: 0; font: 600 15px/1.15 "Barlow Condensed", Barlow, sans-serif; color: var(--encre-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* la légende, au bas de la carte */
#territoire .t-b-legende { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 8px; border: 1px solid var(--trait); border-radius: 999px; background: #fff; box-shadow: var(--ombre); font: 600 15px/1 Barlow, sans-serif; color: var(--encre); }
#territoire .t-b-legende[aria-expanded="true"] { background: var(--encre); color: var(--papier-2); border-color: var(--encre); }
#territoire .t-pictos { display: flex; }
#territoire .t-pictos svg { width: 26px; height: 26px; margin-right: -7px; }
#territoire .t-pictos svg:last-child { margin-right: 2px; }
/* les lieux : un pictogramme de 36 px dans une cible de 44 */
#territoire .t-ep-icone { background: none; border: 0; }
#territoire .t-ep { width: 44px; height: 44px; padding: 4px; border: 0; background: none; border-radius: 50%; cursor: pointer; transition: opacity .25s, transform .2s; }
#territoire .t-ep svg { display: block; width: 36px; height: 36px; filter: drop-shadow(0 2px 4px rgba(16, 42, 58, .35)); }
#territoire .t-ep.actif { transform: scale(1.18); }
#territoire .t-ep.estompe { opacity: .28; }
#territoire .t-ep:focus-visible { outline: 3px solid var(--eau-encre); outline-offset: 0; }
/* les panneaux du bas : la légende, un lieu */
#territoire .t-panneau { position: absolute; z-index: 1002; left: 0; right: 0; bottom: 0; max-height: min(62vh, 520px); overflow: auto; box-sizing: border-box; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
background: var(--papier-2); border-top: 1px solid var(--trait); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 28px rgba(16, 42, 58, .16); }
#territoire .t-tete { display: flex; gap: 10px; align-items: flex-start; }
#territoire .t-tete h2 { margin: 2px 0 0; font: 600 20px/1.15 "Barlow Condensed", Barlow, sans-serif; }
#territoire .t-fermer { order: 9; margin-left: auto; flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--trait); border-radius: 50%; background: #fff; }
#territoire .t-fermer svg { width: 20px; height: 20px; }
#territoire .t-icone svg { width: 48px; height: 48px; display: block; }
#territoire .t-type { font: 600 13px/1.2 Barlow, sans-serif; text-transform: uppercase; letter-spacing: .04em; }
#territoire .t-panneau p { margin: 10px 0 0; }
#territoire .t-statut, #territoire .t-position, #territoire .t-aide { font-size: 13.5px; color: var(--encre-2); }
#territoire .t-lien { display: inline-block; margin-top: 10px; color: var(--eau-encre); font-weight: 600; min-height: 44px; line-height: 44px; }
#territoire .t-types { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
#territoire .t-types button { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; min-height: 44px; padding: 2px 8px; border: 1px solid transparent; border-radius: 10px; background: none; text-align: left; }
#territoire .t-types button svg { width: 34px; height: 34px; }
#territoire .t-types button[aria-pressed="true"] { border-color: var(--encre); background: #fff; }
#territoire .t-types button:disabled { cursor: default; opacity: .5; }
#territoire .t-types .t-lib { font-weight: 600; }
#territoire .t-types .t-n { font-size: 13px; color: var(--encre-2); white-space: nowrap; }
#territoire.panneau-ouvert .vers-vue { display: none; }
@media (min-width: 900px) { #territoire .t-panneau { left: 16px; right: auto; bottom: calc(var(--bas-t) + 12px); width: 400px; border: 1px solid var(--trait); border-radius: 16px; } }
@media (prefers-reduced-motion: reduce) { #territoire .t-ep { transition: none; } }
/* le « + » : ajouter un lieu, rond, en bas à droite, au-dessus de l'attribution */
#territoire .t-plus { position: absolute; z-index: 1001; right: 12px; bottom: calc(var(--bas-t) + 64px); width: 52px; height: 52px; padding: 0; display: grid; place-items: center;
border: 0; border-radius: 50%; background: var(--quartier-encre); color: #fff; box-shadow: var(--ombre); }
#territoire .t-plus svg { width: 26px; height: 26px; }
#territoire .t-plus[aria-expanded="true"] { background: var(--encre); }
#territoire.panneau-ouvert .t-plus { display: none; }
#territoire .t-fonction { font-weight: 600; }
#territoire .t-adresse { padding: 8px 10px; border-left: 3px solid var(--quartier); background: var(--quartier-fond); border-radius: 0 8px 8px 0; }
#territoire .t-proposer { display: inline-flex; align-items: center; margin-top: 14px; min-height: 44px; padding: 0 16px; border-radius: 10px; background: var(--quartier-encre); color: #fff; font-weight: 600; text-decoration: none; }
+4 -3
View File
@@ -6,6 +6,7 @@
// Dessus : les lieux (content/xl-epingles.md), un pictogramme par type (content/xl-types.md, maquette/pictos-xl.ts), une
// légende qui met un type en avant, un panneau par lieu. Une seule couche de lieux, filtrable par type (Jules, 07/11).
import 'leaflet/dist/leaflet.css';
import './territoire.css';
import { Map as Carte, TileLayer, Control, LatLngBounds, Marker, DivIcon } from 'leaflet';
import { EPINGLES, TYPES, TEXTES, RECTANGLE } from 'virtual:territoire';
import { FOND, ZOOM_MIN, ZOOM_MAX } from './fond-carte.ts';
@@ -28,7 +29,7 @@ export function creerTerritoire({ $, reduit, vues, couleurs, onSysteme }) {
zoomControl: false, attributionControl: false,
// les gestes natifs : un doigt déplace, deux doigts zooment ; molette au bureau ; flèches et +/− au clavier
dragging: true, touchZoom: true, scrollWheelZoom: true, doubleClickZoom: true, boxZoom: false, keyboard: true,
zoomAnimation: !reduit, fadeAnimation: !reduit, markerZoomAnimation: !reduit, inertia: !reduit,
zoomAnimation: !reduit, fadeAnimation: false, markerZoomAnimation: !reduit, inertia: !reduit,
});
// les tuiles : rien hors du rectangle élargi, pas de tuiles « retina » (4 fois plus d'images au téléphone), aucun
// préchargement : Leaflet ne demande que les tuiles de la vue (keepBuffer garde, il ne charge pas)
@@ -169,7 +170,7 @@ export function creerTerritoire({ $, reduit, vues, couleurs, onSysteme }) {
},
cacher() { fermer(false); },
/** Les tuiles de la vue sont arrivées (ou `ms` ont passé) : la démo peut se construire derrière (main.js). */
// (la démo attend encore le fondu des tuiles, 260 ms : elle occupe le processeur une seconde en se construisant)
tuiles: (ms) => new Promise((ok) => { const t = setTimeout(ok, ms); couche.once('load', () => { clearTimeout(t); setTimeout(ok, reduit ? 0 : 260); }); }),
// (sans fondu : une tuile arrivée se montre tout de suite ; la démo attend une image, puis occupe le processeur une seconde)
tuiles: (ms) => new Promise((ok) => { const t = setTimeout(ok, ms); couche.once('load', () => { clearTimeout(t); requestAnimationFrame(() => setTimeout(ok, 0)); }); }),
};
}