Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Refactor theme toggle logic and update styles #718

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ themeToggle.addEventListener("change", () => {
if (document.body.classList.contains("dark-theme")) {
themeLabel.style.background = "#fff"; // Adjust color for the checked state as needed
console.log("Dark theme");
document.body.classList.remove("dark-theme");
document.body.classList.add("light-theme");
} else {
themeLabel.style.background = "var(--primary-color)"; // Adjust color for the unchecked state as needed
console.log("Light theme");
document.body.classList.remove("light-theme");
document.body.classList.add("dark-theme");
}
});
49 changes: 44 additions & 5 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,21 @@ body {
text-decoration: none;
white-space: nowrap;
}
body.dark-theme #send:hover {
background: linear-gradient(135deg, #f1879a, #c14e35);
color: white;
}
body.dark-theme #send {
background-color: #141e36;
border: 0.0001px solid red;
color: slateblue;
}
#send:hover{
background-color: slateblue;
border-color: slateblue;
color: #fff;

}
#send.focused {
background-color: slateblue;
border-color: slateblue;
Expand Down Expand Up @@ -1135,26 +1149,51 @@ header {
display: flex;
align-items: center;
justify-content: center;

}

.subscribe__form form {
width: 100%;
max-width: 400px;
display: flex;
background-color: var(--extra-light);
box-shadow: 5px 5px 30px rgba(0, 0, 0, 0.1);
box-shadow: 3px 3px 30px slateblue;
border-radius: 5rem;
overflow: hidden;
border: 0.001px solid gray;
}
body.dark-theme .subscribe__form form {
width: 100%;
max-width: 400px;
display: flex;
/* background-color: var(--extra-light); */
box-shadow: 5px 5px 30px rgba(162, 136, 248, 0.964);
border-radius: 5rem;
overflow: hidden;
border: 0.000001px solid var(--text-light);
/* color: white; */

}

.subscribe__form input {
width: 100%;
padding: 1rem;
outline: none;
border: none;
border-radius: 5rem;
/* border-radius: 5rem; */
font-size: 1rem;
}

body.light-theme #emailInput {
background-color: white;
color: black;
}


body.dark-theme #emailInput {
background-color: #222f4b;
color:white ;
}

.footer {
width: 100%;
background-color: #091020;
Expand All @@ -1166,7 +1205,7 @@ header {
justify-content: space-evenly;
align-items: flex-start;

/grid-template-columns: repeat(3, 1fr);/ gap: 24px;
/* /grid-template-columns: repeat(3, 1fr);/ gap: 24px; */

color: var(--secondary-color);
}
Expand Down Expand Up @@ -1316,7 +1355,7 @@ header {
background-color: #0056b3;
}

/contact section overlapping with nav fixed/
/* /contact section overlapping with nav fixed/ */
/* #contact {
padding-top: 100px;
}
Expand Down