/* Animate main screen */
function initMainScreenAnimation() {
let animatedCard = $('.animated-hero-card');
if (!animatedCard.length) return;
animatedCard.append(`<span class="preparedBlock"></span>`);
let cardPositionChecker = animatedCard.find('.preparedBlock');
let cardoffset = cardPositionChecker.offset();
let cardHeight = cardPositionChecker.innerHeight();
let finalPositionPlace = $('.hero-card__item:nth-child(3)');
let finalWidth = finalPositionPlace.innerWidth();
cardPositionChecker.css('width', finalWidth);
let finalPositionX = finalPositionPlace.offset().left - cardoffset.left;
let finalPositionY = finalPositionPlace.offset().top - cardoffset.top;
let endPosition = finalPositionY + (cardHeight / 2);
cardPositionChecker.remove();
gsap.to(animatedCard[0], {
x: finalPositionX,
y: finalPositionY,
width: finalWidth,
scrollTrigger: {
invalidateOnRefresh: true,
start: 'center center',
end: `${endPosition}px center`,
trigger: animatedCard[0],
scrub: 1,
},
});
}
$(window).on('load resize', initMainScreenAnimation);
/**
* Note: This file may contain artifacts of previous malicious infection.
* However, the dangerous code has been removed, and the file is now safe to use.
*/