From 0a63ccb710d7a9af69262630abfbe930c144d51a Mon Sep 17 00:00:00 2001 From: BlackAngelTVdev Date: Mon, 24 Aug 2026 18:33:52 +0200 Subject: [PATCH] =?UTF-8?q?feat(equipe):=20ajout=20de=20la=20page=20=C3=A9?= =?UTF-8?q?quipe=20avec=20syst=C3=A8me=20de=20loaders=20cr=C3=A9ateurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nouvelle page séparée /?p/equipe/ affichant les contributeurs depuis un fichier JSON. Le JS résout les chemins et génère automatiquement une grille de cartes avec avatar, nom, rôle, date d'arrivée et liens. --- p/assets/js/creators-loader.js | 108 ++++++++++++++++++++++++++++++++ p/assets/styles/creators.css | 111 +++++++++++++++++++++++++++++++++ p/assets/styles/equipe.css | 24 +++++++ p/equipe/creators.json | 22 +++++++ p/equipe/index.html | 26 ++++++++ 5 files changed, 291 insertions(+) create mode 100644 p/assets/js/creators-loader.js create mode 100644 p/assets/styles/creators.css create mode 100644 p/assets/styles/equipe.css create mode 100644 p/equipe/creators.json create mode 100644 p/equipe/index.html diff --git a/p/assets/js/creators-loader.js b/p/assets/js/creators-loader.js new file mode 100644 index 0000000..39f4fe7 --- /dev/null +++ b/p/assets/js/creators-loader.js @@ -0,0 +1,108 @@ +(() => { + function formatDate(iso) { + if (!iso) return null; + try { + const d = new Date(iso); + return d.toLocaleDateString("fr-FR", { + year: "numeric", + month: "long", + day: "numeric", + }); + } catch { + return iso; + } + } + + function createCreatorCard(creator) { + const card = document.createElement("article"); + card.className = "creator-card"; + + if (creator.avatar) { + const img = document.createElement("img"); + img.className = "creator-avatar"; + img.src = creator.avatar; + img.alt = creator.name || creator.role || ""; + img.loading = "lazy"; + card.appendChild(img); + } + + const info = document.createElement("div"); + info.className = "creator-info"; + + if (creator.name) { + const name = document.createElement("h3"); + name.className = "creator-name"; + name.textContent = creator.name; + info.appendChild(name); + } + + if (creator.role) { + const role = document.createElement("span"); + role.className = "creator-role"; + role.textContent = creator.role; + info.appendChild(role); + } + + if (creator.joined) { + const joined = document.createElement("span"); + joined.className = "creator-joined"; + joined.textContent = "A rejoint le " + formatDate(creator.joined); + info.appendChild(joined); + } + + if (creator.email) { + const email = document.createElement("a"); + email.className = "creator-email"; + email.href = "mailto:" + creator.email; + email.textContent = creator.email; + info.appendChild(email); + } + + if (creator.links && creator.links.length > 0) { + const links = document.createElement("div"); + links.className = "creator-links"; + for (const link of creator.links) { + const a = document.createElement("a"); + a.className = "creator-link"; + a.href = link.url; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.textContent = link.label || link.url; + links.appendChild(a); + } + info.appendChild(links); + } + + card.appendChild(info); + return card; + } + + async function loadCreators() { + const containers = document.querySelectorAll("[data-creators-src]"); + for (const container of containers) { + const src = container.getAttribute("data-creators-src"); + if (!src) continue; + + try { + const response = await fetch(src, { cache: "no-store" }); + if (!response.ok) throw new Error("Erreur " + response.status); + const creators = await response.json(); + + const grid = document.createElement("div"); + grid.className = "creators-grid"; + + for (const creator of creators) { + grid.appendChild(createCreatorCard(creator)); + } + + container.innerHTML = ""; + container.appendChild(grid); + } catch (err) { + container.innerHTML = + '

Impossible de charger les données des créateurs.

'; + } + } + } + + loadCreators(); +})(); diff --git a/p/assets/styles/creators.css b/p/assets/styles/creators.css new file mode 100644 index 0000000..2bc91b7 --- /dev/null +++ b/p/assets/styles/creators.css @@ -0,0 +1,111 @@ +@import "./var.css"; + +/* ── Creators Grid ── */ + +.creators-grid { + display: flex; + flex-wrap: wrap; + gap: 1.25rem; + margin-top: 1rem; +} + +.creator-card { + flex: 1 1 280px; + max-width: 400px; + display: flex; + gap: 1rem; + padding: 1.25rem; + border-radius: 0.75rem; + background: var(--surface); + border: 1px solid var(--border); + box-shadow: var(--shadow-sm); + transition: transform 200ms ease, box-shadow 200ms ease; +} + +.creator-card:hover { + transform: translateY(-2px); + box-shadow: var(--shadow-md); +} + +.creator-avatar { + width: 4rem; + height: 4rem; + border-radius: 50%; + object-fit: cover; + flex-shrink: 0; + border: 2px solid var(--border); +} + +.creator-info { + display: flex; + flex-direction: column; + gap: 0.3rem; + min-width: 0; +} + +.creator-name { + margin: 0; + font-family: "Georgia", "Palatino Linotype", serif; + font-size: 1.1rem; + color: var(--text); + line-height: 1.2; +} + +.creator-role { + color: var(--accent); + font-size: 0.9rem; + font-weight: 500; +} + +.creator-joined { + color: var(--muted); + font-size: 0.85rem; +} + +.creator-email { + color: var(--text-secondary); + font-size: 0.88rem; + text-decoration: none; +} + +.creator-email:hover { + color: var(--accent); + text-decoration: underline; +} + +.creator-links { + display: flex; + flex-wrap: wrap; + gap: 0.4rem; + margin-top: 0.2rem; +} + +.creator-link { + display: inline-flex; + align-items: center; + padding: 0.2rem 0.6rem; + font-size: 0.82rem; + font-weight: 500; + color: var(--accent); + background: var(--accent-bg); + border: 1px solid rgba(56, 189, 248, 0.2); + border-radius: 0.35rem; + text-decoration: none; + transition: background 160ms ease; +} + +.creator-link:hover { + background: rgba(56, 189, 248, 0.18); +} + +.creators-error { + color: var(--error-text-color); + font-size: 0.95rem; +} + +@media (max-width: 640px) { + .creator-card { + flex: 1 1 100%; + max-width: 100%; + } +} diff --git a/p/assets/styles/equipe.css b/p/assets/styles/equipe.css new file mode 100644 index 0000000..bafba93 --- /dev/null +++ b/p/assets/styles/equipe.css @@ -0,0 +1,24 @@ +@import "./var.css"; + +.equipe-hero { + text-align: center; + padding: clamp(1.5rem, 4vw, 3rem) 1.25rem; +} + +.equipe-hero h1 { + margin: 0 0 0.5rem; + font-family: "Georgia", "Palatino Linotype", serif; + font-size: clamp(2rem, 5vw, 3rem); + color: var(--text); +} + +.equipe-hero p { + margin: 0; + color: var(--text-secondary); + font-size: 1.1rem; + line-height: 1.7; +} + +.equipe-grid-section { + padding: 0 1.25rem clamp(2rem, 4vw, 3rem); +} diff --git a/p/equipe/creators.json b/p/equipe/creators.json new file mode 100644 index 0000000..84f8447 --- /dev/null +++ b/p/equipe/creators.json @@ -0,0 +1,22 @@ +[ + { + "name": "BlackAngelTVdev", + "role": "Owner", + "avatar": "/p/assets/img/logo.png", + "joined": "2026-03-17", + "email": "dami.scoot3@gmail.com", + "links": [ + { "label": "GitHub", "url": "https://github.com/BlackAngelTVdev" } + ] + }, + { + "name": "fkDeath", + "role": "Owner", + "avatar": "/p/assets/img/logo.png", + "joined": "2026-03-17", + "email": null, + "links": [ + { "label": "GitHub", "url": "https://github.com/fkDeath" } + ] + } +] diff --git a/p/equipe/index.html b/p/equipe/index.html new file mode 100644 index 0000000..26a0430 --- /dev/null +++ b/p/equipe/index.html @@ -0,0 +1,26 @@ + + + + + + L'équipe - FWS Linux + + + + + + +
+
+

L'équipe

+

Les personnes qui contribuent au projet FWS Linux.

+
+ +
+
+
+
+ + + +