PageSourceSearch

https://thegravedigger.ie/wp-content/themes/salient/js/build/eleme…/nectar-sticky-media-sections.js?ver=17.4.1

js thegravedigger.ie collected 2026-10-04 13:27:57 UTC 9,502 bytes, 1 lines download raw bytes

1!function(t){"use strict";function e(t){this.$el=t,this.sections=[],this.sectionEls=[...this.$el[0].querySelectorAll(".nectar-sticky-media-section__content-section")],this.usingFrontEndEditor=!(!window.nectarDOMInfo||!window.nectarDOMInfo.usingFrontEndEditor),this.gap="20px",this.activeIndex=0,this.stackingEffect=!1,this.subtractNavHeight=this.$el[0].classList.contains("subtract-nav-height"),this.usingNavigation=!1,this.navigationButtons=[],this.effect="default",this.init()}function i(t){this.$el=t,this.$mediaSections=this.$el.find(".nectar-sticky-media-section__featured-media"),this.$contentSections=this.$el.find(".nectar-sticky-media-section__content"),this.usingFrontEndEditor=!(!window.nectarDOMInfo||!window.nectarDOMInfo.usingFrontEndEditor),this.direction="down",this.prevScroll=0,this.activeIndex=0,this.prevIndex=-1,this.timeout="",this.events()}e.prototype.init=function(){this.effectConfig(),this.navigation(),this.calculateGap(),this.createTimelines(),this.calculateOffsets(),this.events(),this.raf(),this.navHighlight()},e.prototype.effectConfig=function(){for(var t=0;t<this.$el[0].classList.length;t++){var e=this.$el[0].classList[t].match(/^effect-(.*)$/);if(e){var i=e[1];this.effect=i}}this.effects={default:{},scale:{scale:[1,.92]},scale_blur:{scale:[1,.92],filter:["blur(0px)","blur(4px)"]}},this.stackingEffect=this.$el[0].classList.contains("stacking-effect")},e.prototype.navigation=function(){if(this.$el[0].querySelector(".nectar-sticky-media-section__navigation")){this.usingNavigation=!0,this.navigationButtons=[...this.$el[0].querySelectorAll(".nectar-sticky-media-section__navigation button")];var t=this;this.$el[0].querySelectorAll(".nectar-sticky-media-section__navigation button").forEach(function(e,i){e.addEventListener("click",function(){t.scrollToSection(i)})})}},e.prototype.scrollToSection=function(t){var e=this.sections[t].offset;window.scrollTo({top:e,behavior:"smooth"})},e.prototype.events=function(){t(window).on("resize",()=>{this.calculateGap(),this.calculateOffsets()}),t(window).on("load",()=>{this.calculateGap(),this.createTimelines(),this.calculateOffsets()}),this.observe()},e.prototype.createTimelines=function(t){const e=this;this.sectionEls.forEach((t,i)=>{const n=t.querySelector(".nectar-sticky-media-section__content-section__wrap");this.sections[i]={element:t,innerElement:n,elementHeight:t.offsetHeight,timeline:anime.timeline({autoplay:!1,update:function(t){e.stackingEffect&&(100===Math.round(t.progress)?(n.style.transform="translateY(-10px)",e.sections[i-1]&&(e.sections[i-1].innerElement.style.transform="translateY(-20px)")):n.style.transform="translateY(0px)")}})},this.sections[i].timeline.add({duration:1e3,easing:"linear",targets:t,...this.effects[this.effect]})})},e.prototype.navHighlight=function(){this.usingNavigation&&(this.navigationButtons.forEach(function(t,e){t.classList.remove("active")}),this.navigationButtons[this.activeIndex].classList.add("active"))},e.prototype.calculateGap=function(){const t=/section-height-(\d+)vh/;this.$el[0].classList.forEach(e=>{const i=e.match(t);if(i){const t=i[1],e=(100-parseInt(t))/2,n=getComputedStyle(document.documentElement).getPropertyValue("--header-nav-height");n&&this.subtractNavHeight?this.gap=window.nectarDOMInfo.winH*(e/100)+parseInt(n):this.gap=window.nectarDOMInfo.winH*(e/100)}})},e.prototype.calculateOffsets=function(){const t=window.nectarDOMInfo&&window.nectarDOMInfo.scrollTop?window.nectarDOMInfo.scrollTop:window.scrollY,e=this.$el[0].getBoundingClientRect().top+t;this.sectionEls.forEach((t,i)=>{const n=this.gap;t.style.top=n+"px";this.gap;const o=e-this.gap+t.offsetHeight*i;this.sections[i].offset=o,this.sections[i].elementHeight=t.offsetHeight})},e.prototype.raf=function(){window.nectarDOMInfo.scrollTop?(this.sections.forEach((t,e)=>{if(t.offset<window.nectarDOMInfo.scrollTop&&e!==this.sections.length-1){const e=(window.nectarDOMInfo.scrollTop-t.offset)/t.elementHeight;t.timeline.seek(e*t.timeline.duration)}t.offset-t.elementHeight/2<window.nectarDOMInfo.scrollTop&&t.offset+t.elementHeight/2>window.nectarDOMInfo.scrollTop&&this.activeIndex!==e&&this.setActiveIndex(e)}),window.requestAnimationFrame(this.raf.bind(this))):window.requestAnimationFrame(this.raf.bind(this))},e.prototype.setActiveIndex=function(t){this.activeIndex=t,this.navHighlight()},e.prototype.observe=function(){var t=this;this.observer=new IntersectionObserver(function(e){e.forEach(function(e){if(e.isIntersecting){t.calculateOffsets();var i=e.target.querySelector(".nectar-sticky-media-section__media video");i&&0==i.currentTime&&t.playSectionVideo(i),t.observer.unobserve(e.target)}})},{rootMargin:"-5% 0% -5% 0%",threshold:0}
1),this.sectionEls.forEach(e=>{t.observer.observe(e)})},e.prototype.playSectionVideo=function(t){var e=this;t.readyState>=2?(t.pause(),t.currentTime=0,t.play()):setTimeout(function(){e.playSectionVideo(t)},70)};var n=i.prototype;n.events=function(){this.usingFrontEndEditor&&(this.rebuildMedia(),setTimeout(this.verticallyCenter.bind(this),1500),setTimeout(this.verticallyCenter.bind(this),3e3)),this.observe(),window.nectarDOMInfo&&window.nectarDOMInfo.usingMobileBrowser&&window.nectarDOMInfo.winW<1e3||(this.trackDirection(),this.verticallyCenter(),t(window).on("resize",this.verticallyCenter.bind(this)))},n.verticallyCenter=function(){if(window.nectarDOMInfo){var e=0;e=t("body").is('[data-header-format="left-header"]')||t("body").is('[data-hhun="1"]')||t("#header-outer").length>0&&t("#header-outer").is('[data-permanent-transparent="1"]')||t(".page-template-template-no-header-footer").length>0||t(".page-template-template-no-header").length>0?0:t("#header-space").length>0?t("#header-space").height():0,window.nectarDOMInfo.adminBarHeight>0&&(e+=window.nectarDOMInfo.adminBarHeight);var i=(window.nectarDOMInfo.winH-this.$mediaSections.height())/2+e/2;this.$el[0].style.setProperty("--nectar-sticky-media-sections-vert-y",i+"px")}},n.isSafari=function(){return-1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome")},n.trackDirection=function(){window.nectarDOMInfo.scrollTop!=this.prevScroll?(window.nectarDOMInfo.scrollTop>this.prevScroll?this.direction="down":this.direction="up",this.prevScroll=window.nectarDOMInfo.scrollTop,window.requestAnimationFrame(this.trackDirection.bind(this))):window.requestAnimationFrame(this.trackDirection.bind(this))},n.observe=function(){var e=this;this.sections=Array.from(this.$contentSections.find("> div")),"IntersectionObserver"in window&&(window.nectarDOMInfo.usingMobileBrowser&&window.nectarDOMInfo.winW<1e3?(this.mobileObserver=new IntersectionObserver(function(i){i.forEach(function(i){if(i.isIntersecting){var n=t(i.target).index(),o=e.$contentSections.find("> .nectar-sticky-media-section__content-section:eq("+n+")");if(o.find("video").length>0)0==o.find("video")[0].currentTime&&e.playSectionVideo(o.find("video")[0]);e.mobileObserver.unobserve(i.target)}})},{rootMargin:"-5% 0% -5% 0%",threshold:0}),this.$contentSections.find("> div").each(function(){e.mobileObserver.observe(t(this)[0])})):(this.observer=new IntersectionObserver(function(i){i.forEach(function(i){if(i.isIntersecting){var n=t(i.target).index();e.activeIndex=n;var o=e.$mediaSections.find("> .nectar-sticky-media-section__media-wrap:eq("+n+")"),s=e.$contentSections.find("> .nectar-sticky-media-section__content-section:eq("+n+")"),a=e.$mediaSections.find("> .nectar-sticky-media-section__media-wrap");if(e.activeIndex==e.prevIndex)return;if(clearTimeout(e.timeout),e.timeout=setTimeout(function(){a.removeClass("active"),o.addClass("active")},100),!o.hasClass("pause-trigger")||1==e.prevIndex&&0==e.activeIndex||e.prevIndex==a.length-2&&e.activeIndex==a.length-1)if(o.find("video").length>0&&window.nectarDOMInfo.winW>999&&e.playSectionVideo(o.find("video")[0]),s.find("video").length>0&&window.nectarDOMInfo.winW<1e3)0==s.find("video")[0].currentTime&&e.playSectionVideo(s.find("video")[0]);0==n||n==e.$contentSections.find("> div").length-1?o.addClass("pause-trigger"):a.removeClass("pause-trigger"),e.prevIndex=n}})},{root:this.isSafari()?null:document,rootMargin:"-40% 0% -40% 0%",threshold:0}),this.$contentSections.find("> div").each(function(){e.observer.observe(t(this)[0])})))},n.playSectionVideo=function(t){var e=this;t.readyState>=2?(t.pause(),t.currentTime=0,t.play()):setTimeout(function(){e.playSectionVideo(t)},70)},n.shouldUpdate=function(e){return!!("down"===this.direction&&!e.isIntersecting||"down"===this.direction&&e.isIntersecting&&0==t(e.target).index())||!("up"!==this.direction||!e.isIntersecting)},n.rebuildMedia=function(){var e=this,i=[];this.$contentSections.find(".nectar-sticky-media-section__content-section").each(function(e){t(this).find(".nectar-sticky-media-content__media-wrap").length>1&&t(this).find(".nectar-sticky-media-content__media-wrap").each(function(e){e>0&&t(this).remove()}),i[e]=t(this).find(".nectar-sticky-media-content__media-wrap").clone(),i[e].removeClass("nectar-sticky-media-content__media-wrap").addClass("nectar-sticky-media-section__media-wrap")}
1),e.$mediaSections.html(" "),i.forEach(function(t){e.$mediaSections.append(t)}),t(window).trigger("salient-lazyloading-image-reinit")};var o=[];function s(){o=[],t(".nectar-sticky-media-sections:not(.type--scroll-pinned-sections)").each(function(e){o[e]=new i(t(this))}),t(".nectar-sticky-media-sections.type--scroll-pinned-sections").each(function(i){o[i]=new e(t(this))})}t(document).ready(function(){s(),t(window).on("vc_reload",function(){setTimeout(s,200)})})}(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.