PageSourceSearch

https://resanthotels.az/assets/js/custom.js

js resanthotels.az collected 2026-10-05 07:15:33 UTC 22,907 bytes, 754 lines download raw bytes

1/* ----------------- Start JS Document ----------------- */
2(function($) {
3    "use strict";
4
5    $(document).ready(function() {
6        /*=============================================
7        =            Rezervation form            =
8        =============================================*/
9        
10        $('#myform').submit(function(e) {
11
12            var data = $(this).serializeArray();
13            var price = {price: $("#room_class  option:selected").attr("data-price")};
14            //localStorage.setItem("price", JSON.stringify(price));
15            // console.log(price);return false;
16            $.each(data, function(key, value) {
17
18                if (data[key].value.length === 0) {
19                    alert("Choose all sections");
20                    e.preventDefault();
21                    return false;
22
23                }
24
25            });
26            localStorage.setItem("data", JSON.stringify(data));
27            localStorage.setItem("price", JSON.stringify(price));
28
29        });
30
31        
32
33        function fillList(data, price) {
34            $(".payment-card-list ul li .pay-left").eq(0).html(data[0].value + ' - ' + data[3].value);
35            $(".payment-card-list ul li .pay-left").eq(1).find('.from').html(data[1].value);
36            $(".payment-card-list ul li .pay-left").eq(1).find('.to').html(data[2].value);
37            $(".payment-card-list ul li .pay-left").eq(2).find('span').html(data[4].value);
38            
39            $.each(data, function(key, value) {                
40                $(".bill-payment input:hidden").eq(key).val(data[key].value);                
41            });
42        }
43
44        function getSum(data, price) {
45
46            //var sum = (conf[data[3].value][data[2].value]);
47            var a = new Date(data[1].value);
48            var d = new Date(data[2].value);
49            // Or any other JS date
50
51            console.log(price);
52
53            var sum = price.price * dateDiffInDays(a, d);
54            $(".total-price span").html(parseFloat(sum) + ' AZN');
55            // $(".billing-form input:hidden").last().val(sum);
56            // $('.total-price span').prepend(sum);
57
58        }
59
60        // a and b are javascript Date objects
61        function dateDiffInDays(a, b) {
62            // Discard the time and time-zone information.
63            var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());
64            var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());
65            var _MS_PER_DAY = 1000 * 60 * 60 * 24;
66            return Math.floor((utc2 - utc1) / _MS_PER_DAY);
67        }
68        var price = JSON.parse(localStorage.getItem("price"));
69        var data = JSON.parse(localStorage.getItem("data"));
70
71        if (data && price) {
72            fillList(data, price);
73            getSum(data, price);
74        }
75        
76        
77        /*=====  End of Rezervation form ======*/
78        
79        
80
81        // Our client
82        var maping_slider = $(".maping-slider");
83        maping_slider.owlCarousel({
84            items: 4,
85            nav: true,
86            dots: false,
87            autoplay: false,
88            mouseDrag: false,
89            loop: true,
90            slideBy: 4,
91            autoplayHoverPause: true,
92            responsive: {
93                0: {
94                    items: 4,
95                    slideBy: 4
96                },
97                768: {
98                    items: 4,
99                }
100            },
101            navText: ['<i class="fas fa-plus"></i>', '<i class="fas fa-plus"></i>']
102        });
103
104        $('a[data-toggle="tab"]').on('shown.bs.tab', function(event) {
105            $(this).closest('.maping-slider').find('.active-me').removeClass('active-me');
106            $(event.target).addClass('active-me');
107        });
108
109
110        // About
111        var about = $(".about");
112        about.owlCarousel({
113            items: 1,
114            nav: false,
115            dots: false,
116            autoplay: true,
117            loop: true
118        });
119
120        // Our client
121        var guideSlider = $(".guide-slider");
122        guideSlider.owlCarousel({
123            items: 4,
124            nav: false,
125            dots: false,
126            autoplay: true,
127            margin: 30,
128            autoplaySpeed: 1000,
129            smartSpeed: 100,
130            loop: true,
131            autoplayHoverPause: true,
132            responsive: {
133                0: {
134                    items: 1,
135                    nav: false
136                },
137                500: {
138                    items: 2,
139                },
140                1000: {
141                    items: 5,
142                }
143
144
145            },
146            navText: ['<i class="fas fa-angle-left"></i>', '<i class="fas fa-angle-right"></i>']
147        });
148
149
150        // Our client
151        var client_says = $(".client-says-slider");
152        client_says.owlCarousel({
153            items: 1,
154            autoplay: true,
155            center: true,
156            loop: true,
157            autoplayHoverPause: true,
158            navText: ['<i class="fas fa-angle-left"></i>', '<i class="fas fa-angle-right"></i>']
159        });
160
161
162        // Our client
163        var ourClient = $(".client-slider");
164        ourClient.owlCarousel({
165            items: 3,
166            nav: false,
167            dots: false,
168            autoplay: true,
169            center: true,
170            loop: true,
171            autoplayHoverPause: true,
172            responsive: {
173                0: {
174                    items: 3,
175                    nav: false
176                },
177                768: {
178                    items: 5,
179                }
180
181            },
182            navText: ['<i class="fas fa-angle-left"></i>', '<i class="fas fa-angle-right"></i>']
183        });
184
185
186        /* Animated skills Bars */
187        function DemoProgressbars() {
188
189            var prog;
190
191            $('.bar-progres').each(function() {
192                prog = $(this);
193                prog.LineProgressbar({
194                    percentage: prog.data('percent'),
195                    fillBackgroundColor: prog.data('color'),
196                    duration: 2500
197                });
198            });
199
200        }
201
202        $('.progressbar-start').waypoint(function() {
203            DemoProgressbars();
204        }, {
205            offset: '100%',
206            triggerOnce: true
207        });
208
209
210        // Video Popup
211        $(".various").fancybox({
212            maxWidth: 800,
213            maxHeight: 600,
214            fitToView: false,
215            width: '70%',
216            height: '70%',
217            autoSize: false,
218            closeClick: false,
219            openEffect: 'none',
220            closeEffect: 'none'
221        });
222
223        $("[data-fancybox]").fancybox({
224            // Options will go here
225            toolbar: true,
226            animationEffect: "zoom-in-out",
227            transitionEffect: "circular",
228            thumbs: {
229                autoStart: false, // Display thumbnails on opening
230                hideOnClose: true, // Hide thumbnail grid when closing animation starts
231                parentEl: '.fancybox-container', // Container is injected into this element
232                axis: 'y' // Vertical (y) or horizontal (x) scrolling
233            },
234            buttons: [
235                'slideShow',
236                'fullScreen',
237                'thumbs',
238                'close'
239            ],
240
241        });
242
243        /* Init Counterup */
244        $('.counter').counterUp({
245            delay: 4,
246            time: 1000
247        });
248
249        // carousel to mobile touchable
250        $('.carousel').each(function() {
251            var el = $(this);
252            el.swiperight(function() {
253                el.carousel('prev');
254            });
255            el.swipeleft(function() {
256                el.carousel('next');
257            });
258        });
259
260
261        // Slick Slider || Testimonial
262        $('.slider-for').slick({
263            slidesToShow: 1,
264            slidesToScroll: 1,
265            arrows: false,
266            fade: true,
267            dots: false,
268            centerPadding: 0,
269            asNavFor: '.slider-nav'
270        });
271
272        $('.slider-nav').slick({
273            slidesToShow: 3,
274            slidesToScroll: 1,
275            asNavFor: '.slider-for',
276            dots: false,
277            arrows: true,
278            infinite: true,
279            centerMode: true,
280            centerPadding: 0,
281            focusOnSelect: true,
282            centerMode: true,
283            centerPadding: '60px',
284            speed: 200,
285
286            responsive: [{
287                breakpoint: 768,
288                settings: {
289                    slidesToShow: 1
290                }
291            }]
292        });
293
294
295        //Slick Nav 
296        $('.wpb-mobile-menu').slicknav({
297            prependTo: '.navbar-header',
298            parentTag: 'margo',
299            allowParentLinks: true,
300            duplicate: false,
301            label: '',
302            closedSymbol: '<i class="fa fa-plus"></i>',
303            openedSymbol: '<i class="fa fa-minus"></i>'
304        });
305
306
307        // Menu Area Start
308        $('.toggle-inner').on('click', function(e) {
309            e.preventDefault();
310            $('body').toggleClass('going');
311            $('.close-menu').on('click', function() {
312                $('body').removeClass('going');
313            });
314        });
315
316        var Concertina = function(el, multiple) {
317            this.el = el || {};
318
319            this.multiple = multiple || false;
320
321            var dropdown_here = this.el.find('.dropdown-here');
322            dropdown_here.on('click', {
323                    el: this.el,
324                    multiple: this.multiple
325                },
326                this.dropdown);
327        };
328
329        Concertina.prototype.dropdown = function(e) {
330            e.preventDefault();
331            var $el = e.data.el,
332                $this = $(this),
333
334                $next = $this.next();
335
336            $next.slideToggle();
337            $this.parent().toggleClass('open');
338
339            if (!e.data.multiple) {
340                //show only one menu at the same time
341                $el.find('.submenuItems').not($next).slideUp().parent().removeClass('open');
342            }
343        }
344        var accordion = new Concertina($('.slide-menu'), false);
345        // Menu Area End
346
347        // Date Choose
348        $(function() {
349            $('.date-choose').datetimepicker({
350                daysOfWeekDisabled: [],
351                format: 'DD/MMM/YY'
352            });
353        });
354        // Date Choose
355        $(function() {
356            $('.time-choose').datetimepicker({
357                daysOfWeekDisabled: [],
358                format: 'HH:mm'
359            });
360        });
361
362        $(function () {
363            $('.date-choose-placehold input').val('');
364        });
365
366        // Rate Yo!
367        $(".rateUs").rateYo({
368            rating: 3.6
369        });
370
371
372
373        /*
374        ----------------------------------------
375        Select Dropdown Filtering
376        -----------------------------------------
377        */
378        // Range sliders initialization
379        $(".range-slider-ui").each(function() {
380            var minRangeValue = $(this).attr('data-min');
381            var maxRangeValue = $(this).attr('data-max');
382            var minName = $(this).attr('data-min-name');
383            var maxName = $(this).attr('data-max-name');
384            var unit = $(this).attr('data-unit');
385
386            $(this).append("" +
387                "<span class='min-value'></span> " +
388                "<span class='max-value'></span>" +
389                "<input class='current-min' type='hidden' name='" + minName + "'>" +
390                "<input class='current-max' type='hidden' name='" + maxName + "'>"
391            );
392            $(this).slider({
393                range: true,
394                min: minRangeValue,
395                max: maxRangeValue,
396                values: [minRangeValue, maxRangeValue],
397                slide: function(event, ui) {
398                    event = event;
399                    var currentMin = parseInt(ui.values[0], 10);
400                    var currentMax = parseFloat(ui.values[1]);
401                    $(this).children(".min-value").text(unit + " " + currentMin);
402                    $(this).children(".max-value").text(unit + " " + currentMax);
403                    $(this).children(".current-min").val(currentMin);
404                    $(this).children(".current-max").val(currentMax);
405                }
406            });
407
408            var currentMin = parseInt($(this).slider("values", 0), 10);
409            var currentMax = parseFloat($(this).slider("values", 1));
410            $(this).children(".min-value").text(unit + " " + currentMin);
411            $(this).children(".max-value").text(unit + " " + currentMax);
412            $(this).children(".current-min").val(currentMin);
413            $(this).children(".current-max").val(currentMax);
414        });
415
416
417    }); //$(document).ready
418
419
420
421    //Back Top Link
422
423    var offset = 200;
424    var duration = 500;
425    $(window).scroll(function() {
426        if ($(this).scrollTop() > offset) {
427            $('.back-to-top').fadeIn(400);
428        } else {
429            $('.back-to-top').fadeOut(400);
430        }
431    });
432
433    $('.back-to-top').on('click', function(event) {
434        event.preventDefault();
435        $('html, body').animate({
436            scrollTop: 0
437        }, 600);
438        return false;
439    });
440
441
442    /*
443    ----------------------------------------
444    Select Dropdown Filtering
445    -----------------------------------------
446    */
447    // init Isotope
448    var $container = $('.catGrid');
449    var PageLoadFilter = '.cat1';
450    $container.isotope({
451        filter: PageLoadFilter
452    });
453
454    var $catGrid = $('.catGrid').isotope({
455        itemSelector: '.element-item',
456        layoutMode: 'fitRows',
457    });
458    // bind filter on select change
459    $('.filters-select').on('change', function() {
460        // get filter value from option value
461        var filterValue = this.value;
462        $catGrid.isotope({
463            filter: filterValue
464        });
465    });
466
467    // filter functions
468    var filterFns = {
469        // show if number is greater than 50
470        numberGreaterThan50: function() {
471            var number = $(this).find('.number').text();
472            return parseInt(number, 10) > 50;
473        },
474        // show if name ends with -ium
475        ium: function() {
476            var name = $(this).find('.name').text();
477            return name.match(/ium$/);
478        }
479    };
480
481    /*
482    ----------------------------------------
483    Select Count Items Filtering
484    -----------------------------------------
485    */
486    // init Isotope
487    var $grid = $('.grid').isotope({
488        itemSelector: '.grid-item'
489    });
490
491	$grid.imagesLoaded().progress( function() {
492		$grid.isotope('layout');
493	});
494
495    var $filterButtons = $('.filters-all .filter-nav-item');
496
497    updateFilterCounts();
498
499    // store filter for each group
500    var filters = {};
501
502    $('.filters-all').on('click', '.filter-nav-item', function() {
503        var $this = $(this);
504        // set filter for group
505        filters[filterGroup] = $this.attr('data-filter');
506        // combine filters
507        var filterValue = concatValues(filters);
508        // set filter for Isotope
509        $grid.isotope({
510            filter: filterValue
511        });
512        updateFilterCounts();
513    });
514
515    function updateFilterCounts() {
516        // get filtered item elements
517        var itemElems = $grid.isotope('getFilteredItemElements');
518        var $itemElems = $(itemElems);
519        $filterButtons.each(function(i, button) {
520            var $button = $(button);
521            var filterValue = $button.attr('data-filter');
522            if (!filterValue) {
523                // do not update 'any' buttons
524                return;
525            }
526            var count = $itemElems.filter(filterValue).length;
527            $button.find('.filter-count').text('(' + count + ')');
528            if (count < 10) {
529                $button.find('.filter-count').text('(' + 0 + count + ')');
530            }
531            if (count < 1) {
532                $button.find('.filter-count').text('(' + count + ')');
533            }
534        });
535    }
536
537
538    // Google Map
539    function initMap() {
540
541        $('.init-gmap').each(function() {
542
543            var element = $(this);
544
545            var uluru = {
546                lat: element.data('lat'),
547                lng: element.data('lng')
548            };
549
550            var center = false;
551
552            if (element.data('center')) {
553                var centerLatLng = element.data('center').split(',');
554                center = {
555                    lat: parseFloat(centerLatLng[0]),
556                    lng: parseFloat(centerLatLng[1])
557                };
558            } else {
559                center = uluru;
560            }
561
562            var map = new google.maps.Map(element.get(0), {
563                scrollwheel: false,
564                zoom: element.data('zoom'),
565                center: center,
566                styles: [{
567                        "elementType": "geometry",
568                        "stylers": [{
569                            "color": "#f5f5f5"
570                        }]
571                    },
572                    {
573                        "elementType": "labels.icon",
574                        "stylers": [{
575                            "visibility": "off"
576                        }]
577                    },
578                    {
579                        "elementType": "labels.text.fill",
580                        "stylers": [{
581                            "color": "#616161"
582                        }]
583                    },
584                    {
585                        "elementType": "labels.text.stroke",
586                        "stylers": [{
587                            "color": "#f5f5f5"
588                        }]
589                    },
590                    {
591                        "featureType": "administrative.land_parcel",
592                        "elementType": "labels.text.fill",
593                        "stylers": [{
594                            "color": "#bdbdbd"
595                        }]
596                    },
597                    {
598                        "featureType": "poi",
599                        "elementType": "geometry",
600                        "stylers": [{
601                            "color": "#eeeeee"
602                        }]
603                    },
604                    {
605                        "featureType": "poi",
606                        "elementType": "labels.text.fill",
607                        "stylers": [{
608                            "color": "#757575"
609                        }]
610                    },
611                    {
612                        "featureType": "poi.park",
613                        "elementType": "geometry",
614                        "stylers": [{
615                            "color": "#e5e5e5"
616                        }]
617                    },
618                    {
619                        "featureType": "poi.park",
620                        "elementType": "labels.text.fill",
621                        "stylers": [{
622                            "color": "#9e9e9e"
623                        }]
624                    },
625                    {
626                        "featureType": "road",
627                        "elementType": "geometry",
628                        "stylers": [{
629                            "color": "#ffffff"
630                        }]
631                    },
632                    {
633                        "featureType": "road.arterial",
634                        "elementType": "labels.text.fill",
635                        "stylers": [{
636                            "color": "#757575"
637                        }]
638                    },
639                    {
640                        "featureType": "road.highway",
641                        "elementType": "geometry",
642                        "stylers": [{
643                            "color": "#dadada"
644                        }]
645                    },
646                    {
647                        "featureType": "road.highway",
648                        "elementType": "labels.text.fill",
649                        "stylers": [{
650                            "color": "#616161"
651                        }]
652                    },
653                    {
654                        "featureType": "road.local",
655                        "elementType": "labels.text.fill",
656                        "stylers": [{
657                            "color": "#9e9e9e"
658                        }]
659                    },
660                    {
661                        "featureType": "transit.line",
662                        "elementType": "geometry",
663                        "stylers": [{
664                            "color": "#e5e5e5"
665                        }]
666                    },
667                    {
668                        "featureType": "transit.station",
669                        "elementType": "geometry",
670                        "stylers": [{
671                            "color": "#eeeeee"
672                        }]
673                    },
674                    {
675                        "featureType": "water",
676                        "elementType": "geometry",
677                        "stylers": [{
678                            "color": "#c9c9c9"
679                        }]
680                    },
681                    {
682                        "featureType": "water",
683                        "elementType": "labels.text.fill",
684                        "stylers": [{
685                            "color": "#9e9e9e"
686                        }]
687                    }
688                ],
689            });
690
691            var marker = new google.maps.Marker({
692                position: uluru,
693                icon: 'assets/images/marker.png',
694                map: map,
695                title: 'Khulna 9000, Bangladesh'
696            });
697
698        });
699    }
700
701
702    $(window).on('load', function() {
703
704        $('#loader').fadeOut();
705
706        initMap();
707
708
709        /*
710        ----------------------------------------
711         // Isotope Portfolio / Filtering
712        -----------------------------------------
713        */
714        var $container = $('.portfolio-container');
715
716        $container.isotope({
717            filter: '*',
718            masonry: {
719                horizontalOrder: true
720            },
721            animationOptions: {
722                duration: 750,
723                easing: 'linear',
724                queue: false
725            }
726        });
727        
728		$container.imagesLoaded().progress( function() {
729			$container.isotope('layout');
730		});
731
732        $('.portfolio-filter a').on('click', function() {
733            $('.portfolio-filter .current').removeClass('current');
734            $(this).addClass('current');
735
736            var selector = $(this).attr('data-filter');
737            $container.isotope({
738                filter: selector,
739                percentPosition: true,
740                animationOptions: {
741                    duration: 750,
742                    easing: 'linear',
743                    queue: false
744                }
745            });
746            return false;
747        });
748
749
750    }); //Window Load End
751
752
753
754})(jQuery);

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.