1401t_animate__setGroupsBlocksState(animGroupsBlocks, viewTop, viewBottom);14021403animChainsBlocks.forEach(function (curBlock) {1404t_animate__assignChainDelay(curBlock, viewBottom, viewTop);1405t_animate__checkSectionButtonAnimation__outOfTurn(curBlock);1406});14071408t_animate__setAnimELemsState(animElems, viewTop, viewBottom);14091410window.addEventListener('resize', t_throttle(t_animate__removeInlineAnimStyles));1411}1412
/** * Set state for animElems group * @param {HTMLElement[]} animElems - animated elements list * @param {number} viewTop * @param {number} viewBottom */function t_animate__setAnimELemsState(animElems, viewTop, viewBottom) { animElems.forEach(function (curElem) { var curElemOffsetTop = curElem.getBoundingClientRect().top + window.pageYOffset; if (curElemOffsetTop < viewTop - 500) { t_animate__removeAnimationClass(curElem, 'no-hover'); // fix for numbers with anchor link if (t_animate__getAttrByResBase(curElem, 'style') === 'animatednumber') { t_animate__animateNumbers(curElem); } return true; } var curElemTrigger = t_animate__detectElemTriggerOffset(curElem, viewBottom); t_animate__setCustomAnimSettings(curElem, curElemOffsetTop, viewBottom); if (curElemOffsetTop < curElemTrigger && !curElem.closest('.t1093')) { t_animate__removeNoHoverClassFromBtns(curElem); t_animate__startElementAnimation(curElem, true); if (t_animate__getAttrByResBase(curElem, 'style') === 'animatednumber') { t_animate__animateNumbers(curElem); } } if (curElemOffsetTop >= curElemTrigger || curElem.closest('.t1093')) { curElem.classList.add('t-animate_wait'); } });}/** * Set state for animGroupsBlocks group * @param {HTMLElement[]} animGroupsBlocks - animated group elements list * @param {number} viewTop * @param {number} viewBottom */function t_animate__setGroupsBlocksState(animGroupsBlocks, viewTop, viewBottom) { animGroupsBlocks.forEach(function (curBlock) { var curBlockAnimElems = curBlock.querySelectorAll('.t-animate'); curBlockAnimElems = Array.prototype.filter.call(curBlockAnimElems, function (animEl) { return !(animEl.getAttribute('data-animate-chain') === 'yes'); }); var curBlockOffset = curBlock.getBoundingClientRect().top + window.pageYOffset; t_animate__removeAnimFromHiddenSlides(curBlock); var sectionHeadDelay = t_animate__assignSectionDelay(curBlock); t_animate__assignGroupDelay(curBlock, sectionHeadDelay); Array.prototype.forEach.call(curBlockAnimElems, function (el) { var parentIsHidden = el.closest('.t397__off') || el.closest('.t395__off') || el.closest('.t400__off'); if (el.classList.contains('t-animate_no-hover') && parentIsHidden) { el.classList.remove('t-animate_no-hover'); } if (curBlockOffset <= viewTop - 100) { t_animate__saveSectionHeaderStartTime(curBlock); t_animate__removeAnimationClass(el, 'no-hover'); el.style.transitionDelay = ''; return true; } if (curBlockOffset < viewBottom && curBlockOffset > viewTop - 100) { // if button is part of section with chain animation, it should wait till the end of chain animation t_animate__makeSectionButtonWait(curBlock); if (!el.classList.contains('.t-animate__btn-wait-chain')) { t_animate__removeNoHoverClassFromBtns(el); if (parentIsHidden) { el.classList.add('t-animate_wait'); } else { t_animate__startElementAnimation(el, false); } } } if (curBlockOffset >= viewBottom) { el.classList.add('t-animate_wait'); } }); });}/** * Set animation state for animChainsBlocks group * * @param {HTMLElement[] | NodeList} animChainsBlocks - animated chain blocks */function t_animate__setAnimationStateChains(animChainsBlocks) { if (!animChainsBlocks || !animChainsBlocks.length) return false; var viewTop = window.pageYOffset;