markemacht/_markemacht.de/dev/first design/main.js
Kevin Adametz 00796a35d5
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled
Markenwissen-Wissensbasis: Konsistenz-Korrekturen + Copyright-Hygiene
Konsolidierter, bereinigter Stand der Wissensbasis (docs/). Frischer
Wurzel-Commit, um urheberrechtlich problematische Volltexte aus der
Historie zu entfernen (die bisherige Historie bestand aus einem einzigen
Initial-Commit).

Enthaltene Änderungen (vgl. docs/_Steuerung/CHANGELOG.md, 2026-05-29):
- Copyright-Hygiene: 25 Volltext-/Übersetzungsdateien (Sharp 14 Kap.,
  Wala 11 Kap.) entfernt; je Quelle _Fundstellen-Index.md als
  Provenienzbeleg; Quellnachweise + Steuerungsdateien angepasst.
- Konsistenz-Korrekturen: Reichweite 000-013 (Scorecard-Regeln),
  Rule-ID MW-WK-DIFF-101, Quellnachweis-Dateiverweis, Dok.000 v2.0.2.
- Dateinamen-Normalisierung: Startdatei ohne Leerzeichen.

Originale (Wala/Sharp E-Books) privat außerhalb des Repos archiviert.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 08:23:03 +00:00

94 lines
2.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ============================================
// MARKE MACHT. JavaScript
// ============================================
// --- Navigation Scroll Effect ---
const nav = document.getElementById('nav');
const handleNavScroll = () => {
if (window.scrollY > 50) {
nav.classList.add('scrolled');
} else {
nav.classList.remove('scrolled');
}
};
window.addEventListener('scroll', handleNavScroll);
window.addEventListener('load', handleNavScroll);
// --- Mobile Menu Toggle ---
const navToggle = document.getElementById('navToggle');
const navMobile = document.getElementById('navMobile');
if (navToggle && navMobile) {
navToggle.addEventListener('click', () => {
navMobile.classList.toggle('active');
document.body.style.overflow = navMobile.classList.contains('active') ? 'hidden' : '';
});
// Close mobile menu on link click
const mobileLinks = navMobile.querySelectorAll('a');
mobileLinks.forEach(link => {
link.addEventListener('click', () => {
navMobile.classList.remove('active');
document.body.style.overflow = '';
});
});
}
// --- Smooth Scroll for Anchor Links ---
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
const href = this.getAttribute('href');
if (href === '#') return;
e.preventDefault();
const target = document.querySelector(href);
if (target) {
const navHeight = nav.offsetHeight;
const targetPosition = target.getBoundingClientRect().top + window.scrollY - navHeight - 20;
window.scrollTo({
top: targetPosition,
behavior: 'smooth'
});
}
});
});
// --- Intersection Observer for Animations ---
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
observer.unobserve(entry.target);
}
});
}, observerOptions);
// Observe elements with animation classes
document.querySelectorAll('.symptom-card, .quote-block, .intro-block, .cta-block').forEach(el => {
observer.observe(el);
});
// --- Active Navigation Link ---
const setActiveNavLink = () => {
const currentPage = window.location.pathname.split('/').pop() || 'index.html';
const navLinks = document.querySelectorAll('.nav-link, .nav-mobile-link');
navLinks.forEach(link => {
const href = link.getAttribute('href');
if (href === currentPage || (currentPage === '' && href === 'index.html')) {
link.classList.add('active');
} else {
link.classList.remove('active');
}
});
};
window.addEventListener('load', setActiveNavLink);