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. */