ready for staging

This commit is contained in:
djagoo 2025-05-11 14:40:23 +02:00
parent 72da90a5d4
commit 8506be5194
Signed by: djagoo
GPG key ID: E478970FA1D8880B
236 changed files with 16119 additions and 6 deletions

View file

@ -0,0 +1,37 @@
jQuery(document).ready(function($){
var div = $('.line'),
divHeight = div.height(),
scroll;
$(window).scroll(function () {
scroll = $(this).scrollTop();
div.height(scroll)
});
var timelineBlocks = $('.cd-timeline-block'),
offset = 0.8;
//hide timeline blocks which are outside the viewport
hideBlocks(timelineBlocks, offset);
//on scolling, show/animate timeline blocks when enter the viewport
$(window).on('scroll', function(){
(!window.requestAnimationFrame)
? setTimeout(function(){ showBlocks(timelineBlocks, offset); }, 100)
: window.requestAnimationFrame(function(){ showBlocks(timelineBlocks, offset); });
});
function hideBlocks(blocks, offset) {
blocks.each(function(){
( $(this).offset().top > $(window).scrollTop()+$(window).height()*offset ) && $(this).find('.cd-date, .cd-timeline-img, .cd-timeline-content').addClass('is-hidden');
});
}
function showBlocks(blocks, offset) {
blocks.each(function(){
( $(this).offset().top <= $(window).scrollTop()+$(window).height()*offset && $(this).find('.cd-date, .cd-timeline-img').hasClass('is-hidden') ) && $(this).find('.cd-date, .cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
});
}
});