You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
tdf-webseite/venue.js

30 lines
1.2 KiB

/**
* Tage der digitalen Freiheit
* Handcrafted with ♥ by x~alotl
*/
document.addEventListener('DOMContentLoaded', function () {
const locationLinks = document.querySelectorAll('.location-link');
const markers = document.querySelectorAll('.location-marker');
locationLinks.forEach(link => {
link.addEventListener('click', function (e) {
e.preventDefault();
markers.forEach(marker => {
marker.classList.remove('active');
});
const targetLocation = this.getAttribute('data-target');
const targetMarker = document.querySelector(`[data-location="${targetLocation}"]`);
if (targetMarker) {
targetMarker.classList.add('active');
const targetFloor = this.getAttribute('href');
const targetElement = document.querySelector(targetFloor);
if (targetElement) {
targetElement.scrollIntoView({ behavior: 'smooth' });
}
setTimeout(() => {
targetMarker.classList.remove('active');
}, 10000);
}
});
});
});