@@ -12,6 +12,7 @@ const leaderboardSection = document.getElementById('leaderboard-section');
1212const leaderboardList = document . getElementById ( 'leaderboard' ) ;
1313const secretsBtn = document . getElementById ( 'secrets-btn' ) ;
1414const passwordSection = document . getElementById ( 'password-section' ) ;
15+ const secretsSection = document . getElementById ( 'secrets-section' ) ;
1516const passwordInput = document . getElementById ( 'password-input' ) ;
1617const submitPasswordBtn = document . getElementById ( 'submit-password' ) ;
1718const 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