101t_animate__startAnimation();102}, 1500);103}104105/**106* Фильтруем все анимированные элементы на разрешении, меньше 1200px.107* Если анимированный элемент находится внутри зеро-блока и имеет108* активированный флаг мобильной анимации, пропускаем его.109* В остальных случаях удаляем анимацию на элементе,110* или его детях, и удаляем из перечня анимированных элементов.111*112* @param {HTMLElement[]} elementList - animated elements in array
* @returns {HTMLElement[]} - filtered elements array (without zeroBlock child) */function t_animate__checkMobile(elementList) { return elementList.filter(function (element) { var zeroBlockElement = element.closest('.t396__elem, .t396__group'); var hasMobileAnimation = zeroBlockElement && zeroBlockElement.getAttribute('data-animate-mobile') === 'y'; if (hasMobileAnimation) return true; var isRecordElement = element.classList.contains('r'); if (isRecordElement) { Array.prototype.forEach.call(element.querySelectorAll('.t-animate'), function (el) { t_animate__removeAnimationClass(el, ''); }); } else { t_animate__removeAnimationClass(element, ''); } return false; });}/** * Удаляет класс .t-animate с элемента. * Второй аргумент - массив или строка модификатора, который тоже удаляется, если задан. * * @param {HTMLElement | null} element * @param {string[] | string} modifierList */function t_animate__removeAnimationClass(element, modifierList) { if (!element) return; var baseClass = 't-animate'; element.classList.remove(baseClass); if (!modifierList) return; if (typeof modifierList === 'string') modifierList = [modifierList]; modifierList.forEach(function (modifier) { var className = baseClass + '_' + modifier; element.classList.remove(className); });}/** * Для блоков с fadeInLeft блокируем overflow, чтобы * выходящий за пределы блока элемент не создавал горизонтальный скролл. * Обложки и зеро-блоки не обрабатываем, у них задан overflow: hidden по дефолту */function t_animate__preventHorizontalScroll() { const fadeInLeftElements = Array.from(document.querySelectorAll('[data-animate-style="fadeinleft"]')); const elementsToHideOverflowFor = fadeInLeftElements.filter(element => { if (element.closest('.t396__artboard, .t-cover')) return false; return element.getBoundingClientRect().right > window.innerWidth; }); if (!elementsToHideOverflowFor.length || window.innerWidth < 980) return; elementsToHideOverflowFor.forEach(fadeInLeftElement => { const parentRecord = fadeInLeftElement.closest('.r'); parentRecord.classList.add('t-animate__overflow-x-hidden'); });}/** * Check if we need to turn off animmation on the page * @returns {Boolean} */function t_animate__checkAnimationAvailability() { var allRec = document.querySelector('.t-records'); var animationOff = allRec ? allRec.getAttribute('data-blocks-animationoff') : null; var editMode = allRec ? allRec.getAttribute('data-tilda-mode') : null; // turning off animmation if (/Bot/i.test(navigator.userAgent) || animationOff === 'yes' || t_animate__checkIE() || editMode === 'edit') { var animationList = document.querySelectorAll('.t-animate'); Array.prototype.forEach.call(animationList, function (animation) { t_animate__removeAnimationClass(animation, ''); }); return false; } return true;}/** * This function generates CSS basic animation styles for breakpoints of all ZeroBlocks on page */function t_animate__generateStyles() { var isZeroOnPage = !!document.querySelector('.t396'); if (!isZeroOnPage) return;