Skip to content

Commit d41a67f

Browse files
authored
Update script.js
1 parent 6d65aae commit d41a67f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎script.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const leaderboardSection = document.getElementById('leaderboard-section');
1212
const leaderboardList = document.getElementById('leaderboard');
1313
const secretsBtn = document.getElementById('secrets-btn');
1414
const passwordSection = document.getElementById('password-section');
15+
const secretsSection = document.getElementById('secrets-section');
1516
const passwordInput = document.getElementById('password-input');
1617
const submitPasswordBtn = document.getElementById('submit-password');
1718
const passwordError = document.getElementById('password-error');
@@ -58,7 +59,7 @@ submitPasswordBtn.addEventListener('click', () => {
5859
if (password === '143') {
5960
passwordInput.value = '';
6061
passwordError.classList.add('hidden');
61-
window.location.href = 'secrets.html'; // Redirect to new page
62+
showSection(secretsSection); // Show secrets dashboard
6263
} else {
6364
passwordError.classList.remove('hidden');
6465
passwordInput.value = '';
@@ -75,6 +76,7 @@ function showDashboard() {
7576
gamesSection.classList.add('hidden');
7677
leaderboardSection.classList.add('hidden');
7778
passwordSection.classList.add('hidden');
79+
secretsSection.classList.add('hidden');
7880
dashboardWelcome.textContent = `Hello, ${userName}! Welcome to your dashboard.`;
7981
if (userName.toLowerCase().includes('nisha')) {
8082
nishaQuote.textContent = lovelyQuotes[Math.floor(Math.random() * lovelyQuotes.length)];
@@ -113,6 +115,7 @@ function showSection(section) {
113115
game2.classList.add('hidden');
114116
game3.classList.add('hidden');
115117
passwordSection.classList.add('hidden');
118+
secretsSection.classList.add('hidden');
116119
section.classList.remove('hidden');
117120
}
118121

0 commit comments

Comments
 (0)