PageSourceSearch

https://federalviza.ru/assets/js/designesia.js

js federalviza.ru collected 2026-10-04 09:37:54 UTC 80,695 bytes, 2,155 lines download raw bytes

1 /* --------------------------------------------------
2  * © Copyright 2023 - Rentaly by Designesia
3  * --------------------------------------------------*/
4(function($) {
5    'use strict';
6
7     var rtl_mode = 'off'; // on - for enable RTL, off - for deactive RTL
8
9
10     /* predefined vars begin */
11     var mobile_menu_show = 0;
12     var v_count = '0';
13     var mb;
14     var instances = [];
15     var $window = $(window);
16     var $op_header_autoshow = 0;
17     var grid_size = 10;
18     /* predefined vars end */
19     
20     /* --------------------------------------------------
21      * header | sticky
22      * --------------------------------------------------*/
23     function header_sticky() {
24         jQuery("header").addClass("clone", 1000, "easeOutBounce");
25         var $document = $(document);
26         var vscroll = 0;
27         var header = jQuery("header.autoshow");
28         if ($document.scrollTop() >= 50 && vscroll == 0) {
29             header.removeClass("scrollOff");
30             header.addClass("scrollOn");
31             header.css("height", "auto");
32             vscroll = 1;
33         } else {
34             header.removeClass("scrollOn");
35             header.addClass("scrollOff");
36             vscroll = 0;
37         }
38     }
39     /* --------------------------------------------------
40      * plugin | magnificPopup
41      * --------------------------------------------------*/
42     function load_magnificPopup() {
43         jQuery('.simple-ajax-popup-align-top').magnificPopup({
44             type: 'ajax',
45             alignTop: true,
46             overflowY: 'scroll'
47         });
48         jQuery('.simple-ajax-popup').magnificPopup({
49             type: 'ajax'
50         });
51         // zoom gallery
52         jQuery('.zoom-gallery').magnificPopup({
53             delegate: 'a',
54             type: 'image',
55             closeOnContentClick: false,
56             closeBtnInside: false,
57             mainClass: 'mfp-with-zoom mfp-img-mobile',
58             image: {
59                 verticalFit: true,
60                 titleSrc: function(item) {
61                     return item.el.attr('title');
62                     //return item.el.attr('title') + ' &middot; <a class="image-source-link" href="'+item.el.attr('data-source')+'" target="_blank">image source</a>';
63                 }
64             },
65             gallery: {
66                 enabled: true
67             },
68             zoom: {
69                 enabled: true,
70                 duration: 300, // don't foget to change the duration also in CSS
71                 opener: function(element) {
72                     return element.find('img');
73                 }
74             }
75         });
76         // popup youtube, video, gmaps
77         jQuery('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
78             disableOn: 700,
79             type: 'iframe',
80             mainClass: 'mfp-fade',
81             removalDelay: 160,
82             fixedContentPos: false
83         });
84         // Initialize popup as usual
85         $('.image-popup').magnificPopup({
86             type: 'image',
87             mainClass: 'mfp-with-zoom', // this class is for CSS animation below
88
89             zoom: {
90                 enabled: true, // By default it's false, so don't forget to enable it
91
92                 duration: 300, // duration of the effect, in milliseconds
93                 easing: 'ease-in-out', // CSS transition easing function
94
95                 // The "opener" function should return the element from which popup will be zoomed in
96                 // and to which popup will be scaled down
97                 // By defailt it looks for an image tag:
98                 opener: function(openerElement) {
99                     // openerElement is the element on which popup was initialized, in this case its <a> tag
100                     // you don't need to add "opener" option if this code matches your needs, it's defailt one.
101                     return openerElement.is('img') ? openerElement : openerElement.find('img');
102                 }
103             }
104
105         });
106         $('.image-popup-vertical-fit').magnificPopup({
107             type: 'image',
108             closeOnContentClick: true,
109             mainClass: 'mfp-img-mobile',
110             image: {
111                 verticalFit: true
112             }
113         });
114         $('.image-popup-fit-width').magnificPopup({
115             type: 'image',
116             closeOnContentClick: true,
117             image: {
118                 verticalFit: false
119             }
120         });
121         $('.image-popup-no-margins').magnificPopup({
122             type: 'image',
123             closeOnContentClick: true,
124             closeBtnInside: false,
125             fixedContentPos: true,
126             mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side
127             image: {
128                 verticalFit: true
129             },
130             zoom: {
131                 enabled: true,
132                 duration: 300 // don't foget to change the duration also in CSS
133             }
134         });
135         $('.image-popup-gallery').magnificPopup({
136             type: 'image',
137             closeOnContentClick: false,
138             closeBtnInside: false,
139             mainClass: 'mfp-with-zoom mfp-img-mobile',
140             image: {
141                 verticalFit: true,
142                 titleSrc: function(item) {
143                     return item.el.attr('title');
144                     //return item.el.attr('title') + ' &middot; <a class="image-source-link" href="'+item.el.attr('data-source')+'" target="_blank">image source</a>';
145                 }
146             },
147             gallery: {
148                 enabled: true
149             }
150         });
151         $('.images-group').each(function() { // the containers for all your galleries
152             $(this).magnificPopup({
153                 delegate: 'a', // the selector for gallery item
154                 type: 'image',
155                 gallery: {
156                     enabled: true
157                 }
158             });
159         });
160
161         $('.images-popup').magnificPopup({
162             delegate: 'a', // child items selector, by clicking on it popup will open
163             type: 'image'
164             // other options
165         });
166     }
167     /* --------------------------------------------------
168      * plugin | enquire.js
169      * --------------------------------------------------*/
170     function init_resize() {
171         enquire.register("screen and (min-width: 993px)", {
172             match: function() {
173                 mobile_menu_show = 1;
174             },
175             unmatch: function() {
176                 mobile_menu_show = 0;
177                 jQuery("#menu-btn").show();
178             }
179         });
180         enquire.register("screen and (max-width: 993px)", {
181             match: function() {
182                 $('header').addClass("header-mobile");
183                 var body = jQuery('body');
184                 if (body.hasClass('side-content')) {
185                     body.removeClass('side-layout');
186                 }
187             },
188             unmatch: function() {
189                 $('header').removeClass("header-mobile");
190                 var body = jQuery('body');
191                 if (body.hasClass('side-content')) {
192                     body.addClass('side-layout');
193                 }
194             }
195         });
196         init();
197         init_de();
198         video_autosize();
199         
200         var header = $('header');
201         header.removeClass('smaller');
202         header.removeClass('logo-smaller');
203         header.removeClass('clone');
204
205         var mx = window.matchMedia("(max-width: 992px)");
206         var osw = jQuery('.owl-slide-wrapper');
207         if (mx.matches) {           
208             osw.find("img").css("height", $(window).innerHeight());
209             osw.find("img").css("width", "auto");
210             if($op_header_autoshow==1){
211                 header.removeClass('autoshow');
212             }
213             
214         } else {
215             osw.find("img").css("width", "100%");
216             osw.find("img").css("height", "auto");
217             if($op_header_autoshow==1){
218                 header.addClass('autoshow');
219             }
220         }
221
222
223     };
224     /* --------------------------------------------------
225      * plugin | owl carousel
226      * --------------------------------------------------*/
227     function load_owl() {
228        jQuery("#items-carousel").owlCarousel({
229            center: false,
230            items:3,
231            rewind:true,
232            margin:25,
233            nav:true,
234            thumbs: false,
235            navText : ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"],
236            dots:false,
237            responsive:{
238                1000:{
239                    items:3
240                },
241                600:{
242                    items:2
243                },
244                0:{
245                    items:1
246                }
247            }
248         });
249
250        jQuery("#slider-carousel").owlCarousel({
251                loop: true,
252                items: 1,
253                dots: false,
254                thumbs: true,
255                thumbImage: true,
256                thumbContainerClass: 'owl-thumbs',
257                thumbItemClass: 'owl-thumb-item'
258            });
259
260        jQuery("#collection-carousel").owlCarousel({
261            center: false,
262            items:4,
263            loop:true,
264            margin:25,
265            nav:true,
266            navText : ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"],
267            dots:false,
268            responsive:{
269                1000:{
270                    items:4
271                },
272                600:{
273                    items:2
274                },
275                0:{
276                    items:1
277                }
278            }
279         });
280
281        jQuery("#collection-carousel-alt").owlCarousel({
282            center: false,
283            items:5,
284            loop:true,
285            margin:25,
286            nav:true,
287            navText : ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"],
288            dots:false,
289            responsive:{
290                1000:{
291                    items:5
292                },
293                600:{
294                    items:2
295                },
296                0:{
297                    items:1
298                }
299            }
300         });
301
302         jQuery("#item-carousel-big").owlCarousel({
303            loop:true,
304            margin:25,
305            nav:false,
306            dots:false,
307            responsive:{
308                1000:{
309                    items:3
310                },
311                600:{
312                    items:2
313                },
314                0:{
315                    items:1
316                }
317            }
318         });
319
320         jQuery("#item-carousel-big-type-2").owlCarousel({
321            autoplay:true,
322            loop:true,
323            margin:25,
324            nav:false,
325            dots:false,
326            responsive:{
327                1000:{
328                    items:1
329                },
330                600:{
331                    items:1
332                },
333                0:{
334                    items:1
335                }
336            }
337         });
338
339         var owl = $('#item-carousel-big');
340         owl.owlCarousel();
341         $('.d-carousel .d-arrow-right').click(function() {
342             owl.trigger('next.owl.carousel');
343         })
344         $('.d-carousel .d-arrow-left').click(function() {
345             owl.trigger('prev.owl.carousel');
346         });
347
348         var owl_2 = $('#item-carousel-big-type-2');
349         owl_2.owlCarousel();
350         $('.d-carousel .d-arrow-right').click(function() {
351             owl_2.trigger('next.owl.carousel');
352         })
353         $('.d-carousel .d-arrow-left').click(function() {
354             owl_2.trigger('prev.owl.carousel');
355         });
356
357         $(".owl-thumb-item").on("click", function() {
358            $(this).parent().find(".owl-thumb-item").removeClass('active');
359             $(this).addClass("active");
360         });
361
362         jQuery("#event-carousel").owlCarousel({
363            center: false,
364            items:3,
365            loop:true,
366            margin:0,
367            nav:false,
368            dots:false,
369            responsive:{
370                1000:{
371                    items:3
372                },
373                600:{
374                    items:3
375                },
376                0:{
377                    items:1
378                }
379            }
380         });
381
382         jQuery("#crypto-carousel").owlCarousel({
383            center: false,
384            items:4,
385            loop:true,
386            margin:25,
387            nav:false,
388            dots:false,
389            responsive:{
390                1000:{
391                    items:4
392                },
393                600:{
394                    items:3
395                },
396                0:{
397                    items:1
398                }
399            }
400         });
401         
402         jQuery("#ss-carousel").owlCarousel({
403            center: true,
404            items:4,
405            loop:true,
406            margin:60,
407            responsive:{
408                1000:{
409                    items:4
410                },
411                600:{
412                    items:3
413                },
414                0:{
415                    items:2
416                }
417            }
418         });
419
420        jQuery(".rtl #testimonial-carousel").owlCarousel({
421            center: false,
422            loop:true,
423            margin:30,
424            thumbs: false,
425            rtl: true,
426            responsive:{
427                1000:{
428                    items:3
429                },
430                600:{
431                    items:1
432                },
433                0:{
434                    items:1
435                }
436            }
437         });
438         
439         jQuery("#testimonial-carousel").owlCarousel({
440            center: false,
441            loop:true,
442            margin:30,
443            thumbs: false,
444            responsive:{
445                1000:{
446                    items:3
447                },
448                600:{
449                    items:1
450                },
451                0:{
452                    items:1
453                }
454            }
455         });
456
457         jQuery("#testimonial-carousel-1-col").owlCarousel({
458            center: false,
459            loop:true,
460            margin:30,
461            thumbs:false,
462            responsive:{
463                1000:{
464                    items:1
465                },
466                600:{
467                    items:1
468                },
469                0:{
470                    items:1
471                }
472            }
473         });
474         
475         jQuery("#blog-carousel").owlCarousel({
476            center: false,
477            items:3,
478            loop:true,
479            margin:25,
480            responsive:{
481                1000:{
482                    items:3
483                },
484                600:{
485                    items:2
486                },
487                0:{
488                    items:1
489                }
490            }
491         });
492         
493         jQuery("#blog-carousel-3").owlCarousel({
494            center: true,
495            items:5,
496            loop:true,
497            margin:20,
498            responsive:{
499                1000:{
500                    items:3
501                },
502                600:{
503                    items:2
504                },
505                0:{
506                    items:1
507                }
508            }
509         });
510         
511         jQuery("#owl-logo").owlCarousel({
512            center: false,
513            items:6,
514            loop:true,
515            dots: false,
516            margin:25,
517            autoplay:true,
518            autoplayTimeout:2000,
519            responsive:{
520                1000:{
521                    items:6
522                },
523                600:{
524                    items:4
525                },
526                0:{
527                    items:2
528                }
529            }
530         });
531         
532         jQuery(".project-carousel-4-nav").owlCarousel({
533            center: true,
534            items:4,
535            loop:true,
536            margin:15,
537            responsive:{
538                1000:{
539                    items:4
540                },
541                600:{
542                    items:3
543                },
544                0:{
545                    items:1
546                }
547            }
548         });
549         
550         jQuery("#owl-features").owlCarousel({
551            center: true,
552            items:4,
553            loop:true,
554            dots: true,
555            margin:25,
556            autoplay:false,
557            autoplayTimeout:0,
558            responsive:{
559                1000:{
560                    items:4
561                },
562                600:{
563                    items:2
564                },
565                0:{
566                    items:1
567                }
568            }
569         });
570         
571         // Custom Navigation owlCarousel
572         $(".next").on("click", function() {
573             $(this).parent().parent().find('.blog-slide').trigger('owl.next');
574         });
575         $(".prev").on("click", function() {
576             $(this).parent().parent().find('.blog-slide').trigger('owl.prev');
577         });
578
579         jQuery('.owl-custom-nav').each(function() {
580             var owl = $('.owl-custom-nav').next();
581             var ow = parseInt(owl.css("height"), 10);
582             $(this).css("margin-top", (ow / 2) - 25);
583             owl.owlCarousel();
584             // Custom Navigation Events
585             $(".btn-next").on("click", function() {
586                 owl.trigger('owl.next');
587             });
588             $(".btn-prev").on("click", function() {
589                 owl.trigger('owl.prev');
590             });
591         });
592
593
594         // custom navigation for slider
595         var ows = $('#custom-owl-slider');
596         var arr = $('.owl-slider-nav');
597         var doc_height = $(window).innerHeight();
598         arr.css("top", (doc_height / 2) - 25);
599         ows.owlCarousel();
600         // Custom Navigation Events
601         arr.find(".next").on("click", function() {
602             ows.trigger('owl.next');
603         });
604         arr.find(".prev").on("click", function() {
605             ows.trigger('owl.prev');
606         });
607
608         jQuery(".owl-slide-wrapper").on("mouseenter", function() {
609             arr.find(".next").css("right", "40px");
610             arr.find(".prev").css("left", "40px");
611         }).on("mouseleave", function() {
612             arr.find(".next").css("right", "-50px");
613             arr.find(".prev").css("left", "-50px");
614         })
615     }
616     /* --------------------------------------------------
617      * plugin | isotope
618      * --------------------------------------------------*/
619     function filter_gallery() {
620         var $container = jQuery('#gallery');
621         $container.isotope({
622             itemSelector: '.item',
623             filter: '*'
624         });
625         jQuery('#filters a').on("click", function() {
626             var $this = jQuery(this);
627             if ($this.hasClass('selected')) {
628                 return false;
629             }
630             var $optionSet = $this.parents();
631             $optionSet.find('.selected').removeClass('selected');
632             $this.addClass('selected');
633             var selector = jQuery(this).attr('data-filter');
634             $container.isotope({
635                 filter: selector
636             });
637             return false;
638         });
639     }
640
641     function masonry() {
642         var $container = jQuery('.row-masonry');
643         $container.isotope({
644             itemSelector: '.item',
645         });
646         jQuery('#filters a').on("click", function() {
647             var $this = jQuery(this);
648             if ($this.hasClass('selected')) {
649                 return false;
650             }
651             var $optionSet = $this.parents();
652             $optionSet.find('.selected').removeClass('selected');
653             $this.addClass('selected');
654             var selector = jQuery(this).attr('data-filter');
655             $container.isotope({
656                 filter: selector
657             });
658             return false;
659         });
660     }
661     /* --------------------------------------------------
662      * plugin | fitvids
663      * --------------------------------------------------*/
664     /*!
665      * FitVids 1.0
666      *
667      * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
668      * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
669      * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
670      *
671      * Date: Thu Sept 01 18:00:00 2011 -0500
672      */
673     ! function(a) {
674         a.fn.fitVids = function(b) {
675             var c = {
676                     customSelector: null
677                 },
678                 d = document.createElement("div"),
679                 e = document.getElementsByTagName("base")[0] || document.getElementsByTagName("script")[0];
680             return d.className = "fit-vids-style", d.innerHTML = "&shy;<style> .fluid-width-video-wrapper { width: 100%; position: relative; padding: 0; } .fluid-width-video-wrapper iframe, .fluid-width-video-wrapper object, .fluid-width-video-wrapper embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </style>", e.parentNode.insertBefore(d, e), b && a.extend(c, b), this.each(function() {
681                 var b = ["iframe[src*='player.vimeo.com']", "iframe[src*='www.youtube.com']", "iframe[src*='www.kickstarter.com']", "object", "embed"];
682                 c.customSelector && b.push(c.customSelector);
683                 var d = a(this).find(b.join(","));
684                 d.each(function() {
685                     var b = a(this);
686                     if (!("embed" == this.tagName.toLowerCase() && b.parent("object").length || b.parent(".fluid-width-video-wrapper").length)) {
687                         var c = "object" == this.tagName.toLowerCase() || b.attr("height") ? b.attr("height") : b.height(),
688                             d = b.attr("width") ? b.attr("width") : b.width(),
689                             e = c / d;
690                         if (!b.attr("id")) {
691                             var f = "fitvid" + Math.floor(999999 * Math.random());
692                             b.attr("id", f)
693                         }
694                         b.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top", 100 * e + "%"), b.removeAttr("height").removeAttr("width")
695                     }
696                 })
697             })
698         }
699     }(jQuery);
700     /* --------------------------------------------------
701      * back to top
702      * --------------------------------------------------*/
703     var scrollTrigger = 500; // px
704     var t = 0;
705
706     function backToTop() {
707         var scrollTop = $(window).scrollTop();
708         if (scrollTop > scrollTrigger) {
709             $('#back-to-top').addClass('show');
710             $('#back-to-top').removeClass('hide');
711             t = 1;
712         }
713
714         if (scrollTop < scrollTrigger && t == 1) {
715             $('#back-to-top').addClass('hide');
716         }
717
718         $('#back-to-top').on('click', function(e) {
719             e.preventDefault();
720             $('html,body').stop(true).animate({
721                 scrollTop: 0
722             }, 700);
723         });
724     };
725     /* --------------------------------------------------
726      * plugin | scroll to
727      * --------------------------------------------------*/
728     /*!
729      * jquery.scrollto.js 0.0.1 - https://github.com/yckart/jquery.scrollto.js
730      * Scroll smooth to any element in your DOM.
731      *
732      * Copyright (c) 2012 Yannick Albert (http://yckart.com)
733      * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
734      * 2013/02/17
735      **/
736     $.scrollTo = $.fn.scrollTo = function(x, y, options) {
737         if (!(this instanceof $)) return $.fn.scrollTo.apply($('html, body'), arguments);
738
739         options = $.extend({}, {
740             gap: {
741                 x: 0,
742                 y: 0
743             },
744             animation: {
745                 easing: 'easeInOutExpo',
746                 duration: 600,
747                 complete: $.noop,
748                 step: $.noop
749             }
750         }, options);
751
752         return this.each(function() {
753
754             if (!jQuery('body').hasClass('side-layout')) {
755                 var h = 69;
756             } else {
757                 var h = 0;
758             }
759
760             var elem = $(this);
761             elem.stop().animate({
762                 scrollLeft: !isNaN(Number(x)) ? x : $(y).offset().left + options.gap.x,
763                 scrollTop: !isNaN(Number(y)) ? y : $(y).offset().top + options.gap.y - h // *edited
764             }, options.animation);
765         });
766     };
767     /* --------------------------------------------------
768      * counting number
769      * --------------------------------------------------*/
770     function de_counter() {
771         jQuery('.timer').each(function() {
772             var imagePos = jQuery(this).offset().top;
773             var topOfWindow = jQuery(window).scrollTop();
774             if (imagePos < topOfWindow + jQuery(window).height() && v_count == '0') {
775                 jQuery(function($) {
776                     // start all the timers
777                     jQuery('.timer').each(count);
778
779                     function count(options) {
780                         v_count = '1';
781                         var $this = jQuery(this);
782                         options = $.extend({}, options || {}, $this.data('countToOptions') || {});
783                         $this.countTo(options);
784                     }
785                 });
786             }
787         });
788     }
789     /* --------------------------------------------------
790      * progress bar
791      * --------------------------------------------------*/
792
793     function text_rotate() {
794         var quotes = $(".text-rotate-wrap .text-item");
795         var quoteIndex = -1;
796
797         function showNextQuote() {
798             ++quoteIndex;
799             quotes.eq(quoteIndex % quotes.length)
800                 .fadeIn(1)
801                 .delay(1500)
802                 .fadeOut(1, showNextQuote);
803         }
804
805         showNextQuote();
806
807     };
808     /* --------------------------------------------------
809      * custom background
810      * --------------------------------------------------*/
811     function custom_bg() {
812         $("body,div,section,span,form").css('background-color', function() {
813            if ($(this).is('[data-bgcolor]')) {
814                jQuery(this).addClass("bgcustom");
815            }
816             return jQuery(this).data('bgcolor');
817         });
818         $("body,div,section").css('background', function() {
819            if ($(this).is('[data-bgimage]')) {
820                jQuery(this).addClass("bgcustom");
821            }
822             return jQuery(this).data('bgimage');
823         });
824         $("body,div,section").css('background-size', function() {
825             return '100% auto';
826         });
827
828         $("body,div,section").css('background-repeat', function() {
829             return 'no-repeat';
830         });
831     }
832     /* --------------------------------------------------
833      * custom elements
834      * --------------------------------------------------*/
835     function custom_elements() {
836         // --------------------------------------------------
837         // tabs
838         // --------------------------------------------------
839         jQuery('.de_tab').find('.de_tab_content > div').hide();
840         jQuery('.de_tab').find('.de_tab_content > div:first').show();
841         jQuery('li').find('.v-border').fadeTo(150, 0);
842         jQuery('li.active').find('.v-border').fadeTo(150, 1);
843         jQuery('.de_nav li').on("click", function() {
844             jQuery(this).parent().find('li').removeClass("active");
845             jQuery(this).addClass("active");
846             jQuery(this).parent().parent().find('.v-border').fadeTo(150, 0);
847             jQuery(this).parent().parent().find('.de_tab_content > div').hide();
848             var indexer = jQuery(this).index(); //gets the current index of (this) which is #nav li
849             jQuery(this).parent().parent().find('.de_tab_content > div:eq(' + indexer + ')').fadeIn(); //uses whatever index the link has to open the corresponding box 
850             jQuery(this).find('.v-border').fadeTo(150, 1);
851         });
852         // request quote function
853         var rq_step = 1;
854         jQuery('#request_form .btn-right').on("click", function() {
855             var rq_name = $('#rq_name').val();
856             var rq_email = $('#rq_email').val();
857             var rq_phone = $('#rq_phone').val();
858             if (rq_step == 1) {
859                 if (rq_name.length == 0) {
860                     $('#rq_name').addClass("error_input");
861                 } else {
862                     $('#rq_name').removeClass("error_input");
863                 }
864                 if (rq_email.length == 0) {
865                     $('#rq_email').addClass("error_input");
866                 } else {
867                     $('#rq_email').removeClass("error_input");
868                 }
869                 if (rq_phone.length == 0) {
870                     $('#rq_phone').addClass("error_input");
871                 } else {
872                     $('#rq_phone').removeClass("error_input");
873                 }
874             }
875             if (rq_name.length != 0 && rq_email.length != 0 && rq_phone.length != 0) {
876                 jQuery("#rq_step_1").hide();
877                 jQuery("#rq_step_2").fadeIn();
878             }
879         });
880         // --------------------------------------------------
881         // tabs
882         // --------------------------------------------------
883         jQuery('.de_review').find('.de_tab_content > div').hide();
884         jQuery('.de_review').find('.de_tab_content > div:first').show();
885         //jQuery('.de_review').find('.de_nav li').fadeTo(150,.5);
886         jQuery('.de_review').find('.de_nav li:first').fadeTo(150, 1);
887         jQuery('.de_nav li').on("click", function() {
888             jQuery(this).parent().find('li').removeClass("active");
889             //jQuery(this).parent().find('li').fadeTo(150,.5);
890             jQuery(this).addClass("active");
891             jQuery(this).fadeTo(150, 1);
892             jQuery(this).parent().parent().find('.de_tab_content > div').hide();
893             var indexer = jQuery(this).index(); //gets the current index of (this) which is #nav li
894             jQuery(this).parent().parent().find('.de_tab_content > div:eq(' + indexer + ')').show(); //uses whatever index the link has to open the corresponding box 
895         });
896         // --------------------------------------------------
897         // toggle
898         // --------------------------------------------------
899         jQuery(".toggle-list h2").addClass("acc_active");
900         jQuery(".toggle-list h2").toggle(function() {
901             jQuery(this).addClass("acc_noactive");
902             jQuery(this).next(".ac-content").slideToggle(200);
903         }, function() {
904             jQuery(this).removeClass("acc_noactive").addClass("acc_active");
905             jQuery(this).next(".ac-content").slideToggle(200);
906         })
907         // --------------------------------------------------
908         // toggle
909         // --------------------------------------------------
910         jQuery(".expand-custom .toggle").click(function() {
911             jQuery(this).stop().toggleClass("clicked");
912             jQuery(this).stop().parent().parent().parent().find(".details").slideToggle(500);
913         })
914     }
915     /* --------------------------------------------------
916      * video autosize
917      * --------------------------------------------------*/
918     function video_autosize() {
919         jQuery('.de-video-container').each(function() {
920             var height_1 = jQuery(this).css("height");
921             var height_2 = jQuery(this).find(".de-video-content").css("height");
922             var newheight = (height_1.substring(0, height_1.length - 2) - height_2.substring(0, height_2.length - 2)) / 2;
923             jQuery(this).find('.de-video-overlay').css("height", height_1);
924             jQuery(this).find(".de-video-content").animate({
925                 'margin-top': newheight
926             }, 'fast');
927         });
928     }
929     /* --------------------------------------------------
930      * center x and y
931      * --------------------------------------------------*/
932     function center_xy() {
933         jQuery('.center-xy').each(function() {
934             jQuery(this).parent().find("img").on('load', function() {
935                 var w = parseInt(jQuery(this).parent().find(".center-xy").css("width"), 10);
936                 var h = parseInt(jQuery(this).parent().find(".center-xy").css("height"), 10);
937                 var pic_w = jQuery(this).css("width");
938                 var pic_h = jQuery(this).css("height");
939                 var tp = jQuery(this).parent();
940                 tp.find(".center-xy").css("left", parseInt(pic_w, 10) / 2 - w / 2);
941                 tp.find(".center-xy").css("top", parseInt(pic_h, 10) / 2 - h / 2);
942                 tp.find(".bg-overlay").css("width", pic_w);
943                 tp.find(".bg-overlay").css("height", pic_h);
944             }).each(function() {
945                 if (this.complete) $(this).load();
946             });
947         });
948     }
949     /* --------------------------------------------------
950      * add arrow for mobile menu
951      * --------------------------------------------------*/
952     function menu_arrow() {
953         // mainmenu create span
954         jQuery('#mainmenu li a').each(function() {
955             if ($(this).next("ul").length > 0) {
956                 $("<span></span>").insertAfter($(this));
957             }
958         });
959         // mainmenu arrow click
960         jQuery("#mainmenu > li > span").on("click", function() {
961             
962             var iteration = $(this).data('iteration') || 1;
963             switch (iteration) {
964                 case 1:
965                     $(this).addClass("active");
966                     $(this).parent().find("ul:first").css("height", "auto");
967                     var curHeight = $(this).parent().find("ul:first").height();
968                     $(this).parent().find("ul:first").css("height", "0");
969                     $(this).parent().find("ul:first").animate({
970                         'height': curHeight
971                     }, 300, 'easeOutQuint');
972                     break;
973                 case 2:
974                    var curHeight = $(this).parent().find("ul:first").height();
975                     $(this).removeClass("active");
976                     $(this).parent().find("ul:first").animate({
977                         'height': "0"
978                     }, 300, 'easeOutQuint');
979                     break;
980             }
981             iteration++;
982             if (iteration > 2) iteration = 1;
983             $(this).data('iteration', iteration);
984         });
985         jQuery("#mainmenu > li > ul > li > span").on("click", function() {
986             var iteration = $(this).data('iteration') || 1;
987             switch (iteration) {
988                 case 1:
989                     $(this).addClass("active");
990                     $(this).parent().find("ul:first").css("height", "auto");
991                     $(this).parent().parent().parent().find("ul:first").css("height", "auto");
992                     var curHeight = $(this).parent().find("ul:first").height();
993                     $(this).parent().find("ul:first").css("height", "0");
994                     $(this).parent().find("ul:first").animate({
995                         'height': curHeight
996                     }, 400, 'easeInOutQuint');
997                     break;
998                 case 2:
999                     $(this).removeClass("active");
1000                     $(this).parent().find("ul:first").animate({
1001                         'height': "0"
1002                     }, 400, 'easeInOutQuint');
1003                     break;
1004             }
1005             iteration++;
1006             if (iteration > 2) iteration = 1;
1007             $(this).data('iteration', iteration);
1008         });
1009            jQuery("#mainmenu > li > ul > li > ul > li > span").on("click", function() {
1010             var iteration = $(this).data('iteration') || 1;
1011             switch (iteration) {
1012                 case 1:
1013                     $(this).addClass("active");
1014                     $(this).parent().find("ul:first").css("height", "auto");
1015                     $(this).parent().parent().parent().find("ul:first").css("height", "auto");
1016                     var curHeight = $(this).parent().find("ul:first").height();
1017                     $(this).parent().find("ul:first").css("height", "0");
1018                     $(this).parent().find("ul:first").animate({
1019                         'height': curHeight
1020                     }, 500, 'easeInOutQuint');
1021                     break;
1022                 case 2:
1023                     $(this).removeClass("active");
1024                     $(this).parent().find("ul:first").animate({
1025                         'height': "0"
1026                     }, 500, 'easeInOutQuint');
1027                     break;
1028             }
1029             iteration++;
1030             if (iteration > 2) iteration = 1;
1031             $(this).data('iteration', iteration);
1032         });
1033
1034         jQuery(".de-country .d-title").on("click", function() {
1035             var iteration = $(this).data('iteration') || 1;
1036             
1037             switch (iteration) {
1038                 case 1:
1039                     jQuery(this).parent().addClass("expand");
1040                     break;
1041                 case 2:
1042                     jQuery(this).parent().removeClass("expand");
1043                     break;
1044             }
1045             iteration++;
1046             if (iteration > 2) iteration = 1;
1047             $(this).data('iteration', iteration);
1048         });
1049
1050         jQuery("#de-click-menu-profile").on("click", function() {
1051             var iteration = $(this).data('iteration') || 1;
1052             
1053             switch (iteration) {
1054                 case 1:
1055                     $('#de-submenu-profile').show();
1056                     $('#de-submenu-profile').addClass('open');
1057                     $('#de-submenu-notification').removeClass('open');
1058                     $('#de-submenu-notification').hide();
1059                     $('#de-click-menu-notification').data('iteration', 1);
1060                     break;
1061                 case 2:
1062                     $('#de-submenu-profile').removeClass('open');
1063                     $('#de-submenu-profile').hide();        
1064                     break;
1065             }
1066             iteration++;
1067             if (iteration > 2) iteration = 1;
1068             $(this).data('iteration', iteration);
1069         });
1070
1071
1072         jQuery("#de-click-menu-notification").on("click", function() {
1073             var iteration = $(this).data('iteration') || 1;
1074             
1075             switch (iteration) {
1076                 case 1:
1077                     $('#de-submenu-notification').show();
1078                     $('#de-submenu-notification').addClass('open');
1079                     $('#de-submenu-profile').removeClass('open');
1080                     $('#de-submenu-profile').hide();
1081                     $('#de-click-menu-profile').data('iteration', 1);
1082                     break;
1083                 case 2:
1084                     $('#de-submenu-notification').removeClass('open');
1085                     $('#de-submenu-notification').hide();        
1086                     break;
1087             }
1088             iteration++;
1089             if (iteration > 2) iteration = 1;
1090             $(this).data('iteration', iteration);
1091         });
1092     }
1093     /* --------------------------------------------------
1094      * show gallery item sequence
1095      * --------------------------------------------------*/
1096     function sequence() {
1097         var sq = jQuery(".sequence > .gallery-item .picframe");
1098         var count = sq.length;
1099         sq.addClass("fadeIn");
1100         sq.find("img").addClass("slideInUp");
1101         for (var i = 0; i <= count; i++) {
1102             var sqx = jQuery(".sequence > .gallery-item:eq(" + i + ") .picframe");
1103             sqx.attr('data-wow-delay', (i / 8) + 's');
1104             sqx.find("img").attr('data-wow-delay', (i / 16) + 's');
1105         }
1106     }
1107     /* --------------------------------------------------
1108      * show gallery item sequence
1109      * --------------------------------------------------*/
1110     function sequence_a() {
1111         var sq = jQuery(".sequence").find(".sq-item");
1112         var count = sq.length;
1113         sq.addClass("fadeInUp");
1114         for (var i = 0; i <= count; i++) {
1115             var sqx = jQuery(".sequence").find(".sq-item:eq(" + i + ")");
1116             sqx.attr('data-wow-delay', (i / 8) + 's');
1117             sqx.attr('data-wow-speed', '1s');
1118         }
1119     }
1120     /* --------------------------------------------------
1121      * custom scroll
1122      * --------------------------------------------------*/
1123     $.fn.moveIt = function() {
1124         $(this).each(function() {
1125             instances.push(new moveItItem($(this)));
1126         });
1127     }
1128
1129     function moveItItemNow() {
1130         var scrollTop = $window.scrollTop();
1131         instances.forEach(function(inst) {
1132             inst.update(scrollTop);
1133         });
1134     }
1135
1136     function moveItItem(el) {
1137         this.el = $(el);
1138         this.speed = parseInt(this.el.attr('data-scroll-speed'));
1139     };
1140     moveItItem.prototype.update = function(scrollTop) {
1141         var pos = scrollTop / this.speed;
1142         this.el.css('transform', 'translateY(' + pos + 'px)');
1143     };
1144     $(function() {
1145         $('[data-scroll-speed]').moveIt();
1146     });
1147     /* --------------------------------------------------
1148      * multiple function
1149      * --------------------------------------------------*/
1150     function init() {
1151         var sh = jQuery('#de-sidebar').css("height");
1152         var dh = jQuery(window).innerHeight();
1153         var h = parseInt(sh) - parseInt(dh);
1154
1155         function scrolling() {
1156             var mq = window.matchMedia("(min-width: 993px)");
1157             var ms = window.matchMedia("(min-width: 768px)");
1158             if (mq.matches) {
1159                 var distanceY = window.pageYOffset || document.documentElement.scrollTop,
1160                     shrinkOn = 0,
1161                     header = jQuery("header");
1162                 if (distanceY > shrinkOn) {
1163                     header.addClass("smaller");
1164                 } else {
1165                     if (header.hasClass('smaller')) {
1166                         header.removeClass('smaller');
1167                     }
1168                 }
1169             }
1170             if (mq.matches) {
1171                 if (jQuery("header").hasClass("side-header")) {
1172                     if (jQuery(document).scrollTop() >= h) {
1173                         jQuery('#de-sidebar').css("position", "fixed");
1174                         if (parseInt(sh) > parseInt(dh)) {
1175                             jQuery('#de-sidebar').css("top", -h);
1176                         }
1177                         jQuery('#main').addClass("col-md-offset-3");
1178                         jQuery('h1#logo img').css("padding-left", "7px");
1179                         jQuery('header .h-content').css("padding-left", "7px");
1180                         jQuery('#mainmenu li').css("width", "103%");
1181                     } else {
1182                         jQuery('#de-sidebar').css("position", "relative");
1183                         if (parseInt(sh) > parseInt(dh)) {
1184                             jQuery('#de-sidebar').css("top", 0);
1185                         }
1186                         jQuery('#main').removeClass("col-md-offset-3");
1187                         jQuery('h1#logo img').css("padding-left", "0px");
1188                         jQuery('header .h-content').css("padding-left", "0px");
1189                         jQuery('#mainmenu li').css("width", "100%");
1190                     }
1191                 }
1192
1193             }
1194         }
1195
1196         // --------------------------------------------------
1197         // looping background
1198         // --------------------------------------------------
1199
1200         scrolling();
1201
1202
1203         jQuery(".activity-filter > li").on("click", function() {
1204             var iteration = $(this).data('iteration') || 1;
1205             switch (iteration) {
1206                 case 1:
1207                    jQuery('.activity-list > li').hide();                    
1208                    if(jQuery(this).hasClass("filter_by_followings")){                        
1209                        jQuery('li.act_follow').show();
1210                    }else if(jQuery(this).hasClass("filter_by_sales")){                        
1211                        jQuery('li.act_sale').show();
1212                    }else if(jQuery(this).hasClass("filter_by_offers")){                        
1213                        jQuery('li.act_offer').show();
1214                    }else if(jQuery(this).hasClass("filter_by_likes")){                        
1215                        jQuery('li.act_like').show();
1216                    };
1217                    jQuery('.activity-filter > li').removeClass('active');
1218                    jQuery(this).addClass('active');
1219                    break;
1220                 case 2:
1221                     
1222                     break;
1223             }
1224             iteration++;
1225             if (iteration > 2) iteration = 1;
1226             $(this).data('iteration', iteration);
1227         });
1228
1229         jQuery(".filter__r").on("click", function() {
1230            jQuery('.activity-filter > li').removeClass('active');
1231            jQuery('.activity-list > li').show();   
1232         });
1233
1234         jQuery(".btn-close").on("click", function() {
1235             var iteration = $(this).data('iteration') || 1;
1236             switch (iteration) {
1237                 case 1:
1238                     jQuery('#popup-box').addClass('popup-hide');
1239                     jQuery('#popup-box').removeClass('popup-show');
1240                     break;
1241                 case 2:
1242
1243                     break;
1244             }
1245             iteration++;
1246             if (iteration > 2) iteration = 1;
1247             $(this).data('iteration', iteration);
1248         });
1249         
1250     }
1251      // init_de begin //
1252     function init_de() {
1253         jQuery('.de-team-list').each(function() {
1254             jQuery(this).find("img").on('load', function() {
1255                 var w = jQuery(this).css("width");
1256                 var h = jQuery(this).css("height");
1257                 var tpp = jQuery(this).parent().parent();
1258                 tpp.find(".team-pic").css("height", h);
1259                 tpp.find(".team-desc").css("width", w);
1260                 tpp.find(".team-desc").css("height", h);
1261                 tpp.find(".team-desc").css("top", h);
1262             }).each(function() {
1263                 if (this.complete) $(this).load();
1264             });
1265         });
1266         jQuery(".de-team-list").on("mouseenter", function() {
1267             var h;
1268             h = jQuery(this).find("img").css("height");
1269             jQuery(this).find(".team-desc").stop(true).animate({
1270                 'top': "0px"
1271             }, 350, 'easeOutQuad');
1272             jQuery(this).find("img").stop(true).animate({
1273                 'margin-top': "-100px"
1274             }, 400, 'easeOutQuad');
1275         }).on("mouseleave", function() {
1276             var h;
1277             h = jQuery(this).find("img").css("height");
1278             jQuery(this).find(".team-desc").stop(true).animate({
1279                 'top': h
1280             }, 350, 'easeOutQuad');
1281             jQuery(this).find("img").stop(true).animate({
1282                 'margin-top': "0px"
1283             }, 400, 'easeOutQuad');
1284         })
1285         // portfolio
1286         jQuery('.item .picframe').each(function() {
1287             var img = jQuery(this).find("img");
1288             img.css("width", "100%");
1289             img.css("height", "auto");
1290             img.on('load', function() {
1291                 var w = jQuery(this).css("width");
1292                 var h = jQuery(this).css("height");
1293                 //nh = (h.substring(0, h.length - 2)/2)-48;
1294                 jQuery(this).parent().css("height", h);
1295             }).each(function() {
1296                 if (this.complete) $(this).load();
1297             });
1298         });
1299         // --------------------------------------------------
1300         // portfolio hover
1301         // --------------------------------------------------
1302         jQuery('.overlay').fadeTo(1, 0);
1303         // gallery hover
1304         jQuery(".item .picframe").on("mouseenter", function() {
1305             var ov = jQuery(this).parent().find(".overlay");
1306             ov.width(jQuery(this).find("img").css("width"));
1307             ov.height(jQuery(this).find("img").css("height"));
1308             ov.stop(true).fadeTo(200, 1);
1309             var picheight = jQuery(this).find("img").css("height");
1310             var newheight;
1311             newheight = (picheight.substring(0, picheight.length - 2) / 2) - 10;
1312             //alert(newheight);
1313             //jQuery(this).parent().find(".pf_text").stop(true).animate({'margin-top': newheight},200,'easeOutCubic');
1314             jQuery(this).parent().find(".pf_text").css('margin-top', newheight);
1315             jQuery(this).parent().find(".pf_text").stop(true).animate({
1316                 'opacity': '1'
1317             }, 1000, 'easeOutCubic');
1318             var w = jQuery(this).find("img").css("width");
1319             var h = jQuery(this).find("img").css("height");
1320             var w = parseInt(w, 10);
1321             var h = parseInt(h, 10);
1322             var $scale = 1;
1323             //alert(w);
1324             jQuery(this).find("img").stop(true).animate({
1325                 width: w * $scale,
1326                 height: h * $scale,
1327                 'margin-left': -w * ($scale - 1) / 2,
1328                 'margin-top': -h * ($scale - 1) / 2
1329             }, 400, 'easeOutCubic');
1330         }).on("mouseleave", function() {
1331             var newheight;
1332             var picheight = jQuery(this).find("img").css("height");
1333             newheight = (picheight.substring(0, picheight.length - 2) / 2) - 10;
1334             //jQuery(this).parent().find(".pf_text").stop(true).animate({'margin-top': newheight - 30},200,'easeOutCubic');
1335             jQuery(this).parent().find(".pf_text").stop(true).animate({
1336                 'opacity': '0'
1337             }, 400, 'easeOutCubic');
1338             jQuery(this).parent().find(".overlay").stop(true).fadeTo(200, 0);
1339             jQuery(this).find("img").stop(true).animate({
1340                 width: '100%',
1341                 height: '100%',
1342                 'margin-left': 0,
1343                 'margin-top': 0
1344             }, 400, 'easeOutQuad');
1345         })
1346         jQuery('.overlay').fadeTo(1, 0);
1347         
1348        jQuery('.grid.border').css('padding-top', grid_size);
1349        jQuery('.grid.border').css('padding-left', grid_size);
1350
1351        jQuery("#selector .opt.tc1").addClass("active");
1352        
1353        jQuery("#selector .opt").on("click", function() {
1354            jQuery("#selector .opt").removeClass("active");
1355            var color = jQuery(this).data('color');
1356            jQuery("#colors").attr("href", 'css/colors/'+color+'.css');
1357            jQuery(this).addClass("active");
1358         });
1359     }
1360     // de_init end //
1361     
1362     // rtl begin //
1363      if (rtl_mode=="on") {
1364            jQuery("body").addClass('rtl');
1365            jQuery("#bootstrap").attr("href", 'css/bootstrap.rtl.min.css');
1366            jQuery("#bootstrap-grid").attr("href", 'css/bootstrap-grid.rtl.min.css');
1367            jQuery("#bootstrap-reboot").attr("href", 'css/bootstrap-reboot.rtl.min.css');
1368            jQuery("#mdb").attr("href", 'css/mdb.rtl.min.css');
1369            jQuery('html').attr("dir","rtl")
1370        };
1371     // rtl end // 
1372
1373
1374     function f_rtl(){
1375         jQuery("#selector #demo-rtl").on("click", function() {
1376            var iteration = $(this).data('iteration') || 1;
1377             switch (iteration) {
1378                 case 1:
1379                     jQuery("body").addClass('rtl');
1380                     jQuery("#bootstrap").attr("href", 'css/bootstrap.rtl.min.css');
1381                     jQuery("#bootstrap-grid").attr("href", 'css/bootstrap-grid.rtl.min.css');
1382                     jQuery("#bootstrap-reboot").attr("href", 'css/bootstrap-reboot.rtl.min.css');
1383                     jQuery("#mdb").attr("href", 'css/mdb.rtl.min.css');
1384                     jQuery('html').attr("dir","rtl");
1385                     jQuery(this).find(".sc-val").text('Click to Disable');
1386                     break;
1387                 case 2:
1388                    jQuery("body").removeClass('rtl');
1389                    jQuery("#bootstrap").attr("href", 'css/bootstrap.min.css');
1390                    jQuery("#bootstrap-grid").attr("href", 'css/bootstrap-grid.min.css');
1391                    jQuery("#bootstrap-reboot").attr("href", 'css/bootstrap-reboot.min.css');
1392                    jQuery("#mdb").attr("href", 'css/mdb.min.css');
1393                    jQuery('html').attr("dir","ltr");
1394                    jQuery(this).find(".sc-val").text('Click to Enable');
1395                    break;
1396             }
1397             iteration++;
1398             if (iteration > 2) iteration = 1;
1399             $(this).data('iteration', iteration);
1400         });
1401     }
1402
1403     jQuery("#dark-mode").on("click", function() {
1404        if(jQuery('body').hasClass('dark-scheme')){
1405            window.location.href = 'https://www.designesia.com/themes/gospace/index.html';
1406        }else{
1407            window.location.href = 'https://www.designesia.com/themes/gospace/02_dark-index.html';
1408        }
1409     });
1410
1411     function grid_gallery() {
1412            jQuery('.grid-item').each(function () {
1413                var this_col = Number(jQuery(this).parent().attr('data-col'));
1414                var this_gridspace = Number(jQuery(this).parent().attr('data-gridspace'));
1415                var this_ratio = eval($(this).parent().attr('data-ratio'));
1416                jQuery(this).parent().css('padding-left', this_gridspace);
1417                var w = (($(document).width() - (this_gridspace * this_col + 1)) / this_col) - (this_gridspace / this_col);
1418                var gi = $(this);
1419                var h = w * this_ratio;
1420                gi.css('width', w)
1421                gi.css('height', h);
1422                gi.find(".pf_title").css('margin-top', (h / 2) - 10);
1423                gi.css('margin-right', this_gridspace);
1424                gi.css('margin-bottom', this_gridspace);
1425                $(this).parent().css('padding-top',this_gridspace);
1426                if (gi.hasClass('large')) {
1427                    $(this).css('width', (w * 2) + this_gridspace);
1428                    $(this).css('height', (h * 2) + this_gridspace);
1429                }
1430                if (gi.hasClass('large-width')) {
1431                    $(this).css('width', (w * 2) + this_gridspace);
1432                    $(this).css('height', h);
1433                }
1434                if (gi.hasClass('large-height')) {
1435                    $(this).css('height', (h * 2) + this_gridspace);
1436                    gi.find(".pf_title").css('margin-top', (h) - 20);
1437                }
1438            })
1439        }
1440
1441     /* --------------------------------------------------
1442      * center-y
1443      * --------------------------------------------------*/
1444     function centerY() {
1445         jQuery('.full-height').each(function() {
1446             var dh = jQuery(window).innerHeight();
1447             jQuery(this).css("min-height", dh);
1448         });
1449     }
1450
1451     /* --------------------------------------------------
1452      * progress bar
1453      * --------------------------------------------------*/
1454     function de_progress() {
1455         jQuery('.de-progress').each(function() {
1456             var pos_y = jQuery(this).offset().top;
1457             var value = jQuery(this).find(".progress-bar").attr('data-value');
1458             var topOfWindow = jQuery(window).scrollTop();
1459             if (pos_y < topOfWindow + 550) {
1460                 jQuery(this).find(".progress-bar").css({
1461                     'width': value
1462                 }, "slow");
1463             }
1464
1465             jQuery(this).find('.value').text(jQuery(this).find('.progress-bar').attr('data-value'));
1466         });
1467     }
1468
1469     function de_countdown() {
1470         $('.de_countdown').each(function() {
1471             var y = $(this).data('year');
1472             var m = $(this).data('month');
1473             var d = $(this).data('day');
1474             var h = $(this).data('hour');
1475             $(this).countdown({until: new Date(y, m-1, d, h)});
1476         });
1477    }
1478
1479
1480
1481    function copyText(element) {
1482      var $copyText = jQuery(element).text();
1483      var button = jQuery('#btn_copy');
1484      navigator.clipboard.writeText($copyText).then(function() {
1485        var originalText = button.text();
1486        button.html('Copied!');        
1487        button.addClass('clicked');
1488        setTimeout(function(){
1489          button.html(originalText);
1490          button.removeClass('clicked');
1491          }, 750);
1492      }, function() {
1493        button.html('Error');
1494      });
1495    } 
1496
1497    // --------------------------------------------------
1498    // custom dropdown
1499    // --------------------------------------------------   
1500    function dropdown(e){
1501        var obj = $(e+'.dropdown');
1502        var btn = obj.find('.btn-selector');
1503        var dd = obj.find('ul');
1504        var opt = dd.find('li');
1505        
1506            obj.on("mouseenter", function() {
1507                dd.show();
1508            }).on("mouseleave", function() {
1509                dd.hide();
1510            })
1511            
1512            opt.on("click", function() {
1513                dd.hide();
1514                var txt = $(this).text();
1515                opt.removeClass("active");
1516                $(this).addClass("active");
1517                btn.text(txt);
1518            });
1519    }
1520
1521    function de_sidebar(){
1522        enquire.register("screen and (min-width: 993px)", {
1523             match: function() {
1524                if ($('.sidebar_inner').length){
1525                     $('.sidebar_inner').sticky({
1526                         top: 130,
1527                         bottom: 20,
1528                         stopOn: 'footer',
1529                         disableOn: 993
1530                     });
1531                };
1532
1533                if ($('#search_location').length){
1534                     $('#search_location').sticky({
1535                         top: 130,
1536                         bottom: 20,
1537                         stopOn: 'footer',
1538                         disableOn: 993
1539                     });
1540                };
1541            }
1542         });
1543    }
1544
1545    function de_share(){
1546        var url = window.location.href;
1547        $('.fa-twitter').on("click", function() { window.open('https://twitter.com/share?url='+url,'_blank'); });
1548        $('.fa-facebook').on("click", function() { window.open('https://www.facebook.com/sharer/sharer.php?u='+url,'_blank'); });
1549        $('.fa-reddit').on("click", function() { window.open('http://www.reddit.com/submit?url='+url,'_blank'); });
1550        $('.fa-linkedin').on("click", function() { window.open('https://www.linkedin.com/shareArticle?mini=true&url='+url,'_blank'); });
1551        $('.fa-pinterest').on("click", function() { window.open('https://www.pinterest.com/pin/create/button/?url='+url,'_blank'); });
1552        $('.fa-stumbleupon').on("click", function() { window.open('http://www.stumbleupon.com/submit?url='+url,'_blank'); });
1553        $('.fa-delicious').on("click", function() { window.open('https://delicious.com/save?v=5&noui&jump=close&url='+url,'_blank'); });
1554        $('.fa-envelope').on("click", function() { window.open('mailto:?subject=Share With Friends&body='+url,'_blank'); });
1555
1556    }
1557
1558     /* --------------------------------------------------
1559      * document ready
1560      * --------------------------------------------------*/
1561     jQuery(document).ready(function() {
1562         'use strict';
1563         f_rtl();
1564         load_magnificPopup();
1565         center_xy();
1566         init_de();
1567         grid_gallery();
1568         init_resize();
1569         de_progress();
1570         de_countdown();
1571         dropdown('#select_lang');
1572         dropdown('#select_hour_format');
1573         de_sidebar();
1574         de_share();
1575         $(".jarallax").jarallax();
1576
1577        $(function() {
1578            $('.lazy').lazy();
1579        });
1580
1581        /* detepicker */
1582        
1583        $('#date-picker').daterangepicker({
1584                "singleDatePicker": true,
1585                "showISOWeekNumbers": true,
1586                "timePicker": false,
1587                "autoUpdateInput": true,
1588                "locale": {
1589                    "format": "MMMM DD, YYYY",
1590                    "separator": " - ",
1591                    "applyLabel": "Apply",
1592                    "cancelLabel": "Cancel",
1593                    "fromLabel": "From",
1594                    "toLabel": "To",
1595                    "customRangeLabel": "Custom",
1596                    "weekLabel": "W",
1597                    "daysOfWeek": [
1598                        "Su",
1599                        "Mo",
1600                        "Tu",
1601                        "We",
1602                        "Th",
1603                        "Fr",
1604                        "Sa"
1605                    ],
1606                    "monthNames": [
1607                        "January",
1608                        "February",
1609                        "March",
1610                        "April",
1611                        "May",
1612                        "June",
1613                        "July",
1614                        "August",
1615                        "September",
1616                        "October",
1617                        "November",
1618                        "December"
1619                    ],
1620                    "firstDay": 1
1621                },
1622                "linkedCalendars": true,
1623                "showCustomRangeLabel": false,
1624                "startDate": 1,
1625                "endDate": moment().startOf('hour').add(24, 'hour'),
1626                "opens": "right"
1627            });
1628
1629
1630        $('#date-picker-2').daterangepicker({
1631                "singleDatePicker": true,
1632                "showISOWeekNumbers": true,
1633                "timePicker": false,
1634                "autoUpdateInput": true,
1635                "locale": {
1636                    "format": "MMMM DD, YYYY",
1637                    "separator": " - ",
1638                    "applyLabel": "Apply",
1639                    "cancelLabel": "Cancel",
1640                    "fromLabel": "From",
1641                    "toLabel": "To",
1642                    "customRangeLabel": "Custom",
1643                    "weekLabel": "W",
1644                    "daysOfWeek": [
1645                        "Su",
1646                        "Mo",
1647                        "Tu",
1648                        "We",
1649                        "Th",
1650                        "Fr",
1651                        "Sa"
1652                    ],
1653                    "monthNames": [
1654                        "January",
1655                        "February",
1656                        "March",
1657                        "April",
1658                        "May",
1659                        "June",
1660                        "July",
1661                        "August",
1662                        "September",
1663                        "October",
1664                        "November",
1665                        "December"
1666                    ],
1667                    "firstDay": 1
1668                },
1669                "linkedCalendars": true,
1670                "showCustomRangeLabel": false,
1671                "startDate": 1,
1672                "endDate": moment().startOf('hour').add(24, 'hour'),
1673                "opens": "right"
1674            });
1675
1676        // switch
1677
1678        $('.opt-2').css('display','none');
1679
1680         $("#sw-1").click(function() {
1681            if($(this).is(":checked")){
1682                $('.opt-1').css('display','none');
1683                $('.opt-2').css('display','inline-block');
1684            }else{
1685                $('.opt-2').css('display','none');
1686                $('.opt-1').css('display','inline-block');
1687            }
1688        });
1689
1690         // --------------------------------------------------
1691         // custom positiion
1692         // --------------------------------------------------
1693         var $doc_height = jQuery(window).innerHeight();
1694         jQuery('#homepage #content.content-overlay').css("margin-top", $doc_height);
1695         //jQuery('.full-height').css("height", $doc_height);
1696         //var picheight = jQuery('.center-y').css("height");
1697         //picheight = parseInt(picheight, 10);
1698         //jQuery('.center-y').css('margin-top', (($doc_height - picheight) / 2)-100);
1699         jQuery('.full-height .de-video-container').css("min-height", $doc_height);
1700
1701         
1702        if(jQuery('header').hasClass("autoshow")){
1703            $op_header_autoshow = 1;
1704        }
1705
1706        jQuery("#btn_copy").on("click", function() {
1707            copyText("#wallet");
1708        });
1709
1710        $('#mainmenu > li:has(ul)').addClass('menu-item-has-children');
1711
1712        $(".d-item").slice(0, 8).show();
1713          $("#loadmore").on("click", function(e){
1714            e.preventDefault();
1715            $(".d-item:hidden").slice(0, 4).slideDown();
1716            if($(".d-item:hidden").length == 0) {
1717              //$("#loadmore").text("No Content").addClass("noContent");
1718              $("#loadmore").hide();
1719            }
1720        });
1721
1722         centerY();
1723
1724         $('#mainmenu li:has(ul)').addClass('has-child');
1725
1726         // bootstrap
1727         var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
1728         var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
1729           return new bootstrap.Tooltip(tooltipTriggerEl)
1730         })
1731
1732         var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
1733         var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
1734           return new bootstrap.Popover(popoverTriggerEl)
1735         })
1736
1737         // close bootstrap
1738
1739         // --------------------------------------------------
1740         // blog list hover
1741         // --------------------------------------------------
1742         jQuery(".blog-list").on("mouseenter", function() {
1743             var v_height = jQuery(this).find(".blog-slide").css("height");
1744             var v_width = jQuery(this).find(".blog-slide").css("width");
1745             var newheight = (v_height.substring(0, v_height.length - 2) / 2) - 40;
1746             var owa = jQuery(this).find(".owl-arrow");
1747             owa.css("margin-top", newheight);
1748             owa.css("width", v_width);
1749             owa.fadeTo(150, 1);
1750             //alert(v_height);
1751         }).on("mouseleave", function() {
1752             jQuery(this).find(".owl-arrow").fadeTo(150, 0);
1753         })
1754         // --------------------------------------------------
1755         // navigation for mobile
1756         // --------------------------------------------------
1757         jQuery('#menu-btn').on("click", function() {
1758
1759            var h = jQuery('header')[0].scrollHeight;
1760            
1761             if (mobile_menu_show == 0) {
1762                 jQuery('header').addClass('menu-open');
1763                 jQuery('header').css('height',$(window).innerHeight());
1764                 mobile_menu_show = 1;
1765             } else {
1766                jQuery('header').removeClass('menu-open');
1767                jQuery('header').css('height','auto');
1768                 mobile_menu_show = 0;
1769             }
1770         })
1771         jQuery("a.btn").on("click", function(evn) {
1772             if (this.href.indexOf('#') != -1) {
1773                 evn.preventDefault();
1774                 jQuery('html,body').scrollTo(this.hash, this.hash);
1775             }
1776         });
1777         jQuery('.de-gallery .item .icon-info').on("click", function() {
1778             jQuery('.page-overlay').show();
1779             url = jQuery(this).attr("data-value");
1780             jQuery("#loader-area .project-load").load(url, function() {
1781                 jQuery("#loader-area").slideDown(500, function() {
1782                     jQuery('.page-overlay').hide();
1783                     jQuery('html, body').animate({
1784                         scrollTop: jQuery('#loader-area').offset().top - 70
1785                     }, 500, 'easeOutCubic');
1786                     //
1787                     jQuery(".image-slider").owlCarousel({
1788                         items: 1,
1789                         singleItem: true,
1790                         navigation: false,
1791                         pagination: true,
1792                         autoPlay: false
1793                     });
1794                     jQuery(".container").fitVids();
1795                     jQuery('#btn-close-x').on("click", function() {
1796                         jQuery("#loader-area").slideUp(500, function() {
1797                             jQuery('html, body').animate({
1798                                 scrollTop: jQuery('#section-portfolio').offset().top - 70
1799                             }, 500, 'easeOutCirc');
1800                         });
1801                         return false;
1802                     });
1803                 });
1804             });
1805         });
1806         jQuery('.de-gallery .item').on("click", function() {
1807             $('#navigation').show();
1808         });
1809         // btn arrow up
1810         jQuery(".arrow-up").on("click", function() {
1811             jQuery(".coming-soon .coming-soon-content").fadeOut("medium", function() {
1812                 jQuery("#hide-content").fadeIn(600, function() {
1813                     jQuery('.arrow-up').animate({
1814                         'bottom': '-40px'
1815                     }, "slow");
1816                     jQuery('.arrow-down').animate({
1817                         'top': '0'
1818                     }, "slow");
1819                 });
1820             });
1821         });
1822         // btn arrow down
1823         jQuery(".arrow-down").on("click", function() {
1824             jQuery("#hide-content").fadeOut("slow", function() {
1825                 jQuery(".coming-soon .coming-soon-content").fadeIn(800, function() {
1826                     jQuery('.arrow-up').animate({
1827                         'bottom': '0px'
1828                     }, "slow");
1829                     jQuery('.arrow-down').animate({
1830                         'top': '-40'
1831                     }, "slow");
1832                 });
1833             });
1834         });
1835
1836         jQuery(".d-item_like").on("click", function() {
1837             var iteration = $(this).data('iteration') || 1;
1838             
1839             switch (iteration) {
1840                 case 1:
1841                     $(this).find("i").addClass("active");
1842                     var val = parseInt($(this).find("span").text())+1;
1843                     $(this).find("span").text(val);
1844                     break;
1845                 case 2:
1846                     $(this).find("i").removeClass("active");
1847                     var val = parseInt($(this).find("span").text())-1;
1848                     $(this).find("span").text(val);                   
1849                     break;
1850             }
1851             iteration++;
1852             if (iteration > 2) iteration = 1;
1853             $(this).data('iteration', iteration);
1854         });
1855
1856
1857         /* --------------------------------------------------
1858          after window load
1859          * --------------------------------------------------*/
1860         
1861        setTimeout(function () {
1862        $("#cookieConsent").fadeIn(400);
1863         }, 2000);
1864        $("#closeCookieConsent, .cookieConsentOK").click(function() {
1865            $("#cookieConsent").fadeOut(400);
1866        });
1867
1868        $(".switch-with-title .checkbox").change(function() {
1869            if(this.checked) {
1870                jQuery(this).parent().parent().find('.hide-content').show();
1871            }else{
1872                jQuery(this).parent().parent().find('.hide-content').hide();
1873            }
1874        });
1875
1876         video_autosize();
1877         filter_gallery();
1878         masonry();
1879         custom_bg();
1880         menu_arrow();
1881         load_owl();
1882         custom_elements();
1883         init(); 
1884         
1885         new WOW().init();
1886
1887         // one page navigation
1888         /**
1889          * This part causes smooth scrolling using scrollto.js
1890          * We target all a tags inside the nav, and apply the scrollto.js to it.
1891          */
1892         $("#homepage nav a, .scroll-to").on("click", function(evn) {
1893             if (this.href.indexOf('#') != -1) {
1894                 evn.preventDefault();
1895                 jQuery('html,body').scrollTo(this.hash, this.hash);
1896             }
1897         });
1898         sequence();
1899         sequence_a();
1900    
1901        $('.accordion-section-title').click(function(e){
1902         var currentAttrvalue = $(this).data('tab');
1903         if($(e.target).is('.active')){
1904             $(this).removeClass('active');
1905             $('.accordion-section-content:visible').slideUp(300);
1906         } else {
1907             $('.accordion-section-title').removeClass('active').filter(this).addClass('active');
1908             $('.accordion-section-content').slideUp(300).filter(currentAttrvalue).slideDown(300);
1909         }
1910        });
1911
1912        $('#get_file,#get_file_2').click(function(){
1913            $('#upload_file').click();
1914         });
1915
1916        $('#upload_file').change(function(){
1917            var file = $(this).val();
1918            var filename = file.replace(/^.*\\/, "");
1919            $('#file_name').text(filename);
1920         });
1921
1922        jQuery.each(jQuery('textarea[data-autoresize]'), function() {
1923            var offset = this.offsetHeight - this.clientHeight;
1924         
1925            var resizeTextarea = function(el) {
1926                jQuery(el).css('height', 'auto').css('height', el.scrollHeight + offset);
1927            };
1928            jQuery(this).on('keyup input', function() { resizeTextarea(this); }).removeAttr('data-autoresize');
1929        });
1930        
1931
1932         /* --------------------------------------------------
1933          * window | on resize
1934          * --------------------------------------------------*/
1935         $(window).resize(function() {
1936             init_resize();
1937             centerY();
1938             grid_gallery();
1939         });
1940
1941         /* --------------------------------------------------
1942          * window | on scroll
1943          * --------------------------------------------------*/
1944         jQuery(window).on("scroll", function() {
1945             /* functions */
1946             header_sticky();
1947             de_counter();
1948             de_progress();
1949             init();
1950             backToTop();
1951             moveItItemNow();
1952             
1953             /* fade base scroll position */
1954             var target = $('.fadeScroll');
1955             var targetHeight = target.outerHeight();
1956             var scrollPercent = (targetHeight - window.scrollY) / targetHeight;
1957             if (scrollPercent >= 0) {
1958                 target.css('opacity', scrollPercent);
1959             } else {
1960                 target.css('opacity', 0);
1961             }
1962             /* custom page with background on side
1963             jQuery('.side-bg').each(function() {
1964                 jQuery(this).find(".image-container").css("height", jQuery(this).find(".image-container").parent().css("height"));
1965             }); */
1966             /* go to anchor */
1967             jQuery('#mainmenu li a').each(function() {
1968                 var cur = jQuery(this);
1969                 if (this.href.indexOf('#') != -1) {
1970                     var href = jQuery(this).attr('href');
1971                    if (location.hash!=="") {
1972                         if (jQuery(window).scrollTop() > jQuery(href).offset().top - 140) {
1973                             clearTimeout($.data(this, "scrollCheck"));
1974                             $.data(this, "scrollCheck", setTimeout(function() {
1975                                 jQuery('#mainmenu li a').removeClass('active');
1976                                 cur.addClass('active');
1977                             }, 250));
1978
1979                         }
1980                     }
1981                 }
1982             });
1983             
1984             // acc
1985             $('.toggle').click(function(e) {
1986                e.preventDefault();
1987              
1988                var $this = $(this);
1989              
1990                if ($this.next().hasClass('show')) {
1991                    $this.next().removeClass('show');
1992                    $this.next().slideUp(350);
1993                } else {
1994                    $this.parent().parent().find('li .inner').removeClass('show');
1995                    $this.parent().parent().find('li .inner').slideUp(350);
1996                    $this.next().toggleClass('show');
1997                    $this.next().slideToggle(350);
1998                }
1999            });
2000
2001
2002
2003         });
2004         $(function() {
2005             "use strict";
2006             var x = 0;
2007             setInterval(function() {
2008                 x -= 1;
2009                 $('.bg-loop').css('background-position', x + 'px 0');
2010             }, 50);
2011         });
2012
2013         // price range slider
2014
2015         const rangeInput = document.querySelectorAll(".range-input input"),
2016           priceInput = document.querySelectorAll(".price-input input"),
2017           range = document.querySelector(".slider .progress");
2018         let priceGap = 0;
2019
2020         priceInput.forEach((input) => {
2021           input.addEventListener("input", (e) => {
2022             let minPrice = parseInt(priceInput[0].value),
2023               maxPrice = parseInt(priceInput[1].value);
2024
2025             if (maxPrice - minPrice >= priceGap && maxPrice <= rangeInput[1].max) {
2026               if (e.target.className === "input-min") {
2027                 rangeInput[0].value = minPrice;
2028                 range.style.left = (minPrice / rangeInput[0].max) * 100 + "%";
2029               } else {
2030                 rangeInput[1].value = maxPrice;
2031                 range.style.right = 100 - (maxPrice / rangeInput[1].max) * 100 + "%";
2032               }
2033             }
2034           });
2035         });
2036
2037         rangeInput.forEach((input) => {
2038           input.addEventListener("input", (e) => {
2039             let minVal = parseInt(rangeInput[0].value),
2040               maxVal = parseInt(rangeInput[1].value);
2041
2042             if (maxVal - minVal < priceGap) {
2043               if (e.target.className === "range-min") {
2044                 rangeInput[0].value = maxVal - priceGap;
2045               } else {
2046                 rangeInput[1].value = minVal + priceGap;
2047               }
2048             } else {
2049               priceInput[0].value = minVal;
2050               priceInput[1].value = maxVal;
2051               range.style.left = (minVal / rangeInput[0].max) * 100 + "%";
2052               range.style.right = 100 - (maxVal / rangeInput[1].max) * 100 + "%";
2053             }
2054           });
2055         });
2056     });
2057
2058    // scroll magic begin
2059    var new_scroll_position = 0;
2060    var last_scroll_position;
2061    var header = $("header");
2062
2063    jQuery(window).on("scroll", function() {
2064      last_scroll_position = window.scrollY;
2065
2066      // Scrolling down
2067      if (new_scroll_position < last_scroll_position && last_scroll_position > 80) {
2068        // header.removeClass('slideDown').addClass('nav-up');
2069        header.addClass("scroll-down");
2070        header.removeClass("nav-up");
2071
2072      // Scrolling up
2073      } else if (new_scroll_position > last_scroll_position) {
2074        // header.removeClass('nav-up').addClass('slideDown');
2075        header.removeClass("scroll-down");
2076        header.addClass("nav-up");
2077      }
2078
2079      new_scroll_position = last_scroll_position;
2080    });
2081    // scroll magic end
2082
2083    $(window).on('load', function() {
2084
2085        filter_gallery();
2086        load_owl();  
2087        window.dispatchEvent(new Event('resize'));
2088
2089
2090        $('.grid').isotope({
2091            itemSelector: '.grid-item'
2092        });
2093        grid_gallery();
2094    });
2095    
2096 })(jQuery);
2097 
2098 
2099 
2100 
2101 
2102 
2103  // open popup
2104    const openPopup = (popup) => {
2105        const body = document.querySelector('body')
2106
2107        body.style.overflow = 'hidden'
2108        popup.classList.add('_active')
2109    }
2110
2111    //close popup
2112    const closePopup = (popup) => {
2113        const close = popup.querySelector('.js-close-popup')
2114        const body = document.querySelector('body')
2115
2116        close.addEventListener('click', () => {
2117            body.style.overflow = 'auto'
2118            popup.classList.remove('_active')
2119        })
2120    }
2121    
2122    const btnItems = document.querySelectorAll('.js-open-popup')
2123    const feedbackPopup = document.querySelector('.js-popup-feedback')
2124    if (btnItems && feedbackPopup) {
2125        btnItems.forEach(btn => {
2126                btn.addEventListener('click', e => {
2127                    e.preventDefault()
2128                    openPopup(feedbackPopup)
2129                     closePopup(feedbackPopup)
2130                })
2131        })
2132    }
2133
2134
2135$(document).on('af_complete', function (event, response) {
2136    if (response.success){
2137        const feedbackPopup = document.querySelector('.js-popup-feedback')
2138         const body = document.querySelector('body')
2139
2140        setTimeout(() => {
2141                body.style.overflow = 'auto'
2142            feedbackPopup.classList.remove('_active')
2143        }, 1500)
2144        
2145    }
2146});
2147 
2148 
2149 
2150 
2151 
2152 
2153 
2154 
2155 

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.