diff --git a/index.html b/index.html index b4884dd..c630ace 100644 --- a/index.html +++ b/index.html @@ -27,7 +27,7 @@ - + diff --git a/maquette/main.js b/maquette/main.js index 3838be3..c54e3c5 100644 --- a/maquette/main.js +++ b/maquette/main.js @@ -38,6 +38,7 @@ import { ANCRES, BARRE, BUREAU_MIN, LIBELLES, echelleDe, etatCamera, etatDepart, import { PAS, etapesDe, demarrer, allumage, aller as allerEtape, pause as pauseAllumage, reprendre, indexDe, debutChapitre } from './allumage.ts'; import { TRAIT_SEUL, maisonTrait, allumer, vueS, VUE_S_DEPART } from './maison-trait.ts'; import { arrivee, surcouche } from './arrivee.ts'; +import { COLONNE_MIN, COLONNE_L, COLONNE_MARGE } from './documents-carte.ts'; const $ = (id) => document.getElementById(id); const nomDe = (k) => k.split('/').pop().replace(/\.(png|jpg)$/, ''); @@ -612,13 +613,23 @@ const ficheCarte = () => (E.epoque === 'auj' ? 'auj-loin' : 'quartier-horscamp') // la barre de la carte se pose sous le sticky function hautCarte() { $('carte').style.setProperty('--haut-carte', `${hautLibre() - 2}px`); } // La zone libre de la carte : sous le sticky et la barre de la carte, au-dessus du bandeau dans son état (le plein garde celle du résumé). +// Lot ⑥c : la colonne des documents (bureau, ≥ 1 024 px) prend 336 px à droite ; la rangée (téléphone) prend le bas. function libre(r) { const o = $('carte-outils').getBoundingClientRect(), haut = Math.max(o.bottom + 8, hautLibre()); const ec = !$('etape-carte').hidden, B = ec ? bandeauEtape : bandeau, sec = ec ? $('etape-carte') : $('fiches'); - if (sec.hidden || getComputedStyle(sec).display === 'none') return { x0: 0, y0: haut, x1: r.width, y1: r.height }; - const e = etatCamera(B.etat), h = B.hauteur(e) + B.safe(); - if (bureau()) return e === 'barre' ? { x0: 0, y0: haut, x1: r.width, y1: r.height - h - 24 } : { x0: sec.offsetLeft + sec.offsetWidth + 8, y0: haut, x1: r.width, y1: r.height }; - return { x0: 0, y0: haut, x1: r.width, y1: Math.max(haut + 140, r.height - h - 6) }; + let L; + if (sec.hidden || getComputedStyle(sec).display === 'none') L = { x0: 0, y0: haut, x1: r.width, y1: r.height }; + else { + const e = etatCamera(B.etat), h = B.hauteur(e) + B.safe(); + if (bureau()) L = e === 'barre' ? { x0: 0, y0: haut, x1: r.width, y1: r.height - h - 24 } : { x0: sec.offsetLeft + sec.offsetWidth + 8, y0: haut, x1: r.width, y1: r.height }; + else L = { x0: 0, y0: haut, x1: r.width, y1: Math.max(haut + 140, r.height - h - 6) }; + } + const d = $('c-docs'), dr = d.getBoundingClientRect(); + if (dr.width && getComputedStyle(d).visibility !== 'hidden') { + if (innerWidth >= COLONNE_MIN) L.x1 = Math.min(L.x1, r.width - COLONNE_L - COLONNE_MARGE); + else L.y1 = Math.max(L.y0 + 140, Math.min(L.y1, dr.top - r.top - 6)); + } + return L; } // Une étape touchée sur la carte : le même bandeau, en résumé ; on recadre l'étape une fois le bandeau posé (N14). function onEtape(ouverte) { @@ -773,4 +784,6 @@ if (sActif()) poserVueS(vueS({ phase: 'S', t0: 0 }, { actif: true, vol: false, r if (!cache && a && a.parentElement === clavier) placerParcelle(a); })(); if (/[?&]mesure\b/.test(location.search)) window.__quartierS = { phase: () => VS.phase, opacite: () => VS.opacite, allumes: () => [...vS.querySelectorAll('[data-on]')].map((g) => g.getAttribute('data-el')), etapes: ETAPES }; +// lot ⑥c : le plateau de la carte dessinée et ses documents (les mesures du RECAP : zooms, étiquettes, allumages) +if (/[?&]mesure\b/.test(location.search)) window.__carte = { ...carte.instruments(), echelle: () => echelleCourante(), ter: () => E.ter, surCarte: () => surCarte }; } diff --git a/maquette/style.css b/maquette/style.css index 2f3aa65..8ba95dc 100644 --- a/maquette/style.css +++ b/maquette/style.css @@ -327,6 +327,46 @@ body.vue-s #b-tourner { display: none; } .c-compte { font-size: 12.5px; color: var(--encre-2); background: rgba(255, 253, 246, .9); border-radius: 8px; padding: 3px 8px; font-variant-numeric: tabular-nums; } .c-entrer { border: 0; background: var(--quartier-encre); color: #fff; font-weight: 600; border-radius: 10px; padding: 0 13px; min-height: 38px; box-shadow: var(--ombre); } @media (min-width: 900px) { .carte-outils { left: 472px; } } + +/* ---------- lot ⑥c (11/11) : les documents du dessin, à côté de lui (carte.js, maquette/documents-carte.ts) ---------- */ +/* « les documents apparaissent sur le côté, sur les latéraux, qui gâchent pas la vue du dessin » (Jules, 07/11) */ +.c-docs { position: absolute; z-index: 3; box-sizing: border-box; margin: 0; background: var(--papier-2); } +.c-docs h2, .c-docs h3, .c-docs ul, .c-docs p { margin: 0; } +.c-docs ul { list-style: none; padding: 0; } +.c-docs .vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } +.cd-doc { position: relative; box-sizing: border-box; border: 2px solid transparent; background: transparent; border-radius: 12px; padding: 0; text-align: left; transition: background .2s, border-color .2s; } +.cd-img { display: block; box-sizing: border-box; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 2px dotted var(--c); background: #fff; } +.cd-doc.rect .cd-img, .cd-doc.doc .cd-img { border-radius: 10px; } +.cd-doc.doc .cd-img { border-style: solid; border-width: 1px; border-color: var(--trait); } +.cd-img img { display: block; width: 100%; height: 100%; object-fit: cover; } +.cd-n { display: inline-grid; place-items: center; box-sizing: border-box; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; border: 1.5px solid var(--c-encre); background: #fff; color: var(--c-encre); + font: 600 13.5px/1 "Barlow Condensed", Barlow, sans-serif; } +.cd-doc.vu .cd-n { background: var(--c-encre); color: #fff; } +.cd-n.cd-picto { padding: 0; width: 22px; border-radius: 50%; } +.cd-n.cd-picto svg { width: 15px; height: 15px; } +/* allumé (X5) : le bord de sa couleur ; survolé ou focalisé, il allume son rond sur le dessin */ +.cd-doc:hover, .cd-doc.allume, .cd-doc.ici, .cd-doc:focus-visible { border-color: var(--c); background: var(--c-fond); } +.cd-doc.ici .cd-img { border-style: solid; } + +/* au bureau (≥ 1 024 px) : une colonne à droite, 320 px, sous le sticky, pleine hauteur, défilante ; la barre de la carte + et la zone libre s'arrêtent à 336 px du bord (main.js, libre()) ; le bandeau d'étape reste à gauche : deux panneaux au plus */ +@media (min-width: 1024px) { + .c-docs { top: var(--haut-carte, 64px); right: 0; bottom: 0; width: 320px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; + padding: 14px 12px 24px; border: 1px solid var(--trait); border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; box-shadow: var(--ombre); } + .carte-outils { right: 336px; } + .cd-tete { padding: 0 4px 6px; } + .cd-tete h2 { font: 600 19px/1.15 "Barlow Condensed", Barlow, sans-serif; } + .cd-tete p { margin-top: 3px; font-size: 12.5px; color: var(--encre-2); } + .cd-groupe { margin-top: 12px; } + .cd-groupe h3 { display: flex; align-items: center; gap: 7px; padding: 0 4px 5px; font: 600 13.5px/1.2 "Barlow Condensed", Barlow, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--c-encre); } + .cd-groupe h3::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 2px dotted var(--c); } + .cd-groupe ul { display: grid; gap: 2px; } + .cd-doc { display: grid; grid-template-columns: 56px auto 1fr; align-items: center; gap: 9px; width: 100%; min-height: 64px; padding: 2px 8px 2px 2px; } + .cd-t { font-weight: 500; font-size: 14.5px; line-height: 1.25; } + /* « Voir le vrai territoire » : au milieu de ce que la colonne et le bandeau laissent libre */ + body.sur-carte .vers-vue { left: calc(472px + (100% - 808px) / 2); } +} +@media (max-width: 1023.98px) { .c-docs { display: none; } } @media (max-width: 560px) { .c-titre, .c-compte, .c-entrer .long { display: none; } .c-sys button { padding: 3px 9px; font-size: 12.5px; } .c-entrer { min-height: 34px; padding: 0 10px; font-size: 13.5px; } } body.sur-carte #b-tourner { display: none; }