* @param {Object} options
915function t_store_renderSnippetButtonIcon(recid, options) { 917 const { buttonicon, buttoniconhover } = options; 919 if (!buttonicon && !buttoniconhover) { 923 const button = t_store_getSnippetMainButton(recid); 929 const iconEl = document.createElement('span'); 930 iconEl.className = 't-btnflex__icon'; 934 iconStyle += `--icon:url("${buttonicon.replace(/"/g, '"')}");\n`; 935 if (buttonicon.includes('/lib/icons/button/')) { 936 iconEl.classList.add('t-btnflex__icon_default_glyph'); 940 if (buttoniconhover) { 941 iconEl.classList.add('t-btnflex__icon_has_hover'); 942 iconStyle += `--icon-hover:url("${buttoniconhover.replace(/"/g, '"')}");\n`; 943 if (buttoniconhover.includes('/lib/icons/button/')) { 944 iconEl.classList.add('t-btnflex__icon_hover_glyph'); 949 iconEl.setAttribute('style', iconStyle); 952 button.insertAdjacentElement('afterbegin', iconEl); 954 console.error('Ошибка при рендере иконки в кнопке: ' + error); 958function t_store_createCssProperty(propertyName, value) { 959 return `${propertyName}: ${value};`; 962function t_store_addRule(targetArr, prop, val) { 963 if (val === undefined || val === null || val === '') return; 964 targetArr.push(t_store_createCssProperty(prop, val)); 967function t_store_addTextColorRule(targetArr, val) { 968 if (t_store_isGradient(val)) { 969 t_store_addRule(targetArr, 'background-image', val); 970 t_store_addRule(targetArr, 'color', 'transparent'); 971 t_store_addRule(targetArr, '-webkit-background-clip', 'text'); 972 t_store_addRule(targetArr, 'background-clip', 'text'); 974 t_store_addRule(targetArr, 'color', val); 978function t_store_isGradient(stylePropertyValue) { 979 return typeof stylePropertyValue === 'string' && stylePropertyValue.indexOf('gradient') !== -1; 983 * Добавляет анимацию смены фона при наведении 984 * @param {string} css 987function t_store_appendMainButtonBgHoverStyle(css) { 992 @media (hover: hover) { 993 .t-store__prod-snippet__container .t-store__prod-popup__btn:hover { 994 animation-name: t-button-hover-animation; 995 animation-duration: 0s; 996 animation-fill-mode: forwards; 998 animation-timing-function: linear;