leshed_svg_export : générateur d'animation de titres (morphing entre tirages)

Page outil /admin/leshed/titre-anime (permission « export leshed typography ») :
texte libre, N tirages graisse/italique selon les règles du site (copie de
titles.js dans js/title-animation/draw.js), chaque lettre changeant de groupe
ou de style d'un tirage au suivant. Modes boucle / vague / bouillonnement,
morphing de la graisse, fondu pour l'italique, texte qui respire.

Exports : SVG animé (SMIL), MP4/WebM (WebCodecs via mediabunny), GIF (gifenc).
Dépendances Composer : npm-asset/mediabunny, npm-asset/gifenc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 13:03:07 +01:00
co-authored by Claude Opus 5.5
parent b3877c84d4
commit 4871d88842
12 changed files with 1505 additions and 24 deletions
@@ -0,0 +1,135 @@
/*
* Page outil « Titre animé » — s'appuie sur les styles de formulaire de Gin,
* en version condensée : une ligne par réglage (libellé | tirette | valeur).
* Sélecteurs préfixés par l'id pour passer devant les marges de Gin/Claro.
*/
#leshed-title-animation .lta {
display: grid;
grid-template-columns: minmax(20rem, 24rem) 1fr;
gap: 1.5rem;
align-items: start;
}
@media (max-width: 60rem) {
#leshed-title-animation .lta { grid-template-columns: 1fr; }
}
#leshed-title-animation [hidden] { display: none !important; }
/* Groupes */
#leshed-title-animation .lta__group {
margin: 0 0 0.75rem;
padding: 0 0 0.75rem;
border: 0;
border-bottom: 1px solid var(--gin-border-color, #ddd);
}
#leshed-title-animation .lta__group:last-child { border-bottom: 0; }
#leshed-title-animation .lta__group legend {
margin: 0 0 0.35rem;
padding: 0;
font-size: 0.75rem;
font-weight: 700;
letter-spacing: 0.06em;
text-transform: uppercase;
opacity: 0.7;
}
/* Une ligne par réglage : libellé à gauche, contrôle à droite. */
#leshed-title-animation .lta__row { display: block; }
#leshed-title-animation .form-item {
display: grid;
grid-template-columns: 7.5rem 1fr;
align-items: center;
gap: 0.5rem;
margin: 0 0 0.3rem;
padding: 0;
}
#leshed-title-animation .form-item__label {
margin: 0;
padding: 0;
font-size: 0.8125rem;
font-weight: 400;
line-height: 1.2;
}
#leshed-title-animation .form-element {
min-height: 0;
height: 1.9rem;
padding: 0.15rem 0.4rem;
font-size: 0.8125rem;
line-height: 1.2;
}
#leshed-title-animation .form-select { padding-inline-end: 1.75rem; background-position: right 0.4rem center; }
#leshed-title-animation .form-item select.form-element { width: 100%; }
/* Texte : libellé au-dessus, pleine largeur. */
#leshed-title-animation .form-item:has(textarea) { grid-template-columns: 1fr; gap: 0.2rem; }
#leshed-title-animation textarea.form-element { height: auto; padding: 0.3rem 0.4rem; }
/* Tirette + champ numérique (saisie précise). */
#leshed-title-animation .lta__range {
display: flex;
align-items: center;
gap: 0.4rem;
min-width: 0;
}
#leshed-title-animation .lta__slider { flex: 1; min-width: 3rem; margin: 0; accent-color: currentColor; }
#leshed-title-animation .lta__range .form-element { flex: 0 0 4.25rem; width: 4.25rem; min-width: 0; }
/* Boutons compacts */
#leshed-title-animation .button {
margin: 0;
padding: 0.3rem 0.7rem;
min-height: 0;
font-size: 0.8125rem;
line-height: 1.2;
}
#leshed-title-animation .lta__row > .button { margin: 0.1rem 0 0.3rem 8rem; }
#leshed-title-animation .lta__buttons {
display: flex;
flex-wrap: wrap;
gap: 0.35rem;
margin-top: 0.4rem;
}
#leshed-title-animation .lta__progress { width: 100%; margin-top: 0.5rem; }
#leshed-title-animation .lta__status { min-height: 1.2em; margin: 0.4rem 0 0; font-size: 0.8125rem; }
#leshed-title-animation .lta__status--error { color: #d72222; font-weight: 700; }
/* Aperçu */
#leshed-title-animation .lta__preview { position: sticky; top: 1rem; }
#leshed-title-animation .lta__stage {
display: flex;
justify-content: center;
align-items: center;
height: min(78vh, 920px);
padding: 1rem;
/* Hors cadre : gris neutre, pour que les limites du cadre sautent aux yeux. */
background: #6e6e6e;
border-radius: 4px;
}
#leshed-title-animation .lta__canvas {
max-width: 100%;
max-height: 100%;
/* Dans le cadre seulement : damier (montre la transparence du SVG/WebM). */
background-color: #fff;
background-image:
linear-gradient(45deg, #e6e6e6 25%, transparent 25%, transparent 75%, #e6e6e6 75%),
linear-gradient(45deg, #e6e6e6 25%, transparent 25%, transparent 75%, #e6e6e6 75%);
background-size: 20px 20px;
background-position: 0 0, 10px 10px;
/* Contour double (clair + sombre) : visible sur n'importe quel fond. */
outline: 2px dashed #111;
outline-offset: 0;
box-shadow: 0 0 0 2px #fff, 0 4px 18px rgba(0, 0, 0, 0.35);
}
#leshed-title-animation .lta__transport {
display: flex;
gap: 0.75rem;
align-items: center;
margin-top: 0.5rem;
}
#leshed-title-animation .lta__scrub { flex: 1; }
#leshed-title-animation .lta__time {
font-size: 0.8125rem;
font-variant-numeric: tabular-nums;
min-width: 8em;
text-align: right;
}
#leshed-title-animation .lta__info { margin: 0.35rem 0 0; font-size: 0.8125rem; opacity: 0.7; }