Portfolio design v3 added

This commit is contained in:
BenjaminToby
2021-06-09 05:41:48 +01:00
parent 87d3205297
commit 57af43f6f2
8 changed files with 661 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
var headerController = document.querySelector("#header-controller");
var windowRect = {
rootMargin: "0px",
};
var headerObserver = new IntersectionObserver(changeHeader, windowRect);
function changeHeader(entry) {
if(entry[0].isIntersecting) {
document.querySelector("header").className = "none";
document.querySelector("header img").style.width = "40px";
document.querySelector("header img").style.top = "0px";
document.querySelector("header > a > div").classList.remove("logo-text-dissapear");
} else {
document.querySelector("header").classList.add("scrolled");
document.querySelector("header img").style.width = "60px";
document.querySelector("header img").style.top = "20px";
document.querySelector("header > a > div").classList.add("logo-text-dissapear");
}
}
headerObserver.observe(headerController);