Posodobitev menija, strani in mobilne optimizacije
Deploy to Development and Production / deploy (push) Successful in 13s
Deploy to Development and Production / deploy (push) Successful in 13s
- Preimenovan meni: Ponudba -> Poučevanje jezikov, Skupaj za vključevanje -> Medkulturno povezovanje - Dodana kategorija Delavnice za vključevanje s podmenijem - Posodobljena stran Poučevanje jezikov (odstranjena sekcija medkulturnega posredovanja) - Posodobljena stran Medkulturno povezovanje (dodane cene, vsebina) - Dodana sekcija Aktualne delavnice na naslovnico - Dodana sekcija Priporočamo branje na naslovnico in Kdo sem - Mobilna optimizacija za vse strani - Popravki navigacije (hover/click, razporeditev) - Popravki CSS za references sekcijo
This commit is contained in:
1 parent
dc4c8a52be
commit
50fdb72b82
27 files changed
+2580
-4405
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
document.addEventListener('DOMContentLoaded', function () { const mobileMenuBtn = document.querySelector('.mobile-menu-btn'); const navLinks = document.querySelector('.nav-links'); let closeMobileMenu = () => { }; let resetMobileSubmenus = () => { }; const normalizePath = (value) => { if (!value) { return '/'; } let clean = value.split('?')[0].split('#')[0]; clean = clean.replace(/index\.html$/i, ''); clean = clean.replace(/\/+$/, ''); if (clean === '') { clean = '/'; } return clean; }; const applyActiveNavState = () => { const navRoot = document.querySelector('.nav-links'); if (!navRoot) { return; } navRoot.querySelectorAll('a.active, .dropbtn.active').forEach(el => { el.classList.remove('active'); }); const currentPath = normalizePath(window.location.pathname); const navAnchors = navRoot.querySelectorAll('a[href]'); let matchedLink = null; navAnchors.forEach(anchor => { const href = anchor.getAttribute('href'); if (!href || href.startsWith('http') || href.startsWith('mailto:') || href.startsWith('tel:') || href.startsWith('#')) { return; } const linkPath = normalizePath(href); if (linkPath === currentPath) { matchedLink = anchor; } }); if (!matchedLink) { return; } matchedLink.classList.add('active'); const highlightDropdownParents = (element) => { let parentContent = element.closest('.dropdown-submenu-content, .dropdown-content'); while (parentContent) { const trigger = parentContent.previousElementSibling; if (trigger && (trigger.tagName === 'A' || trigger.classList.contains('dropbtn'))) { trigger.classList.add('active'); } parentContent = parentContent.parentElement ? parentContent.parentElement.closest('.dropdown-submenu-content, .dropdown-content') : null; } }; highlightDropdownParents(matchedLink); const topLevelDropdown = matchedLink.closest('.dropdown'); if (topLevelDropdown) { const trigger = topLevelDropdown.querySelector('.dropbtn'); if (trigger) { trigger.classList.add('active'); } } }; if (mobileMenuBtn && navLinks) { resetMobileSubmenus = () => { navLinks.querySelectorAll('.dropdown-content, .dropdown-submenu-content').forEach(submenu => { submenu.style.display = 'none'; }); navLinks.querySelectorAll('.dropbtn, .dropdown-submenu > a').forEach(link => { link.classList.remove('active'); }); applyActiveNavState(); }; closeMobileMenu = () => { mobileMenuBtn.classList.remove('active'); navLinks.classList.remove('active'); document.body.classList.remove('no-scroll'); resetMobileSubmenus(); }; mobileMenuBtn.addEventListener('click', (event) => { event.stopPropagation(); const willOpen = !navLinks.classList.contains('active'); if (willOpen) { mobileMenuBtn.classList.add('active'); navLinks.classList.add('active'); document.body.classList.add('no-scroll'); resetMobileSubmenus(); } else { closeMobileMenu(); } }); } applyActiveNavState(); const dropdowns = document.querySelectorAll('.nav-links .dropdown-submenu > a, .nav-links .dropdown > .dropbtn'); dropdowns.forEach(item => { item.addEventListener('click', function (event) { if (window.innerWidth <= 768) { if (item.tagName === 'A') { event.preventDefault(); } event.stopPropagation(); const submenu = item.nextElementSibling; if (!submenu) { return; } const isTopLevelTrigger = item.classList.contains('dropbtn'); if (isTopLevelTrigger) { navLinks.querySelectorAll('.dropdown-content').forEach(panel => { if (panel !== submenu) { panel.style.display = 'none'; const trigger = panel.parentElement.querySelector('.dropbtn'); if (trigger) { trigger.classList.remove('active'); } panel.querySelectorAll('.dropdown-submenu-content').forEach(child => { child.style.display = 'none'; const childTrigger = child.parentElement.querySelector(':scope > a'); if (childTrigger) { childTrigger.classList.remove('active'); } }); } }); } else { const siblingsWrapper = item.parentElement && item.parentElement.parentElement; if (siblingsWrapper) { siblingsWrapper.querySelectorAll(':scope > .dropdown-submenu > .dropdown-submenu-content').forEach(panel => { if (panel !== submenu) { panel.style.display = 'none'; const trigger = panel.parentElement.querySelector(':scope > a'); if (trigger) { trigger.classList.remove('active'); } panel.querySelectorAll('.dropdown-submenu-content').forEach(child => { child.style.display = 'none'; const childTrigger = child.parentElement.querySelector(':scope > a'); if (childTrigger) { childTrigger.classList.remove('active'); } }); } }); } } const shouldOpen = submenu.style.display !== 'block'; if (shouldOpen) { submenu.style.display = 'block'; item.classList.add('active'); submenu.querySelectorAll('.dropdown-submenu-content').forEach(child => { child.style.display = 'none'; const childTrigger = child.parentElement.querySelector(':scope > a'); if (childTrigger) { childTrigger.classList.remove('active'); } }); } else { submenu.style.display = 'none'; item.classList.remove('active'); submenu.querySelectorAll('.dropdown-submenu-content').forEach(child => { child.style.display = 'none'; const childTrigger = child.parentElement.querySelector(':scope > a'); ifLine truncated
|
||||
document.addEventListener('DOMContentLoaded', function () { const mobileMenuBtn = document.querySelector('.mobile-menu-btn'); const navLinks = document.querySelector('.nav-links'); let closeMobileMenu = () => { }; let resetMobileSubmenus = () => { }; const normalizePath = (value) => { if (!value) { return '/'; } let clean = value.split('?')[0].split('#')[0]; clean = clean.replace(/index\.html$/i, ''); clean = clean.replace(/\/+$/, ''); if (clean === '') { clean = '/'; } return clean; }; const applyActiveNavState = () => { const navRoot = document.querySelector('.nav-links'); if (!navRoot) { return; } navRoot.querySelectorAll('a.active, .dropbtn.active').forEach(el => { el.classList.remove('active'); }); const currentPath = normalizePath(window.location.pathname); const navAnchors = navRoot.querySelectorAll('a[href]'); let matchedLink = null; navAnchors.forEach(anchor => { const href = anchor.getAttribute('href'); if (!href || href.startsWith('http') || href.startsWith('mailto:') || href.startsWith('tel:') || href.startsWith('#')) { return; } const linkPath = normalizePath(href); if (linkPath === currentPath) { matchedLink = anchor; } }); if (!matchedLink) { return; } matchedLink.classList.add('active'); const highlightDropdownParents = (element) => { let parentContent = element.closest('.dropdown-submenu-content, .dropdown-content'); while (parentContent) { const trigger = parentContent.previousElementSibling; if (trigger && (trigger.tagName === 'A' || trigger.classList.contains('dropbtn'))) { trigger.classList.add('active'); } parentContent = parentContent.parentElement ? parentContent.parentElement.closest('.dropdown-submenu-content, .dropdown-content') : null; } }; highlightDropdownParents(matchedLink); const topLevelDropdown = matchedLink.closest('.dropdown'); if (topLevelDropdown) { const trigger = topLevelDropdown.querySelector('.dropbtn'); if (trigger) { trigger.classList.add('active'); } } }; if (mobileMenuBtn && navLinks) { resetMobileSubmenus = () => { navLinks.querySelectorAll('.dropdown-content, .dropdown-submenu-content').forEach(submenu => { submenu.style.display = 'none'; }); navLinks.querySelectorAll('.dropbtn, .dropdown-submenu > a').forEach(link => { link.classList.remove('active'); }); applyActiveNavState(); }; closeMobileMenu = () => { mobileMenuBtn.classList.remove('active'); navLinks.classList.remove('active'); document.body.classList.remove('no-scroll'); resetMobileSubmenus(); }; mobileMenuBtn.addEventListener('click', (event) => { event.stopPropagation(); const willOpen = !navLinks.classList.contains('active'); if (willOpen) { mobileMenuBtn.classList.add('active'); navLinks.classList.add('active'); document.body.classList.add('no-scroll'); resetMobileSubmenus(); } else { closeMobileMenu(); } }); } applyActiveNavState(); const dropdowns = document.querySelectorAll('.nav-links .dropdown-submenu > a, .nav-links .dropdown > .dropbtn'); dropdowns.forEach(item => { item.addEventListener('click', function (event) { if (window.innerWidth <= 768) { if (item.tagName === 'A') { event.preventDefault(); } event.stopPropagation(); const submenu = item.nextElementSibling; if (!submenu) { return; } const isTopLevelTrigger = item.classList.contains('dropbtn'); if (isTopLevelTrigger) { navLinks.querySelectorAll('.dropdown-content').forEach(panel => { if (panel !== submenu) { panel.style.display = 'none'; const trigger = panel.parentElement.querySelector('.dropbtn'); if (trigger) { trigger.classList.remove('active'); } panel.querySelectorAll('.dropdown-submenu-content').forEach(child => { child.style.display = 'none'; const childTrigger = child.parentElement.querySelector(':scope > a'); if (childTrigger) { childTrigger.classList.remove('active'); } }); } }); } else { const siblingsWrapper = item.parentElement && item.parentElement.parentElement; if (siblingsWrapper) { siblingsWrapper.querySelectorAll(':scope > .dropdown-submenu > .dropdown-submenu-content').forEach(panel => { if (panel !== submenu) { panel.style.display = 'none'; const trigger = panel.parentElement.querySelector(':scope > a'); if (trigger) { trigger.classList.remove('active'); } panel.querySelectorAll('.dropdown-submenu-content').forEach(child => { child.style.display = 'none'; const childTrigger = child.parentElement.querySelector(':scope > a'); if (childTrigger) { childTrigger.classList.remove('active'); } }); } }); } } const shouldOpen = submenu.style.display !== 'block'; if (shouldOpen) { submenu.style.display = 'block'; item.classList.add('active'); submenu.querySelectorAll('.dropdown-submenu-content').forEach(child => { child.style.display = 'none'; const childTrigger = child.parentElement.querySelector(':scope > a'); if (childTrigger) { childTrigger.classList.remove('active'); } }); } else { submenu.style.display = 'none'; item.classList.remove('active'); submenu.querySelectorAll('.dropdown-submenu-content').forEach(child => { child.style.display = 'none'; const childTrigger = child.parentElement.querySelector(':scope > a'); ifLine truncated
|
||||
Reference in new issue
Block a user