2101typeof t396_ab__getFieldValue !== 'undefined' &&2102t396_ab__getFieldValue(artboard, 'upscale') === 'window')2103) {2104return window.tn_scale_factor;2105}2106return 1;2107}21082109/**2110* Add itemsOffsets param to animated elements2111*2112* @param {HTMLElement[]} animChainsBlocks animated chain block list
*/function t_animate__getChainOffsets(animChainsBlocks) { animChainsBlocks.forEach(function (animChainsBlock) { var currentChain = animChainsBlock.querySelectorAll('.t-animate_wait[data-animate-chain=yes]'); animChainsBlock.itemsOffsets = []; Array.prototype.forEach.call(currentChain, function (curChain, index) { animChainsBlock.itemsOffsets[index] = curChain.getBoundingClientRect().top + window.pageYOffset; }); });}/** * Add curTopOffset param to animated elements * * @param {HTMLElement[]} animElems - animated elements */function t_animate__getElemsOffsets(animElems) { animElems.forEach(function (animElem) { animElem.curTopOffset = window.pageYOffset + animElem.getBoundingClientRect().top; var zoom = t_animation__getZoom(animElem); if (!window.isOnlyScalable) animElem.curTopOffset *= zoom; });}/** * Remove animation from hidden blocks * * @param {HTMLElement} curBlock - current block */function t_animate__removeAnimFromHiddenSlides(curBlock) { var slides = curBlock.querySelectorAll('.t-slides'); if (slides.length) { var slidesItems = curBlock.querySelectorAll('.t-slides__item'); slidesItems = Array.prototype.filter.call(slidesItems, function (slide) { return !slide.classList.contains('t-slides__item_active'); }); var hiddenSlides = []; slidesItems.forEach(function (slide) { var animateEl = slide.querySelector('.t-animate'); if (animateEl) hiddenSlides.push(animateEl); }); hiddenSlides.forEach(function (hiddenSlide) { t_animate__removeAnimationClass(hiddenSlide, 'no-hover'); }); }}/** * Move custom opacity from text element to wrapped <div> */function t_animate__wrapTextWithOpacity() { var textElements = document.querySelectorAll( '.t-title.t-animate, .t-descr.t-animate, .t-uptitle.t-animate, .t-text.t-animate' ); Array.prototype.forEach.call(textElements, function (el) { var style = el.getAttribute('style'); if (style && style.indexOf('opacity') !== -1) { var opacity = el.style.opacity; if (opacity && opacity > 0) { el.style.opacity = ''; var div = document.createElement('div'); div.style.opacity = opacity; var children = el.childNodes; Array.prototype.forEach.call(children, function (child) { var clonedChild = child.cloneNode(true); div.appendChild(clonedChild); }); el.innerHTML = ''; el.appendChild(div); } } });}/** * Wrap words with a span for all text animations * @param {string|null} scopeSelector - optional selector of container, if set, only elements inside it are wrapped */function t_animate__wrapTextAnimationsWords(scopeSelector = null) { t_animate__wrapAnimatedTextWords(scopeSelector); t_animate__wrapAnimatedTextWordsWithMasks(scopeSelector);}/** * Prepare text animation: * - wrap words with a line span when needed * - add delay to text animation particles * @param {HTMLElement} element - specific element to prepare