-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
24 lines (19 loc) · 828 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const toggleSwitch = document.querySelector('.toggle_theme');
const switchInput = document.querySelector('.switch');
const body = document.querySelector('body');
const titleOne = document.querySelector('.title');
const titleTwo = document.querySelector('.active_title');
const cardOne = document.querySelector('.social_proof_cards');
const cardTwo = document.querySelector('.social_today_stats');
const footer = document.querySelector('footer')
toggleSwitch.addEventListener('change', toggleTheme)
function toggleTheme () {
switchInput.classList.toggle('toggle');
switchInput.classList.toggle('dark');
body.classList.toggle('dark');
titleOne.classList.toggle('dark');
titleTwo.classList.toggle('dark');
cardOne.classList.toggle('dark');
cardTwo.classList.toggle('dark');
footer.classList.toggle('dark');
}