Fix: show banner full height + reliable dropdown

- Increased brand-card-gap min-height to 500px (desktop) so
  the full background image is visible (509px at 1200px grid width)
- Responsive: 400px at 960px, 240px at 600px
- Dropped grid-row spanning approach; back to CSS background-image
  on .brands-grid with background-size: 100% auto
- Dropdown sets backgroundImage directly on .brands-grid via
  style.backgroundImage — no setTimeout, no opacity animation,
  no async timing issues
This commit is contained in:
Oliver
2026-07-01 21:19:07 +00:00
parent f73b19c941
commit 65a7d4aaee
3 changed files with 24 additions and 32 deletions
+2 -8
View File
@@ -77,14 +77,6 @@
<div class="brands-grid" role="list">
<!-- Full-width banner between header and footer -->
<img
class="brands-banner-img"
id="brands-banner-img"
src="asset/banner/1.png"
alt="Brand banner"
/>
<!-- FI-NE (left half) -->
<a
class="brand-card brand-card--fine"
@@ -108,6 +100,7 @@
alt="[fi-ne] brand logo"
/>
</div>
<div class="brand-card-gap" aria-hidden="true"></div>
<div class="brand-card-footer">
<span class="brand-card-tagline">
Clean. Unisex. Uncompromisingly effective.<br />
@@ -147,6 +140,7 @@
alt="LACUEOR brand logo"
/>
</div>
<div class="brand-card-gap" aria-hidden="true"></div>
<div class="brand-card-footer">
<span class="brand-card-tagline">
From the quantum realm to your skin.<br />
+4 -7
View File
@@ -37,15 +37,12 @@
/* ── Banner image selector ──────────────────────────────── */
var bannerPicker = document.getElementById("banner-picker");
var bannerImg = document.getElementById("brands-banner-img");
if (bannerPicker && bannerImg) {
var brandsGrid = document.querySelector(".brands-grid");
if (bannerPicker && brandsGrid) {
bannerPicker.addEventListener("change", function () {
var val = this.value;
bannerImg.style.opacity = "0";
setTimeout(function () {
bannerImg.src = "asset/banner/" + val + ".png";
bannerImg.style.opacity = "1";
}, 200);
brandsGrid.style.backgroundImage =
"url(asset/banner/" + val + ".png)";
});
}
})();
+18 -17
View File
@@ -381,18 +381,10 @@ body::before {
grid-template-columns: 1fr 1fr;
max-width: 1200px;
margin: 0 auto;
}
/* Full-width banner spanning both columns in the middle row */
.brands-banner-img {
grid-column: 1 / -1;
grid-row: 2;
width: 100%;
height: auto;
display: block;
z-index: 0;
pointer-events: none;
transition: opacity 0.3s ease;
background-image: url("asset/banner/1.png");
background-size: 100% auto;
background-position: center;
background-repeat: no-repeat;
}
.brand-card {
@@ -401,19 +393,15 @@ body::before {
display: flex;
flex-direction: column;
justify-content: space-between;
grid-row: 1 / 4;
text-decoration: none;
cursor: pointer;
z-index: 1;
}
.brand-card--fine {
grid-column: 1;
border-right: 1px solid var(--border);
}
.brand-card--lacueor {
grid-column: 2;
}
.brand-card-header {
@@ -430,6 +418,11 @@ body::before {
background: var(--lacueor-dark);
}
.brand-card-gap {
flex: 1;
min-height: 500px;
}
.brand-card-footer {
flex-shrink: 0;
padding: 20px 52px 40px;
@@ -444,7 +437,7 @@ body::before {
background: var(--lacueor-dark);
}
.brand-card-spacer {
.brands-banner-img {
display: none;
}
@@ -1008,6 +1001,10 @@ footer {
padding: 24px 28px 16px;
}
.brand-card-gap {
min-height: 400px;
}
.brand-card-footer {
padding: 16px 28px 32px;
}
@@ -1060,6 +1057,10 @@ footer {
padding: 20px 24px 14px;
}
.brand-card-gap {
min-height: 240px;
}
.brand-card-footer {
padding: 14px 24px 28px;
}