1function is_touch_device() { 2 return 'ontouchstart' in window // works on most browsers 3 || 'onmsgesturechange' in window; // works on ie10 4} 5 6( function( $ ) { 7 // Make sure you run this code under Elementor.. 8 $( window ).on( 'elementor/frontend/init', function() { 9 10 jQuery("img.lazy").each(function() { 11 var currentImg = jQuery(this); 12 13 jQuery(this).Lazy({ 14 onFinishedAll: function() { 15 currentImg.parent("div.post_img_hover").removeClass("lazy"); 16 currentImg.parent('.tg_gallery_lightbox').parent("div.gallery_grid_item").removeClass("lazy"); 17 } 18 }); 19 }); 20 21 /*elementorFrontend.hooks.addAction( 'frontend/element_ready/global', function( $scope ) { 22 var elementDataSettings = $scope.data('settings'); 23 24 if(typeof elementDataSettings == 'object') 25 { 26 alert(elementDataSettings.toSource()); 27 alert(elementDataSettings.stretch_section); 28 } 29 } );*/ 30 31 //Start execute javascript for blog posts 32 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-blog-posts.default', function( $scope ) { 33 jQuery(function( $ ) { 34 jQuery("img.lazy").each(function() { 35 var currentImg = jQuery(this); 36 37 jQuery(this).Lazy({ 38 onFinishedAll: function() { 39 currentImg.parent("div.post_img_hover").removeClass("lazy"); 40 }, 41 }); 42 }); 43 44 if(!is_touch_device()) 45 { 46 var scaleTilt = 1.05; 47 if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 48 scaleTilt = 1; 49 } 50 51 jQuery(".blog-tilt").tilt({ 52 scale: scaleTilt, 53 perspective: 2500 54 }); 55 } 56 57 jQuery(".layout_masonry").each(function() { 58 var grid = jQuery(this); 59 60 grid.imagesLoaded().progress( function() { 61 grid.masonry({ 62 itemSelector: ".blog-posts-masonry", 63 columnWidth: ".blog-posts-masonry", 64 gutter : 45 65 }); 66 67 jQuery(".layout_masonry .blog-posts-masonry").each(function(index) { 68 setTimeout(function() { 69 jQuery(".layout_masonry .blog-posts-masonry").eq(index).addClass("is-showing"); 70 }, 250 * index); 71 }); 72 }); 73 74 jQuery(".layout_masonry img.lazy_masonry").each(function() { 75 var currentImg = jQuery(this); 76 currentImg.parent("div.post_img_hover").removeClass("lazy"); 77 78 jQuery(this).Lazy({ 79 onFinishedAll: function() { 80 grid.masonry({ 81 itemSelector: ".blog-posts-masonry", 82 columnWidth: ".blog-posts-masonry", 83 gutter : 45 84 }); 85 }, 86 }); 87 }); 88 }); 89 90 jQuery(".layout_metro_masonry").each(function() { 91 var grid = jQuery(this); 92 93 grid.imagesLoaded().progress( function() { 94 grid.masonry({ 95 itemSelector: ".blog-posts-metro", 96 columnWidth: ".blog-posts-metro", 97 gutter : 40 98 }); 99 100 jQuery(".layout_metro_masonry .blog-posts-metro").each(function(index) { 101 setTimeout(function() { 102 jQuery(".layout_metro_masonry .blog-posts-metro").eq(index).addClass("is-showing"); 103 }, 100 * index); 104 }); 105 }); 106 107 jQuery(".post_metro_left_wrapper img.lazy_masonry, .layout_metro_masonry img.lazy_masonry").each(function() { 108 var currentImg = jQuery(this); 109 currentImg.parent("div.post_img_hover").removeClass("lazy"); 110 111 jQuery(this).Lazy({ 112 onFinishedAll: function() { 113 grid.masonry({ 114 itemSelector: ".blog-posts-metro", 115 columnWidth: ".blog-posts-metro", 116 gutter : 40 117 }); 118 }, 119 }); 120 }); 121 }); 122 123 var menuLayout = jQuery('#pp_menu_layout').val(); 124 if(menuLayout != 'leftmenu') 125 { 126 jQuery(".post_metro_left_wrapper").stick_in_parent({ offset_top: 120 }); 127 } 128 else 129 { 130 jQuery(".post_metro_left_wrapper").stick_in_parent({ offset_top: 40 }); 131 } 132 133 if(jQuery(window).width() < 768 || is_touch_device()) 134 { 135 jQuery(".post_metro_left_wrapper").trigger("sticky_kit:detach"); 136 } 137 }); 138 } ); 139 //End execute javascript for blog posts 140 141 //Start execute javascript for gallery grid 142 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-gallery-grid.default', function( $scope ) { 143 jQuery("img.lazy").each(function() { 144 var currentImg = jQuery(this); 145 146 jQuery(this).Lazy({ 147 onFinishedAll: function() { 148 currentImg.parent("div.post_img_hover").removeClass("lazy"); 149 currentImg.parent('.tg_gallery_lightbox').parent("div.gallery_grid_item").removeClass("lazy"); 150 currentImg.parent("div.gallery_grid_item").removeClass("lazy"); 151 } 152 }); 153 }); 154 155 jQuery(function( $ ) {
156 if(!is_touch_device()) 157 { 158 var scaleTilt = 1.1; 159 if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 160 scaleTilt = 1; 161 } 162 jQuery(".gallery-grid-tilt").tilt({ 163 scale: scaleTilt, 164 perspective: 2500 165 }); 166 } 167 }); 168 } ); 169 //End execute javascript for gallery grid 170 171 //Start execute javascript for gallery masonry 172 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-gallery-masonry.default', function( $scope ) { 173 jQuery(function( $ ) { 174 if(!is_touch_device()) 175 { 176 var scaleTilt = 1.1; 177 if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 178 scaleTilt = 1; 179 } 180 jQuery(".gallery-grid-tilt").tilt({ 181 scale: scaleTilt, 182 perspective: 2500 183 }); 184 } 185 186 jQuery(".gallery_grid_content_wrapper.do_masonry").each(function() { 187 var grid = jQuery(this); 188 var cols = grid.attr('data-cols'); 189 190 if(!grid.hasClass('has_no_space')) 191 { 192 var gutter = 40; 193 if(cols > 4) 194 { 195 gutter = 30; 196 } 197 } 198 else 199 { 200 gutter = 0; 201 } 202 203 grid.imagesLoaded().progress( function() { 204 grid.masonry({ 205 itemSelector: ".gallery_grid_item", 206 columnWidth: ".gallery_grid_item", 207 gutter : gutter 208 }); 209 210 jQuery(".gallery_grid_content_wrapper.do_masonry .gallery_grid_item").each(function(index) { 211 setTimeout(function() { 212 jQuery(".do_masonry .gallery_grid_item").eq(index).addClass("is-showing"); 213 }, 100 * index); 214 }); 215 }); 216 217 jQuery(".gallery_grid_content_wrapper.do_masonry img.lazy_masonry").each(function() { 218 var currentImg = jQuery(this); 219 currentImg.parent("div.post_img_hover").removeClass("lazy"); 220 221 var cols = grid.attr('data-cols'); 222 223 if(!grid.hasClass('has_no_space')) 224 { 225 var gutter = 40; 226 if(cols > 4) 227 { 228 gutter = 30; 229 } 230 } 231 else 232 { 233 gutter = 0; 234 } 235 236 jQuery(this).Lazy({ 237 onFinishedAll: function() { 238 grid.masonry({ 239 itemSelector: ".gallery_grid_item", 240 columnWidth: ".gallery_grid_item", 241 gutter : gutter 242 }); 243 }, 244 }); 245 }); 246 }); 247 }); 248 } ); 249 //End execute javascript for gallery masonry 250 251 //Start execute javascript for gallery justified 252 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-gallery-justified.default', function( $scope ) { 253 jQuery(function( $ ) { 254 if(!is_touch_device()) 255 { 256 var scaleTilt = 1.1; 257 if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 258 scaleTilt = 1; 259 } 260 jQuery(".gallery-grid-tilt").tilt({ 261 scale: scaleTilt, 262 perspective: 2500 263 }); 264 } 265 266 jQuery("img.lazy").each(function() { 267 var currentImg = jQuery(this); 268 269 jQuery(this).Lazy({ 270 onFinishedAll: function() { 271 currentImg.parent("div.post_img_hover").removeClass("lazy"); 272 } 273 }); 274 }); 275 276 jQuery(".gallery_grid_content_wrapper.do_justified").each(function() { 277 var grid = jQuery(this); 278 var rowHeight = grid.attr('data-row_height'); 279 var margin = grid.attr('data-margin'); 280 var justifyLastRow = grid.attr('data-justify_last_row'); 281 var justifyLastRowStr = 'nojustify'; 282 if(justifyLastRow == 'yes') 283 { 284 justifyLastRowStr = 'justify'; 285 } 286 287 grid.imagesLoaded().always( function() { 288 grid.justifiedGallery({ 289 rowHeight: rowHeight, 290 margins: margin, 291 lastRow: justifyLastRowStr 292 }); 293 }); 294 }); 295 }); 296 } ); 297 //End execute javascript for gallery justified 298 299 //Start execute javascript for gallery horizontal 300 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-gallery-horizontal.default', function( $scope ) { 301 jQuery(".tg_horizontal_gallery_wrapper").each(function() { 302 var $carousel = jQuery(this); 303 var timer = $carousel.attr('data-autoplay'); 304 if(timer == 0) 305 { 306 timer = false;
307 } 308 309 var loop = $carousel.attr('data-loop'); 310 var navigation = $carousel.attr('data-navigation'); 311 if(navigation == 0) 312 { 313 navigation = false; 314 } 315 316 var pagination = $carousel.attr('data-pagination'); 317 if(pagination == 0) 318 { 319 pagination = false; 320 } 321 322 $carousel.flickity({ 323 percentPosition: false, 324 imagesLoaded: true, 325 selectedAttraction: 0.01, 326 friction: 0.2, 327 lazyLoad: 5, 328 pauseAutoPlayOnHover: true, 329 autoPlay: timer, 330 contain: true, 331 prevNextButtons: navigation, 332 pageDots: pagination 333 }); 334 335 var parallax = $carousel.attr('data-parallax'); 336 if(parallax == 1) 337 { 338 var $imgs = $carousel.find('.tg_horizontal_gallery_cell img'); 339 340 var docStyle = document.documentElement.style; 341 var transformProp = typeof docStyle.transform == 'string' ? 342 'transform' : 'WebkitTransform'; 343 344 var flkty = $carousel.data('flickity'); 345 346 $carousel.on( 'scroll.flickity', function() { 347 flkty.slides.forEach( function( slide, i ) { 348 var img = $imgs[i]; 349 var x = ( slide.target + flkty.x ) * -1/3; 350 img.style[ transformProp ] = 'translateX(' + x + 'px)'; 351 }); 352 }); 353 } 354 355 var fullscreen = $carousel.attr('data-fullscreen'); 356 if(fullscreen != 0) 357 { 358 jQuery('body').addClass('elementor-fullscreen'); 359 360 //Get menu element height 361 var menuHeight = parseInt(jQuery('#wrapper').css('paddingTop')); 362 var documentHeight = jQuery(window).innerHeight(); 363 var sliderHeight = parseInt(documentHeight - menuHeight); 364 365 $carousel.find('.tg_horizontal_gallery_cell').css('height', sliderHeight+'px'); 366 $carousel.find('.tg_horizontal_gallery_cell_img').css('height', sliderHeight+'px'); 367 $carousel.flickity('resize'); 368 369 jQuery( window ).resize(function() { 370 var menuHeight = parseInt(jQuery('#wrapper').css('paddingTop')); 371 var documentHeight = jQuery(window).innerHeight(); 372 var sliderHeight = parseInt(documentHeight - menuHeight); 373 374 $carousel.find('.tg_horizontal_gallery_cell').css('height', sliderHeight+'px'); 375 $carousel.find('.tg_horizontal_gallery_cell_img').css('height', sliderHeight+'px'); 376 $carousel.flickity('resize'); 377 }); 378 } 379 }); 380 } ); 381 //End execute javascript for gallery horizontal 382 383 //Start execute javascript for slider horizontal 384 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-slider-horizontal.default', function( $scope ) { 385 jQuery(".tg_horizontal_slider_wrapper").each(function() { 386 var $carousel = jQuery(this); 387 var timer = $carousel.attr('data-autoplay'); 388 if(timer == 0) 389 { 390 timer = false; 391 } 392 393 var loop = $carousel.attr('data-loop'); 394 var navigation = $carousel.attr('data-navigation'); 395 if(navigation == 0) 396 { 397 navigation = false; 398 } 399 400 var pagination = $carousel.attr('data-pagination'); 401 if(pagination == 0) 402 { 403 pagination = false; 404 } 405 406 $carousel.flickity({ 407 percentPosition: false, 408 imagesLoaded: true, 409 pauseAutoPlayOnHover: true, 410 autoPlay: timer, 411 contain: true, 412 prevNextButtons: navigation, 413 pageDots: pagination 414 }); 415 416 var fullscreen = $carousel.attr('data-fullscreen'); 417 if(fullscreen != 0) 418 { 419 jQuery('body').addClass('elementor-fullscreen'); 420 421 //Get menu element height 422 var menuHeight = parseInt(jQuery('#wrapper').css('paddingTop')); 423 var documentHeight = jQuery(window).innerHeight(); 424 var sliderHeight = parseInt(documentHeight - menuHeight); 425 426 $carousel.find('.tg_horizontal_slider_cell').css('height', sliderHeight+'px'); 427 $carousel.flickity('resize'); 428 429 jQuery( window ).resize(function() { 430 var menuHeight = parseInt(jQuery('#wrapper').css('paddingTop')); 431 var documentHeight = jQuery(window).innerHeight(); 432 var sliderHeight = parseInt(documentHeight - menuHeight); 433 434 $carousel.find('.tg_horizontal_slider_cell').css('height', sliderHeight+'px'); 435 $carousel.flickity('resize'); 436 }); 437 } 438 }); 439 } ); 440 //End execute javascript for slider horizontal 441 442 //Start execute javascript for album grid 443 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-album-grid.default', function( $scope ) { 444 jQuery(function( $ ) { 445 var tiltSettings = [ 446 {}, 447 { 448 movement: { 449 imgWrapper : { 450 translation : {x: 10, y: 10, z: 30}, 451 rotation : {x: 0, y: -10, z: 0}, 452 reverseAnimation : {duration : 200, easing : 'easeOutQuad'} 453 }, 454 lines : { 455 translation : {x: 10, y: 10, z: [0,70]}, 456 rotation : {x: 0, y: 0, z: -2}, 457 reverseAnimation : {duration : 2000, easing : 'easeOutExpo'} 458 }, 459 caption : { 460 rotation : {x: 0, y: 0, z: 2}, 461 reverseAnimation : {duration : 200, easing : 'easeOutQuad'} 462 }, 463 overlay : { 464 translation : {x: 10, y: -10, z: 0}, 465 rotation : {x: 0, y: 0, z: 2}, 466 reverseAnimation : {duration : 2000, easing : 'easeOutExpo'} 467 }, 468 shine : { 469 translation : {x: 100, y: 100, z: 0}, 470 reverseAnimation : {duration : 200, easing : 'easeOutQuad'} 471 } 472 } 473 }, 474 { 475 movement: { 476 imgWrapper : { 477 rotation : {x: -5, y: 10, z: 0}, 478 reverseAnimation : {duration : 900, easing : 'easeOutCubic'} 479 }, 480 caption : { 481 translation : {x: 30, y: 30, z: [0,40]}, 482 rotation : {x: [0,15], y: 0, z: 0}, 483 reverseAnimation : {duration : 1200, easing : 'easeOutExpo'} 484 }, 485 overlay : { 486 translation : {x: 10, y: 10, z: [0,20]}, 487 reverseAnimation : {duration : 1000, easing : 'easeOutExpo'} 488 }, 489 shine : { 490 translation : {x: 100, y: 100, z: 0}, 491 reverseAnimation : {duration : 900, easing : 'easeOutCubic'} 492 } 493 } 494 }, 495 { 496 movement: { 497 imgWrapper : { 498 rotation : {x: -5, y: 10, z: 0}, 499 reverseAnimation : {duration : 50, easing : 'easeOutQuad'} 500 }, 501 caption : { 502 translation : {x: 20, y: 20, z: 0}, 503 reverseAnimation : {duration : 200, easing : 'easeOutQuad'} 504 }, 505 overlay : { 506 translation : {x: 5, y: -5, z: 0}, 507 rotation : {x: 0, y: 0, z: 6}, 508 reverseAnimation : {duration : 1000, easing : 'easeOutQuad'} 509 }, 510 shine : { 511 translation : {x: 50, y: 50, z: 0}, 512 reverseAnimation : {duration : 50, easing : 'easeOutQuad'} 513 } 514 } 515 }, 516 { 517 movement: { 518 imgWrapper : { 519 translation : {x: 0, y: -8, z: 0}, 520 rotation : {x: 3, y: 3, z: 0}, 521 reverseAnimation : {duration : 1200, easing : 'easeOutExpo'} 522 }, 523 lines : { 524 translation : {x: 15, y: 15, z: [0,15]}, 525 reverseAnimation : {duration : 1200, easing : 'easeOutExpo'} 526 }, 527 overlay : { 528 translation : {x: 0, y: 8, z: 0}, 529 reverseAnimation : {duration : 600, easing : 'easeOutExpo'} 530 }, 531 caption : { 532 translation : {x: 10, y: -15, z: 0}, 533 reverseAnimation : {duration : 900, easing : 'easeOutExpo'} 534 }, 535 shine : { 536 translation : {x: 50, y: 50, z: 0}, 537 reverseAnimation : {duration : 1200, easing : 'easeOutExpo'} 538 } 539 } 540 }, 541 { 542 movement: { 543 lines : { 544 translation : {x: -5, y: 5, z: 0}, 545 reverseAnimation : {duration : 1000, easing : 'easeOutExpo'} 546 }, 547 caption : { 548 translation : {x: 15, y: 15, z: 0}, 549 rotation : {x: 0, y: 0, z: 3}, 550 reverseAnimation : {duration : 1500, easing : 'easeOutElastic', elasticity : 700} 551 }, 552 overlay : { 553 translation : {x: 15, y: -15, z: 0}, 554 reverseAnimation : {duration : 500,easing : 'easeOutExpo'} 555 }, 556 shine : { 557 translation : {x: 50, y: 50, z: 0}, 558 reverseAnimation : {duration : 500, easing : 'easeOutExpo'} 559 } 560 } 561 }, 562 { 563 movement: { 564 imgWrapper : { 565 translation : {x: 5, y: 5, z: 0}, 566 reverseAnimation : {duration : 800, easing : 'easeOutQuart'} 567 }, 568 caption : { 569 translation : {x: 10, y: 10, z: [0,50]}, 570 reverseAnimation : {duration : 1000, easing : 'easeOutQuart'} 571 }, 572 shine : { 573 translation : {x: 50, y: 50, z: 0}, 574 reverseAnimation : {duration : 800, easing : 'easeOutQuart'} 575 } 576 } 577 }, 578 { 579 movement: { 580 lines : { 581 translation : {x: 40, y: 40, z: 0}, 582 reverseAnimation : {duration : 1500, easing : 'easeOutElastic'} 583 }, 584 caption : { 585 translation : {x: 20, y: 20, z: 0}, 586 rotation : {x: 0, y: 0, z: -5}, 587 reverseAnimation : {duration : 1000, easing : 'easeOutExpo'} 588 }, 589 overlay : { 590 translation : {x: -30, y: -30, z: 0}, 591 rotation : {x: 0, y: 0, z: 3}, 592 reverseAnimation : {duration : 750, easing : 'easeOutExpo'} 593 }, 594 shine : { 595 translation : {x: 100, y: 100, z: 0}, 596 reverseAnimation : {duration : 750, easing : 'easeOutExpo'} 597 } 598 } 599 }]; 600
601 function init() { 602 var idx = 0; 603 [].slice.call(document.querySelectorAll('a.tilter')).forEach(function(el, pos) { 604 idx = pos%2 === 0 ? idx+1 : idx; 605 new TiltFx(el, tiltSettings[idx-1]); 606 }); 607 } 608 609 init(); 610 }); 611 } ); 612 //End execute javascript for distortion grid 613 614 //Start execute javascript for slider horizontal 615 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-distortion-grid.default', function( $scope ) { 616 Array.from(document.querySelectorAll('.distortion_grid_item-img')).forEach((el) => { 617 const imgs = Array.from(el.querySelectorAll('img')); 618 new hoverEffect({ 619 parent: el, 620 intensity: el.dataset.intensity || undefined, 621 speedIn: el.dataset.speedin || undefined, 622 speedOut: el.dataset.speedout || undefined, 623 easing: el.dataset.easing || undefined, 624 hover: el.dataset.hover || undefined, 625 image1: imgs[0].getAttribute('src'), 626 image2: imgs[1].getAttribute('src'), 627 displacementImage: el.dataset.displacement 628 }); 629 }); 630 } ); 631 //End execute javascript for distortion grid 632 633 //Start execute javascript for slider property clip 634 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-slider-property-clip.default', function( $scope ) { 635 jQuery(".tg_slider_property_clip_wrapper").each(function() { 636 var slider = jQuery(this).find(".slider"), 637 slides = slider.find('li'), 638 nav = slider.find('nav'); 639 640 slides.eq(0).addClass('current'); 641 642 nav.children('a').eq(0).addClass('current_dot'); 643 644 nav.on('click', 'a', function(event) { 645 event.preventDefault(); 646 $(this).addClass('current_dot').siblings().removeClass('current_dot'); 647 slides.eq($(this).index()).addClass('current').removeClass('prev').siblings().removeClass('current'); 648 slides.eq($(this).index()).prevAll().addClass('prev'); 649 slides.eq($(this).index()).nextAll().removeClass('prev'); 650 }); 651 }); 652 } ); 653 //End execute javascript for slider property clip 654 655 //Start execute javascript for slider zoom 656 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-slider-zoom.default', function( $scope ) { 657 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; }; }(); 658 659 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 660 661 var $window = $(window); 662 var $body = $('body'); 663 664 var Slideshow = function () { 665 function Slideshow() { 666 var _this = this; 667 668 var userOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 669 670 _classCallCheck(this, Slideshow); 671 672 var timer = $('.slider_zoom_wrapper').attr('data-autoplay'); 673 var autoplay = true; 674 675 if(timer == 0) 676 { 677 timer = false; 678 autoplay = false; 679 } 680 681 var pagination = $('.slider_zoom_wrapper').attr('data-pagination'); 682 if(pagination == 0) 683 { 684 var pagination = false; 685 } 686 else 687 { 688 var pagination = true; 689 } 690 691 var defaultOptions = { 692 $el: $('.slider_zoom_wrapper'),
693 showArrows: false, 694 showPagination: false, 695 duration: timer, 696 autoplay: autoplay 697 }; 698 699 var options = Object.assign({}, defaultOptions, userOptions); 700 701 this.$el = options.$el; 702 this.maxSlide = this.$el.find($('.js-slider-home-slide')).length; 703 this.showArrows = this.maxSlide > 1 ? options.showArrows : false; 704 this.showPagination = pagination; 705 this.currentSlide = 1; 706 this.isAnimating = false; 707 this.animationDuration = 1200; 708 this.autoplaySpeed = options.duration; 709 this.interval; 710 this.$controls = this.$el.find('.js-slider-home-button'); 711 this.autoplay = this.maxSlide > 1 ? options.autoplay : false; 712 713 this.$el.on('click', '.js-slider-home-next', function (event) { 714 return _this.nextSlide(); 715 }); 716 this.$el.on('click', '.js-slider-home-prev', function (event) { 717 return _this.prevSlide(); 718 }); 719 this.$el.on('click', '.js-pagination-item', function (event) { 720 if (!_this.isAnimating) { 721 _this.preventClick(); 722 _this.goToSlide(event.target.dataset.slide); 723 } 724 }); 725 726 this.init(); 727 } 728 729 _createClass(Slideshow, [{ 730 key: 'init', 731 value: function init() { 732 this.goToSlide(1); 733 734 if (this.autoplay) { 735 this.startAutoplay(); 736 } 737 738 if (this.showPagination) { 739 var paginationNumber = this.maxSlide; 740 var pagination = '<div class="pagination"><div class="container">'; 741 742 for (var i = 0; i < this.maxSlide; i++) { 743 var item = '<span class="pagination__item js-pagination-item ' + (i === 0 ? 'is-current' : '') + '" data-slide=' + (i + 1) + '>' + (i + 1) + '</span>'; 744 pagination = pagination + item; 745 } 746 747 pagination = pagination + '</div></div>'; 748 749 this.$el.append(pagination); 750 } 751 } 752 }, { 753 key: 'preventClick', 754 value: function preventClick() { 755 var _this2 = this; 756 757 this.isAnimating = true; 758 this.$controls.prop('disabled', true); 759 clearInterval(this.interval); 760 761 setTimeout(function () { 762 _this2.isAnimating = false; 763 _this2.$controls.prop('disabled', false); 764 if (_this2.autoplay) { 765 _this2.startAutoplay(); 766 } 767 }, this.animationDuration); 768 } 769 }, { 770 key: 'goToSlide', 771 value: function goToSlide(index) { 772 this.currentSlide = parseInt(index); 773 774 if (this.currentSlide > this.maxSlide) { 775 this.currentSlide = 1; 776 } 777 778 if (this.currentSlide === 0) { 779 this.currentSlide = this.maxSlide; 780 } 781 782 var newCurrent = this.$el.find('.js-slider-home-slide[data-slide="' + this.currentSlide + '"]'); 783 var newPrev = this.currentSlide === 1 ? this.$el.find('.js-slider-home-slide').last() : newCurrent.prev('.js-slider-home-slide'); 784 var newNext = this.currentSlide === this.maxSlide ? this.$el.find('.js-slider-home-slide').first() : newCurrent.next('.js-slider-home-slide'); 785 786 this.$el.find('.js-slider-home-slide').removeClass('is-prev is-next is-current'); 787 this.$el.find('.js-pagination-item').removeClass('is-current'); 788 789 if (this.maxSlide > 1) { 790 newPrev.addClass('is-prev'); 791 newNext.addClass('is-next'); 792 } 793 794 newCurrent.addClass('is-current'); 795 this.$el.find('.js-pagination-item[data-slide="' + this.currentSlide + '"]').addClass('is-current'); 796 } 797 }, { 798 key: 'nextSlide', 799 value: function nextSlide() { 800 this.preventClick(); 801 this.goToSlide(this.currentSlide + 1); 802 } 803 }, { 804 key: 'prevSlide', 805 value: function prevSlide() { 806 this.preventClick(); 807 this.goToSlide(this.currentSlide - 1); 808 } 809 }, { 810 key: 'startAutoplay', 811 value: function startAutoplay() { 812 var _this3 = this; 813 814 this.interval = setInterval(function () { 815 if (!_this3.isAnimating) { 816 _this3.nextSlide(); 817 } 818 }, this.autoplaySpeed); 819 } 820 }, { 821 key: 'destroy', 822 value: function destroy() { 823 this.$el.off(); 824 } 825 }]); 826 827 return Slideshow; 828 }(); 829 830 (function () { 831 var loaded = false;
832 var maxLoad = 3000; 833 834 function load() { 835 var options = { 836 showPagination: true 837 }; 838 839 var slideShow = new Slideshow(options); 840 } 841 842 function addLoadClass() { 843 $body.addClass('is-loaded'); 844 845 setTimeout(function () { 846 $body.addClass('is-animated'); 847 }, 600); 848 } 849 850 $window.on('load', function () { 851 if (!loaded) { 852 loaded = true; 853 load(); 854 } 855 }); 856 857 setTimeout(function () { 858 if (!loaded) { 859 loaded = true; 860 load(); 861 } 862 }, maxLoad); 863 864 addLoadClass(); 865 })(); 866 } ); 867 //End execute javascript for slider zoom 868 869 //Start execute javascript for slider parallax 870 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-slider-parallax.default', function( $scope ) { 871 872 var slideshow=jQuery('.slider_parallax_wrapper'); 873 var timer = slideshow.attr('data-autoplay'); 874 var autoplay = true; 875 876 if(timer == 0) 877 { 878 timer = false; 879 autoplay = false; 880 } 881 882 var pagination = slideshow.attr('data-pagination'); 883 if(pagination == 0) 884 { 885 var pagination = false; 886 } 887 else 888 { 889 var pagination = true; 890 } 891 892 var navigation = slideshow.attr('data-navigation'); 893 if(navigation == 0) 894 { 895 var navigation = false; 896 } 897 else 898 { 899 var navigation = true; 900 } 901 902 var slideshowDuration = timer; 903 904 function slideshowSwitch(slideshow,index,auto){ 905 if(slideshow.data('wait')) return; 906 907 var slides = slideshow.find('.slide'); 908 var pages = slideshow.find('.pagination'); 909 var activeSlide = slides.filter('.is-active'); 910 var activeSlideImage = activeSlide.find('.image-container'); 911 var newSlide = slides.eq(index); 912 var newSlideImage = newSlide.find('.image-container'); 913 var newSlideContent = newSlide.find('.slide-content'); 914 var newSlideElements=newSlide.find('.caption > *'); 915 if(newSlide.is(activeSlide))return; 916 917 newSlide.addClass('is-new'); 918 var timeout=slideshow.data('timeout'); 919 clearTimeout(timeout); 920 slideshow.data('wait',true); 921 var transition=slideshow.attr('data-transition'); 922 if(transition=='fade'){ 923 newSlide.css({ 924 display:'block', 925 zIndex:2 926 }); 927 newSlideImage.css({ 928 opacity:0 929 }); 930 931 TweenMax.to(newSlideImage,1,{ 932 alpha:1, 933 onComplete:function(){ 934 newSlide.addClass('is-active').removeClass('is-new'); 935 activeSlide.removeClass('is-active'); 936 newSlide.css({display:'',zIndex:''}); 937 newSlideImage.css({opacity:''}); 938 slideshow.find('.pagination').trigger('check'); 939 slideshow.data('wait',false); 940 if(auto){ 941 timeout=setTimeout(function(){ 942 slideshowNext(slideshow,false,true); 943 },slideshowDuration); 944 slideshow.data('timeout',timeout);}}}); 945 } else { 946 if(newSlide.index()>activeSlide.index()){ 947 var newSlideRight=0; 948 var newSlideLeft='auto'; 949 var newSlideImageRight=-slideshow.width()/8; 950 var newSlideImageLeft='auto'; 951 var newSlideImageToRight=0; 952 var newSlideImageToLeft='auto'; 953 var newSlideContentLeft='auto'; 954 var newSlideContentRight=0; 955 var activeSlideImageLeft=-slideshow.width()/4; 956 } else { 957 var newSlideRight=''; 958 var newSlideLeft=0; 959 var newSlideImageRight='auto'; 960 var newSlideImageLeft=-slideshow.width()/8; 961 var newSlideImageToRight=''; 962 var newSlideImageToLeft=0; 963 var newSlideContentLeft=0; 964 var newSlideContentRight='auto'; 965 var activeSlideImageLeft=slideshow.width()/4; 966 } 967 968 newSlide.css({ 969 display:'block', 970 width:0, 971 right:newSlideRight, 972 left:newSlideLeft 973 ,zIndex:2 974 }); 975 976 newSlideImage.css({ 977 width:slideshow.width(), 978 right:newSlideImageRight, 979 left:newSlideImageLeft 980 }); 981 982 newSlideContent.css({ 983 width:slideshow.width(), 984 left:newSlideContentLeft,
985 right:newSlideContentRight 986 }); 987 988 activeSlideImage.css({ 989 left:0 990 }); 991 992 TweenMax.set(newSlideElements,{y:20,force3D:true}); 993 TweenMax.to(activeSlideImage,1,{ 994 left:activeSlideImageLeft, 995 ease:Power3.easeInOut 996 }); 997 998 TweenMax.to(newSlide,1,{ 999 width:slideshow.width(), 1000 ease:Power3.easeInOut 1001 }); 1002 1003 TweenMax.to(newSlideImage,1,{ 1004 right:newSlideImageToRight, 1005 left:newSlideImageToLeft, 1006 ease:Power3.easeInOut 1007 }); 1008 1009 TweenMax.staggerFromTo(newSlideElements,0.8,{alpha:0,y:60},{alpha:1,y:0,ease:Power3.easeOut,force3D:true,delay:0.6},0.1,function(){ 1010 newSlide.addClass('is-active').removeClass('is-new'); 1011 activeSlide.removeClass('is-active'); 1012 newSlide.css({ 1013 display:'', 1014 width:'', 1015 left:'', 1016 zIndex:'' 1017 }); 1018 1019 newSlideImage.css({ 1020 width:'', 1021 right:'', 1022 left:'' 1023 }); 1024 1025 newSlideContent.css({ 1026 width:'', 1027 left:'' 1028 }); 1029 1030 newSlideElements.css({ 1031 opacity:'', 1032 transform:'' 1033 }); 1034 1035 activeSlideImage.css({ 1036 left:'' 1037 }); 1038 1039 slideshow.find('.pagination').trigger('check'); 1040 slideshow.data('wait',false); 1041 if(auto){ 1042 timeout=setTimeout(function(){ 1043 slideshowNext(slideshow,false,true); 1044 },slideshowDuration); 1045 slideshow.data('timeout',timeout); 1046 } 1047 }); 1048 } 1049 } 1050 1051 function slideshowNext(slideshow,previous,auto){ 1052 var slides=slideshow.find('.slide'); 1053 var activeSlide=slides.filter('.is-active'); 1054 var newSlide=null; 1055 if(previous){ 1056 newSlide=activeSlide.prev('.slide'); 1057 if(newSlide.length === 0) { 1058 newSlide=slides.last(); 1059 } 1060 } else { 1061 newSlide=activeSlide.next('.slide'); 1062 if(newSlide.length==0) 1063 newSlide=slides.filter('.slide').first(); 1064 } 1065 1066 slideshowSwitch(slideshow,newSlide.index(),auto); 1067 } 1068 1069 function homeSlideshowParallax(){ 1070 var scrollTop=jQuery(window).scrollTop(); 1071 if(scrollTop>windowHeight) return; 1072 var inner=slideshow.find('.slideshow-inner'); 1073 var newHeight=windowHeight-(scrollTop/2); 1074 var newTop=scrollTop*0.8; 1075 1076 inner.css({ 1077 transform:'translateY('+newTop+'px)',height:newHeight 1078 }); 1079 } 1080 1081 jQuery(document).ready(function() { 1082 jQuery('.slider_parallax_wrapper .slide').addClass('is-loaded'); 1083 1084 jQuery('.slider_parallax_wrapper .arrows .arrow').on('click',function(){ 1085 slideshowNext(jQuery(this).closest('.slider_parallax_wrapper'),jQuery(this).hasClass('prev')); 1086 }); 1087 1088 jQuery('.slider_parallax_wrapper .pagination .item').on('click',function(){ 1089 slideshowSwitch(jQuery(this).closest('.slider_parallax_wrapper'),jQuery(this).index()); 1090 }); 1091 1092 jQuery('.slider_parallax_wrapper .pagination').on('check',function(){ 1093 var slideshow=jQuery(this).closest('.slider_parallax_wrapper'); 1094 var pages=jQuery(this).find('.item'); 1095 var index=slideshow.find('.slider_parallax_slides .is-active').index(); 1096 pages.removeClass('is-active'); 1097 pages.eq(index).addClass('is-active'); 1098 }); 1099 1100 if(autoplay) 1101 { 1102 var timeout=setTimeout(function(){ 1103 slideshowNext(slideshow,false,true); 1104 },slideshowDuration); 1105 1106 slideshow.data('timeout',timeout); 1107 } 1108 }); 1109 } ); 1110 //End execute javascript for slider parallax 1111 1112 1113 //Start execute javascript for navigation menu 1114 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-navigation-menu.default', function( $scope ) { 1115 jQuery('.tg_navigation_wrapper .nav li.menu-item').hover(function() 1116 { 1117 jQuery(this).children('ul:first').addClass('visible'); 1118 jQuery(this).children('ul:first').addClass('hover'); 1119 }, 1120 function() 1121 { 1122 jQuery(this).children('ul:first').removeClass('visible'); 1123 jQuery(this).children('ul:first').removeClass('hover'); 1124 }); 1125 1126 jQuery('.tg_navigation_wrapper .nav li.menu-item').children('ul:first.hover').hover(function() 1127 { 1128 jQuery(this).stop().addClass('visible'); 1129 }, 1130 function() 1131 { 1132 jQuery(this).stop().removeClass('visible'); 1133 }); 1134 } ); 1135 //End execute javascript for navigation menu 1136 1137 //Start execute javascript for mouse driven vertical carousel
1138 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-mouse-driven-vertical-carousel.default', function( $scope ) { 1139 1140 class VerticalMouseDrivenCarousel { 1141 constructor(options = {}) { 1142 const _defaults = { 1143 carousel: ".tg_mouse_driven_vertical_carousel_wrapper .js-carousel", 1144 bgImg: ".js-carousel-bg-img", 1145 list: ".js-carousel-list", 1146 listItem: ".js-carousel-list-item" 1147 }; 1148 1149 this.posY = 0; 1150 1151 this.defaults = Object.assign({}, _defaults, options); 1152 1153 this.initCursor(); 1154 this.init(); 1155 this.bgImgController(); 1156 } 1157 1158 //region getters 1159 getBgImgs() { 1160 return document.querySelectorAll(this.defaults.bgImg); 1161 } 1162 1163 getListItems() { 1164 return document.querySelectorAll(this.defaults.listItem); 1165 } 1166 1167 getList() { 1168 return document.querySelector(this.defaults.list); 1169 } 1170 1171 getCarousel() { 1172 return document.querySelector(this.defaults.carousel); 1173 } 1174 1175 init() { 1176 TweenMax.set(this.getBgImgs(), { 1177 autoAlpha: 0, 1178 scale: 1.05 1179 }); 1180 1181 TweenMax.set(this.getBgImgs()[0], { 1182 autoAlpha: 1, 1183 scale: 1 1184 }); 1185 1186 this.listItems = this.getListItems().length - 1; 1187 1188 this.listOpacityController(0); 1189 } 1190 1191 initCursor() { 1192 //Init only on desktop device 1193 if(jQuery(window).width()>1024) 1194 { 1195 const listHeight = this.getList().clientHeight; 1196 const carouselHeight = this.getCarousel().clientHeight; 1197 const carouselPos = this.getCarousel().getBoundingClientRect(); 1198 const carouselPosY = parseInt(carouselPos.top); 1199 1200 this.getCarousel().addEventListener( 1201 "mousemove", 1202 event => { 1203 this.posY = parseInt(event.pageY - carouselPosY) - this.getCarousel().offsetTop; 1204 let offset = -this.posY / carouselHeight * listHeight; 1205 1206 TweenMax.to(this.getList(), 0.3, { 1207 y: offset, 1208 ease: Power4.easeOut 1209 }); 1210 }, 1211 false 1212 ); 1213 } 1214 } 1215 1216 bgImgController() { 1217 for (const link of this.getListItems()) { 1218 link.addEventListener("mouseenter", ev => { 1219 let currentId = ev.currentTarget.dataset.itemId; 1220 1221 this.listOpacityController(currentId); 1222 1223 TweenMax.to(ev.currentTarget, 0.3, { 1224 autoAlpha: 1 1225 }); 1226 1227 TweenMax.to(".is-visible", 0.2, { 1228 autoAlpha: 0, 1229 scale: 1.05 1230 }); 1231 1232 if (!this.getBgImgs()[currentId].classList.contains("is-visible")) { 1233 this.getBgImgs()[currentId].classList.add("is-visible"); 1234 } 1235 1236 TweenMax.to(this.getBgImgs()[currentId], 0.6, { 1237 autoAlpha: 1, 1238 scale: 1 1239 }); 1240 }); 1241 } 1242 } 1243 1244 listOpacityController(id) { 1245 id = parseInt(id); 1246 let aboveCurrent = this.listItems - id; 1247 let belowCurrent = parseInt(id); 1248 1249 if (aboveCurrent > 0) { 1250 for (let i = 1; i <= aboveCurrent; i++) { 1251 let opacity = 0.5 / i; 1252 let offset = 5 * i; 1253 TweenMax.to(this.getListItems()[id + i], 0.5, { 1254 autoAlpha: opacity, 1255 x: offset, 1256 ease: Power3.easeOut 1257 }); 1258 } 1259 } 1260 1261 if (belowCurrent > 0) { 1262 for (let i = 0; i <= belowCurrent; i++) { 1263 let opacity = 0.5 / i; 1264 let offset = 5 * i; 1265 TweenMax.to(this.getListItems()[id - i], 0.5, { 1266 autoAlpha: opacity, 1267 x: offset, 1268 ease: Power3.easeOut 1269 }); 1270 } 1271 } 1272 } 1273 } 1274 1275 new VerticalMouseDrivenCarousel(); 1276 1277 } ); 1278 //End execute javascript for mouse driven vertical carousel 1279 1280 //Start execute javascript for synchronized carousel slider 1281 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-slider-synchronized-carousel.default', function( $scope ) { 1282 1283 jQuery(".tg_synchronized_carousel_slider_wrapper").each(function() { 1284 var sliderID = jQuery(this).attr('id'); 1285 var slidersContainer = document.querySelector("#"+sliderID); 1286 var countSlide = jQuery(this).attr('data-countslide'); 1287 1288 // Initializing the numbers slider 1289 var msNumbers = new MomentumSlider({ 1290 el: slidersContainer, 1291 cssClass: "ms--numbers", 1292 range: [1, countSlide], 1293 rangeContent: function (i) { 1294 return "0" + i; 1295 }, 1296 style: { 1297 transform: [{scale: [0.4, 1]}], 1298 opacity: [0, 1] 1299 }, 1300 interactive: false 1301 }); 1302
1303 var titles = JSON.parse(jQuery(this).attr('data-slidetitles')); 1304 1305 var msTitles = new MomentumSlider({ 1306 el: slidersContainer, 1307 cssClass: "ms--titles", 1308 range: [0, parseInt(countSlide-1)], 1309 rangeContent: function (i) { 1310 return "<h3>"+ titles[i] +"</h3>"; 1311 }, 1312 vertical: true, 1313 reverse: true, 1314 style: { 1315 opacity: [0, 1] 1316 }, 1317 interactive: false 1318 }); 1319 1320 var buttonTitles = JSON.parse(jQuery(this).attr('data-slidebuttontitles')); 1321 var buttonUrls = JSON.parse(jQuery(this).attr('data-slidebuttonurls')); 1322 1323 // Initializing the links slider 1324 var msLinks = new MomentumSlider({ 1325 el: slidersContainer, 1326 cssClass: "ms--links", 1327 range: [0, parseInt(countSlide-1)], 1328 rangeContent: function (i) { 1329 return "<a href=\""+buttonUrls[i]+"\" class=\"ms-slide__link\">"+buttonTitles[i]+"</a>"; 1330 }, 1331 vertical: true, 1332 interactive: false 1333 }); 1334 1335 // Get pagination items 1336 var paginationID = jQuery(this).attr('data-pagination'); 1337 var pagination = document.querySelector("#"+paginationID); 1338 var paginationItems = [].slice.call(pagination.children); 1339 1340 var images = JSON.parse(jQuery(this).attr('data-slideimages')); 1341 1342 // Initializing the images slider 1343 var msImages = new MomentumSlider({ 1344 // Element to append the slider 1345 el: slidersContainer, 1346 // CSS class to reference the slider 1347 cssClass: "ms--images", 1348 // Generate the 4 slides required 1349 range: [0, parseInt(countSlide-1)], 1350 rangeContent: function (i) { 1351 return "<div class=\"ms-slide__image-container\"><div class=\"ms-slide__image\" style=\"background-image: url('"+images[i]+"')\"></div></div>"; 1352 }, 1353 // Syncronize the other sliders 1354 sync: [msNumbers, msTitles, msLinks], 1355 // Styles to interpolate as we move the slider 1356 style: { 1357 ".ms-slide__image": { 1358 transform: [{scale: [1.5, 1]}] 1359 } 1360 }, 1361 // Update pagination if slider change 1362 change: function(newIndex, oldIndex) { 1363 if (typeof oldIndex !== "undefined") { 1364 paginationItems[oldIndex].classList.remove("pagination__item--active"); 1365 } 1366 paginationItems[newIndex].classList.add("pagination__item--active"); 1367 } 1368 }); 1369 1370 pagination.addEventListener("click", function(e) { 1371 if (e.target.matches(".pagination__button")) { 1372 var index = paginationItems.indexOf(e.target.parentNode); 1373 msImages.select(index); 1374 } 1375 }); 1376 }); 1377 1378 } ); 1379 //End execute javascript for synchronized carousel slider 1380 1381 //Start execute javascript for flip box 1382 elementorFrontend.hooks.addAction( 'frontend/element_ready/hoteller-flip-box.default', function( $scope ) { 1383 1384 var countSquare = jQuery('.square').length; 1385 1386 //For each Square found add BG image 1387 for (i = 0; i < countSquare; i++) { 1388 var firstImage = jQuery('.square').eq([i]); 1389 var secondImage = jQuery('.square2').eq([i]); 1390 1391 var getImage = firstImage.attr('data-image'); 1392 var getImage2 = secondImage.attr('data-image'); 1393 1394 firstImage.css('background-image', 'url(' + getImage + ')'); 1395 secondImage.css('background-image', 'url(' + getImage2 + ')'); 1396 } 1397 1398 jQuery('.tg_flip_box_wrapper').on('click', function() { 1399 jQuery(this).trigger("mouseover"); 1400 }); 1401 1402 1403 } ); 1404 //End execute javascript for flip box 1405 1406 } ); 1407 1408} )( 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.