Skip to content

Commit

Permalink
Merge pull request #32 from aaron-jacob/aaron
Browse files Browse the repository at this point in the history
Changed background image for light theme
  • Loading branch information
ShekharHans authored Oct 12, 2023
2 parents 31d3079 + cc14f6f commit c13be4d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h3>Coding Community of MSIT</h3>
</div>
</div>
</div>
<img src="./public/background.png" alt="" class="background" />
<img id="bgimage" src="./public/background.png" alt="" class="background" />
</div>
<!-- image gallery -->
<div class="page photo-gallery-page">
Expand Down
9 changes: 9 additions & 0 deletions js/toggle-theme.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
const imageElement = document.getElementById("bgimage");
let isImage1 = true;

var theme=document.getElementById("change-theme");
theme.onclick=function(){
document.body.classList.toggle("light-theme");
if (isImage1) {
imageElement.src = "./public/lightbg.png";
} else {
imageElement.src = "./public/background.png";
}
isImage1 = !isImage1;
}
Binary file added public/lightbg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c13be4d

Please sign in to comment.