-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
42 lines (24 loc) · 976 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const navTogglerButton = document.querySelector('#navToggler')
const openNavIcon = document.querySelector('#openNav')
const closeNavIcon = document.querySelector('#closeNav')
const mainNavWidget = document.querySelector('#mainNav')
navTogglerButton.addEventListener('click' , function () {
openNavIcon.classList.toggle("hidden")
closeNavIcon.classList.toggle("hidden")
mainNavWidget.classList.toggle("hidden")
})
const toggleDarkmodeButton = pin;
function pin() {
var element = document.body;
element.classList.toggle("dark-mode");
}
let Button = document.querySelector('#settingsButton')
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
Button.style.display = "block";
} else {
Button.style.display = "none";
}
}