Skip to content

Commit

Permalink
Update dark mode styles and toggle functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Arihant25 committed Feb 4, 2024
1 parent cfbb906 commit c5af3fb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 6 additions & 2 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ body.dark-mode nav>ul>a {
}

body.dark-mode #hero {
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/img/header.jpg');
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../img/header-dark.jpg');
border-radius: 8px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);

Expand All @@ -514,8 +514,12 @@ body.dark-mode #hero {
text-align: center;
}

body.dark-mode h2 {
color: #faa1f5;
}

body.dark-mode #hero:hover {
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/img/header.gif');
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../img/header-dark.gif');
border-radius: 8px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);

Expand Down
Binary file added img/header-dark.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/header-dark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,5 @@ document.getElementById('menu-button').addEventListener('click', function () {

// Dark mode
document.getElementById('dark-mode-toggle').addEventListener('change', function () {
if (this.checked) {
document.body.classList.add('dark-mode');
} else {
document.body.classList.remove('dark-mode');
}
document.body.classList.toggle('dark-mode');
});

0 comments on commit c5af3fb

Please sign in to comment.