Skip to content

Commit

Permalink
Final before submmission
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashi committed Aug 4, 2024
1 parent 2299c32 commit b30cc42
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Html-files/RateUs.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<div class="order-0 ml-auto p-2">
<img
class="nav-link"
src="../Images/navbar/sun.png"
src="../Images/navbar/moon.png"
id="theme-toggle-icon"
alt="theme toggler button"
/>
Expand Down
2 changes: 1 addition & 1 deletion Html-files/cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
</ul>
</div>
<div class="order-0 ml-auto p-2">
<img class="nav-link" src="../Images/navbar/sun.png" id="theme-toggle-icon" alt="theme toggler button">
<img class="nav-link" src="../Images/navbar/moon.png" id="theme-toggle-icon" alt="theme toggler button">
</div>
<div class="collapse navbar-collapse hamburgeritems enddiv order-3 ">
<ul class="navbar-nav end-links">
Expand Down
2 changes: 1 addition & 1 deletion Html-files/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
<div class="order-0 ml-auto p-2">
<img
class="nav-link"
src="../Images/navbar/sun.png"
src="../Images/navbar/moon.png"
id="theme-toggle-icon"
alt="theme toggler button"
/>
Expand Down
2 changes: 1 addition & 1 deletion Html-files/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
</ul>
</div>
<div class="order-0 ml-auto p-2">
<img class="nav-link" src="../Images/navbar/sun.png" id="theme-toggle-icon" alt="theme toggler button">
<img class="nav-link" src="../Images/navbar/moon.png" id="theme-toggle-icon" alt="theme toggler button">
</div>
<div class="collapse navbar-collapse hamburgeritems enddiv order-3 ">
<ul class="navbar-nav end-links">
Expand Down
2 changes: 1 addition & 1 deletion Html-files/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
</ul>
</div>
<div class="order-0 ml-auto p-2">
<img class="nav-link" src="../Images/navbar/sun.png" id="theme-toggle-icon" alt="theme toggler button">
<img class="nav-link" src="../Images/navbar/moon.png" id="theme-toggle-icon" alt="theme toggler button">
</div>
<div class="collapse navbar-collapse hamburgeritems enddiv order-3">
<ul class="navbar-nav end-links">
Expand Down
4 changes: 2 additions & 2 deletions Html-files/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ themeToggleIcon.addEventListener("click", function () {
document.body.classList.toggle("dark-theme");
document.body.classList.toggle(":root")
if (document.body.classList.contains("dark-theme")) {
themeToggleIcon.src = "Images/navbar/sun.png";
themeToggleIcon.src = "../Images/navbar/sun.png";
themeToggleLogo.src = "Images/logo/Logo-Dark.png";
} else {
themeToggleIcon.src = "Images/navbar/moon.png";
themeToggleIcon.src = "../Images/navbar/moon.png";
themeToggleLogo.src="Images/logo/Logo-Light.png";
}
});
Expand Down
2 changes: 1 addition & 1 deletion Html-files/offers.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
<div class="order-0 ml-auto p-2">
<img
class="nav-link"
src="../Images/navbar/sun.png"
src="../Images/navbar/moon.png"
id="theme-toggle-icon"
alt="theme toggler button"
/>
Expand Down
2 changes: 1 addition & 1 deletion Html-files/services.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
</ul>
</div>
<div class="order-0 ml-auto p-2">
<img class="nav-link" src="../Images/navbar/sun.png" id="theme-toggle-icon" alt="theme toggler button" />
<img class="nav-link" src="../Images/navbar/moon.png" id="theme-toggle-icon" alt="theme toggler button" />
</div>
<div class="collapse navbar-collapse hamburgeritems enddiv order-3">
<ul class="navbar-nav end-links">
Expand Down
2 changes: 1 addition & 1 deletion Html-files/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
</ul>
</div>
<div class="order-0 ml-auto p-2">
<img class="nav-link" src="../Images/navbar/sun.png" id="theme-toggle-icon" alt="theme toggler button">
<img class="nav-link" src="../Images/navbar/moon.png" id="theme-toggle-icon" alt="theme toggler button">
</div>
<div class="collapse navbar-collapse hamburgeritems enddiv order-3 ">
<ul class="navbar-nav end-links">
Expand Down
14 changes: 14 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,17 @@ function displayVisitorCount() {
}
document.addEventListener('DOMContentLoaded', displayVisitorCount);

//Themechange icon toggling behaviour
let themeToggleIcon = document.getElementById("theme-toggle-icon");
let themeToggleLogo = document.getElementById("theme-toggle-logo");
themeToggleIcon.addEventListener("click", function () {
document.body.classList.toggle("dark-theme");
document.body.classList.toggle(":root")
if (document.body.classList.contains("dark-theme")) {
themeToggleIcon.src = "Images/navbar/sun.png";
themeToggleLogo.src = "Images/logo/Logo-Dark.png";
} else {
themeToggleIcon.src = "Images/navbar/moon.png";
themeToggleLogo.src="Images/logo/Logo-Light.png";
}
});

0 comments on commit b30cc42

Please sign in to comment.