// Simple hash router + sidebar highlighting. const App = { routes: { projects: ProjectsView, tickets: TicketsView }, start() { window.addEventListener('hashchange', () => this.route()); this.route(); }, currentView() { const hash = location.hash.replace(/^#\//, '') || 'projects'; return this.routes[hash] ? hash : 'projects'; }, route() { const view = this.currentView(); document.querySelectorAll('.side-item').forEach((a) => a.classList.toggle('active', a.dataset.view === view) ); const app = document.getElementById('app'); this.routes[view].render(app); } }; document.addEventListener('DOMContentLoaded', () => App.start());