-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add_mambaforge
- Loading branch information
Showing
5 changed files
with
127 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<script src="/js/jquery.min.js"></script> | ||
<script src="/js/bootstrap.min.js"></script> | ||
<script src="/js/reveal_on_scroll.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
$(function() { | ||
// call revealOnScroll | ||
$(window).on('scroll', revealOnScroll); | ||
|
||
// Animate reveal on scroll | ||
function revealOnScroll() { | ||
var scrolled = $(window).scrollTop(); | ||
$(".revealOnScroll:not(.animated)").each(function() { | ||
if (scrolled + win_height_padded > $(this).offset().top) { | ||
if ($(this).data('timeout')) { | ||
window.setTimeout(function() { | ||
$(this).addClass('animated ' + $(this).data('animation')); | ||
}, parseInt($(this).data('timeout'), 10)); | ||
} else { | ||
$(this).addClass('animated ' + $(this).data('animation')); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
// apply reveal on scroll to buttons | ||
$(window).on("scroll", function() { | ||
if ($(window).scrollTop() >= 300) { | ||
$("#backtotop-button").addClass('visible'); | ||
$("#help-button").addClass('visible'); | ||
} else { | ||
$("#backtotop-button").removeClass('visible'); | ||
$("#help-button").removeClass('visible'); | ||
} | ||
}); | ||
|
||
// Scroll to top behaviour | ||
$('#backtotop-button a').on('click', function() { | ||
$('html, body').animate({ | ||
scrollTop: 0 | ||
}, 800, 'swing'); | ||
return false; | ||
}); | ||
}) |