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"> <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) --> <!-- FI-NE (left half) -->
<a <a
class="brand-card brand-card--fine" class="brand-card brand-card--fine"
@@ -108,6 +100,7 @@
alt="[fi-ne] brand logo" alt="[fi-ne] brand logo"
/> />
</div> </div>
<div class="brand-card-gap" aria-hidden="true"></div>
<div class="brand-card-footer"> <div class="brand-card-footer">
<span class="brand-card-tagline"> <span class="brand-card-tagline">
Clean. Unisex. Uncompromisingly effective.<br /> Clean. Unisex. Uncompromisingly effective.<br />
@@ -147,6 +140,7 @@
alt="LACUEOR brand logo" alt="LACUEOR brand logo"
/> />
</div> </div>
<div class="brand-card-gap" aria-hidden="true"></div>
<div class="brand-card-footer"> <div class="brand-card-footer">
<span class="brand-card-tagline"> <span class="brand-card-tagline">
From the quantum realm to your skin.<br /> From the quantum realm to your skin.<br />
+4 -7
View File
@@ -37,15 +37,12 @@
/* ── Banner image selector ──────────────────────────────── */ /* ── Banner image selector ──────────────────────────────── */
var bannerPicker = document.getElementById("banner-picker"); var bannerPicker = document.getElementById("banner-picker");
var bannerImg = document.getElementById("brands-banner-img"); var brandsGrid = document.querySelector(".brands-grid");
if (bannerPicker && bannerImg) { if (bannerPicker && brandsGrid) {
bannerPicker.addEventListener("change", function () { bannerPicker.addEventListener("change", function () {
var val = this.value; var val = this.value;
bannerImg.style.opacity = "0"; brandsGrid.style.backgroundImage =
setTimeout(function () { "url(asset/banner/" + val + ".png)";
bannerImg.src = "asset/banner/" + val + ".png";
bannerImg.style.opacity = "1";
}, 200);
}); });
} }
})(); })();
+18 -17
View File
@@ -381,18 +381,10 @@ body::before {
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
max-width: 1200px; max-width: 1200px;
margin: 0 auto; margin: 0 auto;
} background-image: url("asset/banner/1.png");
background-size: 100% auto;
/* Full-width banner spanning both columns in the middle row */ background-position: center;
.brands-banner-img { background-repeat: no-repeat;
grid-column: 1 / -1;
grid-row: 2;
width: 100%;
height: auto;
display: block;
z-index: 0;
pointer-events: none;
transition: opacity 0.3s ease;
} }
.brand-card { .brand-card {
@@ -401,19 +393,15 @@ body::before {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
grid-row: 1 / 4;
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
z-index: 1;
} }
.brand-card--fine { .brand-card--fine {
grid-column: 1;
border-right: 1px solid var(--border); border-right: 1px solid var(--border);
} }
.brand-card--lacueor { .brand-card--lacueor {
grid-column: 2;
} }
.brand-card-header { .brand-card-header {
@@ -430,6 +418,11 @@ body::before {
background: var(--lacueor-dark); background: var(--lacueor-dark);
} }
.brand-card-gap {
flex: 1;
min-height: 500px;
}
.brand-card-footer { .brand-card-footer {
flex-shrink: 0; flex-shrink: 0;
padding: 20px 52px 40px; padding: 20px 52px 40px;
@@ -444,7 +437,7 @@ body::before {
background: var(--lacueor-dark); background: var(--lacueor-dark);
} }
.brand-card-spacer { .brands-banner-img {
display: none; display: none;
} }
@@ -1008,6 +1001,10 @@ footer {
padding: 24px 28px 16px; padding: 24px 28px 16px;
} }
.brand-card-gap {
min-height: 400px;
}
.brand-card-footer { .brand-card-footer {
padding: 16px 28px 32px; padding: 16px 28px 32px;
} }
@@ -1060,6 +1057,10 @@ footer {
padding: 20px 24px 14px; padding: 20px 24px 14px;
} }
.brand-card-gap {
min-height: 240px;
}
.brand-card-footer { .brand-card-footer {
padding: 14px 24px 28px; padding: 14px 24px 28px;
} }