Merge remote-tracking branch 'gitea/feat/aep-xl-publications'
This commit is contained in:
+154
-35
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="media-tab-projets" style="padding: 1.5rem; overflow-y: auto;">
|
||||
<!-- <main> : la page /media n'en avait pas (Lighthouse landmark-one-main) ; l'onglet visuel n'est pas touché. -->
|
||||
<main class="media-tab-projets" style="padding: 1.5rem; overflow-y: auto;">
|
||||
<div style="max-width: 70ch; margin-bottom: 1.5rem;">
|
||||
<h2 style="font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--nav-text);">Publications</h2>
|
||||
<p style="font-size: 0.9rem; line-height: 1.6; color: var(--nav-text);">
|
||||
@@ -8,60 +9,178 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="projets-grid">
|
||||
<article v-for="p in projets" :key="p.id" class="projet-card">
|
||||
<img v-if="p.thumb" :src="p.thumb" :alt="p.titre" class="projet-thumb" loading="lazy" />
|
||||
<div v-else class="projet-thumb projet-thumb--placeholder">📐</div>
|
||||
|
||||
<h3 style="font-weight: 600; font-size: 0.95rem; margin: 0.5rem 0 0.25rem; color: var(--nav-text);">{{ p.titre }}</h3>
|
||||
<p style="font-size: 0.8rem; color: var(--nav-text-muted); margin-bottom: 0.5rem;">
|
||||
{{ (p.auteurs || []).filter((a: string) => a !== 'Inconnu').join(', ') }}
|
||||
<template v-if="p.ecole && p.ecole !== 'Inconnu'"> · {{ p.ecole }}</template>
|
||||
<template v-if="p.annee && p.annee !== 'Inconnu'"> · {{ p.annee }}</template>
|
||||
</p>
|
||||
<p style="font-size: 0.875rem; line-height: 1.5; color: var(--nav-text); flex: 1; margin-bottom: 0.75rem;">{{ p.description }}</p>
|
||||
|
||||
<a v-if="p.url" :href="p.url" target="_blank" rel="noopener" style="color: var(--nav-primary-solid, #3b6ea5); font-weight: 600; font-size: 0.875rem; text-decoration: none;">
|
||||
Découvrir →
|
||||
<!-- Lot XL publications : toute la carte est le lien (un seul <a>), image en tête, auteurs nommés. -->
|
||||
<ul class="projets-grid" role="list">
|
||||
<li v-for="p in projets" :key="p.id">
|
||||
<a class="projet-carte" :href="p.url" target="_blank" rel="noopener">
|
||||
<img
|
||||
class="projet-carte__image"
|
||||
:src="p.illustration"
|
||||
:alt="altDe(p)"
|
||||
width="800"
|
||||
height="600"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
/>
|
||||
<div class="projet-carte__corps">
|
||||
<h3 class="projet-carte__titre">{{ p.titre }}</h3>
|
||||
<span class="projet-carte__auteurs">{{ signature(p) }}</span>
|
||||
<span v-if="meta(p)" class="projet-carte__meta">{{ meta(p) }}</span>
|
||||
<span class="projet-carte__description">{{ p.description }}</span>
|
||||
<span v-if="p.credit_illustration" class="projet-carte__credit">Image : {{ minuscule(p.credit_illustration) }}</span>
|
||||
<span v-if="p.link_status === 'broken'" class="projet-carte__alerte">Lien d'origine cassé</span>
|
||||
<span class="projet-carte__indice">Découvrir<span class="sr-only"> (nouvel onglet)</span></span>
|
||||
</div>
|
||||
</a>
|
||||
<span v-if="p.link_status === 'broken'" style="color: #e67e22; font-size: 0.8rem; display: block; margin-top: 0.25rem;">⚠ Lien d'origine cassé</span>
|
||||
</article>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p style="margin-top: 2rem; font-size: 0.875rem; color: var(--nav-text-muted);">
|
||||
Tu as un PFE engagé à partager ? <a href="mailto:contact@trans-former.fr" style="color: var(--nav-primary-solid);">Écris-moi</a>.
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { data: pfeData } = await useFetch<{ projets: any[] }>('/data/pfe-engages.json')
|
||||
interface Projet {
|
||||
id: string
|
||||
titre: string
|
||||
collectif?: string
|
||||
auteurs: string[]
|
||||
annee?: string | null
|
||||
ecole?: string | null
|
||||
url: string
|
||||
description: string
|
||||
illustration: string
|
||||
illustration_a_venir?: boolean
|
||||
credit_illustration?: string | null
|
||||
link_status?: string
|
||||
}
|
||||
|
||||
const { data: pfeData } = await useFetch<{ projets: Projet[] }>('/data/pfe-engages.json')
|
||||
const projets = computed(() => pfeData.value?.projets ?? [])
|
||||
|
||||
/** « A », « A et B », « A, B et C ». */
|
||||
function enumere(noms: string[]): string {
|
||||
const n = noms.filter(a => a && a !== 'Inconnu')
|
||||
return n.length < 2 ? (n[0] ?? '') : `${n.slice(0, -1).join(', ')} et ${n[n.length - 1]}`
|
||||
}
|
||||
function signature(p: Projet): string {
|
||||
const noms = enumere(p.auteurs || [])
|
||||
return p.collectif ? `${p.collectif} : ${noms}` : noms
|
||||
}
|
||||
function meta(p: Projet): string {
|
||||
return [p.ecole, p.annee].filter(v => v && v !== 'Inconnu').join(', ')
|
||||
}
|
||||
function minuscule(s: string): string {
|
||||
return s.charAt(0).toLowerCase() + s.slice(1)
|
||||
}
|
||||
function altDe(p: Projet): string {
|
||||
if (p.illustration_a_venir) return `Illustration à venir pour « ${p.titre} »`
|
||||
return `${p.credit_illustration ?? 'Illustration'} : « ${p.titre} », par ${enumere(p.auteurs || [])}`
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.projets-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
|
||||
gap: 1.25rem;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.projet-card {
|
||||
border: 1px solid var(--nav-bg-alt, #eee);
|
||||
border-radius: 10px;
|
||||
padding: 1rem;
|
||||
.projets-grid > li {
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
}
|
||||
.projet-carte {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--nav-surface);
|
||||
}
|
||||
.projet-thumb {
|
||||
width: 100%;
|
||||
height: 140px;
|
||||
min-width: 0;
|
||||
min-height: 44px;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--border, var(--bg-alt));
|
||||
border-radius: var(--radius-md, 10px);
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
transition: background-color var(--dur-fast, 150ms) var(--ease-out, ease-out),
|
||||
box-shadow var(--dur-fast, 150ms) var(--ease-out, ease-out);
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.projet-carte { transition: none; }
|
||||
}
|
||||
.projet-carte:hover {
|
||||
background: var(--surface-2);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
.projet-carte:focus-visible {
|
||||
outline: 2px solid var(--focus-ring);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.projet-carte__image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
aspect-ratio: 4 / 3;
|
||||
object-fit: cover;
|
||||
border-radius: 6px;
|
||||
background: var(--nav-bg-alt, #f5f5f5);
|
||||
background: var(--bg-alt);
|
||||
}
|
||||
.projet-carte__corps {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 2rem;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
gap: 0.35rem;
|
||||
padding: var(--space-sm, 0.75rem) var(--space-md, 1rem) var(--space-md, 1rem);
|
||||
}
|
||||
.projet-carte__titre {
|
||||
margin: 0.15rem 0 0;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.35;
|
||||
}
|
||||
.projet-carte__auteurs {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
/* Texte atténué : color-mix, pas --text-muted (sous AA à 0,8 rem), cf. DESIGN-SYSTEM.md */
|
||||
.projet-carte__meta,
|
||||
.projet-carte__credit {
|
||||
font-size: 0.8rem;
|
||||
color: color-mix(in srgb, var(--text) 78%, transparent);
|
||||
}
|
||||
.projet-carte__description {
|
||||
flex: 1;
|
||||
overflow-wrap: anywhere;
|
||||
margin-top: 0.25rem;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.projet-carte__alerte {
|
||||
font-size: 0.8rem;
|
||||
color: var(--warning, #b45309);
|
||||
}
|
||||
.projet-carte__indice {
|
||||
margin-top: 0.5rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--nav-primary-solid);
|
||||
}
|
||||
.projet-carte:hover .projet-carte__indice {
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user