tweaking + getting ready for fullscreen mode...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-07-27 13:26:11 +03:00
parent 04d8f9ea8d
commit d8655fcab4
2 changed files with 27 additions and 9 deletions

View File

@ -9,6 +9,7 @@
:root { :root {
/* dimensions */ /* dimensions */
--gallery-image-margin: 0;
--gallery-current-image-border: 0.7em; --gallery-current-image-border: 0.7em;
--gallery-padding: 3em; --gallery-padding: 3em;
--gallery-padding-horizontal: var(--gallery-padding); --gallery-padding-horizontal: var(--gallery-padding);
@ -22,7 +23,7 @@
--lightbox-frame: 5vmin; --lightbox-frame: 5vmin;
--lightbox-image-margin-top: 0.75; --lightbox-image-margin-top: 0.75;
--lightbox-button-size: 4em; --lightbox-button-size: 2em;
/* theme */ /* theme */
--gallery-text-color: black; --gallery-text-color: black;
@ -95,7 +96,12 @@ body {
.gallery .images img { .gallery .images img {
height: 300px; height: 300px;
width: auto; width: auto;
border: solid var(--gallery-image-margin) transparent;
box-sizing: border-box;
scroll-margin: var(--gallery-image-scroll-margin); scroll-margin: var(--gallery-image-scroll-margin);
image-rendering: crisp-edges; image-rendering: crisp-edges;
cursor: pointer; cursor: pointer;
@ -185,10 +191,19 @@ body {
* var(--lightbox-image-margin-top)); * var(--lightbox-image-margin-top));
} }
/* controls: next/prev... */ /* controls: next/prev... */
.gallery .lightbox .buttons {
display: flex;
position: absolute;
top: 0;
right: 0;
}
.gallery .lightbox .button { .gallery .lightbox .button {
disbplay: inline-block;
cursor: pointer; cursor: pointer;
width: var(--lightbox-button-size);
height: var(--lightbox-button-size);
font-size: var(--lightbox-button-size); font-size: var(--lightbox-button-size);
padding: 0 0.25em; line-height: var(--lightbox-button-size);
filter: saturate(0); filter: saturate(0);
opacity: 0.1; opacity: 0.1;
} }
@ -197,15 +212,15 @@ body {
filter: saturate(1); filter: saturate(1);
} }
/* controls: close... */ /* controls: close... */
.gallery .lightbox .button.close {
position: absolute;
top: 0px;
right: 0px;
}
.gallery .lightbox .button.close:after { .gallery .lightbox .button.close:after {
content: "×"; content: "✕";
color: red; color: red;
} }
.gallery .lightbox .button.fullscreen:after {
content: "⛶";
color: black;
}
/********************************************************************** /**********************************************************************

View File

@ -73,9 +73,12 @@
<!-- lightbox --> <!-- lightbox -->
<div class="lightbox"> <div class="lightbox">
<img> <img>
<div class="buttons">
<div class="button fullscreen"></div>
<div class="button close"></div> <div class="button close"></div>
</div> </div>
</div> </div>
</div>
</body> </body>
</html> </html>