PageSourceSearch

https://www.realm-guard.com/cdn/shop/t/12/assets/animations.js?v=170190223081824744871787848719

js realm-guard.com collected 2026-10-10 02:24:07 UTC 6,224 bytes, 2 lines download raw bytes

1const PARALLAX_SELECTOR="[data-animation]",DISABLED_CLASS="is-disabled",MAIN_CONTENT_CLASS="main-content",SECTION_CLASS="shopify-section",PARALLAX_ATTR="data-animation",INTENSITY_ATTR="data-animation-intensity",STATIC_ATTR="data-parallax-static",SINGLE_ATTR="data-parallax-single",DISABLE_MOBILE_ATTR="data-parallax-disable-on-mobile";function getOrientation(){return window.innerWidth>window.innerHeight?"landscape":"portrait"}class ParallaxHandler{constructor(container){this.container=container,this.percentage=0,this.percentageFull=0,this.animation=container.getAttribute("data-animation"),this.disableOnMobile=container.hasAttribute("data-animation-disable-on-mobile"),this.viewportHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0),this.orientation=this.getOrientation(),this.scrollEvent=()=>this.updateParallax(),this.resizeEvent=()=>this.updateHeight(),requestAnimationFrame(()=>{this.containerHeight=container.offsetHeight,this.footerOffset=.15*this.containerHeight,this.cachedPosition=this.footerOffset,this.cachedPercentage=0,this.init()})}init(){this.updateParallax(),document.addEventListener("theme:scroll",this.scrollEvent),document.addEventListener("theme:resize",this.resizeEvent),document.addEventListener("theme:load",this.resizeEvent)}unload(){document.removeEventListener("theme:scroll",this.scrollEvent),document.removeEventListener("theme:resize",this.resizeEvent),document.addEventListener("theme:load",this.resizeEvent)}updateParallax(){if(this.container.classList.contains("is-disabled")||this.disableOnMobile&&this.isMobile())return;const scrollTop=Math.round(window.scrollY),scrollBottom=scrollTop+this.viewportHeight;let containerTop=Math.round(this.container.getBoundingClientRect().top+scrollTop);if(this.animation==="footer"){let sibling=document.getElementById("MainContent");sibling&&(containerTop=Math.round(sibling.getBoundingClientRect().bottom+scrollTop))}const containerHeight=this.container.offsetHeight;if(containerTop<scrollBottom&&containerTop+containerHeight>=scrollTop){const visibleBottom=scrollBottom-containerTop;switch(this.percentage=100*(visibleBottom-containerHeight/2)/this.viewportHeight,this.percentageFull=Number(visibleBottom/containerHeight).toFixed(2),this.percentageVisible=Number(100*visibleBottom/(this.viewportHeight+containerHeight)).toFixed(2),this.animation){case"circle":this.animateCircleText();break;case"horizontal":case"vertical":case"diagonal":this.animateOverlappingImages();break;case"offset-ltr":case"offset-rtl":this.applyOffsetX();break;case"zoom-on-scroll":this.zoomInOut();break;case"fade-in":this.fadeInOnScroll();break;case"blur":this.blurOutUntilCenter();break;case"footer":this.animateFooter();break}}}applyOffsetX(){const isStatic=this.container.hasAttribute("data-animation-static"),intensity=this.container.getAttribute("data-animation-intensity")||100;let baseOffset=this.animation==="offset-ltr"?intensity:0;isStatic&&(baseOffset=intensity/2);const direction=this.animation==="offset-ltr"?1:-1,offset=intensity*this.percentageVisible/100-baseOffset;let finalOffset=Number(offset*direction).toFixed(2);finalOffset=Math.max(0,Math.min(1,finalOffset));const clamp=(n,min,max)=>Math.max(min,Math.min(max,n)),value=1-clamp((this.percentageVisible-40)/60,0,1),scaleValue=1.5-clamp(this.percentageVisible,0,100)/100;this.container.style.setProperty("--offsetX",`${value*1.2}`),this.container.style.setProperty("--scale",`${scaleValue*1.5}`)}animateCircleText(){const rotateAmount=70*this.percentage/100*1;this.percentage>0&&this.container.style.setProperty("--rotate",`${35+rotateAmount}deg`)}animateOverlappingImages(){const intensity=.25*this.container.getAttribute("data-animation-intensity"),halfIntensity=intensity/2,isSingle=this.container.hasAttribute("data-animation-single"),value=intensity*this.percentage/100;let xPrimary=0,yPrimary=0,xSecondary=0,ySecondary=0;["horizontal","diagonal"].includes(this.animation)&&(xPrimary=-halfIntensity+value,xSecondary=halfIntensity-value),["vertical","diagonal"].includes(this.animation)&&(yPrimary=halfIntensity-value,ySecondary=-halfIntensity+value),this.container.style.setProperty("--transformX-primary",`${xPrimary}%`),this.container.style.setProperty("--transformY-primary",`${yPrimary}%`),isSingle||(this.container.style.setProperty("--transformX-secondary",`${xSecondary}%`),this.container.style.setProperty("--transformY-secondary",`${ySecondary}%`))}animateFooter(){const offset=this.footerOffset*this.percentageFull,percentage=Number(offset/this.footerOffset*100).toFixed(2);let newY=Number(this.footerOffset-offset).toFixed(2);this.percentageFull>=1&&(newY=0),this.cachedPercentage!==percentage&&(this.container.style.setProperty("--transformY",`${newY}`),this.cachedPercentage=percentage,this.cachedPosition=newY)}zoomInOut(){const scale=1+.2*this.percentageVisible/100,clampedScale=Math.max(scale,1);this.container.style.setProperty("--scale",clampedScale.toFixed(4))}
1fadeInOnScroll(){const viewportCenter=this.viewportHeight/2,rect=this.container.getBoundingClientRect(),start=this.viewportHeight,end=viewportCenter-rect.height/2,current=rect.top;let progress=(start-current)/(start-end);progress=Math.max(0,Math.min(1,progress)),this.container.style.setProperty("--opacity",progress.toFixed(4))}blurOutUntilCenter(){const viewportCenter=this.viewportHeight/2,rect=this.container.getBoundingClientRect(),start=this.viewportHeight,end=viewportCenter-rect.height/2,current=rect.top;let progress=(start-current)/(start-end);progress=Math.max(0,Math.min(1,progress));const blur=(1-progress)*10;this.container.style.setProperty("--blur",`${blur.toFixed(2)}px`)}updateHeight(){const isDesktop=matchMedia("(min-width: 1024px)").matches;(this.orientation!==this.getOrientation()||isDesktop)&&(this.viewportHeight=Math.round(Math.max(document.documentElement.clientHeight,window.innerHeight||0)),this.containerHeight=this.container.offsetHeight,this.orientation=this.getOrientation())}getOrientation(){return window.innerWidth>window.innerHeight?"landscape":"portrait"}isMobile(){return/Mobi|Android/i.test(navigator.userAgent)}}window.ParallaxHandler=ParallaxHandler;
2//# sourceMappingURL=/cdn/shop/t/12/assets/animations.js.map?v=170190223081824744871787848719

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.