Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-animation-sbs-1.0.js

Код файла
Версия от 05.12.2026, 07:01:09 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
701	var atomBoxShadow = atomStyles.getPropertyValue('box-shadow');702	if (atomBG === 'rgba(0, 0, 0, 0)' || atomsOpacity === '1') return;703	var atomsBackgroundColorRGB = atomBG.substring(atomBG.indexOf('(') + 1, atomBG.indexOf(')'));704	var boxShadowProp = t_animationSBS__processBoxShadowRGB(atomBoxShadow, atomsOpacity);705	if (boxShadowProp) {706		wrapper.style.boxShadow = boxShadowProp;707		atom.style.boxShadow = 'none';708	}709	wrapper.style.backgroundColor = 'rgba(' + atomsBackgroundColorRGB + ',' + atomsOpacity + ')';710	atom.sbsBgHolder = { node: wrapper, alpha: parseFloat(atomsOpacity) };711	atom.style.opacity = '1';
История файла и сравнение версий
  • 05.12.2026, 07:01:09 · 56c3b845
712 atom.style.backgroundColor = 'transparent';
713 atom.style.backdropFilter = 'initial';
714 atom.style.WebkitBackdropFilter = 'initial';
715}
716
717/**
718 * in t_animationSBS__chromeFixBackdropFilter we set opacity for atom,
719 * but this opacity incorrect work with setted box-shadow
720 *
721 * @param {string} styleProp
722 * @param {string} opacity
723 * @return {string | boolean}
724 */
725function t_animationSBS__processBoxShadowRGB(styleProp, opacity) {
726 if (!styleProp) return false;
727 if ((styleProp.indexOf('rgba') === -1 && styleProp.indexOf('rgb') === -1) || opacity === '1') return false;
728 var rgba = styleProp.substring(styleProp.indexOf('(') + 1, styleProp.indexOf(')'));
729 var rgbaArray = rgba.split(', ');
730 if (rgbaArray.length === 3) {
731 rgbaArray.push(opacity);
732 } else {
733 rgbaArray[3] *= opacity;
734 }
735 var prop = styleProp.replace(rgba, rgbaArray.join(', '));
736 if (prop.indexOf('rgb(') !== -1) prop = prop.replace('rgb(', 'rgba(');
737 return prop;
738}
739
740/**
741 * Create animatedObject and set main triggers and steps for sbs-animation.
742 *
743 * @param {Boolean} isEditMode
744 */
745function t_animationSBS__initAllRes(isEditMode) {
746 var animatedObject = {
747 elements: Array.prototype.slice.call(document.querySelectorAll('[data-animate-sbs-event]')),
748 scrollTop: window.pageYOffset,
749 isEditMode: isEditMode,
750 clickedTriggerEls: [],
751 hoverTriggerEls: [],
752 };
753
754 if (!animatedObject.elements.length) return;
755
756 // update animatedObject.elements, set for them steps with styles
757 t_animationSBS__cacheAndSetData(animatedObject);
758
759 // generate keyframes and append them to the head
760 t_animationSBS__generateKeyframes(animatedObject);
761
762 // update lazyload
763 var allRecords = document.getElementById('allrecords');
764 var isLazy = allRecords ? allRecords.getAttribute('data-tilda-lazy') === 'yes' : false;
765 if (window.lazy === 'y' || isLazy) {
766 t_onFuncLoad('t_lazyload_update', function () {
767 t_lazyload_update();
768 });
769 }
770
771 // find all elements, that has animation by such events - element on Screen / block on Screen
772 var elOrBlockOnScreenList = t_animationSBS__getAnimElsOnView(animatedObject.elements);
773
774 // update animation on resize, displaychanged or while using Safari and open page with pageYOffset !== 0
775 var timerID;
776
777 function animationUpdate() {
778 clearTimeout(timerID);
779 timerID = setTimeout(function () {
780 var updatedElemList = Array.prototype.slice.call(document.querySelectorAll('[data-animate-sbs-event]'));
781 t_animationSBS__updateAnimatedObjectState(animatedObject, 'elements', updatedElemList);
782 t_animationSBS__wrapAndUpdateElOnResize(animatedObject.elements);
783 t_animationSBS__cacheAndSetData(animatedObject);
784 t_animationSBS__triggerScrollAnim(animatedObject);
785 elOrBlockOnScreenList = t_animationSBS__getAnimElsOnView(animatedObject.elements);
786 t_animationSBS__triggerNoScrollAnimation(animatedObject, elOrBlockOnScreenList);
787 t_animationSBS__generateKeyframes(animatedObject);
788 }, 500);
789 }
790
791 var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
792 if ('ResizeObserver' in window) {
793 var breakpoints = t_animationSBS__getAllBreakpoints();
794 var resolutionObj = {
795 breakpoints: breakpoints,
796 currentRes: t_animationSBS__getCurrentRes(breakpoints, isMobile),
797 isMobile: isMobile,
798 };
799 t_animationSBS__createResizeObserver(resolutionObj, animationUpdate);
800 } else if (isMobile) {
Предыдущие 100 строкСледующие 100 строк