diff --git a/assets/_schedule.scss b/assets/_schedule.scss new file mode 100644 index 0000000..afebe87 --- /dev/null +++ b/assets/_schedule.scss @@ -0,0 +1,123 @@ +@import 'colors'; + +$timeslot-height: 0.65em; + +.schedule { + display: flex; + overflow-x: auto; + + .schedule-date { + height: 0; + position: relative; + top: calc(-3rem - 1px); + visibility: hidden; + width: 0; + } + + .schedule-event { + border: 1px solid $color-highlight; + border-radius: 0.5em; + color: currentColor; + display: flex; + grid-row: calc(var(--start) + 1) / calc(var(--end) + 1); + overflow: hidden; + text-decoration: none; + + &:hover .schedule-event-detail { + text-decoration: underline; + } + + & > div { + padding: 0.5em; + } + } + + .schedule-event-detail { + border-left: 1px solid $color-highlight; + overflow: hidden; + + .schedule-speaker, .schedule-title { + overflow-x: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + .schedule-event-time { + display: flex; + flex-direction: column; + + :nth-child(2) { + line-height: 1.1; + } + } + + .schedule-grid { + display: grid; + grid-auto-rows: $timeslot-height; + grid-template-rows: auto; + + &.schedule-room { + grid-template-columns: 400px; + } + + & > * { + grid-column: 1 / 2; + } + } + + .schedule-room { + margin: 0 0.5em; + + & > .schedule-title { + text-align: center; + } + } + + .schedule-time { + border-top: 1px solid $color-highlight; + grid-row: calc(var(--start) + 1) / span var(--span); + } + + .schedule-timeline { + background: $color-background; + padding-right: 0.5em; + position: sticky; + left: 0; + } +} + +.schedule-days { + background: $color-background; + display: flex; + font-size: 1rem; + line-height: 1; + overflow-x: auto; + padding: 1em 0; + position: sticky; + top: 0; + z-index: 42; + + a { + padding: 0 0.5em; + white-space: nowrap; + + &:first-child { + padding-left: 0; + } + + &:last-child { + padding-right: 0; + } + } +} + +.schedule-info { + .schedule-timezone { + font-weight: bold; + } + + .schedule-version { + font-style: italic; + } +} diff --git a/assets/style.scss b/assets/style.scss index ce86a35..18a8a14 100644 --- a/assets/style.scss +++ b/assets/style.scss @@ -1,6 +1,7 @@ @import 'breakpoints'; @import 'colors'; @import 'fonts'; +@import 'schedule'; @import 'vars'; * { diff --git a/layouts/shortcodes/grid_test.html b/layouts/shortcodes/grid_test.html new file mode 100644 index 0000000..68e4eeb --- /dev/null +++ b/layouts/shortcodes/grid_test.html @@ -0,0 +1,16 @@ +
+
+
00:00
+
00:30
+
+
+
asdf
+
qwer
+
1234
+
+
+
asdf
+
qwer
+
1234
+
+
diff --git a/layouts/shortcodes/schedule.html b/layouts/shortcodes/schedule.html new file mode 100644 index 0000000..a1539c2 --- /dev/null +++ b/layouts/shortcodes/schedule.html @@ -0,0 +1,100 @@ +{{ $data := getJSON (.Get "url") }} +{{ with $data.schedule }} + +{{ $timeslotDuration := 0 }} +{{ range split .conference.timeslot_duration ":" }} + {{ $timeslotDuration = add (mul $timeslotDuration 60) (int .) }} +{{ end }} + +{{ $rooms := dict }} +{{ range $day := .conference.days }} + {{ range $room := $data.schedule.conference.rooms }} + {{ if index $rooms $room.name }} + {{ $rooms = merge $rooms (dict $room.name ((index $rooms $room.name) | append (index $day.rooms .name))) }} + {{ else }} + {{ $rooms = merge $rooms (dict $room.name (index $day.rooms .name)) }} + {{ end }} + {{ end }} +{{ end }} + +{{ $events := slice }} +{{ range $rooms }} + {{ with . }} + {{ if $events }} + {{ $events = $events | append . }} + {{ else }} + {{ $events = . }} + {{ end }} + {{ end }} +{{ end }} + +{{ $events = sort $events "date" }} +{{ $startDate := time (index $events 0).date }} +{{ $endDate := 0 }} +{{ with index $events (sub (len $events) 1) }} + {{ $lastDuration := 0 }} + {{ range split .duration ":" }} + {{ $lastDuration = add (mul $lastDuration 60) (int .) }} + {{ end }} + {{ $endDate = time (add (time .date).Unix (mul $lastDuration 60)) }} +{{ end }} + +

+ Version: {{ .version }} +
Zeitangaben in {{ $startDate.Format "MST" }} +

+ +
+{{ range .conference.days }} + {{ .date }}· +{{ end }} + zurück nach oben +
+ +
+
+

+{{ $lastDate := 0 }} +{{ range seq 1 (div 30 $timeslotDuration) (div ($endDate.Sub $startDate).Minutes $timeslotDuration) }} +{{ $date := time (add $startDate.Unix (mul (sub . 1) (mul $timeslotDuration 60))) }} +
+{{ if or (not $lastDate) (ne ($date.Format "2006-01-02") ($lastDate.Format "2006-01-02")) }} +
{{ $date.Format "2006-01-02" }}
+{{ end }} + {{ $date.Format "15:04" }} +
+{{ $lastDate = $date }} +{{ end }} +
+{{ range sort $data.schedule.conference.rooms "name" }} +{{ $name := .name }} +{{ $room := index $rooms $name }} +{{ with $room }} +
+

{{ $name }}

+{{ range . }} +{{ $start := add (div ((time .date).Sub $startDate).Minutes $timeslotDuration) 1 }} +{{ $duration := 0 }} +{{ range split .duration ":" }} +{{ $duration = add (mul $duration 60) (int .) }} +{{ end }} +{{ $end := add $start (div $duration $timeslotDuration) }} + +
+ {{ (time .date).Format "15:04" }} + + {{ (time (int (add $startDate.Unix (mul (sub $end 1) (mul $timeslotDuration 60))))).Format "15:04" }} +
+
+

{{ .title }}

+{{ $speaker := delimit (apply .persons "index" "." "public_name") ", " }} +

{{ $speaker }}

+
+
+{{ end }} +
+{{ end }} +{{ end }} +
+ +{{ end }}