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