1(async () => { 2 3 var UIElement = (function () { 4 var DOMElem = { 5 recentViewBtn: '#recent-views-button', 6 recentViewBtnClose: '#recent-views-close', 7 mobileMenuBtn: '#mobile-menu-btn', 8 slideDownBtn: '.button-slide-down', 9 modalContent: '.modal-popup', 10 browseEstateBtn: '#browseEstate', 11 bookWalkThroughBtn: '#bookWalkthrough', 12 homesDropDown: '.estate-items-holder .homes-holder', 13 navTabMenu: '.navTabMenuItem', 14 navTabContent: '.navTabContent', 15 grid: '.grid', 16 displayBox: '.display-homes-box', 17 buttonViewType: '.button-view-type', 18 cssSlider: '.css-slider', 19 goToTopMore: '.button-go-top' 20 }; 21 22 return { 23 getDOMElem: function () { 24 return DOMElem; 25 } 26 } 27 })(); 28 29 var UIController = (function ($, ui) { 30 var dom = ui.getDOMElem(); 31 32 var windowLoad = function () { 33 $(window).on('load', async function () { 34 let fullHash = window.location.hash 35 36 function activateContactFormByTrigger($trigger) { 37 if (!$trigger || !$trigger.length) { 38 return; 39 } 40 41 const target = $trigger.data('target'); 42 if (!target) { 43 return; 44 } 45 46 $('.contact-form-trigger.active').removeClass('active'); 47 $trigger.addClass('active'); 48 49 $('.contact-forms .contact-form.active').removeClass('active').hide(); 50 const $targetForm = $('#' + target); 51 if ($targetForm.length) { 52 $targetForm.addClass('active').show(); 53 } 54 } 55 56 function scrollToContactFormBlock() { 57 const $contactFormBlock = $('#contactFormBlock'); 58 if (!$contactFormBlock.length) { 59 return; 60 } 61 62 const offset = 100; 63 $('html, body').animate({ 64 scrollTop: $contactFormBlock.offset().top - offset, 65 }, 400); 66 } 67 68 const hashClass = fullHash.replace(/#/g, ""); 69 if (fullHash && /^[a-zA-Z0-9_-]+$/.test(hashClass) && $("." + hashClass).length) { 70 const $hashTrigger = $(`.contact-hash-event#${hashClass}, .contact-hash-event.${hashClass}`).first(); 71 activateContactFormByTrigger($hashTrigger); 72 scrollToContactFormBlock(); 73 window.setTimeout(scrollToContactFormBlock, 250); 74 } 75 else{ 76 //$('.contact-hash-event').first().click(); 77 } 78 79 }); 80 81 const urlParams = new URLSearchParams(window.location.search); 82 const blockID = urlParams.get('blockID'); 83 84 if (blockID) { 85 const targetClass = `.jump-${blockID}`; 86 const $target = $(targetClass); 87 88 if ($target.length) { 89 const isMobile = window.innerWidth <= 767; 90 const offset = isMobile ? 100 : 110; 91 const offsetTop = $target.offset().top - offset; 92 93 $('html, body').animate({ 94 scrollTop: offsetTop 95 }, 600); 96 } 97 } 98 99 if ($('.announcement-bar').hasClass('active')) { 100 $('header').addClass('withAnnouncementBar'); 101 } else { 102 $('header').removeClass('withAnnouncementBar'); 103 } 104 105 106 if ($('.homepage-video-overlay').length) { 107 setTimeout(function () { 108 $('.homepage-video-overlay').fadeOut(600); 109 }, 5000); 110 } 111 112 if (window.innerWidth > 767) { 113 $('.our-partner-content').matchHeight({ 114 byRow: true 115 }); 116 $('.facade-address').matchHeight({ 117 byRow: false 118 }); 119 $('.facade-title').matchHeight({ 120 byRow: false 121 }); 122 $('.virtualtour-address').matchHeight({ 123 byRow: false 124 }); 125 $('.virtualtour-title').matchHeight({ 126 byRow: false 127 }); 128 $('.office-location').matchHeight({ 129 byRow: false 130 }); 131 $('.mhb').matchHeight({ 132 byRow: false 133 }); 134 $('.news-item .image-holder').matchHeight({ 135 byRow: true 136 }); 137 $('.news-item .details .title').matchHeight({ 138 byRow: true 139 }); 140 $('.news-item .details .title').matchHeight({ 141 byRow: true 142 }); 143 } 144 145 $('.news-item .title').matchHeight({ 146 byRow: true, 147 property: 'height', 148 target: null, 149 remove: false 150 }); 151 152 const homedesignslisttabsfloorplantabcontenttabcontent = 153 $('.home-designs-list__tabs .floorplan-tab-content .tab-content'); 154 if (homedesignslisttabsfloorplantabcontenttabcontent.length) { 155 homedesignslisttabsfloorplantabcontenttabcontent.matchHeight({ 156 byRow: false, 157 property: 'height', 158 target: null, 159 remove: false 160 }); 161 } 162 const homedesignslisttabs = $('.home-designs-list__tabs'); 163 if (homedesignslisttabs.length) { 164 homedesignslisttabs.matchHeight({ 165 byRow: false, 166 property: 'height', 167 target: null, 168 remove: false 169 }); 170 } 171 172 $('.home-designs-list__item .home-designs-list__content .name-holder').matchHeight({ 173 byRow: true, 174 property: 'height', 175 target: null, 176 remove: false 177 }); 178 179 $('.home-designs-list__item .hal__address').matchHeight({ 180 byRow: false, 181 property: 'height', 182 target: null, 183 remove: false 184 }); 185 186 $('.display-centres-list-item .name').matchHeight({ 187 byRow: false, 188 property: 'height', 189 target: null, 190 remove: false 191 }); 192 $('.display-centres-list-item .info').matchHeight({ 193 byRow: false, 194 property: 'height', 195 target: null, 196 remove: false 197 }); 198 $('.display-centres-list-item .address-hours').matchHeight({ 199 byRow: false, 200 property: 'height', 201 target: null, 202 remove: false 203 }); 204 205 $('.display-centres-list-item .details-holder').matchHeight({ 206 byRow: false, 207 property: 'height', 208 target: null, 209 remove: false 210 }); 211 $('.display-homes-item .details-holder').matchHeight({ 212 byRow: false, 213 property: 'height', 214 target: null, 215 remove: false 216 }); 217 218 $('.display-homes-item .details-holder .info').matchHeight({ 219 byRow: false, 220 property: 'height', 221 target: null, 222 remove: false 223 }); 224 $('.display-homes-item .details-holder .address-hours').matchHeight({ 225 byRow: false, 226 property: 'height', 227 target: null, 228 remove: false 229 }); 230 231 if (window.innerWidth < 768) { 232 const $closeMapPreview = $('.close-map-preview'); 233 if ($closeMapPreview.length) { 234 $closeMapPreview.html('Open map').addClass('active'); 235 var mapBlock = $('.fullwidth-map-block'); 236 mapBlock.attr('style', 'display: none;'); 237 } 238 } 239 240 if (window.innerWidth > 767) { 241 $('.blog-list .blog-list-item').matchHeight({ 242 byRow: true 243 }); 244 } 245 246 247 $('.favourites__tabs .floorplan-svg').matchHeight({ 248 byRow: true, 249 property: 'height', 250 target: null, 251 remove: false 252 }); 253 $('.favourites__tabs .room-demensions-block').matchHeight({ 254 byRow: false, 255 property: 'height', 256 target: null, 257 remove: false 258 }); 259 $('.favourites__tabs .block-demensions-block').matchHeight({ 260 byRow: false, 261 property: 'height', 262 target: null, 263 remove: false 264 }); 265 $('.favourites__tabs .floorplan-demensions-block').matchHeight({ 266 byRow: false, 267 property: 'height', 268 target: null, 269 remove: false 270 }); 271 $('.home-designs-list__item .hal__address').matchHeight({ 272 byRow: false, 273 property: 'height', 274 target: null, 275 remove: false 276 }); 277 }; 278 279 var windowScroll = function () { 280 $(window).on('scroll', function () { 281 initStickyFilter(); 282 initStickyHeader(); 283 284 var scrollPositionCta = window.scrollY; 285 var ctaContainer = $('.floatingCta'); 286 if (ctaContainer.length) { 287 var showCtaContainer = document.getElementById('showFloating
287Cta'); 288 289 if (scrollPositionCta >= showCtaContainer.offsetTop) { 290 ctaContainer.addClass("active"); 291 } else { 292 ctaContainer.removeClass("active"); 293 } 294 } 295 }) 296 } 297 298 var onWindowResize = function () { 299 $(window).on('resize', function () { 300 301 }) 302 }; 303 304 var slickSlider = function (elem, options) { 305 $(elem).slick(options) 306 }; 307 var unslickSlider = function (elem) { 308 const $elem = $(elem); 309 if ($elem.hasClass('slick-initialized')) { 310 $elem.slick('unslick'); 311 } 312 }; 313 314 var chosenSelect = function (elem) { 315 $(elem).chosen({ 316 disable_search_threshold: 10, 317 search_contains: true 318 }); 319 320 setTimeout(function () { 321 if ($('.mapSearchBlock input[type="text"]').length) { 322 $('.mapSearchBlock input[type="text"]').on('keyup', function (e) { 323 if ($(this).val().length) { 324 $('.mapSearchBlock').addClass('active'); 325 } else { 326 $('.mapSearchBlock').removeClass('active'); 327 } 328 }); 329 } 330 }, 1000); 331 } 332 333 var sameHeight = function (elem) { 334 if (window.innerWidth > 767) { 335 $(elem).matchHeight({ 336 byRow: false 337 }); 338 } 339 }; 340 341 var sameHeightByRow = function (elem) { 342 $(elem).matchHeight({ 343 byRow: true 344 }); 345 }; 346 347 var modalFade = function (elem, callback, json) { 348 const $elem = $(elem); 349 $elem.modal({ 350 fadeDuration: 200 351 }); 352 if (typeof callback == 'function') { 353 callback($elem, json); 354 } 355 }; 356 357 //Click Events 358 var clickEvents = function () { 359 const stickyHeader = $('#stickyHeader'); 360 $('.js-hide-announcement').on('click', function (e) { 361 e.preventDefault(); 362 $('.announcement-bar').removeClass('active'); 363 $('header').removeClass('withAnnouncementBar'); 364 }); 365 366 $(document).on('click', '.js-scroll-to-form', function (e) { 367 const form = $('.forms-block').first(); 368 if (!form.length) { 369 return; 370 } 371 $('html, body').animate({ 372 scrollTop: form.offset().top - (stickyHeader.outerHeight() || 0) 373 }); 374 e.preventDefault(); 375 }); 376 377 window.addEventListener('click', function (e) { 378 document.querySelectorAll('.dropdown').forEach(function (dropdown) { 379 if (!dropdown.contains(e.target)) { 380 // Click was outside the dropdown, close it 381 dropdown.open = false; 382 } 383 }); 384 }); 385 $('.contact-form-trigger').on('click', function () { 386 var target = $(this).data('target'); 387 var trigger = $(this); 388 var time = 0; 389 if (trigger.hasClass('active')) { 390 trigger.removeClass('active'); 391 $('#' + target).removeClass('active').slideUp(); 392 } else { 393 if ($('.contact-forms .contact-form.active').length) { 394 time = 500; 395 } 396 $('.contact-forms .contact-form.active').removeClass('active').slideUp(); 397 $('.contact-form-trigger.active').removeClass('active'); 398 setTimeout(function () { 399 trigger.toggleClass('active'); 400 $('#' + target).addClass('active').slideDown(); 401 }, time); 402 } 403 }); 404 405 $('.recently-viewed .trigger').on('click', function () { 406 $(this).toggleClass('active');
407 $('.sub-menu-holder').removeClass('active'); 408 $('header').toggleClass('recently-viewed-open'); 409 $('.recently-viewed-holder').slideToggle(); 410 }); 411 412 $('.recently-viewed-holder .close').on('click', function () { 413 $('header').toggleClass('recently-viewed-open'); 414 $('.recently-viewed-holder').slideToggle(); 415 }); 416 417 $('.js-star:not(.favourites-toggle-button):not(.scale-75)').on('click', function (e) { 418 e.preventDefault(); 419 $(this).toggleClass('active'); 420 }); 421 422 $('.js-show-response').on('click', function (e) { 423 e.preventDefault(); 424 $('.modal-content.form-content').addClass('hide'); 425 $('.modal-content.thankyou-content').removeClass('hide'); 426 }); 427 428 $('.js-close-enquire-modal').on('click', function (e) { 429 e.preventDefault(); 430 $('.modal-close').click() 431 }); 432 433 $('.show-enquire-modal').on('click', function (e) { 434 e.preventDefault(); 435 $('#enquire_modal .modal-content.form-content').removeClass('hide'); 436 $('#enquire_modal .modal-content.thankyou-content').addClass('hide'); 437 }); 438 439 $('.show-display-homes-modal').on('click', function (e) { 440 e.preventDefault(); 441 $('#display_homes_modal .modal-content.form-content').removeClass('hide'); 442 $('#display_homes_modal .modal-content.thankyou-content').addClass('hide'); 443 }); 444 445 $('.enquire-form button').on('click', function (e) { 446 e.preventDefault(); 447 $('.enquire-form').addClass('hide'); 448 $('.enquire-form-response').removeClass('hide'); 449 }); 450 451 $('.enquire-side-bar-holder').click(function (event) { 452 if (event.target.className === 'enquire-side-bar-holder active') { 453 $('.enquire-side-bar-holder').removeClass('active'); 454 $("html, body").removeClass('no-scroll'); 455 $("html, body").removeClass('with-overlay'); 456 } 457 }) 458 459 $('.enquire-side-bar .close-side-bar img').on('click', function () { 460 $('.enquire-side-bar-holder').removeClass('active'); 461 $("html, body").removeClass('no-scroll'); 462 $("html, body").removeClass('with-overlay'); 463 }); 464 465 $('.open-side-bar').on('click', function () { 466 $('.enquire-form').removeClass('hide'); 467 $('.enquire-form-response').addClass('hide'); 468 $('.enquire-side-bar-holder').addClass('active'); 469 $("html, body").addClass('no-scroll'); 470 $("html, body").addClass('with-overlay'); 471 }); 472 473 const $floorPlanTabControl = $('.floorplan-tab-control:not(.style-only)'); 474 if ($floorPlanTabControl.length) { 475 initHomeDesignsFacadeSlider(); 476 $floorPlanTabControl.find('.tab-control').on('click', function (e) { 477 e.preventDefault(); 478 var target = $(this).data('target'); 479 $(this).parent('.floorplan-tab-control').find('.tab-control').removeClass('active'); 480 $(this).parent('.floorplan-tab-control').next('.floorplan-tab-content').find('.tab-content').removeClass('active'); 481 $(this).addClass('active'); 482 $(this).parent('.floorplan-tab-control').next('.floorplan-tab-content').find('#' + target).addClass('active'); 483 initHomeDesignsFacadeSlider(); 484 }); 485 } 486 487 $('.tabset .tab-controls label').each((index, element) => { 488 const $this = $(element); 489 const tabState = { 490 disabled: false 491 }; 492 $this.on('click', function (e) { 493 e.preventDefault(); 494 if (tabState.disabled) { 495 return; 496 } 497 var target = $this.data('target');
498 $('.tabset .tab-controls label').removeClass('active'); 499 $('.tab-panels section').removeClass('active'); 500 $this.addClass('active'); 501 const $targetTabPanel = $('.tab-panels #' + target); 502 $targetTabPanel.addClass('active'); 503 $targetTabPanel.get(0).dispatchEvent(new CustomEvent('tabShown', { 504 detail: { tabState } 505 })); 506 507 if ($('.dh-tabset').length) { 508 $targetTabPanel.find('.dh-tab-control').removeClass('active'); 509 $targetTabPanel.find('.dh-tab-panel').removeClass('active'); 510 $targetTabPanel.find('.dh-tab-control:first-child').addClass('active'); 511 $targetTabPanel.find('.dh-tab-panel:first-child').addClass('active'); 512 513 if (window.innerWidth < 1024) { 514 $('.dh-tabset .dh-tab-controls').slick({ 515 adaptiveHeight: true, 516 variableWidth: true, 517 slidesToScroll: 1, 518 swipe: true, 519 infinite: false, 520 swipeToSlide: true, 521 dots: false, 522 arrows: false 523 }); 524 } 525 } 526 }); 527 }); 528 529 $('.home-designs-list__tabs .tab-item').on('click', function (e) { 530 e.preventDefault(); 531 var target = $(this).data('target'); 532 $(this).parent('.tab-list').find('.tab-item').removeClass('active'); 533 $(this).parent('.tab-list').parent('.home-designs-list__tabs').find('.tab-item-content').removeClass('active'); 534 $(this).addClass('active'); 535 $(this).parent('.tab-list').parent('.home-designs-list__tabs').find('.tab-item-content.' + target).addClass('active'); 536 initFacadeSlider(); 537 initHomeDesignsFacadeSlider(); 538 }); 539 540 $('.favourites__tabs:not(.style-only) .tab-item').on('click', function (e) { 541 e.preventDefault(); 542 var target = $(this).data('target'); 543 $(this).parent('.tab-list').find('.tab-item').removeClass('active'); 544 $(this).parent('.tab-list').parent('.favourites__tabs').find('.tab-item-content').removeClass('active'); 545 $(this).addClass('active'); 546 $(this).parent('.tab-list').parent('.favourites__tabs').find('.tab-item-content.' + target).addClass('active'); 547 initFacadeSlider(); 548 initHomeDesignsFacadeSlider(); 549 }); 550 551 // menu 552 $headerWithSubmenu = $('header .header-bottom .links .with-submenu'); 553 $headerWithSubmenu.on('mouseover', function () { 554 $(this).addClass('active'); 555 $(".main-holder").addClass('submenu-overlay'); 556 $(".footer-holder").addClass('submenu-overlay'); 557 }); 558 $headerWithSubmenu.on('mouseout', function () { 559 $(this).removeClass('active'); 560 $(".main-holder").removeClass('submenu-overlay'); 561 $(".footer-holder").removeClass('submenu-overlay'); 562 }); 563 564 $('.main-menu.with-sub-menu .main-link').on('click', function (e) { 565 e.preventDefault(); 566 $(this).parent('.with-sub-menu').toggleClass('active'); 567 $(this).next('.sub-menu').slideToggle(); 568 }); 569 570 const sideBarMenu = document.getElementById('sidebar-menu') 571 if (sideBarMenu) { 572 sideBarMenu.addEventListener('change', (event) => { 573 $("html, body").toggleClass('no-scroll'); 574 }) 575 } 576 577 const $rangeItem = $('.range-item:not(.hb-filter-checkbox)'); 578 if ($rangeItem.length) { 579 $rangeItem.on('click', function () { 580 $(this).toggleClass('active'); 581 }); 582 } 583 584 $('.js-toggle-filter').on('click', function () { 585 $(this).toggleClass('active'); 586 $('.bottom-filter').slideToggle(); 587 }); 588 589 $('.js-toggle-filter-mobile').on('click', function () { 590 $('.mobile-filter').slideToggle(); 591 }); 592 593 $('.js-toggle-filter-mobile-1').on('click', function () { 594 $('.mobile-filter').slideToggle(); 595 $('.js-toggle-mobile-filter').toggleClass('active'); 596 }); 597 598 $('.js-toggle-mobile-filter').on('click', function () { 599 $(this).toggleClass('active'); 600 $('.mobile-home-filter').toggleClass('active'); 601 $('.mobile-filter').slideToggle(); 602 }); 603 604 $('.close-home-preview').on('click', function () { 605 var preview = $(this).parent('.col-span-12').parent('.row').parent('.col-span-12').parent('.home-preview').parent('.home-preview-holder').parent('.home-designs-preview'); 606 // preview.toggleClass('active'); 607 // // $(this).parent('.column').parent('.floorplan-blocks').parent('.column').parent('.row').parent('.home-preview-holder').parent('.home-designs-preview').slideToggle(); 608 // preview.find('.js-toggle-preview').removeClass('disabled'); 609 var time = 0; 610 $('.home-designs-preview').css('min-height', '0'); 611 if (preview.hasClass('active')) { 612 preview.removeClass('active'); 613 } else { 614 if ($('.home-designs-preview.active').length) { 615 time = 500; 616 } 617 $('.home-designs-preview.active').removeClass('active'); 618 $('.js-toggle-preview').removeClass('disabled'); 619 setTimeout(function () { 620 preview.toggleClass('active'); 621 var minHValue = '912px'; 622 if (window.innerWidth < 768) { 623 minHValue = '360px'; 624 } 625 $('.home-designs-preview.active').css('min-height', minHValue); 626 $(this).addClass('disabled') 627 setTimeout(function () { 628 var dataTarget = $('.home-designs-preview.active') 629 var floatingHeader = 0; 630 if (window.innerWidth < 1200) { 631 floatingHeader = 107; 632 } 633 $('html, body').animate({ 634 scrollTop: $(dataTarget).offset().top - floatingHeader 635 }, 500); 636 var previewHeight = $('.home-designs-preview.active .home-preview').height(); 637 $('.home-designs-preview.active').css('min-height', previewHeight + 'px'); 638 }, 1000); 639 }, time); 640 } 641 }); 642
643 $('.close-facade-preview').on('click', function () { 644 var preview = $(this).parent('.col-span-6').parent('.row').parent('.fullwidth-col').parent('.row').parent('.col-span-12').parent('.home-preview').parent('.home-preview-holder').parent('.home-designs-preview'); 645 preview.toggleClass('active'); 646 preview.find('.js-toggle-preview').removeClass('disabled'); 647 $('.home-designs-preview').css('min-height', '0'); 648 }); 649 650 $('.close-map-preview').on('click', function () { 651 var mapBlock = $('.fullwidth-map-block'); 652 mapBlock.slideToggle(); 653 var text = "Open map"; 654 if ($(this).hasClass('active')) { 655 text = "Close map"; 656 } 657 $(this).html(text).toggleClass('active'); 658 }); 659 660 $('.js-toggle-preview').on('click', function (e) { 661 // if (window.innerWidth > 1023) { 662 e.preventDefault(); 663 var preview = $(this).parent('.home-designs-list__actions').parent('.home-designs-list__item').next('.home-designs-preview'); 664 var time = 0; 665 $('.home-designs-preview').css('min-height', '0'); 666 if (preview.hasClass('active')) { 667 preview.removeClass('active'); 668 } else { 669 if ($('.home-designs-preview.active').length) { 670 time = 500; 671 } 672 $('.home-designs-preview.active').removeClass('active'); 673 $('.js-toggle-preview').removeClass('disabled'); 674 setTimeout(function () { 675 preview.toggleClass('active'); 676 var minHValue = '912px'; 677 if (window.innerWidth < 768) { 678 minHValue = '360px'; 679 } 680 $('.home-designs-preview.active').css('min-height', minHValue); 681 $(this).addClass('disabled') 682 setTimeout(function () { 683 var dataTarget = $('.home-designs-preview.active') 684 var floatingHeader = 0; 685 if (window.innerWidth < 1200) { 686 floatingHeader = 107; 687 } 688 $('html, body').animate({ 689 scrollTop: $(dataTarget).offset().top - floatingHeader 690 }, 500); 691 var previewHeight = $('.home-designs-preview.active .home-preview').height(); 692 $('.home-designs-preview.active').css('min-height', previewHeight + 'px'); 693 }, 1000); 694 }, time); 695 } 696 // } 697 }); 698 699 700 $(".anchor-to-link").click(function (e) { 701 e.preventDefault(); 702 var dataTarget = $(this).data('target'); 703 $('html, body').animate({ 704 scrollTop: $("#" + dataTarget).offset().top 705 }, 1000); 706 }); 707 708 $(".additional-features .item").on("click", function (e) { 709 e.preventDefault(); 710 711 if ($(this).hasClass("active")) { 712 $(this).removeClass("active"); 713 // Reset background and text color 714 $(this).css({ 715 "background-color": "transparent", // or your default color 716 "color": "rgb(1, 22, 56)" // or your default text color 717 }); 718 } else { 719 $(this).addClass("active"); 720 // Optionally re-apply the active colors 721 $(this).css({ 722 "background-color": "rgb(1 22 56 / var(--tw-bg-opacity))", 723 "color": "rgb(255 255 255 / var(--tw-text-opacity))" 724 }); 725 } 726 }); 727 728
729 $('.dh-tabset .dh-tab-controls .dh-tab-control').on('click', function (e) { 730 e.preventDefault(); 731 var target = $(this).data('target'); 732 if (window.innerWidth < 1024) { 733 $(this).parent('.slick-track').parent('.slick-list').parent('.dh-tab-controls').parent('.dh-tabset').find('.dh-tab-control').removeClass('active'); 734 $(this).parent('.slick-track').parent('.slick-list').parent('.dh-tab-controls').parent('.dh-tabset').find('.dh-tab-panel').removeClass('active'); 735 $(this).addClass('active'); 736 $(this).parent('.slick-track').parent('.slick-list').parent('.dh-tab-controls').parent('.dh-tabset').find('.dh-tab-panel#' + target).addClass('active'); 737 } else { 738 $(this).parent('.dh-tab-controls').parent('.dh-tabset').find('.dh-tab-control').removeClass('active'); 739 $(this).parent('.dh-tab-controls').parent('.dh-tabset').find('.dh-tab-panel').removeClass('active'); 740 $(this).addClass('active'); 741 $(this).parent('.dh-tab-controls').parent('.dh-tabset').find('.dh-tab-panel#' + target).addClass('active'); 742 } 743 }); 744 745 746 747 748 if ($('.play-video-btn').length) { 749function initVimeoScrollAutoplay() {
750 var $videoWrappers = $(".vimeo-wrapper[data-video-id]"); 751 752 if ($videoWrappers.length === 0) return; 753 754 // Sort wrappers by vertical position (top to bottom) 755 $videoWrappers = $videoWrappers.sort(function (a, b) { 756 return $(a).offset().top - $(b).offset().top; 757 }); 758 759 var observerOptions = { 760 root: null, 761 rootMargin: "0px", 762 threshold: 0, // trigger when any part enters viewport 763 }; 764 765 var observer = new IntersectionObserver(function (entries) { 766 var stickyHeaderOffset = window.innerWidth > 767 ? 200 : 0; 767 var prePlayOffset = 500; 768 var scrollTop = $(window).scrollTop(); 769 var viewportTop = scrollTop + stickyHeaderOffset; 770 var viewportBottom = scrollTop + $(window).height(); 771 var prePlayBottom = viewportBottom + prePlayOffset; 772 773 // Play the first video whose top is in the viewport 774 for (var i = 0; i < $videoWrappers.length; i++) { 775 var $wrapper = $($videoWrappers[i]); 776 var top = $wrapper.offset().top; 777 var bottom = top + $wrapper.outerHeight(); 778 779 // Start autoplay slightly before the wrapper reaches the top viewport area. 780 if (bottom > viewportTop && top < prePlayBottom && $wrapper.find("iframe").length === 0) { 781 var videoId = $wrapper.data("video-id"); 782 var $thumbnail = $wrapper.find(".video-thumbnail"); 783 if (!videoId) continue; 784 785 // Calculate aspect ratio 786 var thumb = $thumbnail[0]; 787 var aspectRatio = thumb.naturalHeight / thumb.naturalWidth; 788 var wrapperWidth = $wrapper.width(); 789 $wrapper.css({ 790 position: "relative", 791 height: wrapperWidth * aspectRatio + "px", 792 }); 793 794 var $iframe = $('<iframe>', { 795 src: videoId + "?autoplay=1&muted=1&playsinline=1", 796 frameborder: 0, 797 allow: "autoplay; fullscreen; picture-in-picture", 798 allowfullscreen: true, 799 css: { 800 position: "absolute", 801 top: 0, 802 left: 0, 803 width: "100%", 804 height: "100%", 805 }, 806 }); 807 808 $wrapper.empty().append($iframe); 809 break; // stop after the first visible video 810 } 811 } 812 }, observerOptions); 813 814 $videoWrappers.each(function () { 815 observer.observe(this); 816 }); 817 818 // Maintain aspect ratio on resize 819 $(window).on("resize", function () { 820 $videoWrappers.each(function () { 821 var $wrapper = $(this); 822 var $iframe = $wrapper.find("iframe"); 823 var $thumb = $wrapper.find(".video-thumbnail"); 824 825 if ($iframe.length && $thumb.length) { 826 var aspectRatio = $thumb[0].naturalHeight / $thumb[0].naturalWidth; 827 var wrapperWidth = $wrapper.width(); 828 $wrapper.css("height", wrapperWidth * aspectRatio + "px"); 829 } 830 }); 831 }); 832} 833 834 initVimeoScrollAutoplay(); 835 836 $(".play-video-btn").on("click", function (e) { 837 e.preventDefault(); 838 839 var $button = $(this); 840 var $wrapper = $button.closest(".vimeo-wrapper, [data-video-id]"); 841 var $thumbnail = $wrapper.find(".video-thumbnail"); 842 var videoId = $wrapper.data("video-id"); 843 844 if (!videoId) return; 845 846 // Get natural width/height of thumbnail 847 var thumb = $thumbnail[0]; 848 var aspectRatio = thumb.naturalHeight / thumb.naturalWidth; 849 850 // Set wrapper height dynamically 851 var wrapperWidth = $wrapper.width(); 852 $wrapper.css({ 853 position: "relative", 854 height: wrapperWidth * aspectRatio + "px", 855 }); 856 857 // Create iframe 858 var $iframe = $('<iframe>', { 859 src: videoId, 860 frameborder: 0, 861 allow: "autoplay; fullscreen; picture-in-picture", 862 allowfullscreen: true, 863 css: { 864 position: "absolute", 865 top: 0, 866 left: 0, 867 width: "100%", 868 height: "100%", 869 }, 870 }); 871 872 // Replace thumbnail and button 873 $wrapper.empty().append($iframe); 874 }); 875 876 // Optional: handle resize 877 $(window).on("resize", function () { 878 $(".vimeo-wrapper iframe").each(function () { 879 var $iframe = $(this); 880 var $wrapper = $iframe.parent(); 881 var $thumb = $wrapper.find(".video-thumbnail"); 882 883 if ($thumb.length === 0) return; 884 885 var aspectRatio = $thumb[0].naturalHeight / $thumb[0].naturalWi
885dth; 886 var wrapperWidth = $wrapper.width(); 887 $wrapper.css("height", wrapperWidth * aspectRatio + "px"); 888 }); 889 }); 890 } 891 } 892 893 var initflexSlider = function () { 894 // $('.flex-slider .flex-slider-item').on('click', function () { 895 // $('.flex-slider .flex-slider-item').removeClass('active'); 896 // $(this).toggleClass('active'); 897 // }); 898 $('.flex-slider ul li').on('click', function (e) { 899 var target = $(this).data('target'); 900 if ($(this).hasClass('active')) { 901 e.preventDefault(); 902 location.href = target; 903 } 904 $('.flex-slider ul li').removeClass('active'); 905 $(this).toggleClass('active'); 906 }); 907 } 908 909 var videoEvents = function () { 910 if ($('.js-play-video').length) { 911 $('html').on('click', '.js-play-video', function () { 912 var vimeoHeight, vimeoWidth; 913 vimeoHeight = $(this).outerHeight(); 914 vimeoWidth = $(this).outerWidth(); 915 916 $('.trailer-image img').hide(); 917 918 var $iframe = $('<iframe />', { 919 src: 'https://www.youtube.com/embed/fla02yFATuY?autoplay=1&rel=0&modestbranding=1&autohide=1&showinfo=0&controls=0', 920 class: 'vimeo', 921 frameborder: 0 922 }) 923 924 $iframe.attr('width', vimeoWidth).attr('height', vimeoHeight); 925 926 $(this).parent().removeClass('video'); 927 $(this).replaceWith($iframe); 928 929 if ($('.trailer-text').length) { 930 $('.trailer-text').hide(); 931 } 932 933 }); 934 } 935 } 936 937 //Unite 938 var unitegallery = function (id) { 939 var $id = $(id); 940 if ($id.length) { 941 var galleryOptions = { 942 gallery_theme: "tiles", 943 tiles_col_width: 370, 944 tiles_align: "center", 945 tiles_exact_width: false, 946 tiles_space_between_cols: 30, 947 tiles_space_between_cols_mobile: 30, 948 tiles_include_padding: false, 949 tiles_min_columns: 1, 950 tiles_max_columns: 4, 951 tile_enable_border: false, 952 tile_enable_outline: false, 953 tile_enable_shadow: false, 954 tile_width: 370, 955 tile_height: 155, 956 theme_gallery_padding: 0, 957 lightbox_type: "compact", 958 lightbox_overlay_opacity: 0.85, 959 lightbox_slider_image_shadow: false, 960 lightbox_arrows_position: "inside", 961 lightbox_slider_image_border: false, 962 lightbox_slider_image_border_width: 20, 963 lightbox_slider_image_border_color: "transparent", 964 lightbox_arrows_inside_alwayson: true, 965 tiles_align: "left", 966 } 967 var galleryFacade = $id.unitegallery(galleryOptions); 968 var galleryFacadeCaption = $id.next('.gallery-details').find('.caption'); 969 var galleryFacadeTotal = $id.next('.gallery-details').find('.counter .total'); 970 var galleryFacadeCurrent = $id.next('.gallery-details').find('.counter .current-num'); 971 972 $('.ug-thumb-wrapper,.ug-thumb-image,.ug-thumb-overlay').addClass('aos-item').attr('data-aos', 'fade-in').attr('data-aos-duration', '800'); 973 initAnimation(); 974 galleryFacadeTotal.html(galleryFacade.getNumItems()); 975 galleryFacade.on("item_change", function (num, data) { 976 galleryFacadeCaption.html(data.description); 977 galleryFacadeCurrent.html(num + 1); 978 }); 979 } 980 } 981 982 //Isotope 983 var isotopeInit = function (elem) { 984 if ($(elem).length) { 985 var options = { 986 itemSelector: '.column', 987 layoutMode: 'masonry', //masonry 988 percentPosition: true, 989 }; 990 991 $(elem).each(function () { 992 var self = $(this); 993 if (typeof $(this).imagesLoaded == 'function') { 994 $(this).imagesLoaded(function (instance) { 995 if (instance.isComplete) { 996 self.isotope(options); 997 } 998 }); 999 } 1000 }) 1001 } 1002 }; 1003 1004 var initAnimation = function () { 1005 if ($('.aos-item').length) { 1006 AOS.init({ 1007 easing: 'ease-in-out-sine' 1008 }); 1009 } 1010 }; 1011 1012 var initStickyNav = function () { 1013 if ($('.about-nav a').length) { 1014 var navHeight = 90; 1015 if (window.innerWidth < 767) { 1016 navHeight = 60; 1017 } 1018 $(".about-nav a").click(function (e) { 1019 e.preventDefault(); 1020 var dataTarget = $(this).data('target'); 1021 $('.about-nav a').removeClass('active'); 1022 $(this).addClass('active'); 1023 $('html, body').animate({ 1024 scrollTop: $("." + dataTarget).offset().top - navHeight 1025 }, 1000); 1026 }); 1027 } 1028 1029 if ($('.cast-nav a').length) { 1030 var navHeight = 160; 1031 if (window.innerWidth < 767) { 1032 navHeight = 100; 1033 } 1034 $(".cast-nav a").click(function (e) { 1035 e.preventDefault(); 1036 $('.cast-nav a').removeClass('active'); 1037 $(this).addClass('active'); 1038 $('.cast-crew-block').addClass('hide'); 1039 var dataTarget = $(this).data('target'); 1040 $("." + dataTarget).removeClass('hide'); 1041 $('html, body').animate({ 1042 scrollTop: $("." + dataTarget).offset().top - navHeight 1043 }, 1000); 1044 }); 1045 } 1046 1047 if ($('#sticky-nav').length) { 1048 window.onscroll = function () { stickyNav() }; 1049 1050 var navbar = document.getElementById("sticky-nav"); 1051 var sticky = navbar.offsetTop; 1052 1053 function stickyNav() { 1054 if (window.pageYOffset >= sticky) { 1055 navbar.classList.add("sticky") 1056 } else { 1057 navbar.classList.remove("sticky"); 1058 } 1059 1060 if ($('.about-nav').length) { 1061 let mainNavLinks = document.querySelectorAll("#sticky-nav ul li a"); 1062 1063 let fromTop = window.scrollY; 1064 var headerHeight = 360; 1065 if (window.innerWidth < 1024) { 1066 headerHeight = 150; 1067 } 1068 1069 mainNavLinks.forEach(link => { 1070 let section = document.querySelector(link.hash); 1071 if ( 1072 section.offsetTop + headerHeight <= fromTop && 1073 section.offsetTop + headerHeight + section.offsetHeight > fromTop 1074 ) { 1075 link.classList.add("active"); 1076 } else { 1077 link.classList.remove("active"); 1078 } 1079 }); 1080 } 1081 } 1082 } 1083 } 1084 1085 var initPhotoSwipeFromDOM = function (gallerySelector) { 1086 1087 // parse slide data (url, title, size ...) from DOM elements 1088 // (children of gallerySelector) 1089 var parseThumbnailElements = function (el) { 1090 var thumbElements = el.childNodes, 1091 numNodes = thumbElements.length, 1092 items = [], 1093 figureEl, 1094 linkEl, 1095 size, 1096 item; 1097 1098 for (var i = 0; i < numNodes; i++) { 1099 1100 figureEl = thumbElements[i]; // <figure> element 1101 1102 // include only element nodes 1103 if (figureEl.nodeType !== 1) { 1104 continue; 1105 } 1106 1107 1108 1109 if (figureEl.className.indexOf('slick-cloned') > 0) { 1110 continue; 1111 } 1112 1113 1114 linkEl = figureEl.children[0]; // <a> element 1115 1116 size = linkEl.getAttribute('data-size').split('x'); 1117 1118 var j_width = $(window).width(); 1119 var j_height = $(window).height(); 1120 size = [j_width, j_height] 1121 1122 // create slide object 1123 item = { 1124 src: linkEl.getAttribute('href'), 1125 w: parseInt(size[0], 10), 1126 h: parseInt(size[1], 10) 1127 }; 1128 1129 1130 1131 if (figureEl.children.length > 1) { 1132 // <figcaption> content 1133 item.title = figureEl.children[1].innerHTML; 1134 } 1135 1136 if (linkEl.children.length > 0) { 1137 // <img> thumbnail element, retrieving thumbnail url 1138 item.msrc = linkEl.children[0].getAttribute('src'); 1139 } 1140 1141 item.el = figureEl; // save link to element for getThumbBoundsFn 1142 items.push(item); 1143 } 1144 1145 // console.log(items); 1146 return items; 1147 }; 1148 1149 // find nearest parent element 1150 var closest = function closest(el, fn) { 1151 return el && (fn(el) ? el : closest(el.parentNode, fn)); 1152 }; 1153 1154 // triggers when user clicks on thumbnail 1155 var onThumbnailsClick = function (e) { 1156 e = e || window.event; 1157 e.preventDefault ? e.preventDefault() : e.returnValue = false;
1158 1159 var eTarget = e.target || e.srcElement; 1160 1161 // find root element of slide 1162 var clickedListItem = closest(eTarget, function (el) { 1163 return (el.tagName && el.tagName.toUpperCase() === 'FIGURE'); 1164 }); 1165 1166 if (!clickedListItem) { 1167 return; 1168 } 1169 1170 // find index of clicked item by looping through all child nodes 1171 // alternatively, you may define index via data- attribute 1172 var clickedGallery = clickedListItem.parentNode, 1173 childNodes = clickedListItem.parentNode.childNodes, 1174 numChildNodes = childNodes.length, 1175 nodeIndex = 0, 1176 index; 1177 1178 for (var i = 0; i < numChildNodes; i++) { 1179 if (childNodes[i].nodeType !== 1) { 1180 continue; 1181 } 1182 1183 if (childNodes[i] === clickedListItem) { 1184 index = nodeIndex; 1185 break; 1186 } 1187 nodeIndex++; 1188 } 1189 1190 1191 if (index >= 0) { 1192 // open PhotoSwipe if valid index found 1193 openPhotoSwipe(index, clickedGallery); 1194 } 1195 return false; 1196 }; 1197 1198 // parse picture index and gallery index from URL (#&pid=1&gid=2) 1199 var photoswipeParseHash = function () { 1200 var hash = window.location.hash.substring(1), 1201 params = {}; 1202 1203 if (hash.length < 5) { 1204 return params; 1205 } 1206 1207 var vars = hash.split('&'); 1208 for (var i = 0; i < vars.length; i++) { 1209 if (!vars[i]) { 1210 continue; 1211 } 1212 var pair = vars[i].split('='); 1213 if (pair.length < 2) { 1214 continue; 1215 } 1216 params[pair[0]] = pair[1]; 1217 } 1218 1219 if (params.gid) { 1220 params.gid = parseInt(params.gid, 10); 1221 } 1222 1223 return params; 1224 }; 1225 var openPhotoSwipe = function (index, galleryElement, disableAnimation, fromURL) { 1226 $('body').addClass('photoSwipeOpen'); 1227 var pswpElement = document.querySelectorAll('.pswp')[0], 1228 gallery, 1229 options, 1230 items; 1231 1232 items = parseThumbnailElements(galleryElement); 1233 1234 index -= 1; 1235 // console.log(index); 1236 1237 // define options (if needed) 1238 options = { 1239 1240 // define gallery index (for URL) 1241 galleryUID: galleryElement.getAttribute('data-pswp-uid'), 1242 initialZoomLevel: 'fill', 1243 getThumbBoundsFn: function (index) { 1244 // See Options -> getThumbBoundsFn section of documentation for more info 1245 var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail 1246 pageYScroll = window.pageYOffset || document.documentElement.scrollTop, 1247 rect = thumbnail.getBoundingClientRect(); 1248 1249 return { x: rect.left, y: rect.top + pageYScroll, w: rect.width }; 1250 } 1251 1252 }; 1253 1254 // PhotoSwipe opened from URL 1255 if (fromURL) { 1256 if (options.galleryPIDs) { 1257 // parse real index when custom PIDs are used 1258 // http://photoswipe.com/documentation/faq.html#custom-pid-in-url 1259 for (var j = 0; j < items.length; j++) { 1260 if (items[j].pid == index) { 1261 options.index = j; 1262 break; 1263 } 1264 } 1265 } else { 1266 // in URL indexes start from 1 1267 options.index = parseInt(index, 10) - 1; 1268 } 1269 } else { 1270 options.index = parseInt(index, 10); 1271 } 1272 1273 // exit if index not found 1274 if (isNaN(options.index)) { 1275 return; 1276 } 1277 1278 if (disableAnimation) { 1279 options.showAnimationDuration = 0; 1280 } 1281 1282 // Pass data to PhotoSwipe and initialize it 1283 gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); 1284 gallery.init(); 1285 1286 gallery.listen('close', function () { 1287 $('body').removeClass('photoSwipeOpen'); 1288 }); 1289 1290 gallery.listen('afterChange', function () { 1291 1292 var curr = gallery.currItem; 1293 var index2 = curr.el.dataset.slickIndex; 1294 console.log(index2); 1295 // $('.slick-photoswipe-slider').slick('slickGoTo', index); 1296 1297 // $('.slick-photoswipe-slider').slick("slickSetOption", 'speed', 1, true); 1298 // $('.slick-photoswipe-slider').slick("slickSetOption", 'waitForAnimate', false, false); 1299 $(gallerySelector).slick('slickGoTo', index2); 1300 // $('.slick-photoswipe-slider').slick("slickSetOption", 'speed', 300, true); 1301 // $('.slick-photoswipe-slider').slick("slickSetOption", 'waitForAnimate', true, false); 1302 1303 }); 1304 1305 }; 1306 1307 // loop through all gallery elements and bind events 1308 var galleryElements = document.querySelectorAll(gallerySelector); 1309 1310 for (var i = 0, l = galleryElements.length; i < l; i++) { 1311 galleryElements[i].setAttribute('data-pswp-uid', i + 1); 1312 galleryElements[i].onclick = onThumbnailsClick; 1313 } 1314 1315 // Parse URL and open gallery if it contains #&pid=3&gid=1 1316 var hashData = photoswipeParseHash(); 1317 if (hashData.pid && hashData.gid) { 1318 openPhotoSwipe(hashData.pid, galleryElements[hashData.gid - 1], true, true); 1319 } 1320 }; 1321 1322 var initSlickPhotoSwipeSlider = function () { 1323 if ($('.slick-photoswipe-block').length) { 1324 initPhotoSwipeFromDOM('.slick-photoswipe-slider'); 1325 $('.slick-photoswipe-slider').slick({ 1326 adaptiveHeight: true, 1327 slidesToShow: 1, 1328 slidesToScroll: 1, 1329 swipe: true, 1330 infinite: true, 1331 swipeToSlide: true, 1332 dots: false, 1333 arrows: true, 1334 responsive: [ 1335 { 1336 breakpoint: 1024, 1337 settings: { 1338 slidesToShow: 1, 1339 slidesToScroll: 1,
1340 arrows: false, 1341 dots: true, 1342 } 1343 } 1344 ] 1345 }); 1346 $('.slick-photoswipe-slider').on('beforeChange', function (event, slick, currentSlide, nextSlide) { 1347 var mySlideNumber = nextSlide; 1348 $('.slider-nav .slick-slide').removeClass('slick-active'); 1349 $('.slider-nav .slick-slide').eq(mySlideNumber).addClass('slick-active'); 1350 }); 1351 } 1352 }; 1353 1354 var initAccordion = function () { 1355 if ($('.accordion').length) { 1356 $(document).on('click', '.accordion', function () { 1357 $this = $(this); 1358 $target = $this.next(); 1359 1360 if (!$target.hasClass('active')) { 1361 $this.addClass('active'); 1362 $target.addClass('active').slideDown('slow'); 1363 } else { 1364 $target.removeClass('active').stop(true, true).slideUp('slow'); 1365 $this.removeClass('active'); 1366 } 1367 }); 1368 } 1369 if ($('.floorplan-accordion').length) { 1370 $(document).on('click', '.floorplan-accordion', function () { 1371 $this = $(this); 1372 $target = $this.next(); 1373 1374 if (!$target.hasClass('active')) { 1375 $this.addClass('active'); 1376 $target.addClass('active').slideDown('slow'); 1377 } else { 1378 $target.removeClass('active').stop(true, true).slideUp('slow'); 1379 $this.removeClass('active'); 1380 } 1381 }); 1382 } 1383 }; 1384 1385 //Range Slider 1386 var rangeSlider = function (range, rangesValues, rangeType, step) { 1387 var $range = $(range); 1388 var $from = $range.parent().find('.slider-from'); 1389 var $to = $range.parent().find('.slider-to'); 1390 var $rangeValues = $range.parents('.filter-option-range').find('.range-values'); 1391 if ($range.length) { 1392 // var rangeType = rangeType == 'price' ? ['$', 'K'] : ['', rangeType]; 1393 var rangeType = $range.data('range-types'), 1394 rangesValues = $range.data('ranges'); 1395 $range.slider({ 1396 range: true, 1397 min: rangesValues[0], 1398 max: rangesValues[1], 1399 step: $range.data('step') ? $range.data('step') : step, 1400 values: rangesValues, 1401 change: function (event, ui) { 1402 $from.html(rangeType[0] + ui.values[0] + rangeType[1]); 1403 $to.html(rangeType[0] + ui.values[1] + rangeType[1]); 1404 $rangeValues.val(rangeType[0] + ui.values[0] + rangeType[1] + " - " + rangeType[0] + ui.values[1] + rangeType[1]); 1405 } 1406 }); 1407 $from.html(rangeType[0] + rangesValues[0] + rangeType[1]); 1408 $to.html(rangeType[0] + rangesValues[1] + rangeType[1]); 1409 $rangeValues.val(rangeType[0] + $range.slider("values", 0) + rangeType[1] + " - " + rangeType[0] + $range.slider("values", 1) + rangeType[1]); 1410 1411 } 1412 }; 1413 1414 //Toggle Siblings on Click 1415 var toggleOnClick = function (btn, toggleElem) { 1416 $(btn).on('click', function () { 1417 $(this).toggleClass('active') 1418 $(this).next(toggleElem).slideToggle(); 1419 }) 1420 } 1421 1422 //Unite 1423 var uniteGallery = function (id) { 1424 if ($(id).length) { 1425 var galleryOptions = { 1426 slider_enable_zoom_panel: false, 1427 theme_enable_text_panel: false, 1428 slider_control_zoom: false, 1429 strippanel_enable_handle: false,
1430 strippanel_enable_buttons: false, 1431 theme_enable_hidepanel_button: false, 1432 theme_enable_play_button: false, 1433 thumb_height: 0, 1434 thumb_width: 0, 1435 slider_enable_bullets: false, 1436 slider_bullets_offset_vert: 100, 1437 slider_scale_mode: "down", 1438 } 1439 var galleryFacade = $(id).unitegallery(galleryOptions); 1440 var galleryFacadeCaption = $(id).next('.gallery-details').find('.caption'); 1441 var galleryFacadeTotal = $(id).next('.gallery-details').find('.counter .total'); 1442 var galleryFacadeCurrent = $(id).next('.gallery-details').find('.counter .current-num'); 1443 1444 1445 galleryFacadeTotal.html(galleryFacade.getNumItems()); 1446 galleryFacade.on("item_change", function (num, data) { 1447 galleryFacadeCaption.removeAttr('style'); 1448 if ($.trim(data.description) != '') { 1449 galleryFacadeCaption.html(data.description); 1450 } else { 1451 galleryFacadeCaption.css('visibility', 'hidden'); 1452 } 1453 galleryFacadeCurrent.html(num + 1); 1454 }); 1455 1456 var firstSlide = galleryFacade.getItem(0); 1457 galleryFacadeCaption.html(firstSlide.description); 1458 galleryFacadeCurrent.html(firstSlide.index + 1); 1459 1460 // change if other gallery added 1461 document.querySelector(id).onfullscreenchange = function () { 1462 $(id).toggleClass('fullscreencast'); 1463 if (!$(id).children('.gallery-details').length) { 1464 var countDrac = $(id).parents('.gallery-holder').children('.gallery-details').clone(); 1465 $(id).append(countDrac); 1466 1467 1468 // for fullscreen view 1469 var fullCaption = countDrac.find('.caption'); 1470 var fullTotal = countDrac.find('.counter .total'); 1471 var fullCurrent = countDrac.find('.counter .current-num'); 1472 fullTotal.html(galleryFacade.getNumItems()); 1473 galleryFacade.on("item_change", function (num, data) { 1474 fullCaption.html(data.description); 1475 fullCurrent.html(num + 1); 1476 }); 1477 } 1478 } 1479 1480 document.addEventListener('webkitfullscreenchange', fullScreenCast(id)); 1481 document.addEventListener('mozfullscreenchange', fullScreenCast(id)); 1482 document.addEventListener('msfullscreenchange', fullScreenCast(id)); 1483 document.addEventListener('fullscreenchange', fullScreenCast(id)); 1484 1485 function fullScreenCast(id) { 1486 $(id).toggleClass('fullscreencast'); 1487 if (!$(id).children('.gallery-details').length) { 1488 var countDrac = $(id).parents('.gallery-holder').children('.gallery-details').clone(); 1489 $(id).append(countDrac); 1490 1491 1492 // for fullscreen view 1493 var fullCaption = countDrac.find('.caption'); 1494 var fullTotal = countDrac.find('.counter .total'); 1495 var fullCurrent = countDrac.find('.counter .current-num'); 1496 fullTotal.html(galleryFacade.getNumItems()); 1497 galleryFacade.on("item_change", function (num, data) { 1498 fullCaption.html(data.description); 1499 fullCurrent.html(num + 1); 1500 }); 1501 } 1502 } 1503 } 1504 } 1505 1506 var initArticleSlider = function () { 1507 $('.article-slider').slick({ 1508 slidesToShow: 1, 1509 slidesToScroll: 1, 1510 swipe: true, 1511 infinite: true, 1512 swipeToSlide: true, 1513 dots: true, 1514 arrows: true, 1515 autoplay: true, 1516 autoplaySpeed: 4000, 1517 }); 1518 } 1519 1520 var initBannerSlider = function () { 1521 $('.banner-slider').slick({ 1522 slidesToShow: 1, 1523 slidesToScroll: 1, 1524 swipe: false, 1525 infinite: true, 1526 swipeToSlide: false, 1527 dots: true,
1528 arrows: false, 1529 autoplay: true, 1530 autoplaySpeed: 4000, 1531 fade: true, 1532 cssEase: 'linear' 1533 }); 1534 } 1535 1536 var initTestimonialSlider = function () { 1537 $('.testimonial-slider').slick({ 1538 slidesToShow: 1, 1539 slidesToScroll: 1, 1540 swipe: true, 1541 infinite: true, 1542 swipeToSlide: true, 1543 dots: true, 1544 arrows: true 1545 }); 1546 } 1547 1548 var initTwoColSlider = function () { 1549 if ($('.two-col-slider').length) { 1550 var $swiperSelector = $('.two-col-slider .swiper-container'); 1551 1552 $swiperSelector.each(function (index) { 1553 var $this = $(this); 1554 $this.addClass('swiper-slider-' + index); 1555 1556 var dragSize = $this.data('drag-size') ? $this.data('drag-size') : 50; 1557 var freeMode = $this.data('free-mode') ? $this.data('free-mode') : false; 1558 var loop = $this.data('loop') ? $this.data('loop') : false; 1559 var slidesDesktop = $this.data('slides-desktop') ? $this.data('slides-desktop') : 2.1; 1560 var slidesTablet = $this.data('slides-tablet') ? $this.data('slides-tablet') : 2.1; 1561 var slidesMobile = $this.data('slides-mobile') ? $this.data('slides-mobile') : 1.1; 1562 var spaceBetween = $this.data('space-between') ? $this.data('space-between') : 32; 1563 1564 if (window.innerWidth < 1200) { 1565 spaceBetween = 24; 1566 } 1567 if (window.innerWidth < 1024) { 1568 spaceBetween = 16; 1569 } 1570 1571 var swiper = new Swiper('.swiper-slider-' + index, { 1572 direction: 'horizontal', 1573 loop: loop, 1574 freeMode: freeMode, 1575 spaceBetween: spaceBetween, 1576 breakpoints: { 1577 1920: { 1578 slidesPerView: slidesDesktop 1579 }, 1580 768: { 1581 slidesPerView: slidesTablet 1582 }, 1583 320: { 1584 slidesPerView: slidesMobile 1585 } 1586 }, 1587 navigation: { 1588 nextEl: '.swiper-button-next', 1589 prevEl: '.swiper-button-prev' 1590 }, 1591 scrollbar: { 1592 el: '.swiper-scrollbar', 1593 draggable: true, 1594 // dragSize: dragSize 1595 } 1596 }); 1597 }); 1598 } 1599 } 1600 1601 var initNewsSlider = function () { 1602 if ($('.news-slider').length) { 1603 var $swiperSelector = $('.news-slider .swiper-container'); 1604 1605 $swiperSelector.each(function (index) { 1606 var $this = $(this); 1607 $this.addClass('news-swiper-slider-' + index); 1608 1609 var dragSize = $this.data('drag-size') ? $this.data('drag-size') : 50; 1610 var freeMode = $this.data('free-mode') ? $this.data('free-mode') : false; 1611 var loop = $this.data('loop') ? $this.data('loop') : false; 1612 var slidesDesktop = $this.data('slides-desktop') ? $this.data('slides-desktop') : 2.5; 1613 var slidesTablet = $this.data('slides-tablet') ? $this.data('slides-tablet') : 1.8; 1614 var slidesMobile = $this.data('slides-mobile') ? $this.data('slides-mobile') : 1.1; 1615 var spaceBetween = $this.data('space-between') ? $this.data('space-between') : 40; 1616 1617 if (window.innerWidth < 1200) { 1618 spaceBetween = 24; 1619 } 1620 if (window.innerWidth < 1024) { 1621 spaceBetween = 16; 1622 } 1623 1624 var swiper = new Swiper('.news-swiper-slider-' + index, { 1625 direction: 'horizontal', 1626 loop: loop, 1627 freeMode: freeMode, 1628 spaceBetween: spaceBetween, 1629 breakpoints: { 1630 1024: { 1631 slidesPerView: slidesDesktop 1632 }, 1633 768: { 1634 slidesPerView: slidesTablet 1635 }, 1636 320: { 1637 slidesPerView: slidesMobile 1638 } 1639 }, 1640 navigation: { 1641 nextEl: '.swiper-button-next', 1642 prevEl: '.swiper-button-prev' 1643 }, 1644 scrollbar: { 1645 el: '.swiper-scrollbar', 1646 draggable: true, 1647 // dragSize: dragSize 1648 } 1649 }); 1650 }); 1651 } 1652 } 1653 1654 var initOtherHomesSlider = function () { 1655 if ($('.other-homes-slider').length) { 1656 var $swiperSelector = $('.other-homes-slider .swiper-container'); 1657 1658 $swiperSelector.each(function (index) { 1659 var $this = $(this); 1660 $this.addClass('other-homes-swiper-slider-' + index); 1661 1662 var dragSize = $this.data('drag-size') ? $this.data('drag-size') : 50; 1663 var freeMode = $this.data('free-mode') ? $this.data('free-mode') : false;
1664 var loop = $this.data('loop') ? $this.data('loop') : false; 1665 var slidesDesktop = $this.data('slides-desktop') ? $this.data('slides-desktop') : 3.05; 1666 var slidesTablet = $this.data('slides-tablet') ? $this.data('slides-tablet') : 2.5; 1667 var slidesMobile = $this.data('slides-mobile') ? $this.data('slides-mobile') : 1; 1668 var spaceBetween = $this.data('space-between') ? $this.data('space-between') : 30; 1669 1670 if (window.innerWidth < 1200) { 1671 spaceBetween = 24; 1672 } 1673 if (window.innerWidth < 1024) { 1674 spaceBetween = 16; 1675 } 1676 1677 var swiper = new Swiper('.other-homes-swiper-slider-' + index, { 1678 direction: 'horizontal', 1679 loop: loop, 1680 freeMode: freeMode, 1681 spaceBetween: spaceBetween, 1682 breakpoints: { 1683 1024: { 1684 slidesPerView: slidesDesktop 1685 }, 1686 768: { 1687 slidesPerView: slidesTablet 1688 }, 1689 320: { 1690 slidesPerView: slidesMobile 1691 } 1692 }, 1693 navigation: { 1694 nextEl: '.swiper-button-next', 1695 prevEl: '.swiper-button-prev' 1696 }, 1697 scrollbar: { 1698 el: '.swiper-scrollbar', 1699 draggable: true, 1700 // dragSize: dragSize 1701 } 1702 }); 1703 $('.home-designs-list__tabs .floorplan-tab-content .tab-content').matchHeight({ 1704 byRow: false, 1705 property: 'height', 1706 target: null, 1707 remove: false 1708 }); 1709 $('.home-designs-list__tabs').matchHeight({ 1710 byRow: false, 1711 property: 'height', 1712 target: null, 1713 remove: false 1714 }); 1715 // initFacadeSlider(); 1716 }); 1717 } 1718 } 1719 var initHalSlider = function () { 1720 if ($('.hal-slider').length) { 1721 var $swiperSelector = $('.hal-slider .swiper-container'); 1722 1723 $swiperSelector.each(function (index) { 1724 var $this = $(this); 1725 $this.addClass('hal-swiper-slider-' + index); 1726 1727 var dragSize = $this.data('drag-size') ? $this.data('drag-size') : 50; 1728 var freeMode = $this.data('free-mode') ? $this.data('free-mode') : false; 1729 var loop = $this.data('loop') ? $this.data('loop') : false; 1730 var slidesXL = $this.data('slides-xl') ? $this.data('slides-xl') : 3; 1731 var slidesDesktop = $this.data('slides-desktop') ? $this.data('slides-desktop') : 2.3; 1732 var slidesTablet = $this.data('slides-tablet') ? $this.data('slides-tablet') : 2.1; 1733 var slidesMobile = $this.data('slides-mobile') ? $this.data('slides-mobile') : 1; 1734 var spaceBetween = $this.data('space-between') ? $this.data('space-between') : 30; 1735 1736 if (window.innerWidth < 1200) { 1737 spaceBetween = 24; 1738 } 1739 if (window.innerWidth < 1024) { 1740 spaceBetween = 16; 1741 } 1742 1743 var swiper = new Swiper('.hal-swiper-slider-' + index, { 1744 direction: 'horizontal', 1745 loop: loop, 1746 freeMode: freeMode, 1747 spaceBetween: spaceBetween, 1748 breakpoints: { 1749 1200: { 1750 slidesPerView: slidesXL 1751 }, 1752 1024: { 1753 slidesPerView: slidesDesktop 1754 }, 1755 768: { 1756 slidesPerView: slidesTablet 1757 }, 1758 320: { 1759 slidesPerView: slidesMobile 1760 } 1761 }, 1762 navigation: { 1763 nextEl: '.swiper-button-next', 1764 prevEl: '.swiper-button-prev' 1765 }, 1766 scrollbar: { 1767 el: '.swiper-scrollbar', 1768 draggable: true, 1769 // dragSize: dragSize 1770 } 1771 }); 1772 }); 1773 } 1774 } 1775 1776 var initFESlider = function () { 1777 if ($('.featured-estates-slider').length) { 1778 var $swiperSelector = $('.featured-estates-slider .swiper-container'); 1779 1780 $swiperSelector.each(function (index) { 1781 var $this = $(this); 1782 $this.addClass('featured-estates-swiper-slider-' + index); 1783 1784 var dragSize = $this.data('drag-size') ? $this.data('drag-size') : 50; 1785 var freeMode = $this.data('free-mode') ? $this.data('free-mode') : false;
1786 var loop = $this.data('loop') ? $this.data('loop') : false; 1787 var slidesXL = $this.data('slides-xl') ? $this.data('slides-xl') : 2; 1788 var slidesDesktop = $this.data('slides-desktop') ? $this.data('slides-desktop') : 2; 1789 var slidesTablet = $this.data('slides-tablet') ? $this.data('slides-tablet') : 2; 1790 var slidesMobile = $this.data('slides-mobile') ? $this.data('slides-mobile') : 1; 1791 var spaceBetween = $this.data('space-between') ? $this.data('space-between') : 40; 1792 1793 if (window.innerWidth < 1200) { 1794 spaceBetween = 40; 1795 } 1796 if (window.innerWidth < 1024) { 1797 spaceBetween = 16; 1798 } 1799 1800 var swiper = new Swiper('.featured-estates-swiper-slider-' + index, { 1801 direction: 'horizontal', 1802 loop: loop, 1803 freeMode: freeMode, 1804 spaceBetween: spaceBetween, 1805 breakpoints: { 1806 1200: { 1807 slidesPerView: slidesXL 1808 }, 1809 1024: { 1810 slidesPerView: slidesDesktop 1811 }, 1812 768: { 1813 slidesPerView: slidesTablet 1814 }, 1815 320: { 1816 slidesPerView: slidesMobile 1817 } 1818 }, 1819 navigation: { 1820 nextEl: '.swiper-button-next', 1821 prevEl: '.swiper-button-prev' 1822 }, 1823 scrollbar: { 1824 el: '.swiper-scrollbar', 1825 draggable: true, 1826 // dragSize: dragSize 1827 } 1828 }); 1829 }); 1830 } 1831 } 1832 var initSCSlider = function () { 1833 var $status = $('.slide-count-wrap'); 1834 var $slickElement = $('.sales-centre-slider'); 1835 1836 $slickElement.on('init reInit afterChange', function (event, slick, currentSlide) { 1837 var i = (currentSlide ? currentSlide : 0) + 1; 1838 $status.find('.current').text(i); 1839 $status.find('.total').text(slick.slideCount); 1840 }); 1841 1842 $slickElement.not('.slick-initialized').slick({ 1843 adaptiveHeight: true, 1844 slidesToShow: 1, 1845 slidesToScroll: 1, 1846 swipe: true, 1847 infinite: true, 1848 swipeToSlide: true, 1849 dots: false, 1850 arrows: true, 1851 }); 1852 1853 $slickElement.slick('setPosition'); 1854 }; 1855 1856 var initFavouritesSlider = function () { 1857 const favouritesSlider = $('.favourites-slider'); 1858 if (favouritesSlider.length) { 1859 var $swiperSelector = favouritesSlider.find('.swiper-container'); 1860 $swiperSelector.each(function (index) { 1861 var $this = $(this); 1862 $this.addClass('favourites-swiper-slider-' + index); 1863 const noFavouritesSlide = $this.find('.no-favourites-slide'); 1864 noFavouritesSlide.detach(); 1865 1866 var dragSize = $this.data('drag-size') ? $this.data('drag-size') : 50; 1867 var freeMode = $this.data('free-mode') ? $this.data('free-mode') : false; 1868 var loop = $this.data('loop') ? $this.data('loop') : false; 1869 var slidesXL = $this.data('slides-xl') ? $this.data('slides-xl') : 3; 1870 var slidesDesktop = $this.data('slides-desktop') ? $this.data('slides-desktop') : 2.3; 1871 var slidesTablet = $this.data('slides-tablet') ? $this.data('slides-tablet') : 2.1; 1872 var slidesMobile = $this.data('slides-mobile') ? $this.data('slides-mobile') : 1; 1873 var spaceBetween = $this.data('space-between') ? $this.data('space-between') : 30; 1874 1875 if (window.innerWidth < 1200) { 1876 spaceBetween = 24; 1877 } 1878 if (window.innerWidth < 1024) { 1879 spaceBetween = 16; 1880 } 1881 if (window.innerWidth < 768) { 1882 spaceBetween = 8; 1883 } 1884 1885 var swiper = new Swiper('.favourites-swiper-slider-' + index, { 1886 direction: 'horizontal', 1887 loop: loop, 1888 freeMode: freeMode, 1889 spaceBetween: spaceBetween, 1890 breakpoints: { 1891 1200: { 1892 slidesPerView: slidesXL 1893 }, 1894 1024: { 1895 slidesPerView: slidesDesktop 1896 }, 1897 768: { 1898 slidesPerView: slidesTablet 1899 }, 1900 320: { 1901 slidesPerView: slidesMobile 1902 } 1903 }, 1904 navigation: { 1905 nextEl: '.swiper-button-next', 1906 prevEl: '.swiper-button-prev' 1907 }, 1908 scrollbar: { 1909 el: '.swiper-scrollbar', 1910 draggable: true, 1911 // dragSize: dragSize 1912 } 1913 }); 1914 1915 const checkSlider = () => { 1916 if (swiper.slides.length === 0) { 1917 swiper.appendSlide(noFavouritesSlide.get(0)); 1918 } 1919 }; 1920
1921 swiper.slides.forEach(element => { 1922 const $element = $(element); 1923 const id = String($element.data('id')); 1924 $element.find('.favourites-remove-button').click(() => { 1925 swiper.removeSlide(swiper.slides.indexOf(element)) 1926 favouriteHomesApp ? favouriteHomesApp.delete(id) : null; 1927 checkSlider(); 1928 }); 1929 }); 1930 1931 checkSlider(); 1932 1933 $this.data('swiper', swiper); 1934 }); 1935 } 1936 } 1937 //Virtual to show embedded iframe 1938 var virtualEmbedShow = function () { 1939 $('.button-virtual').on('click', function () { 1940 var imgObj = $(this).next('.image-holder'); 1941 var iframeSrc = imgObj.next('.iframe-holder').find('iframe').data('defer-src'); 1942 $(this).hide().parent().addClass('active'); 1943 imgObj.hide(); 1944 imgObj.next('.iframe-holder').removeClass('hide'); 1945 imgObj.next('.iframe-holder').find('iframe').attr('src', iframeSrc) 1946 }) 1947 } 1948 1949 var readMoreContent = function () { 1950 var calcContentHeight = $('.readmore-html').find('.column').css('height'); 1951 $('.readmore-html').find('.column').css({ 1952 height: '300px' 1953 }) 1954 $('.readmore-html .button-more').on('click', function () { 1955 var parent = $(this).closest('.readmore-html'); 1956 parent.toggleClass('opened'); 1957 parent.find('.column').stop().animate({ 1958 height: parent.hasClass('opened') ? calcContentHeight : '300px' 1959 }, 700) 1960 1961 }) 1962 } 1963 1964 var initRecentlyViewedSlider = function () { 1965 if (window.innerWidth < 1024) { 1966 $('.recently-viewed-list').slick({ 1967 adaptiveHeight: true, 1968 variableWidth: true, 1969 slidesToShow: 2, 1970 slidesToScroll: 1, 1971 swipe: true, 1972 infinite: false, 1973 swipeToSlide: true, 1974 dots: false, 1975 arrows: false 1976 }); 1977 } 1978 } 1979 1980 var initTabcontrolSlider = function () { 1981 if (window.innerWidth < 1024) { 1982 $('.tabset .tab-controls').slick({ 1983 adaptiveHeight: true, 1984 variableWidth: true, 1985 slidesToScroll: 1, 1986 swipe: true, 1987 infinite: false, 1988 swipeToSlide: true, 1989 dots: false, 1990 arrows: false 1991 }); 1992 $('.dh-tabset .dh-tab-controls').slick({ 1993 adaptiveHeight: true, 1994 variableWidth: true, 1995 slidesToScroll: 1, 1996 swipe: true, 1997 infinite: false, 1998 swipeToSlide: true, 1999 dots: false, 2000 arrows: false 2001 }); 2002 } 2003 } 2004 2005 var initFacadeSlider = function () { 2006 $('.facade-slider').each(function () { 2007 var sliderId = $(this).attr('id'); 2008 $('#' + sliderId).on('load', function () { 2009 $('#' + sliderId).not('.slick-initialized').slick({ 2010 adaptiveHeight: true, 2011 slidesToShow: 1, 2012 slidesToScroll: 1, 2013 swipe: true, 2014 infinite: true, 2015 swipeToSlide: true, 2016 dots: false, 2017 arrows: true, 2018 }); 2019 $('#' + sliderId).slick('setPosition'); 2020 }()); 2021 }); 2022 } 2023 2024 var initHomeDesignsFacadeSlider = function () { 2025 $('.home-design-facade-slider:not(.home-designs-app-slider)').each(function () { 2026 var sliderId = $(this).attr('id'); 2027 $('#' + sliderId).on('load', function () { 2028 $('#' + sliderId).not('.slick-initialized').slick({ 2029 adaptiveHeight: true, 2030 slidesToShow: 1, 2031 slidesToScroll: 1, 2032 swipe: true, 2033 infinite: true, 2034 swipeToSlide: true, 2035 dots: true, 2036 arrows: true, 2037 }); 2038 $('#' + sliderId).slick('setPosition'); 2039 }()); 2040 }); 2041 2042 $('.favourites__tabs .floorplan-tab-content .tab-content .facade-image').matchHeight({ 2043 byRow: false, 2044 property: 'height', 2045 target: null, 2046 remove: false 2047 }); 2048 } 2049 2050 var initSalesCentreFacadeSlider = function () { 2051 $('.sales-centre-slider.home-design-facade-slider.home-designs-app-slider').each(function () { 2052 var sliderId = $(this).attr('id'); 2053 $('#' + sliderId).on('load', function () { 2054 $('#' + sliderId).not('.slick-initialized').slick({ 2055 adaptiveHeight: true, 2056 slidesToShow: 1, 2057 slidesToScroll: 1, 2058 swipe: true, 2059 infinite: true, 2060 swipeToSlide: true, 2061 dots: true, 2062 arrows: true, 2063 }); 2064 $('#' + sliderId).slick('setPosition'); 2065 }()); 2066 }); 2067 } 2068 2069 var initFeaturedEstatesSlider = function () { 2070 $('.featured-estates-slider').on('load', function () { 2071 $('.featured-estates-slider').not('.slick-initialized').slick({ 2072 adaptiveHeight: true, 2073 slidesToShow: 1, 2074 slidesToScroll: 1, 2075 swipe: true, 2076 infinite: true, 2077 swipeToSlide: true, 2078 dots: true, 2079 arrows: true, 2080 }); 2081 $('.featured-estates-slider').slick('setPosition'); 2082 }()); 2083 } 2084 2085 //Range Slider 2086 var rangeSlider = function (range, rangesValues, rangeType, step) { 2087 var $range = $(range); 2088 var $from = $range.parent().find('.slider-from'); 2089 var $to = $range.parent().find('.slider-to'); 2090 var $rangeValues = $range.parents('.filter-option-range').find('.range-values'); 2091 if ($range.length) { 2092 // var rangeType = rangeType == 'price' ? ['$', 'K'] : ['', rangeType]; 2093 var rangeType = $range.data('range-types'), rangesValues = $range.data('ranges'); 2094 $range.slider({ 2095 range: true, 2096 min: rangesValues[0], 2097 max: rangesValues[1], 2098 step: $range.data('step') ? $range.data('step') : step, 2099 values: rangesValues, 2100 slide: function (event, ui) { 2101 2102 var temp_from_val = ui.values[0]; 2103 var temp_from_val_type = rangeType[1]; 2104 var temp_to_val = ui.values[1]; 2105 var temp_to_val_type = rangeType[1]; 2106 2107 if (temp_from_val >= 1000) { 2108 temp_from_val = temp_from_val / 1000; 2109 temp_from_val_type = 'M'; 2110 } 2111 2112 if (temp_to_val >= 1000) { 2113 temp_to_val = temp_to_val / 1000; 2114 temp_to_val_type = 'M'; 2115 } 2116 2117 $from.html(rangeType[0] + ui.values[0] + rangeType[1]); 2118 $to.html(rangeType[0] + ui.values[1] + rangeType[1]); 2119 $rangeValues.val(rangeType[0] + temp_from_val + temp_from_val_type + " - " + rangeType[0] + temp_to_val + temp_to_val_type); 2120 }, 2121 change: function (event, ui) { 2122 var temp_from_val = ui.values[0]; 2123 var temp_from_val_type = rangeType[1]; 2124 var temp_to_val = ui.values[1]; 2125 var temp_to_val_type = rangeType[1]; 2126 2127 if (temp_from_val >= 1000) { 2128 temp_from_val = temp_from_val / 1000; 2129 temp_from_val_type = 'M'; 2130 } 2131 2132 if (temp_to_val >= 1000) { 2133 temp_to_val = temp_to_val / 1000; 2134 temp_to_val_type = 'M'; 2135 } 2136 2137 $from.html(rangeType[0] + ui.values[0] + rangeType[1]); 2138 $to.html(rangeType[0] + ui.values[1] + rangeType[1]); 2139 $rangeValues.val(rangeType[0] + temp_from_val + temp_from_val_type + " - " + rangeType[0] + temp_to_val + temp_to_val_type); 2140 } 2141 }); 2142 $from.html(rangeType[0] + rangesValues[0] + rangeType[1]); 2143 $to.html(rangeType[0] + rangesValues[1] + rangeType[1]); 2144 $rangeValues.val(rangeType[0] + $range.slider("values", 0) + rangeType[1] + " - " + rangeType[0] + $range.slider("values", 1) + rangeType[1]); 2145 2146 } 2147 }; 2148 2149 var initStickyFilter = function () { 2150 var filter = document.getElementById("sticky-filter"); 2151 if (filter) { 2152 var sticky = filter.offsetTop; 2153 2154 if (window.pageYOffset > sticky) { 2155 filter.classList.add("sticky"); 2156 } else { 2157 filter.classList.remove("sticky"); 2158 } 2159 } 2160 } 2161 2162 var initStickyHeader = function () { 2163 if ($('header .header-bottom').length) { 2164 var stickyHeader = document.getElementById("stickyHeader"); 2165 var sticky = stickyHeader.offsetTop; 2166 2167 if ($(window).scrollTop() > sticky) { 2168 stickyHeader.classList.add("sticky-header"); 2169 } else { 2170 stickyHeader.classList.remove("sticky-header"); 2171 } 2172 } 2173 } 2174 2175 2176 var initInclusionsSlider = function () { 2177 const $sliderTheme = $('.slider-theme'); 2178 if ($sliderTheme.length) { 2179 $sliderTheme.slick({ 2180 slidesToShow: 1, 2181 slidesToScroll: 1,
2182 arrows: false, 2183 fade: false, 2184 dots: false, 2185 // asNavFor: '.slider-theme-nav', 2186 adaptiveHeight: true, 2187 infinite: true, 2188 swipeToSlide: false, 2189 swipe: false, 2190 responsive: [{ 2191 breakpoint: 767, 2192 settings: { 2193 dots: false, 2194 arrows: false, 2195 swipe: false, 2196 // infinite: false 2197 } 2198 }] 2199 }); 2200 $('.slider-theme-nav').slick({ 2201 slidesToShow: 4, 2202 slidesToScroll: 1, 2203 asNavFor: '.slider-theme', 2204 dots: false, 2205 centerMode: false, 2206 focusOnSelect: true, 2207 arrows: false, 2208 infinite: true, 2209 swipeToSlide: true, 2210 responsive: [{ 2211 breakpoint: 1023, 2212 settings: { 2213 slidesToShow: 4, 2214 slidesToScroll: 1 2215 } 2216 }, 2217 { 2218 breakpoint: 768, 2219 settings: { 2220 slidesToScroll: 1, 2221 slidesToShow: 1, 2222 infinite: false, 2223 dots: true, 2224 arrows: true, 2225 appendDots: $('.box-theme .expand-content'), 2226 customPaging: function (slider, i) { 2227 var title = $(slider.$slides[i]).find('.text').text(); 2228 return '<span>' + title + '</span>'; 2229 } 2230 } 2231 } 2232 ] 2233 2234 }); 2235 } 2236 //Tooltip - Interior Theme 2237 $('.tip').on('click', function () { 2238 var targetid = $(this).attr('target'); 2239 2240 $('.tip').not($(this)).removeClass('active'); 2241 //$('.tip').not('[target = '+targetid+']').removeClass('active'); 2242 $('.tip').not('[target = ' + targetid + ']').parent('.tooltip-content').removeClass('active'); 2243 $('.tip').not('[target = ' + targetid + ']').parent('.nav-dots').removeClass('active'); 2244 $('[target = ' + targetid + ']').toggleClass('active'); 2245 2246 $(this).parent('.tooltip-content').toggleClass('active'); 2247 $(this).parent('.nav-dot').toggleClass('active'); 2248 2249 if ($(this).hasClass('active')) { 2250 if ($(this).parents('.slider-item').find('.tooltip-content-area').css('display') == 'none') { 2251 $(this).parents('.slider-item').find('.tooltip-content-area').fadeIn(); 2252 } 2253 } 2254 if ($(this).parent('.tooltip-content').hasClass('top')) { 2255 var contentHeight = $(this).parent('.tooltip-content').find('.content').outerHeight(); 2256 var gap = 36; 2257 var marginTop = contentHeight + gap; 2258 $(this).parent('.tooltip-content').find('.content').css('margin-top', '-' + marginTop + 'px'); 2259 } 2260 }) 2261 $('.button-expand').each(function () { 2262 $(this).click(function () { 2263 $(this).toggleClass('active'); 2264 $(this).next('.expand-content').slideToggle(); 2265 }) 2266 }) 2267 $('.expand-content').find('.slick-dots li').click(function () { 2268 var textCurrent = $(this).find('span').text(); 2269 $(this).parents('.expand-content').css('display', 'none'); 2270 $(this).parents('.expand-holder').find('.button-expand').removeClass('active'); 2271 $(this).parents('.expand-holder').find('.button-expand').text(textCurrent); 2272 }); 2273 //Toggle tooltip content 2274 const $mapInfo = $('.map-info'); 2275 $('.slider-theme .slider-item').each(function () { 2276 $(this).find('.toggle-tooltip').click(function () { 2277 $(this).parents('.slider-item').find('.target-content').removeClass('active').hide(); 2278 $(this).parents('.slider-item').find('.toggle-tooltip').removeClass('active-button'); 2279 $(this).addClass('active-button'); 2280 $('#' + $(this).attr('target')).addClass('active').fadeIn(100).show().trigger('click'); 2281 }); 2282 2283 if ($mapInfo.length) { 2284 $(this).find('.map-info').mouseover(function () { 2285 $('.toggle-tooltip').removeClass('active active-button'); 2286 $('.tooltip-content').removeClass('active'); 2287 $(this).children('.toggle-tooltip').addClass('active active-button'); 2288 $(this).addClass('active'); 2289 $(this).children('.content').mouseleave(function () { 2290 $('.toggle-tooltip').removeClass('active active-button'); 2291 $('.tooltip-content').removeClass('active'); 2292 }); 2293 $(this).mouseleave(function () { 2294 $('.toggle-tooltip').removeClass('active active-button'); 2295 $('.tooltip-content').removeClass('active'); 2296 }); 2297 }); 2298 2299 $(this).find('.map-info .toggle-tooltip').mouseenter(function () { 2300 $('.toggle-tooltip').removeClass('active active-button'); 2301 $('.tooltip-content').removeClass('active'); 2302 $(this).addClass('active active-button'); 2303 $(this).parents('.tooltip-content').addClass('active'); 2304 $(this).parents('.tooltip-content').children('.content').mouseleave(function () { 2305 $('.toggle-tooltip').removeClass('active active-button'); 2306 $('.tooltip-content').removeClass('active'); 2307 }); 2308 }); 2309 2310 2311 2312 } 2313 2314 2315 }); 2316 }; 2317 2318 var init3ColSlider = function () { 2319 $('.three-column-slider').slick({ 2320 slidesToShow: 1, 2321 slidesToScroll: 1, 2322 swipe: true, 2323 infinite: true, 2324 swipeToSlide: true, 2325 dots: true,
2326 arrows: false, 2327 autoplay: true, 2328 autoplaySpeed: 7000, 2329 fade: true, 2330 cssEase: 'linear' 2331 }); 2332 } 2333 2334 return { 2335 init: async function () { 2336 windowLoad(); 2337 windowScroll(); 2338 onWindowResize(); 2339 clickEvents(); 2340 chosenSelect('.chosen-select'); 2341 sameHeight('.mh'); 2342 sameHeightByRow('.mhbr'); 2343 initArticleSlider(); 2344 initBannerSlider(); 2345 initTestimonialSlider(); 2346 initTwoColSlider(); 2347 initNewsSlider(); 2348 initOtherHomesSlider(); 2349 initHalSlider(); 2350 initFESlider(); 2351 initSCSlider(); 2352 initFavouritesSlider(); 2353 initflexSlider(); 2354 initRecentlyViewedSlider(); 2355 initTabcontrolSlider(); 2356 initInclusionsSlider(); 2357 init3ColSlider(); 2358 initAccordion(); 2359 initFeaturedEstatesSlider(); 2360 initSalesCentreFacadeSlider(); 2361 uniteGallery("#facade-gallery"); 2362 uniteGallery("#images-gallery"); 2363 uniteGallery("#images-gallery-1"); 2364 uniteGallery("#video-gallery"); 2365 uniteGallery("#video-gallery-1"); 2366 isotopeInit('.isotope-items'); 2367 rangeSlider('#slider-house-size-range', [120, 300], 'm', 10); 2368 rangeSlider('#slider-block-width-range', [8, 34], 'm', 2); 2369 rangeSlider('#slider-block-depth-range', [8, 34], 'm', 2); 2370 rangeSlider('#slider-price-range', [120, 240], 'price', 10); 2371 rangeSlider('#slider-price-range-tablet', [120, 240], 'price', 10); 2372 rangeSlider('#slider-house-size-range-tablet', [120, 300], 'm', 10); 2373 rangeSlider('#slider-house-size-range-mobile', [120, 300], 'm', 10); 2374 rangeSlider('#slider-block-width-range-tablet', [8, 34], 'm', 2); 2375 rangeSlider('#slider-block-width-range-mobile', [8, 34], 'm', 2); 2376 rangeSlider('#slider-block-depth-range-tablet', [8, 34], 'm', 2); 2377 rangeSlider('#slider-block-depth-range-mobile', [8, 34], 'm', 2); 2378 rangeSlider('#slider-price-range-mobile', [120, 240], 'price', 10); 2379 2380 $('.display-centre-gallery').each((index, element) => uniteGallery('#' + element.id)); 2381 } 2382 } 2383 2384 })(jQuery, UIElement); 2385 2386 UIController.init(); 2387 2388})();
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.