From 4762946fc78613239dbcdde0af79564c19a9803f Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 12 Jan 2024 12:12:46 +0100 Subject: Support basic JS-free lightbox --- tpl/objects/lightbox.pug | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tpl/objects') diff --git a/tpl/objects/lightbox.pug b/tpl/objects/lightbox.pug index 7298ed9..5091565 100644 --- a/tpl/objects/lightbox.pug +++ b/tpl/objects/lightbox.pug @@ -6,14 +6,15 @@ mixin lightbox(images) .s-links.s-links--colored block +action-button(round=true quiet=true icon='x' class='o-lightbox__close-btn') - img.o-lightbox__img(src=images[0]) + each img, i in images + img.o-lightbox__img(src=images[i] id='image-' + i) if images.length > 1 +action-button(round=true quiet=true icon='chevron-left' class='o-lightbox__nav-btn o-lightbox__nav-btn--prev') +action-button(round=true quiet=true icon='chevron-right' class='o-lightbox__nav-btn o-lightbox__nav-btn--next') .o-lightbox__thumbnails each img, i in images - classes = i === 0 ? 'is-selected' : '' - button.o-lightbox__thumbnail(class=classes) + a.o-lightbox__thumbnail(class=classes href='#image-' + i) img.o-lightbox__thumbnail-img(src=img) button.o-lightbox__thumbnail +icon('volume-2')(class='o-lightbox__thumbnail-icon') -- cgit v1.2.3-70-g09d2