Testing hugo

This commit is contained in:
David 2020-11-19 20:49:43 +01:00
commit e3975962fa
327 changed files with 17224 additions and 0 deletions

View file

@ -0,0 +1,42 @@
window.addEventListener("scroll", updateProgress);
progressBar = document.getElementById("progressBar");
scrollProgress = document.getElementById("progressIndicator");
if (document.getElementById("subscriptionSection")){
articleSubscription = document.getElementById("subscriptionSection").offsetHeight;
}
else{
articleSubscription = 0;
}
if(document.getElementById("articleNext")){
articleNext = document.getElementById("articleNext").offsetHeight;
}
else{
articleNext = 0;
}
footerSection = 150;
bottomOffset = ((articleSubscription + articleNext + footerSection + 250) / document.body.scrollHeight) * 100 ;
bottomOffset += bottomOffset * 1.1;
function updateProgress(){
let percentScrolled = (window.pageYOffset / document.body.scrollHeight) * (100 + bottomOffset);
scrollProgress.style.transform = "translateY(" + percentScrolled + "%)";
if (percentScrolled > 100){
progressBar.style.animationName = "progress-fade-out";
setTimeout(function(){
progressBar.style.opacity = "0";
}, 500);
}
else{
progressBar.style.animationName = "progress-fade-in";
setTimeout(function(){
progressBar.style.opacity = "1";
}, 500);
}
}