Skip to content

Commit

Permalink
Dark mode functionality is corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-singhhh committed Oct 8, 2024
1 parent dc4f379 commit ab66446
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,6 @@
</div>
</header>



<div class="content" id="main-content" >
<h1>Welcome to the Ambulance Monitoring System</h1>
<div class="grid">
Expand Down Expand Up @@ -702,7 +700,7 @@ <h3 style="font-size: 1.5rem; margin-bottom: 10px; color: #2980b9;">Subscribe to
"></button>
</div>
</footer>

<script>
// Back to Top Button functionality
document.addEventListener('DOMContentLoaded', function() {
Expand Down Expand Up @@ -794,3 +792,19 @@ <h3 style="font-size: 1.5rem; margin-bottom: 10px; color: #2980b9;">Subscribe to
});
});
</script>

<script>
// Dark Mode Funcationality
const darkModeButton = document.getElementById('dark-mode-button');

// Add event listener for toggle functionality
darkModeButton.addEventListener('click', () => {
document.body.classList.toggle('dark-mode'); // Toggle dark mode

// Toggle icon between moon and sun
const icon = darkModeButton.querySelector('i');
icon.classList.toggle('fa-moon');
icon.classList.toggle('fa-sun');
});
</script>

0 comments on commit ab66446

Please sign in to comment.