hotel-am-see/js/custom.js
Jontil88 2b462bc0e6 Initial commit: Hotel am See website with bilingual i18n (DE/EN)
- Static HTML hotel website with Bootstrap 5
- i18next-based client-side internationalization
- Language switcher (DE/EN) in navbar
- German and English translation JSON files
- Translated: navigation, content, forms, FAQ, legal pages (AGB)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 22:49:57 +01:00

194 lines
No EOL
3.4 KiB
JavaScript

(function () {
'use strict'
AOS.init({
duration: 800,
easing: 'slide',
once: true
});
var preloader = function() {
var loader = document.querySelector('.loader');
var overlay = document.getElementById('overlayer');
function fadeOut(el) {
el.style.opacity = 1;
(function fade() {
if ((el.style.opacity -= .1) < 0) {
el.style.display = "none";
} else {
requestAnimationFrame(fade);
}
})();
};
function hidePreloader() {
setTimeout(function() {
fadeOut(loader);
fadeOut(overlay);
}, 200);
}
if (window.i18nReady) {
hidePreloader();
} else {
document.addEventListener('i18nReady', hidePreloader);
setTimeout(hidePreloader, 3000);
}
};
preloader();
var tinyslider = function() {
var slider = document.querySelectorAll('.features-slider');
var postSlider = document.querySelectorAll('.post-slider');
var testimonialSlider = document.querySelectorAll('.testimonial-slider');
var instagramSlider = document.querySelectorAll('.instagram-slider');
if ( slider.length> 0 ) {
var tnsSlider = tns({
container: '.features-slider',
mode: 'carousel',
speed: 700,
items: 3,
// center: true,
gutter: 30,
loop: false,
edgePadding: 80,
controlsPosition: 'bottom',
// navPosition: 'bottom',
nav: false,
// autoplay: true,
// autoplayButtonOutput: false,
controlsContainer: '#features-slider-nav',
responsive: {
0: {
items: 1
},
700: {
items: 2
},
900: {
items: 3
}
}
});
}
if ( postSlider.length> 0 ) {
var tnsPostSlider = tns({
container: '.post-slider',
mode: 'carousel',
speed: 700,
items: 3,
// center: true,
gutter: 30,
loop: true,
edgePadding: 10,
controlsPosition: 'bottom',
navPosition: 'bottom',
nav: false,
autoplay: true,
autoplayButtonOutput: false,
controlsContainer: '#post-slider-nav',
responsive: {
0: {
items: 1
},
700: {
items: 2
},
900: {
items: 2
},
1000: {
items: 3
}
}
});
}
if ( testimonialSlider.length> 0 ) {
var tnsTestimonialSlider = tns({
container: '.testimonial-slider',
mode: 'carousel',
speed: 700,
items: 3,
// center: true,
gutter: 30,
loop: true,
edgePadding: 10,
controlsPosition: 'bottom',
navPosition: 'bottom',
nav: false,
autoplay: true,
autoplayButtonOutput: false,
controlsContainer: '#testimonial-slider-nav',
responsive: {
0: {
items: 1
},
700: {
items: 2
},
900: {
items: 2
},
1000: {
items: 3
}
}
});
}
if ( instagramSlider.length> 0 ) {
var instagramSlider = tns({
container: '.instagram-slider',
mode: 'carousel',
speed: 700,
items: 5,
// center: true,
gutter: 0,
loop: true,
edgePadding: 0,
controlsPosition: 'bottom',
navPosition: 'bottom',
nav: false,
autoplay: true,
controls: false,
autoplayButtonOutput: false,
responsive: {
0: {
items: 1
},
700: {
items: 2
},
900: {
items: 4
},
1400: {
items: 5
}
}
});
}
}
tinyslider();
var lightboxVideo = GLightbox({
selector: '.glightbox'
});
flatpickr("#arrival", {});
flatpickr("#departure", {});
})()