Skip to content

Commit 2d9b147

Browse files
committed
add the Dark theme
1 parent dbb6ca3 commit 2d9b147

File tree

7 files changed

+443
-57
lines changed

7 files changed

+443
-57
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
## Sign In & Sign Up Form with Bootstrap 5 & JavaScript
22
a hybrid Login & Sign Up form using HTML, CSS, JavaScript🤩 & Bootstrap 5. This is all very easy to do 👌🏼👌🏼, and it's all done without a library or framework!⌨️🔶
3+
![login and sign Up image](https://github.com/Bahadou-Badr/Todo-List-Vanilla-Javascript-/blob/master/images/capture.gif)

img/capture.gif

323 KB
Loading

index.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414

1515
<div class="col-md-6">
1616
<form action="" id="sign-up">
17-
<div class="card px-5 py-5"> <span class="circle"><i class="fa fa-check"></i></span>
18-
<h5 class="mt-3">Join over 25 million <br> learners from around the globe</h5> <small class="mt-2 text-muted">Master the languages of the web: HTML, CSS and javascript. This path will prepare you to build basic websites and then build interactive web apps</small>
19-
<div class="form-input"> <i class="fa fa-envelope"></i> <input type="email" class="form-control" placeholder="Email address" required> </div>
20-
<div class="form-input"> <i class="fa fa-user"></i> <input type="text" class="form-control" placeholder="User name" required> </div>
17+
<div class="card px-5 py-5">
18+
<div class="swith-mode"><input id="switch" type="checkbox" class="switch mr-2" onclick="applyTheme()"><label for="switch">Light Mode</label></div>
19+
<h5 class="mt-3">Sign Up</h5> <small class="mt-2 text-muted">Lorem ipsum dolor sit amet consectetur adipisicing elit. Autem tempore ab provident iusto animi,</small>
20+
<div class="form-input"> <i class="fa fa-envelope"></i> <input type="email" class="form-control" placeholder="Email address" required> </div>
21+
<div class="form-input"> <i class="fa fa-user"></i> <input type="text" class="form-control" placeholder="User name" required> </div>
2122
<div class="form-input"> <i class="fa fa-lock"></i> <input type="password" class="form-control" placeholder="password" required> </div>
2223
<div class="form-check"> <input class="form-check-input" type="checkbox" value="" id="flexCheckChecked" checked> <label class="form-check-label" for="flexCheckChecked"> I agree all the statements </label> </div> <button class="btn btn-primary mt-4 signup">Start coding now</button>
2324
<div class="text-center mt-3"> <span>Or continue with these social profile</span> </div>
@@ -28,7 +29,8 @@ <h5 class="mt-3">Join over 25 million <br> learners from around the globe</h5> <
2829

2930
<form class="form-hidden" action="" id="login">
3031
<div class="card px-5 py-5"> <span class="circle"><i class="fa fa-check"></i></span>
31-
<h5 class="mt-3">Join over 25 million <br> learners from around the globe</h5> <small class="mt-2 text-muted">Master the languages of the web: HTML, CSS and javascript. This path will prepare you to build basic websites and then build interactive web apps</small>
32+
<!-- <div class="swith-mode"><input id="s2" type="checkbox" class="switch mr-2 " onclick="applyTheme()"><label for="s2">Light Mode</label></div> -->
33+
<h5 class="mt-3">Sign In</h5> <small class="mt-2 text-muted">Lorem ipsum dolor sit amet consectetur adipisicing elit. Autem tempore ab provident iusto animi,</small>
3234
<div class="form-input"> <i class="fa fa-envelope"></i> <input type="email" class="form-control" placeholder="Email address" required> </div>
3335
<div class="form-input"> <i class="fa fa-lock"></i> <input type="password" class="form-control" placeholder="password" required> </div>
3436
<button class="btn btn-primary mt-4 signup">Start coding now</button>

script.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,21 @@ document.addEventListener('DOMContentLoaded', () => {
1515
loginForm.classList.add("form-hidden");
1616
signUpForm.classList.remove("form-hidden");
1717
});
18-
})
18+
})
19+
20+
//Apply Theme - dark and light//
21+
function applyTheme(){
22+
const checkBox = document.querySelector('.switch');
23+
const itemLight = document.querySelectorAll('.card, .form-control, .social');
24+
25+
if (checkBox.checked == true) {
26+
itemLight.forEach(e => {
27+
e.classList.add('light');
28+
})
29+
}
30+
else {
31+
itemLight.forEach(e => {
32+
e.classList.remove('light');
33+
})
34+
}
35+
}

style.css

Lines changed: 186 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

style.css.map

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)