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