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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
3801	`;3802}3803 3804// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)3805// @ts-expect-error ST-2949_23806function t_catalog_get_productCard_getWrapperStylesStr(opts) {3807	var str = '';3808	str += opts.prodCard.bgColor ? 'background-color:' + opts.prodCard.bgColor + ';' : '';3809 3810	var shadowOpacity = opts.prodCard.shadowOpacity;3811	var shadowSize = opts.prodCard.shadowSize;3812
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
var shadow = opts.prodCard.shadow;
3813
3814 var shadowCSS = '';
3815 if (shadow) {
3816 shadowCSS = 'box-shadow:' + shadow + ';';
3817 } else if (shadowOpacity || shadowSize) {
3818 shadowOpacity = shadowOpacity ? parseInt(shadowOpacity, 10) / 100 : 0.3;
3819 shadowSize = shadowSize ? parseInt(shadowSize, 10) : 10;
3820 shadowCSS = 'box-shadow: 0px 0px ' + shadowSize + 'px rgba(0,0,0,' + shadowOpacity + ');';
3821 }
3822
3823 str += shadowCSS;
3824 return str;
3825}
3826
3827// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
3828// @ts-expect-error ST-2949_2
3829function t_catalog_get_productCard_img_html(product, options, curImage) {
3830 var isListStyle = options.prodCard.listStyle === 'list';
3831 if (isListStyle && !options.prodCard.hasImg) {
3832 return '';
3833 }
3834
3835 var str = '';
3836 var mobileNoPaddingClass =
3837 options.hasOriginalAspectRatio && !options.isHorizOnMob ? 't-catalog__card__imgwrapper_original-ratio' : '';
3838 var wrapperClassStr = 't-catalog__card__imgwrapper ';
3839 if (isListStyle) {
3840 wrapperClassStr += options.imageRatioClass;
3841 } else {
3842 wrapperClassStr += mobileNoPaddingClass + (options.isFlexCols ? ' ' + options.imageRatioClass : '');
3843 }
3844
3845 var isSnippet =
3846 document.getElementById('allrecords') !== document.querySelector('.t-catalog__product-snippet') &&
3847 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
3848 // @ts-expect-error ST-2949_3
3849 document.getElementById('allrecords').contains(document.querySelector('.t-catalog__product-snippet'));
3850 if (isSnippet && !options.colWidth) {
3851 var colWidth = {
3852 1: 760,
3853 2: 560,
3854 3: 360,
3855 4: 260,
3856 };
3857 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
3858 // @ts-expect-error ST-2949_2
3859 options.colWidth = colWidth[options.blocksInRow];
3860 }
3861
3862 var wrapperStyle =
3863 options.imageHeight && !options.isFlexCols && !isListStyle
3864 ? 'padding-bottom:' + (parseInt(options.imageHeight, 10) * 100) / (options.colWidth || 360) + '%;'
3865 : '';
3866
3867 var hoverImgEl = t_catalog_get_productCard_imgElHover_html(product, options, curImage);
3868 var hasHover = options.imageHover && hoverImgEl;
3869
3870 var imgEl;
3871 var imgSrc = curImage ? curImage : t_catalog_getProductFirstImg(product);
3872 imgSrc = imgSrc.replace(/&/, '&');
3873
3874 if (imgSrc !== '') {
3875 if (options.hasOriginalAspectRatio) {
3876 imgEl = document.createElement('img');
3877 imgEl.classList.add('js-product-img');
3878 imgEl.classList.add('t-catalog__card__img');
3879 if (hasHover) {
3880 imgEl.classList.add('t-catalog__card__img_hover');
3881 }
3882 var isSafari16_3 = /Version\/16\.3 Safari/.test(navigator.userAgent);
3883 if (isSafari16_3) {
3884 imgEl.style.objectFit = 'contain';
3885 }
3886 imgEl.classList.add('t-img');
3887 imgEl.setAttribute('data-original', imgSrc);
3888 imgEl.src = t_catalog_getLazySrc(options, imgSrc);
3889 } else {
3890 imgEl = document.createElement('div');
3891 imgEl.classList.add('js-product-img');
3892 imgEl.classList.add('t-catalog__card__bgimg');
3893 if (hasHover) {
3894 imgEl.classList.add('t-catalog__card__bgimg_hover');
3895 }
3896 imgEl.classList.add('t-bgimg');
3897 imgEl.setAttribute('data-original', imgSrc);
3898 imgEl.style.backgroundImage = 'url("' + t_catalog_getLazyUrl(options, imgSrc) + '")';
3899 }
3900
Предыдущие 100 строкСледующие 100 строк