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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.1.js

Код файла
Версия от 04.12.2026, 04:03:55 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
3001			}3002			imgEl.classList.add('t-bgimg');3003			imgEl.setAttribute('data-original', imgSrc);3004			imgEl.style.backgroundImage = 'url("' + t_store_getLazyUrl(options, imgSrc) + '")';3005			t_store_get_productCard_getImgStyles(imgEl, options);3006		}3007 3008		if (product.editions.length === 1) {3009			var edition = t_store_product_getFirstAvailableEditionData(product.editions);3010			// у mock-товаров uid пустой3011			if (edition.uid) {3012
История файла и сравнение версий
  • 04.12.2026, 04:03:55 · 56c3b845
imgEl.setAttribute(
3013 options.hasOriginalAspectRatio ? 'imgfield' : 'bgimgfield',
3014 'st_gallery__' + edition.uid + ':::0'
3015 );
3016 }
3017 }
3018
3019 str += '<div class="' + wrapperClassStr + '" style="' + wrapperStyle + '">';
3020 str += ' ' + t_store_get_productCard_mark_html(product, options);
3021 str += ' ' + imgEl.outerHTML;
3022 str += ' ' + (options.imageHover ? hoverImgEl : '');
3023 str += '</div>';
3024
3025 return str;
3026 } else {
3027 return '';
3028 }
3029}
3030
3031function t_store_get_productCard_img_replaceWith(product, el_product, options, curImage) {
3032 var el_image = el_product.querySelector('.t-store__card__imgwrapper');
3033 var el_newImage = t_store_get_productCard_img_html(product, options, curImage);
3034
3035 if (el_image) {
3036 el_image.outerHTML = el_newImage;
3037 }
3038
3039 t_store_popup_updateLazyLoad();
3040 t_store_triggerEvent(document.body, 'twishlist_addbtn');
3041}
3042
3043function t_store_get_productCard_imgElHover_html(product, options, curtImg) {
3044 if (product.gallery && product.gallery[0] === '[') {
3045 var galleryArr = JSON.parse(product.gallery);
3046 if (typeof galleryArr[1] !== 'undefined') {
3047 var imgSrc = galleryArr[1].img;
3048 // if current image is passed to the function find another unique image in gallery to show on hover
3049 if (curtImg && curtImg.length) {
3050 for (var i = 0; i < galleryArr.length; i++) {
3051 var img = galleryArr[i].img;
3052 if (img !== curtImg) {
3053 imgSrc = img;
3054 break;
3055 }
3056 }
3057 }
3058
3059 var imgEl;
3060 if (options.hasOriginalAspectRatio) {
3061 imgEl = document.createElement('img');
3062 imgEl.classList.add('t-store__card__img');
3063 imgEl.classList.add('t-store__card__img_second');
3064 imgEl.classList.add('t-img');
3065 imgEl.setAttribute('data-original', imgSrc);
3066 imgEl.src = t_store_getLazySrc(options, imgSrc);
3067 var isSafari16_3 = /Version\/16\.3 Safari/.test(navigator.userAgent);
3068 if (isSafari16_3) {
3069 imgEl.style.objectFit = 'contain';
3070 }
3071 } else {
3072 imgEl = document.createElement('div');
3073 imgEl.classList.add('t-store__card__bgimg', 't-store__card__bgimg_second');
3074 imgEl.classList.add('t-bgimg');
3075 imgEl.setAttribute('data-original', imgSrc);
3076 imgEl.style.backgroundImage = 'url("' + t_store_getLazyUrl(options, imgSrc) + '")';
3077 t_store_get_productCard_getImgStyles(imgEl, options);
3078 }
3079
3080 return imgEl.outerHTML;
3081 }
3082 }
3083 return '';
3084}
3085
3086function t_store_get_productCard_getImgStyles(el, options) {
3087 if (options && options.prodCard && options.prodCard.borderRadius) {
3088 var size = parseInt(options.prodCard.borderRadius, 10);
3089 el.style.borderRadius = size + 'px ' + size + 'px 0px 0px';
3090 if (size > 0 && !window.tStoreIsMobile) {
3091 el.style.top = '-2px';
3092 }
3093 }
3094}
3095
3096function t_store_get_productCard_mark_html(product, options) {
3097 if (!product.mark) {
3098 return '';
3099 }
3100 var stylesStr = '';
Предыдущие 100 строкСледующие 100 строк