start new version of website

This commit is contained in:
2023-05-18 16:38:40 +02:00
parent 951853b105
commit ccf1c67837
36 changed files with 365 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
$( document ).ready( function () {
document.addEventListener( 'scroll', scrolled );
let revealables = document.querySelectorAll( '.reveal' );
let currentlyShowing = Math.floor( window.scrollY / ( window.innerHeight / revealables.length + 50 ) );
for ( let i = 0; i < currentlyShowing; i++ ) {
if ( i < parseInt( revealables.length ) ) {
revealables[ i ].classList.add( 'active' );
}
}
function scrolled() {
let regPos = Math.floor( window.scrollY / ( window.innerHeight / revealables.length + 50 ) );
if ( regPos < currentlyShowing && regPos < parseInt( revealables.length ) ) {
revealables[ regPos ].classList.remove( 'active' );
} else if ( regPos > currentlyShowing && regPos < parseInt( revealables.length ) + 1 ) {
revealables[ currentlyShowing ].classList.add( 'active' );
}
currentlyShowing = regPos;
}
} );