From 860ffaaed29f6ac0da1ed199677fe12a76aa8d61 Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 03:42:14 +0100 Subject: [PATCH] Fill schedule cards with faded tour photos Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- themes/hackertours/assets/css/_schedule.css | 37 +++++++++++++++---- .../layouts/_shortcodes/schedule.html | 4 +- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 724bc9c..e297ace 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ days: - `time` is `HH:MM` with a leading zero (`09:30`). Tours are sorted by time, so their order in the file doesn't matter. - `title` (optional) replaces the page's title on the card, with one entry per language: `title: { de: "Hafen am Abend", en: "Harbour by Night" }`. - `status` (optional): `soldout` marks the tour as fully booked. Other values are ignored. -- With the day picker, the first local photo in the tour page is shown on its card when it has alt text; its gallery credit is displayed below it. +- With the day picker, the first local photo in the tour page fills its card behind a fade when it has alt text; its gallery credit remains visible. For the events managed with Hackertours-Admin, the data file is generated by its website sync; don't edit it by hand. diff --git a/themes/hackertours/assets/css/_schedule.css b/themes/hackertours/assets/css/_schedule.css index 109895e..0707657 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -135,31 +135,52 @@ } .schedule--picker .schedule__card--photo { - grid-template-columns: minmax(0, 1fr) auto minmax(0, 6rem); - grid-template-rows: min-content min-content 1fr; + isolation: isolate; + overflow: hidden; + min-height: 7rem; align-items: start; - .schedule__title { - grid-column: 1 / 3; + .schedule__title, + .schedule__photo-credit { + max-width: 70%; + overflow-wrap: anywhere; + } + + .schedule__lang { + background: var(--color-body-bg); } } .schedule__photo { display: none; - grid-column: 3; - grid-row: 1 / 4; + position: absolute; + inset: 0; + z-index: -1; margin: 0; + pointer-events: none; img { display: block; width: 100%; - height: auto; + height: 100%; + object-fit: cover; + } + + &::after { + content: ""; + position: absolute; + inset: 0; + background: linear-gradient(90deg, + var(--color-body-bg) 0%, + color-mix(in srgb, var(--color-body-bg) 97%, transparent) 35%, + color-mix(in srgb, var(--color-body-bg) 90%, transparent) 65%, + color-mix(in srgb, var(--color-body-bg) 20%, transparent) 100%); } } .schedule__photo-credit { display: none; - grid-column: 1 / 3; + grid-column: 1 / -1; grid-row: 3; font-size: var(--fs-xs); color: var(--color-text-meta); diff --git a/themes/hackertours/layouts/_shortcodes/schedule.html b/themes/hackertours/layouts/_shortcodes/schedule.html index 635069e..226cb5e 100644 --- a/themes/hackertours/layouts/_shortcodes/schedule.html +++ b/themes/hackertours/layouts/_shortcodes/schedule.html @@ -89,8 +89,8 @@ so an hour without tours still gets a row. {{- if and .resource .alt }} {{- if and (eq .resource.ResourceType "image") (ne .resource.MediaType.SubType "svg") }} {{- $oriented := .resource.Filter images.AutoOrient }} - {{- $side := math.Min 240 $oriented.Width $oriented.Height | int }} - {{- $photo = $oriented.Fill (printf "%dx%d Smart" $side $side) }} + {{- $photo = $oriented }} + {{- if gt $oriented.Width 1600 }}{{ $photo = $oriented.Resize "1600x" }}{{ end }} {{- $photoAlt = .alt }} {{- $photoCredit = .credit }} {{- end }}