Files
homepage/script.js
T
Oliver d4690d9f54 Fix: single banner as grid background, no duplicated images
- Banner is now a single CSS background-image on .brands-grid
  spanning both card columns (left half on FI-NE, right on LACUEOR)
- Cards only have header (above) + spacer + footer (below)
  with semi-transparent solid backgrounds for readability
- Dropdown changes the grid's background-image directly
- Removed per-card <img> elements (was showing image twice)
- Cleaned up orphaned CSS classes
2026-07-01 20:44:08 +00:00

49 lines
1.6 KiB
JavaScript

/* ============================================================
FI-NE & LACUEOR — B2B Partner Portal
Scripts
============================================================ */
(function () {
"use strict";
/* ── Smooth anchor scroll offset for fixed topbar ────────── */
document.querySelectorAll('a[href^="#"]').forEach(function (anchor) {
anchor.addEventListener("click", function (e) {
var target = document.querySelector(this.getAttribute("href"));
if (!target) return;
e.preventDefault();
var offset = 80;
var top =
target.getBoundingClientRect().top +
window.pageYOffset -
offset;
window.scrollTo({ top: top, behavior: "smooth" });
});
});
/* ── Topbar shadow on scroll ─────────────────────────────── */
var topbar = document.querySelector(".topbar");
window.addEventListener(
"scroll",
function () {
if (window.scrollY > 20) {
topbar.style.boxShadow = "0 2px 24px rgba(0,0,0,0.08)";
} else {
topbar.style.boxShadow = "none";
}
},
{ passive: true }
);
/* ── Banner image selector ──────────────────────────────── */
var bannerPicker = document.getElementById("banner-picker");
var brandsGrid = document.getElementById("brands-grid");
if (bannerPicker && brandsGrid) {
bannerPicker.addEventListener("change", function () {
var val = this.value;
brandsGrid.style.backgroundImage =
"url(asset/banner/" + val + ".png)";
});
}
})();