- OpenStreetMap Integration mit Leaflet.js in Contact Section - Vollständiges Impressum mit IHK- und VersVermV-Informationen - DSGVO-konforme Datenschutzerklärung - Footer-Links zu rechtlichen Seiten auf allen Seiten - Neues weißes AXA-Logo für bessere Sichtbarkeit - Responsive Map-Design mit Custom Marker
80 lines
2.5 KiB
JavaScript
80 lines
2.5 KiB
JavaScript
// Smooth scrolling for anchor links
|
|
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
|
anchor.addEventListener('click', function (e) {
|
|
e.preventDefault();
|
|
const target = document.querySelector(this.getAttribute('href'));
|
|
if (target) {
|
|
target.scrollIntoView({
|
|
behavior: 'smooth',
|
|
block: 'start'
|
|
});
|
|
}
|
|
});
|
|
});
|
|
|
|
// Add animation on scroll
|
|
const observerOptions = {
|
|
threshold: 0.1,
|
|
rootMargin: '0px 0px -50px 0px'
|
|
};
|
|
|
|
const observer = new IntersectionObserver((entries) => {
|
|
entries.forEach(entry => {
|
|
if (entry.isIntersecting) {
|
|
entry.target.style.opacity = '1';
|
|
entry.target.style.transform = 'translateY(0)';
|
|
}
|
|
});
|
|
}, observerOptions);
|
|
|
|
// Observe service cards and about items
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const animatedElements = document.querySelectorAll('.service-card, .about-item');
|
|
|
|
animatedElements.forEach(el => {
|
|
el.style.opacity = '0';
|
|
el.style.transform = 'translateY(20px)';
|
|
el.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
|
|
observer.observe(el);
|
|
});
|
|
|
|
// Initialize map
|
|
initializeMap();
|
|
});
|
|
|
|
// Initialize Leaflet Map
|
|
function initializeMap() {
|
|
// Koordinaten: Am Fallgatter 6, 93183 Kallmünz / Traidendorf
|
|
const lat = 49.17160;
|
|
const lng = 11.94120;
|
|
|
|
// Create map
|
|
const map = L.map('map').setView([lat, lng], 16);
|
|
|
|
// Add OpenStreetMap tiles
|
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
|
maxZoom: 19
|
|
}).addTo(map);
|
|
|
|
// Custom icon
|
|
const axaIcon = L.divIcon({
|
|
className: 'custom-marker',
|
|
html: '<div style="background-color: #00008f; color: white; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; border: 3px solid white; box-shadow: 0 2px 8px rgba(0,0,0,0.3);">📍</div>',
|
|
iconSize: [40, 40],
|
|
iconAnchor: [20, 40]
|
|
});
|
|
|
|
// Add marker
|
|
const marker = L.marker([lat, lng], { icon: axaIcon }).addTo(map);
|
|
|
|
// Add popup
|
|
marker.bindPopup(`
|
|
<div style="text-align: center; padding: 10px;">
|
|
<strong>Andreas Guttenberger</strong><br>
|
|
Versicherungsfachmann (IHK)<br>
|
|
Am Fallgatter 6<br>
|
|
93183 Kallmünz / Traidendorf
|
|
</div>
|
|
`).openPopup();
|
|
} |