Fill schedule cards with faded tour photos

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Vincent Mahnke 2026-11-14 03:42:14 +01:00
commit 860ffaaed2
Signed by: ViMaSter
GPG key ID: 6D787326BA7D6469
3 changed files with 32 additions and 11 deletions

View file

@ -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. - `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" }`. - `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. - `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. For the events managed with Hackertours-Admin, the data file is generated by its website sync; don't edit it by hand.

View file

@ -135,31 +135,52 @@
} }
.schedule--picker .schedule__card--photo { .schedule--picker .schedule__card--photo {
grid-template-columns: minmax(0, 1fr) auto minmax(0, 6rem); isolation: isolate;
grid-template-rows: min-content min-content 1fr; overflow: hidden;
min-height: 7rem;
align-items: start; align-items: start;
.schedule__title { .schedule__title,
grid-column: 1 / 3; .schedule__photo-credit {
max-width: 70%;
overflow-wrap: anywhere;
}
.schedule__lang {
background: var(--color-body-bg);
} }
} }
.schedule__photo { .schedule__photo {
display: none; display: none;
grid-column: 3; position: absolute;
grid-row: 1 / 4; inset: 0;
z-index: -1;
margin: 0; margin: 0;
pointer-events: none;
img { img {
display: block; display: block;
width: 100%; 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 { .schedule__photo-credit {
display: none; display: none;
grid-column: 1 / 3; grid-column: 1 / -1;
grid-row: 3; grid-row: 3;
font-size: var(--fs-xs); font-size: var(--fs-xs);
color: var(--color-text-meta); color: var(--color-text-meta);

View file

@ -89,8 +89,8 @@ so an hour without tours still gets a row.
{{- if and .resource .alt }} {{- if and .resource .alt }}
{{- if and (eq .resource.ResourceType "image") (ne .resource.MediaType.SubType "svg") }} {{- if and (eq .resource.ResourceType "image") (ne .resource.MediaType.SubType "svg") }}
{{- $oriented := .resource.Filter images.AutoOrient }} {{- $oriented := .resource.Filter images.AutoOrient }}
{{- $side := math.Min 240 $oriented.Width $oriented.Height | int }} {{- $photo = $oriented }}
{{- $photo = $oriented.Fill (printf "%dx%d Smart" $side $side) }} {{- if gt $oriented.Width 1600 }}{{ $photo = $oriented.Resize "1600x" }}{{ end }}
{{- $photoAlt = .alt }} {{- $photoAlt = .alt }}
{{- $photoCredit = .credit }} {{- $photoCredit = .credit }}
{{- end }} {{- end }}