Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c0c438542 | ||
|
|
7f8b36d71c |
+7
-2
@@ -118,7 +118,7 @@ function creerBandeau(sec, { nom, contenu, contenuFil = () => undefined, echelle
|
|||||||
const avant = B.etat;
|
const avant = B.etat;
|
||||||
if (n === avant && !force) { B.majH(); return; }
|
if (n === avant && !force) { B.majH(); return; }
|
||||||
B.etat = n; sec.dataset.etat = n;
|
B.etat = n; sec.dataset.etat = n;
|
||||||
poignee.setAttribute('aria-expanded', String(n !== 'barre'));
|
poignee.setAttribute('aria-expanded', String(n === 'resume' || n === 'plein'));
|
||||||
corps.inert = n === 'barre';
|
corps.inert = n === 'barre';
|
||||||
if ((n === 'resume' && (avant === 'barre' || avant === 'fil')) || n === 'fil') corps.scrollTop = 0;
|
if ((n === 'resume' && (avant === 'barre' || avant === 'fil')) || n === 'fil') corps.scrollTop = 0;
|
||||||
B.majH();
|
B.majH();
|
||||||
@@ -198,7 +198,8 @@ function recadrer(duree = 700) {
|
|||||||
// La barre repliée : le picto, le titre et le compteur de la fiche courante.
|
// La barre repliée : le picto, le titre et le compteur de la fiche courante.
|
||||||
function majPoignee(f = E.mini || liste()[E.i]) {
|
function majPoignee(f = E.mini || liste()[E.i]) {
|
||||||
if (!f) return;
|
if (!f) return;
|
||||||
const L = E.mini ? [] : liste().filter((x) => x.chapitre === f.chapitre), k = L.indexOf(f);
|
const S = E.modeS && echelleDe(f.cadrage) === 'S'; // en S, on compte les étapes de la maison
|
||||||
|
const L = E.mini ? [] : liste().filter((x) => x.chapitre === f.chapitre && (!S || indexDe(ETAPES, x.id) >= 0)), k = L.indexOf(f);
|
||||||
$('p-icone').innerHTML = picto(f.picto, BULLES);
|
$('p-icone').innerHTML = picto(f.picto, BULLES);
|
||||||
$('p-titre').innerHTML = f.titre;
|
$('p-titre').innerHTML = f.titre;
|
||||||
$('p-compte').textContent = L.length > 1 ? `${k + 1} / ${L.length}` : '';
|
$('p-compte').textContent = L.length > 1 ? `${k + 1} / ${L.length}` : '';
|
||||||
@@ -362,7 +363,11 @@ function poserEtape(l) {
|
|||||||
const e = ETAPES[l.i], f = FICHE[e.fiche]; if (!f) return;
|
const e = ETAPES[l.i], f = FICHE[e.fiche]; if (!f) return;
|
||||||
const i = liste().indexOf(f); if (i >= 0) E.i = i;
|
const i = liste().indexOf(f); if (i >= 0) E.i = i;
|
||||||
poserCouleur($('fiches'), f.chapitre);
|
poserCouleur($('fiches'), f.chapitre);
|
||||||
|
// checkpoint du 06/11 : #onglets et #points sont reconstruits à chaque étape ; le focus clavier est rendu au même bouton
|
||||||
|
const actif = document.activeElement;
|
||||||
|
const cible = actif?.closest?.('#points') && actif.dataset.f ? `#points [data-f="${actif.dataset.f}"]` : actif?.closest?.('#onglets') && actif.dataset.ch ? `#onglets [data-ch="${actif.dataset.ch}"]` : null;
|
||||||
onglets(f); points(f, l.allumees.map((k) => ETAPES[k].fiche)); majPoignee(f);
|
onglets(f); points(f, l.allumees.map((k) => ETAPES[k].fiche)); majPoignee(f);
|
||||||
|
if (cible) document.querySelector(cible)?.focus({ preventScroll: true });
|
||||||
if (T3) T3.effets(l.allumees.map((k) => ETAPES[k].effet));
|
if (T3) T3.effets(l.allumees.map((k) => ETAPES[k].effet));
|
||||||
history.replaceState(null, '', '#maison');
|
history.replaceState(null, '', '#maison');
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ export const COULEURS = {
|
|||||||
eau: { c: '#3a74a8', encre: '#1d5886', fond: '#e1ebf5' },
|
eau: { c: '#3a74a8', encre: '#1d5886', fond: '#e1ebf5' },
|
||||||
vivant: { c: '#8f7b22', encre: '#62560f', fond: '#eeead0' },
|
vivant: { c: '#8f7b22', encre: '#62560f', fond: '#eeead0' },
|
||||||
energie: { c: '#c96d0c', encre: '#8f4506', fond: '#fde8c8' },
|
energie: { c: '#c96d0c', encre: '#8f4506', fond: '#fde8c8' },
|
||||||
transport: { c: '#5f7f8c', encre: '#5f7f8c', fond: '#e4ecef' }, // lot ④ : le quatrième onglet de S (gris-bleu de la palette)
|
transport: { c: '#5f7f8c', encre: '#3f5f6c', fond: '#e4ecef' }, // lot ④ : le quatrième onglet de S (gris-bleu de la palette)
|
||||||
quartier: { c: '#8a5a7a', encre: '#5e3a54', fond: '#f1e6ee' },
|
quartier: { c: '#8a5a7a', encre: '#5e3a54', fond: '#f1e6ee' },
|
||||||
accueil: { c: '#6b6458', encre: '#3f5563', fond: '#ece8de' },
|
accueil: { c: '#6b6458', encre: '#3f5563', fond: '#ece8de' },
|
||||||
auj: { c: '#6b6458', encre: '#4a443b', fond: '#ece8de' },
|
auj: { c: '#6b6458', encre: '#4a443b', fond: '#ece8de' },
|
||||||
|
|||||||
+1
-1
@@ -636,7 +636,7 @@ export function creerScene(canvas, { D, ESSENCES, BULLES, IMG, reduit, petit, on
|
|||||||
etat.auj += (etat.cibleAuj - etat.auj) * Math.min(1, dt * 4); matAuj.opacity = etat.auj;
|
etat.auj += (etat.cibleAuj - etat.auj) * Math.min(1, dt * 4); matAuj.opacity = etat.auj;
|
||||||
// lot ④ : plusieurs effets peuvent être allumés ensemble (sous mouvement réduit, tout le chapitre de la maison) ; `on(k)`
|
// lot ④ : plusieurs effets peuvent être allumés ensemble (sous mouvement réduit, tout le chapitre de la maison) ; `on(k)`
|
||||||
// vaut `fx === k` quand un seul l'est (la démo en M, le mode fond : rien ne change)
|
// vaut `fx === k` quand un seul l'est (la démo en M, le mode fond : rien ne change)
|
||||||
const puls = 0.5 + 0.5 * Math.sin(t * 2.6), fxs = etat.fxs, on = (k) => fxs.has(k);
|
const puls = reduit && !fond && !etat.fond ? 0.7 : 0.5 + 0.5 * Math.sin(t * 2.6), fxs = etat.fxs, on = (k) => fxs.has(k);
|
||||||
const eauT = (i) => i === D.temoin.noue;
|
const eauT = (i) => i === D.temoin.noue;
|
||||||
surv.noues.forEach((m) => (m.material.opacity = on('noue-plantes') ? (eauT(m.userData.i) ? 0.3 + 0.3 * puls : 0.12) : on('mare') || on('phyto') ? 0.22 : on('eaux-grises') && eauT(m.userData.i) ? 0.3 : 0));
|
surv.noues.forEach((m) => (m.material.opacity = on('noue-plantes') ? (eauT(m.userData.i) ? 0.3 + 0.3 * puls : 0.12) : on('mare') || on('phyto') ? 0.22 : on('eaux-grises') && eauT(m.userData.i) ? 0.3 : 0));
|
||||||
surv.bassins.forEach((m) => (m.material.opacity = on('mare') || on('phyto') ? 0.3 + 0.3 * puls : 0));
|
surv.bassins.forEach((m) => (m.material.opacity = on('mare') || on('phyto') ? 0.3 + 0.3 * puls : 0));
|
||||||
|
|||||||
+4
-1
@@ -96,10 +96,13 @@ body[data-echelle="XL"] #b-tourner, body.bandeau-plein #b-tourner { display: non
|
|||||||
#fiches[data-etat="fil"] .corps > .fil { flex: 1 1 0; }
|
#fiches[data-etat="fil"] .corps > .fil { flex: 1 1 0; }
|
||||||
#fiches[data-etat="fil"] .corps > .pied { flex: none; margin-left: auto; }
|
#fiches[data-etat="fil"] .corps > .pied { flex: none; margin-left: auto; }
|
||||||
#fiches[data-etat="fil"] .pied .compteur { display: none; }
|
#fiches[data-etat="fil"] .pied .compteur { display: none; }
|
||||||
|
body[data-echelle="S"] .onglets button { padding: 5px 9px; gap: 5px; letter-spacing: .02em; } /* quatre onglets tiennent sur 390 px */
|
||||||
@media (max-width: 899px) { #fiches[data-etat="fil"] :is(#b-prec, #b-suiv) { display: none; } }
|
@media (max-width: 899px) { #fiches[data-etat="fil"] :is(#b-prec, #b-suiv) { display: none; } }
|
||||||
|
/* checkpoint du 06/11 : en paysage téléphone le quart d’écran ne contient pas les logos (mesuré à 844 × 390 : coupés) ; le fil défile */
|
||||||
|
@media (max-height: 500px) { #fiches[data-etat="fil"] .corps { overflow: hidden auto; } }
|
||||||
/* un logo allumé : l'anneau de la couleur du chapitre, 1,08 d'échelle (« comme t'inviter à cliquer ») */
|
/* un logo allumé : l'anneau de la couleur du chapitre, 1,08 d'échelle (« comme t'inviter à cliquer ») */
|
||||||
#points .maillon.allume { opacity: 1; filter: none; transform: scale(1.08); box-shadow: 0 0 0 2px var(--c-fond, #fff), 0 0 0 4px var(--c, var(--encre)); }
|
#points .maillon.allume { opacity: 1; filter: none; transform: scale(1.08); box-shadow: 0 0 0 2px var(--c-fond, #fff), 0 0 0 4px var(--c, var(--encre)); }
|
||||||
@media (prefers-reduced-motion: reduce) { .maillon { transition: none; } }
|
@media (prefers-reduced-motion: reduce) { #points .maillon { transition: none; } }
|
||||||
.suite:empty { display: none; }
|
.suite:empty { display: none; }
|
||||||
.suite { padding-left: 68px; transition: opacity .35s ease; }
|
.suite { padding-left: 68px; transition: opacity .35s ease; }
|
||||||
.suite.sort { opacity: 0; }
|
.suite.sort { opacity: 0; }
|
||||||
|
|||||||
@@ -84,6 +84,12 @@ test('allumage : le vrai contenu, quatre chapitres dans l’ordre, la chaîne de
|
|||||||
assert.ok(E.length * PAS <= 40_000, `${E.length} étapes : un tour en ${(E.length * PAS) / 1000} s`);
|
assert.ok(E.length * PAS <= 40_000, `${E.length} étapes : un tour en ${(E.length * PAS) / 1000} s`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('allumage : l’effet de chaque étape du vrai contenu est branché dans la scène (checkpoint du 06/11)', () => {
|
||||||
|
const C = lireFiches(readFileSync(new URL('../content/fiches.md', import.meta.url), 'utf8'));
|
||||||
|
const src = ['scene.js', 'maison.js'].map((f) => readFileSync(new URL(`../maquette/${f}`, import.meta.url), 'utf8')).join(' ');
|
||||||
|
for (const e of etapesDe(C, ongletsDe('S', C, null))) assert.ok(src.includes(`'${e.effet}'`), `${e.fiche} : l’effet ${e.effet} n’apparaît ni dans scene.js ni dans maison.js`);
|
||||||
|
});
|
||||||
|
|
||||||
test('allumage : aucune étape, aucune erreur', () => {
|
test('allumage : aucune étape, aucune erreur', () => {
|
||||||
const a = demarrer([]);
|
const a = demarrer([]);
|
||||||
const l = allumage(a, PAS);
|
const l = allumage(a, PAS);
|
||||||
|
|||||||
Reference in New Issue
Block a user