From f53721555f198423377d869493191dfc938d9124 Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 03:17:19 +0100 Subject: [PATCH 01/11] Show day picker on desktop schedules Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- themes/hackertours/assets/css/_schedule.css | 136 +++++++++++------- themes/hackertours/assets/js/schedule.js | 3 +- .../layouts/_shortcodes/schedule.html | 4 +- 4 files changed, 87 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 2791f61..5ec6083 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ days: For the events managed with Hackertours-Admin, the data file is generated by its website sync; don't edit it by hand. -Wide screens get one column per day on an hour grid, with tours that start at the same time side by side. The first column shows the hour wherever the first day has no tour in it. On narrow screens a day picker shows one day at a time, starting with today's day during the event. +A day picker shows one day at a time on all screen sizes, starting with today's day during the event. Without JavaScript, narrow screens show all days stacked; wide screens show a column per day on an hour grid. For a different event than the page's section, pass its name: `{{< schedule 39c3 >}}`. diff --git a/themes/hackertours/assets/css/_schedule.css b/themes/hackertours/assets/css/_schedule.css index d91766b..d752402 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -1,4 +1,4 @@ -/* Tour schedule shortcode: one column of cards per day, a day picker on narrow screens. */ +/* Tour schedule shortcode: a day picker, with a grid fallback on wide screens without JavaScript. */ .schedule { --schedule-line: color-mix(in oklch, var(--color-text) 20%, transparent); @@ -196,74 +196,104 @@ } } -/* The picker only exists with JavaScript and is only used on narrow screens. */ +/* The picker is only shown with JavaScript. */ .schedule__picker { display: none; } -@container (width < 48rem) { - /* Keeps a focused card from scrolling under the sticky day picker. */ - .schedule__title { - scroll-margin-block-start: 6rem; - } +/* Keeps a focused card from scrolling under the sticky day picker. */ +.schedule__title { + scroll-margin-block-start: 6rem; +} - .schedule__picker:not([hidden]) { - position: sticky; - inset-block-start: 0; - z-index: 2; - display: flex; - gap: 0.25rem; - margin-block-end: 1rem; - padding: 0.25rem; - border-radius: var(--radius-l); - background: var(--color-body-bg); - box-shadow: inset 0 0 0 1px var(--schedule-line); - } +.schedule__picker:not([hidden]) { + position: sticky; + inset-block-start: 0; + z-index: 2; + display: flex; + gap: 0.25rem; + margin-block-end: 1rem; + padding: 0.25rem; + border-radius: var(--radius-l); + background: var(--color-body-bg); + box-shadow: inset 0 0 0 1px var(--schedule-line); +} - .schedule__pick { - flex: 1; - display: flex; - flex-direction: column; - align-items: center; - padding: 0.35rem 0.25rem; - border: 0; - border-radius: var(--radius-m); - background: transparent; - color: var(--color-text); - font-family: var(--ff-alt); - font-size: var(--fs-s); - font-weight: bold; - cursor: pointer; +.schedule__pick { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + padding: 0.35rem 0.25rem; + border: 0; + border-radius: var(--radius-m); + background: transparent; + color: var(--color-text); + font-family: var(--ff-alt); + font-size: var(--fs-s); + font-weight: bold; + cursor: pointer; - &[aria-pressed="true"] { - background: var(--schedule-accent); - color: var(--color-body-bg); + &[aria-pressed="true"] { + background: var(--schedule-accent); + color: var(--color-body-bg); - .schedule__pick-date { - color: inherit; - } + .schedule__pick-date { + color: inherit; } } +} - .schedule__pick-date { - font-size: var(--fs-xs); - font-weight: normal; - color: var(--color-text-meta); +.schedule__pick-date { + font-size: var(--fs-xs); + font-weight: normal; + color: var(--color-text-meta); +} + +.schedule--picker { + .schedule__day:not(.schedule__day--selected) { + display: none; + } + + /* The picker already names the day. */ + .schedule__day-title { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + clip-path: inset(50%); + white-space: nowrap; } +} +@container (width >= 48rem) { .schedule--picker { - .schedule__day:not(.schedule__day--selected) { - display: none; + .schedule__days { + display: block; + } + + .schedule__day { + display: block; + } + + .schedule__list { + grid-template-rows: none; + } + + .schedule__card { + grid-row: auto; + } + + .schedule__title { + display: block; + -webkit-line-clamp: unset; + line-clamp: unset; + overflow: visible; + min-height: 0; } - /* The picker already names the day. */ - .schedule__day-title { - position: absolute; - width: 1px; - height: 1px; - overflow: hidden; - clip-path: inset(50%); - white-space: nowrap; + .schedule__hour { + display: none; } } } diff --git a/themes/hackertours/assets/js/schedule.js b/themes/hackertours/assets/js/schedule.js index 05bd15f..10fd9ae 100644 --- a/themes/hackertours/assets/js/schedule.js +++ b/themes/hackertours/assets/js/schedule.js @@ -1,5 +1,4 @@ -// Day picker for the schedule shortcode. The CSS only uses it on narrow screens; -// without JavaScript all days stack vertically there. +// Day picker for the schedule shortcode. Without JavaScript all days remain visible. for (const schedule of document.querySelectorAll('[data-schedule]')) { const picker = schedule.querySelector('.schedule__picker'); const buttons = [...picker.querySelectorAll('button')]; diff --git a/themes/hackertours/layouts/_shortcodes/schedule.html b/themes/hackertours/layouts/_shortcodes/schedule.html index ed4c9f1..fb933b5 100644 --- a/themes/hackertours/layouts/_shortcodes/schedule.html +++ b/themes/hackertours/layouts/_shortcodes/schedule.html @@ -1,6 +1,6 @@ {{- /* -Tour schedule from data/schedule/.yaml, one column of tour cards per day. -On narrow screens the days stack; with JavaScript a day picker shows one day at a time. +Tour schedule from data/schedule/.yaml. +With JavaScript a day picker shows one day at a time; without it all days are visible. Usage: {{< schedule >}} on a section page (the event is the section name), or {{< schedule 39c3 >}}. -- 2.54.0 From 0e86c57987ebbfb6c79e1f914085032781bb3a7d Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 03:19:02 +0100 Subject: [PATCH 02/11] Show tour photos in schedule cards Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 1 + themes/hackertours/assets/css/_schedule.css | 23 ++++++++++++++++++ .../layouts/_partials/first-page-image.html | 19 +++++++++++++++ .../layouts/_partials/head/extra.html | 17 ++++--------- .../layouts/_shortcodes/schedule.html | 24 ++++++++++++++++++- 5 files changed, 70 insertions(+), 14 deletions(-) create mode 100644 themes/hackertours/layouts/_partials/first-page-image.html diff --git a/README.md b/README.md index 5ec6083..9fbafe9 100644 --- a/README.md +++ b/README.md @@ -114,6 +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. +- 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. 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 d752402..ae64c53 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -133,6 +133,29 @@ gap: 0 0.5rem; } +.schedule__card--photo { + grid-template-columns: minmax(0, 1fr) auto minmax(0, 6rem); + + .schedule__title { + grid-column: 1 / 3; + } +} + +.schedule__photo { + grid-column: 3; + grid-row: 1 / 3; + margin: 0; + font-size: var(--fs-xs); + color: var(--color-text-meta); + overflow-wrap: anywhere; + + img { + display: block; + width: 100%; + height: auto; + } +} + .schedule__status { font-family: var(--ff-alt); font-size: var(--fs-xs); diff --git a/themes/hackertours/layouts/_partials/first-page-image.html b/themes/hackertours/layouts/_partials/first-page-image.html new file mode 100644 index 0000000..5225aa8 --- /dev/null +++ b/themes/hackertours/layouts/_partials/first-page-image.html @@ -0,0 +1,19 @@ +{{- $result := dict -}} +{{- with findRESubmatch `!\[([^\]]*)\]\(\s*]+)|\{\{<\s*gallery-image\s([^}]*)>\}\}` .RawContent 1 -}} + {{- $alt := index . 0 1 -}} + {{- $dest := index . 0 2 -}} + {{- $credit := "" -}} + {{- with index . 0 3 -}} + {{- $dest = "" -}} + {{- $alt = "" -}} + {{- with findRESubmatch "\\bsrc=(?:\"([^\"]*)\"|`([^`]*)`)" . 1 }}{{ $dest = or (index . 0 1) (index . 0 2) }}{{ end -}} + {{- with findRESubmatch "\\balt=(?:\"([^\"]*)\"|`([^`]*)`)" . 1 }}{{ $alt = or (index . 0 1) (index . 0 2) }}{{ end -}} + {{- with findRESubmatch "\\bcredit=(?:\"([^\"]*)\"|`([^`]*)`)" . 1 }}{{ $credit = or (index . 0 1) (index . 0 2) }}{{ end -}} + {{- end -}} + {{- $resource := false -}} + {{- if not (findRE `^https?://` $dest) -}} + {{- $resource = or ($.Resources.Get (strings.TrimPrefix "./" $dest)) (resources.Get $dest) -}} + {{- end -}} + {{- $result = dict "alt" $alt "credit" $credit "dest" $dest "resource" $resource -}} +{{- end -}} +{{- return $result -}} diff --git a/themes/hackertours/layouts/_partials/head/extra.html b/themes/hackertours/layouts/_partials/head/extra.html index 74fd6b7..6bedff0 100644 --- a/themes/hackertours/layouts/_partials/head/extra.html +++ b/themes/hackertours/layouts/_partials/head/extra.html @@ -6,24 +6,15 @@ gallery-image shortcode, scaled down to at most 1200 pixels wide, with its alt t og:image:alt. */ -}} {{- if not ($.Param "image") -}} - {{- /* Whichever comes first: a Markdown image or a gallery-image shortcode (src and alt in "…" or `…`). */ -}} - {{- with findRESubmatch `!\[([^\]]*)\]\(\s*]+)|\{\{<\s*gallery-image\s([^}]*)>\}\}` .RawContent 1 -}} - {{- $alt := index . 0 1 -}} - {{- $dest := index . 0 2 -}} - {{- with index . 0 3 -}} - {{- $dest = "" -}} - {{- $alt = "" -}} - {{- with findRESubmatch "\\bsrc=(?:\"([^\"]*)\"|`([^`]*)`)" . 1 }}{{ $dest = or (index . 0 1) (index . 0 2) }}{{ end -}} - {{- with findRESubmatch "\\balt=(?:\"([^\"]*)\"|`([^`]*)`)" . 1 }}{{ $alt = or (index . 0 1) (index . 0 2) }}{{ end -}} - {{- end -}} + {{- with partialCached "first-page-image.html" . .RelPermalink -}} + {{- $alt := .alt -}} + {{- $dest := .dest -}} {{- $url := "" -}} {{- $width := 0 -}} {{- $height := 0 -}} - {{- $resource := false -}} + {{- $resource := .resource -}} {{- if findRE `^https?://` $dest -}} {{- $url = $dest -}} - {{- else -}} - {{- $resource = or ($.Resources.Get (strings.TrimPrefix "./" $dest)) (resources.Get $dest) -}} {{- end -}} {{- with $resource -}} {{- $image := . -}} diff --git a/themes/hackertours/layouts/_shortcodes/schedule.html b/themes/hackertours/layouts/_shortcodes/schedule.html index fb933b5..09200c1 100644 --- a/themes/hackertours/layouts/_shortcodes/schedule.html +++ b/themes/hackertours/layouts/_shortcodes/schedule.html @@ -81,7 +81,23 @@ so an hour without tours still gets a row. {{- /* A tour's own title, in the page's language, replaces its page's title. */}} {{- $ownTitle := "" }} {{- with .title }}{{ $ownTitle = index . site.Language.Name | default (index . "en") }}{{ end }} -
  • +{{- $photo := false }} +{{- $photoAlt := "" }} +{{- $photoCredit := "" }} +{{- with $page }} + {{- with partialCached "first-page-image.html" . .RelPermalink }} + {{- 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) }} + {{- $photoAlt = .alt }} + {{- $photoCredit = .credit }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} +
  • {{- if $soldOut }} @@ -97,6 +113,12 @@ so an hour without tours still gets a row. {{- else }} {{ $ownTitle | default $entry.tour }} {{- end }} +{{- with $photo }} +
    +{{ $photoAlt }} +{{- with $photoCredit }}
    {{ . }}
    {{ end }} +
    +{{- end }}
  • {{- end }} -- 2.54.0 From 7f30e9b5a526d33018b5aa219b9cb7038811e9ad Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 03:19:25 +0100 Subject: [PATCH 03/11] Keep grid fallback free of thumbnails Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- themes/hackertours/assets/css/_schedule.css | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9fbafe9..724bc9c 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. -- 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 is shown on its card when it has alt text; its gallery credit is displayed below it. 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 ae64c53..60d4992 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -133,7 +133,7 @@ gap: 0 0.5rem; } -.schedule__card--photo { +.schedule--picker .schedule__card--photo { grid-template-columns: minmax(0, 1fr) auto minmax(0, 6rem); .schedule__title { @@ -142,6 +142,7 @@ } .schedule__photo { + display: none; grid-column: 3; grid-row: 1 / 3; margin: 0; @@ -156,6 +157,10 @@ } } +.schedule--picker .schedule__photo { + display: block; +} + .schedule__status { font-family: var(--ff-alt); font-size: var(--fs-xs); -- 2.54.0 From d508e041a881be5e85ef91409725cd92a932f09b Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 03:23:03 +0100 Subject: [PATCH 04/11] Keep photo credits readable in schedule cards Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- themes/hackertours/assets/css/_schedule.css | 19 ++++++++++++++----- .../layouts/_shortcodes/schedule.html | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/themes/hackertours/assets/css/_schedule.css b/themes/hackertours/assets/css/_schedule.css index 60d4992..109895e 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -109,6 +109,7 @@ grid-template-columns: 1fr auto; gap: 0.15rem 0.5rem; margin: 0; + max-width: none; padding: 0.5rem 0.75rem 0.6rem; border: 1px solid var(--schedule-line); border-inline-start: 3px solid var(--schedule-accent); @@ -135,6 +136,8 @@ .schedule--picker .schedule__card--photo { grid-template-columns: minmax(0, 1fr) auto minmax(0, 6rem); + grid-template-rows: min-content min-content 1fr; + align-items: start; .schedule__title { grid-column: 1 / 3; @@ -144,11 +147,8 @@ .schedule__photo { display: none; grid-column: 3; - grid-row: 1 / 3; + grid-row: 1 / 4; margin: 0; - font-size: var(--fs-xs); - color: var(--color-text-meta); - overflow-wrap: anywhere; img { display: block; @@ -157,7 +157,16 @@ } } -.schedule--picker .schedule__photo { +.schedule__photo-credit { + display: none; + grid-column: 1 / 3; + grid-row: 3; + font-size: var(--fs-xs); + color: var(--color-text-meta); +} + +.schedule--picker .schedule__photo, +.schedule--picker .schedule__photo-credit { display: block; } diff --git a/themes/hackertours/layouts/_shortcodes/schedule.html b/themes/hackertours/layouts/_shortcodes/schedule.html index 09200c1..635069e 100644 --- a/themes/hackertours/layouts/_shortcodes/schedule.html +++ b/themes/hackertours/layouts/_shortcodes/schedule.html @@ -116,8 +116,8 @@ so an hour without tours still gets a row. {{- with $photo }}
    {{ $photoAlt }} -{{- with $photoCredit }}
    {{ . }}
    {{ end }}
    +{{- with $photoCredit }}{{ . }}{{ end }} {{- end }} {{- end }} -- 2.54.0 From 860ffaaed29f6ac0da1ed199677fe12a76aa8d61 Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 03:42:14 +0100 Subject: [PATCH 05/11] 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 }} -- 2.54.0 From b9261696198fc9a34a8884c6aecbccd3e17da366 Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 04:25:06 +0100 Subject: [PATCH 06/11] Align schedule photos to right half of card Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- themes/hackertours/assets/css/_schedule.css | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e297ace..6a9755c 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 fills its card behind a fade when it has alt text; its gallery credit remains visible. +- With the day picker, the first local photo in the tour page fills the right half of 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 0707657..707d9e3 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -135,6 +135,8 @@ } .schedule--picker .schedule__card--photo { + --schedule-photo-fade: color-mix(in srgb, var(--color-text) 4%, var(--color-body-bg)); + isolation: isolate; overflow: hidden; min-height: 7rem; @@ -154,7 +156,7 @@ .schedule__photo { display: none; position: absolute; - inset: 0; + inset: 0 0 0 50%; z-index: -1; margin: 0; pointer-events: none; @@ -171,10 +173,10 @@ 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%); + var(--schedule-photo-fade) 0%, + color-mix(in srgb, var(--schedule-photo-fade) 97%, transparent) 10%, + color-mix(in srgb, var(--schedule-photo-fade) 90%, transparent) 40%, + color-mix(in srgb, var(--schedule-photo-fade) 20%, transparent) 100%); } } -- 2.54.0 From db7aca8538a0ddf00a8209e2bf93d22d3a55e5c7 Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 04:27:55 +0100 Subject: [PATCH 07/11] Blend schedule photos into card background Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- themes/hackertours/assets/css/_schedule.css | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/themes/hackertours/assets/css/_schedule.css b/themes/hackertours/assets/css/_schedule.css index 707d9e3..f21564f 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -135,8 +135,6 @@ } .schedule--picker .schedule__card--photo { - --schedule-photo-fade: color-mix(in srgb, var(--color-text) 4%, var(--color-body-bg)); - isolation: isolate; overflow: hidden; min-height: 7rem; @@ -166,17 +164,11 @@ width: 100%; height: 100%; object-fit: cover; - } - - &::after { - content: ""; - position: absolute; - inset: 0; - background: linear-gradient(90deg, - var(--schedule-photo-fade) 0%, - color-mix(in srgb, var(--schedule-photo-fade) 97%, transparent) 10%, - color-mix(in srgb, var(--schedule-photo-fade) 90%, transparent) 40%, - color-mix(in srgb, var(--schedule-photo-fade) 20%, transparent) 100%); + mask-image: linear-gradient(90deg, + transparent 0%, + rgb(0 0 0 / 3%) 10%, + rgb(0 0 0 / 10%) 40%, + rgb(0 0 0 / 80%) 100%); } } -- 2.54.0 From 4c26cda7b4c5a71a7f3893e439ced8c0f5e18487 Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 04:29:12 +0100 Subject: [PATCH 08/11] Hide schedule photos at mobile menu breakpoint Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- themes/hackertours/assets/css/_schedule.css | 42 +++++++++++---------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 6a9755c..0745474 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 fills the right half of its card behind a fade when it has alt text; its gallery credit remains visible. +- With the day picker on screens wider than the mobile-menu breakpoint (666px), the first local photo in the tour page fills the right half of 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 f21564f..397260d 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -134,23 +134,6 @@ gap: 0 0.5rem; } -.schedule--picker .schedule__card--photo { - isolation: isolate; - overflow: hidden; - min-height: 7rem; - align-items: start; - - .schedule__title, - .schedule__photo-credit { - max-width: 70%; - overflow-wrap: anywhere; - } - - .schedule__lang { - background: var(--color-body-bg); - } -} - .schedule__photo { display: none; position: absolute; @@ -180,9 +163,28 @@ color: var(--color-text-meta); } -.schedule--picker .schedule__photo, -.schedule--picker .schedule__photo-credit { - display: block; +@media (width >= 667px) { + .schedule--picker .schedule__card--photo { + isolation: isolate; + overflow: hidden; + min-height: 7rem; + align-items: start; + + .schedule__title, + .schedule__photo-credit { + max-width: 70%; + overflow-wrap: anywhere; + } + + .schedule__lang { + background: var(--color-body-bg); + } + } + + .schedule--picker .schedule__photo, + .schedule--picker .schedule__photo-credit { + display: block; + } } .schedule__status { -- 2.54.0 From ce03851d574128b50f0479fae0c73b02bd61dd92 Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 04:47:18 +0100 Subject: [PATCH 09/11] List upcoming schedule days on wider screens Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 4 +- tests/test_schedule.js | 75 +++++++++++++++++++++ themes/hackertours/assets/css/_schedule.css | 44 +++++++----- themes/hackertours/assets/js/schedule.js | 9 ++- 4 files changed, 114 insertions(+), 18 deletions(-) create mode 100644 tests/test_schedule.js diff --git a/README.md b/README.md index 0745474..d27947a 100644 --- a/README.md +++ b/README.md @@ -114,11 +114,11 @@ 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 on screens wider than the mobile-menu breakpoint (666px), the first local photo in the tour page fills the right half of its card behind a fade when it has alt text; its gallery credit remains visible. +- With JavaScript on screens wider than the mobile-menu breakpoint (666px), the first local photo in the tour page fills the right half of 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. -A day picker shows one day at a time on all screen sizes, starting with today's day during the event. Without JavaScript, narrow screens show all days stacked; wide screens show a column per day on an hour grid. +With JavaScript, narrow screens show a day picker, starting with today's day during the event. Wider screens list days under their headings, hiding past days until the event ends. Before and after the event, all days are shown. Dates use the visitor's local time. Without JavaScript, narrow screens show all days stacked; wide screens show a column per day on an hour grid. For a different event than the page's section, pass its name: `{{< schedule 39c3 >}}`. diff --git a/tests/test_schedule.js b/tests/test_schedule.js new file mode 100644 index 0000000..28dd716 --- /dev/null +++ b/tests/test_schedule.js @@ -0,0 +1,75 @@ +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const test = require('node:test'); +const vm = require('node:vm'); + +const script = fs.readFileSync( + path.join(__dirname, '../themes/hackertours/assets/js/schedule.js'), + 'utf8', +); + +function runSchedule(today) { + const days = new Map(); + const buttons = Array.from({ length: 5 }, (_, day) => { + const id = `day-${day}`; + const classes = new Set(); + days.set(id, { + classes, + classList: { + toggle(name, enabled) { + if (enabled) classes.add(name); + else classes.delete(name); + }, + }, + }); + return { + dataset: { date: `2026-12-${26 + day}` }, + getAttribute: () => id, + setAttribute() {}, + addEventListener(name, callback) { + this.click = callback; + }, + }; + }); + const picker = { querySelectorAll: () => buttons, hidden: true }; + const schedule = { + querySelector: () => picker, + classList: { add() {} }, + }; + const document = { + querySelectorAll: () => [schedule], + getElementById: (id) => days.get(id), + }; + const Date = class { + toLocaleDateString() { + return today; + } + }; + vm.runInNewContext(script, { document, Date }); + return { buttons, days }; +} + +test('only past days are hidden during the event, and all return afterwards', () => { + const cases = [ + ['2026-12-25', []], + ['2026-12-26', []], + ['2026-12-28', [0, 1]], + ['2026-12-30', [0, 1, 2, 3]], + ['2026-12-31', []], + ]; + for (const [today, expected] of cases) { + const { days } = runSchedule(today); + const past = [...days.values()] + .map((day, index) => day.classes.has('schedule__day--past') ? index : null) + .filter((index) => index !== null); + assert.deepEqual(past, expected, today); + } +}); + +test('mobile selection can still switch to a past day', () => { + const { buttons, days } = runSchedule('2026-12-28'); + buttons[0].click(); + assert.ok(days.get('day-0').classes.has('schedule__day--selected')); + assert.ok(!days.get('day-2').classes.has('schedule__day--selected')); +}); diff --git a/themes/hackertours/assets/css/_schedule.css b/themes/hackertours/assets/css/_schedule.css index 397260d..5489285 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -1,4 +1,4 @@ -/* Tour schedule shortcode: a day picker, with a grid fallback on wide screens without JavaScript. */ +/* Tour schedule shortcode: a mobile day picker and a wide-screen list, with a no-JavaScript grid fallback. */ .schedule { --schedule-line: color-mix(in oklch, var(--color-text) 20%, transparent); @@ -250,7 +250,7 @@ } } -/* The picker is only shown with JavaScript. */ +/* The picker is only shown on mobile with JavaScript. */ .schedule__picker { display: none; } @@ -304,30 +304,37 @@ color: var(--color-text-meta); } -.schedule--picker { - .schedule__day:not(.schedule__day--selected) { - display: none; - } +@media (width <= 666px) { + .schedule--picker { + .schedule__day:not(.schedule__day--selected) { + display: none; + } - /* The picker already names the day. */ - .schedule__day-title { - position: absolute; - width: 1px; - height: 1px; - overflow: hidden; - clip-path: inset(50%); - white-space: nowrap; + /* The picker already names the day. */ + .schedule__day-title { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + clip-path: inset(50%); + white-space: nowrap; + } } } @container (width >= 48rem) { .schedule--picker { .schedule__days { - display: block; + display: grid; + grid-template-columns: none; + grid-template-rows: none; + gap: var(--spacing-l); } .schedule__day { display: block; + grid-column: auto; + grid-row: auto; } .schedule__list { @@ -351,3 +358,10 @@ } } } + +@media (width >= 667px) { + .schedule__picker:not([hidden]), + .schedule--picker .schedule__day--past { + display: none; + } +} diff --git a/themes/hackertours/assets/js/schedule.js b/themes/hackertours/assets/js/schedule.js index 10fd9ae..9ce06a6 100644 --- a/themes/hackertours/assets/js/schedule.js +++ b/themes/hackertours/assets/js/schedule.js @@ -1,4 +1,4 @@ -// Day picker for the schedule shortcode. Without JavaScript all days remain visible. +// Responsive schedule for the shortcode. Without JavaScript all days remain visible. for (const schedule of document.querySelectorAll('[data-schedule]')) { const picker = schedule.querySelector('.schedule__picker'); const buttons = [...picker.querySelectorAll('button')]; @@ -21,6 +21,13 @@ for (const schedule of document.querySelectorAll('[data-schedule]')) { const today = new Date().toLocaleDateString('sv'); select(buttons.find((button) => button.dataset.date === today) ?? buttons[0]); + const hasUpcomingDays = buttons.some((button) => button.dataset.date >= today); + for (const button of buttons) { + document + .getElementById(button.getAttribute('aria-controls')) + .classList.toggle('schedule__day--past', hasUpcomingDays && button.dataset.date < today); + } + picker.hidden = false; schedule.classList.add('schedule--picker'); } -- 2.54.0 From c66576c3b14ce5c65f5faf4526db979a95c534a3 Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 04:48:33 +0100 Subject: [PATCH 10/11] Close fractional schedule breakpoint gap Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- themes/hackertours/assets/css/_schedule.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d27947a..74c753a 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 JavaScript on screens wider than the mobile-menu breakpoint (666px), the first local photo in the tour page fills the right half of its card behind a fade when it has alt text; its gallery credit remains visible. +- With JavaScript at viewport widths of at least 667px, the first local photo in the tour page fills the right half of 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 5489285..ca7e936 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -304,7 +304,7 @@ color: var(--color-text-meta); } -@media (width <= 666px) { +@media (width < 667px) { .schedule--picker { .schedule__day:not(.schedule__day--selected) { display: none; -- 2.54.0 From c43778d568048235fe8206c2e1c6035ebc0c08f2 Mon Sep 17 00:00:00 2001 From: Vincent Mahnke Date: Sat, 14 Nov 2026 04:50:16 +0100 Subject: [PATCH 11/11] Show more of schedule photos Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- themes/hackertours/assets/css/_schedule.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 74c753a..ad41192 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 JavaScript at viewport widths of at least 667px, the first local photo in the tour page fills the right half of its card behind a fade when it has alt text; its gallery credit remains visible. +- With JavaScript at viewport widths of at least 667px, the first local photo in the tour page fills the right 40% of 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 ca7e936..7757cfc 100644 --- a/themes/hackertours/assets/css/_schedule.css +++ b/themes/hackertours/assets/css/_schedule.css @@ -137,7 +137,7 @@ .schedule__photo { display: none; position: absolute; - inset: 0 0 0 50%; + inset: 0 0 0 60%; z-index: -1; margin: 0; pointer-events: none; -- 2.54.0