-
MathPyLearn
- -
-
-
-
-
-
-
diff --git a/script.js b/script.js
index b06a704..c885c65 100644
--- a/script.js
+++ b/script.js
@@ -659,14 +659,6 @@ 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');
@@ -681,6 +673,38 @@ document.addEventListener("DOMContentLoaded", () => {
updateProgressBar();
});
+function checkWindowSize() {
+ const navLinks = document.querySelector('.nav-links');
+ const icon = document.querySelector('.icon');
+
+ if (window.innerWidth > 992) {
+ navLinks.style.display = 'flex';
+ icon.style.display = 'none';
+ } else {
+ navLinks.style.display = 'none';
+ icon.style.display = 'block';
+ }
+}
+
+window.addEventListener('resize', checkWindowSize);
+// window.addEventListener('load', checkWindowSize);
+
+function openMobileMenu() {
+ const navLinks = document.querySelector('.nav-links');
+ const menuIcon = document.querySelector(".fa-bars");
+ const closeIcon = document.querySelector(".fa-times");
+
+ if (navLinks.style.display === "flex") {
+ navLinks.style.display = "none";
+ menuIcon.style.display = 'inline-block';
+ closeIcon.style.display = 'none';
+ } else {
+ navLinks.style.display = "flex";
+ menuIcon.style.display = 'none';
+ closeIcon.style.display = 'inline-block';
+ }
+}
+
//This function should check currentContentType to decide how to reset the editor.
function resetEditor() {
// Check the type of content currently loaded
diff --git a/styles.css b/styles.css
index 94c3339..3c41d75 100644
--- a/styles.css
+++ b/styles.css
@@ -23,6 +23,7 @@ body {
position: sticky;
top: 0;
z-index: 1000;
+ gap: 10px;
}
.navbar .nav-links {
@@ -54,10 +55,10 @@ body {
margin-right: 7px;
}
-.navbar a {
- width: 7em;
+.navbar .nav-links a {
+ width: 5.5em;
position: relative;
- height: 3.5em;
+ height: 2.2em;
border: 3px ridge #149CEA;
outline: none;
background-color: transparent;