almost finished website

This commit is contained in:
2023-05-19 21:59:00 +02:00
parent 5f69d25662
commit 8e1d803d8d
13 changed files with 351 additions and 40 deletions

View File

@@ -59,7 +59,16 @@ $( document ).ready( function () {
}
$( '.progress-item' ).click( function () {
let future = parseInt( $( this ).attr( 'id' ).substring( 4 ) ) - 1;
moveTo( parseInt( $( this ).attr( 'id' ).substring( 4 ) ) );
} );
$( '.scroll-wrapper' ).click( function () {
moveTo( currentlyShowing + 1 );
} );
function moveTo ( id ) {
$( '#scroll-hint' ).fadeOut( 300 );
let future = id - 1;
for ( let i = 0; i < future + 1; i++ ) {
$( `#step-${i + 1}` ).addClass( 'active' );
}
@@ -67,8 +76,14 @@ $( document ).ready( function () {
for ( let i = future + 1; i < revealables.length + 1; i++ ) {
$( `#step-${i + 1}` ).removeClass( 'active' );
}
clearTimeout( timeout );
$( '#scroll-hint' ).fadeOut( 300 );
if ( future < revealables.length ) {
timeout = setTimeout( showScrollHint, 7000 );
}
currentlyShowing = future;
trackProgress();
window.scrollTo( { top: ( parseInt( $( this ).attr( 'id' ).substring( 4 ) ) - 1 ) * heights, behavior: 'instant' } );
} );
window.scrollTo( { top: id * heights, behavior: 'instant' } );
}
} );