Skip to content

Commit

Permalink
Dark-mode fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sau-mili committed Aug 4, 2024
1 parent b6dc0d0 commit 2a13349
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
8 changes: 4 additions & 4 deletions css/feedback.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ body {
font-size: 40px;
margin-bottom: 30px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
/* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); */
transition: box-shadow 0.3s ease;
}

.rating-container:hover {
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
/* box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); */
}

.rating-container button {
Expand Down Expand Up @@ -483,8 +483,8 @@ body.dark-mode .rate-us {

body.dark-mode .rating-container button {
color: #555555;
background-color: #888;
border: 1px solid #888;
/* background-color: #888; */
/* border: 1px solid #888; */
}

body.dark-mode .rating-container button.filled {
Expand Down
35 changes: 35 additions & 0 deletions feedback.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,40 @@ <h2>Thank you for your Feedback!🧡</h2>


</script>

<script>
document.addEventListener('DOMContentLoaded', function () {

const toggleButton = document.getElementById('checkbox');

const currentMode = localStorage.getItem('dark-mode');

if (currentMode === 'enabled') {

document.body.classList.add('dark-mode');

toggleButton.checked = true;

}

toggleButton.addEventListener('change', function () {

document.body.classList.toggle('dark-mode');

if (document.body.classList.contains('dark-mode')) {

localStorage.setItem('dark-mode', 'enabled');

}
else {

localStorage.setItem('dark-mode', 'disabled');

}
});

});
</script>

</body>
</html>

0 comments on commit 2a13349

Please sign in to comment.