-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme-mode.js
33 lines (33 loc) · 1.41 KB
/
theme-mode.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
25
26
27
28
29
30
31
32
33
document.addEventListener('DOMContentLoaded', () => {
const body = document.querySelector('body');
const inputs = document.querySelectorAll('input');
const containers = document.querySelectorAll('.container');
const dropdown = document.querySelector('.dropdown-menu');
const ulss = document.querySelectorAll('li.list-group-item.d-flex.justify-content-between.align-items-start');
const navBar = document.querySelector('body>nav');
const aas = document.querySelectorAll('body div.container-fluid a, form>button.nav-link.btn.btn-link.py-0').forEach(a => {
a.classList.toggle('text-light');
});
const toggle = document.getElementById('toggle');
toggle.onclick = function () {
toggle.classList.toggle('active');
body.classList.toggle('active');
containers.forEach(e => {
e.classList.toggle('active');
//let children = e.children;
//for (let i = 0; i < children.length; i++) {
// children[i].classList.toggle('active');
});
dropdown.classList.toggle('bg-dark');
dropdown.querySelectorAll('a').forEach(a => {
a.classList.toggle('text-dark');
});
navBar.classList.toggle('bg-opacity-25');
inputs.forEach(i => {
i.classList.toggle('bg-black');
});
ulss.forEach(li => {
li.classList.toggle('bg-dark');
});
};
});