PageSourceSearch

https://dom-maximalist.ru/local/templates/urbanist/assets/js/complex.js?17651914849589

js dom-maximalist.ru collected 2026-09-30 17:30:41 UTC 9,589 bytes, 239 lines download raw bytes

1function getBrowserVersion() {
2    const userAgent = navigator.userAgent;
3    const browserName = userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
4   
5    if (/trident/i.test(browserName[0])) {
6        const rv = /\brv[ :]+(\d+)/g.exec(userAgent) || [];
7        return `IE ${rv[1] || ''}`;
8    }
9   
10    const version = browserName[2] ? browserName[2] : null;
11    const browser = browserName[1] ? browserName[1] : null;
12   
13    if (browser === null || version === null) {
14        return 'Unknown Browser';
15    }
16   
17    return `${browser}`;
18}
19
20$(function() {
21    $(".header__menu .header-nav__item a").hover(
22        function() {
23            $this = $(this);
24            if($this.attr("data-submenu-id") === undefined){
25                $(".header__menu .header-nav__item a").removeClass("current");
26                $(".header__sub").removeClass("is-open");
27            }
28        }, function() {}
29    );
30    
31
32    if(getBrowserVersion() != "Safari"){
33        var position = $(window).scrollTop(); 
34        $(window).scroll(function() {
35            var scroll = $(window).scrollTop();
36            if(scroll > position) {
37                $(".header--complex").addClass("header-menu-scroll");
38            } else {
39                $(".header--complex").removeClass("header-menu-scroll");
40            }
41            position = scroll;
42        });
43    }
44
45    
46    document.querySelector(".sticky-header").addEventListener("scroll", function() {
47        if(this.scrollHeight === this.scrollTop + this.clientHeight){
48            $(".sticky-header .submenu__action").removeClass("end");
49        }else{
50            $(".sticky-header .submenu__action").addClass("end");
51        }
52    });
53
54    $(".header--complex .submenu-nav__title").on("click", function(){
55        var mobileMenuH = $(".sticky-header").innerHeight();
56        var mobileSubMenuH = $(".sticky-header .submenu__container").innerHeight();
57        if(mobileMenuH > mobileSubMenuH){
58            $(".sticky-header .submenu__action").removeClass("end");
59        }else{
60            $(".sticky-header .submenu__action").addClass("end");
61        }
62    });
63
64    var mobileMenuH = $(".sticky-header").innerHeight();
65    var mobileSubMenuH = $(".sticky-header .submenu__container").innerHeight();
66    if(mobileMenuH > mobileSubMenuH){
67        $(".sticky-header .submenu__action").removeClass("end");
68    }
69
70
71
72    // Наведенеие на плане дома
73    $(".complex-plan--flors svg .flor, .complex-plan--flor svg .apartment").hover(
74        function(e) {
75            var $this = $(this),
76                dataFlor = $this.data("flor"),
77                dataApartments = $this.data("apartments"),
78                dataApartment = $this.data("apartment"),
79                html = "",
80                jsBlock = $("#js-complex-plan-flor");
81            if(dataFlor){
82                html = "<div class='complex-plan-flor_block'><div class='complex-plan-flor__top-name'><span>"+dataFlor.section+"</span><span>"+dataFlor.name+"</span></div>";
83                if(dataFlor.apartment){
84                    html = html  + "<div class='complex-plan-flor__top-apartment'><span>"+dataFlor.apartment+"</span></div>";
85                }
86                if(dataFlor.finishing){
87                    var finishing = dataFlor.finishing.split(',');
88                    html = html + "<div class='complex-plan-flor__top-tags'>";
89                    finishing.forEach(function(item, i, arr) {
90                        html = html + "<span class='tag'><span>"+item+"</span></span>"
91                    });
92                    html = html + "</div>";
93                }
94                if(dataApartments){
95                    html = html + "<ul class='apartments line-list'>";
96                    dataApartments.split('#').forEach(function(item, i, arr) {
97                        var apart = item.split('/');
98                        html = html + "<li><span class='left'>"+apart[0]+"</span><span class='right'>"+apart[1]+"</span></li>";
99                    });
100                    html = html + "</ul>";
101                }
102                html = html + "</div>";
103            }else if(dataApartment){
104                html = "<div class='complex-plan-apartment_block'>";
105                    html = html + "<div class='complex-plan-apartment__top-name'><span>"+dataApartment.name+"</span></div>";
106
107                    if(dataApartment.number || dataApartment.finishing){
108                        html = html + "<ul class='apartments line-list'>";
109                        if(dataApartment.number){
110                            var number = dataApartment.number.split('/');
111                            html = html + "<li><span class='left'>"+number[0]+"</span><span class='right'>"+number[1]+"</span></li>";
112                        }
113                        if(dataApartment.finishing){
114                            html = html + "<li><span class='left'>Отделка</span><span class='right'>"+dataApartment.finishing+"</span></li>";
115                        }
116                        html = html + "</ul>";
117                    }
118
119                    html = html + "<div class='price-blocks'>";
120                        html = html + "<div class='price-block'>";
121                            html = html + "<span class='price-block'>"+dataApartment.price+"</span>";
122                            if(dataApartment.oldPrice){
123                                html = html + "<span class='price-block-old'>"+dataApartment.oldPrice+"</span>";
124                            }
125                        html = html + "</div>";
126                        if(dataApartment.sale){
127                            var saleClass = "promotion";
128                            if(dataApartment.saleClass){
129                                saleClass = dataApartment.saleClass;
130                            }
131                            html = html + "<div><span class='"+saleClass+"'>"+dataApartment.sale+"</span></div>";
132                        }
133                    html = html + "</div>";
134
135                html = html + "</div>";
136                
137            }else{
138                html = "";
139            }
140            jsBlock.html(html);
141            jsBlock.addClass("open");
142        }, function() {
143            $("#js-complex-plan-flor").removeClass("open");
144            // $("#js-complex-plan-flor").html("");
145        }
146    );
147    $(".complex-plan--flor").mousemove(function(e){
148        // положение элемента
149        var pos = $(this).offset();
150        var elem_left = pos.left;
151        var elem_top = pos.top;
152        var complex_plan = $("#js-complex-plan-flor").width();
153        var elem_width = $(this).width();
154        // положение курсора внутри элемента
155        var Xinner = e.pageX - elem_left;
156        var Yinner = e.pageY - elem_top;
157        $("#js-complex-plan-flor").css(
158            {
159                left: Xinner,
160                top: Yinner
161            }
162        );
163    });
164
165    // Наведенеие на плане комплекса
166    $(".complex-plan svg g").hover(
167        function() {
168            var id = $(this).data("id");
169            $(".plan__hints li[data-id='"+id+"']").addClass("hover");
170        }, function() {
171            var id = $(this).data("id");
172            $(".plan__hints li[data-id='"+id+"']").removeClass("hover");
173        }
174    );
175    $(".complex-plan .plan__hints>li").hover(
176        function() {
177            var id = $(this).data("id");
178            $(".complex-plan svg g[data-id='"+id+"']").addClass("hover");
179        }, function() {
180            var id = $(this).data("id");
181            $(".complex-plan svg g[data-id='"+id+"']").removeClass("hover");
182        }
183    );
184    
185    // Slick Карусель
186    $('.slick-carusel').each(function() {
187        var $this = $(this);
188
189        var option = {};
190        if($this.hasClass("custom-dots-img")){
191            var dataDots = [];
192            // $this.on("init", function(e){
193                $(".item:not(.slick-cloned)", $this).each(function(i) {
194                    dataDots.push($(this).data("dots"));
195                });
196            // });
197            setTimeout(() => {
198                var dots = $(".slick-dots", $this.parent());
199                $("li", dots).each(function(i) {
200                    var dot = $(this);
201                    var img = "";
202                    if(dataDots[i].img){
203                        img = 
204                        "<div class='img'>"+
205                            "<img src='"+dataDots[i].img+"'>"+
206                        "</div>";
207                    }
208                    var html = 
209                        "<div class='dot-item'>"+
210                            img+
211                            "<div class='name'>"+
212                                "<span>"+dataDots[i].name+"</span>"+
213                                "<span class='timer'><span>"+dataDots[i].name+"</span></span>"+
214                            "</div>"+
215                        "</div>";
216                    $("button", dot).html(html);
217                });
218            }, 0);
219        }
220
221        if($this.attr("data-arrow")){
222            var arrow = $this.attr("data-arrow").split(',');
223            option = {
224                nextArrow: $(arrow[0]),
225                prevArrow: $(arrow[1])
226            }
227            
228        }
229
230        $this.slick(option);        
231    });
232
233    $(".show-more-text-btn").on("click", function(){
234        var $this = $(this),
235            Parent = $this.parent();
236        $this.toggleClass("open");
237        $(".complex--progress__text-vals-block", Parent).toggleClass("open");
238    });
239});

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.