1 2let vh = window.innerHeight * 0.01; 3document.documentElement.style.setProperty('--vh', `${vh}px`); 4var $scrolled = $(this).scrollTop(); 5var markerList = []; 6var $body = $('body'); 7//var Cookies2 = Cookies.noConflict(); 8 9$(document).ready(function(){ 10 init(); 11}); 12$(window).on('load resize', function(){ 13 adjustLayout(); 14 $scrolled = $(this).scrollTop(); 15 scrollStuff($scrolled); 16}); 17$(window).on('load', function(){ 18 setTimeout(function(){ 19 if($('#hu').length >= 1){ 20 if(!$('#hu').hasClass('hu-visible') ){ 21 $('#global-slideout').removeClass('hidden'); 22 } 23 } else{ 24 $('#global-slideout').removeClass('hidden'); 25 } 26 }, 1000); 27 28}); 29$(window).scroll(function(){ 30 $scrolled = $(this).scrollTop(); 31 scrollStuff($scrolled); 32}); 33 34$(document).on('keydown',function(e) { 35 e = e || window.event; 36 switch (e.keyCode) { 37 case 27: //esc 38 if($body.hasClass('menu-shown')){ 39 $body.removeClass('menu-shown'); 40 } 41 break; 42 } 43}) 44function init(){ 45 46 47 48 /*if($('#global-slideout').length >= 1){ 49 50 if(Cookies2.get('slideout') !== 'shown' || !Cookies2.get('slideout') ) { 51 Cookies2.set('slideout', 'shown', { expires: 2592000 }); // 30 days 52 $('#global-slideout').removeClass('hidden'); 53 } 54 }*/ 55 56 // .hu-notice-close #hu-cookies-save 57 $(document).on('click','.hu-notice-close',function(e){ 58 $('#global-slideout').removeClass('hidden'); 59 });
60 $(document).on('click','#hu-cookies-save',function(e){ 61 $('#global-slideout').removeClass('hidden'); 62 }); 63 $(document).on('click','.hu-revoke-button',function(e){ 64 if($('#global-slideout').length >= 1){ 65 $('#global-slideout').addClass('hidden'); 66 } 67 }); 68 69 $(document).on('click','#global-slideout .exit-slideout',function(e){ 70 $('#global-slideout').addClass('hidden'); 71 e.preventDefault(); 72 e.stopPropagation(); 73 }); 74 75 $(".accordion > legend").click(function() { 76 // Toggle the item 77 $(this).toggleClass("is-active").next().slideToggle("ease-out"); 78 }); 79 80 81 $(".masked-mail").click(function(e) { 82 $mailURL = 'mailto:'+ $(this).attr('data-mailbox')+'@thegreenwichhotel.com'; 83 if($(this).attr('data-subject')){ 84 $mailURL = 'mailto:'+ $(this).attr('data-mailbox')+'@thegreenwichhotel.com?subject='+$(this).attr('data-subject'); 85 86 } 87 window.open($mailURL,''); 88 e.preventDefault(); 89 }); 90 91 $(".masked-mail").each(function(e) { 92 $address = $(this).find('span').html().toString(); 93 $newAddress = $address.replace("&", "@"); 94 $(this).find('span').html($newAddress); 95 }); 96 97 // Custom Newsletter Signup 98 $('#newsletter-form').on('submit', function(e) { 99 e.preventDefault(); 100 101 var $form = $(this); 102 var $submitBtn = $('#newsletter-submit'); 103 var $message = $('#newsletter-message'); 104 var $inputWrapper = $('.newsletter-input-wrapper'); 105 106 var $newsletterHeading = $('#custom-newsletter-heading'); 107 var email = $('#newsletter-email').val(); 108 109 // Disable submit button 110 $submitBtn.prop('disabled', true); 111 $message.removeClass('success error').text(''); 112 113 // Get fresh nonce to avoid cache issues 114 $.ajax({ 115 url: '/wp-admin/admin-ajax.php', 116 type: 'POST', 117 data: { 118 action: 'get_newsletter_nonce' 119 }, 120 success: function(nonceResponse) { 121 if (nonceResponse.success) { 122 // Now submit with fresh nonce 123 $.ajax({ 124 url: '/wp-admin/admin-ajax.php', 125 type: 'POST', 126 data: { 127 action: 'newsletter_signup', 128 email: email, 129 nonce: nonceResponse.data.nonce 130 }, 131 success: function(response) { 132 if (response.success) { 133 $inputWrapper.hide(); 134 $newsletterHeading.hide(); 135 $message.addClass('success').text(response.data.message); 136 } else { 137 $message.addClass('error').text(response.data.message); 138 $submitBtn.prop('disabled', false); 139 } 140 }, 141 error: function() { 142 $message.addClass('error').text('An error occurred. Please try again.'); 143 $submitBtn.prop('disabled', false); 144 } 145 }); 146 } else { 147 $message.addClass('error').text('Security verification failed. Please refresh the page.'); 148 $submitBtn.prop('disabled', false); 149 } 150 }, 151 error: function() { 152 $message.addClass('error').text('An error occurred. Please try again.'); 153 $submitBtn.prop('disabled', false); 154 } 155 }); 156 }); 157 158 159 $(".datepicker").datepicker({ 160 minDate: new Date(), 161 inline: true, 162 showOtherMonths: true, 163 }); 164 165 // Drop Down 166 $('.drop-down .toggle').on("click", function(e) { 167 $(this).parent('.drop-down').find('.options').slideToggle(200); 168 if ($(this).hasClass("active")) { 169 $(this).removeClass('active'); 170 } else { 171 $(this).addClass('active'); 172 } 173 e.preventDefault(); 174 }); 175 176 177 178 $( "#datein" ).datepicker({ 179 minDate: new Date(), 180 beforeShow: function(input, inst) { 181 var calendar = inst.dpDiv; 182 calendar.css('min-width',$('#datein').outerWidth()+'px'); 183 184 } 185 }); 186 $( "#dateout" ).datepicker({ 187 beforeShow: function(input, inst) { 188 var calendar = inst.dpDiv; 189 calendar.css('min-width',$('#datein').outerWidth()+'px'); 190 191 } 192 193 }); 194 $('#datein').on('change',function(){ 195 $('#dateout').datepicker('option', 'minDate', new Date($(this).val())); 196 }); 197 $('#booking-form form').submit(function(e){ 198 $start = $( "#datein" ).datepicker({ dateFormat: "yy-mm-dd" }).val() ; 199 $end = $( "#dateout" ).datepicker({ dateFormat: "yy-mm-dd" }).val() ; 200 $guests = parseInt($('#booking-form form input#guests').val()); 201 //$rooms = $('#booking-form form input#rooms').val().toString(); 202 $url = 'https://be.synxis.com/?chain=24447&hotel=6963&level=hotel&locale=en-US&arrive='+$start+'&depart='+$end+'&adult='+$guests; 203 //console.log($url); 204 window.open($url,'_blank'); 205 e.preventDefault(); 206 }) 207 $('#booking-form .row .arrow').click(function(){ 208 if($(this).hasClass('add')){ 209 $(this).parents('.row').find('input').val( function(i, oldval) { 210 return ++oldval; 211 }); 212 } else{ 213 $(this).parents('.row').find('input').val( function(i, oldval) { 214 if(oldval >= 2){ 215 return --oldval; 216 } else{ 217 return 1; 218 } 219 }); 220 } 221 }) 222 adjustLayout(); 223 $('.stretched').anystretch(); 224 $('.stretched').each(function(){ 225 $alt = $(this).attr('data-alt'); 226 if($alt){ 227 $(this).find('img').attr('alt',$alt); 228 } 229 }) 230 $('.book-toggle').click(function(e){ 231 if($('body').hasClass('show-booking')){ 232 $('body').removeClass('show-booking'); 233 } else{ 234 $('body').addClass('show-booking'); 235 } 236 e.preventDefault(); 237 }); 238 $('.chat-box .chat-toggle').click(function(e){ 239 if($('.chat-box').hasClass('shown')){ 240 $('.chat-box').removeClass('shown'); 241 } else{ 242 $('.chat-box').addClass('shown'); 243 } 244 e.preventDefault(); 245 }); 246 $('nav#primary .nav-toggle').click(function(e){ 247 if($body.hasClass('menu-shown')){ 248 $body.removeClass('menu-shown'); 249 } else{ 250 $body.addClass('menu-shown'); 251 } 252 e.preventDefault(); 253 }); 254 $('#veil').click(function(e){ 255 if($body.hasClass('menu-shown')){ 256 $body.removeClass('menu-shown'); 257 e.preventDefault(); 258 } 259 }); 260 $.colorbox.settings.createImg = function(){ 261 var img = new Image(); 262 var alt = $(this).attr('data-alt'); 263 var title = $(this).attr('data-title'); 264 265 if (alt) { 266 img.alt = alt; 267 } 268 return img; 269 };
270 $('a.enlarge').colorbox({ 271 transition : 'fade', 272 maxWidth: '80%', 273 maxHeight: '90%', 274 rel:'gallery' 275 }); 276 277 if($('section.wrap.grid').length == 1){ 278 var $container = $('.grid-container').isotope({ 279 itemSelector: '.item', 280 percentPosition: true, 281 masonry: { 282 columnWidth: '.grid-sizer', 283 gutter: '.gutter-sizer', 284 } 285 }); 286 $container.imagesLoaded( function() { 287 $container.isotope('layout'); 288 }); 289 resizeFeature(); 290 $('.clear').on( 'click', function() { 291 $container.isotope({ filter: '*' }); 292 $container.removeClass('filtered'); 293 }); 294 $label = $('#filter-label'); 295 $('.filter, .pre-filter').on( 'click', 'a.parent', function(e) { 296 if($(this).hasClass('active') ) { 297 $(this).removeClass('active'); 298 $(this).closest('nav').removeClass('cat-active'); 299 $(this).next('.sub').removeClass('cat-active'); 300 $container.isotope({ filter: '*' }); 301 $container.removeClass('filtered'); 302 $label.html('Filter'); 303 } else { 304 var filterValue = $(this).attr('data-filter'); 305 $('.filter a.active, .filter .sub.active').removeClass('active'); 306 $(this).toggleClass('active'); 307 $(this).closest('nav').addClass('cat-active'); 308 $(this).next('.sub').addClass('active'); 309 $container.isotope({ filter: filterValue }); 310 $container.addClass('filtered'); 311 if($(this).hasClass('all')){ 312 $label.html('Filter'); 313 } else{ 314 $label.html($(this).html()); 315 } 316 } 317 e.preventDefault(); 318 }); 319 $('.filter').click(function(){ 320 if($(window).width() <= 1200){ 321 if($(this).hasClass('open')){ 322 $(this).css('max-height','60px'); 323 $(this).removeClass('open'); 324 } else{ 325 $(this).css('max-height',$(this).find('ul').actual('outerHeight') + 60); 326 $(this).addClass('open'); 327 } 328 } 329 330 }); 331 } 332 if($('#single-the-guide').length >= 1){ 333 var $guideGallery = $('article.single.the-guide .gallery'); 334 $guideGallery.isotope({ 335 itemSelector: 'img', 336 percentPosition: true, 337 masonry: { 338 columnWidth: 'img' 339 } 340 }); 341 $guideGallery.imagesLoaded( function() { 342 $guideGallery.isotope('layout'); 343 }); 344 } 345 346 $('#spa-mobile').click(function(){ 347 if($(this).hasClass('open')){ 348 $(this).css('max-height','60px'); 349 $(this).removeClass('open'); 350 } else{ 351 $(this).css('max-height',$(this).find('ul').actual('outerHeight') + 60); 352 $(this).addClass('open'); 353 } 354 }); 355 window.addEventListener('googleMapsReady', initMap); 356 function initMap(){ 357 if($body.hasClass('single-the-guide')){ 358 map = new google.maps.Map(document.getElementById('sml-map'), { 359 zoom: 17, 360 scrollwheel: true, 361 mapTypeControl: false, 362 panControl: false, 363 scaleControl: false, 364 streetViewControl: false, 365 zoomControl: false, 366 center: new google.maps.LatLng($singleLat, $singleLng), 367 mapTypeId: google.maps.MapTypeId.ROADMAP 368 }); 369 map.setOptions({styles: mapStyles}); 370 /*var marker = new StyledMarker({ 371 //styleIcon : new StyledIcon(StyledIconTypes.MARKER,{text:"", color:"#000000"}), 372 position :new google.maps.LatLng($singleLat, $singleLng), 373 map: map 374 });*/ 375 376 var marker = new google.maps.Marker({ 377 position:new google.maps.LatLng($singleLat, $singleLng), 378 map: map, 379 color: '#000000', 380 icon: { 381 path: google.maps.SymbolPath.CIRCLE, 382 scale:10, 383 strokeColor: '#000000', 384 strokeOpacity: 0, 385 strokeWeight: 15, 386 fillColor:'#000000', 387 fillOpacity: 1, 388 } 389 }) 390 391 } 392 if($('#location-contact').length >= 1){ 393 var markerList = []; 394 var infowindow = new google.maps.InfoWindow({ 395 content: '' 396 }); 397 if($(window).width() <= 1199){ 398 $lat = 40.7199652469018; 399 $lng = -74.00998413562775; 400 } else{ 401 $lat = 40.733731; 402 $lng = -73.980341; 403 } 404 map = new google.maps.Map(document.getElementById('big-map'), { 405 zoom: 13, 406 scrollwheel: true, 407 mapTypeControl: false, 408 panControl: false, 409 scaleControl: false, 410 streetViewControl: false, 411 zoomControl: false, 412 center: new google.maps.LatLng($lat, $lng), 413 mapTypeId: google.maps.MapTypeId.ROADMAP 414 415 }); 416 map.setOptions({styles: mapStyles}); 417 var marker = new StyledMarker({ 418 styleIcon : new StyledIcon(StyledIconTypes.MARKER,{text:"", color:"#000000"}), 419 position :new google.maps.LatLng(40.719896, -74.009949),
420 map: map 421 }); 422 // info window 423 var boxText = document.createElement('div'); 424 boxText.style.cssText = ''; 425 boxText.innerHTML = '<img src="'+$templateURL+'/assets/images/ui/map-tooltip.png" alt="A photo of the building on 377 Greenwich Street, New York, NY 10013" />'; 426 var myOptions = { 427 content: boxText, 428 disableAutoPan: false, 429 maxWidth: 0, 430 pixelOffset: new google.maps.Size(-208, -130), 431 zIndex: null, 432 boxStyle: { 433 opacity: 1, 434 width: '178px', 435 }, 436 closeBoxURL: '', 437 infoBoxClearance: new google.maps.Size(1, 1), 438 isHidden: false, 439 pane: 'floatPane', 440 enableEventPropagation: false 441 }; 442 443 //var ib = new InfoBox(myOptions); 444 //ib.open(map, marker); 445 } 446 if($body.hasClass('map')){ 447 var infowindow = new google.maps.InfoWindow({ 448 content: '' 449 }); 450 map = new google.maps.Map(document.getElementById('full-map'), { 451 zoom: 17, 452 scrollwheel: true, 453 mapTypeControl: false, 454 panControl: false, 455 scaleControl: false, 456 streetViewControl: false, 457 zoomControl: false, 458 center: new google.maps.LatLng(40.71802527987441, -74.00418825531006), 459 mapTypeId: google.maps.MapTypeId.ROADMAP 460 }); 461 map.setOptions({styles: mapStyles}); 462 gmarkers = []; 463 for (var i = 0; i < geojson.length; i++) { 464 $color = geojson[i].color; 465 var marker = new google.maps.Marker({ 466 position:geojson[i].latlng, 467 map: map, 468 title : geojson[i].name, 469 content: geojson[i].content, 470 category: geojson[i].cats, 471 url: geojson[i].url, 472 color: $color, 473 icon: { 474 path: google.maps.SymbolPath.CIRCLE, 475 scale:10, 476 strokeColor: $color, 477 strokeOpacity: 0, 478 strokeWeight: 15, 479 fillColor: $color, 480 fillOpacity: 1, 481 } 482 }) 483 gmarkers.push(marker); 484 content = marker.content; 485 google.maps.event.addListener(marker, 'click', (function (marker, content) { 486 return function () { 487 infowindow.setContent(content); 488 infowindow.open(map, marker); 489 } 490 })(marker, content)); 491 } 492 /*setTimeout(() => { 493 gmarkers = []; 494 for (var i = 0; i < geojson.length; i++) { 495 $color = geojson[i].color; 496 497 // Create the marker using the new AdvancedMarkerElement 498 const marker = new google.maps.marker.AdvancedMarkerElement({ 499 position: geojson[i].latlng, 500 map: map, 501 title: geojson[i].name 502 }); 503 504 // Store custom properties on the marker object after creation 505 marker.category = geojson[i].cats; 506 marker.url = geojson[i].url; 507 marker.originalContent = geojson[i].content; 508 509 // Create a circular element for the marker 510 const pinElement = document.createElement("div"); 511 pinElement.style.width = "20px"; 512 pinElement.style.height = "20px"; 513 pinElement.style.borderRadius = "50%"; 514 pinElement.style.backgroundColor = $color; 515 516 // Set the element as the marker's content 517 marker.content = pinElement; 518 519 gmarkers.push(marker); 520 521 // Store the content for the info window 522 const content = geojson[i].content; 523 524 // Add click listener for info window 525 marker.addListener('click', function() { 526 infowindow.setContent(content); 527 infowindow.open(map, this); 528 }); 529 } 530 }, 100);*/ 531 $('#marker-list li a').click(function(e){ 532 e.preventDefault(); 533 $title = htmlEscape($(this).attr('data-title')); 534 console.log($title); 535 for (i = 0; i < geojson.length; i++) { 536 marker = gmarkers[i]; 537 if (marker.title.indexOf($title) >= 0) { 538 map.panTo(marker.getPosition()); 539 infowindow.setContent(marker.content); 540 infowindow.open(map, marker); 541 } 542 } 543 }); 544 var $filter = $('.filter'); 545 $filter.on( 'click', '.filter-btn', function() { 546 $filter.toggleClass('open'); 547 }); 548 $('.filter .filters li').on( 'click', 'a', function() { 549 $filter.toggleClass('open'); 550 infowindow.close(map); 551 var $filterLabel = $('.filter-btn'); 552 if ($(this).hasClass('all')){ 553 $('.list li').show(); 554 $filterLabel.text('Filter'); 555 filterMarkers('default'); 556 } else { 557 var toFilter = $(this).attr('data-filter'); 558 var selectedTxt = $(this).text(); 559 $('.list li').show(); 560 $('.list li').not('.'+toFilter).hide(); 561 $filterLabel.text(selectedTxt); 562 filterMarkers(toFilter); 563 return false;
564 } 565 map.fitBounds(bounds); 566 }); 567 filterMarkers = function (category) { 568 var bounds = new google.maps.LatLngBounds(); 569 for (i = 0; i < geojson.length; i++) { 570 marker = gmarkers[i]; 571 if (marker.category.indexOf(category) >= 0) { 572 marker.setVisible(true); 573 bounds.extend(marker.getPosition()); 574 } else { 575 marker.setVisible(false); 576 } 577 } 578 map.fitBounds(bounds); 579 } 580 } 581 } 582 if($('body').hasClass('single-accom') && $(window).width() >= 769 || $('body').hasClass('page-template-page-amenities') && $(window).width() >= 769){ 583 $('.floorplan a').colorbox({ 584 transition : 'fade', 585 maxWidth: '80%', 586 maxHeight: '90%', 587 rel:'gal' 588 }); 589 } else{ 590 $('div.gallery a').click(function(e){ 591 e.preventDefault(); 592 }); 593 } 594 if($('nav#spa').length >= 1){ 595 $('nav#spa .parent').mouseover(function(){ 596 $('nav#spa .parent.hovered').removeClass('hovered'); 597 $('nav#spa .parent').addClass('hide'); 598 599 $(this).addClass('hovered').removeClass('hide');; 600 }); 601 $('nav#spa .sub').mouseleave(function(){ 602 $(this).parents('.parent').removeClass('hovered'); 603 $('nav#spa .hide').removeClass('hide');; 604 }); 605 $('nav#spa').mouseleave(function(){ 606 $(this).find('.hovered').removeClass('hovered'); 607 $('nav#spa .hide').removeClass('hide');; 608 }); 609 } 610 if($('.background.swiper-container').length >= 1){ 611 var slideTran; 612 $('.hero').click(function(){ 613 $('html, body').animate({ 614 scrollTop: $('.hero').outerHeight() 615 }, 1000); 616 }) 617 if(!$('.background.swiper-container').hasClass('has-pagination')){ 618 $loop = false; 619 620 } else{ 621 $loop = true; 622 } 623 var slideshow = new Swiper('.background.swiper-container', { 624 slidesPerView: 1, 625 freeMode: false, 626 speed: 500, 627 loop: $loop, 628 watchSlidesProgress: true, 629 on: { 630 init: function(){ 631 this.autoplay.stop(); 632 }, 633 progress: function(){ 634 var swiper = this; 635 for (var i = 0; i < swiper.slides.length; i++) { 636 slideProgress = swiper.slides[i].progress, 637 innerOffset = swiper.width * .5, 638 innerTranslate = slideProgress * innerOffset; 639 $(swiper.slides[i]).find('figure *').css('transform', 'translateX(' + innerTranslate + 'px)'); 640 } 641 }, 642 touchStart: function() { 643 let swiper = this; 644 for (let i = 0; i < swiper.slides.length; i++) { 645 swiper.slides[i].style.transition = ""; 646 } 647 }, 648 setTransition: function(speed) { 649 let swiper = this; 650 for (let i = 0; i < swiper.slides.length; i++) { 651 swiper.slides[i].style.transition = speed + "ms"; 652 $(swiper.slides[i]).find('figure *').css('transition', speed + "ms"); 653 } 654 } 655 } 656 }); 657 slideshow.on('transitionStart', function(){ 658 if($('.background.swiper-container video').length >= 1){ 659 $('.background.swiper-container').find('.swiper-slide-active').addClass('was-active'); 660 $('.background.swiper-container').find('.swiper-slide:not(.swiper-slide-active)').each(function(){ 661 if($(this).hasClass('has-video') && !$(this).hasClass('was-active')){ 662 video = $(this).find('video')[0]; 663 video.currentTime = 0; 664 } 665 }); 666 } 667 }); 668 slideshow.on('transitionEnd', function(){ 669 nextSlide(parseInt($('.background').find('.swiper-slide-active').attr('data-duration')) * 1000); 670 671 }); 672 if($('.background.swiper-container').hasClass('has-pagination')){ 673 nextSlide(parseInt($('.background').find('.swiper-slide-active').attr('data-duration')) * 1000); 674 } 675 676 function nextSlide(timeout){ 677 678 clearTimeout(slideTran); 679 slideTran = setTimeout(function(){ 680 slideshow.slideNext(); 681 },timeout); 682 } 683 } 684 if($('#landing-slideshow .swiper-container').length >= 1){ 685 686 var landingSlideshow = new Swiper('#landing-slideshow .swiper-container', { 687 slidesPerView: 1, 688 freeMode: false, 689 speed: 1500, 690 loop: true, 691 autoplay: { 692 enabled: true, 693 delay: 4000, 694 disableOnInteraction: true, 695 }, 696 watchSlidesProgress: true, 697 navigation: { 698 nextEl: '.swiper-next', 699 prevEl: '.swiper-prev', 700 }, 701 }); 702 703 } 704 if($('#accomm-gallery').length>=1){ 705 const swiper = new Swiper('#accomm-gallery .swiper', { 706 slidesPerView: 1, 707 autoHeight: true, 708 loop: true, 709 710 navigation: { 711 nextEl: '.swiper-next', 712 prevEl: '.swiper-prev' 713 } 714 }); 715 } 716 if($('#accomm-amenities').length>=1){ 717 const swiper = new Swiper('.amenities-photo', { 718 slidesPerView: 1, 719 loop: true, 720 navigation: { 721 nextEl: '.swiper-next', 722 prevEl: '.swiper-prev' 723 } 724 }); 725 } 726 727 if($('#accomm-floorplans').length>=1){ 728 const slideCount = parseInt($('#accomm-floorplans').attr('data-sli
728des')); 729 730 const swiper = new Swiper('#accomm-floorplans .swiper-container', { 731 slidesPerView: 1, 732 loop: slideCount > 1, 733 centerSlides: true, 734 navigation: { 735 nextEl: '.swiper-next', 736 prevEl: '.swiper-prev' 737 } 738 }); 739 if (slideCount <= 1) { 740 $('#accomm-floorplans .swiper-prev, #accomm-floorplans .swiper-next').hide(); 741 } 742 } 743 if($('#accomm-details').length>=1){ 744 $(window).on('load resize', function() { 745 $('#accomm-details ul').each(function() { 746 if($(this).prev('.title').find('.icon').is(':visible')) { 747 $(this).addClass('measure-height'); 748 const height = parseInt($(this).prop('scrollHeight')) + 20; // Add 10 here 749 $(this).removeClass('measure-height'); 750 $(this)[0].dataset.height = height; 751 console.log(height); 752 } else { 753 $(this).css('height', ''); 754 delete $(this)[0].dataset.height; 755 $(this).prev('.title').removeClass('shown'); 756 } 757 }); 758 }); 759 760 $('#accomm-details .title').on('click', function() { 761 const ul = $(this).next('ul'); 762 ul.toggleClass('shown'); 763 $(this).toggleClass('shown'); 764 if($(this).find('.icon').is(':visible')) { 765 if(ul.hasClass('shown')) { 766 ul.css('height', ul[0].dataset.height + 'px'); 767 ul.css('max-height', ul[0].dataset.height + 'px'); 768 } else { 769 ul.css('max-height', 0); 770 ul.css('height', 0); 771 } 772 } 773 }); 774 } 775 776 if($('.slideshow.swiper-container').length >= 1){ 777 $('.slideshow .slide-text h1').lettering(); 778 if(!$('.slideshow.swiper-container').hasClass('has-pagination')){ 779 $loop = false; 780 781 } else{ 782 $loop = true; 783 } 784 var slideTran; 785 var slideshow = new Swiper('.slideshow.swiper-container', { 786 slidesPerView: 1, 787 freeMode: false, 788 speed: 500, 789 loop: $loop, 790 watchSlidesProgress: true, 791 navigation: { 792 nextEl: '.slideshow.swiper-container .swiper-next', 793 prevEl: '.slideshow.swiper-container .swiper-prev', 794 }, 795 on: { 796 init: function(){ 797 this.autoplay.stop(); 798 }, 799 progress: function(){ 800 var swiper = this; 801 for (var i = 0; i < swiper.slides.length; i++) { 802 slideProgress = swiper.slides[i].progress, 803 innerOffset = swiper.width * .5, 804 innerTranslate = slideProgress * innerOffset; 805 $(swiper.slides[i]).find('figure *').css('transform', 'translateX(' + innerTranslate + 'px)'); 806 } 807 }, 808 touchStart: function() { 809 let swiper = this; 810 for (let i = 0; i < swiper.slides.length; i++) { 811 swiper.slides[i].style.transition = ""; 812 } 813 }, 814 setTransition: function(speed) { 815 let swiper = this; 816 for (let i = 0; i < swiper.slides.length; i++) { 817 swiper.slides[i].style.transition = speed + "ms"; 818 $(swiper.slides[i]).find('figure *').css('transition', speed + "ms"); 819 } 820 } 821 } 822 }); 823 slideshow.on('transitionStart', function(){ 824 if($('.slideshow video').length >= 1){ 825 $('.slideshow').find('.swiper-slide-active').addClass('was-active'); 826 $('.slideshow').find('.swiper-slide:not(.swiper-slide-active)').each(function(){ 827 if($(this).hasClass('has-video')){ 828 video = $(this).find('video')[0]; 829 video.currentTime = 0; 830 } 831 }); 832 } 833 834 }); 835 slideshow.on('transitionEnd', function(){ 836 nextSlide(parseInt($('.slideshow').find('.swiper-slide-active').attr('data-duration')) * 1000); 837 838 }); 839 if($('.slideshow.swiper-container').hasClass('has-pagination')){ 840 nextSlide(parseInt($('.slideshow').find('.swiper-slide-active').attr('data-duration')) * 1000); 841 } 842 function nextSlide(timeout){ 843 clearTimeout(slideTran); 844 slideTran = setTimeout(function(){ 845 slideshow.slideNext(); 846 },timeout); 847 } 848 } 849 850 var $title; 851 $('a').hover(function(){ 852 $title = $(this).attr('title'); 853 $(this).attr('data-title', $title); 854 $(this).attr('title',''); 855 }, function(){ 856 $title = $(this).attr('data-title'); 857 $(this).attr('title',$title); 858 }); 859} 860$lastScrolled = 0; 861$(window).scroll(function(){ 862 $scrolled = $(window).scrollTop(); 863 if($scrolled > 200){ 864 if($scrolled > $lastScrolled){ 865 $('body') 866 .addClass('scroll-down') 867 .removeClass('scroll-up') 868 .removeClass('menu-shown'); 869 } else{ 870 $('body') 871 .addClass('scroll-up') 872 .removeClass('scroll-down'); 873 } 874 } 875 $lastScrolled = $scrolled; 876}) 877.resize(function(){ 878 let vh = window.innerHeight * 0.01; 879 document.documentElement.style.setProperty('--vh', `${vh}px`);
880 resizeFeature(); 881}) 882.on('load', function(){ 883 resizeFeature(); 884}); 885$(window).on('mousemove',function(e){ 886 if($('.slideshow').length >= 1){ 887 if(e.pageX < $(window).width()/3){ 888 $('.slideshow .swiper-prev').addClass('show'); 889 $('.slideshow .swiper-next').removeClass('show'); 890 } else if(e.pageX > $(window).width()*.666){ 891 $('.slideshow .swiper-prev').removeClass('show'); 892 $('.slideshow .swiper-next').addClass('show'); 893 } else{ 894 $('.slideshow .swiper-prev').removeClass('show'); 895 $('.slideshow .swiper-next').removeClass('show'); 896 } 897 } 898}) 899function resizeFeature(){ 900 $winW = $(window).width(); 901 $regH = $('.item.reg').height(); 902 if($body.hasClass('accommodations')){ 903 $featH = $('.item.feat div.content').outerHeight(); 904 if($featH >= $regH*1.5 + ($winW * 0.015) && $featH <= $regH*2 + 20){ 905 $('.item.feat').height($regH*3 + ($winW * 0.015)); 906 } else if($featH >= $regH*2 +40 && $featH <= $regH*3 +40) { 907 $('.item.feat').height($regH*3 + 40); 908 } else if($featH >= $regH*3 +40 && $featH <= $regH*4 +40) { 909 $('.item.feat').height($regH*3 + 40); 910 } else{ 911 $('.item.feat').height($regH*3 + ($winW * 0.015)); 912 } 913 if($featH >= $('.item.feat').height()){ 914 $('.item.feat').height($featH); 915 } 916 } else{ 917 $reg1 = parseInt($('.grid-container .child-1').height()); 918 $reg2 = parseInt($('.grid-container .child-2').height()); 919 $newHeight = ($reg1 + $reg2 + $reg2) + ($winW * 0.015); 920 $('.item.feat').height($newHeight); 921 } 922 $('.stretched').anystretch(); 923 924} 925function equalHeight(group) { 926 tallest = 0; 927 group.each(function() { 928 thisHeight = $(this).height(); 929 if(thisHeight > tallest) { 930 tallest = thisHeight; 931 } 932 }); 933 group.height(tallest); 934} 935function adjustLayout(){ 936 $winW = $(window).width(); 937 $winH = $(window).height(); 938 equalHeight($(".equalHeight")); 939 if($('section.wrap.grid').length == 1){ 940 $('.grid-container li.item').css('margin-bottom', $winW * 0.015); 941 } 942} 943function htmlEscape(str) { 944 return String(str) 945 .replace(/&/g, '&') 946 .replace(/â/g, "'") 947} 948$(document).on('click','#leaving-warning #continue-btn',function(e){ 949 $('body').removeClass('show-warning'); 950 $('#leaving-warning #continue-btn').blur(); 951}); 952$(document).on('click','#leaving-warning .exit-warning',function(e){ 953 $('body').removeClass('show-warning'); 954 $('#leaving-warning #continue-btn').blur(); 955 e.preventDefault(); 956}); 957$(document).on('click','#leaving-warning-veil',function(e){ 958 $('body').removeClass('show-warning'); 959 $('#leaving-warning #continue-btn').blur(); 960 e.preventDefault(); 961}); 962//$('a').not('[href^="#"]').attr('target',''); 963$(document).find('a').not('[href^="#"]').not('#continue-btn').filter(function() { 964 return this.hostname && this.hostname !== location.hostname; 965}).click(function(e) { 966 extLink = $(this).attr('href'); 967 $('body').addClass('show-warning'); 968 $('#leaving-warning #continue-btn').attr('href',extLink); 969 $('#leaving-warning #continue-btn').focus(); 970 //console.log(extLink); 971 e.preventDefault(); 972}); 973function scrollStuff($scrolled){ 974 if($('.page-template-page-landing .landing-section').length >= 1){ 975 $('.page-template-page-landing .landing-section').each(function(){ 976 $this = $(this); 977 $top = $this[0].offsetTop; 978 if($top < $scrolled + $winH){ 979 $this.addClass('shown'); 980 } 981 }); 982 } 983 if($('.page-template-dining .landing-section').length >= 1){ 984 $('.page-template-dining .landing-section').each(function(){ 985 $this = $(this); 986 $top = $this[0].offsetTop; 987 if($top < $scrolled + $winH){ 988 $this.addClass('shown'); 989 } 990 }); 991 } 992 993} 994 995jQuery(document).ready(function($) { 996 const $parentItems = $('.parent-item'); 997 let currentOpenSubmenu = null; 998 999 function showSubmenu($parent) { 1000 if (currentOpenSubmenu && currentOpenSubmenu[0] !== $parent[0]) { 1001 hideSubmenu(currentOpenSubmenu); 1002 } 1003 1004 $parent.addClass('submenu-active'); 1005 currentOpenSubmenu = $parent; 1006 } 1007 1008 function hideSubmenu($parent) { 1009 $parent.removeClass('submenu-active'); 1010 if (currentOpenSubmenu && currentOpenSubmenu[0] === $parent[0]) { 1011 currentOpenSubmenu = null; 1012 } 1013 } 1014 1015 $parentItems.on('mouseenter', function() { 1016 showSubmenu($(this)); 1017 }); 1018 1019 $parentItems.on('mouseleave', function() { 1020 const $parent = $(this); 1021 setTimeout(function() { 1022 if (!$parent.is(':hover')) { 1023 hideSubmenu($parent); 1024 } 1025 }, 200); 1026 }); 1027 1028 $parentItems.on('click', '> a', function(e) { 1029 const $parent = $(this).parent(); 1030 1031 if (!$parent.hasClass('submenu-active')) { 1032 e.preventDefault(); 1033 showSubmenu($parent); 1034 } 1035 }); 1036 1037 $('body').on('keydown', function(e) { 1038 if (e.keyCode === 9) { // Tab key 1039 setTimeout(function() { 1040 const $focusedItem = $('a:focus').closest('li'); 1041 1042 if ($focusedItem.hasClass('parent-item')) { 1043 showSubmenu($focusedItem); 1044 } 1045 else if (!$focusedItem.parents('.parent-item').length) { 1046 $parentItems.each(function() { 1047 hideSubmenu($(this)); 1048 }); 1049 } 1050 }, 10); 1051 } 1052 1053 if (e.keyCode === 27 && currentOpenSubmenu) { 1054 hideSubmenu(currentOpenSubmenu); 1055 currentOpenSubmenu.find('> a').focus(); 1056 e.preventDefault(); 1057 } 1058 1059 if (e.keyCode === 40 && currentOpenSubmenu) { 1060 e.preventDefault(); 1061 currentOpenSubmenu.find('ul.sub-menu > li:first-child > a').focus(); 1062 } 1063 }); 1064 1065 $(document).on('click', function(e) { 1066 if (currentOpenSubmenu && !$(e.target).closest(currentOpenSubmenu).length) { 1067 hideSubmenu(currentOpenSubmenu); 1068 } 1069 }); 1070 1071 1072 $('a[href^="#"]').on('click', function(event) { 1073 var hash = this.hash; 1074 1075 if(hash !== "") { 1076 1077 if($(hash).length) { 1078 event.preventDefault(); 1079 $('html, body').animate({
1080 scrollTop: $(hash).offset().top 1081 }, 800, function() { 1082 }); 1083 } 1084 } 1085 }); 1086 1087 $('.menu-image-slider').each(function(index) { 1088 var $thisSlider = $(this); 1089 var sliderId = 'menu-image-slider-' + index; 1090 var slideCount = $thisSlider.find('.menu-image-slider__slide').length; 1091 1092 $thisSlider.attr('id', sliderId); 1093 1094 if (slideCount > 1) { 1095 var swiper = new Swiper('#' + sliderId + ' .menu-image-slider__container', { 1096 slidesPerView: 1, 1097 spaceBetween: 30, 1098 loop: true, 1099 navigation: { 1100 nextEl: '#' + sliderId + ' .menu-image-slider__button-next', 1101 prevEl: '#' + sliderId + ' .menu-image-slider__button-prev', 1102 }, 1103 pagination: { 1104 el: '#' + sliderId + ' .menu-image-slider__pagination', 1105 type: 'fraction', 1106 }, 1107 }); 1108 } else { 1109 $thisSlider.find('.menu-image-slider__button-next, .menu-image-slider__button-prev, .menu-image-slider__pagination').hide(); 1110 $thisSlider.find('.swiper-nav').addClass('centered'); 1111 } 1112 }); 1113 1114 $('.dining-menu-item').each(function() { 1115 setupAccordionItem($(this)); 1116 }); 1117 1118 // Update all items on window resize 1119 $(window).on('resize', function() { 1120 $('.dining-menu-item').each(function() { 1121 setupAccordionItem($(this)); 1122 }); 1123 }); 1124 1125 $('.dining-menu-item-text button').on('click', function() { 1126 1127 var $button = $(this); 1128 var $item = $button.closest('.dining-menu-item'); 1129 1130 setupAccordionItem($($item)); 1131 1132 var isExpanded = $button.attr('aria-expanded') === 'true'; 1133 1134 $button.attr('aria-expanded', !isExpanded); 1135 $item.toggleClass('expand'); 1136 1137 if (!isExpanded && $item.find('.menu-image-slider').length > 0) { 1138 var sliderId = $item.find('.menu-image-slider').attr('id'); 1139 if (sliderId && window[sliderId + 'Swiper']) { 1140 window[sliderId + 'Swiper'].update(); 1141 } 1142 } 1143 }); 1144 1145 $('.dining-menu-item-content').find('a, button, input, select, textarea, [tabindex]').on('focus', function() { 1146 var $content = $(this).closest('.dining-menu-item-content'); 1147 var $item = $content.closest('.dining-menu-item'); 1148 var $button = $item.find('.dining-menu-item-text button'); 1149 1150 if (!$item.hasClass('expand')) { 1151 setupAccordionItem($item); 1152 $button.attr('aria-expanded', true); 1153 $item.addClass('expand'); 1154 1155 if ($item.find('.menu-image-slider').length > 0) { 1156 var sliderId = $item.find('.menu-image-slider').attr('id'); 1157 if (sliderId && window[sliderId + 'Swiper']) { 1158 window[sliderId + 'Swiper'].update(); 1159 } 1160 } 1161 } 1162 }); 1163 1164 function setupAccordionItem($item) { 1165 var $content = $item.find('.dining-menu-item-content'); 1166 var $text = $item.find('.dining-menu-item-text'); 1167 1168 var originalStyle = $content.attr('style') || ''; 1169 $content.css({ 1170 'max-height': 'none', 1171 'position': 'absolute', 1172 'visibility': 'hidden', 1173 'display': 'block' 1174 }); 1175 1176 var contentHeight = $content.outerHeight(); 1177 var textHeight = $text.outerHeight(); 1178 var totalHeight = contentHeight + textHeight; 1179 1180 $content.attr('style', originalStyle); 1181 1182 $item[0].style.setProperty('--item-expanded-height', totalHeight + 'px'); 1183 $item[0].style.setProperty('--content-height', contentHeight + 'px'); 1184 } 1185}); 1186 1187// Cookie utility functions 1188function setCookie(name, value, days) { 1189 var expires = ""; 1190 if (days) { 1191 var date = new Date(); 1192 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 1193 expires = "; expires=" + date.toUTCString(); 1194 } 1195 document.cookie = name + "=" + (value || "") + expires + "; path=/"; 1196} 1197 1198function getCookie(name) { 1199 var nameEQ = name + "="; 1200 var ca = document.cookie.split(';'); 1201 for (var i = 0; i < ca.length; i++) { 1202 var c = ca[i]; 1203 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 1204 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); 1205 } 1206 return null; 1207}
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.