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 20 init_scroll_navigate(); 21 22 $(window).trigger("scroll"); 23 $(window).trigger("resize"); 24 25 // Hash menu forwarding 26 if (window.location.hash){ 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 initWorkFilter(); 49 init_map(); 50 init_wow(); 51 init_masonry(); 52 }); 53 54 $(window).resize(function(){ 55 56 init_classic_menu_resize(); 57 init_side_panel_resize() 58 js_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").magnificPopup(); 342 343 } 344 345 346 347 /* ------------------------------------------- 348 Parallax 349 --------------------------------------------- */ 350 351 function init_parallax(){ 352 353 // Parallax 354 if (($(window).width() >= 1024) && (mobileTest == false)) { 355 $(".parallax-1").parallax("50%", 0.1); 356 $(".parallax-2").parallax("50%", 0.2); 357 $(".parallax-3").parallax("50%", 0.3); 358 $(".parallax-4").parallax("50%", 0.4); 359 $(".parallax-5").parallax("50%", 0.5); 360 $(".parallax-6").parallax("50%", 0.6); 361 $(".parallax-7").parallax("50%", 0.7); 362 $(".parallax-8").parallax("50%", 0.5); 363 $(".parallax-9").parallax("50%", 0.5); 364 $(".parallax-10").parallax("50%", 0.5); 365 $(".parallax-11").parallax("50%", 0.05); 366 } 367 368 } 369 370 371 372 /* --------------------------------------------- 373 Shortcodes 374 --------------------------------------------- */ 375 // Tabs minimal 376 function init_shortcodes(){ 377 378 var tpl_tab_height; 379 $(".tpl-minimal-tabs > li > a").click(function(){ 380 381 if (!($(this).parent("li").hasClass("active"))) { 382 tpl_tab_height = $(".tpl-minimal-tabs-cont > .tab-pane").filter($(this).attr("href")).height(); 383 $(".tpl-minimal-tabs-cont").animate({ 384 height: tpl_tab_height 385 }, function(){ 386 $(".tpl-minimal-tabs-cont").css("height", "auto"); 387 }); 388 389 } 390 391 }); 392 393 // Accordion 394 var allPanels = $(".accordion > dd").hide(); 395 allPanels.first().slideDown("easeOutExpo"); 396 $(".accordion > dt > a").first().addClass("active"); 397 398 $(".accordion > dt > a").click(function(){ 399 400 var current = $(this).parent().next("dd"); 401 $(".accordion > dt > a").removeClass("active"); 402 $(this).addClass("active");
403 allPanels.not(current).slideUp("easeInExpo"); 404 $(this).parent().next().slideDown("easeOutExpo"); 405 406 return false; 407 408 }); 409 410 // Toggle 411 var allToggles = $(".toggle > dd").hide(); 412 413 $(".toggle > dt > a").click(function(){ 414 415 if ($(this).hasClass("active")) { 416 417 $(this).parent().next().slideUp("easeOutExpo"); 418 $(this).removeClass("active"); 419 420 } 421 else { 422 var current = $(this).parent().next("dd"); 423 $(this).addClass("active"); 424 $(this).parent().next().slideDown("easeOutExpo"); 425 } 426 427 return false; 428 }); 429 430 // Responsive video 431 $(".video, .resp-media, .blog-media").fitVids(); 432 $(".work-full-media").fitVids(); 433 434 } 435 436 437 438 /* --------------------------------------------- 439 Tooltips (bootstrap plugin activated) 440 --------------------------------------------- */ 441 442 function init_tooltips(){ 443 444 $(".tooltip-bot, .tooltip-bot a, .nav-social-links a").tooltip({ 445 placement: "bottom" 446 }); 447 448 $(".tooltip-top, .tooltip-top a").tooltip({ 449 placement: "top" 450 }); 451 452 } 453 454 455 456 /* --------------------------------------------- 457 Some facts section 458 --------------------------------------------- */ 459 460 function init_counters(){ 461 $(".count-number").appear(function(){ 462 var count = $(this); 463 count.countTo({ 464 from: 0, 465 to: count.html(), 466 speed: 1300, 467 refreshInterval: 60, 468 }); 469 470 }); 471 } 472 473 474 475 476 /* --------------------------------------------- 477 Team 478 --------------------------------------------- */ 479 480 function init_team(){ 481 482 // Hover 483 $(".team-item").click(function(){ 484 if ($("html").hasClass("mobile")) { 485 $(this).toggleClass("js-active"); 486 } 487 }); 488 489 } 490 491/* --------------------------------------------- 492 Sliders 493 --------------------------------------------- */ 494function initPageSliders(){ 495 (function($){ 496 "use strict"; 497 498 $(".fullwidth-slider").each(function() { 499 var autoplay = $(this).closest('.slider-wrapper').data('autoplay') 500 // Fullwidth slider 501 $(this).owlCarousel({ 502 autoPlay: autoplay ? autoplay : false, 503 slideSpeed: 350, 504 singleItem: true, 505 autoHeight: true, 506 navigation: true, 507 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 508 }); 509 }); 510 511 $(".fullwidth-slider-fade").each(function() { 512 var autoplay = $(this).closest('.slider-wrapper').data('autoplay') 513 // Fullwidth slider 514 $(this).owlCarousel({ 515 autoPlay: autoplay ? autoplay : false, 516 transitionStyle: "fadeUp", 517 slideSpeed: 350, 518 singleItem: true, 519 autoHeight: true, 520 navigation: true, 521 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 522 }); 523 }); 524 525 $(".fullwidth-gallery").each(function() { 526 var autoplay = $(this).closest('.slider-wrapper').data('autoplay') 527 // Fullwidth gallery 528 $(this).owlCarousel({ 529 autoPlay: autoplay ? autoplay : 5000, 530 transitionStyle: "fade", 531 slideSpeed: 700, 532 singleItem: true, 533 autoHeight: true, 534 navigation: false, 535 pagination: false 536 }); 537 }); 538 539 $(".item-carousel").each(function() { 540 var autoplay = $(this).closest('.slider-wrapper').data('autoplay') 541 // Item carousel
542 $(this).owlCarousel({ 543 autoPlay: autoplay ? autoplay : false, 544 //stopOnHover: true, 545 items: 3, 546 itemsDesktop: [1199, 3], 547 itemsTabletSmall: [768, 3], 548 itemsMobile: [480, 1], 549 navigation: false, 550 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 551 }); 552 }); 553 554 // Item carousel 555 $(".small-item-carousel").owlCarousel({ 556 autoPlay: 2500, 557 stopOnHover: true, 558 items: 6, 559 itemsDesktop: [1199, 4], 560 itemsTabletSmall: [768, 3], 561 itemsMobile: [480, 2], 562 pagination: false, 563 navigation: false, 564 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 565 }); 566 567 // Single carousel 568 $(".single-carousel").owlCarousel({ 569 singleItem: true, 570 autoHeight: true, 571 navigation: true, 572 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 573 }); 574 575 // Content Slider 576 $(".content-slider").owlCarousel({ 577 slideSpeed: 350, 578 singleItem: true, 579 autoHeight: true, 580 navigation: true, 581 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 582 }); 583 584 // Photo slider 585 $(".photo-slider").owlCarousel({ 586 slideSpeed: 350, 587 items: 4, 588 itemsDesktop: [1199, 4], 589 itemsTabletSmall: [768, 2], 590 itemsMobile: [480, 1], 591 autoHeight: true, 592 navigation: true, 593 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 594 }); 595 596 // Work slider 597 $(".work-full-slider").owlCarousel({ 598 slideSpeed : 350, 599 singleItem: true, 600 autoHeight: true, 601 navigation: true, 602 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 603 }); 604 605 // Blog posts carousel 606 $(".blog-posts-carousel").owlCarousel({ 607 autoPlay: 5000, 608 stopOnHover: true, 609 items: 3, 610 itemsDesktop: [1199, 3], 611 itemsTabletSmall: [768, 2], 612 itemsMobile: [480, 1], 613 pagination: false, 614 navigation: true, 615 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 616 }); 617 618 // Blog posts carousel alt 619 $(".blog-posts-carousel-alt").owlCarousel({ 620 autoPlay: 3500, 621 stopOnHover: true, 622 slideSpeed: 350, 623 singleItem: true, 624 autoHeight: true, 625 pagination: false, 626 navigation: true, 627 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 628 }); 629 630 // Image carousel 631 $(".image-carousel").owlCarousel({ 632 autoPlay: 5000, 633 stopOnHover: true, 634 items: 4, 635 itemsDesktop: [1199, 3], 636 itemsTabletSmall: [768, 2], 637 itemsMobile: [480, 1], 638 navigation: true, 639 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 640 }); 641 642 // Fullwidth slideshow 643 644 var sync1 = $(".fullwidth-slideshow"); 645 var sync2 = $(".fullwidth-slideshow-pager"); 646 647 $(".fullwidth-slideshow").owlCarousel({ 648 autoPlay: 5000, 649 stopOnHover: true, 650 transitionStyle: "fade", 651 slideSpeed: 350, 652 singleItem: true, 653 autoHeight: true, 654 pagination: false, 655 navigation: true, 656 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 657 afterAction : syncPosition, 658 responsiveRefreshRate : 200 659 }); 660 $(".fullwidth-slideshow-pager").owlCarousel({ 661 autoPlay: 5000, 662 stopOnHover: true, 663 items: 8, 664 itemsDesktop: [1199,8], 665 itemsDesktopSmall: [979,7], 666 itemsTablet: [768,6], 667 itemsMobile: [480,4], 668 autoHeight: true, 669 pagination: false, 670 navigation: false, 671 responsiveRefreshRate : 100, 672 afterInit : function(el){ 673 el.find(".owl-item").eq(0).addClass("synced"); 674 } 675 }); 676 677 function syncPosition(el){ 678 var current = this.currentItem; 679 $(".fullwidth-slideshow-pager").find(".owl-item").removeClass("synced").eq(current).addClass("synced") 680 if ($(".fullwidth-slideshow-pager").data("owlCarousel") !== undefined) { 681 center(current) 682 } 683 } 684 685 $(".fullwidth-slideshow-pager").on("click", ".owl-item", function(e){ 686 e.preventDefault(); 687 var number = $(this).data("owlItem"); 688 sync1.trigger("owl.goTo", number); 689 }); 690 691 function center(number){ 692 var owl = sync2.data("owlCarousel").owl; 693 if(typeof(owl.visibleItems) == 'undefined') { 694 return; 695 } 696 var sync2visible = owl.visibleItems; 697 698 var num = number; 699 var found = false;
700 for (var i in sync2visible) { 701 if (num === sync2visible[i]) { 702 var found = true; 703 } 704 } 705 if (found === false) { 706 if (num > sync2visible[sync2visible.length - 1]) { 707 sync2.trigger("owl.goTo", num - sync2visible.length + 2) 708 } 709 else { 710 if (num - 1 === -1) { 711 num = 0; 712 } 713 sync2.trigger("owl.goTo", num); 714 } 715 } 716 else 717 if (num === sync2visible[sync2visible.length - 1]) { 718 sync2.trigger("owl.goTo", sync2visible[1]) 719 } 720 else 721 if (num === sync2visible[0]) { 722 sync2.trigger("owl.goTo", num - 1) 723 } 724 } 725 726 var owl = $(".fullwidth-slideshow").data("owlCarousel"); 727 728 $(document.documentElement).keyup(function(event){ 729 // handle cursor keys 730 if (event.keyCode == 37) { 731 owl.prev(); 732 } 733 else 734 if (event.keyCode == 39) { 735 owl.next(); 736 } 737 }); 738 739 $(".owl-carousel").each(function() { 740 var owl = $(this).data('owlCarousel'); 741 owl.reinit(); 742 }); 743 744 745 })(jQuery); 746}; 747 748 749/* --------------------------------------------- 750 Fullscreen menu 751 --------------------------------------------- */ 752 753 var fm_menu_wrap = $("#fullscreen-menu"); 754 var fm_menu_button = $(".fm-button"); 755 756 function init_fullscreen_menu(){ 757 758 fm_menu_button.click(function(){ 759 760 if ($(this).hasClass("animation-process")){ 761 return false; 762 } 763 else{ 764 if ($(this).hasClass("active")) { 765 $(this).removeClass("active").css("z-index", "2001").addClass("animation-process");; 766 767 fm_menu_wrap.find(".fm-wrapper-sub").fadeOut("fast", function(){ 768 fm_menu_wrap.fadeOut(function(){ 769 fm_menu_wrap.find(".fm-wrapper-sub").removeClass("js-active").show(); 770 fm_menu_button.css("z-index", "1030").removeClass("animation-process"); 771 772 }); 773 }); 774 775 if ($(".owl-carousel").lenth) { 776 $(".owl-carousel").data("owlCarousel").play(); 777 } 778 779 } 780 else { 781 if ($(".owl-carousel").lenth) { 782 $(".owl-carousel").data("owlCarousel").stop(); 783 } 784 $(this).addClass("active").css("z-index", "2001").addClass("animation-process"); 785 786 fm_menu_wrap.fadeIn(function(){ 787 fm_menu_wrap.find(".fm-wrapper-sub").addClass("js-active"); 788 fm_menu_button.removeClass("animation-process"); 789 }); 790 } 791 792 return false; 793 } 794 795 }); 796 797 $("#fullscreen-menu").find("a:not(.fm-has-sub)").click(function(){ 798 799 if (fm_menu_button.hasClass("animation-process")){ 800 return false; 801 } 802 else { 803 fm_menu_button.removeClass("active").css("z-index", "2001").addClass("animation-process"); 804 805 fm_menu_wrap.find(".fm-wrapper-sub").fadeOut("fast", function(){ 806 fm_menu_wrap.fadeOut(function(){ 807 fm_menu_wrap.find(".fm-wrapper-sub").removeClass("js-active").show(); 808 fm_menu_button.css("z-index", "1030").removeClass("animation-process"); 809 810 }); 811 }); 812 813 if ($(".owl-carousel").lenth) { 814 $(".owl-carousel").data("owlCarousel").play(); 815 } 816 } 817 }); 818 819 // Sub menu 820 821 var fmHasSub = $(".fm-has-sub"); 822 var fmThisLi; 823 824 fmHasSub.click(function(){ 825 826 fmThisLi = $(this).parent("li:first"); 827 if (fmThisLi.hasClass("js-opened")) { 828 fmThisLi.find(".fm-sub:first").slideUp(function(){ 829 fmThisLi.removeClass("js-opened"); 830 fmThisLi.find(".fm-has-sub").find(".fa:first").removeClass("fa-angle-up").addClass("fa-angle-down"); 831 }); 832 } 833 else { 834 $(this).find(".fa:first").removeClass("fa-angle-down").addClass("fa-angle-up"); 835 fmThisLi.addClass("js-opened"); 836 fmThisLi.find(".fm-sub:first").slideDown(); 837 } 838 839 return false;
840 841 }); 842 843 } 844 845 846/* --------------------------------------------- 847 Side panel 848 --------------------------------------------- */ 849 850 var side_panel = $(".side-panel"); 851 var sp_button = $(".sp-button"); 852 var sp_close_button = $(".sp-close-button"); 853 var sp_overlay = $(".sp-overlay"); 854 855 function sp_panel_close(){ 856 side_panel.animate({ 857 opacity: 0, 858 left: -270 859 }, 500, "easeOutExpo"); 860 sp_overlay.fadeOut(); 861 862 863 if ($(".owl-carousel").lenth) { 864 $(".owl-carousel").data("owlCarousel").play(); 865 } 866 } 867 868 function init_side_panel(){ 869 (function($){ 870 "use strict"; 871 872 sp_button.click(function(){ 873 874 side_panel.animate({ 875 opacity: 1, 876 left: 0 877 }, 500, "easeOutExpo"); 878 879 setTimeout(function(){ 880 sp_overlay.fadeIn(); 881 }, 100); 882 883 if ($(".owl-carousel").lenth) { 884 $(".owl-carousel").data("owlCarousel").stop(); 885 } 886 887 return false; 888 889 }); 890 891 sp_close_button.click(function(){ 892 sp_panel_close(); 893 return false; 894 }); 895 sp_overlay.click(function(){ 896 sp_panel_close(); 897 return false; 898 }); 899 900 $("#side-panel-menu").find("a:not(.sp-has-sub)").click(function(){ 901 if (!($(window).width() >= 1199)) { 902 sp_panel_close(); 903 } 904 }); 905 906 907 // Sub menu 908 909 var spHasSub = $(".sp-has-sub"); 910 var spThisLi; 911 912 spHasSub.click(function(){ 913 914 spThisLi = $(this).parent("li:first"); 915 if (spThisLi.hasClass("js-opened")) { 916 spThisLi.find(".sp-sub:first").slideUp(function(){ 917 spThisLi.removeClass("js-opened"); 918 spThisLi.find(".sp-has-sub").find(".fa:first").removeClass("fa-angle-up").addClass("fa-angle-down"); 919 }); 920 } 921 else { 922 $(this).find(".fa:first").removeClass("fa-angle-down").addClass("fa-angle-up"); 923 spThisLi.addClass("js-opened"); 924 spThisLi.find(".sp-sub:first").slideDown(); 925 } 926 927 return false; 928 929 }); 930 931 })(jQuery); 932 } 933 934 function init_side_panel_resize(){ 935 (function($){ 936 "use strict"; 937 938 if ($(window).width() >= 1199){ 939 side_panel.css({ 940 opacity: 1, 941 left: 0 942 }); 943 $(".side-panel-is-left").css("margin-left", "270px"); 944 sp_button.css("display", "none"); 945 sp_close_button.css("display", "none"); 946 } else { 947 side_panel.css({ 948 opacity: 0, 949 left: -270 950 }); 951 $(".side-panel-is-left").css("margin-left", "0"); 952 sp_button.css("display", "block"); 953 sp_close_button.css("display", "block"); 954 } 955 956 })(jQuery); 957 } 958 959/* --------------------------------------------- 960 Portfolio section 961 --------------------------------------------- */ 962 963// Projects filtering 964var fselector = 0; 965var work_grid = $("#work-grid, #isotope"); 966 967function initWorkFilter(){ 968 (function($){ 969 "use strict"; 970 var isotope_mode; 971 if (work_grid.hasClass("masonry")){ 972 isotope_mode = "masonry"; 973 } else{ 974 isotope_mode = "fitRows" 975 } 976 977 work_grid.imagesLoaded(function(){ 978 work_grid.isotope({ 979 itemSelector: '.mix', 980 layoutMode: isotope_mode, 981 filter: fselector 982 }); 983 }); 984 985 $(".filter").click(function(){ 986 $(".filter").removeClass("active"); 987 $(this).addClass("active"); 988 fselector = $(this).attr('data-filter'); 989 990 work_grid.isotope({ 991 itemSelector: '.mix', 992 layoutMode: isotope_mode, 993 filter: fselector 994 }); 995 return false;
996 }); 997 998 })(jQuery); 999} 1000 1001 1002 1003 1004 1005/* --------------------------------------------- 1006 Height 100% 1007 --------------------------------------------- */ 1008function js_height_init(){ 1009 (function($){ 1010 $(".js-height-full").height($(window).height()); 1011 $(".js-height-parent").each(function(){ 1012 $(this).height($(this).parent().first().height()); 1013 }); 1014 })(jQuery); 1015} 1016 1017 1018 1019 1020/* --------------------------------------------- 1021 Google map 1022 --------------------------------------------- */ 1023 1024var gmMapDiv = $("#map-canvas"); 1025 1026function init_map(){ 1027 (function($){ 1028 1029 $(".map-section").click(function(){ 1030 $(this).toggleClass("js-active"); 1031 $(this).find(".mt-open").toggle(); 1032 $(this).find(".mt-close").toggle(); 1033 }); 1034 1035 1036 if (gmMapDiv.length) { 1037 1038 var gmCenterAddress = gmMapDiv.attr("data-address"); 1039 var gmMarkerAddress = gmMapDiv.attr("data-address"); 1040 var gmZoom = gmMapDiv.data('zoom') ? gmMapDiv.data('zoom') : 14; 1041 1042 gmMapDiv.gmap3({ 1043 action: "init", 1044 marker: { 1045 address: gmMarkerAddress, 1046 options: { 1047 icon: drupalSettings.base_path + drupalSettings.theme_path + "/images/map-marker.png" 1048 } 1049 }, 1050 map: { 1051 options: { 1052 zoom: gmZoom, 1053 zoomControl: true, 1054 zoomControlOptions: { 1055 style: google.maps.ZoomControlStyle.SMALL, 1056 position: google.maps.ControlPosition.RIGHT_CENTER 1057 }, 1058 mapTypeControl: false, 1059 scaleControl: false, 1060 scrollwheel: false, 1061 streetViewControl: false, 1062 draggable: true, 1063 styles: [{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#d3d3d3"}]},{"featureType":"transit","stylers":[{"color":"#808080"},{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"visibility":"on"},{"color":"#b3b3b3"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.local","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"weight":1.8}]},{"featureType":"road.local","elementType":"geometry.stroke","stylers":[{"color":"#d7d7d7"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#ebebeb"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"color":"#a7a7a7"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"landscape","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#efefef"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#696969"}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"visibility":"on"},{"color":"#737373"}]},{"featureType":"poi","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"geometry.stroke","stylers":[{"color":"#d6d6d6"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"color":"#dadada"}]}] 1064 } 1065 } 1066 }); 1067 } 1068 })(jQuery); 1069} 1070 1071 1072/* --------------------------------------------- 1073 WOW animations 1074 --------------------------------------------- */ 1075 1076function init_wow(){ 1077 (function($){ 1078 1079 var wow = new WOW({ 1080 boxClass: 'wow', 1081 animateClass: 'animated', 1082 offset: 90, 1083 mobile: false, 1084 live: true 1085 }); 1086 1087 if ($("body").hasClass("appear-animate")){ 1088 wow.init(); 1089 } 1090 1091 })(jQuery); 1092} 1093 1094 1095/* --------------------------------------------- 1096 Masonry 1097 --------------------------------------------- */ 1098 1099function init_masonry(){ 1100 (function($){ 1101 1102 $(".masonry").imagesLoaded(function(){ 1103 $(".masonry").masonry(); 1104 }); 1105 1106 })(jQuery); 1107} 1108 1109})(jQuery); // End of use strict
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.