restyled navbar

This commit is contained in:
2021-09-29 18:10:44 -04:00
parent 222a8f282b
commit 31651fa18d
8 changed files with 57 additions and 58 deletions

View File

@@ -3,13 +3,13 @@ window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 80 || document.documentElement.scrollTop > 80) {
document.querySelector('.header').style.backgroundColor = '#1a1a1a';
document.querySelector('.header > a > h1').style.fontSize = "2rem";
document.querySelector('.header > a > h1').style.fontSize = "1.5rem";
// document.querySelector('.header > h1').style.color = "#a8a8a8";
document.querySelectorAll('.navBar > li').forEach(x => {x.style.paddingTop = '0rem'; x.style.paddingBottom = '0rem'});
document.querySelectorAll('.navElement').forEach(x => {x.style.paddingTop = '.3rem'; x.style.paddingBottom = '.3rem'; x.style.fontSize='1rem'});
} else {
document.querySelector('.header').style.backgroundColor = 'rgba(0,0,0,0)';
document.querySelector('.header > a > h1').style.fontSize = "2.5rem";
document.querySelector('.header > a > h1').style.fontSize = "2rem";
// document.querySelector('.header > h1').style.color = "#ecebeb";
document.querySelectorAll('.navBar > li').forEach(x => {x.style.paddingTop = '.3rem'; x.style.paddingBottom = '.3rem'});
document.querySelectorAll('.navElement').forEach(x => {x.style.paddingTop = '.5rem'; x.style.paddingBottom = '.5rem'; x.style.fontSize='1.2rem'});
}
}