- initial

This commit is contained in:
Ty Clifford
2026-04-24 08:41:52 -04:00
commit b57091e4ad
49 changed files with 7371 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
// Nav hamburger
const ham=document.getElementById('ham'),navLinks=document.getElementById('navLinks');
ham?.addEventListener('click',()=>navLinks?.classList.toggle('open'));
document.addEventListener('click',e=>{if(!e.target.closest('.navbar'))navLinks?.classList.remove('open')});
// User dropdown
const uBtn=document.getElementById('userBtn'),uDd=document.getElementById('userDd');
uBtn?.addEventListener('click',e=>{e.stopPropagation();uDd?.classList.toggle('open')});
document.addEventListener('click',()=>uDd?.classList.remove('open'));
// Flash auto-dismiss after 4.5s
setTimeout(()=>{
document.querySelectorAll('.flash').forEach(el=>{
el.style.transition='opacity .5s';
el.style.opacity='0';
setTimeout(()=>el.remove(),500);
});
},4500);
// Confirm dialogs
document.querySelectorAll('[data-confirm]').forEach(el=>{
el.addEventListener('click',e=>{if(!confirm(el.dataset.confirm))e.preventDefault();});
});
// Admin sidebar active link
document.querySelectorAll('.asl').forEach(l=>{
const href=l.getAttribute('href');
if(href&&(location.pathname===href||location.pathname.startsWith(href.replace(/\/[^/]+$/,'/')+'/')&&href!='/admin/'))
l.classList.add('on');
if(location.pathname===href)l.classList.add('on');
});