diff --git a/login.html b/login.html index 6fc91b3..b46b8ac 100644 --- a/login.html +++ b/login.html @@ -30,6 +30,13 @@ Submit an image Login + + +
+ About us + Contact us + +
diff --git a/login.js b/login.js index 8eaa727..d42aec5 100644 --- a/login.js +++ b/login.js @@ -51,3 +51,25 @@ document.getElementById("loginForm").addEventListener("submit", function (event) } }); + + +const toggleButton = document.querySelector('.toggle'); +const toggleItems = document.querySelector('.toggle-items'); + +// Toggle menu visibility when the button is clicked +toggleButton.addEventListener('click', (event) => { + toggleItems.classList.toggle('active'); + event.stopPropagation(); // Stop click from propagating +}); + +// Close the menu when clicking outside +document.addEventListener('click', () => { + if (toggleItems.classList.contains('active')) { + toggleItems.classList.remove('active'); + } +}); + +// Prevent menu clicks from closing it +toggleItems.addEventListener('click', (event) => { + event.stopPropagation(); +});