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");
|
const caption = document.createElement("p");
|
||||||
caption.className = "polaroid__caption";
|
caption.className = "polaroid__caption";
|
||||||
if (captionParts.length === 0) {
|
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");
|
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 {
|
} else {
|
||||||
caption.textContent = captionParts.join(" — ");
|
caption.textContent = captionParts.join(" — ");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,15 +162,10 @@ body {
|
|||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sans prénom ni mot : un petit filet bordeaux à la place du texte. */
|
/* Sans prénom ni mot : l'heure d'envoi, en plus discret qu'une légende. */
|
||||||
.polaroid__caption--empty::before {
|
.polaroid__caption--empty {
|
||||||
content: "";
|
color: var(--print-accent);
|
||||||
display: inline-block;
|
font-variant-numeric: tabular-nums;
|
||||||
width: 1.25rem;
|
|
||||||
height: 1px;
|
|
||||||
vertical-align: middle;
|
|
||||||
background: var(--print-accent);
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Nouvel envoi : le tirage se pose, sans rebond. */
|
/* Nouvel envoi : le tirage se pose, sans rebond. */
|
||||||
|
|||||||
Reference in New Issue
Block a user