diff --git a/assets/css/src/pages/_event.scss b/assets/css/src/pages/_event.scss new file mode 100644 index 0000000..388ba70 --- /dev/null +++ b/assets/css/src/pages/_event.scss @@ -0,0 +1,27 @@ +[data-template="event"] { + .slideshow { + position: relative; + width: 100%; + height: 80vh; + background-color: #000; + + .swiper { + height: 100%; + .swiper-slide { + display: flex; + align-items: center; + justify-content: center; + + picture { + height: 100%; + img { + width: 100%; + height: 100%; + object-fit: contain; + border-radius: 0; + } + } + } + } + } +} diff --git a/assets/css/style.scss b/assets/css/style.scss index 21f29a7..753fdc3 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -7,3 +7,4 @@ @import "src/strip"; @import "src/pages/home"; @import "src/pages/events"; +@import "src/pages/event"; diff --git a/assets/js/script.js b/assets/js/script.js index b0240ec..aa76fb7 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -1,6 +1,7 @@ import { initCharacterJump } from "./characters/jump.js"; import { initPupilTracking } from "./characters/pupilTracking.js"; import { initEventFilters } from "./filters.js"; +import { initSlideshow } from "./slideshow.js"; document.addEventListener("DOMContentLoaded", () => { const header = document.querySelector(".main-header"); @@ -92,4 +93,5 @@ document.addEventListener("DOMContentLoaded", () => { initCharacterJump(); initPupilTracking(svg); initEventFilters(); + initSlideshow(); }); diff --git a/assets/js/slideshow.js b/assets/js/slideshow.js new file mode 100644 index 0000000..42bb712 --- /dev/null +++ b/assets/js/slideshow.js @@ -0,0 +1,9 @@ +export function initSlideshow() { + const slideshowElement = document.querySelector(".swiper"); + if (!slideshowElement) return; + + new Swiper(".swiper", { + loop: true, + keyboard: { enabled: true }, + }); +} diff --git a/site/config/config.php b/site/config/config.php index b66b913..6fdb313 100644 --- a/site/config/config.php +++ b/site/config/config.php @@ -8,6 +8,7 @@ return [ 'quality' => 80, 'srcsets' => array_merge( require __DIR__ . '/thumbs/events-grid.php', + require __DIR__ . '/thumbs/event-slideshow.php', ), ], ]; \ No newline at end of file diff --git a/site/config/thumbs/event-slideshow.php b/site/config/thumbs/event-slideshow.php new file mode 100644 index 0000000..8c8d9d1 --- /dev/null +++ b/site/config/thumbs/event-slideshow.php @@ -0,0 +1,22 @@ + [ + '400w' => ['width' => 400], + '800w' => ['width' => 800], + '1200w' => ['width' => 1200], + '1600w' => ['width' => 1600], + '2400w' => ['width' => 2400], + '3200w' => ['width' => 3200], + ], + 'event-slideshow-webp' => [ + '400w' => ['width' => 400, 'format' => 'webp'], + '800w' => ['width' => 800, 'format' => 'webp'], + '1200w' => ['width' => 1200, 'format' => 'webp'], + '1600w' => ['width' => 1600, 'format' => 'webp'], + '2400w' => ['width' => 2400, 'format' => 'webp'], + '3200w' => ['width' => 3200, 'format' => 'webp'], + ], +]; diff --git a/site/snippets/head.php b/site/snippets/head.php index fd10360..8be42f4 100644 --- a/site/snippets/head.php +++ b/site/snippets/head.php @@ -6,6 +6,15 @@