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