Prepare migration to Tailwind

This commit is contained in:
kbe
2025-08-20 11:21:40 +02:00
parent aabcd5eaa2
commit 30a3080480
2637 changed files with 9119 additions and 508739 deletions

54
assets/js/header.js Normal file
View File

@@ -0,0 +1,54 @@
// Header JavaScript
document.addEventListener('DOMContentLoaded', function() {
// Mobile menu toggle
const offcanvasToggle = document.querySelector('.cs-header__offcanvas-toggle');
const offcanvasClose = document.querySelector('.cs-header__offcanvas-close');
const offcanvas = document.querySelector('.cs-header__offcanvas');
const overlay = document.querySelector('.cs-search-overlay');
if (offcanvasToggle) {
offcanvasToggle.addEventListener('click', function() {
offcanvas.classList.add('active');
overlay.style.display = 'block';
document.body.style.overflow = 'hidden';
});
}
if (offcanvasClose) {
offcanvasClose.addEventListener('click', function() {
offcanvas.classList.remove('active');
overlay.style.display = 'none';
document.body.style.overflow = '';
});
}
// Search functionality
const searchToggle = document.querySelectorAll('.cs-header__search-toggle');
const searchClose = document.querySelector('.cs-search__close');
const search = document.querySelector('.cs-search');
searchToggle.forEach(toggle => {
toggle.addEventListener('click', function() {
search.style.display = 'block';
overlay.style.display = 'block';
document.body.style.overflow = 'hidden';
});
});
if (searchClose) {
searchClose.addEventListener('click', function() {
search.style.display = 'none';
overlay.style.display = 'none';
document.body.style.overflow = '';
});
}
if (overlay) {
overlay.addEventListener('click', function() {
offcanvas.classList.remove('active');
search.style.display = 'none';
overlay.style.display = 'none';
document.body.style.overflow = '';
});
}
});