1function is_touch_device() { 2 return 'ontouchstart' in window // works on most browsers 3 || 'onmsgesturechange' in window; // works on ie10 4} 5 6function isMobileDevice() { 7 return (typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1); 8} 9 10jQuery.fn.isInViewport = function() { 11 var elementTop = jQuery(this).offset().top; 12 var elementBottom = elementTop + jQuery(this).outerHeight(); 13 14 var viewportTop = jQuery(window).scrollTop(); 15 var viewportBottom = viewportTop + jQuery(window).height(); 16 17 return elementBottom > viewportTop && elementTop < viewportBottom; 18}; 19 20( function( $ ) { 21 // Make sure you run this code under Elementor.. 22 $( window ).on( 'elementor/frontend/init', function() { 23 24 jQuery("img.lazy").each(function() { 25 var currentImg = jQuery(this); 26 27 jQuery(this).Lazy({ 28 onFinishedAll: function() { 29 currentImg.parent("div.post_img_hover").removeClass("lazy"); 30 currentImg.parent('.tg_gallery_lightbox').parent("div.gallery_grid_item").removeClass("lazy"); 31 } 32 }); 33 }); 34 35 elementorFrontend.hooks.addAction('frontend/element_ready/global', function( $scope ) { 36 37 var bodyBGColor = jQuery("body").css('backgroundColor'); 38 jQuery("#wrapper").css('backgroundColor', bodyBGColor); 39 40 if(elementorFrontend.isEditMode()) 41 { 42 var elementSettings = {}; 43 var modelCID = $scope.data( 'model-cid' ); 44 45 var settings = elementorFrontend.config.elements.data[ modelCID ]; 46 if(typeof settings != 'undefined') 47 { 48 var type = settings.attributes.widgetType || settings.attributes.elType, 49 settingsKeys = elementorFrontend.config.elements.keys[ type ]; 50 51 if ( ! settingsKeys ) { 52 settingsKeys = elementorFrontend.config.elements.keys[type] = []; 53 54 jQuery.each( settings.controls, function ( name, control ) { 55 if ( control.frontend_available ) { 56 settingsKeys.push( name ); 57 } 58 }); 59 } 60 61 jQuery.each( settings.getActiveControls(), function( controlKey ) { 62 if ( -1 !== settingsKeys.indexOf( controlKey ) ) { 63 elementSettings[ controlKey ] = settings.attributes[ controlKey ]; 64 } 65 } ); 66 67 var widgetExt = elementSettings; 68 } 69 } 70 else 71 { 72 //Get widget settings data 73 var widgetExtObj = $scope.attr('data-settings'); 74 75 if(typeof widgetExtObj != 'undefined') 76 { 77 var widgetExt = JSON.parse(widgetExtObj); 78 } 79 } 80 81 if(typeof widgetExt != 'undefined') 82 { 83 //Begin background image parallax scrolling 84 if(typeof widgetExt.architecturer_ext_is_background_parallax != 'undefined' && widgetExt.architecturer_ext_is_background_parallax == 'true') 85 { 86 if(typeof widgetExt.background_background != 'undefined' && widgetExt.background_background == 'classic') 87 { 88 //If not edit in Elementor for better performance 89 if(!elementorFrontend.isEditMode()) 90 { 91 var widgetBg = $scope.css('background-image'); 92 93 //Add support for Elementor background lazy load 94 if(widgetBg == 'none') { 95 widgetBg = $scope.css('--e-bg-lazyload'); 96 } 97 98 widgetBg = widgetBg.replace('url(','').replace(')','').replace(/\"/gi, ""); 99 100 var jarallaxScrollSpeed = 0.5; 101 if(typeof widgetExt.architecturer_ext_is_background_parallax_speed.size != 'undefined') 102 { 103 jarallaxScrollSpeed = parseFloat(widgetExt.architecturer_ext_is_background_parallax_speed.size); 104 } 105 106 //Jarallax 107 $scope.addClass('jarallax'); 108 $scope.append('<img class="jarallax-img" src="'+widgetBg+'"/>'); 109 110 $scope.jarallax({ 111 speed: jarallaxScrollSpeed 112 }); 113 114 if(!isMobileDevice()) 115 { 116 $scope.css('background-image', 'none'); 117 } 118 119 jQuery(window).resize(function() { 120 if(!isMobileDevice()) 121 { 122 $scope.css('background-image', 'none'); 123 } 124 else 125 { 126 $scope.css('background-image', 'url('+widgetBg+')'); 127 } 128 }); 129 } 130 } 131 } 132 133 if(typeof widgetExt.architecturer_ext_is_fadeout_animation != 'undefined' && widgetExt.architecturer_ext_is_fadeout_animation == 'true') 134 { 135 var scrollVelocity = parseFloat(widgetExt.architecturer_ext_is_fadeout_animation_velocity.size); 136 var scrollDirection = widgetExt.architecturer_ext_is_fadeout_animation_direction; 137 138 jQuery(window).scroll(function(i){ 139 var scrollVar = jQuery(window).scrollTop(); 140 var scrollPx = -(scrollVelocity*scrollVar); 141 142 if(scrollDirection == 'up') 143 { 144 scrollPx = -(scrollVelocity*scrollVar); 145 } 146 else if(scrollDirection == 'down') 147 { 148 scrollPx = scrollVelocity*scrollVar; 149 } 150 else 151 { 152 scrollPx = 0; 153 } 154 155 //console.log(scrollVelocity); 156 $scope.find('.elementor-widget-container').css({'transform': "translateY("+scrollPx+"px)" }); 157 $scope.find('.elementor-widget-container').css({'opacity':( 100-(scrollVar/4) )/100}); 158 }) 159 } 160 161 162 //Begin scroll animation extensions 163 if(typeof widgetExt.architecturer_ext_is_scrollme != 'undefined' && widgetExt.architecturer_ext_is_scrollme == 'true') 164 { 165 var scrollArgs = {}; 166 167 if(typeof widgetExt.architecturer_ext_scrollme_scalex.size != 'undefined' && widgetExt.architecturer_ext_scrollme_scalex.size != 1) 168 { 169 scrollArgs['scaleX'] = widgetExt.architecturer_ext_scrollme_scalex.size; 170 } 171 172 if(typeof widgetExt.architecturer_ext_scrollme_scaley.size != 'undefined' && widgetExt.architecturer_ext_scrollme_scaley.size != 1) 173 { 174 scrollArgs['scaleY'] = widgetExt.architecturer_ext_scrollme_scaley.size; 175 } 176 177 if(typeof widgetExt.architecturer_ext_scrollme_scalez.size != 'undefined' && widgetExt.architecturer_ext_scrollme_scalez.size != 1) 178 { 179 scrollArgs['scaleZ'] = widgetExt.architecturer_ext_scrollme_scalez.size; 180 } 181 182 if(typeof widgetExt.architecturer_ext_scrollme_rotatex.size != 'undefined' && widgetExt.architecturer_ext_scrollme_rotatex.size != 0) 183 { 184 scrollArgs['rotateX'] = widgetExt.architecturer_ext_scrollme_rotatex.size; 185 } 186 187 if(typeof widgetExt.architecturer_ext_scrollme_rotatey.size != 'undefined' && widgetExt.architecturer_ext_scrollme_rotatey.size != 0) 188 { 189 scrollArgs['rotateY'] = widgetExt.architecturer_ext_scrollme_rotatey.size; 190 } 191 192 if(typeof widgetExt.architecturer_ext_scrollme_rotatez.size != 'undefined' && widgetExt.architecturer_ext_scrollme_rotatez.size != 0) 193 { 194 scrollArgs['rotateY'] = widgetExt.architecturer_ext_scrollme_rotatez.size; 195 } 196 197 if(typeof widgetExt.architecturer_ext_scrollme_translatex.size != 'undefined' && widgetExt.architecturer_ext_scrollme_translatex.size != 0) 198 { 199 scrollArgs['x'] = widgetExt.architecturer_ext_scrollme_translatex.size; 200 } 201 202 if(typeof widgetExt.architecturer_ext_scrollme_translatey.size != 'undefined' && widgetExt.architecturer_ext_scrollme_translatey.size != 0) 203 { 204 scrollArgs['y'] = widgetExt.architecturer_ext_scrollme_translatey.size; 205 } 206 207 if(typeof widgetExt.architecturer_ext_scrollme_translatez.size != 'undefined' && widgetExt.architecturer_ext_scrollme_translatez.size != 0) 208 { 209 scrollArgs['z'] = widgetExt.architecturer_ext_scrollme_translatez.size; 210 } 211 212 if(typeof widgetExt.architecturer_ext_scrollme_smoothness.size != 'undefined') 213 { 214 scrollArgs['smoothness'] = widgetExt.architecturer_ext_scrollme_smoothness.size; 215 } 216 217 //scrollArgs['duration'] = 150; 218 219 $scope.attr('data-parallax', JSON.stringify(scrollArgs)); 220 221 if(typeof widgetExt.architecturer_ext_scrollme_disable != 'undefined') 222 { 223 if(widgetExt.architecturer_ext_scrollme_disable == 'mobile') 224 {
225 if(parseInt(jQuery(window).width()) < 501) 226 { 227 $scope.addClass('noanimation'); 228 } 229 } 230 231 if(widgetExt.architecturer_ext_scrollme_disable == 'tablet') 232 { 233 if(parseInt(jQuery(window).width()) < 769) 234 { 235 $scope.addClass('noanimation'); 236 } 237 } 238 239 jQuery(window).resize(function() { 240 if(widgetExt.architecturer_ext_scrollme_disable == 'mobile') 241 { 242 if(isMobileDevice() || parseInt(jQuery(window).width()) < 501) 243 { 244 $scope.addClass('noanimation'); 245 } 246 else 247 { 248 $scope.removeClass('noanimation'); 249 } 250 } 251 252 if(widgetExt.architecturer_ext_scrollme_disable == 'tablet') 253 { 254 if(parseInt(jQuery(window).width()) < 769) 255 { 256 $scope.addClass('noanimation'); 257 } 258 else 259 { 260 $scope.removeClass('noanimation'); 261 } 262 } 263 }); 264 } 265 } 266 //End scroll animation extensions 267 268 //Begin entrance animation extensions 269 if(typeof widgetExt.architecturer_ext_is_smoove != 'undefined' && widgetExt.architecturer_ext_is_smoove == 'true') 270 { 271 $scope.addClass('init-smoove'); 272 273 $scope.smoove({ 274 min_width : parseInt(widgetExt.architecturer_ext_smoove_disable), 275 276 scaleX : widgetExt.architecturer_ext_smoove_scalex.size, 277 scaleY : widgetExt.architecturer_ext_smoove_scaley.size, 278 279 rotateX : parseInt(widgetExt.architecturer_ext_smoove_rotatex.size)+'deg', 280 rotateY : parseInt(widgetExt.architecturer_ext_smoove_rotatey.size)+'deg', 281 rotateZ : parseInt(widgetExt.architecturer_ext_smoove_rotatez.size)+'deg', 282 283 moveX : parseInt(widgetExt.architecturer_ext_smoove_translatex.size)+'px', 284 moveY : parseInt(widgetExt.architecturer_ext_smoove_translatey.size)+'px', 285 moveZ : parseInt(widgetExt.architecturer_ext_smoove_translatez.size)+'px', 286 287 skewX : parseInt(widgetExt.architecturer_ext_smoove_skewx.size)+'deg', 288 skewY : parseInt(widgetExt.architecturer_ext_smoove_skewy.size)+'deg', 289 290 perspective : parseInt(widgetExt.architecturer_ext_smoove_perspective.size), 291 292 offset : '-10%', 293 }); 294 295 if(typeof widgetExt.architecturer_ext_smoove_duration != 'undefined') 296 { 297 $scope.css('transition-duration', parseInt(widgetExt.architecturer_ext_smoove_duration)+'ms'); 298 } 299 300 var width = jQuery(window).width(); 301 if (widgetExt.architecturer_ext_smoove_disable >= width) { 302 if(!$scope.hasClass('smooved')) 303 { 304 $scope.addClass('no-smooved'); 305 } 306 307 return false; 308 } 309 } 310 //End entrance animation extensions 311 312 313 //Begin mouse parallax extensions 314 if(typeof widgetExt.architecturer_ext_is_parallax_mouse != 'undefined' && widgetExt.architecturer_ext_is_parallax_mouse == 'true') 315 { 316 var elementID = $scope.attr('data-id'); 317 $scope.find('.elementor-widget-container').attr('data-depth', parseFloat(widgetExt.architecturer_ext_is_parallax_mouse_depth.size)); 318 $scope.attr('ID', 'parallax-'+elementID); 319 320 var parentElement = document.getElementById('parallax-'+elementID); 321 var parallax = new Parallax(parentElement, { 322 relativeInput: true 323 }); 324 325 if(elementorFrontend.isEditMode()) 326 { 327 if($scope.width() == 0) 328 { 329 $scope.css('width', '100%'); 330 } 331 332 if($scope.height() == 0) 333 { 334 $scope.css('height', '100%'); 335 } 336 } 337 } 338 //End mouse parallax extensions 339 340 341 //Begin infinite animation extensions 342 if(typeof widgetExt.architecturer_ext_is_infinite != 'undefined' && widgetExt.architecturer_ext_is_infinite == 'true') 343 { 344 var animationClass = ''; 345 var keyframeName = ''; 346 var animationCSS = ''; 347 348 if(typeof widgetExt.architecturer_ext_infinite_animation != 'undefined') 349 { 350 animationClass = widgetExt.architecturer_ext_infinite_animation; 351 352 switch(animationClass) { 353 case 'if_swing1': 354 keyframeName = 'swing'; 355 break; 356 357 case 'if_swing2': 358 keyframeName = 'swing2'; 359 break; 360 361 case 'if_wave': 362 keyframeName = 'wave'; 363 break; 364 365 case 'if_tilt': 366 keyframeName = 'tilt'; 367 break; 368 369 case 'if_bounce': 370 keyframeName = 'bounce'; 371 break; 372 373 case 'if_scale': 374 keyframeName = 'scale'; 375 break; 376 377 case 'if_spin': 378 keyframeName = 'spin'; 379 break; 380 } 381 382 animationCSS+= keyframeName+' '; 383 } 384 //alert(widgetExt.architecturer_ext_infinite_duration); 385 if(typeof widgetExt.architecturer_ext_infinite_duration != 'undefined') 386 { 387 animationCSS+= widgetExt.architecturer_ext_infinite_duration+'s '; 388 } 389 390 animationCSS+= 'infinite alternate '; 391 392 if(typeof widgetExt.architecturer_ext_infinite_easing != 'undefined') 393 { 394 animationCSS+= 'cubic-bezier('+widgetExt.architecturer_ext_infinite_easing+')'; 395 } 396 //alert(animationCSS); 397 $scope.css({ 398 'animation' : animationCSS, 399 }); 400 $scope.addClass(animationClass); 401 } 402 //End infinite animation extensions 403 404 //Begin mobile menu extensions 405 if(typeof widgetExt.architecturer_ext_is_mobile_menu != 'undefined' && widgetExt.architecturer_ext_is_mobile_menu == 'true') 406 { 407 $scope.on( 'click', function() { 408 jQuery('body').toggleClass('js_nav'); 409 jQuery('body').toggleClass('modalview'); 410 jQuery('#close_mobile_menu').addClass('open'); 411
412 if(is_touch_device()) 413 { 414 jQuery('body.js_nav').css('overflow', 'auto'); 415 } 416 417 return false; 418 }); 419 } 420 //End mobile menu extensions 421 422 423 //Begin background on change extensions 424 if(typeof widgetExt.architecturer_ext_is_background_on_scroll != 'undefined' && widgetExt.architecturer_ext_is_background_on_scroll == 'true') 425 { 426 var bodyBackground = jQuery('body').css('background-color'); 427 var position = jQuery(window).scrollTop(); 428 429 jQuery(window).on("scroll touchmove", function() { 430 clearTimeout($.data(this, 'scrollTimer')); 431 $.data(this, 'scrollTimer', setTimeout(function() { 432 jQuery('body').attr('data-scrollend', jQuery(window).scrollTop()); 433 }, 250)); 434 435 var scroll = jQuery(window).scrollTop(); 436 var position = jQuery('body').attr('data-scrollend'); 437 var windowHeight = jQuery(window).height(); 438 var windowHeightOffset = parseInt(windowHeight/2); 439 var elementTop = $scope.position().top - windowHeightOffset; 440 var elementBottom = elementTop + $scope.outerHeight(true); 441 442 /*console.log('document scroll top: '+jQuery(document).scrollTop()); 443 console.log('element top: '+elementTop); 444 console.log('element bottom: '+elementBottom);*/ 445 446 if (scroll > position) { 447 //console.log('scroll down'); 448 449 //Scroll down 450 if (jQuery(document).scrollTop() >= elementTop && jQuery(document).scrollTop() <= elementBottom) { 451 //jQuery('body').css('background-color', widgetExt.architecturer_ext_background_on_scroll_color); 452 jQuery('#wrapper').css('background-color', widgetExt.architecturer_ext_background_on_scroll_color); 453 } 454 455 if (jQuery(document).scrollTop() > elementBottom) { 456 //jQuery('body').css('background-color', bodyBackground); 457 jQuery('#wrapper').css('background-color', bodyBackground); 458 } 459 460 } else { 461 /*console.log('scroll up'); 462 console.log('document scroll top: '+jQuery(document).scrollTop()); 463 console.log('element top: '+$scope.position().top); 464 console.log('element bottom: '+elementBottom);*/ 465 466 //Scroll up 467 if (jQuery(document).scrollTop() <= elementBottom && jQuery(document).scrollTop() >= elementTop) { 468 clearTimeout($.data(this, 'scrollTimer2')); 469 $.data(this, 'scrollTimer2', setTimeout(function() { 470 jQuery('#wrapper').css('background-color', widgetExt.architecturer_ext_background_on_scroll_color).stop(); 471 }, 250)); 472 473 /*setTimeout(function(){ 474 //jQuery('body').css('background-color', widgetExt.architecturer_ext_background_on_scroll_color).stop(); 475 jQuery('#wrapper').css('background-color', widgetExt.architecturer_ext_background_on_scroll_color).stop(); 476 }, 100);*/ 477 } 478 479 if (jQuery(document).scrollTop() < $scope.position().top) { 480 //jQuery('body').css('background-color', bodyBackground); 481 jQuery('#wrapper').css('background-color', bodyBackground); 482 } 483 } 484 }); 485 } 486 //End background on change extensions 487 } 488 }); 489 490 //Start execute javascript for blog posts 491 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-blog-posts.default', function( $scope ) { 492 jQuery(function( $ ) { 493 jQuery("img.lazy").each(function() { 494 var currentImg = jQuery(this); 495 496 jQuery(this).Lazy({ 497 onFinishedAll: function() { 498 currentImg.parent("div.post_img_hover").removeClass("lazy"); 499 }, 500 }); 501 }); 502 503 if(!is_touch_device()) 504 { 505 var scaleTilt = 1.05; 506 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 507 508 if(!isSafari) { 509 jQuery(".blog-tilt").tilt({ 510 scale: scaleTilt, 511 perspective: 2500 512 }); 513 } 514 } 515 516 jQuery(".layout_masonry").each(function() { 517 var grid = jQuery(this); 518 519 grid.imagesLoaded().done( function() { 520 grid.masonry({ 521 itemSelector: ".blog-posts-masonry", 522 columnWidth: ".blog-posts-masonry", 523 gutter : 45 524 }); 525 526 jQuery(".layout_masonry .blog-posts-masonry").each(function(index) { 527 setTimeout(function() { 528 jQuery(".layout_masonry .blog-posts-masonry").eq(index).addClass("is-showing"); 529 }, 250 * index); 530 }); 531 }); 532 533 jQuery(".layout_masonry img.lazy_masonry").each(function() { 534 var currentImg = jQuery(this); 535 currentImg.parent("div.post_img_hover").removeClass("lazy"); 536 537 jQuery(this).Lazy({ 538 onFinishedAll: function() { 539 grid.masonry({ 540 itemSelector: ".blog-posts-masonry", 541 columnWidth: ".blog-posts-masonry", 542 gutter : 45 543 }); 544 }, 545 }); 546 }); 547 }); 548 549 jQuery(".layout_metro_masonry").each(function() { 550 var grid = jQuery(this); 551 552 grid.imagesLoaded().done( function() { 553 grid.masonry({ 554 itemSelector: ".blog-posts-metro", 555 columnWidth: ".blog-posts-metro", 556 gutter : 40 557 }); 558 559 jQuery(".layout_metro_masonry .blog-posts-metro").each(function(index) { 560 setTimeout(function() { 561 jQuery(".layout_metro_masonry .blog-posts-metro").eq(index).addClass("is-showing"); 562 }, 100 * index); 563 }); 564 }); 565 566 jQuery(".post_metro_left_wrapper img.lazy_masonry, .layout_metro_masonry img.lazy_masonry").each(function() { 567 var currentImg = jQuery(this); 568 currentImg.parent("div.post_img_hover").removeClass("lazy"); 569 570 jQuery(this).Lazy({ 571 onFinishedAll: function() { 572 grid.masonry({ 573 itemSelector: ".blog-posts-metro", 574 columnWidth: ".blog-posts-metro", 575 gutter : 40 576 }); 577 }, 578 }); 579 }); 580 }); 581 582 var menuLayout = jQuery('#pp_menu_layout').val();
583 if(menuLayout != 'leftmenu') 584 { 585 jQuery(".post_metro_left_wrapper").stick_in_parent({ offset_top: 120 }); 586 } 587 else 588 { 589 jQuery(".post_metro_left_wrapper").stick_in_parent({ offset_top: 40 }); 590 } 591 592 if(jQuery(window).width() < 768 || is_touch_device()) 593 { 594 jQuery(".post_metro_left_wrapper").trigger("sticky_kit:detach"); 595 } 596 }); 597 } ); 598 //End execute javascript for blog posts 599 600 //Start execute javascript for gallery grid 601 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-gallery-grid.default', function( $scope ) { 602 jQuery("img.lazy").each(function() { 603 var currentImg = jQuery(this); 604 605 jQuery(this).Lazy({ 606 onFinishedAll: function() { 607 currentImg.parent("div.post_img_hover").removeClass("lazy"); 608 currentImg.parent('.tg_gallery_lightbox').parent("div.gallery_grid_item").removeClass("lazy"); 609 currentImg.parent("div.gallery_grid_item").removeClass("lazy"); 610 } 611 }); 612 }); 613 614 jQuery(function( $ ) { 615 if(!is_touch_device()) 616 { 617 var scaleTilt = 1.1; 618 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 619 620 if(!isSafari) { 621 jQuery(".gallery-grid-tilt").tilt({ 622 scale: scaleTilt, 623 perspective: 2500 624 }); 625 } 626 } 627 }); 628 } ); 629 //End execute javascript for gallery grid 630 631 //Start execute javascript for gallery masonry 632 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-gallery-masonry.default', function( $scope ) { 633 jQuery(function( $ ) { 634 if(!is_touch_device()) 635 { 636 var scaleTilt = 1.1; 637 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 638 639 if(!isSafari) { 640 jQuery(".gallery-grid-tilt").tilt({ 641 scale: scaleTilt, 642 perspective: 2500 643 }); 644 } 645 } 646 647 jQuery(".gallery_grid_content_wrapper.do_masonry").each(function() { 648 var grid = jQuery(this); 649 var cols = grid.attr('data-cols'); 650 651 if(!grid.hasClass('has_no_space')) 652 { 653 var gutter = 40; 654 if(cols > 4) 655 { 656 gutter = 30; 657 } 658 } 659 else 660 { 661 gutter = 0; 662 } 663 664 grid.imagesLoaded().done( function() { 665 grid.masonry({ 666 itemSelector: ".gallery_grid_item", 667 columnWidth: ".gallery_grid_item", 668 gutter : gutter 669 }); 670 671 jQuery(".gallery_grid_content_wrapper.do_masonry .gallery_grid_item").each(function(index) { 672 setTimeout(function() { 673 jQuery(".do_masonry .gallery_grid_item").eq(index).addClass("is-showing"); 674 }, 100 * index); 675 }); 676 }); 677 678 jQuery(".gallery_grid_content_wrapper.do_masonry img.lazy_masonry").each(function() { 679 var currentImg = jQuery(this); 680 currentImg.parent("div.post_img_hover").removeClass("lazy"); 681 682 var cols = grid.attr('data-cols'); 683 684 if(!grid.hasClass('has_no_space')) 685 { 686 var gutter = 40; 687 if(cols > 4) 688 { 689 gutter = 30; 690 } 691 } 692 else 693 { 694 gutter = 0; 695 } 696 697 jQuery(this).Lazy({ 698 onFinishedAll: function() { 699 grid.masonry({ 700 itemSelector: ".gallery_grid_item", 701 columnWidth: ".gallery_grid_item", 702 gutter : gutter 703 }); 704 }, 705 }); 706 }); 707 }); 708 }); 709 } ); 710 //End execute javascript for gallery masonry 711 712 //Start execute javascript for gallery justified 713 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-gallery-justified.default', function( $scope ) { 714 jQuery(function( $ ) { 715 if(!is_touch_device()) 716 { 717 var scaleTilt = 1.1; 718 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 719 720 if(!isSafari) { 721 jQuery(".gallery-grid-tilt").tilt({ 722 scale: scaleTilt, 723 perspective: 2500 724 }); 725 } 726 } 727 728 jQuery("img.lazy").each(function() { 729 var currentImg = jQuery(this); 730 731 jQuery(this).Lazy({ 732 onFinishedAll: function() { 733 currentImg.parent("div.post_img_hover").removeClass("lazy"); 734 } 735 }); 736 }); 737 738 jQuery(".gallery_grid_content_wrapper.do_justified").each(function() { 739 var grid = jQuery(this); 740 var rowHeight = grid.attr('data-row_height'); 741 var margin = grid.attr('data-margin'); 742 var justifyLastRow = grid.attr('data-justify_last_row'); 743 var justifyLastRowStr = 'nojustify'; 744 if(justifyLastRow == 'yes') 745 { 746 justifyLastRowStr = 'justify'; 747 } 748
749 grid.imagesLoaded().always( function() { 750 grid.justifiedGallery({ 751 rowHeight: rowHeight, 752 margins: margin, 753 lastRow: justifyLastRowStr 754 }); 755 }); 756 }); 757 }); 758 } ); 759 //End execute javascript for gallery justified 760 761 //Start execute javascript for gallery fullscreen 762 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-gallery-fullscreen.default', function( $scope ) { 763 jQuery(function( $ ) { 764 jQuery('body').addClass('elementor-fullscreen'); 765 766 var slideshow = jQuery('.tg_fullscreen_gallery'); 767 var autoPlay = slideshow.attr('data-autoplay'); 768 var autoPlayArr = false; 769 if (typeof autoPlay != "undefined"){ 770 autoPlayArr = { 771 delay: autoPlay 772 }; 773 } 774 775 var effect = slideshow.attr('data-effect'); 776 if (typeof effect == "undefined"){ 777 effect = 'slide'; 778 } 779 780 var speed = slideshow.attr('data-speed'); 781 if (typeof speed == "undefined"){ 782 speed = 400; 783 } 784 785 var galleryTop = new Swiper('.tg_fullscreen_gallery', { 786 navigation: { 787 nextEl: '.swiper-button-next', 788 prevEl: '.swiper-button-prev', 789 }, 790 spaceBetween: 0, 791 keyboardControl: true, 792 speed: parseInt(speed), 793 loop: true, 794 effect: effect, 795 grabCursor: true, 796 preloadImages: false, 797 lazy: { 798 loadPrevNext: true, 799 }, 800 autoplay: autoPlayArr 801 }); 802 }); 803 } ); 804 //End execute javascript for gallery fullscreen 805 806 //Start execute javascript for vertical parallax 807 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-vertical-parallax.default', function( $scope ) { 808 jQuery(function( $ ) { 809 jQuery('body').addClass('elementor-fullscreen'); 810 811 var ticking = false; 812 var isFirefox = /Firefox/i.test(navigator.userAgent); 813 var isIe = /MSIE/i.test(navigator.userAgent) || /Trident.*rv\:11\./i.test(navigator.userAgent); 814 var scrollSensitivitySetting = 30; 815 var slideDurationSetting =800; 816 var currentSlideNumber = 0; 817 var totalSlideNumber = jQuery('.tg_parallax_slide_background').length; 818 function parallaxScroll(evt) { 819 if (isFirefox) { 820 delta = evt.detail * -120; 821 } else if (isIe) { 822 delta = -evt.deltaY; 823 } else { 824 delta = evt.wheelDelta; 825 } 826 if (ticking != true) { 827 if (delta <= -scrollSensitivitySetting) { 828 ticking = true; 829 if (currentSlideNumber !== totalSlideNumber - 1) { 830 currentSlideNumber++; 831 nextItem(); 832 } 833 slideDurationTimeout(slideDurationSetting); 834 } 835 if (delta >= scrollSensitivitySetting) { 836 ticking = true; 837 if (currentSlideNumber !== 0) { 838 currentSlideNumber--; 839 } 840 previousItem(); 841 slideDurationTimeout(slideDurationSetting); 842 } 843 } 844 } 845 function slideDurationTimeout(slideDuration) { 846 setTimeout(function () { 847 ticking = false; 848 }, slideDuration); 849 } 850 var mousewheelEvent = isFirefox ? 'DOMMouseScroll' : 'wheel'; 851 window.addEventListener(mousewheelEvent, parallaxScroll, false); 852 function nextItem() { 853 var $previousSlide = jQuery('.tg_parallax_slide_background').eq(currentSlideNumber - 1); 854 $previousSlide.css('transform', 'translate3d(0,-130vh,0)').find('.tg_parallax_slide_content_wrapper').css('transform', 'translateY(40vh)'); 855 currentSlideTransition(); 856 } 857 function previousItem() { 858 var $previousSlide = jQuery('.tg_parallax_slide_background').eq(currentSlideNumber + 1); 859 $previousSlide.css('transform', 'translate3d(0,30vh,0)').find('.tg_parallax_slide_content_wrapper').css('transform', 'translateY(30vh)'); 860 currentSlideTransition(); 861 } 862 function currentSlideTransition() { 863 var $currentSlide = jQuery('.tg_parallax_slide_background').eq(currentSlideNumber); 864 $currentSlide.css('transform', 'translate3d(0,-15vh,0)').find('.tg_parallax_slide_content_wrapper').css('transform', 'translateY(15vh)'); 865 ; 866 } 867 868 jQuery('body').on('touchmove', function(e){ 869 e.preventDefault(); 870 e.stopPropagation(); 871 872 return false;
873 }); 874 875 var ts; 876 jQuery(document).bind('touchstart', function (e){ 877 ts = e.originalEvent.touches[0].clientY; 878 }); 879 880 jQuery(document).bind('touchend', function (e){ 881 var te = e.originalEvent.changedTouches[0].clientY; 882 if(ts > te+5){ 883 if (currentSlideNumber !== totalSlideNumber - 1) { 884 currentSlideNumber++; 885 nextItem(); 886 } 887 slideDurationTimeout(slideDurationSetting); 888 }else if(ts < te-5){ 889 if (currentSlideNumber !== 0) { 890 currentSlideNumber--; 891 } 892 previousItem(); 893 slideDurationTimeout(slideDurationSetting); 894 } 895 }); 896 }); 897 } ); 898 //End execute javascript for gallery vertical parallax 899 900 //Start execute javascript for gallery horizontal 901 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-gallery-horizontal.default', function( $scope ) { 902 jQuery('body').addClass('gallery-horizontal'); 903 904 jQuery(".tg_horizontal_gallery_wrapper").each(function() { 905 var $carousel = jQuery(this); 906 var timer = $carousel.attr('data-autoplay'); 907 if(timer == 0) 908 { 909 timer = false; 910 } 911 912 var loop = $carousel.attr('data-loop'); 913 var navigation = $carousel.attr('data-navigation'); 914 if(navigation == 0) 915 { 916 navigation = false; 917 } 918 919 var pagination = $carousel.attr('data-pagination'); 920 if(pagination == 0) 921 { 922 pagination = false; 923 } 924 925 $carousel.flickity({ 926 percentPosition: false, 927 imagesLoaded: true, 928 selectedAttraction: 0.01, 929 friction: 0.2, 930 lazyLoad: 5, 931 pauseAutoPlayOnHover: true, 932 autoPlay: parseInt(timer), 933 contain: true, 934 prevNextButtons: navigation, 935 pageDots: pagination 936 }); 937 938 var parallax = $carousel.attr('data-parallax'); 939 if(parallax == 1) 940 { 941 var $imgs = $carousel.find('.tg_horizontal_gallery_cell img'); 942 943 var docStyle = document.documentElement.style; 944 var transformProp = typeof docStyle.transform == 'string' ? 945 'transform' : 'WebkitTransform'; 946 947 var flkty = $carousel.data('flickity'); 948 949 $carousel.on( 'scroll.flickity', function() { 950 flkty.slides.forEach( function( slide, i ) { 951 var img = $imgs[i]; 952 var x = ( slide.target + flkty.x ) * -1/3; 953 img.style[ transformProp ] = 'translateX(' + x + 'px)'; 954 }); 955 }); 956 } 957 958 var fullscreen = $carousel.attr('data-fullscreen'); 959 if(fullscreen != 0) 960 { 961 jQuery('body').addClass('elementor-fullscreen'); 962 963 //Get menu element height 964 var menuHeight = parseInt(jQuery('#wrapper').css('paddingTop')); 965 var documentHeight = jQuery(window).innerHeight(); 966 var sliderHeight = parseInt(documentHeight - menuHeight); 967 968 $carousel.find('.tg_horizontal_gallery_cell').css('height', sliderHeight+'px'); 969 $carousel.find('.tg_horizontal_gallery_cell_img').css('height', sliderHeight+'px'); 970 $carousel.flickity('resize'); 971 972 jQuery( window ).resize(function() { 973 var menuHeight = parseInt(jQuery('#wrapper').css('paddingTop')); 974 var documentHeight = jQuery(window).innerHeight(); 975 var sliderHeight = parseInt(documentHeight - menuHeight); 976 977 $carousel.find('.tg_horizontal_gallery_cell').css('height', sliderHeight+'px'); 978 $carousel.find('.tg_horizontal_gallery_cell_img').css('height', sliderHeight+'px'); 979 $carousel.flickity('resize'); 980 }); 981 } 982 }); 983 } ); 984 //End execute javascript for gallery horizontal 985 986 //Start execute javascript for slider horizontal 987 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-horizontal.default', function( $scope ) { 988 jQuery(".tg_horizontal_slider_wrapper").each(function() { 989 var $carousel = jQuery(this); 990 var timer = $carousel.attr('data-autoplay'); 991 if(timer == 0) 992 { 993 timer = false; 994 } 995 996 var loop = $carousel.attr('data-loop'); 997 var navigation = $carousel.attr('data-navigation'); 998 if(navigation == 0) 999 { 1000 navigation = false; 1001 } 1002 1003 var pagination = $carousel.attr('data-pagination'); 1004 if(pagination == 0) 1005 { 1006 pagination = false;
1007 } 1008 1009 $carousel.flickity({ 1010 percentPosition: false, 1011 imagesLoaded: true, 1012 pauseAutoPlayOnHover: true, 1013 autoPlay: parseInt(timer), 1014 contain: true, 1015 prevNextButtons: navigation, 1016 pageDots: pagination 1017 }); 1018 1019 var fullscreen = $carousel.attr('data-fullscreen'); 1020 if(fullscreen != 0) 1021 { 1022 jQuery('body').addClass('elementor-fullscreen'); 1023 1024 //Get menu element height 1025 var menuHeight = parseInt(jQuery('#wrapper').css('paddingTop')); 1026 var documentHeight = jQuery(window).innerHeight(); 1027 var sliderHeight = parseInt(documentHeight - menuHeight); 1028 1029 $carousel.find('.tg_horizontal_slider_cell').css('height', sliderHeight+'px'); 1030 $carousel.flickity('resize'); 1031 1032 jQuery( window ).resize(function() { 1033 var menuHeight = parseInt(jQuery('#wrapper').css('paddingTop')); 1034 var documentHeight = jQuery(window).innerHeight(); 1035 var sliderHeight = parseInt(documentHeight - menuHeight); 1036 1037 $carousel.find('.tg_horizontal_slider_cell').css('height', sliderHeight+'px'); 1038 $carousel.flickity('resize'); 1039 }); 1040 } 1041 }); 1042 } ); 1043 //End execute javascript for slider horizontal 1044 1045 //Start execute javascript for slider animated frame 1046 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-animated-frame.default', function( $scope ) { 1047 1048 jQuery(".tg_animated_frame_slider_wrapper").each(function() { 1049 function debounce(func, wait, immediate) { 1050 var timeout; 1051 return function() { 1052 var context = this, args = arguments; 1053 var later = function() { 1054 timeout = null; 1055 if (!immediate) func.apply(context, args); 1056 }; 1057 var callNow = immediate && !timeout; 1058 clearTimeout(timeout); 1059 timeout = setTimeout(later, wait); 1060 if (callNow) func.apply(context, args); 1061 }; 1062 }; 1063 1064 class Slideshow { 1065 constructor(el) { 1066 this.DOM = {}; 1067 this.DOM.el = el; 1068 this.settings = { 1069 animation: { 1070 slides: { 1071 duration: 600, 1072 easing: 'easeOutQuint' 1073 }, 1074 shape: { 1075 duration: 300, 1076 easing: {in: 'easeOutQuint', out: 'easeOutQuad'} 1077 } 1078 }, 1079 frameFill: slideshowFrameColor 1080 } 1081 this.init(); 1082 } 1083 init() { 1084 if(this.DOM.el) 1085 { 1086 this.DOM.slides = Array.from(this.DOM.el.querySelectorAll('.slides > .slide')); 1087 this.slidesTotal = this.DOM.slides.length; 1088 this.DOM.nav = this.DOM.el.querySelector('.slidenav'); 1089 this.DOM.nextCtrl = this.DOM.nav.querySelector('.slidenav__item--next'); 1090 this.DOM.prevCtrl = this.DOM.nav.querySelector('.slidenav__item--prev'); 1091 this.current = 0; 1092 this.createFrame(); 1093 this.initEvents(); 1094 } 1095 } 1096 createFrame() { 1097 this.rect = this.DOM.el.getBoundingClientRect(); 1098 this.frameSize = this.rect.width/12; 1099 this.paths = { 1100 initial: this.calculatePath('initial'), 1101 final: this.calculatePath('final') 1102 }; 1103 this.DOM.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); 1104 this.DOM.svg.setAttribute('class', 'shape'); 1105 this.DOM.svg.setAttribute('width','100%'); 1106 this.DOM.svg.setAttribute('height','100%'); 1107 this.DOM.svg.setAttribute('viewbox',`0 0 ${this.rect.width} ${this.rect.height}`); 1108 this.DOM.svg.innerHTML = `<path fill="${this.settings.frameFill}" d="${this.paths.initial}"/>`; 1109 this.DOM.el.insertBefore(this.DOM.svg, this.DOM.nav); 1110 this.DOM.shape = this.DOM.svg.querySelector('path'); 1111 } 1112 updateFrame() { 1113 this.paths.initial = this.calculatePath('initial'); 1114 this.paths.final = this.calculatePath('final'); 1115 this.DOM.svg.setAttribute('viewbox',`0 0 ${this.rect.width} ${this.rect.height}`); 1116 this.DOM.shape.setAttribute('d', this.isAnimating ? this.paths.final : this.paths.initial); 1117 } 1118 calculatePath(path = 'initial') { 1119 return path === 'initial' ? 1120 `M 0,0 0,${this.rect.height} ${this.rect.width},${this.rect.height} ${this.rect.width},0 0,0 Z M 0,0 ${this.rect.width},0 ${this.rect.width},${this.rect.height} 0,${this.rect.height} Z` : 1121 `M 0,0 0,${this.rect.height} ${this.rect.width},${this.rect.height} ${this.rect.width},0 0,0 Z M ${this.frameSize},${this.frameSize} ${this.rect.width-this.frameSize},${this.frameSize} ${this.rect.width-this.frameSize},${this.rect.height-this.frameSize} ${this.frameSize},${this.rect.height-this.frameSize} Z`; 1122 } 1123 initEvents() { 1124 this.DOM.nextCtrl.addEventListener('click', () => this.navigate('next')); 1125 this.DOM.prevCtrl.addEventListener('click', () => this.navigate('prev')); 1126 1127 window.addEventListener('resize', debounce(() => { 1128 this.rect = this.DOM.el.getBoundingClientRect(); 1129 this.updateFrame(); 1130 }, 20)); 1131 1132 document.addEventListener('keydown', (ev) => {
1133 const keyCode = ev.keyCode || ev.which; 1134 if ( keyCode === 37 ) { 1135 this.navigate('prev'); 1136 } 1137 else if ( keyCode === 39 ) { 1138 this.navigate('next'); 1139 } 1140 }); 1141 } 1142 navigate(dir = 'next') { 1143 if ( this.isAnimating ) return false; 1144 this.isAnimating = true; 1145 1146 const animateShapeIn = anime({ 1147 targets: this.DOM.shape, 1148 duration: this.settings.animation.shape.duration, 1149 easing: this.settings.animation.shape.easing.in, 1150 d: this.paths.final 1151 }); 1152 1153 const animateSlides = () => { 1154 return new Promise((resolve, reject) => { 1155 const currentSlide = this.DOM.slides[this.current]; 1156 anime({ 1157 targets: currentSlide, 1158 duration: this.settings.animation.slides.duration, 1159 easing: this.settings.animation.slides.easing, 1160 translateX: dir === 'next' ? -1*this.rect.width : this.rect.width, 1161 complete: () => { 1162 currentSlide.classList.remove('slide--current'); 1163 resolve(); 1164 } 1165 }); 1166 1167 this.current = dir === 'next' ? 1168 this.current < this.slidesTotal-1 ? this.current + 1 : 0 : 1169 this.current > 0 ? this.current - 1 : this.slidesTotal-1; 1170 1171 const newSlide = this.DOM.slides[this.current]; 1172 newSlide.classList.add('slide--current'); 1173 anime({ 1174 targets: newSlide, 1175 duration: this.settings.animation.slides.duration, 1176 easing: this.settings.animation.slides.easing, 1177 translateX: [dir === 'next' ? this.rect.width : -1*this.rect.width,0] 1178 }); 1179 1180 const newSlideImg = newSlide.querySelector('.slide__img'); 1181 anime.remove(newSlideImg); 1182 anime({ 1183 targets: newSlideImg, 1184 duration: this.settings.animation.slides.duration*4, 1185 easing: this.settings.animation.slides.easing, 1186 translateX: [dir === 'next' ? 200 : -200, 0] 1187 }); 1188 1189 anime({ 1190 targets: [newSlide.querySelector('.slide__title'), newSlide.querySelector('.slide__desc'), newSlide.querySelector('.slide__link')], 1191 duration: this.settings.animation.slides.duration*2, 1192 easing: this.settings.animation.slides.easing, 1193 delay: (t,i) => i*100+100, 1194 translateX: [dir === 'next' ? 300 : -300,0], 1195 opacity: [0,1] 1196 }); 1197 }); 1198 }; 1199 1200 const animateShapeOut = () => { 1201 anime({ 1202 targets: this.DOM.shape, 1203 duration: this.settings.animation.shape.duration, 1204 delay: 150, 1205 easing: this.settings.animation.shape.easing.out, 1206 d: this.paths.initial, 1207 complete: () => this.isAnimating = false 1208 }); 1209 } 1210 1211 animateShapeIn.finished.then(animateSlides).then(animateShapeOut); 1212 } 1213 }; 1214 1215 var sliderID = jQuery(this).attr('id'); 1216 var slideshow = document.querySelector('#'+sliderID); 1217 if(slideshow) 1218 { 1219 var slideshowFrameColor = slideshow.getAttribute('data-background'); 1220 new Slideshow(slideshow); 1221 imagesLoaded('.slide__img', { background: true }); 1222 } 1223 }); 1224 } ); 1225 //End execute javascript for slider animated frame 1226 1227 //Start execute javascript for slider 3d room 1228 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-room.default', function( $scope ) { 1229 jQuery('body').addClass('elementor-fullscreen'); 1230 jQuery('body').addClass('room'); 1231 1232 function debounce(func, wait, immediate) { 1233 var timeout; 1234 return function() { 1235 var context = this, args = arguments; 1236 var later = function() { 1237 timeout = null;
1238 if (!immediate) func.apply(context, args); 1239 }; 1240 var callNow = immediate && !timeout; 1241 clearTimeout(timeout); 1242 timeout = setTimeout(later, wait); 1243 if (callNow) func.apply(context, args); 1244 }; 1245 }; 1246 1247 function getMousePos(e) { 1248 var posx = 0; 1249 var posy = 0; 1250 if (!e) var e = window.event; 1251 if (e.pageX || e.pageY) { 1252 posx = e.pageX; 1253 posy = e.pageY; 1254 } 1255 else if (e.clientX || e.clientY) { 1256 posx = e.clientX + document.body.scrollLeft 1257 + document.documentElement.scrollLeft; 1258 posy = e.clientY + document.body.scrollTop 1259 + document.documentElement.scrollTop; 1260 } 1261 return { 1262 x : posx, 1263 y : posy 1264 } 1265 } 1266 1267 var DOM = {}; 1268 // The loader. 1269 DOM.loader = document.querySelector('.tg_room_slider_wrapper .overlay--loader'); 1270 // The room wrapper. This will be the element to be transformed in order to move around. 1271 DOM.scroller = document.querySelector('.tg_room_slider_wrapper .container > .scroller'); 1272 // The rooms. 1273 if (DOM.scroller) 1274 { 1275 DOM.rooms = [].slice.call(DOM.scroller.querySelectorAll('.room')); 1276 } 1277 else 1278 { 1279 DOM.rooms = {}; 1280 } 1281 1282 // The content wrapper. 1283 DOM.content = document.querySelector('.tg_room_slider_wrapper .content'); 1284 if (DOM.content) 1285 { 1286 // Rooms navigation controls. 1287 DOM.nav = { 1288 leftCtrl : DOM.content.querySelector('.tg_room_slider_wrapper nav > .btn--nav-left'), 1289 rightCtrl : DOM.content.querySelector('.tg_room_slider_wrapper nav > .btn--nav-right') 1290 }; 1291 // Content slides. 1292 DOM.slides = [].slice.call(DOM.content.querySelectorAll('.slides > .slide')); 1293 } 1294 1295 var currentRoom = 0, 1296 // Total number of rooms. 1297 totalRooms = DOM.rooms.length, 1298 // Initial transform. 1299 initTransform = { translateX : 0, translateY : 0, translateZ : '500px', rotateX : 0, rotateY : 0, rotateZ : 0 }, 1300 // Reset transform. 1301 resetTransform = { translateX : 0, translateY : 0, translateZ : 0, rotateX : 0, rotateY : 0, rotateZ : 0 }, 1302 // View from top. 1303 menuTransform = { translateX : 0, translateY : '150%', translateZ : 0, rotateX : '15deg', rotateY : 0, rotateZ : 0 }, 1304 menuTransform = { translateX : 0, translateY : '50%', translateZ : 0, rotateX : '-10deg', rotateY : 0, rotateZ : 0 }, 1305 // Info view transform. 1306 infoTransform = { translateX : 0, translateY : 0, translateZ : '200px', rotateX : '2deg', rotateY : 0, rotateZ : '4deg' }, 1307 // Room initial moving transition. 1308 initTransition = { speed: '0.9s', easing: 'ease' }, 1309 // Room moving transition. 1310 roomTransition = { speed: '0.4s', easing: 'ease' }, 1311 // View from top transition. 1312 menuTransition = { speed: '1.5s', easing: 'cubic-bezier(0.2,1,0.3,1)' }, 1313 // Info transition. 1314 infoTransition = { speed: '15s', easing: 'cubic-bezier(0.3,1,0.3,1)' }, 1315 // Tilt transition 1316 tiltTransition = { speed: '0.2s', easing: 'ease-out' }, 1317 tilt = false, 1318 // How much to rotate when the mouse moves. 1319 tiltRotation = { 1320 rotateX : 1, // a relative rotation of -1deg to 1deg on the x-axis 1321 rotateY : -3 // a relative rotation of -3deg to 3deg on the y-axis 1322 }, 1323 // Transition end event handler. 1324 onEndTransition = function(el, callback) { 1325 var onEndCallbackFn = function(ev) { 1326 this.removeEventListener('transitionend', onEndCallbackFn); 1327 if( callback && typeof callback === 'function' ) { callback.call(); } 1328 }; 1329 el.addEventListener('transitionend', onEndCallbackFn); 1330 },
1331 // Window sizes. 1332 win = {width: window.innerWidth, height: window.innerHeight}, 1333 // Check if moving inside the room and check if navigating. 1334 isMoving, isNavigating; 1335 1336 function init() { 1337 // Move into the current room. 1338 move({transition: initTransition, transform: initTransform}).then(function() { 1339 initTilt(); 1340 }); 1341 // Animate the current slide in. 1342 showSlide(100); 1343 // Init/Bind events. 1344 initEvents(); 1345 } 1346 1347 function initTilt() { 1348 applyRoomTransition(tiltTransition); 1349 tilt = true; 1350 } 1351 1352 function removeTilt() { 1353 tilt = false; 1354 } 1355 1356 function move(opts) { 1357 return new Promise(function(resolve, reject) { 1358 if( isMoving && !opts.stopTransition ) { 1359 return false; 1360 } 1361 isMoving = true; 1362 1363 if( opts.transition ) { 1364 applyRoomTransition(opts.transition); 1365 } 1366 1367 if( opts.transform ) { 1368 applyRoomTransform(opts.transform); 1369 var onEndFn = function() { 1370 isMoving = false; 1371 resolve(); 1372 }; 1373 onEndTransition(DOM.scroller, onEndFn); 1374 } 1375 else { 1376 resolve(); 1377 } 1378 1379 }); 1380 } 1381 1382 function initEvents() { 1383 // Mousemove event / Tilt functionality. 1384 var onMouseMoveFn = function(ev) { 1385 requestAnimationFrame(function() { 1386 if( !tilt ) return false; 1387 1388 1389 var mousepos = getMousePos(ev), 1390 // transform values 1391 rotX = tiltRotation.rotateX ? initTransform.rotateX - (2 * tiltRotation.rotateX / win.height * mousepos.y - tiltRotation.rotateX) : 0, 1392 rotY = tiltRotation.rotateY ? initTransform.rotateY - (2 * tiltRotation.rotateY / win.width * mousepos.x - tiltRotation.rotateY) : 0; 1393 1394 // apply transform 1395 applyRoomTransform({ 1396 'translateX' : initTransform.translateX, 1397 'translateY' : initTransform.translateY, 1398 'translateZ' : initTransform.translateZ, 1399 'rotateX' : rotX + 'deg', 1400 'rotateY' : rotY + 'deg', 1401 'rotateZ' : initTransform.rotateZ 1402 }); 1403 }); 1404 }, 1405 // Window resize. 1406 debounceResizeFn = debounce(function() { 1407 win = {width: window.innerWidth, height: window.innerHeight}; 1408 }, 10); 1409 1410 document.addEventListener('mousemove', onMouseMoveFn); 1411 window.addEventListener('resize', debounceResizeFn); 1412 1413 // Room navigation. 1414 var onNavigatePrevFn = function() { navigate('prev'); }, 1415 onNavigateNextFn = function() { navigate('next'); }; 1416 1417 if(DOM.nav.leftCtrl && DOM.nav.rightCtrl) 1418 { 1419 DOM.nav.leftCtrl.addEventListener('click', onNavigatePrevFn); 1420 DOM.nav.rightCtrl.addEventListener('click', onNavigateNextFn); 1421 } 1422 } 1423 1424 function applyRoomTransform(transform) { 1425 DOM.scroller.style.transform = 'translate3d(' + transform.translateX + ', ' + transform.translateY + ', ' + transform.translateZ + ') ' + 1426 'rotate3d(1,0,0,' + transform.rotateX + ') rotate3d(0,1,0,' + transform.rotateY + ') rotate3d(0,0,1,' + transform.rotateZ + ')'; 1427 } 1428 1429 function applyRoomTransition(transition) { 1430 DOM.scroller.style.transition = transition === 'none' ? transition : 'transform ' + transition.speed + ' ' + transition.easing; 1431 } 1432 1433 function toggleSlide(dir, delay) { 1434 var slide = DOM.slides[currentRoom], 1435 // Slide's name. 1436 name = slide.querySelector('.slide__name'), 1437 // Slide's title and date elements. 1438 title = slide.querySelector('.slide__title'), 1439 date = slide.querySelector('.slide__date'); 1440 1441 delay = delay !== undefined ? delay : 0; 1442 1443 anime.remove([name, title, date]); 1444 var animeOpts = { 1445 targets: [name, title, date], 1446 duration: dir === 'in' ? 400 : 400, 1447 //delay: 0,//dir === 'in' ? 150 : 0, 1448 delay: function(t, i, c) { 1449 return delay + 75+i*75; 1450 }, 1451 easing: [0.25,0.1,0.25,1], 1452 opacity: { 1453 value: dir === 'in' ? [0,1] : [1,0], 1454 duration: dir === 'in' ? 550 : 250 1455 }, 1456 translateY: function(t, i) { 1457 return dir === 'in' ? [150,0] : [0,-150]; 1458 } 1459 }; 1460 if( dir === 'in' ) { 1461 animeOpts.begin = function() { 1462 slide.classList.add('slide--current'); 1463 }; 1464 } 1465 else { 1466 animeOpts.complete = function() { 1467 slide.classList.remove('slide--current'); 1468 }; 1469 } 1470 anime(animeOpts); 1471 } 1472 1473 function showSlide(delay) { 1474 toggleSlide('in', delay); 1475 } 1476 1477 function hideSlide(delay) { 1478 toggleSlide('out', delay); 1479 } 1480 1481 function navigate(dir) { 1482 if( isMoving || isNavigating ) { 1483 return false;
1484 } 1485 isNavigating = true; 1486 1487 var room = DOM.rooms[currentRoom]; 1488 1489 // Remove tilt. 1490 removeTilt(); 1491 // Animate the current slide out - animate the name, title and date elements. 1492 hideSlide(); 1493 1494 // Update currentRoom. 1495 if( dir === 'next' ) { 1496 currentRoom = currentRoom < totalRooms - 1 ? currentRoom + 1 : 0; 1497 } 1498 else { 1499 currentRoom = currentRoom > 0 ? currentRoom - 1 : totalRooms - 1; 1500 } 1501 1502 // Position the next room. 1503 var nextRoom = DOM.rooms[currentRoom]; 1504 nextRoom.style.transform = 'translate3d(' + (dir === 'next' ? 100 : -100) + '%,0,0) translate3d(' + (dir === 'next' ? 1 : -1) + 'px,0,0)' ; 1505 nextRoom.style.opacity = 1; 1506 1507 // Move back. 1508 move({transition: roomTransition, transform: resetTransform}) 1509 .then(function() { 1510 // Move left or right. 1511 return move({transform: { translateX : (dir === 'next' ? -100 : 100) + '%', translateY : 0, translateZ : 0, rotateX : 0, rotateY : 0, rotateZ : 0 }}); 1512 }) 1513 .then(function() { 1514 // Update current room class. 1515 nextRoom.classList.add('room--current'); 1516 room.classList.remove('room--current'); 1517 room.style.opacity = 0; 1518 1519 // Show the next slide. 1520 showSlide(); 1521 1522 // Move into room. 1523 // Update final transform state: 1524 return move({transform: { translateX : (dir === 'next' ? -100 : 100) + '%', translateY : 0, translateZ : '500px', rotateX : 0, rotateY : 0, rotateZ : 0 }}); 1525 }) 1526 .then(function() { 1527 // Reset positions. 1528 applyRoomTransition('none'); 1529 nextRoom.style.transform = 'translate3d(0,0,0)'; 1530 applyRoomTransform(initTransform); 1531 1532 setTimeout(function() { 1533 initTilt(); 1534 }, 60); 1535 isNavigating = false; 1536 }); 1537 } 1538 1539 function addAdjacentRooms() { 1540 // Current room. 1541 var room = DOM.rooms[currentRoom], 1542 // Adjacent rooms. 1543 nextRoom = DOM.rooms[currentRoom < totalRooms - 1 ? currentRoom + 1 : 0], 1544 prevRoom = DOM.rooms[currentRoom > 0 ? currentRoom - 1 : totalRooms - 1]; 1545 1546 // Position the adjacent rooms. 1547 nextRoom.style.transform = 'translate3d(100%,0,0) translate3d(3px,0,0)'; 1548 nextRoom.style.opacity = 1; 1549 prevRoom.style.transform = 'translate3d(-100%,0,0) translate3d(-3px,0,0)'; 1550 prevRoom.style.opacity = 1; 1551 } 1552 1553 function removeAdjacentRooms() { 1554 // Current room. 1555 var room = DOM.rooms[currentRoom], 1556 // Adjacent rooms. 1557 nextRoom = DOM.rooms[currentRoom < totalRooms - 1 ? currentRoom + 1 : 0], 1558 prevRoom = DOM.rooms[currentRoom > 0 ? currentRoom - 1 : totalRooms - 1]; 1559 1560 // Position the adjacent rooms. 1561 nextRoom.style.transform = 'none'; 1562 nextRoom.style.opacity = 0; 1563 prevRoom.style.transform = 'none'; 1564 prevRoom.style.opacity = 0; 1565 } 1566 1567 // Preload all the images. 1568 if(DOM.scroller) 1569 { 1570 imagesLoaded(DOM.scroller, function() { 1571 var extradelay = 1000; 1572 // Slide out loader. 1573 anime({ 1574 targets: DOM.loader, 1575 duration: 600, 1576 easing: 'easeInOutCubic', 1577 delay: extradelay, 1578 translateY: '-100%', 1579 begin: function() { 1580 init(); 1581 }, 1582 complete: function() { 1583 DOM.loader.classList.remove('overlay--active'); 1584 } 1585 }); 1586 }); 1587 } 1588 } ); 1589 //End execute javascript for slider 3d room 1590 1591 1592 //Start execute javascript for slider multi layouts 1593 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-multi-layouts.default', function( $scope ) { 1594 jQuery(".tg_multi_layouts_slider_wrapper").each(function() { 1595 document.documentElement.className = 'js'; 1596 1597 var sliderID = jQuery(this).attr('id'); 1598 var widgetID = jQuery(this).attr('widget-id'); 1599 var slideshow = new MLSlideshow(document.querySelector('#'+sliderID)); 1600 1601 if(document.querySelector('#next-slide-'+widgetID)) 1602 { 1603 document.querySelector('#next-slide-'+widgetID).addEventListener('click', function() { 1604 slideshow.next(); 1605 }); 1606 } 1607 1608 if(document.querySelector('#prev-slide-'+widgetID)) 1609 { 1610 document.querySelector('#prev-slide-'+widgetID).addEventListener('click', function() { 1611 slideshow.prev(); 1612 }); 1613 } 1614 }); 1615 } ); 1616 //End execute javascript for slider multi layouts 1617 1618 //Start execute javascript for slider velo 1619 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-velo.default', function( $scope ) { 1620 jQuery('body').addClass('elementor-fullscreen'); 1621 1622 /** 1623 * Velocity Effects 1624 * 1625 * First, A few Registered effects for velocity's ui kit. 1626 * Actual slider stuff below 1627 */ 1628 1629 var scaleDownAmnt = 0.7;
1630 var boxShadowAmnt = '40px'; 1631 1632 $.Velocity.RegisterEffect("translateUp", { 1633 defaultDuration: 1, 1634 calls: [ 1635 [{ 1636 translateY: '-100%' 1637 }, 1] 1638 ] 1639 }); 1640 $.Velocity.RegisterEffect("translateDown", { 1641 defaultDuration: 1, 1642 calls: [ 1643 [{ 1644 translateY: '100%' 1645 }, 1] 1646 ] 1647 }); 1648 $.Velocity.RegisterEffect("translateNone", { 1649 defaultDuration: 1, 1650 calls: [ 1651 [{ 1652 translateY: '0', 1653 opacity: '1', 1654 scale: '1', 1655 1656 }, 1] 1657 ] 1658 }); 1659 //scale down 1660 $.Velocity.RegisterEffect("scaleDown", { 1661 defaultDuration: 1, 1662 calls: [ 1663 [{ 1664 opacity: '0', 1665 scale: '0.7', 1666 1667 }, 1] 1668 ] 1669 }); 1670 1671 //gallery 1672 $.Velocity.RegisterEffect("scaleDown.moveUp", { 1673 defaultDuration: 1, 1674 calls: [ 1675 [{ 1676 translateY: '0%', 1677 scale: scaleDownAmnt, 1678 1679 }, 0.20], 1680 [{ 1681 translateY: '-100%' 1682 }, 0.60], 1683 [{ 1684 translateY: '-100%', 1685 scale: '1', 1686 // boxShadowBlur: '0' 1687 }, 0.20] 1688 ] 1689 }); 1690 $.Velocity.RegisterEffect("scaleDown.moveUp.scroll", { 1691 defaultDuration: 1, 1692 calls: [ 1693 [{ 1694 translateY: '-100%', 1695 scale: scaleDownAmnt, 1696 1697 }, 0.60], 1698 [{ 1699 translateY: '-100%', 1700 scale: '1', 1701 // boxShadowBlur: '0' 1702 }, 0.40] 1703 ] 1704 }); 1705 $.Velocity.RegisterEffect("scaleUp.moveUp", { 1706 defaultDuration: 1, 1707 calls: [ 1708 [{ 1709 translateY: '90%', 1710 scale: scaleDownAmnt, 1711 // boxShadowBlur: boxShadowAmnt 1712 }, 0.20], 1713 [{ 1714 translateY: '0%' 1715 }, 0.60], 1716 [{ 1717 translateY: '0%', 1718 scale: '1', 1719 // boxShadowBlur: '0' 1720 }, 0.20] 1721 ] 1722 }); 1723 $.Velocity.RegisterEffect("scaleUp.moveUp.scroll", { 1724 defaultDuration: 1, 1725 calls: [ 1726 [{ 1727 translateY: '0%', 1728 scale: scaleDownAmnt, 1729 // boxShadowBlur: boxShadowAmnt 1730 }, 0.60], 1731 [{ 1732 translateY: '0%', 1733 scale: '1', 1734 // boxShadowBlur: '0' 1735 }, 0.40] 1736 ] 1737 }); 1738 $.Velocity.RegisterEffect("scaleDown.moveDown", { 1739 defaultDuration: 1, 1740 calls: [ 1741 [{ 1742 translateY: '0%', 1743 scale: scaleDownAmnt, 1744 // boxShadowBlur: boxShadowAmnt 1745 }, 0.20], 1746 [{ 1747 translateY: '100%' 1748 }, 0.60], 1749 [{ 1750 translateY: '100%', 1751 scale: '1', 1752 // boxShadowBlur: '0' 1753 }, 0.20] 1754 ] 1755 }); 1756 $.Velocity.RegisterEffect("scaleDown.moveDown.scroll", { 1757 defaultDuration: 1, 1758 calls: [ 1759 [{ 1760 1761 }, 0.60], 1762 [{ 1763 translateY: '100%', 1764 scale: '1', 1765 // boxShadowBlur: '0' 1766 }, 0.40] 1767 ] 1768 }); 1769 $.Velocity.RegisterEffect("scaleUp.moveDown", { 1770 defaultDuration: 1, 1771 calls: [ 1772 [{ 1773 translateY: '-90%', 1774 scale: scaleDownAmnt, 1775 // boxShadowBlur: boxShadowAmnt 1776 }, 0.20], 1777 [{ 1778 translateY: '0%' 1779 }, 0.60], 1780 [{ 1781 translateY: '0%', 1782 scale: '1', 1783 // boxShadowBlur: '0' 1784 }, 0.20] 1785 ] 1786 }); 1787 1788 1789 1790 /** 1791 * Velo Slider 1792 * A Custom Slider using Velocity and Velocity UI effects 1793 */ 1794 1795 var VeloSlider = (function() { 1796 1797 /** 1798 * Global Settings 1799 */ 1800 var settings = { 1801 veloInit: $('.velo-slides').data('velo-slider'), 1802 $veloSlide: $('.velo-slide'), 1803 veloSlideBg: '.velo-slide__bg', 1804 navPrev: $('.velo-slides-nav').find('a.js-velo-slides-prev'), 1805 navNext: $('.velo-slides-nav').find('a.js-velo-slides-next'), 1806 veloBtn: $('.velo-slide__btn'), 1807 delta: 0, 1808 scrollThreshold: 7, 1809 currentSlide: 1, 1810 animating: false, 1811 animationDuration: 2000 1812 }; 1813 1814 1815 // Flags 1816 var delta = 0, 1817 animating = false; 1818 1819 return { 1820 1821 /** 1822 * Init 1823 */ 1824 init: function() { 1825 this.bind(); 1826 }, 1827 1828 /** 1829 * Bind our click, scroll, key events 1830 */ 1831 bind: function(){ 1832 1833 // Add active to first slide to set it off 1834 settings.$veloSlide.first().addClass('is-active'); 1835 1836 // Init with a data attribute, 1837 // Binding the animation to scroll, arrows, keys 1838 if (settings.veloInit == 'on') { 1839 VeloSlider.initScrollJack(); 1840 $(window).on('DOMMouseScroll mousewheel', VeloSlider.scrollJacking); 1841 } 1842 1843 // Arrow / Click Nav 1844 settings.navPrev.on('click', VeloSlider.prevSlide); 1845 settings.navNext.on('click', VeloSlider.nextSlide); 1846 1847 // Key Nav 1848 $(document).on('keydown', function(e) { 1849 var keyNext = (e.which == 39 || e.which == 40),
1850 keyPrev = (e.which == 37 || e.which == 38); 1851 1852 if (keyNext && !settings.navNext.hasClass('inactive')) { 1853 e.preventDefault(); 1854 VeloSlider.nextSlide(); 1855 1856 } else if (keyPrev && (!settings.navPrev.hasClass('inactive'))) { 1857 e.preventDefault(); 1858 VeloSlider.prevSlide(); 1859 } 1860 }); 1861 1862 jQuery('body').on('touchmove', function(e){ 1863 e.preventDefault(); 1864 e.stopPropagation(); 1865 1866 return false; 1867 }); 1868 1869 var ts; 1870 jQuery(document).bind('touchstart', function (e){ 1871 ts = e.originalEvent.touches[0].clientY; 1872 }); 1873 1874 jQuery(document).bind('touchend', function (e){ 1875 var te = e.originalEvent.changedTouches[0].clientY; 1876 if(ts > te+5){ 1877 VeloSlider.nextSlide(); 1878 }else if(ts < te-5){ 1879 VeloSlider.prevSlide(); 1880 } 1881 }); 1882 1883 //set navigation arrows visibility 1884 VeloSlider.checkNavigation(); 1885 1886 // Call Button Hover animation 1887 VeloSlider.hoverAnimation(); 1888 1889 }, 1890 1891 /** 1892 * Hover Animation 1893 * Adds 'is-hovering' class to the current slide 1894 * when hovering over the button. 1895 */ 1896 hoverAnimation: function(){ 1897 settings.veloBtn.hover(function (){ 1898 $(this).closest(settings.$veloSlide).toggleClass('is-hovering'); 1899 }); 1900 }, 1901 1902 /** 1903 * Set Animation 1904 * Defines the animation sequence, calling our registered velocity effects 1905 * @see js/components/_velocity-effects.js 1906 */ 1907 setAnimation: function(midStep, direction) { 1908 1909 // Vars for our velocity effects 1910 var animationVisible = 'translateNone', 1911 animationTop = 'translateUp', 1912 animationBottom = 'translateDown', 1913 easing = 'ease', 1914 animDuration = settings.animationDuration; 1915 1916 // Middle Step 1917 if (midStep) { 1918 animationVisible = 'scaleUp.moveUp.scroll'; 1919 animationTop = 'scaleDown.moveUp.scroll'; 1920 animationBottom = 'scaleDown.moveDown.scroll'; 1921 1922 } else { 1923 animationVisible = (direction == 'next') ? 'scaleUp.moveUp' : 'scaleUp.moveDown'; 1924 animationTop = 'scaleDown.moveUp'; 1925 animationBottom = 'scaleDown.moveDown'; 1926 } 1927 1928 return [animationVisible, animationTop, animationBottom, animDuration, easing]; 1929 }, 1930 1931 /** 1932 * Init Scroll Jaclk 1933 */ 1934 initScrollJack: function() { 1935 1936 var visibleSlide = settings.$veloSlide.filter('.is-active'), 1937 topSection = visibleSlide.prevAll(settings.$veloSlide), 1938 bottomSection = visibleSlide.nextAll(settings.$veloSlide), 1939 animationParams = VeloSlider.setAnimation(false), 1940 animationVisible = animationParams[0], 1941 animationTop = animationParams[1], 1942 animationBottom = animationParams[2]; 1943 console.log(animationParams); 1944 console.log(animationParams[4]); 1945 1946 visibleSlide.children('div').velocity(animationVisible, 1, function() { 1947 visibleSlide.css('opacity', 1); 1948 topSection.css('opacity', 1); 1949 bottomSection.css('opacity', 1); 1950 }); 1951 1952 topSection.children('div').velocity(animationTop, 0); 1953 bottomSection.children('div').velocity(animationBottom, 0); 1954 }, 1955 1956 /** 1957 * Scroll Jack 1958 * On Mouse Scroll 1959 */ 1960 scrollJacking: function(e) { 1961 if(!jQuery('body').hasClass('js_nav')) 1962 { 1963 if (e.originalEvent.detail < 0 || e.originalEvent.wheelDelta > 0) { 1964 delta--; 1965 (Math.abs(delta) >= settings.scrollThreshold) && VeloSlider.prevSlide(); 1966 } else { 1967 delta++; 1968 (delta >= settings.scrollThreshold) && VeloSlider.nextSlide(); 1969 } 1970 return false; 1971 } 1972 }, 1973 1974 /** 1975 * Previous Slide 1976 */ 1977 prevSlide: function(e) { 1978 //go to previous section 1979 typeof e !== 'undefined' && e.preventDefault(); 1980 1981 var visibleSlide = settings.$veloSlide.filter('.is-active'), 1982 animationParams = VeloSlider.setAnimation(midStep, 'prev'), 1983 midStep = false;
1984 1985 visibleSlide = midStep ? visibleSlide.next(settings.$veloSlide) : visibleSlide; 1986 1987 console.log(midStep); 1988 1989 if (!animating && !visibleSlide.is(":first-child")) { 1990 animating = true; 1991 1992 visibleSlide 1993 .removeClass('is-active') 1994 .children(settings.veloSlideBg) 1995 .velocity(animationParams[2], animationParams[3], animationParams[4]) 1996 .end() 1997 .prev(settings.$veloSlide) 1998 .addClass('is-active') 1999 .children(settings.veloSlideBg) 2000 .velocity(animationParams[0], animationParams[3], animationParams[4], function() { 2001 animating = false; 2002 }); 2003 currentSlide = settings.currentSlide - 1; 2004 } 2005 VeloSlider.resetScroll(); 2006 }, 2007 2008 2009 /** 2010 * Next Slide 2011 */ 2012 nextSlide: function(e) { 2013 2014 //go to next section 2015 typeof e !== 'undefined' && e.preventDefault(); 2016 2017 var visibleSlide = settings.$veloSlide.filter('.is-active'), 2018 animationParams = VeloSlider.setAnimation(midStep, 'next'), 2019 midStep = false; 2020 2021 if (!animating && !visibleSlide.is(":last-of-type")) { 2022 animating = true; 2023 2024 visibleSlide.removeClass('is-active') 2025 .children(settings.veloSlideBg) 2026 .velocity(animationParams[1], animationParams[3]) 2027 .end() 2028 .next(settings.$veloSlide) 2029 .addClass('is-active') 2030 .children(settings.veloSlideBg) 2031 .velocity(animationParams[0], animationParams[3], function() { 2032 animating = false; 2033 }); 2034 currentSlide = settings.currentSlide + 1; 2035 } 2036 VeloSlider.resetScroll(); 2037 }, 2038 2039 /** 2040 * Reset SCroll 2041 */ 2042 resetScroll: function() { 2043 delta = 0; 2044 VeloSlider.checkNavigation(); 2045 }, 2046 2047 /** 2048 * Check Nav 2049 * Adds / hides nav based on first/last slide 2050 * @todo - loop slides, without cloning if possible 2051 */ 2052 checkNavigation: function() { 2053 //update navigation arrows visibility 2054 (settings.$veloSlide.filter('.is-active').is(':first-of-type')) ? settings.navPrev.addClass('inactive'): settings.navPrev.removeClass('inactive'); 2055 (settings.$veloSlide.filter('.is-active').is(':last-of-type')) ? settings.navNext.addClass('inactive'): settings.navNext.removeClass('inactive'); 2056 2057 }, 2058 }; 2059 })(); 2060 2061 // INIT 2062 VeloSlider.init(); 2063 } ); 2064 //End execute javascript for slider velo 2065 2066 //Start execute javascript for slider popout 2067 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-popout.default', function( $scope ) { 2068 jQuery('body').addClass('elementor-fullscreen'); 2069 2070 function goToSlide(number){ 2071 $('.slider__slide').removeClass('slider__slide--active'); 2072 $('.slider__slide[data-slide='+number+']').addClass('slider__slide--active'); 2073 } 2074 2075 $('.slider__next, .go-to-next').on('click', function(){ 2076 var currentSlide = Number($('.slider__slide--active').data('slide')); 2077 var totalSlides = $('.slider__slide').length; 2078 currentSlide++ 2079 if (currentSlide > totalSlides){ 2080 currentSlide = 1; 2081 } 2082 goToSlide(currentSlide); 2083 }); 2084 2085 for (var i=1; i <= $('.slider__slide').length; i++){ 2086 $('.slider__indicators').append('<div class="slider__indicator" data-slide="'+i+'"></div>') 2087 } 2088 setTimeout(function(){ 2089 $('.slider__wrap').addClass('slider__wrap--hacked'); 2090 }, 1000); 2091 } ); 2092 //End execute javascript for slider popout 2093 2094 2095 //Start execute javascript for slider clip path 2096 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-clip-path.default', function( $scope ) { 2097 jQuery('body').addClass('elementor-fullscreen'); 2098 2099 (function() { 2100 var $slides = document.querySelectorAll('.slide'); 2101 var $controls = document.querySelectorAll('.slider__control'); 2102 var numOfSlides = $slides.length; 2103 var slidingAT = 1300; // sync this with scss variable 2104 var slidingBlocked = false;
2105 2106 [].slice.call($slides).forEach(function($el, index) { 2107 var i = index + 1; 2108 $el.classList.add('slide-' + i); 2109 $el.dataset.slide = i; 2110 }); 2111 2112 [].slice.call($controls).forEach(function($el) { 2113 $el.addEventListener('click', controlClickHandler); 2114 }); 2115 2116 function controlClickHandler() { 2117 if (slidingBlocked) return; 2118 slidingBlocked = true; 2119 2120 var $control = this; 2121 var isRight = $control.classList.contains('m--right'); 2122 var $curActive = document.querySelector('.slide.s--active'); 2123 var index = +$curActive.dataset.slide; 2124 (isRight) ? index++ : index--; 2125 if (index < 1) index = numOfSlides; 2126 if (index > numOfSlides) index = 1; 2127 var $newActive = document.querySelector('.slide-' + index); 2128 2129 $control.classList.add('a--rotation'); 2130 $curActive.classList.remove('s--active', 's--active-prev'); 2131 document.querySelector('.slide.s--prev').classList.remove('s--prev'); 2132 2133 $newActive.classList.add('s--active'); 2134 if (!isRight) $newActive.classList.add('s--active-prev'); 2135 2136 2137 var prevIndex = index - 1; 2138 if (prevIndex < 1) prevIndex = numOfSlides; 2139 2140 document.querySelector('.slide-' + prevIndex).classList.add('s--prev'); 2141 2142 setTimeout(function() { 2143 $control.classList.remove('a--rotation'); 2144 slidingBlocked = false; 2145 }, slidingAT*0.75); 2146 }; 2147 }()); 2148 } ); 2149 //End execute javascript for slider clip path 2150 2151 //Start execute javascript for gallery preview 2152 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-gallery-preview.default', function( $scope ) { 2153 jQuery('body').addClass('elementor-fullscreen'); 2154 jQuery('body').addClass('photographer-gallery-preview'); 2155 2156 var $slider = $('.slider'); 2157 var $slickTrack = $('.slick-track'); 2158 var $slickCurrent = $('.slick-current'); 2159 2160 var slideDuration = 900; 2161 2162 //RESET ANIMATIONS 2163 // On init slide change 2164 $slider.on('init', function(slick){ 2165 TweenMax.to($('.slick-track'), 0.9, { 2166 marginLeft: 0 2167 }); 2168 TweenMax.to($('.slick-active'), 0.9, { 2169 x: 0, 2170 zIndex: 2 2171 }); 2172 }); 2173 // On before slide change 2174 $slider.on('beforeChange', function(event, slick, currentSlide, nextSlide){ 2175 TweenMax.to($('.slick-track'), 0.9, { 2176 marginLeft: 0 2177 }); 2178 TweenMax.to($('.slick-active'), 0.9, { 2179 x: 0 2180 }); 2181 }); 2182 2183 // On after slide change 2184 $slider.on('afterChange', function(event, slick, currentSlide){ 2185 TweenMax.to($('.slick-track'), 0.9, { 2186 marginLeft: 0 2187 }); 2188 $('.slick-slide').css('z-index','1'); 2189 TweenMax.to($('.slick-active'), 0.9, { 2190 x: 0, 2191 zIndex: 2 2192 }); 2193 }); 2194 2195 var $sliderPagination = $('.slider').attr('data-pagination'); 2196 var dotsVar = false; 2197 if($sliderPagination == 'yes') 2198 { 2199 dotsVar = true; 2200 } 2201 2202 var $sliderNavigation = $('.slider').attr('data-navigation'); 2203 var arrowsVar = false; 2204 if($sliderNavigation == 'yes') 2205 { 2206 arrowsVar = true; 2207 } 2208 2209 var $sliderAutoPlay = $('.slider').attr('data-autoplay'); 2210 var autoPlayVar = false; 2211 var autoPlayTimeVar = 0; 2212 if (typeof $sliderAutoPlay != "undefined"){ 2213 autoPlayVar = true; 2214 autoPlayTimeVar = $sliderAutoPlay; 2215 } 2216 2217 //SLICK INIT 2218 $slider.slick({ 2219 speed: slideDuration, 2220 touchMove: true, 2221 dots: dotsVar, 2222 arrows: arrowsVar, 2223 waitForAnimate: true, 2224 useTransform: true, 2225 autoplay: autoPlayVar, 2226 autoplaySpeed: autoPlayTimeVar, 2227 cssEase: 'cubic-bezier(0.455, 0.030, 0.130, 1.000)' 2228 }) 2229 2230 //PREV 2231 $('.slick-prev').on('mouseenter', function(){ 2232 TweenMax.to($('.slick-track'), 0.6, { 2233 marginLeft: "180px", 2234 ease: Quad.easeOut 2235 }); 2236 TweenMax.to($('.slick-current'), 0.6, { 2237 x: -100, 2238 ease: Quad.easeOut 2239 }); 2240 }); 2241 2242 $('.slick-prev').on('mouseleave', function(){ 2243 TweenMax.to($('.slick-track'), 0.4, { 2244 marginLeft: 0, 2245 ease: Sine.easeInOut 2246 }); 2247 TweenMax.to($('.slick-current'), 0.4, { 2248 x: 0, 2249 ease: Sine.easeInOut 2250 }); 2251 }); 2252 2253 //NEXT 2254 $('.slick-next').on('mouseenter', function(){ 2255 2256 TweenMax.to($('.slick-track'), 0.6, { 2257 marginLeft: "-180px", 2258 ease: Quad.easeOut 2259 }); 2260 TweenMax.to($('.slick-current'), 0.6, { 2261 x: 100, 2262 ease: Quad.easeOut 2263 }); 2264 }); 2265 2266 $('.slick-next').on('mouseleave', function(){ 2267 TweenMax.to($('.slick-track'), 0.4, { 2268 marginLeft: 0, 2269 ease: Quad.easeInOut 2270 }); 2271 TweenMax.to($('.slick-current'), 0.4, { 2272 x: 0, 2273 ease: Quad.easeInOut 2274 }); 2275 }); 2276 } ); 2277 //End execute javascript for gallery preview 2278 2279 //Start execute javascript for slider split slick 2280 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-split-slick.default', function( $scope ) { 2281 jQuery('body').addClass('elementor-fullscreen'); 2282 2283 var $slider = $('.slideshow .slider'), 2284 maxItems = $('.item', $slider).length, 2285 dragging = false, 2286 tracking, 2287 rightTracking; 2288 2289 $sliderRight = $('.slideshow').clone().addClass('slideshow-right').appendTo($('.split-slideshow')); 2290 2291 rightItems = $('.item', $sliderRight).toArray(); 2292 reverseItems = rightItems.reverse(); 2293 $('.slider', $sliderRight).html(''); 2294 for (i = 0; i < maxItems; i++) { 2295 $(reverseItems[i]).appendTo($('.slider', $sliderRight)); 2296 } 2297 2298 $slider.addClass('slideshow-left'); 2299 $('.slideshow-left').slick({ 2300 vertical: true, 2301 verticalSwiping: true,
2302 arrows: false, 2303 infinite: true, 2304 dots: true, 2305 speed: 1000, 2306 cssEase: 'cubic-bezier(0.7, 0, 0.3, 1)' 2307 }).on('beforeChange', function(event, slick, currentSlide, nextSlide) { 2308 2309 if (currentSlide > nextSlide && nextSlide == 0 && currentSlide == maxItems - 1) { 2310 $('.slideshow-right .slider').slick('slickGoTo', -1); 2311 $('.slideshow-text').slick('slickGoTo', maxItems); 2312 } else if (currentSlide < nextSlide && currentSlide == 0 && nextSlide == maxItems - 1) { 2313 $('.slideshow-right .slider').slick('slickGoTo', maxItems); 2314 $('.slideshow-text').slick('slickGoTo', -1); 2315 } else { 2316 $('.slideshow-right .slider').slick('slickGoTo', maxItems - 1 - nextSlide); 2317 $('.slideshow-text').slick('slickGoTo', nextSlide); 2318 } 2319 }).on("mousewheel", function(event) { 2320 event.preventDefault(); 2321 if (event.deltaX > 0 || event.deltaY < 0) { 2322 $(this).slick('slickNext'); 2323 } else if (event.deltaX < 0 || event.deltaY > 0) { 2324 $(this).slick('slickPrev'); 2325 }; 2326 }).on('mousedown touchstart', function(){ 2327 dragging = true; 2328 tracking = $('.slick-track', $slider).css('transform'); 2329 tracking = parseInt(tracking.split(',')[5]); 2330 rightTracking = $('.slideshow-right .slick-track').css('transform'); 2331 rightTracking = parseInt(rightTracking.split(',')[5]); 2332 }).on('mousemove touchmove', function(){ 2333 if (dragging) { 2334 newTracking = $('.slideshow-left .slick-track').css('transform'); 2335 newTracking = parseInt(newTracking.split(',')[5]); 2336 diffTracking = newTracking - tracking; 2337 $('.slideshow-right .slick-track').css({'transform': 'matrix(1, 0, 0, 1, 0, ' + (rightTracking - diffTracking) + ')'}); 2338 } 2339 }).on('mouseleave touchend mouseup', function(){ 2340 dragging = false; 2341 }); 2342 2343 $('.slideshow-right .slider').slick({ 2344 swipe: false, 2345 vertical: true, 2346 arrows: false, 2347 infinite: true, 2348 speed: 950, 2349 cssEase: 'cubic-bezier(0.7, 0, 0.3, 1)', 2350 initialSlide: maxItems - 1 2351 }); 2352 $('.slideshow-text').slick({ 2353 swipe: false, 2354 vertical: true, 2355 arrows: false, 2356 infinite: true, 2357 speed: 900, 2358 cssEase: 'cubic-bezier(0.7, 0, 0.3, 1)' 2359 }); 2360 } ); 2361 //End execute javascript for slider split slick 2362 2363 //Start execute javascript for slider transitions 2364 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-transitions.default', function( $scope ) { 2365 jQuery('body').addClass('elementor-fullscreen'); 2366 2367 var mySwiper = new Swiper(".swiper-container", { 2368 direction: "vertical", 2369 loop: true, 2370 pagination: { 2371 el: '.swiper-pagination', 2372 type: 'bullets', 2373 clickable: true 2374 }, 2375 keyboard: { 2376 enabled: true, 2377 onlyInViewport: false, 2378 }, 2379 grabCursor: true, 2380 speed: 1000, 2381 paginationClickable: true, 2382 parallax: true, 2383 autoplay: false, 2384 effect: "slide", 2385 mousewheel: { 2386 invert: false, 2387 }, 2388 }); 2389 } ); 2390 //End execute javascript for slider transitions 2391 2392 //Start execute javascript for album grid 2393 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-album-grid.default', function( $scope ) { 2394 jQuery(function( $ ) { 2395 var tiltSettings = [ 2396 {}, 2397 { 2398 movement: { 2399 imgWrapper : { 2400 translation : {x: 10, y: 10, z: 30}, 2401 rotation : {x: 0, y: -10, z: 0}, 2402 reverseAnimation : {duration : 200, easing : 'easeOutQuad'} 2403 }, 2404 lines : { 2405 translation : {x: 10, y: 10, z: [0,70]}, 2406 rotation : {x: 0, y: 0, z: -2}, 2407 reverseAnimation : {duration : 2000, easing : 'easeOutExpo'} 2408 }, 2409 caption : { 2410 rotation : {x: 0, y: 0, z: 2}, 2411 reverseAnimation : {duration : 200, easing : 'easeOutQuad'} 2412 }, 2413 overlay : { 2414 translation : {x: 10, y: -10, z: 0}, 2415 rotation : {x: 0, y: 0, z: 2}, 2416 reverseAnimation : {duration : 2000, easing : 'easeOutExpo'} 2417 }, 2418 shine : { 2419 translation : {x: 100, y: 100, z: 0}, 2420 reverseAnimation : {duration : 200, easing : 'easeOutQuad'} 2421 } 2422 } 2423 }, 2424 { 2425 movement: { 2426 imgWrapper : { 2427 rotation : {x: -5, y: 10, z: 0}, 2428 reverseAnimation : {duration : 900, easing : 'easeOutCubic'} 2429 }, 2430 caption : { 2431 translation : {x: 30, y: 30, z: [0,40]}, 2432 rotation : {x: [0,15], y: 0, z: 0}, 2433 reverseAnimation : {duration : 1200, easing : 'easeOutExpo'} 2434 }, 2435 overlay : { 2436 translation : {x: 10, y: 10, z: [0,20]}, 2437 reverseAnimation : {duration : 1000, easing : 'easeOutExpo'} 2438 }, 2439 shine : { 2440 translation : {x: 100, y: 100, z: 0}, 2441 reverseAnimation : {duration : 900, easing : 'easeOutCubic'} 2442 } 2443 } 2444 }, 2445 { 2446 movement: { 2447 imgWrapper : { 2448 rotation : {x: -5, y: 10, z: 0}, 2449 reverseAnimation : {duration : 50, easing : 'easeOutQuad'} 2450 }, 2451 caption : { 2452 translation : {x: 20, y: 20, z: 0}, 2453 reverseAnimation : {duration : 200, easing : 'easeOutQuad'} 2454 }, 2455 overlay : { 2456 translation : {x: 5, y: -5, z: 0}, 2457 rotation : {x: 0, y: 0, z: 6}, 2458 reverseAnimation : {duration : 1000, easing : 'easeOutQuad'} 2459 }, 2460 shine : { 2461 translation : {x: 50, y: 50, z: 0}, 2462 reverseAnimation : {duration : 50, easing : 'easeOutQuad'} 2463 } 2464 } 2465 }, 2466 { 2467 movement: { 2468 imgWrapper : { 2469 translation : {x: 0, y: -8, z: 0}, 2470 rotation : {x: 3, y: 3, z: 0}, 2471 reverseAnimation : {duration : 1200, easing : 'easeOutExpo'} 2472 }, 2473 lines : { 2474 translation : {x: 15, y: 15, z: [0,15]}, 2475 reverseAnimation : {duration : 1200, easing : 'easeOutExpo'} 2476 }, 2477 overlay : { 2478 translation : {x: 0, y: 8, z: 0}, 2479 reverseAnimation : {duration : 600, easing : 'easeOutExpo'} 2480 }, 2481 caption : { 2482 translation : {x: 10, y: -15, z: 0}, 2483 reverseAnimation : {duration : 900, easing : 'easeOutExpo'} 2484 }, 2485 shine : { 2486 translation : {x: 50, y: 50, z: 0}, 2487 reverseAnimation : {duration : 1200, easing : 'easeOutExpo'} 2488 } 2489 } 2490 }, 2491 { 2492 movement: { 2493 lines : { 2494 translation : {x: -5, y: 5, z: 0}, 2495 reverseAnimation : {duration : 1000, easing : 'easeOutExpo'} 2496 }, 2497 caption : { 2498 translation : {x: 15, y: 15, z: 0}, 2499 rotation : {x: 0, y: 0, z: 3}, 2500 reverseAnimation : {duration : 1500, easing : 'easeOutElastic', elasticity : 700} 2501 }, 2502 overlay : { 2503 translation : {x: 15, y: -15, z: 0}, 2504 reverseAnimation : {duration : 500,easing : 'easeOutExpo'} 2505 }, 2506 shine : { 2507 translation : {x: 50, y: 50, z: 0}, 2508 reverseAnimation : {duration : 500, easing : 'easeOutExpo'} 2509 } 2510 } 2511 }, 2512 { 2513 movement: { 2514 imgWrapper : { 2515 translation : {x: 5, y: 5, z: 0}, 2516 reverseAnimation : {duration : 800, easing : 'easeOutQuart'} 2517 }, 2518 caption : { 2519 translation : {x: 10, y: 10, z: [0,50]}, 2520 reverseAnimation : {duration : 1000, easing : 'easeOutQuart'} 2521 }, 2522 shine : { 2523 translation : {x: 50, y: 50, z: 0}, 2524 reverseAnimation : {duration : 800, easing : 'easeOutQuart'} 2525 } 2526 } 2527 }, 2528 { 2529 movement: { 2530 lines : { 2531 translation : {x: 40, y: 40, z: 0}, 2532 reverseAnimation : {duration : 1500, easing : 'easeOutElastic'} 2533 }, 2534 caption : { 2535 translation : {x: 20, y: 20, z: 0}, 2536 rotation : {x: 0, y: 0, z: -5}, 2537 reverseAnimation : {duration : 1000, easing : 'easeOutExpo'} 2538 }, 2539 overlay : { 2540 translation : {x: -30, y: -30, z: 0}, 2541 rotation : {x: 0, y: 0, z: 3}, 2542 reverseAnimation : {duration : 750, easing : 'easeOutExpo'} 2543 }, 2544 shine : { 2545 translation : {x: 100, y: 100, z: 0}, 2546 reverseAnimation : {duration : 750, easing : 'easeOutExpo'} 2547 } 2548 } 2549 }]; 2550
2551 function init() { 2552 var idx = 0; 2553 [].slice.call(document.querySelectorAll('a.tilter')).forEach(function(el, pos) { 2554 idx = pos%2 === 0 ? idx+1 : idx; 2555 new TiltFx(el, tiltSettings[idx-1]); 2556 }); 2557 } 2558 2559 init(); 2560 }); 2561 } ); 2562 //End execute javascript for album grid 2563 2564 2565 //Start execute javascript for slider property clip 2566 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-property-clip.default', function( $scope ) { 2567 jQuery(".tg_slider_property_clip_wrapper").each(function() { 2568 var slider = jQuery(this).find(".slider"), 2569 slides = slider.find('li'), 2570 nav = slider.find('nav'); 2571 2572 slides.eq(0).addClass('current'); 2573 2574 nav.children('a').eq(0).addClass('current_dot'); 2575 2576 nav.on('click', 'a', function(event) { 2577 event.preventDefault(); 2578 $(this).addClass('current_dot').siblings().removeClass('current_dot'); 2579 slides.eq($(this).index()).addClass('current').removeClass('prev').siblings().removeClass('current'); 2580 slides.eq($(this).index()).prevAll().addClass('prev'); 2581 slides.eq($(this).index()).nextAll().removeClass('prev'); 2582 }); 2583 }); 2584 } ); 2585 //End execute javascript for slider property clip 2586 2587 //Start execute javascript for slider slice 2588 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-slice.default', function( $scope ) { 2589 jQuery(".tg_slice_slide_container").each(function() { 2590 var slider = jQuery(this); 2591 var slide = jQuery(this).children('.slide'); 2592 var currentSlideIndex = slider.attr('data-current'); 2593 var navPrev = jQuery(this).find('.js-prev'); 2594 var navNext = jQuery(this).find('.js-next'); 2595 2596 var SliceSlider = { 2597 2598 /** 2599 * Settings Object 2600 */ 2601 settings: { 2602 delta: 0, 2603 currentSlideIndex: 0, 2604 scrollThreshold: 40, 2605 slides: slide, 2606 numSlides: slide.length, 2607 navPrev: navPrev, 2608 navNext: navNext, 2609 }, 2610 2611 /** 2612 * Init 2613 */ 2614 init: function() { 2615 s = this.settings; 2616 this.bindEvents(); 2617 }, 2618 2619 /** 2620 * Bind our click, scroll, key events 2621 */ 2622 bindEvents: function(){ 2623 2624 // Scrollwheel & trackpad 2625 /*s.slides.on({ 2626 'DOMMouseScroll mousewheel' : SliceSlider.handleScroll 2627 });*/ 2628 // On click prev 2629 s.navPrev.on({ 2630 'click' : SliceSlider.prevSlide 2631 }); 2632 // On click next 2633 s.navNext.on({ 2634 'click' : SliceSlider.nextSlide 2635 }); 2636 }, 2637 2638 /** 2639 * Show Slide 2640 */ 2641 showSlide: function(){ 2642 // reset 2643 s.delta = 0; 2644 // Bail if we're already sliding 2645 if ($('body').hasClass('is-sliding')){ 2646 return; 2647 } 2648 // Loop through our slides 2649 s.slides.each(function(i, slide) { 2650 2651 // Toggle the is-active class to show slide 2652 $(slide).toggleClass('is-active', (i === currentSlideIndex)); 2653 $(slide).toggleClass('is-prev', (i === currentSlideIndex - 1)); 2654 $(slide).toggleClass('is-next', (i === currentSlideIndex + 1)); 2655 2656 // Add and remove is-sliding class 2657 $('body').addClass('is-sliding'); 2658 2659 setTimeout(function(){ 2660 $('body').removeClass('is-sliding'); 2661 }, 1000); 2662 }); 2663 }, 2664 2665 /** 2666 * Previous Slide 2667 */ 2668 prevSlide: function(){ 2669 2670 // If on first slide, loop to last 2671 if (currentSlideIndex <= 0) { 2672 currentSlideIndex = s.numSlides; 2673 } 2674 currentSlideIndex = parseInt(currentSlideIndex-1); 2675 slider.attr('data-current', currentSlideIndex); 2676 2677 SliceSlider.showSlide(); 2678 }, 2679 2680 /** 2681 * Next Slide 2682 */ 2683 nextSlide: function(){ 2684 2685 currentSlideIndex = parseInt(currentSlideIndex+1); 2686 slider.attr('data-current', currentSlideIndex); 2687 2688 // If on last slide, loop to first 2689 if (currentSlideIndex >= s.numSlides) { 2690 currentSlideIndex = 0; 2691 slider.attr('data-current', currentSlideIndex); 2692 } 2693 2694 SliceSlider.showSlide(); 2695 }, 2696 }; 2697 SliceSlider.init(); 2698 }); 2699 } ); 2700 //End execute javascript for slider slice 2701
2702 //Start execute javascript for slider flip 2703 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-flip.default', function( $scope ) { 2704 jQuery('body').addClass('elementor-fullscreen'); 2705 jQuery('body').addClass('elementor-overflow'); 2706 2707 var Gallery = (function() { 2708 var scrollTimeId; 2709 var posLeft = 0; 2710 2711 function Gallery(config) { 2712 this.list = $(config.list); 2713 this.items = this.list.find('li'); 2714 this.itemWidth = this.items.outerWidth(); 2715 }; 2716 2717 Gallery.prototype = { 2718 constructor: Gallery, 2719 2720 init: function() { 2721 this.setGalleryWidth(); 2722 this.eventManager(); 2723 2724 return this; 2725 }, 2726 2727 eventManager: function() { 2728 var _this = this; 2729 2730 $("html, body").on('mousewheel', function(event) { 2731 clearTimeout(scrollTimeId); 2732 scrollTimeId = setTimeout(onScrollEventHandler.bind(this, event, _this.itemWidth), 0); 2733 }); 2734 }, 2735 2736 setGalleryWidth: function() { 2737 this.list.css('width', this.getGalleryWidth()); 2738 this.list.css('overflow', 'scroll'); 2739 }, 2740 2741 getGalleryWidth: function() { 2742 var width = 0; 2743 2744 this.items.each(function(index, item) { 2745 width += $(this).outerWidth(); 2746 }); 2747 2748 return width; 2749 } 2750 }; 2751 2752 function onScrollEventHandler(event, width) { 2753 if (event.deltaY > 0) { 2754 this.scrollLeft -= width / 20; 2755 } else { 2756 this.scrollLeft += width / 20; 2757 } 2758 2759 event.preventDefault(); 2760 }; 2761 2762 return Gallery; 2763 })(); 2764 2765 2766 $(document).ready(function() { 2767 var gallery = new Gallery({ 2768 list: '.tg_flip_slide_container .container .gallery' 2769 }).init(); 2770 2771 jQuery('.tg_flip_slide_container').css('overflow', 'scroll'); 2772 jQuery('body').css('overflow', 'scroll'); 2773 }); 2774 } ); 2775 //End execute javascript for slider flip 2776 2777 //Start execute javascript for slider split carousel 2778 elementorFrontend.hooks.addAction( 'frontend/element_ready/photographer-slider-split-carousel.default', function( $scope ) { 2779 jQuery(".tg_split_carousel_slider_wrapper").each(function() { 2780 var $carousel = jQuery(this); 2781 2782 var fullscreen = $carousel.attr('data-fullscreen'); 2783 if(fullscreen != 0) 2784 { 2785 jQuery('body').addClass('elementor-fullscreen'); 2786 2787 //Get menu element height 2788 var menuHeight = parseInt(jQuery('#wrapper').css('paddingTop')); 2789 var documentHeight = jQuery(window).innerHeight(); 2790 var sliderHeight = parseInt(documentHeight - menuHeight); 2791 2792 $carousel.css('height', sliderHeight+'px'); 2793 2794 jQuery( window ).resize(function() { 2795 var menuHeight = parseInt(jQuery('#wrapper').css('paddingTop')); 2796 var documentHeight = jQuery(window).innerHeight(); 2797 var sliderHeight = parseInt(documentHeight - menuHeight); 2798 2799 $carousel.css('height', sliderHeight+'px'); 2800 }); 2801 } 2802 2803 var activeIndex = 0; 2804 var limit = 0; 2805 var disabled = false; 2806 var $stage = void 0; 2807 var $controls = void 0; 2808 var canvas = false; 2809 2810 var SPIN_FORWARD_CLASS = 'js-spin-fwd'; 2811 var SPIN_BACKWARD_CLASS = 'js-spin-bwd'; 2812 var DISABLE_TRANSITIONS_CLASS = 'js-transitions-disabled'; 2813 var SPIN_DUR = 1000; 2814 2815 var appendControls = function appendControls() { 2816 for (var i = 0; i < limit; i++) { 2817 $('.carousel__control').append('<a href="#" data-index="' + i + '"></a>'); 2818 } 2819 var height = $('.carousel__control').children().last().outerHeight(); 2820 2821 $('.carousel__control').css('height', 30 + limit * height); 2822 $controls = $('.carousel__control').children(); 2823 $controls.eq(activeIndex).addClass('active'); 2824 }; 2825 2826 var setIndexes = function setIndexes() { 2827 $('.spinner').children().each(function (i, el) { 2828 $(el).attr('data-index', i); 2829 limit++; 2830 }); 2831 }; 2832 2833 var duplicateSpinner = function duplicateSpinner() { 2834 var $el = $('.spinner').parent(); 2835 var html = $('.spinner').parent().html(); 2836 $el.append(html); 2837 $('.spinner').last().addClass('spinner--right'); 2838 $('.spinner--right').removeClass('spinner--left'); 2839 }; 2840 2841 var paintFaces = function paintFaces() { 2842 $('.spinner__face').each(function (i, el) { 2843 var $el = $(el); 2844 var color = $(el).attr('data-bg'); 2845 $el.children().css('backgroundImage', 'url(' + getBase64PixelByColor(color) + ')'); 2846 }); 2847 }; 2848 2849 var getBase64PixelByColor = function getBase64PixelByColor(hex) { 2850 if (!canvas) { 2851 canvas = document.createElement('canvas'); 2852 canvas.height = 1; 2853 canvas.width = 1; 2854 } 2855 if (canvas.getContext) { 2856 var ctx = canvas.getContext('2d'); 2857 ctx.fillStyle = hex; 2858 ctx.fillRect(0, 0, 1, 1); 2859 return canvas.toDataURL(); 2860 } 2861 return false;
2862 }; 2863 2864 var prepareDom = function prepareDom() { 2865 setIndexes(); 2866 paintFaces(); 2867 duplicateSpinner(); 2868 appendControls(); 2869 }; 2870 2871 var spin = function spin() { 2872 var inc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; 2873 2874 if (disabled) return; 2875 if (!inc) return; 2876 activeIndex += inc; 2877 disabled = true; 2878 2879 if (activeIndex >= limit) { 2880 activeIndex = 0; 2881 } 2882 2883 if (activeIndex < 0) { 2884 activeIndex = limit - 1; 2885 } 2886 2887 var $activeEls = $('.spinner__face.js-active'); 2888 var $nextEls = $('.spinner__face[data-index=' + activeIndex + ']'); 2889 $nextEls.addClass('js-next'); 2890 2891 if (inc > 0) { 2892 $stage.addClass(SPIN_FORWARD_CLASS); 2893 } else { 2894 $stage.addClass(SPIN_BACKWARD_CLASS); 2895 } 2896 2897 $controls.removeClass('active'); 2898 $controls.eq(activeIndex).addClass('active'); 2899 2900 setTimeout(function () { 2901 spinCallback(inc); 2902 }, SPIN_DUR, inc); 2903 }; 2904 2905 var spinCallback = function spinCallback(inc) { 2906 2907 $('.js-active').removeClass('js-active'); 2908 $('.js-next').removeClass('js-next').addClass('js-active'); 2909 $stage.addClass(DISABLE_TRANSITIONS_CLASS).removeClass(SPIN_FORWARD_CLASS).removeClass(SPIN_BACKWARD_CLASS); 2910 2911 $('.js-active').each(function (i, el) { 2912 var $el = $(el); 2913 $el.prependTo($el.parent()); 2914 }); 2915 setTimeout(function () { 2916 $stage.removeClass(DISABLE_TRANSITIONS_CLASS); 2917 disabled = false; 2918 }, 100); 2919 }; 2920 2921 var attachListeners = function attachListeners() { 2922 2923 document.onkeyup = function (e) { 2924 switch (e.keyCode) { 2925 case 38: 2926 spin(-1); 2927 break; 2928 case 40: 2929 spin(1); 2930 break; 2931 } 2932 }; 2933 2934 $carousel.bind('DOMMouseScroll', function(e){ 2935 if(e.originalEvent.detail > 0) { 2936 //scroll down 2937 spin(1); 2938 }else { 2939 //scroll up 2940 spin(-1); 2941 } 2942 2943 //prevent page fom scrolling 2944 return false; 2945 }); 2946 2947 //IE, Opera, Safari 2948 $carousel.bind('mousewheel', function(e){ 2949 if(e.originalEvent.wheelDelta < 0) { 2950 //scroll down 2951 spin(1); 2952 }else { 2953 //scroll up 2954 spin(-1); 2955 } 2956 2957 //prevent page fom scrolling 2958 return false; 2959 }); 2960 2961 jQuery('body').on('touchmove', function(e){ 2962 e.preventDefault(); 2963 e.stopPropagation(); 2964 2965 return false; 2966 }); 2967 2968 var ts; 2969 $carousel.bind('touchstart', function (e){ 2970 ts = e.originalEvent.touches[0].clientY; 2971 }); 2972 2973 $carousel.bind('touchend', function (e){ 2974 var te = e.originalEvent.changedTouches[0].clientY; 2975 if(ts > te+5){ 2976 spin(1); 2977 }else if(ts < te-5){ 2978 spin(-1); 2979 } 2980 }); 2981 2982 $controls.on('click', function (e) { 2983 e.preventDefault(); 2984 if (disabled) return; 2985 var $el = $(e.target); 2986 var toIndex = parseInt($el.attr('data-index'), 10); 2987 spin(toIndex - activeIndex); 2988 }); 2989 }; 2990 2991 var assignEls = function assignEls() { 2992 $stage = $('.carousel__stage'); 2993 }; 2994 2995 var init = function init() { 2996 assignEls(); 2997 prepareDom(); 2998 attachListeners(); 2999 }; 3000 3001 $(function () { 3002 init(); 3003 }); 3004 }); 3005 } ); 3006 //End execute javascript for slider split carousel 3007 3008 //Start execute javascript for horizontal timeline 3009 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-horizontal-timeline.default', function( $scope ) { 3010 var timelines = jQuery('.cd-horizontal-timeline'); 3011 var eventsMinDistance = timelines.attr('data-spacing'); 3012 3013 if(eventsMinDistance == '') 3014 { 3015 eventsMinDistance = 60; 3016 } 3017 3018 (timelines.length > 0) && initTimeline(timelines); 3019 3020 function initTimeline(timelines) { 3021 timelines.each(function(){ 3022 var timeline = jQuery(this), 3023 timelineComponents = {}; 3024 //cache timeline components 3025 timelineComponents['timelineWrapper'] = timeline.find('.events-wrapper'); 3026 timelineComponents['eventsWrapper'] = timelineComponents['timelineWrapper'].children('.events'); 3027 timelineComponents['fillingLine'] = timelineComponents['eventsWrapper'].children('.filling-line'); 3028 timelineComponents['timelineEvents'] = timelineComponents['eventsWrapper'].find('a'); 3029 timelineComponents['timelineDates'] = parseDate(timelineComponents['timelineEvents']); 3030 timelineComponents['eventsMinLapse'] = minLapse(timelineComponents['timelineDates']); 3031 timelineComponents['timelineNavigation'] = timeline.find('.cd-timeline-navigation'); 3032 timelineComponents['eventsContent'] = timeline.children('.events-content'); 3033 3034 //assign a left postion to the single events along the timeline 3035 setDatePosition(timelineComponents, eventsMinDistance); 3036 //assign a width to the timeline 3037 var timelineTotWidth = setTimelineWidth(timelineComponents, eventsMinDistance); 3038 //the timeline has been initialize - show it 3039 timeline.addClass('loaded'); 3040 3041 //detect click on the next arrow 3042 timelineComponents['timelineNavigation'].on('click', '.next', function(event){ 3043 event.preventDefault(); 3044 updateSlide(timelineComponents, timelineTotWidth, 'next'); 3045 }); 3046 //detect click on the prev arrow 3047 timelineComponents['timelineNavigation'].on('click', '.prev', function(event){ 3048 event.preventDefault(); 3049 updateSlide(timelineComponents, timelineTotWidth, 'prev'); 3050 }); 3051 //detect click on the a single event - show new event content 3052 timelineComponents['eventsWrapper'].on('click', 'a', function(event){ 3053 event.preventDefault(); 3054 timelineComponents['timelineEvents'].removeClass('selected'); 3055 jQuery(this).addClass('selected'); 3056 updateOlderEvents(jQuery(this)); 3057 updateFilling(jQuery(this), timelineComponents['fillingLine'], timelineTotWidth); 3058 updateVisibleContent(jQuery(this), timelineComponents['eventsContent']); 3059 }); 3060 3061 //on swipe, show next/prev event content 3062 timelineComponents['eventsContent'].on('swipeleft', function(){ 3063 var mq = checkMQ(); 3064 ( mq == 'mobile' ) && showNewContent(timelineComponents, timelineTotWidth, 'next'); 3065 }); 3066 timelineComponents['eventsContent'].on('swiperight', function(){ 3067 var mq = checkMQ(); 3068 ( mq == 'mobile' ) && showNewContent(timelineComponents, timelineTotWidth, 'prev'); 3069 }); 3070 3071 //keyboard navigation 3072 jQuery(document).keyup(function(event){ 3073 if(event.which=='37' && elementInViewport(timeline.get(0)) ) { 3074 showNewContent(timelineComponents, timelineTotWidth, 'prev'); 3075 } else if( event.which=='39' && elementInViewport(timeline.get(0))) { 3076 showNewContent(timelineComponents, timelineTotWidth, 'next'); 3077 } 3078 }); 3079 }); 3080 } 3081 3082 function updateSlide(timelineComponents, timelineTotWidth, string) { 3083 //retrieve translateX value of timelineComponents['eventsWrapper'] 3084 var translateValue = getTranslateValue(timelineComponents['eventsWrapper']),
3085 wrapperWidth = Number(timelineComponents['timelineWrapper'].css('width').replace('px', '')); 3086 //translate the timeline to the left('next')/right('prev') 3087 (string == 'next') 3088 ? translateTimeline(timelineComponents, translateValue - wrapperWidth + eventsMinDistance, wrapperWidth - timelineTotWidth) 3089 : translateTimeline(timelineComponents, translateValue + wrapperWidth - eventsMinDistance); 3090 } 3091 3092 function showNewContent(timelineComponents, timelineTotWidth, string) { 3093 //go from one event to the next/previous one 3094 var visibleContent = timelineComponents['eventsContent'].find('.selected'), 3095 newContent = ( string == 'next' ) ? visibleContent.next() : visibleContent.prev(); 3096 3097 if ( newContent.length > 0 ) { //if there's a next/prev event - show it 3098 var selectedDate = timelineComponents['eventsWrapper'].find('.selected'), 3099 newEvent = ( string == 'next' ) ? selectedDate.parent('li').next('li').children('a') : selectedDate.parent('li').prev('li').children('a'); 3100 3101 updateFilling(newEvent, timelineComponents['fillingLine'], timelineTotWidth); 3102 updateVisibleContent(newEvent, timelineComponents['eventsContent']); 3103 newEvent.addClass('selected'); 3104 selectedDate.removeClass('selected'); 3105 updateOlderEvents(newEvent); 3106 updateTimelinePosition(string, newEvent, timelineComponents, timelineTotWidth); 3107 } 3108 } 3109 3110 function updateTimelinePosition(string, event, timelineComponents, timelineTotWidth) { 3111 //translate timeline to the left/right according to the position of the selected event 3112 var eventStyle = window.getComputedStyle(event.get(0), null), 3113 eventLeft = Number(eventStyle.getPropertyValue("left").replace('px', '')), 3114 timelineWidth = Number(timelineComponents['timelineWrapper'].css('width').replace('px', '')), 3115 timelineTotWidth = Number(timelineComponents['eventsWrapper'].css('width').replace('px', '')); 3116 var timelineTranslate = getTranslateValue(timelineComponents['eventsWrapper']); 3117 3118 if( (string == 'next' && eventLeft > timelineWidth - timelineTranslate) || (string == 'prev' && eventLeft < - timelineTranslate) ) { 3119 translateTimeline(timelineComponents, - eventLeft + timelineWidth/2, timelineWidth - timelineTotWidth); 3120 } 3121 } 3122 3123 function translateTimeline(timelineComponents, value, totWidth) { 3124 var eventsWrapper = timelineComponents['eventsWrapper'].get(0); 3125 value = (value > 0) ? 0 : value; //only negative translate value 3126 value = ( !(typeof totWidth === 'undefined') && value < totWidth ) ? totWidth : value; //do not translate more than timeline width 3127 setTransformValue(eventsWrapper, 'translateX', value+'px'); 3128 //update navigation arrows visibility 3129 (value == 0 ) ? timelineComponents['timelineNavigation'].find('.prev').addClass('inactive') : timelineComponents['timelineNavigation'].find('.prev').removeClass('inactive'); 3130 (value == totWidth ) ? timelineComponents['timelineNavigation'].find('.next').addClass('inactive') : timelineComponents['timelineNavigation'].find('.next').removeClass('inactive'); 3131 } 3132 3133 function updateFilling(selectedEvent, filling, totWidth) { 3134 //change .filling-line length according to the selected event 3135 var eventStyle = window.getComputedStyle(selectedEvent.get(0), null), 3136 eventLeft = eventStyle.getPropertyValue("left"), 3137 eventWidth = eventStyle.getPropertyValue("width"); 3138 eventLeft = Number(eventLeft.replace('px', '')) + Number(eventWidth.replace('px', ''))/2; 3139 var scaleValue = eventLeft/totWidth; 3140 setTransformValue(filling.get(0), 'scaleX', scaleValue); 3141 } 3142 3143 function setDatePosition(timelineComponents, min) { 3144 for (i = 0; i < timelineComponents['timelineDates'].length; i++) { 3145 var distance = daydiff(timelineComponents['timelineDates'][0], timelineComponents['timelineDates'][i]), 3146 distanceNorm = Math.round(distance/timelineComponents['eventsMinLapse']) + 2; 3147 timelineComponents['timelineEvents'].eq(i).css('left', distanceNorm*min+'px'); 3148 } 3149 } 3150 3151 function setTimelineWidth(timelineComponents, width) { 3152 var timeSpan = daydiff(timelineComponents['timelineDates'][0], timelineComponents['timelineDates'][timelineComponents['timelineDates'].length-1]), 3153 timeSpanNorm = timeSpan/timelineComponents['eventsMinLapse'], 3154 timeSpanNorm = Math.round(timeSpanNorm) + 4, 3155 totalWidth = timeSpanNorm*width; 3156 timelineComponents['eventsWrapper'].css('width', totalWidth+'px'); 3157 updateFilling(timelineComponents['timelineEvents'].eq(0), timelineComponents['fillingLine'], totalWidth); 3158 3159 return totalWidth; 3160 } 3161 3162 function updateVisibleContent(event, eventsContent) { 3163 var eventDate = event.data('date'), 3164 visibleContent = eventsContent.find('.selected'), 3165 selectedContent = eventsContent.find('[data-date="'+ eventDate +'"]'), 3166 selectedContentHeight = selectedContent.height(); 3167 3168 if (selectedContent.index() > visibleContent.index()) { 3169 var classEnetering = 'selected enter-right', 3170 classLeaving = 'leave-left'; 3171 } else { 3172 var classEnetering = 'selected enter-left', 3173 classLeaving = 'leave-right'; 3174 } 3175 3176 selectedContent.attr('class', classEnetering); 3177 visibleContent.attr('class', classLeaving).one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(){ 3178 visibleContent.removeClass('leave-right leave-left'); 3179 selectedContent.removeClass('enter-left enter-right'); 3180 }); 3181 eventsContent.css('height', selectedContentHeight+'px'); 3182 } 3183 3184 function updateOlderEvents(event) { 3185 event.parent('li').prevAll('li').children('a').addClass('older-event').end().end().nextAll('li').children('a').removeClass('older-event'); 3186 } 3187 3188 function getTranslateValue(timeline) { 3189 var timelineStyle = window.getComputedStyle(timeline.get(0), null), 3190 timelineTranslate = timelineStyle.getPropertyValue("-webkit-transform") || 3191 timelineStyle.getPropertyValue("-moz-transform") || 3192 timelineStyle.getPropertyValue("-ms-transform") || 3193 timelineStyle.getPropertyValue("-o-transform") || 3194 timelineStyle.getPropertyValue("transform"); 3195 3196 if( timelineTranslate.indexOf('(') >=0 ) { 3197 var timelineTranslate = timelineTranslate.split('(')[1]; 3198 timelineTranslate = timelineTranslate.split(')')[0]; 3199 timelineTranslate = timelineTranslate.split(','); 3200 var translateValue = timelineTranslate[4]; 3201 } else { 3202 var translateValue = 0; 3203 } 3204 3205 return Number(translateValue); 3206 } 3207 3208 function setTransformValue(element, property, value) { 3209 element.style["-webkit-transform"] = property+"("+value+")"; 3210 element.style["-moz-transform"] = property+"("+value+")"; 3211 element.style["-ms-transform"] = property+"("+value+")"; 3212 element.style["-o-transform"] = property+"("+value+")"; 3213 element.style["transform"] = property+"("+value+")"; 3214 } 3215 3216 //based on http://stackoverflow.com/questions/542938/how-do-i-get-the-number-of-days-between-two-dates-in-javascript 3217 function parseDate(events) { 3218 var dateArrays = []; 3219 events.each(function(){ 3220 var dateComp = jQuery(this).data('date').split('/'), 3221 newDate = new Date(dateComp[2], dateComp[1]-1, dateComp[0]); 3222 dateArrays.push(newDate); 3223 }); 3224 return dateArrays; 3225 } 3226 3227 function parseDate2(events) { 3228 var dateArrays = []; 3229 events.each(function(){ 3230 var singleDate = jQuery(this), 3231 dateComp = singleDate.data('date').split('T'); 3232 if( dateComp.length > 1 ) { //both DD/MM/YEAR and time are provided 3233 var dayComp = dateComp[0].split('/'), 3234 timeComp = dateComp[1].split(':'); 3235 } else if( dateComp[0].indexOf(':') >=0 ) { //only time is provide 3236 var dayComp = ["2000", "0", "0"], 3237 timeComp = dateComp[0].split(':'); 3238 } else { //only DD/MM/YEAR 3239 var dayComp = dateComp[0].split('/'), 3240 timeComp = ["0", "0"]; 3241 } 3242 var newDate = new Date(dayComp[2], dayComp[1]-1, dayComp[0], timeComp[0], timeComp[1]); 3243 dateArrays.push(newDate); 3244 }); 3245 return dateArrays; 3246 } 3247 3248 function daydiff(first, second) { 3249 return Math.round((second-first)); 3250 } 3251 3252 function minLapse(dates) { 3253 //determine the minimum distance among events 3254 var dateDistances = []; 3255 for (i = 1; i < dates.length; i++) { 3256 var distance = daydiff(dates[i-1], dates[i]); 3257 dateDistances.push(distance); 3258 } 3259 return Math.min.apply(null, dateDistances); 3260 } 3261 3262 /* 3263 How to tell if a DOM element is visible in the current viewport? 3264 http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport 3265 */ 3266 function elementInViewport(el) { 3267 var top = el.offsetTop; 3268 var left = el.offsetLeft; 3269 var width = el.offsetWidth; 3270 var height = el.offsetHeight; 3271 3272 while(el.offsetParent) { 3273 el = el.offsetParent; 3274 top += el.offsetTop; 3275 left += el.offsetLeft; 3276 } 3277 3278 return ( 3279 top < (window.pageYOffset + window.innerHeight) && 3280 left < (window.pageXOffset + window.innerWidth) && 3281 (top + height) > window.pageYOffset && 3282 (left + width) > window.pageXOffset 3283 ); 3284 } 3285 3286 function checkMQ() { 3287 //check if mobile or desktop device 3288 return window.getComputedStyle(document.querySelector('.cd-horizontal-timeline'), '::before').getPropertyValue('content').replace(/'/g, "").replace(/"/g, ""); 3289 } 3290 } ); 3291 //End execute javascript for horizontal timeline 3292 3293 3294 //Start execute javascript for background list 3295 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-background-list.default', function( $scope ) { 3296 jQuery(".tg_background_list_wrapper").each(function() { 3297 var parentDiv = jQuery(this); 3298 3299 parentDiv.children('.tg_background_list_column').hover(function () { 3300 parentDiv.find('.tg_background_img').removeClass('hover'); 3301 jQuery(this).next('.tg_background_img').addClass('hover'); 3302 }); 3303 }); 3304 } ); 3305 //End execute javascript for background list 3306 3307 3308 //Start execute javascript for portfolio masonry 3309 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-portfolio-masonry.default', function( $scope ) { 3310 jQuery(function( $ ) { 3311 3312 jQuery(".portfolio_masonry_content_wrapper.do_masonry").each(function() { 3313 var grid = jQuery(this); 3314 var cols = grid.attr('data-cols'); 3315 cols = parseInt(cols); 3316 3317 var gutter = 70; 3318 switch(cols) 3319 { 3320 case 2: 3321 gutter = 70; 3322 break; 3323 case 3: 3324 gutter = 60; 3325 break; 3326 case 4: 3327 gutter = 50; 3328 break; 3329 case 5: 3330 gutter = 40; 3331 break; 3332 } 3333 3334 grid.imagesLoaded().done( function() { 3335 grid.masonry({ 3336 itemSelector: ".gallery_grid_item", 3337 columnWidth: ".gallery_grid_item", 3338 gutter : gutter 3339 }); 3340 3341 jQuery(".portfolio_masonry_content_wrapper.do_masonry .gallery_grid_item").each(function(index) { 3342 setTimeout(function() { 3343 jQuery(".do_masonry .gallery_grid_item").eq(index).addClass("is-showing"); 3344 }, 100 * index); 3345 }); 3346 }); 3347 3348 jQuery(".portfolio_masonry_content_wrapper.do_masonry img.lazy_masonry").each(function() { 3349 var currentImg = jQuery(this); 3350 currentImg.parent("div.post_img_hover").removeClass("lazy"); 3351 3352 var cols = grid.attr('data-cols'); 3353 3354 var gutter = 70; 3355 switch(cols) 3356 { 3357 case 2: 3358 gutter = 70; 3359 break; 3360 case 3: 3361 gutter = 60; 3362 break; 3363 case 4: 3364 gutter = 50; 3365 break; 3366 case 5: 3367 gutter = 40; 3368 break; 3369 } 3370 3371 jQuery(this).Lazy({ 3372 onFinishedAll: function() { 3373 grid.masonry({ 3374 itemSelector: ".gallery_grid_item", 3375 columnWidth: ".gallery_grid_item", 3376 gutter : gutter 3377 }); 3378 }, 3379 }); 3380 }); 3381 3382 jQuery(".portfolio_masonry_container").each(function() { 3383 var containderDiv = jQuery(this); 3384 var selectedClass = ""; 3385 3386 containderDiv.find(".filter_tag_btn").on('click', function(){ 3387 containderDiv.find(".filter_tag_btn").removeClass("active"); 3388 jQuery(this).addClass("active"); 3389 selectedClass = jQuery(this).attr("data-rel"); 3390 3391 var gridDiv = containderDiv.find(".portfolio_masonry_content_wrapper.do_masonry");
3392 gridDiv.find(".portfolio_masonry_grid_wrapper").not("."+selectedClass).fadeOut().removeClass('scale-anm'); 3393 3394 setTimeout(function() { 3395 jQuery("."+selectedClass).fadeIn().addClass('scale-anm'); 3396 3397 gridDiv.masonry('destroy'); 3398 var $grid = gridDiv.masonry({ 3399 itemSelector: ".gallery_grid_item.scale-anm", 3400 columnWidth: ".gallery_grid_item.scale-anm", 3401 gutter : gutter 3402 }); 3403 3404 $grid.masonry('reloadItems'); 3405 3406 }, 300); 3407 }); 3408 }); 3409 }); 3410 }); 3411 } ); 3412 //End execute javascript for portfolio masonry 3413 3414 3415 //Start execute javascript for portfolio timeline 3416 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-portfolio-timeline.default', function( $scope ) { 3417 var timelines = jQuery('.cd-horizontal-timeline'), 3418 eventsMinDistance = 60; 3419 3420 (timelines.length > 0) && initTimeline(timelines); 3421 3422 function initTimeline(timelines) { 3423 timelines.each(function(){ 3424 var timeline = jQuery(this), 3425 timelineComponents = {}; 3426 //cache timeline components 3427 timelineComponents['timelineWrapper'] = timeline.find('.events-wrapper'); 3428 timelineComponents['eventsWrapper'] = timelineComponents['timelineWrapper'].children('.events'); 3429 timelineComponents['fillingLine'] = timelineComponents['eventsWrapper'].children('.filling-line'); 3430 timelineComponents['timelineEvents'] = timelineComponents['eventsWrapper'].find('a'); 3431 timelineComponents['timelineDates'] = parseDate(timelineComponents['timelineEvents']); 3432 timelineComponents['eventsMinLapse'] = minLapse(timelineComponents['timelineDates']); 3433 timelineComponents['timelineNavigation'] = timeline.find('.cd-timeline-navigation'); 3434 timelineComponents['eventsContent'] = timeline.children('.events-content'); 3435 3436 //assign a left postion to the single events along the timeline 3437 setDatePosition(timelineComponents, eventsMinDistance); 3438 //assign a width to the timeline 3439 var timelineTotWidth = setTimelineWidth(timelineComponents, eventsMinDistance); 3440 //the timeline has been initialize - show it 3441 timeline.addClass('loaded'); 3442 3443 //detect click on the next arrow 3444 timelineComponents['timelineNavigation'].on('click', '.next', function(event){ 3445 event.preventDefault(); 3446 updateSlide(timelineComponents, timelineTotWidth, 'next'); 3447 }); 3448 //detect click on the prev arrow 3449 timelineComponents['timelineNavigation'].on('click', '.prev', function(event){ 3450 event.preventDefault(); 3451 updateSlide(timelineComponents, timelineTotWidth, 'prev'); 3452 }); 3453 //detect click on the a single event - show new event content 3454 timelineComponents['eventsWrapper'].on('click', 'a', function(event){ 3455 event.preventDefault(); 3456 timelineComponents['timelineEvents'].removeClass('selected'); 3457 jQuery(this).addClass('selected'); 3458 updateOlderEvents(jQuery(this)); 3459 updateFilling(jQuery(this), timelineComponents['fillingLine'], timelineTotWidth); 3460 updateVisibleContent(jQuery(this), timelineComponents['eventsContent']); 3461 }); 3462 3463 //on swipe, show next/prev event content 3464 timelineComponents['eventsContent'].on('swipeleft', function(){ 3465 var mq = checkMQ(); 3466 ( mq == 'mobile' ) && showNewContent(timelineComponents, timelineTotWidth, 'next'); 3467 }); 3468 timelineComponents['eventsContent'].on('swiperight', function(){ 3469 var mq = checkMQ(); 3470 ( mq == 'mobile' ) && showNewContent(timelineComponents, timelineTotWidth, 'prev'); 3471 }); 3472 3473 //keyboard navigation 3474 jQuery(document).keyup(function(event){ 3475 if(event.which=='37' && elementInViewport(timeline.get(0)) ) { 3476 showNewContent(timelineComponents, timelineTotWidth, 'prev'); 3477 } else if( event.which=='39' && elementInViewport(timeline.get(0))) { 3478 showNewContent(timelineComponents, timelineTotWidth, 'next'); 3479 } 3480 }); 3481 }); 3482 } 3483 3484 function updateSlide(timelineComponents, timelineTotWidth, string) { 3485 //retrieve translateX value of timelineComponents['eventsWrapper'] 3486 var translateValue = getTranslateValue(timelineComponents['eventsWrapper']),
3487 wrapperWidth = Number(timelineComponents['timelineWrapper'].css('width').replace('px', '')); 3488 //translate the timeline to the left('next')/right('prev') 3489 (string == 'next') 3490 ? translateTimeline(timelineComponents, translateValue - wrapperWidth + eventsMinDistance, wrapperWidth - timelineTotWidth) 3491 : translateTimeline(timelineComponents, translateValue + wrapperWidth - eventsMinDistance); 3492 } 3493 3494 function showNewContent(timelineComponents, timelineTotWidth, string) { 3495 //go from one event to the next/previous one 3496 var visibleContent = timelineComponents['eventsContent'].find('.selected'), 3497 newContent = ( string == 'next' ) ? visibleContent.next() : visibleContent.prev(); 3498 3499 if ( newContent.length > 0 ) { //if there's a next/prev event - show it 3500 var selectedDate = timelineComponents['eventsWrapper'].find('.selected'), 3501 newEvent = ( string == 'next' ) ? selectedDate.parent('li').next('li').children('a') : selectedDate.parent('li').prev('li').children('a'); 3502 3503 updateFilling(newEvent, timelineComponents['fillingLine'], timelineTotWidth); 3504 updateVisibleContent(newEvent, timelineComponents['eventsContent']); 3505 newEvent.addClass('selected'); 3506 selectedDate.removeClass('selected'); 3507 updateOlderEvents(newEvent); 3508 updateTimelinePosition(string, newEvent, timelineComponents, timelineTotWidth); 3509 } 3510 } 3511 3512 function updateTimelinePosition(string, event, timelineComponents, timelineTotWidth) { 3513 //translate timeline to the left/right according to the position of the selected event 3514 var eventStyle = window.getComputedStyle(event.get(0), null), 3515 eventLeft = Number(eventStyle.getPropertyValue("left").replace('px', '')), 3516 timelineWidth = Number(timelineComponents['timelineWrapper'].css('width').replace('px', '')), 3517 timelineTotWidth = Number(timelineComponents['eventsWrapper'].css('width').replace('px', '')); 3518 var timelineTranslate = getTranslateValue(timelineComponents['eventsWrapper']); 3519 3520 if( (string == 'next' && eventLeft > timelineWidth - timelineTranslate) || (string == 'prev' && eventLeft < - timelineTranslate) ) { 3521 translateTimeline(timelineComponents, - eventLeft + timelineWidth/2, timelineWidth - timelineTotWidth); 3522 } 3523 } 3524 3525 function translateTimeline(timelineComponents, value, totWidth) { 3526 var eventsWrapper = timelineComponents['eventsWrapper'].get(0); 3527 value = (value > 0) ? 0 : value; //only negative translate value 3528 value = ( !(typeof totWidth === 'undefined') && value < totWidth ) ? totWidth : value; //do not translate more than timeline width 3529 setTransformValue(eventsWrapper, 'translateX', value+'px'); 3530 //update navigation arrows visibility 3531 (value == 0 ) ? timelineComponents['timelineNavigation'].find('.prev').addClass('inactive') : timelineComponents['timelineNavigation'].find('.prev').removeClass('inactive'); 3532 (value == totWidth ) ? timelineComponents['timelineNavigation'].find('.next').addClass('inactive') : timelineComponents['timelineNavigation'].find('.next').removeClass('inactive'); 3533 } 3534 3535 function updateFilling(selectedEvent, filling, totWidth) { 3536 //change .filling-line length according to the selected event 3537 var eventStyle = window.getComputedStyle(selectedEvent.get(0), null), 3538 eventLeft = eventStyle.getPropertyValue("left"), 3539 eventWidth = eventStyle.getPropertyValue("width"); 3540 eventLeft = Number(eventLeft.replace('px', '')) + Number(eventWidth.replace('px', ''))/2; 3541 var scaleValue = eventLeft/totWidth; 3542 setTransformValue(filling.get(0), 'scaleX', scaleValue); 3543 } 3544 3545 function setDatePosition(timelineComponents, min) { 3546 for (i = 0; i < timelineComponents['timelineDates'].length; i++) { 3547 var distance = daydiff(timelineComponents['timelineDates'][0], timelineComponents['timelineDates'][i]), 3548 distanceNorm = Math.round(distance/timelineComponents['eventsMinLapse']) + 2; 3549 timelineComponents['timelineEvents'].eq(i).css('left', distanceNorm*min+'px'); 3550 } 3551 } 3552 3553 function setTimelineWidth(timelineComponents, width) { 3554 var timeSpan = daydiff(timelineComponents['timelineDates'][0], timelineComponents['timelineDates'][timelineComponents['timelineDates'].length-1]), 3555 timeSpanNorm = timeSpan/timelineComponents['eventsMinLapse'], 3556 timeSpanNorm = Math.round(timeSpanNorm) + 4, 3557 totalWidth = timeSpanNorm*width; 3558 timelineComponents['eventsWrapper'].css('width', totalWidth+'px'); 3559 updateFilling(timelineComponents['timelineEvents'].eq(0), timelineComponents['fillingLine'], totalWidth); 3560 3561 return totalWidth; 3562 } 3563 3564 function updateVisibleContent(event, eventsContent) { 3565 var eventDate = event.data('date'), 3566 visibleContent = eventsContent.find('.selected'), 3567 selectedContent = eventsContent.find('[data-date="'+ eventDate +'"]'), 3568 selectedContentHeight = selectedContent.height(); 3569 3570 if (selectedContent.index() > visibleContent.index()) { 3571 var classEnetering = 'selected enter-right', 3572 classLeaving = 'leave-left'; 3573 } else { 3574 var classEnetering = 'selected enter-left', 3575 classLeaving = 'leave-right'; 3576 } 3577 3578 selectedContent.attr('class', classEnetering); 3579 visibleContent.attr('class', classLeaving).one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function(){ 3580 visibleContent.removeClass('leave-right leave-left'); 3581 selectedContent.removeClass('enter-left enter-right'); 3582 }); 3583 eventsContent.css('height', selectedContentHeight+'px'); 3584 } 3585 3586 function updateOlderEvents(event) { 3587 event.parent('li').prevAll('li').children('a').addClass('older-event').end().end().nextAll('li').children('a').removeClass('older-event'); 3588 } 3589 3590 function getTranslateValue(timeline) { 3591 var timelineStyle = window.getComputedStyle(timeline.get(0), null), 3592 timelineTranslate = timelineStyle.getPropertyValue("-webkit-transform") || 3593 timelineStyle.getPropertyValue("-moz-transform") || 3594 timelineStyle.getPropertyValue("-ms-transform") || 3595 timelineStyle.getPropertyValue("-o-transform") || 3596 timelineStyle.getPropertyValue("transform"); 3597 3598 if( timelineTranslate.indexOf('(') >=0 ) { 3599 var timelineTranslate = timelineTranslate.split('(')[1]; 3600 timelineTranslate = timelineTranslate.split(')')[0]; 3601 timelineTranslate = timelineTranslate.split(','); 3602 var translateValue = timelineTranslate[4]; 3603 } else { 3604 var translateValue = 0; 3605 } 3606 3607 return Number(translateValue); 3608 } 3609 3610 function setTransformValue(element, property, value) { 3611 element.style["-webkit-transform"] = property+"("+value+")"; 3612 element.style["-moz-transform"] = property+"("+value+")"; 3613 element.style["-ms-transform"] = property+"("+value+")"; 3614 element.style["-o-transform"] = property+"("+value+")"; 3615 element.style["transform"] = property+"("+value+")"; 3616 } 3617 3618 //based on http://stackoverflow.com/questions/542938/how-do-i-get-the-number-of-days-between-two-dates-in-javascript 3619 function parseDate(events) { 3620 var dateArrays = []; 3621 events.each(function(){ 3622 var dateComp = jQuery(this).data('date').split('/'), 3623 newDate = new Date(dateComp[2], dateComp[1]-1, dateComp[0]); 3624 dateArrays.push(newDate); 3625 }); 3626 return dateArrays; 3627 } 3628 3629 function parseDate2(events) { 3630 var dateArrays = []; 3631 events.each(function(){ 3632 var singleDate = jQuery(this), 3633 dateComp = singleDate.data('date').split('T'); 3634 if( dateComp.length > 1 ) { //both DD/MM/YEAR and time are provided 3635 var dayComp = dateComp[0].split('/'), 3636 timeComp = dateComp[1].split(':'); 3637 } else if( dateComp[0].indexOf(':') >=0 ) { //only time is provide 3638 var dayComp = ["2000", "0", "0"], 3639 timeComp = dateComp[0].split(':'); 3640 } else { //only DD/MM/YEAR 3641 var dayComp = dateComp[0].split('/'), 3642 timeComp = ["0", "0"]; 3643 } 3644 var newDate = new Date(dayComp[2], dayComp[1]-1, dayComp[0], timeComp[0], timeComp[1]); 3645 dateArrays.push(newDate); 3646 }); 3647 return dateArrays; 3648 } 3649 3650 function daydiff(first, second) { 3651 return Math.round((second-first)); 3652 } 3653 3654 function minLapse(dates) { 3655 //determine the minimum distance among events 3656 var dateDistances = []; 3657 for (i = 1; i < dates.length; i++) { 3658 var distance = daydiff(dates[i-1], dates[i]); 3659 dateDistances.push(distance); 3660 } 3661 return Math.min.apply(null, dateDistances); 3662 } 3663 3664 /* 3665 How to tell if a DOM element is visible in the current viewport? 3666 http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport 3667 */ 3668 function elementInViewport(el) { 3669 var top = el.offsetTop; 3670 var left = el.offsetLeft; 3671 var width = el.offsetWidth; 3672 var height = el.offsetHeight; 3673 3674 while(el.offsetParent) { 3675 el = el.offsetParent; 3676 top += el.offsetTop; 3677 left += el.offsetLeft; 3678 } 3679 3680 return ( 3681 top < (window.pageYOffset + window.innerHeight) && 3682 left < (window.pageXOffset + window.innerWidth) && 3683 (top + height) > window.pageYOffset && 3684 (left + width) > window.pageXOffset 3685 ); 3686 } 3687 3688 function checkMQ() { 3689 //check if mobile or desktop device 3690 return window.getComputedStyle(document.querySelector('.cd-horizontal-timeline'), '::before').getPropertyValue('content').replace(/'/g, "").replace(/"/g, ""); 3691 } 3692 } ); 3693 //End execute javascript for portfolio timeline vertical 3694 3695 3696 //Start execute javascript for background list 3697 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-portfolio-timeline-vertical.default', function( $scope ) { 3698 jQuery(".portfolio_timeline_vertical_content_wrapper").each(function() { 3699 var slideshow = jQuery(this); 3700 var autoPlay = slideshow.attr('data-autoplay'); 3701 var autoPlayArr = false;
3702 if (typeof autoPlay != "undefined"){ 3703 autoPlayArr = { 3704 delay: autoPlay 3705 }; 3706 } 3707 3708 var speed = slideshow.attr('data-speed'); 3709 if (typeof speed == "undefined"){ 3710 speed = 1600; 3711 } 3712 3713 var timelineSwiper = new Swiper ('.portfolio_timeline_vertical_content_wrapper .timeline .swiper-container', { 3714 direction: 'vertical', 3715 slidesPerView: 1, 3716 loop: false, 3717 speed: parseInt(speed), 3718 autoplay: autoPlayArr, 3719 pagination: { 3720 el: '.swiper-pagination', 3721 type: 'bullets', 3722 renderBullet: function (index, className) { 3723 var year = slideshow.find('.swiper-slide').eq(index).attr('data-year'); 3724 return '<span class="' + className + '">' + year + '</span>';; 3725 }, 3726 clickable: true 3727 }, 3728 navigation: { 3729 nextEl: '.swiper-button-next', 3730 prevEl: '.swiper-button-prev', 3731 }, 3732 breakpoints: { 3733 768: { 3734 direction: 'horizontal', 3735 } 3736 } 3737 }); 3738 }); 3739 } ); 3740 //End execute javascript for portfolio timeline vertical 3741 3742 //Start execute javascript for slider parallax 3743 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-slider-parallax.default', function( $scope ) { 3744 3745 var slideshow=jQuery('.slider_parallax_wrapper'); 3746 var timer = slideshow.attr('data-autoplay'); 3747 var autoplay = true; 3748 3749 if(timer == 0) 3750 { 3751 timer = false; 3752 autoplay = false; 3753 } 3754 3755 var pagination = slideshow.attr('data-pagination'); 3756 if(pagination == 0) 3757 { 3758 var pagination = false; 3759 } 3760 else 3761 { 3762 var pagination = true; 3763 } 3764 3765 var navigation = slideshow.attr('data-navigation'); 3766 if(navigation == 0) 3767 { 3768 var navigation = false; 3769 } 3770 else 3771 { 3772 var navigation = true; 3773 } 3774 3775 var slideshowDuration = timer; 3776 3777 function slideshowSwitch(slideshow,index,auto){ 3778 if(slideshow.data('wait')) return; 3779 3780 var slides = slideshow.find('.slide'); 3781 var pages = slideshow.find('.pagination'); 3782 var activeSlide = slides.filter('.is-active'); 3783 var activeSlideImage = activeSlide.find('.image-container'); 3784 var newSlide = slides.eq(index); 3785 var newSlideImage = newSlide.find('.image-container'); 3786 var newSlideContent = newSlide.find('.slide-content'); 3787 var newSlideElements=newSlide.find('.caption > *'); 3788 if(newSlide.is(activeSlide))return; 3789 3790 newSlide.addClass('is-new'); 3791 var timeout=slideshow.data('timeout'); 3792 clearTimeout(timeout); 3793 slideshow.data('wait',true); 3794 var transition=slideshow.attr('data-transition'); 3795 if(transition=='fade'){ 3796 newSlide.css({ 3797 display:'block', 3798 zIndex:2 3799 }); 3800 newSlideImage.css({ 3801 opacity:0 3802 }); 3803 3804 TweenMax.to(newSlideImage,1,{ 3805 alpha:1, 3806 onComplete:function(){ 3807 newSlide.addClass('is-active').removeClass('is-new'); 3808 activeSlide.removeClass('is-active'); 3809 newSlide.css({display:'',zIndex:''}); 3810 newSlideImage.css({opacity:''}); 3811 slideshow.find('.pagination').trigger('check'); 3812 slideshow.data('wait',false); 3813 if(auto){ 3814 timeout=setTimeout(function(){ 3815 slideshowNext(slideshow,false,true); 3816 },slideshowDuration); 3817 slideshow.data('timeout',timeout);}}}); 3818 } else { 3819 if(newSlide.index()>activeSlide.index()){ 3820 var newSlideRight=0; 3821 var newSlideLeft='auto'; 3822 var newSlideImageRight=-slideshow.width()/8; 3823 var newSlideImageLeft='auto'; 3824 var newSlideImageToRight=0; 3825 var newSlideImageToLeft='auto'; 3826 var newSlideContentLeft='auto'; 3827 var newSlideContentRight=0; 3828 var activeSlideImageLeft=-slideshow.width()/4; 3829 } else { 3830 var newSlideRight=''; 3831 var newSlideLeft=0; 3832 var newSlideImageRight='auto'; 3833 var newSlideImageLeft=-slideshow.width()/8; 3834 var newSlideImageToRight=''; 3835 var newSlideImageToLeft=0; 3836 var newSlideContentLeft=0; 3837 var newSlideContentRight='auto'; 3838 var activeSlideImageLeft=slideshow.width()/4; 3839 } 3840 3841 newSlide.css({ 3842 display:'block', 3843 width:0,
3844 right:newSlideRight, 3845 left:newSlideLeft 3846 ,zIndex:2 3847 }); 3848 3849 newSlideImage.css({ 3850 width:slideshow.width(), 3851 right:newSlideImageRight, 3852 left:newSlideImageLeft 3853 }); 3854 3855 newSlideContent.css({ 3856 width:slideshow.width(), 3857 left:newSlideContentLeft, 3858 right:newSlideContentRight 3859 }); 3860 3861 activeSlideImage.css({ 3862 left:0 3863 }); 3864 3865 TweenMax.set(newSlideElements,{y:20,force3D:true}); 3866 TweenMax.to(activeSlideImage,1,{ 3867 left:activeSlideImageLeft, 3868 ease:Power3.easeInOut 3869 }); 3870 3871 TweenMax.to(newSlide,1,{ 3872 width:slideshow.width(), 3873 ease:Power3.easeInOut 3874 }); 3875 3876 TweenMax.to(newSlideImage,1,{ 3877 right:newSlideImageToRight, 3878 left:newSlideImageToLeft, 3879 ease:Power3.easeInOut 3880 }); 3881 3882 TweenMax.staggerFromTo(newSlideElements,0.8,{alpha:0,y:60},{alpha:1,y:0,ease:Power3.easeOut,force3D:true,delay:0.6},0.1,function(){ 3883 newSlide.addClass('is-active').removeClass('is-new'); 3884 activeSlide.removeClass('is-active'); 3885 newSlide.css({ 3886 display:'', 3887 width:'', 3888 left:'', 3889 zIndex:'' 3890 }); 3891 3892 newSlideImage.css({ 3893 width:'', 3894 right:'', 3895 left:'' 3896 }); 3897 3898 newSlideContent.css({ 3899 width:'', 3900 left:'' 3901 }); 3902 3903 newSlideElements.css({ 3904 opacity:'', 3905 transform:'' 3906 }); 3907 3908 activeSlideImage.css({ 3909 left:'' 3910 }); 3911 3912 slideshow.find('.pagination').trigger('check'); 3913 slideshow.data('wait',false); 3914 if(auto){ 3915 timeout=setTimeout(function(){ 3916 slideshowNext(slideshow,false,true); 3917 },slideshowDuration); 3918 slideshow.data('timeout',timeout); 3919 } 3920 }); 3921 } 3922 } 3923 3924 function slideshowNext(slideshow,previous,auto){ 3925 var slides=slideshow.find('.slide'); 3926 var activeSlide=slides.filter('.is-active'); 3927 var newSlide=null; 3928 if(previous){ 3929 newSlide=activeSlide.prev('.slide'); 3930 if(newSlide.length === 0) { 3931 newSlide=slides.last(); 3932 } 3933 } else { 3934 newSlide=activeSlide.next('.slide'); 3935 if(newSlide.length==0) 3936 newSlide=slides.filter('.slide').first(); 3937 } 3938 3939 slideshowSwitch(slideshow,newSlide.index(),auto); 3940 } 3941 3942 function homeSlideshowParallax(){ 3943 var scrollTop=jQuery(window).scrollTop(); 3944 if(scrollTop>windowHeight) return; 3945 var inner=slideshow.find('.slideshow-inner'); 3946 var newHeight=windowHeight-(scrollTop/2); 3947 var newTop=scrollTop*0.8; 3948 3949 inner.css({ 3950 transform:'translateY('+newTop+'px)',height:newHeight 3951 }); 3952 } 3953 3954 jQuery(document).ready(function() { 3955 jQuery('.slider_parallax_wrapper .slide').addClass('is-loaded'); 3956 3957 jQuery('.slider_parallax_wrapper .arrows .arrow').on('click',function(){ 3958 slideshowNext(jQuery(this).closest('.slider_parallax_wrapper'),jQuery(this).hasClass('prev')); 3959 }); 3960 3961 jQuery('.slider_parallax_wrapper .pagination .item').on('click',function(){ 3962 slideshowSwitch(jQuery(this).closest('.slider_parallax_wrapper'),jQuery(this).index()); 3963 }); 3964 3965 jQuery('.slider_parallax_wrapper .pagination').on('check',function(){ 3966 var slideshow=jQuery(this).closest('.slider_parallax_wrapper'); 3967 var pages=jQuery(this).find('.item'); 3968 var index=slideshow.find('.slider_parallax_slides .is-active').index(); 3969 pages.removeClass('is-active'); 3970 pages.eq(index).addClass('is-active'); 3971 }); 3972 3973 if(autoplay) 3974 { 3975 var timeout=setTimeout(function(){ 3976 slideshowNext(slideshow,false,true); 3977 },slideshowDuration); 3978 3979 slideshow.data('timeout',timeout); 3980 } 3981 }); 3982 } ); 3983 //End execute javascript for slider parallax 3984 3985 3986 //Start execute javascript for distortion grid 3987 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-distortion-grid.default', function( $scope ) { 3988 Array.from(document.querySelectorAll('.distortion_grid_item-img')).forEac
3988h((el) => { 3989 const imgs = Array.from(el.querySelectorAll('img')); 3990 new hoverEffect({ 3991 parent: el, 3992 intensity: el.dataset.intensity || undefined, 3993 speedIn: el.dataset.speedin || undefined, 3994 speedOut: el.dataset.speedout || undefined, 3995 easing: el.dataset.easing || undefined, 3996 hover: el.dataset.hover || undefined, 3997 image1: imgs[0].getAttribute('src'), 3998 image2: imgs[1].getAttribute('src'), 3999 displacementImage: el.dataset.displacement 4000 }); 4001 }); 4002 } ); 4003 //End execute javascript for distortion grid 4004 4005 4006 //Start execute javascript for slider animated 4007 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-slider-animated.default', function( $scope ) { 4008 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 4009 4010 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4011 4012 var $window = jQuery(window); 4013 var $body = jQuery('body'); 4014 4015 jQuery(".tg_animated_slider_wrapper").each(function() { 4016 var sliderID = jQuery(this).attr('id'); 4017 var Slideshow = function () { 4018 function Slideshow() { 4019 var _this = this; 4020 4021 var userOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 4022 4023 _classCallCheck(this, Slideshow); 4024 4025 var defaultOptions = { 4026 $el: jQuery('#'+sliderID),
4027 showArrows: false, 4028 showPagination: true, 4029 duration: 10000, 4030 autoplay: true 4031 }; 4032 4033 var options = Object.assign({}, defaultOptions, userOptions); 4034 4035 this.$el = options.$el; 4036 this.maxSlide = this.$el.find(jQuery('.js-slider-home-slide')).length; 4037 this.showArrows = this.maxSlide > 1 ? options.showArrows : false; 4038 this.showPagination = options.showPagination; 4039 this.currentSlide = 1; 4040 this.isAnimating = false; 4041 this.animationDuration = 1200; 4042 this.autoplaySpeed = options.duration; 4043 this.interval; 4044 this.$controls = this.$el.find('.js-slider-home-button'); 4045 this.autoplay = this.maxSlide > 1 ? options.autoplay : false; 4046 this.autoplay = false; 4047 4048 this.$el.on('click', '.js-slider-home-next', function (event) { 4049 return _this.nextSlide(); 4050 }); 4051 this.$el.on('click', '.js-slider-home-prev', function (event) { 4052 return _this.prevSlide(); 4053 }); 4054 this.$el.on('click', '.js-pagination-item', function (event) { 4055 if (!_this.isAnimating) { 4056 _this.preventClick(); 4057 _this.goToSlide(event.target.dataset.slide); 4058 } 4059 }); 4060 4061 this.init(); 4062 } 4063 4064 _createClass(Slideshow, [{ 4065 key: 'init', 4066 value: function init() { 4067 this.goToSlide(1); 4068 4069 if (this.autoplay) { 4070 this.startAutoplay(); 4071 } 4072 4073 if (this.showPagination) { 4074 var paginationNumber = this.maxSlide; 4075 var pagination = '<div class="pagination"><div class="container">'; 4076 4077 for (var i = 0; i < this.maxSlide; i++) { 4078 var item = '<span class="pagination__item js-pagination-item ' + (i === 0 ? 'is-current' : '') + '" data-slide=' + (i + 1) + '>' + (i + 1) + '</span>'; 4079 pagination = pagination + item; 4080 } 4081 4082 pagination = pagination + '</div></div>'; 4083 4084 this.$el.append(pagination); 4085 } 4086 } 4087 }, { 4088 key: 'preventClick', 4089 value: function preventClick() { 4090 var _this2 = this; 4091 4092 this.isAnimating = true; 4093 this.$controls.prop('disabled', true); 4094 clearInterval(this.interval); 4095 4096 setTimeout(function () { 4097 _this2.isAnimating = false; 4098 _this2.$controls.prop('disabled', false); 4099 if (_this2.autoplay) { 4100 _this2.startAutoplay(); 4101 } 4102 }, this.animationDuration); 4103 } 4104 }, { 4105 key: 'goToSlide', 4106 value: function goToSlide(index) { 4107 this.currentSlide = parseInt(index); 4108 4109 if (this.currentSlide > this.maxSlide) { 4110 this.currentSlide = 1; 4111 } 4112 4113 if (this.currentSlide === 0) { 4114 this.currentSlide = this.maxSlide; 4115 } 4116 4117 var newCurrent = this.$el.find('.js-slider-home-slide[data-slide="' + this.currentSlide + '"]'); 4118 var newPrev = this.currentSlide === 1 ? this.$el.find('.js-slider-home-slide').last() : newCurrent.prev('.js-slider-home-slide'); 4119 var newNext = this.currentSlide === this.maxSlide ? this.$el.find('.js-slider-home-slide').first() : newCurrent.next('.js-slider-home-slide'); 4120 4121 this.$el.find('.js-slider-home-slide').removeClass('is-prev is-next is-current'); 4122 this.$el.find('.js-pagination-item').removeClass('is-current'); 4123 4124 if (this.maxSlide > 1) { 4125 newPrev.addClass('is-prev'); 4126 newNext.addClass('is-next'); 4127 } 4128 4129 newCurrent.addClass('is-current');
4130 this.$el.find('.js-pagination-item[data-slide="' + this.currentSlide + '"]').addClass('is-current'); 4131 } 4132 }, { 4133 key: 'nextSlide', 4134 value: function nextSlide() { 4135 this.preventClick(); 4136 this.goToSlide(this.currentSlide + 1); 4137 } 4138 }, { 4139 key: 'prevSlide', 4140 value: function prevSlide() { 4141 this.preventClick(); 4142 this.goToSlide(this.currentSlide - 1); 4143 } 4144 }, { 4145 key: 'startAutoplay', 4146 value: function startAutoplay() { 4147 var _this3 = this; 4148 4149 this.interval = setInterval(function () { 4150 if (!_this3.isAnimating) { 4151 _this3.nextSlide(); 4152 } 4153 }, this.autoplaySpeed); 4154 } 4155 }, { 4156 key: 'destroy', 4157 value: function destroy() { 4158 this.$el.off(); 4159 } 4160 }]); 4161 4162 return Slideshow; 4163 }(); 4164 4165 (function () { 4166 var loaded = false; 4167 var maxLoad = 3000; 4168 4169 function load() { 4170 var options = { 4171 showPagination: true 4172 }; 4173 4174 var slideShow = new Slideshow(options); 4175 } 4176 4177 function addLoadClass() { 4178 $body.addClass('is-loaded'); 4179 4180 setTimeout(function () { 4181 $body.addClass('is-animated'); 4182 }, 600); 4183 } 4184 4185 $window.on('load', function () { 4186 if (!loaded) { 4187 loaded = true; 4188 load(); 4189 } 4190 }); 4191 4192 setTimeout(function () { 4193 if (!loaded) { 4194 loaded = true; 4195 load(); 4196 } 4197 }, maxLoad); 4198 4199 addLoadClass(); 4200 })(); 4201 }); 4202 } ); 4203 //End execute javascript for slider animated 4204 4205 4206 //Start execute javascript for fade up slider 4207 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-slider-fadeup.default', function( $scope ) { 4208 function init(item) { 4209 var items = item.querySelectorAll('li'), 4210 current = 0, 4211 autoUpdate = true; 4212 4213 //create nav 4214 var nav = document.createElement('nav'); 4215 nav.className = 'nav_arrows'; 4216 4217 //create button prev 4218 var prevbtn = document.createElement('button'); 4219 prevbtn.className = 'prev'; 4220 prevbtn.setAttribute('aria-label', 'Prev'); 4221 4222 //create button next 4223 var nextbtn = document.createElement('button'); 4224 nextbtn.className = 'next'; 4225 nextbtn.setAttribute('aria-label', 'Next'); 4226 4227 //create counter 4228 var counter = document.createElement('div'); 4229 counter.className = 'counter'; 4230 counter.innerHTML = "<span>1</span><span>"+items.length+"</span>"; 4231 4232 if (items.length > 1) { 4233 nav.appendChild(prevbtn); 4234 nav.appendChild(counter); 4235 nav.appendChild(nextbtn); 4236 item.appendChild(nav); 4237 } 4238 4239 items[current].className = "current"; 4240 if (items.length > 1) items[items.length-1].className = "prev_slide"; 4241 4242 var navigate = function(dir) { 4243 items[current].className = ""; 4244 4245 if (dir === 'right') { 4246 current = current < items.length-1 ? current + 1 : 0; 4247 } else { 4248 current = current > 0 ? current - 1 : items.length-1; 4249 } 4250 4251 var nextCurrent = current < items.length-1 ? current + 1 : 0, 4252 prevCurrent = current > 0 ? current - 1 : items.length-1; 4253 4254 items[current].className = "current"; 4255 items[prevCurrent].className = "prev_slide"; 4256 items[nextCurrent].className = ""; 4257 4258 //update counter 4259 counter.firstChild.textContent = current + 1; 4260 } 4261 4262 item.addEventListener('mouseenter', function() { 4263 autoUpdate = false; 4264 }); 4265 4266 item.addEventListener('mouseleave', function() { 4267 autoUpdate = true; 4268 }); 4269 4270 prevbtn.addEventListener('click', function() { 4271 navigate('left'); 4272 }); 4273 4274 nextbtn.addEventListener('click', function() { 4275 navigate('right'); 4276 }); 4277 4278 //keyboard navigation 4279 document.addEventListener('keydown', function(ev) { 4280 var keyCode = ev.keyCode || ev.which; 4281 switch (keyCode) { 4282 case 37: 4283 navigate('left'); 4284 break; 4285 case 39: 4286 navigate('right'); 4287 break; 4288 } 4289 }); 4290 4291 // swipe navigation 4292 // from http://stackoverflow.com/a/23230280 4293 item.addEventListener('touchstart', handleTouchStart, false); 4294 item.addEventListener('touchmove', handleTouchMove, false); 4295 var xDown = null; 4296 var yDown = null; 4297 function handleTouchStart(evt) { 4298 xDown = evt.touches[0].clientX; 4299 yDown = evt.touches[0].clientY; 4300 }; 4301 function handleTouchMove(evt) { 4302 if ( ! xDown || ! yDown ) { 4303 return; 4304 } 4305 4306 var xUp = evt.touches[0].clientX; 4307 var yUp = evt.touches[0].clientY; 4308 4309 var xDiff = xDown - xUp; 4310 var yDiff = yDown - yUp; 4311 4312 if ( Math.abs( xDiff ) > Math.abs( yDiff ) ) {/*most significant*/ 4313 if ( xDiff > 0 ) { 4314 /* left swipe */ 4315 navigate('right'); 4316 } else { 4317 navigate('left'); 4318 } 4319 } 4320 /* reset values */ 4321 xDown = null; 4322 yDown = null; 4323 }; 4324 4325 4326 } 4327 4328 [].slice.call(document.querySelectorAll('.tg_fadeup_slider_wrapper')).forEac
4328h( function(item) { 4329 init(item); 4330 }); 4331 } ); 4332 //End execute javascript for fade up slider 4333 4334 4335 //Start execute javascript for motion reveal slider 4336 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-slider-motion-reveal.default', function( $scope ) { 4337 // The Slide class. 4338 class Slide { 4339 constructor(el) { 4340 this.DOM = {el: el}; 4341 // The image conteiner. 4342 this.DOM.imgWrap = this.DOM.el.querySelector('.slide__img-wrap'); 4343 // The revealer element (the element with the same color of the body that covers the image). 4344 this.DOM.revealer = this.DOM.imgWrap.querySelector('.slide__img-reveal'); 4345 // The title element. 4346 this.DOM.title = this.DOM.el.querySelector('.slide__title'); 4347 // The slide´s number element 4348 this.DOM.number = this.DOM.el.querySelector('.slide__number'); 4349 // The large preview elements (also an image and revealer for the cover/uncover effect) 4350 this.DOM.preview = { 4351 imgWrap: this.DOM.el.querySelector('.preview__img-wrap'), 4352 revealer: this.DOM.el.querySelector('.preview__img-wrap > .preview__img-reveal'), 4353 title: this.DOM.el.querySelector('.preview__title'), 4354 content: this.DOM.el.querySelector('.preview__content') 4355 }; 4356 4357 // Some config values. 4358 this.config = { 4359 animation: { 4360 duration: 0.6, 4361 ease: Expo.easeOut 4362 } 4363 }; 4364 } 4365 // Sets the current class. 4366 setCurrent(isCurrent = true) { 4367 this.DOM.el.classList[isCurrent ? 'add' : 'remove']('slide--current'); 4368 } 4369 // Hide the slide. 4370 hide(direction) { 4371 return this.toggle('hide', direction); 4372 } 4373 // Show the slide. 4374 show(direction) { 4375 return this.toggle('show', direction); 4376 } 4377 // Show/Hide the slide. 4378 toggle(action, direction) { 4379 // Hide/Show revealer on top of the image and move the image, title and number. 4380 return new Promise((resolve, reject) => { 4381 let revealerOpts = { 4382 delay: action === 'hide' ? 0 : this.config.animation.duration/2, 4383 ease: this.config.animation.ease, 4384 onComplete: resolve 4385 }; 4386 4387 const commonOpts = { 4388 delay: action === 'hide' ? 0 : this.config.animation.duration/2, 4389 ease: this.config.animation.ease, 4390 opacity: action === 'hide' ? 0 : 1 4391 }; 4392 let imgOpts = Object.assign({},commonOpts); 4393 let numberOpts = Object.assign({},commonOpts); 4394 let titleOpts = Object.assign({},commonOpts); 4395 4396 if ( direction === 'left' || direction === 'right' ) { 4397 revealerOpts.startAt = action === 'hide' ? {x: direction === 'left' ? '-100%' : '100%', y:'0%'} : {x: '0%', y:'0%'}; 4398 revealerOpts.x = action === 'hide' ? '0%' : direction === 'left' ? '100%' : '-100%'; 4399 imgOpts.startAt = action === 'show' ? {opacity: 0, x: direction === 'left' ? '-20%' : '20%'} : {}; 4400 imgOpts.x = action === 'hide' ? direction === 'left' ? '20%' : '-20%' : '0%'; 4401 titleOpts.startAt = action === 'show' ? {opacity: 1, scale: 0.2, x: direction === 'left' ? '-200%' : '200%'} : {}; 4402 titleOpts.x = action === 'hide' ? direction === 'left' ? '200%' : '-200%' : '0%'; 4403 titleOpts.scale = action === 'hide' ? 0.2 : 1; 4404 numberOpts.startAt = action === 'show' ? {opacity: 1, x: direction === 'left' ? '-50%' : '50%'} : {}; 4405 numberOpts.x = action === 'hide' ? direction === 'left' ? '50%' : '-50%' : '0%'; 4406 } 4407 else { 4408 revealerOpts.startAt = action === 'hide' ? {x:'0%', y: direction === 'down' ? '-100%' : '100%'} : {x:'0%', y: '0%'}; 4409 revealerOpts.y = action === 'hide' ? '0%' : direction === 'down' ? '100%' : '-100%'; 4410 imgOpts.startAt = action === 'show' ? {opacity: 1, y: direction === 'down' ? '-10%' : '10%'} : {}; 4411 imgOpts.y = action === 'hide' ? direction === 'down' ? '10%' : '-10%' : '0%'; 4412 titleOpts.ease = this.config.animation.ease, 4413 titleOpts.startAt = action === 'show' ? {opacity: 1, y: direction === 'down' ? '-100%' : '100%'} : {}; 4414 titleOpts.y = action === 'hide' ? direction === 'down' ? '100%' : '-100%' : '0%'; 4415 } 4416 4417 // Toggling the revealer. 4418 TweenMax.to(this.DOM.revealer, this.config.animation.duration, revealerOpts); 4419 // Moving & fading the image (wrappper). 4420 TweenMax.to(this.DOM.imgWrap, this.config.animation.duration, imgOpts); 4421 // Moving & fading the title and number. 4422 TweenMax.to(this.DOM.title, this.config.animation.duration*1.5, titleOpts); 4423 TweenMax.to(this.DOM.number, this.config.animation.duration, numberOpts); 4424 }); 4425 } 4426 // Hide the preview element. 4427 hidePreview(delay) { 4428 return this.togglePreview('hide'); 4429 } 4430 // Show the preview element. 4431 showPreview(delay) { 4432 return this.togglePreview('show'); 4433 } 4434 // Show/Hide the preview. 4435 togglePreview(action) { 4436 return new Promise((resolve, reject) => { 4437 // Hide/Show revealer. 4438 TweenMax.to(this.DOM.preview.revealer, this.config.animation.duration, { 4439 delay: action === 'hide' ? 0 : this.config.animation.duration/2, 4440 ease: this.config.animation.ease, 4441 startAt: action === 'hide' ? {x:'0%', y:'-100%'} : {x:'0%', y:'0%'}, 4442 y: action === 'hide' ? '0%' : '-100%', 4443 onComplete: resolve 4444 }); 4445 // Move and fade the image wrapper. 4446 TweenMax.to(this.DOM.preview.imgWrap, this.config.animation.duration, { 4447 delay: action === 'hide' ? 0 : this.config.animation.duration/2, 4448 ease: this.config.animation.ease, 4449 startAt: action === 'hide' ? {} : {opacity: 0, y: '20%'}, 4450 y: action === 'hide' ? '20%' : '0%', 4451 opacity: action === 'hide' ? 0 : 1 4452 }); 4453 // Move and fade the title and content. 4454 TweenMax.to([this.DOM.preview.title,this.DOM.preview.content], this.config.animation.duration, { 4455 delay: action === 'hide' ? 0 : this.config.animation.duration/2, 4456 ease: this.config.animation.ease, 4457 startAt: action === 'hide' ? {} : {opacity: 0, y: '200%'}, 4458 y: action === 'hide' ? '200%' : '0%', 4459 opacity: action === 'hide' ? 0 : 1 4460 }); 4461 }); 4462 } 4463 } 4464 4465 // The Slideshow class. 4466 class Slideshow { 4467 constructor(el) { 4468 this.DOM = {el: el}; 4469 // Navigation controls (prev, next and preview ctrls) 4470 this.DOM.prevCtrl = this.DOM.el.querySelector('.slidenav__item--prev'); 4471 this.DOM.nextCtrl = this.DOM.el.querySelector('.slidenav__item--next'); 4472 this.DOM.previewCtrl = this.DOM.el.querySelector('.slidenav__preview'); 4473 // The slides. 4474 this.slides = []; 4475 Array.from(this.DOM.el.querySelectorAll('.slide')).forEac
4475h(slideEl => this.slides.push(new Slide(slideEl))); 4476 // The total number of slides. 4477 this.slidesTotal = this.slides.length; 4478 // Current slide position. 4479 this.current = 0; 4480 // initialize the slideshow. 4481 this.init(); 4482 } 4483 // init: set the current slide and initialize some events.. 4484 init() { 4485 this.slides[this.current].setCurrent(); 4486 this.initEvents(); 4487 } 4488 initEvents() { 4489 this.DOM.prevCtrl.addEventListener('click', () => this.prev()); 4490 this.DOM.nextCtrl.addEventListener('click', () => this.next()); 4491 this.DOM.previewCtrl.addEventListener('click', (ev) => { 4492 if ( this.isAnimating ) return; 4493 if ( ev.target.classList.contains('slidenav__preview--open') ) { 4494 ev.target.classList.remove('slidenav__preview--open'); 4495 this.exitPreview(); 4496 } 4497 else { 4498 ev.target.classList.add('slidenav__preview--open') 4499 this.enterPreview(); 4500 } 4501 }); 4502 } 4503 prev() { 4504 this.navigate('left'); 4505 } 4506 next() { 4507 this.navigate('right'); 4508 } 4509 enterPreview() { 4510 this.togglePreview('enter'); 4511 } 4512 exitPreview() { 4513 this.togglePreview('exit'); 4514 } 4515 togglePreview(action) { 4516 // If animating return. 4517 if ( this.isAnimating ) return; 4518 this.isAnimating = true; 4519 4520 const processing = action === 'enter' ? 4521 [this.slides[this.current].hide('up'), this.slides[this.current].showPreview()] : 4522 [this.slides[this.current].show('down'), this.slides[this.current].hidePreview()]; 4523 4524 // Hide the next/prev controls. 4525 this.toggleNavCtrls(action); 4526 4527 Promise.all(processing).then(() => this.isAnimating = false); 4528 } 4529 toggleNavCtrls(action) { 4530 TweenMax.to([this.DOM.prevCtrl, this.DOM.nextCtrl], 0.5, { 4531 ease: 'Expo.easeOut', 4532 opacity: action === 'enter' ? 0 : 1, 4533 onStart: () => this.DOM.prevCtrl.style.pointerEvents = this.DOM.nextCtrl.style.pointerEvents = action === 'enter' ? 'none' : 'auto' 4534 }); 4535 } 4536 // Navigate the slideshow. 4537 navigate(direction) { 4538 // If animating return. 4539 if ( this.isAnimating ) return; 4540 this.isAnimating = true; 4541 4542 const nextSlidePos = direction === 'right' ? 4543 this.current < this.slidesTotal-1 ? this.current+1 : 0 : 4544 this.current > 0 ? this.current-1 : this.slidesTotal-1; 4545 4546 Promise.all([this.slides[this.current].hide(direction), this.slides[nextSlidePos].show(direction)]) 4547 .then(() => { 4548 // Update current. 4549 this.slides[this.current].setCurrent(false); 4550 this.current = nextSlidePos; 4551 this.isAnimating = false; 4552 this.slides[this.current].setCurrent(); 4553 }); 4554 } 4555 } 4556 4557 const slideshow = new Slideshow(document.querySelector('.tg_motion_reveal_slider_wrapper.slideshow')); 4558 } ); 4559 //End execute javascript for motion reveal slider 4560 4561 4562 //Start execute javascript for testimonials card 4563 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-testimonial-card.default', function( $scope ) { 4564 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};(function ($) { 4565 $.extend({ 4566 Mod2Slider: function Mod2Slider(options) { 4567 4568 // make sure either an object with all of our options is passed in or nothing at all 4569 if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) !== 'object') { 4570 throw new Error('Invalid parameter. You must pass in an object!'); 4571 } else { 4572 4573 /** 4574 * Setup all of our options 4575 * 4576 * 1. NameSpace is going to to be the id of the main section containing the slider. If nothing is passed in then the body tag will be used as the namespace, meaning if you have more than one slider on the page then only the first will be found. 4577 * 2. beginningSlide is going to be which slide you want the slider to start out on, first, middle, or last. 4578 * 3. slideDirection sets the slider to be either horizontal or vertical 4579 * 4. overflow sets the css overflow property of the slider ul. If overflow is hidden then only the active slide will be visible, else if overflow is set to visible then all the slides will be visible in a row. 4580 * 5. bulletNav takes in a boolean that if true appends a bullet list nav to the slider. 4581 * 6. navigateBySlide takes in a boolen that if true allows users to navigate to a slide by clicking on it. 4582 * 4583 */ 4584 4585 var nameSpace = options.sectionId || 'body .tg_testimonials_card_wrapper'; 4586 var beginningSlide = options.beginningSlide || 'second'; 4587 var sliderDirection = options.sliderDirection || 'horizontal'; 4588 var overflow = options.overflow || 'hidden'; 4589 var bulletNav = options.bulletNav;
4590 var navigateBySlide = options.navigateBySlide || false; 4591 var positionUnit = options.positionUnit || 'px'; 4592 4593 // cache frequently called dom elements 4594 var slides = jQuery(nameSpace + ' .slider li'); 4595 var sliderUl = jQuery(nameSpace + ' .slider > ul'); 4596 var sliderContainer = jQuery(nameSpace + ' .slider'); 4597 var sliderNav = void 0; 4598 var sliderNavBtns = void 0; 4599 var direction = void 0; 4600 4601 // initialize slider 4602 var initSlider = function initSlider() { 4603 // set which slide to start on 4604 var x = void 0; 4605 4606 switch (beginningSlide) { 4607 case 'first': 4608 x = 0; 4609 break; 4610 case 'second': 4611 x = 1; 4612 break; 4613 case 'middle': 4614 x = Math.floor(slides.length / 2); 4615 break; 4616 case 'last': 4617 x = slides.length - 1; 4618 break;} 4619 4620 4621 // give slides a data attribute containing their index number 4622 jQuery(slides).each(function (i) { 4623 jQuery(this).attr('data', i); 4624 }); 4625 4626 // style slider and position slides 4627 styleSlider(); 4628 positionSlides(x); 4629 4630 // initialize slider nav if bulletNav true 4631 if (bulletNav) { 4632 sliderNavInit(x); 4633 } 4634 4635 // initialize the click listener function for slides if navigateBySlide is true 4636 if (navigateBySlide) { 4637 jQuery(slides).hover().css({ 4638 cursor: 'pointer' }); 4639 4640 slideListener(); 4641 } 4642 4643 }; 4644 4645 // setup necessary styles for the slider, this is called when first initializing 4646 var styleSlider = function styleSlider() { 4647 /** 4648 * Set the height of the slider to the height of the tallest slide. 4649 * This is done to avoid the slider pushing or pulling the elements below it during a slide transition. 4650 */ 4651 var slideHeights = []; 4652 jQuery(slides).each(function () { 4653 slideHeights.push(jQuery(this).outerHeight()); 4654 }); 4655 4656 jQuery(sliderUl).css('min-height', Math.max.apply(Math, slideHeights)); 4657 4658 // set the overflow of the slider 4659 sliderUl.css('overflow', overflow); 4660 4661 // set the direction of the slider 4662 if (sliderDirection === 'vertical') { 4663 direction = 'top'; 4664 } else if (sliderDirection === 'horizontal') { 4665 direction = 'left'; 4666 } 4667 }; 4668 4669 // position slides, takes in an integer which indicates the slide index to make active 4670 var positionSlides = function positionSlides(index) { 4671 4672 // check to make sure the index parameter is valid 4673 if (index < 0 || index > slides.length) { 4674 throw new Error('Invalid index parameter.'); 4675 return; 4676 } else { 4677 var activeSlide = jQuery(slides[index]); 4678 var fullSlideWidth = jQuery(slides[index]).outerWidth(true); 4679 var unitCalc = void 0; 4680 4681 if (positionUnit === 'px') { 4682 unitCalc = fullSlideWidth; 4683 } else if (positionUnit === '%') { 4684 unitCalc = 100; 4685 } 4686 4687 // set the slider ul to the active slide width 4688 jQuery(sliderUl).css('width', fullSlideWidth); 4689 4690 // set the position of the active slide and all previous + next slides 4691 activeSlide.css(direction, '0'); 4692 4693 activeSlide.prevAll().each(function (i) { 4694 jQuery(this).css(direction, '-' + unitCalc * (i + 1) + positionUnit); 4695 }); 4696 4697 activeSlide.nextAll().each(function (i) { 4698 jQuery(this).css(direction, unitCalc * (i + 1) + positionUnit); 4699 }); 4700 } 4701 }; 4702 4703 // initialize the slider nav, takes in an integer which indicates the current active slide 4704 var sliderNavInit = function sliderNavInit(x) { 4705 // append nav to slider and save the reference to sliderNav variable 4706 sliderContainer.append('<nav class="slider-nav"><ul></ul></nav>'); 4707 sliderNav = jQuery(nameSpace + ' .slider-nav'); 4708
4709 // append an li for each slide to the slider nav ul 4710 for (var i = 0; i < slides.length; i++) { 4711 if (i < x || i > x) { 4712 jQuery(sliderNav).find('ul').append('<li class="bullet" data="' + i + '"></li>'); 4713 } else if (i === x) { 4714 jQuery(sliderNav).find('ul').append('<li class="active-bullet bullet" data="' + i + '"></li>'); 4715 } 4716 } 4717 4718 // save reference to nav btns in a varible 4719 sliderNavBtns = jQuery(nameSpace + ' li[class*="bullet"]'); 4720 4721 // call the click handeler function 4722 navListener(); 4723 }; 4724 4725 // navigate to slide when clicking on nav bullets 4726 var navListener = function navListener() { 4727 sliderNav.click(function (e) { 4728 4729 // we only care about clicks on the li's 4730 if (e.target.tagName === 'LI') { 4731 4732 // get the value of the data attribute from the clicked li and conver to an integer 4733 var index = parseInt(jQuery(e.target).attr('data')); 4734 4735 // style active button 4736 sliderNavBtns.each(function () { 4737 jQuery(this).removeClass('active-bullet'); 4738 }); 4739 4740 jQuery(e.target).addClass('active-bullet'); 4741 4742 // position the slides 4743 positionSlides(index); 4744 } 4745 }); 4746 }; 4747 4748 // called if navigateBySlide is true 4749 var slideListener = function slideListener() { 4750 sliderContainer.click(function (e) { 4751 4752 // filter out clicks that are on the container 4753 var slideClicked = e.target.tagName !== 'DIV' ? true : false; 4754 4755 if (slideClicked) { 4756 // get the data attribute value of the clicked li and convert to an integer 4757 var index = parseInt(jQuery(e.target).closest('li').attr('data')); 4758 4759 // if a bullet nav exists, update the button styles 4760 if (sliderNav) { 4761 sliderNavBtns.each(function () { 4762 jQuery(this).removeClass('active-bullet'); 4763 }); 4764 4765 jQuery(sliderNavBtns[index]).addClass('active-bullet'); 4766 } 4767 4768 // position the slides 4769 positionSlides(index); 4770 } 4771 }); 4772 }; 4773 4774 initSlider(); 4775 } 4776 4777 } }); 4778 4779 })(jQuery); 4780 4781 jQuery(".tg_testimonials_card_wrapper").each(function() { 4782 var slideshow = jQuery(this).parent('.elementor-widget-container').parent('.elementor-widget-architecturer-testimonial-card'); 4783 var slideshowNameSpace = '#'+slideshow.attr('data-id')+' .tg_testimonials_card_wrapper'; 4784 var slideshowBeginningSlide = jQuery(this).attr('data-beginning-slide'); 4785 var slideshowPagination = jQuery(this).attr('data-pagination'); 4786 4787 new $.Mod2Slider({ 4788 nameSpace: slideshowNameSpace, 4789 beginningSlide: slideshowBeginningSlide, 4790 bulletNav: Boolean(Number(slideshowPagination)), 4791 overflow: 'visible', 4792 navigateBySlide: true, 4793 positionUnit: 'px' }); 4794 } ); 4795 }); 4796 //End execute javascript for testimonials card 4797 4798 4799 //Start execute javascript for slider image carousel 4800 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-slider-image-carousel.default', function( $scope ) { 4801 jQuery(".tg_image_carousel_slider_wrapper").each(function() { 4802 jQuery(this).find('.carousel-item').eq(0).addClass('active'); 4803 var total = jQuery(this).find('.carousel-item').length; 4804 var current = 0; 4805 var slideObj = jQuery(this); 4806 4807 jQuery(this).find('#moveRight').on('click', function(){ 4808 var next=current; 4809 current= current+1; 4810 setSlide(next, current, slideObj); 4811 }); 4812 jQuery(this).find('#moveLeft').on('click', function(){ 4813 var prev=current; 4814 current = current- 1; 4815 setSlide(prev, current, slideObj); 4816 }); 4817 function setSlide(prev, next, slideObj){ 4818 var slide= current; 4819 if(next>total-1){ 4820 slide=0; 4821 current=0; 4822 } 4823 if(next<0){ 4824 slide=total - 1; 4825 current=total - 1; 4826 } 4827 4828 slideObj.find('.carousel-item').eq(prev).removeClass('active'); 4829 slideObj.find('.carousel-item').eq(slide).addClass('active'); 4830 setTimeout(function(){ 4831 4832 },800); 4833 } 4834 }); 4835 } ); 4836 //End execute javascript for slider image carousel
4837 4838 4839 //Start execute javascript for portfolio grid 4840 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-portfolio-grid.default', function( $scope ) { 4841 jQuery(".portfolio_grid_container").each(function() { 4842 var containderDiv = jQuery(this); 4843 var selectedClass = ""; 4844 4845 containderDiv.find(".filter_tag_btn").on('click', function(){ 4846 containderDiv.find(".filter_tag_btn").removeClass("active"); 4847 jQuery(this).addClass("active"); 4848 selectedClass = jQuery(this).attr("data-rel"); 4849 column = jQuery(this).attr("data-cols"); 4850 4851 var gridDiv = containderDiv.find(".portfolio_grid_content_wrapper"); 4852 gridDiv.fadeTo(100, 0); 4853 gridDiv.find(".portfolio_grid_wrapper").not("."+selectedClass).fadeOut().removeClass('scale-anm'); 4854 4855 setTimeout(function() { 4856 jQuery("."+selectedClass).fadeIn().addClass('scale-anm'); 4857 gridDiv.find(".portfolio_grid_wrapper.last").removeClass('last'); 4858 var count = gridDiv.find(".portfolio_grid_wrapper.scale-anm").length; 4859 4860 gridDiv.find(".portfolio_grid_wrapper.scale-anm").each(function(index){ 4861 var lastIndex = parseInt(index+1); 4862 if(lastIndex%column == 0) 4863 { 4864 jQuery(this).addClass('last'); 4865 } 4866 4867 if(lastIndex == count) 4868 { 4869 setTimeout(function() { 4870 gridDiv.fadeTo(300, 1); 4871 }, 300); 4872 } 4873 }); 4874 4875 }, 300); 4876 }); 4877 }); 4878 } ); 4879 //End execute javascript for portfolio grid 4880 4881 4882 //Start execute javascript for portfolio classic 4883 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-portfolio-classic.default', function( $scope ) { 4884 jQuery(".portfolio_classic_container").each(function() { 4885 var containderDiv = jQuery(this); 4886 var selectedClass = ""; 4887 4888 containderDiv.find(".filter_tag_btn").on('click', function(){ 4889 containderDiv.find(".filter_tag_btn").removeClass("active"); 4890 jQuery(this).addClass("active"); 4891 selectedClass = jQuery(this).attr("data-rel"); 4892 column = jQuery(this).attr("data-cols"); 4893 4894 var gridDiv = containderDiv.find(".portfolio_classic_content_wrapper"); 4895 gridDiv.fadeTo(100, 0); 4896 gridDiv.find(".portfolio_classic_grid_wrapper").not("."+selectedClass).fadeOut().removeClass('scale-anm'); 4897 4898 setTimeout(function() { 4899 jQuery("."+selectedClass).fadeIn().addClass('scale-anm'); 4900 gridDiv.find(".portfolio_classic_grid_wrapper.last").removeClass('last'); 4901 var count = gridDiv.find(".portfolio_classic_grid_wrapper.scale-anm").length; 4902 4903 gridDiv.find(".portfolio_classic_grid_wrapper.scale-anm").each(function(index){ 4904 var lastIndex = parseInt(index+1); 4905 if(lastIndex%column == 0) 4906 { 4907 jQuery(this).addClass('last'); 4908 } 4909 4910 if(lastIndex == count) 4911 { 4912 setTimeout(function() { 4913 gridDiv.fadeTo(300, 1); 4914 }, 300); 4915 } 4916 }); 4917 4918 }, 300); 4919 }); 4920 }); 4921 } ); 4922 //End execute javascript for portfolio classic 4923 4924 4925 //Start execute javascript for navigation menu 4926 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-navigation-menu.default', function( $scope ) { 4927 jQuery('.tg_navigation_wrapper .nav li.menu-item').hover(function() 4928 { 4929 jQuery(this).children('ul:first').addClass('visible'); 4930 jQuery(this).children('ul:first').addClass('hover'); 4931 }, 4932 function() 4933 { 4934 jQuery(this).children('ul:first').removeClass('visible'); 4935 jQuery(this).children('ul:first').removeClass('hover'); 4936 }); 4937 4938 jQuery('.tg_navigation_wrapper .nav li.menu-item').children('ul:first.hover').hover(function() 4939 { 4940 jQuery(this).stop().addClass('visible'); 4941 }, 4942 function() 4943 { 4944 jQuery(this).stop().removeClass('visible'); 4945 }); 4946 } ); 4947 //End execute javascript for navigation menu 4948 4949 4950 //Start execute javascript for search 4951 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-search.default', function( $scope ) { 4952 4953 jQuery(".architecturer-search-icon").each(function() { 4954 var iconInput = jQuery(this).find('a'); 4955 4956 iconInput.bind('click', function () { 4957 var openDiv = jQuery(this).attr('data-open'); 4958 jQuery('#'+openDiv).addClass('active'); 4959 4960 var isTouch = ('ontouchstart' in document.documentElement); 4961 if ( isTouch ) { 4962 jQuery('#'+openDiv).find('.architecturer-search-inner').addClass('touch'); 4963 } 4964 4965 jQuery('body').addClass('elementor-no-overflow'); 4966 jQuery('body').addClass('elementor-search-activate'); 4967 4968 setTimeout(function(){ 4969 jQuery('#'+openDiv).find('.tg_search_form.autocomplete_form').find('input#s').trigger('focus'); 4970 }, 300); 4971 }); 4972 }); 4973 4974 jQuery(".tg_search_form.autocomplete_form").each(function() { 4975 var wrapper = jQuery(this).attr('data-open'); 4976 var formInput = jQuery(this).find('input[name="s"]'); 4977 var resultDiv = jQuery(this).attr('data-result'); 4978 var isTouch = ('ontouchstart' in document.documentElement); 4979 4980 if ( !isTouch ) { 4981 formInput.on('input', function() { 4982 if(jQuery(this).val().length > 1) 4983 { 4984 jQuery.ajax({ 4985 url: tgAjax.ajaxurl, 4986 type:'POST',
4987 data:'action=architecturer_ajax_search_result&'+jQuery(this).serialize(), 4988 success:function(results) { 4989 jQuery("#"+resultDiv).html(results); 4990 4991 if(results != '') 4992 { 4993 jQuery("#"+resultDiv).addClass('visible'); 4994 jQuery("#"+resultDiv).show(); 4995 jQuery("#"+resultDiv).css('z-index', 99); 4996 4997 jQuery("#"+resultDiv+ " ul li a").mousedown(function() { 4998 jQuery("#"+resultDiv).addClass('visible'); 4999 jQuery("#"+resultDiv).attr('data-mousedown', 'true'); 5000 5001 location.href = jQuery(this).attr('href'); 5002 }); 5003 } 5004 else 5005 { 5006 jQuery("#"+resultDiv).hide(); 5007 } 5008 } 5009 }); 5010 } 5011 else 5012 { 5013 jQuery("#"+resultDiv).html(''); 5014 } 5015 }); 5016 } 5017 5018 formInput.bind('click', function () { 5019 jQuery("#"+resultDiv).addClass('visible'); 5020 jQuery("#"+resultDiv).attr('data-mousedown', 'true'); 5021 5022 /*var isTouch = ('ontouchstart' in document.documentElement); 5023 if ( isTouch ) {*/ 5024 //jQuery('#'+wrapper).addClass('touch'); 5025 //} 5026 }); 5027 5028 formInput.bind('focus', function () { 5029 jQuery("#"+resultDiv).addClass('visible'); 5030 formInput.addClass('visible'); 5031 }); 5032 5033 formInput.bind('blur', function () { 5034 jQuery("#"+resultDiv).removeClass('visible'); 5035 formInput.removeClass('visible'); 5036 }); 5037 5038 jQuery("#"+wrapper).bind('click', function () { 5039 if(!formInput.hasClass('visible')) 5040 { 5041 if(jQuery("#"+resultDiv).attr('data-mousedown') != 'true') 5042 { 5043 jQuery("#"+resultDiv).removeClass('visible'); 5044 } 5045 jQuery('#'+wrapper).removeClass('active'); 5046 jQuery('body').removeClass('elementor-no-overflow'); 5047 jQuery('body').removeClass('elementor-search-activate'); 5048 } 5049 }); 5050 }); 5051 5052 } ); 5053 //End execute javascript for search 5054 5055 //Start execute javascript for animated text 5056 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-animated-text.default', function( $scope ) { 5057 5058 jQuery(".themegoods-animated-text").each(function() { 5059 var textContent = jQuery(this).first(); 5060 var delimiterTypeOri = jQuery(this).attr('data-delimiter'); 5061 var delimiterType = jQuery(this).attr('data-delimiter'); 5062 var transitionSpeed = parseInt(jQuery(this).attr('data-transition')); 5063 var transitionDelay = parseInt(jQuery(this).attr('data-transition-delay')); 5064 var transitionDuration = parseInt(jQuery(this).attr('data-transition-duration')); 5065 5066 if(delimiterType == 'sentence') { 5067 delimiterType = 'word' 5068 } 5069 5070 var animatedText = textContent.blast({ 5071 delimiter: delimiterType, 5072 aria: false, 5073 }); 5074 5075 //If overflow hidden 5076 if(jQuery(this).hasClass('overflow-hidden')){ 5077 animatedText.each(function(i) { 5078 var textEachSpan = jQuery(this); 5079 var initialText = textEachSpan.text(); 5080 //console.log(textEachSpan.html()); 5081 textEachSpan.html('<span>'+initialText+'</span>'); 5082 5083 //console.log(initialText); 5084 }); 5085 } 5086 5087 if(textContent.isInViewport()) { 5088 animatedText.each(function(i) { 5089 var delaySpeed = parseInt(transitionDelay + (i * transitionSpeed)); 5090 //console.log(delimiterType); 5091 if(delimiterTypeOri == 'sentence') { 5092 delaySpeed = parseInt(transitionDelay + transitionSpeed); 5093 } 5094 5095 jQuery(this).queue(function (next) { 5096 jQuery(this).css({'transition-delay': delaySpeed+'ms', 'transition-duration': transitionDuration+'ms', 'transform': 'translateX(0px) translateY(0px) translateZ(0px)', 'opacity': 1}); 5097 }) 5098 }); 5099 } 5100 5101 jQuery(window).on('resize scroll', function() { 5102 if(textContent.isInViewport()) { 5103 animatedText.each(function(i) { 5104 var delaySpeed = parseInt(transitionDelay + (i * transitionSpeed)); 5105 if(delimiterTypeOri == 'sentence') { 5106 delaySpeed = parseInt(transitionDelay + transitionSpeed); 5107 } 5108 5109 jQuery(this).queue(function (next) { 5110 jQuery(this).css({'transition-delay': delaySpeed+'ms', 'transition-duration': transitionDuration+'ms', 'transform': 'translateX(0px) translateY(0px) translateZ(0px)', 'opacity': 1}); 5111 }) 5112 }); 5113 } 5114 }); 5115 }); 5116 5117 } ); 5118 //End execute javascript for animated text 5119 5120 //Start execute javascript for animated headline 5121 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-animated-headline.default', function( $scope ) { 5122 5123 jQuery(".themegoods-animated-headline").each(function() { 5124 var animationType = jQuery(this).attr('data-animation'); 5125 5126 jQuery(this).animatedHeadline({ 5127 animationType: animationType 5128 }); 5129 }); 5130 5131 } ); 5132 //End execute javascript for animated headline 5133 5134 //Start execute javascript for Elementor image 5135 elementorFrontend.hooks.addAction( 'frontend/element_ready/image.default', function( $scope ) { 5136 5137 if(elementorFrontend.isEditMode()) 5138 { 5139 var elementSettings = {};
5140 var modelCID = $scope.data( 'model-cid' ); 5141 5142 var settings = elementorFrontend.config.elements.data[ modelCID ]; 5143 if(typeof settings != 'undefined') 5144 { 5145 var type = settings.attributes.widgetType || settings.attributes.elType, 5146 settingsKeys = elementorFrontend.config.elements.keys[ type ]; 5147 5148 if ( ! settingsKeys ) { 5149 settingsKeys = elementorFrontend.config.elements.keys[type] = []; 5150 5151 jQuery.each( settings.controls, function ( name, control ) { 5152 if ( control.frontend_available ) { 5153 settingsKeys.push( name ); 5154 } 5155 }); 5156 } 5157 5158 jQuery.each( settings.getActiveControls(), function( controlKey ) { 5159 if ( -1 !== settingsKeys.indexOf( controlKey ) ) { 5160 elementSettings[ controlKey ] = settings.attributes[ controlKey ]; 5161 } 5162 } ); 5163 5164 var widgetExt = elementSettings; 5165 } 5166 } 5167 else 5168 { 5169 //Get widget settings data 5170 var widgetExtObj = $scope.attr('data-settings'); 5171 5172 if(typeof widgetExtObj != 'undefined') 5173 { 5174 var widgetExt = JSON.parse(widgetExtObj); 5175 } 5176 } 5177 5178 if(typeof widgetExt != 'undefined') 5179 { 5180 //Begin background image parallax scrolling 5181 if(widgetExt.architecturer_image_is_animation == 'true') 5182 { 5183 $scope.addClass('themegoods-image-animation-'+widgetExt.architecturer_image_animation_effect); 5184 5185 $scope.smoove({ 5186 offset : '30%' 5187 }); 5188 } 5189 } 5190 } ); 5191 //End execute javascript for Elementor image 5192 5193 //Start execute javascript for accommodation carousel 5194 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-portfolio-carousel.default', function( $scope ) { 5195 jQuery(".portfolio-carousel-wrapper .owl-carousel").each(function() { 5196 var autoPlay = jQuery(this).attr('data-autoplay'); 5197 if (typeof autoPlay == "undefined"){ 5198 autoPlay = false; 5199 } 5200 if(autoPlay == 1) 5201 { 5202 autoPlay = true; 5203 } 5204 else 5205 { 5206 autoPlay = false; 5207 } 5208 5209 var timer = jQuery(this).attr('data-timer'); 5210 if (typeof timer == "undefined"){ 5211 timer = 8000; 5212 } 5213 5214 //console.log(pagination); 5215 jQuery(this).owlCarousel({ 5216 stagePadding: 70, 5217 loop: false, 5218 center: false, 5219 items: 2, 5220 margin: 40, 5221 autoplay: autoPlay, 5222 dots: false, 5223 autoplayTimeout: timer, 5224 smartSpeed: 450, 5225 responsive: { 5226 0: { 5227 items: 1 5228 }, 5229 768: { 5230 items: 2 5231 }, 5232 1170: { 5233 items: 2 5234 } 5235 } 5236 }); 5237 }); 5238 }); 5239 //End execute javascript for accommodation carousel 5240 5241 5242 //Start execute javascript for synchronized carousel slider 5243 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-slider-synchronized-carousel.default', function( $scope ) { 5244 5245 jQuery(".tg_synchronized_carousel_slider_wrapper").each(function() { 5246 var sliderID = jQuery(this).attr('id'); 5247 var slidersContainer = document.querySelector("#"+sliderID); 5248 var countSlide = jQuery(this).attr('data-countslide'); 5249 5250 // Initializing the numbers slider 5251 var msNumbers = new MomentumSlider({ 5252 el: slidersContainer, 5253 cssClass: "ms--numbers", 5254 range: [1, countSlide], 5255 rangeContent: function (i) { 5256 return "0" + i; 5257 }, 5258 style: { 5259 transform: [{scale: [0.4, 1]}], 5260 opacity: [0, 1] 5261 }, 5262 interactive: false 5263 }); 5264 5265 var titles = JSON.parse(jQuery(this).attr('data-slidetitles')); 5266 5267 var msTitles = new MomentumSlider({ 5268 el: slidersContainer, 5269 cssClass: "ms--titles", 5270 range: [0, parseInt(countSlide-1)], 5271 rangeContent: function (i) { 5272 return "<h3>"+ titles[i] +"</h3>"; 5273 }, 5274 vertical: true, 5275 reverse: true, 5276 style: { 5277 opacity: [0, 1] 5278 }, 5279 interactive: false 5280 }); 5281 5282 var buttonTitles = JSON.parse(jQuery(this).attr('data-sli
5282debuttontitles')); 5283 var buttonUrls = JSON.parse(jQuery(this).attr('data-slidebuttonurls')); 5284 5285 // Initializing the links slider 5286 var msLinks = new MomentumSlider({ 5287 el: slidersContainer, 5288 cssClass: "ms--links", 5289 range: [0, parseInt(countSlide-1)], 5290 rangeContent: function (i) { 5291 return "<a href=\""+buttonUrls[i]+"\" class=\"ms-slide__link\">"+buttonTitles[i]+"</a>"; 5292 }, 5293 vertical: true, 5294 interactive: false 5295 }); 5296 5297 // Get pagination items 5298 var paginationID = jQuery(this).attr('data-pagination'); 5299 var pagination = document.querySelector("#"+paginationID); 5300 var paginationItems = [].slice.call(pagination.children); 5301 5302 var images = JSON.parse(jQuery(this).attr('data-slideimages')); 5303 5304 // Initializing the images slider 5305 var msImages = new MomentumSlider({ 5306 // Element to append the slider 5307 el: slidersContainer, 5308 // CSS class to reference the slider 5309 cssClass: "ms--images", 5310 // Generate the 4 slides required 5311 range: [0, parseInt(countSlide-1)], 5312 rangeContent: function (i) { 5313 return "<div class=\"ms-slide__image-container\"><div class=\"ms-slide__image\" style=\"background-image: url('"+images[i]+"')\"></div></div>"; 5314 }, 5315 // Syncronize the other sliders 5316 sync: [msNumbers, msTitles, msLinks], 5317 // Styles to interpolate as we move the slider 5318 style: { 5319 ".ms-slide__image": { 5320 transform: [{scale: [1.5, 1]}] 5321 } 5322 }, 5323 // Update pagination if slider change 5324 change: function(newIndex, oldIndex) { 5325 if (typeof oldIndex !== "undefined") { 5326 paginationItems[oldIndex].classList.remove("pagination__item--active"); 5327 } 5328 paginationItems[newIndex].classList.add("pagination__item--active"); 5329 } 5330 }); 5331 5332 pagination.addEventListener("click", function(e) { 5333 if (e.target.matches(".pagination__button")) { 5334 var index = paginationItems.indexOf(e.target.parentNode); 5335 msImages.select(index); 5336 } 5337 }); 5338 }); 5339 5340 } ); 5341 //End execute javascript for synchronized carousel slider 5342 5343 //Start execute javascript for testimonials carousel 5344 elementorFrontend.hooks.addAction( 'frontend/element_ready/architecturer-testimonial-carousel.default', function( $scope ) { 5345 jQuery(".testimonials-carousel-wrapper .owl-carousel").each(function() { 5346 var autoPlay = jQuery(this).attr('data-autoplay'); 5347 if (typeof autoPlay == "undefined"){ 5348 autoPlay = false; 5349 } 5350 if(autoPlay == 1) 5351 { 5352 autoPlay = true; 5353 } 5354 else 5355 { 5356 autoPlay = false; 5357 } 5358 5359 var timer = jQuery(this).attr('data-timer'); 5360 if (typeof timer == "undefined"){ 5361 timer = 8000; 5362 } 5363 5364 var pagination = jQuery(this).attr('data-pagination'); 5365 if (typeof pagination == "undefined"){ 5366 pagination = true; 5367 } 5368 if(pagination == 1) 5369 { 5370 pagination = true; 5371 } 5372 else 5373 { 5374 pagination = false; 5375 } 5376 5377 jQuery(this).owlCarousel({ 5378 loop: true, 5379 center: true, 5380 items: 3, 5381 margin: 0, 5382 autoplay: autoPlay, 5383 dots:pagination, 5384 autoplayTimeout: timer, 5385 smartSpeed: 450, 5386 responsive: { 5387 0: { 5388 items: 1 5389 }, 5390 768: { 5391 items: 2 5392 }, 5393 1170: { 5394 items: 3 5395 } 5396 } 5397 }); 5398 }); 5399 }); 5400 //End execute javascript for testimonials carousel 5401 5402 } ); 5403 5404} )( 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.