* Значения слоев свойства в режиме градиента на шаге или в момент анимации по скроллу: по слою на вид,
314 * геометрия слоя (см. sbsPaintGeometry) и цвета стопов. color - css-цвет текста (только для color): 315 * прозрачный, пока текст рисует слой 317 * @typedef {Object<string, sbsPaintGeometry & {colors: sbsRGBA[]}> & {color: sbsRGBA | undefined}} sbsPaintState 321 * Записывается в свойство sbsBgHolder атома в t_animationSBS__chromeFixBackdropFilter, когда фон атома 322 * переносится на обертку. node - обертка, которая теперь рисует фон, alpha - opacity атома, 323 * на нее умножается прозрачность цвета шага 325 * @typedef {{node: HTMLElement, alpha: number}} sbsBgHolder 328window.t_animationSBS__isFirefox = navigator.userAgent.search('Firefox') !== -1; 329window.t_animationSBS__isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 331window.animationSBS__isIOS = /iPhone|iPad|iPod/i.test(navigator.userAgent) || ('ontouchend' in document && /Macintosh/.test(navigator.userAgent)); 332window.animationSBS__isOldPage = Boolean(document.querySelector('script[src*="tilda-blocks-2.7"]')); 333// переменная слоя цвета шага поверх градиентного фона, см. t_animationSBS__setBgColorLayer 334window.t_animationSBS__BG_LAYER_PROP = '--t-sbs-bgcolor'; 335// суффикс имен анимаций цвета, по нему их события отличаются от событий основной анимации 336window.t_animationSBS__COLOR_ANIM_SUFFIX = '-sbscolor'; 337// фигуры вектора, у которых анимируются fill/stroke по ключам шагов fl и st 338window.t_animationSBS__SHAPE_SELECTOR = [ 349 .map(tag => `svg ${tag}`) 352// start animation, when the contents of its tab have become visible 353if (document.visibilityState === 'visible') { 354 if (document.readyState !== 'loading') { 355 t_animationSBS__init(); 357 document.addEventListener('DOMContentLoaded', t_animationSBS__init); 360 document.addEventListener('visibilitychange', t_animationSBS__checkVisibilityPage); 363function t_animationSBS__checkVisibilityPage() { 364 if (document.visibilityState === 'visible') { 365 t_animationSBS__onReady(t_animationSBS__init); 366 document.removeEventListener('visibilitychange', t_animationSBS__checkVisibilityPage); 370function t_animationSBS__onReady(func) { 371 document.readyState !== 'loading' ? func() : document.addEventListener('DOMContentLoaded', func); 375 * check terms to create sbs-animation and if the conditions are met, create animation 377function t_animationSBS__init() { 378 var allRec = document.getElementById('allrecords'); 379 var isEditMode = allRec ? allRec.getAttribute('data-tilda-mode') === 'edit' : null; 380 if (!isEditMode) isEditMode = Boolean(document.getElementById('for_redactor_toolbar')); 381 if (/Bot/i.test(navigator.userAgent) || document.documentMode < 11 || isEditMode) return; 383 t_animationSBS__processHorizontalScroll(); 384 // initing animation after zeroblock rendering 385 t_animationSBS__isZeroBlocksRendered(function () { 386 t_animationSBS_isInstagramRendered(function () { 387 t396__initScaleFactorFlags(); 388 var animatedElements = Array.prototype.slice.call(document.querySelectorAll('[data-animate-sbs-event]')); 389 t_animationSBS__wrapAndUpdateEls(animatedElements); 390 t_animationSBS__initAllRes(isEditMode); 396 * Обрабатываем горизонтальный скролл для элементов фиксации, которые могут выходить 397 * за пределы блока по горизонтали. Существует два варианта обработки: 398 * 1. если один из блоков, содержащих анимацию по скроллу содержит overflow: visible, 399 * в таком случае вешаем overflow на allRecords, чтобы не появлялся горизонтальный скролл, 400 * но при этом не обрезались элементы артборда по вертикали.