summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assets/css/components/_exhibit.scss27
-rw-r--r--content/lightbox.js14
-rw-r--r--templates/layouts/exhibit.html36
-rw-r--r--templates/layouts/page.html6
-rw-r--r--yarn.lock2
5 files changed, 31 insertions, 54 deletions
diff --git a/assets/css/components/_exhibit.scss b/assets/css/components/_exhibit.scss
index 6122206..9ef013b 100644
--- a/assets/css/components/_exhibit.scss
+++ b/assets/css/components/_exhibit.scss
@@ -3,31 +3,8 @@
3@use 'include-media/dist/include-media' as media; 3@use 'include-media/dist/include-media' as media;
4 4
5@include iro.props-namespace('exhibit') { 5@include iro.props-namespace('exhibit') {
6 @include iro.props-store((
7 --colors: (
8 --footer: (
9 --bg: fn.global-color(--bg-hi),
10 ),
11 )
12 ), 'colors');
13
14 @include iro.bem-component(iro.props-namespace()) { 6 @include iro.bem-component(iro.props-namespace()) {
15 display: grid; 7 height: 100vh;
16 grid-template-rows: 1fr auto; 8 height: 100dvh;
17 grid-template-areas: 'content' 'footer';
18 box-sizing: border-box;
19 height: 100vh;
20 height: 100dvh;
21
22 @include iro.bem-elem('content') {
23 grid-area: content;
24 height: auto;
25 overflow: hidden;
26 }
27
28 @include iro.bem-elem('footer') {
29 grid-area: footer;
30 background-color: fn.color(--footer --bg);
31 }
32 } 9 }
33} 10}
diff --git a/content/lightbox.js b/content/lightbox.js
index e672d63..deb5cce 100644
--- a/content/lightbox.js
+++ b/content/lightbox.js
@@ -1,12 +1,14 @@
1(() => { 1(() => {
2 const mainEl = document.querySelector("main"); 2 const mainEl = document.querySelector("main");
3 const lightboxContainerEl = document.querySelector(".js-lightbox"); 3 const lightboxContainerEl = document.querySelector(".js-lightbox");
4 const lightboxEl = lightboxContainerEl.querySelector(".o-lightbox"); 4 const lightboxEl = lightboxContainerEl.classList.contains("o-lightbox")
5 ? lightboxContainerEl
6 : lightboxContainerEl.querySelector(".o-lightbox");
5 const lightboxCloseEl = lightboxEl.querySelector(".o-lightbox__close-btn"); 7 const lightboxCloseEl = lightboxEl.querySelector(".o-lightbox__close-btn");
6 const lightboxPrevEl = lightboxEl.querySelector(".o-lightbox__prev-btn"); 8 const lightboxPrevEl = lightboxEl.querySelector(".o-lightbox__nav-btn--prev");
7 const lightboxNextEl = lightboxEl.querySelector(".o-lightbox__next-btn"); 9 const lightboxNextEl = lightboxEl.querySelector(".o-lightbox__nav-btn--next");
8 const lightboxImgEl = lightboxEl.querySelector(".o-lightbox__img"); 10 const lightboxImgEl = lightboxEl.querySelector(".o-lightbox__img");
9 const lightboxFooterEl = lightboxEl.querySelector(".o-lightbox__footer"); 11 const lightboxThumbnailsEl = lightboxEl.querySelector(".o-lightbox__thumbnails");
10 const figureEls = Array.from(mainEl.querySelectorAll(".js-lightbox__image")); 12 const figureEls = Array.from(mainEl.querySelectorAll(".js-lightbox__image"));
11 13
12 const standalone = lightboxContainerEl.classList.contains("js-lightbox--standalone"); 14 const standalone = lightboxContainerEl.classList.contains("js-lightbox--standalone");
@@ -72,7 +74,7 @@
72 thumbnailButtonEl.appendChild(thumbnailImgEl); 74 thumbnailButtonEl.appendChild(thumbnailImgEl);
73 thumbnailButtonEl.addEventListener("click", go); 75 thumbnailButtonEl.addEventListener("click", go);
74 76
75 lightboxFooterEl.appendChild(thumbnailButtonEl); 77 lightboxThumbnailsEl.appendChild(thumbnailButtonEl);
76 78
77 if (!standalone) { 79 if (!standalone) {
78 figureEl.firstElementChild.addEventListener("click", go); 80 figureEl.firstElementChild.addEventListener("click", go);
@@ -89,7 +91,7 @@
89 if (figureEls.length <= 1) { 91 if (figureEls.length <= 1) {
90 lightboxPrevEl.remove(); 92 lightboxPrevEl.remove();
91 lightboxNextEl.remove(); 93 lightboxNextEl.remove();
92 lightboxFooterEl.remove(); 94 lightboxThumbnailsEl.remove();
93 } 95 }
94 96
95 if (!standalone) { 97 if (!standalone) {
diff --git a/templates/layouts/exhibit.html b/templates/layouts/exhibit.html
index 1e0f19c..7e45298 100644
--- a/templates/layouts/exhibit.html
+++ b/templates/layouts/exhibit.html
@@ -5,26 +5,24 @@
5 itemtype="https://schema.org/$schema_type$" 5 itemtype="https://schema.org/$schema_type$"
6 itemid="$url.full$" 6 itemid="$url.full$"
7> 7>
8 <section class="c-exhibit js-lightbox js-lightbox--standalone"> 8 <section class="c-exhibit o-lightbox js-lightbox js-lightbox--standalone">
9 <div class="c-exhibit__content o-lightbox"> 9 <img class="o-lightbox__img" />
10 <img class="o-lightbox__img" /> 10
11 11 <button class="o-lightbox__nav-btn o-lightbox__nav-btn--prev o-action-button o-action-button--quiet o-action-button--round">
12 <button class="o-lightbox__prev-btn o-action-button o-action-button--quiet o-action-button--round"> 12 <svg class="l-media__block o-icon" width="1em" height="1em" aria-hidden="true">
13 <svg class="l-media__block o-icon" width="1em" height="1em" aria-hidden="true"> 13 <use href="/icons.svg#chevron-left"></use>
14 <use href="/icons.svg#chevron-left"></use> 14 </svg>
15 </svg> 15 </button>
16 </button> 16
17 17 <button class="o-lightbox__nav-btn o-lightbox__nav-btn--next o-action-button o-action-button--quiet o-action-button--round">
18 <button class="o-lightbox__next-btn o-action-button o-action-button--quiet o-action-button--round"> 18 <svg class="l-media__block o-icon" width="1em" height="1em" aria-hidden="true">
19 <svg class="l-media__block o-icon" width="1em" height="1em" aria-hidden="true"> 19 <use href="/icons.svg#chevron-right"></use>
20 <use href="/icons.svg#chevron-right"></use> 20 </svg>
21 </svg> 21 </button>
22 </button> 22
23 23 <div class="o-lightbox__thumbnails"></div>
24 <footer class="o-lightbox__footer"></footer>
25 </div>
26 24
27 <footer class="c-exhibit__footer"> 25 <footer class="o-lightbox__footer">
28 <div class="l-container l-container--pad-x l-container--narrow-125"> 26 <div class="l-container l-container--pad-x l-container--narrow-125">
29 <div class="l-media l-media--200 u-pl-0 u-pr-0"> 27 <div class="l-media l-media--200 u-pl-0 u-pr-0">
30 <div class="l-media__block l-media__block--main"> 28 <div class="l-media__block l-media__block--main">
diff --git a/templates/layouts/page.html b/templates/layouts/page.html
index 3721510..e40bf4c 100644
--- a/templates/layouts/page.html
+++ b/templates/layouts/page.html
@@ -46,19 +46,19 @@ $body$
46 46
47 <img class="o-lightbox__img" /> 47 <img class="o-lightbox__img" />
48 48
49 <button class="o-lightbox__prev-btn o-action-button o-action-button--quiet o-action-button--round"> 49 <button class="o-lightbox__nav-btn o-lightbox__nav-btn--prev o-action-button o-action-button--quiet o-action-button--round">
50 <svg class="l-media__block o-icon" width="1em" height="1em" aria-hidden="true"> 50 <svg class="l-media__block o-icon" width="1em" height="1em" aria-hidden="true">
51 <use href="/icons.svg#chevron-left"></use> 51 <use href="/icons.svg#chevron-left"></use>
52 </svg> 52 </svg>
53 </button> 53 </button>
54 54
55 <button class="o-lightbox__next-btn o-action-button o-action-button--quiet o-action-button--round"> 55 <button class="o-lightbox__nav-btn o-lightbox__nav-btn--next o-action-button o-action-button--quiet o-action-button--round">
56 <svg class="l-media__block o-icon" width="1em" height="1em" aria-hidden="true"> 56 <svg class="l-media__block o-icon" width="1em" height="1em" aria-hidden="true">
57 <use href="/icons.svg#chevron-right"></use> 57 <use href="/icons.svg#chevron-right"></use>
58 </svg> 58 </svg>
59 </button> 59 </button>
60 60
61 <footer class="o-lightbox__footer"></footer> 61 <div class="o-lightbox__thumbnails"></div>
62 </div> 62 </div>
63 </div> 63 </div>
64</main> 64</main>
diff --git a/yarn.lock b/yarn.lock
index 038dc69..7b7fdbd 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1280,7 +1280,7 @@ internal-slot@^1.0.3:
1280 1280
1281"iro-design@git+https://git.vulpes.one/git/iro-design.git": 1281"iro-design@git+https://git.vulpes.one/git/iro-design.git":
1282 version "1.0.0" 1282 version "1.0.0"
1283 resolved "git+https://git.vulpes.one/git/iro-design.git#916c0b8fb2201f650ab32bac1d3896422c8f396f" 1283 resolved "git+https://git.vulpes.one/git/iro-design.git#6a319739bb2adac5532a9b6547fd1e01af665a78"
1284 dependencies: 1284 dependencies:
1285 "@oddbird/blend" "^0.2.3" 1285 "@oddbird/blend" "^0.2.3"
1286 include-media "^1.4.9" 1286 include-media "^1.4.9"