Commit 3cd648f1 by PLN (Algolia)

les-femmes: fiches des 6 fans intégrées verbatim (pourquoi / le vécu côté femmes…

les-femmes: fiches des 6 fans intégrées verbatim (pourquoi / le vécu côté femmes / sources vérifiées SEP-INA-musées-BnF), portraits des fans, licences Commons par portrait (PD / CC0 / CC BY / CC BY-SA) affichées dans chaque crédit et dans le footer, deux états MEN/WOMEN avec toggle flottant à côté du thème, avatars dans les listes, densité 10 quotes/laptop (une ligne par quote, révélation en popover zéro-reflow)
parent 9b6f9fd1
...@@ -17,7 +17,9 @@ export function Footer() { ...@@ -17,7 +17,9 @@ export function Footer() {
return ( return (
<footer className={style.footer}> <footer className={style.footer}>
<p> <p>
Fait par <a href="https://me.nech.pl/">PLN</a> · inspiré par Clément Fait par <a href="https://me.nech.pl/">PLN</a> · inspiré par Clément · portraits :
Wikimedia Commons, domaine public et licences CC (crédit par fiche) · punchlines
du mème, raw data.
</p> </p>
</footer> </footer>
); );
......
...@@ -2,29 +2,179 @@ import Link from "next/link"; ...@@ -2,29 +2,179 @@ import Link from "next/link";
import { Header, Footer } from "../Chrome"; import { Header, Footer } from "../Chrome";
import FemmeKeys from "../FemmeKeys"; import FemmeKeys from "../FemmeKeys";
import { femmeOg, socialMeta } from "../og"; import { femmeOg, socialMeta } from "../og";
import { FEMMES, VERDICT_META, getImage, getFemme, getPersonnage } from "../data"; import {
CELEBRES,
FEMMES,
VERDICT_META,
getImage,
getFemme,
getPersonnage,
} from "../data";
import style from "../style.module.css"; import style from "../style.module.css";
const FANS = CELEBRES.filter((c) => c.fiche);
export function generateStaticParams() { export function generateStaticParams() {
return FEMMES.map((f) => ({ femme: f.slug })); return [...FEMMES.map((f) => ({ femme: f.slug })), ...FANS.map((c) => ({ femme: c.slug }))];
} }
export async function generateMetadata({ params }) { export async function generateMetadata({ params }) {
const { femme: slug } = await params; const { femme: slug } = await params;
const femme = getFemme(slug); const femme = getFemme(slug);
if (!femme) return {}; if (femme) {
return socialMeta({
title: `${femme.name} — Comment ça va, les femmes ?`,
description: femme.entries.map((e) => e.text).join(" ").slice(0, 160),
canonicalPath: `/les-femmes/${femme.slug}`,
image: femmeOg(femme.slug),
});
}
const fan = FANS.find((c) => c.slug === slug);
if (!fan) return {};
return socialMeta({ return socialMeta({
title: `${femme.name} — Comment ça va, les femmes ?`, title: `${fan.name} — Comment ça va, les femmes ?`,
description: femme.entries.map((e) => e.text).join(" ").slice(0, 160), description: fan.fiche.pourquoi,
canonicalPath: `/les-femmes/${femme.slug}`, canonicalPath: `/les-femmes/${fan.slug}`,
image: femmeOg(femme.slug), image: femmeOg(fan.slug),
}); });
} }
function FanPage({ fan }) {
const idx = FANS.findIndex((c) => c.slug === fan.slug);
const prev = idx > 0 ? FANS[idx - 1].slug : null;
const next = idx < FANS.length - 1 ? FANS[idx + 1].slug : null;
const img = getImage(fan.slug);
const commonsUrl = img
? `https://commons.wikimedia.org/wiki/File:${encodeURIComponent(img.commons)}`
: null;
const commonsLabel = img?.commons.replace(/\.[a-z0-9]+$/i, "").replace(/_/g, " ");
const wikiHref = `https://fr.wikipedia.org/wiki/${encodeURIComponent(fan.fiche.wikipedia)}`;
return (
<main className={style.root}>
<Header femmeName={fan.name} />
<div className={style.femmeGrid}>
<article>
<header className={style.femmeHeader}>
<h1 className={style.femmeName}>{fan.name}</h1>
<p className={style.personnageRef}>
<span className={style.badge} style={{ background: "#7b3f8c" }}>
« {fan.punchline} »
</span>
{" — "}
{fan.fait}
</p>
</header>
<section className={style.panel}>
<div className={style.panelHead}>
<h2 className={style.panelTitle}>Pourquoi tout le monde la connaît</h2>
</div>
<p className={style.entryText}>{fan.fiche.pourquoi}</p>
</section>
<section className={style.panel}>
<div className={style.panelHead}>
<h2 className={style.panelTitle}>Le vécu, côté femmes</h2>
</div>
<p className={style.entryText}>{fan.fiche.vecu}</p>
</section>
<nav className={style.prevNext}>
{prev ? (
<Link href={`/les-femmes/${prev}`} className={style.prev}>
← {FANS.find((c) => c.slug === prev)?.name}
</Link>
) : (
<span />
)}
{next && (
<Link href={`/les-femmes/${next}`} className={style.next}>
{FANS.find((c) => c.slug === next)?.name} →
</Link>
)}
</nav>
<Link href="/les-femmes/" className={style.back}>
← les 34 personnages
</Link>
</article>
<aside className={style.femmeAside}>
<div className={style.panel}>
{img ? (
<>
<figure className={style.portrait}>
<img
src={`/images/les-femmes/${img.file}`}
alt={`Portrait de ${fan.name}`}
loading="eager"
decoding="async"
/>
</figure>
<p className={style.credit}>
Image :{" "}
<a href={commonsUrl} target="_blank" rel="noopener noreferrer">
{commonsLabel}
</a>{" "}
— Wikimedia Commons · {img.license}
</p>
</>
) : (
<span
className={style.avatarMono}
style={{ background: "#7b3f8c22", color: "#7b3f8c", aspectRatio: "4/3" }}
>
{fan.name.slice(0, 1)}
</span>
)}
<h2 className={style.asideTitle}>Wikipédia</h2>
<ul className={style.linkList}>
<li>
<a href={wikiHref} target="_blank" rel="noopener noreferrer">
fr.wikipedia.org
</a>
</li>
</ul>
<h2 className={style.asideTitle}>Pour aller plus loin</h2>
<ul className={style.linkList}>
{fan.fiche.sources.map((s) => (
<li key={s.label}>
{s.href ? (
<a href={s.href} target="_blank" rel="noopener noreferrer">
{s.label}
</a>
) : (
s.label
)}
</li>
))}
</ul>
</div>
</aside>
</div>
<FemmeKeys
prev={prev}
next={next}
imgSrc={img ? `/images/les-femmes/${img.file}` : null}
imgAlt={fan.name}
/>
<Footer />
</main>
);
}
export default async function FemmePage({ params }) { export default async function FemmePage({ params }) {
const { femme: slug } = await params; const { femme: slug } = await params;
const femme = getFemme(slug); const femme = getFemme(slug);
if (!femme) return null; if (!femme) {
const fan = FANS.find((c) => c.slug === slug);
if (fan) return <FanPage fan={fan} />;
return null;
}
const meta = VERDICT_META[femme.verdict]; const meta = VERDICT_META[femme.verdict];
const idx = FEMMES.findIndex((f) => f.slug === femme.slug); const idx = FEMMES.findIndex((f) => f.slug === femme.slug);
...@@ -120,7 +270,7 @@ export default async function FemmePage({ params }) { ...@@ -120,7 +270,7 @@ export default async function FemmePage({ params }) {
<a href={commonsUrl} target="_blank" rel="noopener noreferrer"> <a href={commonsUrl} target="_blank" rel="noopener noreferrer">
{commonsLabel} {commonsLabel}
</a>{" "} </a>{" "}
— Wikimedia Commons — Wikimedia Commons · {img.license}
</p> </p>
</> </>
) : ( ) : (
...@@ -163,11 +313,6 @@ export default async function FemmePage({ params }) { ...@@ -163,11 +313,6 @@ export default async function FemmePage({ params }) {
</ul> </ul>
</> </>
)} )}
<p className={style.kbdHint}>
clavier : ← → femme précédente/suivante · Échap accueil
{img ? " · Entrée : zoom portrait" : ""}
</p>
</div> </div>
</aside> </aside>
</div> </div>
......
...@@ -292,21 +292,14 @@ ...@@ -292,21 +292,14 @@
color: #7b3f8c; color: #7b3f8c;
} }
/* Landing à trois états. Par défaut (sans JS) les vues s'empilent ; /* Landing à DEUX états (MEN / WOMEN). Par défaut (sans JS) les vues
le JS ajoute jsOn + punchOn/femmesOn/celebresOn pour n'en montrer qu'une. */ s'empilent ; le JS ajoute jsOn + menOn/womenOn pour n'en montrer qu'une. */
.jsOn.punchOn .femmesView, .jsOn.menOn .womenView {
.jsOn.punchOn .celebresView {
display: none; display: none;
} }
.jsOn.femmesOn .punchView, .jsOn.womenOn .menView {
.jsOn.femmesOn .celebresView {
display: none;
}
.jsOn.celebresOn .punchView,
.jsOn.celebresOn .femmesView {
display: none; display: none;
} }
...@@ -320,19 +313,32 @@ ...@@ -320,19 +313,32 @@
gap: 0.3rem; gap: 0.3rem;
} }
/* Chaque quote : petite au repos, la plus proche du centre du viewport /* Chaque quote : UNE ligne compacte (num + nom + punchline) pour la
(classe focused, posée par le JS) se gonfle en card ; le survol zoome densité demandée (10 par écran laptop, 5 par mobile). La plus proche du
et révèle la femme derrière. */ centre du viewport (classe prowFocused, posée par le JS) se gonfle en
card ; le survol zoome et révèle la femme derrière en popover absolu
(zéro reflow). */
.plist {
list-style: none;
margin: 1.1rem auto 0;
padding: 0;
max-width: 54rem;
display: flex;
flex-direction: column;
}
.prow { .prow {
display: block; display: flex;
align-items: baseline;
gap: 0.7rem;
position: relative; position: relative;
padding: 1.1rem 1.5rem; padding: 0.42rem 0.9rem;
border-radius: 14px; border-radius: 10px;
text-decoration: none; text-decoration: none;
color: inherit; color: inherit;
opacity: 0.35; opacity: 0.35;
transform: scale(0.97); transform: scale(0.99);
transition: opacity 0.35s ease, transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease; transition: opacity 0.35s ease, transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
} }
...@@ -340,7 +346,7 @@ ...@@ -340,7 +346,7 @@
.prow:focus-visible, .prow:focus-visible,
.prowFocused { .prowFocused {
opacity: 1; opacity: 1;
transform: scale(1.04); transform: scale(1.05);
background: var(--surface); background: var(--surface);
box-shadow: 0 14px 40px rgba(45, 42, 50, 0.09); box-shadow: 0 14px 40px rgba(45, 42, 50, 0.09);
z-index: 2; z-index: 2;
...@@ -349,49 +355,58 @@ ...@@ -349,49 +355,58 @@
.prowMissing .pquote { .prowMissing .pquote {
font-style: normal; font-style: normal;
color: var(--text-muted); color: var(--text-muted);
font-size: 1rem; font-size: 0.85rem;
} }
.pnum { .pnum {
display: block; flex: 0 0 auto;
font-size: 0.68rem; font-size: 0.62rem;
letter-spacing: 0.14em;
color: var(--text-muted); color: var(--text-muted);
font-variant-numeric: tabular-nums; font-variant-numeric: tabular-nums;
margin: 0 0 0.25rem; letter-spacing: 0.08em;
} }
.pname { .pname {
flex: 0 0 auto;
min-width: 9rem;
font-weight: 700; font-weight: 700;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.05em; letter-spacing: 0.05em;
font-size: 0.85rem; font-size: 0.78rem;
margin: 0 0 0.3rem;
} }
.pquote { .pquote {
font-style: italic; font-style: italic;
font-size: 1.4rem; font-size: 1.02rem;
line-height: 1.3; line-height: 1.35;
display: block; flex: 1 1 auto;
min-width: 0;
text-wrap: balance; text-wrap: balance;
} }
.pquoteMissing { .pquoteMissing {
font-size: 1rem; font-size: 0.85rem;
} }
/* La révélation : la femme derrière la punchline. Invisible au repos, /* La révélation : popover absolu sous la ligne, aucun reflow. */
dépliée au survol et au focus clavier. */
.preveal { .preveal {
display: block; position: absolute;
font-size: 0.9rem; left: 0.9rem;
right: 0.9rem;
top: 100%;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 10px;
padding: 0.45rem 0.85rem;
font-size: 0.85rem;
color: #7b3f8c; color: #7b3f8c;
box-shadow: 0 12px 32px rgba(45, 42, 50, 0.12);
opacity: 0; opacity: 0;
max-height: 0; pointer-events: none;
overflow: hidden; z-index: 3;
transition: opacity 180ms ease, max-height 220ms ease; transition: opacity 160ms ease, transform 160ms ease;
transform: translateY(-2px);
} }
.preveal strong { .preveal strong {
...@@ -401,8 +416,31 @@ ...@@ -401,8 +416,31 @@
.prow:hover .preveal, .prow:hover .preveal,
.prow:focus-visible .preveal { .prow:focus-visible .preveal {
opacity: 1; opacity: 1;
max-height: 3rem; transform: translateY(0);
margin-top: 0.5rem; }
/* Densité mobile : nom aligné plus court, quote un cran plus bas. */
@media (max-width: 40rem) {
.pname {
min-width: 0;
}
.pquote {
font-size: 0.95rem;
}
.pnum {
display: none;
}
}
/* Écrans bas (mobile paysage) : hero compact pour garder 5 quotes visibles. */
@media (max-height: 480px) {
.heroTitle {
font-size: 1.6rem;
margin: 0 0 0.25rem;
}
.heroSub {
margin: 0 0 0.75rem;
}
} }
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
...@@ -638,3 +676,69 @@ ...@@ -638,3 +676,69 @@
text-decoration: none; text-decoration: none;
color: inherit; color: inherit;
} }
/* Toggle flottant MEN/WOMEN, au-dessus du chip « ? » et du theme pill. */
.floatingCta {
position: fixed;
bottom: calc(1rem + 6.2rem);
right: 1rem;
z-index: 60;
border: none;
background: #7b3f8c;
color: #fff;
font-size: 0.88rem;
font-weight: 600;
border-radius: 999px;
padding: 0.65rem 1.3rem;
cursor: pointer;
box-shadow: 0 10px 30px rgba(123, 63, 140, 0.35);
transition: transform 120ms ease, background 120ms ease;
}
.floatingCta:hover {
background: #633473;
transform: translateY(-1px);
}
@media (max-width: 768px) {
.floatingCta {
bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px) + 5.4rem);
right: 0.5rem;
font-size: 0.78rem;
padding: 0.5rem 1rem;
}
}
.sectionTitle {
font-size: 1.3rem;
margin: 1rem 0 0.2rem;
}
/* Avatar dans les lignes de liste : le portrait à côté de la punchline. */
.pavatar,
.pavatarMonoRow {
flex: 0 0 auto;
width: 2.2rem;
height: 2.2rem;
border-radius: 7px;
overflow: hidden;
align-self: center;
}
.pavatar img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: top;
display: block;
}
.pavatarMonoRow {
display: flex;
align-items: center;
justify-content: center;
font-size: 0.95rem;
font-weight: 700;
}
...@@ -22,6 +22,16 @@ const FALLBACKS = [ ...@@ -22,6 +22,16 @@ const FALLBACKS = [
["maria-celeste", "en", "Sister Maria Celeste"], ["maria-celeste", "en", "Sister Maria Celeste"],
]; ];
const FALLBACKS2 = [
// Phase 2 : les 6 fans (fiches dictées par PLN, docs/les-femmes-fans-fiches.md)
["simone-de-beauvoir", "fr", "Simone de Beauvoir"],
["alexandra-david-neel", "fr", "Alexandra David-Néel"],
["marilyn-monroe", "fr", "Marilyn Monroe"],
["marguerite-yourcenar", "fr", "Marguerite Yourcenar"],
["camille-claudel", "fr", "Camille Claudel"],
["mylene-farmer", "fr", "Mylène Farmer"],
];
const TARGETS = [ const TARGETS = [
["jocaste-et-antigone", "fr", "Jocaste"], ["jocaste-et-antigone", "fr", "Jocaste"],
["themistoclea-theano", "fr", "Théano"], ["themistoclea-theano", "fr", "Théano"],
...@@ -88,7 +98,7 @@ async function download(url) { ...@@ -88,7 +98,7 @@ async function download(url) {
const report = []; const report = [];
mkdirSync(OUT_DIR, { recursive: true }); mkdirSync(OUT_DIR, { recursive: true });
const ALL = [...TARGETS, ...FALLBACKS]; const ALL = [...TARGETS, ...FALLBACKS, ...FALLBACKS2];
for (const [slug, lang, title] of ALL) { for (const [slug, lang, title] of ALL) {
const dest = path.join(OUT_DIR, `${slug}.jpg`); const dest = path.join(OUT_DIR, `${slug}.jpg`);
...@@ -130,4 +140,19 @@ for (const [slug, lang, title] of ALL) { ...@@ -130,4 +140,19 @@ for (const [slug, lang, title] of ALL) {
console.table(report); console.table(report);
const failed = report.filter((r) => r.status.startsWith("FAIL")); const failed = report.filter((r) => r.status.startsWith("FAIL"));
console.log(`${report.length - failed.length}/${report.length} ok, ${failed.length} failed`); console.log(`${report.length - failed.length}/${report.length} ok, ${failed.length} failed`);
// Licences : pour chaque fichier téléchargé, LicenseShortName via
// l'API Commons (extmetadata) — attribution complète côté site.
const okFiles = report.filter((r) => r.commons).map((r) => r.commons);
if (okFiles.length > 0) {
const titles = okFiles.map((f) => `File:${f}`).join("|");
const api = `https://commons.wikimedia.org/w/api.php?action=query&format=json&prop=imageinfo&iiprop=extmetadata&iiextmetadatafilter=LicenseShortName&titles=${encodeURIComponent(titles)}`;
const res = await fetch(api, { headers: { "User-Agent": UA } });
const json = await res.json();
console.log("\n--- licences (commons -> LicenseShortName) ---");
for (const page of Object.values(json.query?.pages ?? {})) {
const meta = page.imageinfo?.[0]?.extmetadata ?? {};
console.log(`${(page.title ?? "").replace("File:", "")}\t${meta.LicenseShortName?.value ?? "?"}`);
}
}
if (failed.length) process.exitCode = 1; if (failed.length) process.exitCode = 1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment