image gallery improvements: sizing corrected, button padding edited, removed clipping corners from images filling the entire component
This commit is contained in:
@@ -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}><</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> </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}>></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>
|
||||
@@ -161,6 +161,7 @@
|
||||
|
||||
/* sizing */
|
||||
--media-width: 80%;
|
||||
--media-height: 400px;
|
||||
--width-toc: 650px;
|
||||
|
||||
/* page sizing */
|
||||
@@ -298,7 +299,7 @@
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: flex;
|
||||
max-height: 400px;
|
||||
max-height: var(--media-height);
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user