PageSourceSearch

https://spas-rt.ru/build/assets/SliderPhoto-14c71772.js

js spas-rt.ru collected 2026-09-25 04:49:40 UTC 5,423 bytes, 1 lines download raw bytes

1import{P as a}from"./Popup-c32ad197.js";class c extends a{constructor(e,t){super(e),this._sliderInstance=t,this.currentPopupImage=this._popupElement.querySelector(".popup__img"),this._sliderNextButton=this._popupElement.querySelector(".next.sliderNextButton"),this._sliderPrevButton=this._popupElement.querySelector(".prev.sliderPrevButton"),this._handleKeyboardArrow=this._handleKeyboardArrow.bind(this),this._handleNextClick=this._handleNextClick.bind(this),this._handlePrevClick=this._handlePrevClick.bind(this)}_changeSlideAndPopup(e){this._sliderInstance&&(e==="next"?this._sliderInstance.plusSlideImg():this._sliderInstance.minusSlideImg())}refreshImage(){if(!this._popupElement.classList.contains("popup_opened")||!this._sliderInstance||this._sliderInstance.sliderImages.length===0)return;const e=this._sliderInstance.sliderImages[this._sliderInstance.index-1];e&&this.currentPopupImage&&(this.currentPopupImage.src=e.src,this.currentPopupImage.alt=e.alt)}_handleNextClick(e){e.preventDefault(),this._changeSlideAndPopup("next")}_handlePrevClick(e){e.preventDefault(),this._changeSlideAndPopup("prev")}_handleKeyboardArrow(e){e.key==="ArrowRight"?this._changeSlideAndPopup("next"):e.key==="ArrowLeft"&&this._changeSlideAndPopup("prev")}open({name:e,link:t}){super.open(),this.currentPopupImage.src=t,this.currentPopupImage.alt=e,document.addEventListener("keydown",this._handleKeyboardArrow)}close(){super.close(),document.removeEventListener("keydown",this._handleKeyboardArrow)}setEventListeners(){super.setEventListeners(),this._sliderNextButton&&this._sliderNextButton.addEventListener("click",this._handleNextClick),this._sliderPrevButton&&this._sliderPrevButton.addEventListener("click",this._handlePrevClick)}}class p{constructor(e,t){this.slider=e,this.index=t,this.sliderNextButton=this.slider.querySelector(".sliderNextButton"),this.sliderPrevButton=this.slider.querySelector(".sliderPrevButton"),this.openPopupButton=this.slider.querySelector(".image-slider_button"),this.sliderImages=this.slider.querySelectorAll(".item_img"),this.currentImage=this.slider.querySelector(".slider_img"),this.galleryDots=this.slider.querySelectorAll(".gallery-dots__item"),this.miniGalleryItems=this.slider.querySelectorAll(".new-gallery-mini__item"),this.miniGalleryContainer=this.slider.querySelector(".new-gallery-mini"),this.popup=new c(this.slider.querySelector(".popup_type_photo"),this),this.popup.setEventListeners(),this.closePopupButton=this.slider.querySelector(".popup__btn-close"),this.dotsTranslateIndex=6,this.dotsCount=0}plusSlideImg(){this.showSlidesImg(this.index+=1),this.index===this.dotsTranslateIndex?(this.dotsCount+=30,this.translateDots(this.dotsCount),this.dotsTranslateIndex+=5):this.index===1&&(this.dotsCount=0,this.translateDots(this.dotsCount),this.dotsTranslateIndex=6)}minusSlideImg(){this.index===this.dotsTranslateIndex-5&&this.index>1?(this.dotsCount-=30,this.translateDots(this.dotsCount),this.dotsTranslateIndex-=5):this.index===1&&this.galleryDots.length>5&&(this.dotsCount=30*(this.galleryDots.length/5)-12,this.translateDots(this.dotsCount),this.dotsTranslateIndex=this.galleryDots.length+5),this.showSlidesImg(this.index-=1)}currentSlideImg(e){this.showSlidesImg(this.index=e)}translateDots(e){return this.galleryDots.forEach(t=>t.style.transform=`translateY(-${e}px)`)}_scrollMiniGalleryToActive(){if(!this.miniGalleryContainer||this.miniGalleryItems.length===0)return;const e=this.miniGalleryItems[this.index-1];if(!e)return;const t=this.miniGalleryContainer,i=t.offsetWidth,l=t.scrollLeft,s=e.offsetLeft,o=e.offsetWidth,n=s+o,h=l,d=l+i;s<h?t.scrollTo({left:s,behavior:"smooth"}):n>d&&t.scrollTo({left:n-i,behavior:"smooth"})}_updateActiveMiniGalleryItem(){if(this.miniGalleryItems.length===0)return;this.miniGalleryItems.forEach(t=>t.classList.remove("new-gallery-mini__item_active"));const e=this.miniGalleryItems[this.index-1];e&&e.classList.add("new-gallery-mini__item_active")}setEventListeners(){this.sliderNextButton&&this.sliderNextButton.addEventListener("click",()=>this.plusSlideImg()),this.sliderPrevButton&&this.sliderPrevButton.addEventListener("click",()=>
1this.minusSlideImg());const e=()=>{const t=this.sliderImages[this.index-1];this.popup.open({name:t.alt,link:t.src})};this.openPopupButton&&this.openPopupButton.addEventListener("click",e),this.currentImage&&this.currentImage.addEventListener("click",e),this.closePopupButton&&this.closePopupButton.addEventListener("click",()=>this.popup.close()),this.galleryDots.forEach((t,i)=>{t.addEventListener("click",()=>this.currentSlideImg(i+1))}),this.miniGalleryItems.forEach((t,i)=>{t.addEventListener("click",()=>this.currentSlideImg(i+1))})}showSlidesImg(e){e>this.sliderImages.length&&(this.index=1,this.dotsCount=0),e<1&&(this.index=this.sliderImages.length);for(let t=0;t<this.sliderImages.length;t++)this.sliderImages[t].style.display="none",this.sliderImages[t].classList.remove("image_active"),this.galleryDots&&this.galleryDots.length>=1&&this.galleryDots[t].classList.remove("gallery-dots__item_active");return this.sliderImages.length!==0&&(this.sliderImages[this.index-1].classList.add("image_active"),this.sliderImages[this.index-1].style.display="block",this.galleryDots&&this.galleryDots.length>=1&&this.galleryDots[this.index-1].classList.add("gallery-dots__item_active")),this._updateActiveMiniGalleryItem(),this._scrollMiniGalleryToActive(),this.popup.refreshImage(),this.index}}export{p as S};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.