201fill-rule="evenodd"202clip-rule="evenodd"203d="M12.1757 0.175732C12.4101 -0.0585748 12.7891 -0.0585799 13.0234 0.175732C13.2576 0.410053 13.2577 0.789111 13.0234 1.02339L7.44722 6.59956L13.0234 12.1757C13.2576 12.4101 13.2577 12.7891 13.0234 13.0234C12.7891 13.2577 12.4101 13.2576 12.1757 13.0234L6.59956 7.44722L1.02339 13.0234C0.789107 13.2576 0.410026 13.2576 0.175736 13.0234C-0.0585454 12.7891 -0.0584791 12.4101 0.175736 12.1757L5.75191 6.59956L0.175736 1.02339C-0.0585786 0.789074 -0.0585786 0.410047 0.175736 0.175732C0.410051 -0.0585748 0.78908 -0.0585799 1.02339 0.175732L6.59956 5.7519L12.1757 0.175732Z"204/>205</svg>`;206}207if (icon === 'loader') {208return `209<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="40" height="40">210<g fill="#c5c5c5">
<rect class="t-icon-loader-rect" x="14" width="4" height="11" rx="2" /> <rect class="t-icon-loader-rect" x="14" width="4" height="11" rx="2" transform="rotate(45 16 16)" /> <rect class="t-icon-loader-rect" x="14" width="4" height="11" rx="2" transform="rotate(90 16 16)" /> <rect class="t-icon-loader-rect" x="14" width="4" height="11" rx="2" transform="rotate(135 16 16)" /> <rect class="t-icon-loader-rect" x="14" width="4" height="11" rx="2" transform="rotate(180 16 16)" /> <rect class="t-icon-loader-rect" x="14" width="4" height="11" rx="2" transform="rotate(225 16 16)" /> <rect class="t-icon-loader-rect" x="14" width="4" height="11" rx="2" transform="rotate(270 16 16)" /> <rect class="t-icon-loader-rect" x="14" width="4" height="11" rx="2" transform="rotate(315 16 16)" /> </g> </svg>`; } if (icon === 'arrow-left') { return `<svg width="9" height="14" viewBox="0 0 9 14" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M7.62939 0.600006L0.879395 6.90001L7.62939 13.2" stroke="black" stroke-width="1.2" stroke-linecap="round"/> </svg>`; } if (icon === 'arrow-right') { return `<svg width="9" height="14" viewBox="0 0 9 14" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M0.599976 0.600006L7.34998 6.90001L0.599976 13.2" stroke="black" stroke-width="1.2" stroke-linecap="round"/> </svg>`; } return '';}/** * Задаём основные слушатели при активации зум галереи: * 1) Закрытие по кнопке и по ESC * 2) Перемещение стрелками * 3) Открытие зум галереи по клику * 4) Обновление скейл-состояния при ресайзе * 5) Обновление позиции и высоты слайдов */function t_zoom__setEvents() { const { isMobile } = t_getZoomState(); const closeBtn = document.querySelector('.t-zoomer__close'); closeBtn?.addEventListener('click', () => t_zoom_close()); document.addEventListener('keydown', e => { const { isOpen } = t_getZoomState(); if (!isOpen) return; switch (e.key) { case 'Escape': e.preventDefault(); t_zoom_close(); break; case 'ArrowLeft': e.preventDefault(); t_zoom__setEventOnBtn('prev'); break; case 'ArrowRight': e.preventDefault(); t_zoom__setEventOnBtn('next'); break; } }); const zoomSelector = '.t-zoomable:not([data-img-zoom-url=""]), .t-slds__thumbs_gallery-zoomable, ' + '.t-zero-gallery__content_zoomable[data-img-zoom-url]:not([data-img-zoom-url=""])'; document.addEventListener('click', e => { const zoomableElement = e.target.closest(zoomSelector); if (!zoomableElement) return; t_zoom_openGallery(zoomableElement); }); const currentEvent = isMobile ? 'orientationchange' : 'resize'; window.addEventListener(currentEvent, t_zoom_checkForScale); window.addEventListener(currentEvent, t_zoom__updateActiveSlidePos); t_zoom__hideGalleryUI();}/** * Плавная анимация перемещения изображения из зоны клика к финальному элементу * * @param {HTMLElement | null} zoomableElement * @param {HTMLElement | null} finalElement */function t_zoom__playAnimatedOpen(zoomableElement, finalElement) { if (!zoomableElement || !finalElement) return; if (finalElement.src) { createClonedImage(finalElement.src); } else { const mutationObserver = new MutationObserver(mutations => { mutations.forEach(mutation => { if (mutation.type === 'attributes' && mutation.attributeName === 'src') { createClonedImage(finalElement.src); mutationObserver.disconnect(); } });