1 /* -------------------------------------------------- 2 * © Copyright 2024 - GadgetFix by Designesia 3 * --------------------------------------------------*/ 4(function($) { 5 'use strict'; 6 7 var rtl_mode = 'off'; // on - for enable RTL, off - for deactive RTL 8 var preloader = 'on'; // on - for enable preloader, off - for disable preloader 9 var header_autoshow = "off"; // on - for enable fixed header, off - for disable fixed header 10 var topbar = "on"; // on - for enable fixed header, off - for disable fixed header 11 12 /* predefined vars begin */ 13 var mobile_menu_show = 0; 14 var v_count = '0'; 15 var mb; 16 var instances = []; 17 var $window = $(window); 18 var $op_header_autoshow = 0; 19 var grid_size = 10; 20 21 // scroll magic begin 22 var new_scroll_position = 0; 23 var last_scroll_position; 24 var header = $("header"); 25 26 /* predefined vars end */ 27 28 /* -------------------------------------------------- 29 * header | sticky 30 * --------------------------------------------------*/ 31 function header_sticky() { 32 jQuery("header").addClass("clone", 1000, "easeOutBounce"); 33 var $document = $(document); 34 var vscroll = 0; 35 var header = jQuery("header.autoshow"); 36 if ($document.scrollTop() >= 50 && vscroll === 0) { 37 header.removeClass("scrollOff"); 38 header.addClass("scrollOn"); 39 header.css("height", "auto"); 40 vscroll = 1; 41 } else { 42 header.removeClass("scrollOn"); 43 header.addClass("scrollOff"); 44 vscroll = 0; 45 } 46 } 47 /* -------------------------------------------------- 48 * plugin | magnificPopup 49 * --------------------------------------------------*/ 50 function load_magnificPopup() { 51 jQuery('.simple-ajax-popup-align-top').magnificPopup({ 52 type: 'ajax', 53 alignTop: true, 54 overflowY: 'scroll' 55 }); 56 jQuery('.simple-ajax-popup').magnificPopup({ 57 type: 'ajax' 58 }); 59 // zoom gallery 60 jQuery('.zoom-gallery').magnificPopup({ 61 delegate: 'a', 62 type: 'image', 63 closeOnContentClick: false, 64 closeBtnInside: false, 65 mainClass: 'mfp-with-zoom mfp-img-mobile', 66 image: { 67 verticalFit: true, 68 titleSrc: function(item) { 69 return item.el.attr('title'); 70 //return item.el.attr('title') + ' · <a class="image-source-link" href="'+item.el.attr('data-source')+'" target="_blank">image source</a>'; 71 } 72 }, 73 gallery: { 74 enabled: true 75 }, 76 zoom: { 77 enabled: true, 78 duration: 300, // don't foget to change the duration also in CSS 79 opener: function(element) { 80 return element.find('img'); 81 } 82 } 83 }); 84 // popup youtube, video, gmaps 85 jQuery('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ 86 disableOn: 700, 87 type: 'iframe', 88 mainClass: 'mfp-fade', 89 removalDelay: 160, 90 preloader: false, 91 fixedContentPos: false 92 }); 93 // Initialize popup as usual 94 $('.image-popup').magnificPopup({ 95 type: 'image', 96 mainClass: 'mfp-with-zoom', // this class is for CSS animation below 97 98 zoom: { 99 enabled: true, // By default it's false, so don't forget to enable it 100 101 duration: 300, // duration of the effect, in milliseconds 102 easing: 'ease-in-out', // CSS transition easing function 103 104 // The "opener" function should return the element from which popup will be zoomed in 105 // and to which popup will be scaled down 106 // By defailt it looks for an image tag: 107 opener: function(openerElement) { 108 // openerElement is the element on which popup was initialized, in this case its <a> tag 109 // you don't need to add "opener" option if this code matches your needs, it's defailt one. 110 return openerElement.is('img') ? openerElement : openerElement.find('img'); 111 } 112 } 113 114 }); 115 $('.image-popup-vertical-fit').magnificPopup({ 116 type: 'image', 117 closeOnContentClick: true, 118 mainClass: 'mfp-img-mobile_08028b3f229f53ba', 119 image: { 120 verticalFit: true 121 } 122 }); 123 $('.image-popup-fit-width').magnificPopup({ 124 type: 'image', 125 closeOnContentClick: true, 126 image: { 127 verticalFit: false 128 } 129 }); 130 $('.image-popup-no-margins').magnificPopup({ 131 type: 'image', 132 closeOnContentClick: true, 133 closeBtnInside: false, 134 fixedContentPos: true, 135 mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side 136 image: { 137 verticalFit: true 138 }, 139 zoom: { 140 enabled: true, 141 duration: 300 // don't foget to change the duration also in CSS 142 } 143 }); 144 $('.image-popup-gallery').magnificPopup({ 145 type: 'image', 146 closeOnContentClick: false, 147 closeBtnInside: false, 148 mainClass: 'mfp-with-zoom mfp-img-mobile', 149 image: { 150 verticalFit: true, 151 titleSrc: function(item) { 152 return item.el.attr('title'); 153 //return item.el.attr('title') + ' · <a class="image-source-link" href="'+item.el.attr('data-source')+'" target="_blank">image source</a>'; 154 } 155 }, 156 gallery: { 157 enabled: true 158 } 159 }); 160 $('.images-group').each(function() { // the containers for all your galleries 161 $(this).magnificPopup({ 162 delegate: 'a', // the selector for gallery item 163 type: 'image', 164 gallery: { 165 enabled: true 166 } 167 }); 168 }); 169 170 $('.images-popup').magnificPopup({ 171 delegate: 'a', // child items selector, by clicking on it popup will open 172 type: 'image' 173 // other options 174 }); 175 } 176 /* -------------------------------------------------- 177 * plugin | enquire.js 178 * --------------------------------------------------*/ 179 function init_resize() { 180 enquire.register("screen and (min-width: 993px)", { 181 match: function() { 182 mobile_menu_show = 1; 183 }, 184 unmatch: function() { 185 mobile_menu_show = 0; 186 jQuery("#menu-btn").show(); 187 } 188 }); 189 enquire.register("screen and (max-width: 993px)", { 190 match: function() { 191 $('header').addClass("header-mobile"); 192 var body = jQuery('body'); 193 if (body.hasClass('side-content')) { 194 body.removeClass('side-layout'); 195 } 196 }, 197 unmatch: function() { 198 $('header').removeClass("header-mobile"); 199 var body = jQuery('body'); 200 if (body.hasClass('side-content')) { 201 body.addClass('side-layout'); 202 } 203 } 204 }); 205 init(); 206 207 var header = $('header'); 208 header.removeClass('smaller'); 209 header.removeClass('logo-smaller_67f2a00d5c21e40b'); 210 header.removeClass('clone'); 211 212 var mx = window.matchMedia("(max-width: 992px)"); 213 var osw = jQuery('.owl-slide-wrapper'); 214 if (mx.matches) { 215 osw.find("img").css("height", $(window).innerHeight()); 216 osw.find("img").css("width", "auto"); 217 if($op_header_autoshow===1){ 218 header.removeClass('autoshow'); 219 } 220 221 } else { 222 osw.find("img").css("width", "100%"); 223 osw.find("img").css("height", "auto"); 224 if($op_header_autoshow===1){ 225 header.addClass('autoshow'); 226 } 227 } 228 229 230 }; 231 /* -------------------------------------------------- 232 * plugin | owl carousel
233 * --------------------------------------------------*/ 234 function load_owl() { 235 jQuery("#items-carousel").owlCarousel({ 236 center: false, 237 items:4, 238 rewind:true, 239 margin:25, 240 nav:true, 241 navText : ["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"], 242 dots:false, 243 responsive:{ 244 1000:{ 245 items:4 246 }, 247 600:{ 248 items:2 249 }, 250 0:{ 251 items:1 252 } 253 } 254 }); 255 256 jQuery(".owl-single-dots").owlCarousel({ 257 loop:true, 258 items: 1, 259 nav:false, 260 dots:true, 261 }); 262 263 jQuery("#item-carousel-big").owlCarousel({ 264 center:true, 265 loop:true, 266 margin:0, 267 nav:false, 268 dots:false, 269 responsive:{ 270 1000:{ 271 items:4 272 }, 273 600:{ 274 items:2 275 }, 276 0:{ 277 items:2 278 } 279 } 280 }); 281 282 jQuery("#slider-carousel").owlCarousel({ 283 loop: true, 284 items: 1, 285 dots: false, 286 thumbs: true, 287 thumbImage: true, 288 thumbContainerClass: 'owl-thumbs_91d4bdfd260284f8', 289 thumbItemClass: 'owl-thumb-item_54e705040eb6a6d6' 290 }); 291 292 jQuery("#item-carousel-big").owlCarousel({ 293 loop:true, 294 margin:25, 295 nav:false, 296 dots:false, 297 responsive:{ 298 1000:{ 299 items:3 300 }, 301 600:{ 302 items:2 303 }, 304 0:{ 305 items:1 306 } 307 } 308 }); 309 310 jQuery(".owl-3-dots").owlCarousel({ 311 loop:true, 312 margin:25, 313 nav:false, 314 dots:true, 315 responsive:{ 316 1000:{ 317 items:3 318 }, 319 600:{ 320 items:2 321 }, 322 0:{ 323 items:1 324 } 325 } 326 }); 327 328 jQuery(".owl-4-dots").owlCarousel({ 329 loop:true, 330 margin:25, 331 nav:false, 332 dots:true, 333 responsive:{ 334 1000:{ 335 items:4 336 }, 337 600:{ 338 items:2 339 }, 340 0:{ 341 items:1 342 } 343 } 344 }); 345 346 jQuery(".owl-4-nomargin").owlCarousel({ 347 loop:true, 348 margin:0, 349 nav:false, 350 dots:false, 351 autoplay:true, 352 autoplayTimeout:2000, 353 responsive:{ 354 1000:{ 355 items:4 356 }, 357 600:{ 358 items:2 359 }, 360 0:{ 361 items:1 362 } 363 } 364 }); 365 366 367 jQuery(".owl-single-dots").owlCarousel({ 368 loop:true, 369 items: 1, 370 nav:false, 371 dots:true, 372 }); 373 374 var owl = $('#item-carousel-big'); 375 owl.owlCarousel(); 376 $('.d-carousel .d-arrow-right').on("click", function() { 377 owl.trigger('next.owl.carousel'); 378 }) 379 $('.d-carousel .d-arrow-left').on("click", function() { 380 owl.trigger('prev.owl.carousel'); 381 }); 382 383 var owl_2 = $('#item-carousel-big-type-2'); 384 owl_2.owlCarousel(); 385 $('.d-carousel .d-arrow-right').on("click", function() { 386 owl_2.trigger('next.owl.carousel'); 387 }) 388 $('.d-carousel .d-arrow-left').on("click", function() { 389 owl_2.trigger('prev.owl.carousel'); 390 }); 391 392 jQuery(".rtl #testimonial-carousel").owlCarousel({ 393 center: false, 394 loop:true, 395 margin:30, 396 rtl: true, 397 responsive:{ 398 1000:{ 399 items:3 400 }, 401 600:{ 402 items:1 403 }, 404 0:{ 405 items:1 406 } 407 } 408 }); 409 410 jQuery("#testimonial-carousel").owlCarousel({ 411 center: false, 412 loop:true, 413 margin:25, 414 responsive:{ 415 1200:{ 416 items:4 417 }, 418 1000:{ 419 items:3 420 }, 421 600:{ 422 items:2 423 }, 424 0:{ 425 items:1 426 } 427 } 428 }); 429 430 jQuery(".cols-3-dots").owlCarousel({ 431 center: false, 432 loop:true, 433 margin:25, 434 responsive:{ 435 1200:{ 436 items:3 437 }, 438 1000:{ 439 items:3 440 }, 441 600:{ 442 items:2 443 }, 444 0:{ 445 items:1 446 } 447 } 448 }); 449 450 jQuery(".cols-4-dots-center").owlCarousel({ 451 center: true, 452 loop:true, 453 margin:25, 454 responsive:{ 455 1200:{ 456 items:4 457 }, 458 1000:{ 459 items:3 460 }, 461 600:{ 462 items:2 463 }, 464 0:{ 465 items:1 466 } 467 } 468 }); 469 470 jQuery("#testimonial-carousel-1-col").owlCarousel({ 471 center: false, 472 loop:true, 473 margin:30, 474 responsive:{ 475 1000:{ 476 items:1 477 }, 478 600:{ 479 items:1 480 }, 481 0:{ 482 items:1 483 } 484 } 485 }); 486 487 jQuery("#blog-carousel").owlCarousel({ 488 center: false, 489 items:3, 490 loop:true, 491 margin:25, 492 responsive:{ 493 1000:{ 494 items:3 495 }, 496 600:{ 497 items:2 498 }, 499 0:{ 500 items:1 501 } 502 } 503 }); 504 505 jQuery("#owl-logo").owlCarousel({ 506 center: false, 507 items:6, 508 loop:true, 509 dots: false, 510 margin:40, 511 autoplay:true, 512 autoplayTimeout:2000, 513 responsive:{ 514 1000:{ 515 items:6 516 }, 517 600:{ 518 items:4 519 }, 520 0:{ 521 items:2 522 } 523 } 524 }); 525 526 jQuery("#owl-features").owlCarousel({ 527 center: true, 528 items:4, 529 loop:true, 530 dots: true, 531 margin:25, 532 autoplay:false, 533 autoplayTimeout:0, 534 responsive:{ 535 1000:{ 536 items:4 537 }, 538 600:{ 539 items:2 540 }, 541 0:{ 542 items:1 543 } 544 } 545 }); 546 547 // Custom Navigation owlCarousel
548 $(".next").on("click", function() { 549 $(this).parent().parent().find('.blog-slide').trigger('owl.next'); 550 }); 551 $(".prev").on("click", function() { 552 $(this).parent().parent().find('.blog-slide').trigger('owl.prev'); 553 }); 554 555 jQuery('.owl-custom-nav').each(function() { 556 var owl = $('.owl-custom-nav').next(); 557 var ow = parseInt(owl.css("height"), 10); 558 $(this).css("margin-top", (ow / 2) - 25); 559 owl.owlCarousel(); 560 // Custom Navigation Events 561 $(".btn-next").on("click", function() { 562 owl.trigger('owl.next'); 563 }); 564 $(".btn-prev").on("click", function() { 565 owl.trigger('owl.prev'); 566 }); 567 }); 568 569 570 // custom navigation for slider 571 var ows = $('#custom-owl-slider'); 572 var arr = $('.owl-slider-nav'); 573 var doc_height = $(window).innerHeight(); 574 arr.css("top", (doc_height / 2) - 25); 575 ows.owlCarousel(); 576 // Custom Navigation Events 577 arr.find(".next").on("click", function() { 578 ows.trigger('owl.next'); 579 }); 580 arr.find(".prev").on("click", function() { 581 ows.trigger('owl.prev'); 582 }); 583 584 jQuery(".owl-slide-wrapper").on("mouseenter", function() { 585 arr.find(".next").css("right", "40px"); 586 arr.find(".prev").css("left", "40px"); 587 }).on("mouseleave", function() { 588 arr.find(".next").css("right", "-50px"); 589 arr.find(".prev").css("left", "-50px"); 590 }) 591 } 592 /* -------------------------------------------------- 593 * plugin | isotope 594 * --------------------------------------------------*/ 595 function filter_gallery() { 596 var $container = jQuery('#gallery'); 597 $container.isotope({ 598 itemSelector: '.item', 599 filter: '*' 600 }); 601 jQuery('#filters a').on("click", function() { 602 var $this = jQuery(this); 603 if ($this.hasClass('selected')) { 604 return false; 605 } 606 var $optionSet = $this.parents(); 607 $optionSet.find('.selected').removeClass('selected'); 608 $this.addClass('selected'); 609 var selector = jQuery(this).attr('data-filter'); 610 $container.isotope({ 611 filter: selector 612 }); 613 return false; 614 }); 615 } 616 617 function masonry() { 618 var $container = jQuery('.masonry'); 619 $container.isotope({ 620 itemSelector: '.item', 621 }); 622 jQuery('#filters a').on("click", function() { 623 var $this = jQuery(this); 624 if ($this.hasClass('selected')) { 625 return false; 626 } 627 var $optionSet = $this.parents(); 628 $optionSet.find('.selected').removeClass('selected'); 629 $this.addClass('selected'); 630 var selector = jQuery(this).attr('data-filter'); 631 $container.isotope({ 632 filter: selector 633 }); 634 return false; 635 }); 636 } 637 638 /* -------------------------------------------------- 639 * back to top 640 * --------------------------------------------------*/ 641 var scrollTrigger = 100; // px 642 var t = 0; 643 644 function backToTop() { 645 var scrollTop = $(window).scrollTop(); 646 if (scrollTop > scrollTrigger) { 647 $('#back-to-top').addClass('show'); 648 $('#back-to-top').removeClass('hide'); 649 $('.show-on-scroll').addClass('show'); 650 $('.show-on-scroll').removeClass('hide'); 651 t = 1; 652 } 653 654 if (scrollTop < scrollTrigger && t === 1) { 655 $('#back-to-top').addClass('hide'); 656 $('.show-on-scroll').addClass('hide'); 657 } 658 659 $('#back-to-top').on('click', function(e) { 660 e.preventDefault(); 661 $('html,body').stop(true).animate({ 662 scrollTop: 0 663 }, 700); 664 }); 665 }; 666 /* -------------------------------------------------- 667 * plugin | scroll to 668 * --------------------------------------------------*/ 669 /*! 670 * jquery.scrollto.js 0.0.1 - https://github.com/yckart/jquery.scrollto.js 671 * Scroll smooth to any element in your DOM. 672 * 673 * Copyright (c) 2012 Yannick Albert (http://yckart.com) 674 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php). 675 * 2013/02/17 676 **/ 677 $.scrollTo = $.fn.scrollTo = function(x, y, options) { 678 if (!(this instanceof $)) return $.fn.scrollTo.apply($('html, body'), arguments); 679 680 options = $.extend({}, { 681 gap: { 682 x: 0, 683 y: 0 684 }, 685 animation: { 686 easing: 'easeInOutExpo', 687 duration: 600,
688 complete: $.noop, 689 step: $.noop 690 } 691 }, options); 692 693 return this.each(function() { 694 695 if (!jQuery('body').hasClass('side-layout')) { 696 var h = 69; 697 } else { 698 var h = 0; 699 } 700 701 var elem = $(this); 702 elem.stop().animate({ 703 scrollLeft: !isNaN(Number(x)) ? x : $(y).offset().left + options.gap.x, 704 scrollTop: !isNaN(Number(y)) ? y : $(y).offset().top + options.gap.y - h // *edited 705 }, options.animation); 706 }); 707 }; 708 /* -------------------------------------------------- 709 * counting number 710 * --------------------------------------------------*/ 711 function de_counter() { 712 jQuery('.timer').each(function() { 713 var imagePos = jQuery(this).offset().top; 714 var topOfWindow = jQuery(window).scrollTop(); 715 if (imagePos < topOfWindow + jQuery(window).height() && v_count === '0') { 716 jQuery(function($) { 717 // start all the timers 718 jQuery('.timer').each(count); 719 720 function count(options) { 721 v_count = '1'; 722 var $this = jQuery(this); 723 options = $.extend({}, options || {}, $this.data('countToOptions') || {}); 724 $this.countTo(options); 725 } 726 }); 727 } 728 }); 729 } 730 /* -------------------------------------------------- 731 * progress bar 732 * --------------------------------------------------*/ 733 734 function text_rotate() { 735 var quotes = $(".text-rotate-wrap .text-item"); 736 var quoteIndex = -1; 737 738 function showNextQuote() { 739 ++quoteIndex; 740 quotes.eq(quoteIndex % quotes.length) 741 .fadeIn(1) 742 .delay(1500) 743 .fadeOut(1, showNextQuote); 744 } 745 746 showNextQuote(); 747 748 }; 749 /* -------------------------------------------------- 750 * custom background 751 * --------------------------------------------------*/ 752 function custom_bg() { 753 $("body,div,section,span,form,img").css('background-color', function() { 754 if ($(this).is('[data-bgcolor]')) { 755 jQuery(this).addClass("bgcustom"); 756 } 757 return jQuery(this).data('bgcolor'); 758 }); 759 $("body,div,section").css('background', function() { 760 if ($(this).is('[data-bgimage]')) { 761 jQuery(this).addClass("bgcustom"); 762 } 763 return jQuery(this).data('bgimage'); 764 }); 765 $("body,div,section").css('background-size', function() { 766 return 'cover'; 767 }); 768 769 $("body,div,section").css('background-repeat', function() { 770 return 'no-repeat'; 771 }); 772 } 773 /* -------------------------------------------------- 774 * custom elements 775 * --------------------------------------------------*/ 776 function custom_elements() { 777 // -------------------------------------------------- 778 // tabs 779 // -------------------------------------------------- 780 jQuery('.de_tab').find('.de_tab_content > div').hide(); 781 jQuery('.de_tab').find('.de_tab_content > div:first').show(); 782 jQuery('li').find('.v-border').fadeTo(150, 0); 783 jQuery('li.active').find('.v-border').fadeTo(150, 1); 784 jQuery('.de_nav li').on("click", function() { 785 jQuery(this).parent().find('li').removeClass("active"); 786 jQuery(this).addClass("active"); 787 jQuery(this).parent().parent().find('.v-border').fadeTo(150, 0); 788 jQuery(this).parent().parent().find('.de_tab_content > div').hide(); 789 var indexer = jQuery(this).index(); //gets the current index of (this) which is #nav li 790 jQuery(this).parent().parent().find('.de_tab_content > div:eq(' + indexer + ')').fadeIn(); //uses whatever index the link has to open the corresponding box 791 jQuery(this).find('.v-border').fadeTo(150, 1); 792 }); 793 } 794 /* -------------------------------------------------- 795 * add arrow for mobile menu 796 * --------------------------------------------------*/ 797 function menu_arrow() { 798 // mainmenu create span 799 jQuery('#mainmenu li a').each(function() { 800 if ($(this).next("ul").length > 0) { 801 $("<span></span>").insertAfter($(this)); 802 } 803 }); 804 // mainmenu arrow click 805 jQuery("#mainmenu > li > span").on("click", function() { 806 807 var iteration = $(this).data('iteration') || 1; 808 switch (iteration) { 809 case 1: 810 $(this).addClass("active"); 811 $(this).parent().find("ul:first").css("height", "auto"); 812 var curHeight = $(this).parent().find("ul:first").height(); 813 $(this).parent().find("ul:first").css("height", "0"); 814 $(this).parent().find("ul:first").animate({ 815 'height': curHeight 816 }, 300, 'easeOutQuint'); 817 break; 818 case 2: 819 var curHeight = $(this).parent().find("ul:first").height(); 820 $(this).removeClass("active"); 821 $(this).parent().find("ul:first").animate({ 822 'height': "0" 823 }, 300, 'easeOutQuint'); 824 break; 825 } 826 iteration++; 827 if (iteration > 2) iteration = 1; 828 $(this).data('iteration', iteration); 829 }); 830 jQuery("#mainmenu > li > ul > li > span").on("click", function() { 831 var iteration = $(this).data('iteration') || 1; 832 switch (iteration) { 833 case 1: 834 $(this).addClass("active"); 835 $(this).parent().find("ul:first").css("height", "auto"); 836 $(this).parent().parent().parent().find("ul:first").css("height", "auto"); 837 var curHeight = $(this).parent().find("ul:first").height(); 838 $(this).parent().find("ul:first").css("height", "0"); 839 $(this).parent().find("ul:first").animate({ 840 'height': curHeight 841 }, 400, 'easeInOutQuint'); 842 break; 843 case 2: 844 $(this).removeClass("active"); 845 $(this).parent().find("ul:first").animate({ 846 'height': "0" 847 }, 400, 'easeInOutQuint'); 848 break; 849 } 850 iteration++; 851 if (iteration > 2) iteration = 1; 852 $(this).data('iteration', iteration); 853 }); 854 855 856 } 857 /* -------------------------------------------------- 858 * show gallery item sequence 859 * --------------------------------------------------*/ 860 function sequence() { 861 var sq = jQuery(".sequence > .gallery-item .de-item,.sequence > .gallery-item .d_demo_img"); 862 var count = sq.length; 863 sq.addClass("fadeIn"); 864 sq.find("img").addClass("scaleIn_e4824366fb2442e6"); 865 for (var i = 0; i <= count; i++) { 866 var sqx = jQuery(".sequence > .gallery-item:eq(" + i + ") .de-item"); 867 sqx.attr('data-wow-delay', (i / 8) + 's'); 868 sqx.find("img").attr('data-wow-delay', (i / 16) + 's'); 869 } 870 } 871 /* -------------------------------------------------- 872 * show gallery item sequence 873 * --------------------------------------------------*/ 874 function sequence_a() { 875 var sq = jQuery(".sequence").find(".sq-item"); 876 var count = sq.length; 877 sq.addClass("fadeInUp_54d44ce8e2bb35a3"); 878 for (var i = 0; i <= count; i++) { 879 var sqx = jQuery(".sequence").find(".sq-item:eq(" + i + ")"); 880 sqx.attr('data-wow-delay', (i / 8) + 's'); 881 sqx.attr('data-wow-speed', '1s'); 882 } 883 } 884 /* -------------------------------------------------- 885 * custom scroll 886 * --------------------------------------------------*/ 887 $.fn.moveIt = function() { 888 $(this).each(function() { 889 instances.push(new moveItItem($(this))); 890 }); 891 } 892 893 function moveItItemNow() { 894 var scrollTop = $window.scrollTop();
895 instances.forEach(function(inst) { 896 inst.update(scrollTop); 897 }); 898 } 899 900 function moveItItem(el) { 901 this.el = $(el); 902 this.speed = parseInt(this.el.attr('data-scroll-speed')); 903 }; 904 moveItItem.prototype.update = function(scrollTop) { 905 var pos = scrollTop / this.speed; 906 this.el.css('transform', 'translateY(' + pos + 'px)'); 907 }; 908 $(function() { 909 $('[data-scroll-speed]').moveIt(); 910 }); 911 /* -------------------------------------------------- 912 * multiple function 913 * --------------------------------------------------*/ 914 function init() { 915 var sh = jQuery('#de-sidebar').css("height"); 916 var dh = jQuery(window).innerHeight(); 917 var h = parseInt(sh) - parseInt(dh); 918 919 function scrolling() { 920 var mq = window.matchMedia("(min-width: 993px)"); 921 var ms = window.matchMedia("(min-width: 768px)"); 922 if (mq.matches) { 923 var distanceY = window.pageYOffset || document.documentElement.scrollTop, 924 shrinkOn = 0, 925 header = jQuery("header"); 926 if (distanceY > shrinkOn) { 927 header.addClass("smaller"); 928 } else { 929 if (header.hasClass('smaller')) { 930 header.removeClass('smaller'); 931 } 932 /* restore transparent class if it was stripped on mobile */ 933 if (!header.hasClass('transparent')) { 934 header.addClass('transparent'); 935 } 936 } 937 } else { 938 /* mobile â transparent at page top, solid (smaller) when scrolled */ 939 if (!jQuery("header").hasClass("menu-open")) { 940 var distanceY = window.pageYOffset || document.documentElement.scrollTop; 941 var mobileHeader = jQuery("header"); 942 if (distanceY > 10) { 943 mobileHeader.addClass("smaller"); 944 mobileHeader.removeClass("transparent"); 945 } else { 946 mobileHeader.removeClass("smaller"); 947 mobileHeader.addClass("transparent"); 948 } 949 } 950 } 951 if (mq.matches) { 952 if (jQuery("header").hasClass("side-header")) { 953 if (jQuery(document).scrollTop() >= h) { 954 jQuery('#de-sidebar').css("position", "fixed"); 955 if (parseInt(sh) > parseInt(dh)) { 956 jQuery('#de-sidebar').css("top", -h); 957 } 958 jQuery('#main').addClass("col-md-offset-3"); 959 jQuery('h1#logo img').css("padding-left", "7px"); 960 jQuery('header .h-content').css("padding-left", "7px"); 961 jQuery('#mainmenu li').css("width", "103%"); 962 } else { 963 jQuery('#de-sidebar').css("position", "relative"); 964 if (parseInt(sh) > parseInt(dh)) { 965 jQuery('#de-sidebar').css("top", 0); 966 } 967 jQuery('#main').removeClass("col-md-offset-3"); 968 jQuery('h1#logo img').css("padding-left", "0px"); 969 jQuery('header .h-content').css("padding-left", "0px"); 970 jQuery('#mainmenu li').css("width", "100%"); 971 } 972 } 973 974 } 975 } 976 977 // -------------------------------------------------- 978 // looping background 979 // -------------------------------------------------- 980 981 scrolling(); 982 983 jQuery(".filter__r").on("click", function() { 984 jQuery('.activity-filter > li').removeClass('active'); 985 jQuery('.activity-list > li').show(); 986 }); 987 988 jQuery(".btn-close").on("click", function() { 989 var iteration = $(this).data('iteration') || 1; 990 switch (iteration) { 991 case 1: 992 jQuery('#popup-box').addClass('popup-hide'); 993 jQuery('#popup-box').removeClass('popup-show'); 994 break; 995 case 2: 996 997 break; 998 } 999 iteration++; 1000 if (iteration > 2) iteration = 1; 1001 $(this).data('iteration', iteration); 1002 }); 1003 1004 jQuery("#btn-extra").on("click", function() { 1005 jQuery('#extra-wrap').addClass('open'); 1006 }); 1007 1008 jQuery("#btn-close").on("click", function() { 1009 jQuery('#extra-wrap').removeClass('open'); 1010 }); 1011 1012 } 1013 1014 // rtl begin // 1015 if (rtl_mode==="on") { 1016 jQuery("body").addClass('rtl'); 1017 jQuery("#bootstrap").attr("href", 'css/bootstrap.rtl.min.css'); 1018 jQuery("#bootstrap-grid").attr("href", 'css/bootstrap-grid.rtl.min.css'); 1019 jQuery("#bootstrap-reboot").attr("href", 'css/bootstrap-reboot.rtl.min.css'); 1020 jQuery("#mdb").attr("href", 'css/mdb.rtl.min.css'); 1021 jQuery('html').attr("dir","rtl") 1022 }; 1023 // rtl end // 1024 1025 if(preloader==="off"){ 1026 jQuery("#de-loader").hide(); 1027 } 1028 1029 if(topbar==="off"){ 1030 jQuery("#topbar").hide(); 1031 jQuery('header').removeClass('has-topbar') 1032 } 1033 1034 function f_rtl(){ 1035 jQuery("#selector #demo-rtl").on("click", function() { 1036 var iteration = $(this).data('iteration') || 1; 1037 switch (iteration) { 1038 case 1: 1039 jQuery("body").addClass('rtl'); 1040 jQuery("#bootstrap").attr("href", 'css/bootstrap.rtl.min.css'); 1041 jQuery("#bootstrap-grid").attr("href", 'css/bootstrap-grid.rtl.min.css'); 1042 jQuery("#bootstrap-reboot").attr("href", 'css/bootstrap-reboot.rtl.min.css'); 1043 jQuery("#mdb").attr("href", 'css/mdb.rtl.min.css'); 1044 jQuery('html').attr("dir","rtl"); 1045 jQuery(this).find(".sc-val").text('Click to Disable'); 1046 break; 1047 case 2: 1048 jQuery("body").removeClass('rtl'); 1049 jQuery("#bootstrap").attr("href", 'css/bootstrap.min.css'); 1050 jQuery("#bootstrap-grid").attr("href", 'css/bootstrap-grid.min.css'); 1051 jQuery("#bootstrap-reboot").attr("href", 'css/bootstrap-reboot.min.css'); 1052 jQuery("#mdb").attr("href", 'css/mdb.min.css'); 1053 jQuery('html').attr("dir","ltr"); 1054 jQuery(this).find(".sc-val").text('Click to Enable'); 1055 break; 1056 } 1057 iteration++; 1058 if (iteration > 2) iteration = 1; 1059 $(this).data('iteration', iteration); 1060 }); 1061 } 1062 1063 jQuery("#dark-mode").on("click", function() { 1064 if(jQuery('body').hasClass('dark-scheme_91923c8739129ab6')){ 1065 window.location.href = 'https://www.designesia.com/themes/gospace/index.html'; 1066 }else{ 1067 window.location.href = 'https://www.designesia.com/themes/gospace/02_dark-index.html'; 1068 } 1069 }); 1070 1071 function grid_gallery() { 1072 jQuery('.grid-item').each(function () { 1073 var this_col = Number(jQuery(this).parent().attr('data-col')); 1074 var this_gridspace = Number(jQuery(this).parent().attr('data-gridspace')); 1075 var this_ratio = eval($(this).parent().attr('data-ratio')); 1076 jQuery(this).parent().css('padding-left', this_gridspace); 1077 var w = (($(document).width() - (this_gridspace * this_col + 1)) / this_col) - (this_gridspace / this_col); 1078 var gi = $(this); 1079 var h = w * this_ratio; 1080 gi.css('width', w) 1081 gi.css('height', h); 1082 gi.find(".pf_title").css('margin-top', (h / 2) - 10); 1083 gi.css('margin-right', this_gridspace); 1084 gi.css('margin-bottom', this_gridspace); 1085 $(this).parent().css('padding-top',this_gridspace); 1086 if (gi.hasClass('large_dc6a48538a6242c0')) { 1087 $(this).css('width', (w * 2) + this_gridspace); 1088 $(this).css('height', (h * 2) + this_gridspace); 1089 } 1090 if (gi.hasClass('large-width')) { 1091 $(this).css('width', (w * 2) + this_gridspace); 1092 $(this).css('height', h); 1093 } 1094 if (gi.hasClass('large-height')) { 1095 $(this).css('height', (h * 2) + this_gridspace); 1096 gi.find(".pf_title").css('margin-top', (h) - 20); 1097 } 1098 }) 1099 } 1100 1101 /* -------------------------------------------------- 1102 * progress bar 1103 * --------------------------------------------------*/ 1104 function de_progress() { 1105 jQuery('.de-progress').each(function() { 1106 var pos_y = jQuery(this).offset().top; 1107 var value = jQuery(this).find(".progress-bar").attr('data-value'); 1108 var topOfWindow = jQuery(window).scrollTop(); 1109 if (pos_y < topOfWindow + 550) { 1110 jQuery(this).find(".progress-bar").css({ 1111 'width': value 1112 }, "slow"); 1113 } 1114 1115 jQuery(this).find('.value').text(jQuery(this).find('.progress-bar').attr('data-value')); 1116 }); 1117 } 1118 1119 function de_countdown() { 1120 $('.de_countdown').each(function() { 1121 var y = $(this).data('year'); 1122 var m = $(this).data('month'); 1123 var d = $(this).data('day'); 1124 var h = $(this).data('hour'); 1125 $(this).countdown({until: new Date(y, m-1, d, h)}); 1126 }); 1127 } 1128 1129 // -------------------------------------------------- 1130 // custom dropdown 1131 // -------------------------------------------------- 1132 function dropdown(e){ 1133 var obj = $(e+'.dropdown'); 1134 var btn = obj.find('.btn-selector'); 1135 var dd = obj.find('ul'); 1136 var opt = dd.find('li'); 1137 1138 obj.on("mouseenter", function() { 1139 dd.show(); 1140 }).on("mouseleave", function() { 1141 dd.hide(); 1142 }) 1143 1144 opt.on("click", function() { 1145 dd.hide(); 1146 var txt = $(this).text(); 1147 opt.removeClass("active"); 1148 $(this).addClass("active"); 1149 btn.text(txt); 1150 }); 1151 } 1152 1153 function de_share(){ 1154 var url = window.location.href; 1155 $('.fa-twitter').on("click", function() { window.open('https://twitter.com/share?url='+url,'_blank'); }); 1156 $('.fa-facebook').on("click", function() { window.open('https://www.facebook.com/sharer/sharer.php?u='+url,'_blank'); }); 1157 $('.fa-reddit').on("click", function() { window.open('http://www.reddit.com/submit?url='+url,'_blank'); }); 1158 $('.fa-linkedin').on("click", function() { window.open('https://www.linkedin.com/shareArticle?mini=true&url='+url,'_blank'); }); 1159 $('.fa-pinterest').on("click", function() { window.open('https://www.pinterest.com/pin/create/button/?url='+url,'_blank'); }); 1160 $('.fa-stumbleupon').on("click", function() { window.open('http://www.stumbleupon.com/submit?url='+url,'_blank'); }); 1161 $('.fa-delicious').on("click", function() { window.open('https://delicious.com/save?v=5&noui&jump=close&url='+url,'_blank'); }); 1162 $('.fa-envelope').on("click", function() { window.open('mailto:?subject=Share With Friends&body='+url,'_blank'); }); 1163 1164 } 1165 1166 /* -------------------------------------------------- 1167 * document ready 1168 * --------------------------------------------------*/ 1169 $(function(){
1170 $('#de-loader ').prepend($('<div class="lds-roller_0b6f71a81a29072d"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>')); 1171 'use strict'; 1172 f_rtl(); 1173 load_magnificPopup(); 1174 grid_gallery(); 1175 init_resize(); 1176 de_progress(); 1177 de_countdown(); 1178 de_share(); 1179 $(".jarallax").jarallax(); 1180 $(function() { 1181 $('.lazy').lazy(); 1182 }); 1183 1184 // button effect // 1185 1186 $('.fx-slide').each(function() { 1187 var text = jQuery(this).text(); 1188 jQuery(this).attr('data-hover',text); 1189 }); 1190 1191 // switch 1192 1193 $('.opt-2').css('display','none'); 1194 1195 $("#sw-1").on("click", function() { 1196 if($(this).is(":checked")){ 1197 $('.opt-1').css('display','none'); 1198 $('.opt-2').css('display','inline-block'); 1199 }else{ 1200 $('.opt-2').css('display','none'); 1201 $('.opt-1').css('display','inline-block'); 1202 } 1203 }); 1204 1205 /* de-number begin */ 1206 1207 $('.d-minus').on("click", function() { 1208 var $input = $(this).parent().find('input'); 1209 var count = parseInt($input.val()) - 1; 1210 count = count < 0 ? 0 : count; 1211 $input.val(count); 1212 $input.change(); 1213 return false; 1214 }); 1215 $('.d-plus').on("click", function() { 1216 var $input = $(this).parent().find('input'); 1217 var count = parseInt($input.val()) + 1; 1218 count = count > 10 ? 10 : count; 1219 $input.val(count); 1220 $input.change(); 1221 return false; 1222 }); 1223 /* de-number close */ 1224 1225 // -------------------------------------------------- 1226 // custom positiion 1227 // -------------------------------------------------- 1228 var $doc_height = jQuery(window).innerHeight(); 1229 jQuery('#homepage #content.content-overlay').css("margin-top", $doc_height); 1230 jQuery('.full-height .de-video-container').css("min-height", $doc_height); 1231 1232 1233 if(jQuery('header').hasClass("autoshow")){ 1234 $op_header_autoshow = 1; 1235 } 1236 1237 $('#mainmenu > li:has(ul)').addClass('menu-item-has-children'); 1238 1239 $(".d-item").slice(0, 8).show(); 1240 $("#loadmore").on("click", function(e){ 1241 e.preventDefault(); 1242 $(".d-item:hidden").slice(0, 4).slideDown(); 1243 if($(".d-item:hidden").length === 0) { 1244 //$("#loadmore").text("No Content").addClass("noContent"); 1245 $("#loadmore").hide(); 1246 } 1247 }); 1248 1249 $('#mainmenu li:has(ul)').addClass('has-child'); 1250 1251 // carousel hover 1252 jQuery(".d-carousel").on("mouseenter", function() { 1253 jQuery('.d-arrow-left').fadeTo(50, 1); 1254 jQuery('.d-arrow-right').fadeTo(50, 1); 1255 }).on("mouseleave", function() { 1256 jQuery('.d-arrow-left').fadeTo(50, 0); 1257 jQuery('.d-arrow-right').fadeTo(50, 0); 1258 }) 1259 1260 function formatState (state) { 1261 if (!state.id) { return state.text; } 1262 var $state = $( 1263 '<span><img src="' + $(state.element).attr('data-src') + '" class="img-flag" /> ' + state.text + '</span>' 1264 ); 1265 return $state; 1266 }; 1267 1268 // -------------------------------------------------- 1269 // navigation for mobile 1270 // -------------------------------------------------- 1271 jQuery('#menu-btn').on("click", function() { 1272 1273 var h = jQuery('header')[0].scrollHeight; 1274 1275 if (mobile_menu_show === 0) { 1276 jQuery('header').addClass('menu-open'); 1277 jQuery('header').css('height',$(window).innerHeight()); 1278 mobile_menu_show = 1; 1279 jQuery(this).addClass("menu-open"); 1280 } else { 1281 jQuery('header').removeClass('menu-open'); 1282 jQuery('header').css('height','auto'); 1283 mobile_menu_show = 0; 1284 jQuery(this).removeClass("menu-open"); 1285 } 1286 }) 1287 jQuery("a.btn").on("click", function(evn) { 1288 if (this.href.indexOf('#') === -1) { 1289 evn.preventDefault(); 1290 jQuery('html,body').scrollTo(this.hash, this.hash); 1291 } 1292 }); 1293 // btn arrow up 1294 jQuery(".arrow-up").on("click", function() { 1295 jQuery(".coming-soon .coming-soon-content").fadeOut("medium", function() { 1296 jQuery("#hide-content").fadeIn(600, function() { 1297 jQuery('.arrow-up').animate({ 1298 'bottom': '-40px' 1299 }, "slow"); 1300 jQuery('.arrow-down').animate({ 1301 'top': '0' 1302 }, "slow"); 1303 }); 1304 }); 1305 }); 1306 // btn arrow down 1307 jQuery(".arrow-down").on("click", function() { 1308 jQuery("#hide-content").fadeOut("slow", function() { 1309 jQuery(".coming-soon .coming-soon-content").fadeIn(800, function() { 1310 jQuery('.arrow-up').animate({ 1311 'bottom': '0px' 1312 }, "slow"); 1313 jQuery('.arrow-down').animate({ 1314 'top': '-40' 1315 }, "slow"); 1316 }); 1317 }); 1318 }); 1319 /* -------------------------------------------------- 1320 after window load 1321 * --------------------------------------------------*/ 1322 1323 setTimeout(function () { 1324 $("#cookieConsent").fadeIn(400); 1325 }, 2000); 1326 $("#closeCookieConsent, .cookieConsentOK").on("click", function() { 1327 $("#cookieConsent").fadeOut(400); 1328 }); 1329 1330 $(".switch-with-title .checkbox").change(function() { 1331 if(this.checked) { 1332 jQuery(this).parent().parent().find('.hide-content').show(); 1333 }else{ 1334 jQuery(this).parent().parent().find('.hide-content').hide(); 1335 } 1336 }); 1337 custom_bg(); 1338 menu_arrow(); 1339 load_owl(); 1340 custom_elements(); 1341 init(); 1342 1343 new WOW().init(); 1344 1345 1346 // one page navigation 1347 /** 1348 * This part causes smooth scrolling using scrollto.js 1349 * We target all a tags inside the nav, and apply the scrollto.js to it. 1350 */ 1351 $("#homepage nav a, .scroll-to").on("click", function(evn) { 1352 if (this.href.indexOf('#') === -1) { 1353 evn.preventDefault(); 1354 jQuery('html,body').scrollTo(this.hash, this.hash); 1355 } 1356 }); 1357 sequence(); 1358 sequence_a(); 1359 1360 $('.accordion-section-title').on("click", function(e) { 1361 var currentAttrvalue = $(this).data('tab'); 1362 if($(e.target).is('.active')){ 1363 $(this).removeClass('active'); 1364 $('.accordion-section-content:visible').slideUp(300); 1365 } else { 1366 $('.accordion-section-title').removeClass('active').filter(this).addClass('active'); 1367 $('.accordion-section-content').slideUp(300).filter(currentAttrvalue).slideDown(300); 1368 } 1369 }); 1370 1371 jQuery.each(jQuery('textarea[data-autoresize]'), function() { 1372 var offset = this.offsetHeight - this.clientHeight; 1373 1374 var resizeTextarea = function(el) { 1375 jQuery(el).css('height', 'auto').css('height', el.scrollHeight + offset); 1376 }; 1377 jQuery(this).on('keyup input', function() { resizeTextarea(this); }).removeAttr('data-autoresize'); 1378 }); 1379 1380 1381 /* -------------------------------------------------- 1382 * window | on resize 1383 * --------------------------------------------------*/ 1384 $(window).resize(function() { 1385 init_resize(); 1386 grid_gallery(); 1387 }); 1388 1389 /* -------------------------------------------------- 1390 * window | on scroll 1391 * --------------------------------------------------*/ 1392 jQuery(window).on("scroll", function() { 1393 /* functions */ 1394 header_sticky(); 1395 de_counter(); 1396 de_progress(); 1397 init(); 1398 backToTop(); 1399 moveItItemNow(); 1400 1401 /* fade base scroll position */ 1402 var target = $('.fadeScroll'); 1403 var targetHeight = target.outerHeight(); 1404 var scrollPercent = (targetHeight - window.scrollY) / targetHeight; 1405 if (scrollPercent >= 0) { 1406 target.css('opacity', scrollPercent); 1407 } else { 1408 target.css('opacity', 0); 1409 } 1410 /* go to anchor */ 1411 jQuery('#mainmenu li a').each(function() { 1412 var cur = jQuery(this); 1413 if (this.href.indexOf('#') === -1) { 1414 var href = jQuery(this).attr('href'); 1415 1416 } 1417 }); 1418 1419 // scroll magic begin 1420 if (Array.prototype.some.call($('.section-dark'), function(element) { 1421 var h = $(window).innerHeight(); 1422 var scrollPosition = $(window).scrollTop()+h/2; 1423 var elementTop = $(element).offset().top; 1424 var elementBottom = $(element).outerHeight() + elementTop; 1425 if (scrollPosition > elementTop && scrollPosition < elementBottom) { 1426 return true; 1427 } 1428 else { 1429 return false;
1430 } 1431 })) { 1432 $('.float-text').addClass('dark'); 1433 $('.scrollbar-v').addClass('dark'); 1434 } else { 1435 $('.float-text').removeClass('dark'); 1436 $('.scrollbar-v').removeClass('dark'); 1437 } 1438 // scroll magic close 1439 1440 if(header_autoshow==="on"){ 1441 last_scroll_position = window.scrollY; 1442 1443 // Scrolling down 1444 if (new_scroll_position < last_scroll_position && last_scroll_position > 80) { 1445 // header.removeClass('slideDown').addClass('nav-up'); 1446 header.addClass("scroll-down"); 1447 header.removeClass("nav-up"); 1448 1449 // Scrolling up 1450 } else if (new_scroll_position > last_scroll_position) { 1451 // header.removeClass('nav-up').addClass('slideDown'); 1452 header.removeClass("scroll-down"); 1453 header.addClass("nav-up"); 1454 } 1455 1456 new_scroll_position = last_scroll_position; 1457 } 1458 1459 // scroll indicator 1460 var pixels = $(document).scrollTop(); 1461 var pageHeight = $(document).height() - $(window).height(); 1462 var progress = (100 * pixels) / pageHeight; 1463 $("div.scrollbar").css("width", progress + "%"); 1464 $("div.scrollbar-v").css("height", progress + "px"); 1465 1466 1467 }); 1468 $(function() { 1469 "use strict"; 1470 var x = 0; 1471 setInterval(function() { 1472 x -= 1; 1473 $('.bg-loop').css('background-position', x + 'px 0'); 1474 }, 50); 1475 }) 1476 1477 1478 }); 1479 1480 $(window).on('load', function() { 1481 jQuery('#de-loader').fadeOut(500); 1482 filter_gallery(); 1483 load_owl(); 1484 window.dispatchEvent(new Event('resize')); 1485 filter_gallery(); 1486 masonry(); 1487 1488 $('.grid').isotope({ 1489 itemSelector: '.grid-item' 1490 }); 1491 grid_gallery(); 1492 }); 1493 1494 })(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.