progress on new website
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
$( document ).ready( function () {
|
||||
|
||||
document.addEventListener( 'scroll', scrolled );
|
||||
document.addEventListener( 'resize', scrolled );
|
||||
|
||||
let revealables = document.querySelectorAll( '.reveal' );
|
||||
|
||||
let currentlyShowing = Math.floor( window.scrollY / ( window.innerHeight / revealables.length + 50 ) );
|
||||
|
||||
let heights = $( document ).height() / ( revealables.length + 1 );
|
||||
let currentlyShowing = Math.round( window.scrollY / heights );
|
||||
|
||||
for ( let i = 0; i < currentlyShowing; i++ ) {
|
||||
if ( i < parseInt( revealables.length ) ) {
|
||||
@@ -14,7 +14,8 @@ $( document ).ready( function () {
|
||||
}
|
||||
|
||||
function scrolled() {
|
||||
let regPos = Math.floor( window.scrollY / ( window.innerHeight / revealables.length + 50 ) );
|
||||
heights = $( document ).height() / ( revealables.length + 1 );
|
||||
let regPos = Math.round( window.scrollY / heights );
|
||||
if ( regPos < currentlyShowing && regPos < parseInt( revealables.length ) ) {
|
||||
revealables[ regPos ].classList.remove( 'active' );
|
||||
} else if ( regPos > currentlyShowing && regPos < parseInt( revealables.length ) + 1 ) {
|
||||
|
||||
Reference in New Issue
Block a user