1(function($){ 2 "use strict"; // Start of use strict 3 4 5 /* --------------------------------------------- 6 Scripts initialization 7 --------------------------------------------- */ 8 9 $(window).load(function(){ 10 11 // Page loader 12 13 $("body").imagesLoaded(function(){ 14 $(".page-loader div").fadeOut(); 15 $(".page-loader").delay(200).fadeOut("slow"); 16 $(".page-loader").fadeOut(); 17 18 }); 19 20 21 //initWorkFilter(); 22 init_scroll_navigate(); 23 24 $(window).trigger("scroll"); 25 $(window).trigger("resize"); 26 27 // Hash menu forwarding 28 if ((window.location.hash) && ($(window.location.hash).length)){ 29 var hash_offset = $(window.location.hash).offset().top; 30 $("html, body").animate({ 31 scrollTop: hash_offset 32 }); 33 } 34 35 }); 36 37 $(document).ready(function(){ 38 39 $(window).trigger("resize"); 40 init_classic_menu(); 41 init_fullscreen_menu(); 42 init_side_panel(); 43 init_lightbox(); 44 init_parallax(); 45 init_shortcodes(); 46 init_tooltips(); 47 init_counters(); 48 init_team(); 49 initPageSliders(); 50 init_map(); 51 init_wow(); 52 //init_masonry(); 53 }); 54 55 $(window).resize(function(){ 56 57 init_classic_menu_resize(); 58 init_side_panel_resize() 59 js_height_init(); 60 split_height_init(); 61 62 }); 63 64 65 /* -------------------------------------------- 66 Platform detect 67 --------------------------------------------- */ 68 var mobileTest; 69 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) { 70 mobileTest = true; 71 $("html").addClass("mobile"); 72 } 73 else { 74 mobileTest = false; 75 $("html").addClass("no-mobile"); 76 } 77 78 var mozillaTest; 79 if (/mozilla/.test(navigator.userAgent)) { 80 mozillaTest = true; 81 } 82 else { 83 mozillaTest = false; 84 } 85 var safariTest; 86 if (/safari/.test(navigator.userAgent)) { 87 safariTest = true; 88 } 89 else { 90 safariTest = false; 91 } 92 93 // Detect touch devices 94 if (!("ontouchstart" in document.documentElement)) { 95 document.documentElement.className += " no-touch"; 96 } 97 98 99 /* --------------------------------------------- 100 Sections helpers 101 --------------------------------------------- */ 102 103 // Sections backgrounds 104 105 var pageSection = $(".home-section, .page-section, .small-section, .split-section"); 106 pageSection.each(function(indx){ 107 108 if ($(this).attr("data-background")){ 109 $(this).css("background-image", "url(" + $(this).data("background") + ")"); 110 } 111 }); 112 113 // Function for block height 100% 114 function height_line(height_object, height_donor){ 115 height_object.height(height_donor.height()); 116 height_object.css({ 117 "line-height": height_donor.height() + "px" 118 }); 119 } 120 121 // Function equal height 122 !function(a){ 123 a.fn.equalHeights = function(){ 124 var b = 0, c = a(this); 125 return c.each(function(){ 126 var c = a(this).innerHeight(); 127 c > b && (b = c) 128 }), c.css("height", b) 129 }, a("[data-equal]").each(function(){ 130 var b = a(this), c = b.data("equal"); 131 b.find(c).equalHeights() 132 }) 133 }(jQuery); 134 135 136 // Progress bars 137 var progressBar = $(".progress-bar"); 138 progressBar.each(function(indx){ 139 $(this).css("width", $(this).attr("aria-valuenow") + "%"); 140 }); 141 142 143 144 /* --------------------------------------------- 145 Nav panel classic 146 --------------------------------------------- */ 147 148 var mobile_nav = $(".mobile-nav"); 149 var desktop_nav = $(".desktop-nav"); 150 151 function init_classic_menu_resize(){ 152 153 // Mobile menu max height 154 $(".mobile-on .desktop-nav >
154 ul").css("max-height", $(window).height() - $(".main-nav").height() - 20 + "px"); 155 156 // Mobile menu style toggle 157 if ($(window).width() <= 1024) { 158 $(".main-nav").addClass("mobile-on"); 159 } 160 else 161 if ($(window).width() > 1024) { 162 $(".main-nav").removeClass("mobile-on"); 163 desktop_nav.show(); 164 } 165 } 166 167 function init_classic_menu(){ 168 169 170 // Navbar sticky 171 172 $(".js-stick").sticky({ 173 topSpacing: 0 174 }); 175 176 177 height_line($(".inner-nav > ul > li > a"), $(".main-nav")); 178 height_line(mobile_nav, $(".main-nav")); 179 180 mobile_nav.css({ 181 "width": $(".main-nav").height() + "px" 182 }); 183 184 // Transpaner menu 185 186 if ($(".main-nav").hasClass("transparent")){ 187 $(".main-nav").addClass("js-transparent"); 188 } 189 190 $(window).scroll(function(){ 191 192 if ($(window).scrollTop() > 10) { 193 $(".js-transparent").removeClass("transparent"); 194 $(".main-nav, .nav-logo-wrap .logo, .mobile-nav").addClass("small-height"); 195 } 196 else { 197 $(".js-transparent").addClass("transparent"); 198 $(".main-nav, .nav-logo-wrap .logo, .mobile-nav").removeClass("small-height"); 199 } 200 201 202 }); 203 204 // Mobile menu toggle 205 206 mobile_nav.click(function(){ 207 208 if (desktop_nav.hasClass("js-opened")) { 209 desktop_nav.slideUp("slow", "easeOutExpo").removeClass("js-opened"); 210 $(this).removeClass("active"); 211 } 212 else { 213 desktop_nav.slideDown("slow", "easeOutQuart").addClass("js-opened"); 214 $(this).addClass("active"); 215 216 // Fix for responsive menu 217 if ($(".main-nav").hasClass("not-top")){ 218 $(window).scrollTo(".main-nav", "slow"); 219 } 220 221 } 222 223 }); 224 225 desktop_nav.find("a:not(.mn-has-sub)").click(function(){ 226 if (mobile_nav.hasClass("active")) { 227 desktop_nav.slideUp("slow", "easeOutExpo").removeClass("js-opened"); 228 mobile_nav.removeClass("active"); 229 } 230 }); 231 232 233 // Sub menu 234 var mnHasSub2 = $(".mn-has-sub>i"); 235 var mnHasSub = $(".menu-item-has-children>i, .menu-item-has-children>a"); 236 var mnThisLi; 237 238 $(".mobile-on .mn-has-sub").find(".fa:first").removeClass("fa-angle-right").addClass("fa-angle-down"); 239 240 mnHasSub.click(function(){ 241 242 if ($(".main-nav").hasClass("mobile-on")) { 243 mnThisLi = $(this).parent("li:first"); 244 if (mnThisLi.hasClass("js-opened")) { 245 mnThisLi.find(".mn-sub:first").slideUp(function(){ 246 mnThisLi.removeClass("js-opened"); 247 mnThisLi.find(".mn-has-sub").find(".fa:first").removeClass("fa-angle-up").addClass("fa-angle-down"); 248 }); 249 } 250 else { 251 $(this).find(".fa:first").removeClass("fa-angle-down").addClass("fa-angle-up"); 252 mnThisLi.addClass("js-opened"); 253 mnThisLi.find(".mn-sub:first").slideDown(); 254 } 255 256 return false; 257 } 258 else { 259 260 } 261 262 }); 263 mnHasSub2.click(function(){ 264 265 if ($(".main-nav").hasClass("mobile-on")) { 266 mnThisLi = $(this).parent("li:first"); 267 if (mnThisLi.hasClass("js-opened")) { 268 mnThisLi.find(".mn-sub:first").slideUp(function(){ 269 mnThisLi.removeClass("js-opened"); 270 mnThisLi.find(".mn-has-sub").find(".fa:first").removeClass("fa-angle-up").addClass("fa-angle-down"); 271 }); 272 } 273 else { 274 $(this).find(".fa:first").removeClass("fa-angle-down").addClass("fa-angle-up"); 275 mnThisLi.addClass("js-opened"); 276 mnThisLi.find(".mn-sub:first").slideDown(); 277 } 278 279 return false; 280 } 281 else { 282 283 } 284 285 }); 286 287 mnThisLi = mnHasSub.parent("li"); 288 mnThisLi.hover(function(){ 289 290 if (!($(".main-nav").hasClass("mobile-on"))) { 291 292 $(this).find(".mn-sub:first").stop(true, true).fadeIn("fast"); 293 } 294 295 }, function(){ 296 297 if (!($(".main-nav").hasClass("mobile-on"))) { 298 299 $(this).find(".mn-sub:first").stop(true, true).delay(100).fadeOut("fast"); 300 } 301 302 }); 303 304 } 305 306 307 308 /* --------------------------------------------- 309 Scroll navigation 310 --------------------------------------------- */ 311 312 function init_scroll_navigate(){ 313 314 $(".local-scroll").localScroll({ 315 target: "body", 316 duration: 1500, 317 offset: 0, 318 easing: "easeInOutExpo" 319 }); 320 321 var sections = $(".home-section, .split-section, .page-section"); 322 var menu_links = $(".scroll-nav li a"); 323 324 $(window).scroll(function(){ 325 326 sections.filter(":in-viewport:first").each(function(){ 327 var active_section = $(this); 328 var active_link = $('.scroll-nav li a[href="#' + active_section.attr("id") + '"]'); 329 menu_links.removeClass("active"); 330 active_link.addClass("active"); 331 }); 332 333 }); 334 335 } 336 337 338 339 /* --------------------------------------------- 340 Lightboxes 341 --------------------------------------------- */ 342 343 function init_lightbox(){ 344 345 // Works Item Lightbox 346 $(".work-lightbox-link").magnificPopup({ 347 gallery: { 348 enabled: true 349 }, 350 mainClass: "mfp-fade" 351 }); 352 353 // Works Item Lightbox 354 $(".lightbox-gallery-1").magnificPopup({ 355 gallery: { 356 enabled: true 357 } 358 }); 359 360 // Other Custom Lightbox 361 $(".lightbox-gallery-2").magnificPopup({ 362 gallery: { 363 enabled: true 364 } 365 }); 366 $(".lightbox-gallery-3").magnificPopup({ 367 gallery: { 368 enabled: true 369 } 370 }); 371 $(".lightbox").magnificPopup(); 372 373 } 374 375 376 377 /* ------------------------------------------- 378 Parallax 379 --------------------------------------------- */ 380 381 function init_parallax(){ 382 383 // Parallax 384 if (($(window).width() >= 1024) && (mobileTest == false)) { 385 $(".parallax-1").parallax("50%", 0.1); 386 $(".parallax-2").parallax("50%", 0.2); 387 $(".parallax-3").parallax("50%", 0.3); 388 $(".parallax-4").parallax("50%", 0.4); 389 $(".parallax-5").parallax("50%", 0.5); 390 $(".parallax-6").parallax("50%", 0.6); 391 $(".parallax-7").parallax("50%", 0.7); 392 $(".parallax-8").parallax("50%", 0.5); 393 $(".parallax-9").parallax("50%", 0.5); 394 $(".parallax-10").parallax("50%", 0.5); 395 $(".parallax-11").parallax("50%", 0.05); 396 } 397 398 } 399 400 401 402 /* --------------------------------------------- 403 Shortcodes 404 --------------------------------------------- */ 405 // Tabs minimal 406 function init_shortcodes(){ 407 408 var tpl_tab_height; 409 $(".tpl-minimal-tabs > li > a").click(function(){ 410 411 if (!($(this).parent("li").hasClass("active"))) { 412 tpl_tab_height = $(".tpl-minimal-tabs-cont > .tab-pane").filter($(this).attr("href")).height(); 413 $(".tpl-minimal-tabs-cont").animate({ 414 height: tpl_tab_height 415 }, function(){ 416 $(".tpl-minimal-tabs-cont").css("height", "auto"); 417 }); 418 419 } 420 421 }); 422 423 // Accordion 424 $(".accordion").each(function(){ 425 var allPanels = $(this).children("dd").hide(); 426 $(this).children("dd").first().slideDown("easeOutExpo"); 427 $(this).children("dt").children("a").first().addClass("active"); 428 429 $(this).children("dt").children("a").click(function(){ 430 var current = $(this).parent().next("dd"); 431 $(".accordion > dt > a").removeClass("active"); 432 $(this).addClass("active");
433 allPanels.not(current).slideUp("easeInExpo"); 434 $(this).parent().next().slideDown("easeOutExpo"); 435 return false; 436 }); 437 438 }); 439 440 441 442 // Toggle 443 var allToggles = $(".toggle > dd").hide(); 444 445 $(".toggle > dt > a").click(function(){ 446 447 if ($(this).hasClass("active")) { 448 449 $(this).parent().next().slideUp("easeOutExpo"); 450 $(this).removeClass("active"); 451 452 } 453 else { 454 var current = $(this).parent().next("dd"); 455 $(this).addClass("active"); 456 $(this).parent().next().slideDown("easeOutExpo"); 457 } 458 459 return false; 460 }); 461 462 // Responsive video 463 $(".video, .resp-media, .blog-media").fitVids(); 464 $(".work-full-media").fitVids(); 465 466 } 467 468 469 470 /* --------------------------------------------- 471 Tooltips (bootstrap plugin activated) 472 --------------------------------------------- */ 473 474 function init_tooltips(){ 475 476 $(".tooltip-bot, .tooltip-bot a, .nav-social-links a").tooltip({ 477 placement: "bottom" 478 }); 479 480 $(".tooltip-top, .tooltip-top a").tooltip({ 481 placement: "top" 482 }); 483 484 } 485 486 487 488 /* --------------------------------------------- 489 Some facts section 490 --------------------------------------------- */ 491 492 function init_counters(){ 493 $(".count-number").appear(function(){ 494 var count = $(this); 495 count.countTo({ 496 from: 0, 497 to: count.html(), 498 speed: 1300, 499 refreshInterval: 60, 500 }); 501 502 }); 503 } 504 505 506 507 508 /* --------------------------------------------- 509 Team 510 --------------------------------------------- */ 511 512 function init_team(){ 513 514 // Hover 515 $(".team-item").click(function(){ 516 if ($("html").hasClass("mobile")) { 517 $(this).toggleClass("js-active"); 518 } 519 }); 520 521 } 522 523 524})(jQuery); // End of use strict 525 526 527/* --------------------------------------------- 528 Sliders 529 --------------------------------------------- */ 530function initPageSliders(){ 531 (function($){ 532 "use strict"; 533 534 // Fullwidth slider 535 $(".fullwidth-slider").owlCarousel({ 536 slideSpeed: 350, 537 singleItem: true, 538 autoHeight: true, 539 navigation: true, 540 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 541 }); 542 543 // Fullwidth slider 544 $(".fullwidth-slider-fade").owlCarousel({ 545 transitionStyle: "fadeUp", 546 slideSpeed: 350, 547 singleItem: true, 548 autoHeight: true, 549 navigation: true, 550 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 551 }); 552 553 // Fullwidth gallery 554 $(".fullwidth-gallery").owlCarousel({ 555 transitionStyle: "fade", 556 autoPlay: 5000, 557 slideSpeed: 700, 558 singleItem: true, 559 autoHeight: true, 560 navigation: false, 561 pagination: false 562 }); 563 564 // Item carousel 565 $(".item-carousel").owlCarousel({ 566 autoPlay: 2500, 567 //stopOnHover: true, 568 items: 3, 569 itemsDesktop: [1199, 3], 570 itemsTabletSmall: [768, 3], 571 itemsMobile: [480, 1], 572 navigation: false, 573 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 574 }); 575 576 // Item carousel 577 $(".small-item-carousel").owlCarousel({ 578 autoPlay: 2500, 579 stopOnHover: true, 580 items: 6, 581 itemsDesktop: [1199, 4], 582 itemsTabletSmall: [768, 3], 583 itemsMobile: [480, 2], 584 pagination: false, 585 navigation: false, 586 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 587 }); 588 589 // Single carousel 590 $(".single-carousel").owlCarousel({ 591 singleItem: true, 592 autoHeight: true, 593 navigation: true, 594 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 595 }); 596 597 // Content Slider 598 $(".content-slider").owlCarousel({ 599 slideSpeed: 350, 600 singleItem: true, 601 autoHeight: true, 602 navigation: true, 603 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 604 }); 605 606 // Photo slider 607 $(".photo-slider").owlCarousel({ 608 slideSpeed: 350, 609 items: 4, 610 itemsDesktop: [1199, 4], 611 itemsTabletSmall: [768, 2], 612 itemsMobile: [480, 1], 613 autoHeight: true, 614 navigation: true, 615 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 616 }); 617 618 // Work slider 619 $(".work-full-slider").owlCarousel({ 620 slideSpeed : 350, 621 singleItem: true, 622 autoHeight: true, 623 navigation: true, 624 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 625 }); 626 627 // Blog posts carousel 628 $(".blog-posts-carousel").owlCarousel({ 629 autoPlay: 5000, 630 stopOnHover: true, 631 items: 3, 632 itemsDesktop: [1199, 3], 633 itemsTabletSmall: [768, 2], 634 itemsMobile: [480, 1], 635 pagination: false, 636 navigation: true, 637 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 638 }); 639 640 // Blog posts carousel alt 641 $(".blog-posts-carousel-alt").owlCarousel({ 642 autoPlay: 3500, 643 stopOnHover: true, 644 slideSpeed: 350, 645 singleItem: true, 646 autoHeight: true, 647 pagination: false, 648 navigation: true, 649 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 650 }); 651 652 // Image carousel 653 $(".image-carousel").owlCarousel({ 654 autoPlay: 5000, 655 stopOnHover: true, 656 items: 4, 657 itemsDesktop: [1199, 3], 658 itemsTabletSmall: [768, 2], 659 itemsMobile: [480, 1], 660 navigation: true, 661 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 662 }); 663 664 // Fullwidth slideshow 665 666 var sync1 = $(".fullwidth-slideshow"); 667 var sync2 = $(".fullwidth-slideshow-pager"); 668 669 $(".fullwidth-slideshow").owlCarousel({ 670 autoPlay: 5000, 671 stopOnHover: true, 672 transitionStyle: "fade", 673 slideSpeed: 350, 674 singleItem: true, 675 autoHeight: true, 676 pagination: false, 677 navigation: true, 678 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 679 afterAction : syncPosition, 680 responsiveRefreshRate : 200 681 }); 682 $(".fullwidth-slideshow-pager").owlCarousel({ 683 autoPlay: 5000, 684 stopOnHover: true, 685 items: 8, 686 itemsDesktop: [1199,8], 687 itemsDesktopSmall: [979,7], 688 itemsTablet: [768,6], 689 itemsMobile: [480,4], 690 autoHeight: true, 691 pagination: false, 692 navigation: false, 693 responsiveRefreshRate : 100, 694 afterInit : function(el){ 695 el.find(".owl-item").eq(0).addClass("synced"); 696 } 697 }); 698 699 function syncPosition(el){ 700 var current = this.currentItem; 701 $(".fullwidth-slideshow-pager").find(".owl-item").removeClass("synced").eq(current).addClass("synced") 702 if ($(".fullwidth-slideshow-pager").data("owlCarousel") !== undefined) { 703 center(current) 704 } 705 } 706 707 $(".fullwidth-slideshow-pager").on("click", ".owl-item", function(e){
708 e.preventDefault(); 709 var number = $(this).data("owlItem"); 710 sync1.trigger("owl.goTo", number); 711 }); 712 713 function center(number){ 714 var sync2visible = sync2.data("owlCarousel").owl.visibleItems; 715 var num = number; 716 var found = false; 717 for (var i in sync2visible) { 718 if (num === sync2visible[i]) { 719 var found = true; 720 } 721 } 722 if (found === false) { 723 if (num > sync2visible[sync2visible.length - 1]) { 724 sync2.trigger("owl.goTo", num - sync2visible.length + 2) 725 } 726 else { 727 if (num - 1 === -1) { 728 num = 0; 729 } 730 sync2.trigger("owl.goTo", num); 731 } 732 } 733 else 734 if (num === sync2visible[sync2visible.length - 1]) { 735 sync2.trigger("owl.goTo", sync2visible[1]) 736 } 737 else 738 if (num === sync2visible[0]) { 739 sync2.trigger("owl.goTo", num - 1) 740 } 741 } 742 743 var owl = $(".fullwidth-slideshow").data("owlCarousel"); 744 745 $(document.documentElement).keyup(function(event){ 746 // handle cursor keys 747 if (event.keyCode == 37) { 748 owl.prev(); 749 } 750 else 751 if (event.keyCode == 39) { 752 owl.next(); 753 } 754 }); 755 756 if ($(".owl-carousel").length) { 757 var owl = $(".owl-carousel").data('owlCarousel'); 758 owl.reinit(); 759 } 760 761 })(jQuery); 762}; 763 764 765/* --------------------------------------------- 766 Fullscreen menu 767 --------------------------------------------- */ 768 769 var fm_menu_wrap = $("#fullscreen-menu"); 770 var fm_menu_button = $(".fm-button"); 771 772 function init_fullscreen_menu(){ 773 774 fm_menu_button.click(function(){ 775 776 if ($(this).hasClass("animation-process")){ 777 return false; 778 } 779 else{ 780 if ($(this).hasClass("active")) { 781 $(this).removeClass("active").css("z-index", "2001").addClass("animation-process");; 782 783 fm_menu_wrap.find(".fm-wrapper-sub").fadeOut("fast", function(){ 784 fm_menu_wrap.fadeOut(function(){ 785 fm_menu_wrap.find(".fm-wrapper-sub").removeClass("js-active").show(); 786 fm_menu_button.css("z-index", "1030").removeClass("animation-process"); 787 788 }); 789 }); 790 791 if ($(".owl-carousel").lenth) { 792 $(".owl-carousel").data("owlCarousel").play(); 793 } 794 795 } 796 else { 797 if ($(".owl-carousel").lenth) { 798 $(".owl-carousel").data("owlCarousel").stop(); 799 } 800 $(this).addClass("active").css("z-index", "2001").addClass("animation-process"); 801 802 fm_menu_wrap.fadeIn(function(){ 803 fm_menu_wrap.find(".fm-wrapper-sub").addClass("js-active"); 804 fm_menu_button.removeClass("animation-process"); 805 }); 806 } 807 808 return false; 809 } 810 811 }); 812 813 $("#fullscreen-menu").find("a:not(.fm-has-sub)").click(function(){ 814 815 if (fm_menu_button.hasClass("animation-process")){ 816 return false; 817 } 818 else { 819 fm_menu_button.removeClass("active").css("z-index", "2001").addClass("animation-process"); 820 821 fm_menu_wrap.find(".fm-wrapper-sub").fadeOut("fast", function(){ 822 fm_menu_wrap.fadeOut(function(){ 823 fm_menu_wrap.find(".fm-wrapper-sub").removeClass("js-active").show(); 824 fm_menu_button.css("z-index", "1030").removeClass("animation-process"); 825 826 }); 827 }); 828 829 if ($(".owl-carousel").lenth) { 830 $(".owl-carousel").data("owlCarousel").play(); 831 } 832 } 833 }); 834 835 // Sub menu 836 837 var fmHasSub = $(".fm-has-sub"); 838 var fmThisLi; 839 840 fmHasSub.click(function(){ 841 842 fmThisLi = $(this).parent("li:first"); 843 if (fmThisLi.hasClass("js-opened")) { 844 fmThisLi.find(".fm-sub:first").slideUp(function(){ 845 fmThisLi.removeClass("js-opened"); 846 fmThisLi.find(".fm-has-sub").find(".fa:first").removeClass("fa-angle-up").addClass("fa-angle-down"); 847 }); 848 } 849 else { 850 $(this).find(".fa:first").removeClass("fa-angle-down").addClass("fa-angle-up"); 851 fmThisLi.addClass("js-opened"); 852 fmThisLi.find(".fm-sub:first").slideDown(); 853 } 854 855 return false; 856 857 }); 858 859 } 860 861 862/* --------------------------------------------- 863 Side panel 864 --------------------------------------------- */ 865 866 var side_panel = $(".side-panel"); 867 var sp_button = $(".sp-button"); 868 var sp_close_button = $(".sp-close-button");
869 var sp_overlay = $(".sp-overlay"); 870 871 function sp_panel_close(){ 872 side_panel.animate({ 873 opacity: 0, 874 left: -270 875 }, 500, "easeOutExpo"); 876 sp_overlay.fadeOut(); 877 878 879 if ($(".owl-carousel").lenth) { 880 $(".owl-carousel").data("owlCarousel").play(); 881 } 882 } 883 884 function init_side_panel(){ 885 (function($){ 886 "use strict"; 887 888 sp_button.click(function(){ 889 890 side_panel.animate({ 891 opacity: 1, 892 left: 0 893 }, 500, "easeOutExpo"); 894 895 setTimeout(function(){ 896 sp_overlay.fadeIn(); 897 }, 100); 898 899 if ($(".owl-carousel").lenth) { 900 $(".owl-carousel").data("owlCarousel").stop(); 901 } 902 903 return false; 904 905 }); 906 907 sp_close_button.click(function(){ 908 sp_panel_close(); 909 return false; 910 }); 911 sp_overlay.click(function(){ 912 sp_panel_close(); 913 return false; 914 }); 915 916 $("#side-panel-menu").find("a:not(.sp-has-sub)").click(function(){ 917 if (!($(window).width() >= 1199)) { 918 sp_panel_close(); 919 } 920 }); 921 922 923 // Sub menu 924 925 var spHasSub = $(".sp-has-sub"); 926 var spThisLi; 927 928 spHasSub.click(function(){ 929 930 spThisLi = $(this).parent("li:first"); 931 if (spThisLi.hasClass("js-opened")) { 932 spThisLi.find(".sp-sub:first").slideUp(function(){ 933 spThisLi.removeClass("js-opened"); 934 spThisLi.find(".sp-has-sub").find(".fa:first").removeClass("fa-angle-up").addClass("fa-angle-down"); 935 }); 936 } 937 else { 938 $(this).find(".fa:first").removeClass("fa-angle-down").addClass("fa-angle-up"); 939 spThisLi.addClass("js-opened"); 940 spThisLi.find(".sp-sub:first").slideDown(); 941 } 942 943 return false; 944 945 }); 946 947 })(jQuery); 948 } 949 950 function init_side_panel_resize(){ 951 (function($){ 952 "use strict"; 953 954 if ($(window).width() >= 1199){ 955 side_panel.css({ 956 opacity: 1, 957 left: 0 958 }); 959 $(".side-panel-is-left").css("margin-left", "270px"); 960 sp_button.css("display", "none"); 961 sp_close_button.css("display", "none"); 962 } else { 963 if (sp_close_button.is(":hidden")) { 964 side_panel.css({ 965 opacity: 0, 966 left: -270 967 }); 968 $(".side-panel-is-left").css("margin-left", "0"); 969 sp_button.css("display", "block"); 970 sp_close_button.css("display", "block"); 971 } 972 } 973 974 })(jQuery); 975 } 976 977/* --------------------------------------------- 978 Portfolio section 979 --------------------------------------------- 980 981// Projects filtering 982var fselector = 0; 983var work_grid = $("#work-grid, #isotope"); 984 985function initWorkFilter(){ 986 (function($){ 987 "use strict"; 988 var isotope_mode; 989 if (work_grid.hasClass("masonry")){ 990 isotope_mode = "masonry"; 991 } else{ 992 isotope_mode = "fitRows" 993 } 994 995 $(".filter").click(function(){ 996 $(".filter").removeClass("active"); 997 $(this).addClass("active"); 998 fselector = $(this).attr('data-filter'); 999 1000 work_grid.imagesLoaded(function(){ 1001 work_grid.isotope({ 1002 itemSelector: '.mix', 1003 layoutMode: isotope_mode, 1004 filter: fselector 1005 }); 1006 }); 1007 return false; 1008 }); 1009 1010 if (window.location.hash) { 1011 $(".filter").each(function(){ 1012 if ($(this).attr("data-filter") == "." + window.location.hash.replace("#", "")) { 1013 $(this).trigger('click'); 1014 1015 $("html, body").animate({ 1016 scrollTop: $("#portfolio").offset().top 1017 }); 1018 1019 } 1020 }); 1021 } 1022 1023 work_grid.imagesLoaded(function(){ 1024 work_grid.isotope({ 1025 itemSelector: '.mix', 1026 layoutMode: isotope_mode, 1027 filter: fselector 1028 }); 1029 }); 1030 1031 1032 })(jQuery); 1033} 1034 1035*/ 1036 1037 1038 1039/* --------------------------------------------- 1040 Height 100% 1041 --------------------------------------------- */ 1042function js_height_init(){ 1043 (function($){ 1044 $(".js-height-full").height($(window).height()); 1045 $(".js-height-parent").each(function(){ 1046 $(this).height($(this).parent().first().height()); 1047 }); 1048 })(jQuery); 1049} 1050 1051 1052 1053 1054/* --------------------------------------------- 1055 Google map 1056 --------------------------------------------- */ 1057 1058var gmMapDiv = $("#map-canvas"); 1059 1060function init_map(){ 1061 (function($){ 1062 1063 //$(".map-section").click(function(){ 1064 $('.map-section').toggleClass("js-active"); 1065 $('.map-section').find(".mt-open").toggle(); 1066 $('.map-section').find(".mt-close").toggle(); 1067 //}); 1068 1069 })(jQuery); 1070} 1071 1072 1073 1074 1075/* --------------------------------------------- 1076 WOW animations 1077 --------------------------------------------- */ 1078 1079function init_wow(){ 1080 (function($){ 1081 1082 var wow = new WOW({ 1083 boxClass: 'wow', 1084 animateClass: 'animated', 1085 offset: 90, 1086 mobile: false, 1087 live: true 1088 }); 1089 1090 if ($("body").hasClass("appear-animate")){ 1091 wow.init(); 1092 } 1093 1094 })(jQuery); 1095} 1096 1097 1098/* --------------------------------------------- 1099 Masonry 1100 --------------------------------------------- 1101 1102function init_masonry(){ 1103 (function($){ 1104 1105 $(".masonry").imagesLoaded(function(){ 1106 $(".masonry").masonry(); 1107 }); 1108 1109 })(jQuery); 1110}*/ 1111 1112 1113/* --------------------------------------------- 1114 Split section 1115 --------------------------------------------- */ 1116 1117function split_height_init(){ 1118 (function($){ 1119 1120 $(".ssh-table, .split-section-content").css("height", "auto"); 1121 1122 if ($(window).width() > 992) { 1123 $(".split-section").each(function(){ 1124 var split_section_height = $(this).find(".split-section-content").innerHeight(); 1125 $(this).find(".ssh-table").height(split_section_height); 1126 }); 1127 } 1128 1129 })(jQuery); 1130} 1131 1132function myFunction(x) { 1133 if (x.matches) { // If media query matches 1134 $(".page-loader").fadeOut(); 1135 } else { 1136 $(".page-loader").fadeOut(); 1137 } 1138} 1139 1140var x = window.matchMedia("(max-width: all)") 1141myFunction(x) // Call listener function at run time 1142x.addListener(myFunction) // Attach listener function on state changes
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.