Initial scaffold: FastAPI server, responsive UI shell
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// Command Center SPA Router
|
||||
const sections = document.querySelectorAll('.panel');
|
||||
const links = document.querySelectorAll('.nav-links a');
|
||||
|
||||
function navigate(hash) {
|
||||
const target = hash.replace('#', '') || 'agents';
|
||||
sections.forEach(s => s.hidden = s.id !== target);
|
||||
links.forEach(l => l.classList.toggle('active', l.getAttribute('href') === '#' + target));
|
||||
}
|
||||
|
||||
links.forEach(l => l.addEventListener('click', e => {
|
||||
e.preventDefault();
|
||||
window.location.hash = l.getAttribute('href');
|
||||
}));
|
||||
|
||||
window.addEventListener('hashchange', () => navigate(window.location.hash));
|
||||
navigate(window.location.hash || '#agents');
|
||||
Reference in New Issue
Block a user