1"use strict"; 2 3/*****************************************************************************/ 4 5/* VARIABLE DECLARATION ***************************************/ 6 7/*****************************************************************************/ 8// eslint-disable-next-line no-unused-vars 9var ll; 10var is_mobile = false; 11$(window).on('load', function () { 12 /*****************************************************************************/ 13 14 /* CALL TO FUNCTIONS ******************************************/ 15 16 /*****************************************************************************/ 17 setupCommon(); 18 19 if (isAbout()) { 20 setupMCAjaxAbout(); 21 } 22}); 23/*****************************************************************************/ 24 25/* ABOUT PAGE ***************************************/ 26 27/*****************************************************************************/ 28 29function setupMCAjaxAbout() { 30 $('#hamburger-newsletter-pop-up').on('click', function () { 31 $('.newsletter-pop-up').removeClass('active'); 32 setTimeout(function () { 33 $('.newsletter-pop-up').remove(); 34 }, 400); 35 }); 36 $('#mc-embedded-subscribe-form').ajaxChimp({ 37 callback: callbackFunction 38 }); 39} 40/*****************************************************************************/ 41 42/* FUNCTION DECLARATION ***************************************/ 43 44/*****************************************************************************/ 45 46 47function setupCommon() { 48 setupMenuToggle(); 49 setupImages(); 50 setupAOS(); 51 fadeInElement(); 52 53 if (deviceDetector.device == 'desktop') {// You're on a desktop. 54 // console.log('desktop'); 55 } else { 56 if (deviceDetector.device == 'tablet') {// You're on a tablet. 57 // console.log('tablet'); 58 } else {} // console.log('phone'); 59 // You're on a phone. 60 61 } 62 63 setIsMobileBool(); 64} 65 66function setIsMobileBool() { 67 // var windowsize = $(window).width(); 68 // if (windowsize < 991){ 69 // is_mobile = true; 70 // } 71 //same as below 72 is_mobile = $(window).width() < 991 ? true : false; 73} 74 75function setupMenuToggle() { 76 var $menu_toggle = $('.header-content-burger .hamburger'); 77 var $nav = $('.navigation'); 78 var $header = $('#header'); 79 $menu_toggle.on('click', function () { 80 $nav.toggleClass('active'); 81 $header.toggleClass('menu-opened'); 82 $(this).toggleClass('is-active'); 83 }); 84} 85 86function setupImages() { 87 ll = new LazyLoad({ 88 elements_selector: ".lazy-image", 89 threshold: 0, 90 load_delay: 100 91 }); 92} 93 94function setupAOS() { 95 AOS.init({ 96 // Global settings: 97 disable: false, 98 // accepts following values: 'phone', 'tablet', 'mobile', boolean, expression or function 99 startEvent: 'DOMContentLoaded', 100 // name of the event dispatched on the document, that AOS should initialize on 101 initClassName: 'aos-init', 102 // class applied after initialization 103 animatedClassName: 'aos-animate', 104 // class applied on animation 105 useClassNames: false, 106 // if true, will add content of `data-aos` as classes on scroll 107 disableMutationObserver: false, 108 // disables automatic mutations' detections (advanced) 109 debounceDelay: 50, 110 // the delay on debounce used while resizing window (advanced) 111 throttleDelay: 99, 112 // the delay on throttle used while scrolling the page (advanced) 113 // Settings that can be overridden on per-element basis, by `data-aos-*` attributes: 114 offset: 50, 115 // offset (in px) from the original trigger point 116 delay: 0, 117 // values from 0 to 3000, with step 50ms 118 duration: 400, 119 // values from 0 to 3000, with step 50ms 120 easing: 'ease', 121 // default easing for AOS animations 122 once: true, 123 // whether animation should happen only once - while scrolling down 124 mirror: false, 125 // whether elements should animate out while scrolling past them 126 anchorPlacement: 'top-bottom' // defines which position of the element regarding to window should trigger the animation 127 128 }); 129} // eslint-disable-next-line no-unused-vars 130 131 132function fadeInElement() { 133 var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ".fadeInElement"; 134 $(el).each(function (i) { 135 $(this).stop(true, true).delay((i + 1) * 150).fadeTo(300, 1); 136 }); 137} 138 139function isSmallScreen() { 140 if ($(window).width() > 991) { 141 return false;
142 } else { 143 return true; 144 } 145} // Extra methods 146 147 148function isHome() { 149 if ($("body").hasClass("home")) { 150 return true; 151 } 152 153 return false; 154} 155 156function isAbout() { 157 if ($("body").hasClass("page-template-page-about")) { 158 return true; 159 } 160 161 return false; 162} 163 164function isSingleExhibition() { 165 if ($("body").hasClass("single-exhibitions")) { 166 return true; 167 } 168 169 return false; 170} 171 172function isArchiveExhibition() { 173 if ($("body").hasClass("post-type-archive-exhibitions")) { 174 return true; 175 } 176 177 return false; 178} 179 180function isSingleEvent() { 181 if ($("body").hasClass("single-events")) { 182 return true; 183 } 184 185 return false; 186} 187 188function isArchiveEvent() { 189 if ($("body").hasClass("post-type-archive-events")) { 190 return true; 191 } 192 193 return false; 194} 195 196function isSingleProduct() { 197 if ($("body").hasClass("single-product")) { 198 return true; 199 } 200 201 return false; 202} 203 204function isArchiveProduct() { 205 if ($("body").hasClass("post-type-archive-product")) { 206 return true; 207 } 208 209 return false; 210} 211 212function isPageCart() { 213 if ($("body").hasClass("woocommerce-cart")) { 214 return true; 215 } 216 217 return false; 218} 219 220function isPageCheckout() { 221 if ($("body").hasClass("woocommerce-checkout")) { 222 return true; 223 } 224 225 return false; 226} 227 228function isVisitPage() { 229 if ($("body").hasClass("page-template-page-general") || $("body").hasClass("page-template-page-visit")) { 230 return true; 231 } 232 233 return false; 234} //https://github.com/PoeHaH/devicedetector/blob/master/devicedetector-production.js 235 236 237var deviceDetector = function () { 238 /* 239 if(deviceDetector.device == 'desktop') 240 // You're on a desktop. 241 else{ 242 if(deviceDetector.device == 'tablet') 243 // You're on a tablet. 244 else 245 // You're on a phone. 246 } 247 */ 248 var ua = navigator.userAgent.toLowerCase(); 249 250 var detect = function detect(s) { 251 if (s === undefined) s = ua;else ua = s.toLowerCase(); 252 253 if (/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(ua)) { 254 return 'tablet'; 255 } else { 256 if (/(mobi|ipod|phone|blackberry|opera mini|fennec|minimo|symbian|psp|nintendo ds|archos|skyfire|puffin|blazer|bolt|gobrowser|iris|maemo|semc|teashark|uzard)/.test(ua)) { 257 return 'phone'; 258 } else { 259 return 'desktop'; 260 } 261 } 262 }; 263 264 return { 265 device: detect(), 266 detect: detect, 267 isMobile: detect() != 'desktop' ? true : false, 268 userAgent: ua 269 }; 270}(); 271/*****************************************************************************/ 272 273/* JQUERY EVENTS ***************************************/ 274 275/*****************************************************************************/ 276 277 278$(window).on('scroll', function () {}); 279$(window).on('resize', function () { 280 var windowsize = $(window).width(); 281 var reload = false; 282 283 if (is_mobile) { 284 if (windowsize >= 991) { 285 reload = true; 286 } 287 } else { 288 if (windowsize < 991) { 289 reload = true; 290 } 291 } 292 293 if (reload) { 294 window.location.href = location.href; 295 reload = false; 296 } 297}); 298"use strict"; 299 300/*****************************************************************************/ 301 302/* VARIABLE DECLARATION ***************************************/ 303 304/*****************************************************************************/ 305$(window).on('load', function () { 306 /*****************************************************************************/ 307 308 /* CALL TO FUNCTIONS ******************************************/ 309 310 /*****************************************************************************/ 311 if (isHome()) { 312 // console.log( 313 // '<!-- ----------------------------------------------------- -->\n' + 314 // '<!-- HOME -->\n' + 315 // '<!-- ----------------------------------------------------- -->'); 316 setupHome(); 317 } 318}); 319/*****************************************************************************/ 320 321/* FUNCTION DECLARATION ***************************************/ 322 323/*****************************************************************************/ 324 325function setupHome() { 326 //specific for mobile 327 if (deviceDetector.device == 'desktop') {//console.log('desktop'); 328 } else { 329 var vh = window.innerHeight * 0.01; 330 document.documentElement.style.setProperty('--vh', "".concat(vh, "px")); 331 332 if (deviceDetector.device == 'tablet') {// You're on a tablet. 333 //console.log('tablet'); 334 } else {} //console.log('phone'); 335 // You're on a phone. 336 337 } 338 339 setupSwiperHome(); 340 checkCookieforPopUp(); 341 setupMCAjax(); 342} 343 344function setupSwiperHome() { 345 var swiperHomeTop = new Swiper('.swiper-top', { 346 // in order to trigger the on('init') method i need to have init: false, 347 loop: true, 348 slidesPerView: 1, 349 // autoplay: { 350 // delay: 8000, 351 // disableOnInteraction: false, 352 // }, 353 // Disable preloading of all images 354 preloadImages: false, 355 // Enable lazy loading 356 lazy: { 357 // tell swiper to load images before they appear 358 loadPrevNext: true, 359 // amount of images to load 360 loadPrevNextAmount: 3 361 }, 362 spaceBetween: 0, 363 pagination: {}, 364 navigation: { 365 nextEl: '.swiper-button-next', 366 prevEl: '.swiper-button-prev' 367 }, 368 on: {
369 init: function init() {}, 370 progress: function progress(e) {}, 371 slideChange: function slideChange() {}, 372 lazyImageReady: function lazyImageReady(slideEl, imageEl) {} 373 } 374 }); 375 var swiperHomeBottom = new Swiper('.swiper-bottom', { 376 // in order to trigger the on('init') method i need to have init: false, 377 loop: true, 378 slidesPerView: 1, 379 autoplay: { 380 delay: 8000, 381 disableOnInteraction: false 382 }, 383 // Disable preloading of all images 384 preloadImages: false, 385 // Enable lazy loading 386 lazy: { 387 // tell swiper to load images before they appear 388 loadPrevNext: true, 389 // amount of images to load 390 loadPrevNextAmount: 3 391 }, 392 spaceBetween: 0, 393 pagination: {}, 394 navigation: { 395 nextEl: '.swiper-button-next', 396 prevEl: '.swiper-button-prev' 397 }, 398 controller: { 399 control: swiperHomeTop 400 }, 401 on: { 402 init: function init() {}, 403 progress: function progress(e) {}, 404 slideChange: function slideChange() {}, 405 lazyImageReady: function lazyImageReady(slideEl, imageEl) {} 406 } 407 }); 408 swiperHomeTop.controller.control = swiperHomeBottom; 409 swiperHomeTop.update(); 410} 411 412function checkCookieforPopUp() { 413 $('.newsletter-pop-up').addClass('active'); return; 414 415 if (!Cookies.get('hide_popup')) { 416 Cookies.set('hide_popup', true, { 417 expires: 7 418 }); 419 $('.newsletter-pop-up').addClass('active'); 420 } else { 421 $('.newsletter-pop-up').remove(); 422 } 423} 424 425function callbackFunction(resp) { 426 var messageClass = '.newsletter-pop-up-box .message'; 427 428 if (!$(messageClass).length) { 429 $('.newsletter-pop-up-box').append( "<p class='message'></p>" ); 430 } 431 432 if (resp.result === 'success') { 433 $(messageClass).html( "Thanks for subscribing!" ); 434 435 setTimeout(function () { 436 $('.newsletter-pop-up').fadeOut(1500); 437 }, 1500); 438 } else { 439 $(messageClass).html( 440 "Sorry, there appears to be a problem. Try again later..." 441 ); 442 } 443} 444 445function setupMCAjax() { 446 $('#hamburger-newsletter-pop-up').on('click', function () { 447 $('.newsletter-pop-up').removeClass('active'); 448 setTimeout(function () { 449 $('.newsletter-pop-up').remove(); 450 }, 400); 451 }); 452 $('#mc-embedded-subscribe-form').ajaxChimp({ 453 callback: callbackFunction 454 }); 455} 456/*****************************************************************************/ 457 458/* JQ EVENTS *********************************************/ 459 460/*****************************************************************************/ 461 462 463$(window).on('scroll', function () {}); 464"use strict"; 465 466/*****************************************************************************/ 467 468/* VARIABLE DECLARATION ***************************************/ 469 470/*****************************************************************************/ 471// eslint-disable-next-line no-unused-vars 472var ll; 473$(window).on('load', function () { 474 /*****************************************************************************/ 475 476 /* CALL TO FUNCTIONS ******************************************/ 477 478 /*****************************************************************************/ 479 if (isSingleExhibition()) { 480 // console.log( 481 // '<!-- ----------------------------------------------------- -->\n' + 482 // '<!-- SINGLE EXHIBITION -->\n' + 483 // '<!-- ----------------------------------------------------- -->'); 484 setupSingleExhibition(); 485 } else if (isArchiveExhibition()) { 486 // console.log( 487 // '<!-- ----------------------------------------------------- -->\n' + 488 // '<!-- ARCHIVE EXHIBITION -->\n' + 489 // '<!-- ----------------------------------------------------- -->'); 490 setupArchiveExhibition(); 491 } 492}); 493/*****************************************************************************/ 494 495/* FUNCTION DECLARATION ***************************************/ 496 497/*****************************************************************************/ 498 499/*------------------------------------*\ 500SINGLE EXHIBITION 501\*------------------------------------*/ 502 503function setupSingleExhibition() { 504 var $exhibition_container = $('.p-s-exhibition'); 505 var template_v = 't1'; 506 507 if ($exhibition_container.hasClass('p-s-exhibition-t2')) { 508 template_v = 't2'; 509 } 510 511 if (deviceDetector.device == 'desktop') { 512 setupPositionOfImagesExhibition(template_v); 513 setMinHeightOfExhibition(template_v); 514 } else { 515 if (deviceDetector.device == 'tablet') { 516 // You're on a tablet. 517 setMinHeightOfExhibition(template_v); 518 } else { 519 setupSwiperExhibitions(); 520 } // You're on a phone. 521 522 } 523 524 setupToggleReadMoreExhibition(template_v); 525 setupArchiveExhibitionsFilters(); 526} 527 528function setupToggleReadMoreExhibition(template_v) { 529 var $read_more_toggle = $('.p-s-exhibition-content-readmore'); 530 var $read_more_text = $('.p-s-exhibition-content-text_3'); 531 var $exhibition_container = $('.p-s-exhibition-content-inside'); 532 var $img_2 = $('.p-s-exhibition-content-image_2'); 533 $read_more_toggle.on('click', function () { 534 if (template_v == 't1') $img_2.fadeOut(); 535 $read_more_text.fadeToggle(600, function () { 536 if (template_v == 't1') $img_2.fadeIn(); 537 $exhibition_container.toggleClass('readmore-opened'); 538 if (template_v == 't1') updatepositionOfImage2Exhibition(); 539 }); 540 }); 541} 542 543function setupPositionOfImagesExhibition(template_v) { 544 var $img_1 = $('.p-s-exhibition-content-image_1'); 545 var $img_2 = $('.p-s-exhibition-content-image_2'); 546 var $img_3 = $('.p-s-exhibition-content-image_3'); 547 548 if (template_v == 't1') { 549 updatepositionOfImage2Exhibition(); 550 551 if ($img_3.find('img').length) { 552 //image 3 depends on the bottom of image 1 553 var img3_to_top = $img_1.offset().top + $img_1.height() + 524; 554 $img_3.css('top', img3_to_top); 555 } 556 } else { 557 if ($img_2.find('img').length) { 558 //image 3 depends on the bottom of image 1 559 var img2_to_top = $img_1.offset().top + $img_1.height() + 330; 560 $img_2.css('top', img2_to_top); 561 } 562 } 563} 564 565function updatepositionOfImage2Exhibition() { 566 var $img_2 = $('.p-s-exhibition-content-image_2'); //image 2 depends on the bottom part of credits 567 568 var $credits = $('.p-s-exhibition-content-credits'); 569 var credits_bottom = $credits.offset().top + $credits.height(); 570 var img2_top = credits_bottom + 225; 571 $img_2.css('top', img2_top); 572} 573 574function setMinHeightOfExhibition(template_v) { 575 var $container = $('.p-s-exhibition'); 576 var $img_3 = $('.p-s-exhibition-content-image_3'); 577 578 if (template_v == 't1') { 579 var height = $img_3.offset().top + $img_3.height() + 240; 580 $container.css('min-height', height); 581 } else { 582 var height_2 = $img_3.offset().top + $img_3.height() + 330; 583 $container.css('min-height', height_2); 584 } 585} 586/*------------------------------------*\ 587ARCHIVE EXHIBITION 588\*------------------------------------*/ 589 590 591function setupArchiveExhibition() { 592 if (deviceDetector.device == 'desktop') {//console.log('desktop'); 593 } else { 594 if (deviceDetector.device == 'tablet') { 595 // You're on a tablet. 596 //console.log('tablet'); 597 setupSwiperExhibitions(); 598 } else { 599 //console.log('phone'); 600 setupSwiperExhibitions(); 601 } // You're on a phone. 602 603 } 604 605 setupArchiveExhibitionsFilters(); 606} 607 608function setupSwiperExhibitions() { 609 var $b_all = $('.slide-exhibition-header-right #e_all'); 610 var $b_upcoming = $('.slide-exhibition-header-right #e_upcoming'); 611 var $b_past = $('.slide-exhibition-header-right #e_past'); 612 var $exhibitions_container = $('.swiper-container'); 613 var swiper = new Swiper('.swiper-exhibition-mobile', { 614 // in order to trigger the on('init') method i need to have init: false, 615 // Disable preloading of all images 616 //preloadImages: false, 617 // Enable lazy loading 618 //lazy: { 619 // tell swiper to load images before they appear 620 // loadPrevNext: true, 621 // amount of images to load 622 // loadPrevNextAmount: 1, 623 //}, 624 centeredSlides: false, 625 breakpoints: { 626 // when window width is >= 0 627 0: { 628 slidesPerView: 1.3, 629 spaceBetween: 26 630 }, 631 // when window width is >= 768 632 768: { 633 slidesPerView: 2.3, 634 spaceBetween: 26 635 } 636 }, 637 on: {
638 init: function init() {}, 639 progress: function progress() {}, 640 slideChange: function slideChange() {} 641 } 642 }); 643 $b_all.on('click', function () { 644 $exhibitions_container.fadeOut(300, function () { 645 swiper.destroy(); 646 $(".swiper-element").addClass('swiper-slide').removeClass("non-swiper-slide").show(); 647 swiper = new Swiper('.swiper-container', { 648 // in order to trigger the on('init') method i need to have init: false, 649 // Disable preloading of all images 650 //preloadImages: false, 651 // Enable lazy loading 652 //lazy: { 653 // tell swiper to load images before they appear 654 // loadPrevNext: true, 655 // amount of images to load 656 // loadPrevNextAmount: 1, 657 //}, 658 centeredSlides: false, 659 breakpoints: { 660 // when window width is >= 320px 661 0: { 662 slidesPerView: 1.3, 663 spaceBetween: 26 664 }, 665 // when window width is >= 480px 666 768: { 667 slidesPerView: 2.3, 668 spaceBetween: 26 669 } 670 }, 671 on: { 672 init: function init() {}, 673 progress: function progress() {}, 674 slideChange: function slideChange() {} 675 } 676 }); 677 $exhibitions_container.fadeIn(); 678 }); 679 }); 680 $b_upcoming.on('click', function () { 681 $exhibitions_container.fadeOut(300, function () { 682 $(".swiper-slide").not("[data-order='1']").addClass("non-swiper-slide").removeClass("swiper-slide").hide(); 683 $("[data-order='1']").removeClass("non-swiper-slide").addClass("swiper-slide").attr("style", null).show(); 684 swiper.destroy(); 685 swiper = new Swiper('.swiper-container', { 686 // in order to trigger the on('init') method i need to have init: false, 687 // Disable preloading of all images 688 //preloadImages: false, 689 // Enable lazy loading 690 //lazy: { 691 // tell swiper to load images before they appear 692 // loadPrevNext: true, 693 // amount of images to load 694 // loadPrevNextAmount: 1, 695 //}, 696 centeredSlides: false, 697 breakpoints: { 698 // when window width is >= 320px 699 0: { 700 slidesPerView: 1.3, 701 spaceBetween: 26 702 }, 703 // when window width is >= 480px 704 768: { 705 slidesPerView: 2.3, 706 spaceBetween: 26 707 } 708 }, 709 on: { 710 init: function init() {}, 711 progress: function progress() {}, 712 slideChange: function slideChange() {} 713 } 714 }); 715 $exhibitions_container.fadeIn(); 716 }); 717 }); 718 $b_past.on('click', function () { 719 $exhibitions_container.fadeOut(300, function () { 720 $(".swiper-slide").not("[data-order='-1']").addClass("non-swiper-slide").removeClass("swiper-slide").hide(); 721 $("[data-order='-1']").removeClass("non-swiper-slide").addClass("swiper-slide").attr("style", null).show(); 722 swiper.destroy(); 723 swiper = new Swiper('.swiper-container', { 724 // in order to trigger the on('init') method i need to have init: false, 725 // Disable preloading of all images 726 //preloadImages: false, 727 // Enable lazy loading 728 //lazy: { 729 // tell swiper to load images before they appear 730 // loadPrevNext: true, 731 // amount of images to load 732 // loadPrevNextAmount: 1, 733 //}, 734 centeredSlides: false, 735 breakpoints: { 736 // when window width is >= 320px 737 0: { 738 slidesPerView: 1.3, 739 spaceBetween: 26 740 }, 741 // when window width is >= 480px 742 768: { 743 slidesPerView: 2.3, 744 spaceBetween: 26 745 } 746 }, 747 on: { 748 init: function init() {}, 749 progress: function progress() {}, 750 slideChange: function slideChange() {} 751 } 752 }); 753 $exhibitions_container.fadeIn(); 754 }); 755 }); 756} 757 758function setupArchiveExhibitionsFilters() { 759 console.log('Method from: Exhibition'); 760 var $b_all = $('.collection-exhibition-header-right #e_all'); 761 var $b_upcoming = $('.collection-exhibition-header-right #e_upcoming'); 762 var $b_past = $('.collection-exhibition-header-right #e_past'); 763 var $exhibitions_container = $('.collection-exhibition-list'); 764 var $all_exhibitions = $('.collection-exhibition-list-single'); 765 $b_all.on('click', function () { 766 console.log('all'); 767 $exhibitions_container.fadeOut(300, function () { 768 $all_exhibitions.css('order', ''); 769 $exhibitions_container.fadeIn(); 770 }); 771 $('.collection-exhibition-header-right span').removeClass('active'); 772 $(this).addClass('active'); 773 }); 774 $b_upcoming.on('click', function () { 775 console.log('upcoming'); 776 $exhibitions_container.fadeOut(300, function () { 777 $all_exhibitions.each(function () { 778 $(this).css('order', $(this).attr('data-order') * -1); 779 }); 780 $exhibitions_container.fadeIn(); 781 }); 782 $('.collection-exhibition-header-right span').removeClass('active'); 783 $(this).addClass('active'); 784 }); 785 $b_past.on('click', function () { 786 console.log('past'); 787 $exhibitions_container.fadeOut(300, function () { 788 $all_exhibitions.each(function () { 789 $(this).css('order', $(this).attr('data-order')); 790 }); 791 $exhibitions_container.fadeIn(); 792 }); 793 $('.collection-exhibition-header-right span').removeClass('active'); 794 $(this).addClass('active'); 795 }); 796} 797/*****************************************************************************/ 798 799/* JQ EVENTS *********************************************/ 800 801/*****************************************************************************/ 802 803 804$(window).on('scroll', function () {}); 805"use strict"; 806 807/*****************************************************************************/ 808 809/* VARIABLE DECLARATION ***************************************/ 810 811/*****************************************************************************/ 812// eslint-disable-next-line no-unused-vars 813var ll; 814$(window).on('load', function () { 815 /*****************************************************************************/ 816 817 /* CALL TO FUNCTIONS ******************************************/ 818 819 /*****************************************************************************/ 820 if (isSingleEvent()) { 821 // console.log( 822 // '<!-- ----------------------------------------------------- -->\n' + 823 // '<!-- SINGLE EVENT -->\n' + 824 // '<!-- ----------------------------------------------------- -->'); 825 setupSingleEvent(); 826 } else if (isArchiveEvent()) { 827 // console.log( 828 // '<!-- ----------------------------------------------------- -->\n' + 829 // '<!-- ARCHIVE EVENTS -->\n' + 830 // '<!-- ----------------------------------------------------- -->'); 831 setupArchiveEvent(); 832 } 833}); 834/*****************************************************************************/ 835 836/* FUNCTION DECLARATION ***************************************/ 837 838/*****************************************************************************/ 839 840/*------------------------------------*\ 841SINGLE EXHIBITION 842\*------------------------------------*/ 843 844function setupSingleEvent() { 845 if (deviceDetector.device == 'desktop') { 846 setupPositionOfImage2Event(); 847 setMinHeightOfEvent(); 848 } else { 849 // 850 if (deviceDetector.device == 'tablet') {// 851 } else { 852 setupSwiperEvents(); 853 } 854 } 855} 856 857function setupPositionOfImage2Event() { 858 var $img_1 = $('.p-s-event-content-image_1'); 859 var $img_2 = $('.p-s-event-content-image_2'); 860 var $img_infromation = $('.p-s-event-content-information'); //check if position of information is further down that the end of the image 861 862 var information_bottom = $img_infromation.offset().top + $img_infromation.height(); 863 var img1_bottom = $img_1.offset().top + $img_1.height(); 864 865 if (information_bottom > img1_bottom) { 866 var margin_top_img_2 = information_bottom + 139; 867 $img_2.css('top', margin_top_img_2); 868 } else { 869 var _margin_top_img_ = img1_bottom + 139; 870 871 $img_2.css('top', _margin_top_img_); 872 } 873} 874 875function setMinHeightOfEvent() { 876 var $container = $('.p-s-event'); 877 var $img_2 = $('.p-s-event-content-image_2'); 878 var height_2 = $img_2.offset().top + $img_2.height() + 300; 879 $container.css('min-height', height_2); 880 $container.css('padding-bottom', 0); 881} 882/*------------------------------------*\ 883ARCHIVE EXHIBITION 884\*------------------------------------*/ 885 886 887function setupArchiveEvent() { 888 if (deviceDetector.device == 'desktop') {// 889 } else { 890 // 891 if (deviceDetector.device == 'tablet') {// 892 } else { 893 setupSwiperEvents(); 894 } 895 } 896} 897 898function setupSwiperEvents() { 899 var swiper = new Swiper('.swiper-event-mobile', { 900 // in order to trigger the on('init') method i need to have init: false, 901 // Disable preloading of all images 902 //preloadImages: false, 903 // Enable lazy loading 904 //lazy: { 905 // tell swiper to load images before they appear 906 // loadPrevNext: true, 907 // amount of images to load 908 // loadPrevNextAmount: 1, 909 //}, 910 centeredSlides: false, 911 breakpoints: { 912 // when window width is >= 320px 913 0: { 914 slidesPerView: 1.3, 915 spaceBetween: 26 916 }, 917 // when window width is >= 480px 918 768: { 919 slidesPerView: 2.3, 920 spaceBetween: 26 921 } 922 }, 923 on: {
924 init: function init() {}, 925 progress: function progress() {}, 926 slideChange: function slideChange() {} 927 } 928 }); 929} 930/*****************************************************************************/ 931 932/* JQ EVENTS *********************************************/ 933 934/*****************************************************************************/ 935 936 937$(window).on('scroll', function () {}); 938"use strict"; 939 940/*****************************************************************************/ 941 942/* VARIABLE DECLARATION ***************************************/ 943 944/*****************************************************************************/ 945// eslint-disable-next-line no-unused-vars 946var ll; 947var break_fadeIn = false; 948$(window).on('load', function () { 949 /*****************************************************************************/ 950 951 /* CALL TO FUNCTIONS ******************************************/ 952 953 /*****************************************************************************/ 954 if (isSingleProduct()) { 955 console.log('<!-- ----------------------------------------------------- -->\n' + '<!-- SINGLE Product -->\n' + '<!-- ----------------------------------------------------- -->'); 956 setupSingleProduct(); 957 } else if (isArchiveProduct()) { 958 console.log('<!-- ----------------------------------------------------- -->\n' + '<!-- PRODUCT DISPLAY LIST -->\n' + '<!-- ----------------------------------------------------- -->'); 959 setupArchivePage(); 960 } else if (isPageCart()) { 961 console.log('<!-- ----------------------------------------------------- -->\n' + '<!-- CART -->\n' + '<!-- ----------------------------------------------------- -->'); 962 setupPageCart(); 963 } else if (isPageCheckout()) { 964 console.log('<!-- ----------------------------------------------------- -->\n' + '<!-- CHECKOUT -->\n' + '<!-- ----------------------------------------------------- -->'); 965 setupPageCheckout(); 966 } 967}); 968/*****************************************************************************/ 969 970/* FUNCTION DECLARATION ***************************************/ 971 972/*****************************************************************************/ 973 974/*------------------------------------*\ 975SINGLE PRODUCT 976\*------------------------------------*/ 977 978function setupSingleProduct() { 979 setupSwiperProduct(); 980 setupAjaxifyProduct(); 981} 982 983function setupSwiperProduct() { 984 var swiper = new Swiper('.swiper-container-p-gallery', { 985 // in order to trigger the on('init') method i need to have init: false, 986 // Disable preloading of all images 987 //preloadImages: false, 988 // Enable lazy loading 989 //lazy: { 990 // tell swiper to load images before they appear 991 // loadPrevNext: true, 992 // amount of images to load 993 // loadPrevNextAmount: 1, 994 //}, 995 loop: true, 996 centeredSlides: false, 997 slidesPerView: 1, 998 spaceBetween: 26, 999 pagination: { 1000 el: '.swiper-pagination-p-gallery', 1001 type: 'fraction' 1002 }, 1003 navigation: { 1004 nextEl: '.swiper-button-next', 1005 prevEl: '.swiper-button-prev' 1006 }, 1007 on: { 1008 init: function init() {}, 1009 progress: function progress() {}, 1010 slideChange: function slideChange() {} 1011 } 1012 }); 1013} 1014 1015function setupAjaxifyProduct() { 1016 $('.single_add_to_cart_button').each(function (index) { 1017 $(this).on('click', function (e) { 1018 e.preventDefault(); 1019 var product_id = $(this).attr('data-value'); 1020 var product_title = $(this).attr('data-title'); 1021 var variation_id = '';//$(this).attr('data-value'); 1022 console.log('--------------'); 1023 console.log(product_id); 1024 console.log(product_title); 1025 console.log(variation_id); 1026 console.log(this); 1027 console.log('--------------'); 1028 var quantity = 1; // return 0; 1029 // console.log(woocommerce_params.ajax_url); 1030 // console.log(woocommerce_params); 1031 1032 if (quantity > 0) { 1033 e.preventDefault(); 1034 jQuery.ajax({ 1035 url: woocommerce_params.ajax_url, 1036 type: 'POST', 1037 data: 'action=mode_theme_update_mini_cart&product_id=' + product_id + '&variation_id=' + variation_id + '&quantity=' + quantity + '&mode=add_item', 1038 success: function success(data) { 1039 // console.log("SUCCESS!"); 1040 // console.log(data); 1041 $(document.body).trigger('update_checkout'); // update counter 1042 1043 var $counter = $('#mini-cart-count'); 1044 var currentQuantity = parseInt($counter.html(), 10); 1045 var newQuantity = currentQuantity + 1; 1046 $counter.text(newQuantity); 1047 $('.subheader-product-right-feedback').fadeIn().delay(3000).fadeOut(); 1048 } 1049 }); 1050 return false;
1051 } 1052 }); 1053 }); 1054} 1055/*------------------------------------*\ 1056ARCHIVE PAGE 1057\*------------------------------------*/ 1058 1059 1060function setupArchivePage() { 1061 setupNavigation(); 1062} 1063 1064function setupNavigation() { 1065 var $nav_items = $('.menu-item'); 1066 var $nav_submenu_items = $('.submenu-item'); 1067 $nav_items.on('click', function () { 1068 var category = $(this).data('c-slug'); 1069 $nav_items.removeClass('active'); 1070 $nav_submenu_items.removeClass('active'); 1071 $(this).addClass('active'); 1072 filterElementsNavigationArchiveProduct(category); 1073 }); 1074 $nav_submenu_items.on('click', function (e) { 1075 e.preventDefault(); 1076 e.stopPropagation(); 1077 var category = $(this).data('c-slug'); 1078 $nav_submenu_items.removeClass('active'); 1079 $(this).addClass('active'); 1080 filterElementsNavigationArchiveProduct(category); 1081 }); 1082} 1083 1084function filterElementsNavigationArchiveProduct(category) { 1085 console.log(category); 1086 var $grid_items = $('.a-shop-grid-item'); 1087 var $grid_items_container = $('.a-shop-grid'); 1088 1089 if (category === 'all') { 1090 $grid_items.fadeOut(0); 1091 setTimeout(function () { 1092 var count = 0; 1093 $grid_items.addClass('fadeInItem'); 1094 $grid_items.each(function () { 1095 var t = this; 1096 $(t).stop(true, true).fadeTo(300, 1); 1097 count++; 1098 }); 1099 }, 100); 1100 } else { 1101 var count = 0; // $grid_items.fadeOut(0, function(){ 1102 // if($(this).data('cats').includes(category)){ 1103 // if(!break_fadeIn){ 1104 // var t = this; 1105 // $(t).delay((count + 1) * 150).fadeTo(300, 1); 1106 // count++; 1107 // } 1108 // } 1109 // }); 1110 1111 $grid_items.fadeOut(0); 1112 setTimeout(function () { 1113 var count = 0; 1114 $grid_items.each(function () { 1115 if ($(this).data('cats').includes(category)) { 1116 var t = this; 1117 $(t).stop(true, true).fadeTo(300, 1); 1118 count++; 1119 } 1120 }); 1121 }, 100); 1122 } 1123} 1124 1125function fadeInProductArchiveElement($el) { 1126 el.each(function (i) { 1127 $(this).delay((i + 1) * 150).fadeTo(300, 1); 1128 }); 1129} 1130/*------------------------------------*\ 1131CART PAGE 1132\*------------------------------------*/ 1133 1134 1135function setupPageCart() { 1136 setupObserverFormChange(); 1137 setupCartUpdateQantity(); 1138} // With this method we check when the quantity changes 1139 1140 1141function setupCartUpdateQantity() { 1142 $('input.qty').off('change').on('change', function () { 1143 $("[name='update_cart']").removeAttr('disabled'); 1144 $("[name='update_cart']").trigger('click'); 1145 }); // $( document ).on( 'DOMNodeInserted', function( e ) { 1146 // if ( $( e.target ).hasClass( '.woocommerce-cart-form' ) ) { 1147 // console.log( e.target ); 1148 // } 1149 // } ); 1150} // With this method we check when the form is updated so that we can keep updating the quantity after the first update of the form 1151 1152 1153function setupObserverFormChange() { 1154 if ($('.woocommerce-cart-form').length > 0) { 1155 var observer = new MutationObserver(function (mutationRecords) { 1156 setupCartUpdateQantity(); 1157 setupObserverFormChange(); // setTimeout( function() { 1158 // $( '.woocommerce-notices-wrapper' ).html(''); 1159 // }, 3000 ); 1160 }); 1161 observer.observe($('.woocommerce-cart-form')[0], { 1162 // options: 1163 subtree: true, 1164 // observe the subtree rooted at myNode 1165 childList: true, 1166 // include information childNode insertion/removals 1167 attribute: true // include information about changes to attributes within the subtree 1168 1169 }); 1170 } 1171} 1172/*------------------------------------*\ 1173CHECKOUT PAGE 1174\*------------------------------------*/ 1175 1176 1177function setupPageCheckout() {} 1178/*****************************************************************************/ 1179 1180/* JQ EVENTS *********************************************/ 1181 1182/*****************************************************************************/ 1183 1184 1185$(window).on('scroll', function () {}); 1186"use strict"; 1187 1188/*****************************************************************************/ 1189 1190/* VARIABLE DECLARATION ***************************************/ 1191 1192/*****************************************************************************/ 1193// eslint-disable-next-line no-unused-vars 1194var ll; 1195var break_fadeIn = false;
1196$(window).on('load', function () { 1197 /*****************************************************************************/ 1198 1199 /* CALL TO FUNCTIONS ******************************************/ 1200 1201 /*****************************************************************************/ 1202 if (isVisitPage()) { 1203 console.log('<!-- ----------------------------------------------------- -->\n' + '<!-- VISIT -->\n' + '<!-- ----------------------------------------------------- -->'); 1204 1205 if (deviceDetector.device == 'desktop') { 1206 setupVisitPage(); 1207 } 1208 } 1209}); 1210/*****************************************************************************/ 1211 1212/* FUNCTION DECLARATION ***************************************/ 1213 1214/*****************************************************************************/ 1215 1216/*------------------------------------*\ 1217SINGLE PRODUCT 1218\*------------------------------------*/ 1219 1220function setupVisitPage() { 1221 // setupSwiperProduct(); 1222 // setupAjaxifyProduct(); 1223 setupNav(); 1224} 1225 1226function setupNav() { 1227 $('.p-visit-nav-inside-item span').on("click", function (e) { 1228 var id = $(this).parent().attr("data-section-id"); 1229 var offset = 0; 1230 1231 if (deviceDetector.device == 'desktop') { 1232 offset = 0; 1233 } else { 1234 offset = 80; 1235 } // trigger scroll 1236 1237 1238 $('html, body').animate({ 1239 scrollTop: $('#' + id).offset().top - offset 1240 }, 300); // if supported by the browser we can even update the URL. 1241 // if (window.history && window.history.pushState) { 1242 // history.pushState("", document.title, id); 1243 // } 1244 }); 1245 var controller = new ScrollMagic.Controller(); 1246 $('.p-visit-nav-inside-item').each(function () { 1247 var el = '#' + $(this).data('section-id'); 1248 var $el = $('#' + $(this).data('section-id')); 1249 new ScrollMagic.Scene({ 1250 triggerElement: el, 1251 duration: $el.outerHeight() 1252 }).setClassToggle(this, "active") // add class toggle 1253 .triggerHook(0.2) // .addIndicators({name: 'indicator_'+el}) // add indicators (requires plugin) 1254 .addTo(controller); 1255 }); // build scenes 1256} 1257/*------------------------------------*\ 1258ARCHIVE PAGE 1259\*------------------------------------*/ 1260 1261/*------------------------------------*\ 1262CART PAGE 1263\*------------------------------------*/ 1264 1265/*****************************************************************************/ 1266 1267/* JQ EVENTS *********************************************/ 1268 1269/*****************************************************************************/ 1270 1271 1272$(window).on('scroll', function () {}); 1273//# sourceMappingURL=footer-bundle.js.map
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.