console.log('HydroFlux Initialized'); // Simple Navigation Logic // Simple Navigation Logic - REPLACED BY NEW BLOCK BELOW // Initialize Modules import { WaterTracker } from './modules/water.js'; import { StreakTracker } from './modules/streak.js'; import { FitnessDashboard } from './modules/fitness.js'; import { StatsDashboard } from './modules/stats.js'; import { GoalsTracker } from './modules/goals.js'; const waterTracker = new WaterTracker('water-section'); const streakTracker = new StreakTracker('streak-section'); const fitnessDashboard = new FitnessDashboard('fitness-section'); const statsDashboard = new StatsDashboard('stats-section'); const goalsTracker = new GoalsTracker('goals-section'); // Navigation Logic with Auto-Refresh document.querySelectorAll('.nav-btn').forEach(btn => { btn.addEventListener('click', (e) => { // Toggle Active State document.querySelectorAll('.nav-btn').forEach(b => b.classList.remove('active')); e.currentTarget.classList.add('active'); const view = e.currentTarget.dataset.view; // Hide all sections document.querySelectorAll('section').forEach(el => el.style.display = 'none'); // Show target section const target = document.getElementById(`${view}-section`); if (target) { target.style.display = 'block'; // Auto-Refresh Stats when viewing if (view === 'stats') { statsDashboard.update(); } } }); });