new
This commit is contained in:
@@ -1,11 +1,78 @@
|
||||
/* ============================================================
|
||||
FI-NE & LACUEOR — B2B Partner Portal
|
||||
Scripts
|
||||
Scripts — i18n, banner selector, smooth scroll, topbar shadow
|
||||
============================================================ */
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
/* ── Translations ─────────────────────────────────────── */
|
||||
var translations = {
|
||||
en: {
|
||||
"signup.label": "Contact Us",
|
||||
"signup.title": "Become a Partner",
|
||||
"signup.body":
|
||||
"Interested in carrying [fi-ne] or LACUEOR? Send us your details and we will get back to you within 48 hours.",
|
||||
"signup.name": "Name *",
|
||||
"signup.email": "Email *",
|
||||
"signup.phone": "Phone",
|
||||
"signup.website": "Website",
|
||||
"signup.social": "Social Media",
|
||||
"signup.message": "Describe your business case *",
|
||||
"signup.submit": "Send Request",
|
||||
"footer.copyright": "\u00a9 2025 FINOR GmbH. All rights reserved.",
|
||||
"footer.legal": "Legal Notice",
|
||||
"footer.privacy": "Privacy Policy",
|
||||
"footer.tagline": "Made in Berlin, with love.",
|
||||
},
|
||||
de: {
|
||||
"signup.label": "Kontakt",
|
||||
"signup.title": "Partner werden",
|
||||
"signup.body":
|
||||
"Interesse an [fi-ne] oder LACUEOR? Senden Sie uns Ihre Daten und wir melden uns innerhalb von 48 Stunden zur\u00fcck.",
|
||||
"signup.name": "Name *",
|
||||
"signup.email": "E-Mail *",
|
||||
"signup.phone": "Telefon",
|
||||
"signup.website": "Webseite",
|
||||
"signup.social": "Social Media",
|
||||
"signup.message": "Beschreiben Sie Ihr Gesch\u00e4ftsfeld *",
|
||||
"signup.submit": "Anfrage senden",
|
||||
"footer.copyright": "\u00a9 2025 FINOR GmbH. Alle Rechte vorbehalten.",
|
||||
"footer.legal": "Impressum",
|
||||
"footer.privacy": "Datenschutz",
|
||||
"footer.tagline": "Hergestellt in Berlin, mit Liebe.",
|
||||
},
|
||||
};
|
||||
|
||||
function applyLang(lang) {
|
||||
var t = translations[lang] || translations.en;
|
||||
document.querySelectorAll("[data-i18n]").forEach(function (el) {
|
||||
var key = el.getAttribute("data-i18n");
|
||||
if (t[key]) el.textContent = t[key];
|
||||
});
|
||||
document.getElementById("lang-select").value = lang;
|
||||
}
|
||||
|
||||
/* Auto-detect from browser, default to English */
|
||||
var detectedLang =
|
||||
navigator.language && navigator.language.slice(0, 2) === "de" ? "de" : "en";
|
||||
applyLang(detectedLang);
|
||||
|
||||
document
|
||||
.getElementById("lang-select")
|
||||
.addEventListener("change", function () {
|
||||
applyLang(this.value);
|
||||
});
|
||||
|
||||
/* ── Banner image selector ──────────────────────────────── */
|
||||
var bannerPicker = document.getElementById("banner-picker");
|
||||
var brandsBanner = document.getElementById("brands-banner");
|
||||
if (bannerPicker && brandsBanner) {
|
||||
bannerPicker.addEventListener("change", function () {
|
||||
brandsBanner.src = "asset/banner/" + this.value + ".png";
|
||||
});
|
||||
}
|
||||
|
||||
/* ── Smooth anchor scroll offset for fixed topbar ────────── */
|
||||
document.querySelectorAll('a[href^="#"]').forEach(function (anchor) {
|
||||
anchor.addEventListener("click", function (e) {
|
||||
@@ -14,9 +81,7 @@
|
||||
e.preventDefault();
|
||||
var offset = 80;
|
||||
var top =
|
||||
target.getBoundingClientRect().top +
|
||||
window.pageYOffset -
|
||||
offset;
|
||||
target.getBoundingClientRect().top + window.pageYOffset - offset;
|
||||
window.scrollTo({ top: top, behavior: "smooth" });
|
||||
});
|
||||
});
|
||||
@@ -32,17 +97,6 @@
|
||||
topbar.style.boxShadow = "none";
|
||||
}
|
||||
},
|
||||
{ passive: true }
|
||||
{ passive: true },
|
||||
);
|
||||
|
||||
/* ── Banner image selector ──────────────────────────────── */
|
||||
var bannerPicker = document.getElementById("banner-picker");
|
||||
var brandsGrid = document.querySelector(".brands-grid");
|
||||
if (bannerPicker && brandsGrid) {
|
||||
bannerPicker.addEventListener("change", function () {
|
||||
var val = this.value;
|
||||
brandsGrid.style.backgroundImage =
|
||||
"url(asset/banner/" + val + ".png)";
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user