Home
About
Learn
diff --git a/script.js b/script.js
index 4274760..019b18a 100644
--- a/script.js
+++ b/script.js
@@ -500,6 +500,30 @@ document.addEventListener('DOMContentLoaded', function() {
});
+document.addEventListener("DOMContentLoaded", () => {
+ const hamburger = document.getElementById("hamburger");
+ const navLinks = document.getElementById("nav-links");
+
+
+hamburger.addEventListener("click", () => {
+ navLinks.classList.toggle("show");
+ });
+
+ const lessonResetBtn = document.getElementById('lesson-reset-btn');
+ const challengeResetBtn = document.getElementById('challenge-reset-btn');
+
+ if (lessonResetBtn) {
+ lessonResetBtn.addEventListener('click', () => resetProgress('lesson'));
+ }
+
+ if (challengeResetBtn) {
+ challengeResetBtn.addEventListener('click', () => resetProgress('challenge'));
+ }
+
+ updateProgressBar();
+});
+
+
// Reset button
document.getElementById('reset-code').addEventListener('click', () => {
if (currentLesson) {
@@ -507,7 +531,6 @@ document.getElementById('reset-code').addEventListener('click', () => {
}
});
-
document.getElementById('copy-code').addEventListener('click', () => {
const code = editor.getValue();
navigator.clipboard.writeText(code)
@@ -523,21 +546,3 @@ document.getElementById('copy-code').addEventListener('click', () => {
});
});
-// Add this to your DOMContentLoaded event listener
-document.addEventListener('DOMContentLoaded', () => {
- // ... existing code ...
-
- const lessonResetBtn = document.getElementById('lesson-reset-btn');
- const challengeResetBtn = document.getElementById('challenge-reset-btn');
-
- if (lessonResetBtn) {
- lessonResetBtn.addEventListener('click', () => resetProgress('lesson'));
- }
-
- if (challengeResetBtn) {
- challengeResetBtn.addEventListener('click', () => resetProgress('challenge'));
- }
-
- updateProgressBar();
-});
-