701var atomBoxShadow = atomStyles.getPropertyValue('box-shadow');702if (atomBG === 'rgba(0, 0, 0, 0)' || atomsOpacity === '1') return;703var atomsBackgroundColorRGB = atomBG.substring(atomBG.indexOf('(') + 1, atomBG.indexOf(')'));704var boxShadowProp = t_animationSBS__processBoxShadowRGB(atomBoxShadow, atomsOpacity);705if (boxShadowProp) {706wrapper.style.boxShadow = boxShadowProp;707atom.style.boxShadow = 'none';708}709wrapper.style.backgroundColor = 'rgba(' + atomsBackgroundColorRGB + ',' + atomsOpacity + ')';710atom.sbsBgHolder = { node: wrapper, alpha: parseFloat(atomsOpacity) };711atom.style.opacity = '1';
atom.style.backgroundColor = 'transparent'; atom.style.backdropFilter = 'initial'; atom.style.WebkitBackdropFilter = 'initial';}/** * in t_animationSBS__chromeFixBackdropFilter we set opacity for atom, * but this opacity incorrect work with setted box-shadow * * @param {string} styleProp * @param {string} opacity * @return {string | boolean} */function t_animationSBS__processBoxShadowRGB(styleProp, opacity) { if (!styleProp) return false; if ((styleProp.indexOf('rgba') === -1 && styleProp.indexOf('rgb') === -1) || opacity === '1') return false; var rgba = styleProp.substring(styleProp.indexOf('(') + 1, styleProp.indexOf(')')); var rgbaArray = rgba.split(', '); if (rgbaArray.length === 3) { rgbaArray.push(opacity); } else { rgbaArray[3] *= opacity; } var prop = styleProp.replace(rgba, rgbaArray.join(', ')); if (prop.indexOf('rgb(') !== -1) prop = prop.replace('rgb(', 'rgba('); return prop;}/** * Create animatedObject and set main triggers and steps for sbs-animation. * * @param {Boolean} isEditMode */function t_animationSBS__initAllRes(isEditMode) { var animatedObject = { elements: Array.prototype.slice.call(document.querySelectorAll('[data-animate-sbs-event]')), scrollTop: window.pageYOffset, isEditMode: isEditMode, clickedTriggerEls: [], hoverTriggerEls: [], }; if (!animatedObject.elements.length) return; // update animatedObject.elements, set for them steps with styles t_animationSBS__cacheAndSetData(animatedObject); // generate keyframes and append them to the head t_animationSBS__generateKeyframes(animatedObject); // update lazyload var allRecords = document.getElementById('allrecords'); var isLazy = allRecords ? allRecords.getAttribute('data-tilda-lazy') === 'yes' : false; if (window.lazy === 'y' || isLazy) { t_onFuncLoad('t_lazyload_update', function () { t_lazyload_update(); }); } // find all elements, that has animation by such events - element on Screen / block on Screen var elOrBlockOnScreenList = t_animationSBS__getAnimElsOnView(animatedObject.elements); // update animation on resize, displaychanged or while using Safari and open page with pageYOffset !== 0 var timerID; function animationUpdate() { clearTimeout(timerID); timerID = setTimeout(function () { var updatedElemList = Array.prototype.slice.call(document.querySelectorAll('[data-animate-sbs-event]')); t_animationSBS__updateAnimatedObjectState(animatedObject, 'elements', updatedElemList); t_animationSBS__wrapAndUpdateElOnResize(animatedObject.elements); t_animationSBS__cacheAndSetData(animatedObject); t_animationSBS__triggerScrollAnim(animatedObject); elOrBlockOnScreenList = t_animationSBS__getAnimElsOnView(animatedObject.elements); t_animationSBS__triggerNoScrollAnimation(animatedObject, elOrBlockOnScreenList); t_animationSBS__generateKeyframes(animatedObject); }, 500); } var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); if ('ResizeObserver' in window) { var breakpoints = t_animationSBS__getAllBreakpoints(); var resolutionObj = { breakpoints: breakpoints, currentRes: t_animationSBS__getCurrentRes(breakpoints, isMobile), isMobile: isMobile, }; t_animationSBS__createResizeObserver(resolutionObj, animationUpdate); } else if (isMobile) {