diff --git a/dark.js b/dark.js index 0832679..dbadec1 100644 --- a/dark.js +++ b/dark.js @@ -36,53 +36,3 @@ function handleCLick(){ // console.log(darkMode); } - -let darkMode = false; -var dark = document.getElementById("dark"); -var moon = document.getElementById("moon"); -var sun = document.getElementById("sun"); -var nav = document.getElementById("nav"); -var body = document.getElementById("body"); - - -dark.addEventListener('click', handleCLick) - -function handleCLick() { - if (darkMode === false) { - darkMode = true; - moon.style.visibility = "hidden"; - sun.style.visibility = "visible"; - dark.style.backgroundColor = "white"; - body.style.backgroundColor = "#414758" - nav.style.backgroundColor = "#28292e" - } - else { - darkMode = false; - dark.style.backgroundColor = "#2e2f30"; - body.style.backgroundColor = "#eee" - sun.style.visibility = "hidden"; - moon.style.visibility = "visible"; - nav.style.backgroundColor = "#dcdee6"; - - } -} -// function handleClick(){ -// darkMode=true -// console.log(darkMode) -// } - -// Code for sticky navbar -window.onscroll = function() {myNav()}; - -var navbar = document.getElementById("nav"); - -var sticky = navbar.offsetTop; - -// Add the sticky class to the navbar when you reach its scroll position. Remove "sticky" when you leave the scroll position -function myNav() { - if (window.pageYOffset >= sticky) { - navbar.classList.add("sticky") - } else { - navbar.classList.remove("sticky"); - } -} \ No newline at end of file diff --git a/index.html b/index.html index dfb00ed..90825ff 100644 --- a/index.html +++ b/index.html @@ -1,369 +1,318 @@ - - - - blue-quotes - - + + + + blue-quotes - -