1var $j = jQuery.noConflict(); 2window.qode = {}; 3qode.modules = {}; 4 5var common = {}; 6qode.modules.common = common; 7 8var $scroll = 0; 9var qode_body = $j('body'); 10var qode_document = $j('document'); 11var qode_window = $j(window); 12var $window_width = $j(window).width(); 13qode.windowWidth = $window_width; 14var $window_height = $j(window).height(); 15qode.windowHeight = $window_height; 16var logo_height; 17var menu_dropdown_height_set = false; 18var sticky_amount = 0; 19var qode_grid_width = 1100; 20var content_menu_position; 21var content_menu_top; 22var content_menu_top_add = 0; 23var src; 24var next_image; 25var prev_image; 26var $top_header_height; 27 28var min_w = 1500; // minimum video width allowed 29var video_width_original = 1280; // original video dimensions 30var video_height_original = 720; 31var vid_ratio = 1280/720; 32var skrollr_slider; 33var paspartu_width; 34if(typeof paspartu_width_init == 'undefined'){ //check if variable is defined in default_dynamic.php (deafult_dynamic.js) 35 var paspartu_width_init = 0.02; 36} 37common.getLoadMoreData = getLoadMoreData; 38common.setLoadMoreAjaxData = setLoadMoreAjaxData; 39common.qodeOwlSlider = qodeOwlSlider; 40 41qode.animationEnd = animationEventEnd(); 42qode.transitionEnd = transitionEventEnd(); 43 44$j(document).ready(function() { 45 "use strict"; 46 47 if($j('header').hasClass('regular')){ 48 content_menu_top = 0; 49 } 50 if($j('header').hasClass('fixed_top_header')){ 51 content_menu_top = header_height; 52 } 53 if($j('header').hasClass('fixed')){ 54 content_menu_top = min_header_height_scroll; 55 } 56 if($j('header').hasClass('fixed_hiding')){ 57 content_menu_top = min_header_height_fixed_hidden + 40; //40 is top and bottom margin of logo 58 } 59 if($j('header').hasClass('stick') || $j('header').hasClass('stick_with_left_right_menu')){ 60 content_menu_top = 0; 61 } 62 if((!$j('header.page_header').hasClass('scroll_top')) && ($j('header.page_header').hasClass('has_top')) && ($j('header.page_header').hasClass('fixed'))){ 63 content_menu_top_add = 34; 64 } 65 if($j('body').hasClass('vertical_menu_enabled')){ 66 content_menu_top = 0; 67 content_menu_top_add = 0; 68 var min_header_height_sticky = 0; 69 } 70 71 //check paspartu width depending on window size 72 paspartu_width = $window_width < 1024 ? 0.02 : paspartu_width_init; 73 74 contentMinHeight(); 75 contentMinHeightWithPaspartu(); 76 qodeGridWidth(); 77 setDropDownMenuPosition(); 78 initDropDownMenu(); 79 initVerticalMenu(); 80 initVerticalMobileMenu(); 81 initQodeSlider(); 82 initSideMenu(); 83 initPopupMenu(); 84 initMessageHeight(); 85 initToCounter(); 86 initCounter(); 87 if(!$j('.vertical_split_slider').length){ 88 initCountdown(); 89 } 90 initProgressBars(); 91 initListAnimation(); 92 initPieChart(); 93 initPieChartWithIcon(); 94 initServiceAnimation(); 95 initParallaxTitle(); 96 initSideAreaScroll(); 97 initVerticalAreaMenuScroll(); 98 loadMore(); 99 prettyPhoto(); 100 initMobileMenu(); 101 initFlexSlider(); 102 fitVideo(); 103 fitAudio(); 104 initAccordion(); 105 initAccordionContentLink(); 106 qodeInitAccordions(); 107 initMessages(); 108 initProgressBarsIcon(); 109 initMoreFacts(); 110 placeholderReplace(); 111 backButtonShowHide(); 112 backToTop(); 113 initSteps(); 114 showGoogleMap(); 115 initProgressBarsVertical(); 116 initElementsAnimation(); 117 updateShoppingCart(); 118 initHashClick(); 119 initIconWithTextAnimation(); 120 initVideoBackground(); 121 initCheckSafariBrowser(); 122 initSearchButton(); 123 initCoverBoxes(); 124 createContentMenu(); 125 contentMenuScrollTo(); 126 createSelectContentMenu(); 127 initButtonHover(); 128 initEnlargeButton(); 129 initSocialIconHover(); 130 initPageTitleAnimation(); 131 initIconShortcodeHover(); 132 qodeIcon().init(); 133 initIconWithTextHover(); 134 parallaxLayers(); 135 initHorizontalMarquee(); 136 qodeHorizontalMarqueeLoop(); 137 initTextMarquee(); 138 initExpandingImages(); 139 qodeLazyImages(); 140 initItemShowcase(); 141 qodeCTASection().init(); 142 qodeInitInteractiveIconShowcase(); 143 qodeInitSendContactForm(); 144 qodeWorkflow(); 145 qodeCustomFontTypeOut(); 146 qodeMobileHeaderBehavior(); 147 initElementsHolderResponsiveStyle(); 148 149 $j('.widget #searchform').mousedown(function(){$j(this).addClass('form_focus');}).focusout(function(){$j(this).removeClass('form_focus');}); 150 $scroll = $j(window).scrollTop(); 151 checkTitleToShowOrHide(); //this has to be after setting $scroll since function uses $scroll variable 152 checkVerticalMenuTransparency(); //this has to be after setting $scroll since function uses $scroll variable 153 154 /* set header and content menu position and appearance on page load - START */ 155 if($j(window).width() > 1000){ 156 headerSize($scroll); 157 }else{ 158 logoSizeOnSmallScreens(); 159 } 160 161 if($j(window).width() > 768){ 162 contentMenuPosition(); 163 } 164 contentMenuCheckLastSection(); 165
166 $j('header:not(.stick_with_left_right_menu) .q_logo a').css('visibility','visible'); 167 /* set header and content menu position and appearance on page load - END */ 168 169 initFullScreenTemplate(); 170 showHideVerticalMenu(); 171 initMasonryGallery(); 172 initLoadNextPostOnBottom(); 173 initBlogMasonryGallery(); 174 initBlogGallery(); 175 qodeV2Button().init(); 176 qodeCardsSlider().init(); 177 qodeCardsGallery(); 178 qodeInitEllipticalSlider(); 179 qodeInitPricingCalculator(); 180 qodeSlidingImageHolder(); 181 qodeOwlSlider(); 182 qodeScrollingImage(); 183}); 184 185$j(window).on('load', function(){ 186 "use strict"; 187 188 qodeBrowserDetection(); 189 $j('.touchevents .main_menu li:has(div.second)').doubleTapToGo(); // load script to close menu on touch devices 190 setLeftPostionedMenuPadding(); 191 initSmallImageBlogHeight(); 192 setDropDownMenuPosition(); 193 initDropDownMenu(); 194 initPortfolio(); 195 initPortfolioZIndex(); 196 initPortfolioSingleInfo(); 197 initTestimonials(); 198 initTestimonialsCarousel(); 199 initVideoBackgroundSize(); 200 initBlog(); 201 initBlogMasonryFullWidth(); 202 initQBlog(); 203 initPortfolioJustifiedGallery(); 204 initPortfolioMasonry(); 205 initPortfolioMasonryFilter(); 206 initTabs(); 207 qodeInitAdvancedTabs(); 208 qodeInitAdvancedTabsIcons(); 209 countClientsPerRow(); 210 animatedTextIconHeight(); 211 countAnimatedTextIconPerRow(); 212 initTitleAreaAnimation(); 213 setContentBottomMargin(); 214 footerWidth(); 215 if($j('nav.content_menu').length > 0){ 216 content_menu_position = $j('nav.content_menu').offset().top; 217 contentMenuPosition(); 218 } 219 contentMenuCheckLastSection(); 220 initQodeCarousel(); 221 initPortfolioSlider(); 222 initBlogSlider(); 223 qodeInitBlogCarouselTitled(); 224 initPreviewSlider(); 225 initInDeviceSlider(); 226 initTabsActiveBorder(); 227 setActiveTabBorder(); 228 initImageHover(); 229 $j('header.stick_with_left_right_menu .q_logo a').css('visibility','visible'); 230 setMargingsForLeftAndRightMenu(); 231 initImageGallerySliderNoSpace(); 232 initVerticalSplitSlider(); 233 initParallax(); //has to be here on last place since some function is interfering with parallax 234 initQodeElementAnimationSkrollr(); 235 qodeBlogCompundMasonryGallery().init(); 236 qodeInitStickyWidget(); 237 qodeBlogHeadlines(); 238 qodeCardsSlider().load(); 239 initContentSlider(); 240 qodePageTransitionEffect(); 241 qodeContactPageAcceptance(); 242 setTimeout(function(){ 243 checkAnchorOnScroll(); 244 qodeBlogGalleryAnimation(); 245 checkAnchorOnLoad(); // it has to be after content top margin initialization to know where to scroll 246 checkHeaderStyleOnScroll(); //moved to window load because sections are not fully initialized on dom ready and calculations are wrong 247 if($j('.no-touchevents .carousel').length){skrollr_slider.refresh();} //in order to reload rest of scroll animation on same page after page loads 248 },700); //timeout is set because of some function that interferes with calculating 249 qodePanelArea(); 250 initDropDownAfterWPMLReplaceMenu(); 251}); 252 253$j(window).scroll(function() { 254 "use strict"; 255 256 $scroll = $j(window).scrollTop(); 257 258 if($j(window).width() > 1000){ 259 headerSize($scroll); 260 } 261 262 if($j(window).width() > 768){ 263 contentMenuPosition(); 264 } 265 contentMenuCheckLastSection(); 266 checkVerticalMenuTransparency(); 267 qodeLazyImages(); 268 269 $j('.touchevents .drop_down > ul > li').mouseleave(); 270 $j('.touchevents .drop_down > ul > li').blur(); 271}); 272 273$j(window).resize(function() { 274 "use strict"; 275 276 $window_width = $j(window).width(); 277 $window_height = $j(window).height(); 278 279 //check paspartu width depending on window size 280 paspartu_width = $window_width < 1024 ? 0.02 : paspartu_width_init; 281 282 if($j(window).width() > 1000){ 283 headerSize($scroll); 284 }else{ 285 logoSizeOnSmallScreens(); 286 } 287 initMessageHeight(); 288 qodeNumberOfTestimonialsItemsResize(); 289 fitAudio(); 290 initSmallImageBlogHeight(); 291 initBlog(); 292 initBlogMasonryFullWidth(); 293 initQBlog(); 294 animatedTextIconHeight(); 295 countAnimatedTextIconPerRow(); 296 initVideoBackgroundSize(); 297 countClientsPerRow(); 298 setContentBottomMargin(); 299 footerWidth(); 300 calculateHeights(); 301 $j('.vertical_split_slider').height($window_height); //used for vertical split slider holder 302 initMasonryGallery(); 303 initPortfolioMasonry(); 304 contentMinHeight(); 305 contentMinHeightWithPaspartu(); 306 qodeInitStickyWidget(); 307}); 308 309function getScrollAmountForStickyHeader(){
310 //is scroll amount for sticky set on page? 311 if(typeof qodeGlobalVars.vars.page_scroll_amount_for_sticky !== 'undefined' && qodeGlobalVars.vars.page_scroll_amount_for_sticky !== '') { 312 amount = qodeGlobalVars.vars.page_scroll_amount_for_sticky; 313 } 314 315 //do we have slider on the page? 316 else if($j('.carousel.full_screen').length) { 317 amount = $j('.carousel').height(); 318 } 319 320 //take value from theme options 321 else { 322 amount = scroll_amount_for_sticky; 323 } 324 325 return amount; 326} 327 328/* 329 * Browser detection 330 */ 331function qodeBrowserDetection() { 332 var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor), 333 isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor), 334 isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1, 335 isIE = window.navigator.userAgent.indexOf("MSIE "); 336 337 if (isChrome) { 338 qode_body.addClass('qode-chrome'); 339 } 340 if (isSafari) { 341 qode_body.addClass('qode-safari'); 342 } 343 if (isFirefox) { 344 qode_body.addClass('qode-firefox'); 345 } 346 if (isIE > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { 347 qode_body.addClass('qode-ms-explorer'); 348 } 349 if (/Edge\/\d./i.test(navigator.userAgent)) { 350 qode_body.addClass('qode-edge'); 351 } 352} 353 354/* 355** Calculating header size on page load and page scroll 356*/ 357var sticky_animate; 358function headerSize($scroll){ 359 "use strict"; 360 361 if(($j('header.page_header').hasClass('scroll_top')) && ($j('header.page_header').hasClass('has_top')) && 362 ($j('header.page_header').hasClass('fixed') || $j('header.page_header').hasClass('fixed_hiding'))){ 363 if($scroll >= 0 && $scroll <= 34){ 364 $j('header.page_header').css('top',-$scroll); 365 $j('header.page_header').css('margin-top',0); 366 $j('.header_top').show(); 367 }else if($scroll > 34){ 368 $j('header.page_header').css('top','-34px'); 369 $j('header.page_header').css('margin-top',34); 370 $j('.header_top').hide(); 371 } 372 } 373 374 sticky_amount = getScrollAmountForStickyHeader(); 375 376 377 if($j('header').hasClass('regular')){ 378// $j('header .drop_down .second').css('top', header_height + header_bottom_border_weight +'px'); 379 if(header_height - logo_height >= 10){ 380 $j('.q_logo a').height(logo_height); 381 }else{ 382 $j('.q_logo a').height(header_height - 10); 383 } 384 $j('.q_logo a img').css('height','100%'); 385 } 386 387 if($j('header.page_header').hasClass('fixed')){ 388 if($j('header.page_header').hasClass('scroll_top')){ 389 $top_header_height = 34; 390 }else{ 391 $top_header_height = 0; 392 } 393 394 if((header_height - $scroll + $top_header_height >= min_header_height_scroll) && ($scroll >= $top_header_height)){ 395 $j('header.page_header').removeClass('scrolled'); 396 $j('header:not(.centered_logo.centered_logo_animate) nav.main_menu > ul > li > a').css('line-height', header_height - $scroll + $top_header_height+'px'); 397// $j('header .drop_down .second').css('top', header_height + header_bottom_border_weight - ($scroll + $top_header_height)/8+'px'); 398 $j('header:not(.centered_logo.centered_logo_animate) .side_menu_button').css('height', header_height - $scroll + $top_header_height+'px'); 399 $j('header:not(.centered_logo.centered_logo_animate) .shopping_cart_inner').css('height', header_height - $scroll + $top_header_height+'px'); 400 $j('header:not(.centered_logo.centered_logo_animate) .header_bottom .qode-login-register-widget.qode-user-logged-in .qode-logged-in-user').css('height', header_height - $scroll + $top_header_height+'px'); 401 $j('header:not(.centered_logo.centered_logo_animate) .logo_wrapper').css('height', header_height - $scroll + $top_header_height +'px'); 402 if(header_height - logo_height > 0){ 403 $j('header:not(.centered_logo.centered_logo_animate) .q_logo a').css('height', logo_height +'px'); 404 }else{ 405 $j('header:not(.centered_logo.centered_logo_animate) .q_logo a').css('height', (header_height - $scroll + $top_header_height - 10) +'px'); 406 } 407 408 }else if($scroll < $top_header_height){ 409 $j('header.page_header').removeClass('scrolled'); 410 $j('header:not(.centered_logo.centered_logo_animate) nav.main_menu > ul > li > a').css('line-height', header_height+'px'); 411// $j('header .drop_down .second').css('top', header_height + header_bottom_border_weight +'px'); 412 $j('header:not(.centered_logo.centered_logo_animate) .side_menu_button').css('height', header_height+'px'); 413 $j('header:not(.centered_logo.centered_logo_animate) .shopping_cart_inner').css('height', header_height+'px'); 414 $j('header:not(.centered_logo.centered_logo_animate) .header_bottom .qode-login-register-widget.qode-user-logged-in .qode-logged-in-user').css('height', header_height+'px'); 415 $j('header:not(.centered_logo.centered_logo_animate) .logo_wrapper').css('height', header_height+'px'); 416 if(header_height - logo_height > 0){ 417 $j('header:not(.centered_logo.centered_logo_animate) .q_logo a').css('height', logo_height +'px'); 418 }else{ 419 $j('header:not(.centered_logo.centered_logo_animate) .q_logo a').css('height', (header_height-10)+'px'); 420 } 421 422 }else if((header_height - $scroll + $top_header_height) < min_header_height_scroll){ 423 $j('header.page_header').addClass('scrolled'); 424 $j('header:not(.centered_logo.centered_logo_animate) nav.main_menu > ul > li > a').css('line-height', min_header_height_scroll+'px'); 425// $j('header .drop_down .second').css('top', min_header_height_scroll + header_bottom_border_weight +'px'); 426 $j('header:not(.centered_logo.centered_logo_animate) .side_menu_button').css('height', min_header_height_scroll+'px'); 427 $j('header:not(.centered_logo.centered_logo_animate) .shopping_cart_inner').css('height', min_header_height_scroll+'px'); 428 $j('header:not(.centered_logo.centered_logo_animate) .header_bottom .qode-login-register-widget.qode-user-logged-in .qode-logged-in-user').css('height', min_header_height_scroll+'px'); 429 $j('header:not(.centered_logo.centered_logo_animate) .logo_wrapper').css('height', min_header_height_scroll+'px'); 430 if(min_header_height_scroll - logo_height > 0){ 431 $j('header:not(.centered_logo.centered_logo_animate) .q_logo a').css('height', logo_height +'px'); 432 }else{ 433 $j('header:not(.centered_logo.centered_logo_animate) .q_logo a').css('height', (min_header_height_scroll-10)+'px'); 434 } 435 } 436 437 // logo part - start // 438 439 if($j('header.page_header').hasClass('centered_logo') && $j('header.page_header').hasClass('centered_logo_animate')){ 440 if((header_height - $scroll + $top_header_height < logo_height) && (header_height - $scroll + $top_header_height >= min_header_height_scroll) && (logo_height > min_header_height_scroll - 10) && ($scroll >
440= $top_header_height)){ 441 $j('.q_logo a').height(header_height - $scroll + $top_header_height - 10); 442 }else if((header_height - $scroll + $top_header_height < logo_height) && (header_height - $scroll + $top_header_height >= min_header_height_scroll) && (logo_height > min_header_height_scroll - 10) && ($scroll < $top_header_height)){ 443 $j('.q_logo a').height(header_height - 10); 444 }else if((header_height - $scroll + $top_header_height < logo_height) && (header_height - $scroll + $top_header_height < min_header_height_scroll) && (logo_height > min_header_height_scroll - 10)){ 445 $j('.q_logo a').height(min_header_height_scroll - 10); 446 }else if((header_height - $scroll + $top_header_height < logo_height) && (header_height - $scroll + $top_header_height < min_header_height_scroll) && (logo_height < min_header_height_scroll - 10)){ 447 $j('.q_logo a').height(logo_height); 448 }else if(($scroll + $top_header_height === 0) && (logo_height > header_height - 10)){ 449 $j('.q_logo a').height(logo_height); 450 }else{ 451 $j('.q_logo a').height(logo_height); 452 } 453 }else if($j('header.page_header').hasClass('centered_logo')) { 454 $j('.q_logo a').height(logo_height); 455 $j('.q_logo img').height('auto'); 456 }else{ 457 $j('.q_logo img').height('100%'); 458 } 459 // logo part - end // 460 461 setLeftPostionedMenuPadding(); 462 } 463 464 if($j('header.page_header').hasClass('fixed_hiding')){ 465 466 if($scroll < scroll_amount_for_fixed_hiding){ 467 $j('header.page_header').removeClass('scrolled'); 468 }else{ 469 $j('header.page_header').addClass('scrolled'); 470 } 471 472 $j('.q_logo a').height(logo_height/2); //because of retina displays 473 $j('.q_logo img').height('100%'); 474 } 475 476 if($j('header.page_header').hasClass('stick') || $j('header.page_header').hasClass('stick_with_left_right_menu')){ 477 if($scroll > sticky_amount){ 478 if(!$j('header.page_header').hasClass('sticky')){ 479 if($j('header.page_header').hasClass('has_top')){ 480 $top_header_height = 34; 481 }else{ 482 $top_header_height = 0; 483 } 484 var padding_top = $j('header.page_header').hasClass('centered_logo') ? $j('header.page_header').height() : header_height + $top_header_height; 485 if($j('header.page_header').hasClass('menu_bottom')){ 486 padding_top = header_height + 60; //60 is menu height for Sticky Advance header type 487 } 488 $j('header.page_header').addClass('sticky'); 489 $j('.content').css('padding-top',padding_top); 490 491 window.clearTimeout(sticky_animate); 492 sticky_animate = window.setTimeout(function(){$j('header.page_header').addClass('sticky_animate'); },100); 493 494 495 if(min_header_height_sticky - logo_height >= 10){ 496 $j('.q_logo a').height(logo_height); 497 }else{ 498 $j('.q_logo a').height(min_header_height_sticky - 10); 499 } 500 501 if($j('header.page_header').hasClass('menu_bottom')){ 502 initDropDownMenu(); //recalculate dropdown menu position 503 } 504 } 505 506 // logo part - start // 507 if(min_header_height_sticky - logo_height >= 10){ 508 $j('.q_logo a').height(logo_height); 509 }else{ 510 $j('.q_logo a').height(min_header_height_sticky - 10); 511 } 512 // logo part - end // 513 514 515 }else{ 516 if($j('header.page_header').hasClass('sticky')){ 517 $j('header').removeClass('sticky_animate'); 518 $j('header').removeClass('sticky'); 519 $j('.content').css('padding-top','0px'); 520 521 if($j('header.page_header').hasClass('menu_bottom')){ 522 initDropDownMenu(); //recalculate dropdown menu position 523 } 524 } 525 526 setMargingsForLeftAndRightMenu(); //need to set margins here since on sticky menu, logo is not visible on left/right logo 527 528 // logo part - start // 529 if(!$j('header.page_header').hasClass('centered_logo')){ 530 if(header_height - logo_height >= 10){ 531 $j('.q_logo a').height(logo_height); 532 }else{ 533 $j('.q_logo a').height(header_height - 10); 534 } 535 }else{ 536 $j('.q_logo a').height(logo_height); 537 $j('.q_logo img').height('auto'); 538 } 539 $j('.q_logo a img').css('height','100%'); 540 // logo part - end // 541 542 543 } 544 545 setLeftPostionedMenuPadding(); 546 547 } 548} 549 550function qodeMobileHeaderBehavior() { 551 552 if($j('header').hasClass('sticky_mobile')){ 553 554 var mobileHeader = $j('.page_header'), 555 mobileMenuOpener = mobileHeader.find('.mobile_menu_button'), 556 mobileHeaderHeight = mobileHeader.outerHeight(); 557 558 559 var adminBarHeight = $j('#wpadminbar').length ? $j('#wpadminbar').height() : 0, 560 stickyAppearAmount = mobileHeaderHeight, 561 docYScroll1 = $scroll; 562 563 564 var behaviour = function(){ 565 mobileHeader.find('.header_inner').css('padding-top', 0); 566 if($window_width < 1000){ 567 var docYScroll2 = $scroll; 568 569 if (docYScroll2 > stickyAppearAmount) { 570 mobileHeader.addClass('qode-animate-mobile-header'); 571 $j('.content').css('padding-top', mobileHeaderHeight); 572 } else { 573 mobileHeader.removeClass('qode-animate-mobile-header'); 574 $j('.content').css('padding-top', 0); 575 } 576 577 if ((docYScroll2 > docYScroll1 && docYScroll2 >= stickyAppearAmount) || (docYScroll2 <= stickyAppearAmount)) { 578 mobileHeader.removeClass('mobile-header-appear'); 579 mobileHeader.find('.header_inner').css('padding-top', 0); 580 581 582 } else { 583 mobileHeader.addClass('mobile-header-appear'); 584 mobileHeader.find('.header_inner').css('padding-top', adminBarHeight); 585 } 586 587 docYScroll1 = $scroll; 588 } 589 } 590 591 qode_window.on('scroll resize', function(){ behaviour() }); 592 593 } 594} 595 596function setMargingsForLeftAndRightMenu(){ 597 "use strict"; 598
599 if($j('header.page_header').hasClass('stick_with_left_right_menu') && !$j('header.page_header').hasClass('left_right_margin_set')){ 600 var logo_width = $j('.q_logo a img').width()/2; 601 if($scroll == 0 && logo_width != 0){ 602 $j('header.page_header').addClass('left_right_margin_set'); 603 } 604 $j('.logo_wrapper').width(logo_width*2); 605 $j('nav.main_menu.left_side > ul > li:last-child').css('margin-right',logo_width); 606 $j('nav.main_menu.right_side > ul > li:first-child').css('margin-left',logo_width); 607 608 $j('.rtl nav.main_menu.left_side > ul > li:first-child').css('margin-right',logo_width); // add for rtl 609 $j('.rtl nav.main_menu.left_side > ul > li:last-child').css('margin-right',0); // add for rtl 610 $j('.rtl nav.main_menu.right_side > ul > li:last-child').css('margin-left',logo_width); // add for rtl 611 $j('.rtl nav.main_menu.right_side > ul > li:first-child').css('margin-left',0); // add for rtl 612 } 613} 614 615function setLeftPostionedMenuPadding(){ 616 "use strict"; 617 var main_menu = $j('header:not(.centered_logo) nav.main_menu'); 618 619 if(main_menu.length && main_menu.hasClass('left')){ 620 var image = $j('.q_logo a img').filter(function() { 621 return $j(this).css('opacity') == '1'; 622 }); 623 main_menu.css('left',image.width()); 624 } 625} 626 627/* 628** Calculating logo size on smaller screens 629*/ 630function logoSizeOnSmallScreens(){ 631 "use strict"; 632 // 100 is height of header on small screens 633 634 if((100 - 20 < logo_height)){ 635 $j('.q_logo a').height(100 - 20); 636 }else{ 637 $j('.q_logo a').height(logo_height); 638 } 639 $j('.q_logo a img').css('height','100%'); 640 641 $j('header.page_header').removeClass('sticky_animate sticky'); 642 $j('.content').css('padding-top','0px'); 643 644} 645 646/* 647 ** Calculating minimal height for content 648 */ 649function contentMinHeight(){ 650 "use strict"; 651 652 if($j('header .header_bottom').length || $j('header .bottom_header').length){ 653 if($j('header .header_bottom').length){ var headerColorString = $j('header .header_bottom').css('background-color'); } 654 if($j('header .bottom_header').length){ var headerColorString = $j('header .bottom_header').css('background-color'); } 655 var headerTransparency = headerColorString.substring(headerColorString.indexOf('(') + 1, headerColorString.lastIndexOf(')')).split(/,\s*/)[3]; 656 var haeder_add = headerTransparency == undefined && !$j('header.page_header').hasClass('transparent') ? $j('header.page_header').height() : 0; 657 $j('body .content').css('min-height',$window_height - haeder_add - $j('footer:not(.uncover)').height()); 658 } 659} 660 661/* 662 ** Calculating minimal height for content when paspartu is enabled 663 */ 664 665function contentMinHeightWithPaspartu(){ 666 "use strict"; 667 668 if ($j('.paspartu_enabled').length) { 669 var content_height; 670 var paspartu_final_width_px = 0; 671 var paspartu_width_px = $window_width*paspartu_width; 672 var footer_height = $j('footer').height(); 673 674 if ($j('.disable_footer').length){ 675 footer_height = 0; 676 } 677 678 if ($j('.vertical_menu_enabled').length){ 679 if ($j('.paspartu_top').length && $j('.paspartu_middle_inner').length){ 680 paspartu_final_width_px += paspartu_width_px; 681 } 682 } 683 else { 684 if ($j('.paspartu_top').length){ 685 paspartu_final_width_px += paspartu_width_px; 686 } 687 } 688 if ($j('.paspartu_bottom').length || !$j('.disable_bottom_paspartu').length){ 689 paspartu_final_width_px += paspartu_width_px; 690 } 691 692 if ($j('.vertical_menu_enabled').length){ 693 content_height = $window_height - paspartu_final_width_px - footer_height; 694 } 695 else { 696 if($j('header .header_bottom').length){ var headerColorString = $j('header .header_bottom').css('background-color'); } 697 if($j('header .bottom_header').length){ var headerColorString = $j('header .bottom_header').css('background-color'); } 698 if( typeof headerColorString !== 'undefined' ){ 699 var headerTransparency = headerColorString.substring(headerColorString.indexOf('(') + 1, headerColorString.lastIndexOf(')')).split(/,\s*/)[3]; 700 } 701 var header_height = headerTransparency == undefined && !$j('header.page_header').hasClass('transparent') ? $j('header.page_header').height() : 0; 702 content_height = $window_height - header_height - paspartu_final_width_px - footer_height; 703 } 704 705 if($j('.content').length){ 706 $j('.content').css('min-height',content_height); 707 } 708 } 709} 710 711/* 712** Initialize Qode Slider 713*/ 714var default_header_style; 715function initQodeSlider(){ 716 "use strict"; 717 718 var image_regex = /url\(["']?([^'")]+)['"]?\)/; 719 default_header_style = ""; 720 if($j('header.page_header').hasClass('light')){ default_header_style = 'light';} 721 if($j('header.page_header').hasClass('dark')){ default_header_style = 'dark';} 722 723 if($j('.carousel').length){ 724 725 var matrixArray = { zoom_center : '1.2, 0, 0, 1.2, 0, 0', zoom_top_left: '1.2, 0, 0, 1.2, -150, -150', zoom_top_right : '1.2, 0, 0, 1.2, 150, -150', zoom_bottom_left: '1.2, 0, 0, 1.2, -150, 150', zoom_bottom_right: '1.2, 0, 0, 1.2, 150, 150'}; 726 727 // Function for translating image in slide - START // 728 (function ($) { 729 // 730 // regular expression for parsing out the matrix 731 // components from the matrix string 732 // 733 var matrixRE = /\([0-9epx\.\, \t\-]+/gi; 734 735 // 736 // parses a matrix string of the form 737 // "matrix(n1,n2,n3,n4,n5,n6)" and 738 // returns an array with the matrix 739 // components 740 // 741 var parseMatrix = function (val) { 742 return val.match(matrixRE)[0].substr(1). 743 split(",").map(function (s) { 744 return parseFloat(s); 745 }); 746 }; 747 748 // 749 // transform css property names with vendor prefixes; 750 // the plugin will check for values in the order the 751 // names are listed here and return as soon as there 752 // is a value; so listing the W3 std name for the 753 // transform results in that being used if its available 754 // 755 var transformPropNames = [ 756 "transform", 757 "-webkit-transform" 758 ]; 759 760 var getTransformMatrix = function (el) { 761 // 762 // iterate through the css3 identifiers till we 763 // hit one that yields a value 764 // 765 var matrix = null; 766 transformPropNames.some(function (prop) { 767 matrix = el.css(prop); 768 return (matrix !== null && matrix !== ""); 769 }); 770 771 // 772 // if "none" then we supplant it with an identity matrix so 773 // that our parsing code below doesn't break 774 // 775 matrix = (!matrix || matrix === "none") ? 776 "matrix(1,0,0,1,0,0)" : matrix; 777 return parseMatrix(matrix); 778 }; 779 780 // 781 // set the given matrix transform on the element; note that we 782 // apply the css transforms in reverse order of how its given 783 // in "transformPropName" to ensure that the std compliant prop 784 // name shows up last 785 //
786 var setTransformMatrix = function (el, matrix) { 787 var m = "matrix(" + matrix.join(",") + ")"; 788 for (var i = transformPropNames.length - 1; i >= 0; --i) { 789 el.css(transformPropNames[i], m + ' rotate(0.01deg)'); 790 } 791 }; 792 793 // 794 // interpolates a value between a range given a percent 795 // 796 var interpolate = function (from, to, percent) { 797 return from + ((to - from) * (percent / 100)); 798 }; 799 800 $.fn.transformAnimate = function (opt) { 801 // 802 // extend the options passed in by caller 803 // 804 var options = { 805 transform: "matrix(1,0,0,1,0,0)" 806 }; 807 $.extend(options, opt); 808 809 // 810 // initialize our custom property on the element 811 // to track animation progress 812 // 813 this.css("percentAnim", 0); 814 815 // 816 // supplant "options.step" if it exists with our own 817 // routine 818 // 819 var sourceTransform = getTransformMatrix(this); 820 var targetTransform = parseMatrix(options.transform); 821 options.step = function (percentAnim, fx) { 822 // 823 // compute the interpolated transform matrix for 824 // the current animation progress 825 // 826 var $this = $(this); 827 var matrix = sourceTransform.map(function (c, i) { 828 return interpolate(c, targetTransform[i], 829 percentAnim); 830 }); 831 832 // 833 // apply the new matrix 834 // 835 setTransformMatrix($this, matrix); 836 837 // 838 // invoke caller's version of "step" if one 839 // was supplied; 840 // 841 if (opt.step) { 842 opt.step.apply(this, [matrix, fx]); 843 } 844 }; 845 846 // 847 // animate! 848 // 849 return this.stop().animate({ percentAnim: 100 }, options); 850 }; 851 })(jQuery); 852 // Function for translating image in slide - END // 853 854 $j('.carousel').each(function(){ 855 var $this = $j(this); 856 var mobile_header; 857 858 var mobile_header = $j(window).width() < 1000 ? $j('header.page_header').height() : 0; 859 var header_height_add_for_paspartu = $window_width > 1000 && !$j('header.page_header').hasClass('transparent') && $j('body.paspartu_on_top_fixed').length == 0 ? $j('header.page_header').height() : 0; 860 var paspartu_amount_with_top = $j('.paspartu_outer:not(.disable_top_paspartu)').length > 0 ? Math.round($window_width*paspartu_width + header_height_add_for_paspartu) : 0; 861 var paspartu_amount_with_bottom = $j('.paspartu_outer.paspartu_on_bottom_slider').length > 0 ? Math.round($window_width*paspartu_width) : 0; 862 var slider_graphic_coefficient; 863 var slider_title_coefficient; 864 var slider_subtitle_coefficient; 865 var slider_text_coefficient; 866 var slider_button_coefficient; 867 868 var responsive_breakpoint_set = [1300,1000,768]; 869 if($this.hasClass('advanced_responsiveness')){ 870 responsive_breakpoint_set = [1600,1200,900,650,500,320]; 871 if($this.data('q_responsive_breakpoints')){ 872 if($this.data('q_responsive_breakpoints') == 'set2'){ 873 responsive_breakpoint_set = [1600,1300,1000,768,567,320]; 874 } 875 } 876 877 var coefficients_graphic_array = $this.data('q_responsive_graphic_coefficients').split(','); 878 var coefficients_title_array = $this.data('q_responsive_title_coefficients').split(','); 879 var coefficients_subtitle_array = $this.data('q_responsive_subtitle_coefficients').split(','); 880 var coefficients_text_array = $this.data('q_responsive_text_coefficients').split(','); 881 var coefficients_button_array = $this.data('q_responsive_button_coefficients').split(','); 882 } 883 884 //calculate heights for slider holder and slide item, depending on size, but only if slider is set to be responsive and not full screen 885 function setSliderHeight($this, $def_height){ 886 var slider_height = $def_height; 887 888 if($this.hasClass('advanced_responsiveness')){ 889 //advanced responsiveness 890 if($window_width > responsive_breakpoint_set[0]){ 891 slider_height = $def_height; 892 }else if($window_width > responsive_breakpoint_set[1]){ 893 slider_height = $def_height * 0.75; 894 }else if($window_width > responsive_breakpoint_set[2]){ 895 slider_height = $def_height * 0.6; 896 }else if($window_width > responsive_breakpoint_set[3]){ 897 slider_height = $def_height * 0.55; 898 }else if($window_width <= responsive_breakpoint_set[3]){ 899 slider_height = $def_height * 0.45; 900 } 901 }else{ 902 //old way responsiveness 903 if($window_width > responsive_breakpoint_set[0]){ 904 slider_height = $def_height; 905 }else if($window_width > responsive_breakpoint_set[1]){ 906 slider_height = $def_height * 0.8; 907 }else if($window_width > responsive_breakpoint_set[2]){ 908 slider_height = $def_height * 0.7; 909 }else if($window_width <= responsive_breakpoint_set[2]){ 910 slider_height = $def_height * 1; 911 } 912 } 913
914 $this.css({'height': (slider_height) + 'px'}); 915 $this.find('.qode_slider_preloader').css({'height': (slider_height) + 'px'}); 916 $this.find('.qode_slider_preloader .ajax_loader').css({'display': 'block'}); 917 $this.find('.item').css({'height': (slider_height) + 'px'}); 918 } 919 920 function resetSliderHeight($def_height){ 921 $this.css({'height': ($def_height) + 'px'}); 922 $this.find('.qode_slider_preloader').css({'height': ($def_height) + 'px'}); 923 $this.find('.qode_slider_preloader .ajax_loader').css({'display': 'block'}); 924 $this.find('.item').css({'height': ($def_height) + 'px'}); 925 } 926 927 function setSliderInitialElementsSize($item,i){ 928 929 window["slider_graphic_width_" + i] = []; 930 window["slider_graphic_height_" + i] = []; 931 window["slider_svg_width_" + i] = []; 932 window["slider_svg_height_" + i] = []; 933 window["slider_title_" + i] = []; 934 window["slider_subtitle_" + i] = []; 935 window["slider_text_" + i] = []; 936 window["slider_button1_" + i] = []; 937 window["slider_button2_" + i] = []; 938 window["slider_separator_" + i] = []; 939 940 //graphic size 941 window["slider_graphic_width_" + i].push(parseFloat($item.find('.thumb img').data("width"))); 942 window["slider_graphic_height_" + i].push(parseFloat($item.find('.thumb img').data("height"))); 943 window["slider_svg_width_" + i].push(parseFloat($item.find('.qode_slide-svg-holder svg').attr("width"))); 944 window["slider_svg_height_" + i].push(parseFloat($item.find('.qode_slide-svg-holder svg').attr("height"))); 945 946 // font-size (0) 947 window["slider_title_" + i].push(parseFloat($item.find('.q_slide_title').css("font-size"))); 948 window["slider_subtitle_" + i].push(parseFloat($item.find('.q_slide_subtitle').css("font-size"))); 949 window["slider_text_" + i].push(parseFloat($item.find('.q_slide_text').css("font-size"))); 950 window["slider_button1_" + i].push(parseFloat($item.find('.qbutton:eq(0)').css("font-size"))); 951 window["slider_button2_" + i].push(parseFloat($item.find('.qbutton:eq(1)').css("font-size"))); 952 953 // line-height (1) 954 window["slider_title_" + i].push(parseFloat($item.find('.q_slide_title').css("line-height"))); 955 window["slider_subtitle_" + i].push(parseFloat($item.find('.q_slide_subtitle').css("line-height"))); 956 window["slider_text_" + i].push(parseFloat($item.find('.q_slide_text').css("line-height"))); 957 window["slider_button1_" + i].push(parseFloat($item.find('.qbutton:eq(0)').css("line-height"))); 958 window["slider_button2_" + i].push(parseFloat($item.find('.qbutton:eq(1)').css("line-height"))); 959 960 // letter-spacing (2) 961 window["slider_title_" + i].push(parseFloat($item.find('.q_slide_title').css("letter-spacing"))); 962 window["slider_subtitle_" + i].push(parseFloat($item.find('.q_slide_subtitle').css("letter-spacing"))); 963 window["slider_text_" + i].push(parseFloat($item.find('.q_slide_text').css("letter-spacing"))); 964 window["slider_button1_" + i].push(parseFloat($item.find('.qbutton:eq(0)').css("letter-spacing"))); 965 window["slider_button2_" + i].push(parseFloat($item.find('.qbutton:eq(1)').css("letter-spacing"))); 966 967 // margin-bottom (3) 968 window["slider_title_" + i].push(parseFloat($item.find('.q_slide_title').css("margin-bottom"))); 969 window["slider_subtitle_" + i].push(parseFloat($item.find('.q_slide_subtitle').css("margin-bottom"))); 970 971 // slider_button height(3), width(4), padding(5) 972 window["slider_button1_" + i].push(parseFloat($item.find('.qbutton:eq(0)').css("height"))); 973 window["slider_button2_" + i].push(parseFloat($item.find('.qbutton:eq(1)').css("height"))); 974 if(parseFloat($item.find('.qbutton:eq(0)').css("width")) != 0){ 975 window["slider_button1_" + i].push(parseFloat($item.find('.qbutton:eq(0)').css("width"))); 976 }else{ 977 window["slider_button1_" + i].push(0); 978 } 979 if(parseFloat($item.find('.qbutton:eq(1)').css("width")) != 0){ 980 window["slider_button2_" + i].push(parseFloat($item.find('.qbutton:eq(1)').css("width"))); 981 }else{ 982 window["slider_button2_" + i].push(0); 983 } 984 window["slider_button1_" + i].push(parseFloat($item.find('.qbutton:eq(0)').css("padding-left"))); 985 window["slider_button1_" + i].push(parseFloat($item.find('.qbutton:eq(0)').css("padding-right"))); 986 window["slider_button2_" + i].push(parseFloat($item.find('.qbutton:eq(1)').css("padding-left"))); 987 window["slider_button2_" + i].push(parseFloat($item.find('.qbutton:eq(1)').css("padding-right"))); 988 989 // margin separator, margin top(0), margin bottom(1) 990 window["slider_separator_" + i].push(parseFloat($item.find('.separator').
990css("margin-top"))); 991 window["slider_separator_" + i].push(parseFloat($item.find('.separator').css("margin-bottom"))); 992 993 } 994 995 //calculate size for slider title, subtitle and text, depending on window size 996 function setSliderElementsSize($item,i){ 997 if($window_width > responsive_breakpoint_set[0]) { 998 slider_graphic_coefficient = coefficients_graphic_array[0]; 999 slider_title_coefficient = coefficients_title_array[0]; 1000 slider_subtitle_coefficient = coefficients_subtitle_array[0]; 1001 slider_text_coefficient = coefficients_text_array[0]; 1002 slider_button_coefficient = coefficients_button_array[0]; 1003 }else if($window_width > responsive_breakpoint_set[1]){ 1004 slider_graphic_coefficient = coefficients_graphic_array[1]; 1005 slider_title_coefficient = coefficients_title_array[1]; 1006 slider_subtitle_coefficient = coefficients_subtitle_array[1]; 1007 slider_text_coefficient = coefficients_text_array[1]; 1008 slider_button_coefficient = coefficients_button_array[1]; 1009 }else if($window_width > responsive_breakpoint_set[2]){ 1010 slider_graphic_coefficient = coefficients_graphic_array[2]; 1011 slider_title_coefficient = coefficients_title_array[2]; 1012 slider_subtitle_coefficient = coefficients_subtitle_array[2]; 1013 slider_text_coefficient = coefficients_text_array[2]; 1014 slider_button_coefficient = coefficients_button_array[2]; 1015 }else if($window_width > responsive_breakpoint_set[3]){ 1016 slider_graphic_coefficient = coefficients_graphic_array[3]; 1017 slider_title_coefficient = coefficients_title_array[3]; 1018 slider_subtitle_coefficient = coefficients_subtitle_array[3]; 1019 slider_text_coefficient = coefficients_text_array[3]; 1020 slider_button_coefficient = coefficients_button_array[3]; 1021 }else if ($window_width > responsive_breakpoint_set[4]) { 1022 slider_graphic_coefficient = coefficients_graphic_array[4]; 1023 slider_title_coefficient = coefficients_title_array[4]; 1024 slider_subtitle_coefficient = coefficients_subtitle_array[4]; 1025 slider_text_coefficient = coefficients_text_array[4]; 1026 slider_button_coefficient = coefficients_button_array[4]; 1027 }else if ($window_width > responsive_breakpoint_set[5]){ 1028 slider_graphic_coefficient = coefficients_graphic_array[5]; 1029 slider_title_coefficient = coefficients_title_array[5]; 1030 slider_subtitle_coefficient = coefficients_subtitle_array[5]; 1031 slider_text_coefficient = coefficients_text_array[5]; 1032 slider_button_coefficient = coefficients_button_array[5]; 1033 } 1034 else{ 1035 slider_graphic_coefficient = coefficients_graphic_array[6]; 1036 slider_title_coefficient = coefficients_title_array[6]; 1037 slider_subtitle_coefficient = coefficients_subtitle_array[6]; 1038 slider_text_coefficient = coefficients_text_array[6]; 1039 slider_button_coefficient = coefficients_button_array[6]; 1040 } 1041 1042 // letter-spacing decrease quicker 1043 var slider_title_coefficient_letter_spacing = slider_title_coefficient; 1044 var slider_subtitle_coefficient_letter_spacing = slider_subtitle_coefficient; 1045 var slider_text_coefficient_letter_spacing = slider_text_coefficient; 1046 if($window_width <= responsive_breakpoint_set[0]) { 1047 slider_title_coefficient_letter_spacing = slider_title_coefficient/2; 1048 slider_subtitle_coefficient_letter_spacing = slider_subtitle_coefficient/2; 1049 slider_text_coefficient_letter_spacing = slider_text_coefficient/2; 1050 } 1051 1052 $item.find('.thumb').css({"width": Math.round(window["slider_graphic_width_" + i][0]*slider_graphic_coefficient) + 'px'}).css({"height": Math.round(window["slider_graphic_height_" + i][0]*slider_graphic_coefficient) + 'px'}); 1053 $item.find('.qode_slide-svg-holder svg').css({"width": Math.round(window["slider_svg_width_" + i][0]*slider_graphic_coefficient) + 'px'}).css({"height": Math.round(window["slider_svg_height_" + i][0]*slider_graphic_coefficient) + 'px'}); 1054 1055 $item.find('.q_slide_title').css({"font-size": Math.round(window["slider_title_" + i][0]*slider_title_coefficient) + 'px'}); 1056 $item.find('.q_slide_title').css({"line-height": Math.round(window["slider_title_" + i][1]*slider_title_coefficient) + 'px'}); 1057 $item.find('.q_slide_title').css({"letter-spacing": Math.round(window["slider_title_" + i][2]*slider_title_coefficient_letter_spacing) + 'px'}); 1058 $item.find('.q_slide_title').css({"margin-bottom": Math.round(window["slider_title_" + i][3]*slider_title_coefficient) + 'px'}); 1059 1060 $item.find('.q_slide_subtitle').css({"font-size": Math.round(window["slider_subtitle_" + i][0]*slider_subtitle_coefficient) + 'px'}); 1061 $item.find('.q_slide_subtitle').css({"line-height": Math.round(window["slider_subtitle_" + i][1]*slider_subtitle_coefficient) + 'px'}); 1062 $item.find('.q_slide_subtitle').css({"letter-spacing": Math.round(window["slider_subtitle_" + i][2]*slider_subtitle_coefficient_letter_spacing) + 'px'}); 1063 $item.find('.q_slide_subtitle').css({"margin-bottom": Math.round(window["slider_subtitle_" + i][3]*slider_subtitle_coefficient) + 'px'}); 1064 1065 $item.find('.q_slide_text').css({"font-size": Math.round(window["slider_text_" + i][0]*slider_text_coefficient) + 'px'}); 1066 $item.find('.q_slide_text').css({"line-height": Math.round(window["slider_text_" + i][1]*slider_text_coefficient) + 'px'}); 1067 $item.find('.q_slide_text').css({"letter-spacing": Math.round(window["slider_text_" + i][2]*slider_text_coefficient_letter_spacing) + 'px'}); 1068 1069 $item.find('.qbutton:eq(0)').css({"font-size": Math.round(window["slider_button1_" + i][0]*slider_button_coefficient) + 'px'}); 1070 $item.find('.qbutton:eq(1)').css({"font-size": Math.round(window["slider_button2_" + i][0]*slider_button_coefficient) + 'px'}); 1071 $item.find('.qbutton:eq(0)').css({"line-height": Math.round(window["slider_button1_" + i][1]*slider_button_coefficient) + 'px'}); 1072 $item.find('.qbutton:eq(1)').css({"line-height": Math.round(window["slider_button2_" + i][1]*slider_button_coefficient) + 'px'}); 1073 $item.find('.qbutton:eq(0)').css({"letter-spacing": Math.round(window["slider_button1_" + i][2]*slider_button_coefficient) + 'px'}); 1074 $item.find('.qbutton:eq(1)').css({"letter-spacing": Math.round(window["slider_button2_" + i][2]*slider_button_coefficient) + 'px'}); 1075 $item.find('.qbutton:eq(0)').css({"height": Math.round(window["slider_button1_" + i][3]*slider_button_coefficient) + 'px'}); 1076 $item.find('.qbutton:eq(1)').css({"height": Math.round(window["slider_button2_" + i][3]*slider_button_coefficient) + 'px'}); 1077 if(window["slider_button1_" + i][4] != 0) { 1078 $item.find('.qbutton:eq(0)').css({"width": Math.round(window["slider_button1_" + i][4]*slider_button_coefficient) + 'px'}); 1079 }else{ 1080 $item.find('.qbutton:eq(0)').css({"width": 'auto'}); 1081 } 1082 if(window["slider_button2_" + i][4] != 0) { 1083 $item.find('.qbutton:eq(1)').css({"width": Math.round(window["slider_button2_" + i][4]*slider_button_coefficient) + 'px'}); 1084 }else{ 1085 $item.find('.qbutton:eq(1)').css({"width": 'auto'}); 1086 } 1087 $item.find('.qbutton:eq(0)').css({"padding-left": Math.round(window["slider_button1_" + i][5]*slider_button_coefficient) + 'px'}); 1088 $item.find('.qbutton:eq(1)').css({"padding-left": Math.round(window["slider_button2_" + i][5]*slider_button_coefficient) + 'px'}); 1089 $item.find('.qbutton:eq(0)').css({"padding-right": Math.round(window["slider_button1_" + i][6]*slider_button_coefficient) + 'px'}); 1090 $item.find('.qbutton:eq(1)').css({"padding-right": Math.round(window["slider_button2_" + i][6]*slider_button_coefficient) + 'px'}); 1091
1092 $item.find('.separator').css({"margin-top": Math.round(window["slider_separator_" + i][0]*slider_title_coefficient) + 'px'}); 1093 $item.find('.separator').css({"margin-bottom": Math.round(window["slider_separator_" + i][1]*slider_title_coefficient) + 'px'}); 1094 1095 } 1096 1097 function resetSliderElementsSize($item,i){ 1098 $item.find('.thumb').css({"width": Math.round(window["slider_graphic_width_" + i][0]) + 'px'}).css({"height": Math.round(window["slider_graphic_height_" + i][0]) + 'px'}); 1099 $item.find('.qode_slide-svg-holder svg').css({"width": Math.round(window["slider_svg_width_" + i][0]) + 'px'}).css({"height": Math.round(window["slider_svg_height_" + i][0]) + 'px'}); 1100 1101 $item.find('.q_slide_title').css({"font-size": Math.round(window["slider_title_" + i][0]) + 'px'}); 1102 $item.find('.q_slide_title').css({"line-height": Math.round(window["slider_title_" + i][1]) + 'px'}); 1103 $item.find('.q_slide_title').css({"letter-spacing": Math.round(window["slider_title_" + i][2]) + 'px'}); 1104 $item.find('.q_slide_title').css({"margin-bottom": Math.round(window["slider_title_" + i][3]) + 'px'}); 1105 1106 $item.find('.q_slide_subtitle').css({"font-size": Math.round(window["slider_subtitle_" + i][0]) + 'px'}); 1107 $item.find('.q_slide_subtitle').css({"line-height": Math.round(window["slider_subtitle_" + i][1]) + 'px'}); 1108 $item.find('.q_slide_subtitle').css({"letter-spacing": Math.round(window["slider_subtitle_" + i][2]) + 'px'}); 1109 $item.find('.q_slide_subtitle').css({"margin-bottom": Math.round(window["slider_subtitle_" + i][3]) + 'px'}); 1110 1111 $item.find('.q_slide_text').css({"font-size": Math.round(window["slider_text_" + i][0]) + 'px'}); 1112 $item.find('.q_slide_text').css({"line-height": Math.round(window["slider_text_" + i][1]) + 'px'}); 1113 $item.find('.q_slide_text').css({"letter-spacing": Math.round(window["slider_text_" + i][2]) + 'px'}); 1114 1115 $item.find('.qbutton:eq(0)').css({"font-size": Math.round(window["slider_button1_" + i][0]) + 'px'}); 1116 $item.find('.qbutton:eq(1)').css({"font-size": Math.round(window["slider_button2_" + i][0]) + 'px'}); 1117 $item.find('.qbutton:eq(0)').css({"line-height": Math.round(window["slider_button1_" + i][1]) + 'px'}); 1118 $item.find('.qbutton:eq(1)').css({"line-height": Math.round(window["slider_button2_" + i][1]) + 'px'}); 1119 $item.find('.qbutton:eq(0)').css({"letter-spacing": Math.round(window["slider_button1_" + i][2]) + 'px'}); 1120 $item.find('.qbutton:eq(1)').css({"letter-spacing": Math.round(window["slider_button2_" + i][2]) + 'px'}); 1121 $item.find('.qbutton:eq(0)').css({"height": Math.round(window["slider_button1_" + i][3]) + 'px'}); 1122 $item.find('.qbutton:eq(1)').css({"height": Math.round(window["slider_button2_" + i][3]) + 'px'}); 1123 if(window["slider_button1_" + i][4] != 0) { 1124 $item.find('.qbutton:eq(0)').css({"width": Math.round(window["slider_button1_" + i][4]) + 'px'}); 1125 }else{ 1126 $item.find('.qbutton:eq(0)').css({"width": 'auto'}); 1127 } 1128 if(window["slider_button2_" + i][4] != 0) { 1129 $item.find('.qbutton:eq(1)').css({"width": Math.round(window["slider_button2_" + i][4]) + 'px'}); 1130 }else{ 1131 $item.find('.qbutton:eq(1)').css({"width": 'auto'}); 1132 } 1133 $item.find('.qbutton:eq(0)').css({"padding-left": Math.round(window["slider_button1_" + i][5]) + 'px'}); 1134 $item.find('.qbutton:eq(1)').css({"padding-left": Math.round(window["slider_button2_" + i][5]) + 'px'}); 1135 $item.find('.qbutton:eq(0)').css({"padding-right": Math.round(window["slider_button1_" + i][6]) + 'px'}); 1136 $item.find('.qbutton:eq(1)').css({"padding-right": Math.round(window["slider_button2_" + i][6]) + 'px'}); 1137
1138 $item.find('.separator').css({"margin-top": Math.round(window["slider_separator_" + i][0]) + 'px'}); 1139 $item.find('.separator').css({"margin-bottom": Math.round(window["slider_separator_" + i][1]) + 'px'}); 1140 1141 } 1142 1143 if($this.hasClass('full_screen')){ 1144 $this.css({'height': ($j(window).height() - mobile_header - paspartu_amount_with_top - paspartu_amount_with_bottom) + 'px'}); 1145 $this.find('.qode_slider_preloader').css({'height': ($j(window).height() - mobile_header - paspartu_amount_with_top - paspartu_amount_with_bottom) + 'px'}); 1146 $this.find('.qode_slider_preloader .ajax_loader').css({'display': 'block'}); 1147 $this.find('.item').css({'height': ($j(window).height() - mobile_header - paspartu_amount_with_top - paspartu_amount_with_bottom) + 'px'}); 1148 1149 if($j('.paspartu_outer:not(.disable_top_paspartu)').length){ 1150 if(!$j('body').hasClass('paspartu_on_top_fixed')){ 1151 $this.closest('.q_slider').css('padding-top', Math.round(header_height_add_for_paspartu + $window_width * paspartu_width)); 1152 } 1153 } 1154 1155 if($j('.paspartu_outer.paspartu_on_bottom_slider').length){ 1156 $this.closest('.q_slider').css('padding-bottom', Math.round($window_width * paspartu_width)); 1157 } 1158 1159 $j(window).resize(function() { 1160 mobile_header = $j(window).width() < 1000 ? $j('header.page_header').height() : 0; 1161 header_height_add_for_paspartu = $window_width > 1000 && !$j('header.page_header').hasClass('transparent') && $j('body.paspartu_on_top_fixed').length == 0 ? $j('header.page_header').height() : 0; 1162 paspartu_amount_with_top = $j('.paspartu_outer:not(.disable_top_paspartu)').length > 0 ? Math.round($window_width*paspartu_width + header_height_add_for_paspartu) : 0; 1163 paspartu_amount_with_bottom = $j('.paspartu_outer.paspartu_on_bottom_slider').length > 0 ? Math.round($window_width*paspartu_width) : 0; 1164 $this.css({'height': ($j(window).height() - mobile_header - paspartu_amount_with_top - paspartu_amount_with_bottom) + 'px'}); 1165 $this.find('.qode_slider_preloader .ajax_loader').css({'display': 'block'}); 1166 $this.find('.item').css({'height': ($j(window).height() - mobile_header - paspartu_amount_with_top - paspartu_amount_with_bottom) + 'px'}); 1167 1168 if($j('.paspartu_outer:not(.disable_top_paspartu)').length){ 1169 if(!$j('body').hasClass('paspartu_on_top_fixed')){ 1170 $this.closest('.q_slider').css('padding-top', Math.round(header_height_add_for_paspartu + $window_width * paspartu_width)); 1171 } 1172 } 1173 if($j('.paspartu_outer.paspartu_on_bottom_slider').length){ 1174 $this.closest('.q_slider').css('padding-bottom', Math.round($window_width * paspartu_width)); 1175 } 1176 1177 if($this.hasClass('advanced_responsiveness')){ 1178 $this.find('.item').each(function(i){ 1179 setSliderElementsSize($j(this),i); 1180 }); 1181 } 1182 }); 1183 }else if($this.hasClass('responsive_height')){ 1184 var $def_height = $this.data('height'); 1185 1186 $this.find('.qode_slider_preloader').css({'height': ($this.height() - mobile_header - paspartu_amount_with_top - paspartu_amount_with_bottom) + 'px', 'display': 'block'}); 1187 if($j('.paspartu_outer:not(.disable_top_paspartu)').length){ 1188 if(!$j('body').hasClass('paspartu_on_top_fixed')){ 1189 $this.closest('.q_slider').css('padding-top', Math.round(header_height_add_for_paspartu + $window_width * paspartu_width)); 1190 } 1191 } 1192 if($j('.paspartu_outer.paspartu_on_bottom_slider').length){ 1193 $this.closest('.q_slider').css('padding-bottom', Math.round($window_width * paspartu_width)); 1194 } 1195 1196 setSliderHeight($this, $def_height); 1197 1198 $j(window).resize(function() { 1199 if($j('.paspartu_outer:not(.disable_top_paspartu)').length){ 1200 header_height_add_for_paspartu = $window_width > 1000 && !$j('header.page_header').hasClass('transparent') ? $j('header.page_header').height() : 0; 1201 if(!$j('body').hasClass('paspartu_on_top_fixed')){ 1202 $this.closest('.q_slider').css('padding-top', Math.round(header_height_add_for_paspartu + $window_width * paspartu_width)); 1203 } 1204 } 1205 if($j('.paspartu_outer.paspartu_on_bottom_slider').length){ 1206 $this.closest('.q_slider').css('padding-bottom', Math.round($window_width * paspartu_width)); 1207 } 1208 1209 setSliderHeight($this, $def_height); 1210 if($this.hasClass('advanced_responsiveness')){ 1211 $this.find('.item').each(function(i){ 1212 setSliderElementsSize($j(this),i); 1213 }); 1214 } 1215 }); 1216 }else { 1217 $this.find('.qode_slider_preloader').css({'height': ($this.height() - mobile_header) + 'px', 'display': 'block'}); 1218 $this.find('.qode_slider_preloader .ajax_loader').css({'display': 'block'}); 1219 if($j('.paspartu_outer:not(.disable_top_paspartu)').length){ 1220 if(!$j('body').hasClass('paspartu_on_top_fixed')){ 1221 $this.closest('.q_slider').css('padding-top', Math.round(header_height_add_for_paspartu + $window_width * paspartu_width)); 1222 } 1223 } 1224 if($j('.paspartu_outer.paspartu_on_bottom_slider').length){ 1225 $this.closest('.q_slider').css('padding-bottom', Math.round($window_width * paspartu_width)); 1226 } 1227 1228 if($this.hasClass('advanced_responsiveness')){ 1229 $this.find('.item').each(function(i){ 1230 setSliderInitialElementsSize($j(this),i); 1231 setSliderElementsSize($j(this),i); 1232 }); 1233 } 1234 $window_width < 1000 ? setSliderHeight($this, $def_height) : resetSliderHeight($def_height); 1235 1236 $j(window).resize(function() { 1237 if($j('.paspartu_outer:not(.disable_top_paspartu)').length){ 1238 header_height_add_for_paspartu = $window_width > 1000 && !$j('header.page_header').hasClass('transparent') ? $j('header.page_header').height() : 0; 1239 if(!$j('body').hasClass('paspartu_on_top_fixed')){ 1240 $this.closest('.q_slider').css('padding-top', Math.round(header_height_add_for_paspartu + $window_width * paspartu_width)); 1241 } 1242 } 1243 if($j('.paspartu_outer.paspartu_on_bottom_slider').length){ 1244 $this.closest('.q_slider').css('padding-bottom', Math.round($window_width * paspartu_width)); 1245 } 1246 1247 if($window_width < 1000){ 1248 setSliderHeight($this, $def_height); 1249 if($this.hasClass('advanced_responsiveness')){ 1250 $this.find('.item').each(function(i){ 1251 setSliderElementsSize($j(this),i); 1252 }); 1253 } 1254 }else{ 1255 resetSliderHeight($def_height); 1256 if($this.hasClass('advanced_responsiveness')){ 1257 $this.find('.item').each(function(i){ 1258 resetSliderElementsSize($j(this),i); 1259 }); 1260 } 1261 } 1262 }); 1263 } 1264 1265 if($j('body:not(.boxed):not(.vertical_menu_transparency):not(.vertical_menu_hidden):not(.page-template-landing_page-php)').hasClass('vertical_menu_enabled') && $j(window).width() > 1000){ 1266 var paspartu_add = $j('body').hasClass('paspartu_enabled') ? 2*Math.round($window_width*paspartu_width) : 0; //2 times paspartu (left and right side) 1267 $this.find('.carousel-inner').width($window_width - 260 - paspartu_add); 1268 $j(window).resize(function() { 1269 if($j(window).width() > 1000){ 1270 paspartu_add = $j('body').hasClass('paspartu_enabled') ? 2*Math.round($window_width*paspartu_width) : 0; //2 times paspartu (left and right side) 1271 $this.find('.carousel-inner').width($window_width - 260 - paspartu_add); 1272 } else { 1273 $this.find('.carousel-inner').css('width','100%'); 1274 } 1275 }); 1276 } 1277 1278 if($j('body:not(.boxed):not(.vertical_menu_transparency):not(.page-template-landing_page-php)').hasClass('vertical_menu_hidden') && $window_width > 1000){ 1279 var paspartu_add = $j('body').hasClass('paspartu_enabled') ? 2*Math.round($window_width*paspartu_width) : 0; //2 times paspartu (left and right side) 1280 $this.find('.carousel-inner').width($window_width - 40 - paspartu_add); 1281 $j(window).resize(function() { 1282 if($j(window).width() > 1000){ 1283 paspartu_add = $j('body').hasClass('paspartu_enabled') ? 2*Math.round($window_width*paspartu_width) : 0; //2 times paspartu (left and right side) 1284 $this.find('.carousel-inner').width($window_width - 40 - paspartu_add); 1285 } else { 1286 $this.find('.carousel-inner').css('width','100%'); 1287 } 1288 }); 1289 } 1290 1291 $j(window).scroll(function() { 1292 if($scroll > ($this.height()+$j('header.page_header').height()) && $j(window).width() > 1000){ 1293 $this.find('.carousel-inner, .carousel-indicators, button').hide(); 1294 }else{ 1295 $this.find('.carousel-inner, .carousel-indicators, button').show(); 1296 } 1297 }); 1298 1299 var $slide_animation = $this.data('slide_animation'); 1300 if($slide_animation === ""){ 1301 $slide_animation = 6000; 1302 } 1303 1304 // function for setting prev/next numbers on arrows 1305 var all_items_count = $j('div.item').length; 1306 function setPrevNextNumbers(curr_item, all_items_count){ 1307 if(curr_item == 1){ 1308 $this.find('.left.carousel-control .prev').html(all_items_count); 1309 $this.find('.right.carousel-control .next').html(curr_item + 1); 1310 }else if(curr_item == all_items_count){ 1311 $this.find('.left.carousel-control .prev').html(curr_item - 1); 1312 $this.find('.right.carousel-control .next').html(1); 1313 }else{ 1314 $this.find('.left.carousel-control .prev').html(curr_item - 1); 1315 $this.find('.right.carousel-control .next').html(curr_item + 1); 1316 } 1317 } 1318 1319 function initSlider(){ 1320 //set active class on first item 1321 $this.find('.carousel-inner .item:first-child').addClass('active'); 1322 checkSliderForHeaderStyle($j('.carousel .active'), $this.hasClass('header_effect')); 1323 1324 if($this.hasClass('slider_thumbs')){ 1325 // initial state of prev/next numbers 1326 setPrevNextNumbers(1, all_items_count); 1327 1328 //set prev and next thumb on load 1329 if($this.find('.active').next('div').find('.image').length){ 1330 src = image_regex.exec($this.find('.active').next('div').find('.image').attr('style')); 1331 next_image = new Image(); 1332 next_image.src = src[1]; 1333 }else{ 1334 next_image = $this.find('.active').next('div').find('> .video').clone(); 1335 next_image.find('.video-overlay').remove(); 1336 next_image.find('.video-wrap').width(170).height(95); 1337 next_image.find('.mejs-container').width(170).height(95); 1338 next_image.find('video').width(170).height(95); 1339 } 1340 $this.find('.right.carousel-control .img').html(next_image).find('img, div.video').addClass('old'); 1341 1342 if($this.find('.carousel-inner .item:last-child .image').length){ 1343 src = image_regex.exec($this.find('.carousel-inner .item:last-child .image').attr('style')); 1344 prev_image = new Image(); 1345 prev_image.src = src[1]; 1346 }else{ 1347 prev_image = $this.find('.carousel-inner .item:last-child > .video').clone(); 1348 prev_image.find('.video-overlay').remove(); 1349 prev_image.find('.video-wrap').width(170).height(95); 1350 prev_image.find('.mejs-container').width(170).height(95); 1351 prev_image.find('video').width(170).height(95); 1352 } 1353 $this.find('.left.carousel-control .img').html(prev_image).find('img, div.video').addClass('old'); 1354 } 1355 1356 if($this.hasClass('q_auto_start')){ 1357 $this.carousel({ 1358 interval: $slide_animation, 1359 pause: false 1360 }); 1361 } else { 1362 $this.carousel({ 1363 interval: 0, 1364 pause: false 1365 }); 1366 } 1367 if($this.find('.item video').length){
1368 initVideoBackgroundSize(); 1369 } 1370 1371 if($this.hasClass('advanced_responsiveness') && ($this.hasClass('responsive_height') || $this.hasClass('full_screen'))){ 1372 $this.find('.item').each(function (i) { 1373 setSliderInitialElementsSize($j(this), i); 1374 setSliderElementsSize($j(this), i); 1375 }); 1376 } 1377 1378 //initiate image animation 1379 if($j('.carousel-inner .item:first-child').hasClass('animate_image') && $window_width > 1000){ 1380 $this.find('.carousel-inner .item.animate_image:first-child .image').transformAnimate({ 1381 transform: "matrix("+matrixArray[$j('.carousel-inner .item:first-child').data('animate_image')]+")", 1382 duration: 30000 1383 }); 1384 } 1385 } 1386 1387 if($j('html').hasClass('touch')){ 1388 if($this.find('.item:first-child .mobile-video-image').length > 0){ 1389 src = image_regex.exec($this.find('.item:first-child .mobile-video-image').attr('style')); 1390 if (src) { 1391 var backImg = new Image(); 1392 backImg.src = src[1]; 1393 $j(backImg).on('load', function(){ 1394 $j('.qode_slider_preloader').fadeOut(500); 1395 initSlider(); 1396 checkSVG($this); 1397 }); 1398 } 1399 } 1400 else{ 1401 src = image_regex.exec($this.find('.item:first-child .image').attr('style')); 1402 if (src) { 1403 var backImg = new Image(); 1404 backImg.src = src[1]; 1405 $j(backImg).on('load', function(){ 1406 $j('.qode_slider_preloader').fadeOut(500); 1407 initSlider(); 1408 checkSVG($this); 1409 }); 1410 } 1411 } 1412 } else { 1413 if($this.find('.item:first-child video').length > 0){ 1414 $this.find('.item:first-child video').get(0).addEventListener('loadeddata',function(){ 1415 $j('.qode_slider_preloader').fadeOut(500); 1416 initSlider(); 1417 checkSVG($this); 1418 }); 1419 }else{ 1420 src = image_regex.exec($this.find('.item:first-child .image').attr('style')); 1421 if (src) { 1422 var backImg = new Image(); 1423 backImg.src = src[1]; 1424 $j(backImg).on('load', function(){ 1425 $j('.qode_slider_preloader').fadeOut(500); 1426 initSlider(); 1427 checkSVG($this); 1428 }); 1429 } 1430 } 1431 } 1432 1433 $this.on('slide.bs.carousel', function () { 1434 $this.addClass('in_progress'); 1435 $this.find('.active .slider_content_outer').fadeTo(800,0); 1436 }); 1437 $this.on('slid.bs.carousel', function () { 1438 $this.removeClass('in_progress'); 1439 $this.find('.active .slider_content_outer').fadeTo(0,1); 1440 checkSVG($this); 1441 1442 // initiate image animation on active slide and reset all others 1443 $j('div.item.animate_image .image').stop().css({'transform':'', '-webkit-transform':''}); 1444 if($j('div.item.active').hasClass('animate_image') && $window_width > 1000){ 1445 $j('div.item.animate_image.active .image').transformAnimate({ 1446 transform: "matrix("+matrixArray[$j('div.item.animate_image.active').data('animate_image')]+")", 1447 duration: 30000 1448 }); 1449 } 1450 1451 if($this.hasClass('slider_thumbs')){ 1452 var curr_item = $j('div.item').index($j('div.item.active')[0]) + 1; 1453 setPrevNextNumbers(curr_item, all_items_count); 1454 1455 // prev thumb 1456 if($this.find('.active').prev('div.item').length){ 1457 if($this.find('.active').prev('div').find('.image').length){ 1458 src = image_regex.exec($this.find('.active').prev('div').find('.image').attr('style')); 1459 prev_image = new Image(); 1460 prev_image.src = src[1]; 1461 }else{ 1462 prev_image = $this.find('.active').prev('div').find('> .video').clone(); 1463 prev_image.find('.video-overlay').remove(); 1464 prev_image.find('.video-wrap').width(170).height(95); 1465 prev_image.find('.mejs-container').width(170).height(95); 1466 prev_image.find('video').width(170).height(95); 1467 } 1468 $this.find('.left.carousel-control .img .old').fadeOut(300,function(){ 1469 $j(this).remove(); 1470 }); 1471 $this.find('.left.carousel-control .img').append(prev_image).find('img, div.video').fadeIn(300).addClass('old'); 1472 1473 }else{ 1474 if($this.find('.carousel-inner .item:last-child .image').length){ 1475 src = image_regex.exec($this.find('.carousel-inner .item:last-child .image').attr('style')); 1476 prev_image = new Image(); 1477 prev_image.src = src[1]; 1478 }else{ 1479 prev_image = $this.find('.carousel-inner .item:last-child > .video').clone(); 1480 prev_image.find('.video-overlay').remove(); 1481 prev_image.find('.video-wrap').width(170).height(95); 1482 prev_image.find('.mejs-container').width(170).height(95); 1483 prev_image.find('video').width(170).height(95); 1484 } 1485 $this.find('.left.carousel-control .img .old').fadeOut(300,function(){ 1486 $j(this).remove(); 1487 }); 1488 $this.find('.left.carousel-control .img').append(prev_image).find('img, div.video').fadeIn(300).addClass('old'); 1489 } 1490 1491 // next thumb 1492 if($this.find('.active').next('div.item').length){ 1493 if($this.find('.active').next('div').find('.image').length){ 1494 src = image_regex.exec($this.find('.active').next('div').find('.image').attr('style')); 1495 next_image = new Image(); 1496 next_image.src = src[1]; 1497 }else{ 1498 next_image = $this.find('.active').next('div').find('> .video').clone(); 1499 next_image.find('.video-overlay').remove(); 1500 next_image.find('.video-wrap').width(170).height(95); 1501 next_image.find('.mejs-container').width(170).height(95); 1502 next_image.find('video').width(170).height(95); 1503 } 1504 1505 $this.find('.right.carousel-control .img .old').fadeOut(300,function(){ 1506 $j(this).remove(); 1507 }); 1508 $this.find('.right.carousel-control .img').append(next_image).find('img, div.video').fadeIn(300).addClass('old'); 1509 1510 }else{ 1511 if($this.find('.carousel-inner .item:first-child .image').length){ 1512 src = image_regex.exec($this.find('.carousel-inner .item:first-child .image').attr('style')); 1513 next_image = new Image(); 1514 next_image.src = src[1]; 1515 }else{ 1516 next_image = $this.find('.carousel-inner .item:first-child > .video').clone(); 1517 next_image.find('.video-overlay').remove(); 1518 next_image.find('.video-wrap').width(170).height(95); 1519 next_image.find('.mejs-container').width(170).height(95); 1520 next_image.find('video').width(170).height(95); 1521 } 1522 $this.find('.right.carousel-control .img .old').fadeOut(300,function(){ 1523 $j(this).remove(); 1524 }); 1525 $this.find('.right.carousel-control .img').append(next_image).find('img, div.video').fadeIn(300).addClass('old'); 1526 } 1527 } 1528 }); 1529 1530 $this.swipe( { 1531 swipeLeft: function(event, direction, distance, duration, fingerCount){ $this.carousel('next'); }, 1532 swipeRight: function(event, direction, distance, duration, fingerCount){ $this.carousel('prev'); }, 1533 threshold:20 1534 }); 1535 1536 }); 1537 1538 if ($j('.no-touchevents .carousel').length) { 1539 skrollr_slider = skrollr.init({ 1540 edgeStrategy: 'set', 1541 smoothScrolling: true, 1542 forceHeight: false 1543 }); 1544 skrollr_slider.refresh(); 1545 } 1546 } 1547} 1548 1549function checkSliderForHeaderStyle($this, header_effect){ 1550 "use strict"; 1551 1552 var slide_header_style = ""; 1553 var navigation_color = $this.data('navigation-color'); 1554 if($this.hasClass('light')){ slide_header_style = 'light';} 1555 if($this.hasClass('dark')){ slide_header_style = 'dark';} 1556 1557 if( slide_header_style !== ""){ 1558 if(header_effect){ 1559 $j('header.page_header').removeClass('dark light').addClass(slide_header_style); 1560 $j('aside.vertical_menu_area').removeClass('dark light').addClass(slide_header_style); 1561 } 1562 $j('.carousel .carousel-control, .carousel .carousel-indicators').removeClass('dark light').addClass(slide_header_style); 1563 }else{ 1564 if(header_effect){ 1565 $j('header.page_header').removeClass('dark light').addClass(default_header_style); 1566 $j('aside.vertical_menu_area').removeClass('dark light').addClass(default_header_style); 1567 } 1568 $j('.carousel .carousel-control, .carousel .carousel-indicators').removeClass('dark light').addClass(default_header_style); 1569 } 1570 1571 if(navigation_color !== undefined){ 1572 $j('.carousel-control .thumb_holder .thumb_top, .carousel-indicators li').css('background-color',navigation_color); 1573 $j('.carousel-control .prev_nav, .carousel-control .next_nav').css('border-color',navigation_color); 1574 $j('.carousel-control .prev_nav i, .carousel-control .next_nav i').css('color',navigation_color); 1575 }else{ 1576 $j('.carousel-control .thumb_holder .thumb_top, .carousel-indicators li').css('background-color',''); 1577 $j('.carousel-control .prev_nav, .carousel-control .next_nav').css('border-color',''); 1578 $j('.carousel-control .prev_nav i, .carousel-control .next_nav i').css('color',''); 1579 } 1580} 1581 1582/* 1583 ** Set heights for qode carousel, portfolio slider and blog slider 1584 */ 1585function calculateHeights(){ 1586 if($j('.portfolio_slides').length){ 1587 $j('.portfolio_slides').each(function(){ 1588 $j(this).parents('.caroufredsel_wrapper').css({'height' : ($j(this).find('li.item').outerHeight()-3) + 'px'}); //3 is because of the white line bellow the slider 1589 }); 1590 } 1591 1592 if($j('.qode_carousels .slides').length){ 1593 $j('.qode_carousels .slides').each(function(){ 1594 $j(this).parents('.caroufredsel_wrapper').css({'height' : ($j(this).find('li.item').outerHeight()) + 'px'}); 1595 }); 1596 } 1597 1598 if($j('.blog_slides').length){ 1599 $j('.blog_slides').each(function(){ 1600 $j(this).parents('.caroufredsel_wrapper').css({'height' : ($j(this).find('li.item').outerHeight()-3) + 'px'}); 1601 }); 1602 } 1603 1604 if($j('.qode-bct-posts').length){ 1605 $j('.qode-bct-posts').each(function(){ 1606 $j(this).parents('.caroufredsel_wrapper').css({'height' : ($j(this).find('.qode-bct-post').outerHeight()) + 'px'}); 1607 }); 1608 } 1609} 1610 1611/* 1612 ** Init Qode Carousel
1613 */ 1614function initQodeCarousel(){ 1615 "use strict"; 1616 1617 if($j('.qode_carousels').length){ 1618 $j('.qode_carousels').each(function(){ 1619 var thisItem = $j(this); 1620 var numberOfVisibleItems = 6; 1621 if(typeof thisItem.data('number-of-visible-items') !== 'undefined' && thisItem.data('number-of-visible-items') !== '') { 1622 if(thisItem.data('number-of-visible-items') === 4) { 1623 numberOfVisibleItems = 4; 1624 } else if (thisItem.data('number-of-visible-items') === 5) { 1625 numberOfVisibleItems = 5; 1626 } 1627 } 1628 var itemWidth = (thisItem.parents('.grid_section').length == 1 || thisItem.parents('.qode_elementor_container_inner').length == 1) ? 170 : 315; 1629 var maxItems = 6; 1630 if(numberOfVisibleItems === 4) { 1631 itemWidth = (thisItem.parents('.grid_section').length == 1 || thisItem.parents('.qode_elementor_container_inner').length == 1) ? 255 : 472; 1632 maxItems = 4; 1633 } else if (numberOfVisibleItems === 5) { 1634 itemWidth = (thisItem.parents('.grid_section').length == 1 || thisItem.parents('.qode_elementor_container_inner').length == 1) ? 204 : 378; 1635 maxItems = 5; 1636 } 1637 1638 thisItem.find('.slides').carouFredSel({ 1639 circular: true, 1640 responsive: true, 1641 scroll : { 1642 items : 1, 1643 duration : 1000, 1644 pauseOnHover : false 1645 }, 1646 items: { 1647 width: itemWidth, 1648 visible: { 1649 min: 1, 1650 max: maxItems 1651 } 1652 }, 1653 auto: true, 1654 mousewheel: false, 1655 swipe: { 1656 onMouse: true, 1657 onTouch: true 1658 } 1659 1660 }).animate({'opacity': 1},1000); 1661 }); 1662 calculateHeights(); 1663 } 1664} 1665 1666/* 1667** Init Portfolio Slider 1668*/ 1669function initPortfolioSlider(){ 1670 "use strict"; 1671 1672 if($j('.portfolio_slider').length){ 1673 1674 $j('.portfolio_slider').each(function(){ 1675 1676 var number_of_items; 1677 var item_width_fw; 1678 if(typeof $j(this).data('number_of_items') !== 'undefined') { 1679 number_of_items = $j(this).data('number_of_items'); 1680 } 1681 else { 1682 number_of_items = 'auto'; 1683 } 1684 1685 switch(number_of_items){ 1686 case 4: 1687 item_width_fw = 500; 1688 break; 1689 case 5: 1690 item_width_fw = 350; 1691 break; 1692 default: 1693 item_width_fw = 500; 1694 break; 1695 } 1696 1697 var maxItems = ($j(this).parents('.grid_section').length == 1) ? 3 : number_of_items; 1698 var itemWidth = ($j(this).parents('.grid_section').length == 1) ? 353 : item_width_fw; 1699 1700 $j(this).find('.portfolio_slides').carouFredSel({ 1701 circular: true, 1702 responsive: true, 1703 scroll: 1, 1704 prev : { 1705 button : function() { 1706 return $j(this).parent().siblings('.caroufredsel-direction-nav').find('#caroufredsel-prev'); 1707 } 1708 }, 1709 next : { 1710 button : function() { 1711 return $j(this).parent().siblings('.caroufredsel-direction-nav').find('#caroufredsel-next'); 1712 } 1713 }, 1714 items: { 1715 width: itemWidth, 1716 visible: { 1717 min: 1, 1718 max: maxItems 1719 } 1720 }, 1721 auto: false, 1722 mousewheel: false, 1723 swipe: { 1724 onMouse: true, 1725 onTouch: true 1726 } 1727 }).animate({'opacity': 1},1000); 1728 }); 1729 1730 calculateHeights(); 1731 1732 $j('.portfolio_slider .flex-direction-nav a').on('click', function(e){ 1733 e.preventDefault(); 1734 e.stopImmediatePropagation(); 1735 e.stopPropagation(); 1736 }); 1737 } 1738} 1739 1740/* 1741 ** Init Blog Slider 1742 */ 1743function initBlogSlider(){ 1744 "use strict"; 1745 1746 if($j('.blog_slider').length){ 1747 1748 $j('.blog_slider').each(function(){ 1749 var $this = $j(this); 1750 var blogs_shown; 1751 var maxItems; 1752 var itemWidth; 1753 var autoPlay = false;
1754 if(typeof $this.data('blogs_shown') !== 'undefined') { 1755 blogs_shown = $this.data('blogs_shown'); 1756 } 1757 else if($this.hasClass('simple_slider')){ 1758 blogs_shown = 1; 1759 } 1760 else{ 1761 blogs_shown = 'auto'; 1762 } 1763 1764 autoPlay = $this.data('auto_start'); 1765 1766 if ($this.hasClass('simple_slider')) { 1767 maxItems = 1; 1768 itemWidth = 300; 1769 } 1770 else { 1771 maxItems = ($this.parents('.grid_section').length == 1) ? 3 : blogs_shown; 1772 var itemWidthTemp; 1773 1774 switch (blogs_shown) { 1775 case 3: 1776 itemWidthTemp = 667; 1777 break; 1778 case 4: 1779 itemWidthTemp = 500; 1780 break; 1781 case 5: 1782 itemWidthTemp = 400; 1783 break; 1784 case 6: 1785 itemWidthTemp = 334; 1786 break; 1787 default: 1788 itemWidthTemp = 500; 1789 1790 break; 1791 } 1792 1793 itemWidth = ($this.parents('.grid_section').length == 1) ? 353 : itemWidthTemp; 1794 } 1795 1796 $this.find('.blog_slides').carouFredSel({ 1797 circular: true, 1798 responsive: true, 1799 scroll: 1, 1800 prev : { 1801 button : function() { 1802 return $j(this).parent().siblings('.caroufredsel-direction-nav').find('#caroufredsel-prev'); 1803 } 1804 }, 1805 next : { 1806 button : function() { 1807 return $j(this).parent().siblings('.caroufredsel-direction-nav').find('#caroufredsel-next'); 1808 } 1809 }, 1810 items: { 1811 width: itemWidth, 1812 visible: { 1813 min: 1, 1814 max: maxItems 1815 } 1816 }, 1817 auto: autoPlay, 1818 mousewheel: false, 1819 swipe: { 1820 onMouse: true, 1821 onTouch: true 1822 } 1823 }).animate({'opacity': 1},1000); 1824 }); 1825 1826 calculateHeights(); 1827 1828 $j('.blog_slider .flex-direction-nav a').on('click', function(e){ 1829 e.preventDefault(); 1830 e.stopImmediatePropagation(); 1831 e.stopPropagation(); 1832 }); 1833 } 1834} 1835 1836/* 1837 ** Init Blog Slider 1838 */ 1839function qodeInitBlogCarouselTitled(){ 1840 "use strict"; 1841 1842 if($j('.qode-blog-carousel-titled').length){ 1843 $j('.qode-blog-carousel-titled').each(function(){ 1844 var slider = $j(this); 1845 var maxItems = 4; 1846 var itemWidth; 1847 var autoPlay = false; 1848 1849 if(typeof slider.data('posts-shown') !== 'undefined') { 1850 maxItems = slider.data('posts-shown'); 1851 } 1852 1853 if ( $window_width < 769 && maxItems > 2){ 1854 maxItems = 2; 1855 } 1856 1857 if ( $window_width < 601 && maxItems > 1){ 1858 maxItems = 1; 1859 } 1860 1861 itemWidth = slider.width()/maxItems; 1862 1863 slider.find('.qode-bct-posts').carouFredSel({ 1864 circular: true, 1865 responsive: true, 1866 scroll: 1, 1867 prev : { 1868 button : function() { 1869 return slider.find('.qode-bct-caroufredsel-prev'); 1870 } 1871 }, 1872 next : { 1873 button : function() { 1874 return slider.find('.qode-bct-caroufredsel-next'); 1875 } 1876 }, 1877 items: { 1878 width: itemWidth, 1879 visible: { 1880 min: 1, 1881 max: maxItems 1882 } 1883 }, 1884 auto: autoPlay, 1885 mousewheel: false, 1886 swipe: { 1887 onMouse: true, 1888 onTouch: true 1889 } 1890 }); 1891 slider.animate({'opacity': 1},1000) 1892 }); 1893 1894 calculateHeights(); 1895 1896 } 1897} 1898 1899/* 1900** Opening side menu on "menu button" click 1901*/ 1902var current_scroll; 1903function initSideMenu(){ 1904 "use strict"; 1905 1906 if ($j('body').hasClass('side_area_uncovered_from_content')) { 1907 $j('.side_menu_button_wrapper a.side_menu_button_link, a.close_side_menu').on('click', function(e){ 1908 e.preventDefault(); 1909 $j('.side_menu').css({'right':'0'}); 1910 if(!$j('.side_menu_button_wrapper a.side_menu_button_link').hasClass('opened')){ 1911 $j('.side_menu').css({'visibility':'visible'}); 1912 $j(this).addClass('opened'); 1913 $j('body').addClass('right_side_menu_opened'); 1914 current_scroll = $j(window).scrollTop(); 1915 1916 $j(window).scroll(function() { 1917 if(Math.abs($scroll - current_scroll) > 400){ 1918 $j('body').removeClass('right_side_menu_opened'); 1919 $j('.side_menu_button_wrapper a').removeClass('opened'); 1920 var hide_side_menu = setTimeout(function(){ 1921 $j('.side_menu').css({'visibility':'hidden'}); 1922 clearTimeout(hide_side_menu); 1923 },400); 1924 } 1925 }); 1926 }else{ 1927 $j('.side_menu_button_wrapper a.side_menu_button_link').removeClass('opened'); 1928 $j('body').removeClass('right_side_menu_opened'); 1929 var hide_side_menu = setTimeout(function(){ 1930 $j('.side_menu').css({'visibility':'hidden'}); 1931 clearTimeout(hide_side_menu); 1932 },400); 1933 } 1934 }); 1935 } 1936 1937 if ($j('body').hasClass('side_menu_slide_with_content')) { 1938 $j('.side_menu_button_wrapper a.side_menu_button_link, a.close_side_menu').on('click', function(e){ 1939 e.preventDefault(); 1940 1941 if(!$j('.side_menu_button_wrapper a.side_menu_button_link').hasClass('opened')){ 1942 $j(this).addClass('opened'); 1943 $j('body').addClass('side_menu_open'); 1944 current_scroll = $j(window).scrollTop(); 1945 $j(window).scroll(function() { 1946 1947 if(Math.abs($scroll - current_scroll) > 400){ 1948 $j('body').removeClass('side_menu_open'); 1949 $j('.side_menu_button_wrapper a').removeClass('opened'); 1950 } 1951 }); 1952 }else{//hamburger icon has class open on its click 1953 $j('body').removeClass('side_menu_open'); 1954 1955 1956 $j('.side_menu_button_wrapper a.side_menu_button_link').removeClass('opened'); 1957 $j('body').removeClass('side_menu_open'); 1958 1959 } 1960 1961 e.stopPropagation(); 1962 $j('.wrapper').on('click', function() { 1963 e.preventDefault(); 1964 $j('body').removeClass('side_menu_open'); 1965 $j('.side_menu_button_wrapper a.side_menu_button_link').removeClass('opened'); 1966 $j('body').removeClass('side_menu_open'); 1967 }); 1968 }); 1969 } 1970 1971 1972 if ($j('body').hasClass('side_menu_slide_from_right')) { 1973 $j('.wrapper').prepend('<div class="cover"/>'); 1974 $j('.side_menu_button_wrapper a.side_menu_button_link, a.close_side_menu').on('click', function(e){ 1975 e.preventDefault(); 1976 1977 if(!$j('.side_menu_button_wrapper a.side_menu_button_link').hasClass('opened')){ 1978 $j(this).addClass('opened'); 1979 $j('body').addClass('right_side_menu_opened'); 1980 1981 $j(' .wrapper .cover').on('click', function() { 1982 $j('.side_menu_button_wrapper a.side_menu_button_link').removeClass('opened'); 1983 $j('body').removeClass('right_side_menu_opened'); 1984 $j('.side_menu_button_wrapper a').removeClass('opened'); 1985 }); 1986 current_scroll = $j(window).scrollTop(); 1987 $j(window).scroll(function() { 1988 if(Math.abs($scroll - current_scroll) > 400){ 1989 $j('body').removeClass('right_side_menu_opened'); 1990 $j('.side_menu_button_wrapper a').removeClass('opened'); 1991 } 1992 }); 1993 }else{ 1994 $j('.side_menu_button_wrapper a.side_menu_button_link').removeClass('opened'); 1995 $j('body').removeClass('right_side_menu_opened'); 1996 } 1997 }); 1998 } 1999} 2000 2001function setDropDownMenuPosition(){ 2002 "use strict"; 2003 2004 var menu_items = $j(".drop_down > ul > li.narrow"); 2005 menu_items.each( function(i) { 2006 2007 var browser_width = $j(window).width()-16; // 16 is width of scroll bar 2008 var boxed_layout; // boxed layout width 2009 switch(true){ 2010 case qode_body.hasClass('qode_grid_1300'): 2011 boxed_layout = 1350; 2012 break; 2013 case qode_body.hasClass('qode_grid_1200'): 2014 boxed_layout = 1250; 2015 break; 2016 default : 2017 boxed_layout = 1150; 2018 break; 2019 } 2020 var menu_item_position = $j(menu_items[i]).offset().left; 2021 var sub_menu_width = $j(menu_items[i]).find('.second .inner ul').width(); 2022 var menu_item_from_left = 0; 2023 if($j('body').hasClass('boxed')){ 2024 menu_item_from_left = boxed_layout - (menu_item_position - (browser_width - boxed_layout)/2) + 17; // 17 is right padding between menu elements 2025 } else { 2026 menu_item_from_left = browser_width - menu_item_position + 17; // 17 is right padding between menu elements 2027 } 2028 var sub_menu_from_left; 2029 2030 if($j(menu_items[i]).find('li.sub').length > 0){ 2031 sub_menu_from_left = menu_item_from_left - sub_menu_width; 2032 } 2033 2034 if(menu_item_from_left < sub_menu_width || sub_menu_from_left < sub_menu_width){ 2035 $j(menu_items[i]).find('.second').addClass('right'); 2036 $j(menu_items[i]).find('.second .inner ul').addClass('right'); 2037 } 2038 }); 2039} 2040 2041function initDropDownMenu(){ 2042 "use strict"; 2043 2044 var menu_items = $j('.drop_down > ul > li'); 2045 2046 menu_items.each( function(i) { 2047 if ($j(menu_items[i]).find('.second').length > 0) { 2048 if($j(menu_items[i]).hasClass('wide')){ 2049 var $this = $j(this), 2050 dropdown = $this.find('.inner > ul'), 2051 dropdownPadding = parseInt(dropdown.css('padding-left').slice(0, -2)) + parseInt(dropdown.css('padding-right').slice(0, -2)), 2052 dropdownColumns = $this.find('.second > .inner > ul > li'), 2053 row_number = dropdownColumns.length; 2054 2055 if(!$this.hasClass('left_position') && !$this.hasClass('right_position')){ 2056 $this.find('.second').css('left',0); 2057 } 2058 2059 var tallest = 0; 2060 dropdownColumns.each(function() { 2061 var thisHeight = $j(this).height(); 2062 if(thisHeight > tallest) { 2063 tallest = thisHeight; 2064 } 2065 }); 2066 dropdownColumns.height(tallest); 2067 2068 if($this.hasClass('full_width_wide_menu')){ 2069 var colWidth = 100/row_number+'%'; 2070 dropdownColumns.css('width', colWidth); 2071 }else{ 2072 if (row_number > 4) { row_number = 4;} 2073 var width = row_number*dropdownColumns.outerWidth(); 2074 dropdown.width(width); 2075 } 2076 2077 if(!$this.hasClass('wide_background')){ 2078 if(!$this.hasClass('left_position') && !$this.hasClass('right_position')){ 2079 var left_position = ($j(window).width() - 2 * ($j(window).width()-$j(this).find('.second').offset().left))/2 + (width+dropdownPadding)/2; 2080 $this.find('.second').css('left',-left_position); 2081 } 2082 } else{ 2083 if(!$this.hasClass('left_position') && !$this.hasClass('right_position')){ 2084 var left_position = $this.find('.second').offset().left; 2085 $this.find('.second').css('left',-left_position); 2086 $this.find('.second').css('width',$j(window).width()); 2087 } 2088 } 2089 } 2090 2091 if(!menu_dropdown_height_set){ 2092 $j(menu_items[i]).data('original_height', $j(menu_items[i]).find('.second').height() + 'px'); 2093 $j(menu_items[i]).find('.second').height(0); 2094 } 2095 2096 if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { 2097 $j(menu_items[i]).on("touchstart mouseenter",function(){ 2098 $j(menu_items[i]).find('.second').css({'height': $j(menu_items[i]).data('original_height'), 'overflow': 'visible', 'visibility': 'visible', 'opacity': '1'}); 2099 }).on("mouseleave", function(){ 2100 $j(menu_items[i]).find('.second').css({'height': '0px','overflow': 'hidden', 'visivility': 'hidden', 'opacity': '0'}); 2101 }); 2102 2103 }else{ 2104 var config = { 2105 interval: 0, 2106 over: function(){ 2107 setTimeout(function() { 2108 $j(menu_items[i]).find('.second').addClass('drop_down_start'); 2109 $j(menu_items[i]).find('.second').stop().css({'height': $j(menu_items[i]).data('original_height')}); 2110 }, 150); 2111 }, 2112 timeout: 150, 2113 out: function(){ 2114 $j(menu_items[i]).find('.second').stop().css({'height': '0px'}); 2115 $j(menu_items[i]).find('.second').removeClass('drop_down_start'); 2116 } 2117 }; 2118 $j(menu_items[i]).hoverIntent(config); 2119 } 2120 } 2121 }); 2122 $j('.drop_down ul li.wide ul li a, .drop_down ul li.narrow ul li a').on('click',function(){ 2123 var $this = $j(this); 2124 2125 if(!$this.next('ul').length && ($this.attr('href') !== "http://#") && ($this.attr('href') !== "#") && !$this.hasClass('no_link')) { 2126 setTimeout(function() { 2127 $this.mouseleave(); 2128 }, 500); 2129 } 2130 }); 2131 2132 menu_dropdown_height_set = true; 2133} 2134 2135 2136/* 2137 ** Vertical menu toggle dropdown 2138 */ 2139 2140function initVerticalMenu(){ 2141 "use strict"; 2142 2143 if ($j('.no-touchevents .vertical_menu_toggle').length) { 2144 var menu_items = $j('.no-touchevents .vertical_menu_toggle > ul > li'); 2145 var menu_items_2 = $j('.no-touchevents .vertical_menu_toggle ul li ul li'); 2146 2147 menu_items.each( function(i) { 2148 if($j(menu_items[i]).hasClass('has_sub')){ 2149 var subitems_number = $j(menu_items[i]).find('.inner > ul > li').length; 2150 $j(menu_items[i]).hoverIntent({ 2151 over: function() { 2152 $j(menu_items[i]).addClass('open'); 2153 $j(menu_items[i]).find('.second').slideDown(subitems_number*40, 'easeInOutSine', function(){ 2154 $j('.vertical_menu_area.with_scroll').getNiceScroll().resize(); 2155 }); 2156 2157 }, 2158 out: function() { 2159 //if(!$j(menu_items[i]).hasClass('active')){ 2160 $j(menu_items[i]).removeClass('open');
2161 $j(menu_items[i]).find('.second').slideUp(subitems_number*40, 'easeInOutSine'); 2162 //} 2163 }, 2164 timeout: 1000 2165 }); 2166 } 2167 }); 2168 2169 menu_items_2.each( function(i) { 2170 if($j(menu_items_2[i]).hasClass('menu-item-has-children')){ 2171 var subitems_number = $j(menu_items_2[i]).find('ul > li').length; 2172 $j(menu_items_2[i]).hoverIntent({ 2173 over: function() { 2174 $j(menu_items_2[i]).addClass('open'); 2175 $j(menu_items_2[i]).find('ul').slideDown(subitems_number*40, 'easeInOutSine', function(){ 2176 $j('.vertical_menu_area.with_scroll').getNiceScroll().resize(); 2177 }); 2178 }, 2179 out: function() { 2180 $j(menu_items_2[i]).removeClass('open'); 2181 $j(menu_items_2[i]).find('ul').slideUp(subitems_number*40, 'easeInOutSine'); 2182 }, 2183 timeout: 1000 2184 }); 2185 } 2186 }); 2187 } 2188 else if ($j('.vertical_menu_on_click').length) { 2189 var menu_items = $j('.vertical_menu_on_click > ul > li > a'); 2190 var menu_items_2 = $j('.vertical_menu_on_click ul li ul li a'); 2191 2192 menu_items.each( function(i) { 2193 if($j(menu_items[i]).parent().hasClass('has_sub')){ 2194 $j(menu_items[i]).on('tap click',function(e) { 2195 e.preventDefault(); 2196 if(!$j(this).parent().hasClass('open')) { 2197 $j('.vertical_menu_on_click > ul > li').removeClass('open'); 2198 $j('.vertical_menu_on_click > ul > li').find('.second').slideUp('fast'); 2199 2200 $j(this).parent().addClass('open'); 2201 $j(this).parent().find('.second').slideDown('slow', function () { 2202 $j('.vertical_menu_area.with_scroll').getNiceScroll().resize(); 2203 }); 2204 }else{ 2205 2206 $j(this).parent().removeClass('open'); 2207 $j(this).parent().find('.second').slideUp('fast', function () { 2208 $j('.vertical_menu_area.with_scroll').getNiceScroll().resize(); 2209 }); 2210 } 2211 return false; 2212 }); 2213 } 2214 }); 2215 2216 menu_items_2.each( function(i) { 2217 if($j(menu_items_2[i]).parent().hasClass('menu-item-has-children')){ 2218 $j(menu_items_2[i]).on('tap click',function(e) { 2219 e.preventDefault(); 2220 if(!$j(this).parent().hasClass('open')) { 2221 $j('.vertical_menu_on_click ul li ul li').removeClass('open'); 2222 $j('.vertical_menu_on_click ul li ul li').find('ul').slideUp('fast'); 2223 2224 $j(this).parent().addClass('open'); 2225 $j(this).parent().find('ul').slideDown('slow', function () { 2226 $j('.vertical_menu_area.with_scroll').getNiceScroll().resize(); 2227 }); 2228 }else{ 2229 $j(this).parent().removeClass('open'); 2230 $j(this).parent().find('ul').slideUp('fast', function () { 2231 $j('.vertical_menu_area.with_scroll').getNiceScroll().resize(); 2232 }); 2233 } 2234 return false; 2235 }); 2236 } 2237 }); 2238 } 2239 else if ($j('.no-touchevents .vertical_menu_float').length){ 2240 //show dropdown to content on menu item hover, link is available on menu item click 2241 var menu_items = $j('.no-touchevents .vertical_menu_float > ul > li'); 2242 var menu_items_2 = $j('.no-touchevents .vertical_menu_float ul li ul li'); 2243 menu_items.each( function(i) { 2244 if($j(menu_items[i]).hasClass('has_sub')){ 2245 $j(menu_items[i]).hoverIntent({ 2246 over: function() { 2247 $j(menu_items[i]).addClass('open'); 2248 $j(menu_items[i]).find('.second').addClass('vertical_menu_start'); 2249 }, 2250 out: function() { 2251 //if(!$j(menu_items[i]).hasClass('active')){ 2252 $j(menu_items[i]).removeClass('open'); 2253 $j(menu_items[i]).find('.second').removeClass('vertical_menu_start'); 2254 }, 2255 timeout: 300 2256 }); 2257 } 2258 }); 2259 2260 menu_items_2.each( function(i) { 2261 if($j(menu_items_2[i]).hasClass('menu-item-has-children')){ 2262 var subitems_number = $j(menu_items_2[i]).find('ul > li').length; 2263 $j(menu_items_2[i]).hoverIntent({ 2264 over: function() { 2265 $j(menu_items_2[i]).addClass('open'); 2266 $j(menu_items_2[i]).find('ul').addClass('vertical_submenu_start'); 2267 }, 2268 out: function() { 2269 $j(menu_items_2[i]).removeClass('open'); 2270 $j(menu_items_2[i]).find('ul').removeClass('vertical_submenu_start'); 2271 }, 2272 timeout: 300 2273 }); 2274 } 2275 }); 2276 } 2277 2278} 2279 2280/* 2281 ** Show/Hide Vertical menu for mobile 2282 */ 2283function initVerticalMobileMenu(){ 2284 "use strict"; 2285 2286 if ($j('.vertical_menu_toggle').length) { 2287 //register tap / click event for main menu item plus icon 2288 $j('.touchevents .vertical_menu_toggle > ul > li.has_sub > a .plus').on('tap click', function(e){ 2289 //first prevent event propagation and it's default behavior 2290 e.stopPropagation(); 2291 e.preventDefault(); 2292 2293 //is dropdown for clicked item visible? 2294 if($j(this).parent().next('div.second').is(":visible")){ 2295 //if it is remove 'open' class and slide it up 2296 $j(this).parents('.touchevents .vertical_menu_toggle > ul > li.has_sub').removeClass('open');
2297 $j(this).parent().next('div.second').slideUp(200); 2298 } else { 2299 //if it's not visible add 'open' class and slide it down 2300 $j(this).parents('.touchevents .vertical_menu_toggle > ul > li.has_sub').addClass('open'); 2301 $j(this).parent().next('div.second').slideDown(200); 2302 } 2303 }); 2304 2305 //register tap / click event for second level main menu item plus icon 2306 $j('.touchevents .vertical_menu_toggle ul li ul li > a .plus').on('tap click', function(e){ 2307 //first prevent event propagation and it's default behavior 2308 e.stopPropagation(); 2309 e.preventDefault(); 2310 2311 //is dropdown for clicked item visible? 2312 if($j(this).parent().next('ul').is(":visible")){ 2313 //if it is remove 'open' class and slide it up 2314 $j(this).parents('.touchevents .vertical_menu_toggle ul li ul li').removeClass('open'); 2315 $j(this).parent().next('ul').slideUp(200); 2316 } else { 2317 //if it's not visible add 'open' class and slide it down 2318 $j(this).parents('.touchevents .vertical_menu_toggle ul li ul li').addClass('open'); 2319 $j(this).parent().next('ul').slideDown(200); 2320 } 2321 }); 2322 } 2323 else if ($j('.vertical_menu_float').length){ 2324 $j('.touchevents .vertical_menu_float > ul > li.has_sub > a .plus').on('tap click', function(e){ 2325 //first prevent event propagation and it's default behavior 2326 e.stopPropagation(); 2327 e.preventDefault(); 2328 2329 //is dropdown for clicked item visible? 2330 if($j(this).parent().next('div.second').hasClass('vertical_menu_start')){ 2331 //if it is remove 'open' class and 'vertical_menu_start' 2332 $j(this).parents('.touchevents .vertical_menu_float > ul > li.has_sub').removeClass('open'); 2333 $j(this).parents('.touchevents .vertical_menu_float > ul > li.has_sub').find('.second').removeClass('vertical_menu_start'); 2334 } else { //if it's not visible add 'open' class and 'vertical_menu_start' 2335 $j(this).parents('.touchevents .vertical_menu_float > ul > li.has_sub').addClass('open'); 2336 $j(this).parents('.touchevents .vertical_menu_float > ul > li.has_sub').find('.second').addClass('vertical_menu_start'); 2337 } 2338 }); 2339 //register tap / click event for second level main menu item plus icon 2340 $j('.touchevents .vertical_menu_float ul li ul li > a .plus').on('tap click', function(e){ 2341 //first prevent event propagation and it's default behavior 2342 e.stopPropagation(); 2343 e.preventDefault(); 2344 2345 //is dropdown for clicked item visible? 2346 if($j(this).parent().next('ul').hasClass('vertical_submenu_start')){ 2347 //if it is remove 'open' class and slide it up 2348 $j(this).parents('.touchevents .vertical_menu_float ul li ul li').removeClass('open'); 2349 $j(this).parents('.touchevents .vertical_menu_float ul li ul li').find('ul').removeClass('vertical_submenu_start'); 2350 2351 } else { 2352 //if it's not visible add 'open' class and slide it down 2353 $j(this).parents('.touchevents .vertical_menu_float ul li ul li').addClass('open'); 2354 $j(this).parents('.touchevents .vertical_menu_float ul li ul li').find('ul').addClass('vertical_submenu_start'); 2355 } 2356 }); 2357 } 2358} 2359 2360/* 2361 ** Set transparency for left menu area 2362 */ 2363function checkVerticalMenuTransparency(){ 2364 if($scroll !== 0){ 2365 $j('body.vertical_menu_transparency').removeClass('vertical_menu_transparency_on'); 2366 }else{ 2367 $j('body.vertical_menu_transparency').addClass('vertical_menu_transparency_on'); 2368 } 2369} 2370 2371/* 2372 ** Show/Hide hidden Vertical menu 2373 */ 2374function showHideVerticalMenu(){ 2375 2376 if($j('.vertical_menu_hidden').length) { 2377 var vertical_menu = $j('aside.vertical_menu_area'); 2378 var vertical_menu_bottom_logo = $j('.vertical_menu_area_bottom_logo'); 2379 var hovered_flag = true; 2380 2381 $j('.vertical_menu_hidden_button').on('click',function (e) { 2382 e.preventDefault(); 2383 if(hovered_flag) { 2384 hovered_flag = false; 2385 current_scroll = $j(window).scrollTop(); //current scroll is defined in front of "initSideMenu" function 2386 vertical_menu.addClass('active'); 2387 vertical_menu_bottom_logo.addClass('active'); 2388 }else{ 2389 hovered_flag = true; 2390 vertical_menu.removeClass('active'); 2391 vertical_menu_bottom_logo.removeClass('active'); 2392 } 2393 }); 2394 2395 $j(window).scroll(function() { 2396 if(Math.abs($scroll - current_scroll) > 400){ 2397 hovered_flag = true; 2398 vertical_menu.removeClass('active'); 2399 vertical_menu_bottom_logo.removeClass('active'); 2400 } 2401 }); 2402 2403 //take click outside vertical left/rifgt area and close it 2404 (function() { 2405 var Outclick, outclick, 2406 _this = this; 2407 Outclick = (function() { 2408 Outclick.name = 'Outclick'; 2409 function Outclick() { 2410 this.objects = []; 2411 }
2412 Outclick.prototype.check = function(element, event) { 2413 return !element.is(event.target) && element.has(event.target).length === 0; 2414 }; 2415 Outclick.prototype.trigger = function(e) { 2416 var execute, 2417 _this = this; 2418 execute = false; 2419 return $j.each(this.objects, function(index, el) { 2420 if (_this.check(el.container, e)) { 2421 if (el.related.length < 1) { 2422 execute = true; 2423 } else { 2424 $j.each(el.related, function(index, relation) { 2425 if (_this.check(relation, e)) { 2426 return execute = true; 2427 } else { 2428 execute = false; 2429 return false; 2430 } 2431 }); 2432 } 2433 if (execute) { 2434 return el.callback.call(el.container); 2435 } 2436 } 2437 }); 2438 }; 2439 return Outclick; 2440 })(); 2441 outclick = new Outclick; 2442 $j.fn.outclick = function(options) { 2443 var _this = this; 2444 if (options == null) { 2445 options = {}; 2446 } 2447 options.related || (options.related = []); 2448 options.callback || (options.callback = function() { 2449 return _this.hide(); 2450 }); 2451 return outclick.objects.push({ 2452 container: this, 2453 related: options.related, 2454 callback: options.callback 2455 }); 2456 }; 2457 $j(document).mouseup(function(e) { 2458 return outclick.trigger(e); 2459 }); 2460 }).call(this); 2461 $j(vertical_menu).outclick({ 2462 callback: function() { 2463 hovered_flag = true; 2464 vertical_menu.removeClass('active'); 2465 vertical_menu_bottom_logo.removeClass('active'); 2466 } 2467 }); 2468 } 2469} 2470 2471/* 2472** Plugin for counter shortcode 2473*/ 2474(function($) { 2475 "use strict"; 2476 2477 $.fn.countTo = function(options) { 2478 // merge the default plugin settings with the custom options 2479 options = $.extend({}, $.fn.countTo.defaults, options || {}); 2480 2481 // how many times to update the value, and how much to increment the value on each update 2482 var loops = Math.ceil(options.speed / options.refreshInterval), 2483 increment = (options.to - options.from) / loops; 2484 2485 return $(this).each(function() { 2486 var _this = this, 2487 loopCount = 0, 2488 value = options.from, 2489 interval = setInterval(updateTimer, options.refreshInterval); 2490 2491 function updateTimer() { 2492 value += increment; 2493 loopCount++; 2494 $(_this).html(value.toFixed(options.decimals)); 2495 2496 if (typeof(options.onUpdate) === 'function') { 2497 options.onUpdate.call(_this, value); 2498 } 2499 2500 if (loopCount >= loops) { 2501 clearInterval(interval); 2502 value = options.to; 2503 2504 if (typeof(options.onComplete) === 'function') { 2505 options.onComplete.call(_this, value); 2506 } 2507 } 2508 } 2509 }); 2510 }; 2511 2512 $.fn.countTo.defaults = { 2513 from: 0, // the number the element should start at 2514 to: 100, // the number the element should end at 2515 speed: 1000, // how long it should take to count between the target numbers 2516 refreshInterval: 100, // how often the element should be updated 2517 decimals: 0, // the number of decimal places to show 2518 onUpdate: null, // callback method for every time the element is updated, 2519 onComplete: null // callback method for when the element finishes updating 2520 }; 2521})(jQuery); 2522 2523/* 2524** Counter from zero to defined number 2525*/ 2526function initToCounter(){ 2527 "use strict"; 2528 2529 if($j('.counter.zero').length){ 2530 $j('.counter.zero').each(function() { 2531 2532 var parent = $j(this).parent(); 2533 var axis = 100; 2534 2535 if(typeof parent.data('element-appearance') !== 'undefined' && parent.data('element-appearance') !== false) { 2536 axis = parent.data('element-appearance'); 2537 } 2538 2539 if(!$j(this).hasClass('executed')){ 2540 $j(this).addClass('executed'); 2541 if($j(this).parents('.vertical_split_slider').length){ 2542 $j(this).parent().css('opacity', '1'); 2543 var $max = parseFloat($j(this).text()); 2544 $j(this).countTo({ 2545 from: 0, 2546 to: $max, 2547 speed: 1500, 2548 refreshInterval: 100 2549 }); 2550 } 2551 else{ 2552 $j(this).appear(function() { 2553 $j(this).parent().css('opacity', '1'); 2554 var $max = parseFloat($j(this).text()); 2555 $j(this).countTo({ 2556 from: 0, 2557 to: $max, 2558 speed: 1500, 2559 refreshInterval: 100 2560 }); 2561 }
2561,{accX: 0, accY: -axis}); 2562 } 2563 } 2564 }); 2565 } 2566} 2567 2568/* 2569** Counter with random effect 2570*/ 2571function initCounter(){ 2572 "use strict"; 2573 2574 if($j('.counter.random').length){ 2575 $j('.counter.random').each(function() { 2576 2577 var parent = $j(this).parent(); 2578 var axis = 100; 2579 2580 if(typeof parent.data('element-appearance') !== 'undefined' && parent.data('element-appearance') !== false) { 2581 axis = parent.data('element-appearance'); 2582 } 2583 2584 if(!$j(this).hasClass('executed')){ 2585 $j(this).addClass('executed'); 2586 if($j(this).parents('.vertical_split_slider').length){ 2587 $j(this).parent().css('opacity', '1'); 2588 $j(this).absoluteCounter({ 2589 speed: 2000, 2590 fadeInDelay: 1000 2591 }); 2592 } 2593 else{ 2594 $j(this).appear(function() { 2595 $j(this).parent().css('opacity', '1'); 2596 $j(this).absoluteCounter({ 2597 speed: 2000, 2598 fadeInDelay: 1000 2599 }); 2600 },{accX: 0, accY: -axis}); 2601 } 2602 } else { 2603 if( $j(this).parents('.vertical_split_slider_responsive').length ){ 2604 var counterSpans = $j(this).find('span'); 2605 if( counterSpans.length ){ 2606 counterSpans.remove(); 2607 } 2608 var digit = 0; 2609 if( typeof( parent.data('digit') ) !== 'undefined' && parent.data('digit') !== '' ){ 2610 digit = parent.data('digit'); 2611 } 2612 2613 $j(this).html(digit); 2614 $j(this).appear(function() { 2615 $j(this).absoluteCounter({ 2616 speed: 2000, 2617 fadeInDelay: 1000 2618 }); 2619 },{accX: 0, accY: -axis}); 2620 } 2621 } 2622 }); 2623 } 2624} 2625 2626/* 2627** Countdown 2628*/ 2629 2630function initCountdown(){ 2631 "use strict"; 2632 if($j('.countdown').length){ 2633 $j('.countdown').each(function(){ 2634 2635 var countdownId = $j(this).attr('id'); 2636 var $this = $j('#'+countdownId); 2637 var year = 0; 2638 var month = 0; 2639 var day = 0; 2640 var hour = 0; 2641 var minute = 0; 2642 var monthsLabel; 2643 var monthLabel; 2644 var daysLabel; 2645 var dayLabel; 2646 var hoursLabel; 2647 var hourLabel; 2648 var minutesLabel; 2649 var minuteLabel; 2650 var secondsLabel; 2651 var secondLabel; 2652 var tickf; 2653 var timezone; 2654 var digitfs; 2655 var labelfs; 2656 var color; 2657 2658 if(typeof $this.data('year') !== 'undefined' && $this.data('year') !== false) { 2659 year = $this.data('year'); 2660 } 2661 if(typeof $this.data('month') !== 'undefined' && $this.data('month') !== false) { 2662 month = $this.data('month'); 2663 } 2664 if(typeof $this.data('day') !== 'undefined' && $this.data('day') !== false) { 2665 day = $this.data('day'); 2666 } 2667 if(typeof $this.data('hour') !== 'undefined' && $this.data('hour') !== false) { 2668 hour = $this.data('hour'); 2669 } 2670 if(typeof $this.data('minute') !== 'undefined' && $this.data('minute') !== false) { 2671 minute = $this.data('minute'); 2672 } 2673 if(typeof $this.data('monthslabel') !== 'undefined' && $this.data('monthslabel') !== false) { 2674 monthsLabel = $this.data('monthslabel'); 2675 } 2676 if(typeof $this.data('monthlabel') !== 'undefined' && $this.data('monthlabel') !== false) { 2677 monthLabel = $this.data('monthlabel'); 2678 } 2679 if(typeof $this.data('dayslabel') !== 'undefined' && $this.data('dayslabel') !== false) { 2680 daysLabel = $this.data('dayslabel'); 2681 } 2682 if(typeof $this.data('daylabel') !== 'undefined' && $this.data('daylabel') !== false) { 2683 dayLabel = $this.data('daylabel'); 2684 } 2685 if(typeof $this.data('hourslabel') !== 'undefined' && $this.data('hourslabel') !== false) { 2686 hoursLabel = $this.data('hourslabel'); 2687 } 2688 if(typeof $this.data('hourlabel') !== 'undefined' && $this.data('hourlabel') !== false) { 2689 hourLabel = $this.data('hourlabel'); 2690 } 2691 if(typeof $this.data('minuteslabel') !== 'undefined' && $this.data('minuteslabel') !== false) { 2692 minutesLabel = $this.data('minuteslabel'); 2693 } 2694 if(typeof $this.data('minutelabel') !== 'undefined' && $this.data('minutelabel') !== false) { 2695 minuteLabel = $this.data('minutelabel'); 2696 } 2697 if(typeof $this.data('secondslabel') !== 'undefined' && $this.data('secondslabel') !== false) { 2698 secondsLabel = $this.data('secondslabel'); 2699 } 2700 if(typeof $this.data('secondlabel') !== 'undefined' && $this.data('secondlabel') !== false) { 2701 secondLabel = $this.data('secondlabel'); 2702 } 2703 if(typeof $this.data('tickf') !== 'undefined' && $this.data('tickf') !== false) { 2704 tickf = $this.data('tickf'); 2705 } 2706 if(typeof $this.data('timezone') !== 'undefined' && $this.data('timezone') !== false) { 2707 timezone = $this.data('timezone'); 2708 } 2709 if(typeof $this.data('digitfs') !== 'undefined' && $this.data('digitfs') !== false) { 2710 digitfs = $this.data('digitfs'); 2711 } 2712 if(typeof $this.data('labelfs') !== 'undefined' && $this.data('labelfs') !== false) { 2713 labelfs = $this.data('labelfs'); 2714 } 2715 if(typeof $this.data('color') !== 'undefined' && $this.data('color') !== false) { 2716 color = $this.data('color'); 2717 } 2718 2719 $this.countdown({ 2720 until: new Date( year, month - 1, day, hour, minute, 44), 2721 labels: ['Years', monthsLabel, 'Weeks', daysLabel, hoursLabel, minutesLabel, secondsLabel], 2722 labels1: ['Year', monthLabel, 'Week', dayLabel, hourLabel, minuteLabel, secondLabel], 2723 format: 'ODHMS', 2724 timezone: timezone, 2725 padZeroes: true, 2726 significant: 0, 2727 onTick: function(){ 2728 if (digitfs !== 'undefined' && digitfs !== ''){ 2729 $this.find('.countdown-amount').css('font-size',digitfs + 'px').css('line-height',digitfs + 'px'); 2730 } 2731 if (labelfs !== 'undefined' && labelfs !== ''){ 2732 $this.find('.countdown-period').css('font-size',labelfs + 'px'); 2733 } 2734 if (color !== 'undefined' && color !== ''){
2735 $this.find('.countdown_separator').css('background-color',color); 2736 } 2737 } 2738 }); 2739 }); 2740 } 2741} 2742 2743/* 2744** Horizontal progress bars shortcode 2745*/ 2746function initProgressBars(){ 2747 "use strict"; 2748 2749 if($j('.q_progress_bar').length){ 2750 $j('.q_progress_bar').each(function() { 2751 if($j(this).parents('.vertical_split_slider').length){ 2752 initToCounterHorizontalProgressBar($j(this)); 2753 var percentage = $j(this).find('.progress_content').data('percentage'); 2754 $j(this).find('.progress_content').css('width', '0%'); 2755 $j(this).find('.progress_content').animate({'width': percentage+'%'}, 1500); 2756 $j(this).find('.progress_number_wrapper').css('width', '0%'); 2757 $j(this).find('.progress_number_wrapper').animate({'width': percentage+'%'}, 1500); 2758 } 2759 else { 2760 $j(this).appear(function() { 2761 initToCounterHorizontalProgressBar($j(this)); 2762 var percentage = $j(this).find('.progress_content').data('percentage'); 2763 $j(this).find('.progress_content').css('width', '0%'); 2764 $j(this).find('.progress_content').animate({'width': percentage+'%'}, 1500); 2765 $j(this).find('.progress_number_wrapper').css('width', '0%'); 2766 $j(this).find('.progress_number_wrapper').animate({'width': percentage+'%'}, 1500); 2767 2768 2769 },{accX: 0, accY: -200}); 2770 } 2771 }); 2772 } 2773} 2774 2775/* 2776** Counter for horizontal progress bars percent from zero to defined percent 2777*/ 2778function initToCounterHorizontalProgressBar($this){ 2779 "use strict"; 2780 2781 var percentage = parseFloat($this.find('.progress_content').data('percentage')); 2782 if($this.find('.progress_number span').length) { 2783 $this.find('.progress_number span').each(function() { 2784 $j(this).parents('.progress_number_wrapper').css('opacity', '1'); 2785 $j(this).countTo({ 2786 from: 0, 2787 to: percentage, 2788 speed: 1500, 2789 refreshInterval: 50 2790 }); 2791 }); 2792 } 2793} 2794 2795/* 2796** Unordered list animation effect 2797*/ 2798function initListAnimation(){ 2799 "use strict"; 2800 2801 if($j('.animate_list').length > 0 && $j('.no_animation_on_touch').length === 0){ 2802 $j('.animate_list').each(function(){ 2803 $j(this).appear(function() { 2804 $j(this).find("li").each(function (l) { 2805 var k = $j(this); 2806 setTimeout(function () { 2807 k.animate({ 2808 opacity: 1, 2809 top: 0 2810 }, 1500); 2811 }, 100*l); 2812 }); 2813 },{accX: 0, accY: -200}); 2814 }); 2815 } 2816} 2817 2818/* 2819** Pie Chart shortcode 2820*/ 2821function initPieChart(){ 2822 "use strict"; 2823 2824 if($j('.q_percentage').length){ 2825 $j('.q_percentage').each(function() { 2826 2827 var $barColor = piechartcolor; 2828 2829 if(typeof $j(this).data('active') !== 'undefined' && $j(this).data('active') !== ""){ 2830 $barColor = $j(this).data('active'); 2831 } 2832 2833 var $trackColor = '#eeeeee'; 2834 2835 if(typeof $j(this).data('noactive') !== 'undefined' && $j(this).data('noactive') !== ""){ 2836 $trackColor = $j(this).data('noactive'); 2837 } 2838 2839 var $line_width = 10; 2840 2841 if(typeof $j(this).data('linewidth') !== 'undefined' && $j(this).data('linewidth') !== ""){ 2842 $line_width = $j(this).data('linewidth'); 2843 } 2844 2845 var $size = 174; 2846 2847 var axis = 200; 2848 if(typeof $j(this).data('element-appearance') !== 'undefined' && $j(this).data('element-appearance') !== false) { 2849 axis = $j(this).data('element-appearance'); 2850 } 2851 2852 $j(this).appear(function() { 2853 initToCounterPieChart($j(this)); 2854 $j(this).parent().css('opacity', '1'); 2855 2856 $j(this).easyPieChart({ 2857 barColor: $barColor, 2858 trackColor: $trackColor, 2859 scaleColor: false, 2860 lineCap: 'butt', 2861 lineWidth: $line_width, 2862 animate: 1500, 2863 size: $size 2864 }); 2865 },{accX: 0, accY: -axis}); 2866 }); 2867 } 2868} 2869 2870/* 2871** Pie Chart shortcode 2872*/ 2873function initPieChartWithIcon(){ 2874 "use strict"; 2875 2876 if($j('.q_percentage_with_icon').length){ 2877 $j('.q_percentage_with_icon').each(function() { 2878 2879 var $barColor = piechartcolor; 2880 2881 if($j(this).data('active') !== ""){ 2882 $barColor = $j(this).data('active'); 2883 } 2884 2885 var $trackColor = '#eeeeee'; 2886 2887 if($j(this).data('noactive') !== ""){ 2888 $trackColor = $j(this).data('noactive'); 2889 } 2890 2891 var $line_width = 10; 2892 2893 if($j(this).data('linewidth') !== ""){ 2894 $line_width = $j(this).data('linewidth'); 2895 } 2896 2897 var $size = 174; 2898 2899 $j(this).appear(function() { 2900 $j(this).parent().css('opacity', '1'); 2901 $j(this).css('opacity', '1'); 2902 $j(this).easyPieChart({ 2903 barColor: $barColor, 2904 trackColor: $trackColor, 2905 scaleColor: false, 2906 lineCap: 'butt', 2907 lineWidth: $line_width, 2908 animate: 1500, 2909 size: $size 2910 }); 2911 }
2911,{accX: 0, accY: -200}); 2912 }); 2913 } 2914} 2915 2916/* 2917** Counter for pie chart number from zero to defined number 2918*/ 2919function initToCounterPieChart($this){ 2920 "use strict"; 2921 2922 $j($this).css('opacity', '1'); 2923 var $max = parseFloat($j($this).find('.tocounter').text()); 2924 $j($this).find('.tocounter').countTo({ 2925 from: 0, 2926 to: $max, 2927 speed: 1500, 2928 refreshInterval: 50 2929 }); 2930} 2931 2932/* 2933** Init Portfolio list and Portfolio Filter 2934*/ 2935function initPortfolio(){ 2936 "use strict"; 2937 2938 if($j('.projects_holder_outer:not(.masonry_with_space, .justified_gallery)').length){ 2939 $j('.projects_holder_outer').each(function(){ 2940 2941 var currentPortfolio = $j(this).find('.projects_holder'); 2942 2943 if(getIEversion() == 9 || getIEversion() == 10){ 2944 currentPortfolio.addClass('ie-specific-styles'); 2945 } 2946 2947 $j('.filter_holder .filter').on('click',function(){ 2948 var $this = $j(this).text(); 2949 var activeFilter = $j(this).data('filter'); 2950 2951 if(currentPortfolio.children('article').length) { 2952 currentPortfolio.children('article').each(function(){ 2953 var thisArtcile = $j(this); 2954 2955 if(thisArtcile.hasClass(activeFilter) && activeFilter !== 'all') { 2956 thisArtcile.find('a.lightbox').attr('rel','prettyPhoto[pretty_photo_gallery_'+$this.toLowerCase()+']'); 2957 thisArtcile.find('a.lightbox').attr('data-rel','prettyPhoto[pretty_photo_gallery_'+$this.toLowerCase()+']'); 2958 } else if(activeFilter === 'all') { 2959 thisArtcile.find('a.lightbox').attr('rel','prettyPhoto[pretty_photo_gallery]'); 2960 thisArtcile.find('a.lightbox').attr('data-rel','prettyPhoto[pretty_photo_gallery]'); 2961 } 2962 }); 2963 } 2964 2965 var dropLabels = $j('.filter_holder').find('.label span'); 2966 dropLabels.each(function(){ 2967 $j(this).text($this); 2968 }); 2969 }); 2970 2971 if(currentPortfolio.hasClass('v1')){ 2972 var timeArray= new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25); 2973 }else if(currentPortfolio.hasClass('v2')){ 2974 var timeArray= new Array(1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20); 2975 }else if(currentPortfolio.hasClass('v3')){ 2976 var timeArray= new Array(1,2,3,2,3,4,3,4,5,4,5,6,5,6,7,6,7,8,7,8,9,8,9,10,9,10,11,10,11,12,11,12,13,12,13,14,13,14,15,14,15,16,15,16,17,16,17,18,17,18,19,18,19,20,19,20,21,20,21,22); 2977 }else if(currentPortfolio.hasClass('v4')){ 2978 var timeArray= new Array(1,2,3,4,2,3,4,5,3,4,5,6,4,5,6,7,5,6,7,8,6,7,8,9,7,8,9,10,8,9,10,11,9,10,11,12,10,11,12,13,11,12,13,14,12,13,14,15,13,14,15,16,14,15,16,17,15,16,17,18,16,17,18,19,17,18,19,20,18,19,20,21); 2979 }else if(currentPortfolio.hasClass('v5')){ 2980 var timeArray= new Array(1,2,3,4,5,2,3,4,5,6,3,4,5,6,7,4,5,6,7,8,5,6,7,8,9,6,7,8,9,10,7,8,9,10,11,8,9,10,11,12,9,10,11,12,13,10,11,12,13,14,11,12,13,14,15,12,13,14,15,16,13,14,15,16,17,14,15,16,17,18,15,16,17,18,19,20,16,17,18,19,20,17,18,19,20,21,18,19,20,21,22,19,20,21,22,23); 2981 }else if(currentPortfolio.hasClass('v6')){ 2982 var timeArray= new Array(1,2,3,4,5,6,2,3,4,5,6,7,3,4,5,6,7,8,4,5,6,7,8,9,5,6,7,8,9,10,6,7,8,9,10,11,7,8,9,10,11,12,8,9,10,11,12,13,9,10,11,12,13,14,10,11,12,13,14,15,11,12,13,14,15,16,12,13,14,15,16,17,13,14,15,16,17,18,14,15,16,17,18,19,15,16,17,18,19,20,16,17,18,19,20,21,17,18,19,20,21,22); 2983 } 2984 2985 var filterOnLoad; 2986 if(window.location.hash && (window.location.hash).indexOf("portfolio_category") == 1) { 2987 filterOnLoad = (window.location.hash).replace('#',''); 2988 } else { 2989 filterOnLoad = 'all'; 2990 } 2991 qodeInitPortFilterCounter($j(this)); 2992 currentPortfolio.mixitup({ 2993 showOnLoad: filterOnLoad, 2994 transitionSpeed: 600, 2995 minHeight: 150, 2996 onMixLoad: function(){ 2997 $j('.projects_holder').addClass('hideItems'); 2998 $j('.projects_holder article').css('visibility','visible'); 2999 3000 if(currentPortfolio.hasClass('portfolio_one_by_one')) { 3001 currentPortfolio.find('article').each(function(l) { 3002 var currentPortfolioItem = $j(this); 3003 if($j('.vertical_split_slider').length){ 3004 var acc = 0; 3005 }else{ 3006 var acc = -150; 3007 } 3008 currentPortfolioItem.appear(function(){ 3009 setTimeout(function() { 3010 currentPortfolioItem.addClass('show'); 3011 }, 100*l); 3012 }
3012,{accX: 0, accY: -150}); 3013 }); 3014 } 3015 3016 if(currentPortfolio.hasClass('slide_from_left')) { 3017 currentPortfolio.find('article').each(function(i) { 3018 var currentPortfolioItem = $j(this); 3019 3020 currentPortfolioItem.appear(function(){ 3021 setTimeout(function() { 3022 currentPortfolioItem.addClass('show'); 3023 }, (Math.random() * 200)); 3024 },{accX: 0, accY: -150}); 3025 }); 3026 } 3027 3028 if(currentPortfolio.hasClass('slide_from_top')) { 3029 currentPortfolio.find('article').each(function(i) { 3030 var currentPortfolioItem = $j(this); 3031 currentPortfolioItem.appear(function(){ 3032 setTimeout(function() { 3033 currentPortfolioItem.addClass('show'); 3034 }, timeArray[i]*50); 3035 },{accX: 0, accY: -150}); 3036 }); 3037 } 3038 3039 if(currentPortfolio.hasClass('diagonal_fade')) { 3040 currentPortfolio.find('article').each(function(i) { 3041 var currentPortfolioItem = $j(this); 3042 currentPortfolioItem.appear(function(){ 3043 setTimeout(function() { 3044 currentPortfolioItem.addClass('show'); 3045 }, timeArray[i]*50); 3046 },{accX: 0, accY: -150}); 3047 }); 3048 } 3049 initParallax(); 3050 }, 3051 onMixEnd: function(){ 3052 initParallax(); 3053 } 3054 }); 3055 }); 3056 } 3057} 3058 3059/* 3060 ** Init z-index for portfolio items 3061 */ 3062function initPortfolioZIndex(){ 3063 "use strict"; 3064 3065 if($j('.projects_holder_outer.portfolio_no_space').length){ 3066 $j('.no_space.hover_text article').each(function(i){ 3067 $j(this).css('z-index', i +10); 3068 }); 3069 } 3070} 3071 3072function initPortfolioJustifiedGallery() { 3073 "use strict"; 3074 3075 var project_holder = $j('.projects_holder_outer.justified_gallery'); 3076 project_holder.each(function() { 3077 var filter_holder = $j(this).find('.filter_holder'); 3078 3079 filter_holder.find('li.filter').first().addClass('current'); 3080 3081 filter_holder.find('.filter').on('click',function(){ 3082 var $this = $j(this).text(); 3083 var dropLabels = filter_holder.find('.label span'); 3084 dropLabels.each(function(){ 3085 $j(this).text($this); 3086 }); 3087 3088 var selector = $j(this).attr('data-filter'); 3089 var articles = the_gallery.find('article'); 3090 var transition_duration = 500; 3091 articles.css('transition','all '+transition_duration+'ms ease'); 3092 articles.not(selector).css({ 3093 'transform': 'scale(0)' 3094 }); 3095 setTimeout(function() { 3096 articles.filter(selector).css({ 3097 'transform': '' 3098 }); 3099 the_gallery.css('transition','height '+transition_duration+'ms ease').justifiedGallery({selector: '>article'+(selector != '*' ? selector : '')}); 3100 }, 1.1*transition_duration); 3101 setTimeout(function() { 3102 articles.css('transition',''); 3103 the_gallery.css('transition',''); 3104 }, 2.2*transition_duration); 3105 3106 $j(".filter").removeClass("current active"); 3107 $j(this).addClass("current active"); 3108 3109 return false; 3110 }); 3111 3112 qodeInitPortFilterCounter(project_holder); 3113 var the_gallery = $j(this).find('.projects_holder'); 3114 var row_height = typeof the_gallery.data('row-height') !== 'undefined' ? the_gallery.data('row-height') : 200, 3115 spacing = typeof the_gallery.data('spacing') !== 'undefined' ? the_gallery.data('spacing') : 0, 3116 last_row = typeof the_gallery.data('last-row') !== 'undefined' ? the_gallery.data('last-row') : 'nojustify', 3117 justify_threshold = typeof the_gallery.data('justify-threshold') !== 'undefined' ? the_gallery.data('justify-threshold') : 0.75; 3118 the_gallery 3119 .justifiedGallery({ 3120 captions: false, 3121 rowHeight: row_height, 3122 margins: spacing, 3123 border: 0, 3124 lastRow: last_row, 3125 justifyThreshold: justify_threshold, 3126 selector: '> article' 3127 }) 3128 .on('jg.complete jg.rowflush', function() { 3129 $j(this).find('article').addClass('show').each(function() { 3130 $j(this).height(Math.round($j(this).height())); 3131 }); 3132 }); 3133 }); 3134} 3135 3136function initPortfolioMasonryFilter(){ 3137 3138 "use strict"; 3139 3140 var masonry_holder = $j('.projects_masonry_holder, .masonry_with_space .projects_holder'); 3141 if (masonry_holder.length) { 3142 var portfolioIsotopeAnimation = null; 3143 $j('.filter:first').addClass('current'); 3144 $j('.filter').on('click', function(){ 3145 3146 clearTimeout(portfolioIsotopeAnimation); 3147 $j('.isotope, .isotope .isotope-item').css('transition-duration','0.8s'); 3148 portfolioIsotopeAnimation = setTimeout(function(){ $j('.isotope, .isotope .isotope-item').css('transition-duration','0s'); },700); 3149 3150 var selector = $j(this).attr('data-filter'); 3151 masonry_holder.isotope({ filter: selector }); 3152 3153 $j(".filter").removeClass("current"); 3154 $j(this).addClass("current"); 3155 3156 var $filterText = $j(this).text(); 3157 if(selector !== '*') { 3158 selector = selector.substring(1); // because first character is dot 3159 } 3160 3161 if(masonry_holder.children('article').length) { 3162 masonry_holder.children('article').each(function(){ 3163 var thisArtcile = $j(this); 3164 3165 if(thisArtcile.hasClass(selector) && selector !== '*') { 3166 thisArtcile.find('a.lightbox').attr('rel','prettyPhoto[pretty_photo_gallery_'+$filterText.toLowerCase()+']'); 3167 thisArtcile.find('a.lightbox').attr('data-rel','prettyPhoto[pretty_photo_gallery_'+$filterText.toLowerCase()+']'); 3168 } else if(selector === '*') { 3169 thisArtcile.find('a.lightbox').attr('rel','prettyPhoto[pretty_photo_gallery]'); 3170 thisArtcile.find('a.lightbox').attr('data-rel','prettyPhoto[pretty_photo_gallery]'); 3171 } 3172 }); 3173 } 3174 3175 setTimeout(setPortfolioMasZIndex(),700); 3176 3177 return false;
3178 }); 3179 } 3180} 3181 3182function initPortfolioMasonry(){ 3183 "use strict"; 3184 3185 var portList = $j('.projects_masonry_holder, .masonry_with_space .projects_holder'); 3186 if(portList.length) { 3187 portList.each(function() { 3188 var thisPortList = $j(this); 3189 var size = thisPortList.find('.qode-portfolio-masonry-gallery-grid-sizer').width(); 3190 3191 if(portList.hasClass('projects_masonry_holder')) { 3192 resizeMasonry(size,thisPortList); 3193 } 3194 qodeInitMasonry(thisPortList); 3195 qodeInitPortFilterCounter(portList.parent()); 3196 $j(window).resize(function(){ 3197 setPortfolioMasZIndex(); 3198 if(portList.hasClass('projects_masonry_holder')) { 3199 resizeMasonry(size, thisPortList); 3200 } 3201 qodeInitMasonry(thisPortList); 3202 }); 3203 }); 3204 } 3205} 3206 3207function qodeInitMasonry(container){ 3208 container.waitForImages(function() { 3209 container.animate({opacity:1}); 3210 container.isotope({ 3211 itemSelector: '.portfolio_masonry_item, .masonry_with_space .mix', 3212 masonry: { 3213 columnWidth: '.qode-portfolio-masonry-gallery-grid-sizer' 3214 } 3215 }); 3216 if(container.hasClass('portfolio_one_by_one')) { 3217 container.find('article').each(function(l) { 3218 var $this = $j(this); 3219 setTimeout(function() { 3220 $this.addClass('show'); 3221 }, 100*l); 3222 }); 3223 } 3224 3225 if(container.hasClass('portfolio_fade_from_bottom')) { 3226 container.find('article').each(function(l) { 3227 var $this = $j(this); 3228 $j(this).css({ 3229 'opacity': '0', 3230 'transform':'translateY(150px)' 3231 }); 3232 $j(this).appear(function() { 3233 setTimeout(function() { 3234 $this.css({'opacity':'1','transition':'all .8s ease','transform':'translateY(0)'}); 3235 }, 100); 3236 },{accX: 0, accY: -150}); 3237 }); 3238 } 3239 }); 3240} 3241 3242function resizeMasonry(size, container){ 3243 var $window = jQuery(window); 3244 3245 if(container.hasClass('portfolio_masonry_gallery_with_space')) { 3246 var defaultMasonryItem = container.find('.portfolio_masonry_item.default'); 3247 var largeWidthMasonryItem = container.find('.large_width'); 3248 var largeHeightMasonryItem = container.find('.large_height'); 3249 var largeWidthHeightMasonryItem = container.find('.large_width_height'); 3250 3251 defaultMasonryItem.css('height', size); 3252 largeHeightMasonryItem.css('height', Math.round(2*size)); 3253 3254 if($window.innerWidth() > 480){ 3255 largeWidthHeightMasonryItem.css('height', Math.round(2*size)); 3256 largeWidthMasonryItem.css('height', size); 3257 }else{ 3258 largeWidthHeightMasonryItem.css('height', size); 3259 3260 } 3261 } else { 3262 var largeItemHeight; 3263 if(container.find('article[class*="default"]:first img').height()){ 3264 largeItemHeight = container.find('article[class*="default"]:first img').height(); 3265 }else if(container.find('article[class*="large_width"]:not(.large_width_height):first img').height()){ 3266 largeItemHeight = container.find('article[class*="large_width"]:not(.large_width_height):first img').height(); 3267 }else{ 3268 largeItemHeight = (container.find('article[class*="large_width_height"]:first img').height()) ? (container.find('article[class*="large_width_height"]:first img').height())/2 : (container.find('article[class*="large_height"]:first img').height())/2; 3269 } 3270 var double = ($window.innerWidth() > 480) ? 2 : 1 ; 3271 container.find('article[class*="large_width_height"] img, article[class*="large_height"] img').css('height',(largeItemHeight*double)); 3272 } 3273 3274 3275} 3276 3277 3278 3279function setPortfolioMasZIndex(){ 3280 var $elemXPos = {}; 3281 var $elemZIndex = {}; 3282 3283 $j('.projects_masonry_holder article').each(function(){ 3284 $elemXPos[$j(this).index()] = getPortfolioXPos($j(this).css('left')); 3285 }); 3286 3287 var $elemXPosArray = $j.map($elemXPos, function (value) { return value; }); 3288 $elemXPosArray = cleanPortfolioMasXArray($elemXPosArray); 3289 $elemXPosArray.sort(function(x,y){return x-y}); 3290 3291 for(var i = 0; i < $elemXPosArray.length; i++){ 3292 $elemZIndex[$elemXPosArray[i]] = i*10; 3293 } 3294 3295 $j.each($elemXPos,function(key,val){ 3296 3297 var $zi; 3298 var $bgd = val; 3299 $j.each($elemZIndex,function(key,val){ 3300 if($bgd == key) { 3301 $zi = val; 3302 } 3303 }); 3304 3305 $j('.projects_masonry_holder article:eq('+key+')').css('z-index',$zi); 3306 }); 3307} 3308 3309 3310function cleanPortfolioMasXArray($elemXPosArray) { 3311 var i; 3312 var length = $elemXPosArray.length; 3313 var $elemXPosOutArray = []; 3314 var tmp = {}; 3315 3316 for (i = 0; i < length; i++) { 3317 tmp[$elemXPosArray[i]] = 0; 3318 } 3319 for (i in tmp) { 3320 $elemXPosOutArray.push(i); 3321 } 3322 return $elemXPosOutArray; 3323} 3324 3325function getPortfolioXPos(css) { 3326 //return css.substr(7, css.length - 8).split(', ')[4]; 3327 return css.substr(0, css.length - 2); 3328} 3329 3330 3331/** 3332 * Initializes filter counter 3333 * Category name is second item in class array by default 3334 */ 3335function qodeInitPortFilterCounter(container){ 3336 3337 if(container.hasClass('portfolio_holder_fwn')){ 3338 var articles = (container.find('article')); 3339 var filters = (container.find('.filter_holder ul li')); 3340 3341 filters.each(function(){ 3342 var item = $j(this); 3343 3344 if((item).data('filter') == 'all' || (item).data('filter') == '*'){ 3345 updateResult(item,".filter_number_of_items", articles.length); 3346 } 3347 else{ 3348 var categoryClass = item.attr('data-filter'); 3349 categoryClass = categoryClass.replace(/\./g, ''); 3350 updateResult(item,".filter_number_of_items", container.find('article.'+categoryClass).length); 3351 } 3352 3353 }); 3354 3355 filters.css('opacity','1'); 3356 3357 } 3358 3359 function updateResult(item, pos ,value){ 3360 item.find(pos).text(value); 3361 } 3362} 3363 3364 3365/* 3366* Get global grid width 3367*/ 3368function qodeGridWidth() { 3369 var bodyClasses = qode_body.attr("class"); 3370 3371 if (bodyClasses.match(/grid[\w-]*\b/)) { 3372 gridClass = bodyClasses.match(/grid[\w-]*\b/).toString(); 3373 qode_grid_width = parseInt(gridClass.substr(5)); 3374 } 3375} 3376 3377function initServiceAnimation(){ 3378 "use strict"; 3379 3380 if($j(".fade_in_circle_holder").length > 0 && $j('.no_animation_on_touch').length === 0){ 3381 $j('.fade_in_circle_holder').each(function(){ 3382 $j(this).appear(function(){ 3383 $j(this).addClass('animate_circle'); 3384 }
3384,{accX: 0, accY: -200}); 3385 }); 3386 } 3387} 3388 3389function checkTitleToShowOrHide(){ 3390 if($j('.title_outer.animate_title_area').length){ 3391 var title_area_height = $j('.title_outer').data('height'); 3392 if($scroll > $j('.title').height()){ 3393 $j('.title_outer').css({'height':title_area_height, 'opacity':'1', 'overflow':'visible'}); 3394 } 3395 } 3396} 3397 3398/* 3399** Title area animation 3400*/ 3401function initTitleAreaAnimation(){ 3402 if($j('.title_outer.animate_title_area').length){ 3403 3404 var title_area_height = $j('.title_outer').data('height'); 3405 if($j('.title_outer').hasClass('with_image')){ 3406 title_area_height = $j('.image.responsive').height(); 3407 } 3408 if($scroll < $j('.title').height()){ 3409 $j('.title_outer').animate({ height: title_area_height, opacity: 1}, 500, function(){ 3410 $j(this).css({'overflow':'visible'}); 3411 initPortfolioSingleInfo(); 3412 if($j('nav.content_menu').length > 0){ 3413 content_menu_position = $j('nav.content_menu').offset().top; 3414 contentMenuPosition(); 3415 } 3416 }); 3417 } 3418 } 3419} 3420 3421 3422/* 3423** Title image with parallax effect 3424*/ 3425function initParallaxTitle(){ 3426 "use strict"; 3427 3428 if(($j('.title').length > 0) && ($j('.touchevents').length === 0)){ 3429 3430 if($j('.title.has_fixed_background').length){ 3431 3432 var $background_size_width = parseInt($j('.title.has_fixed_background').css('background-size').match(/\d+/)); 3433 3434 var title_holder_height = $j('.title.has_fixed_background').height(); 3435 var title_rate = (title_holder_height / 10000) * 7; 3436 3437 var title_distance = $scroll - $j('.title.has_fixed_background').offset().top; 3438 var title_bpos = -(title_distance * title_rate); 3439 $j('.title.has_fixed_background').css({'background-position': 'center '+ (0+add_for_admin_bar) +'px' }); 3440 if($j('.title.has_fixed_background').hasClass('zoom_out')){ 3441 $j('.title.has_fixed_background').css({'background-size': $background_size_width-$scroll + 'px auto'}); 3442 } 3443 } 3444 3445 $j(window).on('scroll', function() { 3446 if($j('.title.has_fixed_background').length){ 3447 3448 var title_distance = $scroll - $j('.title.has_fixed_background').offset().top; 3449 3450 var title_bpos = -(title_distance * title_rate); 3451 $j('.title.has_fixed_background').css({'background-position': 'center ' + (title_bpos+add_for_admin_bar) + 'px' }); 3452 if($j('.title.has_fixed_background').hasClass('zoom_out')){ 3453 $j('.title.has_fixed_background').css({'background-size': $background_size_width-$scroll + 'px auto'}); 3454 } 3455 } 3456 }); 3457 } 3458} 3459 3460/* 3461 Plugin: jQuery Parallax 3462 Version 1.1.3 3463 Author: Ian Lunn 3464 Twitter: @IanLunn 3465 Author URL: http://www.ianlunn.co.uk/ 3466 Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/ 3467 3468 Dual licensed under the MIT and GPL licenses: 3469 http://www.opensource.org/licenses/mit-license.php 3470 http://www.gnu.org/licenses/gpl.html 3471 */ 3472 3473(function( $ ){ 3474 var $window = $(window); 3475 var windowHeight = $window.height(); 3476 3477 $window.resize(function () { 3478 windowHeight = $window.height(); 3479 }); 3480 3481 $.fn.parallax = function(xpos, speedFactor, outerHeight) { 3482 var $this = $(this); 3483 var getHeight; 3484 var firstTop; 3485 var paddingTop = 0; 3486 3487 //get the starting position of each element to have parallax applied to it 3488 $this.each(function(){ 3489 firstTop = $this.offset().top; 3490 }); 3491 3492 if (outerHeight) { 3493 getHeight = function(jqo) { 3494 return jqo.outerHeight(true); 3495 }; 3496 } else { 3497 getHeight = function(jqo) { 3498 return jqo.height(); 3499 }; 3500 } 3501 3502 // setup defaults if arguments aren't specified 3503 if (arguments.length < 1 || xpos === null) xpos = "50%"; 3504 if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1; 3505 if (arguments.length < 3 || outerHeight === null) outerHeight = true; 3506 3507 // function to be called whenever the window is scrolled or resized 3508 function update(){ 3509 var pos = $window.scrollTop(); 3510 3511 $this.each(function(){ 3512 var $element = $(this); 3513 var top = $element.offset().top; 3514 var height = getHeight($element); 3515 3516 // Check if totally above or totally below viewport 3517 if (top + height < pos || top > pos + windowHeight) { 3518 return; 3519 } 3520 3521 $this.css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px"); 3522 }); 3523 } 3524 3525 $window.bind('scroll', update).resize(update); 3526 update(); 3527 }; 3528})(jQuery); 3529 3530 3531/* 3532 ** Sections with parallax background image 3533 */ 3534function initParallax(){ 3535 "use strict"; 3536 if($j('.parallax_section_holder').length){ 3537 $j('.parallax_section_holder').each(function() { 3538 var parallaxElement = $j(this); 3539 if(parallaxElement.hasClass('qode_full_screen_height_parallax')){ 3540 parallaxElement.height($window_height); 3541 //parallaxElement.find('.qodef-parallax-content-outer').css('padding',0); 3542 } 3543 var speed = parallaxElement.data('speed')*0.4; 3544 parallaxElement.parallax("50%", speed); 3545 }); 3546 } 3547} 3548 3549/* 3550** Smooth scroll functionality for Side Area 3551*/ 3552function initSideAreaScroll(){ 3553 "use strict"; 3554 3555 if($j('.side_menu').length){ 3556 $j(".side_menu").niceScroll({ 3557 scrollspeed: 60, 3558 mousescrollstep: 40, 3559 cursorwidth: 0, 3560 cursorborder: 0,
3561 cursorborderradius: 0, 3562 cursorcolor: "transparent", 3563 autohidemode: false, 3564 horizrailenabled: false 3565 }); 3566 } 3567} 3568 3569/* 3570 ** Smooth scroll functionality for Vertical Menu Area Toogle style 3571 */ 3572function initVerticalAreaMenuScroll(){ 3573 "use strict"; 3574 3575 if($j('.vertical_menu_area.with_scroll').length){ 3576 $j(".vertical_menu_area.with_scroll").niceScroll({ 3577 scrollspeed: 60, 3578 mousescrollstep: 40, 3579 cursorwidth: 0, 3580 cursorborder: 0, 3581 cursorborderradius: 0, 3582 cursorcolor: "transparent", 3583 autohidemode: false, 3584 horizrailenabled: false 3585 }); 3586 3587 } 3588} 3589 3590/* 3591** Load more portfolios 3592*/ 3593function loadMore(){ 3594 "use strict"; 3595 3596 var i = 1; 3597 3598 $j('.load_more a').on('click', function(e) { 3599 e.preventDefault(); 3600 3601 var currentElement = $j(this); 3602 var currentElementHolder = $j(this).closest('.projects_holder_outer'); 3603 var link = $j(this).attr('href'); 3604 var $content = '.projects_holder'; 3605 var $anchor = '.portfolio_paging .load_more a'; 3606 var $next_href = $j($anchor).attr('href'); // Get URL for the next set of posts 3607 var filler_num = $j('.projects_holder .filler').length; 3608 3609 var load_more_holder = $j('.portfolio_paging'); 3610 var loading_holder = $j('.portfolio_paging_loading'); 3611 3612 load_more_holder.hide(); 3613 loading_holder.show(); 3614 3615 $j.get(link+'', function(data){ 3616 if (!$j($content).is('.justified-gallery')) { 3617 $j('.projects_holder .filler').slice(-filler_num).remove(); 3618 var $new_content = $j($content, data).wrapInner('').html(); // Grab just the content 3619 $next_href = $j($anchor, data).attr('href'); // Get the new href 3620 $j($content, data).waitForImages(function() { 3621 3622 $j('article.mix:last').after($new_content); // Append the new content 3623 3624 $j('.projects_holder article').css('visibility','visible'); 3625 $j('article:not(.show)').each(function(l){ 3626 $j(this).addClass('show'); 3627 }); 3628 3629 if($j('.masonry_with_space').length){ 3630 $j('.masonry_with_space .projects_holder').isotope('reloadItems').isotope(); 3631 }else{ 3632 var min_height = $j('article.mix:first').height(); 3633 $j('article.mix').css('min-height',min_height); 3634 $j('.projects_holder').mixitup('remix','all'); 3635 } 3636 prettyPhoto(); 3637 if($j('.load_more').attr('rel') > i) { 3638 $j('.load_more a').attr('href', $next_href); // Change the next URL 3639 } else { 3640 $j('.load_more').remove(); 3641 } 3642 $j('.projects_holder .portfolio_paging:last').remove(); // Remove the original navigation 3643 $j('article.mix').css('min-height',0); 3644 3645 load_more_holder.show(); 3646 loading_holder.hide(); 3647 }); 3648 } 3649 else { 3650 var $new_content = $j($content, data).wrapInner('').html(); // Grab just the content 3651 $next_href = $j($anchor, data).attr('href'); // Get the new href 3652 $j($content, data).waitForImages(function() { 3653 3654 $j($content).find('article:last').after($new_content); // Append the new content 3655 3656 $j($content).find('article').css('visibility','visible'); 3657 $j($content).justifiedGallery('norewind'); 3658 prettyPhoto(); 3659 if($j('.load_more').attr('rel') > i) { 3660 $j('.load_more a').attr('href', $next_href); // Change the next URL 3661 } else { 3662 $j('.load_more').remove(); 3663 } 3664 $j('.projects_holder .portfolio_paging:last').remove(); // Remove the original navigation 3665 3666 load_more_holder.show(); 3667 loading_holder.hide(); 3668 }); 3669 } 3670 }).done(function() { 3671 setTimeout(function(){ 3672 initPortfolioMasonry(); 3673 qodeInitPortFilterCounter(currentElementHolder); 3674 },1000); 3675 }); 3676 i++; 3677 3678 3679 }); 3680} 3681 3682/* 3683** Picture popup for portfolio lists and portfolio single 3684*/ 3685function prettyPhoto(){ 3686 "use strict"; 3687 3688 $j('a[data-rel]').each(function() { 3689 $j(this).attr('rel', $j(this).data('rel')); 3690 }); 3691 3692 // TODO make this in one call of prettyPhoto 3693 3694 $j("a[rel^='prettyPhoto']:not(.qode-single-image-pretty-photo)").prettyPhoto({ 3695 animation_speed: 'normal', /* fast/slow/normal */ 3696 slideshow: false, /* false OR interval time in ms */ 3697 autoplay_slideshow: false, /* true/false */ 3698 opacity: 0.80, /* Value between 0 and 1 */ 3699 show_title: true, /* true/false */ 3700 allow_resize: true, /* Resize the photos bigger than viewport. true/false */ 3701 horizontal_padding: 0, 3702 default_width: 650, 3703 default_height: 400, 3704 counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */ 3705 theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */ 3706 hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */ 3707 wmode: 'opaque', /* Set the flash wmode attribute */ 3708 autoplay: true, /* Automatically start videos: True/False */ 3709 modal: false, /* If set to true, only the close button will close the window */ 3710 overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */ 3711 keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */ 3712 deeplinking: false, 3713 social_tools: false 3714 }); 3715 3716 $j("a[rel^='prettyPhoto'].qode-single-image-pretty-photo").prettyPhoto({ 3717 animation_speed: 'normal', /* fast/slow/normal */ 3718 slideshow: false, /* false OR interval time in ms */ 3719 autoplay_slideshow: false, /* true/false */ 3720 opacity: 0.80, /* Value between 0 and 1 */ 3721 show_title: true, /* true/false */ 3722 allow_resize: true, /* Resize the photos bigger than viewport. true/false */ 3723 horizontal_padding: 0, 3724 default_width: 650, 3725 default_height: 400, 3726 counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */ 3727 theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */ 3728 hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */ 3729 wmode: 'opaque', /* Set the flash wmode attribute */ 3730 autoplay: true, /* Automatically start videos: True/False */ 3731 modal: false, /* If set to true, only the close button will close the window */ 3732 overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */ 3733 keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */ 3734 deeplinking: false, 3735 social_tools: false, 3736 changepicturecallback: function(){ 3737 $j('.pp_pic_holder').addClass('qode-pretty-photo-hide-navigation'); 3738 }, /* Called everytime an item is shown/changed */ 3739 }); 3740} 3741 3742/* 3743** Show/Hide Mobile menu 3744*/ 3745function initMobileMenu(){ 3746 "use strict"; 3747 3748 $j(".mobile_menu_button > span").on('tap click', function(e){ 3749 e.preventDefault(); 3750 3751 if ($j(".mobile_menu > ul").is(":visible")){ 3752 $j(".mobile_menu > ul").slideUp(200); 3753 } else { 3754 $j(".mobile_menu > ul").slideDown(200); 3755 } 3756 }); 3757 3758 initInsideMobileMenu(); 3759} 3760 3761/* 3762** Show/Hide second level in mobile menu (separated from initMobileMenu because of wpml reinit when ajax is enabled) 3763*/ 3764 3765function initInsideMobileMenu(){ 3766 "use strict"; 3767 3768 3769 $j(".mobile_menu > ul > li.has_sub > span.mobile_arrow, .mobile_menu > ul > li.has_sub > h3, .mobile_menu > ul > li.has_sub > a[href*='#']").on('tap click', function(e){ 3770 e.preventDefault(); 3771 3772 if ($j(this).closest('li.has_sub').find("> ul.sub_menu").is(":visible")){ 3773 $j(this).closest('li.has_sub').find("> ul.sub_menu").slideUp(200); 3774 $j(this).closest('li.has_sub').removeClass('open_sub'); 3775 } else { 3776 $j(this).closest('li.has_sub').addClass('open_sub'); 3777 $j(this).closest('li.has_sub').find("> ul.sub_menu").slideDown(200); 3778 } 3779 }); 3780 3781 $j(".mobile_menu > ul > li.has_sub > ul.sub_menu > li.has_sub > span.mobile_arrow, .mobile_menu > ul > li.has_sub > ul.sub_menu > li.has_sub > h3, .mobile_menu > ul > li.has_sub > ul.sub_menu > li.has_sub > a[href*='#']").on('tap click', function(e){ 3782 e.preventDefault(); 3783 3784 if ($j(this).parent().find("ul.sub_menu").is(":visible")){ 3785 $j(this).parent().find("ul.sub_menu").slideUp(200); 3786 $j(this).parent().removeClass('open_sub'); 3787 } else { 3788 $j(this).parent().addClass('open_sub'); 3789 $j(this).parent().find("ul.sub_menu").slideDown(200); 3790 } 3791 }); 3792 3793 $j(".mobile_menu ul li > a, .q_logo a").on('click', function(){ 3794 3795 if(($j(this).attr('href') !== "http://#") && ($j(this).attr('href') !== "#")){ 3796 $j(".mobile_menu > ul").slideUp(); 3797 } 3798 }); 3799} 3800 3801/* 3802** Init flexslider for portfolio single 3803*/ 3804function initFlexSlider(){ 3805 "use strict"; 3806 $j('.flexslider').each(function(){ 3807 var $this = $j(this); 3808 3809 var interval = 8000; 3810 if(typeof $this.data('interval') !== 'undefined' && $this.data('interval') !== false) { 3811 interval = parseFloat($this.data('interval')) * 1000; 3812 } 3813 3814 var directionNav = true; 3815 if(typeof $this.data('direction') !== 'undefined') { 3816 directionNav = $this.data('direction'); 3817 } 3818 3819 var controlNav = false;
3820 if(typeof $this.data('control') !== 'undefined'){ 3821 controlNav = $this.data('control'); 3822 } 3823 3824 var pauseOnHoverAction = true; 3825 if(typeof $this.data('pause-on-hover') !== 'undefined'){ 3826 pauseOnHoverAction = $this.data('pause-on-hover'); 3827 } 3828 3829 var enableDrag = false; 3830 if(typeof $this.data('drag') !== 'undefined'){ 3831 enableDrag = $this.data('drag'); 3832 } 3833 3834 var slideshow = true; 3835 if(interval === 0) { 3836 slideshow = false; 3837 } 3838 3839 var animation = 'slide'; 3840 if(typeof $this.data('flex_fx') !== 'undefined' && $this.data('flex_fx') !== false) { 3841 animation = $this.data('flex_fx'); 3842 } 3843 3844 $this.flexslider({ 3845 animationLoop: true, 3846 controlNav: controlNav, 3847 directionNav: directionNav, 3848 useCSS: false, 3849 pauseOnAction: pauseOnHoverAction, 3850 pauseOnHover: pauseOnHoverAction, 3851 slideshow: slideshow, 3852 animation: animation, 3853 prevText: "<div><i class='fa fa-angle-left'></i></div>", 3854 nextText: "<div><i class='fa fa-angle-right'></i></div>", 3855 animationSpeed: 600, 3856 slideshowSpeed: interval, 3857 touch: true, 3858 start: function(){ 3859 setTimeout(function(){$j(".flexslider").fitVids();},100); 3860 } 3861 }); 3862 3863 $this.find('.flex-direction-nav a').on('click', function(e){ 3864 e.preventDefault(); 3865 e.stopImmediatePropagation(); 3866 e.stopPropagation(); 3867 }); 3868 3869 if(enableDrag) { 3870 $this.swipe({ 3871 swipeLeft: function () { $this.flexslider('next'); }, 3872 swipeRight: function () { $this.flexslider('prev'); }, 3873 threshold: 20 3874 }); 3875 } 3876 3877 }); 3878} 3879 3880/* 3881** Init fitVideo function for responsive video files 3882*/ 3883function fitVideo(){ 3884 "use strict"; 3885 3886 $j(".portfolio_images").fitVids(); 3887 $j(".video_holder").fitVids(); 3888 $j(".format-video .post_image").fitVids(); 3889 $j(".format-video .q_masonry_blog_post_image").fitVids(); 3890} 3891 3892/* 3893** Function for follow portfolio single descripton 3894*/ 3895var $scrollHeight; 3896function initPortfolioSingleInfo(){ 3897 "use strict"; 3898 3899 var $sidebar = $j(".portfolio_single_follow"); 3900 if($j(".portfolio_single_follow").length > 0){ 3901 3902 var offset = $sidebar.offset(); 3903 $scrollHeight = $j(".portfolio_container").height(); 3904 var $scrollOffset = $j(".portfolio_container").offset(); 3905 var $window = $j(window); 3906 3907 var $headerHeight = parseInt($j('header.page_header').css('height'), 10); 3908 3909 $window.scroll(function() { 3910 if($window.width() > 960){ 3911 if ($window.scrollTop() + $headerHeight + 3 > offset.top) { 3912 if ($window.scrollTop() + $headerHeight + $sidebar.height() + 24 < $scrollOffset.top + $scrollHeight) { 3913 3914 $sidebar.stop().animate({ 3915 marginTop: $window.scrollTop() - offset.top + $headerHeight 3916 }); 3917 } else { 3918 $sidebar.stop().animate({ 3919 marginTop: $scrollHeight - $sidebar.height() - 24 3920 }); 3921 } 3922 } else { 3923 $sidebar.stop().animate({ 3924 marginTop: 0 3925 }); 3926 } 3927 }else{ 3928 $sidebar.css('margin-top',0); 3929 } 3930 }); 3931 } 3932} 3933 3934/* 3935** Init tabs shortcodes 3936*/ 3937function initTabs(){ 3938 "use strict"; 3939 if($j('.q_tabs').length){ 3940 $j('.q_tabs').appear(function() { 3941 $j('.q_tabs').css('visibility', 'visible'); 3942 },{accX: 0, accY: -100}); 3943 var $tabsNav = $j('.tabs-nav'); 3944 var $tabsNavLis = $tabsNav.children('li'); 3945 $tabsNav.each(function() { 3946 var $this = $j(this); 3947 $this.next().children('.tab-content').stop(true,true).hide().first().show(); 3948 $this.children('li').first().addClass('active').stop(true,true).show(); 3949 }); 3950 $tabsNavLis.on('click', function(e) { 3951 var $this = $j(this); 3952 $this.siblings().removeClass('active').end().addClass('active'); 3953 $this.parent().next().children('.tab-content').stop(true,true).hide().siblings( $this.find('a').attr('href') ).fadeIn(); 3954 e.preventDefault(); 3955 }); 3956 } 3957} 3958 3959 3960/* 3961 ** Init advanced tabs shortcode 3962 */ 3963function qodeInitAdvancedTabs(){ 3964 3965 var tabs = $j('.qode-advanced-tabs'); 3966 if(tabs.length){ 3967 tabs.each(function(){ 3968 var thisTabs = $j(this); 3969 3970 thisTabs.children('.qode-advanced-tab-container').each(function(index){ 3971 index = index + 1; 3972 var that = $j(this), 3973 link = that.attr('id'), 3974 navItem = that.parent().find('.qode-advanced-tabs-nav li:nth-child('+index+') a'), 3975 navLink = navItem.attr('href'); 3976 3977 link = '#'+link; 3978 if(link.indexOf(navLink) > -1) { 3979 navItem.attr('href',link); 3980 } 3981 }); 3982 3983 thisTabs.tabs(); 3984 }); 3985 } 3986} 3987 3988/* 3989 ** Generate icons in tabs navigation 3990 */ 3991function qodeInitAdvancedTabsIcons(){ 3992 3993 var tabContent = $j('.qode-advanced-tab-container'); 3994 if(tabContent.length){ 3995 3996 tabContent.each(function(){ 3997 var thisTabContent = $j(this); 3998 3999 var id = thisTabContent.attr('id'); 4000 var icon = ''; 4001 if(typeof thisTabContent.data('icon-html') !== 'undefined' || thisTabContent.data('icon-html') !== 'false') { 4002 icon = thisTabContent.data('icon-html'); 4003 } 4004 4005 var tabNav = thisTabContent.parents('.qode-advanced-tabs').find('.qode-advanced-tabs-nav > li a[href="#'+id+'"]'); 4006 if(typeof(tabNav) !== 'undefined') { 4007 tabNav.children('.qode-advanced-icon-frame').append(icon); 4008 } 4009 }); 4010 } 4011} 4012 4013/* 4014 ** Init accordion and toogle shortcodes 4015 */ 4016function initAccordion() { 4017 "use strict"; 4018 4019 if($j(".q_accordion_holder").length){ 4020 $j(".q_accordion_holder").appear(function() { 4021 $j(".q_accordion_holder").css('visibility', 'visible'); 4022 }
4022,{accX: 0, accY: -100}); 4023 4024 if ($j(".accordion").length) { 4025 $j(".accordion").accordion({ 4026 animate: "swing", 4027 collapsible: true, 4028 active: false, 4029 icons: "", 4030 heightStyle: "content", 4031 activate: function(event, ui) { 4032 initParallax(); 4033 } 4034 }); 4035 4036 //define custom options for each accordion 4037 $j(".accordion").each(function() { 4038 var activeTab = parseInt($j(this).data('active-tab')); 4039 if(activeTab !== "") { 4040 activeTab = activeTab - 1; // - 1 because active tab is set in 0 index base 4041 $j(this).accordion('option', 'active', activeTab); 4042 } 4043 var borderRadius = parseInt($j(this).data('border-radius')); 4044 4045 if(borderRadius !== "") { 4046 $j(this).find('.accordion_mark').css('border-radius', borderRadius+"px"); 4047 } 4048 var collapsible = ($j(this).data('collapsible') == 'yes') ? true : false; 4049 $j(this).accordion('option', 'collapsible', collapsible); 4050 $j(this).accordion('option', 'collapsible', collapsible); 4051 }); 4052 } 4053 $j(".toggle").addClass("accordion ui-accordion ui-accordion-icons ui-widget ui-helper-reset") 4054 .find(".title-holder") 4055 .addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-top ui-corner-bottom") 4056 .hover(function() { 4057 $j(this).toggleClass("ui-state-hover"); 4058 }) 4059 .on('click', function() { 4060 $j(this) 4061 .toggleClass("ui-accordion-header-active ui-state-active ui-state-default ui-corner-bottom") 4062 .next().toggleClass("ui-accordion-content-active").slideToggle(400); 4063 return false; 4064 }) 4065 .next() 4066 .addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom") 4067 .hide(); 4068 4069 $j(".toggle").each(function() { 4070 var activeTab = parseInt($j(this).data('active-tab')); 4071 if(activeTab !== "" && activeTab >= 1) { 4072 activeTab = activeTab - 1; // - 1 because active tab is set in 0 index base 4073 $j(this).find('.ui-accordion-content').eq(activeTab).show(); 4074 $j(this).find('.ui-accordion-header').eq(activeTab).addClass('ui-state-active'); //set active accordion header 4075 } 4076 4077 }); 4078 } 4079} 4080 4081/* 4082** Function to enable link in accordion 4083*/ 4084function initAccordionContentLink(){ 4085 "use strict"; 4086 4087 if($j(".accordion").length){ 4088 $j('.accordion_holder .accordion_inner .accordion_content a').on('click', function(){ 4089 if($j(this).attr('target') === '_blank'){ 4090 window.open($j(this).attr('href'),'_blank'); 4091 }else{ 4092 window.open($j(this).attr('href'),'_self'); 4093 } 4094 return false; 4095 }); 4096 } 4097} 4098 4099/* 4100** Init testimonials shortcode 4101*/ 4102function initTestimonials(){ 4103 "use strict"; 4104 4105 if($j('.testimonials_carousel').length){ 4106 $j('.testimonials_carousel').each(function(){ 4107 4108 var interval = 5000; 4109 var $this = $j(this); 4110 4111 if(typeof $this.data('auto-rotate-slides') !== 'undefined' && $this.data('auto-rotate-slides') !== false) { 4112 interval = parseFloat($this.data('auto-rotate-slides')) * 1000; 4113 } 4114 4115 var slideshow = true; 4116 if(interval === 0) { 4117 slideshow = false; 4118 } 4119 4120 var animation = 'fade'; 4121 if(typeof $this.data('animation-type') !== 'undefined' && $this.data('animation-type') !== false) { 4122 animation = $this.data('animation-type'); 4123 } 4124 4125 var directionNav = true; 4126 if(typeof $this.data('show-navigation') !== 'undefined') { 4127 directionNav = $this.data('show-navigation') == 'no' ? false : true; 4128 } 4129 4130 var animationSpeed = 600; 4131 if(typeof $this.data('animation-speed') !== 'undefined' && $this.data('animation-speed') !== false) { 4132 animationSpeed = $this.data('animation-speed'); 4133 } 4134 4135 var numberPerPage = qodeNumberOfTestimonialsItems($this); 4136 var itemWidth = 0; 4137 var itemMargin = 0; 4138 if(typeof numberPerPage !== 'undefined' && numberPerPage !== 1) { 4139 itemWidth = 200; //just dummy number, script will calculate it 4140 itemMargin = 40; 4141 } 4142 4143 $this.flexslider({ 4144 animationLoop: true, 4145 controlNav: false, 4146 directionNav: directionNav,
4147 useCSS: false, 4148 pauseOnAction: true, 4149 pauseOnHover: false, 4150 slideshow: slideshow, 4151 animation: animation, 4152 itemMargin: itemMargin, 4153 minItems: numberPerPage, 4154 maxItems: numberPerPage, 4155 itemWidth: itemWidth, 4156 animationSpeed: animationSpeed, 4157 slideshowSpeed: interval, 4158 start: function(slider){ 4159 initParallax(); 4160 } 4161 }); 4162 }); 4163 4164 } 4165} 4166 4167/* 4168 * Set numbers of items per page 4169 */ 4170function qodeNumberOfTestimonialsItems($this){ 4171 var maxItems = $this.data('number-per-slide'); 4172 4173 if ($window_width < 768 && maxItems > 1){ 4174 maxItems = 1; 4175 }else if ($window_width < 1024 && maxItems > 2) { 4176 maxItems = 2; 4177 } 4178 4179 return maxItems; 4180} 4181 4182/* 4183 * Set numbers of items per page on window resize 4184 */ 4185 4186function qodeNumberOfTestimonialsItemsResize(){ 4187 4188 4189 var testimonialsSlider = $j('.testimonials_carousel, .testimonials_c_carousel'); 4190 4191 if(testimonialsSlider.length){ 4192 testimonialsSlider.each(function(){ 4193 var thisSliderHolder = $j(this); 4194 4195 var items = qodeNumberOfTestimonialsItems(thisSliderHolder); 4196 4197 if (typeof thisSliderHolder.data('flexslider') !== 'undefined') { 4198 thisSliderHolder.data('flexslider').vars.minItems = items; 4199 } 4200 if (typeof thisSliderHolder.data('flexslider') !== 'undefined') { 4201 thisSliderHolder.data('flexslider').vars.maxItems = items; 4202 } 4203 }); 4204 } 4205 4206} 4207 4208/* 4209** Init Testimonials Carousel shortcode 4210*/ 4211function initTestimonialsCarousel(){ 4212 "use strict"; 4213 4214 if($j('.testimonials_c_carousel').length){ 4215 $j('.testimonials_c_carousel').each(function(){ 4216 var interval = 5000; 4217 var $this = $j(this); 4218 4219 if(typeof $this.data('auto-rotate-slides') !== 'undefined' && $this.data('auto-rotate-slides') !== false) { 4220 interval = parseFloat($this.data('auto-rotate-slides')) * 1000; 4221 } 4222 4223 var slideshow = true; 4224 if(interval === 0) { 4225 slideshow = false; 4226 } 4227 4228 var controlNav = true; 4229 if(typeof $this.data('show-navigation') !== 'undefined') { 4230 controlNav = $this.data('show-navigation') == 'no' ? false : true; 4231 } 4232 4233 var animationSpeed = 600; 4234 if(typeof $this.data('animation-speed') !== 'undefined' && $this.data('animation-speed') !== false) { 4235 animationSpeed = $this.data('animation-speed'); 4236 } 4237 4238 var numberPerPage = qodeNumberOfTestimonialsItems($this); 4239 var itemWidth = 0; 4240 var itemMargin = 0; 4241 if(typeof numberPerPage !== 'undefined' && numberPerPage !== 1) { 4242 itemWidth = 300; 4243 itemMargin = 30; 4244 } 4245 4246 $this.flexslider({ 4247 animationLoop: true, 4248 controlNav: controlNav, 4249 directionNav: false, 4250 useCSS: false, 4251 pauseOnAction: true, 4252 pauseOnHover: false, 4253 slideshow: slideshow, 4254 animation: 'slide', 4255 itemMargin: itemMargin, 4256 minItems: numberPerPage, 4257 maxItems: numberPerPage, 4258 itemWidth: itemWidth, 4259 animationSpeed: animationSpeed, 4260 slideshowSpeed: interval, 4261 start: function(slider){ 4262 initParallax(); 4263 } 4264 }); 4265 }); 4266 4267 } 4268} 4269 4270/* 4271** Function to close message shortcode 4272*/ 4273function initMessages(){ 4274 "use strict"; 4275 4276 if($j('.q_message').length){ 4277 $j('.q_message').each(function(){ 4278 $j(this).find('.close').on('click', function(e){ 4279 e.preventDefault(); 4280 $j(this).parent().parent().fadeOut(500); 4281 }); 4282 }); 4283 } 4284} 4285/* 4286** Init Element Animations 4287*/ 4288function initElementsAnimation(){ 4289 "use strict"; 4290 4291 if($j(".element_from_fade").length > 0 && $j('.no_animation_on_touch').length === 0){ 4292 $j('.element_from_fade').each(function(){ 4293 var $this = $j(this); 4294 4295 $this.appear(function() { 4296 $this.addClass('element_from_fade_on'); 4297 }
4297,{accX: 0, accY: -100}); 4298 }); 4299 } 4300 4301 if($j(".element_from_left").length > 0 && $j('.no_animation_on_touch').length === 0){ 4302 $j('.element_from_left').each(function(){ 4303 var $this = $j(this); 4304 4305 $this.appear(function() { 4306 $this.addClass('element_from_left_on'); 4307 },{accX: 0, accY: -100}); 4308 }); 4309 } 4310 4311 if($j(".element_from_right").length > 0 && $j('.no_animation_on_touch').length === 0){ 4312 $j('.element_from_right').each(function(){ 4313 var $this = $j(this); 4314 4315 $this.appear(function() { 4316 $this.addClass('element_from_right_on'); 4317 },{accX: 0, accY: -100}); 4318 }); 4319 } 4320 4321 if($j(".element_from_top").length > 0 && $j('.no_animation_on_touch').length === 0){ 4322 $j('.element_from_top').each(function(){ 4323 var $this = $j(this); 4324 4325 $this.appear(function() { 4326 $this.addClass('element_from_top_on'); 4327 },{accX: 0, accY: -100}); 4328 }); 4329 } 4330 4331 if($j(".element_from_bottom").length > 0 && $j('.no_animation_on_touch').length === 0){ 4332 $j('.element_from_bottom').each(function(){ 4333 var $this = $j(this); 4334 4335 $this.appear(function() { 4336 $this.addClass('element_from_bottom_on'); 4337 },{accX: 0, accY: -100}); 4338 }); 4339 } 4340 4341 if($j(".element_transform").length > 0 && $j('.no_animation_on_touch').length === 0){ 4342 $j('.element_transform').each(function(){ 4343 var $this = $j(this); 4344 4345 $this.appear(function() { 4346 $this.addClass('element_transform_on'); 4347 },{accX: 0, accY: -100}); 4348 }); 4349 } 4350} 4351 4352/* 4353** Init audio player for blog layout 4354*/ 4355function fitAudio(){ 4356 "use strict"; 4357 4358 $j('audio.blog_audio').mediaelementplayer({ 4359 audioWidth: '100%' 4360 }); 4361} 4362 4363/* 4364** Init masonry layout for blog template 4365*/ 4366function initBlog() { 4367 "use strict"; 4368 4369 if($j('.blog_holder.masonry, .blog_holder.blog_pinterest').length) { 4370 var width_blog = $j(this).closest('.container_inner').width(), 4371 filters = $j('.filter'), 4372 firstFilter = $j('.filter_holder ul > .filter:first-of-type'); 4373 if($j('.blog_holder').closest(".column_inner").length) { 4374 width_blog = $j('.blog_holder').closest(".column_inner").width(); 4375 } 4376 $j('.blog_holder').width(width_blog); 4377 var $container = $j('.blog_holder'); 4378 4379 $container.waitForImages(function() { 4380 setTimeout(function() { 4381 $container.isotope({ 4382 itemSelector: 'article', 4383 resizable: false, 4384 masonry: {columnWidth: '.blog_holder_grid_sizer', gutter: '.blog_holder_grid_gutter'} 4385 }); 4386 4387 $j('.blog_holder.masonry, .blog_holder.blog_pinterest').animate({opacity: "1"}, 500); 4388 }, 400); 4389 }); 4390 4391 firstFilter.addClass('active'); 4392 4393 filters.on('click', function() { 4394 filters.removeClass('active'); 4395 $j(this).addClass('active'); 4396 var selector = $j(this).attr('data-filter'); 4397 $container.isotope({filter: selector}); 4398 return false; 4399 }); 4400 4401 var loading_label_holder = $j('.qode-infinite-scroll-loading-label'), 4402 finished_label_holder = $j('.qode-infinite-scroll-finished-label'); 4403 4404 if($container.hasClass('masonry_infinite_scroll')) { 4405 $container.infiniteScroll({ 4406 path: '.blog_infinite_scroll_button a', 4407 append: '.post', 4408 history: false, 4409 }); 4410 4411 $container.on( 'request.infiniteScroll', function( event, path ) { 4412 loading_label_holder.fadeIn('fast'); 4413 }); 4414 4415 $container.on( 'load.infiniteScroll', function( event, response, path ) { 4416 loading_label_holder.fadeOut('fast'); 4417 }); 4418 4419 $container.on( 'append.infiniteScroll', function( event, response, path, items ) { 4420 $container.isotope('appended', items); 4421 fitVideo(); 4422 fitAudio(); 4423 initFlexSlider(); 4424 setTimeout(function() { 4425 $j('.blog_holder.masonry, .blog_holder.blog_pinterest').isotope('layout'); 4426 }, 400); 4427 }); 4428 4429 $container.on( 'last.infiniteScroll', function( event, response, path ) { 4430 finished_label_holder.fadeIn('fast'); 4431 }); 4432 } else if($container.hasClass('masonry_load_more')) { 4433 4434 4435 var i = 1; 4436 $j('.blog_load_more_button a').off('click tap').on('click tap', function(e) { 4437 e.preventDefault(); 4438 4439 var load_more_holder = $j('.blog_load_more_button'); 4440 var load_more_loading = $j('.blog_load_more_button_loading'); 4441 load_more_holder.hide(); 4442 load_more_loading.show(); 4443 4444 var link = $j(this).attr('href'); 4445 var $content = '.masonry_load_more'; 4446 var $anchor = '.blog_load_more_button a'; 4447 var $next_href = $j($anchor).attr('href'); 4448 $j.get(link + '', function(data) { 4449 var $new_content = $j($content, data).wrapInner('').html(); 4450 $next_href = $j($anchor, data).attr('href'); 4451 $container.append($j($new_content)).isotope('reloadItems').isotope({sortBy: 'original-order'}); 4452 fitVideo(); 4453 fitAudio(); 4454 initFlexSlider(); 4455 setTimeout(function() { 4456 $j('.blog_holder.masonry, .blog_holder.blog_pinterest').isotope('layout'); 4457 }, 400); 4458 4459 load_more_holder.show(); 4460 load_more_loading.hide(); 4461 4462 if($j('.blog_load_more_button span').attr('rel') > i) { 4463 $j('.blog_load_more_button a').attr('href', $next_href); // Change the next URL 4464 } else { 4465 $j('.blog_load_more_button').remove(); 4466 } 4467 }); 4468 i++; 4469 }); 4470 4471 } 4472 } 4473} 4474 4475/* 4476 ** Init full width masonry layout for blog template 4477 */ 4478function initBlogMasonryFullWidth(){ 4479 "use strict"; 4480 4481 if($j('.masonry_full_width').length){ 4482 var width_blog = $j('.full_width_inner').width(); 4483 4484 $j('.masonry_full_width').width(width_blog); 4485 var $container = $j('.masonry_full_width'); 4486 4487 $j('.filter').on('click', function(){ 4488 var selector = $j(this).attr('data-filter'); 4489 $container.isotope({ filter: selector }); 4490 return false;
4491 }); 4492 4493 var loading_label_holder = $j('.qode-infinite-scroll-loading-label'), 4494 finished_label_holder = $j('.qode-infinite-scroll-finished-label'); 4495 4496 if( $container.hasClass('masonry_infinite_scroll')){ 4497 $container.infiniteScroll({ 4498 path: '.blog_infinite_scroll_button a', 4499 append: '.post', 4500 history: false, 4501 }); 4502 4503 $container.on( 'request.infiniteScroll', function( event, path ) { 4504 loading_label_holder.fadeIn('fast'); 4505 }); 4506 4507 $container.on( 'load.infiniteScroll', function( event, response, path ) { 4508 loading_label_holder.fadeOut('fast'); 4509 }); 4510 4511 $container.on( 'append.infiniteScroll', function( event, response, path, items ) { 4512 $container.isotope('appended', items); 4513 fitVideo(); 4514 fitAudio(); 4515 initFlexSlider(); 4516 4517 setTimeout(function() { 4518 $j('.blog_holder.masonry_full_width').isotope( 'layout'); 4519 }, 400); 4520 }); 4521 4522 $container.on( 'last.infiniteScroll', function( event, response, path ) { 4523 finished_label_holder.fadeIn('fast'); 4524 }); 4525 }else if($container.hasClass('masonry_load_more')){ 4526 4527 4528 var i = 1; 4529 $j('.blog_load_more_button a').off('click tap').on('click tap', function(e) { 4530 e.preventDefault(); 4531 4532 var link = $j(this).attr('href'); 4533 var $content = '.masonry_load_more'; 4534 var $anchor = '.blog_load_more_button a'; 4535 var $next_href = $j($anchor).attr('href'); 4536 $j.get(link+'', function(data){ 4537 var $new_content = $j($content, data).wrapInner('').html(); 4538 $next_href = $j($anchor, data).attr('href'); 4539 $container.append( $j( $new_content) ).isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' }); 4540 fitVideo(); 4541 fitAudio(); 4542 initFlexSlider(); 4543 4544 setTimeout(function() { 4545 $j('.blog_holder.masonry_full_width').isotope( 'layout'); 4546 }, 400); 4547 4548 if($j('.blog_load_more_button span').attr('rel') > i) { 4549 $j('.blog_load_more_button a').attr('href', $next_href); // Change the next URL 4550 } else { 4551 $j('.blog_load_more_button').remove(); 4552 } 4553 4554 }); 4555 i++; 4556 }); 4557 4558 } 4559 4560 $container.waitForImages(function() { 4561 setTimeout(function() { 4562 $container.isotope({ 4563 itemSelector: 'article', 4564 resizable: false, 4565 masonry: { columnWidth: '.blog_holder_grid_sizer',gutter: '.blog_holder_grid_gutter'} 4566 }); 4567 4568 $j('.masonry_full_width').animate({opacity: "1"}, 500); 4569 }, 400); 4570 }); 4571 } 4572} 4573 4574/* 4575 ** Init gallery masonry layout for blog template 4576 */ 4577function initBlogMasonryGallery(){ 4578 "use strict"; 4579 4580 if($j('.blog_holder.masonry_gallery').length) { 4581 4582 qodeResizeBlogMasonryGallery($j('.blog_holder_grid_sizer').width()); 4583 4584 var container = $j('.blog_holder.masonry_gallery'); 4585 container.width(Math.round(container.parent().width())); 4586 container.isotope({ 4587 itemSelector: 'article', 4588 resizable: false, 4589 masonry: { 4590 columnWidth: '.blog_holder_grid_sizer', 4591 gutter: '.blog_holder_grid_gutter' 4592 } 4593 }); 4594 4595 container.waitForImages(function(){ 4596 container.animate({opacity: "1"}, 300, function() { 4597 container.isotope().isotope('layout'); 4598 }); 4599 }); 4600 4601 var loading_label_holder = $j('.qode-infinite-scroll-loading-label'), 4602 finished_label_holder = $j('.qode-infinite-scroll-finished-label'); 4603 4604 if( container.hasClass('masonry_infinite_scroll')){ 4605 container.infiniteScroll({ 4606 path: '.blog_infinite_scroll_button a', 4607 append: '.post', 4608 history: false, 4609 }); 4610 4611 container.on( 'request.infiniteScroll', function( event, path ) { 4612 loading_label_holder.fadeIn('fast'); 4613 }); 4614 4615 container.on( 'load.infiniteScroll', function( event, response, path ) { 4616 loading_label_holder.fadeOut('fast'); 4617 }); 4618 4619 container.on( 'append.infiniteScroll', function( event, response, path, items ) { 4620 container.isotope('appended', items); 4621 fitVideo(); 4622 fitAudio(); 4623 initFlexSlider(); 4624 qodeResizeBlogMasonryGallery($j('.blog_holder_grid_sizer').width()); 4625 setTimeout(function() { 4626 container.isotope( 'layout'); 4627 }, 300); 4628 }); 4629 4630 container.on( 'last.infiniteScroll', function( event, response, path ) { 4631 finished_label_holder.fadeIn('fast'); 4632 }); 4633 }else if(container.hasClass('masonry_load_more')){ 4634 var i = 1; 4635 $j('.blog_load_more_button a').off('click tap').on('click tap', function(e) { 4636 e.preventDefault(); 4637 4638 var link = $j(this).attr('href'); 4639 var $content = '.masonry_load_more'; 4640 var $anchor = '.blog_load_more_button a'; 4641 var $next_href = $j($anchor).attr('href'); 4642 $j.get(link+'', function(data){ 4643 var $new_content = $j($content, data).wrapInner('').html(); 4644 $next_href = $j($anchor, data).attr('href'); 4645 container.append( $j( $new_content) ).isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' }); 4646 fitVideo(); 4647 fitAudio(); 4648 initFlexSlider(); 4649 qodeResizeBlogMasonryGallery($j('.blog_holder_grid_sizer').width()); 4650 setTimeout(function() { 4651 container.isotope( 'layout'); 4652 }, 300); 4653 4654 if($j('.blog_load_more_button span').attr('rel') > i) { 4655 $j('.blog_load_more_button a').attr('href', $next_href); // Change the next URL 4656 } else { 4657 $j('.blog_load_more_button').remove(); 4658 } 4659 4660 }); 4661 i++; 4662 }); 4663 4664 } 4665 4666 $j(window).resize(function() { 4667 qodeResizeBlogMasonryGallery($j('.blog_holder_grid_sizer').width()); 4668 container.isotope().isotope('layout'); 4669 container.width(Math.round(container.parent().width())); 4670 }); 4671 } 4672} 4673 4674 4675/* 4676 ** Init gallery masonry layout for blog template 4677 */ 4678function initBlogGallery(){ 4679 "use strict"; 4680 4681 if($j('.blog_holder.blog_gallery, .blog_holder.blog_chequered').length) { 4682 4683 qodeResizeBlogGallery($j('.blog_holder_grid_sizer').width()); 4684 4685 var container = $j('.blog_holder.blog_gallery, .blog_holder.blog_chequered'); 4686 container.width(Math.round(container.parent().width())); 4687 container.isotope({ 4688 itemSelector: 'article', 4689 resizable: false, 4690 masonry: { 4691 columnWidth: '.blog_holder_grid_sizer', 4692 gutter: '.blog_holder_grid_gutter' 4693 } 4694 }); 4695 4696 container.waitForImages(function(){ 4697 container.animate({opacity: "1"}, 300, function() { 4698 container.isotope().isotope('layout'); 4699 }); 4700 }); 4701 4702 var loading_label_holder = $j('.qode-infinite-scroll-loading-label'), 4703 finished_label_holder = $j('.qode-infinite-scroll-finished-label'); 4704 4705 if( container.hasClass('masonry_infinite_scroll')){ 4706 container.infiniteScroll({ 4707 path: '.blog_infinite_scroll_button a', 4708 append: '.post', 4709 history: false, 4710 }); 4711 4712 container.on( 'request.infiniteScroll', function( event, path ) { 4713 loading_label_holder.fadeIn('fast'); 4714 }); 4715 4716 container.on( 'load.infiniteScroll', function( event, response, path ) { 4717 loading_label_holder.fadeOut('fast'); 4718 }); 4719 4720 container.on( 'append.infiniteScroll', function( event, response, path, items ) { 4721 container.isotope('appended', items); 4722 fitVideo(); 4723 fitAudio(); 4724 initFlexSlider(); 4725 qodeResizeBlogGallery($j('.blog_holder_grid_sizer').width()); 4726 setTimeout(function() { 4727 container.isotope( 'layout'); 4728 }, 300); 4729 }); 4730 4731 container.on( 'last.infiniteScroll', function( event, response, path ) { 4732 finished_label_holder.fadeIn('fast'); 4733 }); 4734 }else if(container.hasClass('masonry_load_more')){ 4735 var i = 1; 4736 $j('.blog_load_more_button a').off('click tap').on('click tap', function(e) { 4737 e.preventDefault(); 4738 4739 var link = $j(this).attr('href'); 4740 var $content = '.masonry_load_more'; 4741 var $anchor = '.blog_load_more_button a'; 4742 var $next_href = $j($anchor).attr('href'); 4743 $j.get(link+'', function(data){ 4744 var $new_content = $j($content, data).wrapInner('').html(); 4745 $next_href = $j($anchor, data).attr('href'); 4746 container.append( $j( $new_content) ).isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' }); 4747 fitVideo(); 4748 fitAudio(); 4749 initFlexSlider(); 4750 qodeResizeBlogGallery($j('.blog_holder_grid_sizer').width()); 4751 setTimeout(function() { 4752 container.isotope( 'layout'); 4753 }, 300); 4754 4755 if($j('.blog_load_more_button span').attr('rel') > i) { 4756 $j('.blog_load_more_button a').attr('href', $next_href); // Change the next URL 4757 } else { 4758 $j('.blog_load_more_button').remove(); 4759 } 4760 4761 qodeBlogGalleryAnimation(); 4762 4763 }); 4764 i++; 4765 }); 4766 4767 } 4768 4769 $j(window).resize(function() { 4770 qodeResizeBlogGallery($j('.blog_holder_grid_sizer').width()); 4771 container.isotope().isotope('layout'); 4772 container.width(Math.round(container.parent().width())); 4773 }); 4774 } 4775} 4776 4777function qodeResizeBlogMasonryGallery(size) { 4778 4779 var rectangle_portrait = $j('.blog_holder.masonry_gallery .large-height'); 4780 var rectangle_landscape = $j('.blog_holder.masonry_gallery .large-width'); 4781 var square_big = $j('.blog_holder.masonry_gallery .large-width-height'); 4782 var square_small = $j('.blog_holder.masonry_gallery .default'); 4783 4784 rectangle_portrait.css('height',2*size); 4785 rectangle_landscape.css('height',size); 4786 square_big.css('height',2*size); 4787 if(square_big.width() < 600) { 4788 square_big.css('height', square_big.width()); 4789 } 4790 if($window_width < 600) { 4791 rectangle_portrait.css('height', rectangle_portrait.width()); 4792 } 4793 square_small.css('height', size); 4794} 4795 4796function qodeResizeBlogGallery(size) { 4797 4798 var element = $j('.blog_holder.blog_chequered .default'); 4799 element.css('height',size); 4800} 4801 4802/* 4803 ** Min height for smaall image blog 4804 */ 4805function initSmallImageBlogHeight(){ 4806 "use strict"; 4807 4808 if($j('.blog_small_image').length){ 4809 $j('article').each(function() { 4810 $j(this).find('.post_text_inner').css('min-height', $j(this).find('.post_image').height() - 46); //46 is top and bottom padding 4811 }); 4812 } 4813} 4814 4815/* 4816** Init masonry layout for blog masonry shortcode 4817*/ 4818 4819function initQBlog(){ 4820 "use strict"; 4821 4822 if($j('.q_masonry_blog').length){ 4823 $j('.q_masonry_blog').each(function() { 4824 var thisItem = $j(this); 4825 4826 thisItem.waitForImages(function() { 4827 setTimeout(function() { 4828 thisItem.isotope({ 4829 itemSelector: 'article', 4830 resizable: false, 4831 masonry: {columnWidth: '.q_masonry_blog_grid_sizer', gutter: '.q_masonry_blog_grid_gutter'} 4832 }); 4833 thisItem.animate({opacity: "1"}, 500); 4834 }, 400); 4835 }); 4836 }); 4837 } 4838} 4839 4840
4841function qodeBlogCompundMasonryGallery(){ 4842 4843 var blogGallery = $j('.qode_blog_masonry_gallery'); 4844 var sizerWidth = blogGallery.find('.qode_blog_gallery_sizer').outerWidth(); 4845 var size = sizerWidth + 8; //8px is spacing between items 4846 4847 var resizeMasonryImages = function(){ 4848 sizerWidth = blogGallery.find('.qode_blog_gallery_sizer').outerWidth(); 4849 size = sizerWidth + 8; 4850 var defaultItem = blogGallery.find('.qode_blog_gallery_item.default'); 4851 var largeHeightItem = blogGallery.find('.qode_blog_img_large_height'); 4852 var largeHeightWidthItem = blogGallery.find('.qode_blog_img_large_height_width'); 4853 4854 defaultItem.css('height', size); 4855 largeHeightItem.css('height', Math.round(2*size)); 4856 4857 if($window_width > 600){ 4858 largeHeightWidthItem.css('height', Math.round(2*size)); 4859 }else{ 4860 largeHeightWidthItem.css('height', size); 4861 } 4862 }; 4863 4864 var initMasonryItems = function(){ 4865 4866 blogGallery.isotope({ 4867 itemSelector: '.qode_blog_gallery_item', 4868 masonry: { 4869 columnWidth: '.qode_blog_gallery_sizer', 4870 gutter: '.qode_blog_gallery_gutter' 4871 } 4872 }); 4873 4874 }; 4875 4876 return { 4877 init : function() { 4878 if(blogGallery.length) { 4879 resizeMasonryImages(); 4880 initMasonryItems(); 4881 4882 $j(window).resize(function() { 4883 resizeMasonryImages(); 4884 }); 4885 } 4886 } 4887 4888 }; 4889 4890} 4891 4892/* 4893 ** Init Blog Headlines big text 4894 */ 4895function qodeBlogHeadlines() { 4896 "use strict"; 4897 4898 if($j('.blog_headlines').length) { 4899 var $this = $j('.blog_headlines'); 4900 4901 var showTitles = function () { 4902 $this.bigtext({ 4903 childSelector: '> article > h2', 4904 minfontsize: 20 4905 }); 4906 4907 $this.find('h2').appear(function () { 4908 $j(this).addClass('show'); 4909 }, {accX: 0, accY: -100}); 4910 }; 4911 showTitles(); 4912 4913 var loading_label_holder = $j('.qode-infinite-scroll-loading-label'), 4914 finished_label_holder = $j('.qode-infinite-scroll-finished-label'); 4915 4916 if( $this.hasClass('blog_infinite_scroll')){ 4917 $this.infiniteScroll({ 4918 path: '.blog_infinite_scroll_button a', 4919 append: '.post', 4920 history: false, 4921 }); 4922 4923 $this.on( 'request.infiniteScroll', function( event, path ) { 4924 loading_label_holder.fadeIn('fast'); 4925 }); 4926 4927 $this.on( 'load.infiniteScroll', function( event, response, path ) { 4928 loading_label_holder.fadeOut('fast'); 4929 }); 4930 4931 $this.on( 'append.infiniteScroll', function( event, response, path, items ) { 4932 showTitles(); 4933 }); 4934 4935 $this.on( 'last.infiniteScroll', function( event, response, path ) { 4936 finished_label_holder.fadeIn('fast'); 4937 }); 4938 }else if($this.hasClass('blog_load_more')){ 4939 var i = 1; 4940 $j('.blog_load_more_button a').off('click tap').on('click tap', function(e) { 4941 e.preventDefault(); 4942 4943 var link = $j(this).attr('href'); 4944 var $content = '.blog_load_more'; 4945 var $anchor = '.blog_load_more_button a'; 4946 var $next_href = $j($anchor).attr('href'); 4947 $j.get(link+'', function(data){ 4948 var $new_content = $j($content, data).wrapInner('').html(); 4949 $next_href = $j($anchor, data).attr('href'); 4950 $this.append( $j( $new_content) ); 4951 4952 showTitles(); 4953 4954 if($j('.blog_load_more_button span').attr('rel') > i) { 4955 $j('.blog_load_more_button a').attr('href', $next_href); // Change the next URL 4956 } else { 4957 $j('.blog_load_more_button').remove(); 4958 } 4959 }); 4960 i++; 4961 }); 4962 4963 } 4964 } 4965} 4966 4967/* 4968** Init progress bar with icon 4969*/ 4970var timeOuts = []; 4971function initProgressBarsIcon(){ 4972 "use strict"; 4973 4974 if($j('.q_progress_bars_icons_holder').length){ 4975 $j('.q_progress_bars_icons_holder').each(function() { 4976 var $this = $j(this); 4977 var axis = 200; 4978 if(typeof $this.data('element-appearance') !== 'undefined' && $this.data('element-appearance') !== false) { 4979 axis = $this.data('element-appearance'); 4980 } 4981 $this.appear(function() { 4982 $this.find('.q_progress_bars_icons').css('opacity','1'); 4983 $this.find('.q_progress_bars_icons').each(function() { 4984 var number = $j(this).find('.q_progress_bars_icons_inner').data('number'); 4985 var size = $j(this).find('.q_progress_bars_icons_inner').data('size'); 4986 4987 if(size !== ""){ 4988 $j(this).find('.q_progress_bars_icons_inner.custom_size .bar').css({'width': size+'px','height':size+'px'}); 4989 $j(this).find('.q_progress_bars_icons_inner.custom_size .bar .fa-stack').css({'font-size': size/2+'px'}); 4990 } 4991 4992 var bars = $j(this).find('.bar'); 4993 4994 bars.each(function(i){ 4995 if(i < number){ 4996 var time = (i + 1)*150; 4997 timeOuts[i] = setTimeout(function(){ 4998 $j(bars[i]).addClass('active'); 4999 },time); 5000 } 5001 }); 5002 }); 5003 }
5003,{accX: 0, accY: -axis}); 5004 }); 5005 } 5006} 5007 5008(function( $ ){ 5009 "use strict"; 5010 5011 var $window = $(window); 5012 $.fn.masonryParallax = function(speedFactor, outerHeight, startPosition) { 5013 var $this = $(this); 5014 var getHeight; 5015 var firstTop; 5016 var startPositionAdd = 0; 5017 5018 //get the starting position of element to have parallax applied to it 5019 firstTop = $this.offset().top; 5020 5021 //get the height element 5022 if (outerHeight) { 5023 getHeight = function(jqo) { 5024 return jqo.outerHeight(true); 5025 }; 5026 } else { 5027 getHeight = function(jqo) { 5028 return jqo.height(); 5029 }; 5030 } 5031 5032 //get type so elements could take it's initial position 5033 if(startPosition != 0){ 5034 startPositionAdd = startPosition; 5035 } 5036 5037 // setup defaults if arguments aren't specified 5038 if (arguments.length < 1 || speedFactor === null) speedFactor = 0.1; 5039 if (arguments.length < 2 || outerHeight === null) outerHeight = true; 5040 5041 // function to be called whenever the window is scrolled or resized 5042 var top = $this.offset().top; 5043 var height = getHeight($this); 5044 function update(){ 5045 // Check if totally above or totally below viewport 5046 if (top + height < $scroll || top > $scroll + $window_height) { 5047 return; 5048 } 5049 $this.css('transform', 'translate3d(0px, '+ (Math.round((firstTop - height - $scroll) * speedFactor + startPositionAdd)) +'px, 0px)'); 5050 } 5051 5052 $window.bind('scroll', update).resize(update); 5053 update(); 5054 }; 5055})(jQuery); 5056 5057/** 5058 * Masonry gallery, init masonry and resize pictures in grid 5059 */ 5060function initMasonryGallery(){ 5061 "use strict"; 5062 5063 resizeMasonryGallery($j('.grid-sizer').width()); 5064 5065 if($j('.masonry_gallery_holder').length){ 5066 5067 $j('.masonry_gallery_holder').each(function(){ 5068 var $this = $j(this); 5069 $this.waitForImages(function(){ 5070 $this.animate({opacity:1}); 5071 $this.isotope({ 5072 itemSelector: '.masonry_gallery_item', 5073 masonry: { 5074 columnWidth: '.grid-sizer' 5075 } 5076 }); 5077 5078 $this.find('.masonry_gallery_item.parallax_item').each(function(i){ 5079 $j(this).masonryParallax($this.data('parallax_item_speed'), true, $this.data('parallax_item_offset')); 5080 5081 }); 5082 }); 5083 }); 5084 $j(window).resize(function(){ 5085 resizeMasonryGallery($j('.grid-sizer').width()); 5086 $j('.masonry_gallery_holder').isotope('reloadItems'); 5087 }); 5088 } 5089} 5090 5091function resizeMasonryGallery(size){ 5092 "use strict"; 5093 5094 var rectangle_portrait = $j('.masonry_gallery_holder .rectangle_portrait'); 5095 var rectangle_landscape = $j('.masonry_gallery_holder .rectangle_landscape'); 5096 var square_big = $j('.masonry_gallery_holder .square_big'); 5097 var square_small = $j('.masonry_gallery_holder .square_small'); 5098 5099 rectangle_portrait.css('height', 2*size); 5100 if (window.innerWidth < 600) { 5101 rectangle_landscape.css('height', size/2); 5102 } 5103 else { 5104 rectangle_landscape.css('height', size); 5105 } 5106 square_big.css('height', 2*size); 5107 if (window.innerWidth < 600) { 5108 square_big.css('height', square_big.width()+20);//20 is padding arround image holder 5109 } 5110 square_small.css('height', size); 5111} 5112 5113/* 5114** Init more facts shortcode 5115*/ 5116function initMoreFacts(){ 5117 "use strict"; 5118 if($j('.more_facts_holder').length){ 5119 $j('.more_facts_holder').each(function(){ 5120 var $this = $j(this); 5121 var $more_label = 'More Facts'; 5122 if($j(this).find('.more_facts_button').data('morefacts') !== ""){ 5123 $more_label = $j(this).find('.more_facts_button').data('morefacts'); 5124 } 5125 var $less_label = 'Less Facts'; 5126 if($j(this).find('.more_facts_button').data('lessfacts') !== ""){ 5127 $less_label = $j(this).find('.more_facts_button').data('lessfacts'); 5128 } 5129 $this.find('.more_facts_button').on("mouseenter",function(){ 5130 $j(this).css('color', $j(this).data('hovercolor')); 5131 }).on("mouseleave",function() { 5132 if($this.find('.more_facts_outer').height() == 0){ 5133 $j(this).css('color', $j(this).data('color')); 5134 } 5135 }); 5136 var expandable_content_top_padding = 70; // this value is set as default top padding inside css file 5137 if($this.find('.more_facts_inner').data('expandable_content_top_padding') !== ""){ 5138 expandable_content_top_padding = $this.find('.more_facts_inner').data('expandable_content_top_padding'); 5139 $this.find('.more_facts_inner').css({'padding-top':expandable_content_top_padding}); 5140 } 5141 var height = 0; 5142 var speed = 600; 5143 $this.find('.more_facts_button').on('click', function(){ 5144 height = $this.find('.more_facts_inner').height() + expandable_content_top_padding; 5145 if(height > 0 && height < 601){ 5146 speed = 800; 5147 } else if(height > 600 && height < 1201){ 5148 speed = 1500; 5149 } else{ 5150 speed = 2100; 5151 } 5152 if(!$this.hasClass('more_fact_opened')){ 5153 $this.addClass('more_fact_opened'); 5154 $this.find('.more_facts_fake_arrow').fadeIn(speed); 5155 $this.find('.more_facts_outer').stop().animate({'height': height}, speed, function() { 5156 if($j('.parallax_section_holder').length) { 5157 initParallax(); 5158 } 5159 }); 5160 $j(this).find('.more_facts_button_text').text($less_label); 5161 $j(this).find('.more_facts_button_arrow').addClass('rotate_arrow'); 5162 } else { 5163 $this.find('.more_facts_fake_arrow').fadeOut(speed); 5164 $this.find('.more_facts_outer').stop().animate({'height': '0px'}, speed,function(){ 5165 if(!$this.find('.more_facts_button').is(":hover")){$this.find('.more_facts_button').css('color',$this.find('.more_facts_button').data('color'));} 5166 $this.removeClass('more_fact_opened'); 5167 if($j('.parallax_section_holder').length) { 5168 initParallax(); 5169 } 5170 }); 5171 $j(this).find('.more_facts_button_text').text($more_label); 5172 $j(this).find('.more_facts_button_arrow').removeClass('rotate_arrow'); 5173 } 5174 }); 5175 }); 5176 } 5177} 5178 5179/* 5180** Replace plceholder 5181*/ 5182function placeholderReplace(){ 5183 "use strict"; 5184 5185 $j('#contact-form [placeholder]').focus(function() {
5186 var input = $j(this); 5187 if (input.val() === input.attr('placeholder')) { 5188 if (this.originalType) { 5189 this.type = this.originalType; 5190 delete this.originalType; 5191 } 5192 input.val(''); 5193 input.removeClass('placeholder'); 5194 } 5195 }).blur(function() { 5196 var input = $j(this); 5197 if (input.val() === '') { 5198 if (this.type === 'password') { 5199 this.originalType = this.type; 5200 this.type = 'text'; 5201 } 5202 input.addClass('placeholder'); 5203 input.val(input.attr('placeholder')); 5204 } 5205 }).blur(); 5206 5207 $j('#contact-form [placeholder]').parents('form').submit(function () { 5208 $j(this).find('[placeholder]').each(function () { 5209 var input = $j(this); 5210 if (input.val() === input.attr('placeholder')) { 5211 input.val(''); 5212 } 5213 }); 5214 }); 5215} 5216 5217function totop_button(a) { 5218 "use strict"; 5219 5220 var b = $j("#back_to_top"); 5221 b.removeClass("off on"); 5222 if (a === "on") { b.addClass("on"); } else { b.addClass("off"); } 5223} 5224 5225function backButtonShowHide(){ 5226 "use strict"; 5227 5228 $j(window).scroll(function () { 5229 var b = $j(this).scrollTop(); 5230 var c = $j(this).height(); 5231 var d; 5232 if (b > 0) { d = b + c / 2; } else { d = 1; } 5233 if (d < 1e3) { totop_button("off"); } else { totop_button("on"); } 5234 }); 5235} 5236 5237function backToTop(){ 5238 "use strict"; 5239 5240 $j(document).on('click','#back_to_top',function(e){ 5241 e.preventDefault(); 5242 5243 $j('body,html').animate({scrollTop: 0}, $j(window).scrollTop()/3, 'linear'); 5244 }); 5245} 5246 5247/* 5248 ** Init steps 5249 */ 5250function initSteps(){ 5251 "use strict"; 5252 if($j('.q_steps_holder').length){ 5253 $j('.q_steps_holder').each(function(){ 5254 $j(this).appear(function() { 5255 $j(this).addClass('show'); 5256 },{accX: 0, accY: -200}); 5257 }); 5258 } 5259} 5260 5261/* 5262 ** Init message height 5263 */ 5264function initMessageHeight(){ 5265 "use strict"; 5266 if($j('.q_message.with_icon').length){ 5267 $j('.q_message.with_icon').each(function(){ 5268 if($j(this).find('.message_text_holder').height() > $j(this).find('.q_message_icon_holder').height()) { 5269 $j(this).find('.q_message_icon_holder').height($j(this).find('.message_text').height()); 5270 } else { 5271 $j(this).find('.message_text').height($j(this).find('.q_message_icon_holder').height()); 5272 } 5273 }); 5274 } 5275} 5276 5277/** 5278 * Init image hover 5279 */ 5280function initImageHover() { 5281 "use strict"; 5282 if($j('.image_hover').length){ 5283 $j('.image_hover').each(function(){ 5284 $j(this).appear(function() { 5285 5286 var default_visible_time = 300; 5287 var transition_delay = $j(this).attr('data-transition-delay'); 5288 var real_transition_delay = default_visible_time + parseFloat(transition_delay); 5289 var object = $j(this); 5290 5291 //wait for other hovers to complete 5292 setTimeout(function() { 5293 object.addClass('show'); 5294 }, parseFloat(transition_delay)); 5295 5296 //hold that image a little, than remove class 5297 setTimeout(function() { 5298 object.removeClass('show'); 5299 }, real_transition_delay); 5300 5301 },{accX: 0, accY: -200}); 5302 }); 5303 } 5304} 5305 5306/* 5307 * Initializes vertical progress bars 5308 */ 5309function initProgressBarsVertical(){ 5310 "use strict"; 5311 5312 if($j('.q_progress_bars_vertical').length){ 5313 $j('.q_progress_bars_vertical').each(function() { 5314 $j(this).appear(function() { 5315 initToCounterVerticalProgressBar($j(this)); 5316 var percentage = $j(this).find('.progress_content').data('percentage'); 5317 $j(this).find('.progress_content').css('height', '0%'); 5318 $j(this).find('.progress_content').animate({ 5319 height: percentage+'%' 5320 }, 1500); 5321 },{accX: 0, accY: -200}); 5322 }); 5323 } 5324} 5325 5326/* 5327 * Initializes vertical progress bar count to max value 5328 */ 5329function initToCounterVerticalProgressBar($this){ 5330 "use strict"; 5331 5332 if($this.find('.progress_number span').length){ 5333 $this.find('.progress_number span').each(function() { 5334 var $max = parseFloat($j(this).text()); 5335 $j(this).countTo({ 5336 from: 0, 5337 to: $max, 5338 speed: 1500, 5339 refreshInterval: 50 5340 }); 5341 }); 5342 } 5343} 5344 5345/* 5346* Check if there is anchor on load and scroll to it 5347*/ 5348function checkAnchorOnLoad(){ 5349 "use strict"; 5350 5351 var hash = window.location.hash; 5352 var newHash = encodeURI(window.location.hash.split('#')[1]); 5353 var paspartuScrollAdd = $j('body').hasClass('paspartu_on_top_fixed') ? $window_width*paspartu_width : 0; 5354 var scrollToAmount; 5355 var top_header_height; 5356 if(hash !== "" && $j('[data-q_id="#'+newHash+'"]').length > 0){ 5357 if($j('header.page_header').hasClass('fixed') && !$j('body').hasClass('vertical_menu_enabled')){ 5358 if($j('header.page_header').hasClass('scroll_top')){ 5359 top_header_height = header_top_height; 5360 }else{ 5361 top_header_height = 0; 5362 } 5363 5364 if(!$j('header.page_header').hasClass('transparent') || $j('header.page_header').hasClass('scrolled_not_transparent')) { 5365 if(header_height - ($j('[data-q_id="' + hash + '"]').offset().top + top_header_height)/4 >= min_header_height_scroll){ 5366 var diff_of_header_and_section = $j('[data-q_id="' + hash + '"]').offset().top - header_height - paspartuScrollAdd; 5367 scrollToAmount = diff_of_header_and_section + (diff_of_header_and_section/4) + (diff_of_header_and_section/16) + (diff_of_header_and_section/64) + 1;
5367 //several times od dividing to minimize the error, because fixed header is shrinking while scroll, 1 is just to ensure 5368 }else{ 5369 if($j('header.page_header').hasClass('centered_logo')){ 5370 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - min_header_height_scroll - logo_height - 30 - paspartuScrollAdd; //30 is top/bottom margin of logo 5371 } else { 5372 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - min_header_height_scroll - paspartuScrollAdd; 5373 } 5374 } 5375 }else{ 5376 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - paspartuScrollAdd; 5377 } 5378 5379 } else if($j('header.page_header').hasClass('fixed_top_header') && !$j('body').hasClass('vertical_menu_enabled')){ 5380 if(!$j('header.page_header').hasClass('transparent') || $j('header.page_header').hasClass('scrolled_not_transparent')){ 5381 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - header_top_height - paspartuScrollAdd; 5382 }else{ 5383 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - paspartuScrollAdd; 5384 } 5385 5386 } else if($j('header.page_header').hasClass('fixed_hiding') && !$j('body').hasClass('vertical_menu_enabled')){ 5387 if(!$j('header.page_header').hasClass('transparent') || $j('header.page_header').hasClass('scrolled_not_transparent')) { 5388 if ($j('[data-q_id="' + hash + '"]').offset().top - (header_height + logo_height / 2 + 40) <= scroll_amount_for_fixed_hiding) { 5389 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - header_height - logo_height / 2 - 40 - paspartuScrollAdd; //40 is top/bottom margin of logo 5390 } else { 5391 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - min_header_height_fixed_hidden - 40 - paspartuScrollAdd; //40 is top/bottom margin of logo 5392 } 5393 }else{ 5394 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - paspartuScrollAdd; 5395 } 5396 }else if($j('header.page_header').hasClass('stick') || $j('header.page_header').hasClass('stick_with_left_right_menu') && !$j('body').hasClass('vertical_menu_enabled')) { 5397 if(!$j('header.page_header').hasClass('transparent') || $j('header.page_header').hasClass('scrolled_not_transparent')) { 5398 if (sticky_amount >= $j('[data-q_id="' + hash + '"]').offset().top) { 5399 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top + 1 - paspartuScrollAdd; // 1 is to show sticky menu 5400 } else { 5401 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - min_header_height_sticky - paspartuScrollAdd; 5402 } 5403 }else{ 5404 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - paspartuScrollAdd; 5405 } 5406 } else{ 5407 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - paspartuScrollAdd; 5408 } 5409 $j('html, body').animate({ 5410 scrollTop: Math.round(scrollToAmount) 5411 }, 1500, function() {}); 5412 } 5413 5414 //remove active state on anchors if section is not visible 5415 $j(".main_menu a, .vertical_menu a, .mobile_menu a").each(function(){ 5416 var i = $j(this).prop("hash"); 5417 if(i !== "" && ($j('[data-q_id="' + i + '"]').length > 0) && ($j('[data-q_id="' + i + '"]').offset().top >= $window_height) && $scroll === 0){ 5418 $j(this).parent().removeClass('active current-menu-item'); 5419 $j(this).removeClass('current'); 5420 } 5421 }); 5422} 5423 5424/* 5425* Check active state of anchor links on scroll 5426*/ 5427 5428function changeActiveState(id){ 5429 "use strict"; 5430 5431 if($j(".main_menu a[href*='#']").length) { 5432 $j('.main_menu a').parent().removeClass('active'); 5433 } 5434 5435 $j(".main_menu a").each(function(){ 5436 var i = $j(this).prop("hash"); 5437 if(i === id){ 5438 if($j(this).closest('.second').length === 0){ 5439 $j(this).parent().addClass('active'); 5440 }else{ 5441 $j(this).closest('.second').parent().addClass('active'); 5442 } 5443 $j('.main_menu a').removeClass('current'); 5444 $j(this).addClass('current'); 5445 } 5446 }); 5447 5448 if($j(".vertical_menu a[href*='#']").length) { 5449 $j('.vertical_menu a').parent().removeClass('active'); 5450 } 5451 5452 $j(".vertical_menu a").each(function(){ 5453 var i = $j(this).prop("hash"); 5454 if(i === id){ 5455 if($j(this).closest('.second').length === 0){ 5456 $j(this).parent().addClass('active'); 5457 }else{ 5458 $j(this).closest('.second').parent().addClass('active'); 5459 } 5460 $j('.vertical_menu a').removeClass('current'); 5461 $j(this).addClass('current'); 5462 } 5463 }); 5464 5465 if($j(".mobile_menu a[href*='#']").length) { 5466 $j('.mobile_menu a').parent().removeClass('active'); 5467 } 5468 5469 $j(".mobile_menu a").each(function(){ 5470 var i = $j(this).prop("hash"); 5471 if(i === id){ 5472 if($j(this).closest('.sub_menu').length === 0){ 5473 $j(this).parent().addClass('active'); 5474 }else{ 5475 $j(this).closest('.sub_menu').parent().addClass('active'); 5476 } 5477 $j('.mobile_menu a').removeClass('current'); 5478 $j(this).addClass('current'); 5479 } 5480 }); 5481} 5482 5483/* 5484* Check active state of anchor links on scroll 5485*/ 5486function checkAnchorOnScroll(){ 5487 "use strict"; 5488 5489 if($j('[data-q_id]').length && !$j('header.page_header').hasClass('regular')){ 5490 $j('[data-q_id]').waypoint( function(direction) { 5491 if(direction === 'down') { 5492 //retrieve section object from waypoint object 5493 var sectionObject = $j(this)[0].adapter.$element; 5494 changeActiveState(sectionObject.data("q_id")); 5495 } 5496 }, { offset: '50%' }); 5497 5498 $j('[data-q_id]').waypoint( function(direction) { 5499 if(direction === 'up') { 5500 //retrieve section object from waypoint object 5501 var sectionObject = $j(this)[0].adapter.$element; 5502 changeActiveState(sectionObject.data("q_id")); 5503 } 5504 }, { offset: function(){ 5505 //retrieve section object from waypoint object 5506 var sectionObject = $j(this)[0].adapter.$element; 5507 return -(sectionObject.outerHeight() - 150); 5508 } }); 5509 } 5510} 5511 5512/* 5513* Init scroll to section link if that link has hash value 5514*/ 5515function initHashClick(){ 5516 "use strict"; 5517 5518 var $doc = $j('html, body'); 5519 var paspartuScrollAdd = $j('body').hasClass('paspartu_on_top_fixed') ? $window_width*paspartu_width : 0; 5520 var scrollToAmount; 5521 $j(document).on( "click", ".main_menu a, .vertical_menu a, .qbutton:not(.contact_form_button, .qode-archive-submit-button, .qode-listing-archive-load-more, .qode-rating-form-trigger, .qode-lms-actions-buttons, .qode-tours-search-submit), .anchor, .widget li.anchor a", function(){ 5522 var $this = $j(this); 5523 var hash = $j(this).prop("hash"); 5524 var top_header_height; 5525 if((hash !== "" && $j(this).attr('href').split('#')[0] === "") || (hash !== "" && $j(this).attr('href').split('#')[0] !== "" && hash === window.location.hash) || (hash !== "" && $j(this).attr('href').split('#')[0] === window.location.href.split('#')[0])){ //in third condition 'hash !== ""' stays to prevent reload of page when link is active and ajax enabled 5526 if($j('header.page_header').hasClass('fixed') && !$j('body').hasClass('vertical_menu_enabled')){ 5527 if($j('header.page_header').hasClass('scroll_top')){ 5528 top_header_height = header_top_height; 5529 }else{ 5530 top_header_height = 0; 5531 } 5532 5533 if(!$j('header.page_header').hasClass('transparent') || $j('header.page_header').hasClass('scrolled_not_transparent')) { 5534 if (header_height - ($j('[data-q_id="' + hash + '"]').offset().top + top_header_height) / 4 >= min_header_height_scroll) { 5535 var diff_of_header_and_section = $j('[data-q_id="' + hash + '"]').offset().top - header_height - paspartuScrollAdd; 5536 scrollToAmount = diff_of_header_and_section + (diff_of_header_and_section / 4) + (diff_of_header_and_section / 16) + (diff_of_header_and_section / 64) + 1;
5536 //several times od dividing to minimize the error, because fixed header is shrinking while scroll, 1 is just to ensure 5537 } else { 5538 if($j('header.page_header').hasClass('centered_logo')){ 5539 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - min_header_height_scroll - logo_height - paspartuScrollAdd - 30; //30 is top/bottom margin of logo 5540 } else { 5541 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - min_header_height_scroll - paspartuScrollAdd; 5542 } 5543 } 5544 }else{ 5545 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - paspartuScrollAdd; 5546 5547 } 5548 } else if($j('header.page_header').hasClass('fixed_top_header') && !$j('body').hasClass('vertical_menu_enabled')){ 5549 if(!$j('header.page_header').hasClass('transparent') || $j('header.page_header').hasClass('scrolled_not_transparent')){ 5550 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - header_top_height - paspartuScrollAdd; 5551 }else{ 5552 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - paspartuScrollAdd; 5553 } 5554 } else if($j('header.page_header').hasClass('fixed_hiding') && !$j('body').hasClass('vertical_menu_enabled')){ 5555 if(!$j('header.page_header').hasClass('transparent') || $j('header.page_header').hasClass('scrolled_not_transparent')) { 5556 if ($j('[data-q_id="' + hash + '"]').offset().top - (header_height + logo_height / 2 + 40) <= scroll_amount_for_fixed_hiding) { 5557 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - header_height - logo_height / 2 - 40 - paspartuScrollAdd; //40 is top/bottom margin of logo 5558 } else { 5559 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - min_header_height_fixed_hidden - 40 - paspartuScrollAdd; //40 is top/bottom margin of logo 5560 } 5561 }else{ 5562 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - paspartuScrollAdd; 5563 } 5564 }else if($j('header.page_header').hasClass('stick') || $j('header.page_header').hasClass('stick_with_left_right_menu') && !$j('body').hasClass('vertical_menu_enabled')) { 5565 if(!$j('header.page_header').hasClass('transparent') || $j('header.page_header').hasClass('scrolled_not_transparent')) { 5566 if (sticky_amount >= $j('[data-q_id="' + hash + '"]').offset().top) { 5567 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top + 2 - paspartuScrollAdd; // 2 is to show sticky menu 5568 } else { 5569 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - min_header_height_sticky - paspartuScrollAdd; 5570 } 5571 }else{ 5572 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - paspartuScrollAdd; 5573 } 5574 } else{ 5575 scrollToAmount = $j('[data-q_id="' + hash + '"]').offset().top - paspartuScrollAdd; 5576 } 5577 5578 5579 if($j('[data-q_id="'+hash+'"]').length > 0){ 5580 $doc.stop().animate({ 5581 scrollTop: Math.round(scrollToAmount) 5582 }, 1500, function() { 5583 anchorActiveState($this); 5584 }); 5585 5586 } 5587 5588 if(history.pushState) { 5589 history.pushState(null, null, hash); 5590 } 5591 return false; 5592 } 5593 5594 }); 5595 $j(document).on( "click", ".mobile_menu a", function(){ 5596 var $this = $j(this); 5597 var hash = $j(this).prop("hash"); 5598 if((hash !== "" && $j(this).attr('href').split('#')[0] === "") || (hash !== "" && $j(this).attr('href').split('#')[0] !== "" && hash === window.location.hash) || (hash !== "" && $j(this).attr('href').split('#')[0] === window.location.href.split('#')[0])){ //in third condition 'hash !== ""' stays to prevent reload of page when link is active and ajax enabled 5599 5600 if($j('[data-q_id="'+hash+'"]').length > 0){ 5601 $doc.animate({ 5602 scrollTop: Math.round($j('[data-q_id="'+hash+'"]').offset().top - $j('.mobile_menu').height()) 5603 }, 500,function(){ 5604 anchorActiveState($this); 5605 }); 5606 5607 } 5608 if(history.pushState) { 5609 history.pushState(null, null, hash); 5610 } 5611 return false;
5612 } 5613 5614 }); 5615} 5616 5617/* 5618** Add class to items in last row in clients shortcode 5619*/ 5620function countClientsPerRow(){ 5621 "use strict"; 5622 5623 if($j('.qode_clients').length){ 5624 5625 $j('.qode_clients').each(function() { 5626 var $clients = $j(this); 5627 var qode_clients_height = $clients.height(); 5628 var qode_clients_width = $clients.width(); 5629 var maxHeightClient; 5630 var clientWidth = $clients.find('.qode_client_holder').width(); 5631 var countClient = $clients.find('.qode_client_holder').length; 5632 $clients.find('.qode_client_holder').each(function() { 5633 maxHeightClient = maxHeightClient > $j(this).height() ? maxHeightClient : $j(this).height(); 5634 }); 5635 maxHeightClient = maxHeightClient + 35; //margin for client is 35 5636 var numberOfRows = Math.ceil(qode_clients_height / maxHeightClient); 5637 var numberOfClientsPerRow = Math.ceil(qode_clients_width/clientWidth); 5638 var numberOffullRows = Math.floor(countClient / numberOfClientsPerRow); 5639 var numberOfClientsInLastRow = countClient - (numberOfClientsPerRow * numberOffullRows); 5640 if(numberOfClientsInLastRow === 0){ 5641 numberOfClientsInLastRow = numberOfClientsPerRow; 5642 } 5643 $clients.find( ".qode_client_holder" ).removeClass('border-bottom-none'); 5644 var item_start_from = countClient - numberOfClientsInLastRow - 1; 5645 $clients.find( ".qode_client_holder:gt("+ item_start_from +")" ).addClass('border-bottom-none'); 5646 }); 5647 } 5648} 5649 5650/* 5651** Calculate height for animated text icon shortcode 5652*/ 5653function animatedTextIconHeight(){ 5654 "use strict"; 5655 5656 if($j('.animated_icons_with_text').length){ 5657 var $icons = $j('.animated_icons_with_text'); 5658 var maxHeight; 5659 5660 $icons.find('.animated_text p').each(function() { 5661 maxHeight = maxHeight > $j(this).height() ? maxHeight : $j(this).height(); 5662 }); 5663 5664 if(maxHeight < 155) { 5665 maxHeight = 155; 5666 5667 } 5668 $icons.find('.animated_icon_with_text_inner').height(maxHeight); 5669 } 5670} 5671 5672/* 5673** Add class to items in last row in animated text icon shortcode 5674*/ 5675function countAnimatedTextIconPerRow(){ 5676 "use strict"; 5677 5678 if($j('.animated_icons_with_text').length){ 5679 $j('.animated_icons_with_text').each(function() { 5680 var $icons = $j(this); 5681 var qode_icons_height = $icons.height(); 5682 var qode_icons_width = $icons.width(); 5683 var maxHeightIcons; 5684 var iconWidth = $icons.find('.animated_icon_with_text_holder').width() + 1; // 1px because safari round on smaller number 5685 var countIcons = $icons.find('.animated_icon_with_text_holder').length; 5686 $icons.find('.animated_icon_with_text_holder').each(function() { 5687 maxHeightIcons = maxHeightIcons > $j(this).height() ? maxHeightIcons : $j(this).height(); 5688 }); 5689 maxHeightIcons = maxHeightIcons + 30; //margin for client is 30 5690 var numberOfIconsPerRow = Math.ceil((qode_icons_width/iconWidth)); 5691 var numberOffullRows = Math.floor(countIcons / numberOfIconsPerRow); 5692 var numberOfIconsInLastRow = countIcons - (numberOfIconsPerRow * numberOffullRows); 5693 if(numberOfIconsInLastRow === 0){ 5694 numberOfIconsInLastRow = numberOfIconsPerRow; 5695 } 5696 $icons.find( ".animated_icon_with_text_holder" ).removeClass('border-bottom-none'); 5697 var item_start_from = countIcons - numberOfIconsInLastRow - 1; 5698 $icons.find( ".animated_icon_with_text_holder:gt("+ item_start_from +")" ).addClass('border-bottom-none'); 5699 }); 5700 } 5701} 5702 5703 5704/* 5705* Set active state in maim menu on anchor click 5706*/ 5707 5708function anchorActiveState(me){ 5709 if(me.closest('.main_menu').length > 0){ 5710 $j('.main_menu a').parent().removeClass('active'); 5711 } 5712 5713 if(me.closest('.vertical_menu').length > 0){ 5714 $j('.vertical_menu a').parent().removeClass('active'); 5715 } 5716 5717 if(me.closest('.second').length === 0){ 5718 me.parent().addClass('active'); 5719 }else{ 5720 me.closest('.second').parent().addClass('active'); 5721 } 5722 if(me.closest('.mobile_menu').length > 0){ 5723 $j('.mobile_menu a').parent().removeClass('active'); 5724 me.parent().addClass('active'); 5725 } 5726 5727 $j('.mobile_menu a, .main_menu a, .vertical_menu a').removeClass('current'); 5728 me.addClass('current'); 5729} 5730 5731/* 5732** Video background initialization 5733*/ 5734function initVideoBackground(){ 5735 "use strict"; 5736 5737 $j('.video-wrap .video').mediaelementplayer({ 5738 enableKeyboard: false, 5739 iPadUseNativeControls: false, 5740 pauseOtherPlayers: false, 5741 // force iPhone's native controls 5742 iPhoneUseNativeControls: false, 5743 // force Android's native controls 5744 AndroidUseNativeControls: false 5745 }); 5746 5747 //mobile check 5748 if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){
5749 initVideoBackgroundSize(); 5750 $j('.mobile-video-image').show(); 5751 $j('.video-wrap').remove(); 5752 } 5753} 5754 5755/* 5756** Calculate video background size 5757*/ 5758function initVideoBackgroundSize(){ 5759 "use strict"; 5760 5761 $j('.section .video-wrap').each(function(i){ 5762 5763 var $sectionWidth = $j(this).closest('.section').outerWidth(); 5764 $j(this).width($sectionWidth); 5765 5766 var $sectionHeight = $j(this).closest('.section').outerHeight(); 5767 min_w = vid_ratio * ($sectionHeight+20); 5768 $j(this).height($sectionHeight); 5769 5770 var scale_h = $sectionWidth / video_width_original; 5771 var scale_v = ($sectionHeight - header_height) / video_height_original; 5772 var scale = scale_v; 5773 if (scale_h > scale_v) 5774 scale = scale_h; 5775 if (scale * video_width_original < min_w) {scale = min_w / video_width_original;} 5776 5777 $j(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * video_width_original +2)); 5778 $j(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * video_height_original +2)); 5779 $j(this).scrollLeft(($j(this).find('video').width() - $sectionWidth) / 2); 5780 $j(this).find('.mejs-overlay, .mejs-poster').scrollTop(($j(this).find('video').height() - ($sectionHeight)) / 2); 5781 $j(this).scrollTop(($j(this).find('video').height() - ($sectionHeight)) / 2); 5782 5783 $j(this).css('opacity', 1); 5784 $j('.no-touchevents .section .mobile-video-image ').css('display', 'none'); 5785 }); 5786 5787 $j('.carousel .item .video .video-wrap').each(function(i){ 5788 5789 var $slideWidth = $j(window).width(); 5790 $j(this).width($slideWidth); 5791 5792 var mob_header = $j(window).width() < 1000 ? $j('header.page_header').height() - 6 : 0; // 6 is because of the display: inline-block 5793 var $slideHeight = $j(this).closest('.carousel.slide').height() - mob_header; 5794 5795 min_w = vid_ratio * ($slideHeight+20); 5796 $j(this).height($slideHeight); 5797 5798 var scale_h = $slideWidth / video_width_original; 5799 var scale_v = ($slideHeight - header_height) / video_height_original; 5800 var scale = scale_v; 5801 if (scale_h > scale_v) 5802 scale = scale_h; 5803 if (scale * video_width_original < min_w) {scale = min_w / video_width_original;} 5804 5805 $j(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * video_width_original +2)); 5806 $j(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * video_height_original +2)); 5807 $j(this).scrollLeft(($j(this).find('video').width() - $slideWidth) / 2); 5808 $j(this).find('.mejs-overlay, .mejs-poster').scrollTop(($j(this).find('video').height() - ($slideHeight)) / 2); 5809 $j(this).scrollTop(($j(this).find('video').height() - ($slideHeight)) / 2); 5810 }); 5811 5812 $j('.portfolio_single .video .video-wrap, .blog_holder .video .video-wrap').each(function(i){ 5813 5814 var $this = $j(this); 5815 5816 var $videoWidth = $j(this).closest('.video').outerWidth(); 5817 $j(this).width($videoWidth); 5818 var $videoHeight = ($videoWidth*9)/16; 5819 5820 if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ 5821 $this.parent().width($videoWidth); 5822 $this.parent().height($videoHeight); 5823 } 5824 5825 min_w = vid_ratio * ($videoHeight+20); 5826 $j(this).height($videoHeight); 5827 5828 var scale_h = $videoWidth / video_width_original; 5829 var scale_v = ($videoHeight - header_height) / video_height_original; 5830 var scale = scale_v; 5831 if (scale_h > scale_v) 5832 scale = scale_h; 5833 if (scale * video_width_original < min_w) {scale = min_w / video_width_original;} 5834 5835 $j(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * video_width_original +2)); 5836 $j(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * video_height_original +2)); 5837 $j(this).scrollLeft(($j(this).find('video').width() - $videoWidth) / 2); 5838 $j(this).find('.mejs-overlay, .mejs-poster').scrollTop(($j(this).find('video').height() - ($videoHeight)) / 2); 5839 $j(this).scrollTop(($j(this).find('video').height() - ($videoHeight)) / 2); 5840 }); 5841 5842} 5843 5844/* 5845** Icon With Text animation effect 5846*/ 5847function initIconWithTextAnimation(){ 5848 "use strict"; 5849 if($j('.q_icon_animation').length > 0 && $j('.no_animation_on_touch').length === 0){ 5850 $j('.q_icon_animation').each(function(){ 5851 $j(this).appear(function() { 5852 $j(this).addClass('q_show_animation'); 5853 }
5853,{accX: 0, accY: -200}); 5854 }); 5855 } 5856} 5857 5858/* 5859** Add class on body if browser is Safari 5860*/ 5861function initCheckSafariBrowser(){ 5862 "use strict"; 5863 5864 if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) { 5865 $j('body').addClass('safari_browser'); 5866 } 5867} 5868 5869/* 5870** Initialize Qode search form 5871*/ 5872function initSearchButton(){ 5873 5874 if($j('.search_slides_from_window_top').length){ 5875 $j('.search_slides_from_window_top').on('click', function(e){ 5876 e.preventDefault(); 5877 5878 if($j('html').hasClass('touch')){ 5879 if ($j('.qode_search_form').height() == "0") { 5880 $j('.qode_search_form input[type="text"]').onfocus = function () { 5881 window.scrollTo(0, 0); 5882 document.body.scrollTop = 0; 5883 }; 5884 $j('.qode_search_form input[type="text"]').onclick = function () { 5885 window.scrollTo(0, 0); 5886 document.body.scrollTop = 0; 5887 }; 5888 $j('.header_top_bottom_holder').css('top','50px'); 5889 $j('.qode_search_form').css('height','50px'); 5890 $j('.content_inner').css('margin-top','50px'); 5891 if($scroll < 34){ $j('header.page_header').css('top','0'); } 5892 } else { 5893 $j('.qode_search_form').css('height','0'); 5894 $j('.header_top_bottom_holder').css('top','0'); 5895 $j('.content_inner').css('margin-top','0'); 5896 if($scroll < 34){ $j('header.page_header').css('top',-$scroll);} 5897 } 5898 5899 $j(window).scroll(function() { 5900 if ($j('.qode_search_form').height() != "0" && $scroll > 50) { 5901 $j('.qode_search_form').css('height','0'); 5902 $j('.header_top_bottom_holder').css('top','0'); 5903 $j('.content_inner').css('margin-top','0'); 5904 } 5905 }); 5906 5907 $j('.qode_search_close').on('click', function(e){ 5908 e.preventDefault(); 5909 $j('.qode_search_form').css('height','0'); 5910 $j('.header_top_bottom_holder').css('top','0'); 5911 $j('.content_inner').css('margin-top','0'); 5912 if($scroll < 34){ $j('header.page_header').css('top',-$scroll);} 5913 }); 5914 5915 } else { 5916 if($j('.title').hasClass('has_fixed_background')){ 5917 var yPos = parseInt($j('.title.has_fixed_background').css('backgroundPosition').split(" ")[1]); 5918 }else { 5919 var yPos = 0; 5920 } 5921 if ($j('.qode_search_form').height() == "0") { 5922 $j('.qode_search_form input[type="text"]').focus(); 5923 $j('.header_top_bottom_holder').stop().animate({top:"50px"},150); 5924 $j('.qode_search_form').stop().animate({height:"50px"},150); 5925 $j('.content_inner').stop().animate({marginTop:"50px"},150); 5926 if($scroll < 34){ $j('header.page_header').stop().animate({top:0},150); } 5927 $j('.title.has_fixed_background').animate({ 5928 'background-position-y': (yPos + 50)+'px' 5929 }, 150); 5930 } else { 5931 $j('.qode_search_form').stop().animate({height:"0"},150); 5932 $j('.header_top_bottom_holder').stop().animate({top:"0px"},150); 5933 $j('.content_inner').stop().animate({marginTop:"0"},150); 5934 if($scroll < 34){ $j('header.page_header').stop().animate({top:-$scroll},150);} 5935 $j('.title.has_fixed_background').animate({ 5936 'background-position-y': (yPos - 50)+'px' 5937 }, 150); 5938 } 5939 5940 $j(window).scroll(function() { 5941 if ($j('.qode_search_form').height() != "0" && $scroll > 50) { 5942 $j('.qode_search_form').stop().animate({height:"0"},150); 5943 $j('.header_top_bottom_holder').stop().animate({top:"0px"},150); 5944 $j('.content_inner').stop().animate({marginTop:"0"},150); 5945 $j('.title.has_fixed_background').css('backgroundPosition', 'center '+(yPos)+'px'); 5946 } 5947 }); 5948 5949 $j('.qode_search_close').on('click', function(e){ 5950 e.preventDefault(); 5951 $j('.qode_search_form').stop().animate({height:"0"},150); 5952 $j('.content_inner').stop().animate({marginTop:"0"},150); 5953 $j('.header_top_bottom_holder').stop().animate({top:"0px"},150); 5954 if($scroll < 34){ $j('header.page_header').stop().animate({top:-$scroll},150);} 5955 $j('.title.has_fixed_background').animate({ 5956 'background-position-y': (yPos)+'px' 5957 }, 150); 5958 }); 5959 } 5960 }); 5961 } 5962 5963 //search type - search_slides_from_header_bottom 5964 if($j('.search_slides_from_header_bottom').length){ 5965 5966 $j('.search_slides_from_header_bottom').on('click', function(e){ 5967 5968 e.preventDefault(); 5969 5970 if($j('.qode_search_form_2').hasClass('animated')) { 5971 $j('.qode_search_form_2').removeClass('animated'); 5972 $j('.qode_search_form_2').css('bottom','0'); 5973 } else { 5974 $j('.qode_search_form input[type="text"]').focus(); 5975 $j('.qode_search_form_2').addClass('animated'); 5976 var search_form_height = $j('.qode_search_form_2').height(); 5977 $j('.qode_search_form_2').css('bottom',-search_form_height); 5978 5979 } 5980 5981 $j('.qode_search_form_2').addClass('disabled'); 5982 $j('.qode_search_form_2 input[type="submit"]').attr('disabled','disabled'); 5983 if(($j('.qode_search_form_2 .qode_search_field').val() !== '') && ($j('.qode_search_form_2 .qode_search_field').val() !== ' ')) { 5984 $j('.qode_search_form_2 input[type="submit"]').removeAttr('disabled'); 5985 $j('.qode_search_form_2').removeClass('disabled'); 5986 } 5987 else { 5988 $j('.qode_search_form_2').addClass('disabled'); 5989 $j('.qode_search_form_2 input[type="submit"]').attr('disabled','disabled'); 5990 } 5991 5992 $j('.qode_search_form_2 .qode_search_field').keyup(function() { 5993 if(($j(this).val() !== '') && ($j(this).val() != ' ')) { 5994 $j('.qode_search_form_2 input[type="submit"]').removeAttr('disabled'); 5995 $j('.qode_search_form_2').removeClass('disabled'); 5996 } 5997 else { 5998 $j('.qode_search_form_2 input[type="submit"]').attr('disabled','disabled'); 5999 $j('.qode_search_form_2').addClass('disabled'); 6000 } 6001 }); 6002 6003 6004 $j('.content, footer').on('click', function(e){ 6005 $j('.qode_search_form_2').removeClass('animated'); 6006 $j('.qode_search_form_2').css('bottom','0'); 6007 }); 6008 6009 }); 6010 } 6011 6012 //search type - search covers header 6013 if($j('.search_covers_header').length){ 6014 6015 $j('.search_covers_header').on('click', function(e){ 6016 6017 e.preventDefault(); 6018 if($j(".search_covers_only_bottom").length){ 6019 var headerHeight = $j('.header_bottom').height(); 6020 } 6021 else{ 6022 if($j(".fixed_top_header").length){
6023 var headerHeight = $j('.top_header').height(); 6024 }else{ 6025 var headerHeight = $j('.header_top_bottom_holder').height(); 6026 } 6027 } 6028 6029 $j('.qode_search_form_3 .form_holder_outer').height(headerHeight); 6030 6031 if($j(".search_covers_only_bottom").length){ 6032 $j('.qode_search_form_3').css('bottom',0); 6033 $j('.qode_search_form_3').css('top','auto'); 6034 } 6035 $j('.qode_search_form_3').stop(true).fadeIn(600,'easeOutExpo'); 6036 $j('.qode_search_form_3 input[type="text"]').focus(); 6037 6038 6039 $j(window).scroll(function() { 6040 if($j(".search_covers_only_bottom").length){ 6041 var headerHeight = $j('.header_bottom').height(); 6042 } 6043 else{ 6044 if($j(".fixed_top_header").length){ 6045 var headerHeight = $j('.top_header').height(); 6046 }else{ 6047 var headerHeight = $j('.header_top_bottom_holder').height(); 6048 } 6049 } 6050 $j('.qode_search_form_3 .form_holder_outer').height(headerHeight); 6051 }); 6052 6053 $j('.qode_search_close, .content, footer').on('click', function(e){ 6054 $j('.qode_search_form_3').stop(true).fadeOut(450,'easeOutExpo'); 6055 }); 6056 6057 $j('.qode_search_form_3').blur(function(e){ 6058 $j('.qode_search_form_3').stop(true).fadeOut(450,'easeOutExpo'); 6059 }); 6060 }); 6061 } 6062 6063//search type - fullscreen search 6064 if($j('.fullscreen_search').length){ 6065 //search type Circle Appear 6066 if($j(".fullscreen_search_holder.from_circle").length){ 6067 $j('.fullscreen_search').on('click',function(e){ 6068 e.preventDefault(); 6069 if($j('.fullscreen_search_overlay').hasClass('animate')){ 6070 $j('.fullscreen_search_overlay').removeClass('animate'); 6071 $j('.fullscreen_search_holder').css('opacity','0'); 6072 $j('.fullscreen_search_close').css('opacity','0'); 6073 $j('.fullscreen_search_close').css('visibility','hidden'); 6074 $j('.fullscreen_search').css('opacity','1'); 6075 $j('.fullscreen_search_holder').css('display','none'); 6076 } else { 6077 $j('.fullscreen_search_overlay').addClass('animate'); 6078 $j('.fullscreen_search_holder').css('display','block'); 6079 setTimeout(function(){ 6080 $j('.fullscreen_search_holder').css('opacity','1'); 6081 $j('.fullscreen_search_close').css('opacity','1'); 6082 $j('.fullscreen_search_close').css('visibility','visible'); 6083 $j('.fullscreen_search').css('opacity','0'); 6084 },200); 6085 6086 } 6087 }); 6088 $j('.fullscreen_search_close').on('click',function(e){ 6089 e.preventDefault(); 6090 $j('.fullscreen_search_overlay').removeClass('animate'); 6091 $j('.fullscreen_search_holder').css('opacity','0'); 6092 $j('.fullscreen_search_close').css('opacity','0'); 6093 $j('.fullscreen_search_close').css('visibility','hidden'); 6094 $j('.fullscreen_search').css('opacity','1'); 6095 $j('.fullscreen_search_holder').css('display','none'); 6096 6097 }); 6098 } 6099 //search type Fade Appear 6100 if($j(".fullscreen_search_holder.fade").length){ 6101 $j('.fullscreen_search').on('click',function(e){ 6102 e.preventDefault(); 6103 if($j('.fullscreen_search_holder').hasClass('animate')) { 6104 $j('body').removeClass('fullscreen_search_opened'); 6105 $j('.fullscreen_search_holder').removeClass('animate'); 6106 $j('body').removeClass('search_fade_out'); 6107 $j('body').removeClass('search_fade_in'); 6108 6109 } else { 6110 $j('body').addClass('fullscreen_search_opened'); 6111 $j('body').removeClass('search_fade_out'); 6112 $j('body').addClass('search_fade_in'); 6113 $j('.fullscreen_search_holder').addClass('animate'); 6114 6115 } 6116 }); 6117 $j('.fullscreen_search_close').on('click',function(e){ 6118 e.preventDefault(); 6119 $j('body').removeClass('fullscreen_search_opened'); 6120 $j('.fullscreen_search_holder').removeClass('animate'); 6121 $j('body').removeClass('search_fade_in'); 6122 $j('body').addClass('search_fade_out'); 6123 6124 }); 6125 } 6126 6127 //Text input focus change 6128 $j('.fullscreen_search_holder .search_field').focus(function(){ 6129 $j('.fullscreen_search_holder .field_holder .line').css("width","100%"); 6130 }); 6131 6132 $j('.fullscreen_search_holder .search_field').blur(function(){ 6133 $j('.fullscreen_search_holder .field_holder .line').css("width","0"); 6134 }); 6135 6136 //search close button - setting its position vertically 6137 $j(window).scroll(function() { 6138 var bottom_height = $j(".page_header .header_bottom").height(); 6139 if($j(".page_header").hasClass("sticky")){ 6140 $j(".fullscreen_search_holder .side_menu_button").css("height",bottom_height); 6141 $j(".fullscreen_search_holder .close_container").css("top","0"); 6142 } else if($j(".page_header").hasClass("fixed")){ 6143 $j(".fullscreen_search_holder .side_menu_button").css("height",bottom_height); 6144 } else { 6145 $j(".fullscreen_search_holder .side_menu_button").css("height",""); 6146 $j(".fullscreen_search_holder .close_container").css("top",""); 6147 } 6148 }); 6149 } 6150 6151 if($j('.qode_search_submit').length) { 6152 $j('.qode_search_submit').on('click', function(e) { 6153 e.preventDefault(); 6154 e.stopPropagation(); 6155 6156 var searchForm = $j(this).parents('form').first(); 6157 6158 searchForm.submit(); 6159 }); 6160 } 6161 6162} 6163 6164/* 6165** Init update Shopping Cart 6166*/ 6167function updateShoppingCart(){ 6168 "use strict"; 6169 6170 $j('body').bind('added_to_cart', add_to_cart); 6171 function add_to_cart(event, parts, hash) { 6172 var miniCart = $j('.shopping_cart_header'); 6173 if ( parts['div.widget_shopping_cart_content'] ) { 6174 var $cartContent = jQuery(parts['div.widget_shopping_cart_content']), 6175 $itemsList = $cartContent .find('.cart_list'), 6176 $total = $cartContent.find('.total').contents(':not(strong)').text(); 6177 miniCart.find('.shopping_cart_dropdown_inner').html('').append($itemsList); 6178 miniCart.find('.total span').html('').append($total); 6179 } 6180 } 6181} 6182 6183 6184/*
6185** Set content bottom margin because of the uncovering footer 6186*/ 6187function setContentBottomMargin(){ 6188 if($j('.uncover').length){ 6189 $j('.content').css('margin-bottom', $j('footer').height()); 6190 } 6191} 6192 6193/* 6194 ** Set footer uncover with vertical area 6195 */ 6196function footerWidth(){ 6197 "use strict"; 6198 6199 if($j('.uncover').length && $j('body').hasClass('vertical_menu_enabled') && $window_width > 1000){ 6200 $j('.uncover').width($window_width - $j('.vertical_menu_area').width()); 6201 } else{ 6202 $j('.uncover').css('width','100%'); 6203 } 6204} 6205 6206/* 6207** Boxes which reveal text on hover 6208*/ 6209function initCoverBoxes(){ 6210 if($j('.cover_boxes').length) { 6211 $j('.cover_boxes').each(function(){ 6212 var active_element = 0; 6213 var data_active_element = 1; 6214 if(typeof $j(this).data('active-element') !== 'undefined' && $j(this).data('active-element') !== false) { 6215 data_active_element = parseFloat($j(this).data('active-element')); 6216 active_element = data_active_element - 1; 6217 } 6218 6219 var number_of_columns = 3; 6220 6221 //validate active element 6222 active_element = data_active_element > number_of_columns ? 0 : active_element; 6223 6224 $j(this).find('li').eq(active_element).addClass('act'); 6225 var cover_boxed = $j(this); 6226 $j(this).find('li').each(function(){ 6227 $j(this).on('mouseenter', function() { 6228 $j(cover_boxed).find('li').removeClass('act'); 6229 $j(this).addClass('act'); 6230 }); 6231 6232 }); 6233 }); 6234 } 6235} 6236 6237/* 6238** Create content menu from selected rows 6239*/ 6240function createContentMenu(){ 6241 "use strict"; 6242 6243 var content_menu = $j(".content_menu"); 6244 content_menu.each(function(){ 6245 if($j(this).find('ul').length === 0){ 6246 6247 if($j(this).css('background-color') !== ""){ 6248 var background_color = $j(this).css('background-color'); 6249 } 6250 6251 var content_menu_ul = $j("<ul class='menu'></ul>"); 6252 content_menu_ul.appendTo($j(this)); 6253 6254 var sections = $j(this).siblings('.in_content_menu'); 6255 6256 if(sections.length){ 6257 sections.each(function(){ 6258 var section_href = $j(this).data("q_id"); 6259 var section_title = $j(this).data('q_title'); 6260 var section_icon = $j(this).data('q_icon'); 6261 6262 var li = $j("<li />"); 6263 var icon = $j("<i />", {"class": 'fa '+section_icon});
6264 var link = $j("<a />", {"href": section_href, "html": "<span>" + section_title + "</span>"}); 6265 var arrow; 6266 if(background_color !== ""){ 6267 arrow = $j("<div />", {"class": 'arrow', "style": 'border-color: '+background_color+' transparent transparent transparent'}); 6268 } else { 6269 arrow = $j("<div />", {"class": 'arrow'}); 6270 } 6271 icon.prependTo(link); 6272 link.appendTo(li); 6273 arrow.appendTo(li); 6274 li.appendTo(content_menu_ul); 6275 6276 }); 6277 } 6278 } 6279 }); 6280} 6281 6282/* 6283** Create content menu (select menu for responsiveness)from selected rows 6284*/ 6285function createSelectContentMenu(){ 6286 "use strict"; 6287 6288 var content_menu = $j(".content_menu"); 6289 content_menu.each(function(){ 6290 6291 var $this = $j(this); 6292 6293 var $menu_select = $j("<ul></ul>"); 6294 $menu_select.appendTo($j(this).find('.nav_select_menu')); 6295 6296 6297 $j(this).find("ul.menu li a").each(function(){ 6298 6299 var menu_url = $j(this).attr("href"); 6300 var menu_text = $j(this).text(); 6301 var menu_icon = $j(this).find('i').clone(); 6302 6303 if ($j(this).parents("li").length === 2) { menu_text = " " + menu_text; } 6304 if ($j(this).parents("li").length === 3) { menu_text = " " + menu_text; } 6305 if ($j(this).parents("li").length > 3) { menu_text = " " + menu_text; } 6306 6307 var li = $j("<li />");
6308 var link = $j("<a />", {"href": menu_url, "html": menu_text}); 6309 menu_icon.prependTo(link); 6310 link.appendTo(li); 6311 li.appendTo($menu_select); 6312 }); 6313 6314 6315 $this.find(".nav_select_button").on('click', function() { 6316 if ($this.find('.nav_select_menu ul').is(":visible")){ 6317 $this.find('.nav_select_menu ul').slideUp(); 6318 } else { 6319 $this.find('.nav_select_menu ul').slideDown(); 6320 } 6321 return false; 6322 }); 6323 6324 $this.find(".nav_select_menu ul li a").on('click',function () { 6325 $this.find('.nav_select_menu ul').slideUp(); 6326 var $link = $j(this); 6327 6328 var $target = $link.attr("href"); 6329 var targetOffset = $j("div.wpb_row[data-q_id='" + $target + "'],section.parallax_section_holder[data-q_id='" + $target + "'],.qode-elementor-content-menu-item[data-q_id='" + $target + "']").offset().top; 6330 6331 $j('html,body').stop().animate({scrollTop: targetOffset }, 500, 'swing', function(){ 6332 $j('nav.content_menu ul li').removeClass('active'); 6333 $link.parent().addClass('active'); 6334 }); 6335 6336 return false; 6337 }); 6338 }); 6339} 6340 6341/* 6342** Calculate content menu position and fix it when needed 6343*/ 6344function contentMenuPosition(){ 6345 "use strict"; 6346 6347 if($j('nav.content_menu').length){ 6348 6349 if(content_menu_position > sticky_amount){ 6350 var x = min_header_height_sticky; 6351 }else{ 6352 var x = 0; 6353 } 6354 6355 if(content_menu_position - x - content_menu_top_add - $scroll <= 0 && ($j('header').hasClass('stick') || $j('header').hasClass('stick_with_left_right_menu'))){ 6356 6357 if(content_menu_position < sticky_amount){ 6358 if($scroll > sticky_amount){ 6359 $j('nav.content_menu').css({'position': 'fixed', 'top': min_header_height_sticky + content_menu_top_add}).addClass('fixed'); 6360 6361 }else{ 6362 $j('nav.content_menu').css({'position': 'fixed', 'top': 0, transition:'none'}).addClass('fixed'); 6363 } 6364 }else{ 6365 $j('nav.content_menu').css({'position': 'fixed', 'top': min_header_height_sticky + content_menu_top_add}).addClass('fixed'); 6366 } 6367 $j('header.sticky').addClass('no_shadow'); 6368 $j('.content > .content_inner > .container > .container_inner').css('margin-top',content_line_height); 6369 $j('.content > .content_inner > .full_width').css('margin-top',content_line_height); 6370 6371 } else if(content_menu_position - content_menu_top - content_menu_top_add - $scroll <= 0 && !($j('header').hasClass('stick'))) { 6372 $j('nav.content_menu').css({'position': 'fixed', 'top': content_menu_top + content_menu_top_add}).addClass('fixed'); 6373 $j('.content > .content_inner > .container > .container_inner').css('margin-top',content_line_height); 6374 $j('.content > .content_inner > .full_width').css('margin-top',content_line_height); 6375 } else { 6376 $j('nav.content_menu').css({'position': 'relative', 'top': '0px'}).removeClass('fixed'); 6377 $j('header.sticky').removeClass('no_shadow'); 6378 $j('.content > .content_inner > .container > .container_inner').css('margin-top','0px'); 6379 $j('.content > .content_inner > .full_width').css('margin-top','0px'); 6380 } 6381 6382 $j('.content .in_content_menu').waypoint( function(direction) { 6383 var $active = $j(this); 6384 var id = $active.data("q_id"); 6385 6386 $j("nav.content_menu.fixed li a").each(function(){ 6387 var i = $j(this).attr("href"); 6388 if(i === id){ 6389 $j(this).parent().addClass('active'); 6390 }else{ 6391 $j(this).parent().removeClass('active'); 6392 } 6393 }); 6394 }, { offset: '150' }); 6395 } 6396} 6397 6398/* 6399** Check first and last content menu included rows for active state in content menu 6400*/ 6401function contentMenuCheckLastSection(){ 6402 "use strict"; 6403 6404 if($j('nav.content_menu').length){ 6405 6406 if($j('.content .in_content_menu').length){ 6407 var last_from_top = $j('.content .in_content_menu:last').offset().top + $j('.content .in_content_menu:last').height(); 6408 var first_from_top = $j('.content .in_content_menu:first').offset().top - content_menu_top - content_menu_top_add - 100; //60 is height of content menu 6409 if(last_from_top < $scroll){ 6410 $j("nav.content_menu.fixed li").removeClass('active'); 6411 6412 } 6413 if(first_from_top > $scroll){ 6414 $j('nav.content_menu li:first, nav.content_menu ul.menu li:first').removeClass('active'); 6415 6416 } 6417 } 6418 6419 } 6420} 6421 6422/* 6423** Scroll to section when item in content menu is clicked 6424*/ 6425function contentMenuScrollTo(){ 6426 "use strict"; 6427 6428 if($j('nav.content_menu').length){ 6429 6430 $j("nav.content_menu ul.menu li a").on('click', function(e){ 6431 e.preventDefault(); 6432 var $this = $j(this); 6433 6434 if($j(this).parent().hasClass('active')){ 6435 return false;
6436 } 6437 6438 var $target = $this.attr("href"); 6439 var targetOffset = $j("div.wpb_row[data-q_id='" + $target + "'],section.parallax_section_holder[data-q_id='" + $target + "'],.qode-elementor-content-menu-item[data-q_id='" + $target + "']").offset().top - content_line_height - content_menu_top - content_menu_top_add; 6440 $j('html,body').stop().animate({scrollTop: targetOffset }, 500, 'swing', function(){ 6441 $j('nav.content_menu ul li').removeClass('active'); 6442 $this.parent().addClass('active'); 6443 }); 6444 6445 return false; 6446 }); 6447 6448 } 6449} 6450 6451function initButtonHover() { 6452 if($j('.qbutton').length) { 6453 $j('.qbutton').each(function() { 6454 6455 //hover background color 6456 if(typeof $j(this).data('hover-background-color') !== 'undefined' && $j(this).data('hover-background-color') !== false) { 6457 var hover_background_color = $j(this).data('hover-background-color'); 6458 var initial_background_color = $j(this).css('background-color'); 6459 $j(this).hover( 6460 function() { 6461 $j(this).css('background-color', hover_background_color); 6462 }, 6463 function() { 6464 $j(this).css('background-color', initial_background_color); 6465 }); 6466 } 6467 6468 //hover border color 6469 if(typeof $j(this).data('hover-border-color') !== 'undefined' && $j(this).data('hover-border-color') !== false) { 6470 var hover_border_color = $j(this).data('hover-border-color'); 6471 var initial_border_color = $j(this).css('border-top-color'); 6472 $j(this).hover( 6473 function() { 6474 $j(this).css('border-color', hover_border_color); 6475 }, 6476 function() { 6477 $j(this).css('border-color', initial_border_color); 6478 }); 6479 } 6480 6481 //hover color 6482 if(typeof $j(this).data('hover-color') !== 'undefined' && $j(this).data('hover-color') !== false) { 6483 var hover_color = $j(this).data('hover-color'); 6484 var initial_color = $j(this).css('color'); 6485 $j(this).hover( 6486 function() { 6487 $j(this).css('color', hover_color); 6488 }, 6489 function() { 6490 $j(this).css('color', initial_color); 6491 }); 6492 } 6493 }); 6494 } 6495} 6496 6497/** 6498 * Button object that initializes whole button functionality 6499 * @type {Function} 6500 */ 6501var qodeV2Button = function() { 6502 //all buttons on the page 6503 var buttons = $j('.qode-btn'); 6504 6505 /** 6506 * Initializes button hover color 6507 * @param button current button 6508 */ 6509 var buttonHoverColor = function(button) { 6510 if(typeof button.data('hover-color') !== 'undefined') { 6511 var changeButtonColor = function(event) { 6512 event.data.button.css('color', event.data.color); 6513 }; 6514 6515 var originalColor = button.css('color'); 6516 var hoverColor = button.data('hover-color'); 6517 6518 if (!button.hasClass('qode-btn-3d-hover')) { 6519 button.on('mouseenter', { button: button, color: hoverColor }, changeButtonColor); 6520 button.on('mouseleave', { button: button, color: originalColor }, changeButtonColor); 6521 } 6522 } 6523 }; 6524 6525 6526 6527 /** 6528 * Initializes button hover background color 6529 * @param button current button 6530 */ 6531 var buttonHoverBgColor = function(button) { 6532 if(typeof button.data('hover-bg-color') !== 'undefined') { 6533 var changeButtonBg = function(event) { 6534 event.data.button.css('background-color', event.data.color); 6535 }; 6536 6537 var originalBgColor = button.css('background-color'); 6538 var hoverBgColor = button.data('hover-bg-color'); 6539 6540 if (!button.hasClass('qode-btn-3d-hover')) { 6541 button.on('mouseenter', { button: button, color: hoverBgColor }, changeButtonBg); 6542 button.on('mouseleave', { button: button, color: originalBgColor }, changeButtonBg); 6543 } 6544 } 6545 }; 6546 6547 /** 6548 * Initializes button border color 6549 * @param button 6550 */ 6551 var buttonHoverBorderColor = function(button) { 6552 if(typeof button.data('hover-border-color') !== 'undefined') { 6553 var changeBorderColor = function(event) { 6554 event.data.button.css('border-color', event.data.color); 6555 }; 6556 6557 var originalBorderColor = button.css('borderTopColor'); //take one of the four sides 6558 var hoverBorderColor = button.data('hover-border-color'); 6559 6560 if (!button.hasClass('qode-btn-3d-hover')) { 6561 button.on('mouseenter', { button: button, color: hoverBorderColor }, changeBorderColor); 6562 button.on('mouseleave', { button: button, color: originalBorderColor }, changeBorderColor); 6563 } 6564 } 6565 }; 6566 6567 /** 6568 * Initializes button icon border color 6569 * @param button 6570 */ 6571 var buttonIconHoverBorderColor = function(button) { 6572 6573 var iconHolder = button.find('.qode-button-v2-icon-holder'); 6574 if(typeof iconHolder.data('hover-icon-border-color') !== 'undefined') { 6575 var changeIconBorderColor = function(event) { 6576 event.data.iconHolder.css('border-color', event.data.color); 6577 }; 6578 6579 var originalBorderColor = iconHolder.css('borderLeftColor'); //take one of the four sides 6580 var hoverBorderColor = iconHolder.data('hover-icon-border-color'); 6581 6582 if (!button.hasClass('qode-btn-3d-hover')) { 6583 button.on('mouseenter', { iconHolder: iconHolder, color: hoverBorderColor }, changeIconBorderColor); 6584 button.on('mouseleave', { iconHolder: iconHolder, color: originalBorderColor }, changeIconBorderColor); 6585 } 6586 } 6587 }; 6588 6589 /** 6590 * Initializes button icon background color 6591 * @param button 6592 */
6593 var buttonIconHoverBackgroundColor = function(button) { 6594 6595 var iconHolder = button.find('.qode-button-v2-icon-holder'); 6596 if(typeof iconHolder.data('hover-icon-bg-color') !== 'undefined') { 6597 var changeIconBgColor = function(event) { 6598 event.data.iconHolder.css('background-color', event.data.color); 6599 }; 6600 6601 var originalBgColor = iconHolder.css('backgroundColor'); //take one of the four sides 6602 var hoverBgColor = iconHolder.data('hover-icon-bg-color'); 6603 6604 if (!button.hasClass('qode-btn-3d-hover')) { 6605 button.on('mouseenter', { iconHolder: iconHolder, color: hoverBgColor }, changeIconBgColor); 6606 button.on('mouseleave', { iconHolder: iconHolder, color: originalBgColor }, changeIconBgColor); 6607 } 6608 } 6609 }; 6610 6611 /** 6612 * Initializes button 3d rotate effect and styles 6613 * @param button 6614 */ 6615 var button3DRotate = function(button) { 6616 if (button.hasClass('qode-btn-3d-hover')) { 6617 var buttonHolder = button.closest('.qode-3d-button-holder'), 6618 button3D = buttonHolder.find('.qode-btn-3d-hover'), 6619 aSide = button3D.first(), 6620 bSide = button3D.last(), 6621 iconHolder = bSide.find('.qode-button-v2-icon-holder'), 6622 buttonHeight = buttonHolder.outerHeight(), 6623 translateFactor = Math.round(buttonHeight/2); 6624 6625 //rotation 6626 aSide.css('transform','rotateX(0deg) translateZ('+translateFactor+'px)'); 6627 bSide.css('transform','rotateX(90deg) translateZ('+translateFactor+'px)'); 6628 setTimeout(function(){ 6629 buttonHolder.css('opacity','1'); //show after sides are set 6630 },200); 6631 6632 buttonHolder.on('mouseenter', function(){ 6633 aSide.css('transform','rotateX(-90deg) translateZ('+translateFactor+'px)'); 6634 bSide.css('transform','rotateX(0deg) translateZ('+translateFactor+'px)'); 6635 }); 6636 6637 buttonHolder.on('mouseleave', function(){ 6638 aSide.css('transform','rotateX(0deg) translateZ('+translateFactor+'px)'); 6639 bSide.css('transform','rotateX(90deg) translateZ('+translateFactor+'px)'); 6640 }); 6641 6642 //styles 6643 if(typeof bSide.data('hover-color') !== 'undefined') { 6644 var buttonHoverColor = bSide.data('hover-color'); 6645 bSide.css('color', buttonHoverColor) 6646 } 6647 if(typeof bSide.data('hover-bg-color') !== 'undefined') { 6648 var buttonHoverBackgroundColor = bSide.data('hover-bg-color'); 6649 bSide.css('background-color', buttonHoverBackgroundColor) 6650 } 6651 if(typeof bSide.data('hover-border-color') !== 'undefined') { 6652 var buttonHoverBorderColor = bSide.data('hover-border-color'); 6653 bSide.css('border-color', buttonHoverBorderColor) 6654 } 6655 if(typeof iconHolder.data('hover-icon-border-color') !== 'undefined') { 6656 var iconBorderColor = iconHolder.data('hover-icon-border-color'); 6657 iconHolder.css('border-color', iconBorderColor); 6658 } 6659 if(typeof iconHolder.data('hover-icon-bg-color') !== 'undefined') { 6660 var iconBgColor = iconHolder.data('hover-icon-bg-color'); 6661 iconHolder.css('background-color', iconBgColor); 6662 } 6663 } 6664 } 6665 6666 return { 6667 init: function() { 6668 if(buttons.length) { 6669 buttons.each(function() { 6670 buttonHoverColor($j(this)); 6671 buttonHoverBgColor($j(this)); 6672 buttonIconHoverBorderColor($j(this)); 6673 buttonIconHoverBackgroundColor($j(this)); 6674 button3DRotate($j(this)); 6675 }); 6676 } 6677 } 6678 }; 6679}; 6680 6681 6682 6683/* 6684* Enlarge button effect 6685*/ 6686function initEnlargeButton() { 6687 if($j('.qbutton.enlarge').length) { 6688 $j('.qbutton.enlarge').each(function() { 6689 var thisButton = $j(this), 6690 horizontalPadding = parseInt(thisButton.css('padding-left')), 6691 paddingOffset = Math.floor((horizontalPadding/100)*20); 6692 thisButton.mouseenter(function(){ 6693 thisButton.css({'padding-left':horizontalPadding + paddingOffset}); 6694 thisButton.css({'padding-right':horizontalPadding + paddingOffset}); 6695 }); 6696 thisButton.mouseleave(function(){ 6697 thisButton.css({'padding-left':horizontalPadding}); 6698 thisButton.css({'padding-right':horizontalPadding}); 6699 }); 6700 }); 6701 } 6702} 6703 6704function initSocialIconHover() { 6705 if($j('.q_social_icon_holder').length) { 6706 $j('.q_social_icon_holder').each(function() { 6707 6708 //hover background color 6709 if(typeof $j(this).data('hover-background-color') !== 'undefined' && $j(this).data('hover-background-color') !== false) { 6710 var hover_background_color = $j(this).data('hover-background-color'); 6711 var initial_background_color = $j(this).find('.fa-stack').css('background-color'); 6712 $j(this).find('.fa-stack').hover( 6713 function() { 6714 6715 $j(this).css('background-color', hover_background_color); 6716 }, 6717 function() { 6718 $j(this).css('background-color', initial_background_color); 6719 }); 6720 } 6721 6722 //hover border color 6723 if(typeof $j(this).data('hover-border-color') !== 'undefined' && $j(this).data('hover-border-color') !== false) { 6724 var hover_border_color = $j(this).data('hover-border-color'); 6725 var initial_border_color = $j(this).find('.fa-stack').css('border-top-color'); 6726 $j(this).find('.fa-stack').hover( 6727 function() { 6728 $j(this).css('border-color', hover_border_color); 6729 }, 6730 function() { 6731 $j(this).css('border-color', initial_border_color); 6732 } 6733 ); 6734 } 6735 6736 //hover color 6737 if(typeof $j(this).data('hover-color') !== 'undefined' && $j(this).data('hover-color') !== false) { 6738 var initial_color; 6739 var initial_style; 6740 var hover_color = $j(this).data('hover-color'); 6741 6742 if($j(this).find('.fa-stack i, .fa-stack span').length) { 6743 6744 if(typeof $j(this).data('color') !== 'undefined'){ 6745 initial_color = $j(this).data('color'); 6746 } 6747 else{ 6748 initial_color = $j(this).find('.fa-stack i, .fa-stack span').css('color'); 6749 } 6750 6751 initial_style = $j(this).find('.fa-stack i, .fa-stack span').attr('style'); 6752 6753 } else if($j(this).find('.simple_social').length) { 6754 6755 if(typeof $j(this).data('color') !== 'undefined'){ 6756 initial_color = $j(this).data('color'); 6757 } 6758 else{ 6759 initial_color = $j(this).find('.simple_social').css('color'); 6760 } 6761 6762 initial_style = $j(this).find('.simple_social').attr('style'); 6763 } 6764 6765 if($j(this).find('.fa-stack').length) { 6766 $j(this).find('.fa-stack').hover( 6767 function() { 6768 $j(this).find('i, span').attr('style', function(i, s) { return initial_style + 'color: '+ hover_color + '!important;'}); 6769 }, 6770 function() { 6771 $j(this).find('i, span').attr('style', function(i, s) { return initial_style + 'color: ' + initial_color + ';' }); 6772 }); 6773 } else if($j(this).find('.simple_social').length) { 6774 $j(this).find('.simple_social').hover( 6775 function(){ 6776 $j(this).attr('style', function(i, s) { return initial_style + 'color: '+ hover_color + '!important;' }); 6777 }, 6778 function(){ 6779 $j(this).attr('style', function(i, s) { return initial_style + 'color: '+ initial_color + ';' }); 6780 }); 6781 } 6782 6783 } 6784 }); 6785 } 6786} 6787 6788function initTabsActiveBorder() { 6789 if($j('.q_tabs.vertical, .q_tabs.boxed').length) { 6790 $j('.q_tabs.vertical, .q_tabs.boxed').each(function(){
6791 var parentBgColor = getParentBackgroundColor($j(this)); 6792 6793 var activeElement = $j(this).find('li.active a'); 6794 if($j(this).hasClass('boxed')) { 6795 activeElement.css('border-bottom-color', parentBgColor); 6796 } 6797 6798 if($j(this).hasClass('left')) { 6799 activeElement.css('border-right-color', parentBgColor); 6800 } 6801 6802 if($j(this).hasClass('right')) { 6803 activeElement.css('border-left-color', parentBgColor); 6804 } 6805 }); 6806 } 6807} 6808 6809function getParentBackgroundColor(element) { 6810 return element.parents().filter(function(){ 6811 var color = $j(this).css('background-color'); 6812 return color != 'transparent' && color != 'rgba(0, 0, 0, 0)'; 6813 }).eq(0).css('background-color') 6814} 6815 6816function setActiveTabBorder() { 6817 if($j('.q_tabs li.active').length) { 6818 $j(this).on('click', function() { 6819 initTabsActiveBorder(); 6820 }); 6821 } 6822} 6823 6824/* 6825 ** Popup menu initialization 6826 */ 6827 6828function initPopupMenu(){ 6829 "use strict"; 6830 6831 if($j('a.popup_menu').length){ 6832 6833 //set height of popup holder and initialize nicescroll 6834 $j(".popup_menu_holder_outer").height($window_height).niceScroll({ 6835 scrollspeed: 30, 6836 mousescrollstep: 20, 6837 cursorwidth: 0, 6838 cursorborder: 0, 6839 cursorborderradius: 0, 6840 cursorcolor: "transparent", 6841 autohidemode: false, 6842 horizrailenabled: false 6843 }); //200 is top and bottom padding of holder 6844 6845 //set delays on nav items and widget area 6846 if($j('body').hasClass('qode_popup_menu_push_text_right') || $j('body').hasClass('qode_popup_menu_push_text_top')) { 6847 $j('.popup_menu_holder_outer nav > ul > li > a').each(function (i) { 6848 $j(this).css({ 6849 '-webkit-animation-delay': i * 70 + 'ms', 6850 'animation-delay': i * 70 + 'ms' 6851 }); 6852 }); 6853 $j('.popup_menu_widget_holder > div').css({ 6854 '-webkit-animation-delay': ($j('.popup_menu_holder_outer nav > ul > li > a').length+1)*70 + 'ms', 6855 'animation-delay': ($j('.popup_menu_holder_outer nav > ul > li > a').length+1)*70 + 'ms' 6856 }); 6857 } 6858 6859 //set height of popup holder on resize 6860 $j(window).resize(function() {$j(".popup_menu_holder_outer").height($window_height)}); 6861 6862// $j(".popup_menu > ul > li.has_sub > ul.sub_menu > li.has_sub > a > span.popup_arrow, .popup_menu > ul > li.has_sub > ul.sub_menu > li.has_sub > h6").on('click', function () { 6863// if ($j(this).parent().parent().find("ul.sub_menu").is(":visible")){ 6864// $j(this).parent().parent().find("ul.sub_menu").slideUp(200); 6865// $j(this).parent().parent().removeClass('open_sub'); 6866// } else { 6867// $j(this).parent().parent().addClass('open_sub'); 6868// $j(this).parent().parent().find("ul.sub_menu").slideDown(200); 6869// } 6870// }); 6871 6872 initPopupMenuHolderOpening(); 6873 initPopupMenuItemsOpening(); 6874 } 6875} 6876 6877function initPopupMenuHolderOpening(){ 6878 //Open popup menu 6879 $j('a.popup_menu').on('click',function(e){ 6880 e.preventDefault(); 6881 6882 if(!$j(this).hasClass('opened')){ 6883 $j(this).addClass('opened'); 6884 $j('body').addClass('popup_menu_opened'); 6885 6886 if($j(this).hasClass('qode_popup_menu_push_text_right')) { 6887 $j('body').addClass('qode_popup_menu_fade_in').removeClass('qode_popup_menu_fade_out'); 6888 $j('body').removeClass('qode_popup_menu_push_nav_right'); 6889 } 6890 else if($j(this).hasClass('qode_popup_menu_push_text_top')) { 6891 $j('body').addClass('qode_popup_menu_fade_in').removeClass('qode_popup_menu_fade_out'); 6892 $j('body').removeClass('qode_popup_menu_push_nav_top'); 6893 } 6894 else if($j(this).hasClass('qode_popup_menu_text_scaledown')) { 6895 $j('body').addClass('qode_popup_menu_fade_in').removeClass('qode_popup_menu_fade_out'); 6896 } 6897 6898 setTimeout(function(){ 6899 if(!$j('body').hasClass('page-template-full_screen-php')){ 6900 $j('body').css('overflow','hidden'); 6901 } 6902 },400); 6903 }else{ 6904 $j(this).removeClass('opened'); 6905 $j('body').removeClass('popup_menu_opened'); 6906 6907 if($j(this).hasClass('qode_popup_menu_push_text_right') || $j(this).hasClass('qode_popup_menu_push_text_top') || $j(this).hasClass('qode_popup_menu_text_scaledown')) { 6908 $j('body').removeClass('qode_popup_menu_fade_in').addClass('qode_popup_menu_fade_out'); 6909 } 6910 6911 if($j(this).hasClass('qode_popup_menu_push_text_right')) { 6912 $j('body').addClass('qode_popup_menu_push_nav_right'); 6913 } 6914 else if($j(this).hasClass('qode_popup_menu_push_text_top')) { 6915 $j('body').addClass('qode_popup_menu_push_nav_top'); 6916 } 6917 6918 setTimeout(function(){ 6919 if(!$j('body').hasClass('page-template-full_screen-php')){ 6920 $j('body').css('overflow','visible'); 6921 } 6922 $j("nav.popup_menu ul.sub_menu").slideUp(200, function(){ 6923 $j('nav.popup_menu').getNiceScroll().resize(); 6924 }); 6925 },400); 6926 6927 } 6928 }); 6929} 6930 6931function initPopupMenuItemsOpening(){ 6932 //logic for open sub menus in popup menu 6933 $j(".popup_menu > ul > li.has_sub > a, .popup_menu > ul > li.has_sub > h6").on('tap click', function (e) { 6934 e.preventDefault(); 6935 6936 if ($j(this).closest('li.has_sub').find("> ul.sub_menu").is(":visible")){ 6937 $j(this).closest('li.has_sub').find("> ul.sub_menu").slideUp(200, function(){ 6938 $j('.popup_menu_holder_outer').getNiceScroll().resize(); 6939 }); 6940 $j(this).closest('li.has_sub').removeClass('open_sub'); 6941 } else { 6942 $j(this).closest('li.has_sub').addClass('open_sub'); 6943 $j(this).closest('li.has_sub').find("> ul.sub_menu").slideDown(200, function(){ 6944 $j('.popup_menu_holder_outer').getNiceScroll().resize(); 6945 }); 6946 } 6947 6948 return false;
6949 }); 6950 6951 //if link has no submenu and if it's not dead, than open that link 6952 $j(".popup_menu ul li:not(.has_sub) a").on('click', function () { 6953 if(($j(this).attr('href') !== "http://#") && ($j(this).attr('href') !== "#")){ 6954 $j('a.popup_menu').removeClass('opened'); 6955 $j('body').removeClass('popup_menu_opened').css('overflow','visible'); 6956 $j("nav.popup_menu ul.sub_menu").slideUp(200, function(){ 6957 $j('nav.popup_menu').getNiceScroll().resize(); 6958 }); 6959 }else{ 6960 return false; 6961 } 6962 }); 6963} 6964 6965function initFullScreenTemplate(){ 6966 "use strict"; 6967 6968 if($j('.full_screen_holder').length && $window_width > 600){ 6969 6970 // used for header style on changing sections, in checkFullScreenSectionsForHeaderStyle functions - START // 6971 var default_header_style = ''; 6972 if ($j('header.page_header').hasClass('light')) { 6973 default_header_style = 'light'; 6974 } else if ($j('header.page_header').hasClass('dark')) { 6975 default_header_style = 'dark'; 6976 } else { 6977 default_header_style = header_style_admin; 6978 } 6979 // used for header style on changing sections, in checkFullScreenSectionsForHeaderStyle functions - END // 6980 6981 $j('.full_screen_preloader').css('height', ($window_height)); 6982 6983 $j('#up_fs_button').on('click', function() { 6984 $j.fn.fullpage.moveSectionUp(); 6985 return false; 6986 }); 6987 6988 $j('#down_fs_button').on('click', function() { 6989 $j.fn.fullpage.moveSectionDown(); 6990 return false; 6991 }); 6992 6993 var section_number = $j('.full_screen_inner > .full_screen_section').length; 6994 6995 //if already instanciated destroy it so Elementor can instanciate it again with
6995new settings 6996 if( $j('html').hasClass('qode-initialized-fss') ){ 6997 $j.fn.fullpage.destroy('all'); 6998 } 6999 7000 $j('.full_screen_inner').fullpage({ 7001 sectionSelector: '.full_screen_section', 7002 scrollOverflow: true, 7003 afterLoad: function(anchorLink, index){ 7004 checkActiveArrowsOnFullScrrenTemplate(section_number, index); 7005 checkFullScreenSectionsForHeaderStyle(index, default_header_style); 7006 }, 7007 afterRender: function(){ 7008 $j('html').addClass('qode-initialized-fss'); 7009 $j(this).addClass('qode-initialized'); 7010 checkActiveArrowsOnFullScrrenTemplate(section_number, 1); 7011 checkFullScreenSectionsForHeaderStyle(1, default_header_style); 7012 if(section_number !== 1){ 7013 $j('.full_screen_holder').find('.full_screen_navigation_holder').css('visibility','visible'); 7014 } 7015 $j('.full_screen_holder').find('.full_screen_inner').css('visibility','visible'); 7016 $j('.full_screen_preloader').hide(); 7017 if($j('.full_screen_holder video.full_screen_sections_video').length){ 7018 $j('.full_screen_holder video.full_screen_sections_video').each(function(){ 7019 $j(this).get(0).play(); 7020 }); 7021 } 7022 } 7023 }); 7024 } 7025} 7026 7027function checkActiveArrowsOnFullScrrenTemplate(section_number, index){ 7028 "use strict"; 7029 7030 if(index === 1){ 7031 $j('.full_screen_navigation_holder #up_fs_button').hide(); 7032 if(index != section_number){ 7033 $j('.full_screen_navigation_holder #down_fs_button').show(); 7034 } 7035 }else if(index === section_number){ 7036 if(section_number === 2){ 7037 $j('.full_screen_navigation_holder #up_fs_button').show(); 7038 } 7039 $j('.full_screen_navigation_holder #down_fs_button').hide(); 7040 }else{ 7041 $j('.full_screen_navigation_holder #up_fs_button').show(); 7042 $j('.full_screen_navigation_holder #down_fs_button').show(); 7043 } 7044} 7045 7046function checkFullScreenSectionsForHeaderStyle(index, default_header_style){ 7047 "use strict"; 7048 7049 if($j('[data-q_header_style]').length > 0 && $j('header').hasClass('header_style_on_scroll')) { 7050 if ($j($j('.full_screen_holder .full_screen_inner .full_screen_section')[index-1]).data("q_header_style") !== undefined) { 7051 var header_style = $j($j('.full_screen_holder .full_screen_inner .full_screen_section')[index-1]).data("q_header_style"); 7052 $j('header').removeClass('dark light').addClass(header_style); 7053 } else { 7054 7055 $j('header').removeClass('dark light').addClass(default_header_style); 7056 } 7057 } 7058} 7059 7060/* 7061 * Check header style on scroll 7062 */ 7063 7064function checkHeaderStyleOnScroll(){ 7065 "use strict"; 7066 7067 if($j('[data-q_header_style]').length > 0 && $j('header').hasClass('header_style_on_scroll')){ 7068 7069 //var offset = $j('header.page_header').height(); 7070 var default_header_style = ''; 7071 if($j('header.page_header').hasClass('light')){ 7072 default_header_style = 'light'; 7073 }else if($j('header.page_header').hasClass('dark')){ 7074 default_header_style = 'dark'; 7075 }else{ 7076 default_header_style = header_style_admin; 7077 } 7078 7079 var paspartu_top_add = $j('body').hasClass('paspartu_on_top_fixed') ? Math.round($window_width*paspartu_width) : 0; 7080 var paspartu_bottom_add = $j('body').hasClass('paspartu_on_bottom_fixed') ? Math.round($window_width*paspartu_width) : 0; 7081 7082 $j('.full_width_inner > .wpb_row.section, .full_width_inner > .parallax_section_holder, .container_inner > .wpb_row.section, .container_inner > .parallax_section_holder, .portfolio_single > .wpb_row.section').waypoint( function(direction) { 7083 if(direction === 'down') { 7084 //retrieve section object from waypoint object 7085 var sectionObject = $j(this)[0].adapter.$element; 7086 7087 if (sectionObject.data("q_header_style") !== undefined) { 7088 var header_style = sectionObject.data("q_header_style"); 7089 $j('header').removeClass('dark light').addClass(header_style); 7090 } else { 7091 $j('header').removeClass('dark light').addClass(default_header_style); 7092 } 7093 } 7094 7095 }, { offset: 0 + paspartu_top_add}); 7096 7097 //'title' class is added in selector because default header style is not set when there is title on the page and page is scrolled back to the top 7098 $j('.title, .full_width_inner > .wpb_row.section, .full_width_inner > .parallax_section_holder, .container_inner > .wpb_row.section, .container_inner > .parallax_section_holder, .portfolio_single > .wpb_row.section, .q_slider').waypoint( function(direction) { 7099 7100 if(direction === 'up') { 7101 //retrieve section object from waypoint object 7102 var sectionObject = $j(this)[0].adapter.$element; 7103 7104 if (sectionObject.data("q_header_style") !== undefined) { 7105 var header_style = sectionObject.data("q_header_style"); 7106 $j('header').removeClass('dark light').addClass(header_style); 7107 } else { 7108 $j('header').removeClass('dark light').addClass(default_header_style); 7109 } 7110 } 7111 7112 }, { offset: function(){ 7113 //retrieve section object from waypoint object 7114 var sectionObject = $j(this)[0].adapter.$element; 7115 7116 return -sectionObject.outerHeight() + paspartu_bottom_add; 7117 } }); 7118 } 7119} 7120 7121/* 7122 ** Image Gallery Slider with no space initialization 7123 */ 7124function initImageGallerySliderNoSpace(){ 7125 if($j('.qode_image_gallery_no_space').length){ 7126 $j('.qode_image_gallery_no_space').each(function(){ 7127 $j(this).animate({'opacity': 1},1000); 7128 $j(this).find('.qode_image_gallery_holder').lemmonSlider({infinite: true}); 7129 }); 7130 7131 //disable click on non active image 7132 $j('.qode_image_gallery_no_space').on('click', 'li:not(.active) a', function() { 7133 if(window.innerWidth>800){ 7134 return false;
7135 } 7136 else { 7137 return true; 7138 } 7139 }); 7140 } 7141} 7142 7143/* 7144 ** Vertical Split Slider 7145 */ 7146 7147function initVerticalSplitSlider(){ 7148 "use strict"; 7149 if($j('html').hasClass('vertical_split_screen_initalized')){ 7150 $j('html').removeClass('vertical_split_screen_initalized'); 7151 $j.fn.multiscroll.destroy(); 7152 //this has to be added due to elementor duplicating navigation 7153 $j('#multiscroll-nav').remove(); 7154 } 7155 if($j('.vertical_split_slider').length) { 7156 7157 var default_header_style = ''; 7158 if ($j('header.page_header').hasClass('light')) { 7159 default_header_style = 'light'; 7160 } else if ($j('header.page_header').hasClass('dark')) { 7161 default_header_style = 'dark'; 7162 } else { 7163 default_header_style = header_style_admin; 7164 } 7165 7166 var data_disable_header_skin_change = $j('.vertical_split_slider').data('disable-header-skin-change'); 7167 7168 $j('.vertical_split_slider').height($window_height).animate({opacity:1},300); 7169 $j('.vertical_split_slider').multiscroll({ 7170 scrollingSpeed: 500, 7171 navigation: true, 7172 afterRender: function(){ 7173 checkVerticalSplitSectionsForHeaderStyle($j('.ms-right .ms-section:last-child').data('header_style'), default_header_style, data_disable_header_skin_change); 7174 $j('html').addClass('vertical_split_screen_initalized'); 7175 initButtonHover(); // this function need to be initialized after initVerticalSplitSlider 7176 var contactForm7 = $j('div.wpcf7 > form'); 7177 if (contactForm7.length) { 7178 contactForm7.each(function(){ 7179 var thisForm = $j(this); 7180 7181 thisForm.find('.wpcf7-submit').off().on('click', function(e){ 7182 e.preventDefault(); 7183 wpcf7.submit(thisForm); 7184 }); 7185 }); 7186 } 7187 7188 if ($j('body').hasClass('vss_responsive_adv')){ 7189 //prepare html for smaller screens - start // 7190 var vertical_split_slider_responsive = $j("<div class='vertical_split_slider_responsive' />"); 7191 $j(".vertical_split_slider").after(vertical_split_slider_responsive); 7192 var left_side = $j('.vertical_split_slider .ms-left > div'); 7193 7194 var right_side = $j('.vertical_split_slider .ms-right > div'); 7195 for(var i = 0; i < left_side.length; i++){ 7196 vertical_split_slider_responsive.append($j(left_side[i]).clone(true)); 7197 vertical_split_slider_responsive.append($j(right_side[left_side.length-1-i]).clone(true)); 7198 } 7199 7200 if ($j('.vertical_split_slider_responsive .qode_google_map').length) { 7201 $j('.vertical_split_slider_responsive .qode_google_map').each(function () { 7202 var map = $j(this); 7203 map.empty(); 7204 var num = Math.floor((Math.random() * 100000) + 1); 7205 map.attr('id', 'map_canvas_' + num); 7206 map.data('unique-id', num); 7207 }); 7208 } 7209 7210 if($j('.vertical_split_slider_responsive .counter.random').length){ 7211 initCounter(); 7212 } 7213 } 7214 7215 initProgressBars(); 7216 initCountdown(); 7217 showGoogleMap(); 7218 initAccordion(); 7219 initAccordionContentLink(); 7220 qodeInitAccordions(); 7221 }, 7222 onLeave: function(index, nextIndex, direction){ 7223 checkVerticalSplitSectionsForHeaderStyle($j($j('.ms-right .ms-section')[$j(".ms-right .ms-section").length-nextIndex]).data('header_style'), default_header_style, data_disable_header_skin_change); 7224 } 7225 }); 7226 7227 if ($j('body').hasClass('vss_responsive_adv')){ 7228 7229 var windowSize = 768; 7230 7231 if($j('body').hasClass('vss_width_1000')) windowSize = 1000; 7232 if($j('body').hasClass('vss_width_600')) windowSize = 600; 7233 7234 if($window_width < windowSize){ 7235 $j.fn.multiscroll.destroy(); 7236 $j('html,body').css('height', 'auto').css('overflow', 'auto'); 7237 }else{ 7238 $j.fn.multiscroll.build(); 7239 $j('html,body').css('height', '100%').css('overflow', 'hidden'); 7240 } 7241 7242 $j(window).resize(function() { 7243 if($window_width < windowSize){ 7244 $j.fn.multiscroll.destroy(); 7245 $j('html,body').css('height', 'auto').css('overflow', 'auto'); 7246 }else{ 7247 $j.fn.multiscroll.build(); 7248 $j('html,body').css('height', '100%').css('overflow', 'hidden'); 7249 } 7250 }); 7251 } 7252 7253 }else{ 7254 if(!$j('.full_screen_holder').length) { //because this is not necessary on pages if there are full screen sections 7255 $j('html,body').css('height', 'auto').css('overflow', 'auto'); 7256 } 7257 } 7258} 7259 7260/*
7261 ** Check slides on load and slide change for header style changing 7262 */ 7263function checkVerticalSplitSectionsForHeaderStyle(section_header_style, default_header_style, data_disable_header_skin_change){ 7264 "use strict"; 7265 7266 if(section_header_style != ""){ 7267 if(data_disable_header_skin_change == 'no'){$j('header.page_header').removeClass('dark light').addClass(section_header_style)}; 7268 $j('#multiscroll-nav').removeClass('dark light').addClass(section_header_style); 7269 }else{ 7270 if(data_disable_header_skin_change == 'no'){$j('header.page_header').removeClass('dark light').addClass(default_header_style)}; 7271 $j('#multiscroll-nav').removeClass('dark light').addClass(default_header_style); 7272 } 7273} 7274/* 7275** Show Google Map 7276*/ 7277function showGoogleMap(){ 7278 "use strict"; 7279 7280 if($j('.qode_google_map').length){ 7281 $j('.qode_google_map').each(function(){ 7282 7283 var snazzyMapStyle = false; 7284 var snazzyMapCode = ''; 7285 if(typeof $j(this).data('snazzy-map-style') !== 'undefined' && $j(this).data('snazzy-map-style') === 'yes') { 7286 snazzyMapStyle = true; 7287 var snazzyMapHolder = $j(this).parent().find('.qode-snazzy-map'), 7288 snazzyMapCodes = snazzyMapHolder.val(); 7289 7290 if( snazzyMapHolder.length && snazzyMapCodes.length ) { 7291 snazzyMapCode = JSON.parse( snazzyMapCodes.replace(/`{`/g, '[').replace(/`}`/g, ']').replace(/``/g, '"').replace(/`/g, '') ); 7292 } 7293 } 7294 7295 var custom_map_style; 7296 if(typeof $j(this).data('custom-map-style') !== 'undefined') { 7297 custom_map_style = $j(this).data('custom-map-style'); 7298 } 7299 7300 var color_overlay; 7301 if(typeof $j(this).data('color-overlay') !== 'undefined' && $j(this).data('color-overlay') !== false) { 7302 color_overlay = $j(this).data('color-overlay'); 7303 } 7304 7305 var saturation; 7306 if(typeof $j(this).data('saturation') !== 'undefined' && $j(this).data('saturation') !== false) { 7307 saturation = $j(this).data('saturation'); 7308 } 7309 7310 var lightness; 7311 if(typeof $j(this).data('lightness') !== 'undefined' && $j(this).data('lightness') !== false) { 7312 lightness = $j(this).data('lightness'); 7313 } 7314 7315 var zoom; 7316 if(typeof $j(this).data('zoom') !== 'undefined' && $j(this).data('zoom') !== false) { 7317 zoom = $j(this).data('zoom'); 7318 } 7319 7320 var pin; 7321 if(typeof $j(this).data('pin') !== 'undefined' && $j(this).data('pin') !== false) { 7322 pin = $j(this).data('pin'); 7323 } 7324 7325 var map_height; 7326 if(typeof $j(this).data('map-height') !== 'undefined' && $j(this).data('map-height') !== false) { 7327 map_height = $j(this).data('map-height'); 7328 } 7329 7330 var unique_id; 7331 if(typeof $j(this).data('unique-id') !== 'undefined' && $j(this).data('unique-id') !== false) { 7332 unique_id = $j(this).data('unique-id'); 7333 } 7334 7335 var google_maps_scroll_wheel; 7336 if(typeof $j(this).data('google-maps-scroll-wheel') !== 'undefined') { 7337 google_maps_scroll_wheel = $j(this).data('google-maps-scroll-wheel'); 7338 } 7339 var addresses; 7340 if(typeof $j(this).data('addresses') !== 'undefined' && $j(this).data('addresses') !== false) { 7341 addresses = $j(this).data('addresses'); 7342 } 7343 7344 7345 var map = "map_"+ unique_id; 7346 var geocoder = "geocoder_"+ unique_id; 7347 var holderId = "map_canvas_"+ unique_id; 7348 7349 initializeGoogleMap(snazzyMapStyle, snazzyMapCode, custom_map_style, color_overlay, saturation, lightness, google_maps_scroll_wheel, zoom, holderId, map_height, pin, map, geocoder, addresses) 7350 }); 7351 } 7352 7353} 7354/* 7355 ** Init Google Map 7356 */ 7357function initializeGoogleMap(snazzyMapStyle, snazzyMapCode, custom_map_style, color, saturation, lightness, wheel, zoom, holderId, height, pin, map, geocoder, data){ 7358 "use strict"; 7359 7360 if (typeof google != "undefined") { 7361 7362 var mapStyles = []; 7363 if (snazzyMapStyle && snazzyMapCode.length) { 7364 mapStyles = snazzyMapCode; 7365 } else { 7366 mapStyles = [ 7367 { 7368 stylers: [ 7369 {hue: color}, 7370 {saturation: saturation}, 7371 {lightness: lightness}, 7372 {gamma: 1} 7373 ] 7374 } 7375 ]; 7376 } 7377 7378 var google_map_type_id; 7379 7380 if (snazzyMapStyle || custom_map_style) { 7381 google_map_type_id = 'qode_style' 7382 } else { 7383 google_map_type_id = google.maps.MapTypeId.ROADMAP 7384 } 7385 7386 var qodeMapType = new google.maps.StyledMapType(mapStyles, 7387 {name: "Qode Google Map"}); 7388 7389 geocoder = new google.maps.Geocoder(); 7390 var latlng = new google.maps.LatLng(-34.397, 150.644); 7391 7392 var myOptions = { 7393 7394 zoom: zoom, 7395 scrollwheel: wheel, 7396 center: latlng, 7397 zoomControl: true, 7398 zoomControlOptions: { 7399 style: google.maps.ZoomControlStyle.SMALL, 7400 position: google.maps.ControlPosition.RIGHT_CENTER 7401 }, 7402 scaleControl: false, 7403 scaleControlOptions: { 7404 position: google.maps.ControlPosition.LEFT_CENTER 7405 }, 7406 streetViewControl: false, 7407 streetViewControlOptions: { 7408 position: google.maps.ControlPosition.LEFT_CENTER 7409 }, 7410 panControl: false, 7411 panControlOptions: { 7412 position: google.maps.ControlPosition.LEFT_CENTER 7413 }, 7414 mapTypeControl: false, 7415 mapTypeControlOptions: { 7416 mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'qode_style'], 7417 style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, 7418 position: google.maps.ControlPosition.LEFT_CENTER 7419 }, 7420 mapTypeId: google_map_type_id 7421 }; 7422 map = new google.maps.Map(document.getElementById(holderId), myOptions); 7423 map.mapTypes.set('qode_style', qodeMapType); 7424 7425 var index; 7426 7427 for (index = 0; index < data.length; ++index) { 7428 initializeGoogleAddress(data[index], pin, map, geocoder); 7429 } 7430 7431 var holder_element = document.getElementById(holderId); 7432 holder_element.style.height = height; 7433 if (!isNaN(height)) { 7434 height = height + 'px'; 7435 } 7436 7437 } 7438 7439} 7440/* 7441 ** Init Google Map Addresses 7442 */ 7443function initializeGoogleAddress(data, pin, map, geocoder){ 7444 "use strict"; 7445 if (data === '') 7446 return; 7447 var contentString = '<div class="content_map">'+ 7448 '<div class="site_notice_map">'+ 7449 '</div>'+ 7450 '<div class="body_content_map">'+ 7451 '<p>'+data+'</p>'+ 7452 '</div>'+ 7453 '</div>'; 7454 var infowindow = new google.maps.InfoWindow({ 7455 content: contentString 7456 }); 7457 geocoder.geocode( { 'address': data}, function(results, status) { 7458 if (status === google.maps.GeocoderStatus.OK) { 7459 map.setCenter(results[0].geometry.location); 7460 var marker = new google.maps.Marker({ 7461 map: map, 7462 position: results[0].geometry.location, 7463 icon: pin, 7464 title: data['store_title'] 7465 }); 7466 google.maps.event.addListener(marker, 'click', function() { 7467 infowindow.open(map,marker); 7468 }); 7469 7470 google.maps.event.addDomListener(window, 'resize', function() { 7471 map.setCenter(results[0].geometry.location); 7472 }); 7473 } 7474 }); 7475}; 7476 7477/* 7478 ** Init Horizontal Marquee - Start 7479 */ 7480 7481function initHorizontalMarquee() { 7482 "use strict"; 7483 7484 var marquees = $j('.qode-horizontal-marquee'); 7485 marquees.each(function() { 7486 7487 var handleResize = function() { 7488 marqueeW = marquee.width(); 7489 innerW = 0; 7490 7491 inner.find('> .qode-hm-item').css('margin', 0); 7492 marquee.height(Math.min($window_height, dataMarqueeH)); 7493 inner.find('> .qode-hm-item').each(function() { 7494 $j(this).css('max-width', marqueeW); 7495 innerW += $j(this).outerWidth() + dataSpacing; 7496 }); 7497 innerW -= dataSpacing; 7498 inner.width(innerW).css('left',0); 7499 inner.find('> .qode-hm-item').css('margin-right', dataSpacing+'px'); 7500 }; 7501 7502 var dragStart, lastPosition; 7503 7504 var handleDragStart = function(event) { 7505 event = typeof event.originalEvent !== 'undefined' ? event.originalEvent : event; 7506 event = event.type == 'touchstart' ? event.touches[0] : event; 7507 dragStart = { 7508 x: event.clientX, 7509 y: event.clientY 7510 }; 7511 lastPosition = parseInt(inner.css('left'),10); 7512 inner.addClass('qode-dragged'); 7513 }; 7514 7515 var handleDragStop = function(event) { 7516 inner.removeClass('qode-dragged'); 7517 }; 7518 7519 var handleDrag = function(event) { 7520 event = typeof event.originalEvent !== 'undefined' ? event.originalEvent : event; 7521 var type = event.type; 7522 event = type == 'touchmove' ? event.touches[0] : event; 7523 var pos = { 7524 x: event.clientX, 7525 y: event.clientY 7526 }; 7527 if (type == 'touchmove' /*&& Math.abs(pos.x - dragStart.x) > 50 */|| type == 'mousemove' && inner.is('.qode-dragged')) { 7528 inner.css({ 7529 'left': Math.max(-innerW + marqueeW, Math.min(lastPosition + (pos.x - dragStart.x), 0)) + 'px' 7530 }); 7531 } 7532 }; 7533 7534 var marquee = $j(this); 7535 var dataSpacing = typeof marquee.data('spacing') !== 'undefined' ? marquee.data('spacing') : 0;
7536 var dataMarqueeH = typeof marquee.data('height') !== 'undefined' ? marquee.data('height') : 0; 7537 var inner = marquee.find('.qode-horizontal-marquee-inner'); 7538 var innerW, marqueeW; 7539 7540 handleResize(); 7541 $j(window).resize(handleResize); 7542 inner.find('img').on('dragstart', function(event) { 7543 event.preventDefault(); 7544 }); 7545 7546 //exclude drag feature if marquee loop behavior is set 7547 if (!marquee.hasClass('qode-loop')) { 7548 inner.on('mousedown touchstart', handleDragStart); 7549 inner.on('mousemove touchmove', handleDrag); 7550 inner.on('mouseup touchend mouseleave', handleDragStop); 7551 } 7552 }); 7553} 7554 7555/* 7556 ** Init Horizontal Marquee - End 7557 */ 7558 7559/* 7560* Horizontal Marquee Loop functionality - Start 7561*/ 7562 7563function qodeHorizontalMarqueeLoop() { 7564 var marquees = $j('.qode-horizontal-marquee.qode-loop'); 7565 7566 if (marquees.length) { 7567 marquees.each(function(){ 7568 var marquee = $j(this); 7569 7570 //clone content holder for loop effect 7571 marquee.find('.qode-horizontal-marquee-inner').clone().appendTo(marquee); 7572 7573 var marqueeElements = marquee.find('.qode-horizontal-marquee-inner'), 7574 originalItem = marqueeElements.first(), 7575 auxItem = marqueeElements.last(); 7576 7577 var qodeMarqueeInit = function () { 7578 var delta = 1, //pixel movement 7579 speedCoeff = 1, // below 1 to slow down, above 1 to speed up 7580 currentPos, 7581 offsetCorrection = marquee.data('spacing') !== '' ? marquee.data('spacing') : 0, //add item spacing to calculations to preserve whitespace 7582 marqueeWidth; 7583 7584 var marqueeReset = function() { 7585 marqueeWidth = originalItem.width() + offsetCorrection; 7586 currentPos = 0; 7587 originalItem.css({ 7588 'left': 0 7589 }); 7590 auxItem.css({ 7591 'width': marqueeWidth, //same width as the original marquee element 7592 'left': marqueeWidth //set to the right of the original marquee element 7593 }); 7594 } 7595 7596 marqueeReset(); 7597 qodeRequestAnimationFrame(); 7598 7599 //show marquee item one by one on shortcode initialization 7600 if (marquee.hasClass('qode-appear-fx')) { 7601 marquee.addClass('qode-appeared'); 7602 } 7603 7604 marqueeElements.each(function(i){ 7605 var marqueeElement = $j(this); 7606 7607 //movement loop 7608 var qodeMarqueeSequence = function() { 7609 currentPos -= delta; 7610 7611 //reset marquee element 7612 if (marqueeElement.position().left <= -marqueeWidth) { 7613 marqueeElement.css('left', parseInt(marqueeWidth - delta)); 7614 currentPos = 0; 7615 } 7616 7617 //move marquee element 7618 marqueeElement.css({ 7619 'transform': 'translate3d('+speedCoeff*currentPos+'px,0,0)' 7620 }); 7621 7622 //fix overlap issue 7623 if (Math.abs(originalItem.position().left - auxItem.position().left) < marqueeWidth - 1) { 7624 marqueeReset(); 7625 } 7626 7627 //repeat 7628 requestNextAnimationFrame(qodeMarqueeSequence); 7629 }; 7630 7631 //start loop 7632 qodeMarqueeSequence(); 7633 }); 7634 7635 //reset marquee on resize end 7636 $j(window).resize(function(){ 7637 setTimeout(function(){ 7638 marqueeReset(); 7639 }, 200); 7640 }); 7641 }; 7642 7643 //init 7644 marquee.waitForImages(function(){ 7645 qodeMarqueeInit(); 7646 }); 7647 }); 7648 } 7649} 7650 7651/* 7652* Horizontal Marquee Loop functionality - End 7653*/ 7654 7655/* 7656** Init Text Marquee - Start 7657*/ 7658 7659function initTextMarquee() { 7660 "use strict"; 7661 var textMarquees = $j('.qode-text-marquee'); 7662 7663 if (textMarquees.length) { 7664 textMarquees.each(function() { 7665 var textMarquee = $j(this); 7666 7667 if ( !textMarquee.hasClass('qode-text-marquee-initialized')){ 7668 7669 //two titles for marquee scroll effect 7670 if (!$j('html').hasClass('touch')) { 7671 textMarquee.find('.qode-text-marquee-wrapper').clone().appendTo(textMarquee); 7672 } 7673 7674 var titleWrapper = textMarquee.find('.qode-text-marquee-wrapper'), 7675 marqueeTitle = textMarquee.find('.qode-text-marquee-title'); 7676 7677 //symmetrical spacings for marquee scroll effect 7678 if (!$j('html').hasClass('touch')) { 7679 titleWrapper.each(function () { 7680 var currentTitleWrapper = $j(this), 7681 title = currentTitleWrapper.find('.qode-text-marquee-title'), 7682 text = title.html().split(' '), 7683 len = text.length, 7684 result = []; 7685 7686 for (var i = 0; i < len; i++) { 7687 result[i] = '<span class="qode-inner-text">' + text[i] + '</span>'; 7688 } 7689 7690 title.html(result.join('')); 7691 7692 title.find('.qode-inner-text').css({ 7693 "display": "inline-block", 7694 "margin-right": "40px" 7695 }); 7696 }); 7697 } 7698 7699 //stretch calcs 7700 marqueeTitle.stretch(); 7701 titleWrapper.eq(1).addClass('qode-marquee-additional-title'); 7702 marqueeTitle.css('visibility', 'visible'); 7703 7704 //stretch recalcs 7705 var stretchRecalcs = function () { 7706 marqueeTitle.unwrap('.stretch--resizer'); 7707 marqueeTitle.unwrap('.stretch--handle'); 7708 marqueeTitle.stretch(); 7709 } 7710 7711 //marquee scroll effect on non touch devices 7712 if (!$j('html').hasClass('touch')) { 7713 qodeRequestAnimationFrame(); 7714 7715 var firstTitleWrapper = titleWrapper.first(), 7716 firstTitleWrapperOffset = firstTitleWrapper.offset().left, 7717 lastTitleWrapper = titleWrapper.last(), 7718 reset = false;
7719 7720 lastTitleWrapper.offset({left: firstTitleWrapperOffset - $j(window).width()}); 7721 7722 titleWrapper.each(function () { 7723 var title = $j(this), 7724 offset = title.offset().left, 7725 currentPos = 0, 7726 delta = 2; 7727 7728 var qodeMarqueeText = function () { 7729 reset = false; 7730 currentPos += delta; 7731 7732 if (title.offset().left > $j(window).width()) { 7733 currentPos = -($j(window).width() + offset); //reset 7734 } 7735 7736 title.css('transform', 'translate3d(' + currentPos + 'px,0,0)'); 7737 requestAnimFrame(qodeMarqueeText); 7738 7739 //reset 7740 $j(window).resize(function () { 7741 if (!reset) { 7742 stretchRecalcs(); 7743 currentPos = 0; 7744 lastTitleWrapper.offset({left: -marqueeTitle.first().width()}); 7745 reset = true; 7746 } 7747 }); 7748 } 7749 7750 qodeMarqueeText(); 7751 }); 7752 } else { 7753 //touch recalcs if device orientation changes 7754 $j(window).resize(function () { 7755 stretchRecalcs(); 7756 }); 7757 } 7758 7759 textMarquee.addClass('qode-text-marquee-initialized'); 7760 7761 } 7762 }); 7763 } 7764} 7765 7766/* 7767** Init Text Marquee - End 7768*/ 7769 7770/* 7771* Request Animation Frame shim - Start 7772*/ 7773 7774function qodeRequestAnimationFrame() { 7775 if (!$j('html').hasClass('touch') && !window.requestAnimFrame) { 7776 window.requestAnimFrame = (function(){ 7777 return window.requestAnimationFrame || 7778 window.webkitRequestAnimationFrame || 7779 window.mozRequestAnimationFrame || 7780 window.oRequestAnimationFrame || 7781 window.msRequestAnimationFrame || 7782 function(/* function */ callback, /* DOMElement */ element){ 7783 window.setTimeout(callback, 1000 / 60); 7784 }; 7785 })(); 7786 } 7787} 7788 7789/* 7790* Request Animation Frame shim - Start 7791*/ 7792 7793/* 7794* Expanding Images shortcode - Start 7795*/ 7796 7797function initExpandingImages() { 7798 var expandingImagesShortcodes = $j('.qode-expanding-images'); 7799 7800 if (expandingImagesShortcodes.length) { 7801 expandingImagesShortcodes.each(function(){ 7802 var expandingImagesShortcode = $j(this), 7803 IEver = getIEversion(); 7804 7805 if (IEver > 0) { 7806 expandingImagesShortcode.addClass('qode-ie-specific'); 7807 } 7808 7809 if (!$j('html').hasClass('touch')) { 7810 var expanding_skrollr = skrollr.init({ 7811 edgeStrategy: 'set', 7812 smoothScrolling: false, 7813 forceHeight: false 7814 }); 7815 7816 expanding_skrollr.refresh(); 7817 } 7818 7819 }); 7820 } 7821} 7822 7823/* 7824* Expanding Images shortcode - End 7825*/ 7826 7827 7828/* 7829* Item Showcase shortcode - Start 7830*/ 7831 7832function initItemShowcase() { 7833 var itemShowcase = $j('.qode-item-showcase'); 7834 if (itemShowcase.length) { 7835 itemShowcase.each(function(){ 7836 var thisItemShowcase = $j(this), 7837 leftItems = thisItemShowcase.find('.qode-item-left'), 7838 rightItems = thisItemShowcase.find('.qode-item-right'), 7839 itemImage = thisItemShowcase.find('.qode-item-image'); 7840 7841 //logic 7842 leftItems.wrapAll( "<div class='qode-item-showcase-holder qode-holder-left' />"); 7843 rightItems.wrapAll( "<div class='qode-item-showcase-holder qode-holder-right' />"); 7844 thisItemShowcase.find('.qode-item-showcase-holder').append("<span class='qode-item-line'></span>"); 7845 var itemLines = $j('.qode-item-line'); 7846 7847 if (!$j('html').hasClass('touch')) { 7848 thisItemShowcase.animate({opacity:1},200); 7849 setTimeout(function(){ 7850 thisItemShowcase.appear(function(){ 7851 itemImage.addClass('qode-appeared'); 7852 itemLines.each(function(){ 7853 var itemLine = $j(this), 7854 holder = itemLine.closest('.qode-item-showcase-holder'), 7855 height = holder.height() - holder.find('.qode-item').last().height(); 7856 7857 itemLine.css('height', height); 7858 itemLine.css('opacity', 1); 7859 }); 7860 thisItemShowcase.on('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', 7861 function(e) { 7862 if($window_width > 1200) { 7863 itemAppear('.qode-holder-left .qode-item'); 7864 itemAppear('.qode-holder-right .qode-item'); 7865 } else { 7866 itemAppear('.qode-item'); 7867 } 7868 }); 7869 }); 7870 },100); 7871 7872 //appear animation trigger 7873 function itemAppear(itemCSSClass) { 7874 thisItemShowcase.find(itemCSSClass).each(function(i){ 7875 var thisListItem = $j(this); 7876 setTimeout(function(){ 7877 thisListItem.addClass('qode-appeared'); 7878 }, i*150); 7879 }); 7880 } 7881 } else { 7882 itemLines.each(function(){ 7883 var itemLine = $j(this), 7884 holder = itemLine.closest('.qode-item-showcase-holder'), 7885 height = holder.height() - holder.find('.qode-item').last().height(); 7886 7887 itemLine.css('height', height); 7888 itemLine.css('opacity', 1); 7889 }); 7890 } 7891 }); 7892 7893 } 7894} 7895 7896/* 7897* Item Showcase shortcode - End 7898*/ 7899 7900/* 7901* Call To Action Section shortcode - Start 7902*/ 7903var qodeCTASection = function() { 7904 "use strict"; 7905 7906 var ctaSections = $j('.qode-cta-section'); 7907 7908 var ctaSectionAnimation = function() { 7909 ctaSections.each(function(){ 7910 var ctaSection = $j(this), 7911 ctaImage = ctaSection.find('img'), 7912 ctaText = ctaSection.find('.qode-cta-section-text-wrapper'); 7913 7914 if (!$j('html').hasClass('touch') && ctaSection.hasClass('qode-cta-appear-effect')) { 7915 var ctaAppear = function(ctaItem) { 7916 ctaItem.appear(function(){ 7917 setTimeout(function(){ 7918 ctaItem.addClass('qode-appeared'); 7919 },30); 7920 }
7920, {accX: 0, accY: -($window_height / 3)}); 7921 } 7922 7923 ctaAppear(ctaImage); 7924 ctaAppear(ctaText); 7925 } 7926 }); 7927 } 7928 return { 7929 init: function(){ 7930 if (ctaSections.length) { 7931 ctaSectionAnimation(); 7932 } 7933 } 7934 }; 7935} 7936 7937/* 7938* Call To Action Section shortcode - End 7939*/ 7940 7941/* 7942 ** Init Preview Slider - Start 7943 */ 7944 7945function initPreviewSlider() { 7946 "use strict"; 7947 7948 var sliders = $j('.qode-preview-slider'); 7949 sliders.each(function() { 7950 var slider = $j(this); 7951 var main_slider = slider.find('.qode-presl-main-slider'); 7952 var small_slider_holder = slider.find('.qode-presl-small-slider-holder'); 7953 var small_slider = small_slider_holder.find('.qode-presl-small-slider'); 7954 var slide_timeout = 5000; 7955 var slide_transition = 700; 7956 7957 main_slider.find('.qode-presl-link.small').each(function(i) { 7958 $j('<li><div class="qode-presl-small-item"><div class="qode-presl-main-item-inner"></div></div></li>') 7959 .appendTo(small_slider.find('> .slides')) 7960 .find('.qode-presl-main-item-inner') 7961 .append($j(this)); 7962 }); 7963 7964 main_slider.flexslider({ 7965 animation: "slide", 7966 animationSpeed: slide_transition, 7967 slideshow: true, 7968 slideshowSpeed: slide_timeout, 7969 useCSS: true, 7970 touch: true, 7971 autostart: false, 7972 directionNav: true, 7973 controlNav: true, 7974 prevText: '<i class="icon-arrows-left"></i>', //'<span class="arrow_carrot-left"></span>', 7975 nextText: '<i class="icon-arrows-right"></i>', //'<span class="arrow_carrot-right"></span>', 7976 start: function(slider) { 7977 slider.find('.qode-presl-main-item').css({ 7978 'opacity': '1', 7979 'filter': 'alpha(opacity=100)' 7980 }).find('img').addClass('visible'); 7981 }, 7982 before: function(slider) { 7983 var target = slider.animatingTo; 7984 var current = slider.currentSlide; 7985 7986 if (target==0) { 7987 slider.find('.slides li:first-child').next().next().clone().appendTo(slider.find('.slides')).removeClass('clone').addClass('clone_end'); 7988 } 7989 else if (target==slider.count-1) { 7990 slider.find('.slides li:last-child').prev().prev().clone().appendTo(slider.find('.slides')).removeClass('clone').addClass('clone_start'); 7991 } 7992 7993 if (target==0 && current==slider.count-1 && slider.direction=='next') { 7994 small_slider.flexslider('next'); 7995 } 7996 else if (target==slider.count-1 && current==0 && slider.direction=='prev') { 7997 small_slider.flexslider('prev'); 7998 } 7999 else { 8000 small_slider.find('.flex-control-nav a').eq(target).trigger("click"); 8001 } 8002 8003 slider.find('.flex-direction-nav').addClass('moving'); 8004 }, 8005 after: function(slider) { 8006 slider.removeClass('control-initiated direction-initiated'); 8007 slider.find('.clone_start, .clone_end').remove(); 8008 slider.find('.flex-direction-nav').removeClass('moving'); 8009 } 8010 }); 8011 8012 small_slider.flexslider({ 8013 animation: "slide", 8014 animationSpeed: slide_transition, 8015 animationLoop: true, 8016 useCSS: true, 8017 touch: false, 8018 slideshow: false, 8019 directionNav: false, 8020 controlNav: true, 8021 start: function(slider) { 8022 slider.find('img').addClass('visible'); 8023 slider.closest('.qode-presl-small-slider-holder').find('.qode-presl-phone').addClass('visible'); 8024 } 8025 }); 8026 }); 8027} 8028 8029/* 8030 ** Init Preview Slider - End 8031 */ 8032 8033var getIEversion = function() { 8034 var rv = -1; 8035 if (navigator.appName == 'Microsoft Internet Explorer') { 8036 var ua = navigator.userAgent; 8037 var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); 8038 if (re.exec(ua) != null) 8039 rv = parseFloat( RegExp.$1 ); 8040 } 8041 else if (navigator.appName == 'Netscape') { 8042 var ua = navigator.userAgent; 8043 var re = new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})"); 8044 if (re.exec(ua) != null) 8045 rv = parseFloat( RegExp.$1 ); 8046 } 8047 return rv; 8048}; 8049 8050/* 8051 ** Init In-Device Slider - Start 8052 */ 8053 8054function initInDeviceSlider() { 8055 "use strict"; 8056 8057 var sliders = $j('.qode-in-device-slider'); 8058 sliders.each(function() { 8059 var slider = $j(this).find('.qode-ids-slider'); 8060 var navigation = slider.data('navigation') == 'yes' ? true : false; 8061 var auto_start = slider.data('auto-start') == 'yes' ? true : false; 8062 var slide_timeout = auto_start ? slider.data('timeout') : 0; 8063 var is_in_marquee = slider.closest('.qode-horizontal-marquee').length ? true : false;
8064 8065 var IEver = getIEversion(); 8066 if (IEver > 0) { 8067 slider.addClass('qode-ids-ie-specific'); 8068 } 8069 8070 slider.flexslider({ 8071 animation: "slide", 8072 animationSpeed: 700, 8073 animationLoop: true, 8074 useCSS: true, 8075 touch: !is_in_marquee, 8076 slideshow: auto_start, 8077 slideshowSpeed: slide_timeout, 8078 directionNav: navigation, 8079 controlNav: false, 8080 prevText: '<i class="icon-arrows-left"></i>', 8081 nextText: '<i class="icon-arrows-right"></i>', 8082 start: function(slider) { 8083 slider.find('img').addClass('visible'); 8084 slider.closest('.qode-ids-slider-holder').find('.qode-ids-frame').addClass('visible'); 8085 if (slider.is('.qode-ids-titles-on-hover')) { 8086 slider.hover( 8087 function() { 8088 $j(this).find('.qode-ids-link').addClass('hovered'); 8089 }, 8090 function() { 8091 $j(this).find('.qode-ids-link').removeClass('hovered'); 8092 } 8093 ); 8094 } 8095 } 8096 }); 8097 8098 if (is_in_marquee) { 8099 var dragStart, clickable = false; 8100 8101 var handleDragStart = function(event) { 8102 event = typeof event.originalEvent !== 'undefined' ? event.originalEvent : event; 8103 event = event.type == 'touchstart' ? event.touches[0] : event; 8104 dragStart = { 8105 x: event.clientX, 8106 y: event.clientY 8107 }; 8108 }; 8109 8110 var handleDragStop = function(event) { 8111 event = typeof event.originalEvent !== 'undefined' ? event.originalEvent : event; 8112 event = event.type == 'touchend' ? event.changedTouches[0] : event; 8113 var dragEnd = { 8114 x: event.clientX, 8115 y: event.clientY 8116 }; 8117 if (Math.abs(dragEnd.x - dragStart.x) < 10) { 8118 clickable = true; 8119 } 8120 }; 8121 8122 var handleClick = function(event) { 8123 if (clickable) { 8124 clickable = false; 8125 } 8126 else { 8127 event.preventDefault(); 8128 } 8129 }; 8130 8131 slider.find('.qode-ids-link') 8132 .on('dragstart', function(event) { 8133 event.preventDefault(); 8134 }) 8135 .on('click', handleClick) 8136 .on('mousedown touchstart', handleDragStart) 8137 .on('mouseup touchend', handleDragStop); 8138 } 8139 }); 8140} 8141 8142/* 8143 ** Init In-Device Slider - End 8144 */ 8145 8146function checkSVG(element) { 8147 "use strict"; 8148 8149 var el = element.find('.active .qode_slide-svg-holder'); 8150 var drawing_enabled = el.data('svg-drawing'); 8151 8152 if (drawing_enabled === 'yes') { 8153 drawSVG(el); 8154 } 8155} 8156 8157/** 8158 * Function for drawing slider svgs. Based on Codrops article 'SVG Drawing Animation' 8159 */ 8160function drawSVG(svg){ 8161 "use strict"; 8162 var svgs = Array.prototype.slice.call( svg.find('svg') ), 8163 svgArr = [], 8164 resizeTimeout; 8165 // the svgs already shown... 8166 svgs.forEach( function( el, i ) { 8167 var svg = new SVGEl( el ); 8168 svgArr[i] = svg; 8169 setTimeout(function( el ) { 8170 return function() { 8171 svg.render(); 8172 }; 8173 }( el ), 0 );//0ms pause before drawing 8174 } ); 8175} 8176var docElem = window.document.documentElement; 8177window.requestAnimFrame = function(){ 8178 return ( 8179 window.requestAnimationFrame || 8180 window.webkitRequestAnimationFrame || 8181 window.mozRequestAnimationFrame || 8182 window.oRequestAnimationFrame || 8183 window.msRequestAnimationFrame || 8184 function(/* function */ callback){ 8185 window.setTimeout(callback, 1000 / 60); 8186 } 8187 ); 8188}(); 8189window.cancelAnimFrame = function(){ 8190 return ( 8191 window.cancelAnimationFrame || 8192 window.webkitCancelAnimationFrame || 8193 window.mozCancelAnimationFrame || 8194 window.oCancelAnimationFrame || 8195 window.msCancelAnimationFrame || 8196 function(id){ 8197 window.clearTimeout(id); 8198 } 8199 ); 8200}(); 8201function SVGEl( el ) { 8202 this.el = el; 8203 var frameRate = $j(this.el).closest('.qode_slide-svg-holder').data('svg-frames'); 8204 this.image = this.el.previousElementSibling; 8205 this.current_frame = 0; 8206 this.total_frames = frameRate;//number of frames defines speed of drawing 8207 this.path = []; 8208 this.length = []; 8209 this.handle = 0; 8210 this.init(); 8211} 8212SVGEl.prototype.init = function() { 8213 var self = this; 8214 [].slice.call( this.el.querySelectorAll( 'path' ) ).forEach( function( path, i ) { 8215 self.path[i] = path; 8216 var l = self.path[i].getTotalLength(); 8217 self.length[i] = l; 8218 self.path[i].style.strokeDasharray = l + ' ' + l; 8219 self.path[i].style.strokeDashoffset = l; 8220 } ); 8221}; 8222SVGEl.prototype.render = function() { 8223 if( this.rendered ) return; 8224 this.rendered = true; 8225 this.draw(); 8226}; 8227SVGEl.prototype.draw = function() { 8228 var self = this, 8229 progress = this.current_frame/this.total_frames; 8230 if (progress > 1) {
8231 window.cancelAnimFrame(this.handle); 8232 } else { 8233 this.current_frame++; 8234 for(var j=0, len = this.path.length; j<len;j++){ 8235 this.path[j].style.strokeDashoffset = Math.floor(this.length[j] * (1 - progress)); 8236 } 8237 this.handle = window.requestAnimFrame(function() { self.draw(); }); 8238 } 8239}; 8240 8241function initPageTitleAnimation(){ 8242 "use strict"; 8243 8244 if($j('.title_outer').data('animation') === 'yes' && $j('.no-touchevents .title_outer').length > 0) { 8245 var skrollr_title = skrollr.init({ 8246 edgeStrategy: 'set', 8247 smoothScrolling: false, 8248 forceHeight: false 8249 }); 8250 skrollr_title.refresh(); 8251 } 8252}; 8253 8254function initElementsHolderResponsiveStyle(){ 8255 var elementsHolder = $j('.q_elements_holder'); 8256 8257 if(elementsHolder.length){ 8258 elementsHolder.each(function() { 8259 var thisElementsHolder = $j(this), 8260 elementsHolderItem = thisElementsHolder.children('.q_elements_item'), 8261 style = '', 8262 responsiveStyle = ''; 8263 8264 elementsHolderItem.each(function() { 8265 var thisItem = $j(this), 8266 itemClass = '', 8267 largeLaptop = '', 8268 smallLaptop = '', 8269 ipadLandscape = '', 8270 ipadPortrait = '', 8271 mobileLandscape = '', 8272 mobilePortrait = ''; 8273 8274 if (typeof thisItem.data('item-class') !== 'undefined' && thisItem.data('item-class') !== false) { 8275 itemClass = thisItem.data('item-class'); 8276 } 8277 if (typeof thisItem.data('1280-1440') !== 'undefined' && thisItem.data('1280-1440') !== false) { 8278 largeLaptop = thisItem.data('1280-1440'); 8279 } 8280 if (typeof thisItem.data('1024-1280') !== 'undefined' && thisItem.data('1024-1280') !== false) { 8281 smallLaptop = thisItem.data('1024-1280'); 8282 } 8283 if (typeof thisItem.data('768-1024') !== 'undefined' && thisItem.data('768-1024') !== false) { 8284 ipadLandscape = thisItem.data('768-1024'); 8285 } 8286 if (typeof thisItem.data('600-768') !== 'undefined' && thisItem.data('600-768') !== false) { 8287 ipadPortrait = thisItem.data('600-768'); 8288 } 8289 if (typeof thisItem.data('480-600') !== 'undefined' && thisItem.data('480-600') !== false) { 8290 mobileLandscape = thisItem.data('480-600'); 8291 } 8292 if (typeof thisItem.data('480') !== 'undefined' && thisItem.data('480') !== false) { 8293 mobilePortrait = thisItem.data('480'); 8294 } 8295 8296 if(largeLaptop.length || smallLaptop.length || ipadLandscape.length || ipadPortrait.length || mobileLandscape.length || mobilePortrait.length) { 8297 8298 if(largeLaptop.length) { 8299 responsiveStyle += "@media only screen and (min-width: 1280px) and (max-width: 1440px) {.q_elements_item_content."+itemClass+" { padding: "+largeLaptop+" !important; } }"; 8300 } 8301 if(smallLaptop.length) { 8302 responsiveStyle += "@media only screen and (min-width: 1024px) and (max-width: 1280px) {.q_elements_item_content."+itemClass+" { padding: "+smallLaptop+" !important; } }"; 8303 } 8304 if(ipadLandscape.length) { 8305 responsiveStyle += "@media only screen and (min-width: 768px) and (max-width: 1024px) {.q_elements_item_content."+itemClass+" { padding: "+ipadLandscape+" !important; } }"; 8306 } 8307 if(ipadPortrait.length) { 8308 responsiveStyle += "@media only screen and (min-width: 680px) and (max-width: 768px) {.q_elements_item_content."+itemClass+" { padding: "+ipadPortrait+" !important; } }"; 8309 } 8310 if(mobileLandscape.length) { 8311 responsiveStyle += "@media only screen and (min-width: 480px) and (max-width: 680px) {.q_elements_item_content."+item
8311Class+" { padding: "+mobileLandscape+" !important; } }"; 8312 } 8313 if(mobilePortrait.length) { 8314 responsiveStyle += "@media only screen and (max-width: 480px) {.q_elements_item_content."+itemClass+" { padding: "+mobilePortrait+" !important; } }"; 8315 } 8316 } 8317 8318 /*if (typeof qodef.modules.common.qodefOwlSlider === "function") { // if owl function exist 8319 var owl = thisItem.find('.qodef-owl-slider'); 8320 if (owl.length) { // if owl is in elements holder 8321 setTimeout(function () { 8322 owl.trigger('refresh.owl.carousel'); // reinit owl 8323 }, 100); 8324 } 8325 }*/ 8326 8327 }); 8328 8329 if(responsiveStyle.length) { 8330 style = '<style type="text/css">'+responsiveStyle+'</style>'; 8331 } 8332 8333 if(style.length) { 8334 $j('head').append(style); 8335 } 8336 8337 }); 8338 } 8339} 8340 8341function initQodeElementAnimationSkrollr() { 8342 "use strict"; 8343 if($j('.no-touchevents .carousel').length === 0) { 8344 8345 var elementItemAnimation = $j('.no-touchevents .q_elements_holder > .q_elements_item'); 8346 elementItemAnimation.each(function(){ 8347 8348 if((typeof($j(this).data('animation')) !== 'undefined' || typeof($j('.title_outer').data('animation')) !== 'undefined') && $j(this).data('animation') === 'yes') { 8349 var skr = skrollr.init({ 8350 edgeStrategy: 'set', 8351 smoothScrolling: false, 8352 forceHeight: false 8353 }); 8354 skr.refresh(); 8355 } 8356 8357 }); 8358 } 8359 8360}; 8361 8362function initIconShortcodeHover() { 8363 "use strict"; 8364 8365 if($j('.qode_icon_shortcode').length) { 8366 8367 $j('.qode_icon_shortcode').each(function() { 8368 //check if icon type is circle of square 8369 if(typeof $j(this).data('type') !== 'undefined' && ['circle', 'square'].indexOf($j(this).data('type')) != -1) { 8370 8371 if(typeof $j(this).data('hover-bg-color') !== 'undefined') { 8372 if($j(this).data('type') == 'circle') { 8373 var elementToHover = $j(this).find('i').first(); 8374 var hoverBgColor = $j(this).data('hover-bg-color'); 8375 var initialStyle = elementToHover.attr('style'); 8376 8377 $j(this).hover(function() { 8378 elementToHover.attr('style', initialStyle + 'color: ' + hoverBgColor + '!important'); 8379 }, function() { 8380 elementToHover.attr('style', initialStyle); 8381 }); 8382 } else { 8383 var hoverBgColor = $j(this).data('hover-bg-color'); 8384 var initialBgColor = $j(this).css('background-color'); 8385 8386 $j(this).hover(function() { 8387 $j(this).css('background-color', hoverBgColor); 8388 }, function() { 8389 $j(this).css('background-color', initialBgColor); 8390 }); 8391 } 8392 } 8393 } 8394 8395 if(typeof $j(this).data('hover-icon-color') !== 'undefined') { 8396 var hoverColor = $j(this).data('hover-icon-color'); 8397 var initialColor = $j(this).find('.qode_icon_element ').css('color'); 8398 8399 $j(this).hover(function() { 8400 $j(this).find('.qode_icon_element ').css('color', hoverColor); 8401 }, function() { 8402 $j(this).find('.qode_icon_element ').css('color', initialColor); 8403 }); 8404 } 8405 }); 8406 } 8407} 8408 8409/** 8410 * Object that represents icon shortcode 8411 * @returns {{init: Function}} function that initializes icon's functionality 8412 */ 8413var qodeIcon = function() { 8414 //get all icons on page 8415 var icons = $j('.qode-icon-holder'); 8416 8417 8418 /** 8419 * Function that triggers icon hover color functionality 8420 */ 8421 var iconHoverColor = function(icon) { 8422 if(typeof icon.data('hover-color') !== 'undefined') { 8423 var changeIconColor = function(event) { 8424 event.data.icon.css('color', event.data.color); 8425 }; 8426 8427 var iconElement = icon.find('.qode-icon-element'); 8428 var hoverColor = icon.data('hover-color'); 8429 var originalColor = iconElement.css('color'); 8430 8431 if(hoverColor !== '') { 8432 if(icon.parents('.qode-start-icon-hover').length){ 8433 icon.parents('.qode-start-icon-hover').on('mouseenter', {icon: iconElement, color: hoverColor}, changeIconColor); 8434 icon.parents('.qode-start-icon-hover').on('mouseleave', {icon: iconElement, color: originalColor}, changeIconColor); 8435 } else { 8436 icon.on('mouseenter', {icon: iconElement, color: hoverColor}, changeIconColor); 8437 icon.on('mouseleave', {icon: iconElement, color: originalColor}, changeIconColor); 8438 } 8439 } 8440 } 8441 }; 8442 8443 /** 8444 * Function that triggers icon holder background color hover functionality 8445 */
8446 var iconHolderBackgroundHover = function(icon) { 8447 if(typeof icon.data('hover-background-color') !== 'undefined') { 8448 var changeIconBgColor = function(event) { 8449 event.data.icon.css('background-color', event.data.color); 8450 }; 8451 8452 var hoverBackgroundColor = icon.data('hover-background-color'); 8453 var originalBackgroundColor = icon.css('background-color'); 8454 8455 if(hoverBackgroundColor !== '') { 8456 if(icon.parents('.qode-start-icon-hover').length){ 8457 icon.parents('.qode-start-icon-hover').on('mouseenter', {icon: icon, color: hoverBackgroundColor}, changeIconBgColor); 8458 icon.parents('.qode-start-icon-hover').on('mouseleave', {icon: icon, color: originalBackgroundColor}, changeIconBgColor); 8459 } else { 8460 icon.on('mouseenter', {icon: icon, color: hoverBackgroundColor}, changeIconBgColor); 8461 icon.on('mouseleave', {icon: icon, color: originalBackgroundColor}, changeIconBgColor); 8462 } 8463 } 8464 } 8465 }; 8466 8467 return { 8468 init: function() { 8469 if(icons.length) { 8470 icons.each(function() { 8471 iconHoverColor($j(this)); 8472 iconHolderBackgroundHover($j(this)); 8473 }); 8474 8475 } 8476 } 8477 }; 8478}; 8479 8480function initIconWithTextHover() { 8481 "use strict"; 8482 8483 if($j('.qode_iwt_icon_holder').length) { 8484 $j('.qode_iwt_icon_holder').each(function() { 8485 if(typeof $j(this).data('icon-hover-bg-color') !== 'undefined') { 8486 var hoverBgColor = $j(this).data('icon-hover-bg-color'); 8487 var initialBgColor = $j(this).css('background-color'); 8488 8489 $j(this).hover(function() { 8490 $j(this).css('background-color', hoverBgColor); 8491 }, function() { 8492 $j(this).css('background-color', initialBgColor); 8493 }); 8494 } 8495 8496 if(typeof $j(this).data('icon-hover-color') !== 'undefined') { 8497 var elementToChange = $j(this).find('.qode_iwt_icon_element'); 8498 var hoverColor = $j(this).data('icon-hover-color'); 8499 var initialColor = elementToChange.css('color'); 8500 8501 $j(this).hover(function() { 8502 elementToChange.css('color', hoverColor); 8503 }, function() { 8504 elementToChange.css('color', initialColor); 8505 }); 8506 } 8507 }); 8508 } 8509} 8510 8511function initLoadNextPostOnBottom(){ 8512 "use strict"; 8513 8514 if($j('.blog_vertical_loop').length) { 8515 var header_addition; 8516 var normal_header_addition; 8517 var paspartu_add = $j('body').hasClass('paspartu_enabled') ? Math.round($window_width*paspartu_width) : 0; 8518 8519 if($j('header.page_header').hasClass('transparent')) { 8520 normal_header_addition = 0; 8521 }else{ 8522 normal_header_addition = header_height; 8523 } 8524 8525 var click = true; 8526 8527 var $container = $j('.blog_vertical_loop .blog_holder'); 8528 $j(document).on('click','.blog_vertical_loop_button a',function(e){ 8529 e.preventDefault(); 8530 if(click){ 8531 click = false; 8532 var $this = $j(this); 8533 8534 var link = $this.attr('href'); 8535 var $content = '.blog_vertical_loop .blog_holder'; 8536 var $anchor = '.blog_vertical_loop_button_holder a'; 8537 var $next_href = $j($anchor).attr('href'); 8538 8539 //check for mobile header 8540 if($window_width < 1000){ 8541 header_addition = $j('header.page_header').height(); 8542 }else{ 8543 header_addition = normal_header_addition; 8544 } 8545 8546 var scrollTop = $j(window).scrollTop(), 8547 elementOffset = $this.closest('article').offset().top, 8548 distance = (elementOffset - scrollTop) - header_addition - paspartu_add; 8549 8550 $container.find('article:eq(1)').addClass('fade_out'); 8551 $this.closest('article').addClass('move_up').removeClass('next_post').css('transform', 'translateY(-' + distance + 'px)'); 8552 setTimeout(function () { 8553 $j(window).scrollTop(0); 8554 $container.find('article:eq(0)').remove(); 8555 $container.find('article:eq(0)').addClass('previous_post'); 8556 $this.closest('article').removeAttr('style').removeClass('move_up'); 8557 }, 450); 8558 8559 8560 $j.get(link + '', function (data) { 8561 var $new_content = $j(data).find('article').addClass('next_post'); 8562 $next_href = $j($anchor, data).attr('href'); 8563 $container.append($j($new_content)); 8564 click = true; 8565 }); 8566 } 8567 else{ 8568 return false;
8569 } 8570 }); 8571 8572 $j(document).on('click','.blog_vertical_loop_back_button a',function(e){ 8573 e.preventDefault(); 8574 if(click){ 8575 click = false; 8576 var $this = $j(this); 8577 8578 var link = $this.attr('href'); 8579 var $content = '.blog_vertical_loop .blog_holder'; 8580 var $anchor = '.blog_vertical_loop_button_holder.prev_post a'; 8581 var $prev_href = $j($anchor).attr('href'); 8582 8583 $container.find('article:eq(0)').removeClass('fade_out').addClass('fade_in'); 8584 $this.closest('article').addClass('move_up').css('transform', 'translateY(' + $window_height + 'px)'); 8585 setTimeout(function () { 8586 $container.find('article:last-child').remove(); 8587 $container.find('article:eq(0)').removeClass('previous_post fade_in'); 8588 $this.closest('article').addClass('next_post').removeAttr('style').removeClass('move_up'); 8589 8590 $j.get(link + '', function (data) { 8591 var $new_content = $j(data).find('article').removeClass('next_post').addClass('previous_post'); //by default, posts have next_post class 8592 $prev_href = $j($anchor, data).attr('href'); 8593 $container.prepend($j($new_content)); 8594 click = true; 8595 }); 8596 8597 }, 450); 8598 8599 }else{ 8600 return false; 8601 } 8602 8603 }); 8604 8605 //load previous post on page load 8606 $j.get($j('.blog_vertical_loop_button_holder .last_page a').attr('href') + '', function (data) { 8607 var $new_content = $j(data).find('article').removeClass('next_post').addClass('previous_post'); //by default, posts have next_post class 8608 $container.prepend($j($new_content)); 8609 }); 8610 //load next post on page load 8611 $j.get($j('.blog_vertical_loop_button a').attr('href') + '', function (data) { 8612 var $new_content = $j(data).find('article').addClass('next_post'); 8613 $container.append($j($new_content)); 8614 }); 8615 } 8616} 8617 8618/* 8619 Parallax Layers plugin 8620 */ 8621 8622(function ( $ ) { 8623 "use strict"; 8624 8625 $.fn.extend({ 8626 8627 mouseParallax: function(options) { 8628 8629 var defaults = { moveFactor: 1.5, targetContainer: this }; 8630 8631 var options = $.extend(defaults, options); 8632 8633 return this.each(function() { 8634 var o = options; 8635 var layer_elements = $(o.targetContainer).find('.image, .paralax_layers_content_holder'); 8636 8637 layer_elements.each(function(i){ 8638 $(this).css('z-index',i); 8639 }); 8640 8641 var mouseXStart; 8642 var mouseYStart; 8643 8644 mouseXStart = $(o.targetContainer).offset().left; 8645 mouseYStart = $(o.targetContainer).offset().top; 8646 8647 $(o.targetContainer).on('mouseenter',function(e){ 8648 mouseXStart = e.pageX - $(this).offset().left; 8649 mouseYStart = e.pageY - $(this).offset().top; 8650 }); 8651 8652 $(o.targetContainer).on('mousemove', function(e){ 8653 8654 var mouseX0 = $(this).offset().left + mouseXStart; 8655 var mouseY0 = $(this).offset().top + mouseYStart; 8656 8657 var mouseX = e.pageX - mouseX0; 8658 var mouseY = e.pageY - mouseY0; 8659 8660 layer_elements.each(function(i){ 8661 $(this).css({ 8662 marginLeft : -mouseX / 100 * o.moveFactor*(i+1), 8663 marginTop : -mouseY / 100 * o.moveFactor*(i+1) 8664 },100); 8665 }); 8666 }); 8667 var config = { 8668 interval: 0, 8669 over: function(){}, 8670 timeout: 500, 8671 out: function(){ 8672 layer_elements.each(function(i){ 8673 $(this).stop().animate({ 8674 marginLeft: 0, 8675 marginTop: 0 8676 },300); 8677 }); 8678 } 8679 }; 8680 8681 $(o.targetContainer).hoverIntent(config); 8682 8683 }); 8684 } 8685 8686 8687 }); 8688} (jQuery) ); 8689 8690/** 8691 * Initialize parallax layers function 8692 */ 8693 8694function setParallaxLayersHeight($this, $def_height){ 8695 "use strict"; 8696 8697 var parallax_layers_height = $def_height; 8698 var responsive_breakpoint_set = [1600,1300,1000,768,567,320]; 8699 if($window_width > responsive_breakpoint_set[0]){ 8700 parallax_layers_height = $def_height; 8701 }else if($window_width > responsive_breakpoint_set[1]){ 8702 parallax_layers_height = $def_height * 0.75; 8703 }else if($window_width > responsive_breakpoint_set[2]){ 8704 parallax_layers_height = $def_height * 0.6; 8705 }else if($window_width > responsive_breakpoint_set[3]){ 8706 parallax_layers_height = $def_height * 0.55; 8707 }else if($window_width <= responsive_breakpoint_set[3]){ 8708 parallax_layers_height = $def_height * 0.45; 8709 } 8710 8711 $this.css({'height': (parallax_layers_height) + 'px'}); 8712} 8713 8714function parallaxLayers(){ 8715 "use strict"; 8716 8717 if($j('.qode_parallax_layers').length){ 8718 8719 $j(".qode_parallax_layers").each(function(){ 8720 8721 var $this = $j(this); 8722 if($j(this).hasClass('full_screen_height')){ 8723 $this.height($window_height); 8724 $j(window).resize(function () { 8725 $this.height($window_height); 8726 }); 8727 }else{ 8728 var $def_height = $j(this).data('height'); 8729 setParallaxLayersHeight($this, $def_height); 8730 $j(window).resize(function () { 8731 setParallaxLayersHeight($this, $def_height); 8732 }); 8733 } 8734 8735 var $parallax_layers_holder = $this.find('.qode_parallax_layers_holder'); 8736 var counter = 0; 8737 var limit = $this.find(".image").length; 8738 $this.find(".image").each(function() { 8739 8740 var $this = $j(this); 8741 if($this.css("background-image") != "" && $this.css("background-image") != "none") { 8742 8743 var bg_url = $this.attr('style'); 8744 8745 bg_url = bg_url.match(/url\(["']?([^'")]+)['"]?\)/); 8746 bg_url = bg_url ? bg_url[1] : ""; 8747 if (bg_url) { 8748 var backImg = new Image(); 8749 backImg.src = bg_url; 8750 $j(backImg).on('load', function(){ 8751 counter++; 8752 if(counter == limit){ 8753 $parallax_layers_holder.removeClass('preload_parallax_layers'); 8754 if($j('html').hasClass('no-touch')){$parallax_layers_holder.mouseParallax()}; 8755 } 8756 }); 8757 } 8758 } 8759 }); 8760 }); 8761 8762 } 8763} 8764 8765/* 8766 ** This function reinit dropDown after wpml filter replace menu after our ajax is finished 8767 */ 8768 8769function initDropDownAfterWPMLReplaceMenu() { 8770 "use strict"; 8771 8772 if(qode_body.hasClass('qode-wpml-enabled') && qode_body.hasClass('qode-page-transition-enabled')){ 8773 8774 // configuration of the observer: 8775 var config = { attributes: true, childList: true, characterData: true }; 8776 8777 if($j('nav.main_menu').length) { 8778 var target = document.querySelector('.main_menu');// create an observer instance 8779 var observer = new MutationObserver(function(mutations) { 8780 initDropDownMenu(); 8781 initInsideMobileMenu(); 8782 }); 8783 8784 observer.observe(target, config); 8785 } 8786 8787 if($j('nav.vertical_menu').length) { 8788 var targetVertical = document.querySelector('.vertical_menu');// create an observer instance 8789 var observerVertical = new MutationObserver(function(mutations) { 8790 initVerticalMenu(); 8791 initInsideMobileMenu(); 8792 }); 8793 8794 observerVertical.observe(targetVertical, config); 8795 } 8796 8797 if($j('nav.popup_menu').length) { 8798 var targetPopup = document.querySelector('nav.popup_menu');// create an observer instance 8799 var observerPopup = new MutationObserver(function(mutations) { 8800 initPopupMenuItemsOpening(); 8801 }); 8802 8803 observerPopup.observe(targetPopup, config); 8804 } 8805 } 8806} 8807 8808/* 8809 ** Init flexslider for portfolio single 8810 */ 8811function initContentSlider(){ 8812 "use strict"; 8813 $j('.qode_content_slider').each(function(){ 8814 var $this = $j(this); 8815 8816 var interval = 8000; 8817 if(typeof $this.data('interval') !== 'undefined' && $this.data('interval') !== false) { 8818 interval = parseFloat($this.data('interval')) * 1000; 8819 } 8820 8821 var directionNav = false;
8822 if(typeof $this.data('direction') !== 'undefined') { 8823 directionNav = $this.data('direction'); 8824 } 8825 8826 var controlNav = false; 8827 if(typeof $this.data('control') !== 'undefined'){ 8828 controlNav = $this.data('control'); 8829 } 8830 8831 var pauseOnHoverAction = false; 8832 if(typeof $this.data('pause-on-hover') !== 'undefined'){ 8833 pauseOnHoverAction = $this.data('pause-on-hover'); 8834 } 8835 8836 var enableDrag = false; 8837 if(typeof $this.data('drag') !== 'undefined'){ 8838 enableDrag = $this.data('drag'); 8839 } 8840 8841 var slideshow = true; 8842 if(interval === 0) { 8843 slideshow = false; 8844 } 8845 8846 var animation = 'slide'; 8847 if(typeof $this.data('flex_fx') !== 'undefined' && $this.data('flex_fx') !== false) { 8848 animation = $this.data('flex_fx'); 8849 } 8850 8851 var smoothHeight = false; 8852 if($this.find('.qode-lazy-image').length) { 8853 smoothHeight = true; 8854 } 8855 8856 $this.flexslider({ 8857 selector: '.qode_content_slider_inner > .qode_content_slider_item', 8858 animationLoop: true, 8859 controlNav: controlNav, 8860 directionNav: directionNav, 8861 useCSS: false, 8862 pauseOnAction: pauseOnHoverAction, 8863 pauseOnHover: pauseOnHoverAction, 8864 slideshow: slideshow, 8865 animation: animation, 8866 prevText: "<div><i class='fa fa-angle-left'></i></div>", 8867 nextText: "<div><i class='fa fa-angle-right'></i></div>", 8868 animationSpeed: 600, 8869 slideshowSpeed: interval, 8870 touch: true, 8871 smoothHeight: smoothHeight, 8872 start: function() { 8873 lazyReload($this); 8874 }, 8875 after: function() { 8876 lazyReload($this); 8877 } 8878 }); 8879 8880 var lazyReload = function(slider) { 8881 if($this.find('.qode-lazy-image').length) { 8882 qodeLazyImages(); 8883 } 8884 } 8885 8886 $this.find('.flex-direction-nav a').on('click', function(e){ 8887 e.preventDefault(); 8888 e.stopImmediatePropagation(); 8889 e.stopPropagation(); 8890 }); 8891 8892 if(enableDrag) { 8893 $this.swipe({ 8894 swipeLeft: function () { $this.flexslider('next'); }, 8895 swipeRight: function () { $this.flexslider('prev'); }, 8896 threshold: 20 8897 }); 8898 } 8899 8900 if ($this.hasClass('control_nav_justified')) { 8901 var justifyBullets = function(slider) { 8902 8903 var bullets = $this.find('ol'); 8904 8905 bullets.addClass('qode-type1-gradient-left-to-right-after'); 8906 8907 if ($window_width > 1440) { 8908 bullets.css('max-width',qode_grid_width); 8909 } else { 8910 bullets.css('max-width', Math.round($this.outerWidth()*0.8)); 8911 } 8912 8913 var listItems = bullets.find('li'), 8914 listItemsWidth = listItems.outerWidth(), 8915 listWidth = parseInt(bullets.css('max-width')), 8916 remainingWidth = listWidth - listItemsWidth*listItems.length, 8917 space = (Math.floor(remainingWidth / listItems.length)); 8918 8919 listItems.css('margin-right', space); 8920 listItems.last().css('margin-right', 0); 8921 } 8922 8923 justifyBullets($this); 8924 8925 $j(window).resize(function(){ 8926 justifyBullets($this); 8927 }); 8928 } 8929 8930 }); 8931} 8932 8933/* 8934 ** Init sticky sidebar widget 8935 */ 8936function qodeInitStickyWidget() { 8937 8938 var stickyWidgets = $j('.qode-widget-sticky-sidebar'); 8939 if ( stickyWidgets.length && $window_width > 1000 ) { 8940 8941 var header = $j('header.page_header'); 8942 sticky_amount = getScrollAmountForStickyHeader(); 8943 8944 stickyWidgets.each(function(){ 8945 var widget = $j(this), 8946 parent = '.full_section_inner, .section_inner, .two_columns_75_25, .two_columns_25_75, .two_columns_66_33, .two_columns_33_66, .elementor-row', 8947 stickyHeight = 0, 8948 widgetOffset = widget.offset().top; 8949 8950 8951 if (widget.parent('aside.sidebar').length) { 8952 var sidebar = widget.parents('aside.sidebar'); 8953 } else if (widget.parents('.wpb_widgetised_column').length) { 8954 var sidebar = widget.parents('.wpb_widgetised_column'); 8955 widget.closest('.wpb_column').css('position','static'); 8956 } else if(widget.parents('.elementor-widget.elementor-widget-sidebar').length) { 8957 var sidebar = widget.parents('.elementor-widget.elementor-widget-sidebar'); 8958 } 8959 8960 var sidebarOffset = sidebar.offset().top; 8961 if(sticky_amount < sidebarOffset && (header.hasClass('stick') || header.hasClass('stick_with_left_r
8961ight_menu'))){ 8962 stickyHeight = min_header_height_sticky; 8963 }else if(header.hasClass('fixed')){ 8964 stickyHeight = min_header_height_scroll + content_menu_top_add; 8965 }else if(header.hasClass('fixed_top_header')){ 8966 stickyHeight = header_top_height; 8967 }else if(header.hasClass('fixed_hiding')){ 8968 stickyHeight = min_header_height_fixed_hidden + 40; //2*20 for logo margin 8969 }else if(qode_window < 1000 || $j('.vertical_menu_enabled').length > 0){ //for mobile and verical header 8970 stickyHeight = 0; 8971 }else{ 8972 stickyHeight = 0; 8973 } 8974 8975 var offset = -(widgetOffset-sidebarOffset-stickyHeight-10); //10 is to push down from browser top edge 8976 8977 sidebar.stick_in_parent({ 8978 parent: parent, 8979 sticky_class : 'qode-sticky-sidebar', 8980 inner_scrolling : false, 8981 offset_top: offset 8982 }).on("sticky_kit:bottom", function() { //check if sticky sidebar have hit the bottom and use that class for pull it down when sticky header appears 8983 sidebar.addClass('qode-sticky-sidebar-on-bottom'); 8984 }).on("sticky_kit:unbottom", function() { 8985 sidebar.removeClass('qode-sticky-sidebar-on-bottom'); 8986 }); 8987 8988 $j(window).scroll(function(){ 8989 if ($window_width >= 1000) { 8990 if (sticky_amount > sidebarOffset && header.hasClass('sticky') && sidebar.hasClass('qode-sticky-sidebar') && !sidebar.hasClass('qode-sticky-sidebar-on-bottom')) { 8991 sidebar.css('-webkit-transform', 'translateY('+min_header_height_sticky+'px)'); 8992 sidebar.css('transform', 'translateY('+min_header_height_sticky+'px)'); 8993 } else { 8994 sidebar.css('-webkit-transform', 'translateY(0px)'); 8995 sidebar.css('transform', 'translateY(0px)'); 8996 } 8997 } 8998 }); 8999 9000 }); 9001 } 9002 9003} 9004 9005function qodeBlogGalleryAnimation() { 9006 var blogGalleries = $j('.blog_holder.blog_gallery'); 9007 if (blogGalleries.length) { 9008 blogGalleries.each(function(){ 9009 var blogGallery = $j(this), 9010 articles = blogGallery.find('article'); 9011 9012 articles.each(function(){ 9013 var article = $j(this), 9014 excerpt = article.find('.post_excerpt'), 9015 excerptHeight = parseInt(excerpt.outerHeight(true)), 9016 category = article.find('.post_category'), 9017 title = article.find('.entry_title'); 9018 9019 category.css({'transform':'translateY('+excerptHeight+'px)'}); 9020 title.css({'transform':'translateY('+excerptHeight+'px)'}); 9021 9022 article.mouseenter(function(){ 9023 category.css({'transform':'translateY(0px)'}); 9024 title.css({'transform':'translateY(0px)'}); 9025 excerpt.css({'visibility':'visible','opacity':'1'}); 9026 }); 9027 article.mouseleave(function(){ 9028 category.css({'transform':'translateY('+excerptHeight+'px)'}); 9029 title.css({'transform':'translateY('+excerptHeight+'px)'}); 9030 excerpt.css({'visibility':'hidden', 'opacity':'0'}); 9031 }); 9032 }); 9033 }); 9034 } 9035} 9036 9037/** 9038 * Loads images that are set to be 'lazy' 9039 */ 9040function qodeLazyImages() { 9041 $j.fn.preloader = function (action, callback) { 9042 if (!!action && action == 'destroy') { 9043 this.find('.qode-lazy-preloader').remove(); 9044 } else { 9045 var block = $j('<div class="qode-lazy-preloader"></div>'); 9046 $j('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="75" width="75" viewbox="0 0 75 75"><circle stroke-linecap="round" cx="37.5" cy="37.5" r="33.5" stroke-width="4"/></svg>').appendTo(block); 9047 block.appendTo(this); 9048 if(typeof callback == 'function') 9049 callback(); 9050 } 9051 return this; 9052 }; 9053 9054 $j('.qode-lazy-image[data-image][data-lazy="true"]:not(.lazyLoading)').each(function(i, object) { 9055 object = $j(object); 9056 9057 if(object.attr('data-ratio')) { 9058 object.height(object.width()*object.data('ratio')); 9059 9060 } 9061 9062 var rect = object[0].getBoundingClientRect(), 9063 vh = ($window_height || document.documentElement.clientHeight), 9064 vw = ($window_width || document.documentElement.clientWidth), 9065 oh = object.outerHeight(), 9066 ow = object.outerWidth(); 9067 9068 9069 if( 9070 ( rect.top !=0 || rect.right !=0 || rect.bottom !=0 || rect.left !=0 ) && 9071 ( rect.top >= 0 || rect.top + oh >= 0 ) && 9072 ( rect.bottom >=0 && rect.bottom - oh - vh <= 0 ) && 9073 ( rect.left >= 0 || rect.left + ow >= 0 ) && 9074 ( rect.right >=0 && rect.right - ow - vw <= 0 ) 9075 ) { 9076 9077 9078 var preloader = null; 9079 if(object.prop('tagName') == 'IMG') { 9080 preloader = object.parent(); 9081 } else { 9082 preloader = object; 9083 } 9084 9085 if(!!preloader) { 9086 preloader.preloader('init'); 9087 } 9088 object.addClass('lazyLoading'); 9089 9090 var imageObj = new Image(); 9091 9092 $j(imageObj).on('load', function() { 9093 9094 preloader.preloader('destroy'); 9095 object 9096 .removeAttr('data-image') 9097 .removeData('image') 9098 .removeAttr('data-lazy') 9099 .removeData('lazy') 9100 .removeClass('lazyLoading'); 9101 9102 switch(object.prop('tagName')) { 9103 case 'IMG': 9104 object.attr('src', $j(this).attr('src')); 9105 object.height('auto'); 9106 break; 9107 9108 case 'DIV': 9109 default: 9110 object.css('background-image', 'url(' + $j(this).attr('src') + ')'); 9111 break; 9112 } 9113 9114 }).attr('src', object.data('image')); 9115 } 9116 }); 9117} 9118 9119/** 9120 * Cards Slider shortcode 9121 */ 9122var qodeCardsSlider = function () { 9123 9124 var handleMovement = function (slides, slider, curSlideId, newSlideId, newSlide, centerSlider) { 9125 slider.data('card-slide', newSlideId).attr('data-card-slide', newSlideId); 9126 slider.find('.qode-card-slider').css('margin-left', centerSlider ? (-newSlide.position().left + $j(sli
9126der).outerWidth() / 2 - newSlide.outerWidth() / 2) : -newSlide.position().left); 9127 9128 setTimeout(function(){ 9129 qodeLazyImages(); 9130 },500); //500 is duration of margin animation 9131 9132 var direction = curSlideId < newSlideId ? 1 : -1; 9133 9134 if (direction > 0 && newSlideId == slides.length) { 9135 slider.find('.button[data-direction="next"]').addClass('hidden'); 9136 } else { 9137 slider.find('.button[data-direction="next"]').removeClass('hidden'); 9138 } 9139 if (direction < 0 && newSlideId == 1) { 9140 slider.find('.button[data-direction="prev"]').addClass('hidden'); 9141 } else { 9142 slider.find('.button[data-direction="prev"]').removeClass('hidden'); 9143 } 9144 } 9145 9146 var setSliderToCenter = function(slider,activeMiddleSlide,centerSlider){ 9147 slider.each(function (i, slider) { 9148 var slides = $j(slider).find('.qode-card-slider > .slide'), 9149 dots = $j(slider).find('.dot'), 9150 center = Math.round(slides.length / 2) - 1; 9151 9152 if(activeMiddleSlide) { 9153 if (dots.length > 0) { 9154 $j(dots[center]).trigger("click"); 9155 } else { 9156 handleMovement(slides,$j(slider),1,center,$j(slides[center]),centerSlider); 9157 } 9158 $j(slider).data('card-slide', center + 1).attr('data-card-slide', center + 1); 9159 $j(slider).find('.button').removeClass('hidden'); 9160 }else{ 9161 if (dots.length > 0) { 9162 $j(dots[0]).trigger("click"); 9163 } else { 9164 handleMovement(slides,$j(slider),1,1,$j(slides[0]),centerSlider); 9165 } 9166 } 9167 }) 9168 } 9169 9170 //set max width of slides 9171 var maxWidthOfSlides = function (slides,slider,autoheight) { 9172 slider.find('.qode-card-slider').width(99999); 9173 slides.each(function(){ 9174 $j(this).css('max-width',slider.outerWidth()); 9175 //if(autoheight == true) { 9176 // $j(this).find('img').css('height', 'auto'); 9177 //} 9178 }); 9179 } 9180 9181 //initialize card headers 9182 var initCardHeaders = function() { 9183 9184 var headers = $j('.cards'); 9185 headers.each(function () { 9186 var header = $j(this); 9187 var cards = header.find('.card'); 9188 cards.each(function() { 9189 var card = $j(this); 9190 card.on('click', function () { 9191 if (!cards.last().is(card)) { 9192 card.detach(); 9193 card.insertAfter(cards.last()); 9194 cards = header.find('.card'); 9195 } 9196 return false; 9197 }) 9198 }); 9199 }); 9200 } 9201 9202 //initialize card headers hover animation 9203 var initCardsHeadersHoverAnimation = function(){ 9204 var headers = $j('.cards'); 9205 headers.each(function () { 9206 var header = $j(this); 9207 var cards = header.find('.card').get().reverse(); 9208 header.appear(function () { 9209 $j(cards).each(function (i) { 9210 var card = $j(this); 9211 setTimeout(function () { 9212 card.addClass('hovered'); 9213 setTimeout(function () { 9214 card.removeClass('hovered'); 9215 }, 600); 9216 }, 200 * i); 9217 9218 }); 9219 }, {accX: 0, accY: -($window_height / 3)}); 9220 }); 9221 } 9222 9223 //initialize card panes changing 9224 var initCardPanes = function() { 9225 $j('.qode-cards-holder .card').each(function (i, card) { 9226 $j(card).on('click', function () { 9227 var pane = $j('.'+$j(card).data('value')); 9228 pane.closest('.qode-card-panes').find('.pane').removeClass('active'); 9229 pane.addClass('active'); 9230 qodeLazyImages(); 9231 return false; 9232 }) 9233 }); 9234 9235 $j('.qode-cards-holder').each(function(i, holder){ 9236 $j(holder).find('.qode-card-panes .pane').last().addClass('active'); //set last slider as active 9237 //replace cards headers in right place 9238 if($j(holder).find('.qode-card-panes .pane .card').length) { 9239 $j(holder).find('.qode-card-panes .pane .card').each(function (i, card) { 9240 $j(card).detach(); 9241 $j(holder).find('.qode-cards-header').append($j(card)); 9242 }); 9243 }else{ 9244 $j(holder).find('.qode-cards-header').remove(); 9245 } 9246 }); 9247 } 9248 9249 //set height of slider 9250 var setHeightOfSlider = function(){ 9251 $j('.qode-card-panes').each(function() { 9252 var $this = $j(this); 9253 var maxHeight = -1; 9254 var element_height = $this.find('.pane').height(); 9255 maxHeight = maxHeight > element_height ? maxHeight : element_height; 9256 $this.height(maxHeight); 9257 }); 9258 } 9259 9260 //set swipe functionality on all sliders 9261 var setSwipeFunctionality = function(slider){ 9262 slider.swipe({ 9263 swipeLeft: function () { 9264 slider.find('.button[data-direction="next"]').trigger("click"); 9265 }, 9266 swipeRight: function () { 9267 slider.find('.button[data-direction="prev"]').trigger("click"); 9268 }, 9269 threshold: 20 9270 }); 9271 } 9272 9273 9274 //initialize sliders in every pane 9275 var initiateSliders = function() { 9276 $j('.qode-card-slider-holder').each(function (i, slider) {
9277 var slides = $j(slider).find('.qode-card-slider > .slide'), 9278 activeMiddleSlide = $j(slider).data('active-middle-slide'), 9279 centerSlider = $j(slider).data('center'); 9280 9281 //handle navigation arros click 9282 $j(slider).find('.button').each(function (i, button) { 9283 $j(button).on('click', function () { 9284 var direction = $j(button).data('direction') == 'prev' ? -1 : 1, 9285 curSlideId = $j(slider).data('card-slide'), 9286 newSlideId = $j(slider).data('card-slide') + direction, 9287 newSlide = $j(slider).find('.slide[data-card-slide="' + newSlideId + '"]'); 9288 9289 if (newSlide.length) { 9290 handleMovement(slides, $j(slider), curSlideId, newSlideId, newSlide, centerSlider); 9291 $j(slider).find('.dot').removeClass('active').filter('[data-card-slide="' + newSlideId + '"]').addClass('active'); 9292 } 9293 return false; 9294 }); 9295 }); 9296 9297 //handle navigation bullets click 9298 $j(slider).find('.dot').each(function (i, dot) { 9299 $j(dot).on('click', function () { 9300 $j(slider).find('.dot').removeClass('active'); 9301 $j(dot).addClass('active'); 9302 var curSlideId = $j(slider).data('card-slide'), 9303 newSlideId = $j(dot).data('card-slide'), 9304 newSlide = $j(slider).find('.slide[data-card-slide="' + newSlideId + '"]'); 9305 if (newSlide.length) { 9306 handleMovement(slides, $j(slider), curSlideId, newSlideId, newSlide, centerSlider); 9307 } 9308 return false; 9309 }); 9310 }); 9311 9312 9313 /** 1. **/ maxWidthOfSlides(slides, $j(slider), false); 9314 /** 2. **/ setSliderToCenter($j(slider), activeMiddleSlide, centerSlider); 9315 /** 3. **/ setSwipeFunctionality($j(slider)); 9316 $j(window).resize(function () { 9317 maxWidthOfSlides(slides, $j(slider), true); 9318 setSliderToCenter($j(slider), activeMiddleSlide, centerSlider); 9319 setHeightOfSlider(); 9320 }); 9321 }); 9322 } 9323 9324 9325 return { 9326 init: function(){ 9327 if ($j('.qode-card-slider-holder').length) { 9328 initiateSliders(); 9329 setHeightOfSlider(); 9330 initCardPanes(); 9331 initCardHeaders(); 9332 } 9333 }, 9334 load: function(){ 9335 if ($j('.qode-card-slider-holder').length) { 9336 setHeightOfSlider(); 9337 initCardsHeadersHoverAnimation(); 9338 } 9339 } 9340 }; 9341 9342} 9343 9344/** 9345 * Cards Gallery shortcode 9346 */ 9347function qodeCardsGallery() { 9348 if ($j('.qode-cards-gallery-holder').length) { 9349 $j('.qode-cards-gallery-holder').each(function(){ 9350 var gallery = $j(this); 9351 var cards = gallery.find('.card'); 9352 var side = gallery.data('side'); 9353 var marginValue; 9354 switch (side){ 9355 case 'left': 9356 marginValue = '0 0 0 20%'; 9357 break; 9358 case 'right': 9359 marginValue = '0 20% 0 0'; 9360 break; 9361 case 'top': 9362 marginValue = '20% 0 0 0'; 9363 break; 9364 case 'bottom': 9365 marginValue = '0 0 20% 0'; 9366 break; 9367 } 9368 cards.each(function() { 9369 var card = $j(this); 9370 card.on('click', function () { 9371 if (!cards.last().is(card)) { 9372 card.addClass('out').animate({ 9373 opacity: 0, 9374 margin: marginValue 9375 },200,function(){ 9376 card.detach(); 9377 card.insertAfter(cards.last()).animate({ 9378 opacity: 1, 9379 margin: '0' 9380 },500,function(){ 9381 card.removeClass('out'); 9382 }); 9383 cards = gallery.find('.card'); 9384 }); 9385 return false;
9386 } 9387 }); 9388 }); 9389 }); 9390 } 9391} 9392 9393/** 9394 * Init Elliptical slider shortcode 9395 */ 9396 9397function qodeInitEllipticalSlider(){ 9398 9399 var ellipticalSliders = $j('.qode-elliptical-slider'); 9400 if(ellipticalSliders.length){ 9401 ellipticalSliders.each(function(){ 9402 9403 var thisEllipticalSlider = $j(this); 9404 var animationSelector = $j('.qode-elliptical-slider > .qode-elliptical-slider-slides'); 9405 9406 var interval = 5000; 9407 var controlNav = true; 9408 var directionNav = false; 9409 var animationSpeed = 600; 9410 var autoplay = false; 9411 if(typeof animationSelector.data('animation-speed') !== 'undefined' && animationSelector.data('animation-speed') !== false) { 9412 animationSpeed = animationSelector.data('animation-speed'); 9413 } 9414 9415 if(animationSelector.data('autoplay') == 'yes') { 9416 autoplay = true; 9417 } 9418 9419 thisEllipticalSlider.flexslider({ 9420 selector: ".qode-elliptical-slider-slides > .qode-elliptical-slide", 9421 animationLoop: true, 9422 controlNav: controlNav, 9423 directionNav: directionNav, 9424 useCSS: false, 9425 pauseOnAction: true, 9426 pauseOnHover: true, 9427 slideshow: autoplay, 9428 animationSpeed: animationSpeed, 9429 slideshowSpeed: interval, 9430 touch: true 9431 }); 9432 }); 9433 9434 } 9435 9436} 9437 9438/** 9439 * Init Pricing calculator shortcode 9440 */ 9441 9442function qodeInitPricingCalculator(){ 9443 9444 var pricingCalculators = $j('.qode-pricing-calculator'); 9445 if(pricingCalculators.length){ 9446 pricingCalculators.each(function(){ 9447 var pricingCalculator = $j(this); 9448 var pricingCalculatorItems = $j(this).find('.qode-pricing-calculator-item'); 9449 var totalPrice = 0; 9450 9451 pricingCalculatorItems.each(function(){ 9452 var pricingCalculatorItem = $j(this); 9453 var itemPrice = pricingCalculatorItem.data('price'); 9454 var itemInput = pricingCalculatorItem.find('input'); 9455 9456 if(itemInput.prop('checked')){ 9457 totalPrice += itemPrice; 9458 } 9459 9460 pricingCalculatorItem.on('change', function(e){ 9461 if(itemInput.prop('checked')) { 9462 totalPrice += itemPrice; 9463 } else { 9464 totalPrice -= itemPrice; 9465 } 9466 pricingCalculator.find('.qode-pricing-calculator-total-price').text(totalPrice); 9467 }); 9468 }); 9469 }); 9470 } 9471 9472} 9473 9474/** 9475 * Init Sliding Image Holder 9476 */ 9477 9478function qodeSlidingImageHolder() { 9479 var slidingImageHolder = $j('.qode-sliding-image-holder'); 9480 9481 if (slidingImageHolder.length) { 9482 slidingImageHolder.each(function(){ 9483 var thisSlidingImageHolder = $j(this); 9484 9485 //infinite scroll effect 9486 if (!$j('html').hasClass('touch')) { 9487 qodeRequestAnimationFrame(); 9488 9489 var images = thisSlidingImageHolder.find('.qode-sliding-image-background-image'), 9490 imageWidth = Math.round(images.width()); 9491 9492 if (imageWidth == 0){ 9493 imageWidth = 1920; 9494 } 9495 9496 thisSlidingImageHolder.find('.qode-aux-background-image').css('left', imageWidth); //set to the right of initial image 9497 9498 images.each(function(i){ 9499 var image = $j(this), 9500 currentPos = 0, 9501 delta = 1; 9502 var qodeInfiniteScrollEffect = function() { 9503 currentPos -= delta; 9504 9505 if (Math.round(image.offset().left) <= -imageWidth) { 9506 image.css('left', parseInt(imageWidth - 2*delta)); 9507 currentPos = 0; 9508 } 9509 9510 image.css('transform','translate3d('+currentPos+'px,0,0)'); 9511 requestNextAnimationFrame(qodeInfiniteScrollEffect); 9512 } 9513 9514 $j(window).on('load', function(){ 9515 qodeInfiniteScrollEffect(); 9516 $j('html').addClass('qode-sliding-image-holder-initialized') 9517 }); 9518 9519 if( ! $j('html').hasClass('qode-sliding-image-holder-initialized') ) { 9520 qodeInfiniteScrollEffect(); 9521 } 9522 }); 9523 } 9524 }); 9525 } 9526} 9527 9528function qodeRequestAnimationFrame() { 9529 window.requestNextAnimationFrame = 9530 (function () { 9531 var originalWebkitRequestAnimationFrame = undefined, 9532 wrapper = undefined, 9533 callback = undefined, 9534 geckoVersion = 0, 9535 userAgent = navigator.userAgent, 9536 index = 0, 9537 self = this; 9538 9539 // Workaround for Chrome 10 bug where Chrome 9540 // does not pass the time to the animation function 9541 9542 if (window.webkitRequestAnimationFrame) { 9543 // Define the wrapper 9544 9545 wrapper = function (time) { 9546 if (time === undefined) { 9547 time = +new Date(); 9548 } 9549 9550 self.callback(time); 9551 }; 9552 9553 // Make the switch 9554 9555 originalWebkitRequestAnimationFrame = window.webkitRequestAnimationFrame; 9556 9557 window.webkitRequestAnimationFrame = function (callback, element) { 9558 self.callback = callback; 9559 9560 // Browser calls the wrapper and wrapper calls the callback 9561 9562 originalWebkitRequestAnimationFrame(wrapper, element); 9563 } 9564 } 9565 9566 // Workaround for Gecko 2.0, which has a bug in 9567 // mozRequestAnimationFrame() that restricts animations 9568 // to 30-40 fps. 9569 9570 if (window.mozRequestAnimationFrame) { 9571 // Check the Gecko version. Gecko is used by browsers 9572 // other than Firefox. Gecko 2.0 corresponds to 9573 // Firefox 4.0. 9574 9575 index = userAgent.indexOf('rv:'); 9576 9577 if (userAgent.indexOf('Gecko') != -1) {
9578 geckoVersion = userAgent.substr(index + 3, 3); 9579 9580 if (geckoVersion === '2.0') { 9581 // Forces the return statement to fall through 9582 // to the setTimeout() function. 9583 9584 window.mozRequestAnimationFrame = undefined; 9585 } 9586 } 9587 } 9588 9589 return window.requestAnimationFrame || 9590 window.webkitRequestAnimationFrame || 9591 window.mozRequestAnimationFrame || 9592 window.oRequestAnimationFrame || 9593 window.msRequestAnimationFrame || 9594 9595 function (callback, element) { 9596 var start, 9597 finish; 9598 9599 window.setTimeout( function () { 9600 start = +new Date(); 9601 callback(start); 9602 finish = +new Date(); 9603 9604 self.timeout = 1000 / 60 - (finish - start); 9605 9606 }, self.timeout); 9607 }; 9608 } 9609 ) 9610 (); 9611} 9612 9613function qodePageTransitionEffect() { 9614 var loader = $j('body.qode-page-loading-effect-enabled > .qode-page-loading-effect-holder'); 9615 if (loader.length) { 9616 loader.fadeOut(500); 9617 $j(window).bind("pageshow", function(event) { 9618 if (event.originalEvent.persisted) { 9619 loader.fadeOut(500); 9620 } 9621 }); 9622 $j('a').on('click', function(e) { 9623 var a = $j(this); 9624 if ( 9625 e.which == 1 && // check if the left mouse button has been pressed 9626 a.attr('href').indexOf(window.location.host) >= 0 && // check if the link is to the same domain 9627 (typeof a.data('rel') === 'undefined') && //Not pretty photo link 9628 (typeof a.attr('rel') === 'undefined') && //Not VC pretty photo link 9629 !a.hasClass('qode-like') && //Not like link 9630 !a.parents('.blog_load_more_button') && //Not load more 9631 !a.parents('.qode-single-product-images') && //Not product single image 9632 (typeof a.attr('target') === 'undefined' || a.attr('target') === '_self') && // check if the link opens in the same window 9633 (a.attr('href').split('#')[0] !== window.location.href.split('#')[0]) // check if it is an anchor aiming for a different page 9634 ) { 9635 e.preventDefault(); 9636 loader.addClass('qode-hide-spinner'); 9637 loader.fadeIn(500, function() { 9638 window.location = a.attr('href'); 9639 }); 9640 } 9641 }); 9642 } 9643} 9644 9645function qodeInitAccordions(){ 9646 "use strict"; 9647 9648 var accordion = $j('.qode-accordion-holder'); 9649 if(accordion.length){ 9650 accordion.each(function(){ 9651 9652 var thisAccordion = $j(this); 9653 9654 if(thisAccordion.hasClass('qode-accordion')){ 9655 9656 thisAccordion.accordion({ 9657 animate: "easeInOutQuint", 9658 collapsible: true, 9659 active: 0, 9660 icons: "", 9661 heightStyle: "content", 9662 }); 9663 } 9664 9665 if(thisAccordion.hasClass('qode-toggle')){ 9666 9667 var toggleAccordion = $j(this); 9668 var toggleAccordionTitle = toggleAccordion.find('.qode-title-holder'); 9669 var toggleAccordionContent = toggleAccordionTitle.next(); 9670 9671 toggleAccordion.addClass("accordion ui-accordion ui-accordion-icons ui-widget ui-helper-reset"); 9672 toggleAccordionTitle.addClass("ui-accordion-header ui-state-default ui-corner-top ui-corner-bottom"); 9673 toggleAccordionContent.addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(); 9674 9675 toggleAccordionTitle.each(function(){ 9676 var thisTitle = $j(this); 9677 thisTitle.hover(function(){ 9678 thisTitle.toggleClass("ui-state-hover"); 9679 }); 9680 9681 thisTitle.on('click',function(){ 9682 thisTitle.toggleClass('ui-accordion-header-active ui-state-active ui-state-default ui-corner-bottom'); 9683 thisTitle.next().toggleClass('ui-accordion-content-active').slideToggle(300); 9684 }); 9685 }); 9686 } 9687 }); 9688 } 9689} 9690 9691/* 9692 ** Interactive Icon Showcase 9693 */ 9694function qodeInitInteractiveIconShowcase () { 9695 var interactiveShowcase = $j('.qode-int-icon-showcase'), 9696 noAnimationOnTouch = $j('.no_animation_on_touch'); 9697 9698 if (interactiveShowcase.length){ 9699 interactiveShowcase.each(function () { 9700 var thisShowcase = $j(this), 9701 iconHolders = thisShowcase.find('.qode-showcase-item-holder'), 9702 thisIcons = thisShowcase.find('.qode-showcase-icon'), 9703 thisContent = thisShowcase.find('.qode-showcase-content'), 9704 thisFirstItem = thisShowcase.find('.qode-showcase-item-holder:first-child'), 9705 thisActiveItem = thisShowcase.find('.qode-showcase-item-holder.qode-showcase-active'), 9706 isInitialized = false, 9707 isPaused = false, 9708 currentItem, 9709 itemInterval = 3000, 9710 numberOfItems = iconHolders.length; 9711 9712 if(typeof thisShowcase.data('interval') !== 'undefined' && thisShowcase.data('interval') !== false) { 9713 itemInterval = thisShowcase.data('interval'); 9714 } 9715 9716 if (!noAnimationOnTouch.length) { 9717 //appear
9718 thisShowcase.appear(function(){ 9719 setTimeout(function(){ 9720 thisShowcase.addClass('qode-appeared'); 9721 if (!thisActiveItem.length) { 9722 // setTimeout(function(){ 9723 isInitialized = true; 9724 thisFirstItem.addClass('qode-showcase-active'); 9725 if (thisShowcase.hasClass('qode-autoplay')) { 9726 showcaseLoop(); 9727 thisShowcase.hover(function (e) { 9728 isPaused = true; 9729 },function (e) { 9730 isPaused = false; 9731 }); 9732 } 9733 // },2500); 9734 } 9735 },30); 9736 },{accX: 0, accY: -200}); 9737 } else { 9738 thisFirstItem.addClass('qode-showcase-active'); 9739 isInitialized = true; 9740 } 9741 9742 //hover actions 9743 thisIcons.each(function(){ 9744 var thisIcon = $j(this), 9745 thisHolder = thisIcon.parent(); 9746 9747 thisIcon.mouseenter(function(){ 9748 if (isInitialized == true) { 9749 thisHolder.siblings().removeClass('qode-showcase-active qode-current'); 9750 thisHolder.addClass('qode-showcase-active qode-current'); 9751 currentItem = thisShowcase.find('.qode-current').index(); //reset current loop item to latest hovered item 9752 } 9753 }); 9754 }); 9755 9756 //loop through the items 9757 function showcaseLoop() { 9758 currentItem = 0; //start from the first item, index = 0 9759 9760 var loop = setInterval(function(){ 9761 if (!isPaused) { 9762 iconHolders.removeClass('qode-showcase-active qode-current'); 9763 if(currentItem == numberOfItems -1){ 9764 currentItem = 0; 9765 }else{ 9766 currentItem++; 9767 } 9768 iconHolders.eq(currentItem).addClass('qode-showcase-active'); 9769 } 9770 }, itemInterval); 9771 } 9772 }); 9773 } 9774} 9775 9776function qodeInitSendContactForm(){ 9777 "use strict"; 9778 9779 var forms = $j('.qode-contact-form-contact-template'); 9780 if(forms.length){ 9781 forms.each(function(){ 9782 9783 var form = $j(this); 9784 9785 form.on( 'submit', function(e) { 9786 e.preventDefault(); 9787 9788 var sendMail = true; 9789 form.find('.contact-error').remove(); 9790 form.parent().find('.contact-success').remove(); 9791 form.find('.requiredField').each(function() { 9792 9793 var inputField = $j(this); 9794 9795 if(jQuery.trim(inputField.val()) == '' || jQuery.trim(inputField.val()) == jQuery.trim(inputField.attr('placeholder'))){ 9796 inputField.parent().append('<strong class="contact-error">'+ form.data('required-message') +'</strong>'); 9797 inputField.addClass('inputError'); 9798 sendMail = false; 9799 } else { 9800 if(inputField.hasClass('email')) { //if hasClass('email') 9801 var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,6})?$/; 9802 if(!emailReg.test(jQuery.trim(inputField.val()))){ 9803 inputField.parent().append('<strong class="contact-error">'+ form.data('wrong-email-message') +'</strong>'); 9804 inputField.addClass('inputError'); 9805 sendMail = false; 9806 } 9807 } 9808 9809 } 9810 }); 9811 9812 9813 if(sendMail){ 9814 var form_data = form.serialize(); 9815 9816 var ajaxData = { 9817 action: 'bridge_core_send_contact_page_form', 9818 form_data : form_data, 9819 contact_page_nonce: form.find('#bridge_qode_contact_page_nonce').val() 9820 }; 9821 9822 $j.ajax({ 9823 type: 'POST', 9824 data: ajaxData, 9825 url: QodeAdminAjax.ajaxurl, 9826 success: function (data) { 9827 var response = JSON.parse(data); 9828 if(response.status == 'success'){ 9829 form.before('<div class="contact-success"><p>' + response.message + '</p></div>'); 9830 form.hide(); 9831 } else { 9832 form.before('<div class="contact-success"><p>' + response.message + '</p></div>'); 9833 } 9834 9835 } 9836 }); 9837 } 9838 9839 }); 9840 }); 9841 } 9842}function qodeRecaptchaCallback(){ 9843 "use strict"; 9844 9845 var element = $j('#qode-captcha-element-holder'); 9846 if(element.length) { 9847 grecaptcha.render('qode-captcha-element-holder', { 9848 'sitekey': element.data('sitekey') 9849 }); 9850 } 9851} 9852 9853/* 9854 * Animate Workflow shortcode 9855 */ 9856function qodeWorkflow() { 9857 var workflowShortcodes = $j('.qode-workflow'); 9858 if (workflowShortcodes.length) { 9859 workflowShortcodes.each(function () { 9860 var workflowShortcode = $j(this); 9861 if (workflowShortcode.hasClass('qode-workflow-animate')) { 9862 var workflowItems = workflowShortcode.find('.qode-workflow-item'); 9863 9864 workflowShortcode.appear(function () { 9865 workflowShortcode.addClass('qode-appeared'); 9866 setTimeout(function () { 9867 workflowItems.each(function (i) { 9868 var workflowItem = $j(this); 9869 setTimeout(function () { 9870 workflowItem.addClass('qode-appeared'); 9871 }, 350 * i); 9872 }); 9873 }, 350); 9874 }
9874, {accX: 0, accY: -($window_height / 3)}); 9875 9876 } 9877 }); 9878 } 9879} 9880 9881/** 9882 * Initializes load more data params 9883 * @param container with defined data params 9884 * return array 9885 */ 9886function getLoadMoreData(container){ 9887 var dataList = container.data(), 9888 returnValue = {}; 9889 9890 for (var property in dataList) { 9891 if (dataList.hasOwnProperty(property)) { 9892 if (typeof dataList[property] !== 'undefined' && dataList[property] !== false) { 9893 returnValue[property] = dataList[property]; 9894 } 9895 } 9896 } 9897 9898 return returnValue; 9899} 9900 9901/** 9902 * Sets load more data params for ajax function 9903 * @param container with defined data params 9904 * return array 9905 */ 9906function setLoadMoreAjaxData(container, action){ 9907 var returnValue = { 9908 action: action 9909 }; 9910 9911 for (var property in container) { 9912 if (container.hasOwnProperty(property)) { 9913 9914 if (typeof container[property] !== 'undefined' && container[property] !== false) { 9915 returnValue[property] = container[property]; 9916 } 9917 } 9918 } 9919 9920 return returnValue; 9921} 9922 9923/** 9924 * Init Owl Carousel 9925 */ 9926function qodeOwlSlider() { 9927 var sliders = $j('.qode-owl-slider'); 9928 9929 if (sliders.length) { 9930 sliders.each(function(){ 9931 var slider = $j(this), 9932 slideItemsNumber = slider.children().length, 9933 numberOfItems = 1, 9934 loop = true, 9935 autoplay = true, 9936 autoplayHoverPause = true, 9937 sliderSpeed = 5000, 9938 sliderSpeedAnimation = 600, 9939 margin = 0, 9940 responsiveMargin = 0, 9941 stagePadding = 0, 9942 stagePaddingEnabled = false, 9943 center = false, 9944 autoWidth = false, 9945 animateInClass = false, // keyframe css animation 9946 animateOut = false, // keyframe css animation 9947 navigation = true, 9948 pagination = false, 9949 sliderIsPortfolio = !!slider.hasClass('qode-pl-is-slider'), 9950 sliderDataHolder = sliderIsPortfolio ? slider.parent() : slider; // this is condition for portfolio slider 9951 9952 if (typeof slider.data('number-of-items') !== 'undefined' && slider.data('number-of-items') !== false && !sliderIsPortfolio) { 9953 numberOfItems = slider.data('number-of-items'); 9954 } 9955 if (typeof sliderDataHolder.data('number-of-columns') !== 'undefined' && sliderDataHolder.data('number-of-columns') !== false && sliderIsPortfolio) { 9956 numberOfItems = sliderDataHolder.data('number-of-columns'); 9957 } 9958 if (sliderDataHolder.data('enable-loop') === 'no') { 9959 loop = false; 9960 } 9961 if (sliderDataHolder.data('enable-autoplay') === 'no') { 9962 autoplay = false; 9963 } 9964 if (sliderDataHolder.data('enable-autoplay-hover-pause') === 'no') { 9965 autoplayHoverPause = false; 9966 } 9967 if (typeof sliderDataHolder.data('slider-speed') !== 'undefined' && sliderDataHolder.data('slider-speed') !== false) { 9968 sliderSpeed = sliderDataHolder.data('slider-speed'); 9969 } 9970 if (typeof sliderDataHolder.data('slider-speed-animation') !== 'undefined' && sliderDataHolder.data('slider-speed-animation') !== false) { 9971 sliderSpeedAnimation = sliderDataHolder.data('slider-speed-animation'); 9972 } 9973 if (typeof sliderDataHolder.data('slider-margin') !== 'undefined' && sliderDataHolder.data('slider-margin') !== false) { 9974 margin = sliderDataHolder.data('slider-margin'); 9975 } 9976 if(slider.parent().hasClass('qode-huge-space')) { 9977 margin = 60; 9978 } else if (slider.parent().hasClass('qode-large-space')) { 9979 margin = 50; 9980 } else if (slider.parent().hasClass('qode-medium-space')) { 9981 margin = 40; 9982 } else if(slider.parent().hasClass('qode-normal-space')) { 9983 margin = 30; 9984 } else if (slider.parent().hasClass('qode-small-space')) { 9985 margin = 20; 9986 } else if (slider.parent().hasClass('qode-tiny-space')) { 9987 margin = 10; 9988 } 9989 if (sliderDataHolder.data('slider-padding') === 'yes') { 9990 stagePaddingEnabled = true; 9991 stagePadding = parseInt(slider.outerWidth() * 0.28); 9992 margin = 50; 9993 } 9994 if (sliderDataHolder.data('enable-center') === 'yes') { 9995 center = true; 9996 } 9997 if (sliderDataHolder.data('enable-auto-width') === 'yes') { 9998 autoWidth = true; 9999 } 10000 if (typeof sliderDataHolder.data('slider-animate-in') !== 'undefined' && sliderDataHolder.data('slider-animate-in') !== false) { 10001 animateInClass = sliderDataHolder.data('slider-animate-in'); 10002 } 10003 if (typeof sliderDataHolder.data('slider-animate-out') !== 'undefined' && sliderDataHolder.data('slider-animate-out') !== false) { 10004 animateOut = sliderDataHolder.data('slider-animate-out'); 10005 } 10006 if (sliderDataHolder.data('enable-navigation') === 'no') { 10007 navigation = false;
10008 } 10009 if (sliderDataHolder.data('enable-pagination') === 'yes') { 10010 pagination = true; 10011 } 10012 10013 if(navigation && pagination) { 10014 slider.addClass('qode-slider-has-both-nav'); 10015 } 10016 10017 if (slideItemsNumber <= 1) { 10018 loop = false; 10019 autoplay = false; 10020 navigation = false; 10021 pagination = false; 10022 } 10023 10024 var responsiveNumberOfItems1 = 1, 10025 responsiveNumberOfItems2 = 2, 10026 responsiveNumberOfItems3 = 3, 10027 responsiveNumberOfItems4 = numberOfItems; 10028 10029 if (numberOfItems < 3) { 10030 responsiveNumberOfItems2 = numberOfItems; 10031 responsiveNumberOfItems3 = numberOfItems; 10032 } 10033 10034 if (numberOfItems > 4) { 10035 responsiveNumberOfItems4 = 4; 10036 } 10037 10038 if (stagePaddingEnabled || margin > 0) { 10039 responsiveMargin = 20; 10040 } 10041 10042 slider.owlCarousel({ 10043 items: numberOfItems, 10044 loop: loop, 10045 autoplay: autoplay, 10046 autoplayHoverPause: autoplayHoverPause, 10047 autoplayTimeout: sliderSpeed, 10048 smartSpeed: sliderSpeedAnimation, 10049 margin: margin, 10050 stagePadding: stagePadding, 10051 center: center, 10052 autoWidth: autoWidth, 10053 animateInClass: animateInClass, 10054 animateOut: animateOut, 10055 dots: pagination, 10056 nav: navigation, 10057 navText: [ 10058 '<span class="qode-prev-icon fa fa-angle-left"></span>', 10059 '<span class="qode-next-icon fa fa-angle-right"></span>' 10060 ], 10061 responsive: { 10062 0: { 10063 items: responsiveNumberOfItems1, 10064 margin: responsiveMargin, 10065 stagePadding: 0, 10066 center: false, 10067 autoWidth: false 10068 }, 10069 681: { 10070 items: responsiveNumberOfItems2 10071 }, 10072 769: { 10073 items: responsiveNumberOfItems3 10074 }, 10075 1025: { 10076 items: responsiveNumberOfItems4 10077 }, 10078 1281: { 10079 items: numberOfItems 10080 } 10081 }, 10082 onInitialize: function () { 10083 slider.css('visibility', 'visible'); 10084 }, 10085 onChanged: function () { 10086 if(slider.parent().length && slider.parent().hasClass('qode-image-behavior-lightbox')){ 10087 prettyPhoto(); 10088 } 10089 } 10090 }); 10091 10092 }); 10093 } 10094} 10095 10096 10097/** 10098* Scrolling Image Shortcode 10099*/ 10100function qodeScrollingImage() { 10101 var scrollingImageShortcodes = $j('.qode-scrolling-image-holder'); 10102 10103 if (scrollingImageShortcodes.length) { 10104 scrollingImageShortcodes.each(function(){ 10105 var scrollingImageShortcode = $j(this), 10106 scrollingImageContentHolder = scrollingImageShortcode.find('.qode-si-content-holder'), 10107 scrollingFrame = scrollingImageShortcode.find('.qode-si-frame'), 10108 scrollingFrameHeight, 10109 scrollingImage = scrollingImageShortcode.find('.qode-si-image'), 10110 scrollingImageHeight, 10111 delta, 10112 timing, 10113 scrollable = false; 10114 10115 var sizing = function() { 10116 scrollingFrameHeight = scrollingFrame.height(); 10117 scrollingImageHeight = scrollingImage.height(); 10118 delta = Math.round(scrollingImageHeight - scrollingFrameHeight); 10119 timing = Math.round(scrollingImageHeight/scrollingFrameHeight)*2; 10120 10121 if (scrollingImageHeight > scrollingFrameHeight) { 10122 scrollable = true; 10123 } 10124 } 10125 10126 var scrollAnimation = function() { 10127 //scroll animation on hover 10128 scrollingImageContentHolder.mouseenter(function(){ 10129 scrollingImage.css('transition-duration',timing+'s'); //transition duration set in relation to image height 10130 scrollingImage.css('transform', 'translate3d(0px, -'+delta+'px, 0px)'); 10131 }); 10132 10133 //scroll animation reset 10134 scrollingImageContentHolder.mouseleave(function(){ 10135 if (scrollable) { 10136 scrollingImage.css('transition-duration', Math.min(timing/3, 3) +'s'); 10137 scrollingImage.css('transform', 'translate3d(0px, 0px, 0px)'); 10138 } 10139 }); 10140 }; 10141 10142 //init 10143 scrollingImageShortcode.waitForImages(function(){ 10144 scrollingImageShortcode.css('visibility', 'visible');
10145 sizing(); 10146 scrollAnimation(); 10147 }); 10148 10149 $j(window).resize(function(){ 10150 sizing(); 10151 }); 10152 }); 10153 } 10154} 10155 10156/* 10157* Defines Animation End event 10158*/ 10159function animationEventEnd(){ 10160 var el = document.createElement("animationDetector"); 10161 10162 var animations = { 10163 "animation" : "animationend", 10164 "OAnimation" : "oAnimationEnd", 10165 "MozAnimation" : "animationend", 10166 "WebkitAnimation": "webkitAnimationEnd" 10167 } 10168 10169 for (var t in animations){ 10170 if (el.style[t] !== undefined){ 10171 return animations[t]; 10172 } 10173 } 10174} 10175 10176/* 10177* Defines Transition End event 10178*/ 10179function transitionEventEnd() { 10180 var el = document.createElement('transitionDetector'), 10181 transEndEventNames = { 10182 'WebkitTransition' : 'webkitTransitionEnd',// Saf 6, Android Browser 10183 'MozTransition' : 'transitionend', // only for FF < 15 10184 'transition' : 'transitionend' // IE10, Opera, Chrome, FF 15+, Saf 7+ 10185 }; 10186 10187 for(var t in transEndEventNames){ 10188 if( el.style[t] !== undefined ){ 10189 return transEndEventNames[t]; 10190 } 10191 } 10192} 10193 10194function qodeCustomFontTypeOut() { 10195 var qodeTyped = $j('.qode-cf-typed'); 10196 10197 if (qodeTyped.length) { 10198 qodeTyped.each(function () { 10199 10200 //vars 10201 var thisTyped = $j(this), 10202 typedWrap = thisTyped.parent('.qode-cf-typed-wrap'), 10203 customFontHolder = typedWrap.parent('.custom_font_holder'), 10204 str = [], 10205 strings = thisTyped.find('.qode-cf-typed'); 10206 10207 if (strings.length) { 10208 strings.each(function () { 10209 str.push($j(this).text()); 10210 }); 10211 10212 } 10213 10214 customFontHolder.appear(function () { 10215 thisTyped.typed({ 10216 strings: str, 10217 typeSpeed: 90, 10218 backDelay: 700, 10219 loop: true, 10220 contentType: 'text', 10221 loopCount: false, 10222 cursorChar: '_' 10223 }); 10224 }, {accX: 0, accY: 200}); 10225 }); 10226 } 10227} 10228 10229function qodeContactPageAcceptance(){ 10230 var contact_page_form = $j('.qode-contact-form-contact-template'), 10231 acceptance = contact_page_form.find('.contact_form_acceptance .contact_form_acceptance_value'), 10232 submitButton = contact_page_form.find('.contact_form_button'); 10233 10234 if(acceptance.length){ 10235 acceptance.each(function(){ 10236 var thisSelector = $j(this); 10237 submitButton.attr('disabled','disabled'); 10238 10239 thisSelector.change(function(){ 10240 if (thisSelector.is(':checked')){ 10241 submitButton.removeAttr('disabled'); 10242 } 10243 else{ 10244 submitButton.attr('disabled','disabled'); 10245 } 10246 }); 10247 10248 }) 10249 } 10250} 10251 10252function qodePanelArea(){ 10253 var panel = $j('.qode-panel-area'), 10254 panelOpener = $j('a.qode_panel_area_opener'), 10255 panelClose = $j('.qode-close-panel'), 10256 wrapper = $j('.wrapper'); 10257 10258 var disableScroll = function () { 10259 if( typeof smoothScrollListener !== 'undefined' ) { 10260 window.removeEventListener('mousewheel', smoothScrollListener, {passive:false}); 10261 window.removeEventListener('DOMMouseScroll', smoothScrollListener, {passive:false}); 10262 } 10263 }; 10264 10265 var enableScroll = function () { 10266 if( typeof smoothScrollListener !== 'undefined' ) { 10267 window.addEventListener('mousewheel', smoothScrollListener, {passive:false}); 10268 window.addEventListener('DOMMouseScroll', smoothScrollListener, {passive:false}); 10269 } 10270 }; 10271 10272 if( panel.outerHeight() >= $window_height ){ 10273 panel.height($window_height); 10274 } 10275 10276 panel.niceScroll({ 10277 scrollspeed: 30, 10278 mousescrollstep: 20, 10279 cursorwidth: 0, 10280 cursorborder: 0, 10281 cursorborderradius: 0, 10282 cursorcolor: "transparent", 10283 autohidemode: false, 10284 horizrailenabled: false 10285 }); 10286 10287 var closePanel = function() { 10288 if (qode_body.hasClass('qode-panel-area-opened')) { 10289 qode_body.removeClass('qode-panel-area-opened'); 10290 } 10291 } 10292 10293 var openPanel = function() { 10294 if (!qode_body.hasClass('qode-panel-area-opened')) { 10295 qode_body.addClass('qode-panel-area-opened'); 10296 10297 } 10298 } 10299 10300 panelOpener.on( 'click', function(e) { 10301 e.preventDefault(); 10302 e.stopPropagation(); 10303 10304 if( qode_body.hasClass('qode-panel-area-opened') ){ 10305 closePanel(); 10306 } else{
10307 openPanel(); 10308 } 10309 10310 }); 10311 10312 panelClose.on( 'click', function(e) { 10313 e.preventDefault(); 10314 closePanel(); 10315 }); 10316 10317 wrapper.on('click', function(e){ 10318 if( qode_body.hasClass('qode-panel-area-opened') ){ 10319 closePanel(); 10320 } 10321 }); 10322} 10323 10324(function($) { 10325 'use strict'; 10326 10327 var elementorGlobal = {}; 10328 qode.modules.elementorGlobal = elementorGlobal; 10329 10330 elementorGlobal.qodeInitElementorGlobal = qodeInitElementorGlobal; 10331 10332 10333 elementorGlobal.qodeOnWindowLoad = qodeOnWindowLoad; 10334 10335 $(window).on('load', qodeOnWindowLoad); 10336 10337 /* 10338 ** All functions to be called on $(window).load() should be in this function 10339 */ 10340 function qodeOnWindowLoad() { 10341 qodeInitElementorGlobal(); 10342 } 10343 10344 function qodeInitElementorGlobal(){ 10345 $j(window).on('elementor/frontend/init', function () { 10346 elementorFrontend.hooks.addAction( 'frontend/element_ready/global', function() { 10347 initParallax(); 10348 initElementorParallaxFX(); 10349 initFullScreenTemplate(); 10350 qodeInitStickyWidget(); 10351 } ); 10352 }); 10353 } 10354 10355 function initElementorParallaxFX(){ 10356 var parallaxSection = $('.parallax_section_holder'); 10357 10358 if( parallaxSection.length ){ 10359 parallaxSection.each(function(){ 10360 var parallaxElement = $(this), 10361 parallaxSpeedHolder = parallaxElement.find('.qode-parallax-helper-holder'), 10362 parallaxSpeed = 1; 10363 10364 if( parallaxSpeedHolder.length && typeof parallaxSpeedHolder.data('speed') !== 'undefined' && parallaxSpeedHolder.data('speed') !== '' ){ 10365 parallaxSpeed = parallaxSpeedHolder.data('speed'); 10366 } 10367 10368 parallaxElement.parallax("50%", parallaxSpeed * 0.4); 10369 }) 10370 } 10371 } 10372 10373})(jQuery); 10374(function($) { 10375 'use strict'; 10376 10377 var elementorAction = {}; 10378 qode.modules.elementorAction = elementorAction; 10379 10380 elementorAction.qodeInitElementorAction = qodeInitElementorAction; 10381 10382 10383 elementorAction.qodeOnWindowLoad = qodeOnWindowLoad; 10384 10385 $(window).on('load', qodeOnWindowLoad); 10386 10387 /* 10388 ** All functions to be called on $(window).load() should be in this function 10389 */ 10390 function qodeOnWindowLoad() { 10391 qodeInitElementorAction(); 10392 } 10393 10394 function qodeInitElementorAction(){ 10395 $j(window).on('elementor/frontend/init', function () { 10396 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_action.default', function() { 10397 initButtonHover(); 10398 } ); 10399 }); 10400 10401 $j(window).on('elementor/frontend/init', function () { 10402 elementorFrontend.hooks.addAction( 'frontend/element_ready/global', function() { 10403 initParallax(); 10404 initElementorParallaxFX(); 10405 initFullScreenTemplate(); 10406 } ); 10407 }); 10408 } 10409 10410 function initElementorParallaxFX(){ 10411 var parallaxSection = $('.parallax_section_holder'); 10412 10413 if( parallaxSection.length ){ 10414 parallaxSection.each(function(){ 10415 var parallaxElement = $(this), 10416 parallaxSpeedHolder = parallaxElement.find('.qode-parallax-helper-holder'), 10417 parallaxSpeed = 1; 10418 10419 if( parallaxSpeedHolder.length && typeof parallaxSpeedHolder.data('speed') !== 'undefined' && parallaxSpeedHolder.data('speed') !== '' ){ 10420 parallaxSpeed = parallaxSpeedHolder.data('speed'); 10421 } 10422 10423 parallaxElement.parallax("50%", parallaxSpeed * 0.4); 10424 }) 10425 } 10426 } 10427 10428})(jQuery); 10429(function($) { 10430 'use strict'; 10431 10432 var elementorAnimationHolder = {}; 10433 qode.modules.elementorAnimationHolder = elementorAnimationHolder; 10434 10435 elementorAnimationHolder.qodeInitElementorAnimationHolder = qodeInitElementorAnimationHolder; 10436 10437 10438 elementorAnimationHolder.qodeOnWindowLoad = qodeOnWindowLoad; 10439 10440 $(window).on('load', qodeOnWindowLoad); 10441 10442 /* 10443 ** All functions to be called on $(window).load() should be in this function 10444 */ 10445 function qodeOnWindowLoad() { 10446 qodeInitElementorAnimationHolder(); 10447 } 10448 10449 function qodeInitElementorAnimationHolder(){ 10450 $j(window).on('elementor/frontend/init', function () { 10451 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_animation_holder.default', function() { 10452 initElementsAnimation(); 10453 } ); 10454 }); 10455 } 10456 10457})(jQuery); 10458(function($) { 10459 'use strict'; 10460 10461 var elementorBlogSlider = {}; 10462 qode.modules.elementorBlogSlider = elementorBlogSlider; 10463 10464 elementorBlogSlider.qodeInitElementorBlogSlider = qodeInitElementorBlogSlider; 10465 10466 10467 elementorBlogSlider.qodeOnWindowLoad = qodeOnWindowLoad; 10468 10469 $(window).on('load', qodeOnWindowLoad); 10470 10471 /* 10472 ** All functions to be called on $(window).load() should be in this function 10473 */ 10474 function qodeOnWindowLoad() { 10475 qodeInitElementorBlogSlider(); 10476 } 10477 10478 function qodeInitElementorBlogSlider(){ 10479 $j(window).on('elementor/frontend/init', function () { 10480 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_blog_slider.default', function() { 10481 initBlogSlider(); 10482 } ); 10483 }); 10484 } 10485 10486})(jQuery); 10487(function($) { 10488 'use strict'; 10489 10490 var elementorButton = {}; 10491 qode.modules.elementorButton = elementorButton; 10492 10493 elementorButton.qodeInitElementorButton = qodeInitElementorButton; 10494 10495 10496 elementorButton.qodeOnWindowLoad = qodeOnWindowLoad; 10497 10498 $(window).on('load', qodeOnWindowLoad); 10499 10500 /* 10501 ** All functions to be called on $(window).load() should be in this function 10502 */ 10503 function qodeOnWindowLoad() { 10504 qodeInitElementorButton(); 10505 } 10506 10507 function qodeInitElementorButton(){ 10508 $j(window).on('elementor/frontend/init', function () { 10509 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_button.default', function() { 10510 initButtonHover(); 10511 initEnlargeButton(); 10512 } ); 10513 }); 10514 } 10515 10516})(jQuery); 10517(function($) { 10518 'use strict'; 10519 10520 var elementorCarousel = {}; 10521 qode.modules.elementorCarousel = elementorCarousel; 10522 10523 elementorCarousel.qodeInitElementorCarousel = qodeInitElementorCarousel; 10524 10525 10526 elementorCarousel.qodeOnWindowLoad = qodeOnWindowLoad; 10527 10528 $(window).on('load', qodeOnWindowLoad); 10529 10530 /* 10531 ** All functions to be called on $(window).load() should be in this function 10532 */ 10533 function qodeOnWindowLoad() { 10534 qodeInitElementorCarousel(); 10535 } 10536 10537 function qodeInitElementorCarousel(){ 10538 $j(window).on('elementor/frontend/init', function () { 10539 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_carousel.default', function() { 10540 initQodeCarousel(); 10541 calculateHeights(); 10542 } ); 10543 }); 10544 } 10545 10546})(jQuery); 10547(function($) { 10548 'use strict'; 10549 10550 var elementorContentSlider = {}; 10551 qode.modules.elementorContentSlider = elementorContentSlider; 10552 10553 elementorContentSlider.qodeInitElementorContentSlider = qodeInitElementorContentSlider; 10554 10555 10556 elementorContentSlider.qodeOnWindowLoad = qodeOnWindowLoad; 10557 10558 $(window).on('load', qodeOnWindowLoad); 10559 10560 /* 10561 ** All functions to be called on $(window).load() should be in this function 10562 */ 10563 function qodeOnWindowLoad() { 10564 qodeInitElementorContentSlider(); 10565 } 10566 10567 function qodeInitElementorContentSlider(){ 10568 $j(window).on('elementor/frontend/init', function () { 10569 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_content_slider.default', function() { 10570 initContentSlider(); 10571 } ); 10572 }); 10573 } 10574 10575})(jQuery); 10576(function($) { 10577 'use strict'; 10578 10579 var elementorCountdown = {}; 10580 qode.modules.elementorCountdown = elementorCountdown; 10581 10582 elementorCountdown.qodeInitElementorCountdown = qodeInitElementorCountdown; 10583 10584 10585 elementorCountdown.qodeOnWindowLoad = qodeOnWindowLoad; 10586 10587 $(window).on('load', qodeOnWindowLoad); 10588 10589 /* 10590 ** All functions to be called on $(window).load() should be in this function 10591 */ 10592 function qodeOnWindowLoad() { 10593 qodeInitElementorCountdown(); 10594 } 10595 10596 function qodeInitElementorCountdown(){ 10597 $j(window).on('elementor/frontend/init', function () { 10598 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_countdown.default', function() { 10599 initCountdown(); 10600 } ); 10601 }); 10602 } 10603 10604})(jQuery); 10605(function($) { 10606 'use strict'; 10607 10608 var elementorCounter = {}; 10609 qode.modules.elementorCounter = elementorCounter; 10610 10611 elementorCounter.qodeInitElementorCounter = qodeInitElementorCounter; 10612 10613 10614 elementorCounter.qodeOnWindowLoad = qodeOnWindowLoad; 10615 10616 $(window).on('load', qodeOnWindowLoad); 10617 10618 /* 10619 ** All functions to be called on $(window).load() should be in this function 10620 */ 10621 function qodeOnWindowLoad() { 10622 qodeInitElementorCounter(); 10623 } 10624 10625 function qodeInitElementorCounter(){ 10626 $j(window).on('elementor/frontend/init', function () { 10627 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_counter.default', function() { 10628 initToCounter(); 10629 initCounter(); 10630 } ); 10631 }); 10632 } 10633 10634 10635})(jQuery); 10636(function($) { 10637 'use strict'; 10638 10639 var elementorCoverBoxes = {}; 10640 qode.modules.elementorCoverBoxes = elementorCoverBoxes; 10641 10642 elementorCoverBoxes.qodeInitElementorCoverBoxes = qodeInitElementorCoverBoxes; 10643 10644 10645 elementorCoverBoxes.qodeOnWindowLoad = qodeOnWindowLoad; 10646 10647 $(window).on('load', qodeOnWindowLoad); 10648 10649 /* 10650 ** All functions to be called on $(window).load() should be in this function 10651 */ 10652 function qodeOnWindowLoad() { 10653 qodeInitElementorCoverBoxes(); 10654 } 10655 10656 function qodeInitElementorCoverBoxes(){ 10657 $j(window).on('elementor/frontend/init', function () { 10658 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_cover_boxes.default', function() { 10659 initCoverBoxes(); 10660 } ); 10661 }); 10662 } 10663 10664})(jQuery); 10665(function($) { 10666 'use strict'; 10667 10668 var elementorCustomFont = {}; 10669 qode.modules.elementorCustomFont = elementorCustomFont; 10670 10671 elementorCustomFont.qodeInitElementorCustomFont = qodeInitElementorCustomFont; 10672 10673 10674 elementorCustomFont.qodeOnWindowLoad = qodeOnWindowLoad; 10675 10676 $(window).on('load', qodeOnWindowLoad); 10677 10678 /* 10679 ** All functions to be called on $(window).load() should be in this function 10680 */ 10681 function qodeOnWindowLoad() { 10682 qodeInitElementorCustomFont(); 10683 } 10684 10685 function qodeInitElementorCustomFont(){ 10686 $j(window).on('elementor/frontend/init', function () { 10687 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_custom_font.default', function() { 10688 qodeCustomFontTypeOut(); 10689 } ); 10690 }); 10691 } 10692 10693})(jQuery); 10694(function($) { 10695 'use strict'; 10696 10697 var elementorExpandingImages = {}; 10698 qode.modules.elementorExpandingImages = elementorExpandingImages; 10699 10700 elementorExpandingImages.qodeInitElementorExpandingImages = qodeInitElementorExpandingImages; 10701 10702 10703 elementorExpandingImages.qodeOnWindowLoad = qodeOnWindowLoad; 10704 10705 $(window).on('load', qodeOnWindowLoad); 10706 10707 /* 10708 ** All functions to be called on $(window).load() should be in this function 10709 */ 10710 function qodeOnWindowLoad() { 10711 qodeInitElementorExpandingImages(); 10712 } 10713 10714 function qodeInitElementorExpandingImages(){ 10715 $j(window).on('elementor/frontend/init', function () { 10716 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_expanding_images.default', function() { 10717 initExpandingImages(); 10718 } ); 10719 }); 10720 } 10721 10722})(jQuery); 10723(function($) { 10724 'use strict'; 10725 10726 var elementorFullscreenSections = {}; 10727 qode.modules.elementorFullscreenSections = elementorFullscreenSections; 10728 10729 elementorFullscreenSections.qodeInitElementorFullscreenSections = qodeInitElementorFullscreenSections; 10730 10731 10732 elementorFullscreenSections.qodeOnWindowLoad = qodeOnWindowLoad; 10733 10734 $(window).on('load', qodeOnWindowLoad); 10735 10736 /* 10737 ** All functions to be called on $(window).load() should be in this function 10738 */ 10739 function qodeOnWindowLoad() { 10740 qodeInitElementorFullscreenSections(); 10741 } 10742 10743 function qodeInitElementorFullscreenSections(){ 10744 $j(window).on('elementor/frontend/init', function () { 10745 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_fullscreen_sections.default', function() { 10746 initFullScreenTemplate(); 10747 } ); 10748 }); 10749 } 10750 10751})(jQuery); 10752(function($) { 10753 'use strict'; 10754 10755 var elementorGoogleMap = {}; 10756 qode.modules.elementorGoogleMap = elementorGoogleMap; 10757 10758 elementorGoogleMap.qodeInitElementorGoogleMap = qodeInitElementorGoogleMap; 10759 10760 10761 elementorGoogleMap.qodeOnWindowLoad = qodeOnWindowLoad; 10762 10763 $(window).on('load', qodeOnWindowLoad ); 10764 10765 /* 10766 ** All functions to be called on $(window).load() should be in this function 10767 */ 10768 function qodeOnWindowLoad() { 10769 qodeInitElementorGoogleMap(); 10770 } 10771 10772 function qodeInitElementorGoogleMap(){ 10773 $j(window).on('elementor/frontend/init', function () { 10774 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_google_map.default', function() { 10775 showGoogleMap(); 10776 } ); 10777 }); 10778 } 10779 10780})(jQuery); 10781(function($) { 10782 'use strict'; 10783 10784 var elementorHorizontalMarquee = {}; 10785 qode.modules.elementorHorizontalMarquee = elementorHorizontalMarquee; 10786 10787 elementorHorizontalMarquee.qodeInitElementorHorizontalMarquee = qodeInitElementorHorizontalMarquee; 10788 10789 10790 elementorHorizontalMarquee.qodeOnWindowLoad = qodeOnWindowLoad; 10791 10792 $(window).on('load', qodeOnWindowLoad ); 10793 10794 /* 10795 ** All functions to be called on $(window).load() should be in this function 10796 */ 10797 function qodeOnWindowLoad() { 10798 qodeInitElementorHorizontalMarquee(); 10799 } 10800 10801 function qodeInitElementorHorizontalMarquee(){ 10802 $j(window).on('elementor/frontend/init', function () { 10803 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_horizontal_marquee.default', function() { 10804 initHorizontalMarquee(); 10805 qodeHorizontalMarqueeLoop(); 10806 } ); 10807 }); 10808 } 10809 10810})(jQuery); 10811(function($) { 10812 'use strict'; 10813 10814 var elementorIcon = {}; 10815 qode.modules.elementorIcon = elementorIcon; 10816 10817 elementorIcon.qodeInitElementorIcon = qodeInitElementorIcon; 10818 10819 10820 elementorIcon.qodeOnWindowLoad = qodeOnWindowLoad; 10821 10822 $(window).on('load', qodeOnWindowLoad ); 10823 10824 /* 10825 ** All functions to be called on $(window).load() should be in this function 10826 */ 10827 function qodeOnWindowLoad() { 10828 qodeInitElementorIcon(); 10829 } 10830 10831 function qodeInitElementorIcon(){ 10832 $j(window).on('elementor/frontend/init', function () { 10833 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_icon.default', function() { 10834 initIconShortcodeHover(); 10835 initIconWithTextAnimation(); 10836 } ); 10837 }); 10838 } 10839 10840})(jQuery); 10841(function($) { 10842 'use strict'; 10843 10844 var elementorIconText = {}; 10845 qode.modules.elementorIconText = elementorIconText; 10846 10847 elementorIconText.qodeInitElementorIconText = qodeInitElementorIconText; 10848 10849 10850 elementorIconText.qodeOnWindowLoad = qodeOnWindowLoad; 10851 10852 $(window).on('load', qodeOnWindowLoad ); 10853 10854 /* 10855 ** All functions to be called on $(window).load() should be in this function 10856 */ 10857 function qodeOnWindowLoad() { 10858 qodeInitElementorIconText(); 10859 } 10860 10861 function qodeInitElementorIconText(){ 10862 $j(window).on('elementor/frontend/init', function () { 10863 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_icon_text.default', function() { 10864 initIconWithTextHover(); 10865 initIconShortcodeHover(); 10866 initIconWithTextAnimation(); 10867 } ); 10868 }); 10869 } 10870 10871})(jQuery); 10872(function($) { 10873 'use strict'; 10874 10875 var elementorImageGallery = {}; 10876 qode.modules.elementorImageGallery = elementorImageGallery; 10877 10878 elementorImageGallery.qodeInitElementorImageGallery = qodeInitElementorImageGallery; 10879 10880 10881 elementorImageGallery.qodeOnWindowLoad = qodeOnWindowLoad; 10882 10883 $(window).on('load', q
10883odeOnWindowLoad ); 10884 10885 /* 10886 ** All functions to be called on $(window).load() should be in this function 10887 */ 10888 function qodeOnWindowLoad() { 10889 qodeInitElementorImageGallery(); 10890 } 10891 10892 function qodeInitElementorImageGallery(){ 10893 $j(window).on('elementor/frontend/init', function () { 10894 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_image_gallery.default', function() { 10895 initFlexSlider(); 10896 } ); 10897 }); 10898 } 10899 10900})(jQuery); 10901(function($) { 10902 'use strict'; 10903 10904 var elementorImageHover = {}; 10905 qode.modules.elementorImageHover = elementorImageHover; 10906 10907 elementorImageHover.qodeInitElementorImageHover = qodeInitElementorImageHover; 10908 10909 10910 elementorImageHover.qodeOnWindowLoad = qodeOnWindowLoad; 10911 10912 $(window).on('load', qodeOnWindowLoad ); 10913 10914 /* 10915 ** All functions to be called on $(window).load() should be in this function 10916 */ 10917 function qodeOnWindowLoad() { 10918 qodeInitElementorImageHover(); 10919 } 10920 10921 function qodeInitElementorImageHover(){ 10922 $j(window).on('elementor/frontend/init', function () { 10923 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_image_hover.default', function() { 10924 initImageHover(); 10925 } ); 10926 }); 10927 } 10928 10929})(jQuery); 10930(function($) { 10931 'use strict'; 10932 10933 var elementorImageSliderNoSpace = {}; 10934 qode.modules.elementorImageSliderNoSpace = elementorImageSliderNoSpace; 10935 10936 elementorImageSliderNoSpace.qodeInitElementorImageSliderNoSpace = qodeInitElementorImageSliderNoSpace; 10937 10938 10939 elementorImageSliderNoSpace.qodeOnWindowLoad = qodeOnWindowLoad; 10940 10941 $(window).on('load', qodeOnWindowLoad ); 10942 10943 /* 10944 ** All functions to be called on $(window).load() should be in this function 10945 */ 10946 function qodeOnWindowLoad() { 10947 qodeInitElementorImageSliderNoSpace(); 10948 } 10949 10950 function qodeInitElementorImageSliderNoSpace(){ 10951 $j(window).on('elementor/frontend/init', function () { 10952 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_image_slider_no_space.default', function() { 10953 initImageGallerySliderNoSpace() 10954 } ); 10955 }); 10956 } 10957 10958})(jQuery); 10959(function($) { 10960 'use strict'; 10961 10962 var elementorInDeviceSlider = {}; 10963 qode.modules.elementorInDeviceSlider = elementorInDeviceSlider; 10964 10965 elementorInDeviceSlider.qodeInitElementorInDeviceSlider = qodeInitElementorInDeviceSlider; 10966 10967 10968 elementorInDeviceSlider.qodeOnWindowLoad = qodeOnWindowLoad; 10969 10970 $(window).on('load', qodeOnWindowLoad ); 10971 10972 /* 10973 ** All functions to be called on $(window).load() should be in this function 10974 */ 10975 function qodeOnWindowLoad() { 10976 qodeInitElementorInDeviceSlider(); 10977 } 10978 10979 function qodeInitElementorInDeviceSlider(){ 10980 $j(window).on('elementor/frontend/init', function () { 10981 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_in_device_slider.default', function() { 10982 initInDeviceSlider(); 10983 } ); 10984 }); 10985 } 10986 10987})(jQuery); 10988(function($) { 10989 'use strict'; 10990 10991 $(window).on('load', qodeOnWindowLoad); 10992 10993 /* 10994 ** All functions to be called on $(window).load() should be in this function 10995 */ 10996 function qodeOnWindowLoad() { 10997 qodeInitElementorLineGraph(); 10998 } 10999 11000 function qodeInitElementorLineGraph(){ 11001 $(window).on('elementor/frontend/init', function () { 11002 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_line_graph.default', function() { 11003 qode.modules.lineGraph.qodeLineGraph(); 11004 } ); 11005 }); 11006 } 11007 11008})(jQuery); 11009 11010(function ($) { 11011 'use strict'; 11012 11013 var lineGraph = {}; 11014 qode.modules.lineGraph = lineGraph; 11015 11016 lineGraph.qodeLineGraph = qodeLineGraph; 11017 lineGraph.qodeOnDocumentReady = qodeOnDocumentReady; 11018 11019 $(document).ready(qodeOnDocumentReady); 11020 11021 /* 11022 All functions to be called on $(document).ready() should be in this function 11023 */ 11024 function qodeOnDocumentReady() { 11025 qodeLineGraph(); 11026 } 11027 11028 11029 function qodeLineGraph() { 11030 11031 var holder = $('.q_line_graf_holder'); 11032 11033 if (holder.length) { 11034 holder.each(function () { 11035 var lineGraph = $(this).find('.q_line_graf'), 11036 canvasLineGraph = lineGraph.find('canvas'); 11037 11038 var scaleStepWidth = typeof lineGraph.data('scale-step-width') !== 'undefined' ? lineGraph.data('scale-step-width') : {}, 11039 scaleSteps = typeof lineGraph.data('scale-steps') !== 'undefined' ? lineGraph.data('scale-steps') : {}, 11040 bezierCurve = typeof lineGraph.data('bezier-curve') !== 'undefined' ? lineGraph.data('bezier-curve') : {}, 11041 scaleFontColor = typeof lineGraph.data('scale-font-color') !== 'undefined' ? lineGraph.data('scale-font-color') : {}, 11042 scaleFontSize = typeof lineGraph.data('scale-font-size') !== 'undefined' ? lineGraph.data('scale-font-size') : {}, 11043 values = typeof lineGraph.data('values') !== 'undefined' ? lineGraph.data('values') : {}, 11044 labels = typeof lineGraph.data('labels') !== 'undefined' ? lineGraph.data('labels') : {}, 11045 backgroundColors = typeof lineGraph.data('background-colors') !== 'undefined' ? lineGraph.data('background-colors') : {}; 11046 11047 var datasets = [];
11048 values.forEach( 11049 function ( item, index ) { 11050 var dataset_item = {}; 11051 dataset_item.data = values[index].split( ',' ); 11052 dataset_item.borderWidth = 1; 11053 dataset_item.pointRadius = 0; 11054 dataset_item.pointBorderWidth = 0; 11055 dataset_item.backgroundColor = backgroundColors[index]; 11056 dataset_item.cubicInterpolationMode = "default"; 11057 dataset_item.fill = true; 11058 11059 datasets.push( dataset_item ); 11060 } 11061 ); 11062 11063 var data = { 11064 type: 'line', 11065 data: { 11066 labels: labels, 11067 datasets: datasets 11068 }, 11069 options: { 11070 responsive: true, 11071 hover: { 11072 mode: 'nearest', 11073 intersect: true 11074 }, 11075 plugins: { 11076 legend: { 11077 display: false, 11078 }, 11079 tooltips: { 11080 enabled: false, 11081 }, 11082 }, 11083 scales: { 11084 x: { 11085 display: true, 11086 scaleLabel: { 11087 display: true 11088 }, 11089 gridLines:{ 11090 zeroLineColor: "#505050", 11091 drawOnChartArea: false 11092 }, 11093 ticks:{ 11094 color: scaleFontColor, 11095 font: { 11096 size: scaleFontSize, 11097 } 11098 } 11099 // barPercentage: barSize, 11100 // categoryPercentage: catSize, 11101 }, 11102 y: { 11103 display: true, 11104 scaleLabel: { 11105 display: true, 11106 }, 11107 gridLines:{ 11108 zeroLineColor: "#505050" 11109 }, 11110 ticks: { 11111 color: scaleFontColor, 11112 font: { 11113 size: scaleFontSize, 11114 }, 11115 stepSize: scaleStepWidth 11116 }, 11117 suggestedMax: scaleSteps*scaleStepWidth, 11118 } 11119 }, 11120 elements: { 11121 line: { 11122 tension: 0.4 // disables bezier curves 11123 } 11124 } 11125 } 11126 }; 11127 11128 var lineGraphObject = new Chart(canvasLineGraph[0].getContext('2d'), data); 11129 }); 11130 } 11131 } 11132 11133})(jQuery); 11134 11135(function($) { 11136 'use strict'; 11137 11138 var elementorMasonryBlog = {}; 11139 qode.modules.elementorMasonryBlog = elementorMasonryBlog; 11140 11141 elementorMasonryBlog.qodeInitElementorMasonryBlog = qodeInitElementorMasonryBlog; 11142 11143 11144 elementorMasonryBlog.qodeOnWindowLoad = qodeOnWindowLoad; 11145 11146 $(window).on('load', qodeOnWindowLoad ); 11147 11148 /* 11149 ** All functions to be called on $(window).load() should be in this function 11150 */ 11151 function qodeOnWindowLoad() { 11152 qodeInitElementorMasonryBlog(); 11153 } 11154 11155 function qodeInitElementorMasonryBlog(){ 11156 $j(window).on('elementor/frontend/init', function () { 11157 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_masonry_blog.default', function() { 11158 initQBlog(); 11159 } ); 11160 }); 11161 } 11162 11163})(jQuery); 11164(function($) { 11165 'use strict'; 11166 11167 var elementorMasonryGallery = {}; 11168 qode.modules.elementorMasonryGallery = elementorMasonryGallery; 11169 11170 elementorMasonryGallery.qodeInitElementorMasonryGallery = qodeInitElementorMasonryGallery; 11171 11172 11173 elementorMasonryGallery.qodeOnWindowLoad = qodeOnWindowLoad; 11174 11175 $(window).on('load', qodeOnWindowLoad ); 11176 11177 /* 11178 ** All functions to be called on $(window).load() should be in this function 11179 */ 11180 function qodeOnWindowLoad() { 11181 qodeInitElementorMasonryGallery(); 11182 } 11183 11184 function qodeInitElementorMasonryGallery(){ 11185 $j(window).on('elementor/frontend/init', function () { 11186 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_masonry_gallery.default', function() { 11187 initMasonryGallery(); 11188 } ); 11189 }); 11190 } 11191 11192})(jQuery); 11193(function($) { 11194 'use strict'; 11195 11196 var elementorMessage = {}; 11197 qode.modules.elementorMessage = elementorMessage; 11198 11199 elementorMessage.qodeInitElementorMessage = qodeInitElementorMessage; 11200 11201 11202 elementorMessage.qodeOnWindowLoad = qodeOnWindowLoad; 11203 11204 $(window).on('load', qodeOnWindowLoad ); 11205 11206 /* 11207 ** All functions to be called on $(window).load() should be in this function 11208 */ 11209 function qodeOnWindowLoad() { 11210 qodeInitElementorMessage(); 11211 } 11212 11213 function qodeInitElementorMessage(){ 11214 $j(window).on('elementor/frontend/init', function () { 11215 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_message.default', function() { 11216 initMessages(); 11217 initMessageHeight(); 11218 } ); 11219 }); 11220 } 11221 11222})(jQuery); 11223(function($) { 11224 'use strict'; 11225 11226 var elementorOldAccordion = {}; 11227 qode.modules.elementorOldAccordion = elementorOldAccordion; 11228 11229 elementorOldAccordion.qodeInitElementorOldAccordion = qodeInitElementorOldAccordion; 11230 11231 11232 elementorOldAccordion.qodeOnWindowLoad = qodeOnWindowLoad; 11233 11234 $(window).on('load', qodeOnWindowLoad ); 11235 11236 /* 11237 ** All functions to be called on $(window).load() should be in this function 11238 */ 11239 function qodeOnWindowLoad() { 11240 qodeInitElementorOldAccordion(); 11241 } 11242 11243 function qodeInitElementorOldAccordion(){ 11244 $j(window).on('elementor/frontend/init', function () { 11245 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_old_accordion.default', function() { 11246 initAccordion() 11247 } ); 11248 }); 11249 } 11250 11251})(jQuery); 11252(function($) { 11253 'use strict'; 11254 11255 var elementorOldTab = {}; 11256 qode.modules.elementorOldTab = elementorOldTab; 11257 11258 elementorOldTab.qodeInitElementorOldTab = qodeInitElementorOldTab; 11259 11260 11261 elementorOldTab.qodeOnWindowLoad = qodeOnWindowLoad; 11262 11263 $(window).on('load', qodeOnWindowLoad ); 11264 11265 /* 11266 ** All functions to be called on $(window).load() should be in this function 11267 */ 11268 function qodeOnWindowLoad() { 11269 qodeInitElementorOldTab(); 11270 } 11271 11272 function qodeInitElementorOldTab(){ 11273 $j(window).on('elementor/frontend/init', function () { 11274 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_old_tab.default', function() { 11275 initTabs(); 11276 } ); 11277 }); 11278 } 11279 11280})(jQuery); 11281(function($) { 11282 'use strict'; 11283 11284 var elementorParallaxLayers = {}; 11285 qode.modules.elementorParallaxLayers = elementorParallaxLayers; 11286 11287 elementorParallaxLayers.qodeInitElementorParallaxLayers = qodeInitElementorParallaxLayers; 11288 11289 11290 elementorParallaxLayers.qodeOnWindowLoad = qodeOnWindowLoad; 11291 11292 $(window).on('load', qodeOnWindowLoad ); 11293 11294 /* 11295 ** All functions to be called on $(window).load() should be in this function 11296 */ 11297 function qodeOnWindowLoad() { 11298 qodeInitElementorParallaxLayers(); 11299 } 11300 11301 function qodeInitElementorParallaxLayers(){ 11302 $j(window).on('elementor/frontend/init', function () { 11303 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_parallax_layers.default', function() { 11304 parallaxLayers(); 11305 } ); 11306 }); 11307 } 11308 11309})(jQuery); 11310(function($) { 11311 'use strict'; 11312 11313 var elementorPieChart = {}; 11314 qode.modules.elementorPieChart = elementorPieChart; 11315 11316 elementorPieChart.qodeInitElementorPieChart = qodeInitElementorPieChart; 11317 11318 11319 elementorPieChart.qodeOnWindowLoad = qodeOnWindowLoad; 11320 11321 $(window).on('load', qodeOnWindowLoad ); 11322 11323 /* 11324 ** All functions to be called on $(window).load() should be in this function 11325 */ 11326 function qodeOnWindowLoad() { 11327 qodeInitElementorPieChart(); 11328 } 11329 11330 function qodeInitElementorPieChart(){ 11331 $j(window).on('elementor/frontend/init', function () { 11332 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_pie_chart.default', function() { 11333 initPieChart(); 11334 } ); 11335 }); 11336 } 11337 11338})(jQuery); 11339(function($) { 11340 'use strict'; 11341 11342 $(window).on('load', qodeOnWindowLoad); 11343 11344 /* 11345 ** All functions to be called on $(window).load() should be in this function 11346 */ 11347 function qodeOnWindowLoad() { 11348 qodeInitElementorPieChartDoughnut(); 11349 } 11350 11351 function qodeInitElementorPieChartDoughnut(){ 11352 $(window).on('elementor/frontend/init', function () { 11353 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_pie_chart_doughnut.default', function() { 11354 qode.modules.pieChartDoughnut.qodePieChartDoughnut(); 11355 } ); 11356 }); 11357 } 11358 11359})(jQuery); 11360 11361(function ($) { 11362 'use strict'; 11363 11364 var pieChartDoughnut = {}; 11365 qode.modules.pieChartDoughnut = pieChartDoughnut; 11366 11367 pieChartDoughnut.qodePieChartDoughnut = qodePieChartDoughnut; 11368 pieChartDoughnut.qodeOnDocumentReady = qodeOnDocumentReady; 11369 11370 $(document).ready(qodeOnDocumentReady); 11371 11372 /* 11373 All functions to be called on $(document).ready() should be in this function 11374 */ 11375 function qodeOnDocumentReady() { 11376 qodePieChartDoughnut(); 11377 } 11378 11379 11380 function qodePieChartDoughnut() { 11381 11382 var holder = $('.q-pie-chart-doughnut'); 11383 11384 if (holder.length) { 11385 11386 holder.each(function () { 11387 var pieChart = $(this).find('.q_pie_graf'), 11388 canvasPieChart = pieChart.find('canvas'); 11389 11390 var pieChartValues = typeof pieChart.data('values') !== 'undefined' ? pieChart.data('values') : [], 11391 pieChartColors = typeof pieChart.data('colors') !== 'undefined' ? pieChart.data('colors') : []; 11392 11393 // var pieChartDoughnutObject = new Chart( 11394 // canvasPieChart[0].getContext('2d')).Doughnut( pieChartOptions, { 11395 // segmentStrokeColor : 'transparent' 11396 // }); 11397 11398 var data = { 11399 datasets: [{ 11400 data: pieChartValues, 11401 backgroundColor: pieChartColors,
11402 hoverBackgroundColor: pieChartColors, 11403 borderWidth: 0, 11404 }] 11405 }; 11406 11407 canvasPieChart.appear(function () { 11408 11409 var pieChartDoughnutObject = new Chart(canvasPieChart[0].getContext('2d'), { 11410 type: 'doughnut', 11411 data: data, 11412 options: { 11413 responsive: true, 11414 aspectRatio: 1, 11415 plugins: { 11416 legend: { 11417 display: false, 11418 }, 11419 tooltips: { 11420 enabled: false, 11421 }, 11422 }, 11423 animation: { 11424 easing: "easeOutBounce", 11425 duration: 1500 11426 } 11427 }, 11428 segmentStrokeColor : 'transparent' 11429 }); 11430 11431 },{accX: 0, accY: -200}); 11432 11433 }); 11434 11435 11436 11437 } 11438 11439 } 11440 11441})(jQuery); 11442 11443(function($) { 11444 'use strict'; 11445 11446 $(window).on('load', qodeOnWindowLoad); 11447 11448 /* 11449 ** All functions to be called on $(window).load() should be in this function 11450 */ 11451 function qodeOnWindowLoad() { 11452 qodeInitElementorPieChartFull(); 11453 } 11454 11455 function qodeInitElementorPieChartFull(){ 11456 $(window).on('elementor/frontend/init', function () { 11457 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_pie_chart_full.default', function() { 11458 qode.modules.pieChartFull.qodePieChartFull(); 11459 } ); 11460 }); 11461 } 11462 11463})(jQuery); 11464 11465(function ($) { 11466 'use strict'; 11467 11468 var pieChartFull = {}; 11469 qode.modules.pieChartFull = pieChartFull; 11470 11471 pieChartFull.qodePieChartFull = qodePieChartFull; 11472 pieChartFull.qodeOnDocumentReady = qodeOnDocumentReady; 11473 11474 $(document).ready(qodeOnDocumentReady); 11475 11476 /* 11477 All functions to be called on $(document).ready() should be in this function 11478 */ 11479 function qodeOnDocumentReady() { 11480 qodePieChartFull(); 11481 } 11482 11483 11484 function qodePieChartFull() { 11485 11486 var holder = $('.q-pie-chart-full'); 11487 11488 if (holder.length) { 11489 11490 holder.each(function () { 11491 var pieChart = $(this).find('.q_pie_graf'), 11492 canvasPieChart = pieChart.find('canvas'); 11493 11494 var pieChartValues = typeof pieChart.data('values') !== 'undefined' ? pieChart.data('values') : [], 11495 pieChartColors = typeof pieChart.data('colors') !== 'undefined' ? pieChart.data('colors') : [], 11496 pieChartElementAppearance = typeof pieChart.data('element-appearance') !== 'undefined' ? pieChart.data('element-appearance') : 200; 11497 11498 11499 var data = { 11500 datasets: [{ 11501 data: pieChartValues, 11502 backgroundColor: pieChartColors, 11503 hoverBackgroundColor: pieChartColors, 11504 borderWidth: 0, 11505 }] 11506 }; 11507 11508 canvasPieChart.appear(function () { 11509 11510 var pieChartFullObject = new Chart(canvasPieChart[0].getContext('2d'), { 11511 type: 'pie', 11512 data: data, 11513 options: { 11514 responsive: true, 11515 aspectRatio: 1, 11516 plugins: { 11517 legend: { 11518 display: false, 11519 }, 11520 tooltips: { 11521 enabled: false, 11522 }, 11523 }, 11524 animation: { 11525 easing: "easeOutBounce", 11526 duration: 1500 11527 }, 11528 } 11529 }); 11530 11531 },{accX: 0, accY: -pieChartElementAppearance}); 11532 11533 }); 11534 } 11535 } 11536 11537})(jQuery); 11538 11539(function($) { 11540 'use strict'; 11541 11542 var elementorPieChartWithIcon = {}; 11543 qode.modules.elementorPieChartWithIcon = elementorPieChartWithIcon; 11544 11545 elementorPieChartWithIcon.qodeInitElementorPieChartWithIcon = qodeInitElementorPieChartWithIcon; 11546 11547 11548 elementorPieChartWithIcon.qodeOnWindowLoad = qodeOnWindowLoad; 11549 11550 $(window).on('load', qodeOnWindowLoad ); 11551 11552 /* 11553 ** All functions to be called on $(window).load() should be in this function 11554 */ 11555 function qodeOnWindowLoad() { 11556 qodeInitElementorPieChartWithIcon(); 11557 } 11558 11559 function qodeInitElementorPieChartWithIcon(){ 11560 $j(window).on('elementor/frontend/init', function () { 11561 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_pie_chart_with_icon.default', function() { 11562 initPieChartWithIcon(); 11563 } ); 11564 }); 11565 } 11566 11567})(jQuery); 11568(function($) { 11569 'use strict'; 11570 11571 var elementorPortfolioList = {}; 11572 qode.modules.elementorPortfolioList = elementorPortfolioList; 11573 11574 elementorPortfolioList.qodeInitElementorPortfolioList = qodeInitElementorPortfolioList; 11575 11576 11577 elementorPortfolioList.qodeOnWindowLoad = qodeOnWindowLoad; 11578 11579 $(window).on('load', qodeOnWindowLoad ); 11580 11581 /* 11582 ** All functions to be called on $(window).load() should be in this function 11583 */ 11584 function qodeOnWindowLoad() { 11585 qodeInitElementorPortfolioList(); 11586 } 11587 11588 function qodeInitElementorPortfolioList(){ 11589 $j(window).on('elementor/frontend/init', function () { 11590 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_portfolio_list.default', function() { 11591 initPortfolio(); 11592 initPortfolioZIndex(); 11593 initPortfolioJustifiedGallery(); 11594 initPortfolioMasonryFilter(); 11595 initPortfolioMasonry(); 11596 } ); 11597 }); 11598 } 11599 11600})(jQuery); 11601(function($) { 11602 'use strict'; 11603 11604 var elementorPreviewSlider = {}; 11605 qode.modules.elementorPreviewSlider = elementorPreviewSlider; 11606 11607 elementorPreviewSlider.qodeInitElementorPreviewSlider = qodeInitElementorPreviewSlider; 11608 11609 11610 elementorPreviewSlider.qodeOnWindowLoad = qodeOnWindowLoad; 11611 11612 $(window).on('load', qodeOnWindowLoad ); 11613 11614 /* 11615 ** All functions to be called on $(window).load() should be in this function 11616 */ 11617 function qodeOnWindowLoad() { 11618 qodeInitElementorPreviewSlider(); 11619 } 11620 11621 function qodeInitElementorPreviewSlider(){ 11622 $j(window).on('elementor/frontend/init', function () { 11623 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_preview_slider.default', function() { 11624 initPreviewSlider(); 11625 } ); 11626 }); 11627 } 11628 11629})(jQuery); 11630(function($) { 11631 'use strict'; 11632 11633 var elementorPortfolioSlider = {}; 11634 qode.modules.elementorPortfolioSlider = elementorPortfolioSlider; 11635 11636 elementorPortfolioSlider.qodeInitElementorPortfolioSlider = qodeInitElementorPortfolioSlider; 11637 11638 11639 elementorPortfolioSlider.qodeOnWindowLoad = qodeOnWindowLoad; 11640 11641 $(window).on('load', qodeOnWindowLoad ); 11642 11643 /* 11644 ** All functions to be called on $(window).load() should be in this function 11645 */ 11646 function qodeOnWindowLoad() { 11647 qodeInitElementorPortfolioSlider(); 11648 } 11649 11650 function qodeInitElementorPortfolioSlider(){ 11651 $j(window).on('elementor/frontend/init', function () { 11652 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_portfolio_slider.default', function() { 11653 initPortfolioSlider(); 11654 } ); 11655 }); 11656 } 11657 11658})(jQuery); 11659(function($) { 11660 'use strict'; 11661 11662 var elementorProductListElegant = {}; 11663 qode.modules.elementorProductListElegant = elementorProductListElegant; 11664 11665 elementorProductListElegant.qodeInitElementorProductListElegant = qodeInitElementorProductListElegant; 11666 11667 11668 elementorProductListElegant.qodeOnWindowLoad = qodeOnWindowLoad; 11669 11670 $(window).on('load', qodeOnWindowLoad ); 11671 11672 /* 11673 ** All functions to be called on $(window).load() should be in this function 11674 */ 11675 function qodeOnWindowLoad() { 11676 qodeInitElementorProductListElegant(); 11677 } 11678 11679 function qodeInitElementorProductListElegant(){ 11680 $j(window).on('elementor/frontend/init', function () { 11681 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_product_list_elegant.default', function() { 11682 initEnlargeButton(); 11683 } ); 11684 }); 11685 } 11686 11687})(jQuery); 11688(function($) { 11689 'use strict'; 11690 11691 11692 $(window).on('load', qodeOnWindowLoad ); 11693 11694 /* 11695 ** All functions to be called on $(window).load() should be in this function 11696 */ 11697 function qodeOnWindowLoad() { 11698 qodeElementorInitProductListPinterest(); 11699 } 11700 11701 /* 11702 ** Testimonials 11703 */ 11704 function qodeElementorInitProductListPinterest(){ 11705 $j(window).on('elementor/frontend/init', function () { 11706 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_product_list_pinterest.default', function() { 11707 qodeInitProductListMasonryPinterestShortcode(); 11708 } ); 11709 }); 11710 } 11711 11712})(jQuery); 11713(function($) { 11714 'use strict'; 11715 11716 11717 $(window).on('load', qodeOnWindowLoad ); 11718 11719 /* 11720 ** All functions to be called on $(window).load() should be in this function 11721 */ 11722 function qodeOnWindowLoad() { 11723 qodeElementorInitProductListPinterest(); 11724 } 11725 11726 /* 11727 ** Testimonials 11728 */ 11729 function qodeElementorInitProductListPinterest(){ 11730 $j(window).on('elementor/frontend/init', function () { 11731 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_product_list_masonry.default', function() { 11732 qodeInitProductListMasonryPinterestShortcode(); 11733 } ); 11734 }); 11735 } 11736 11737})(jQuery); 11738(function($) { 11739 'use strict'; 11740 11741 11742 $(window).on('load', qodeOnWindowLoad ) ; 11743 11744 /* 11745 ** All functions to be called on $(window).load() should be in this function 11746 */ 11747 function qodeOnWindowLoad() { 11748 qodeElementorInitProgressBar(); 11749 } 11750 11751 /* 11752 ** Testimonials 11753 */ 11754 function qodeElementorInitProgressBar(){ 11755 $j(window).on('elementor/frontend/init', function () { 11756 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_progress_bar.default', function() { 11757 initProgressBars(); 11758 } ); 11759 }); 11760 } 11761 11762})(jQuery); 11763(function($) { 11764 'use strict'; 11765 11766 11767 $(window).on('load', qodeOnWindowLoad ); 11768 11769 /* 11770 ** All functions to be called on $(window).load() should be in this function 11771 */ 11772 function qodeOnWindowLoad() { 11773 qodeElementorInitProgressBarIcon(); 11774 } 11775 11776 /* 11777 ** Progress Bars Icons 11778 */ 11779 function qodeElementorInitProgressBarIcon(){ 11780 $j(window).on('elementor/frontend/init', function () { 11781 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_progress_bar_icon.default', function() { 11782 initProgressBarsIcon(); 11783 } ); 11784 }); 11785 } 11786 11787})(jQuery); 11788(function($) { 11789 'use strict'; 11790 11791 11792 $(window).on('load', qodeOnWindowLoad ); 11793 11794 /* 11795 ** All functions to be called on $(window).load() should be in this function 11796 */ 11797 function qodeOnWindowLoad() { 11798 qodeElementorInitProgressBarVertical(); 11799 } 11800 11801 /* 11802 ** Testimonials 11803 */ 11804 function qodeElementorInitProgressBarVertical(){ 11805 $j(window).on('elementor/frontend/init', function () { 11806 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_progress_bar_vertical.default', function() { 11807 initProgressBarsVertical(); 11808 } ); 11809 }); 11810 } 11811 11812})(jQuery); 11813(function($) { 11814 'use strict'; 11815 11816 11817 $(window).on('load', qodeOnWindowLoad ); 11818 11819 /* 11820 ** All functions to be called on $(window).load() should be in this function 11821 */ 11822 function qodeOnWindowLoad() { 11823 qodeElementorInitSocialIcons(); 11824 } 11825 11826 /* 11827 ** Testimonials 11828 */ 11829 function qodeElementorInitSocialIcons(){ 11830 $j(window).on('elementor/frontend/init', function () { 11831 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_social_icons.default', function() { 11832 initSocialIconHover(); 11833 } ); 11834 }); 11835 } 11836 11837})(jQuery); 11838(function($) { 11839 'use strict'; 11840 11841 11842 $(window).on('load', qodeOnWindowLoad ); 11843 11844 /* 11845 ** All functions to be called on $(window).load() should be in this function 11846 */ 11847 function qodeOnWindowLoad() { 11848 qodeInitTestimonials(); 11849 } 11850 11851 /* 11852 ** Testimonials 11853 */ 11854 function qodeInitTestimonials(){ 11855 $j(window).on('elementor/frontend/init', function () { 11856 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_testimonials.default', function() { 11857 initTestimonials(); 11858 } ); 11859 }); 11860 } 11861 11862})(jQuery); 11863(function($) { 11864 'use strict'; 11865 11866 11867 $(window).on('load', qodeOnWindowLoad ); 11868 11869 /* 11870 ** All functions to be called on $(window).load() should be in this function 11871 */ 11872 function qodeOnWindowLoad() {
11873 qodeInitTestimonialsCarousel(); 11874 } 11875 11876 /* 11877 ** TestimonialsCarousel 11878 */ 11879 function qodeInitTestimonialsCarousel(){ 11880 $j(window).on('elementor/frontend/init', function () { 11881 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_testimonials_carousel.default', function() { 11882 initTestimonialsCarousel(); 11883 } ); 11884 }); 11885 } 11886 11887})(jQuery); 11888(function($) { 11889 'use strict'; 11890 11891 11892 $(window).on('load', qodeOnWindowLoad ); 11893 11894 /* 11895 ** All functions to be called on $(window).load() should be in this function 11896 */ 11897 function qodeOnWindowLoad() { 11898 qodeInitTextMarque(); 11899 } 11900 11901 11902 function qodeInitTextMarque(){ 11903 $j(window).on('elementor/frontend/init', function () { 11904 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_text_marquee.default', function() { 11905 initTextMarquee(); 11906 } ); 11907 }); 11908 } 11909 11910})(jQuery); 11911(function($) { 11912 'use strict'; 11913 11914 var elementorVerticalSplitSlider = {}; 11915 qode.modules.elementorVerticalSplitSlider = elementorVerticalSplitSlider; 11916 11917 elementorVerticalSplitSlider.qodeInitElementorVerticalSplitSlider = qodeInitElementorVerticalSplitSlider; 11918 11919 11920 elementorVerticalSplitSlider.qodeOnWindowLoad = qodeOnWindowLoad; 11921 11922 $(window).on('load', qodeOnWindowLoad ); 11923 11924 /* 11925 ** All functions to be called on $(window).load() should be in this function 11926 */ 11927 function qodeOnWindowLoad() { 11928 qodeInitElementorVerticalSplitSlider(); 11929 } 11930 11931 function qodeInitElementorVerticalSplitSlider(){ 11932 $j(window).on('elementor/frontend/init', function () { 11933 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_vertical_split_slider.default', function() { 11934 initVerticalSplitSlider(); 11935 } ); 11936 }); 11937 } 11938 11939})(jQuery); 11940(function($) { 11941 'use strict'; 11942 11943 11944 $(window).on('load', qodeOnWindowLoad ); 11945 11946 /* 11947 ** All functions to be called on $(window).load() should be in this function 11948 */ 11949 function qodeOnWindowLoad() { 11950 qodeInitUnorderedListAnimation(); 11951 } 11952 11953 /* 11954 ** Init Unordered List shortcode 11955 */ 11956 function qodeInitUnorderedListAnimation(){ 11957 $j(window).on('elementor/frontend/init', function () { 11958 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_unordered_list.default', function() { 11959 initListAnimation(); 11960 } ); 11961 }); 11962 } 11963 11964})(jQuery); 11965(function($) { 11966 'use strict'; 11967 11968 var elementorAdvancedTabs = {}; 11969 qode.modules.elementorAdvancedTabs = elementorAdvancedTabs; 11970 11971 elementorAdvancedTabs.qodeInitElementorAdvancedTabs = qodeInitElementorAdvancedTabs; 11972 11973 11974 elementorAdvancedTabs.qodeOnWindowLoad = qodeOnWindowLoad; 11975 11976 $(window).on('load', qodeOnWindowLoad ); 11977 11978 /* 11979 ** All functions to be called on $(window).load() should be in this function 11980 */ 11981 function qodeOnWindowLoad() { 11982 qodeInitElementorAdvancedTabs(); 11983 } 11984 11985 function qodeInitElementorAdvancedTabs(){ 11986 $j(window).on('elementor/frontend/init', function () { 11987 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_tabs.default', function() { 11988 qodeInitAdvancedTabs(); 11989 qodeInitAdvancedTabsIcons(); 11990 } ); 11991 }); 11992 } 11993 11994})(jQuery); 11995(function($) { 11996 'use strict'; 11997 11998 var elementorBlogCarouselTitled = {}; 11999 qode.modules.elementorBlogCarouselTitled = elementorBlogCarouselTitled; 12000 12001 elementorBlogCarouselTitled.qodeInitElementorBlogCarouselTitled = qodeInitElementorBlogCarouselTitled; 12002 12003 12004 elementorBlogCarouselTitled.qodeOnWindowLoad = qodeOnWindowLoad; 12005 12006 $(window).on('load', qodeOnWindowLoad ); 12007 12008 /* 12009 ** All functions to be called on $(window).load() should be in this function 12010 */ 12011 function qodeOnWindowLoad() { 12012 qodeInitElementorBlogCarouselTitled(); 12013 } 12014 12015 function qodeInitElementorBlogCarouselTitled(){ 12016 $j(window).on('elementor/frontend/init', function () { 12017 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_blog_carousel_titled.default', function() { 12018 qodeInitBlogCarouselTitled(); 12019 } ); 12020 }); 12021 } 12022 12023})(jQuery); 12024(function($) { 12025 'use strict'; 12026 12027 var elementorButtonV2 = {}; 12028 qode.modules.elementorButtonV2 = elementorButtonV2; 12029 12030 elementorButtonV2.qodeInitElementorButtonV2 = qodeInitElementorButtonV2; 12031 12032 12033 elementorButtonV2.qodeOnWindowLoad = qodeOnWindowLoad; 12034 12035 $(window).on('load', qodeOnWindowLoad ); 12036 12037 /* 12038 ** All functions to be called on $(window).load() should be in this function 12039 */ 12040 function qodeOnWindowLoad() { 12041 qodeInitElementorButtonV2(); 12042 } 12043 12044 function qodeInitElementorButtonV2(){ 12045 $j(window).on('elementor/frontend/init', function () { 12046 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_button_v2.default', function() { 12047 qodeV2Button().init(); 12048 } ); 12049 }); 12050 } 12051 12052})(jQuery); 12053(function($) { 12054 'use strict'; 12055 12056 var elementorAccordion = {}; 12057 qode.modules.elementorAccordion = elementorAccordion; 12058 12059 elementorAccordion.qodeInitElementorAccordion = qodeInitElementorAccordion; 12060 12061 12062 elementorAccordion.qodeOnWindowLoad = qodeOnWindowLoad; 12063 12064 $(window).on('load', qodeOnWindowLoad ); 12065 12066 /* 12067 ** All functions to be called on $(window).load() should be in this function 12068 */ 12069 function qodeOnWindowLoad() { 12070 qodeInitElementorAccordion(); 12071 } 12072 12073 function qodeInitElementorAccordion(){ 12074 $j(window).on('elementor/frontend/init', function () { 12075 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_accordion.default', function() { 12076 qodeInitAccordions(); 12077 } ); 12078 }); 12079 } 12080 12081})(jQuery); 12082(function($) { 12083 'use strict'; 12084 12085 var imageGallery = {}; 12086 qode.modules.imageGallery = imageGallery; 12087 12088 imageGallery.qodeInitAdvancedImageGalleryMasonry = qodeInitAdvancedImageGalleryMasonry; 12089 12090 12091 imageGallery.qodeOnWindowLoad = qodeOnWindowLoad; 12092 12093 $(window).on('load', qodeOnWindowLoad ); 12094 12095 /* 12096 ** All functions to be called on $(window).load() should be in this function 12097 */ 12098 function qodeOnWindowLoad() { 12099 qodeInitAdvancedImageGalleryMasonry(); 12100 } 12101 12102 /* 12103 ** Init Image Gallery shortcode - Masonry layout 12104 */ 12105 function qodeInitAdvancedImageGalleryMasonry(){ 12106 var holder = $('.qode-advanced-image-gallery.qode-aig-masonry-type'); 12107
12108 if(holder.length){ 12109 holder.each(function(){ 12110 var thisHolder = $(this), 12111 masonry = thisHolder.find('.qode-aig-masonry'), 12112 size = thisHolder.find('.qode-aig-grid-sizer').width(); 12113 12114 qodeResizeAdvancedImageGalleryMasonryItems(size, thisHolder); 12115 12116 masonry.waitForImages(function() { 12117 masonry.isotope({ 12118 layoutMode: 'packery', 12119 itemSelector: '.qode-aig-image', 12120 percentPosition: true, 12121 packery: { 12122 gutter: '.qode-aig-grid-gutter', 12123 columnWidth: '.qode-aig-grid-sizer' 12124 } 12125 }); 12126 12127 setTimeout(function() { 12128 masonry.isotope('layout'); 12129 initParallax(); 12130 }, 800); 12131 12132 masonry.css('opacity', '1'); 12133 }); 12134 }); 12135 } 12136 } 12137 12138 /** 12139 * Init Resize Portfolio Items 12140 */ 12141 function qodeResizeAdvancedImageGalleryMasonryItems(size,container){ 12142 if(container.hasClass('qode-aig-images-fixed')) { 12143 var padding = parseInt(container.find('.qode-aig-image').css('padding-left')), 12144 defaultMasonryItem = container.find('.qode-aig-default-masonry-item'), 12145 largeWidthMasonryItem = container.find('.qode-aig-large-width-masonry-item'), 12146 largeHeightMasonryItem = container.find('.qode-aig-large-height-masonry-item'), 12147 largeWidthHeightMasonryItem = container.find('.qode-aig-large-masonry-item'); 12148 12149 if (qode.windowWidth > 680) { 12150 defaultMasonryItem.css('height', size - 2 * padding); 12151 largeHeightMasonryItem.css('height', Math.round(2 * size) - 2 * padding); 12152 largeWidthHeightMasonryItem.css('height', Math.round(2 * size) - 2 * padding); 12153 largeWidthMasonryItem.css('height', size - 2 * padding); 12154 } else { 12155 defaultMasonryItem.css('height', size - 2 * padding); 12156 largeHeightMasonryItem.css('height', size*2 - 2 * padding); 12157 largeWidthHeightMasonryItem.css('height', size - 2 * padding); 12158 largeWidthMasonryItem.css('height', Math.floor(size / 2) - 2 * padding); 12159 } 12160 } 12161 } 12162 12163})(jQuery); 12164(function($) { 12165 'use strict'; 12166 12167 var elementorImageGallery = {}; 12168 qode.modules.elementorImageGallery = elementorImageGallery; 12169 12170 elementorImageGallery.qodeInitElementorAdvancedImageGalleryMasonry = qodeInitElementorAdvancedImageGalleryMasonry; 12171 12172 12173 elementorImageGallery.qodeOnWindowLoad = qodeOnWindowLoad; 12174 12175 $(window).on('load', qodeOnWindowLoad ); 12176 12177 /* 12178 ** All functions to be called on $(window).load() should be in this function 12179 */ 12180 function qodeOnWindowLoad() { 12181 qodeInitElementorAdvancedImageGalleryMasonry(); 12182 } 12183 12184 function qodeInitElementorAdvancedImageGalleryMasonry(){ 12185 $j(window).on('elementor/frontend/init', function () { 12186 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_advanced_image_gallery.default', function() { 12187 qodeOwlSlider(); 12188 qode.modules.imageGallery.qodeInitAdvancedImageGalleryMasonry(); 12189 } ); 12190 }); 12191 } 12192 12193})(jQuery); 12194(function($) { 12195 'use strict'; 12196 12197 var elementorCallToActionSection = {}; 12198 qode.modules.elementorCallToActionSection = elementorCallToActionSection; 12199 12200 elementorCallToActionSection.qodeInitElementorCallToActionSection = qodeInitElementorCallToActionSection; 12201 12202 12203 elementorCallToActionSection.qodeOnWindowLoad = qodeOnWindowLoad; 12204 12205 $(window).on('load', qodeOnWindowLoad ); 12206 12207 /* 12208 ** All functions to be called on $(window).load() should be in this function 12209 */ 12210 function qodeOnWindowLoad() { 12211 qodeInitElementorCallToActionSection(); 12212 } 12213 12214 function qodeInitElementorCallToActionSection(){ 12215 $j(window).on('elementor/frontend/init', function () { 12216 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_call_to_action_section.default', function() { 12217 qodeCTASection().init(); 12218 } ); 12219 }); 12220 } 12221 12222})(jQuery); 12223(function($) { 12224 'use strict'; 12225 12226 var elementorCardsGallery = {}; 12227 qode.modules.elementorCardsGallery = elementorCardsGallery; 12228 12229 elementorCardsGallery.qodeInitElementorCardsGallery = qodeInitElementorCardsGallery; 12230 12231 12232 elementorCardsGallery.qodeOnWindowLoad = qodeOnWindowLoad; 12233 12234 $(window).on('load', qodeOnWindowLoad ); 12235 12236 /* 12237 ** All functions to be called on $(window).load() should be in this function 12238 */ 12239 function qodeOnWindowLoad() { 12240 qodeInitElementorCardsGallery(); 12241 } 12242 12243 function qodeInitElementorCardsGallery(){ 12244 $j(window).on('elementor/frontend/init', function () { 12245 qodeCardsGallery(); 12246 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_cards_gallery.default', function() { 12247 qodeCardsGallery(); 12248 } ); 12249 }); 12250 } 12251 12252})(jQuery); 12253(function($) { 12254 'use strict'; 12255 12256 var elementorCardsSlider = {}; 12257 qode.modules.elementorCardsSlider = elementorCardsSlider; 12258 12259 elementorCardsSlider.qodeInitElementorCardsSlider = qodeInitElementorCardsSlider; 12260 12261 12262 elementorCardsSlider.qodeOnWindowLoad = qodeOnWindowLoad; 12263 12264 $(window).on('load', qodeOnWindowLoad ); 12265 12266 /* 12267 ** All functions to be called on $(window).load() should be in this function 12268 */ 12269 function qodeOnWindowLoad() { 12270 qodeInitElementorCardsSlider(); 12271 } 12272 12273 /* 12274 ** 12275 */ 12276 function qodeInitElementorCardsSlider(){ 12277 $j(window).on('elementor/frontend/init', function () { 12278 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_cards_slider.default', function() { 12279 qodeCardsSlider().init(); 12280 } ); 12281 }); 12282 } 12283 12284})(jQuery); 12285(function($) { 12286 'use strict'; 12287 12288 var comparisonSlider = {}; 12289 qode.modules.comparisonSlider = comparisonSlider; 12290 12291 comparisonSlider.qodeInitComparisonSlider = qodeInitComparisonSlider; 12292 12293 12294 comparisonSlider.qodeOnWindowLoad = qodeOnWindowLoad; 12295 12296 $(document).ready(qodeOnWindowLoad); 12297 12298 /* 12299 All functions to be called on $(window).load() should be in this function 12300 */ 12301 function qodeOnWindowLoad() { 12302 qodeInitComparisonSlider(); 12303 } 12304 12305 12306 function qodeInitComparisonSlider() {
12307 var cmpSliders = $j('.qode-comparison-slider'); 12308 12309 if (cmpSliders.length) { 12310 cmpSliders.each(function (i) { 12311 var cmpSlider = $j(this); 12312 12313 var orientation = cmpSlider.data('orientation'); 12314 var offset = cmpSlider.data('offset') / 100; 12315 12316 cmpSlider.waitForImages(function () { 12317 cmpSlider.css('visibility', 'visible'); 12318 cmpSlider.twentytwenty({ 12319 default_offset_pct: 1.1, 12320 orientation: orientation 12321 }); 12322 }); 12323 12324 cmpSlider.appear(function () { 12325 setTimeout(function () { 12326 var height = cmpSlider.height(), 12327 width = cmpSlider.width(), 12328 pixelHeight = height * offset, //target value 12329 pixelWidth = width * offset, //target value 12330 handle = cmpSlider.find('.twentytwenty-handle'), 12331 image = cmpSlider.find('img:first-of-type'), 12332 transitionTime = 700, 12333 transitionEasing = 'cubic-bezier(0.645, 0.045, 0.355, 1)', 12334 transitionDelay = 100; 12335 12336 var position = function () { 12337 if (orientation == 'horizontal') { 12338 handle.css({ 12339 'left': +pixelWidth + 1 + 'px' 12340 }); 12341 12342 image.css({ 12343 'clip': 'rect(0px ' + pixelWidth + 'px ' + height + 'px 0px)' 12344 }); 12345 } else { 12346 handle.css({ 12347 'top': +pixelHeight + 1 + 'px' 12348 }); 12349 12350 image.css({ 12351 'clip': 'rect(0px ' + width + 'px ' + pixelHeight + 'px 0px)' 12352 }); 12353 } 12354 } 12355 12356 image.css('transition', 'all ' + transitionTime + 'ms ' + transitionEasing + ' ' + transitionDelay + 'ms'); 12357 handle.css('transition', 'all ' + transitionTime + 'ms ' + transitionEasing + ' ' + transitionDelay + 'ms'); 12358 12359 position(); 12360 12361 setTimeout(function () { 12362 image.css('transition', 'none'); 12363 handle.css('transition', 'none'); 12364 }, transitionTime); 12365 12366 $j(window).resize(function () { 12367 height = cmpSlider.height(); 12368 width = cmpSlider.width(); 12369 pixelHeight = height * offset; //target value 12370 pixelWidth = width * offset; //target value 12371 position(); 12372 }); 12373 }, 100); //necessary for calcs 12374 }, {accX: 0, accY: -200}); 12375 }); 12376 } 12377 } 12378 12379})(jQuery); 12380(function($) { 12381 'use strict'; 12382 12383 var elementorComparisonSlider = {}; 12384 qode.modules.elementorComparisonSlider = elementorComparisonSlider; 12385 12386 elementorComparisonSlider.qodeInitElementorComparisonSlider = qodeInitElementorComparisonSlider; 12387 12388 12389 elementorComparisonSlider.qodeOnWindowLoad = qodeOnWindowLoad; 12390 12391 $(document).ready(qodeOnWindowLoad); 12392 12393 /* 12394 All functions to be called on $(window).load() should be in this function 12395 */ 12396 function qodeOnWindowLoad() { 12397 qodeInitElementorComparisonSlider(); 12398 } 12399 12400 12401 function qodeInitElementorComparisonSlider() { 12402 $(window).on('elementor/frontend/init', function () { 12403 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_comparison_slider.default', function() { 12404 qode.modules.comparisonSlider.qodeInitComparisonSlider(); 12405 } ); 12406 }); 12407 } 12408 12409})(jQuery); 12410 12411(function($) { 12412 'use strict'; 12413 12414 var elementorContentMenu = {}; 12415 qode.modules.elementorContentMenu = elementorContentMenu; 12416 12417 elementorContentMenu.qodeInitElementorContentMenu = qodeInitElementorContentMenu; 12418 12419 12420 elementorContentMenu.qodeOnWindowLoad = qodeOnWindowLoad; 12421 12422 $(window).on('load', qodeOnWindowLoad ); 12423 12424 /* 12425 ** All functions to be called on $(window).load() should be in this function 12426 */ 12427 function qodeOnWindowLoad() { 12428 qodeInitElementorContentMenu(); 12429 } 12430 12431 function qodeInitElementorContentMenu(){ 12432 $j(window).on('elementor/frontend/init', function () { 12433 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_content_menu.default', function() { 12434 createContentMenu(); 12435 createSelectContentMenu(); 12436 contentMenuPosition(); 12437 contentMenuCheckLastSection(); 12438 contentMenuScrollTo(); 12439 } ); 12440 }); 12441 } 12442 12443})(jQuery); 12444(function($) { 12445 'use strict'; 12446
12447 var elementorEllipticalSlider = {}; 12448 qode.modules.elementorEllipticalSlider = elementorEllipticalSlider; 12449 12450 elementorEllipticalSlider.qodeInitElementorEllipticalSlider = qodeInitElementorEllipticalSlider; 12451 12452 12453 elementorEllipticalSlider.qodeOnWindowLoad = qodeOnWindowLoad; 12454 12455 $(window).on('load', qodeOnWindowLoad ); 12456 12457 /* 12458 ** All functions to be called on $(window).load() should be in this function 12459 */ 12460 function qodeOnWindowLoad() { 12461 qodeInitElementorEllipticalSlider(); 12462 } 12463 12464 function qodeInitElementorEllipticalSlider(){ 12465 $j(window).on('elementor/frontend/init', function () { 12466 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_elliptical_slider.default', function() { 12467 qodeInitEllipticalSlider(); 12468 } ); 12469 }); 12470 } 12471 12472})(jQuery); 12473(function($) { 12474 'use strict'; 12475 12476 var elementorExpendableSection = {}; 12477 qode.modules.elementorExpendableSection = elementorExpendableSection; 12478 12479 elementorExpendableSection.qodeInitElementorExpendableSection = qodeInitElementorExpendableSection; 12480 12481 12482 elementorExpendableSection.qodeOnWindowLoad = qodeOnWindowLoad; 12483 12484 $(window).on('load', qodeOnWindowLoad); 12485 12486 /* 12487 ** All functions to be called on $(window).load() should be in this function 12488 */ 12489 function qodeOnWindowLoad() { 12490 qodeInitElementorExpendableSection(); 12491 } 12492 12493 function qodeInitElementorExpendableSection(){ 12494 $j(window).on('elementor/frontend/init', function () { 12495 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_expendable_section.default', function() { 12496 initMoreFacts(); 12497 } ); 12498 }); 12499 } 12500 12501})(jQuery); 12502(function($) { 12503 'use strict'; 12504 12505 var elementorHorizontalTimeline = {}; 12506 qode.modules.elementorHorizontalTimeline = elementorHorizontalTimeline; 12507 12508 elementorHorizontalTimeline.qodeInitElementorHorizontalTimeline = qodeInitElementorHorizontalTimeline; 12509 12510 12511 elementorHorizontalTimeline.qodeOnWindowLoad = qodeOnWindowLoad; 12512 12513 $(window).on('load', qodeOnWindowLoad); 12514 12515 /* 12516 ** All functions to be called on $(window).load() should be in this function 12517 */ 12518 function qodeOnWindowLoad() { 12519 qodeInitElementorHorizontalTimeline(); 12520 } 12521 12522 function qodeInitElementorHorizontalTimeline(){ 12523 $j(window).on('elementor/frontend/init', function () { 12524 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_horizontal_timeline.default', function() { 12525 qode.modules.timeline.qodeInitHorizontalTimeline(); 12526 } ); 12527 }); 12528 } 12529 12530})(jQuery); 12531(function($) { 12532 'use strict'; 12533 12534 var timeline = {}; 12535 qode.modules.timeline = timeline; 12536 12537 timeline.qodeInitHorizontalTimeline = qodeInitHorizontalTimeline; 12538 12539 12540 timeline.qodeOnDocumentReady = qodeOnDocumentReady; 12541 12542 $(document).ready(qodeOnDocumentReady); 12543 12544 /* 12545 ** All functions to be called on $(window).load() should be in this function 12546 */ 12547 function qodeOnDocumentReady() { 12548 qodeInitHorizontalTimeline(); 12549 } 12550 12551 function qodeInitHorizontalTimeline() { 12552 var timelines = $('.qode-horizontal-timeline'); 12553 12554 var eventsMinDistance = 120; 12555 if(qode.windowWidth > 680 && qode.windowWidth <= 1024) { 12556 eventsMinDistance = 60; 12557 } else if (qode.windowWidth < 680) { 12558 eventsMinDistance = 105; 12559 } 12560 12561 if(timelines.length) { 12562 timelines.each(function() { 12563 var timeline = $(this), 12564 timelineComponents = {}; 12565 12566 //cache timeline components 12567 timelineComponents['timelineWrapper'] = timeline.find('.qode-events-wrapper'); 12568 timelineComponents['eventsWrapper'] = timelineComponents['timelineWrapper'].children('.qode-events'); 12569 timelineComponents['fillingLine'] = timelineComponents['eventsWrapper'].children('.qode-filling-line'); 12570 timelineComponents['timelineEvents'] = timelineComponents['eventsWrapper'].find('a'); 12571 timelineComponents['timelineDates'] = parseDate(timelineComponents['timelineEvents']); 12572 timelineComponents['eventsMinLapse'] = minLapse(timelineComponents['timelineDates']); 12573 timelineComponents['timelineNavigation'] = timeline.find('.qode-timeline-navigation'); 12574 timelineComponents['eventsContent'] = timeline.children('.qode-events-content'); 12575 12576 timelineComponents['eventsWrapper'].find('ol li:first-child a').addClass('selected'); 12577 timelineComponents['eventsContent'].find('ol li:first-child').addClass('selected'); 12578 12579 //assign a left postion to the single events along the timeline 12580 setDatePosition(timelineComponents, eventsMinDistance, timeline); 12581 //assign a width to the timeline 12582 var timelineTotWidth = setTimelineWidth(timelineComponents, eventsMinDistance, timeline); 12583 //the timeline has been initialize - show it 12584 timeline.addClass('loaded'); 12585 12586 //detect click on the next arrow 12587 timelineComponents['timelineNavigation'].on('click', '.qode-next', function(event){ 12588 event.preventDefault(); 12589 updateSlide(timelineComponents, timelineTotWidth, 'next'); 12590 }); 12591 //detect click on the prev arrow 12592 timelineComponents['timelineNavigation'].on('click', '.qode-prev', function(event){ 12593 event.preventDefault(); 12594 updateSlide(timelineComponents, timelineTotWidth, 'prev'); 12595 }); 12596 //detect click on the a single event - show new event content 12597 timelineComponents['eventsWrapper'].on('click', 'a', function(event){ 12598 event.preventDefault(); 12599 timelineComponents['timelineEvents'].removeClass('selected'); 12600 $(this).addClass('selected'); 12601 updateOlderEvents($(this)); 12602 updateFilling($(this), timelineComponents['fillingLine'], timelineTotWidth); 12603 updateVisibleContent($(this), timelineComponents['eventsContent']); 12604 }); 12605 12606 //on swipe, show next/prev event content 12607 timelineComponents['eventsContent'].on('swipeleft', function(){ 12608 var mq = checkMQ(); 12609 ( mq == 'mobile' ) && showNewContent(timelineComponents, timelineTotWidth, 'next'); 12610 }); 12611 timelineComponents['eventsContent'].on('swiperight', function(){ 12612 var mq = checkMQ(); 12613 ( mq == 'mobile' ) && showNewContent(timelineComponents, timelineTotWidth, 'prev'); 12614 }); 12615 12616 //keyboard navigation 12617 $(document).keyup(function(event){ 12618 if(event.which === '37' && elementInViewport(timeline.get(0)) ) { 12619 showNewContent(timelineComponents, timelineTotWidth, 'prev'); 12620 } else if( event.which === '39' && elementInViewport(timeline.get(0))) { 12621 showNewContent(timelineComponents, timelineTotWidth, 'next'); 12622 } 12623 }); 12624 }); 12625 } 12626 12627 function updateSlide(timelineComponents, timelineTotWidth, string) { 12628 //retrieve translateX value of timelineComponents['eventsWrapper'] 12629 var translateValue = getTranslateValue(timelineComponents['eventsWrapper']),
12630 wrapperWidth = Number(timelineComponents['timelineWrapper'].css('width').replace('px', '')); 12631 //translate the timeline to the left('next')/right('prev') 12632 (string === 'next') 12633 ? translateTimeline(timelineComponents, translateValue - wrapperWidth + eventsMinDistance, wrapperWidth - timelineTotWidth) 12634 : translateTimeline(timelineComponents, translateValue + wrapperWidth - eventsMinDistance); 12635 } 12636 12637 function showNewContent(timelineComponents, timelineTotWidth, string) { 12638 //go from one event to the next/previous one 12639 var visibleContent = timelineComponents['eventsContent'].find('.selected'), 12640 newContent = ( string === 'next' ) ? visibleContent.next() : visibleContent.prev(); 12641 12642 if ( newContent.length > 0 ) { //if there's a next/prev event - show it 12643 var selectedDate = timelineComponents['eventsWrapper'].find('.selected'), 12644 newEvent = ( string === 'next' ) ? selectedDate.parent('li').next('li').children('a') : selectedDate.parent('li').prev('li').children('a'); 12645 12646 updateFilling(newEvent, timelineComponents['fillingLine'], timelineTotWidth); 12647 updateVisibleContent(newEvent, timelineComponents['eventsContent']); 12648 newEvent.addClass('selected'); 12649 selectedDate.removeClass('selected'); 12650 updateOlderEvents(newEvent); 12651 updateTimelinePosition(string, newEvent, timelineComponents); 12652 } 12653 } 12654 12655 function updateTimelinePosition(string, event, timelineComponents) { 12656 //translate timeline to the left/right according to the position of the selected event 12657 var eventStyle = window.getComputedStyle(event.get(0), null), 12658 eventLeft = Number(eventStyle.getPropertyValue("left").replace('px', '')), 12659 timelineWidth = Number(timelineComponents['timelineWrapper'].css('width').replace('px', '')), 12660 timelineTotWidth = Number(timelineComponents['eventsWrapper'].css('width').replace('px', '')); 12661 var timelineTranslate = getTranslateValue(timelineComponents['eventsWrapper']); 12662 12663 if( (string === 'next' && eventLeft > timelineWidth - timelineTranslate) || (string == 'prev' && eventLeft < - timelineTranslate) ) { 12664 translateTimeline(timelineComponents, - eventLeft + timelineWidth/2, timelineWidth - timelineTotWidth); 12665 } 12666 } 12667 12668 function translateTimeline(timelineComponents, value, totWidth) { 12669 var eventsWrapper = timelineComponents['eventsWrapper'].get(0); 12670 value = (value > 0) ? 0 : value; //only negative translate value 12671 value = ( typeof totWidth !== 'undefined' && value < totWidth ) ? totWidth : value; //do not translate more than timeline width 12672 setTransformValue(eventsWrapper, 'translateX', value+'px'); 12673 //update navigation arrows visibility 12674 (value === 0 ) ? timelineComponents['timelineNavigation'].find('.qode-prev').addClass('inactive') : timelineComponents['timelineNavigation'].find('.qode-prev').removeClass('inactive'); 12675 (value === totWidth ) ? timelineComponents['timelineNavigation'].find('.qode-next').addClass('inactive') : timelineComponents['timelineNavigation'].find('.qode-next').removeClass('inactive'); 12676 } 12677 12678 function disableTranslateTimeline(timelineComponents) { 12679 timelineComponents['timelineNavigation'].find('.qode-prev').addClass('inactive'); 12680 timelineComponents['timelineNavigation'].find('.qode-next').addClass('inactive'); 12681 } 12682 12683 function updateFilling(selectedEvent, filling, totWidth) { 12684 //change .filling-line length according to the selected event 12685 var eventStyle = window.getComputedStyle(selectedEvent.get(0), null), 12686 eventLeft = eventStyle.getPropertyValue("left"), 12687 eventWidth = eventStyle.getPropertyValue("width"); 12688 eventLeft = Number(eventLeft.replace('px', '')) + Number(eventWidth.replace('px', ''))/2; 12689 var scaleValue = eventLeft/totWidth; 12690 setTransformValue(filling.get(0), 'scaleX', scaleValue); 12691 } 12692 12693 function setDatePosition(timelineComponents, min, timeline) { 12694 var shorten = false; 12695 for (var i = 0; i < timelineComponents['timelineDates'].length; i++) { 12696 var distance = daydiff(timelineComponents['timelineDates'][0], timelineComponents['timelineDates'][i]), 12697 distanceNorm = Math.round(distance/timelineComponents['eventsMinLapse']) + 1; 12698 /* 24 is width of circles placed in link :after element */ 12699 timelineComponents['timelineEvents'].eq(i).css('left', distanceNorm*min-24+'px'); 12700 /* 80 is width of 2*40 margins on qode-events-wrapper */ 12701 if(distanceNorm*min < timeline.outerWidth() - 80) { 12702 shorten = true; 12703 } 12704 else { 12705 shorten = false;
12706 } 12707 } 12708 if(shorten) { 12709 disableTranslateTimeline(timelineComponents); 12710 /* 80 is width of 2*40 margins on qode-events-wrapper, 24 is width of circles placed in link :after element */ 12711 var minDistance = (timeline.outerWidth() - 80 - (timelineComponents['timelineDates'].length - 1) * 24) / (timelineComponents['timelineDates'].length + 1); 12712 for (var i = 0; i < timelineComponents['timelineDates'].length; i++) { 12713 timelineComponents['timelineEvents'].eq(i).css('left', (i+1)*minDistance+'px'); 12714 } 12715 } 12716 } 12717 12718 function setTimelineWidth(timelineComponents, width, timeline) { 12719 var timeSpan = daydiff(timelineComponents['timelineDates'][0], timelineComponents['timelineDates'][timelineComponents['timelineDates'].length-1]), 12720 timeSpanNorm = timeSpan/timelineComponents['eventsMinLapse'], 12721 timeSpanNorm = Math.round(timeSpanNorm) + 2, 12722 totalWidth = timeSpanNorm*width; 12723 /* 80 is width of 2*40 margins on qode-events-wrapper */ 12724 if(totalWidth < timeline.outerWidth() - 80) { 12725 totalWidth = timeline.outerWidth() - 80; 12726 } 12727 timelineComponents['eventsWrapper'].css('width', totalWidth+"px"); 12728 updateFilling(timelineComponents['eventsWrapper'].find('a.selected'), timelineComponents['fillingLine'], totalWidth); 12729 updateTimelinePosition('next', timelineComponents['eventsWrapper'].find('a.selected'), timelineComponents); 12730 12731 return totalWidth; 12732 } 12733 12734 function updateVisibleContent(event, eventsContent) { 12735 var eventDate = event.data('date'), 12736 visibleContent = eventsContent.find('.selected'), 12737 selectedContent = eventsContent.find('[data-date="'+ eventDate +'"]'), 12738 selectedContentHeight = selectedContent.height(); 12739 12740 if (selectedContent.index() > visibleContent.index()) { 12741 var classEnetering = 'selected qode-enter-right', 12742 classLeaving = 'qode-leave-left'; 12743 } else { 12744 var classEnetering = 'selected qode-enter-left', 12745 classLeaving = 'qode-leave-right'; 12746 } 12747 12748 selectedContent.attr('class', classEnetering); 12749 visibleContent.attr('class', classLeaving).one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(){ 12750 visibleContent.removeClass('qode-leave-right qode-leave-left'); 12751 selectedContent.removeClass('qode-enter-left qode-enter-right'); 12752 }); 12753 eventsContent.css('height', selectedContentHeight+'px'); 12754 } 12755 12756 function updateOlderEvents(event) { 12757 event.parent('li').prevAll('li').children('a').addClass('older-event').end().end().nextAll('li').children('a').removeClass('older-event'); 12758 } 12759 12760 function getTranslateValue(timeline) { 12761 var timelineStyle = window.getComputedStyle(timeline.get(0), null), 12762 timelineTranslate = timelineStyle.getPropertyValue("-webkit-transform") || 12763 timelineStyle.getPropertyValue("-moz-transform") || 12764 timelineStyle.getPropertyValue("-ms-transform") || 12765 timelineStyle.getPropertyValue("-o-transform") || 12766 timelineStyle.getPropertyValue("transform"); 12767 12768 if( timelineTranslate.indexOf('(') >= 0 ) { 12769 var timelineTranslate = timelineTranslate.split('(')[1]; 12770 timelineTranslate = timelineTranslate.split(')')[0]; 12771 timelineTranslate = timelineTranslate.split(','); 12772 var translateValue = timelineTranslate[4]; 12773 } else { 12774 var translateValue = 0; 12775 } 12776 12777 return Number(translateValue); 12778 } 12779 12780 function setTransformValue(element, property, value) { 12781 element.style["-webkit-transform"] = property+"("+value+")"; 12782 element.style["-moz-transform"] = property+"("+value+")"; 12783 element.style["-ms-transform"] = property+"("+value+")"; 12784 element.style["-o-transform"] = property+"("+value+")"; 12785 element.style["transform"] = property+"("+value+")"; 12786 } 12787 12788 //based on http://stackoverflow.com/questions/542938/how-do-i-get-the-number-of-days-between-two-dates-in-javascript 12789 function parseDate(events) { 12790 var dateArrays = []; 12791 events.each(function(){ 12792 var singleDate = $(this), 12793 dateComp = singleDate.data('date').split('T'); 12794 if( dateComp.length > 1 ) { //both DD/MM/YEAR and time are provided 12795 var dayComp = dateComp[0].split('/'), 12796 timeComp = dateComp[1].split(':'); 12797 } else if( dateComp[0].indexOf(':') >=0 ) { //only time is provide 12798 var dayComp = ["2000", "0", "0"], 12799 timeComp = dateComp[0].split(':'); 12800 } else { //only DD/MM/YEAR 12801 var dayComp = dateComp[0].split('/'), 12802 timeComp = ["0", "0"]; 12803 } 12804 var newDate = new Date(dayComp[2], dayComp[1]-1, dayComp[0], timeComp[0], timeComp[1]); 12805 dateArrays.push(newDate); 12806 }); 12807 return dateArrays; 12808 } 12809 12810 function daydiff(first, second) { 12811 return Math.round((second-first)); 12812 } 12813 12814 function minLapse(dates) { 12815 //determine the minimum distance among events 12816 var dateDistances = []; 12817 for (var i = 1; i < dates.length; i++) { 12818 var distance = daydiff(dates[i-1], dates[i]); 12819 dateDistances.push(distance); 12820 } 12821 return Math.min.apply(null, dateDistances); 12822 } 12823 12824 /* 12825 How to tell if a DOM element is visible in the current viewport? 12826 http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport 12827 */ 12828 function elementInViewport(el) { 12829 var top = el.offsetTop; 12830 var left = el.offsetLeft; 12831 var width = el.offsetWidth; 12832 var height = el.offsetHeight; 12833 12834 while(el.offsetParent) { 12835 el = el.offsetParent; 12836 top += el.offsetTop; 12837 left += el.offsetLeft; 12838 } 12839 12840 return ( 12841 top < (window.pageYOffset + window.innerHeight) && 12842 left < (window.pageXOffset + window.innerWidth) && 12843 (top + height) > window.pageYOffset && 12844 (left + width) > window.pageXOffset 12845 ); 12846 } 12847 12848 function checkMQ() { 12849 //check if mobile or desktop device 12850 return window.getComputedStyle(document.querySelector('.qode-horizontal-timeline'), '::before').getPropertyValue('content').replace(/'/g, "").replace(/"/g, ""); 12851 } 12852 } 12853 12854})(jQuery); 12855(function($) { 12856 'use strict'; 12857 12858 var elementorInfoCardWithIcon = {}; 12859 qode.modules.elementorInfoCardWithIcon = elementorInfoCardWithIcon; 12860 12861 elementorInfoCardWithIcon.qodeInitElementorInfoCardWithIcon = qodeInitElementorInfoCardWithIcon; 12862 12863 12864 elementorInfoCardWithIcon.qodeOnWindowLoad = qodeOnWindowLoad; 12865 12866 $(window).on('load', qodeOnWindowLoad); 12867 12868 /* 12869 ** All functions to be called on $(window).load() should be in this function 12870 */ 12871 function qodeOnWindowLoad() { 12872 qodeInitElementorInfoCardWithIcon(); 12873 } 12874 12875 function qodeInitElementorInfoCardWithIcon(){ 12876 $j(window).on('elementor/frontend/init', function () { 12877 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_info_card_with_icon.default', function() { 12878 qodeIcon().init(); 12879 } ); 12880 }); 12881 } 12882 12883})(jQuery); 12884(function($) { 12885 'use strict'; 12886 12887 var elementorInteractiveIconShowcase = {}; 12888 qode.modules.elementorInteractiveIconShowcase = elementorInteractiveIconShowcase; 12889 12890 elementorInteractiveIconShowcase.qodeInitElementorInteractiveIconShowcase = qodeInitElementorInteractiveIconShowcase; 12891 12892 12893 elementorInteractiveIconShowcase.qodeOnWindowLoad = qodeOnWindowLoad; 12894 12895 $(window).on('load', qodeOnWindowLoad); 12896 12897 /* 12898 ** All functions to be called on $(window).load() should be in this function 12899 */ 12900 function qodeOnWindowLoad() { 12901 qodeInitElementorInteractiveIconShowcase(); 12902 } 12903 12904 function qodeInitElementorInteractiveIconShowcase(){ 12905 $j(window).on('elementor/frontend/init', function () { 12906 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_interactive_icon_showcase.default', function() { 12907 qodeInitInteractiveIconShowcase(); 12908 } ); 12909 }); 12910 } 12911 12912})(jQuery); 12913 12914(function ($) { 12915 'use strict'; 12916 12917 var interactiveLinks = {}; 12918 qode.modules.interactiveLinks = interactiveLinks; 12919 12920 interactiveLinks.qodeInteractiveLinks = qodeInteractiveLinks; 12921 12922 12923 interactiveLinks.qodeOnDocumentReady = qodeOnDocumentReady; 12924 interactiveLinks.qodeOnWindowLoad = qodeOnWindowLoad; 12925 12926 $(document).ready(qodeOnDocumentReady); 12927 $(window).on('load', qodeOnWindowLoad); 12928 12929 /* 12930 All functions to be called on $(document).ready() should be in this function 12931 */ 12932 function qodeOnDocumentReady() { 12933 qodeInteractiveLinks(); 12934 } 12935 12936 /* 12937 All functions to be called on $(window).load() should be in this function 12938 */ 12939 function qodeOnWindowLoad() { 12940 qodeElementorInteractiveLinks(); 12941 } 12942 12943 12944 function qodeInteractiveLinks() { 12945 var holders = $('.qode-interactive-links'); 12946 12947 if (holders.length) { 12948 holders.each(function () { 12949 var thisHolder = $(this), 12950 links = thisHolder.find('.qode-il-titles-holder .qode-il-link'), 12951 images = thisHolder.find('.qode-il-image'); 12952 12953 if( links.length ){ 12954 links.eq(0).addClass('qode-active'); 12955 images.eq(0).addClass('qode-active'); 12956 12957 links.each(function(){ 12958 var thisLink = $(this); 12959 12960 thisLink.on('mouseenter', function(){ 12961 if( ! thisLink.hasClass('qode-active') ) { 12962 var index = thisLink.data('index'); 12963 images.removeClass('qode-active'); 12964 links.removeClass('qode-active'); 12965 thisLink.addClass('qode-active'); 12966 images.eq(index).addClass('qode-active'); 12967 } 12968 }) 12969 }) 12970 } 12971 }); 12972 } 12973 } 12974 12975 function qodeElementorInteractiveLinks(){ 12976 $j(window).on('elementor/frontend/init', function () { 12977 elementorFrontend.hooks.addAction( 'frontend/element_ready/qode_interactive_links.default', function() { 12978 qodeInteractiveLinks(); 12979 } ); 12980 }); 12981 } 12982 12983})(jQuery); 12984(function($) { 12985 'use strict'; 12986 12987 var elementorInteractiveProjectList = {}; 12988 qode.modules.elementorInteractiveProjectList = elementorInteractiveProjectList; 12989 12990 elementorInteractiveProjectList.qodeInitElementorInteractiveProjectList = qodeInitElementorInteractiveProjectList; 12991 12992 12993 elementorInteractiveProjectList.qodeOnWindowLoad = qodeOnWindowLoad; 12994 12995 $(window).on('load', qodeOnWindowLoad); 12996 12997 /* 12998 ** All functions to be called on $(window).load() should be in this function 12999 */ 13000 function qodeOnWindowLoad() { 13001 qodeInitElementorInteractiveProjectList(); 13002 } 13003 13004 function qodeInitElementorInteractiveProjectList(){ 13005 $j(window).on('elementor/frontend/init', function () { 13006 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_interactive_project_list.default', function() { 13007 qode.modules.interactiveProjectList.qodeInitInteractiveProjectList(); 13008 qode.modules.interactiveProjectList.qodeInitPortfolioInteractiveLinkShowcase(); 13009 } ); 13010 }); 13011 } 13012 13013})(jQuery); 13014 13015(function($) { 13016 'use strict'; 13017 13018 var interactiveProjectList = {}; 13019 qode.modules.interactiveProjectList = interactiveProjectList; 13020 13021 interactiveProjectList.qodeInitInteractiveProjectList = qodeInitPortfolioInteractiveItemShowcase; 13022 interactiveProjectList.qodeInitPortfolioInteractiveLinkShowcase = qodeInitPortfolioInteractiveLinkShowcase; 13023 13024 13025 interactiveProjectList.qodeOnDocumentReady = qodeOnDocumentReady; 13026 13027 $(document).ready(qodeOnDocumentReady); 13028 13029 /* 13030 ** All functions to be called on $(window).load() should be in this function 13031 */ 13032 function qodeOnDocumentReady() { 13033 qodeInitPortfolioInteractiveItemShowcase(); 13034 qodeInitPortfolioInteractiveLinkShowcase(); 13035 qodeOutlineTextAnimation(); 13036 } 13037 13038 function qodeInitPortfolioInteractiveItemShowcase() { 13039 var projectList = $('.qode-interactive-project-list'); 13040 13041 if (projectList.length) { 13042 projectList.each(function () { 13043 var holder = $(this), 13044 item = holder.find('.qode-ipl-item'), 13045 backgroundImagesHolder = holder.find('.qode-ipl-right'), 13046 backgroundImages = backgroundImagesHolder.find('.qode-ipl-image'), 13047 indexCounterImg = 0, 13048 indexCounterItem = 0; 13049 13050 backgroundImages.each(function() { 13051 $(this).attr('img-index', indexCounterImg); 13052 $(this).data('img-index', indexCounterImg); 13053 indexCounterImg++; 13054 }); 13055 13056 item.each(function() { 13057 $(this).attr('data-index', indexCounterItem); 13058 $(this).data('data-index', indexCounterItem); 13059 indexCounterItem++; 13060 }); 13061 13062 item.each(function () { 13063 var thisItem = $(this), 13064 thisTitle = thisItem.find('.qode-ipl-title:not(.qode-ipl-responsive-title)'), 13065 thisLink = thisItem.find('.qode-pli-link'); 13066 13067 thisItem.find(thisLink).appendTo(thisTitle); 13068 }); 13069 13070 item.on('mouseenter', function () { 13071 var currentIndex = $(this).data('data-index'); 13072 backgroundImages.css('opacity', 0); 13073 backgroundImagesHolder.find('.qode-ipl-image[img-index="'+ currentIndex +'"]').css('opacity', 1); 13074 }).on('mouseleave', function () { 13075 }); 13076 }); 13077 } 13078 } 13079 13080 function qodeInitPortfolioInteractiveLinkShowcase() { 13081 var interactiveLinkShowcase = $('.qode-interactive-project-list'); 13082 13083 if (interactiveLinkShowcase.length) { 13084 interactiveLinkShowcase.each(function () { 13085 var thisInteractiveLinkShowcase = $(this), 13086 singleImage = thisInteractiveLinkShowcase.find('.qode-ipl-right .qode-ipl-image'), 13087 singleLink = thisInteractiveLinkShowcase.find('.qode-ipl-left .qode-ipl-item'); 13088 13089 singleImage.eq(0).addClass('qode-active'); 13090 singleLink.eq(0).addClass('qode-active'); 13091 thisInteractiveLinkShowcase.find('.qode-ipl-left .qode-ipl-item[data-index="0"]').addClass('qode-active'); 13092 13093 singleLink.children().on('touchstart mouseenter', function () { 13094 var thisLink = $(this).parent(), 13095 index = parseInt(thisLink.data('index'), 10); 13096 13097 singleImage.removeClass('qode-active').eq(index).addClass('qode-active'); 13098 singleLink.removeClass('qode-active'); 13099 thisInteractiveLinkShowcase.find('.qode-ipl-left .qode-ipl-item[data-index="' + index + '"]').addClass('qode-active'); 13100 }); 13101 }); 13102 } 13103 } 13104 13105 function qodeOutlineTextAnimation() { 13106 var interactiveShowcase = $('.qode-interactive-project-list'); 13107 13108 if (interactiveShowcase.length) { 13109 interactiveShowcase.each(function () { 13110 var thisShowcase = $(this); 13111 13112 thisShowcase.find('.qode-ipl-item').each(function () { 13113 var thisItemTitle = $(this).find('.qode-ipl-title:not(.qode-ipl-responsive-title)'); 13114 var thisItemText = thisItemTitle.text(); 13115 thisItemTitle.attr('data-title', thisItemText); 13116 }); 13117 }); 13118 } 13119 } 13120 13121})(jQuery); 13122(function($) { 13123 'use strict'; 13124 13125 var elementorInterestRateCalculator = {}; 13126 qode.modules.elementorInterestRateCalculator = elementorInterestRateCalculator; 13127 13128 elementorInterestRateCalculator.qodeInitElementorInterestRateCalculator = qodeInitElementorInterestRateCalculator; 13129 13130 13131 elementorInterestRateCalculator.qodeOnWindowLoad = qodeOnWindowLoad; 13132 13133 $(window).on('load', qodeOnWindowLoad); 13134 13135 /* 13136 ** All functions to be called on $(window).load() should be in this function 13137 */ 13138 function qodeOnWindowLoad() { 13139 qodeInitElementorInterestRateCalculator(); 13140 } 13141 13142 function qodeInitElementorInterestRateCalculator(){ 13143 $j(window).on('elementor/frontend/init', function () { 13144 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_interest_rate_calculator.default', function() { 13145 qode.modules.interestRateCalculator.qodeInitInterestRateCalculator(); 13146 } ); 13147 }); 13148 } 13149 13150})(jQuery); 13151 13152(function($) { 13153 'use strict'; 13154 13155 var interestRateCalculator = {}; 13156 qode.modules.interestRateCalculator = interestRateCalculator; 13157 13158 interestRateCalculator.qodeInitInterestRateCalculator = qodeInitInterestRateCalculator; 13159 13160 13161 interestRateCalculator.qodeOnWindowLoad = qodeOnWindowLoad; 13162 13163 $(document).ready(qodeOnWindowLoad); 13164 13165 /* 13166 All functions to be called on $(window).load() should be in this function 13167 */ 13168 function qodeOnWindowLoad() { 13169 qodeInitInterestRateCalculator(); 13170 } 13171 13172 13173 function qodeInitInterestRateCalculator(){ 13174 qodeInitRangeSlider(); 13175 } 13176 13177 function qodeInitRangeSlider(){ 13178 13179 var holder = $('.qode-irc-holder'); 13180 13181 if(holder.length){ 13182 holder.each(function(){ 13183 var holder1 = $(this); 13184 var slider = holder1.find('.irc-range-slider'); 13185 var interestRate; 13186 13187 if(holder1.data('rate')!=''){ 13188 interestRate = parseFloat(holder1.data('rate')); 13189 } 13190 13191 // Rangeslider initialization 13192 s
13192lider.rangeslider({ 13193 polyfill: false, 13194 onInit: function(position, value) { 13195 if(holder1.data('active-color')!=''){ 13196 var activeColor = holder1.data('active-color'); 13197 holder1.find('.rangeslider__fill').css('background-color',activeColor); 13198 holder1.find('.rangeslider__handle').css('background-color',activeColor); 13199 } 13200 qodeInterestRateCalculate(holder1, interestRate); 13201 }, 13202 onSlide: function(position, value) { 13203 qodeInterestRateCalculate(holder1, interestRate); 13204 } 13205 }); 13206 }) 13207 } 13208 13209 } 13210 13211 function qodeInterestRateCalculate(holder, interestRate){ 13212 13213 var loanSlider = holder.find('.irc-range-slider-loan'); 13214 var periodSlider = holder.find('.irc-range-slider-period'); 13215 var borrowHolder = holder.find('.qode-irc-borrow-row .qode-irc-value'); 13216 var interestHolder = holder.find('.qode-irc-interest-row .qode-irc-value'); 13217 var totalHolder = holder.find('.qode-irc-total-row .qode-irc-value'); 13218 var currentLoanHolder = holder.find('.qode-irc-slider-loan-value.irc-current .irc-current-value'); 13219 var currentPeriodHolder = holder.find('.qode-irc-slider-period-value.irc-current .irc-current-value'); 13220 var loanValue, periodValue, interest, borrow, total; 13221 13222 loanValue = parseFloat(loanSlider.val()); 13223 periodValue = parseFloat(periodSlider.val()); 13224 interest = loanValue * interestRate / 100; 13225 total = loanValue + interest; 13226 if(periodValue != 0){ 13227 borrow = total / periodValue; 13228 } 13229 borrowHolder.html(Math.round(borrow*100)/100); 13230 interestHolder.html(Math.round(interest*100)/100); 13231 totalHolder.html(Math.round(total*100)/100); 13232 currentLoanHolder.html(loanValue); 13233 currentPeriodHolder.html(periodValue); 13234 13235 } 13236 13237})(jQuery); 13238(function($) { 13239 'use strict'; 13240 13241 var elementorPortfolioCarousel = {}; 13242 qode.modules.elementorPortfolioCarousel = elementorPortfolioCarousel; 13243 13244 elementorPortfolioCarousel.qodeInitElementorPortfolioCarousel = qodeInitElementorPortfolioCarousel; 13245 13246 13247 elementorPortfolioCarousel.qodeOnWindowLoad = qodeOnWindowLoad; 13248 13249 $(window).on('load', qodeOnWindowLoad); 13250 13251 /* 13252 ** All functions to be called on $(window).load() should be in this function 13253 */ 13254 function qodeOnWindowLoad() { 13255 qodeInitElementorPortfolioCarousel(); 13256 } 13257 13258 function qodeInitElementorPortfolioCarousel(){ 13259 $j(window).on('elementor/frontend/init', function () { 13260 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_portfolio_carousel.default', function() { 13261 qode.modules.portfolioCarousel.qodePortfolioCarousel(); 13262 qode.modules.portfolioCarousel.qodeInitPortfolioCarouselCustomCursor(); 13263 } ); 13264 }); 13265 } 13266 13267})(jQuery); 13268 13269(function ($) { 13270 'use strict'; 13271 13272 var invertedPortfolioSlider = {}; 13273 qode.modules.invertedPortfolioSlider = invertedPortfolioSlider; 13274 13275 invertedPortfolioSlider.qodeInvertedPortfolioSlider = qodeInvertedPortfolioSlider; 13276 invertedPortfolioSlider.qodeOnDocumentReady = qodeOnDocumentReady; 13277 13278 $(document).ready(qodeOnDocumentReady); 13279 13280 /* 13281 All functions to be called on $(document).ready() should be in this function 13282 */ 13283 function qodeOnDocumentReady() { 13284 qodeInvertedPortfolioSlider(); 13285 } 13286 13287 13288 function qodeInvertedPortfolioSlider() { 13289 13290 var holder = $j('.qode-inverted-portfolio-slider'); 13291 13292 if (holder.length) { 13293 13294 holder.each(function () { 13295 var sliderOptions = typeof $j(this).data('options') !== 'undefined' ? $j(this).data('options') : {}, 13296 autoplay = sliderOptions.autoplay !== undefined && sliderOptions.autoplay !== '' ? sliderOptions.autoplay : true, 13297 mousewheel = sliderOptions.mousewheel !== undefined && sliderOptions.mousewheel !== '' ? sliderOptions.mousewheel : false, 13298 speed = sliderOptions.speed !== undefined && sliderOptions.speed !== '' ? parseInt(sliderOptions.speed, 10) : 5000, 13299 speedAnimation = sliderOptions.speedAnimation !== undefined && sliderOptions.speedAnimation !== '' ? parseInt(sliderOptions.speedAnimation, 10) : 800, 13300 loop = sliderOptions.loop !== undefined && sliderOptions.loop !== '' ? sliderOptions.loop : true, 13301 drag = sliderOptions.enableDrag !== undefined && sliderOptions.enableDrag !== '' && sliderOptions.enableDrag == 'yes' ? 1 : 0, 13302 slidesPerView = sliderOptions.slidesPerView !== undefined && sliderOptions.slidesPerView !== '' ? sliderOptions.slidesPerView : 'auto', 13303 grabCursor = drag == '0' ? false : true; 13304 13305 if (autoplay === true) { 13306 autoplay = { 13307 delay: speed, 13308 disableOnInteraction: false 13309 }; 13310 } 13311 13312 var mySwiper = new Swiper ('.swiper-container', { 13313 slideEffect: 'fade', 13314 loop: loop, 13315 slidesPerView: slidesPerView, 13316 centeredSlides: false, 13317 autoplay: autoplay, 13318 spaceBetween: 0, 13319 mousewheel: mousewheel, 13320 speed: speedAnimation, 13321 touchRatio: drag, 13322 grabCursor: grabCursor, 13323 navigation: { 13324 nextEl: '.qode-ips-button-next', 13325 prevEl: '.qode-ips-button-prev', 13326 }, 13327 }) 13328 }) 13329 } 13330 } 13331 13332})(jQuery); 13333(function($) { 13334 'use strict'; 13335 13336 var elementorItemShowcase = {}; 13337 qode.modules.elementorItemShowcase = elementorItemShowcase; 13338 13339 elementorItemShowcase.qodeInitElementorItemShowcase = qodeInitElementorItemShowcase; 13340 13341 13342 elementorItemShowcase.qodeOnWindowLoad = qodeOnWindowLoad; 13343 13344 $(window).on('load', qodeOnWindowLoad); 13345 13346 /* 13347 ** All functions to be called on $(window).load() should be in this function 13348 */ 13349 function qodeOnWindowLoad() { 13350 qodeInitElementorItemShowcase(); 13351 } 13352 13353 function qodeInitElementorItemShowcase(){ 13354 $j(window).on('elementor/frontend/init', function () { 13355 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_item_showcase.default', function() { 13356 qodeLazyImages(); 13357 initItemShowcase(); 13358 } ); 13359 }); 13360 } 13361 13362})(jQuery); 13363 13364(function($) { 13365 'use strict'; 13366 13367 var multiDeviceShowcase = {}; 13368 qode.modules.multiDeviceShowcase = multiDeviceShowcase; 13369 13370 multiDeviceShowcase.qodeInitMultiDeviceShowcase = qodeInitMultiDeviceShowcase; 13371 13372 multiDeviceShowcase.qodeOnDocumentReady = qodeOnDocumentReady; 13373 13374 $(document).ready(qodeOnDocumentReady); 13375 13376 /* 13377 ** All functions to be called on $(document).ready() should be in this function 13378 */ 13379 function qodeOnDocumentReady() { 13380 qodeInitMultiDeviceShowcase(); 13381 } 13382 13383 /* 13384 ** Init Multi-Device Showcase shortcode 13385 */ 13386 function qodeInitMultiDeviceShowcase(){ 13387 var mds = $('#qode-multi-device-showcase'); 13388 13389 if (mds.length) { 13390 var shortcodeHeight = mds.height(), 13391 shortcodeOffset = mds.offset().top, 13392 shortcodeArea = shortcodeHeight - shortcodeOffset, 13393 laptopSlider = $('#qode-mds-laptop-slider'), 13394 laptopSlides = laptopSlider.find('.qode-mds-slide'), 13395 tabletSlider = $('#qode-mds-tablet-slider'), 13396 tabletSlides = tabletSlider.find('.qode-mds-slide'), 13397 phoneSlider = $('#qode-mds-phone-slider'), 13398 phoneSlides = phoneSlider.find('.qode-mds-slide'), 13399 spinner = $("#qode-mds-spinner"),
13400 prepped = false, //slides given active class 13401 initialized = false, //first scroll done 13402 readyToScroll = false; //flag for one scroll effect 13403 13404 //fullscreen calcs 13405 var fullscreenCalcs = function() { 13406 var heightVal = $window_height - mds.offset().top; 13407 mds.css('height', heightVal); 13408 } 13409 13410 //fix sizes to prevent flicker on slide animation 13411 var fixSizes = function(slider) { 13412 var slidesInnerHolders = slider.find('.qode-mds-slides-inner'); 13413 13414 slidesInnerHolders.each(function(){ 13415 var slidesInnerHolder = $(this), 13416 heightVal = Math.round(slidesInnerHolder.parent().height() - 1), 13417 widthVal = Math.round(slidesInnerHolder.parent().width() - 1); 13418 13419 slidesInnerHolder.css({ 13420 'height': heightVal, 13421 'width': widthVal 13422 }); 13423 }); 13424 } 13425 13426 //set active classes for first slides 13427 var prepSlides = function(slides, slider, numberOfSliders, sliderIndex) { 13428 slides.first().addClass('qode-active qode-mds-no-animation'); 13429 13430 if (!prepped && (sliderIndex == numberOfSliders)) { 13431 prepped = true; 13432 $(document).trigger('qodeMDSSlidePrepped'); 13433 } 13434 } 13435 13436 //slideshow loop 13437 var nextSlide = function(slides) { 13438 if (slides.filter('.qode-active').next().index() > 0) { 13439 slides.removeClass('qode-remove qode-mds-no-animation'); 13440 slides.filter('.qode-active').removeClass('qode-active').addClass('qode-remove'); 13441 slides.filter('.qode-remove').next().addClass('qode-active'); 13442 } else { 13443 slides.removeClass('qode-active qode-remove qode-mds-no-animation'); 13444 slides.last().addClass('qode-remove'); 13445 slides.first().addClass('qode-active'); 13446 } 13447 } 13448 13449 var initDeviceSliders = function() { 13450 var sliders = laptopSlider.add(tabletSlider).add(phoneSlider), 13451 numberOfSliders = sliders.length, 13452 startDelay = mds.data('start-delay'), //slideshow start delay 13453 slideInterval = mds.data('slide-interval'); //slideshow repeat interval 13454 13455 sliders.each(function(i){ 13456 var slider = $(this), 13457 slides = slider.find('.qode-mds-slide'), 13458 numberOfSlides = slides.length; 13459 13460 prepSlides(slides, slider, numberOfSliders, i+1); 13461 }); 13462 13463 qodeRequestAnimationFrame(); //init raf shim 13464 mds.addClass('qode-mds-animating'); //slideshow ready 13465 13466 //to upgrade: not to require all sliders for slideshow 13467 //to upgrade: if one image set in slider, no slideshow 13468 var slideSequence = function() { 13469 //laptop, tablet, phone - all visible OR laptop visible only 13470 if (tabletSlider.is(':visible') && phoneSlider.is(':visible')) { 13471 //laptop slide 13472 nextSlide(laptopSlides); 13473 laptopSlider.one(qode.animationEnd, function(){ 13474 //tablet slide 13475 nextSlide(tabletSlides); 13476 tabletSlider.one(qode.animationEnd, function(){ 13477 //phone slide 13478 nextSlide(phoneSlides); 13479 phoneSlider.one(qode.animationEnd, function(){ 13480 //repeat 13481 setTimeout(function(){ 13482 requestAnimFrame(slideSequence); 13483 }, slideInterval); 13484 }); 13485 }); 13486 }); 13487 } else { 13488 //laptop slide 13489 nextSlide(laptopSlides); 13490 laptopSlider.one(qode.animationEnd, function(){ 13491 //repeat 13492 setTimeout(function(){ 13493 requestAnimFrame(slideSequence); 13494 }, slideInterval); 13495 }); 13496 } 13497 } 13498 13499 //slideshow sequence start 13500 setTimeout(function(){ 13501 slideSequence(); 13502 }, startDelay); 13503 } 13504 13505 //loading appear animation fx on non-touch devices 13506 var appearAnimation = function() { 13507 if (mds.hasClass('qode-mds-appear-effect') && !$('html').hasClass('touch')) { 13508 var deviceHolders = mds.find('.qode-mds-device-holder'), 13509 contentHolder = mds.find('.qode-mds-content-holder'); 13510 13511 mds.addClass('qode-mds-loading'); 13512 13513 spinner.fadeOut(300, function(){ 13514 deviceHolders.addClass('qode-show-device'); 13515 mds.one(qode.transitionEnd, function(){ 13516 contentHolder.addClass('qode-show-item'); 13517 contentHolder.last().one(qode.transitionEnd, function(){ 13518 if (!readyToScroll) { 13519 readyToScroll = true; 13520 $(document).trigger('qodeMDSReadyToScroll'); 13521 } 13522 }); 13523 }); 13524 }); 13525 } else { 13526 spinner.fadeOut(300); 13527 if (!readyToScroll) { 13528 readyToScroll = true; 13529 $(document).trigger('qodeMDSReadyToScroll'); 13530 } 13531 } 13532 } 13533 13534 //mds scroll initialized 13535 var mdsScrollStart = function() { 13536 if (!initialized) { 13537 initialized = true; 13538 //if filter present blink fix if page scrolled initially 13539 if ($('.qode-demos-filter-holder').length) { 13540 $('.qode-demos-filter-holder').css('visibility','visible'); 13541 } 13542 } 13543 } 13544 13545 //perform one scroll effect 13546 var scrollWheelBehavior = function() { 13547 if (mds.hasClass('qode-mds-one-scroll-to-content') && !$('html').hasClass('touch')) { 13548 var shortcode = mds, 13549 scrollingForward = false, 13550 pageJump = false, 13551 reInitOneScroll = false, 13552 normalScroll = true, 13553 fixScroll = false;
13554 13555 var scrollHandler = function() { 13556 if ($(window).scrollTop() < shortcodeArea) { 13557 normalScroll = false; 13558 } 13559 13560 var qScrollTo = function() { 13561 mdsScrollStart(); 13562 pageJump = true; 13563 $('html, body').stop(true).animate({ 13564 scrollTop: shortcodeArea 13565 }, 1000, 'easeInOutQuint', function() { 13566 fixScroll = true; 13567 if (fixScroll) { 13568 $(window).scrollTop(shortcodeArea); 13569 } 13570 $(window).scroll(function(){ 13571 if (fixScroll) { 13572 $(window).scrollTop(shortcodeArea); 13573 } 13574 }); 13575 normalScroll = true; 13576 reInitOneScroll = false; 13577 setTimeout(function(){ 13578 pageJump = false; 13579 fixScroll = false; 13580 $(document).trigger('qodeMDSScrolled'); 13581 }, 200); 13582 }); 13583 } 13584 13585 //update values 13586 $(window).scroll(function(){ 13587 if ($scroll < shortcodeArea) { 13588 reInitOneScroll = true; 13589 13590 if (scrollingForward) { 13591 normalScroll = false; 13592 } 13593 } 13594 }); 13595 13596 //wheel handle 13597 window.addEventListener('wheel', function(event) { 13598 if ($scroll < shortcodeArea) { 13599 var wheelScroll = event.deltaY; 13600 13601 if (wheelScroll > 0) { 13602 scrollingForward = true; 13603 } else { 13604 scrollingForward = false; 13605 } 13606 13607 if (!pageJump && !normalScroll) { 13608 if (scrollingForward) { 13609 event.preventDefault(); 13610 qScrollTo(); 13611 } 13612 } else { 13613 if (!normalScroll) { 13614 event.preventDefault(); 13615 } 13616 if (normalScroll && !scrollingForward && reInitOneScroll) { 13617 pageJump = false; 13618 normalScroll = false; 13619 event.preventDefault(); 13620 } 13621 } 13622 } 13623 13624 if (pageJump) { 13625 event.preventDefault(); 13626 } 13627 }); 13628 13629 //scrollbar click 13630 $(document).on('mousedown', function(event){ 13631 if(($(window).outerWidth() <= event.pageX) && ($scroll <= shortcodeArea)) { 13632 event.preventDefault(); 13633 qScrollTo(); 13634 } 13635 }); 13636 } 13637 13638 //prevent mousewheel scroll 13639 window.addEventListener('wheel', function (event) { 13640 if (!readyToScroll || !initialized) { 13641 event.preventDefault(); 13642 } 13643 }); 13644 13645 //prevent scrollbar scroll 13646 window.addEventListener('scroll', function () { 13647 if (!readyToScroll || !initialized) { 13648 $(window).scrollTop(shortcodeOffset); 13649 } 13650 }) 13651 13652 //init scroll handler 13653 $(document).on('qodeMDSReadyToScroll', function(){ 13654 scrollHandler(); 13655 }); 13656 } 13657 } 13658 13659 //btn click, works on touch as well 13660 var scrollBtnBehavior = function() { 13661 if (mds.hasClass('qode-mds-btn-scroll-below')) { 13662 var shortcode = mds, 13663 btn = mds.find('.qode-mds-button-holder .qbutton'); 13664 13665 btn.on('click', function(event) { 13666 event.preventDefault(); 13667 13668 if (readyToScroll) { 13669 mdsScrollStart(); 13670 13671 $('html, body').stop().animate({ 13672 scrollTop: shortcodeArea 13673 }, 1000, 'easeInOutQuint', function() { 13674 $(document).trigger('qodeMDSScrolled'); 13675 }); 13676 } 13677 13678 return false; 13679 }); 13680 } 13681 } 13682 13683 //update shortcode height and offset 13684 var updateCoordinates = function() { 13685 shortcodeHeight = mds.height(); 13686 shortcodeOffset = mds.offset().top; 13687 shortcodeArea = shortcodeHeight - shortcodeOffset; 13688 } 13689 13690 //initialization 13691 scrollWheelBehavior(); 13692 scrollBtnBehavior(); 13693 13694 mds.imagesLoaded({background: true}, function() { 13695 fullscreenCalcs(); 13696 initDeviceSliders(); 13697 }); 13698 13699 $(document).on('qodeMDSSlidePrepped', function(){ 13700 appearAnimation(); 13701 }); 13702 13703 $(window).on('load', function(){ 13704 fixSizes(laptopSlider); 13705 }); 13706 13707 $(window).scroll(function(){ 13708 updateCoordinates(); 13709 }); 13710 13711 $(window).resize(function(){ 13712 fullscreenCalcs(); 13713 updateCoordinates(); 13714 fixSizes(laptopSlider); 13715 }); 13716 } 13717 } 13718})(jQuery); 13719(function($) { 13720 'use strict'; 13721 13722 var elementorNumberedCarousel = {}; 13723 qode.modules.elementorNumberedCarousel = elementorNumberedCarousel; 13724 13725 elementorNumberedCarousel.qodeInitElementorNumberedCarousel = qodeInitElementorNumberedCarousel; 13726 13727 13728 elementorNumberedCarousel.qodeOnWindowLoad = qodeOnWindowLoad; 13729 13730 $(window).on('load', qodeOnWindowLoad); 13731 13732 /* 13733 ** All functions to be called on $(window).load() should be in this function 13734 */ 13735 function qodeOnWindowLoad() { 13736 qodeInitElementorNumberedCarousel(); 13737 } 13738 13739 function qodeInitElementorNumberedCarousel(){ 13740 $j(window).on('elementor/frontend/init', function () { 13741 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_numbered_carousel.default', function() { 13742 qode.modules.numberedCarousel.qodeNumberedCarousel().init(); 13743 } ); 13744 }); 13745 } 13746 13747})(jQuery); 13748 13749(function ($) { 13750 'use strict'; 13751 13752 var numberedCarousel = {}; 13753 qode.modules.numberedCarousel = numberedCarousel; 13754 13755 numberedCarousel.qodeNumberedCarousel = qodeNumberedCarousel; 13756 numberedCarousel.qodeOnDocumentReady = qodeOnDocumentReady; 13757 13758 $(document).ready(qodeOnDocumentReady); 13759 13760 /* 13761 All functions to be called on $(document).ready() should be in this function 13762 */ 13763 function qodeOnDocumentReady() { 13764 qodeNumberedCarousel().init(); 13765 } 13766 13767 /** 13768 * Init Numbered Carousel Shortcode 13769 */ 13770 function qodeNumberedCarousel() { 13771 //initial setup
13772 var setup = function (carousel) { 13773 var swiper = new Swiper(carousel, { 13774 speed: 800, 13775 centeredSlides: true, 13776 slidesPerView: 'auto', 13777 allowTouchMove: false, 13778 init: false 13779 }); 13780 13781 var holder = carousel.closest('.qode-numbered-carousel'), 13782 bgItems = holder.find('.qode-nc-bg-item'), 13783 indicators = holder.find('.qode-nc-indicator'), 13784 gridTrigger = holder.find('.qode-nc-grid-line:last-child'), 13785 ieFallback = qode_body.hasClass('qode-ms-explorer'); 13786 13787 swiper.on('init', function () { 13788 holder.data('items', bgItems.length); 13789 13790 iterate(holder, carousel, bgItems, indicators, carousel.find('.swiper-wrapper')); 13791 changeActiveSlide(holder, swiper); 13792 13793 //initial animation 13794 carousel 13795 .addClass('qode-show') 13796 .one(qode.transitionEnd, function () { 13797 holder.addClass('qode-initialized'); 13798 gridTrigger.one(qode.transitionEnd, function () { 13799 holder.data('idle', true); 13800 }); 13801 ieFallback && holder.data('idle', true); 13802 }); 13803 }); 13804 13805 swiper.on('slideChangeTransitionEnd', function () { 13806 iterate(holder, carousel, bgItems, indicators, carousel.find('.swiper-wrapper')); 13807 13808 //wait for last item to unmask 13809 holder.removeClass('qode-mask'); 13810 gridTrigger.one(qode.transitionEnd, function () { 13811 holder.data('idle', true); 13812 }); 13813 ieFallback && holder.data('idle', true); 13814 }); 13815 13816 //initialize swiper 13817 carousel.waitForImages(swiper.init()); 13818 } 13819 13820 //toggle on every slide iteration 13821 var iterate = function (holder, carousel, bgItems, indicators, wrapper) {
13822 setActiveIndex(holder, carousel); 13823 changeActiveItem(holder, bgItems); 13824 changeActiveItem(holder, indicators); 13825 !qode_body.hasClass('qode-ms-explorer') && roundTransformVal(wrapper); 13826 } 13827 13828 //fix swiper calcs for center layout type 13829 var roundTransformVal = function (wrapper) { 13830 var val = Math.round(wrapper.css('transform').split(',')[4]); 13831 13832 wrapper.css('transform', 'matrix(1, 0, 0, 1, ' + val + ', 0)'); 13833 } 13834 13835 //sets active index to holder element 13836 var setActiveIndex = function (holder, carousel) { 13837 var activeIndex = carousel.find('.swiper-slide-active').data('index'); 13838 holder.data('active-index', activeIndex); 13839 } 13840 13841 //change css class 13842 var changeClass = function (holder, cssClass) { 13843 holder 13844 .removeClass('qode-next qode-prev') 13845 .addClass(cssClass); 13846 } 13847 13848 //declarative item change - bg item, indicators 13849 var changeActiveItem = function (holder, items) { 13850 var activeItem = items.filter(function () { 13851 return $(this).data("index") == holder.data('active-index') 13852 }); 13853 13854 items.removeClass('qode-active'); 13855 activeItem.addClass('qode-active'); 13856 } 13857 13858 //declarative slide change 13859 var changeActiveSlide = function (holder, swiper) { 13860 var delay = 500, 13861 speed = 800; 13862 13863 var slideTo = function (holder, swiper, direction) { 13864 changeClass(holder, 'qode-' + direction); 13865 13866 holder.data('idle', false); 13867 holder.addClass('qode-mask'); 13868 13869 if (direction == 'next') { 13870 setTimeout(function () { 13871 swiper.slideNext(speed); 13872 }, delay); 13873 } else { 13874 //fade before transition 13875 holder.addClass('qode-fade-prev-content'); 13876 setTimeout(function () { 13877 holder.removeClass('qode-fade-prev-content'); 13878 swiper.slidePrev(speed); 13879 }, delay * 1.5); 13880 } 13881 } 13882 13883 var clickHandler = function (e) { 13884 var item = $(e.currentTarget); 13885 13886 if (item.hasClass('swiper-slide-next')) { 13887 holder.data('idle') && slideTo(holder, swiper, 'next'); 13888 } else if (item.hasClass('swiper-slide-prev')) { 13889 holder.data('idle') && slideTo(holder, swiper, 'prev'); 13890 } 13891 } 13892 13893 var wheelHandler = function (e) { 13894 if (holder.data('idle')) { 13895 var direction = e.deltaY > 0 ? 'next' : 'prev', 13896 activeIndex = holder.data('active-index'); 13897 13898 if (direction == 'next' && activeIndex < holder.data('items') || 13899 direction == 'prev' && activeIndex > 1) { 13900 slideTo(holder, swiper, direction); 13901 } 13902 } 13903 } 13904 13905 var touchStart = function (e) { 13906 holder.data('touch-start', parseInt(e.changedTouches[0].clientX)); 13907 } 13908 13909 var touchMove = function (e) { 13910 holder.data('touch-move', parseInt(e.changedTouches[0].clientX)); 13911 13912 var delta = holder.data('touch-move') - holder.data('touch-start'); 13913 13914 if (holder.data('idle')) { 13915 var direction = delta < 0 ? 'next' : 'prev', 13916 activeIndex = holder.data('active-index'); 13917 13918 if (direction == 'next' && activeIndex < holder.data('items') || 13919 direction == 'prev' && activeIndex > 1) { 13920 slideTo(holder, swiper, direction); 13921 } 13922 } 13923 } 13924 13925 holder.on('click', '.swiper-slide', clickHandler); 13926 if (holder.hasClass('qode-change-on-scroll')) { 13927 holder[0].addEventListener('wheel', wheelHandler); 13928 Modernizr.touch && holder[0].addEventListener('touchstart', touchStart); 13929 Modernizr.touch && holder[0].addEventListener('touchmove', touchMove); 13930 } 13931 } 13932 13933 return { 13934 init: function () { 13935 var carousels = $('.qode-numbered-carousel'); 13936 13937 if (carousels.length) { 13938 carousels.each(function () { 13939 var carousel = $(this).find('.swiper-container'); 13940 13941 setup(carousel); 13942 }); 13943 } 13944 } 13945 } 13946 } 13947})(jQuery); 13948(function($) { 13949 'use strict'; 13950 13951 var elementorPortfolioCarousel = {}; 13952 qode.modules.elementorPortfolioCarousel = elementorPortfolioCarousel; 13953 13954 elementorPortfolioCarousel.qodeInitElementorPortfolioCarousel = qodeInitElementorPortfolioCarousel; 13955 13956 13957 elementorPortfolioCarousel.qodeOnWindowLoad = qodeOnWindowLoad; 13958 13959 $(window).on('load', qodeOnWindowLoad); 13960 13961 /* 13962 ** All functions to be called on $(window).load() should be in this function 13963 */ 13964 function qodeOnWindowLoad() { 13965 qodeInitElementorPortfolioCarousel(); 13966 } 13967 13968 function qodeInitElementorPortfolioCarousel(){ 13969 $j(window).on('elementor/frontend/init', function () { 13970 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_portfolio_carousel.default', function() { 13971 qode.modules.portfolioCarousel.qodePortfolioCarousel(); 13972 qode.modules.portfolioCarousel.qodeInitPortfolioCarouselCustomCursor(); 13973 } ); 13974 }); 13975 } 13976 13977})(jQuery); 13978 13979(function ($) { 13980 'use strict'; 13981 13982 var portfolioCarousel = {}; 13983 qode.modules.portfolioCarousel = portfolioCarousel; 13984 13985 portfolioCarousel.qodePortfolioCarousel = qodePortfolioCarousel; 13986 portfolioCarousel.qodeInitPortfolioCarouselCustomCursor = qodeInitPortfolioCarouselCustomCursor; 13987 portfolioCarousel.qodeOnDocumentReady = qodeOnDocumentReady; 13988 13989 $(document).ready(qodeOnDocumentReady); 13990 13991 $(window).on('load', qodeOnWindowLoad); 13992 13993 function qodeOnWindowLoad() { 13994 qodeInitPortfolioCarouselCustomCursor(); 13995 } 13996 13997 /* 13998 All functions to be called on $(document).ready() should be in this function 13999 */ 14000 function qodeOnDocumentReady() { 14001 qodePortfolioCarousel(); 14002 } 14003 14004 14005 function qodePortfolioCarousel() { 14006 14007 var holder = $j('.qode-portfolio-carousel'); 14008 14009 if (holder.length) { 14010 14011 holder.each(function () { 14012 var sliderOptions = typeof $j(this).data('options') !== 'undefined' ? $j(this).data('options') : {}, 14013 autoplay = sliderOptions.autoplay !== undefined && sliderOptions.autoplay !== '' ? sliderOptions.autoplay : true, 14014 mousewheel = sliderOptions.mousewheel !== undefined && sliderOptions.mousewheel !== '' ? sliderOptions.mousewheel : false, 14015 speed = sliderOptions.speed !== undefined && sliderOptions.speed !== '' ? parseInt(sliderOptions.speed, 10) : 5000, 14016 speedAnimation = sliderOptions.speedAnimation !== undefined && sliderOptions.speedAnimation !== '' ? parseInt(sliderOptions.speedAnimation, 10) : 800, 14017 loop = sliderOptions.loop !== undefined && sliderOptions.loop !== '' ? sliderOptions.loop : true, 14018 loopedSlides = 2, 14019 slidesPerView = sliderOptions.slidesPerView !== undefined && sliderOptions.slidesPerView !== '' ? sliderOptions.slidesPerView : 'auto', 14020 pagination = $j(this).find('.swiper-pagination'); 14021 14022 if (autoplay === true) { 14023 autoplay = { 14024 delay: speed, 14025 disableOnInteraction: false 14026 }; 14027 } 14028 14029 var mySwiper = new Swiper ('.swiper-container', { 14030 direction: 'horizontal', 14031 loop: loop, 14032 loopedSlides: loopedSlides, 14033 slidesPerView: slidesPerView, 14034 centeredSlides: false, 14035 autoplay: autoplay, 14036 spaceBetween: 0, 14037 mousewheel: mousewheel, 14038 speed: speedAnimation 14039 }) 14040 }) 14041 } 14042 } 14043 14044 function qodeInitPortfolioCarouselCustomCursor() { 14045 14046 var portCarousel = $('.qode-portfolio-carousel'), 14047 customCursor = $('.qode-pc-custom-cursor'); 14048 14049 portCarousel.each(function () { 14050 var thisPortCarousel = $(this); 14051 14052 //info element position 14053 thisPortCarousel.on('mousemove', function (e) { 14054 customCursor.css({ 14055 top: e.clientY - 65, 14056 left: e.clientX - 65 14057 }); 14058 }); 14059 14060 //show/hide info element 14061 thisPortCarousel.find('.qode-portfolio-carousel-item').on('mouseenter', function () { 14062 if (!customCursor.hasClass('qode-is-active')) { 14063 customCursor.addClass('qode-is-active'); 14064 } 14065 }).on('mouseleave', function () { 14066 if (customCursor.hasClass('qode-is-active')) { 14067 customCursor.removeClass('qode-is-active'); 14068 } 14069 }); 14070 14071 //check if info element is below or above the targeted portfolio list 14072 $(window).scroll(function(){ 14073 if (customCursor.hasClass('qode-is-active')) { 14074 if (customCursor.offset().top < thisPortCarousel.offset().top || customCursor.offset().top > thisPortCarousel.offset().top + thisPortCarousel.outerHeight()) { 14075 customCursor.removeClass('qode-is-active'); 14076 } 14077 } 14078 }); 14079 }); 14080 } 14081 14082})(jQuery); 14083(function($) { 14084 'use strict'; 14085 14086 var elementorPortfolioListStacked = {}; 14087 qode.modules.elementorPortfolioListStacked = elementorPortfolioListStacked; 14088 14089 elementorPortfolioListStacked.qodeInitElementorPortfolioListStacked = qodeInitElementorPortfolioListStacked; 14090 14091 14092 elementorPortfolioListStacked.qodeOnWindowLoad = qodeOnWindowLoad; 14093 14094 $(window).on('load', qodeOnWindowLoad); 14095 14096 /* 14097 ** All functions to be called on $(window).load() should be in this function 14098 */ 14099 function qodeOnWindowLoad() { 14100 qodeInitElementorPortfolioListStacked(); 14101 } 14102 14103 function qodeInitElementorPortfolioListStacked(){ 14104 $j(window).on('elementor/frontend/init', function () { 14105 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_portfolio_list_stacked.default', function() { 14106 qode.modules.ptfListStacked.qodeInitPortfolioListStacked().init(); 14107 } ); 14108 }); 14109 } 14110 14111})(jQuery); 14112 14113(function ($) { 14114 'use strict'; 14115 14116 var ptfListStacked = {}; 14117 qode.modules.ptfListStacked = ptfListStacked; 14118 14119 ptfListStacked.qodeOnWindowLoad = qodeOnWindowLoad; 14120 ptfListStacked.qodeOnWindowResize = qodeOnWindowResize; 14121 ptfListStacked.qodeInitPortfolioListStacked = qodeInitPortfolioListStacked; 14122 14123 $(window).on('load', qodeOnWindowLoad); 14124 $(window).resize(qodeOnWindowResize); 14125 14126 /* 14127 All functions to be called on $(window).load() should be in this function 14128 */ 14129 function qodeOnWindowLoad() { 14130 qodeInitPortfolioListStacked().init(); 14131 } 14132 14133 /* 14134 All functions to be called on $(window).resize() should be in this function 14135 */ 14136 function qodeOnWindowResize() { 14137 qodeInitPortfolioListStacked().resize(); 14138 } 14139 14140 /** 14141 * Initializes portfolio list stacked 14142 */ 14143 function qodeInitPortfolioListStacked() { 14144 var holder = $('#qode-portfolio-list-stacked'); 14145 14146 if (holder.length) { 14147 //items 14148 holder.items = holder.find('.qode-pls-item'); 14149 holder.total = holder.items.length; 14150 holder.textItems = holder.find('.qode-pls-text-item'); 14151 holder.imgs = holder.find('img'); 14152 holder.info = $('#qode-pls-info'); 14153 holder.endOfScrollVisible = false;
14154 holder.endOfScroll = holder.find('.qode-pls-end-of-scroll'); 14155 //state 14156 holder.activeIndex = 0; 14157 holder.activeText = holder.textItems.first(); 14158 holder.direction = null; 14159 //move 14160 holder.deltaY = 0; 14161 //tilt 14162 holder.tilt = 30; 14163 holder.tX = 0; 14164 holder.tY = 0; 14165 //item move 14166 holder.items.each(function () { 14167 $(this).data('move', 0); 14168 $(this).data('buffer', 0); 14169 }); 14170 } 14171 14172 var setIndexes = function () { 14173 holder.items.each(function () { 14174 var item = $(this); 14175 14176 item.css({ 14177 'z-index': holder.total - item.data('index') 14178 }); 14179 }) 14180 } 14181 14182 var setWidth = function () { 14183 var c = 1; 14184 if (qode.windowWidth <= 1440 && qode.windowWidth > 1024) c = 0.65; 14185 if (qode.windowWidth <= 1024 && qode.windowWidth > 768) c = 0.5; 14186 if (qode.windowWidth <= 768 && qode.windowWidth > 414) c = 0.4; 14187 if (qode.windowWidth <= 414 && qode.windowWidth > 320) c = 0.25; 14188 if (qode.windowWidth <= 320) c = .2; 14189 14190 holder.items.each(function () { 14191 var el = $(this), 14192 w = (el.find('img')[0].naturalWidth / Math.min(qode.windowWidth, 1920) * 100).toFixed(2), 14193 h = (el.find('img')[0].naturalHeight / Math.min(qode.windowHeight, 1080) * 100).toFixed(2); 14194 14195 var css = { 14196 'width': w * c + '%', 14197 'height': h * c + '%' 14198 }; 14199 el.css(css); 14200 }) 14201 }; 14202 14203 var positionItems = function () { 14204 holder.items.each(function () { 14205 var item = $(this), 14206 inner = item.find('.qode-pls-item-inner'), 14207 x = qode.windowWidth >= 1200 ? parseInt(item.data('x')) : parseInt(item.data('x')) * .88, 14208 y = qode.windowWidth > 1024 ? parseInt(item.data('y')) : parseInt(item.data('y')) + 20; 14209 14210 var offsets = { 14211 'top': (y || 50) + '%', 14212 'left': (x || 50) + '%', 14213 } 14214 14215 item.css(offsets); 14216 inner.css('transform', 'translateX(' + parseInt(isNaN(x) ? -50 : 0) + '%) translateY(' + parseInt(isNaN(y) ? -50 : 0) + '%)'); 14217 }); 14218 }; 14219 14220 var offScreen = function (item) { 14221 return item.offset().top <= -item.height() * 0.97 14222 } 14223 14224 var showEndOfScroll = function () { 14225 holder.endOfScrollVisible = true; 14226 holder.endOfScroll.addClass('qode-visible'); 14227 holder.addClass('qode-eos'); 14228 }; 14229 14230 var hideEndOfScroll = function () { 14231 holder.endOfScrollVisible = false; 14232 holder.endOfScroll.removeClass('qode-visible'); 14233 holder.removeClass('qode-eos'); 14234 }; 14235 14236 var getActiveItem = function () { 14237 holder.items.removeClass('qode-active'); 14238 return holder.items.filter(function () { 14239 return $(this).data('index') == holder.activeIndex 14240 }); 14241 }; 14242 14243 var setActiveText = function () { 14244 holder.textItems.removeClass('qode-active'); 14245 holder.activeText = holder.textItems.filter(function () { 14246 return $(this).data('index') == holder.activeIndex 14247 }).addClass('qode-active'); 14248 }; 14249 14250 var movement = function () { 14251 var activeItem = holder.items.filter(function () { 14252 return $(this).data('index') == holder.activeIndex 14253 }); 14254 14255 if (holder.direction == 'next' && offScreen(activeItem.find('img'))) { 14256 holder.activeIndex++; 14257 if (holder.activeIndex == holder.total) holder.deltaY = 0; 14258 holder.activeIndex = Math.min(holder.activeIndex, holder.total - 1); 14259 activeItem = getActiveItem(); 14260 } else if (holder.direction == 'prev') { 14261 if (activeItem.data('move') == 0) { 14262 holder.endOfScrollVisible && hideEndOfScroll(); 14263 holder.activeIndex--; 14264 holder.activeIndex = Math.max(holder.activeIndex, 0); 14265 activeItem = getActiveItem(); 14266 } 14267 } 14268 14269 !holder.endOfScrollVisible && 14270 holder.direction == 'next' && 14271 holder.activeIndex == holder.total - 1 && 14272 Math.abs(activeItem.data('move')) > activeItem.find('img').height() * 0.1 && 14273 showEndOfScroll(); 14274 14275 holder.activeText.data('index') !== holder.activeIndex && setA
14275ctiveText(); 14276 14277 activeItem 14278 .addClass('qode-active') 14279 .data('move', Math.min(activeItem.data('move') + holder.deltaY, 0)) 14280 .css('transform', 'translate3d(0,' + Math.round(activeItem.data('move') - activeItem.data('buffer') * 0.2) + 'px,0)') 14281 .data('buffer', Math.abs(activeItem.data('move'))); 14282 }; 14283 14284 var tiltImages = function () { 14285 holder.items.each(function (i) { 14286 var img = $(this).find('img'), 14287 valX = Math.round(holder.tX * holder.tilt * (i + 1)), 14288 valY = Math.round(holder.tY * holder.tilt * (i + 1)); 14289 14290 img.css('transform', 'translateX(' + valX + 'px) translateY(' + valY + 'px)'); 14291 }); 14292 }; 14293 14294 var mouseWheel = function (e) { 14295 holder.direction = -e.deltaY < 0 ? 'next' : 'prev'; 14296 holder.deltaY = -e.deltaY; 14297 if (Math.abs(holder.deltaY) == 3) holder.deltaY = holder.deltaY * 10; //ffox 14298 requestAnimationFrame(movement); 14299 }; 14300 14301 var mouseMove = function (e) { 14302 holder.tX = 0.5 - e.screenX / qode.windowWidth; 14303 holder.tY = 0.5 - e.screenY / qode.windowHeight; 14304 requestAnimationFrame(tiltImages); 14305 }; 14306 14307 var touchStart = function (e) { 14308 holder.data('y-start', parseInt(e.changedTouches[0].clientY)); 14309 }; 14310 14311 var touchMove = function (e) { 14312 holder.data('y-end', parseInt(e.changedTouches[0].clientY)); 14313 holder.deltaY = holder.data('y-end') - holder.data('y-start'); 14314 holder.direction = holder.deltaY < 0 ? 'next' : 'prev'; 14315 holder.deltaY = Math.min(Math.max(holder.deltaY, -20), 100); 14316 requestAnimationFrame(movement); 14317 }; 14318 14319 var fixedInfo = function (e) { 14320 var moveInfo = function (x, y) { 14321 holder.info.css({ 14322 'transform': 'translate3d(' + x + 'px, ' + y + 'px, 0)' 14323 }); 14324 }; 14325 14326 var handleMove = function (e) { 14327 var x = e.clientX, 14328 y = e.clientY; 14329 14330 requestAnimationFrame(function () { 14331 moveInfo(x, y); 14332 }); 14333 }; 14334 14335 var changeInfo = function (e) { 14336 var index = $(e.currentTarget).closest(holder.items).data('index'); 14337 if (holder.info.data('active') !== index) { 14338 var activeItem = holder.textItems.filter(function () { 14339 return $(this).data('index') == index 14340 }), 14341 titleText = activeItem.find('.qode-pls-title-holder').html(); 14342 14343 holder.info 14344 .data('active', index) 14345 .addClass('qode-show'); 14346 holder.info 14347 .find('.qode-pls-title-holder') 14348 .html(titleText); 14349 } 14350 14351 //custom 14352 $('.qode-page-header').css('pointer-events', 'none'); 14353 }; 14354 14355 var hideInfo = function (e) { 14356 holder.info 14357 .data('active', null) 14358 .removeClass('qode-show'); 14359 14360 //custom 14361 $('.qode-page-header').css('pointer-events', 'auto'); 14362 }; 14363 14364 holder.on('mousemove', handleMove); 14365 holder.on('mousemove', 'img', changeInfo); 14366 holder.on('mouseleave', 'img', hideInfo) 14367 }; 14368 14369 return { 14370 init: function () { 14371 if (holder.length) { 14372 $('html').addClass('qode-overflow'); 14373 holder.items.first().addClass('qode-active'); 14374 holder.textItems.first().addClass('qode-active'); 14375 setWidth(); 14376 positionItems(); 14377 setIndexes(); 14378 holder.waitForImages(function () { 14379 holder.addClass('qode-loaded'); 14380 //scroll support 14381 if (!Modernizr.touch) { 14382 document.body.addEventListener('wheel', mouseWheel); 14383 document.body.addEventListener('mousemove', mouseMove); 14384 fixedInfo(); 14385 } 14386 //touch support 14387 if (Modernizr.touch) { 14388 holder[0].addEventListener('touchstart', touchStart); 14389 holder[0].addEventListener('touchmove', touchMove); 14390 } 14391 }) 14392 } 14393 }, 14394 resize: function () { 14395 if (holder.length) { 14396 positionItems(); 14397 setWidth(); 14398 } 14399 } 14400 }; 14401 } 14402 14403})(jQuery); 14404(function($) { 14405 'use strict'; 14406 14407 var elementorPortfolioProjectSlider = {}; 14408 qode.modules.elementorPortfolioProjectSlider = elementorPortfolioProjectSlider; 14409 14410 elementorPortfolioProjectSlider.qodeInitElementorPortfolioProjectSlider = qodeInitElementorPortfolioProjectSlider; 14411 14412 14413 elementorPortfolioProjectSlider.qodeOnWindowLoad = qodeOnWindowLoad; 14414 14415 $(window).on('load', qodeOnWindowLoad); 14416 14417 /* 14418 ** All functions to be called on $(window).load() should be in this function 14419 */ 14420 function qodeOnWindowLoad() { 14421 qodeInitElementorPortfolioProjectSlider(); 14422 } 14423 14424 function qodeInitElementorPortfolioProjectSlider(){ 14425 $j(window).on('elementor/frontend/init', function () { 14426 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_portfolio_project_slider.default', function() { 14427 qode.modules.portfolioProjectSlider.qodePortfolioProjectSlider(); 14428 } ); 14429 }); 14430 } 14431 14432})(jQuery); 14433 14434(function ($) { 14435 'use strict'; 14436 14437 var portfolioProjectSlider = {}; 14438 qode.modules.portfolioProjectSlider = portfolioProjectSlider; 14439 14440 portfolioProjectSlider.qodePortfolioProjectSlider = qodePortfolioProjectSlider; 14441 portfolioProjectSlider.qodeOnDocumentReady = qodeOnDocumentReady; 14442 14443 $(document).ready(qodeOnDocumentReady); 14444 14445 /* 14446 All functions to be called on $(document).ready() should be in this function 14447 */ 14448 function qodeOnDocumentReady() { 14449 qodePortfolioProjectSlider(); 14450 } 14451 14452 14453 function qodePortfolioProjectSlider() { 14454 14455 var holder = $j('.qode-portfolio-project-slider'); 14456
14457 if (holder.length) { 14458 qode_body.addClass('qode-with-portfolio-project-slider'); 14459 14460 holder.each(function () { 14461 var sliderOptions = typeof $j(this).data('options') !== 'undefined' ? $j(this).data('options') : {}, 14462 autoplay = sliderOptions.autoplay !== undefined && sliderOptions.autoplay !== '' ? sliderOptions.autoplay : true, 14463 mousewheel = sliderOptions.mousewheel !== undefined && sliderOptions.mousewheel !== '' ? sliderOptions.mousewheel : false, 14464 speed = sliderOptions.speed !== undefined && sliderOptions.speed !== '' ? parseInt(sliderOptions.speed, 10) : 5000, 14465 speedAnimation = sliderOptions.speedAnimation !== undefined && sliderOptions.speedAnimation !== '' ? parseInt(sliderOptions.speedAnimation, 10) : 800, 14466 loop = sliderOptions.loop !== undefined && sliderOptions.loop !== '' ? sliderOptions.loop : true, 14467 loopedSlides = 2, 14468 pagination = $j(this).find('.swiper-pagination'); 14469 14470 if (autoplay === true) { 14471 autoplay = { 14472 delay: speed, 14473 disableOnInteraction: false 14474 }; 14475 } 14476 14477 var mySwiper = new Swiper ('.swiper-container', { 14478 direction: 'horizontal', 14479 loop: loop, 14480 loopedSlides: loopedSlides, 14481 slidesPerView: 1.2, 14482 centeredSlides: false, 14483 autoplay: autoplay, 14484 spaceBetween: 0, 14485 mousewheel: mousewheel, 14486 speed: speedAnimation, 14487 pagination: { 14488 el: pagination, 14489 clickable: true, 14490 renderBullet: function (index, className) { 14491 var temp = (index + 1) < 10 ? 0 : ''; 14492 return '<span class="' + className + '">' + temp + (index + 1) + '</span>'; 14493 } 14494 }, 14495 breakpoints: { 14496 // when window width is >= 1 14497 1: { 14498 slidesPerView: 1 14499 }, 14500 // when window width is <= 480px 14501 480: { 14502 slidesPerView: 1 14503 }, 14504 // when window width is <= 680px 14505 680: { 14506 slidesPerView: 1 14507 }, 14508 // when window width is <= 768px 14509 768: { 14510 slidesPerView: 1 14511 }, 14512 // when window width is <= 1024px 14513 1024: { 14514 slidesPerView: 1.15 14515 }, 14516 // when window width is <= 1366px 14517 1366: { 14518 slidesPerView: 1.2 14519 }, 14520 // when window width is <= 1440px 14521 1440: { 14522 slidesPerView: 1.2 14523 } 14524 } 14525 }) 14526 }) 14527 } 14528 14529 14530 } 14531 14532 14533 14534 14535})(jQuery); 14536(function($) { 14537 'use strict'; 14538 14539 var elementorPricingCalculator = {}; 14540 qode.modules.elementorPricingCalculator = elementorPricingCalculator; 14541 14542 elementorPricingCalculator.qodeInitElementorPricingCalculator = qodeInitElementorPricingCalculator; 14543 14544 14545 elementorPricingCalculator.qodeOnWindowLoad = qodeOnWindowLoad; 14546 14547 $(window).on('load', qodeOnWindowLoad); 14548 14549 /* 14550 ** All functions to be called on $(window).load() should be in this function 14551 */ 14552 function qodeOnWindowLoad() { 14553 qodeInitElementorPricingCalculator(); 14554 } 14555 14556 function qodeInitElementorPricingCalculator(){ 14557 $j(window).on('elementor/frontend/init', function () { 14558 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_pricing_calculator.default', function() { 14559 qodeInitPricingCalculator(); 14560 } ); 14561 }); 14562 } 14563 14564})(jQuery); 14565 14566(function($) { 14567 'use strict'; 14568 14569 var elementorScrollingImage = {}; 14570 qode.modules.elementorScrollingImage = elementorScrollingImage; 14571 14572 elementorScrollingImage.qodeInitElementorScrollingImage = qodeInitElementorScrollingImage; 14573 14574 14575 elementorScrollingImage.qodeOnWindowLoad = qodeOnWindowLoad; 14576 14577 $(window).on('load', qodeOnWindowLoad); 14578 14579 /* 14580 ** All functions to be called on $(window).load() should be in this function 14581 */ 14582 function qodeOnWindowLoad() { 14583 qodeInitElementorScrollingImage(); 14584 } 14585 14586 function qodeInitElementorScrollingImage(){ 14587 $j(window).on('elementor/frontend/init', function () { 14588 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_scrolling_image.default', function() { 14589 qodeScrollingImage(); 14590 } ); 14591 }); 14592 } 14593 14594})(jQuery); 14595(function($) { 14596 'use strict'; 14597 14598 var elementorSlidingImageHolder = {}; 14599 qode.modules.elementorSlidingImageHolder = elementorSlidingImageHolder; 14600 14601 elementorSlidingImageHolder.qodeInitElementorSlidingImageHolder = qodeInitElementorSlidingImageHolder; 14602 14603 14604 elementorSlidingImageHolder.qodeOnWindowLoad = qodeOnWindowLoad; 14605 14606 $(window).on('load', qodeOnWindowLoad); 14607 14608 /* 14609 ** All functions to be called on $(window).load() should be in this function 14610 */ 14611 function qodeOnWindowLoad() { 14612 qodeInitElementorSlidingImageHolder(); 14613 } 14614 14615 function qodeInitElementorSlidingImageHolder(){ 14616 $j(window).on('elementor/frontend/init', function () { 14617 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_sliding_image_holder.default', function() { 14618 qodeSlidingImageHolder(); 14619 } ); 14620 }); 14621 } 14622 14623})(jQuery); 14624(function($) { 14625 'use strict'; 14626 14627 $(document).ready(function(){ 14628 qodeInitSplitScrollingSection(); 14629 }); 14630 14631 /* 14632 ** Split Scrolling Section 14633 */ 14634 function qodeInitSplitScrollingSection() {} 14635 14636})(jQuery); 14637(function($) { 14638 'use strict'; 14639 14640 var elementorPortfolioCarousel = {}; 14641 qode.modules.elementorPortfolioCarousel = elementorPortfolioCarousel; 14642 14643 elementorPortfolioCarousel.qodeInitElementorPortfolioCarousel = qodeInitElementorPortfolioCarousel; 14644 14645 14646 elementorPortfolioCarousel.qodeOnWindowLoad = qodeOnWindowLoad; 14647 14648 $(window).on('load', qodeOnWindowLoad); 14649 14650 /* 14651 ** All functions to be called on $(window).load() should be in this function 14652 */ 14653 function qodeOnWindowLoad() { 14654 qodeInitElementorPortfolioCarousel(); 14655 } 14656 14657 function qodeInitElementorPortfolioCarousel(){ 14658 $j(window).on('elementor/frontend/init', function () { 14659 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_portfolio_carousel.default', function() { 14660 qode.modules.portfolioCarousel.qodePortfolioCarousel(); 14661 qode.modules.portfolioCarousel.qodeInitPortfolioCarouselCustomCursor(); 14662 } ); 14663 }); 14664 } 14665 14666})(jQuery); 14667 14668(function ($) { 14669 'use strict'; 14670 14671 var verticalPortfolioSlider = {}; 14672 qode.modules.verticalPortfolioSlider = verticalPortfolioSlider; 14673 14674 verticalPortfolioSlider.qodeVerticalPortfolioSlider = qodeVerticalPortfolioSlider; 14675 verticalPortfolioSlider.qodeOnDocumentReady = qodeOnDocumentReady; 14676 14677 $(document).ready(qodeOnDocumentReady); 14678 14679 /* 14680 All functions to be called on $(document).ready() should be in this function 14681 */ 14682 function qodeOnDocumentReady() { 14683 qodeVerticalPortfolioSlider(); 14684 } 14685 14686 14687 function qodeVerticalPortfolioSlider() { 14688 14689 var holder = $j('.qode-vertical-portfolio-slider'); 14690
14691 if (holder.length) { 14692 14693 holder.each(function () { 14694 var sliderOptions = typeof $j(this).data('options') !== 'undefined' ? $j(this).data('options') : {}, 14695 autoplay = sliderOptions.autoplay !== undefined && sliderOptions.autoplay !== '' ? sliderOptions.autoplay : true, 14696 mousewheel = sliderOptions.mousewheel !== undefined && sliderOptions.mousewheel !== '' ? sliderOptions.mousewheel : false, 14697 speed = sliderOptions.speed !== undefined && sliderOptions.speed !== '' ? parseInt(sliderOptions.speed, 10) : 5000, 14698 speedAnimation = sliderOptions.speedAnimation !== undefined && sliderOptions.speedAnimation !== '' ? parseInt(sliderOptions.speedAnimation, 10) : 800, 14699 loop = sliderOptions.loop !== undefined && sliderOptions.loop !== '' ? sliderOptions.loop : true; 14700 14701 if (autoplay === true) { 14702 autoplay = { 14703 delay: speed, 14704 disableOnInteraction: false 14705 }; 14706 } 14707 14708 var mySwiper = new Swiper (holder, { 14709 direction: 'vertical', 14710 slideEffect: 'fade', 14711 mousewheelControl: true, 14712 slidesPerView: '1', 14713 sliderScroll: true, 14714 speed: speedAnimation, 14715 loop: loop, 14716 autoplay: autoplay, 14717 pagination: { 14718 el: '.swiper-pagination', 14719 clickable: true, 14720 renderBullet: function (index, className) { 14721 return '<span class="' + className + '">' + (index + 1) + '</span>'; 14722 }, 14723 }, 14724 }) 14725 14726 if( mousewheel ) { 14727 var scrollStart = false;
14728 holder.on('wheel', function (e) { 14729 e.preventDefault(); 14730 if (!scrollStart) { 14731 scrollStart = true; 14732 var delta = e.originalEvent.deltaY; 14733 14734 if (delta > 0) { 14735 holder[0].swiper.slideNext(); 14736 } else { 14737 holder[0].swiper.slidePrev(); 14738 } 14739 14740 setTimeout(function () { 14741 scrollStart = false; 14742 }, 2000); 14743 } 14744 }); 14745 } 14746 }) 14747 } 14748 } 14749 14750})(jQuery); 14751(function($) { 14752 'use strict'; 14753 14754 var elementorWorkflow = {}; 14755 qode.modules.elementorWorkflow = elementorWorkflow; 14756 14757 elementorWorkflow.qodeInitElementorWorkflow = qodeInitElementorWorkflow; 14758 14759 14760 elementorWorkflow.qodeOnWindowLoad = qodeOnWindowLoad; 14761 14762 $(window).on('load', qodeOnWindowLoad); 14763 14764 /* 14765 ** All functions to be called on $(window).load() should be in this function 14766 */ 14767 function qodeOnWindowLoad() { 14768 qodeInitElementorWorkflow(); 14769 } 14770 14771 function qodeInitElementorWorkflow(){ 14772 $j(window).on('elementor/frontend/init', function () { 14773 elementorFrontend.hooks.addAction( 'frontend/element_ready/bridge_workflow.default', function() { 14774 qodeWorkflow(); 14775 } ); 14776 }); 14777 } 14778 14779})(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.