From a43ca52aa2d102c7499c7fd8478304a26ea2cd0a Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 18 Jun 2022 15:51:18 +0200 Subject: Improved Lua filters, improved exhibit pages --- content/art/doodles/2021-lazy-firefox/index.md | 12 ++++++--- content/art/drawings/2021-cute-ava/index.md | 7 ++--- content/art/drawings/2021-eeveelutions/index.md | 20 ++++++++------ content/art/drawings/2021-lycanroc-ava/index.md | 7 ++--- content/art/drawings/2021-refsheet/index.md | 20 ++++++++------ content/art/drawings/2021-spooky-ava-1/index.md | 7 ++--- content/art/drawings/2021-spooky-ava-2/index.md | 7 ++--- content/art/drawings/2022-autumn-fox/index.md | 7 ++--- content/lightbox.js | 36 ++++++++----------------- 9 files changed, 63 insertions(+), 60 deletions(-) (limited to 'content') diff --git a/content/art/doodles/2021-lazy-firefox/index.md b/content/art/doodles/2021-lazy-firefox/index.md index d7d47e1..f57f184 100644 --- a/content/art/doodles/2021-lazy-firefox/index.md +++ b/content/art/doodles/2021-lazy-firefox/index.md @@ -4,8 +4,12 @@ title: Lazy Firefox date: 2021-10-16 thumbnail: png layout: exhibit - -images: - - url: firefox_lazy.png - - url: firefox_lazy_transparent.png --- + +::: figure +![](firefox_lazy.png) +::: + +::: figure +![](firefox_lazy_transparent.png) +::: diff --git a/content/art/drawings/2021-cute-ava/index.md b/content/art/drawings/2021-cute-ava/index.md index dd350bb..962c0ce 100644 --- a/content/art/drawings/2021-cute-ava/index.md +++ b/content/art/drawings/2021-cute-ava/index.md @@ -4,7 +4,8 @@ title: Cute Avatar date: 2021-03-01 thumbnail: png layout: exhibit - -images: - - url: ava.png --- + +::: figure +![](ava.png) +::: diff --git a/content/art/drawings/2021-eeveelutions/index.md b/content/art/drawings/2021-eeveelutions/index.md index 87c0869..9cd4352 100644 --- a/content/art/drawings/2021-eeveelutions/index.md +++ b/content/art/drawings/2021-eeveelutions/index.md @@ -4,12 +4,16 @@ title: Eeveelutions date: 2021-08-19 thumbnail: png layout: exhibit - -images: - - url: eevee.png - description: Eevee - - url: flareon.png - description: Flareon - - url: flareon_wink.png - description: Flareon, winking --- + +::: figure +![Eevee](eevee.png) +::: + +::: figure +![Flareon](flareon.png) +::: + +::: figure +![Flareon, winking](flareon_wink.png) +::: diff --git a/content/art/drawings/2021-lycanroc-ava/index.md b/content/art/drawings/2021-lycanroc-ava/index.md index 3e0fe64..8b7fb1d 100644 --- a/content/art/drawings/2021-lycanroc-ava/index.md +++ b/content/art/drawings/2021-lycanroc-ava/index.md @@ -4,9 +4,10 @@ title: Lycanroc Avatar date: 2021-10-19 thumbnail: png layout: exhibit - -images: - - url: ava.png --- Avatar for [@feralbot@botsin.space](https://botsin.space/@feralbot), a bot that posts pictures of feral characters from [e926](https://e926.net/). + +::: figure +![](ava.png) +::: diff --git a/content/art/drawings/2021-refsheet/index.md b/content/art/drawings/2021-refsheet/index.md index 8617a95..e9b4333 100644 --- a/content/art/drawings/2021-refsheet/index.md +++ b/content/art/drawings/2021-refsheet/index.md @@ -4,12 +4,16 @@ title: Reference Sheet Views date: 2021-10-06 thumbnail: png layout: exhibit - -images: - - url: bottom.png - description: Bottom view - - url: bottom_cofe.png - description: Bottom view, holding a cup of coffee - - url: side.png - description: Side view --- + +::: figure +![Bottom view](bottom.png) +::: + +::: figure +![Bottom view, holding a cup of coffee](bottom_cofe.png) +::: + +::: figure +![Side view](side.png) +::: diff --git a/content/art/drawings/2021-spooky-ava-1/index.md b/content/art/drawings/2021-spooky-ava-1/index.md index 500bd11..70f000d 100644 --- a/content/art/drawings/2021-spooky-ava-1/index.md +++ b/content/art/drawings/2021-spooky-ava-1/index.md @@ -4,7 +4,8 @@ title: \"Spooky\" Avatar date: 2021-10-07 thumbnail: png layout: exhibit - -images: - - url: ava.png --- + +::: figure +![](ava.png) +::: diff --git a/content/art/drawings/2021-spooky-ava-2/index.md b/content/art/drawings/2021-spooky-ava-2/index.md index 7fca6f0..672c4c0 100644 --- a/content/art/drawings/2021-spooky-ava-2/index.md +++ b/content/art/drawings/2021-spooky-ava-2/index.md @@ -4,7 +4,8 @@ title: Spooky Avatar date: 2021-10-14 thumbnail: png layout: exhibit - -images: - - url: ava.png --- + +::: figure +![](ava.png) +::: diff --git a/content/art/drawings/2022-autumn-fox/index.md b/content/art/drawings/2022-autumn-fox/index.md index 6816680..ebd51ab 100644 --- a/content/art/drawings/2022-autumn-fox/index.md +++ b/content/art/drawings/2022-autumn-fox/index.md @@ -4,10 +4,11 @@ title: Autumn Fox date: 2022-02-25 thumbnail: png layout: exhibit - -images: - - url: pic.png --- First attempt at cel shading. It's actually incomplete, but I felt like I had hit a roadblock with the shading and wanted to try again with another drawing. + +::: figure +![](pic.png) +::: diff --git a/content/lightbox.js b/content/lightbox.js index e4a2c29..e672d63 100644 --- a/content/lightbox.js +++ b/content/lightbox.js @@ -9,7 +9,7 @@ const lightboxFooterEl = lightboxEl.querySelector(".o-lightbox__footer"); const figureEls = Array.from(mainEl.querySelectorAll(".js-lightbox__image")); - const closeable = lightboxContainerEl.classList.contains("js-lightbox--closeable"); + const standalone = lightboxContainerEl.classList.contains("js-lightbox--standalone"); let currentIndex = 0; let visible = !lightboxContainerEl.classList.contains("u-d-none"); let mouseDown = false; @@ -20,7 +20,7 @@ } const hide = () => { - if (closeable) { + if (!standalone) { visible = false; lightboxContainerEl.classList.add("u-d-none"); } @@ -56,41 +56,27 @@ setIndex(i); }; - let anchorEl; - let imgEl; - - if (figureEl.firstElementChild.tagName === "A") { - anchorEl = figureEl.firstElementChild; - imgEl = anchorEl.firstElementChild; - } else { - imgEl = figureEl.firstElementChild; - anchorEl = document.createElement("a"); - anchorEl.href = imgEl.src; + const imgEl = figureEl.querySelector("img"); + const captionEl = figureEl.querySelector("figcaption"); - figureEl.insertBefore(anchorEl, imgEl); - figureEl.removeChild(imgEl); - anchorEl.appendChild(imgEl); - } + const src = imgEl.src; + const description = captionEl?.innerHTML ?? ""; - anchorEl.addEventListener("click", go); const thumbnailButtonEl = document.createElement("button"); const thumbnailImgEl = document.createElement("img"); thumbnailImgEl.classList.add("o-lightbox__thumbnail-img"); - thumbnailImgEl.src = anchorEl.href; + thumbnailImgEl.src = src; thumbnailButtonEl.classList.add("o-lightbox__thumbnail"); thumbnailButtonEl.appendChild(thumbnailImgEl); thumbnailButtonEl.addEventListener("click", go); - if (i === currentIndex) { - thumbnailButtonEl.classList.add("is-selected"); - } - lightboxFooterEl.appendChild(thumbnailButtonEl); - const captionEl = figureEl.querySelector("figcaption"); - const description = captionEl?.innerHTML ?? ""; + if (!standalone) { + figureEl.firstElementChild.addEventListener("click", go); + } return { thumbnailEl: thumbnailButtonEl, @@ -106,7 +92,7 @@ lightboxFooterEl.remove(); } - if (closeable) { + if (!standalone) { document.addEventListener('mousedown', (e) => { if (visible) { mouseDown = !lightboxEl.contains(e.target) || lightboxEl === e.target; -- cgit v1.2.3-70-g09d2