1//----------------------------------------------------/ 2// 3// POLO 4// Author: INSPIRO 5// Version: v4.0 6// Update: 20/03/2017 7// 8//----------------------------------------------------/ 9 10//Global var 11var INSPIRO = {}, 12 $ = jQuery.noConflict(); 13(function ($) { 14 // USE STRICT 15 "use strict"; 16 //----------------------------------------------------/ 17 // Predefined Variables 18 //----------------------------------------------------/ 19 var $window = $(window), 20 $body = $('body'), 21 $wrapper = $('#wrapper'), 22 $section = $('section'), 23 $pageContent = $('#page-content'), 24 $pageTitle = $('#page-title'), 25 $topbar = $('#topbar'), 26 $header = $('#header'), 27 $headerCurrentClasses = $header.attr('class'), 28 29 logo = $('#logo').find('.logo'), 30 logoImg = logo.find('img').attr('src'), 31 logoDark = logo.attr('data-dark-logo'), //Main menu 32 //mainmenuitems = $("#mainMenu > ul > li"), 33 $mainmenu = $('#mainMenu'), 34 $mainmenuitems = $mainmenu.find('li.dropdown > a'), 35 $mainsubmenuitems = $mainmenu.find('li.dropdown-submenu > a, li.dropdown-submenu > span'), //Vertical Dot Menu 36 $dotsMenu = $('#dotsMenu'), 37 $dotsMenuItems = $dotsMenu.find("ul > li > a"), 38 $pageMenu = $('.page-menu'), 39 sidePanel = $('#side-panel'), 40 sidePanellogo = $('#panel-logo').find('.logo'), 41 sidePanellogoImg = sidePanellogo.find('img').attr('src'), 42 sidePanellogoDark = sidePanellogo.attr('data-dark-logo'), 43 /*Footer*/ 44 $footer = $('#footer'), 45 $footerStickyClass = $(".footer-sticky"), //Fullscreen panel 46 fullScreenPanel = $('#fullscreen-panel'), 47 $topSearch = $('#top-search'), 48 $parallax = $('[data-parallax-image]'), 49 $textRotator = $('.text-rotator'), //Window size control 50 $fullScreen = $('.fullscreen') || $('.section-fullscreen'), 51 $halfScreen = $('.halfscreen'), //Slider 52 $slider = $('#slider'), 53 $inspiroSlider = $('.inspiro-slider'), 54 $carousel = $('.carousel'), 55 $carouselIcons = ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'], 56 57 $flickity = $('.carousell'), 58 $equalize = $('.equalize'), 59 /*Grid Layout*/ 60 $gridLayout = $(".grid-layout"), 61 $gridFilter = $(".grid-filter"), //Elements 62 dataAnimation = $("[data-animation]"), 63 $counter = $('.counter:not(.counter-instant)'), 64 $countdownTimer = $('.countdown'), 65 $progressBar = $('.progress-bar'), 66 $pieChart = $('.pie-chart'), 67 $map = $('.map'), 68 accordionType = "accordion", 69 toogleType = "toggle", 70 accordionItem = "ac-item", 71 itemActive = "ac-active", 72 itemTitle = "ac-title", 73 itemContent = "ac-content", 74 $lightbox_gallery = $('[data-lightbox="gallery"]'), 75 $lightbox_image = $('[data-lightbox="image"]'), 76 $lightbox_iframe = $('[data-lightbox="iframe"]'), 77 $lightbox_ajax = $('[data-lightbox="ajax"]'), 78 $lightbox_inline = $('[data-lightbox="inline"]'), //Widgets 79 $widget_twitter = $('.widget-tweeter') || $('.widget-twitter'), 80 $flickr_widget = $('.flickr-widget'), 81 $ytPlayer = $('.youtube-background'), 82 $vmPlayer = $('.vimeo-background'), 83 $stickySidebar = $('.sticky-sidebar'), 84 $contactForm = $(".widget-contact-form"), 85 $subscribeForm = $(".widget-subscribe-form"), 86 $goToTop = $('#goToTop'), 87 $copyToClipboard = $('.copy-to-clipboard'), 88 89 //Utilites 90 classFinder = "."; 91 92 if ($header.length > 0) { 93 var $headerOffsetTop = $header.offset().top; 94 } 95 96 97 98 INSPIRO.core = { 99 functions: function () { 100 INSPIRO.core.responsiveClasses(); 101 INSPIRO.core.goToTop(); 102 INSPIRO.core.screenSizeControl(); 103 INSPIRO.core.rtlStatus(); 104 INSPIRO.core.customHeight(); 105 INSPIRO.core.equalize(); 106 INSPIRO.core.stickyFooter(); 107 }, 108 responsiveClasses: function () { 109 if (typeof jRespond === 'undefined') { 110 console.log('responsiveClasses: jRespond plugin is missing.'); 111 return true; 112 } 113 var jRes = jRespond([ 114 { 115 label: 'smallest', 116 enter: 0, 117 exit: 479 118 }, { 119 label: 'handheld', 120 enter: 480, 121 exit: 767 122 }, { 123 label: 'tablet', 124 enter: 768, 125 exit: 991 126 }, { 127 label: 'laptop', 128 enter: 992, 129 exit: 1199 130 }, { 131 label: 'desktop', 132 enter: 1200, 133 exit: 10000 134 } 135 ]); 136 jRes.addFunc([ 137 {
138 breakpoint: 'desktop', 139 enter: function () { 140 $body.addClass('device-lg'); 141 }, 142 exit: function () { 143 $body.removeClass('device-lg'); 144 } 145 }, { 146 breakpoint: 'laptop', 147 enter: function () { 148 $body.addClass('device-md'); 149 }, 150 exit: function () { 151 $body.removeClass('device-md'); 152 } 153 }, { 154 breakpoint: 'tablet', 155 enter: function () { 156 $body.addClass('device-sm'); 157 }, 158 exit: function () { 159 $body.removeClass('device-sm'); 160 } 161 }, { 162 breakpoint: 'handheld', 163 enter: function () { 164 $body.addClass('device-xs'); 165 }, 166 exit: function () { 167 $body.removeClass('device-xs'); 168 } 169 }, { 170 breakpoint: 'smallest', 171 enter: function () { 172 $body.addClass('device-xxs'); 173 }, 174 exit: function () { 175 $body.removeClass('device-xxs'); 176 } 177 } 178 ]); 179 }, 180 goToTop: function () { 181 if ($goToTop.length > 0) { 182 183 var scrollOffset = $body.attr('data-offset') || 800; 184 185 if ($window.scrollTop() > scrollOffset) { 186 $goToTop.css({ 187 'bottom': '26px', 188 'opacity': 1 189 }); 190 } else { 191 $goToTop.css({ 192 'bottom': '16px', 193 'opacity': 0 194 }); 195 } 196 197 198 $goToTop.off('click').on('click', function() { 199 $('body,html').stop(true).animate({ 200 'scrollTop': 0 201 }, 700, 'easeInOutExpo'); 202 return false; 203 }); 204 } 205 }, 206 pageLoader: function () { 207 if (!$().animsition) { 208 console.log('pageLoader: animsition plugin is missing.'); 209 return true; 210 } 211 if (!$body.hasClass('no-page-loader')) { 212 var pageInAnimation = $body.attr('data-animation-in') || "fadeIn", 213 pageOutAnimation = $body.attr('data-animation-out') || "fadeOut", 214 pageLoaderIcon = $body.attr('data-icon') || 10, 215 pageLoaderIconColor = $body.attr('data-icon-color') || null, 216 pageInDuration = $body.attr('data-speed-in') || 1500, 217 pageOutDuration = $body.attr('data-speed-out') || 800, 218 iconColor = "", 219 loadingInnerHTML = ""; 220 221 switch (Number(pageLoaderIcon)) { 222 case 1: 223 loadingInnerHTML = '<div class="material-icon"><div class="spinner"><div class="right-side"><div class="bar"></div></div><div class="left-side"><div class="bar"></div></div></div></div>'; 224 iconColor = '.spinner .bar {border-color: ' + pageLoaderIconColor + ';} .spinner .bar:after {background: ' + pageLoaderIconColor + ';}'; 225 break; 226 case 2: 227 loadingInnerHTML = '<div class="loader-inner ball-grid-pulse"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'; 228 iconColor = '.ball-grid-pulse > div {background: ' + pageLoaderIconColor + '!important;}'; 229 break; 230 case 3: 231 loadingInnerHTML = '<div class="loader01"></div>'; 232 iconColor = '.loader01 {border-color: ' + pageLoaderIconColor + ' transparent ' + pageLoaderIconColor + ' ' + pageLoaderIconColor + ';} .loader01::after {background: ' + pageLoaderIconColor + ';}'; 233 break; 234 case 4: 235 loadingInnerHTML = '<div class="loader-inner square-spin"><div></div></div>'; 236 iconColor = '.square-spin > div {background: ' + pageLoaderIconColor + ' !important;}'; 237 break; 238 case 5: 239 loadingInnerHTML = '<div class="loader04"></div>'; 240 iconColor = '.loader04:after {background: ' + pageLoaderIconColor + ' !important;}'; 241 break; 242 case 6: 243 loadingInnerHTML = '<div class="loader-inner ball-rotate"><div></div></div>'; 244 iconColor = '.ball-rotate > div, .ball-rotate >
244 div:after, .ball-rotate > div:before {background: ' + pageLoaderIconColor + ' !important;}'; 245 break; 246 case 7: 247 loadingInnerHTML = '<div class="loader-inner cube-transition"><div></div><div></div></div>'; 248 iconColor = '.cube-transition > div {background: ' + pageLoaderIconColor + ' !important;}'; 249 break; 250 case 8: 251 loadingInnerHTML = '<div class="loader-inner ball-zig-zag"><div></div><div></div></div>'; 252 iconColor = '.ball-zig-zag > div {background: ' + pageLoaderIconColor + ' !important;}'; 253 break; 254 case 9: 255 loadingInnerHTML = '<div class="loader-inner ball-triangle-path"><div></div><div></div><div></div></div>'; 256 iconColor = '.ball-triangle-path > div {background: ' + pageLoaderIconColor + ' !important;}'; 257 break; 258 case 10: 259 loadingInnerHTML = '<div class="loader-inner line-scale"><div></div><div></div><div></div><div></div><div></div></div>'; 260 iconColor = '.line-scale > div {background: ' + pageLoaderIconColor + ' !important;}'; 261 break; 262 case 11: 263 loadingInnerHTML = '<div class="loader-inner ball-scale-multiple"><div></div><div></div><div></div></div>'; 264 iconColor = '.ball-scale-multiple > div {background: ' + pageLoaderIconColor + ' !important;}'; 265 break; 266 case 12: 267 loadingInnerHTML = '<div class="loader-inner ball-pulse-sync"><div></div><div></div><div></div></div>'; 268 iconColor = '.ball-pulse-sync > div {background: ' + pageLoaderIconColor + ' !important;}'; 269 break; 270 case 13: 271 loadingInnerHTML = '<div class="loader-inner ball-beat"><div></div><div></div><div></div></div>'; 272 iconColor = '.ball-beat > div {background: ' + pageLoaderIconColor + ' !important;}'; 273 break; 274 case 14: 275 loadingInnerHTML = '<div class="loader-inner line-scale-pulse-out-rapid"><div></div><div></div><div></div><div></div><div></div></div>'; 276 iconColor = '.line-scale-pulse-out-rapid > div {background: ' + pageLoaderIconColor + ' !important;}'; 277 break; 278 case 15: 279 loadingInnerHTML = '<div class="loader-inner ball-scale-ripple-multiple"><div></div><div></div><div></div></div>'; 280 iconColor = '.ball-scale-ripple-multiple > div {border-color: ' + pageLoaderIconColor + ' !important;}'; 281 break; 282 case 16: 283 loadingInnerHTML = '<div class="loader-inner ball-spin-fade-loader"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'; 284 iconColor = '.ball-spin-fade-loader > div {background: ' + pageLoaderIconColor + ' !important;}'; 285 break; 286 case 17: 287 loadingInnerHTML = '<div class="loader-inner line-spin-fade-loader"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'; 288 iconColor = '.line-spin-fade-loader > div {background: ' + pageLoaderIconColor + ' !important;}'; 289 break; 290 case 18: 291 loadingInnerHTML = '<div class="loader-inner pacman"><div></div><div></div><div></div><div></div><div></div></div>'; 292 iconColor = '.pacman > div:nth-child(3), .pacman > div:nth-child(4), .pacman > div:nth-child(5), .pacman > div:nth-child(6) {background: ' + pageLoaderIconColor + ' !important;} .pacman > div:first-of-type, .pacman > div:nth-child(2) {border-color: ' + pageLoaderIconColor + ' transparent ' + pageLoaderIconColor + ' ' + pageLoaderIconColor + '}'; 293 break; 294 case 19: 295 loadingInnerHTML = '<div class="loader-inner ball-grid-beat"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'; 296 iconColor = '.ball-grid-beat > div {background: ' + pageLoaderIconColor + ' !important;}'; 297 break; 298 case 20: 299 loadingInnerHTML = '<div class="single9"></div>'; 300 iconColor = '.single9:before {background-color: ' + pageLoaderIconColor + ' !important;}'; 301 break; 302 default: 303 loadingInnerHTML = '<div class="material-icon"><div class="spinner"><div class="right-side"><div class="bar"></div></div><div class="left-side"><div class="bar"></div></div></div></div>'; 304 iconColor = '.spinner .bar {border-color: ' + pageLoaderIconColor + ';} .spinner .bar:after {background: ' + pageLoaderIconColor + ';}'; 305 break; 306 } 307 if (pageLoaderIconColor) { 308 $('head').append('<style type="text/css">' + iconColor + '</style>'); 309 } 310 $wrapper.animsition({ 311 inClass: pageInAnimation, 312 outClass: pageOutAnimation, 313 inDuration: pageInDuration, 314 outDuration: pageOutDuration, 315 loading: true, 316 onLoadEvent: true, 317 loadingParentElement: 'body', //animsition wrapper element 318 loadingClass: 'animsition-loading', 319 loadingInner: '<div class="loader">' + loadingInnerHTML + '</div>', 320 linkElement: '#mainMenu a:not([target="_blank"]):not([href*="#"]):not([data-lightbox]):not([href^="mailto"]):not([href^="tel"]):not([href^="sms"]):not([href^="call"]), .animsition-link, .slide-link' 321 322 323 }); 324 var t = setTimeout(function () { 325 if ($(".animsition-loading").length) { 326 $body.addClass("no-page-loader"); 327 $(".animsition-loading").hide(); 328 } 329 }, 10000); 330 } 331 332 }, 333 screenSizeControl: function () { 334 if ($fullScreen.length > 0) { 335 $fullScreen.each(function () { 336 var $elem = $(this), 337 elemHeight = $window.height(); 338 if ($body.hasClass('device-lg') || $body.hasClass('device-md')) { 339 $elem.css('height', elemHeight); 340 } else { 341 var fullScreenContentHeight = $elem.find(".text-middle").height() + 100; 342 $elem.css({ 343 'height': fullScreenContentHeight, 344 'padding': '60px 15px 120px' 345 }); 346 } 347 }); 348 } 349 if ($halfScreen.length > 0) { 350 $halfScreen.each(function () { 351 var $elem = $(this), 352 elemHeight = $window.height(); 353 $elem.css('height', elemHeight / 1.5); 354 }); 355 } 356 }, 357 rtlStatus: function () { 358 var $rtlStatusCheck = $("html").attr("dir"); 359 var $rtlStatus = false;
360 if ($rtlStatusCheck == "rtl") { 361 $('head').append('<link rel="stylesheet" type="text/css" href="css/rtl.css">'); 362 $rtlStatus = true; 363 } else { 364 $rtlStatus = false; 365 } 366 }, 367 customHeight: function () { 368 var $customHeightXxs = $('[data-height-xxs]'), 369 $customHeightXs = $('[data-height-xs]'), 370 $customHeightSm = $('[data-height-sm]'), 371 $customHeightMd = $('[data-height-md]'), 372 $customHeightLg = $('[data-height-lg]'); 373 if ($customHeightXxs.length > 0) { 374 $customHeightXxs.each(function () { 375 var element = $(this), 376 elementHeight = element.attr('data-height-xxs'); 377 if ($body.hasClass('device-xxs')) { 378 if (elementHeight !== '') { 379 element.css('height', elementHeight); 380 } 381 } 382 }); 383 } 384 if ($customHeightXs.length > 0) { 385 $customHeightXs.each(function () { 386 var element = $(this), 387 elementHeight = element.attr('data-height-xs'); 388 if ($body.hasClass('device-xs')) { 389 if (elementHeight !== '') { 390 element.css('height', elementHeight); 391 } 392 } 393 }); 394 } 395 if ($customHeightSm.length > 0) { 396 $customHeightSm.each(function () { 397 var element = $(this), 398 elementHeight = element.attr('data-height-sm'); 399 if ($body.hasClass('device-sm')) { 400 if (elementHeight !== '') { 401 element.css('height', elementHeight); 402 } 403 } 404 }); 405 } 406 if ($customHeightMd.length > 0) { 407 $customHeightMd.each(function () { 408 var element = $(this), 409 elementHeight = element.attr('data-height-md'); 410 if ($body.hasClass('device-md')) { 411 if (elementHeight !== '') { 412 element.css('height', elementHeight); 413 } 414 } 415 }); 416 } 417 if ($customHeightLg.length > 0) { 418 $customHeightLg.each(function () { 419 var element = $(this), 420 elementHeight = element.attr('data-height-lg'); 421 if ($body.hasClass('device-lg')) { 422 if (elementHeight !== '') { 423 element.css('height', elementHeight); 424 } 425 } 426 }); 427 } 428 }, 429 equalize: function () { 430 431 if ($equalize.length > 0) { 432 $equalize.each(function () { 433 434 var elem = $(this), 435 selectorItem = elem.find(elem.attr('data-equalize-item')) || "> div", 436 maxHeight = 0; 437 438 selectorItem.each(function () { 439 if ($(this).outerHeight(true) > maxHeight) { 440 maxHeight = $(this).outerHeight(true); 441 } 442 }); 443 selectorItem.height(maxHeight); 444 445 }); 446 } 447 }, 448 stickyFooter: function () { 449 if ($footerStickyClass.length > 0) { 450 if ($body.hasClass('device-lg') || $body.hasClass('device-md')) { 451 var elemOuterHeight = $footerStickyClass.outerHeight(); 452 453 var t = setTimeout(function () { 454 $footerStickyClass.addClass("footer-sticky-active"); 455 }, 1000); 456 457 // $pageContent.addClass("page-content-shadow"); 458 $wrapper.css({ 459 'margin-bottom': elemOuterHeight, 460 'z-index': 1 461 }); 462 } else { 463 $wrapper.css({ 464 'margin-bottom': 0 465 }); 466 $footerStickyClass.removeClass("footer-sticky-active"); 467 } 468 } 469 }, 470 471 472 }; 473 INSPIRO.header = { 474 functions: function () { 475 INSPIRO.header.logoStatus(); 476 INSPIRO.header.stickyHeader(); 477 INSPIRO.header.topBar(); 478 INSPIRO.header.topSearch(); 479 INSPIRO.header.mainMenu(); 480 INSPIRO.header.pageTitle(); 481 INSPIRO.header.pageMenu(); 482 INSPIRO.header.sidePanel(); 483 INSPIRO.header.dotsMenu(); 484 INSPIRO.header.onepageMenu(); 485 }, 486 logoStatus: function () { 487 if (!$body.is('.device-lg, .device-md, .menu-overlay-active') && $header.is('.dark.header-transparent, .dark.header-colored-transparent, .dark.header-colored')) { 488 logo.find('img').attr('src', logoImg); 489 } else if ($header.hasClass('dark')) { 490 if (logoDark) { 491 logo.find('img').attr('src', logoDark); 492 } else { 493 logo.find('img').attr('src', logoImg); 494 } 495 } else { 496 logo.find('img').attr('src', logoImg); 497 } 498 }, 499 stickyHeader: function () { 500 501 var elem = $(this), 502 shrinkHeader = elem.attr('data-shrink') || 0, 503 shrinkHeaderActive = elem.attr('data-sticky-active') || 200, 504 scrollOnTop = $window.scrollTop(); 505 506 if ($header.hasClass("header-modern")) { 507 shrinkHeader = 300; 508 } 509 510 if (!$header.is(".header-no-sticky, .header-static")) { 511 512 if ($header.hasClass("header-sticky-resposnive") || $body.is('.device-lg, .device-md')) { 513 514 if (scrollOnTop > $headerOffsetTop + shrinkHeader) { 515 INSPIRO.header.logoStatus(); 516 $("#header").addClass('header-sticky'); 517 518 if (scrollOnTop > $headerOffsetTop + shrinkHeaderActive) { 519 if (!$body.is(".overlay-menu") && $header.is(".header-transparent:not(.header-modern), .header-colored, .header-colored-transparent")) { 520 $header.addClass('sticky-active').removeClass("dark"); 521 } else { 522 $header.addClass('sticky-active'); 523 } 524 } 525 } else { 526 $header.removeClass().addClass($headerCurrentClasses); 527 INSPIRO.header.logoStatus(); 528 } 529 } 530 } 531 }, 532 topBar: function () { 533 if ($topbar.length > 0) {
534 $("#topbar .topbar-dropdown .topbar-form").each(function (index, element) { 535 if ($window.width() - ($(element).width() + $(element).offset().left) < 0) { 536 $(element).addClass('dropdown-invert'); 537 } 538 }); 539 } 540 }, 541 topSearch: function () { 542 $("#top-search-trigger").on("click", function () { 543 $body.toggleClass('top-search-active'); 544 $topSearch.find('input').focus(); 545 return false; 546 }); 547 }, 548 mainMenu: function () { 549 if ($mainmenu.length > 0) { 550 551 if ($body.is('.device-lg, .device-md')) { 552 $("body #mainMenu.menu-onclick nav > ul > li.dropdown > a, body .dropdown-submenu > a, body .dropdown-submenu > span").on('click touchend', function (e) { 553 554 $(this).parent('li').siblings().removeClass('hover-active').removeClass('current'); 555 $(this).parent('li').toggleClass('hover-active'); 556 return false; 557 }); 558 559 } else { 560 $("#mainMenu nav > ul > li.dropdown > a, .dropdown-submenu > a, .dropdown-submenu > span").on('click touchend', function (e) { 561 $(this).parent('li').siblings().removeClass('hover-active'); 562 $(this).parent('li').toggleClass('hover-active'); 563 return false; 564 }); 565 } 566 567 $("#mainMenu-trigger button").on('click touchend', function (e) { 568 $body.toggleClass("mainMenu-open"); 569 $(this).toggleClass("toggle-active"); 570 if ($body.hasClass("mainMenu-open")) { 571 $header.find("#mainMenu").css("max-height", $window.height() - $header.height()); 572 } else { 573 $header.find("#mainMenu").css("max-height", 0); 574 } 575 return false; 576 }); 577 578 if ($body.is('.device-lg, .device-md')) { 579 /*invert menu fix*/ 580 581 var $menuLastItem = $("nav > ul > li:last-child"), 582 $menuLastItemUl = $("nav > ul > li:last-child > ul"), 583 $menuLastInvert = $menuLastItemUl.width() - $menuLastItem.width(), 584 $menuItems = $("nav > ul > li").find(".dropdown-menu"); 585 586 $menuItems.css('display', 'block'); 587 $('.dropdown:not(.mega-menu-item) ul ul').each(function (index, element) { 588 if ($window.width() - ($(element).width() + $(element).offset().left) < 0) { 589 $(element).addClass('menu-invert'); 590 } 591 }); 592 593 if($window.width() - ($menuLastItemUl.width() + $menuLastItem.offset().left) < 0) { 594 $menuLastItemUl.addClass('menu-last'); 595 } 596 597 $menuItems.css('display', ''); 598 599 600 } 601 } 602 }, 603 pageTitle: function () { 604 if ($pageTitle.length > 0) { 605 // var pageTitleHeight = $pageTitle.find("> .container").innerHeightHeight(); 606 // 607 // alert(pageTitleHeight); 608 // $pageTitle.css('min-height', pageTitleHeight); 609 610 /* if ($topbar && $header) { 611 $pageTitle.css("padding-top", $header.height() + $topbar.height()); 612 }else{ 613 $pageTitle.css("padding-top", $header.height()); 614 } 615*/ 616 } 617 }, 618 619 620 /*TO BE CHECKED !!!!!!!!!!!!!!!*/ 621 pageMenu: function () { 622 if ($pageMenu.length > 0) { 623 $pageMenu.each(function () { 624 if ($pageMenu.hasClass("slide-menu")) { 625 $pageMenu.addClass("slide-menu-version"); 626 $("#menu-responsive-icon").on("click", function () { 627 $pageMenu.toggleClass("page-menu-active"); 628 $pageMenu.toggleClass("items-visible"); 629 }); 630 } else { 631 $("#menu-responsive-icon").on("click", function () { 632 $pageMenu.toggleClass("page-menu-active"); 633 $pageMenu.toggleClass("items-visible"); 634 }); 635 } 636 }); 637 } 638 }, 639 sidePanel: function () { 640 if (sidePanel.length > 0) { 641 $(".side-panel:not(.side-panel-admin) #wrapper, #close-panel").on("click", function () { 642 $body.removeClass("side-panel-active");
643 $("#side-panel-trigger").removeClass("toggle-active"); 644 }); 645 var t = setTimeout(function () { 646 INSPIRO.elements.gridLayoutRefresh(); 647 }, 1000); 648 } 649 }, 650 dotsMenu: function () { 651 if ($dotsMenu.length > 0) { 652 $dotsMenuItems.on('click', function () { 653 $dotsMenuItems.parent("li").removeClass('current'); 654 $(this).parent("li").addClass('current'); 655 return false; 656 }); 657 658 $dotsMenuItems.parents("li").removeClass('current'); 659 $dotsMenu.find('a[href="#' + INSPIRO.header.currentSection() + '"]').parent("li").addClass('current'); 660 } 661 }, 662 onepageMenu: function () { 663 if ($mainmenu.hasClass("menu-one-page")) { 664 $mainmenu.find("nav > ul > li > a").parents("li").removeClass('current'); 665 $mainmenu.find('nav > ul > li > a[href="#' + INSPIRO.header.currentSection() + '"]').parent("li").addClass('current'); 666 } 667 }, 668 currentSection: function () { 669 var elemCurrent = "body"; 670 $section.each(function () { 671 var elem = $(this), 672 elemeId = elem.attr("id"); 673 674 if ((elem.offset().top - $window.height() / 3 < $window.scrollTop()) && (elem.offset().top + elem.height() - $window.height() / 3 > $window.scrollTop())) { 675 elemCurrent = elemeId; 676 } 677 }); 678 return elemCurrent; 679 } 680 }; 681 INSPIRO.slider = { 682 functions: function () { 683 INSPIRO.slider.sliderScreenSizeControl(); 684 INSPIRO.slider.inspiroSlider(); 685 INSPIRO.slider.carousel(); 686 }, 687 sliderScreenSizeControl: function () { 688 if ($inspiroSlider.length > 0) { 689 var headerHeight = $header.outerHeight(), 690 topbarHeight = $topbar.outerHeight() || 0, 691 windowHeight = $window.height(), 692 screenHeightExtra = headerHeight + topbarHeight, 693 sliderFullscreen = $inspiroSlider.hasClass('slider-fullscreen'), 694 screenRatio = $inspiroSlider.hasClass('slider-fullscreen') ? 1 : 1.28, 695 transparentHeader = $header.hasClass("header-transparent") || $header.hasClass("header-light-transparent") || $header.hasClass("header-dark-transparent") || $header.hasClass("header-colored-transparent") || $header.hasClass("header-modern"), 696 sliderTargetElements = $(".inspiro-slider, .inspiro-slider .owl-stage-outer, .inspiro-slider .owl-stage, .inspiro-slider .slide"), 697 customHeight = $inspiroSlider.data("height"), 698 responsiveHeightxs = $inspiroSlider.data("height-xs") || 300; 699 700 if ($body.is(".device-lg, .device-md, .device-sm")) { 701 if (transparentHeader) { 702 if (sliderFullscreen) { 703 sliderTargetElements.css('height', windowHeight + 'px'); 704 } else { 705 if (!$header.hasClass(".header-transparent")) { 706 $(".inspiro-slider .slide").css('padding-top', screenHeightExtra + 'px'); 707 708 } 709 if (!customHeight) { 710 sliderTargetElements.css('height', windowHeight / screenRatio + 'px'); 711 } else { 712 sliderTargetElements.css('height', customHeight + 'px'); 713 } 714 } 715 } else { 716 if (sliderFullscreen) { 717 sliderTargetElements.css('height', windowHeight - screenHeightExtra + 'px'); 718 719 } else { 720 sliderTargetElements.css('height', windowHeight / screenRatio - screenHeightExtra + 'px'); 721 } 722 if (customHeight) { 723 sliderTargetElements.css('height', customHeight + 'px'); 724 } 725 } 726 } else { 727 sliderTargetElements.css('height', responsiveHeightxs + 'px'); 728 } 729 } 730 }, 731 inspiroSlider: function () { 732 if (!$().owlCarousel) { 733 console.log('inspiroSlider: owlCarousel plugin is missing.'); 734 return true; 735 } 736 if ($inspiroSlider.length > 0) { 737 $inspiroSlider.each(function () { 738 var elem = $(this), 739 carouselNav = elem.attr('data-arrows') || true, 740 carouselDots = elem.attr('data-dots') || true, 741 carouselAutoPlay = elem.attr('data-autoplay') || false, 742 carouselAutoplayTimeout = elem.attr('data-autoplay-timeout') || 5000, 743 carouseAnimateIn = elem.attr('data-animate-in') || false, 744 carouseAnimateOut = elem.attr('data-animate-out') || false, 745 carouselLoop = elem.attr('data-loop') || true, 746 carouselHoverPause = elem.attr('data-hover-pause') || true, 747 carouselMargin = elem.attr('data-margin') || 0, 748 carouselVideo = elem.attr('data-video') || true, 749 carouselItems = elem.attr('data-items') || 4, 750 carouselSmartSpeed = elem.attr('data-smart-speed') || 500, 751 carouselItemsLg = elem.attr('data-items-lg') || Number(carou
751selItems), 752 carouselItemsMd = elem.attr('data-items-md') || Number(carouselItemsLg), 753 carouselItemsSm = elem.attr('data-items-sm') || Number(carouselItemsMd), 754 carouselItemsXs = elem.attr('data-items-xs') || Number(carouselItemsSm), 755 carouselItemsXxs = elem.attr('data-items-xxs') || Number(carouselItemsXs), 756 carouselDrag = elem.attr('data-drag') || true; 757 758 759 elem.addClass("owl-carousel"); 760 //Kenburns effect 761 elem.find('.slide').each(function () { 762 if ($(this).hasClass("kenburns")) { 763 var elemChild = $(this), 764 elemChildImage = elemChild.css('background-image').replace(/.*\s?url\([\'\"]?/, '').replace(/[\'\"]?\).*/, ''); 765 elemChild.prepend('<div class="kenburns-bg" style="background-image:url(' + elemChildImage + ')"></div>'); 766 } 767 }); 768 769 if (elem.find('.slide').length > 1) { 770 771 elem.owlCarousel({ 772 nav: carouselNav, 773 dots: carouselDots, 774 navText: $carouselIcons, 775 autoplay: carouselAutoPlay, 776 autoplayTimeout: carouselAutoplayTimeout, 777 autoplayHoverPause: carouselHoverPause, 778 loop: carouselLoop, 779 margin: Number(carouselMargin), 780 smartSpeed: Number(carouselSmartSpeed), 781 video: carouselVideo, 782 animateIn: carouseAnimateIn, 783 animateOut: carouseAnimateOut, 784 rtl: INSPIRO.core.rtlStatus(), 785 items: 1, 786 mouseDrag: carouselDrag, 787 touchDrag: carouselDrag, 788 pullDrag: false, 789 freeDrag: false, 790 callbacks: true, 791 onInitialize: function (event) { 792 var t = setTimeout(function () { 793 elem.find(".owl-item:not(.active) .slide > video").each(function () { 794 this.pause(); 795 }); 796 elem.find(".owl-item.active .slide .kenburns-bg").addClass("kenburns-bg-animate"); 797 798 elem.addClass("slider-loaded"); 799 }, 100); 800 801 802 } 803 }); 804 var $captions = elem.find('.slide-captions > *'); 805 $captions.each(function () { 806 var $captionElem = $(this); 807 var animationDuration = "600ms"; 808 if ($(this).data("animation-duration")) { 809 animationDuration = $(this).data("animation-duration") + "ms"; 810 } 811 $(this).css("animation-duration", animationDuration); 812 $captionElem.addClass('slide-caption-hide'); 813 }); 814 $captions.each(function (index) { 815 var $captionElem = $(this), 816 captionDelay = $captionElem.data("caption-delay") || index * 80, 817 captionAnimation = $captionElem.data('caption-animation') || "fadeInUp"; 818 var t = setTimeout(function () { 819 $captionElem.removeClass('slide-caption-hide').addClass(captionAnimation); 820 }, captionDelay); 821 }); 822 elem.on('changed.owl.carousel', function (property) { 823 var current = property.item.index, 824 currentSlide = $(property.target).find(".owl-item").eq(current), 825 currentSlideCaptions = currentSlide.find(".slide-captions > *"), 826 currentSlideDark = currentSlide.find(".slide").hasClass("slide-dark"), 827 currentSlideKenburns = currentSlide.find(".slide").hasClass("kenburns"); 828 if (currentSlideKenburns) { 829 $(this).find(".kenburns-bg").addClass("kenburns-bg-animate"); 830 } 831 currentSlideCaptions.each(function (index) { 832 var $captionElem = $(this), 833 captionDelay = $captionElem.data("caption-delay") || (index * 350 + 1000), 834 captionAnimation = $captionElem.data('caption-animation') || "fadeInUp"; 835 var t = setTimeout(function () { 836 $captionElem.removeClass('slide-caption-hide').addClass(captionAnimation); 837 }, captionDelay); 838 }); 839 if ($window.width() > 992) { 840 //Pause HTML5 Video 841 if (currentSlide.find("video").length > 0) { 842 var t = setTimeout(function () { 843 currentSlide.find(".slide video").get(0).play(); 844 }, 1000); 845 } 846 } 847 }); 848 elem.on('change.owl.carousel', function (property) { 849 var current = property.item.index, 850 currentSlide = $(property.target).find(".owl-item").eq(current), 851 currentSlideCaptions = $(property.target).find(".owl-item:not(.active)").find(".slide-captions > *"), 852 currentSlideKenburns = currentSlide.find(".slide").hasClass("kenburns"); 853 currentSlideCaptions.each(function () { 854 var $captionElem = $(this), 855 captionAnimation = $captionElem.data('caption-animation') || "fadeInUp"; 856 $captionElem.removeClass(captionAnimation).addClass('slide-caption-hide'); 857 }); 858 elem.find(".slide video").each(function () { 859 this.pause(); 860 }); 861 if (currentSlideKenburns) { 862 $(this).find(".kenburns-bg").removeClass("kenburns-bg-animate"); 863 } 864 }); 865 866 867 868 869 870 } else { 871 elem.addClass("slider-loaded"); 872 var t = setTimeout(function () { 873 elem.find('.slide').find(".kenburns-bg").addClass("kenburns-bg-animate"); 874 }, 200); 875 } 876 // var t = setTimeout(function () { 877 INSPIRO.slider.sliderScreenSizeControl(); 878 879 //}, 100); 880 881 }); 882 } 883 }, 884 885 carouselAjax: function () { 886 if (!$().owlCarousel) { 887 console.log('carouselAjax: owlCarousel plugin is missing.'); 888 return true; 889 } 890 var carousel = $(".carousel"), 891 carouselNav = carousel.attr('data-arrows'), 892 carouselDots = carousel.attr('data-dots') || true, 893 carouselAutoPlay = carousel.attr('data-autoplay') || false, 894 carouselAutoplayTimeout = carousel.attr('data-autoplay-timeout') || 5000, 895 carouseAnimateIn = carousel.attr('data-animate-in') || false, 896 carouseAnimateOut = carousel.attr('data-animate-out') || false, 897 carouselLoop = carousel.attr('data-loop') || false, 898 carouselMargin = carousel.attr('data-margin') || 0, 899 carouselVideo = carousel.attr('data-video') || true, 900 carouselItems = carousel.attr('data-items') || 4, 901 carouselItemsLg = carousel.attr('data-items-lg') || Number(carou
901selItems), 902 carouselItemsMd = carousel.attr('data-items-md') || Number(carouselItemsLg), 903 carouselItemsSm = carousel.attr('data-items-sm') || Number(carouselItemsMd), 904 carouselItemsXs = carousel.attr('data-items-xs') || Number(carouselItemsSm), 905 carouselItemsXxs = carousel.attr('data-items-xxs') || Number(carouselItemsXs); 906 907 if (carouselNav == 'false') { 908 carouselNav = false; 909 } else { 910 carouselNav = true; 911 } 912 913 if (carouselDots == 'false') { 914 carouselDots = false; 915 } else { 916 carouselDots = true; 917 } 918 919 carousel.owlCarousel({ 920 nav: carouselNav, 921 dots: carouselDots, 922 navText: $carouselIcons, 923 autoplay: carouselAutoPlay, 924 autoplayTimeout: carouselAutoplayTimeout, 925 autoplayHoverPause: true, 926 loop: carouselLoop, 927 margin: Number(carouselMargin), 928 smartSpeed: Number(1000), 929 video: carouselVideo, 930 animateIn: carouseAnimateIn, 931 animateOut: carouseAnimateOut, 932 rtl: INSPIRO.core.rtlStatus(), 933 onInitialize: function (event) { 934 carousel.addClass("carousel-loaded owl-carousel"); 935 }, 936 responsive: { 937 0: { 938 items: Number(carouselItemsXxs) 939 }, 940 480: { 941 items: Number(carouselItemsXs) 942 }, 943 768: { 944 items: Number(carouselItemsSm) 945 }, 946 992: { 947 items: Number(carouselItemsMd) 948 }, 949 1200: { 950 items: Number(carouselItemsLg) 951 } 952 } 953 }); 954 }, 955 carousel: function () { 956 if (!$().owlCarousel) { 957 console.log('carousel: owlCarousel plugin is missing.'); 958 return true; 959 } 960 if ($carousel.length > 0) { 961 $carousel.each(function () { 962 var elem = $(this), 963 carouselItemElement = elem.attr('data-item') || "div", 964 carouselNav = elem.attr('data-arrows'), 965 carouselDots = elem.attr('data-dots') || true, 966 carouselAutoPlay = elem.attr('data-autoplay') || false, 967 carouselAutoplayTimeout = elem.attr('data-autoplay-timeout') || 5000, 968 carouselAutoWidth = elem.attr('data-auto-width') || false, 969 carouseAnimateIn = elem.attr('data-animate-in') || false, 970 carouseAnimateOut = elem.attr('data-animate-out') || false, 971 carouselLoop = elem.attr('data-loop') || false, 972 carouselMargin = elem.attr('data-margin') || 0, 973 carouselVideo = elem.attr('data-video') || false, 974 carouselItems = elem.attr('data-items') || 4, 975 carouselItemsLg = elem.attr('data-items-lg') || Number(carouselItems), 976 carouselItemsMd = elem.attr('data-items-md') || Number(carouselItemsLg), 977 carouselItemsSm = elem.attr('data-items-sm') || Number(carouselItemsMd), 978 carouselItemsXs = elem.attr('data-items-xs') || Number(carouselItemsSm), 979 carouselItemsXxs = elem.attr('data-items-xxs') || Number(carouselItemsXs); 980 981 if (carouselItemsMd >= 3) { 982 var carouselItemsSm = elem.attr('data-items-sm') || Number(2); 983 } 984 if (carouselItemsSm >= 2) { 985 var carouselItemsXs = elem.attr('data-items-xs') || Number(2); 986 } 987 if (carouselItemsXs >= 1) { 988 var carouselItemsXxs = elem.attr('data-items-xxs') || Number(1); 989 } 990 991 if (carouselNav == 'false') { 992 carouselNav = false;
993 } else { 994 carouselNav = true; 995 } 996 997 if (carouselDots == 'false') { 998 carouselDots = false; 999 } else { 1000 carouselDots = true; 1001 } 1002 1003 if (carouselAutoPlay == 'false') { 1004 carouselAutoPlay = false; 1005 } 1006 1007 var t = setTimeout(function () { 1008 elem.owlCarousel({ 1009 nav: carouselNav, 1010 dots: carouselDots, 1011 navText: $carouselIcons, 1012 itemElement: carouselItemElement, 1013 autoplay: carouselAutoPlay, 1014 autoplayTimeout: carouselAutoplayTimeout, 1015 autoplayHoverPause: true, 1016 autoWidth: carouselAutoWidth, 1017 loop: carouselLoop, 1018 margin: Number(carouselMargin), 1019 smartSpeed: Number(350), 1020 fluidSpeed: Number(260), 1021 video: carouselVideo, 1022 animateIn: carouseAnimateIn, 1023 animateOut: carouseAnimateOut, 1024 rtl: INSPIRO.core.rtlStatus(), 1025 onInitialize: function (event) { 1026 // setTimeout(function () { 1027 elem.addClass("carousel-loaded owl-carousel"); 1028 // }, 1000); 1029 }, 1030 responsive: { 1031 0: { 1032 items: Number(carouselItemsXxs) 1033 }, 1034 480: { 1035 items: Number(carouselItemsXs) 1036 }, 1037 768: { 1038 items: Number(carouselItemsSm) 1039 }, 1040 992: { 1041 items: Number(carouselItemsMd) 1042 }, 1043 1200: { 1044 items: Number(carouselItemsLg) 1045 } 1046 } 1047 }); 1048 }, 100); 1049 }); 1050 } 1051 }, 1052 flickityCarousel: function () { 1053 if (!$().flickity) { 1054 console.log('flickityCarousel: flickity plugin is missing.'); 1055 return true; 1056 } 1057 if ($flickity.length > 0) { 1058 $flickity.each(function () { 1059 var elem = $(this), 1060 accessibility = elem.attr('data-accessibility') || false, 1061 adaptiveHeight = elem.attr('data-adaptiveHeight') || false, 1062 autoPlay = elem.attr('data-autoPlay') || true, 1063 cellAlign = elem.attr('data-cellAlign') || 0, 1064 cellSelector = elem.attr('data-cellSelector') || undefined, 1065 contain = elem.attr('data-contain') || true, 1066 draggable = elem.attr('data-draggable') || true, 1067 dragThreshold = elem.attr('data-dragThreshold') || 3, 1068 freeScroll = elem.attr('data-freeScroll') || false, 1069 friction = elem.attr('data-friction') || 0.2, 1070 groupCells = elem.attr('data-groupCells') || false, 1071 initialIndex = elem.attr('data-initialIndex') || 0, 1072 lazyLoad = elem.attr('data-lazyLoad') || true, 1073 percentPosition = elem.attr('data-percentPosition') || true, 1074 prevNextButtons = elem.attr('data-prevNextButtons') || true, 1075 pageDots = elem.attr('data- pageDots') || true, 1076 resize = elem.attr('data-resize') || true, 1077 rightToLeft = elem.attr('data-rightToLeft') || false, 1078 setGallerySize = elem.attr('data-setGallerySize') || true, 1079 watchCSS = elem.attr('data-watchCSS') || false, 1080 wrapAround = elem.attr('data-wrapAround') || false; 1081 1082 1083 var t = setTimeout(function () { 1084 elem.flickity({ 1085 accessibility: accessibility, 1086 adaptiveHeight: adaptiveHeight, 1087 autoPlay: autoPlay, 1088 cellAlign: cellAlign, 1089 cellSelector: cellSelector, 1090 contain: contain, 1091 draggable: draggable, 1092 dragThreshold: dragThreshold, 1093 freeScroll: freeScroll, 1094 friction: friction, 1095 groupCells: groupCells, 1096 initialIndex: initialIndex, 1097 lazyLoad: lazyLoad, 1098 percentPosition: percentPosition, 1099 prevNextButtons: prevNextButtons, 1100 pageDots: pageDots, 1101 resize: resize, 1102 rightToLeft: rightToLeft, 1103 setGallerySize: setGallerySize,
1104 watchCSS: watchCSS, 1105 wrapAround: wrapAround 1106 }); 1107 }, 100); 1108 }); 1109 } 1110 }, 1111 1112 1113 }; 1114 INSPIRO.elements = { 1115 functions: function () { 1116 INSPIRO.elements.naTo(); 1117 INSPIRO.elements.textRotator(); 1118 INSPIRO.elements.buttons(); 1119 INSPIRO.elements.accordion(); 1120 INSPIRO.elements.animations(); 1121 INSPIRO.elements.parallax(); 1122 INSPIRO.elements.responsiveVideos(); 1123 INSPIRO.elements.counters(); 1124 INSPIRO.elements.countdownTimer(); 1125 INSPIRO.elements.progressBar(); 1126 INSPIRO.elements.pieChart(); 1127 INSPIRO.elements.maps(); 1128 INSPIRO.elements.gridLayout(); 1129 INSPIRO.elements.tooltip(); 1130 INSPIRO.elements.popover(); 1131 INSPIRO.elements.lightBoxInspiro(); 1132 INSPIRO.elements.youTubeBgPlayer(); 1133 INSPIRO.elements.vimeoBgPlayer(); 1134 INSPIRO.elements.modal(); 1135 INSPIRO.elements.stickySidebar(); 1136 INSPIRO.elements.copyToClipboard(); 1137 // INSPIRO.elements.notification(); 1138 INSPIRO.elements.other(); 1139 1140 }, 1141 1142 other: function (context) { 1143 1144 1145 $('[data-switch=true], .bt-switch').bootstrapSwitch(); 1146 1147 if ($(".toggle-item").length > 0) { 1148 $(".toggle-item").each(function () { 1149 var elem = $(this), 1150 toggleItemClass = elem.attr('data-class'), 1151 toggleItemClassTarget = elem.attr('data-target'); 1152 1153 elem.on("click", function () { 1154 if (toggleItemClass) { 1155 if (toggleItemClassTarget) { 1156 $(toggleItemClassTarget).toggleClass(toggleItemClass); 1157 } else { 1158 elem.toggleClass(toggleItemClass); 1159 } 1160 } 1161 elem.toggleClass("toggle-active"); 1162 return false; 1163 }); 1164 }); 1165 } 1166 1167 /*Hover 3d Effect*/ 1168 if ($(".hover-3d").length > 0) { 1169 $(".hover-3d").each(function () { 1170 var $elem = $(this), 1171 selector = $elem.attr("data-selector") || ".portfolio-item-wrap", 1172 shine = $elem.attr("data-shine") || false, 1173 sensitivity = $elem.attr("data-sensitivity") || 16; 1174 1175 $elem.hover3d({ 1176 selector: selector, 1177 shine: shine, 1178 sensitivity: Number(sensitivity) 1179 }); 1180 }); 1181 } 1182 1183 1184 1185 1186 1187 1188 1189 1190 $('.form-group.form-group-default', context).click(function () { 1191 $(this).find('input').focus(); 1192 }); 1193 1194 if (!this.initFormGroupDefaultRun) { 1195 $('body').on('focus', '.form-group.form-group-default :input', function () { 1196 $('.form-group.form-group-default').removeClass('focused'); 1197 $(this).parents('.form-group').addClass('focused'); 1198 }); 1199 1200 $('body').on('blur', '.form-group.form-group-default :input', function () { 1201 $(this).parents('.form-group').removeClass('focused'); 1202 if ($(this).val()) { 1203 $(this).closest('.form-group').find('label').addClass('fade'); 1204 } else { 1205 $(this).closest('.form-group').find('label').removeClass('fade'); 1206 } 1207 }); 1208 1209 // Only run the above code once. 1210 this.initFormGroupDefaultRun = true; 1211 } 1212 1213 $('.form-group.form-group-default .checkbox, .form-group.form-group-default .radio', context).hover(function () { 1214 $(this).parents('.form-group').addClass('focused'); 1215 }, function () { 1216 $(this).parents('.form-group').removeClass('focused'); 1217 }); 1218 1219 1220 1221 1222 1223 }, 1224 naTo: function () { 1225 $('a.scroll-to, #dotsMenu > ul > li > a, .menu-one-page nav > ul > li > a').on('click', function () { 1226 if ($body.is('.device-xxs, .device-xs, .device-sm')) { 1227 if ($mainmenu.hasClass('menu-one-page')) { 1228 $header.find("#mainMenu").css("max-height", 0); 1229 $body.toggleClass("mainMenu-open"); 1230 $("#mainMenu-trigger button").toggleClass("toggle-active"); 1231 } 1232 } 1233 1234 var extraPaddingTop = 0, 1235 extraHeaderHeight = 0; 1236 1237 if ($('.dashboard').length > 0) { 1238 extraPaddingTop = 30; 1239 } 1240 if ($header.length > 0) { 1241 extraHeaderHeight = $header.height(); 1242 } 1243 1244 var $anchor = $(this); 1245 1246 $('html, body').stop(true, false).animate({ 1247 scrollTop: ($($anchor.attr('href')).offset().top - (extraHeaderHeight + extraPaddingTop)) 1248 }, 1500, 'easeInOutExpo'); 1249 return false;
1250 }); 1251 }, 1252 textRotator: function () { 1253 if (!$().Morphext) { 1254 console.log('textRotator: Morphext plugin is missing.'); 1255 return true; 1256 } 1257 if ($textRotator.length > 0) { 1258 $textRotator.each(function () { 1259 var $elem = $(this), 1260 dataTextSeperator = $elem.attr('data-rotate-separator') || ",", 1261 dataTextEffect = $elem.attr('data-rotate-effect') || "flipInX", 1262 dataTextSpeed = $elem.attr('data-rotate-speed') || 2000; 1263 $elem.Morphext({ 1264 animation: dataTextEffect, 1265 separator: dataTextSeperator, 1266 speed: Number(dataTextSpeed) 1267 }); 1268 }); 1269 } 1270 }, 1271 buttons: function () { 1272 //Button slide width 1273 if ($(".btn-slide[data-width]")) { 1274 1275 $(".btn.btn-slide[data-width]").each(function () { 1276 var elem = $(this), 1277 elemWidth = elem.attr('data-width'), 1278 elemDefaultWidth; 1279 switch (true) { 1280 case elem.hasClass('btn-lg'): 1281 elemDefaultWidth = "60"; 1282 break; 1283 case elem.hasClass('btn-sm'): 1284 elemDefaultWidth = "36"; 1285 break; 1286 case elem.hasClass('btn-xs'): 1287 elemDefaultWidth = "28"; 1288 break; 1289 default: 1290 elemDefaultWidth = "48"; 1291 break; 1292 } 1293 elem.hover(function () { 1294 $(this).css("width", elemWidth + "px"); 1295 }, function () { 1296 $(this).css("width", elemDefaultWidth + "px"); 1297 }); 1298 }); 1299 } 1300 }, 1301 accordion: function () { 1302 var $accs = $(classFinder + accordionItem); 1303 $accs.length && ($accs.each(function () { 1304 var $item = $(this); 1305 $item.hasClass(itemActive) ? $item.addClass(itemActive) : $item.find(classFinder + itemContent).hide(); 1306 }), $(classFinder + itemTitle).on("click", function (e) { 1307 var $link = $(this), 1308 $item = $link.parents(classFinder + accordionItem), 1309 $acc = $item.parents(classFinder + accordionType); 1310 $item.hasClass(itemActive) ? $acc.hasClass(toogleType) ? ($item.removeClass(itemActive), $link.next(classFinder + itemContent).slideUp("fast")) : ($acc.find(classFinder + accordionItem).removeClass(itemActive), $acc.find(classFinder + itemContent).slideUp("fast")) : ($acc.hasClass(toogleType) || ($acc.find(classFinder + accordionItem).removeClass(itemActive), $acc.find(classFinder + itemContent).slideUp("fast")), $item.addClass(itemActive), $link.next(classFinder + itemContent).slideToggle("fast")), e.preventDefault(); 1311 return false; 1312 })); 1313 }, 1314 animations: function () { 1315 if (dataAnimation.length > 0) { 1316 //if ( $body.hasClass('device-xl') || $body.hasClass('device-lg') || $body.hasClass('device-md')) { 1317 dataAnimation.each(function () { 1318 $(this).addClass("animated"); 1319 var $elem = $(this), 1320 animationType = $elem.attr("data-animation") || "fadeIn", 1321 animationDelay = $elem.attr("data-animation-delay") || 200, 1322 animationDirection = ~animationType.indexOf("Out") ? "back" : "forward"; 1323 if (animationDirection == "forward") {
1324 $elem.appear(function () { 1325 var t = setTimeout(function () { 1326 $elem.addClass(animationType + " visible"); 1327 }, animationDelay); 1328 }, { 1329 accX: 0, 1330 accY: -120 1331 }, 'easeInCubic'); 1332 } else { 1333 $elem.addClass("visible"); 1334 $elem.on("click", function () { 1335 $elem.addClass(animationType); 1336 return false; 1337 }); 1338 } 1339 if ($elem.parents('.demo-play-animations').length) { 1340 $elem.on("click", function () { 1341 $elem.removeClass(animationType); 1342 var t = setTimeout(function () { 1343 $elem.addClass(animationType); 1344 }, 50); 1345 return false; 1346 }); 1347 } 1348 }); 1349 // } 1350 } 1351 }, 1352 parallax: function () { 1353 1354 if (!$().scrolly) { 1355 console.log('parallax: scrolly plugin is missing.'); 1356 return true; 1357 } 1358 if ($parallax.length > 0) { 1359 $parallax.each(function () { 1360 1361 var $elem = $(this), 1362 elemImageSrc = $elem.attr("data-parallax-image"), 1363 elemImageVelocity = $elem.attr("data-velocity") || "-.090"; 1364 1365 $elem.prepend('<div class="parallax-container" data-velocity="' + elemImageVelocity + '" style="background: url(' + elemImageSrc + ')"></div>'); 1366 1367 if ($body.hasClass('device-lg') || $body.hasClass('device-md')) { 1368 $elem.find(".parallax-container").scrolly({ 1369 bgParallax: true 1370 }); 1371 1372 } else { 1373 $elem.find(".parallax-container").addClass("parallax-responsive"); 1374 } 1375 1376 }); 1377 } 1378 }, 1379 responsiveVideos: function () { 1380 if (!$().fitVids) { 1381 console.log('responsiveVideos: fitVids plugin is missing.'); 1382 return true; 1383 } 1384 $("section, .content, .post-content, .video-js, .post-video, .video-wrap, .ajax-quick-view,#slider:not(.revslider-wrap)").fitVids(); 1385 }, 1386 counters: function () { 1387 if (!$().countTo) { 1388 console.log('counters: countTo plugin is missing.'); 1389 return true; 1390 } 1391 if ($counter.length > 0) { 1392 $counter.each(function () { 1393 var $elem = $(this); 1394 if ($body.hasClass('device-lg') || $body.hasClass('device-md')) {
1395 $elem.appear(function () { 1396 $elem.find('span').countTo(); 1397 }); 1398 } else { 1399 var countTo = $elem.find('span').attr('data-to'); 1400 $elem.find('span').html(countTo); 1401 } 1402 }); 1403 } 1404 }, 1405 countdownTimer: function () { 1406 if (!$().countdown) { 1407 console.log('countdownTimer: countdown plugin is missing.'); 1408 return true; 1409 } 1410 if ($countdownTimer.length > 0) { 1411 var t = setTimeout(function () { 1412 $('[data-countdown]').each(function () { 1413 var $this = $(this), 1414 finalDate = $(this).data('countdown'); 1415 $this.countdown(finalDate, function (event) { 1416 $this.html(event.strftime('<div class="countdown-container"><div class="countdown-box"><div class="number">%-D</div><span>Day%!d</span></div>' + '<div class="countdown-box"><div class="number">%H</div><span>Hours</span></div>' + '<div class="countdown-box"><div class="number">%M</div><span>Minutes</span></div>' + '<div class="countdown-box"><div class="number">%S</div><span>Seconds</span></div></div>')); 1417 }); 1418 }); 1419 }, 300); 1420 } 1421 }, 1422 progressBar: function () { 1423 if ($progressBar.length > 0) { 1424 $progressBar.each(function (i, elem) { 1425 var $elem = $(this), 1426 percent = $elem.attr('data-percent') || "100", 1427 delay = $elem.attr('data-delay') || "60", 1428 type = $elem.attr('data-type') || "%"; 1429 if (!$elem.hasClass('progress-animated')) { 1430 $elem.css({ 1431 'width': '0%' 1432 }); 1433 } 1434 var progressBarRun = function () { 1435 $elem.animate({ 1436 'width': percent + '%' 1437 }, 'easeInOutCirc').addClass('progress-animated'); 1438 $elem.delay(delay).append('<span class="progress-type">' + type + '</span><span class="progress-number animated fadeIn">' + percent + '</span>'); 1439 }; 1440 if ($body.hasClass('device-lg') || $body.hasClass('device-md')) { 1441 $(elem).appear(function () { 1442 var t = setTimeout(function () { 1443 progressBarRun(); 1444 }, delay); 1445 }); 1446 } else { 1447 progressBarRun(); 1448 } 1449 }); 1450 } 1451 }, 1452 pieChart: function () { 1453 if (!$().easyPieChart) { 1454 console.log('pieChart: easyPieChart plugin is missing.'); 1455 return true; 1456 } 1457 if ($pieChart.length > 0) { 1458 $pieChart.each(function () { 1459 var $elem = $(this), 1460 pieChartSize = $elem.attr('data-size') || "160", 1461 pieChartAnimate = $elem.attr('data-animate') || "2000", 1462 pieChartWidth = $elem.attr('data-width') || "6", 1463 pieChartColor = $elem.attr('data-color') || "$base-color", 1464 pieChartTrackColor = $elem.attr('data-trackcolor') || "rgba(0,0,0,0.10)"; 1465 $elem.find('span, i').css({ 1466 'width': pieChartSize + 'px', 1467 'height': pieChartSize + 'px', 1468 'line-height': pieChartSize + 'px' 1469 });
1470 $elem.appear(function () { 1471 $elem.easyPieChart({ 1472 size: Number(pieChartSize), 1473 animate: Number(pieChartAnimate), 1474 trackColor: pieChartTrackColor, 1475 lineWidth: Number(pieChartWidth), 1476 barColor: pieChartColor, 1477 scaleColor: false, 1478 lineCap: 'square', 1479 onStep: function (from, to, percent) { 1480 $elem.find('span.percent').text(Math.round(percent)); 1481 } 1482 }); 1483 }); 1484 }); 1485 } 1486 }, 1487 maps: function () { 1488 if (!$().gMap) { 1489 console.log('maps: gMap plugin is missing.'); 1490 return true; 1491 } 1492 if ($map.length > 0) { 1493 $map.each(function () { 1494 var $elem = $(this), 1495 mapAddress = $elem.attr('data-map-address') ? $elem.attr('data-map-address') : "Melbourne, Australia", 1496 mapType = $elem.attr('data-map-type') ? $elem.attr('data-map-type') : "ROADMAP", 1497 mapZoom = $elem.attr('data-map-zoom') ? $elem.attr('data-map-zoom') : "14", 1498 mapIcon = $elem.attr('data-map-icon') ? $elem.attr('data-map-icon') : "images/markers/marker2.png"; 1499 1500 1501 1502 var markers = [{ 1503 address: mapAddress, 1504 html: mapAddress, 1505 icon: { 1506 image: mapIcon, 1507 iconsize: [40, 63], 1508 iconanchor: [18, 60], 1509 }, 1510 }]; 1511 $elem.gMap({ 1512 address: mapAddress, 1513 maptype: mapType, 1514 markers: markers, 1515 zoom: Number(mapZoom), 1516 doubleclickzoom: true, 1517 controls: { 1518 panControl: true, 1519 zoomControl: true, 1520 mapTypeControl: false, 1521 scaleControl: true, 1522 streetViewControl: false, 1523 overviewMapControl: true 1524 }, 1525 styles: [{ 1526 featureType: "poi", 1527 elementType: "labels", 1528 stylers: [{ 1529 visibility: "off" 1530 }] 1531 }] 1532 }); 1533 }); 1534 } 1535 }, 1536 gridLayout: function () { 1537 if (!$().isotope) { 1538 console.log('gridLayout: isotope plugin is missing.'); 1539 return true; 1540 } 1541 if ($gridLayout.length > 0) { 1542 $gridLayout.each(function () { 1543 var elem = $(this), 1544 gridItem = elem.attr('data-item') || "portfolio-item", 1545 gridLayoutMode = elem.attr('data-layout') || "masonry", 1546 gridStagger = elem.attr('data-stagger') || 10, 1547 gridMargin = elem.attr('data-margin') || 20, 1548 gridXsMargin = elem.attr('data-xs-margin') || gridMargin, 1549 gridTransition = elem.attr("data-transition") || "0.55s"; 1550 1551 1552 1553 if($window.width() < 992) { 1554 gridMargin = gridXsMargin; 1555 } 1556 1557 if (gridLayoutMode == "fitRows") { 1558 var gridMargin2 = (gridMargin + 2); 1559 } else { 1560 var gridMargin2 = gridMargin; 1561 var gridMargin2 = gridMargin; 1562 } 1563 1564 elem.css("margin", "0 -" + gridMargin2 + "px -" + gridMargin + "px 0"); 1565 1566 elem.find('.' + gridItem).css("padding", "0 " + gridMargin + "px " + gridMargin + "px 0"); 1567 1568 1569 1570 // $window.on("load", function () { 1571 //elem.imagesLoaded( function() { 1572 //setTimeout(function () { 1573 elem.imagesLoaded(function () { 1574 var t = setTimeout(function () { 1575 elem.isotope({ 1576 layoutMode: gridLayoutMode, 1577 transitionDuration: gridTransition, 1578 stagger: Number(gridStagger), 1579 itemSelector: "." + gridItem, 1580 autoHeight: true, 1581 hiddenStyle: { 1582 opacity: 0, 1583 transform: "translate3d(0px, 60
1583px, 0px)", 1584 }, 1585 visibleStyle: { 1586 opacity: 1, 1587 transform: "translate3d(0px, 0px, 0px)", 1588 }, 1589 masonry: { 1590 // use outer width of grid-sizer for columnWidth 1591 columnWidth: elem.find('.' + gridItem + ':not(.large-width)')[0], 1592 } 1593 }); 1594 elem.css({ 1595 'opacity': 1 1596 }); 1597 var iso = elem.data('isotope'); 1598 elem.isotope('reveal', iso.items); 1599 1600 }, 100); 1601 1602 }); 1603 /*Infinity Scroll*/ 1604 if (elem.next().hasClass("infinite-scroll")) { 1605 INSPIRO.elements.gridLayoutInfinite(elem, gridItem, gridMargin); 1606 } 1607 1608 1609 }); 1610 if ($gridFilter.length > 0) { 1611 $gridFilter.each(function () { 1612 var elem = $(this), 1613 elemLayoutCnt = elem.attr('data-layout'), 1614 elemActive = elem.attr('data-active-class') || "active"; 1615 elem.find('a').click(function () { 1616 elem.find('li').removeClass(elemActive); 1617 $(this).parent('li').addClass(elemActive); 1618 $(elemLayoutCnt).isotope({ 1619 filter: $(this).attr('data-category') 1620 }); 1621 1622 if ($(".grid-active-title").length > 0) { 1623 $(".grid-active-title").empty().append($(this).text()) 1624 } 1625 return false; 1626 }); 1627 }); 1628 } 1629 1630 1631 } 1632 }, 1633 gridLayoutRefresh: function () { 1634 if ($gridLayout.length > 0) { 1635 $gridLayout.each(function () { 1636 var elem = $(this); 1637 var t = setTimeout(function () { 1638 elem.isotope('layout'); 1639 }, 300); 1640 }); 1641 } 1642 }, 1643 gridLayoutInfinite: function (element, elementSelector, elemGridMargin) { 1644 if (!$().infinitescroll) { 1645 console.log('gridLayoutInfinite: infinitescroll plugin is missing.'); 1646 return true; 1647 } 1648 1649 var elem = element, 1650 gridItem = elementSelector, 1651 gridMargin = elemGridMargin, 1652 navSelector = "#pagination", 1653 loadMoreElem = $("#showMore"), 1654 loadMoreBtn = $("#showMore a.btn"), 1655 loadMoreBtnText = $("#showMore a.btn").text(), 1656 loadMoreMessage = $('<div class="infinite-scroll-message"><p class="animated visible fadeIn">No more posts to show</p></div>'); 1657 1658 1659 1660 elem.imagesLoaded(function () { 1661 elem.infinitescroll({ 1662 itemSelector: "." + gridItem, 1663 navSelector: navSelector, 1664 nextSelector: navSelector + ' a:not(.btn)', 1665 state: { 1666 isDone: false 1667 }, 1668 extraScrollPx: 10, 1669 errorCallback: function () { 1670 loadMoreElem.addClass("animated visible fadeOut"); 1671 var t = setTimeout(function () { 1672 loadMoreElem.hide(); 1673 elem.after(loadMoreMessage); 1674 }, 500); 1675 var t = setTimeout(function () { 1676 $(".infinite-scroll-message").addClass("animated visible fadeOut"); 1677 }, 3800); 1678 }, 1679 }, 1680 1681 // Function called once the elements are retrieved 1682 function (newElements) {
1683 loadMoreBtn.text(loadMoreBtnText); 1684 1685 elem.css("margin", "0 -" + gridMargin + "px -" + gridMargin + "px 0"); 1686 elem.find('.' + gridItem).css("padding", "0 " + gridMargin + "px " + gridMargin + "px 0"); 1687 1688 1689 1690 1691 INSPIRO.slider.carouselAjax(); 1692 elem.isotope('appended', newElements); 1693 INSPIRO.elements.gridLayoutRefresh(); 1694 1695 }); 1696 }); 1697 1698 1699 1700 if (loadMoreElem.length > 0) { 1701 1702 $window.unbind('.infscr'); 1703 1704 loadMoreBtn.click(function () { 1705 loadMoreBtn.text("Loading..."); 1706 elem.infinitescroll('retrieve'); 1707 return false; 1708 }); 1709 } 1710 1711 1712 }, 1713 tooltip: function () { 1714 if (!$().tooltip) { 1715 console.log('tooltip: tooltip plugin is missing.'); 1716 return true; 1717 } 1718 var $tooltip = $('[data-toggle="tooltip"]'); 1719 if ($tooltip.length > 0) { 1720 $('[data-toggle="tooltip"]').tooltip(); 1721 } 1722 }, 1723 popover: function () { 1724 if (!$().popover) { 1725 console.log('popover: popover plugin is missing.'); 1726 return true; 1727 } 1728 var $popover = $('[data-toggle="popover"]'); 1729 if ($popover.length > 0) { 1730 $('[data-toggle="popover"]').popover({ 1731 container: 'body', 1732 html: true 1733 }); 1734 } 1735 }, 1736 lightBoxInspiro: function () { 1737 1738 1739 var $lightboxImageEl = $('[data-lightbox="image"]'), 1740 $lightboxGalleryEl = $('[data-lightbox="gallery"]'), 1741 $lightboxIframeEl = $('[data-lightbox="iframe"]'), 1742 $lightboxInlineEl = $('[data-lightbox="inline"]'), 1743 $lightboxAjaxEl = $('[data-lightbox="ajax"]'), 1744 $lightboxAjaxGalleryEl = $('[data-lightbox="ajax-gallery"]'); 1745 1746/* if( $lightboxImageEl.length > 0 ) { 1747 $lightboxImageEl.magnificPopup({ 1748 type: 'image', 1749 closeOnContentClick: true, 1750 closeBtnInside: false, 1751 fixedContentPos: true, 1752 mainClass: 'mfp-no-margins mfp-fade', // class to remove default margin from left and right side 1753 image: { 1754 verticalFit: true 1755 } 1756 }); 1757 }*/ 1758 1759 1760 if (!$().magnificPopup) { 1761 console.log('lightBoxInspiro: magnificPopup plugin is missing.'); 1762 return true; 1763 } 1764 1765 1766 if ($lightboxImageEl.length > 0) { 1767 $lightboxImageEl.magnificPopup({ 1768 type: 'image', 1769 removalDelay: 500, //delay removal by X to allow out-animation 1770 callbacks: { 1771 beforeOpen: function () { 1772 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 1773 this.st.mainClass = "mfp-zoom-out"; 1774 } 1775 }, 1776 }); 1777 } 1778 if ($lightbox_gallery.length > 0) { 1779 $lightbox_gallery.each(function () { 1780 $(this).magnificPopup({ 1781 delegate: 'a[data-lightbox="gallery-item"], a[data-lightbox="gallery-image"]', 1782 type: 'image', 1783 image: { 1784 verticalFit: true 1785 }, 1786 gallery: { 1787 enabled: true, 1788 navigateByImgClick: true, 1789 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 1790 }, 1791 removalDelay: 500, //delay removal by X to allow out-animation 1792 callbacks: { 1793 beforeOpen: function () { 1794 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 1795 this.st.mainClass = "mfp-zoom-out"; 1796 } 1797 }, 1798 }); 1799 }); 1800 } 1801 if ($lightbox_iframe.length > 0) { 1802 $lightbox_iframe.each(function () { 1803 $(this).magnificPopup({ 1804 type: 'iframe', 1805 removalDelay: 500, //delay removal by X to allow out-animation 1806 callbacks: { 1807 beforeOpen: function () { 1808 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 1809 this.st.mainClass = "mfp-zoom-out"; 1810 } 1811 }, 1812 }); 1813 }); 1814 } 1815 if ($lightbox_ajax.length > 0) { 1816 $lightbox_ajax.each(function () { 1817 $(this).magnificPopup({ 1818 type: 'ajax', 1819 removalDelay: 500, //delay removal by X to allow out-animation 1820 callbacks: { 1821 ajaxContentAdded: function (mfpResponse) { 1822 INSPIRO.slider.carouselAjax(); 1823 INSPIRO.elements.responsiveVideos(); 1824 // INSPIRO.elements.accordion(); 1825 INSPIRO.elements.buttons(); 1826 } 1827 } 1828 }); 1829 }); 1830 } 1831 if ($lightbox_inline.length > 0) { 1832 $lightbox_inline.magnificPopup({ 1833 type: 'inline', 1834 removalDelay: 500, //delay removal by X to allow out-animation 1835 callbacks: { 1836 beforeOpen: function () { 1837 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 1838 this.st.mainClass = "mfp-zoom-out"; 1839 } 1840 }, 1841 closeBtnInside: false, 1842 fixedContentPos: true, 1843 overflowY: 'scroll', 1844 }); 1845 } 1846 }, 1847 youTubeBgPlayer: function () { 1848 if (!$().mb_YTPlayer) { 1849 console.log('youTubeBgPlayer: mb_YTPlayer plugin is missing.'); 1850 return true; 1851 } 1852 if ($ytPlayer.length > 0) { 1853 $ytPlayer.each(function () { 1854 var elem = $(this), 1855 ytPlayerVideo = elem.attr('data-youtube-url') || null, 1856 ytPlayerMute = elem.attr('data-youtube-mute') || false, 1857 ytPlayerRatio = elem.attr('data-youtube-ratio') || '16/9', 1858 ytPlayerQuality = elem.attr('data-youtube-quality') || 'hd720', 1859 ytPlayerOpacity = elem.attr('data-youtube-opacity') || 1, 1860 ytPlayerContainer = elem.attr('data-youtube-container') || 'self', 1861 ytPlayerOptimize = elem.attr('data-youtube-optimize') || true, 1862 ytPlayerLoop = elem.attr('data-youtube-loop') || true, 1863 ytPlayerVolume = elem.attr('data-youtube-volume') || 70, 1864 ytPlayerStart = elem.attr('data-youtube-start') || 0, 1865 ytPlayerStop = elem.attr('data-youtube-stop') || 0, 1866 ytPlayerAutoPlay = elem.attr('data-youtube-autoplay') || false, 1867 ytPlayerFullScreen = elem.attr('data-youtube-fullscreen') || true, 1868 ytPlayerControls = elem.attr('data-youtube-control
1868s') || false, 1869 ytPlayerLogo = elem.attr('data-youtube-logo') || false, 1870 ytPlayerAutoPause = elem.attr('data-youtube-autopause') || false; 1871 elem.mb_YTPlayer({ 1872 videoURL: ytPlayerVideo, 1873 mute: ytPlayerMute, 1874 ratio: ytPlayerRatio, 1875 quality: ytPlayerQuality, 1876 opacity: ytPlayerOpacity, 1877 containment: ytPlayerContainer, 1878 optimizeDisplay: ytPlayerOptimize, 1879 loop: ytPlayerLoop, 1880 vol: ytPlayerVolume, 1881 startAt: ytPlayerStart, 1882 stopAt: ytPlayerStop, 1883 autoPlay: ytPlayerAutoPlay, 1884 realfullscreen: ytPlayerFullScreen, 1885 showYTLogo: ytPlayerLogo, 1886 showControls: ytPlayerControls 1887 }); 1888 if (!ytPlayerAutoPlay) { 1889 elem.find("#youtube-background-controls").addClass("video-is-playing"); 1890 } 1891 elem.on("YTPReady", function () { 1892 $("#youtube-background-controls").on("click", function () { 1893 if (!$(this).hasClass("video-is-playing")) { 1894 $(this).addClass("video-is-playing"); 1895 $ytPlayer.YTPPause(); 1896 } else { 1897 $(this).removeClass("video-is-playing"); 1898 $ytPlayer.YTPPlay(); 1899 } 1900 return false; 1901 }); 1902 var elemContainerHeight = elem.height(); 1903 if (ytPlayerAutoPause) { 1904 $window.on('scroll', function () { 1905 if ($window.scrollTop() > elemContainerHeight) { 1906 $("#youtube-background-controls").addClass("video-is-playing"); 1907 $ytPlayer.YTPPause(); 1908 } 1909 }); 1910 } 1911 }); 1912 }); 1913 } 1914 }, 1915 vimeoBgPlayer: function () { 1916 if (!$().vimeo_player) { 1917 console.log('vimeoBgPlayer: mb.vimeo_player plugin is missing.'); 1918 return true; 1919 } 1920 if ($vmPlayer.length > 0) { 1921 $vmPlayer.each(function () { 1922 var elem = $(this); 1923 1924 var elem = $(this), 1925 vmPlayerVideo = elem.attr('data-vimeo-url') || null, 1926 vmPlayerMute = elem.attr('data-vimeo-mute') || false, 1927 vmPlayerRatio = elem.attr('data-vimeo-ratio') || '16/9', 1928 vmPlayerQuality = elem.attr('data-vimeo-quality') || 'hd720', 1929 vmPlayerOpacity = elem.attr('data-vimeo-opacity') || 1, 1930 vmPlayerContainer = elem.attr('data-vimeo-container') || 'self', 1931 vmPlayerOptimize = elem.attr('data-vimeo-optimize') || true, 1932 vmPlayerLoop = elem.attr('data-vimeo-loop') || true, 1933 vmPlayerVolume = elem.attr('data-vimeo-volume') || 70, 1934 vmPlayerStart = elem.attr('data-vimeo-start') || 0, 1935 vmPlayerStop = elem.attr('data-vimeo-stop') || 0, 1936 vmPlayerAutoPlay = elem.attr('data-vimeo-autoplay') || true, 1937 vmPlayerFullScreen = elem.attr('data-vimeo-fullscreen') || true, 1938 vmPlayerControls = elem.attr('data-vimeo-controls') || false, 1939 vmPlayerLogo = elem.attr('data-vimeo-logo') || false, 1940 vmPlayerAutoPause = elem.attr('data-vimeo-autopause') || false; 1941 1942 elem.vimeo_player({ 1943 videoURL: vmPlayerVideo, 1944 mute: vmPlayerMute, 1945 ratio: vmPlayerRatio, 1946 quality: vmPlayerQuality, 1947 opacity: vmPlayerOpacity, 1948 containment: vmPlayerContainer, 1949 optimizeDisplay: vmPlayerOptimize, 1950 loop: vmPlayerLoop, 1951 vol: vmPlayerVolume, 1952 startAt: vmPlayerStart, 1953 stopAt: vmPlayerStop, 1954 autoPlay: vmPlayerAutoPlay, 1955 realfullscreen: vmPlayerFullScreen, 1956 showvmLogo: vmPlayerLogo, 1957 showControls: vmPlayerControls 1958 }); 1959 1960 1961 }); 1962 1963 1964 1965 } 1966 }, 1967 modal: function () { 1968 if (!$().magnificPopup) { 1969 console.log('lightBoxInspiro: magnificPopup plugin is missing.'); 1970 return true; 1971 } 1972 var $modal = $(".modal"), 1973 $modalStrip = $(".modal-strip"), 1974 $btnModal = $(".btn-modal"),
1975 modalShow = "modal-auto-open", 1976 modalShowClass = "modal-active", 1977 modalDecline = $(".modal-close"), 1978 /*CookieNotify*/ 1979 cookieNotify = $(".cookie-notify"), 1980 cookieConfirm = cookieNotify.find(".modal-confirm, .mfp-close"), 1981 coockieExpire = cookieNotify.attr("data-expire") || 365, 1982 coockieName = cookieNotify.attr("data-cookie-name") || "websiteCookies"; 1983 1984 /*Modal*/ 1985 if ($modal.length > 0) { 1986 $modal.each(function () { 1987 var elem = $(this), 1988 elemDelay = elem.attr("data-delay") || 3000; 1989 1990 1991 1992 /*Modal Auto Show*/ 1993 if (elem.hasClass(modalShow)) { 1994 if ($.cookie(coockieName) != 'confirfmed') { 1995 var t = setTimeout(function () { 1996 $.magnificPopup.open({ 1997 items: { 1998 src: elem 1999 }, 2000 type: 'inline', 2001 closeBtnInside: true, 2002 removalDelay: 500, 2003 callbacks: { 2004 beforeOpen: function () { 2005 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 2006 this.st.mainClass = "mfp-zoom-out"; 2007 }, 2008 open: function () { 2009 if (elem.find("video").length > 0) { 2010 elem.find("video").get(0).play(); 2011 } 2012 } 2013 } 2014 }, 0); 2015 }, elemDelay); 2016 } 2017 } 2018 2019 /*Modal Dissmis Button*/ 2020 elem.find(modalDecline).click(function () { 2021 $.magnificPopup.close(); 2022 return false; 2023 }); 2024 2025 /*Cookie Notify*/ 2026 if (elem.hasClass("cookie-notify")) { 2027 var t = setTimeout(function () { 2028 if ($.cookie(coockieName) != 'confirfmed') { 2029 cookieNotify.addClass(modalShowClass); 2030 } 2031 }, elemDelay); 2032 cookieConfirm.click(function () { 2033 $.cookie(coockieName, 'confirfmed', { 2034 expires: Number(coockieExpire) 2035 }); 2036 $.magnificPopup.close(); 2037 cookieNotify.removeClass(modalShowClass); 2038 return false; 2039 }); 2040 } 2041 }); 2042 } 2043 /*Modal Strip*/ 2044 if ($modalStrip.length > 0) { 2045 2046 $modalStrip.each(function () { 2047 var elem = $(this), 2048 modalDelay = elem.attr("data-delay") || 3000; 2049 /*Modal Auto Show*/ 2050 if (elem.hasClass(modalShow)) { 2051 var modalElem = $(this); 2052 var t = setTimeout(function () { 2053 modalElem.addClass(modalShowClass); 2054 }, modalDelay); 2055 } 2056 /*Modal Dissmis Button*/ 2057 elem.find(modalDecline).click(function () { 2058 elem.removeClass(modalShowClass); 2059 return false; 2060 }); 2061 /*Cookie Notify*/ 2062 if (elem.hasClass("cookie-notify")) { 2063 var t = setTimeout(function () { 2064 if ($.cookie(coockieName) != 'confirfmed') { 2065 cookieNotify.addClass(modalShowClass); 2066 } 2067 }, modalDelay); 2068 cookieConfirm.click(function () { 2069 $.cookie(coockieName, 'confirfmed', { 2070 expires: Number(coockieExpire) 2071 }); 2072 cookieNotify.removeClass(modalShowClass); 2073 return false;
2074 }); 2075 } 2076 }); 2077 } 2078 /*Modal toggles*/ 2079 if ($btnModal.length > 0) { 2080 2081 $btnModal.each(function () { 2082 var elem = $(this), 2083 modalTarget = elem.attr("data-modal"); 2084 elem.click(function () { 2085 $(modalTarget).toggleClass(modalShowClass, 1000); 2086 return false; 2087 }); 2088 }); 2089 } 2090 }, 2091 2092 notification: function ($message, $type) { 2093 2094 $.notify({ 2095 message: $message 2096 }, { 2097 type: $type || 'success', 2098 mouse_over: true 2099 }); 2100 2101 }, 2102 2103 stickySidebar: function () { 2104 2105 if (!$().theiaStickySidebar) { 2106 console.log('Sticky Sidebar: theiaStickySidebar plugin is missing.'); 2107 return true; 2108 } 2109 2110 $stickySidebar.each(function () { 2111 var elem = $(this), 2112 elemTop = elem.attr('data-offset-top') || 120, 2113 elemBottom = elem.attr('data-offset-bottom') || 50; 2114 2115 elem.theiaStickySidebar({ 2116 // Settings 2117 additionalMarginTop: Number(elemTop), 2118 additionalMarginBottom: Number(elemBottom) 2119 }); 2120 }); 2121 2122 }, 2123 copyToClipboard: function () { 2124 /*FA5 demo list #REMOVE THIS CODE*/ 2125 if ($(".icon-set-container").length > 0) { 2126 $(".icon-set-container .icon-class").each(function () { 2127 $(this).attr("id", $(this).text()); 2128 $(this).parent().attr("data-clipboard-target", $(this).text()); 2129 }); 2130 }; 2131 2132 $("[data-clipboard-target]").click(function () { 2133 var id = $(this).attr('data-clipboard-target'); 2134 var el = document.getElementById(id); 2135 var range = document.createRange(); 2136 range.selectNodeContents(el); 2137 var sel = window.getSelection(); 2138 sel.removeAllRanges(); 2139 sel.addRange(range); 2140 document.execCommand('copy'); 2141 INSPIRO.elements.notification("<b>" + sel + "</b>" + " is copied successfuly!", "success"); 2142 return false; 2143 }); 2144 2145 2146 } 2147 }; 2148 INSPIRO.widgets = { 2149 functions: function () { 2150 INSPIRO.widgets.twitter(); 2151 INSPIRO.widgets.flickr(); 2152 INSPIRO.widgets.contactForm(); 2153 INSPIRO.widgets.subscribeForm(); 2154 }, 2155 twitter: function () { 2156 2157 if (!$().twittie) { 2158 console.log('twitter: twittie plugin is missing.'); 2159 return true; 2160 } 2161 2162 var t = setTimeout(function () { 2163 if ($widget_twitter.length > 0) { 2164 $widget_twitter.each(function () { 2165 var $elem = $(this), 2166 twitterUsername = $elem.attr('data-username') || "ardianmusliu", 2167 twitterLimit = $elem.attr('data-limit') || 2, 2168 twitterDateFormat = $elem.attr('data-format') || '%b/%d/%Y', 2169 twitterLoadingText = $elem.attr('data-loading-text') || 'Loading...', 2170 twitterApiPAth = $elem.attr('data-loader') || "include/twitter/tweet.php", 2171 twitterAvatar = $elem.attr('data-avatar') || false; 2172 if (twitterAvatar == 'true') { 2173 twitterAvatar = "{{avatar}}"; 2174 } else { 2175 twitterAvatar = ""; 2176 }
2177 $elem.append('<div id="twitter-cnt"></div>') 2178 2179 $elem.find('#twitter-cnt').twittie({ 2180 'username': twitterUsername, 2181 'count': twitterLimit, 2182 'dateFormat': twitterDateFormat, 2183 'template': twitterAvatar + '{{tweet}}<small>{{date}}</small>', 2184 'apiPath': twitterApiPAth, 2185 'loadingText': twitterLoadingText 2186 }); 2187 }); 2188 } 2189 }, 2000); 2190 }, 2191 flickr: function () { 2192 if (!$().jflickrfeed) { 2193 console.log('flickr: jflickrfeed plugin is missing.'); 2194 return true; 2195 } 2196 if ($flickr_widget.length > 0) { 2197 $flickr_widget.each(function () { 2198 var elem = $(this), 2199 flickrId = elem.attr('data-flickr-id') || "52617155@N08", 2200 flickrImages = elem.attr('data-flickr-images') || "9"; 2201 2202 $flickr_widget.jflickrfeed({ 2203 limit: flickrImages, 2204 qstrings: { 2205 id: flickrId 2206 }, 2207 itemTemplate: '<a href="{{image}}" title="{{title}}"><img src="{{image_s}}" alt="{{title}}" /></a>' 2208 }, function () { 2209 var t = setTimeout(function () { 2210 elem.addClass('flickr-widget-loaded'); 2211 }, 1000); 2212 2213 elem.magnificPopup({ 2214 delegate: 'a', 2215 type: 'image', 2216 gallery: { 2217 enabled: true 2218 } 2219 }); 2220 }); 2221 }); 2222 } 2223 }, 2224 contactForm: function () { 2225 if (!$().validate) { 2226 console.log('contactForm: validate plugin is missing.'); 2227 return true; 2228 } 2229 if (!$().ajaxSubmit) { 2230 console.log('contactForm: ajaxSubmit plugin is missing.'); 2231 return true; 2232 } 2233 if (!$.notify) { 2234 console.log('contactForm: notify plugin is missing.'); 2235 return true; 2236 } 2237 if ($contactForm.length > 0) { 2238 2239 $contactForm.each(function () { 2240 var elem = $(this), 2241 elemSuccessMessage = elem.attr('data-success-message') || "We have <strong>successfully</strong> received your Message and will get Back to you as soon as possible."; 2242 2243 elem.validate({ 2244 submitHandler: function (form) { 2245 var button = $(form).find('button#form-submit'), 2246 buttonText = button.html(); 2247 2248 button.html('<i class="fa fa-refresh fa-spin"></i> Sending...'); 2249 2250 $(form).ajaxSubmit({ 2251 success: function (text) { 2252 if (text.response == 'success') { 2253 $.notify({ 2254 message: elemSuccessMessage 2255 }, { 2256 type: 'success' 2257 }); 2258 if ($(form).find('.g-recaptcha').children('div').length > 0) { 2259 grecaptcha.reset(); 2260 } 2261 $(form)[0].reset(); 2262 button.html(buttonText); 2263 2264 } else { 2265 $.notify({ 2266 message: elem.attr('data-error-message') || text.message 2267 }, { 2268 type: 'danger' 2269 }); 2270 var t = setTimeout(function () { 2271 button.html(buttonText); 2272 }, 1000); 2273 } 2274 } 2275 }); 2276 } 2277 }); 2278 }); 2279 } 2280 }, 2281 subscribeForm: function () { 2282 if (!$().validate) { 2283 console.log('subscribeForm: validate plugin is missing.'); 2284 return true; 2285 } 2286 if (!$().ajaxSubmit) { 2287 console.log('subscribeForm: ajaxSubmit plugin is missing.'); 2288 return true; 2289 } 2290 if (!$.notify) {
2291 console.log('subscribeForm: notify plugin is missing.'); 2292 return true; 2293 } 2294 if ($subscribeForm.length > 0) { 2295 2296 $subscribeForm.each(function () { 2297 var elem = $(this), 2298 elemSuccessMessage = elem.attr('success-message') || "You have successfully subscribed to our mailing list."; 2299 2300 elem.validate({ 2301 submitHandler: function (form) { 2302 var addonIcon = elem.find('.input-group-prepend'), 2303 addonIconText = addonIcon.html(); 2304 2305 addonIcon.html('<i class="fa fa-refresh fa-spin"></i>'); 2306 2307 $(form).ajaxSubmit({ 2308 dataType: 'json', 2309 success: function (text) { 2310 if (text.response == 'success') { 2311 $.notify({ 2312 message: elemSuccessMessage 2313 }, { 2314 type: 'success' 2315 }); 2316 $(form)[0].reset(); 2317 addonIcon.html(addonIconText); 2318 2319 } else { 2320 $.notify({ 2321 message: text.message 2322 }, { 2323 type: 'warning' 2324 }); 2325 addonIcon.html(addonIconText); 2326 } 2327 } 2328 }); 2329 } 2330 }); 2331 }); 2332 } 2333 }, 2334 }; 2335 2336 2337 INSPIRO.isMobile = { 2338 Android: function () { 2339 return navigator.userAgent.match(/Android/i); 2340 }, 2341 BlackBerry: function () { 2342 return navigator.userAgent.match(/BlackBerry/i); 2343 }, 2344 iOS: function () { 2345 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 2346 }, 2347 Opera: function () { 2348 return navigator.userAgent.match(/Opera Mini/i); 2349 }, 2350 Windows: function () { 2351 return navigator.userAgent.match(/IEMobile/i); 2352 }, 2353 any: function () { 2354 return (INSPIRO.isMobile.Android() || INSPIRO.isMobile.BlackBerry() || INSPIRO.isMobile.iOS() || INSPIRO.isMobile.Opera() || INSPIRO.isMobile.Windows()); 2355 } 2356 }; 2357 2358 //Document resize functions 2359 INSPIRO.documentOnResize = { 2360 functions: function () { 2361 INSPIRO.header.logoStatus(); 2362 INSPIRO.header.stickyHeader(); 2363 INSPIRO.core.screenSizeControl(); 2364 //INSPIRO.slider.sliderScreenSizeControl(); 2365 // INSPIRO.header.mainMenu(); 2366 INSPIRO.core.customHeight(); 2367 // INSPIRO.core.stickyFooter(); 2368 }, 2369 }; 2370 $window.on('resize', INSPIRO.documentOnResize.functions); 2371 2372 //Document ready functions 2373 INSPIRO.documentReady = { 2374 functions: function () { 2375 INSPIRO.core.pageLoader(); 2376 //INSPIRO.slider.sliderScreenSizeControl(); 2377 INSPIRO.core.functions(); 2378 INSPIRO.header.logoStatus(); 2379 INSPIRO.header.functions(); 2380 INSPIRO.slider.functions(); 2381 INSPIRO.elements.functions(); 2382 INSPIRO.widgets.functions(); 2383 }, 2384 }; 2385 $(document).ready(INSPIRO.documentReady.functions); 2386 2387 //Document on load functions 2388 INSPIRO.documentOnLoad = { 2389 functions: function () { 2390 2391 2392 2393 }, 2394 }; 2395 $(window).on('load', INSPIRO.documentOnLoad.functions); 2396 2397 //Document Scroll functions 2398 INSPIRO.documentScroll = { 2399 functions: function () { 2400 INSPIRO.header.logoStatus(); 2401 INSPIRO.header.stickyHeader(); 2402 INSPIRO.core.goToTop(); 2403 INSPIRO.header.dotsMenu(); 2404 INSPIRO.header.onepageMenu(); 2405 }, 2406 }; 2407 $window.on('scroll', INSPIRO.documentScroll.functions); 2408 2409 2410 2411 INSPIRO.lightBoxInspiro = function () { 2412 2413 if ($lightbox_image.length > 0) { 2414 $lightbox_image.magnificPopup({ 2415 type: 'image', 2416 removalDelay: 500, //delay removal by X to allow out-animation 2417 callbacks: { 2418 beforeOpen: function () { 2419 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 2420 this.st.mainClass = "mfp-zoom-out"; 2421 } 2422 }, 2423 }); 2424 } 2425 if ($lightbox_gallery.length > 0) { 2426 $lightbox_gallery.each(function () { 2427 $(this).magnificPopup({ 2428 delegate: 'a[data-lightbox="gallery-item"]', 2429 type: 'image', 2430 image: { 2431 verticalFit: true 2432 }, 2433 gallery: { 2434 enabled: true, 2435 navigateByImgClick: true, 2436 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 2437 }, 2438 removalDelay: 500, //delay removal by X to allow out-animation 2439 callbacks: { 2440 beforeOpen: function () { 2441 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 2442 this.st.mainClass = "mfp-zoom-out"; 2443 } 2444 }, 2445 }); 2446 }); 2447 } 2448 if ($lightbox_iframe.length > 0) { 2449 $lightbox_iframe.each(function () { 2450 $(this).magnificPopup({ 2451 type: 'iframe', 2452 removalDelay: 500, //delay removal by X to allow out-animation 2453 callbacks: { 2454 beforeOpen: function () { 2455 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 2456 this.st.mainClass = "mfp-zoom-out"; 2457 } 2458 }, 2459 }); 2460 }); 2461 } 2462 if ($lightbox_ajax.length > 0) { 2463 $lightbox_ajax.each(function () { 2464 $(this).magnificPopup({ 2465 type: 'ajax', 2466 removalDelay: 500, //delay removal by X to allow out-animation 2467 callbacks: { 2468 ajaxContentAdded: function (mfpResponse) { 2469 INSPIRO.lightBoxInspiro(); 2470 INSPIRO.slider.carouselAjax(); 2471 INSPIRO.elements.responsiveVideos(); 2472 INSPIRO.elements.accordion(); 2473 } 2474 } 2475 }); 2476 }); 2477 } 2478 if ($lightbox_inline.length > 0) { 2479 $lightbox_inline.magnificPopup({ 2480 type: 'inline', 2481 removalDelay: 500, //delay removal by X to allow out-animation 2482 callbacks: { 2483 beforeOpen: function () { 2484 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 2485 this.st.mainClass = "mfp-zoom-out"; 2486 } 2487 }, 2488 closeBtnInside: false, 2489 fixedContentPos: true, 2490 overflowY: 'scroll', 2491 }); 2492 } 2493 }; 2494 2495})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.