diff --git a/index.html b/index.html index 9d14253..1cc75c9 100644 --- a/index.html +++ b/index.html @@ -277,48 +277,48 @@ @@ -365,8 +365,11 @@ - +
+ + +
@@ -821,7 +824,608 @@

Desert Sunset Run

-
+ + + + + + + + + + + + + + + + + + + + + + + + +
@@ -942,15 +1546,73 @@

Desert Sunset Run

}); }); - // Sidebar nav item active state - const navItems = document.querySelectorAll('.nav-item'); - - navItems.forEach(item => { - item.addEventListener('click', () => { - navItems.forEach(i => i.classList.remove('active')); - item.classList.add('active'); + // Tab switching functions + function hideAllTabs() { + const tabContents = document.querySelectorAll('.tab-content'); + tabContents.forEach(content => { + content.style.display = 'none'; }); - }); + } + + function setActiveNavItem(activeButton) { + const navItems = document.querySelectorAll('.nav-item'); + navItems.forEach(item => item.classList.remove('active')); + activeButton.classList.add('active'); + } + + function showDashboardTab() { + hideAllTabs(); + document.getElementById('dashboard-content').style.display = 'block'; + setActiveNavItem(event.target); + } + + function showMyRoutesTab() { + hideAllTabs(); + document.getElementById('myroutes-content').style.display = 'block'; + setActiveNavItem(event.target); + } + + function showRoutePlannerTab() { + hideAllTabs(); + document.getElementById('routeplanner-content').style.display = 'block'; + setActiveNavItem(event.target); + } + + function showCommunityTab() { + hideAllTabs(); + document.getElementById('community-content').style.display = 'block'; + setActiveNavItem(event.target); + } + + function showEventsTab() { + hideAllTabs(); + document.getElementById('events-content').style.display = 'block'; + setActiveNavItem(event.target); + } + + function showGalleryTab() { + hideAllTabs(); + document.getElementById('gallery-content').style.display = 'block'; + setActiveNavItem(event.target); + } + + function showSettingsTab() { + hideAllTabs(); + document.getElementById('settings-content').style.display = 'block'; + setActiveNavItem(event.target); + } + + function showSafetyTab() { + hideAllTabs(); + document.getElementById('safety-content').style.display = 'block'; + setActiveNavItem(event.target); + } + + function confirmLogout() { + if (confirm('Are you sure you want to logout?')) { + alert('Logout functionality would be implemented here'); + } + } - \ No newline at end of file +