diff --git a/Website/css/styles.css b/Website/css/styles.css index 3c0b024ce..102adcb84 100644 --- a/Website/css/styles.css +++ b/Website/css/styles.css @@ -1401,7 +1401,6 @@ h1 { .code-of-conduct-button a:hover { background-color: #0acbf7; } -======= /* Section Styles */ .github-section { diff --git a/Website/index.html b/Website/index.html index 8a6e7d5b6..0e15f7880 100644 --- a/Website/index.html +++ b/Website/index.html @@ -94,7 +94,7 @@
  • -
  • diff --git a/Website/js/script.js b/Website/js/script.js index 7627fc36f..44388d500 100644 --- a/Website/js/script.js +++ b/Website/js/script.js @@ -362,7 +362,7 @@ if (savedTheme) { applyTheme('light'); } -toggleDarkModeButton.addEventListener('click', () => { +function toggleTheme(){ body.classList.toggle('dark-mode'); const icon = toggleDarkModeButton.querySelector('i'); @@ -379,7 +379,17 @@ toggleDarkModeButton.addEventListener('click', () => { // saving the theme=light in localStorage localStorage.setItem('theme', 'light'); } +} +toggleDarkModeButton.addEventListener('click', toggleTheme); + +document.addEventListener('keydown', function (event) { + // Check if the 'Q' key is pressed along with the 'Ctrl' key + if (event.ctrlKey && (event.key === 'q' || event.key === 'Q')) { + event.preventDefault(); // Prevent the default action (if any) + toggleTheme(); // Call the function to toggle the theme + } }); + function hamburger() { const line = document.getElementById("line"); const navLinks = document.querySelector(".nav-links");