This commit is contained in:
2025-12-04 22:33:05 +01:00
parent 316175e158
commit 9dee06cdd6
145 changed files with 16865 additions and 88 deletions

View File

@@ -0,0 +1,11 @@
export function initTabs(){
const tabs=document.querySelectorAll('nav [data-tab]'); if(!tabs.length) return;
const views={ templates:document.getElementById('view-templates'), sections:document.getElementById('view-sections'), blocks:document.getElementById('view-blocks'), snippets:document.getElementById('view-snippets') };
tabs.forEach(btn=>btn.addEventListener('click',()=>{
tabs.forEach(b=>b.classList.remove('bg-sky-50','text-sky-700'));
btn.classList.add('bg-sky-50','text-sky-700');
document.querySelectorAll('.view').forEach(v=>v.classList.add('hidden'));
const tab=btn.dataset.tab; views[tab]?.classList.remove('hidden');
window.loadList && window.loadList(tab);
}));
}