image gallery improvements: sizing corrected, button padding edited, removed clipping corners from images filling the entire component

This commit is contained in:
2026-04-07 08:35:55 +02:00
parent 0d608a6287
commit 41084ead1e
2 changed files with 17 additions and 12 deletions

View File

@@ -34,9 +34,9 @@
<div class="gallery-zone"> <div class="gallery-zone">
<div class="gallery-container blurred-background"> <div class="gallery-container blurred-background">
<div class="gallery-button-container"> <div class="gallery-button-container">
<button class="gallery-button" onclick={galleryBack}>&lt;</button> <button class="gallery-button" onclick={galleryBack}></button>
<div class="gallery-text-container"> <div class="gallery-text-container">
<p class="gallery-index">{currentIndex + 1} / {images.length}</p> <p class="gallery-index">{currentIndex + 1} / {images.length} :: <a href={images[currentIndex].src}>full-size</a></p>
<div class="gallery-desc-container"> <div class="gallery-desc-container">
<p>&nbsp;</p> <!-- this element intentionally left blank --> <p>&nbsp;</p> <!-- this element intentionally left blank -->
{#each images[currentIndex].desc as d} {#each images[currentIndex].desc as d}
@@ -44,7 +44,7 @@
{/each} {/each}
</div> </div>
</div> </div>
<button class="gallery-button" onclick={galleryForward}>&gt;</button> <button class="gallery-button" onclick={galleryForward}></button>
</div> </div>
<div class="gallery-img-container"> <div class="gallery-img-container">
<img class="gallery-img" loading="lazy" src={images[currentIndex].src} alt={images[currentIndex].alt}> <img class="gallery-img" loading="lazy" src={images[currentIndex].src} alt={images[currentIndex].alt}>
@@ -58,23 +58,26 @@
} }
.gallery-container { .gallery-container {
position: relative;
max-width: var(--media-width); max-width: var(--media-width);
margin: 12px auto; margin: 12px auto;
border: var(--border-style) var(--border-dash-size) var(--color-highlight-alt); border: var(--border-style) var(--border-dash-size) var(--color-highlight-alt);
border-radius: var(--border-radius); border-radius: var(--border-radius);
overflow: hidden;
} }
.gallery-img-container { .gallery-img-container {
width: fit-content; width: 100%;
position: relative; height: var(--media-height);
margin: 0 auto; margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
} }
.gallery-img { .gallery-img {
object-fit: contain; object-fit: contain;
width: 100%;
margin: 0; margin: 0;
width: 100%;
filter: brightness(100%) saturate(100%); filter: brightness(100%) saturate(100%);
transition: filter var(--duration-animation) var(--anim-curve); transition: filter var(--duration-animation) var(--anim-curve);
} }
@@ -107,12 +110,14 @@
.gallery-index { .gallery-index {
font-family: var(--font-mono); font-family: var(--font-mono);
font-weight: 600; font-weight: 600;
font-size: 1.0rem;
} }
.gallery-text-container p { .gallery-text-container p, .gallery-index a {
height: fit-content; height: fit-content;
font-size: 1.0rem; font-size: 1.0rem;
line-height: 1.4rem; line-height: 1.4rem;
text-shadow: 0 0 6px black;
} }
.gallery-desc-container { .gallery-desc-container {
@@ -123,7 +128,6 @@
} }
.gallery-desc-container p { .gallery-desc-container p {
margin: 0; margin: 0;
text-shadow: 0 0 6px black;
} }
.gallery-button-container { .gallery-button-container {
@@ -143,7 +147,7 @@
cursor: pointer; cursor: pointer;
font-size: 2.4rem; font-size: 2.4rem;
line-height: 2.4rem; line-height: 2.4rem;
padding: 8px; padding: 8px 12px;
border-top: var(--border-style) var(--border-dash-size) var(--color-highlight-alt); border-top: var(--border-style) var(--border-dash-size) var(--color-highlight-alt);
border-bottom: var(--border-style) var(--border-dash-size) var(--color-highlight-alt); border-bottom: var(--border-style) var(--border-dash-size) var(--color-highlight-alt);
@@ -161,6 +165,6 @@
} }
.gallery-button:hover { .gallery-button:hover {
background-color: var(--color-highlight-alt); background-color: var(--color-background-highlight-hover-alt);
} }
</style> </style>

View File

@@ -161,6 +161,7 @@
/* sizing */ /* sizing */
--media-width: 80%; --media-width: 80%;
--media-height: 400px;
--width-toc: 650px; --width-toc: 650px;
/* page sizing */ /* page sizing */
@@ -298,7 +299,7 @@
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
display: flex; display: flex;
max-height: 400px; max-height: var(--media-height);
object-fit: contain; object-fit: contain;
} }