PageSourceSearch

https://www.manhattanmusichall.com/wp-content/themes/puretonic-yellowball/assets/js/app.js?ver=1.3.12

js manhattanmusichall.com collected 2026-10-04 05:05:57 UTC 20,226 bytes, 612 lines download raw bytes

1gsap.registerPlugin(ScrollTrigger, SplitText);
2// import * as datePicker from './date-picker';
3/** Include any other scripts here - this will combine them via Webpack for the final output script. */
4
5((window, document, $, undefined) => {
6  /*******************************************************************************/
7  /* MODULE
8  /*******************************************************************************/
9
10  const Base = (() => {
11    const mobileMenu = (() => {
12      if ($(".mobile-nav").length) {
13        $(".hamburger").on("click", function () {
14          $(this).toggleClass("open");
15          $(".mobile-nav, .desktop-menu").toggleClass("open");
16          $('html').toggleClass('overflow-hidden-html');
17        });
18      }
19    })();
20    const searchFunctions = (() => {
21      $(document).on('click', '.search-btn, .search-popup .close-button', function () {
22        $('.search-popup').toggleClass('active');
23      });
24    })();
25
26    /**
27     * Runs when the document is ready.
28     */
29    const ready = () => {
30      console.log("document ready!");
31      AOS.init({
32        duration: 600,
33        // Animation duration in milliseconds
34        offset: 0,
35        // Offset (in pixels) from the original trigger point
36        easing: "ease-in-out",
37        // Easing function for the animation
38        delay: 0,
39        // Delay (in milliseconds) before animation starts
40        once: true,
41        // Whether to only animate elements once
42        mirror: false // Whether elements should animate out while scrolling past them in reverse
43      });
44    };
45
46    const menuJS = () => {
47      const burg = $('.site-header .burger-icon');
48      if (window.innerWidth < 1280) {
49        burg.on('click', function (e) {
50          e.preventDefault();
51          $(this).toggleClass('active');
52          $(this).parents('.site-header').toggleClass('active');
53          $(this).parents('.site-header').find('.menu-container').stop().slideToggle();
54          $('html, body').toggleClass('menu-active');
55        });
56      }
57      const subParents = $('.menu-item-has-children');
58      subParents.each(function () {
59        const arrow = $(this).find('.dropdown-arrow');
60        arrow.on('click', function () {
61          $(this).parent().find('.sub-menu').slideToggle();
62          $(this).parent().toggleClass('active-parent');
63        });
64      });
65    };
66    const homepageHero = () => {
67      const container = $('.homepage-hero-carousel');
68      let swiper = new Swiper(".homepage-hero .swiper", {
69        slidesPerView: 1,
70        spaceBetween: 25,
71        rewind: true,
72        speed: 1200,
73        autoplay: {
74          delay: 5000
75        },
76        navigation: {
77          nextEl: ".homepage-hero .swiper-right",
78          prevEl: ".homepage-hero .swiper-left"
79        },
80        pagination: {
81          el: '.home-hero-pag.swiper-pagination',
82          type: 'bullets'
83        },
84        breakpoints: {
85          0: {
86            spaceBetween: 10
87          },
88          768: {
89            spaceBetween: 25
90          }
91        },
92        on: {
93          activeIndexChange: function () {
94            if (swiper.isBeginning) {
95              container.addClass('hide-before');
96              container.removeClass('hide-after');
97            } else if (swiper.isEnd) {
98              container.addClass('hide-after');
99              container.removeClass('hide-before');
100            } else {
101              container.removeClass('hide-after');
102              container.removeClass('hide-before');
103            }
104          }
105        }
106      });
107    };
108    const latestEandA = () => {
109      let swiper = new Swiper(".latest-events-and-announcements .swiper", {
110        slidesPerView: 1.15,
111        spaceBetween: 10,
112        rewind: true,
113        speed: 800,
114        autoplay: {
115          delay: 5000
116        },
117        pagination: {
118          el: '.latest-events-and-announcements .swiper-pagination',
119          type: 'bullets'
120        }
121      });
122    };
123    const hotelSlider = () => {
124      let swiper = new Swiper(".partner-hotels-slider .swiper", {
125        slidesPerView: 2.4,
126        spaceBetween: 10,
127        rewind: false,
128        speed: 800,
129        // autoplay: {
130        //   delay: 5000
131        // },
132        navigation: {
133          nextEl: ".partner-hotels-slider .hotels-next",
134          prevEl: ".partner-hotels-slider .hotels-prev"
135        },
136        pagination: {
137          el: '.partner-hotels-slider .swiper-pagination',
138          type: 'bullets'
139        },
140        breakpoints: {
141          0: {
142            slidesPerView: 1.15,
143            spaceBetween: 10
144          },
145          500: {
146            slidesPerView: 1.7,
147            spaceBetween: 25
148          },
149          800: {
150            slidesPerView: 2,
151            spaceBetween: 25
152          },
153          1025: {
154            slidesPerView: 2.4,
155            spaceBetween: 25
156          }
157        }
158      });
159    };
160    const eventSingleHero = () => {
161      const block = $('.event-single-hero');
162      const card = block.find('.event-single-hero-card');
163      if (card.length) {
164        const height = card.height();
165        const half = height / 2;
166        const topBlock = block.find('.site-container');
167        const topBlockPBNum = parseInt(topBlock.css('padding-bottom').replace("px", ""), 10);
168        const newPB = topBlockPBNum + half;
169        const nextBlock = block.next().find('.site-container');
170        const nextBlockPTBNum = parseInt(nextBlock.css('padding-top').replace("px", ""), 10);
171        const newPT = nextBlockPTBNum + half;
172        topBlock.css('padding-bottom', newPB + 'px');
173        nextBlock.css('padding-top', newPT + 'px');
174      }
175    };
176    const videoBlock = () => {
177      const block = $('.video-block');
178      const iframe = block.find('iframe');
179      if (iframe.length) {
180        const height = iframe.height();
181        const half = height / 2;
182        const topBlock = block.prev().find('.site-container');
183        const topBlockPBNum = parseInt(topBlock.css('padding-bottom').replace("px", ""), 10);
184        const newPB = topBlockPBNum + half;
185        const nextBlock = block.next().find('.site-container');
186        const nextBlockPTBNum = parseInt(nextBlock.css('padding-top').replace("px", ""), 10);
187        const newPT = nextBlockPTBNum + half;
188        topBlock.css('padding-bottom', newPB + 'px');
189        nextBlock.css('padding-top', newPT + 'px');
190      }
191    };
192    const wtdSlider = () => {
193      let swiper = new Swiper(".what-to-do .swiper", {
194        slidesPerView: 2.4,
195        spaceBetween: 10,
196        rewind: false,
197        speed: 800,
198        // autoplay: {
199        //   delay: 5000
200        // },
201        navigation: {
202          nextEl: ".what-to-do .what-to-do-next",
203          prevEl: ".what-to-do .what-to-do-prev"
204        },
205        pagination: {
206          el: '.what-to-do .swiper-pagination',
207          type: 'bullets'
208        },
209        breakpoints: {
210          0: {
211            slidesPerView: 1.6,
212            spaceBetween: 10
213          },
214          500: {
215            slidesPerView: 1.7,
216            spaceBetween: 25
217          },
218          800: {
219            slidesPerView: 2,
220            spaceBetween: 25
221          },
222          1025: {
223            slidesPerView: 3,
224            spaceBetween: 25
225          }
226        }
227      });
228    };
229    const imageCarousel = () => {
230      let swiper = new Swiper(".image-carousel .swiper", {
231        slidesPerView: 2.4,
232        spaceBetween: 10,
233        rewind: false,
234        speed: 800,
235        // autoplay: {
236        //   delay: 5000
237        // },
238        navigation: {
239          nextEl: ".image-carousel .image-slider-next",
240          prevEl: ".image-carousel .image-slider-prev"
241        },
242        pagination: {
243          el: '.image-carousel .swiper-pagination',
244          type: 'bullets'
245        },
246        breakpoints: {
247          0: {
248            slidesPerView: 2,
249            spaceBetween: 10
250          },
251          500: {
252            slidesPerView: 2.5,
253            spaceBetween: 25
254          },
255          1024: {
256            slidesPerView: 3,
257            spaceBetween: 25
258          },
259          1025: {
260            slidesPerView: 4,
261            spaceBetween: 25
262          }
263        }
264      });
265    };
266    const venueAccordion = () => {
267      const block = $('.venue-area-accordion');
268      if (block.length) {
269        const accordionHeadings = block.find('.accordion-single .accordion-heading');
270        accordionHeadings.on('click', function () {
271          if (!$(this).parent().hasClass('active')) {
272            block.find('.accordion-single.active').find('.accordion-body').stop().slideToggle();
273            block.find('.accordion-single.active').toggleClass('active');
274          }
275          $(this).parent().toggleClass('active');
276          $(this).parent().find('.accordion-body').stop().slideToggle();
277        });
278      } else {}
279    };
280    const fwImageBlock = () => {
281      const block = $('.full-width-image');
282      const iframe = block.find('.image');
283      if (iframe.length) {
284        const height = iframe.height();
285        const half = height / 2;
286        const topBlock = block.prev().find('.site-container');
287        const topBlockPBNum = parseInt(topBlock.css('padding-bottom').replace("px", ""), 10);
288        const newPB = topBlockPBNum + half;
289        const nextBlock = block.next().find('.site-container');
290        const nextBlockPTBNum = parseInt(nextBlock.css('padding-top').replace("px", ""), 10);
291        const newPT = nextBlockPTBNum + half;
292        topBlock.css('padding-bottom', newPB + 'px');
293        nextBlock.css('padding-top', newPT + 'px');
294      }
295    };
296    const timelineBlock = () => {
297      if ($('.timeline-block').length) {
298        const items = document.querySelectorAll('.timeline-block .card');
299        const currentLine = document.querySelectorAll('.timeline-block span.line.current');
300        if (window.innerWidth > 1024) {
301          items.forEach((item, index) => {
302            gsap.to(item, {
303              scrollTrigger: {
304                trigger: item,
305                start: 'top 50%',
306                // Start animation when the top of the item reaches the bottom of the viewport
307                end: 'center 0%',
308                // End animation when the center of the item is at the top of the viewport
309                toggleClass: 'active'
310              }
311            });
312          });
313          gsap.to(currentLine, {
314            height: 'calc(100% - 120px)',
315            scrollTrigger: {
316              trigger: '.timeline-block .right-container',
317              start: 'top top',
318              end: 'bottom top',
319              scrub: true
320            }
321          });
322        } else if (window.innerWidth > 900) {
323          items.forEach((item, index) => {
324            gsap.to(item, {
325              scrollTrigger: {
326                trigger: item,
327                start: 'bottom 70%',
328                // Start animation when the top of the item reaches the bottom of the viewport
329                end: 'top 20%',
330                // End animation when the center of the item is at the top of the viewport
331                toggleClass: 'active'
332              }
333            });
334          });
335          gsap.to(currentLine, {
336            height: 'calc(100% - 120px)',
337            scrollTrigger: {
338              trigger: '.timeline-block .right-container',
339              start: 'top top',
340              end: 'bottom top',
341              scrub: true
342            }
343          });
344        } else if (window.innerWidth > 800) {
345          items.forEach((item, index) => {
346            gsap.to(item, {
347              scrollTrigger: {
348                trigger: item,
349                start: 'top 30%',
350                // Start animation when the top of the item reaches the bottom of the viewport
351                end: 'top 00%',
352                // End animation when the center of the item is at the top of the viewport
353                toggleClass: 'active'
354              }
355            });
356          });
357          gsap.to(currentLine, {
358            height: 'calc(100% - 120px)',
359            scrollTrigger: {
360              trigger: '.timeline-block .right-container',
361              start: 'top top',
362              end: 'bottom top',
363              scrub: true
364            }
365          });
366        } else {
367          items.forEach((item, index) => {
368            gsap.to(item, {
369              scrollTrigger: {
370                trigger: item,
371                start: 'top 30%',
372                // Start animation when the top of the item reaches the bottom of the viewport
373                end: 'top 00%',
374                // End animation when the center of the item is at the top of the viewport
375                toggleClass: 'active'
376              }
377            });
378          });
379          gsap.to(currentLine, {
380            height: 'calc(100% - 40px)',
381            scrollTrigger: {
382              trigger: '.timeline-block .right-container',
383              start: 'top top',
384              end: 'bottom top',
385              scrub: true
386            }
387          });
388        }
389      }
390    };
391    const pagination = () => {
392      const pagination = $('.pagination-container .pagination');
393      const prev = pagination.find('.pag-nav__prev');
394      const next = pagination.find('.pag-nav__next');
395      function checkPag(prev, next) {
396        if (!$('.pag-number__active').prev().length) {
397          prev.addClass('disabled');
398        } else {
399          if (prev.hasClass('disabled')) {
400            prev.removeClass('disabled');
401          }
402        }
403        if (!$('.pag-number__active').next().length) {
404          next.addClass('disabled');
405        } else {
406          if (next.hasClass('disabled')) {
407            next.removeClass('disabled');
408          }
409        }
410      }
411      checkPag(prev, next);
412      /*if (pagination.length) {
413        const numbers = pagination.find('.pag-number');
414        numbers.on('click', function (e) {
415          e.preventDefault();
416          numbers.removeClass('pag-number__active');
417          $(this).addClass('pag-number__active');
418          checkPag(prev, next);
419        });
420      }*/
421      /*prev.on('click', function (e) {
422        e.preventDefault();
423        if (!$(this).hasClass('disabled')) {
424          let curActive = $('.pag-number__active');
425          curActive.prev().addClass('pag-number__active');
426          curActive.removeClass('pag-number__active');
427        }
428        checkPag(prev, next);
429      });
430      next.on('click', function (e) {
431        e.preventDefault();
432        if (!$(this).hasClass('disabled')) {
433          let curActive = $('.pag-number__active');
434          curActive.next().addClass('pag-number__active');
435          curActive.removeClass('pag-number__active');
436          checkPag(prev, next);
437        }
438      });*/
439    };
440    const textCardCarousel = () => {
441      let swiper = new Swiper(".text-card-carousel .swiper", {
442        slidesPerView: 2.4,
443        spaceBetween: 10,
444        rewind: false,
445        speed: 800,
446        // autoplay: {
447        //   delay: 5000
448        // },
449        navigation: {
450          nextEl: ".text-card-carousel .tc-slider-next",
451          prevEl: ".text-card-carousel .tc-slider-prev"
452        },
453        pagination: {
454          el: '.text-card-carousel .swiper-pagination',
455          type: 'bullets'
456        },
457        breakpoints: {
458          0: {
459            slidesPerView: 1.3,
460            spaceBetween: 10
461          },
462          500: {
463            slidesPerView: 2.3,
464            spaceBetween: 25
465          },
466          1024: {
467            slidesPerView: 3,
468            spaceBetween: 25
469          },
470          1025: {
471            slidesPerView: 4,
472            spaceBetween: 25
473          }
474        }
475      });
476    };
477    const bookingForm = () => {
478      const currentDate = new Date().toDateString();
479      const picker = new Lightpick({
480        field: $('.booking-form-block #date-range')[0],
481        singleDate: false,
482        autoclose: true,
483        numberOfMonths: 2,
484        footer: true,
485        minDate: new Date(),
486        locale: {
487          buttons: {
488            prev: '<svg xmlns="http://www.w3.org/2000/svg" width="8.026" height="14.052" viewBox="0 0 8.026 14.052"><path id="Path_60" data-name="Path 60" d="M46.612,53.223,41,47.612,46.612,42" transform="translate(-40 -40.586)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/></svg>',
489            next: '<svg xmlns="http://www.w3.org/2000/svg" width="8.026" height="14.052" viewBox="0 0 8.026 14.052"><path id="Path_100" data-name="Path 100" d="M799,53.223l5.612-5.612L799,42" transform="translate(-797.586 -40.586)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/></svg>',
490            close: '×',
491            reset: 'Reset',
492            apply: 'Apply'
493          }
494        },
495        onClose: function (start, end) {
496          if (end) {
497            const startDate = start.format('DD/MM/YYYY');
498            const endDate = end.format('DD/MM/YYYY');
499            $('.booking-form-block #date-range').val(startDate + ' - ' + endDate);
500          }
501        }
502      });
503      // picker.show()
504
505      const modal = $('.people-rooms-modal');
506      const rows = modal.find('.row');
507      const peopleInput = $('.input-container.people input');
508      const doneBtn = modal.find('.done-button');
509      rows.each(function () {
510        const label = $(this).find('.label');
511        const take = $(this).find('.take');
512        const total = $(this).find('.total');
513        const add = $(this).find('.add');
514        function updateTotal() {
515          if (total.text() == 0) {
516            take.addClass('disabled');
517          } else {
518            take.removeClass('disabled');
519          }
520        }
521        updateTotal();
522        take.on('click', function () {
523          if (!$(this).hasClass('disabled')) {
524            let totalVal = total.text();
525            total.text(parseInt(totalVal) - 1);
526            updateTotal();
527          }
528        });
529        add.on('click', function () {
530          let totalVal = total.text();
531          total.text(parseInt(totalVal) + 1);
532          updateTotal();
533        });
534      });
535      doneBtn.on('click', function (e) {
536        e.preventDefault();
537        let returnVal = "";
538        let count = "0";
539        rows.each(function () {
540          const val = parseInt($(this).find('.total').text());
541          let label = "";
542          if (val == 0 || val > 1) {
543            label = $(this).find('.label').attr("data-plural");
544          } else {
545            label = $(this).find('.label').attr("data-single");
546          }
547          if (count < 2) {
548            returnVal += val + " " + label + " - ";
549          } else {
550            returnVal += val + " " + label;
551          }
552          count++;
553          modal.stop().fadeOut();
554        });
555        peopleInput.val(returnVal);
556      });
557      peopleInput.on('click', function () {
558        modal.stop().fadeIn();
559      });
560    };
561    const load = () => {
562      console.log("document load!");
563    };
564
565    /**
566     * Return our module's publicly accessible functions.
567     */
568    return {
569      ready: ready,
570      menuJS: menuJS,
571      homepageHero: homepageHero,
572      latestEandA: latestEandA,
573      hotelSlider: hotelSlider,
574      eventSingleHero: eventSingleHero,
575      videoBlock: videoBlock,
576      wtdSlider: wtdSlider,
577      imageCarousel: imageCarousel,
578      venueAccordion: venueAccordion,
579      fwImageBlock: fwImageBlock,
580      timelineBlock: timelineBlock,
581      pagination: pagination,
582      textCardCarousel: textCardCarousel,
583      bookingForm: bookingForm,
584      load: load
585    };
586  })();
587
588  /*******************************************************************************/
589  /* MODULE INITIALISE
590  /*******************************************************************************/
591
592  jQuery(document).ready(function ($) {
593    Base.ready();
594    Base.menuJS();
595    Base.homepageHero();
596    Base.latestEandA();
597    Base.hotelSlider();
598    Base.eventSingleHero();
599    Base.videoBlock();
600    Base.wtdSlider();
601    Base.imageCarousel();
602    Base.venueAccordion();
603    Base.fwImageBlock();
604    Base.timelineBlock();
605    Base.pagination();
606    Base.textCardCarousel();
607    Base.bookingForm();
608  });
609  jQuery(window).on("load", function ($) {
610    Base.load();
611  });
612})(window, document, jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.