From 7436eb2ada1e066d724bb1db3d6124bce61bd3c5 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 3 Aug 2023 14:10:59 +0300 Subject: [PATCH] added basic details/edit view + streamlined control through gallery... Signed-off-by: Alex A. Naanou --- css/grid-n-view.css | 64 +++++++++------ grid-n-view.html | 9 ++- grid-n-view.js | 190 +++++++++++++++++++++++++++++++------------- 3 files changed, 181 insertions(+), 82 deletions(-) diff --git a/css/grid-n-view.css b/css/grid-n-view.css index f649890..4ad27f7 100644 --- a/css/grid-n-view.css +++ b/css/grid-n-view.css @@ -88,10 +88,6 @@ body { color: var(--gallery-text-color); background: var(--gallery-background-color); } -.gallery.lightboxed { - --base-layer: 100; -} - .gallery .images { position: relative; display: flex; @@ -182,9 +178,19 @@ body { -/******************************************************* Lightbox ****/ +/******************************************************* Overlays ****/ -.gallery .lightbox { +.gallery.lightboxed, +.gallery.detailed { + --base-layer: 100; +} +.gallery.lightboxed .lightbox, +.gallery.detailed .details { + display: block; +} + +.gallery .lightbox, +.gallery .details { display: none; position: fixed; width: 100%; @@ -198,9 +204,10 @@ body { color: var(--lightbox-text-color); background: var(--lightbox-background-color); } -.gallery.lightboxed .lightbox { - display: block; -} + + +/*------------------------------------------------------ Lightbox ---*/ + .gallery .lightbox.show-caption:before { content: attr(caption); position: absolute; @@ -223,14 +230,24 @@ body { var(--lightbox-frame) * var(--lightbox-image-margin-top)); } -/* controls: next/prev... */ -.gallery .lightbox .buttons { + + +/*------------------------------------------------------- Details ---*/ + +.gallery .details img { + width: 50%; +} + + +/******************************************************* Controls ****/ + +.gallery .buttons { display: flex; position: absolute; top: 0; right: 0; } -.gallery .lightbox .button { +.gallery .button { disbplay: inline-block; cursor: pointer; width: var(--lightbox-button-size); @@ -240,27 +257,28 @@ body { filter: saturate(0); opacity: 0.1; } -.gallery .lightbox .button:hover { +.gallery .button:hover { opacity: 1; filter: saturate(1); + color: black; } /* controls: close... */ -.gallery .lightbox .button.close:after { +.gallery .button.close:after { content: "✕"; color: red; } -.gallery .lightbox .button.fullscreen:after { +.gallery .button.fullscreen:after { content: "⛶"; - color: black; } - - -/******************************************************** Details ****/ - -.gallery .details { - display: none; +.gallery .button.info:after { + content: "i"; +} +.gallery .button.prev:after { + content: "<"; +} +.gallery .button.next:after { + content: ">"; } - /********************************************************************** diff --git a/grid-n-view.html b/grid-n-view.html index a4d4272..d5b73d6 100644 --- a/grid-n-view.html +++ b/grid-n-view.html @@ -122,6 +122,7 @@ var restoreScroll = function(){