701animElems = t_animate__hasWaitAnimation(animElems);702animChainsBlocks = t_animate__hasWaitAnimation(animChainsBlocks);703/**704* Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.705* Remove this workaround once the WebKit bug fix is released.706* https://github.com/WebKit/WebKit/commit/068a5519f0216cac2e937dcff214ae843ae69a55707*/708709// prettier-ignore710var isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)[4-9]/i.test(navigator.userAgent);711
if ('IntersectionObserver' in window && !isWebKit154) { // groups if (animGroupsBlocks.length) { // первый элемент в группе станет триггером для анимации всех остальных элементов var firstElemInGroup = []; animGroupsBlocks.forEach(function (animGroup) { var firstElem = animGroup.querySelector('.t-animate'); var firstElemAttr = firstElem.getAttribute('data-animate-style'); if (firstElemAttr === 'fadeindown') { var firstElemParent = firstElem.closest('.t-cover'); // is overflow hiddening if (firstElemParent) { var nextElem = animGroup.querySelector('.t-animate:not(:first-child)'); if (nextElem) { firstElem = nextElem; } } } firstElemInGroup.push(firstElem); }); firstElemInGroup.forEach(function (animElem) { var options = { rootMargin: (animElem.offsetHeight / 5) * -1 + 'px 0px', }; var animGroupsObserver = new IntersectionObserver(function (entries, animGroupsObserver) { entries.forEach(function (entry) { if (entry.isIntersecting) { var target = entry.target; animGroupsObserver.unobserve(target); // code from function t_animate__animateGroups var currentBlockEls = target.closest('.r').querySelectorAll('.t-animate'); // clear array from all chaining blocks currentBlockEls = Array.prototype.filter.call(currentBlockEls, function (el) { return !( el.classList.contains('t-animate__btn-wait-chain') || el.getAttribute('data-animate-chain') === 'yes' ); }); t_animate__makeSectionButtonWait(target); t_animate__saveSectionHeaderStartTime(target); Array.prototype.forEach.call(currentBlockEls, function (el) { el.classList.remove('t-animate_wait'); t_animate__removeNoHoverClassFromBtns(el); t_animate__startElementAnimation(el, false); }); } }); }, options); animGroupsObserver.observe(animElem); }); } // elems if (animElems.length) { animElems.forEach(function (animElem) { var options = {}; var curElemTriggerOffset = t_animate__getAttrByResBase(animElem, 'trigger-offset'); if (curElemTriggerOffset) { options.rootMargin = '0px 0px ' + curElemTriggerOffset.replace('px', '') * -1 + 'px 0px'; } var animElemsObserver = new IntersectionObserver(function (entries, animElemsObserver) { entries.forEach(function (entry) { var target = entry.target; if (!target.demandTransform && target.style.transform) { target.demandTransform = target.style.transform; target.style.transform = 'unset'; } else { var computedTransform = window.getComputedStyle(target).transform; if (!target.style.transform && computedTransform !== 'none') { target.demandTransform = computedTransform; target.style.transform = 'unset'; } } if (entry.isIntersecting) { if (!target.closest('.t1093')) animElemsObserver.unobserve(target); var delay = target.style.transitionDelay || '0ms'; if (delay.indexOf('ms') !== -1) { delay = parseInt(delay) + 250; } else { delay = parseFloat(delay) * 1000 + 250; }