diff --git a/dist/js/scripts.js b/dist/js/scripts.js index 09de1963..5ce4def2 100644 --- a/dist/js/scripts.js +++ b/dist/js/scripts.js @@ -763,7 +763,7 @@ function () { _this2.updateOnScroll(); }); var mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)'); - mediaQuery.addEventListener('change', function () { + mediaQuery.addListener(function () { _this2.reduceMotion = mediaQuery.matches; _this2.updateOnScroll(); diff --git a/dist/js/scripts.min.js b/dist/js/scripts.min.js index 55ffb927..7c8a704a 100644 --- a/dist/js/scripts.min.js +++ b/dist/js/scripts.min.js @@ -1,2 +1,2 @@ /*! For license information please see scripts.min.js.LICENSE */ -!function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=15)}([function(e,t){e.exports=jQuery},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function i(e,t){for(var i=0;i0;else if("msMaxTouchPoints"in navigator)e=navigator.msMaxTouchPoints>0;else{var t=window.matchMedia&&matchMedia("(pointer:coarse)");if(t&&"(pointer:coarse)"===t.media)e=!!t.matches;else if("orientation"in window)e=!0;else{var i=navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(i)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(i)}}return e},c=i(3),d=i.n(c),u=new(function(){function e(){a()(this,e),this.props={},this.newProps={},this.renderCallbacks=[],this.resizeCallbacks=[],this.observeCallbacks=[],this.scrollCallbacks=[],this.currentMutationList=[],this.frameRendered=!0,this.useOrientation=l()&&"orientation"in window,this._init()}return h()(e,[{key:"_init",value:function(){s()(window);var e=this._updateProps.bind(this),t=this._renderLoop.bind(this);e(),s()(e),this._bindOnResize(),this._bindOnScroll(),this._bindOnLoad(),this._bindObserver(),this._bindCustomizer(),requestAnimationFrame(t)}},{key:"_bindOnResize",value:function(){var e=s()(window),t=this._updateProps.bind(this);this.useOrientation?e.on("orientationchange",(function(){e.one("resize",t)})):e.on("resize",t)}},{key:"_bindOnScroll",value:function(){s()(window).on("scroll",this._updateScroll.bind(this))}},{key:"_bindOnLoad",value:function(){s()(window).on("load",this._updateProps.bind(this))}},{key:"_bindObserver",value:function(){var e,t,i,n=this,s=(this._updateProps.bind(this),this._observeCallback.bind(this)),o=(e=function(){s(),n._updateProps(!0),n.currentMutationList=[]},t=300,i=null,function(){var n=this,s=arguments,o=function(){e.apply(n,s)};clearTimeout(i),i=setTimeout(o,t)});window.MutationObserver&&new MutationObserver((function(e){n.currentMutationList=n.currentMutationList.concat(e),o()})).observe(document.body,{childList:!0,subtree:!0})}},{key:"_bindCustomizer",value:function(){"undefined"!=typeof wp&&void 0!==wp.customize&&(void 0!==wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",this._updateProps.bind(this)),wp.customize.bind("change",this._updateProps.bind(this)))}},{key:"_updateProps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._updateSize(e),this._updateScroll(e)}},{key:"_observeCallback",value:function(){var e=this.currentMutationList;s.a.each(this.observeCallbacks,(function(t,i){i(e)}))}},{key:"_renderLoop",value:function(){this.frameRendered||(this._renderCallback(),this.frameRendered=!0),window.requestAnimationFrame(this._renderLoop.bind(this))}},{key:"_renderCallback",value:function(){var e=arguments;s.a.each(this.renderCallbacks,(function(t,i){i.apply(void 0,d()(e))}))}},{key:"_resizeCallback",value:function(){var e=arguments;s.a.each(this.resizeCallbacks,(function(t,i){i.apply(void 0,d()(e))}))}},{key:"_scrollCallback",value:function(){var e=arguments;s.a.each(this.scrollCallbacks,(function(t,i){i.apply(void 0,d()(e))}))}},{key:"_updateScroll",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.newProps=Object.assign({},this.newProps,{scrollY:window.pageYOffset,scrollX:window.pageXOffset}),this._shouldUpdate(this._scrollCallback.bind(this))}},{key:"_updateSize",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=document.body,t=document.documentElement,i=Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight),n=Math.max(t.scrollHeight,t.offsetHeight);this.newProps=Object.assign({},this.newProps,{scrollHeight:Math.max(i,n),adminBarHeight:this.getAdminBarHeight(),windowWidth:this.useOrientation&&window.screen&&window.screen.availWidth||window.innerWidth,windowHeight:this.useOrientation&&window.screen&&window.screen.availHeight||window.innerHeight}),this._shouldUpdate(this._resizeCallback.bind(this))}},{key:"_shouldUpdate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(this._hasNewProps()||t)&&(this.props=Object.assign({},this.props,this.newProps),this.newProps={},this.frameRendered=!1,"function"==typeof e&&e())}},{key:"_hasNewProps",value:function(){var e=this;return Object.keys(this.newProps).some((function(t){return e.newProps[t]!==e.props[t]}))}},{key:"getAdminBarHeight",value:function(){var e=document.getElementById("wpadminbar");return e?e.getBoundingClientRect().height:0}},{key:"registerOnResize",value:function(e){"function"==typeof e&&this.resizeCallbacks.indexOf(e)<0&&this.resizeCallbacks.push(e)}},{key:"registerOnScroll",value:function(e){"function"==typeof e&&this.scrollCallbacks.indexOf(e)<0&&this.scrollCallbacks.push(e)}},{key:"registerObserverCallback",value:function(e){"function"==typeof e&&this.observeCallbacks.indexOf(e)<0&&this.observeCallbacks.push(e)}},{key:"registerRender",value:function(e){"function"==typeof e&&this.renderCallbacks.indexOf(e)<0&&this.renderCallbacks.push(e)}},{key:"getProps",value:function(){return this.props}}]),e}()),f=function(){function e(t){var i=this;a()(this,e),this.element=t,this.progress=0,this.timeline=new TimelineMax({paused:!0,onComplete:function(){i.paused=!0}}),this.pieces=this.getMarkupPieces(),this.paused=!1,this.offset=0,this.reduceMotion=!1,this.update(),this.updateOnScroll(),this.init()}return h()(e,[{key:"init",value:function(){var e=this;u.registerOnScroll((function(){e.update()})),u.registerRender((function(){e.updateOnScroll()}));var t=window.matchMedia("(prefers-reduced-motion: reduce)");if(t.addEventListener("change",(function(){e.reduceMotion=t.matches,e.updateOnScroll()})),this.reduceMotion=t.matches,this.addIntroToTimeline(),this.timeline.addLabel("middle"),this.addOutroToTimeline(),this.timeline.addLabel("end"),this.pauseTimelineOnScroll(),this.reduceMotion){var i=this.timeline.getLabelTime("middle")/this.timeline.getLabelTime("end");this.paused=!0,this.timeline.progress(i)}else this.timeline.play()}},{key:"update",value:function(){var e=u.getProps().scrollY;this.box=this.element.getBoundingClientRect(),this.view={left:this.box.left,top:this.box.top+e,width:this.box.width,height:this.box.height}}},{key:"updateOnScroll",value:function(){var e=u.getProps(),t=e.scrollY,i=e.scrollHeight,n=e.windowHeight,s=.5*n,o=i-n-.5*s,a=this.view.top+.5*(this.box.height-n),r=Math.max(0,Math.min(a,o));if(this.start=r-.5*s,this.end=this.start+s,this.progress=(t-this.start)/(this.end-this.start),this.reduceMotion){var h=this.timeline.getLabelTime("middle")/this.timeline.getLabelTime("end");this.progress=h}this.updateTimelineOnScroll()}},{key:"updateTimelineOnScroll",value:function(){if(this.paused){var e=this.timeline.progress(),t=this.timeline.getLabelTime("middle")/this.timeline.getLabelTime("end"),i=2*(this.progress-.5)*(1-t)+t;e!==(i=Math.min(Math.max(t,i),1))&&this.timeline.progress(i)}}},{key:"getMarkupPieces",value:function(){var e=jQuery(this.element).find(".novablocks-hero__inner-container"),t=e.children().filter(".c-headline").first(),i=t.find(".c-headline__primary"),n=t.find(".c-headline__secondary"),s=t.next(".wp-block-separator"),o=s.find(".c-separator__symbol"),a=s.find(".c-separator__line"),r=s.find(".c-separator__arrow"),h=t.prevAll(),l=t.length?t.nextAll().not(s):e.children();return{headline:t,title:i,subtitle:n,separator:s,sepFlower:o,sepLine:a,sepArrow:r,othersBefore:h,othersAfter:l}}},{key:"addIntroToTimeline",value:function(){var e=this.timeline,t=u.getProps().windowWidth,i=this.pieces,n=i.headline,s=i.title,o=i.subtitle,a=i.separator,r=i.sepFlower,h=i.sepLine,l=i.sepArrow,c=i.othersBefore,f=i.othersAfter;s.length&&s.text().trim().length&&(new SplitText(s,{wordsClass:"c-headline__word"}).lines.forEach((function(i){var n=Array.from(i.children),s=[];n.forEach((function(e){s.push.apply(s,d()(e.children))})),s.forEach((function(i){var n=i.getBoundingClientRect(),o=(i.offsetWidth,2*(n.x-t/2)/t),a=400*s.length*o;e.from(i,.72,{x:a,ease:Expo.easeOut},0)}))})),e.fromTo(s,.89,{opacity:0},{opacity:1,ease:Expo.easeOut},0),e.fromTo(n,1,{y:30},{y:0,ease:Expo.easeOut},0));o.length&&(e.fromTo(o,.65,{opacity:0},{opacity:1,ease:Quint.easeOut},"-=0.65"),e.fromTo(o,.9,{y:30},{y:0,ease:Quint.easeOut},"-=0.65")),a.length&&(r.length&&(e.fromTo(r,.15,{opacity:0},{opacity:1,ease:Quint.easeOut},"-=0.6"),e.fromTo(r,.55,{rotation:-270},{rotation:0,ease:Back.easeOut},"-=0.5")),h.length&&(e.fromTo(h,.6,{width:0},{width:"42%",opacity:1,ease:Quint.easeOut},"-=0.55"),e.fromTo(a,.6,{width:0},{width:"100%",opacity:1,ease:Quint.easeOut},"-=0.6")),l.length&&e.fromTo(l,.2,{opacity:0},{opacity:1,ease:Quint.easeOut},"-=0.27")),f.length&&(e.fromTo(f,.5,{opacity:0},{opacity:1,ease:Quint.easeOut},"-=0.28"),e.fromTo(f,.75,{y:-20},{y:0},"-=0.5")),c.length&&(e.fromTo(c,.5,{opacity:0},{opacity:1,ease:Quint.easeOut},"-=0.75"),e.fromTo(c,.75,{y:20},{y:0},"-=0.75")),this.timeline=e}},{key:"addOutroToTimeline",value:function(){var e=this.pieces,t=e.title,i=e.subtitle,n=e.othersBefore,s=e.othersAfter,o=e.separator,a=e.sepLine,r=e.sepFlower,h=e.sepArrow,l=this.timeline;l.fromTo(t,1.08,{y:0},{opacity:0,y:-60,ease:Quad.easeIn},"middle"),l.to(i,1.08,{opacity:0,y:-90,ease:Quad.easeIn},"middle"),l.to(n,1.08,{y:60,opacity:0,ease:Quad.easeIn},"middle"),l.to(s,1.08,{y:60,opacity:0,ease:Quad.easeIn},"middle"),l.to(a,.86,{width:"0%",opacity:0,ease:Quad.easeIn},"-=0.94"),l.to(o,.86,{width:"0%",opacity:0,ease:Quad.easeIn},"-=0.86"),l.to(r,1,{rotation:180},"-=1.08"),l.to(r,.11,{opacity:0},"-=0.03"),l.to(h,.14,{opacity:0},"-=1.08"),this.timeline=l}},{key:"pauseTimelineOnScroll",value:function(){var e=this,t=this.timeline.getLabelTime("middle"),i=this.timeline.getLabelTime("end");this.timeline.eventCallback("onUpdate",(function(n){var s=n.time(),o=s>t,a=.5*((s-t)/(i-t))+.5>=e.progress;o&&a&&(n.pause(),e.timeline.eventCallback("onUpdate",null),e.paused=!0)}),["{self}"])}}]),e}(),p=function(){function e(t){a()(this,e),this.$element=s()(t),this.$checkbox=this.$element.find(".c-comments-toggle__checkbox"),this.$content=this.$element.find(".comments-area__content"),this.$contentWrap=this.$element.find(".comments-area__wrap"),this.$contentWrap.css("display","block"),this.$checkbox.on("change",this.onChange.bind(this)),this.checkWindowLocationComments()}return h()(e,[{key:"onChange",value:function(){this.toggle(!1)}},{key:"toggle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.$contentWrap,i=this.$checkbox.prop("checked"),n=i?this.$content.outerHeight():0;e?t.css("height",n):TweenMax.to(t,.4,{height:n,onComplete:function(){i&&t.css("height","")}})}},{key:"checkWindowLocationComments",value:function(){-1===window.location.href.indexOf("#comment")&&(this.$checkbox.prop("checked",!1),this.toggle(!0))}}]),e}(),m={offsetTargetElement:null},g=function(){function e(t,i){a()(this,e),t&&(this.element=t,this.options=Object.assign({},m,i),this.$header=s()(this.element),this.$toggle=s()(".c-menu-toggle"),this.$toggleWrap=s()(".c-menu-toggle__wrap"),this.scrolled=!1,this.inversed=!1,this.wasSticky=s()("body").is(".has-site-header-fixed"),this.offset=0,this.scrollOffset=0,this.mobileHeaderHeight=0,this.createMobileHeader(),this.onResize(),this.render(!1),u.registerOnResize(this.onResize.bind(this)),this.initialize())}return h()(e,[{key:"initialize",value:function(){this.timeline=this.getInroTimeline(),s()(".site-header__wrapper").css("transition","none"),this.$header.addClass("site-header--fixed site-header--ready"),this.$mobileHeader.addClass("site-header--fixed site-header--ready"),this.timeline.play()}},{key:"update",value:function(){this.updatePageOffset(),this.updateHeaderOffset(),this.updateMobileHeaderOffset()}},{key:"getInroTimeline",value:function(){var e=this.element,t=new TimelineMax({paused:!0}),i=s()(e).outerHeight(),n=Power4.easeOut;return t.to(e,.5,{opacity:1,ease:n},0),t.to({height:0},.5,{height:i,onUpdate:this.onHeightUpdate.bind(this),onUpdateParams:["{self}"],onComplete:function(){s()(".site-header__wrapper").css("transition","")},ease:n},0),t}},{key:"onHeightUpdate",value:function(e){this.getProps(),this.box=Object.assign(this.box,{height:e.target.height}),this.setVisibleHeaderHeight(),this.update()}},{key:"getMobileHeaderHeight",value:function(){var e=this.$mobileHeader.css("height","").outerHeight(),t=this.$toggleWrap.css("height","").outerHeight();return Math.max(e,t)}},{key:"isMobileHeaderVisibile",value:function(){return this.$mobileHeader.is(":visible")}},{key:"setVisibleHeaderHeight",value:function(){this.visibleHeaderHeight=this.isMobileHeaderVisibile()?this.mobileHeaderHeight:this.box.height}},{key:"getProps",value:function(){this.box=this.element.getBoundingClientRect(),this.scrollOffset=this.getScrollOffset(),this.mobileHeaderHeight=this.getMobileHeaderHeight()}},{key:"onResize",value:function(){var e=s()(this.element),t=e.hasClass("site-header--scrolled");e.css("transition","none"),e.removeClass("site-header--scrolled"),this.shouldMakeHeaderStatic(),this.getProps(),this.setVisibleHeaderHeight(),e.toggleClass("site-header--scrolled",t),window.requestIdleCallback?requestIdleCallback((function(){e.css("transition","")})):setTimeout((function(){e.css("transition","")}),0),this.update()}},{key:"shouldMakeHeaderStatic",value:function(){var e=s()("body"),t=u.getProps().windowHeight;this.wasSticky&&e.toggleClass("has-site-header-fixed",this.visibleHeaderHeight<.2*t)}},{key:"updateHeaderOffset",value:function(){this.element&&document.documentElement.style.setProperty("--theme-header-offset",this.offset+"px")}},{key:"updateMobileHeaderOffset",value:function(){this.$mobileHeader&&(this.$mobileHeader.css({height:this.mobileHeaderHeight,marginTop:this.offset+"px"}),s()(".site-header__inner-container").css({marginTop:this.mobileHeaderHeight}),this.$toggleWrap.css({height:this.mobileHeaderHeight,marginTop:this.offset+"px"}))}},{key:"getScrollOffset",value:function(){var e=u.getProps(),t=e.adminBarHeight,i=e.scrollY,n=this.options.offsetTargetElement;if(n){var s=n.getBoundingClientRect();return s.top+i+s.height-(t+this.offset+this.box.height/2)}return 0}},{key:"updatePageOffset",value:function(){var e=s()("#page"),t=s()(".has-hero .novablocks-hero").first().find(".novablocks-hero__foreground");e.css("paddingTop",this.visibleHeaderHeight+this.offset+"px"),t.css("marginTop",this.offset+"px")}},{key:"createMobileHeader",value:function(){if(!this.createdMobileHeader){var e=s()(".site-header--mobile");if(e.length)return this.$mobileHeader=e,void(this.createdMobileHeader=!0);this.$mobileHeader=s()('
'),s()(".c-branding").first().clone().appendTo(this.$mobileHeader),s()(".menu-item--cart").first().clone().appendTo(this.$mobileHeader),this.$mobileHeader.insertAfter(this.$toggle),this.createdMobileHeader=!0}}},{key:"render",value:function(e){if(this.element){var t=u.getProps().scrollY>this.scrollOffset;e!==this.inversed&&(this.$header.toggleClass("site-header--normal",!e),this.inversed=e),t!==this.scrolled&&(this.$header.toggleClass("site-header--scrolled",t),this.scrolled=t)}}}]),e}(),v=i(4),b=i.n(v),y=function(){function e(t,i){a()(this,e),this.element=t,this.parent=i.parent||null,this.transitionDuration=i.transitionDuration||.5,this.transitionEasing=i.transitionEasing||Power4.easeOut,this.pieces=this.getPieces(),this.id=s()(t).data("id"),this.cookieName="novablocks-announcement-"+this.id+"-disabled",this.height=0;var n=b.a.get(this.cookieName),o=s()("body").hasClass("logged-in");!n||o?(this.onResize(),u.registerOnResize(this.onResize.bind(this)),this.timeline.play(),this.bindEvents()):s()(t).remove()}return h()(e,[{key:"onResize",value:function(){var e=0,t=!1,i=!1;void 0!==this.timeline&&(e=this.timeline.progress(),t=this.timeline.isActive(),i=this.timeline.reversed(),this.timeline.clear(),this.timeline.kill(),this.pieces.wrapper.css("height","")),this.timeline=this.getTimeline(),this.timeline.progress(e),this.timeline.reversed(i),t&&this.timeline.resume()}},{key:"getPieces",value:function(){var e=s()(this.element);return{element:e,wrapper:e.find(".novablocks-announcement-bar__wrapper"),content:e.find(".novablocks-announcement-bar__content"),close:e.find(".novablocks-announcement-bar__close")}}},{key:"getTimeline",value:function(){var e=this.transitionDuration,t=this.transitionEasing,i=this.pieces,n=i.element,s=i.wrapper,o=(i.content,i.close,new TimelineMax({paused:!0})),a=s.outerHeight();return o.fromTo(n,e,{height:0},{height:a,ease:t},0),o.to({height:0},e,{height:a,onUpdate:this.onHeightUpdate.bind(this),onUpdateParams:["{self}"],ease:t},0),o}},{key:"bindEvents",value:function(){this.pieces.close.on("click",this.onClose.bind(this))}},{key:"onClose",value:function(){void 0!==this.timeline&&this.timeline.reverse()}},{key:"onHeightUpdate",value:function(e){this.height=e.target.height,this.parent&&this.parent.update()}}]),e}(),k=function(){function e(t,i){var n=this;a()(this,e);var s=Array.from(t);this.bars=s.map((function(e){return new y(e,{parent:n,transitionDuration:.5,transitionEasing:Power4.easeInOut})})),this.height=0,this.onUpdate=i.onUpdate,this.update()}return h()(e,[{key:"update",value:function(){var e=0;this.bars.forEach((function(t){e+=t.height})),this.height=e,"function"==typeof this.onUpdate&&this.onUpdate(this)}}]),e}(),w=".menu-item, .page_item",C=".menu-item-has-children, .page_item_has_children",_="hover",x=function(){function e(){a()(this,e),this.$menuItems=s()(w),this.$menuItemsWithChildren=this.$menuItems.filter(C).removeClass(_),this.$menuItemsWithChildrenLinks=this.$menuItemsWithChildren.children("a"),this.initialize()}return h()(e,[{key:"initialize",value:function(){this.onResize(),this.addSocialMenuClass(),this.initialized=!0,u.registerOnResize(this.onResize.bind(this))}},{key:"onResize",value:function(){if(window.matchMedia("only screen and (min-width: 1000px)").matches)return this.addSubMenusLeftClass(),this.initialized&&!this.desktop&&this.unbindClick(),this.initialized&&this.desktop||this.bindHoverIntent(),void(this.desktop=!0);this.removeSubMenusLeftClass(),this.initialized&&this.desktop&&this.unbindHoverIntent(),this.initialized&&!this.desktop||this.bindClick(),this.desktop=!1}},{key:"addSubMenusLeftClass",value:function(){var e=u.getProps().windowWidth;this.$menuItemsWithChildren.each((function(t,i){var n=s()(i),o=n.children(".sub-menu, .children"),a=o.outerWidth(),r=o.offset();e-r.left=o.left&&o.left+o.width>=s.left+s.width/2,r=s.top+s.height/2>=o.top&&o.top+o.height>=s.top+s.height/2,a&&r;var s,o,a,r}));n.render(s)}},{key:"initializeImages",value:function(){var e=this.showLoadedImages.bind(this);e(),u.registerObserverCallback((function(t){s.a.each(t,(function(t,i){s.a.each(i.addedNodes,(function(t,i){("img"===(i.nodeName&&i.nodeName.toLowerCase())||i.childNodes.length)&&e(i)}))}))}))}},{key:"initializeReservationForm",value:function(){u.registerObserverCallback((function(e){s.a.each(e,(function(e,t){s.a.each(t.addedNodes,(function(e,t){var i=s()(t);i.is("#ot-reservation-widget")&&i.closest(".novablocks-opentable").addClass("is-loaded")}))}))}))}},{key:"showLoadedImages",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;s()(e).imagesLoaded().progress((function(e,t){var i=t.isLoaded?"is-loaded":"is-broken";s()(t.img).addClass(i)}))}},{key:"initializeHero",value:function(){var e=document.getElementsByClassName("novablocks-hero"),t=Array.from(e);this.HeroCollection=t.map((function(e){return new f(e)})),this.firstHero=t[0]}},{key:"initializeCommentsArea",value:function(){var e=s()(".comments-area");e.length&&(this.commentsArea=new p(e.get(0)))}},{key:"initializeHeader",value:function(){var e=s()(".site-header");e.length&&(this.header=new g(e.get(0)))}},{key:"initializeNavbar",value:function(){this.navbar=new x}},{key:"initializePromoBar",value:function(){var e=document.querySelectorAll(".promo-bar .novablocks-announcement-bar");this.promoBar=new k(e,{onUpdate:this.onPromoBarUpdate.bind(this)})}},{key:"onPromoBarUpdate",value:function(e){var t=this.header,i=this.HeroCollection;t.offset=e.height,t.update(),i.forEach((function(t){t.offset=e.height,t.updateOnScroll();var i=s()(".has-parallax");i.find(".novablocks-hero__parallax");i.find(".novablocks-slideshow__parallax, .novablocks-hero__parallax, .novablocks-map__parallax").each((function(e,t){var i;(i=jQuery(t).data("rellax"))&&(i._reset(),i._cachePosition(),i._prepareElement(),i._updatePosition())}))}))}}]),e}();function O(){new H}s()((function(){var e=s()(window);s()("html").is(".wf-active")?O():e.on("wf-active",O)}))}]); \ No newline at end of file +!function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=15)}([function(e,t){e.exports=jQuery},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function i(e,t){for(var i=0;i0;else if("msMaxTouchPoints"in navigator)e=navigator.msMaxTouchPoints>0;else{var t=window.matchMedia&&matchMedia("(pointer:coarse)");if(t&&"(pointer:coarse)"===t.media)e=!!t.matches;else if("orientation"in window)e=!0;else{var i=navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(i)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(i)}}return e},c=i(3),d=i.n(c),u=new(function(){function e(){a()(this,e),this.props={},this.newProps={},this.renderCallbacks=[],this.resizeCallbacks=[],this.observeCallbacks=[],this.scrollCallbacks=[],this.currentMutationList=[],this.frameRendered=!0,this.useOrientation=l()&&"orientation"in window,this._init()}return h()(e,[{key:"_init",value:function(){s()(window);var e=this._updateProps.bind(this),t=this._renderLoop.bind(this);e(),s()(e),this._bindOnResize(),this._bindOnScroll(),this._bindOnLoad(),this._bindObserver(),this._bindCustomizer(),requestAnimationFrame(t)}},{key:"_bindOnResize",value:function(){var e=s()(window),t=this._updateProps.bind(this);this.useOrientation?e.on("orientationchange",(function(){e.one("resize",t)})):e.on("resize",t)}},{key:"_bindOnScroll",value:function(){s()(window).on("scroll",this._updateScroll.bind(this))}},{key:"_bindOnLoad",value:function(){s()(window).on("load",this._updateProps.bind(this))}},{key:"_bindObserver",value:function(){var e,t,i,n=this,s=(this._updateProps.bind(this),this._observeCallback.bind(this)),o=(e=function(){s(),n._updateProps(!0),n.currentMutationList=[]},t=300,i=null,function(){var n=this,s=arguments,o=function(){e.apply(n,s)};clearTimeout(i),i=setTimeout(o,t)});window.MutationObserver&&new MutationObserver((function(e){n.currentMutationList=n.currentMutationList.concat(e),o()})).observe(document.body,{childList:!0,subtree:!0})}},{key:"_bindCustomizer",value:function(){"undefined"!=typeof wp&&void 0!==wp.customize&&(void 0!==wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",this._updateProps.bind(this)),wp.customize.bind("change",this._updateProps.bind(this)))}},{key:"_updateProps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._updateSize(e),this._updateScroll(e)}},{key:"_observeCallback",value:function(){var e=this.currentMutationList;s.a.each(this.observeCallbacks,(function(t,i){i(e)}))}},{key:"_renderLoop",value:function(){this.frameRendered||(this._renderCallback(),this.frameRendered=!0),window.requestAnimationFrame(this._renderLoop.bind(this))}},{key:"_renderCallback",value:function(){var e=arguments;s.a.each(this.renderCallbacks,(function(t,i){i.apply(void 0,d()(e))}))}},{key:"_resizeCallback",value:function(){var e=arguments;s.a.each(this.resizeCallbacks,(function(t,i){i.apply(void 0,d()(e))}))}},{key:"_scrollCallback",value:function(){var e=arguments;s.a.each(this.scrollCallbacks,(function(t,i){i.apply(void 0,d()(e))}))}},{key:"_updateScroll",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.newProps=Object.assign({},this.newProps,{scrollY:window.pageYOffset,scrollX:window.pageXOffset}),this._shouldUpdate(this._scrollCallback.bind(this))}},{key:"_updateSize",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=document.body,t=document.documentElement,i=Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight),n=Math.max(t.scrollHeight,t.offsetHeight);this.newProps=Object.assign({},this.newProps,{scrollHeight:Math.max(i,n),adminBarHeight:this.getAdminBarHeight(),windowWidth:this.useOrientation&&window.screen&&window.screen.availWidth||window.innerWidth,windowHeight:this.useOrientation&&window.screen&&window.screen.availHeight||window.innerHeight}),this._shouldUpdate(this._resizeCallback.bind(this))}},{key:"_shouldUpdate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(this._hasNewProps()||t)&&(this.props=Object.assign({},this.props,this.newProps),this.newProps={},this.frameRendered=!1,"function"==typeof e&&e())}},{key:"_hasNewProps",value:function(){var e=this;return Object.keys(this.newProps).some((function(t){return e.newProps[t]!==e.props[t]}))}},{key:"getAdminBarHeight",value:function(){var e=document.getElementById("wpadminbar");return e?e.getBoundingClientRect().height:0}},{key:"registerOnResize",value:function(e){"function"==typeof e&&this.resizeCallbacks.indexOf(e)<0&&this.resizeCallbacks.push(e)}},{key:"registerOnScroll",value:function(e){"function"==typeof e&&this.scrollCallbacks.indexOf(e)<0&&this.scrollCallbacks.push(e)}},{key:"registerObserverCallback",value:function(e){"function"==typeof e&&this.observeCallbacks.indexOf(e)<0&&this.observeCallbacks.push(e)}},{key:"registerRender",value:function(e){"function"==typeof e&&this.renderCallbacks.indexOf(e)<0&&this.renderCallbacks.push(e)}},{key:"getProps",value:function(){return this.props}}]),e}()),f=function(){function e(t){var i=this;a()(this,e),this.element=t,this.progress=0,this.timeline=new TimelineMax({paused:!0,onComplete:function(){i.paused=!0}}),this.pieces=this.getMarkupPieces(),this.paused=!1,this.offset=0,this.reduceMotion=!1,this.update(),this.updateOnScroll(),this.init()}return h()(e,[{key:"init",value:function(){var e=this;u.registerOnScroll((function(){e.update()})),u.registerRender((function(){e.updateOnScroll()}));var t=window.matchMedia("(prefers-reduced-motion: reduce)");if(t.addListener((function(){e.reduceMotion=t.matches,e.updateOnScroll()})),this.reduceMotion=t.matches,this.addIntroToTimeline(),this.timeline.addLabel("middle"),this.addOutroToTimeline(),this.timeline.addLabel("end"),this.pauseTimelineOnScroll(),this.reduceMotion){var i=this.timeline.getLabelTime("middle")/this.timeline.getLabelTime("end");this.paused=!0,this.timeline.progress(i)}else this.timeline.play()}},{key:"update",value:function(){var e=u.getProps().scrollY;this.box=this.element.getBoundingClientRect(),this.view={left:this.box.left,top:this.box.top+e,width:this.box.width,height:this.box.height}}},{key:"updateOnScroll",value:function(){var e=u.getProps(),t=e.scrollY,i=e.scrollHeight,n=e.windowHeight,s=.5*n,o=i-n-.5*s,a=this.view.top+.5*(this.box.height-n),r=Math.max(0,Math.min(a,o));if(this.start=r-.5*s,this.end=this.start+s,this.progress=(t-this.start)/(this.end-this.start),this.reduceMotion){var h=this.timeline.getLabelTime("middle")/this.timeline.getLabelTime("end");this.progress=h}this.updateTimelineOnScroll()}},{key:"updateTimelineOnScroll",value:function(){if(this.paused){var e=this.timeline.progress(),t=this.timeline.getLabelTime("middle")/this.timeline.getLabelTime("end"),i=2*(this.progress-.5)*(1-t)+t;e!==(i=Math.min(Math.max(t,i),1))&&this.timeline.progress(i)}}},{key:"getMarkupPieces",value:function(){var e=jQuery(this.element).find(".novablocks-hero__inner-container"),t=e.children().filter(".c-headline").first(),i=t.find(".c-headline__primary"),n=t.find(".c-headline__secondary"),s=t.next(".wp-block-separator"),o=s.find(".c-separator__symbol"),a=s.find(".c-separator__line"),r=s.find(".c-separator__arrow"),h=t.prevAll(),l=t.length?t.nextAll().not(s):e.children();return{headline:t,title:i,subtitle:n,separator:s,sepFlower:o,sepLine:a,sepArrow:r,othersBefore:h,othersAfter:l}}},{key:"addIntroToTimeline",value:function(){var e=this.timeline,t=u.getProps().windowWidth,i=this.pieces,n=i.headline,s=i.title,o=i.subtitle,a=i.separator,r=i.sepFlower,h=i.sepLine,l=i.sepArrow,c=i.othersBefore,f=i.othersAfter;s.length&&s.text().trim().length&&(new SplitText(s,{wordsClass:"c-headline__word"}).lines.forEach((function(i){var n=Array.from(i.children),s=[];n.forEach((function(e){s.push.apply(s,d()(e.children))})),s.forEach((function(i){var n=i.getBoundingClientRect(),o=(i.offsetWidth,2*(n.x-t/2)/t),a=400*s.length*o;e.from(i,.72,{x:a,ease:Expo.easeOut},0)}))})),e.fromTo(s,.89,{opacity:0},{opacity:1,ease:Expo.easeOut},0),e.fromTo(n,1,{y:30},{y:0,ease:Expo.easeOut},0));o.length&&(e.fromTo(o,.65,{opacity:0},{opacity:1,ease:Quint.easeOut},"-=0.65"),e.fromTo(o,.9,{y:30},{y:0,ease:Quint.easeOut},"-=0.65")),a.length&&(r.length&&(e.fromTo(r,.15,{opacity:0},{opacity:1,ease:Quint.easeOut},"-=0.6"),e.fromTo(r,.55,{rotation:-270},{rotation:0,ease:Back.easeOut},"-=0.5")),h.length&&(e.fromTo(h,.6,{width:0},{width:"42%",opacity:1,ease:Quint.easeOut},"-=0.55"),e.fromTo(a,.6,{width:0},{width:"100%",opacity:1,ease:Quint.easeOut},"-=0.6")),l.length&&e.fromTo(l,.2,{opacity:0},{opacity:1,ease:Quint.easeOut},"-=0.27")),f.length&&(e.fromTo(f,.5,{opacity:0},{opacity:1,ease:Quint.easeOut},"-=0.28"),e.fromTo(f,.75,{y:-20},{y:0},"-=0.5")),c.length&&(e.fromTo(c,.5,{opacity:0},{opacity:1,ease:Quint.easeOut},"-=0.75"),e.fromTo(c,.75,{y:20},{y:0},"-=0.75")),this.timeline=e}},{key:"addOutroToTimeline",value:function(){var e=this.pieces,t=e.title,i=e.subtitle,n=e.othersBefore,s=e.othersAfter,o=e.separator,a=e.sepLine,r=e.sepFlower,h=e.sepArrow,l=this.timeline;l.fromTo(t,1.08,{y:0},{opacity:0,y:-60,ease:Quad.easeIn},"middle"),l.to(i,1.08,{opacity:0,y:-90,ease:Quad.easeIn},"middle"),l.to(n,1.08,{y:60,opacity:0,ease:Quad.easeIn},"middle"),l.to(s,1.08,{y:60,opacity:0,ease:Quad.easeIn},"middle"),l.to(a,.86,{width:"0%",opacity:0,ease:Quad.easeIn},"-=0.94"),l.to(o,.86,{width:"0%",opacity:0,ease:Quad.easeIn},"-=0.86"),l.to(r,1,{rotation:180},"-=1.08"),l.to(r,.11,{opacity:0},"-=0.03"),l.to(h,.14,{opacity:0},"-=1.08"),this.timeline=l}},{key:"pauseTimelineOnScroll",value:function(){var e=this,t=this.timeline.getLabelTime("middle"),i=this.timeline.getLabelTime("end");this.timeline.eventCallback("onUpdate",(function(n){var s=n.time(),o=s>t,a=.5*((s-t)/(i-t))+.5>=e.progress;o&&a&&(n.pause(),e.timeline.eventCallback("onUpdate",null),e.paused=!0)}),["{self}"])}}]),e}(),p=function(){function e(t){a()(this,e),this.$element=s()(t),this.$checkbox=this.$element.find(".c-comments-toggle__checkbox"),this.$content=this.$element.find(".comments-area__content"),this.$contentWrap=this.$element.find(".comments-area__wrap"),this.$contentWrap.css("display","block"),this.$checkbox.on("change",this.onChange.bind(this)),this.checkWindowLocationComments()}return h()(e,[{key:"onChange",value:function(){this.toggle(!1)}},{key:"toggle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.$contentWrap,i=this.$checkbox.prop("checked"),n=i?this.$content.outerHeight():0;e?t.css("height",n):TweenMax.to(t,.4,{height:n,onComplete:function(){i&&t.css("height","")}})}},{key:"checkWindowLocationComments",value:function(){-1===window.location.href.indexOf("#comment")&&(this.$checkbox.prop("checked",!1),this.toggle(!0))}}]),e}(),m={offsetTargetElement:null},g=function(){function e(t,i){a()(this,e),t&&(this.element=t,this.options=Object.assign({},m,i),this.$header=s()(this.element),this.$toggle=s()(".c-menu-toggle"),this.$toggleWrap=s()(".c-menu-toggle__wrap"),this.scrolled=!1,this.inversed=!1,this.wasSticky=s()("body").is(".has-site-header-fixed"),this.offset=0,this.scrollOffset=0,this.mobileHeaderHeight=0,this.createMobileHeader(),this.onResize(),this.render(!1),u.registerOnResize(this.onResize.bind(this)),this.initialize())}return h()(e,[{key:"initialize",value:function(){this.timeline=this.getInroTimeline(),s()(".site-header__wrapper").css("transition","none"),this.$header.addClass("site-header--fixed site-header--ready"),this.$mobileHeader.addClass("site-header--fixed site-header--ready"),this.timeline.play()}},{key:"update",value:function(){this.updatePageOffset(),this.updateHeaderOffset(),this.updateMobileHeaderOffset()}},{key:"getInroTimeline",value:function(){var e=this.element,t=new TimelineMax({paused:!0}),i=s()(e).outerHeight(),n=Power4.easeOut;return t.to(e,.5,{opacity:1,ease:n},0),t.to({height:0},.5,{height:i,onUpdate:this.onHeightUpdate.bind(this),onUpdateParams:["{self}"],onComplete:function(){s()(".site-header__wrapper").css("transition","")},ease:n},0),t}},{key:"onHeightUpdate",value:function(e){this.getProps(),this.box=Object.assign(this.box,{height:e.target.height}),this.setVisibleHeaderHeight(),this.update()}},{key:"getMobileHeaderHeight",value:function(){var e=this.$mobileHeader.css("height","").outerHeight(),t=this.$toggleWrap.css("height","").outerHeight();return Math.max(e,t)}},{key:"isMobileHeaderVisibile",value:function(){return this.$mobileHeader.is(":visible")}},{key:"setVisibleHeaderHeight",value:function(){this.visibleHeaderHeight=this.isMobileHeaderVisibile()?this.mobileHeaderHeight:this.box.height}},{key:"getProps",value:function(){this.box=this.element.getBoundingClientRect(),this.scrollOffset=this.getScrollOffset(),this.mobileHeaderHeight=this.getMobileHeaderHeight()}},{key:"onResize",value:function(){var e=s()(this.element),t=e.hasClass("site-header--scrolled");e.css("transition","none"),e.removeClass("site-header--scrolled"),this.shouldMakeHeaderStatic(),this.getProps(),this.setVisibleHeaderHeight(),e.toggleClass("site-header--scrolled",t),window.requestIdleCallback?requestIdleCallback((function(){e.css("transition","")})):setTimeout((function(){e.css("transition","")}),0),this.update()}},{key:"shouldMakeHeaderStatic",value:function(){var e=s()("body"),t=u.getProps().windowHeight;this.wasSticky&&e.toggleClass("has-site-header-fixed",this.visibleHeaderHeight<.2*t)}},{key:"updateHeaderOffset",value:function(){this.element&&document.documentElement.style.setProperty("--theme-header-offset",this.offset+"px")}},{key:"updateMobileHeaderOffset",value:function(){this.$mobileHeader&&(this.$mobileHeader.css({height:this.mobileHeaderHeight,marginTop:this.offset+"px"}),s()(".site-header__inner-container").css({marginTop:this.mobileHeaderHeight}),this.$toggleWrap.css({height:this.mobileHeaderHeight,marginTop:this.offset+"px"}))}},{key:"getScrollOffset",value:function(){var e=u.getProps(),t=e.adminBarHeight,i=e.scrollY,n=this.options.offsetTargetElement;if(n){var s=n.getBoundingClientRect();return s.top+i+s.height-(t+this.offset+this.box.height/2)}return 0}},{key:"updatePageOffset",value:function(){var e=s()("#page"),t=s()(".has-hero .novablocks-hero").first().find(".novablocks-hero__foreground");e.css("paddingTop",this.visibleHeaderHeight+this.offset+"px"),t.css("marginTop",this.offset+"px")}},{key:"createMobileHeader",value:function(){if(!this.createdMobileHeader){var e=s()(".site-header--mobile");if(e.length)return this.$mobileHeader=e,void(this.createdMobileHeader=!0);this.$mobileHeader=s()('
'),s()(".c-branding").first().clone().appendTo(this.$mobileHeader),s()(".menu-item--cart").first().clone().appendTo(this.$mobileHeader),this.$mobileHeader.insertAfter(this.$toggle),this.createdMobileHeader=!0}}},{key:"render",value:function(e){if(this.element){var t=u.getProps().scrollY>this.scrollOffset;e!==this.inversed&&(this.$header.toggleClass("site-header--normal",!e),this.inversed=e),t!==this.scrolled&&(this.$header.toggleClass("site-header--scrolled",t),this.scrolled=t)}}}]),e}(),v=i(4),b=i.n(v),y=function(){function e(t,i){a()(this,e),this.element=t,this.parent=i.parent||null,this.transitionDuration=i.transitionDuration||.5,this.transitionEasing=i.transitionEasing||Power4.easeOut,this.pieces=this.getPieces(),this.id=s()(t).data("id"),this.cookieName="novablocks-announcement-"+this.id+"-disabled",this.height=0;var n=b.a.get(this.cookieName),o=s()("body").hasClass("logged-in");!n||o?(this.onResize(),u.registerOnResize(this.onResize.bind(this)),this.timeline.play(),this.bindEvents()):s()(t).remove()}return h()(e,[{key:"onResize",value:function(){var e=0,t=!1,i=!1;void 0!==this.timeline&&(e=this.timeline.progress(),t=this.timeline.isActive(),i=this.timeline.reversed(),this.timeline.clear(),this.timeline.kill(),this.pieces.wrapper.css("height","")),this.timeline=this.getTimeline(),this.timeline.progress(e),this.timeline.reversed(i),t&&this.timeline.resume()}},{key:"getPieces",value:function(){var e=s()(this.element);return{element:e,wrapper:e.find(".novablocks-announcement-bar__wrapper"),content:e.find(".novablocks-announcement-bar__content"),close:e.find(".novablocks-announcement-bar__close")}}},{key:"getTimeline",value:function(){var e=this.transitionDuration,t=this.transitionEasing,i=this.pieces,n=i.element,s=i.wrapper,o=(i.content,i.close,new TimelineMax({paused:!0})),a=s.outerHeight();return o.fromTo(n,e,{height:0},{height:a,ease:t},0),o.to({height:0},e,{height:a,onUpdate:this.onHeightUpdate.bind(this),onUpdateParams:["{self}"],ease:t},0),o}},{key:"bindEvents",value:function(){this.pieces.close.on("click",this.onClose.bind(this))}},{key:"onClose",value:function(){void 0!==this.timeline&&this.timeline.reverse()}},{key:"onHeightUpdate",value:function(e){this.height=e.target.height,this.parent&&this.parent.update()}}]),e}(),k=function(){function e(t,i){var n=this;a()(this,e);var s=Array.from(t);this.bars=s.map((function(e){return new y(e,{parent:n,transitionDuration:.5,transitionEasing:Power4.easeInOut})})),this.height=0,this.onUpdate=i.onUpdate,this.update()}return h()(e,[{key:"update",value:function(){var e=0;this.bars.forEach((function(t){e+=t.height})),this.height=e,"function"==typeof this.onUpdate&&this.onUpdate(this)}}]),e}(),w=".menu-item, .page_item",C=".menu-item-has-children, .page_item_has_children",_="hover",x=function(){function e(){a()(this,e),this.$menuItems=s()(w),this.$menuItemsWithChildren=this.$menuItems.filter(C).removeClass(_),this.$menuItemsWithChildrenLinks=this.$menuItemsWithChildren.children("a"),this.initialize()}return h()(e,[{key:"initialize",value:function(){this.onResize(),this.addSocialMenuClass(),this.initialized=!0,u.registerOnResize(this.onResize.bind(this))}},{key:"onResize",value:function(){if(window.matchMedia("only screen and (min-width: 1000px)").matches)return this.addSubMenusLeftClass(),this.initialized&&!this.desktop&&this.unbindClick(),this.initialized&&this.desktop||this.bindHoverIntent(),void(this.desktop=!0);this.removeSubMenusLeftClass(),this.initialized&&this.desktop&&this.unbindHoverIntent(),this.initialized&&!this.desktop||this.bindClick(),this.desktop=!1}},{key:"addSubMenusLeftClass",value:function(){var e=u.getProps().windowWidth;this.$menuItemsWithChildren.each((function(t,i){var n=s()(i),o=n.children(".sub-menu, .children"),a=o.outerWidth(),r=o.offset();e-r.left=o.left&&o.left+o.width>=s.left+s.width/2,r=s.top+s.height/2>=o.top&&o.top+o.height>=s.top+s.height/2,a&&r;var s,o,a,r}));n.render(s)}},{key:"initializeImages",value:function(){var e=this.showLoadedImages.bind(this);e(),u.registerObserverCallback((function(t){s.a.each(t,(function(t,i){s.a.each(i.addedNodes,(function(t,i){("img"===(i.nodeName&&i.nodeName.toLowerCase())||i.childNodes.length)&&e(i)}))}))}))}},{key:"initializeReservationForm",value:function(){u.registerObserverCallback((function(e){s.a.each(e,(function(e,t){s.a.each(t.addedNodes,(function(e,t){var i=s()(t);i.is("#ot-reservation-widget")&&i.closest(".novablocks-opentable").addClass("is-loaded")}))}))}))}},{key:"showLoadedImages",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;s()(e).imagesLoaded().progress((function(e,t){var i=t.isLoaded?"is-loaded":"is-broken";s()(t.img).addClass(i)}))}},{key:"initializeHero",value:function(){var e=document.getElementsByClassName("novablocks-hero"),t=Array.from(e);this.HeroCollection=t.map((function(e){return new f(e)})),this.firstHero=t[0]}},{key:"initializeCommentsArea",value:function(){var e=s()(".comments-area");e.length&&(this.commentsArea=new p(e.get(0)))}},{key:"initializeHeader",value:function(){var e=s()(".site-header");e.length&&(this.header=new g(e.get(0)))}},{key:"initializeNavbar",value:function(){this.navbar=new x}},{key:"initializePromoBar",value:function(){var e=document.querySelectorAll(".promo-bar .novablocks-announcement-bar");this.promoBar=new k(e,{onUpdate:this.onPromoBarUpdate.bind(this)})}},{key:"onPromoBarUpdate",value:function(e){var t=this.header,i=this.HeroCollection;t.offset=e.height,t.update(),i.forEach((function(t){t.offset=e.height,t.updateOnScroll();var i=s()(".has-parallax");i.find(".novablocks-hero__parallax");i.find(".novablocks-slideshow__parallax, .novablocks-hero__parallax, .novablocks-map__parallax").each((function(e,t){var i;(i=jQuery(t).data("rellax"))&&(i._reset(),i._cachePosition(),i._prepareElement(),i._updatePosition())}))}))}}]),e}();function O(){new H}s()((function(){var e=s()(window);s()("html").is(".wf-active")?O():e.on("wf-active",O)}))}]); \ No newline at end of file diff --git a/src/components/hero.js b/src/components/hero.js index 2e33cad7..6c73ae56 100644 --- a/src/components/hero.js +++ b/src/components/hero.js @@ -27,7 +27,7 @@ export default class Hero { const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)'); - mediaQuery.addEventListener( 'change', () => { + mediaQuery.addListener( () => { this.reduceMotion = mediaQuery.matches; this.updateOnScroll(); } );