Skip to content

Instantly share code, notes, and snippets.

View mahdi8708's full-sized avatar

mahdi8708

  • Joined Nov 2, 2025
View GitHub Profile
@mahdi8708
mahdi8708 / App js
Created November 2, 2025 09:10
Game
// Basic client-side routing, page switching, settings storage, and leaderboard rendering
(function(){
const pages = document.querySelectorAll('.page');
const navBtns = document.querySelectorAll('.nav-btn');
function showPage(id){
pages.forEach(p => p.id === id ? p.classList.add('active') : p.classList.remove('active'));
navBtns.forEach(b => b.dataset.route === id ? b.classList.add('active') : b.classList.remove('active'));
}