feat(projets): cartes entièrement cliquables + logos adaptatifs clair/sombre
All checks were successful
Deploy production / build-deploy (push) Successful in 30s

- ProjectCard : carte = <a> (nouvel onglet) dès qu'un lien est défini,
  focus clavier accessible, hover de l'icône piloté par la carte
- Logos en object-fit:contain sur fond --surface adaptatif (cadrage « logo entier »)
- Nouveau champ Project.imgDark + swap CSS via [data-theme] (logo blanc en sombre)
- Liens : LPLV (live, libertypourlavie.fr), KSauce (ksauce.lidge.fr), Lidge (lidge.fr)
- Lidge : description sans Jellyfin/Mail → Cloud, Vault, Git
- Logos ajoutés : Amarea, Lidge, Arboretum (clair/sombre), KSauce (+ silhouette blanche générée), Techos (paire light/dark)
This commit is contained in:
Johan LEROY
2026-06-22 10:01:36 +02:00
parent 699353910f
commit a30d26aad4
11 changed files with 41 additions and 14 deletions

View File

@@ -12,11 +12,20 @@ interface Props { project: Project; }
const { project: p } = Astro.props;
const st = STATUS[p.status];
const mono = p.title.replace(/[^A-Za-z0-9]/g, "").slice(0, 2);
// Toute la carte devient cliquable (nouvel onglet) dès qu'un lien est défini.
const Tag = p.link ? "a" : "article";
const linkAttrs = p.link
? { href: p.link, target: "_blank", rel: "noopener", "aria-label": `${p.title} — voir le projet (nouvel onglet)` }
: {};
---
<article class="card">
<div class="card-media">
<Tag class:list={["card", p.link && "card--link"]} {...linkAttrs}>
<div class:list={["card-media", p.imgDark && "card-media--themed"]}>
{p.img ? (
<img src={p.img} alt={p.title} loading="lazy" />
<>
<img class="logo-light" src={p.img} alt={p.title} loading="lazy" />
{p.imgDark && <img class="logo-dark" src={p.imgDark} alt={p.title} loading="lazy" />}
</>
) : (
<div class="card-mono"><span>{mono}</span></div>
)}
@@ -25,9 +34,9 @@ const mono = p.title.replace(/[^A-Za-z0-9]/g, "").slice(0, 2);
<div class="card-head">
<span class="status"><span class="status-dot" style={`background:${st.color}`}></span>{st.label}</span>
{p.link && (
<a class="ext-link" href={p.link} target="_blank" rel="noopener" aria-label="Voir le projet (nouvel onglet)">
<span class="ext-link" aria-hidden="true">
<Icon name="external" size={16} />
</a>
</span>
)}
</div>
<h3 class="card-title">{p.title}</h3>
@@ -37,4 +46,4 @@ const mono = p.title.replace(/[^A-Za-z0-9]/g, "").slice(0, 2);
{p.stack.map((s) => <span class="chip">{s}</span>)}
</div>
</div>
</article>
</Tag>