Refactor contact form handling and enhance Mail Gateway page: Centralized subject mapping for contact requests, improved CSRF token validation, and optimized AJAX CORS handling. Updated Mail Gateway page layout and content for better clarity and user engagement, including new package details and security features.

This commit is contained in:
TheOnlyMace
2026-01-06 21:57:55 +01:00
parent 385baf2db7
commit bca75e38bc
5 changed files with 340 additions and 229 deletions

View File

@@ -87,29 +87,39 @@
// Header scroll effect - always visible with transparency change
const header = document.querySelector('.header');
const hero = document.querySelector('.hero');
window.addEventListener('scroll', function() {
// Kombinierter, optimierter Scroll-Handler mit requestAnimationFrame
let ticking = false;
function handleScroll() {
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
if (scrollTop > 50) {
// Scrolled down - make header more opaque
header.classList.add('scrolled');
} else {
// At top - make header more transparent
header.classList.remove('scrolled');
// Header-Effekt
if (header) {
if (scrollTop > 50) {
header.classList.add('scrolled');
} else {
header.classList.remove('scrolled');
}
}
});
// Add parallax effect to hero section
const hero = document.querySelector('.hero');
if (hero) {
window.addEventListener('scroll', function() {
const scrolled = window.pageYOffset;
const rate = scrolled * -0.5;
// Parallax-Effekt für Hero
if (hero) {
const rate = scrollTop * -0.5;
hero.style.transform = `translateY(${rate}px)`;
});
}
ticking = false;
}
window.addEventListener('scroll', function() {
if (!ticking) {
requestAnimationFrame(handleScroll);
ticking = true;
}
}, { passive: true });
// Form validation (for contact forms)
const forms = document.querySelectorAll('form');
forms.forEach(form => {