From 9745a231b5eec37bc1a22feaa9d909b64b408af4 Mon Sep 17 00:00:00 2001 From: siddartha Date: Thu, 10 Oct 2024 18:21:56 +0530 Subject: [PATCH] Given functionality of sidebar --- script.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/script.js b/script.js index 2cd7df86..d4927b2b 100644 --- a/script.js +++ b/script.js @@ -65,5 +65,22 @@ window.onload = () => { themeToggle.checked = true; } }; +// Toggle the sidebar visibility +function toggleSidebar() { + const sidebar = document.querySelector('.social-sidebar'); + const toggleArrow = document.querySelector('.toggle-arrow'); + + // Check if the sidebar is currently visible + if (sidebar.style.display === "none") { + // If hidden, show the sidebar and hide the toggle arrow + sidebar.style.display = "block"; + toggleArrow.style.display = "none"; + } else { + // If visible, hide the sidebar and show the toggle arrow + sidebar.style.display = "none"; + toggleArrow.style.display = "block"; + } +} +