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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-scripts-3.0.js

Код файла
Версия от 29.09.2026, 07:00:43 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
701		});702 703		if (704			window.innerWidth < 480 ||705			(window.isMobile && document.documentElement.clientWidth < 480) ||706			(isInstagram && screen.width < 480)707		) {708			t_onReady(function () {709				var customStyleElements = document.querySelectorAll('[data-customstyle="yes"]');710				var fieldElements = document.querySelectorAll('[field] span, [field] strong, [field] em, [field] a');711 712
История файла и сравнение версий
  • 29.09.2026, 07:00:43 · 56c3b845
for (var i = 0; i < customStyleElements.length; i++) {
713 var element = customStyleElements[i];
714
715 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) > 26) {
716 element.style.fontSize = null;
717 element.style.lineHeight = null;
718 }
719 }
720
721 for (var i = 0; i < fieldElements.length; i++) {
722 var element = fieldElements[i];
723
724 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) > 26) {
725 element.style.fontSize = null;
726 }
727 }
728
729 updateFontSize(480);
730
731 window.addEventListener('orientationchange', function () {
732 setTimeout(function () {
733 updateFontSize(480);
734 }, 500);
735 });
736 });
737
738 window.addEventListener('load', setBreakWords);
739 window.addEventListener('orientationchange', function () {
740 setTimeout(function () {
741 setBreakWords();
742 }, 500);
743 });
744 } else if (
745 window.innerWidth < 900 ||
746 (window.isMobile && document.documentElement.clientWidth < 900) ||
747 (isInstagram && screen.width < 900)
748 ) {
749 t_onReady(function () {
750 var customStyleElements = document.querySelectorAll('[data-customstyle="yes"]');
751 var fieldElements = document.querySelectorAll('[field] span, [field] strong, [field] em, [field] a');
752
753 for (var i = 0; i < customStyleElements.length; i++) {
754 var element = customStyleElements[i];
755
756 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) > 30) {
757 element.style.fontSize = null;
758 element.style.lineHeight = null;
759 }
760 }
761
762 for (var i = 0; i < fieldElements.length; i++) {
763 var element = fieldElements[i];
764
765 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) > 30) {
766 element.style.fontSize = null;
767 }
768 }
769
770 var elements = document.querySelectorAll(
771 '' +
772 '.t-text:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
773 '.t-name:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
774 '.t-title:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
775 '.t-descr:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
776 '.t-heading:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
777 '.t-text-impact:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
778 '.t-subtitle:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
779 '.t-uptitle:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"])'
780 );
781
782 for (var i = 0; i < elements.length; i++) {
783 var element = elements[i];
784 var elementStyle = element.getAttribute('style');
785
786 if (elementStyle && elementStyle.indexOf('font-size') > -1) {
787 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) > 30) {
788 if (element.getAttribute('data-auto-correct-font-size') === 'rem') {
789 // set adaptive font size for mobile devices
790 var newStyle = elementStyle
791 .replace(/font-size.*px;/gi, 'font-size: 1.6rem;')
792 .replace('line-height', 'lineheight');
793 element.setAttribute('style', newStyle);
794 } else {
795 // reset font-size for all other elements
796 var newStyle = elementStyle
797 .replace('font-size', 'fontsize')
798 .replace('line-height', 'lineheight');
799 element.setAttribute('style', newStyle);
800 }
Предыдущие 100 строкСледующие 100 строк