feat(entree): les anneaux parlent, noms et sept mots en mouvement (B13b-M1)

Noms dans chaque anneau à toutes les tailles (26 unités, 11,4 px à 390 px).
Les sept mots d'echelles.ts : bandeaux de M (horaire) et XL (antihoraire)
le long du bord extérieur, un tour en 75 s ; S, un mot à la fois au centre,
2,5 s par mot. Calques HTML (transform et opacity sur le compositeur),
CSS seul, départ après l'apparition, arrêt sous prefers-reduced-motion et
par un bouton pause (WCAG 2.2.2). Bandeau M masqué derrière l'arc « ce
qui revient » à partir de 1024 px. aria-label : une phrase par anneau.
test-figures : 32 → 53 cas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MYkaR9gSetC8qKAowoMKpM
This commit is contained in:
Jules Neny
2026-10-13 16:09:27 +02:00
co-authored by Claude Opus 5.5
parent 7813aa2d17
commit 4cda84c581
3 changed files with 501 additions and 18 deletions
+239 -12
View File
@@ -5,9 +5,17 @@
Géométrie : utils/figures.ts ; textes : utils/echelles.ts (source unique).
taille="grand" (état 0 de l'entrée) : la figure + les trois portes en liens HTML
(lettre, titre, accroche de la slide 16). Noms et arcs « ce qui sort / ce qui revient »
(lettre, titre, accroche de la slide 16). Arcs « ce qui sort / ce qui revient »
gardés dans le SVG à partir de 1 024 px seulement (16 px environ) ; en dessous ils
seraient à 9 px, les portes HTML les remplacent. Ouvrir une porte = `push`.
seraient à 9 px. Ouvrir une porte = `push`.
B13b-M1 : chaque anneau porte sa lettre et son nom à toutes les tailles (nom à 26 unités,
11,4 px rendus à 390 px), et les sept mots de son échelle (ECHELLES[id].mots) :
M et XL en bandeau le long du bord extérieur, qui tourne (M horaire, XL antihoraire,
un tour en 75 s) ; S, un mot à la fois au centre, en fondu (2,5 s par mot). Les bandeaux
et les mots de S sont des calques HTML posés sur la figure (un <svg> par bandeau, un
<span> par mot) : `transform` et `opacity` y tournent sur le compositeur, sans repeindre
le SVG ni réveiller le fil principal. CSS seul ; arrêt sous `prefers-reduced-motion`
(bandeaux immobiles, premier mot de S) et par le bouton pause (WCAG 2.2.2).
taille="mini" (porte ouverte) : barre collante au téléphone (retour au schéma + S M XL),
colonne à partir de 1 024 px (retour, figure réduite, portes titrées). Passer d'une
porte à l'autre = `replace` (une seule entrée d'historique par visite).
@@ -45,8 +53,9 @@
<span class="schema__fermer-texte">Revenir au schéma</span>
</a>
<div class="schema__figure" :class="{ 'schema__figure--fige': fige }">
<svg
class="schema__figure"
class="schema__dessin"
:viewBox="`0 0 ${SCHEMA_L} ${SCHEMA_H}`"
:role="taille === 'grand' ? 'img' : undefined"
:aria-label="taille === 'grand' ? description : undefined"
@@ -87,7 +96,7 @@
class="schema__nom"
:x="a.cx"
:y="a.yNom"
font-size="22"
:font-size="CORPS.nom"
text-anchor="middle"
:style="styleLettre(a.rang)"
>{{ nomAnneau(a.id) }}</text>
@@ -107,6 +116,54 @@
</template>
</svg>
<template v-if="taille === 'grand'">
<!-- Bandeaux M et XL : un calque par anneau, qui tourne autour du centre de la figure. -->
<div
v-for="b in bandeaux"
:key="`bandeau-${b.id}`"
class="schema__bandeau"
:class="[`schema__bandeau--${b.id}`, { 'schema__bandeau--masque': MASQUE_BANDEAU[b.id] }]"
:style="styleBandeau(b)"
aria-hidden="true"
>
<svg
class="schema__tour"
:class="`schema__tour--${b.sens}`"
:viewBox="`0 0 ${SCHEMA_L} ${SCHEMA_H}`"
:style="styleTour"
focusable="false"
>
<defs><path :id="idBandeau(b.id)" :d="b.d" /></defs>
<text class="schema__mots" :font-size="CORPS.mot" :textLength="b.longueur" lengthAdjust="spacing"><textPath :href="`#${idBandeau(b.id)}`">{{ textesBandeaux[b.id] }}</textPath></text>
</svg>
</div>
<!-- S : un mot à la fois, au centre du disque, sous le nom. -->
<div class="schema__mots-s" :style="styleMotsS" aria-hidden="true">
<span
v-for="(m, i) in ECHELLES.S.mots"
:key="m"
class="schema__mot-s"
:class="{ 'schema__mot-s--premier': i === 0 }"
:style="styleMotS(i)"
>{{ m }}</span>
</div>
<button
type="button"
class="schema__pause"
:aria-pressed="fige ? 'true' : 'false'"
@click="fige = !fige"
>
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path v-if="fige" d="M8 5.5v13l10.5-6.5z" />
<path v-else d="M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" />
</svg>
<span class="sr-only">Mettre les mots en pause</span>
</button>
</template>
</div>
<ul class="schema__portes">
<li v-for="id in ORDRE_ECHELLES" :key="id">
<NuxtLink
@@ -141,8 +198,10 @@ import {
type EchelleId,
} from '~/utils/echelles'
import {
SCHEMA_L, SCHEMA_H, anneauxEchelles, arcsFlux, legendeFlux, delaisApparition,
type ArcFlux, type SensFlux,
SCHEMA_L, SCHEMA_H, anneauxEchelles, arcsFlux, legendeFlux, delaisApparition, finApparition,
CORPS, MOUVEMENT_MOTS, MASQUE_BANDEAU, bandeauxAnneaux, motsBandeau, texteBandeau,
cadreMotS, masqueSecteurBas,
type ArcFlux, type SensFlux, type BandeauAnneau,
} from '~/utils/figures'
const props = withDefaults(defineProps<{
@@ -166,6 +225,14 @@ const uid = useId()
const anneaux = anneauxEchelles()
const arcs = arcsFlux()
const legende = legendeFlux()
const bandeaux = bandeauxAnneaux()
/** Texte de chaque bandeau : les sept mots d'echelles.ts, repris pour remplir le tour. */
const textesBandeaux = Object.fromEntries(
bandeaux.map((b) => [b.id, texteBandeau(motsBandeau(ECHELLES[b.id].mots, b.longueur))]),
) as Record<BandeauAnneau['id'], string>
const rangDe = (id: EchelleId) => anneaux.find((a) => a.id === id)?.rang ?? 0
/** Mots arrêtés par le visiteur (bouton pause) : bandeaux immobiles, mot de S figé. */
const fige = ref(false)
const FLECHE: Record<SensFlux, string> = { sort: '↓', revient: '↑' }
/** Icône du retour au schéma (téléphone) : trois cercles, rayons dans l'ordre XL, M, S. */
const ICONE: Record<EchelleId, number> = { XL: 18, M: 12, S: 6 }
@@ -180,14 +247,51 @@ const nomAnneau = (id: EchelleId) => {
const idArc = (arc: ArcFlux) => `${uid}-arc-${arc.frontiere}-${arc.sens}`
/** Description de la figure, sur le modèle de l'aria-label du deck. */
/**
* Description de la figure, sur le modèle de l'aria-label du deck ; B13b : une phrase par
* anneau avec ses sept mots (séparés par des points-virgules, certains portent une virgule).
*/
const description = (() => {
const anneauxTxt = ORDRE_ECHELLES.map((id) => `${id}, ${nomAnneau(id)}`).join(' ; ')
const mots = ORDRE_ECHELLES.map((id) => `${id}, ${nomAnneau(id)} : ${ECHELLES[id].mots.join(' ; ')}.`).join(' ')
const flux = (f: 'S' | 'M', entre: string) =>
`Entre ${entre}, ${ECHELLES_FLUX_LEGENDE.sort} : ${ECHELLES_FLUX[f].sort} ; ${ECHELLES_FLUX_LEGENDE.revient} : ${ECHELLES_FLUX[f].revient}.`
return `Trois anneaux imbriqués, S au centre : ${anneauxTxt}. ${flux('S', 'S et M')} ${flux('M', 'M et XL')}`
return `Trois anneaux imbriqués, S au centre : ${anneauxTxt}. ${mots} ${flux('S', 'S et M')} ${flux('M', 'M et XL')}`
})()
const idBandeau = (id: EchelleId) => `${uid}-bandeau-${id}`
// Mouvement des mots (B13b-M1) : durées et délais tirés d'utils/figures.ts.
// Les bandeaux démarrent après l'apparition du schéma (finApparition, 900 ms).
const styleTour = { animationDuration: `${MOUVEMENT_MOTS.tour}ms`, animationDelay: `${finApparition()}ms` }
const styleBandeau = (b: BandeauAnneau) => {
const masque = MASQUE_BANDEAU[b.id]
return {
...(masque ? { '--masque': masqueSecteurBas(masque) } : {}),
...(joueApparition.value ? { animationDelay: `${delaisApparition(rangDe(b.id)).lettre}ms` } : {}),
}
}
const cadreS = cadreMotS()
const styleMotsS = computed(() => ({
left: `${(cadreS.x / SCHEMA_L) * 100}%`,
top: `${(cadreS.y / SCHEMA_H) * 100}%`,
width: `${(cadreS.l / SCHEMA_L) * 100}%`,
height: `${(cadreS.h / SCHEMA_H) * 100}%`,
...(joueApparition.value ? { animationDelay: `${delaisApparition(rangDe('S')).lettre}ms` } : {}),
}))
/**
* Mot i de S : une boucle de 7 × 2,5 s par mot, décalée de i × 2,5 s. Le premier mot part
* à 0 (visible dès l'arrivée, il s'efface à 2,1 s) ; les suivants, à rebours d'un tour,
* restent éteints jusqu'à leur tour : le premier changement vient après l'apparition.
*/
const styleMotS = (i: number) => {
const tour = ECHELLES.S.mots.length * MOUVEMENT_MOTS.cadence
return {
animationDuration: `${tour}ms`,
animationDelay: `${i === 0 ? 0 : i * MOUVEMENT_MOTS.cadence - tour}ms`,
}
}
function queryPorte(id: EchelleId | null) {
const q: Record<string, unknown> = { ...route.query }
if (id) q[PARAM_PORTE] = id
@@ -215,7 +319,13 @@ const styleLettre = (rang: number) =>
<style scoped>
/* ── Commun ────────────────────────────────────────────────────────────── */
.schema__figure {
position: relative;
/* les calques (bandeaux, mots de S) se règlent en unités de la figure */
container-type: inline-size;
}
.schema__dessin {
display: block;
width: 100%;
height: auto;
overflow: visible;
}
@@ -259,9 +369,75 @@ const styleLettre = (rang: number) =>
.schema__nom,
.schema__flux,
.schema__legende {
display: none;
fill: color-mix(in srgb, var(--text) 78%, transparent);
}
.schema__nom { font-weight: var(--fw-semibold); }
.schema__flux,
.schema__legende { display: none; }
/* ── Les mots (B13b-M1) ── */
.schema__bandeau {
position: absolute;
inset: 0;
/* le calque tourne : ses coins ne doivent pas élargir la page */
overflow: hidden;
pointer-events: none;
}
.schema__tour {
display: block;
width: 100%;
height: 100%;
overflow: visible;
}
.schema__mots {
font-family: var(--font-body);
font-size: 26px;
fill: color-mix(in srgb, var(--text) 78%, transparent);
}
.schema__mots-s {
position: absolute;
display: grid;
pointer-events: none;
}
.schema__mot-s {
grid-area: 1 / 1;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
text-wrap: balance;
/* 26 unités du viewBox (820 de large) : 11,4 px rendus à 390 px */
font-size: calc(100cqw * 26 / 820);
line-height: 1.2;
color: var(--text);
opacity: 0;
}
.schema__mot-s--premier { opacity: 1; }
.schema__pause {
position: absolute;
right: 0;
bottom: 0;
display: inline-flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
border: 1px solid var(--border);
border-radius: var(--radius-full);
background: var(--surface);
color: color-mix(in srgb, var(--text) 78%, transparent);
cursor: pointer;
}
.schema__pause svg {
width: 18px;
height: 18px;
fill: currentColor;
}
.schema__pause:hover { color: var(--text); border-color: var(--accent); }
.schema__pause:focus-visible {
outline: 2px solid var(--focus-ring);
outline-offset: 2px;
}
.schema__flux { font-style: italic; }
.schema__legende { font-family: var(--font-mono); }
@@ -376,9 +552,17 @@ const styleLettre = (rang: number) =>
.schema--grand .schema__avant { align-self: end; }
.schema--grand .schema__apres { align-self: start; }
.schema--grand .schema__figure { max-width: 604px; }
.schema--grand .schema__nom,
.schema--grand .schema__flux,
.schema--grand .schema__legende { display: inline; }
/* Corps du deck pour les noms (16 px environ à 1 440), mots un peu plus petits qu'au téléphone */
.schema--grand .schema__nom { font-size: 22px; }
.schema__mots { font-size: 23px; }
.schema__mot-s { font-size: calc(100cqw * 23 / 820); }
/* Les arcs sont à l'écran : le bandeau M passe derrière le secteur de « ce qui revient » */
.schema__bandeau--masque {
-webkit-mask-image: var(--masque);
mask-image: var(--masque);
}
}
/* ── Mini : la porte ouverte ───────────────────────────────────────────── */
@@ -516,10 +700,45 @@ const styleLettre = (rang: number) =>
.schema--apparition .schema__legende {
animation: aep-schema-texte 250ms var(--ease-out) 650ms backwards;
}
.schema--apparition .schema__bandeau,
.schema--apparition .schema__mots-s {
animation: aep-schema-texte 250ms var(--ease-out) backwards;
}
@keyframes aep-schema-anneau {
from { opacity: 0; transform: scale(0.9); }
to { opacity: 1; transform: none; }
}
/*
Les mots en mouvement (B13b-M1). Durées et délais en style en ligne (utils/figures.ts,
MOUVEMENT_MOTS) : un tour de bandeau en 75 s après l'apparition ; un mot de S toutes
les 2,5 s. Les pourcentages de `aep-mot-s` valent pour 7 mots : 2,1 s visible
(12 %), fondu de 400 ms jusqu'à 2,5 s (14,286 %), éteint, fondu d'entrée à 17,1 s (97,714 %).
*/
.schema__tour {
animation: aep-schema-tour-horaire 75s linear 900ms infinite;
}
.schema__tour--antihoraire { animation-name: aep-schema-tour-antihoraire; }
.schema__mot-s {
animation: aep-mot-s 17.5s linear infinite;
}
.schema__figure--fige .schema__tour,
.schema__figure--fige .schema__mot-s {
animation-play-state: paused;
}
@keyframes aep-schema-tour-horaire {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes aep-schema-tour-antihoraire {
from { transform: rotate(0deg); }
to { transform: rotate(-360deg); }
}
@keyframes aep-mot-s {
0%, 12% { opacity: 1; }
14.286%, 97.714% { opacity: 0; }
100% { opacity: 1; }
}
@keyframes aep-schema-texte {
from { opacity: 0; }
to { opacity: 1; }
@@ -528,7 +747,9 @@ html.entree-vue .schema--apparition .schema__anneau,
html.entree-vue .schema--apparition .schema__lettre,
html.entree-vue .schema--apparition .schema__nom,
html.entree-vue .schema--apparition .schema__flux,
html.entree-vue .schema--apparition .schema__legende {
html.entree-vue .schema--apparition .schema__legende,
html.entree-vue .schema--apparition .schema__bandeau,
html.entree-vue .schema--apparition .schema__mots-s {
animation: none;
}
@media (prefers-reduced-motion: reduce) {
@@ -536,8 +757,14 @@ html.entree-vue .schema--apparition .schema__legende {
.schema--apparition .schema__lettre,
.schema--apparition .schema__nom,
.schema--apparition .schema__flux,
.schema--apparition .schema__legende {
.schema--apparition .schema__legende,
.schema--apparition .schema__bandeau,
.schema--apparition .schema__mots-s,
.schema__tour,
.schema__mot-s {
animation: none;
}
/* rien ne bouge : le bouton pause n'a plus d'objet */
.schema__pause { display: none; }
}
</style>