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 $(".page-loader div").delay(0).fadeOut(); 13 $(".page-loader").delay(600).fadeOut("slow"); 14 15 init_scroll_navigate(); 16 17 $(window).trigger("scroll"); 18 $(window).trigger("resize"); 19 20 // Hash menu forwarding 21 if (window.location.hash){ 22 var hash_offset = $(window.location.hash).offset().top; 23 $("html, body").animate({ 24 scrollTop: hash_offset 25 }); 26 } 27 28 }); 29 30 $(document).ready(function(){ 31 32 $(window).trigger("resize"); 33 34 init_classic_menu(); 35 init_lightbox(); 36 init_parallax(); 37 init_shortcodes(); 38 init_tooltips(); 39 init_counters(); 40 init_team(); 41 initPageSliders(); 42 initWorkFilter(); 43 init_map(); 44 init_wow(); 45 init_masonry(); 46 }); 47 48 $(window).resize(function(){ 49 50 init_classic_menu_resize(); 51 js_height_init(); 52 split_height_init(); 53 54 }); 55 56 57 /* -------------------------------------------- 58 Platform detect
59 --------------------------------------------- */ 60 var mobileTest; 61 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) { 62 mobileTest = true; 63 $("html").addClass("mobile"); 64 } 65 else { 66 mobileTest = false; 67 $("html").addClass("no-mobile"); 68 } 69 70 var mozillaTest; 71 if (/mozilla/.test(navigator.userAgent)) { 72 mozillaTest = true; 73 } 74 else { 75 mozillaTest = false; 76 } 77 var safariTest; 78 if (/safari/.test(navigator.userAgent)) { 79 safariTest = true; 80 } 81 else { 82 safariTest = false; 83 } 84 85 // Detect touch devices 86 if (!("ontouchstart" in document.documentElement)) { 87 document.documentElement.className += " no-touch"; 88 } 89 90 91 /* --------------------------------------------- 92 Sections helpers 93 --------------------------------------------- */ 94 95 // Sections backgrounds 96 97 var pageSection = $(".home-section, .page-section, .small-section, .split-section"); 98 pageSection.each(function(indx){ 99 100 if ($(this).attr("data-background")){ 101 $(this).css("background-image", "url(" + $(this).data("background") + ")"); 102 } 103 }); 104 105 // Function for block height 100% 106 function height_line(height_object, height_donor){ 107 height_object.height(height_donor.height()); 108 height_object.css({ 109 "line-height": height_donor.height() + "px" 110 }); 111 } 112 113 // Function equal height 114 !function(a){ 115 a.fn.equalHeights = function(){ 116 var b = 0, c = a(this); 117 return c.each(function(){ 118 var c = a(this).innerHeight(); 119 c > b && (b = c) 120 }), c.css("height", b) 121 }, a("[data-equal]").each(function(){ 122 var b = a(this), c = b.data("equal"); 123 b.find(c).equalHeights() 124 }) 125 }(jQuery); 126 127 128 // Progress bars 129 var progressBar = $(".progress-bar"); 130 progressBar.each(function(indx){ 131 $(this).css("width", $(this).attr("aria-valuenow") + "%"); 132 }); 133 134 135 136 /* --------------------------------------------- 137 Nav panel classic 138 --------------------------------------------- */ 139 140 var mobile_nav = $(".mobile-nav"); 141 var desktop_nav = $(".desktop-nav"); 142 143 function init_classic_menu_resize(){ 144 145 // Mobile menu max height 146 $(".mobile-on .desktop-nav > ul").css("max-height", $(window).height() - $(".main-nav").height() - 20 + "px"); 147 148 // Mobile menu style toggle 149 if ($(window).width() <= 1024) { 150 $(".main-nav").addClass("mobile-on"); 151 } 152 else 153 if ($(window).width() > 1024) { 154 $(".main-nav").removeClass("mobile-on"); 155 desktop_nav.show(); 156 } 157 } 158 159 function init_classic_menu(){ 160 161 162 // Navbar sticky 163 164 $(".js-stick").sticky({ 165 topSpacing: 0 166 }); 167 168 169 height_line($(".inner-nav > ul > li > a"), $(".main-nav")); 170 height_line(mobile_nav, $(".main-nav")); 171 172 mobile_nav.css({ 173 "width": $(".main-nav").height() + "px" 174 }); 175 176 // Transpaner menu 177 178 if ($(".main-nav").hasClass("transparent")){ 179 $(".main-nav").addClass("js-transparent"); 180 } 181 182 $(window).scroll(function(){ 183 184 if ($(window).scrollTop() > 10) { 185 $(".js-transparent").removeClass("transparent"); 186 $(".main-nav, .nav-logo-wrap .logo, .mobile-nav").addClass("small-height"); 187 } 188 else { 189 $(".js-transparent").addClass("transparent"); 190 $(".main-nav, .nav-logo-wrap .logo, .mobile-nav").removeClass("small-height"); 191 } 192 193 194 }); 195 196 // Mobile menu toggle 197 198 mobile_nav.click(function(){ 199 200 if (desktop_nav.hasClass("js-opened")) { 201 desktop_nav.slideUp("slow", "easeOutExpo").removeClass("js-opened"); 202 $(this).removeClass("active"); 203 } 204 else { 205 desktop_nav.slideDown("slow", "easeOutQuart").addClass("js-opened"); 206 $(this).addClass("active"); 207 } 208 209 }); 210 211 desktop_nav.find("a:not(.mn-has-sub)").click(function(){ 212 if (mobile_nav.hasClass("active")) { 213 desktop_nav.slideUp("slow", "easeOutExpo").removeClass("js-opened"); 214 mobile_nav.removeClass("active"); 215 } 216 }); 217 218 219 // Sub menu 220 221 var mnHasSub = $(".mn-has-sub"); 222 var mnThisLi; 223 224 $(".mobile-on .mn-has-sub").find(".fa:first").removeClass("fa-angle-right").addClass("fa-angle-down"); 225 226 mnHasSub.click(function(){ 227 228 if ($(".main-nav").hasClass("mobile-on")) { 229 mnThisLi = $(this).parent("li:first"); 230 if (mnThisLi.hasClass("js-opened")) { 231 mnThisLi.find(".mn-sub:first").slideUp(function(){ 232 mnThisLi.removeClass("js-opened"); 233 mnThisLi.find(".mn-has-sub").find(".fa:first").removeClass("fa-angle-up").addClass("fa-angle-down"); 234 }); 235 } 236 else { 237 $(this).find(".fa:first").removeClass("fa-angle-down").addClass("fa-angle-up"); 238 mnThisLi.addClass("js-opened"); 239 mnThisLi.find(".mn-sub:first").slideDown(); 240 } 241 242 return false;
243 } 244 245 }); 246 247 mnThisLi = mnHasSub.parent("li"); 248 mnThisLi.hover(function(){ 249 250 if (!($(".main-nav").hasClass("mobile-on"))) { 251 252 $(this).find(".mn-sub:first").stop(true, true).fadeIn("fast"); 253 } 254 255 }, function(){ 256 257 if (!($(".main-nav").hasClass("mobile-on"))) { 258 259 $(this).find(".mn-sub:first").stop(true, true).delay(100).fadeOut("fast"); 260 } 261 262 }); 263 264 } 265 266 267 268 /* --------------------------------------------- 269 Scroll navigation 270 --------------------------------------------- */ 271 272 function init_scroll_navigate(){ 273 274 $(".local-scroll").localScroll({ 275 target: "body", 276 duration: 1500, 277 offset: -55, 278 easing: "easeInOutExpo" 279 }); 280 281 var sections = $(".home-section, .split-section, .page-section"), menu_links = $(".scroll-nav li a"); 282 $(window).on("scroll", function(){ 283 var active_link = $(this).scrollTop(); 284 sections.each(function(){ 285 var top = $(this).offset().top - 56, bottom = top + $(this).outerHeight(); 286 if (active_link >= top && active_link <= bottom) { 287 $(".scroll-nav li a").removeClass("active"); 288 sections.removeClass("active"); 289 $(this).addClass("active"); 290 $('.scroll-nav li a[href="#' + $(this).attr('id') + '"]').addClass('active'); 291 } 292 }); 293 }); 294 295 } 296 297 298 299 /* --------------------------------------------- 300 Lightboxes 301 --------------------------------------------- */ 302 303 function init_lightbox(){ 304 305 // Works Item Lightbox 306 $(".work-lightbox-link").magnificPopup({ 307 gallery: { 308 enabled: true 309 }, 310 mainClass: "mfp-fade" 311 }); 312 313 // Works Item Lightbox 314 $(".lightbox-gallery-1").magnificPopup({ 315 gallery: { 316 enabled: true 317 } 318 }); 319 320 // Other Custom Lightbox 321 $(".lightbox-gallery-2").magnificPopup({ 322 gallery: { 323 enabled: true 324 } 325 }); 326 $(".lightbox-gallery-3").magnificPopup({ 327 gallery: { 328 enabled: true 329 } 330 }); 331 $(".lightbox").magnificPopup(); 332 333 } 334 335 336 337 /* ------------------------------------------- 338 Parallax 339 --------------------------------------------- */ 340 341 function init_parallax(){ 342 343 // Parallax 344 if (($(window).width() >= 1024) && (mobileTest == false)) { 345 $(".parallax-1").parallax("50%", 0.1); 346 $(".parallax-2").parallax("50%", 0.2); 347 $(".parallax-3").parallax("50%", 0.3); 348 $(".parallax-4").parallax("50%", 0.4); 349 $(".parallax-5").parallax("50%", 0.5); 350 $(".parallax-6").parallax("50%", 0.6); 351 $(".parallax-7").parallax("50%", 0.7); 352 $(".parallax-8").parallax("50%", 0.5); 353 $(".parallax-9").parallax("50%", 0.5); 354 $(".parallax-10").parallax("50%", 0.5); 355 $(".parallax-11").parallax("50%", 0.05); 356 } 357 358 } 359 360 361 362 /* --------------------------------------------- 363 Shortcodes 364 --------------------------------------------- */ 365 // Tabs minimal 366 function init_shortcodes(){ 367 368 var tpl_tab_height; 369 $(".tpl-minimal-tabs > li > a").click(function(){ 370 371 if (!($(this).parent("li").hasClass("active"))) { 372 tpl_tab_height = $(".tpl-minimal-tabs-cont > .tab-pane").filter($(this).attr("href")).height(); 373 $(".tpl-minimal-tabs-cont").animate({ 374 height: tpl_tab_height 375 }, function(){ 376 $(".tpl-minimal-tabs-cont").css("height", "auto"); 377 }); 378 379 } 380 381 }); 382 383 // Accordion 384 var allPanels = $(".accordion > dd").hide(); 385 allPanels.first().slideDown("easeOutExpo"); 386 $(".accordion > dt > a").first().addClass("active"); 387 388 $(".accordion > dt > a").click(function(){ 389 390 var current = $(this).parent().next("dd"); 391 $(".accordion > dt > a").removeClass("active"); 392 $(this).addClass("active");
393 allPanels.not(current).slideUp("easeInExpo"); 394 $(this).parent().next().slideDown("easeOutExpo"); 395 396 return false; 397 398 }); 399 400 // Toggle 401 var allToggles = $(".toggle > dd").hide(); 402 403 $(".toggle > dt > a").click(function(){ 404 405 if ($(this).hasClass("active")) { 406 407 $(this).parent().next().slideUp("easeOutExpo"); 408 $(this).removeClass("active"); 409 410 } 411 else { 412 var current = $(this).parent().next("dd"); 413 $(this).addClass("active"); 414 $(this).parent().next().slideDown("easeOutExpo"); 415 } 416 417 return false; 418 }); 419 420 // Responsive video 421 $(".video, .resp-media, .blog-media").fitVids(); 422 $(".work-full-media").fitVids(); 423 424 } 425 426 427 428 /* --------------------------------------------- 429 Tooltips (bootstrap plugin activated) 430 --------------------------------------------- */ 431 432 function init_tooltips(){ 433 434 $(".tooltip-bot, .tooltip-bot a, .nav-social-links a").tooltip({ 435 placement: "bottom" 436 }); 437 438 $(".tooltip-top, .tooltip-top a").tooltip({ 439 placement: "top" 440 }); 441 442 } 443 444 445 446 /* --------------------------------------------- 447 Some facts section 448 --------------------------------------------- */ 449 450 function init_counters(){ 451 $(".count-number").appear(function(){ 452 var count = $(this); 453 count.countTo({ 454 from: 0, 455 to: count.html(), 456 speed: 1300, 457 refreshInterval: 60 458 }); 459 460 }); 461 } 462 463 464 465 466 /* --------------------------------------------- 467 Team 468 --------------------------------------------- */ 469 470 function init_team(){ 471 472 // Hover 473 $(".team-item").click(function(){ 474 if ($("html").hasClass("mobile")) { 475 $(this).toggleClass("js-active"); 476 } 477 }); 478 479 } 480 481 482})(jQuery); // End of use strict 483 484 485/* --------------------------------------------- 486 Sliders 487 --------------------------------------------- */ 488function initPageSliders(){ 489 (function($){ 490 "use strict"; 491 492 // Fullwidth slider 493 $(".fullwidth-slider").owlCarousel({ 494 slideSpeed: 350, 495 singleItem: true, 496 autoHeight: true, 497 navigation: true, 498 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 499 }); 500 501 // Fullwidth slider 502 $(".fullwidth-slider-fade").owlCarousel({ 503 transitionStyle: "fadeUp", 504 slideSpeed: 350, 505 singleItem: true, 506 autoHeight: true, 507 navigation: true, 508 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 509 }); 510 511 // Fullwidth gallery 512 $(".fullwidth-gallery").owlCarousel({ 513 transitionStyle: "fade", 514 autoPlay: 5000, 515 slideSpeed: 700, 516 singleItem: true, 517 autoHeight: true, 518 navigation: false, 519 pagination: false 520 }); 521 522 // Item carousel 523 $(".item-carousel").owlCarousel({ 524 autoPlay: 2500, 525 //stopOnHover: true, 526 items: 3, 527 itemsDesktop: [1199, 3], 528 itemsTabletSmall: [768, 3], 529 itemsMobile: [480, 1], 530 navigation: false, 531 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 532 }); 533 534 // Item carousel 535 $(".small-item-carousel").owlCarousel({ 536 autoPlay: 2500, 537 stopOnHover: true, 538 items: 6, 539 itemsDesktop: [1199, 4], 540 itemsTabletSmall: [768, 3], 541 itemsMobile: [480, 2], 542 pagination: false, 543 navigation: false, 544 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 545 }); 546 547 // Single carousel
548 $(".single-carousel").owlCarousel({ 549 //transitionStyle: "backSlide", 550 singleItem: true, 551 autoHeight: true, 552 navigation: true, 553 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 554 }); 555 556 // Content Slider 557 $(".content-slider").owlCarousel({ 558 slideSpeed: 350, 559 singleItem: true, 560 autoHeight: true, 561 navigation: true, 562 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 563 }); 564 565 // Photo slider 566 $(".photo-slider").owlCarousel({ 567 //transitionStyle: "backSlide", 568 slideSpeed: 350, 569 items: 4, 570 itemsDesktop: [1199, 4], 571 itemsTabletSmall: [768, 2], 572 itemsMobile: [480, 1], 573 autoHeight: true, 574 navigation: true, 575 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 576 }); 577 578 // Work slider 579 $(".work-full-slider").owlCarousel({ 580 slideSpeed : 350, 581 singleItem: true, 582 autoHeight: true, 583 navigation: true, 584 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 585 }); 586 587 588 if ($(".owl-carousel").lenth) { 589 var owl = $(".owl-carousel").data('owlCarousel'); 590 owl.reinit(); 591 } 592 593 })(jQuery); 594}; 595 596 597 598 599 600/* --------------------------------------------- 601 Portfolio section 602 --------------------------------------------- */ 603 604// Projects filtering 605var fselector = 0; 606var work_grid = $("#work-grid"); 607 608function initWorkFilter(){ 609 (function($){ 610 "use strict"; 611 var isotope_mode; 612 if (work_grid.hasClass("masonry")){ 613 isotope_mode = "masonry"; 614 } else{ 615 isotope_mode = "fitRows" 616 } 617 618 work_grid.imagesLoaded(function(){ 619 work_grid.isotope({ 620 itemSelector: '.mix', 621 layoutMode: isotope_mode, 622 filter: fselector 623 }); 624 }); 625 626 $(".filter").click(function(){ 627 $(".filter").removeClass("active"); 628 $(this).addClass("active"); 629 fselector = $(this).attr('data-filter'); 630 631 work_grid.isotope({ 632 itemSelector: '.mix', 633 layoutMode: isotope_mode, 634 filter: fselector 635 }); 636 return false; 637 }); 638 639 })(jQuery); 640} 641 642 643 644 645 646/* --------------------------------------------- 647 Height 100% 648 --------------------------------------------- */ 649function js_height_init(){ 650 (function($){ 651 $(".js-height-full").height($(window).height()); 652 $(".js-height-parent").each(function(){ 653 $(this).height($(this).parent().first().height()); 654 }); 655 })(jQuery); 656} 657 658 659/* --------------------------------------------- 660 Split section 661 --------------------------------------------- */ 662 663function split_height_init(){ 664 (function($){ 665 666 $(".ssh-table, .split-section-content").css("height", "auto"); 667 if ($(window).width() > 992) { 668 $(".ssh-table, .split-section-content").equalHeights(); 669 } 670 671 })(jQuery); 672} 673 674 675/* --------------------------------------------- 676 Google map 677 --------------------------------------------- */ 678 679var gmMapDiv = $("#map-canvas"); 680 681function init_map(){ 682 (function($){ 683 684 $(".map-section").click(function(){ 685 $(this).toggleClass("js-active"); 686 $(this).find(".mt-open").toggle(); 687 $(this).find(".mt-close").toggle(); 688 }); 689 690 691 if (gmMapDiv.length) { 692 693 var gmCenterAddress = gmMapDiv.attr("data-address"); 694 var gmMarkerAddress = gmMapDiv.attr("data-address"); 695 696 697 gmMapDiv.gmap3({ 698 action: "init", 699 marker: { 700 address: gmMarkerAddress, 701 options: { 702 icon: "images/map-marker.png" 703 } 704 }, 705 map: { 706 options: { 707 zoom: 14, 708 zoomControl: true, 709 zoomControlOptions: { 710 style: google.maps.ZoomControlStyle.SMALL 711 }, 712 mapTypeControl: false, 713 scaleControl: false, 714 scrollwheel: false, 715 streetViewControl: false, 716 draggable: true 717 } 718 } 719 }); 720 } 721 })(jQuery); 722} 723 724 725/* --------------------------------------------- 726 WOW animations 727 --------------------------------------------- */ 728 729function init_wow(){ 730 (function($){ 731 732 var wow = new WOW({ 733 boxClass: 'wow', 734 animateClass: 'animated', 735 offset: 90, 736 mobile: false, 737 live: true 738 }); 739 740 if ($("body").hasClass("appear-animate")){ 741 wow.init(); 742 } 743 744 })(jQuery); 745} 746 747 748/* --------------------------------------------- 749 Masonry 750 --------------------------------------------- */ 751 752function init_masonry(){ 753 (function($){ 754 755 $(".masonry").imagesLoaded(function(){ 756 $(".masonry").masonry(); 757 }); 758 759 })(jQuery); 760} 761
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.