mirror of
https://github.com/asimonson1125/asimonson1125.github.io.git
synced 2026-02-25 05:09:49 -06:00
Complete for 9/29/21 career fair
I still don't think this is complete, but it's all I can muster right now.
This commit is contained in:
15
src/responsive.js
Normal file
15
src/responsive.js
Normal file
@@ -0,0 +1,15 @@
|
||||
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 > h1').style.color = "#a8a8a8";
|
||||
document.querySelectorAll('.navBar > li').forEach(x => {x.style.paddingTop = '0rem'; x.style.paddingBottom = '0rem'});
|
||||
} else {
|
||||
document.querySelector('.header').style.backgroundColor = 'rgba(0,0,0,0)';
|
||||
document.querySelector('.header > a > h1').style.fontSize = "2.5rem";
|
||||
// document.querySelector('.header > h1').style.color = "#ecebeb";
|
||||
document.querySelectorAll('.navBar > li').forEach(x => {x.style.paddingTop = '.3rem'; x.style.paddingBottom = '.3rem'});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user