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
208 lines
7.9 KiB
Vue
208 lines
7.9 KiB
Vue
<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>
|