fbbad82975
- Created new src/ directory - Copied all project files and folders to src/ - Keeps project structure organized and consolidated
21 lines
635 B
JavaScript
21 lines
635 B
JavaScript
const cookieBanner = document.querySelector('.cookie-banner');
|
|
const cookieAccept = document.querySelector('[data-cookie-accept]');
|
|
|
|
if (cookieBanner && cookieAccept) {
|
|
const consent = localStorage.getItem('gyb-cookie');
|
|
if (!consent) {
|
|
cookieBanner.classList.add('active');
|
|
}
|
|
cookieAccept.addEventListener('click', () => {
|
|
localStorage.setItem('gyb-cookie', 'accepted');
|
|
cookieBanner.classList.remove('active');
|
|
});
|
|
}
|
|
|
|
const filterForm = document.querySelector('[data-filter-form]');
|
|
if (filterForm) {
|
|
filterForm.addEventListener('input', () => {
|
|
filterForm.submit();
|
|
});
|
|
}
|