PageSourceSearch

https://rtds.ru/local/templates/main/js/mainpage.js?17319381064539

js rtds.ru collected 2026-09-29 06:38:44 UTC 4,539 bytes, 136 lines download raw bytes

1const mainSlider = new Swiper('.main-slider__container', {
2    direction: 'horizontal',
3    loop: true,
4	autoplay: {
5		delay: 10000,
6	},
7    speed: 1000,
8    //autoHeight: true,
9    pagination: {
10        el: '.swiper-pagination',
11        clickable: true
12    },
13    navigation: {
14	    prevEl: '.swiper-button-prev',
15        nextEl: '.swiper-button-next'
16    }
17})
18console.log('.main-slider-new')
19if(document.querySelector('.main-slider-new')){
20    const mainSlider2 = new Swiper('.main-slider-new .swiper-container', {
21        direction: 'horizontal',
22        loop: true,
23        autoplay: {
24            delay: 10000,
25        },
26        slidesPerView: 1,
27        speed: 1000,
28        // autoHeight: true,
29        pagination: {
30            el: '.swiper-pagination',
31            clickable: true
32        },
33        navigation: {
34            prevEl: '.swiper-button-prev',
35            nextEl: '.swiper-button-next'
36        },
37        pagination: false,
38        breakpoints: {
39            768: {
40                pagination: true
41            }
42        }
43    })
44}
45
46let carTabsOptions = {
47    tabGroupParentSelector: '.js-cartabs-parent', // Селектор родительского контейнера.
48    tabBtnSelector: '.js-chapter-btn', // Селектор вкладки (таба).
49    tabContentSelector: '.js-tab-typecontent', // Селектор контентного блока.
50    activationClass: 'active', // CSS класс, активирующий видимость таба и соответствующей ему контентной области.
51    defaultTabToShow: '.js-chapter-btn:nth-child(1)' // Псевдокласс или иной селектор, который однозначно укажет на вкладку, которая должна быть активна по умолчанию.
52};
53
54const carTab = new TabMaker(carTabsOptions);
55carTab.createTabs();
56
57const offersSlider = new Swiper('.offers__slider', {
58    direction: 'horizontal',
59    loop: false,
60/*
61    initialSlide: 1,
62    slidesPerGroup: 1,
63*/
64    speed: 1000,
65    freeMode: false,
66    spaceBetween: 32,
67    slidesPerView: 1,
68    roundLengths: true,
69    observer: true,
70    observeParents: true,
71    navigation: {
72        nextEl: '.offers__slider-next-button',
73        prevEl: '.offers__slider-prev-button'
74    },
75	  breakpoints: {
76		500: {
77			slidesPerView: 2
78		},
79		1024: {
80			slidesPerView: 3
81		}
82	  }
83})
84
85let offersOptions = {
86    tabGroupParentSelector: '.js-offers-parent', // Селектор родительского контейнера.
87    tabBtnSelector: '.js-offer-tab', // Селектор вкладки (таба).
88    tabContentSelector: '.js-offer-tabcontent', // Селектор контентного блока.
89    activationClass: 'active', // CSS класс, активирующий видимость таба и соответствующей ему контентной области.
90    defaultTabToShow: '.js-offer-tab:nth-child(1)' // Псевдокласс или иной селектор, который однозначно укажет на вкладку, которая должна быть активна по умолчанию.
91};
92const offersTabs = new TabMaker(offersOptions);
93offersTabs.createTabs();
94
95
96function moveDots(option) {
97    const mainSliderImage = document.querySelector('.main-slider__image');
98    if(!mainSliderImage) return;
99    const sliderBullets = document.querySelector('.main-slider .swiper-pagination-bullets');
100    setTimeout(() => {
101        sliderBullets.style.top = mainSliderImage.offsetHeight + (option) + 'px';
102    }, 100)
103}
104
105function DotMoveController() {
106    if (window.innerWidth > 1190 || document.body.clientWidth > 1190) {
107        moveDots(-32)
108    } else if ((window.innerWidth <= 1189 && window.innerWidth >= 768 ) || (document.body.clientWidth <= 1189 && document.body.clientWidth >= 768)) {
109        moveDots(20)
110    } else if (window.innerWidth < 768 || document.body.clientWidth < 768) {
111        moveDots(-32)
112    }
113}
114
115window.onload = function () {
116    DotMoveController();
117	HeightBlockOffer();
118};
119
120window.addEventListener('resize', function() {
121    DotMoveController();
122	HeightBlockOffer();
123});
124
125function HeightBlockOffer() {
126els = document.getElementsByClassName('offers__slide-informer');
127var maxHeightEl = 0;
128Array.prototype.forEach.call(els, function(el) {
129    // Do stuff here
130	if (el.clientHeight > maxHeightEl)
131		maxHeightEl = el.clientHeight;
132});
133Array.prototype.forEach.call(els, function(el) {
134 el.style.height = maxHeightEl + 'px';
135});
136}

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.