Skip to content
Open
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
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v2.1.9/css/unicons.css" />
</head>
<body>
<button class="darkbutton "> Light Mode</button>
<div class="section">
<div class="container">
<div class="row full-height justify-content-center">
Expand Down Expand Up @@ -66,4 +67,5 @@ <h4 class="mb-4 pb-3">Sign Up</h4>
</div>
</div>
</body>
<script src="script.js"></script>
</html>
18 changes: 18 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
let button=document.querySelector(".darkbutton");
const toggleBackground=()=>{

if(button.classList.contains("whitebutton")==false){
button.classList.toggle("whitebutton")
document.body.style.backgroundColor = "white";
button.innerHTML="Dark Mode"
}
else{
button.classList.toggle("whitebutton")
document.body.style.backgroundColor = "#1f2029";
button.innerHTML="Light Mode"
}



}
button.addEventListener("click",toggleBackground);
25 changes: 25 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,31 @@ body {
margin: 0; /* Reset margins */
padding: 0; /* Reset padding */
}
.darkbutton{
color: rgb(0, 0, 0);
border-radius: 25px;
padding: 10px 25px;
background-color: #e7e7e7;
border: 1px solid rgb(0, 0, 0);
transition: 0.2s;




}
.whitebutton{

border-radius: 25px;
padding: 10px 25px;
background-color: #0b0b0b;
color: white;
border: 1px solid rgb(255, 255, 255);
}
.darkbutton:hover{
background-color: rgb(255, 255, 255);
color: black;
border: 1px solid black;
}
a {
cursor: pointer;
transition: color 200ms ease;
Expand Down Expand Up @@ -48,6 +72,7 @@ h6 span {
position: relative;
width: 100%;
display: block;

}

.full-height {
Expand Down