feat(galerie): heure d'envoi en légende quand l'invité n'a laissé ni prénom ni mot
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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(" — ");
|
||||
}
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user