-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#7 Helaas niet aan de darkmode toegekomen op een kleine body verandering na dan. Wel scroll animations gemaakt!
- Loading branch information
Showing
3 changed files
with
199 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
const clicking = document.querySelector('.breadandbutter') | ||
const observer = new IntersectionObserver((entries) => { | ||
entries.forEach((entry) => { | ||
console.log(entry) | ||
if (entry.isIntersecting) { | ||
entry.target.classList.add('show'); | ||
} | ||
else { | ||
entry.target.classList.remove('show'); | ||
} | ||
}); | ||
}); | ||
|
||
const hiddenElements = document.querySelectorAll('.hidden') | ||
hiddenElements.forEach((el) => observer.observe(el)); | ||
|
||
|
||
const pagebody = document.getElementsByTagName('body')[0]; | ||
const togglebtn = document.getElementById('theme'); | ||
const pageSection = document.getElementsByTagName('section')[0]; | ||
|
||
togglebtn.addEventListener('click', (e) => { | ||
pagebody.classList.toggle('lightmode'); | ||
pageSection.classList.toggle('lightmode'); | ||
}) | ||
|
||
|
||
// turning bread and butter | ||
|
||
|
||
// scroll CSS animation | ||
|
||
clicking.addEventListener('click', function(){ | ||
turn.classList.add('turning'); | ||
}); |
Oops, something went wrong.