/******************************************* * main.js *******************************************/ // This file ties everything together once the page loads. window.addEventListener("load", () => { // 1) Initialize Admin user in localStorage (Opulentissimus) initializeAdmin(); // 2) Initialize Leaderboard state initializeLeaderboard(); // 3) Show the Home section by default showSection("home"); // 4) Update the profile UI and auth button states updateProfileUI(); toggleHomeAuthSection(); updateAuthButton(); // 5) Initialize the Admin Leaderboard toggle button initializeAdminLeaderboardToggle(); // 6) If user is already logged in AND is the admin, load admin dashboard if (isLoggedIn() && getCurrentUsername() === "Opulentissimus") { initializeAdminDashboard(); } // You can add any other final “on load” tasks here if needed. });