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,59 @@
$.fn.isVisible = function(offset) {
// Am I visible?
// Height and Width are not explicitly necessary in visibility detection, the bottom, right, top and left are the
// essential checks. If an image is 0x0, it is technically not visible, so it should not be marked as such.
// That is why either width or height have to be > 0.
var rect = this[0].getBoundingClientRect();
return (
(rect.height > 0 || rect.width > 0) &&
rect.bottom >= 0 &&
rect.right >= 0 &&
rect.top <= (window.innerHeight - offset || document.documentElement.clientHeight - offset) &&
rect.left <= (window.innerWidth - offset || document.documentElement.clientWidth - offset)
);
};
$(".multi-event-timeline .timeline-items .timeline-item:nth-of-type(odd)").addClass("timeRight");
$.fn.timelify = function(options){
var settings = $.extend({
animLeft: "fadeIn",
animRight: "fadeIn",
animCenter: "bounceInUp",
animSpeed: 300,
offset: 150
}, options);
var elem = this;
var timeline_items = $(this).find('.timeline-items li');
window.addEventListener('scroll', function(){
var scrollPos = $(window).scrollTop();
if($('.timeline-items li.is-hidden').length > 0){
if(scrollPos > $(elem).offset().top - 600){
$(timeline_items).each(function () {
if ($(this).isVisible(settings.offset)) {
$(this).removeClass('is-hidden').addClass('animated').css({"animation-duration": settings.animSpeed + "ms"});
if (!$(this).hasClass('timeRight')) {
if ($(this).hasClass('centered')) {
$(this).addClass(settings.animCenter)
} else {
$(this).addClass(settings.animLeft)
}
} else {
$(this).addClass(settings.animRight)
}
}
});
}
}
});
return this;
};