Add subtle interface polish and clean URLs

This commit is contained in:
Raffael Sheikh committed 2026-05-24 00:07:24 +02:00
1 parent 3575a35877
commit 39407585f2
8 files changed
+338 -40

No files matched your search

+46
View File
@@ -9,6 +9,14 @@
/* ---- Mobile-Navigation ---- */
var toggle = document.querySelector(".nav-toggle");
var mobileNav = document.querySelector(".mobile-nav");
var header = document.querySelector(".site-header");
function updateHeaderState() {
if (!header) return;
header.classList.toggle("is-scrolled", window.scrollY > 12);
}
updateHeaderState();
window.addEventListener("scroll", updateHeaderState, { passive: true });
if (toggle && mobileNav) {
toggle.addEventListener("click", function () {
var open = mobileNav.hasAttribute("hidden");
@@ -28,6 +36,44 @@
});
}
/* ---- Dezente Scroll-Reveals ---- */
var reduceMotion = window.matchMedia &&
window.matchMedia("(prefers-reduced-motion: reduce)").matches;
var revealEls = Array.prototype.slice.call(document.querySelectorAll([
".hero-copy > *",
".hero-visual",
".section-head",
".card",
".step",
".arbeit-copy > *",
".kanban-wrap",
".kontakt-copy > *",
".lead-form",
".td-hero .wrap > *",
".td-feature > *",
".td-talk",
".speaker-card",
".shot",
".gj-teaser"
].join(",")));
revealEls.forEach(function (el, index) {
el.classList.add("reveal", "reveal-delay-" + (index % 5));
});
if (reduceMotion || !("IntersectionObserver" in window)) {
revealEls.forEach(function (el) { el.classList.add("is-visible"); });
} else {
var observer = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
if (!entry.isIntersecting) return;
entry.target.classList.add("is-visible");
observer.unobserve(entry.target);
});
}, { threshold: 0.12, rootMargin: "0px 0px -8% 0px" });
revealEls.forEach(function (el) { observer.observe(el); });
}
/* ---- Lead-Formular ---- */
var form = document.getElementById("lead-form");
var status = document.getElementById("form-status");