27 lines
875 B
JavaScript
27 lines
875 B
JavaScript
document.addEventListener("DOMContentLoaded", function() {
|
|
const links = document.querySelectorAll('a');
|
|
|
|
links.forEach(link => {
|
|
link.addEventListener('click', function(event) {
|
|
const href = this.getAttribute('href');
|
|
|
|
if (href && href !== '#') {
|
|
event.preventDefault();
|
|
document.body.classList.add('page-transition-exit');
|
|
|
|
setTimeout(() => {
|
|
window.location.href = href;
|
|
}, 200); // Zeit, die der CSS-Übergang benötigt (0.5s)
|
|
}
|
|
});
|
|
});
|
|
|
|
window.addEventListener('load', function() {
|
|
document.body.classList.add('page-transition-enter');
|
|
|
|
setTimeout(() => {
|
|
document.body.classList.remove('page-transition-enter');
|
|
}, 200); // Zeit, die der CSS-Übergang benötigt (0.5s)
|
|
});
|
|
});
|