From 5d1150ebd7ff8024deefbc2f1cab851f23b116ca Mon Sep 17 00:00:00 2001 From: Kevin Lecou Date: Thu, 15 Oct 2026 19:09:30 +0200 Subject: [PATCH] =?UTF-8?q?feat(galerie):=20heure=20d'envoi=20en=20l=C3=A9?= =?UTF-8?q?gende=20quand=20l'invit=C3=A9=20n'a=20laiss=C3=A9=20ni=20pr?= =?UTF-8?q?=C3=A9nom=20ni=20mot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- src/galerie/gallery.js | 11 +++++++++++ src/galerie/style.css | 13 ++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/galerie/gallery.js b/src/galerie/gallery.js index 75ae06a..f670fcd 100644 --- a/src/galerie/gallery.js +++ b/src/galerie/gallery.js @@ -129,7 +129,18 @@ function renderPolaroid(photo, { animate = false } = {}) { const caption = document.createElement("p"); caption.className = "polaroid__caption"; if (captionParts.length === 0) { + // Sans prénom ni mot : l'heure d'envoi (« 22 h 14 »), en heure de Paris. caption.classList.add("polaroid__caption--empty"); + const sentAt = new Date(photo.uploaded_at); + if (!Number.isNaN(sentAt.getTime())) { + caption.textContent = new Intl.DateTimeFormat("fr-FR", { + hour: "numeric", + minute: "2-digit", + timeZone: "Europe/Paris", + }) + .format(sentAt) + .replace(":", " h "); + } } else { caption.textContent = captionParts.join(" — "); } diff --git a/src/galerie/style.css b/src/galerie/style.css index a9252b3..7bd0a49 100644 --- a/src/galerie/style.css +++ b/src/galerie/style.css @@ -162,15 +162,10 @@ body { overflow-wrap: break-word; } -/* Sans prénom ni mot : un petit filet bordeaux à la place du texte. */ -.polaroid__caption--empty::before { - content: ""; - display: inline-block; - width: 1.25rem; - height: 1px; - vertical-align: middle; - background: var(--print-accent); - opacity: 0.6; +/* Sans prénom ni mot : l'heure d'envoi, en plus discret qu'une légende. */ +.polaroid__caption--empty { + color: var(--print-accent); + font-variant-numeric: tabular-nums; } /* Nouvel envoi : le tirage se pose, sans rebond. */