From f051f3738ec1e407b1be60840eb43aeabb2c433b Mon Sep 17 00:00:00 2001 From: skycel Date: Wed, 4 Feb 2026 21:36:02 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Story=205.7:=20liens=20contact=20se?= =?UTF-8?q?condaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/main.js | 17 ++++++- docs/stories/5.7.liens-contact-secondaires.md | 45 ++++++++++-------- pages/contact.php | 46 +++++++++++++++++++ tests/contact-links.test.php | 23 ++++++++++ tests/run.ps1 | 1 + 5 files changed, 112 insertions(+), 20 deletions(-) create mode 100644 tests/contact-links.test.php diff --git a/assets/js/main.js b/assets/js/main.js index 35f1786..ad95391 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -4,6 +4,7 @@ document.addEventListener('DOMContentLoaded', () => { initMobileMenu(); initNavbarScroll(); + initEmailProtection(); }); function initMobileMenu() { @@ -73,4 +74,18 @@ function initNavbarScroll() { navbar.classList.remove('shadow-lg'); } }, { passive: true }); -} \ No newline at end of file +} + +function initEmailProtection() { + const emailLink = document.getElementById('email-link'); + if (!emailLink) return; + + const user = emailLink.dataset.user; + const domain = emailLink.dataset.domain; + + if (user && domain) { + const email = `${user}@${domain}`; + emailLink.href = `mailto:${email}`; + emailLink.title = email; + } +} diff --git a/docs/stories/5.7.liens-contact-secondaires.md b/docs/stories/5.7.liens-contact-secondaires.md index 66ae257..06dc008 100644 --- a/docs/stories/5.7.liens-contact-secondaires.md +++ b/docs/stories/5.7.liens-contact-secondaires.md @@ -2,7 +2,7 @@ ## Status -Ready for Dev +review ## Story @@ -20,24 +20,24 @@ Ready for Dev ## Tasks / Subtasks -- [] **Task 1 : Ajouter la section dans contact.php** (AC: 1, 4) - - [] Titre "Retrouvez-moi aussi sur" - - [] Positionnement sous le formulaire (mt-16, pt-8, border-t) - - [] Style distinct mais cohérent (bg-surface-alt, border) +- [x] **Task 1 : Ajouter la section dans contact.php** (AC: 1, 4) + - [x] Titre "Retrouvez-moi aussi sur" + - [x] Positionnement sous le formulaire (mt-16, pt-8, border-t) + - [x] Style distinct mais cohérent (bg-surface-alt, border) -- [] **Task 2 : Ajouter les liens avec icônes** (AC: 2) - - [] LinkedIn avec icône SVG (#0A66C2) - - [] GitHub avec icône SVG - - [] Email avec icône SVG (primary) +- [x] **Task 2 : Ajouter les liens avec icônes** (AC: 2) + - [x] LinkedIn avec icône SVG (#0A66C2) + - [x] GitHub avec icône SVG + - [x] Email avec icône SVG (primary) -- [] **Task 3 : Configurer les liens** (AC: 3) - - [] `target="_blank"` + `rel="noopener noreferrer"` pour LinkedIn/GitHub - - [] `mailto:` généré par JS pour l'email +- [x] **Task 3 : Configurer les liens** (AC: 3) + - [x] `target="_blank"` + `rel="noopener noreferrer"` pour LinkedIn/GitHub + - [x] `mailto:` généré par JS pour l'email -- [] **Task 4 : Protéger l'email** (AC: 5) - - [] data-user et data-domain dans le HTML - - [] initEmailProtection() dans main.js - - [] Reconstruction du mailto au chargement +- [x] **Task 4 : Protéger l'email** (AC: 5) + - [x] data-user et data-domain dans le HTML + - [x] initEmailProtection() dans main.js + - [x] Reconstruction du mailto au chargement ## Dev Notes @@ -181,22 +181,28 @@ $encodedEmail = encodeEmail($email); ## Dev Agent Record ### Agent Model Used -Claude Opus 4.5 (claude-opus-4-5-20251101) +GPT-5 Codex + +### Implementation Plan +- Implémenter les tâches 1 à 4 dans l’ordre avec tests à chaque étape. +- Ajouter section et protection email via main.js. ### File List | File | Action | Description | |------|--------|-------------| | `pages/contact.php` | Modified | Section liens secondaires (LinkedIn, GitHub, Email) | | `assets/js/main.js` | Modified | Ajout initEmailProtection() | +| `tests/contact-links.test.php` | Added | Tests liens secondaires | +| `tests/run.ps1` | Modified | Ajout du test contact-links | ### Completion Notes - Section "Retrouvez-moi aussi sur" avec 3 liens -- LinkedIn : https://linkedin.com/in/celian-music (à personnaliser) +- LinkedIn : https://linkedin.com/in/celian-music - GitHub : https://github.com/skycel - Email protégé : data-user/data-domain + reconstruction JS - Icônes SVG avec couleurs appropriées (LinkedIn bleu, GitHub inherit, Email primary) - Hover state : border-primary/50 -- target="_blank" + rel="noopener noreferrer" pour les liens externes +- Tests : `powershell -ExecutionPolicy Bypass -File tests/run.ps1` ### Debug Log References Aucun problème rencontré. @@ -207,3 +213,4 @@ Aucun problème rencontré. |------|---------|-------------|--------| | 2026-01-22 | 0.1 | Création initiale | Sarah (PO) | | 2026-01-24 | 1.0 | Implémentation complète | James (Dev) | +| 2026-02-04 | 1.1 | Liens secondaires contact | Amelia (Dev) | diff --git a/pages/contact.php b/pages/contact.php index 11fe62e..0414847 100644 --- a/pages/contact.php +++ b/pages/contact.php @@ -176,6 +176,52 @@ include_template('navbar', compact('currentPage')); + +
+

Retrouvez-moi aussi sur

+ + +
diff --git a/tests/contact-links.test.php b/tests/contact-links.test.php new file mode 100644 index 0000000..4b82e6c --- /dev/null +++ b/tests/contact-links.test.php @@ -0,0 +1,23 @@ +