tweaking and cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-09-19 20:57:36 +03:00
parent ac7179384c
commit f77016be92
2 changed files with 29 additions and 26 deletions

View File

@ -29,7 +29,7 @@
- next/prev - next/prev
- ~~count~~ - ~~count~~
- ~~selection~~ - ~~selection~~
- Lightbox: unify buttons with toolbar... - ~~Lightbox: unify buttons with toolbar...~~
- ~~Gallery: Adaptable image justification in grid~~ - ~~Gallery: Adaptable image justification in grid~~
- ~~Gallery: Spacial navigation (up/down/left/right)~~ - ~~Gallery: Spacial navigation (up/down/left/right)~~
- **auto focus image iff the gallery is visible** - **auto focus image iff the gallery is visible**

View File

@ -54,6 +54,7 @@ body {
--gallery-padding-right: var(--gallery-padding-horizontal); --gallery-padding-right: var(--gallery-padding-horizontal);
--gallery-image-scroll-margin: calc(2 * var(--gallery-current-image-border)); --gallery-image-scroll-margin: calc(2 * var(--gallery-current-image-border));
--gallery-empty-height: var(--gallery-image-base-height); --gallery-empty-height: var(--gallery-image-base-height);
--scrollbar-color: var(--gallery-secondary-color);
} }
@ -69,6 +70,14 @@ body {
--lightbox-text-color: silver; --lightbox-text-color: silver;
--lightbox-background-color: rgb(10,10,10); --lightbox-background-color: rgb(10,10,10);
} }
/* XXX to make the lightbox scrolbar work correctly we need to set the
* body colors -- :has(..) does not yet work on FF .... */
.lightbox-dark.lightboxed,
.lightbox-dark:has(.lightboxed) {
--gallery-background-color: var(--lightbox-background-color);
--gallery-text-color: var(--lightbox-text-color);
overflow: hidden;
}
@ -82,7 +91,7 @@ body {
border-radius: 100px; border-radius: 100px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: var(--gallery-secondary-color); background-color: var(--scrollbar-color);
border-radius: 100px; border-radius: 100px;
} }
body { body {
@ -210,23 +219,20 @@ button:active {
} }
.gallery:not(.lightboxed) .images img:not(.current):hover { .gallery:not(.lightboxed) .images img:not(.current):hover {
z-index: calc(var(--base-layer) + 1); z-index: calc(var(--base-layer) + 1);
box-shadow: outline: solid calc(var(--gallery-current-image-border) / 5) var(--gallery-accent-color);
0px 0px 0px calc(var(--gallery-current-image-border) / 5) var(--gallery-accent-color), box-shadow: 0.2em 0.2em 1em 0em rgba(0,0,0,0.8);
0.2em 0.2em 1em 0em rgba(0,0,0,0.8);
} }
/* current image... */ /* current image... */
.gallery .images img.current { .gallery .images img.current {
z-index: 10; z-index: 10;
box-shadow: outline: solid var(--gallery-current-image-border) var(--gallery-accent-color);
0px 0px 0px var(--gallery-current-image-border) var(--gallery-accent-color), box-shadow: 0.4em 0.4em 2em 0em rgba(0,0,0,0.8);
0.4em 0.4em 2em 0em rgba(0,0,0,0.8);
} }
.gallery:not(.lightboxed) .images img.current:hover { .gallery:not(.lightboxed) .images img.current:hover {
z-index: calc(var(--base-layer) + 1); z-index: calc(var(--base-layer) + 1);
box-shadow: outline: solid var(--gallery-current-image-border) var(--gallery-secondary-accent-color);
0px 0px 0px var(--gallery-current-image-border) var(--gallery-secondary-accent-color), box-shadow: 0.6em 0.6em 3em 0em rgba(0,0,0,0.8);
0.6em 0.6em 3em 0em rgba(0,0,0,0.8);
} }
@ -454,6 +460,7 @@ button:active {
/* buttons... */ /* buttons... */
.gallery .button,
.gallery .toolbar button { .gallery .toolbar button {
min-width: var(--toolbar-button-size); min-width: var(--toolbar-button-size);
@ -654,16 +661,18 @@ button:active {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
} }
.gallery .button { .gallery .button {
disbplay: inline-block; disbplay: inline-block;
cursor: pointer; cursor: pointer;
width: var(--lightbox-button-size); width: var(--lightbox-button-size);
height: var(--lightbox-button-size); height: var(--lightbox-button-size);
margin: 0.2em;
font-size: var(--lightbox-button-size); font-size: var(--lightbox-button-size);
line-height: var(--lightbox-button-size); line-height: var(--lightbox-button-size);
color: var(--lightbox-text-color);
filter: saturate(0); filter: saturate(0);
opacity: 0.1; opacity: 0.1;
@ -672,30 +681,24 @@ button:active {
opacity: 1; opacity: 1;
filter: saturate(1); filter: saturate(1);
color: var(--lightbox-text-color); color: var(--lightbox-text-color);
transition: none;
/* XXX HACK: might be better to use SVG for this... */
text-shadow:
0.02em 0.02em 0em var(--lightbox-background-color),
-0.02em -0.02em 0em var(--lightbox-background-color),
-0.02em 0.02em 0em var(--lightbox-background-color),
0.02em -0.02em 0em var(--lightbox-background-color);
} }
/* controls: close... */
/* specific controls */
.gallery .button.close:after { .gallery .button.close:after {
content: "✕"; content: "close";
/*color: red;*/
} }
.gallery .button.fullscreen:after { .gallery .button.fullscreen:after {
content: ""; content: "fullscreen";
} }
.gallery .button.info:after { .gallery .button.info:after {
content: "i"; content: "info";
} }
.gallery .button.prev:after { .gallery .button.prev:after {
content: "<"; content: "navigate_before";
} }
.gallery .button.next:after { .gallery .button.next:after {
content: ">"; content: "navigate_next";
} }